mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/12952] Check obvious errors before status in functional tests
This will change the output from just saying that the status did not match the expected one to actually showing any errors before complaining about a possible difference in the status code. PHPBB3-12952
This commit is contained in:
parent
c6308ee7c0
commit
2503723e2f
1 changed files with 10 additions and 10 deletions
|
@ -854,15 +854,15 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
*/
|
*/
|
||||||
static public function assert_response_html($status_code = 200)
|
static public function assert_response_html($status_code = 200)
|
||||||
{
|
{
|
||||||
if ($status_code !== false)
|
|
||||||
{
|
|
||||||
self::assert_response_status_code($status_code);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Any output before the doc type means there was an error
|
// Any output before the doc type means there was an error
|
||||||
$content = self::$client->getResponse()->getContent();
|
$content = self::$client->getResponse()->getContent();
|
||||||
self::assertNotContains('[phpBB Debug]', $content);
|
self::assertNotContains('[phpBB Debug]', $content);
|
||||||
self::assertStringStartsWith('<!DOCTYPE', trim($content), 'Output found before DOCTYPE specification.');
|
self::assertStringStartsWith('<!DOCTYPE', trim($content), 'Output found before DOCTYPE specification.');
|
||||||
|
|
||||||
|
if ($status_code !== false)
|
||||||
|
{
|
||||||
|
self::assert_response_status_code($status_code);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -875,15 +875,15 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
*/
|
*/
|
||||||
static public function assert_response_xml($status_code = 200)
|
static public function assert_response_xml($status_code = 200)
|
||||||
{
|
{
|
||||||
if ($status_code !== false)
|
|
||||||
{
|
|
||||||
self::assert_response_status_code($status_code);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Any output before the xml opening means there was an error
|
// Any output before the xml opening means there was an error
|
||||||
$content = self::$client->getResponse()->getContent();
|
$content = self::$client->getResponse()->getContent();
|
||||||
self::assertNotContains('[phpBB Debug]', $content);
|
self::assertNotContains('[phpBB Debug]', $content);
|
||||||
self::assertStringStartsWith('<?xml', trim($content), 'Output found before XML specification.');
|
self::assertStringStartsWith('<?xml', trim($content), 'Output found before XML specification.');
|
||||||
|
|
||||||
|
if ($status_code !== false)
|
||||||
|
{
|
||||||
|
self::assert_response_status_code($status_code);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue