1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

Merge branch '3.2.x'

This commit is contained in:
Derky
2018-01-11 21:03:20 +01:00
2 changed files with 20 additions and 11 deletions

View File

@@ -910,10 +910,15 @@ class phpbb_functional_test_case extends phpbb_test_case
* status code. This assertion tries to catch that.
*
* @param int $status_code Expected status code
* @return null
* @return void
*/
static public function assert_response_status_code($status_code = 200)
{
if ($status_code != self::$client->getResponse()->getStatus() &&
preg_match('/^5[0-9]{2}/', self::$client->getResponse()->getStatus()))
{
self::fail("Encountered unexpected server error:\n" . self::$client->getResponse()->getContent());
}
self::assertEquals($status_code, self::$client->getResponse()->getStatus(), 'HTTP status code does not match');
}