aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2015-06-16 11:10:22 +0200
committerMarc Alexander <admin@m-a-styles.de>2015-06-16 11:10:22 +0200
commit2503723e2fff11c2a14bf62f6e261cebd9ffcf06 (patch)
treea1f65035d4ba98900c06b48d09fb5bd4ad877c6b
parentc6308ee7c0681b5c99185f009e7a59f1c7c8f1d5 (diff)
downloadforums-2503723e2fff11c2a14bf62f6e261cebd9ffcf06.tar
forums-2503723e2fff11c2a14bf62f6e261cebd9ffcf06.tar.gz
forums-2503723e2fff11c2a14bf62f6e261cebd9ffcf06.tar.bz2
forums-2503723e2fff11c2a14bf62f6e261cebd9ffcf06.tar.xz
forums-2503723e2fff11c2a14bf62f6e261cebd9ffcf06.zip
[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
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index 844caa8f54..d403831626 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -854,15 +854,15 @@ class phpbb_functional_test_case extends phpbb_test_case
*/
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
$content = self::$client->getResponse()->getContent();
self::assertNotContains('[phpBB Debug]', $content);
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)
{
- if ($status_code !== false)
- {
- self::assert_response_status_code($status_code);
- }
-
// Any output before the xml opening means there was an error
$content = self::$client->getResponse()->getContent();
self::assertNotContains('[phpBB Debug]', $content);
self::assertStringStartsWith('<?xml', trim($content), 'Output found before XML specification.');
+
+ if ($status_code !== false)
+ {
+ self::assert_response_status_code($status_code);
+ }
}
/**