diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2012-12-09 21:02:31 +0100 |
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2012-12-09 21:02:31 +0100 |
| commit | 1aae72961a3205a8487218b6d69361c43a1297d6 (patch) | |
| tree | 3096a599c14c88084f782022f002ed84224ccf8b /tests/test_framework/phpbb_functional_test_case.php | |
| parent | 26bde05a30c7111b57621a37d86425aa69d74263 (diff) | |
| parent | 3fe381eed561e724700b21789e28ea3efb1f7ef9 (diff) | |
| download | forums-1aae72961a3205a8487218b6d69361c43a1297d6.tar forums-1aae72961a3205a8487218b6d69361c43a1297d6.tar.gz forums-1aae72961a3205a8487218b6d69361c43a1297d6.tar.bz2 forums-1aae72961a3205a8487218b6d69361c43a1297d6.tar.xz forums-1aae72961a3205a8487218b6d69361c43a1297d6.zip | |
Merge branch 'develop' into feature/avatars
Conflicts:
phpBB/install/database_update.php
Diffstat (limited to 'tests/test_framework/phpbb_functional_test_case.php')
| -rw-r--r-- | tests/test_framework/phpbb_functional_test_case.php | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 41edb3e6af..16e1ccaff9 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -51,6 +51,7 @@ class phpbb_functional_test_case extends phpbb_test_case // that were added in other tests are gone $this->lang = array(); $this->add_lang('common'); + $this->purge_cache(); } public function request($method, $path) @@ -331,15 +332,30 @@ class phpbb_functional_test_case extends phpbb_test_case return call_user_func_array('sprintf', $args); } - /** - * assertContains for language strings - * - * @param string $needle Search string - * @param string $haystack Search this - * @param string $message Optional failure message - */ - public function assertContainsLang($needle, $haystack, $message = null) - { - $this->assertContains(html_entity_decode($this->lang($needle), ENT_QUOTES), $haystack, $message); - } + /** + * assertContains for language strings + * + * @param string $needle Search string + * @param string $haystack Search this + * @param string $message Optional failure message + */ + public function assertContainsLang($needle, $haystack, $message = null) + { + $this->assertContains(html_entity_decode($this->lang($needle), ENT_QUOTES), $haystack, $message); + } + + /** + * 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); + } } |
