Altered test cases for allowed user checking.

Changed test checking if admin used has always access.
Added new test to check if non admin used does not have access if is not added to acl list.
This commit is contained in:
toomyem 2014-03-05 10:55:26 +01:00
parent 384b64b7fa
commit 850abb1500
1 changed files with 7 additions and 1 deletions

View File

@ -57,7 +57,13 @@ class ProjectTest extends PHPUnit_Framework_TestCase
$this->assertTrue($p->revokeUser(1, 1));
$this->assertEquals(array('2' => 'unittest'), $p->getAllowedUsers(1));
$this->assertFalse($p->isUserAllowed(1, 1));
$this->assertTrue($p->isUserAllowed(1, 1)); // has admin priviledges
$this->assertTrue($p->isUserAllowed(1, 2));
// Check if revoked regular user is not allowed
$this->assertTrue($p->allowUser(1, 1));
$this->assertTrue($p->revokeUser(1, 2));
$this->assertEquals(array('1' => 'admin'), $p->getAllowedUsers(1));
$this->assertFalse($p->isUserAllowed(1, 2)); // regulat user is not allowed
}
}