diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-11-25 22:07:24 -0500 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-11-25 22:07:24 -0500 |
commit | 38070aec79416e529ff85205ee7def06216dd8ff (patch) | |
tree | 3b06705bce2cf6ad38f93840045db35ce881d4cf /tests/units/UserTest.php | |
parent | 93df72bd4daa14c44e30f0a22553d3445506506b (diff) |
Remove private projects when a user is deleted
Diffstat (limited to 'tests/units/UserTest.php')
-rw-r--r-- | tests/units/UserTest.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/units/UserTest.php b/tests/units/UserTest.php index 6e535a35..c4094ea2 100644 --- a/tests/units/UserTest.php +++ b/tests/units/UserTest.php @@ -141,5 +141,20 @@ class UserTest extends Base $task = $tf->getById(1); $this->assertEquals(1, $task['id']); $this->assertEquals(0, $task['owner_id']); + + // Make sure that private projects are also removed + $user_id1 = $u->create(array('username' => 'toto1', 'password' => '123456', 'name' => 'Toto')); + $user_id2 = $u->create(array('username' => 'toto2', 'password' => '123456', 'name' => 'Toto')); + $this->assertNotFalse($user_id1); + $this->assertNotFalse($user_id2); + $this->assertEquals(2, $p->create(array('name' => 'Private project #1', 'is_private' => 1), $user_id1, true)); + $this->assertEquals(3, $p->create(array('name' => 'Private project #2', 'is_private' => 1), $user_id2, true)); + + $this->assertTrue($u->remove($user_id1)); + + $this->assertNotEmpty($p->getById(1)); + $this->assertNotEmpty($p->getById(3)); + + $this->assertEmpty($p->getById(2)); } } |