aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_framework
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2012-11-15 19:48:46 +0100
committerAndreas Fischer <bantu@phpbb.com>2012-11-15 19:48:46 +0100
commit14a42a97a856830f5856428a46017b0bf6b1588d (patch)
tree29f5731fb46378a5bc6aa5d84d76e7d1a22f5a57 /tests/test_framework
parent27594130b0cb5d99a3350deeec6e6c6886f30155 (diff)
parentaf7ab2d3ac287db1a2c9ed623e21393cb429203f (diff)
downloadforums-14a42a97a856830f5856428a46017b0bf6b1588d.tar
forums-14a42a97a856830f5856428a46017b0bf6b1588d.tar.gz
forums-14a42a97a856830f5856428a46017b0bf6b1588d.tar.bz2
forums-14a42a97a856830f5856428a46017b0bf6b1588d.tar.xz
forums-14a42a97a856830f5856428a46017b0bf6b1588d.zip
Merge remote-tracking branch 'p/ticket/11202-olympus' into develop-olympus
* p/ticket/11202-olympus: [ticket/11202] Custom message does not make sense here, delete it. [ticket/11202] Check response success before content assertions. [ticket/11202] Add a heuristic function to check for response success.
Diffstat (limited to 'tests/test_framework')
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index bd248a662e..7c03f874e9 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -205,7 +205,7 @@ class phpbb_functional_test_case extends phpbb_test_case
$login = $this->client->submit($form, array('username' => 'admin', 'password' => 'admin'));
$cookies = $this->cookieJar->all();
-
+
// The session id is stored in a cookie that ends with _sid - we assume there is only one such cookie
foreach ($cookies as $cookie);
{
@@ -252,4 +252,19 @@ class phpbb_functional_test_case extends phpbb_test_case
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.
+ *
+ * @return null
+ */
+ public function assert_response_success()
+ {
+ $this->assertEquals(200, $this->client->getResponse()->getStatus());
+ $content = $this->client->getResponse()->getContent();
+ $this->assertNotContains('Fatal error:', $content);
+ }
}