From e8fdc1545a54e87541efa404265abbd16dc31ead Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 10 Mar 2014 10:48:19 +0100 Subject: [ticket/12261] Add a functional test for redirect after using login_box() PHPBB3-12261 --- tests/functional/extension_controller_test.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'tests/functional/extension_controller_test.php') diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php index 4725301141..bba11291af 100644 --- a/tests/functional/extension_controller_test.php +++ b/tests/functional/extension_controller_test.php @@ -112,12 +112,28 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c $this->assertContains('No route found for "GET /does/not/exist"', $crawler->filter('body')->text()); } + /** + * Check the redirect after using he login_box() form + */ + public function test_login_redirect() + { + $this->phpbb_extension_manager->enable('foo/bar'); + $crawler = self::request('GET', 'app.php/foo/login_redirect'); + $this->assertContainsLang('LOGIN', $crawler->filter('h2')->text()); + $form = $crawler->selectButton('login')->form(array( + 'username' => 'admin', + 'password' => 'adminadmin', + )); + $crawler = self::submit($form); + $this->assertContains("I am a variable", $crawler->filter('#content')->text(), 'Unsuccessful redirect after using login_box()'); + $this->phpbb_extension_manager->purge('foo/bar'); + } + /** * Check the output of a controller using the template system */ public function test_redirect() { - $filesystem = new \phpbb\filesystem(); $this->phpbb_extension_manager->enable('foo/bar'); $crawler = self::request('GET', 'app.php/foo/redirect'); -- cgit v1.2.1