diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-11-15 12:50:33 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-11-15 12:50:33 -0500 |
commit | a675271ad71b7713d1b33bdba3c51b2b04813229 (patch) | |
tree | e54d8a95e16ca521193b9fd5a5eb071aa2910823 /tests/units/Helper/UserHelperTest.php | |
parent | 2fc402f6733573627ad25394d109b9f848ef04f6 (diff) |
Rewrite of session management
Diffstat (limited to 'tests/units/Helper/UserHelperTest.php')
-rw-r--r-- | tests/units/Helper/UserHelperTest.php | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/tests/units/Helper/UserHelperTest.php b/tests/units/Helper/UserHelperTest.php index 4cc9fa65..eba977ee 100644 --- a/tests/units/Helper/UserHelperTest.php +++ b/tests/units/Helper/UserHelperTest.php @@ -6,7 +6,6 @@ use Kanboard\Helper\User; use Kanboard\Model\Project; use Kanboard\Model\ProjectPermission; use Kanboard\Model\User as UserModel; -use Kanboard\Core\Session; class UserHelperTest extends Base { @@ -24,7 +23,6 @@ class UserHelperTest extends Base $p = new Project($this->container); $pp = new ProjectPermission($this->container); $u = new UserModel($this->container); - $session = new Session; // We create our user $this->assertEquals(2, $u->create(array('username' => 'unittest', 'password' => 'unittest'))); @@ -36,7 +34,7 @@ class UserHelperTest extends Base $this->assertFalse($pp->isManager(1, 2)); // We fake a session for him - $session['user'] = array( + $this->container['sessionStorage']->user = array( 'id' => 2, 'is_admin' => false, 'is_project_admin' => true, @@ -51,7 +49,6 @@ class UserHelperTest extends Base $p = new Project($this->container); $pp = new ProjectPermission($this->container); $u = new UserModel($this->container); - $session = new Session; // We create our user $this->assertEquals(2, $u->create(array('username' => 'unittest', 'password' => 'unittest'))); @@ -63,7 +60,7 @@ class UserHelperTest extends Base $this->assertFalse($pp->isManager(1, 2)); // We fake a session for him - $session['user'] = array( + $this->container['sessionStorage']->user = array( 'id' => 2, 'is_admin' => false, 'is_project_admin' => false, @@ -78,7 +75,6 @@ class UserHelperTest extends Base $p = new Project($this->container); $pp = new ProjectPermission($this->container); $u = new UserModel($this->container); - $session = new Session; // We create our user $this->assertEquals(2, $u->create(array('username' => 'unittest', 'password' => 'unittest'))); @@ -90,7 +86,7 @@ class UserHelperTest extends Base $this->assertTrue($pp->isManager(1, 2)); // We fake a session for him - $session['user'] = array( + $this->container['sessionStorage']->user = array( 'id' => 2, 'is_admin' => false, 'is_project_admin' => false, @@ -105,7 +101,6 @@ class UserHelperTest extends Base $p = new Project($this->container); $pp = new ProjectPermission($this->container); $u = new UserModel($this->container); - $session = new Session; // We create our user $this->assertEquals(2, $u->create(array('username' => 'unittest', 'password' => 'unittest'))); @@ -117,7 +112,7 @@ class UserHelperTest extends Base $this->assertFalse($pp->isManager(1, 2)); // We fake a session for him - $session['user'] = array( + $this->container['sessionStorage']->user = array( 'id' => 2, 'is_admin' => false, 'is_project_admin' => true, @@ -132,7 +127,6 @@ class UserHelperTest extends Base $p = new Project($this->container); $pp = new ProjectPermission($this->container); $u = new UserModel($this->container); - $session = new Session; // We create our user $this->assertEquals(2, $u->create(array('username' => 'unittest', 'password' => 'unittest'))); @@ -144,7 +138,7 @@ class UserHelperTest extends Base $this->assertFalse($pp->isManager(1, 2)); // We fake a session for him - $session['user'] = array( + $this->container['sessionStorage']->user = array( 'id' => 2, 'is_admin' => false, 'is_project_admin' => false, @@ -159,7 +153,6 @@ class UserHelperTest extends Base $p = new Project($this->container); $pp = new ProjectPermission($this->container); $u = new UserModel($this->container); - $session = new Session; // We create our user $this->assertEquals(2, $u->create(array('username' => 'unittest', 'password' => 'unittest'))); @@ -171,7 +164,7 @@ class UserHelperTest extends Base $this->assertTrue($pp->isManager(1, 2)); // We fake a session for him - $session['user'] = array( + $this->container['sessionStorage']->user = array( 'id' => 2, 'is_admin' => false, 'is_project_admin' => false, |