コード例 #1
0
ファイル: deleteTest.php プロジェクト: gudwin/extasy
 public function testDeleteAndCheckEntityDeletion()
 {
     ACL::create('test/test2/test3');
     ACL::grant('test/test2/test3', 'o1');
     ACL::grant('test', 'o2');
     ACL::remove('test/test2');
     $this->assertEquals(1, DBSimple::getRowsCount(ACL_GRANT_TABLE));
     // Проверяем, что удалились именно нужные данные
     $this->assertEquals(true, ACL::isGranted('test', 'o2'));
 }
コード例 #2
0
ファイル: isGrantedTest.php プロジェクト: gudwin/extasy
 public function testDeleteGrant()
 {
     $path = 'test/test2';
     $entity = 'obj1';
     ACL::create($path);
     ACL::grant($path, $entity);
     $this->assertEquals(true, ACL::isGranted($path, $entity));
     ACL::unGrant($path, $entity);
     $this->assertEquals(false, ACL::isGranted($path, $entity));
 }
コード例 #3
0
ファイル: miscTest.php プロジェクト: gudwin/extasy
 /**
  * 
  */
 public function testRemoveEntity()
 {
     ACL::create('test');
     ACL::create('test2');
     ACL::create('test3');
     ACL::grant('test', 'obj1');
     ACL::grant('test2', 'obj2');
     ACL::grant('test3', 'obj1');
     ACL::removeEntity('obj1');
     $this->assertEquals(1, DBSimple::getRowsCount(ACL_GRANT_TABLE));
     $this->assertEquals(true, ACL::isGranted('test2', 'obj2'));
 }