public function testUser() { $user = new GitPHP_User('user', 'pass'); $this->assertEquals('user', $user->GetUsername()); $this->assertEquals('pass', $user->GetPassword()); $user->SetUsername('user2'); $this->assertEquals('user2', $user->GetUsername()); $user->SetPassword('pass2'); $this->assertEquals('pass2', $user->GetPassword()); }
/** * Add a user * * @param GitPHP_User $user user */ public function AddUser($user) { if (!$user) { return; } $username = $user->GetUsername(); $password = $user->GetPassword(); if (empty($username) || empty($password)) { return; } $this->users[$username] = $user; }