Start adding basic login infrastructure (still needs styling)
[gitphp.git] / test / auth / UserListTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
 * Userlist test class
 *
 * @author Christopher Han <xiphux@gmail.com>
 * @copyright Copyright (c) 2012 Christopher Han
 * @package GitPHP
 * @subpackage Test\Auth
 */
class GitPHP_UserListTest extends PHPUnit_Framework_TestCase
{
        public function testUserList()
        {
                $userlist = new GitPHP_UserList();
 
                $this->assertEquals(0, $userlist->GetCount());
 
                $user = new GitPHP_User('username', 'password');
                $userlist->AddUser($user);
 
                $this->assertEquals(1, $userlist->GetCount());
 
                $user2 = $userlist->GetUser('username');
                $this->assertInstanceOf('GitPHP_User', $user2);
                $this->assertEquals('username', $user2->GetUsername());
                $this->assertEquals('password', $user2->GetPassword());
 
                $userlist->RemoveUser('username');
                $this->assertNull($userlist->GetUser('username'));
                $this->assertEquals(0, $userlist->GetCount());
        }
}
 
comments