Beispiel #1
0
 /**
  * Ensures that removal of a Resource results in its rules being removed
  *
  * @return void
  */
 public function testRulesResourceRemove()
 {
     $this->_acl->addResource(new Resource\GenericResource('area'))->allow(null, 'area');
     $this->assertTrue($this->_acl->isAllowed(null, 'area'));
     $this->_acl->removeResource('area');
     try {
         $this->_acl->isAllowed(null, 'area');
         $this->fail('Expected Zend\\Acl\\Exception not thrown upon isAllowed() on non-existent Resource');
     } catch (Acl\Exception $e) {
         $this->assertContains('not found', $e->getMessage());
     }
     $this->_acl->addResource(new Resource\GenericResource('area'));
     $this->assertFalse($this->_acl->isAllowed(null, 'area'));
 }