diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-01-04 22:34:59 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-01-04 22:34:59 -0500 |
commit | 99d27e0ce4f48454808d2325cb407b5b35cf5e88 (patch) | |
tree | 3c518cf08499890d46b9d2f65724d46617e1fc67 /tests/units | |
parent | d1d04d6feeebeba2aea5333d7a4229fcec799f75 (diff) |
Allow users to override the timezone and the language
Diffstat (limited to 'tests/units')
-rw-r--r-- | tests/units/TaskPermissionTest.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/units/TaskPermissionTest.php b/tests/units/TaskPermissionTest.php index 4b0b2b61..0bf68ce3 100644 --- a/tests/units/TaskPermissionTest.php +++ b/tests/units/TaskPermissionTest.php @@ -9,6 +9,7 @@ use Model\TaskPermission; use Model\Project; use Model\Category; use Model\User; +use Model\UserSession; class TaskPermissionTest extends Base { @@ -19,6 +20,7 @@ class TaskPermissionTest extends Base $tp = new TaskPermission($this->container); $p = new Project($this->container); $u = new User($this->container); + $us = new UserSession($this->container); $this->assertNotFalse($u->create(array('username' => 'toto', 'password' => '123456'))); $this->assertNotFalse($u->create(array('username' => 'toto2', 'password' => '123456'))); @@ -31,7 +33,7 @@ class TaskPermissionTest extends Base // User #1 can remove everything $user = $u->getbyId(1); $this->assertNotEmpty($user); - $u->updateSession($user); + $us->refresh($user); $task = $tf->getbyId(1); $this->assertNotEmpty($task); @@ -40,7 +42,7 @@ class TaskPermissionTest extends Base // User #2 can't remove the task #1 $user = $u->getbyId(2); $this->assertNotEmpty($user); - $u->updateSession($user); + $us->refresh($user); $task = $tf->getbyId(1); $this->assertNotEmpty($task); @@ -49,7 +51,7 @@ class TaskPermissionTest extends Base // User #1 can remove everything $user = $u->getbyId(1); $this->assertNotEmpty($user); - $u->updateSession($user); + $us->refresh($user); $task = $tf->getbyId(2); $this->assertNotEmpty($task); @@ -58,7 +60,7 @@ class TaskPermissionTest extends Base // User #2 can remove his own task $user = $u->getbyId(2); $this->assertNotEmpty($user); - $u->updateSession($user); + $us->refresh($user); $task = $tf->getbyId(2); $this->assertNotEmpty($task); @@ -67,7 +69,7 @@ class TaskPermissionTest extends Base // User #1 can remove everything $user = $u->getbyId(1); $this->assertNotEmpty($user); - $u->updateSession($user); + $us->refresh($user); $task = $tf->getbyId(3); $this->assertNotEmpty($task); @@ -76,7 +78,7 @@ class TaskPermissionTest extends Base // User #2 can't remove the task #3 $user = $u->getbyId(2); $this->assertNotEmpty($user); - $u->updateSession($user); + $us->refresh($user); $task = $tf->getbyId(3); $this->assertNotEmpty($task); @@ -85,7 +87,7 @@ class TaskPermissionTest extends Base // User #1 can remove everything $user = $u->getbyId(1); $this->assertNotEmpty($user); - $u->updateSession($user); + $us->refresh($user); $task = $tf->getbyId(4); $this->assertNotEmpty($task); @@ -94,7 +96,7 @@ class TaskPermissionTest extends Base // User #2 can't remove the task #4 $user = $u->getbyId(2); $this->assertNotEmpty($user); - $u->updateSession($user); + $us->refresh($user); $task = $tf->getbyId(4); $this->assertNotEmpty($task); |