From 8eb739bb910fb91737c6ce65f244eb9a3ac8f35c Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 23 Aug 2015 13:15:59 -0400 Subject: Add Gitlab authentication --- tests/units/UserTest.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'tests/units/UserTest.php') 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'; -- cgit v1.2.3