Cast the header value to string as PHPUnit can't handle it being NULL.

This commit is contained in:
Simon Welsh 2011-10-29 14:13:34 +13:00
parent 82da8a0718
commit 2c0257e9b9

View File

@ -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"
);