/** * Ensures that removal of all Roles results in Role-specific rules being removed * * @return void */ public function testRuleRoleRemoveAll() { $this->_acl->addRole(new Role\GenericRole('guest'))->allow('guest'); $this->assertTrue($this->_acl->isAllowed('guest')); $this->_acl->removeRoleAll(); try { $this->_acl->isAllowed('guest'); $this->fail('Expected Zend\\Permissions\\Acl\\Role\\Exception not thrown upon isAllowed() on non-existent Role'); } catch (Acl\Exception\InvalidArgumentException $e) { $this->assertContains('not found', $e->getMessage()); } $this->_acl->addRole(new Role\GenericRole('guest')); $this->assertFalse($this->_acl->isAllowed('guest')); }