diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-05-31 16:45:06 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2013-05-31 16:45:06 +0200 |
commit | 8c4670eeb1264e2535021e400d2cf7e2c2028010 (patch) | |
tree | 9c1a92f4f2711f09c9816ffde93c05b25e0c7ce5 /tests/functional/extension_controller_test.php | |
parent | 5c046b9493d05981264c18b304d217fc75eda9e2 (diff) | |
parent | 6af5262fcccae3f3e651348a20dbbd8a78e191aa (diff) | |
download | forums-8c4670eeb1264e2535021e400d2cf7e2c2028010.tar forums-8c4670eeb1264e2535021e400d2cf7e2c2028010.tar.gz forums-8c4670eeb1264e2535021e400d2cf7e2c2028010.tar.bz2 forums-8c4670eeb1264e2535021e400d2cf7e2c2028010.tar.xz forums-8c4670eeb1264e2535021e400d2cf7e2c2028010.zip |
Merge branch 'ticket/11568' into ticket/11568-develop
* ticket/11568:
[ticket/11568] Split status code and html debug assertion into two methods
[ticket/11568] Add comma at end of array key-value couple
[ticket/11568] Invert logic for asserting the response
[ticket/11568] Use static calls for static methods
Conflicts:
tests/test_framework/phpbb_functional_test_case.php
Diffstat (limited to 'tests/functional/extension_controller_test.php')
-rw-r--r-- | tests/functional/extension_controller_test.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php index 28805e7b5d..a09035cb2b 100644 --- a/tests/functional/extension_controller_test.php +++ b/tests/functional/extension_controller_test.php @@ -6,6 +6,7 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ +require_once dirname(__FILE__) . '/../../phpBB/includes/db/db_tools.php'; /** * @group functional @@ -90,7 +91,8 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c public function test_foo_bar() { $this->phpbb_extension_manager->enable('foo/bar'); - $crawler = $this->request('GET', 'app.php?controller=foo/bar'); + $crawler = self::request('GET', 'app.php?controller=foo/bar', array(), false); + self::assert_response_status_code(); $this->assertContains("foo/bar controller handle() method", $crawler->filter('body')->text()); $this->phpbb_extension_manager->purge('foo/bar'); } @@ -101,7 +103,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c public function test_controller_with_template() { $this->phpbb_extension_manager->enable('foo/bar'); - $crawler = $this->request('GET', 'app.php?controller=foo/template'); + $crawler = self::request('GET', 'app.php?controller=foo/template'); $this->assertContains("I am a variable", $crawler->filter('#content')->text()); $this->phpbb_extension_manager->purge('foo/bar'); } @@ -113,8 +115,8 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c public function test_missing_argument() { $this->phpbb_extension_manager->enable('foo/bar'); - $crawler = $this->request('GET', 'app.php?controller=foo/baz', array(), true); - $this->assert_response_success(500); + $crawler = self::request('GET', 'app.php?controller=foo/baz', array(), false); + $this->assert_response_html(500); $this->assertContains('Missing value for argument #1: test in class phpbb_ext_foo_bar_controller:baz', $crawler->filter('body')->text()); $this->phpbb_extension_manager->purge('foo/bar'); } @@ -125,8 +127,8 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c public function test_exception_should_result_in_500_status_code() { $this->phpbb_extension_manager->enable('foo/bar'); - $crawler = $this->request('GET', 'app.php?controller=foo/exception', array(), true); - $this->assert_response_success(500); + $crawler = self::request('GET', 'app.php?controller=foo/exception', array(), false); + $this->assert_response_html(500); $this->assertContains('Exception thrown from foo/exception route', $crawler->filter('body')->text()); $this->phpbb_extension_manager->purge('foo/bar'); } @@ -142,8 +144,8 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c */ public function test_error_ext_disabled_or_404() { - $crawler = $this->request('GET', 'app.php?controller=does/not/exist', array(), true); - $this->assert_response_success(404); + $crawler = self::request('GET', 'app.php?controller=does/not/exist', array(), false); + $this->assert_response_html(404); $this->assertContains('No route found for "GET /does/not/exist"', $crawler->filter('body')->text()); } } |