1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-03 15:27:42 +02:00

[ticket/11202] Add a heuristic function to check for response success.

This tries to account for php sending fatal errors with 200 status code.

PHPBB3-11202
This commit is contained in:
Oleg Pudeyev
2012-11-15 08:19:40 -05:00
parent 8b156c3d83
commit 4ab178f3ef

View File

@@ -229,4 +229,19 @@ class phpbb_functional_test_case extends phpbb_test_case
return call_user_func_array('sprintf', $args); return call_user_func_array('sprintf', $args);
} }
/**
* Heuristic function to check that the response is success.
*
* When php decides to die with a fatal error, it still sends 200 OK
* status code. This assertion tries to catch that.
*
* @param string $message Optional failure message
*/
public function assert_response_success($message = null)
{
$this->assertEquals(200, $this->client->getResponse()->getStatus());
$content = $this->client->getResponse()->getContent();
$this->assertNotContains('Fatal error:', $content);
}
} }