diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-08-23 13:15:59 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-08-23 13:15:59 -0400 |
commit | 8eb739bb910fb91737c6ce65f244eb9a3ac8f35c (patch) | |
tree | db615be44d945a8dc1880a1238a381ec6534dfa2 /tests/units/UserTest.php | |
parent | 297c11e48e1cf18e5773a7463721d862dfd6063d (diff) |
Add Gitlab authentication
Diffstat (limited to 'tests/units/UserTest.php')
-rw-r--r-- | tests/units/UserTest.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/units/UserTest.php b/tests/units/UserTest.php index e3fa5f76..e52f2849 100644 --- a/tests/units/UserTest.php +++ b/tests/units/UserTest.php @@ -47,6 +47,36 @@ class UserTest extends Base $this->assertEmpty($u->getByEmail('')); } + public function testGetByGitlabId() + { + $u = new User($this->container); + $this->assertNotFalse($u->create(array('username' => 'user1', 'password' => '123456', 'gitlab_id' => '1234'))); + $this->assertNotFalse($u->create(array('username' => 'user2', 'password' => '123456', 'gitlab_id' => ''))); + + $this->assertNotEmpty($u->getByGitlabId('1234')); + $this->assertEmpty($u->getByGitlabId('')); + } + + public function testGetByGithubId() + { + $u = new User($this->container); + $this->assertNotFalse($u->create(array('username' => 'user1', 'password' => '123456', 'github_id' => 'plop'))); + $this->assertNotFalse($u->create(array('username' => 'user2', 'password' => '123456', 'github_id' => ''))); + + $this->assertNotEmpty($u->getByGithubId('plop')); + $this->assertEmpty($u->getByGithubId('')); + } + + public function testGetByGoogleId() + { + $u = new User($this->container); + $this->assertNotFalse($u->create(array('username' => 'user1', 'password' => '123456', 'google_id' => '1234'))); + $this->assertNotFalse($u->create(array('username' => 'user2', 'password' => '123456', 'google_id' => ''))); + + $this->assertNotEmpty($u->getByGoogleId('1234')); + $this->assertEmpty($u->getByGoogleId('')); + } + public function testPassword() { $password = 'test123'; |