From 2c0257e9b9127fa9e1341a11fec82411c59da90f Mon Sep 17 00:00:00 2001 From: Simon Welsh Date: Sat, 29 Oct 2011 14:13:34 +1300 Subject: [PATCH] Cast the header value to string as PHPUnit can't handle it being NULL. --- tests/security/SecurityTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/security/SecurityTest.php b/tests/security/SecurityTest.php index 9bbbe89d3..b5aea47be 100644 --- a/tests/security/SecurityTest.php +++ b/tests/security/SecurityTest.php @@ -142,7 +142,7 @@ class SecurityTest extends FunctionalTest { // Test external redirect $response = $this->doTestLoginForm('noexpiry@silverstripe.com', '1nitialPassword', 'http://myspoofedhost.com'); - $this->assertNotRegExp('/^' . preg_quote('http://myspoofedhost.com', '/') . '/', $response->getHeader('Location'), + $this->assertNotRegExp('/^' . preg_quote('http://myspoofedhost.com', '/') . '/', (string)$response->getHeader('Location'), "Redirection to external links in login form BackURL gets prevented as a measure against spoofing attacks" );