Ejemplo n.º 1
0
 public function get($role)
 {
     if ($role instanceof Zend_Acl_Role_Interface) {
         return $role;
     }
     return parent::get($role);
 }
Ejemplo n.º 2
0
 /**
  * Ensures that two Roles having the same ID cannot be registered
  *
  * @return void
  */
 public function testRoleRegistryDuplicateId()
 {
     $roleGuest1 = new Zend_Acl_Role('guest');
     $roleGuest2 = new Zend_Acl_Role('guest');
     $roleRegistry = new Zend_Acl_Role_Registry();
     try {
         $roleRegistry->add($roleGuest1)->add($roleGuest2);
         $this->fail('Expected exception not thrown upon adding two Roles with same ID');
     } catch (Zend_Acl_Role_Registry_Exception $e) {
         $this->assertContains('already exists', $e->getMessage());
     }
 }