diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/units/Helper/UserHelperTest.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/units/Helper/UserHelperTest.php b/tests/units/Helper/UserHelperTest.php index 10bbc58e..d5bd1789 100644 --- a/tests/units/Helper/UserHelperTest.php +++ b/tests/units/Helper/UserHelperTest.php @@ -31,6 +31,12 @@ class UserHelperTest extends Base $this->assertEquals('Project Viewer', $helper->getRoleName(Role::PROJECT_VIEWER)); } + public function testHasAccessWithoutSession() + { + $helper = new UserHelper($this->container); + $this->assertFalse($helper->hasAccess('UserCreationController', 'create')); + } + public function testHasAccessForAdmins() { $helper = new UserHelper($this->container); @@ -73,6 +79,15 @@ class UserHelperTest extends Base $this->assertTrue($helper->hasAccess('ProjectCreationController', 'createPrivate')); } + public function testHasProjectAccessWithoutSession() + { + $helper = new UserHelper($this->container); + $project = new ProjectModel($this->container); + + $this->assertEquals(1, $project->create(array('name' => 'My project'))); + $this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 1)); + } + public function testHasProjectAccessForAdmins() { $helper = new UserHelper($this->container); |