1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

[ticket/12261] Add a functional test for redirect after using login_box()

PHPBB3-12261
This commit is contained in:
Joas Schilling
2014-03-10 10:48:19 +01:00
parent b876c07377
commit e8fdc1545a
5 changed files with 38 additions and 5 deletions

View File

@@ -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');