[ticket/233] Properly redirect to portal after login

We need to provide a proper path with controller helper and path helper.
A simple path to the portal is not enough, as we redirect from ucp.php.
Therefore, we need to remove the web root path from the URL to the portal.

B3P-233
This commit is contained in:
Marc Alexander
2014-04-06 19:33:45 +02:00
parent 1b18cfc104
commit 8db374bcd8
3 changed files with 38 additions and 4 deletions

View File

@@ -38,4 +38,22 @@ class phpbb_functional_portal_redirect_test extends \board3\portal\tests\testfra
$this->assertContains('Board3 Portal', $crawler->text());
}
}
public function test_redirect_after_login()
{
// Make sure we are logged out
$this->logout();
$crawler = self::request('GET', 'app.php/portal?sid=' . $this->sid);
$form = $crawler->selectButton('Login')->form();
$form->setValues(array(
'username' => 'admin',
'password' => 'adminadmin',
));
$crawler = self::submit($form);
// Should be redirected to portal and logged in
$this->assertContains('Site Admin', $crawler->text());
}
}