diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-10-03 18:22:06 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-10-03 18:22:06 -0400 |
commit | c9e317872004cdd7e58a9474d17a1b85888c5873 (patch) | |
tree | 5f21bd427d12a65c9b0577c50ca1bee94bfdee44 /tests/units/Model/UserTest.php | |
parent | 260c8515c507b8c339fdbe1a10b0f13792eac09d (diff) |
Fix issue when unlinking Gitlab account
Diffstat (limited to 'tests/units/Model/UserTest.php')
-rw-r--r-- | tests/units/Model/UserTest.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/units/Model/UserTest.php b/tests/units/Model/UserTest.php index ac16a300..85631cd6 100644 --- a/tests/units/Model/UserTest.php +++ b/tests/units/Model/UserTest.php @@ -250,7 +250,7 @@ class UserTest extends Base ); $u->prepare($input); - $this->assertEquals(array(), $input); + $this->assertEquals(array('gitlab_id' => null), $input); $input = array( 'gitlab_id' => 'something', @@ -325,8 +325,11 @@ class UserTest extends Base public function testUpdate() { $u = new User($this->container); - $this->assertNotFalse($u->create(array('username' => 'toto', 'password' => '123456', 'name' => 'Toto'))); + $this->assertEquals(2, $u->create(array('username' => 'toto', 'password' => '123456', 'name' => 'Toto'))); + $this->assertEquals(3, $u->create(array('username' => 'plop', 'gitlab_id' => '123'))); + $this->assertTrue($u->update(array('id' => 2, 'username' => 'biloute'))); + $this->assertTrue($u->update(array('id' => 3, 'gitlab_id' => ''))); $user = $u->getById(2); $this->assertNotFalse($user); @@ -335,6 +338,10 @@ class UserTest extends Base $this->assertEquals('Toto', $user['name']); $this->assertEquals(0, $user['is_admin']); $this->assertEquals(0, $user['is_ldap_user']); + + $user = $u->getById(3); + $this->assertNotEmpty($user); + $this->assertEquals(null, $user['gitlab_id']); } public function testRemove() |