mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-11 19:24:01 +02:00
[ticket/10972] Tweak user addition.
Always add users, do not keep track of which users have been added. The tests should know whether users they want exist or not. Use more unique user names in tests for robustness. Added some more assertions here and there. PHPBB3-10972
This commit is contained in:
@@ -18,16 +18,18 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
|
||||
|
||||
// check for logout link
|
||||
$crawler = $this->request('GET', 'index.php');
|
||||
$this->assert_response_success();
|
||||
$this->assertContains($this->lang('LOGOUT_USER', 'admin'), $crawler->filter('.navbar')->text());
|
||||
}
|
||||
|
||||
public function test_login_other()
|
||||
{
|
||||
$this->create_user('user');
|
||||
$this->login('user');
|
||||
$this->create_user('anothertestuser');
|
||||
$this->login('anothertestuser');
|
||||
$crawler = $this->request('GET', 'index.php');
|
||||
$this->assertContains('user', $crawler->filter('.icon-logout')->text());
|
||||
$this->delete_user('user');
|
||||
$this->assert_response_success();
|
||||
$this->assertContains('anothertestuser', $crawler->filter('.icon-logout')->text());
|
||||
$this->delete_user('anothertestuser');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -40,10 +42,12 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
|
||||
|
||||
// logout
|
||||
$crawler = $this->request('GET', 'ucp.php?sid=' . $this->sid . '&mode=logout');
|
||||
$this->assert_response_success();
|
||||
$this->assertContains($this->lang('LOGOUT_REDIRECT'), $crawler->filter('#message')->text());
|
||||
|
||||
// look for a register link, which should be visible only when logged out
|
||||
$crawler = $this->request('GET', 'index.php');
|
||||
$this->assert_response_success();
|
||||
$this->assertContains($this->lang('REGISTER'), $crawler->filter('.navbar')->text());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user