mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/10758] Add a test for acp login.
PHPBB3-10758
This commit is contained in:
parent
e82833d4b8
commit
ff83580af1
2 changed files with 15 additions and 2 deletions
|
@ -49,4 +49,15 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
|
||||||
$this->assert_response_success();
|
$this->assert_response_success();
|
||||||
$this->assertContains($this->lang('REGISTER'), $crawler->filter('.navbar')->text());
|
$this->assertContains($this->lang('REGISTER'), $crawler->filter('.navbar')->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_acp_login()
|
||||||
|
{
|
||||||
|
$this->login();
|
||||||
|
$this->admin_login();
|
||||||
|
|
||||||
|
// check that we are logged in
|
||||||
|
$crawler = $this->request('GET', 'adm/index.php?sid=' . $this->sid);
|
||||||
|
$this->assert_response_success();
|
||||||
|
$this->assertContains($this->lang('ADMIN_PANEL'), $crawler->filter('h1')->text());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -323,7 +323,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
* Login to the ACP
|
* Login to the ACP
|
||||||
* You must run login() before calling this.
|
* You must run login() before calling this.
|
||||||
*/
|
*/
|
||||||
protected function admin_login()
|
protected function admin_login($username = 'admin')
|
||||||
{
|
{
|
||||||
$this->add_lang('acp/common');
|
$this->add_lang('acp/common');
|
||||||
|
|
||||||
|
@ -343,7 +343,9 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
{
|
{
|
||||||
if (strpos($field, 'password_') === 0)
|
if (strpos($field, 'password_') === 0)
|
||||||
{
|
{
|
||||||
$login = $this->client->submit($form, array('username' => 'admin', $field => 'admin'));
|
$crawler = $this->client->submit($form, array('username' => $username, $field => $username));
|
||||||
|
$this->assert_response_success();
|
||||||
|
$this->assertContains($this->lang('LOGIN_ADMIN_SUCCESS'), $crawler->filter('html')->text());
|
||||||
|
|
||||||
$cookies = $this->cookieJar->all();
|
$cookies = $this->cookieJar->all();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue