mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-05 05:55:15 +02:00
[ticket/10972] Moved tests into appropriate places and added comments
PHPBB3-10972
This commit is contained in:
parent
7005002069
commit
cafc7feca1
@ -21,6 +21,15 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
|
||||
$this->assertContains($this->lang('LOGOUT_USER', 'admin'), $crawler->filter('.navbar')->text());
|
||||
}
|
||||
|
||||
public function test_login_other()
|
||||
{
|
||||
$this->create_user('user');
|
||||
$this->login('user');
|
||||
$crawler = $this->request('GET', 'index.php');
|
||||
$this->assertContains('user', $crawler->filter('.icon-logout')->text());
|
||||
$this->delete_user('user');
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends test_login
|
||||
*/
|
||||
|
@ -1,45 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package testing
|
||||
* @copyright (c) 2012 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @group functional
|
||||
*/
|
||||
class phpbb_functional_new_user_test extends phpbb_functional_test_case
|
||||
{
|
||||
public function test_create_user()
|
||||
{
|
||||
$this->create_user('user');
|
||||
$this->login();
|
||||
$crawler = $this->request('GET', 'memberlist.php?sid=' . $this->sid);
|
||||
$this->assertContains('user', $crawler->filter('#memberlist tr')->eq(1)->text());
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends test_create_user
|
||||
*/
|
||||
public function test_delete_user()
|
||||
{
|
||||
$this->delete_user('user');
|
||||
$this->login();
|
||||
$crawler = $this->request('GET', 'memberlist.php?sid=' . $this->sid);
|
||||
$this->assertEquals(2, $crawler->filter('#memberlist tr')->count());
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends test_delete_user
|
||||
*/
|
||||
public function test_login_other()
|
||||
{
|
||||
$this->create_user('user');
|
||||
$this->login('user');
|
||||
$crawler = $this->request('GET', 'index.php');
|
||||
$this->assertContains('user', $crawler->filter('.icon-logout')->text());
|
||||
$this->delete_user('user');
|
||||
}
|
||||
}
|
@ -197,6 +197,10 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
/**
|
||||
* Creates a new user with limited permissions
|
||||
*
|
||||
* Note that creating two users with the same name results in undefined
|
||||
* login behaviour. Always call delete_user after running a test that
|
||||
* requires create_user.
|
||||
*
|
||||
* @param string $username Also doubles up as the user's password
|
||||
*/
|
||||
protected function create_user($username)
|
||||
|
Loading…
x
Reference in New Issue
Block a user