[ticket/11215] Use new URL structure for controllers

In tests, the old app.php?controller=foo structure was used. Instead
it should be app.php/foo.

PHPBB3-11215
This commit is contained in:
David King 2013-08-31 14:51:28 -07:00
parent ffee476047
commit 73859da481

View file

@ -52,7 +52,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
public function test_foo_bar() public function test_foo_bar()
{ {
$this->phpbb_extension_manager->enable('foo/bar'); $this->phpbb_extension_manager->enable('foo/bar');
$crawler = self::request('GET', 'app.php?controller=foo/bar', array(), false); $crawler = self::request('GET', 'app.php/foo/bar', array(), false);
self::assert_response_status_code(); self::assert_response_status_code();
$this->assertContains("foo/bar controller handle() method", $crawler->filter('body')->text()); $this->assertContains("foo/bar controller handle() method", $crawler->filter('body')->text());
$this->phpbb_extension_manager->purge('foo/bar'); $this->phpbb_extension_manager->purge('foo/bar');
@ -64,7 +64,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
public function test_controller_with_template() public function test_controller_with_template()
{ {
$this->phpbb_extension_manager->enable('foo/bar'); $this->phpbb_extension_manager->enable('foo/bar');
$crawler = self::request('GET', 'app.php?controller=foo/template'); $crawler = self::request('GET', 'app.php/foo/template');
$this->assertContains("I am a variable", $crawler->filter('#content')->text()); $this->assertContains("I am a variable", $crawler->filter('#content')->text());
$this->phpbb_extension_manager->purge('foo/bar'); $this->phpbb_extension_manager->purge('foo/bar');
} }
@ -76,7 +76,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
public function test_missing_argument() public function test_missing_argument()
{ {
$this->phpbb_extension_manager->enable('foo/bar'); $this->phpbb_extension_manager->enable('foo/bar');
$crawler = self::request('GET', 'app.php?controller=foo/baz', array(), false); $crawler = self::request('GET', 'app.php/foo/baz', array(), false);
$this->assert_response_html(500); $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->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'); $this->phpbb_extension_manager->purge('foo/bar');
@ -88,7 +88,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
public function test_exception_should_result_in_500_status_code() public function test_exception_should_result_in_500_status_code()
{ {
$this->phpbb_extension_manager->enable('foo/bar'); $this->phpbb_extension_manager->enable('foo/bar');
$crawler = self::request('GET', 'app.php?controller=foo/exception', array(), false); $crawler = self::request('GET', 'app.php/foo/exception', array(), false);
$this->assert_response_html(500); $this->assert_response_html(500);
$this->assertContains('Exception thrown from foo/exception route', $crawler->filter('body')->text()); $this->assertContains('Exception thrown from foo/exception route', $crawler->filter('body')->text());
$this->phpbb_extension_manager->purge('foo/bar'); $this->phpbb_extension_manager->purge('foo/bar');
@ -105,7 +105,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
*/ */
public function test_error_ext_disabled_or_404() public function test_error_ext_disabled_or_404()
{ {
$crawler = self::request('GET', 'app.php?controller=does/not/exist', array(), false); $crawler = self::request('GET', 'app.php/does/not/exist', array(), false);
$this->assert_response_html(404); $this->assert_response_html(404);
$this->assertContains('No route found for "GET /does/not/exist"', $crawler->filter('body')->text()); $this->assertContains('No route found for "GET /does/not/exist"', $crawler->filter('body')->text());
} }