Exemplo n.º 1
0
 public function testAnnotation()
 {
     $annotation = new Acl(['id' => 'test_acl', 'type' => 'SomeType', 'class' => 'SomeClass', 'permission' => 'SomePermission', 'group_name' => 'SomeGroup', 'label' => 'SomeLabel', 'ignore_class_acl' => true]);
     $this->assertEquals('test_acl', $annotation->getId());
     $this->assertEquals('SomeType', $annotation->getType());
     $this->assertEquals('SomeClass', $annotation->getClass());
     $this->assertEquals('SomePermission', $annotation->getPermission());
     $this->assertEquals('SomeGroup', $annotation->getGroup());
     $this->assertEquals('SomeLabel', $annotation->getLabel());
     $this->assertTrue($annotation->getIgnoreClassAcl());
 }
 /**
  * {@inheritdoc}
  */
 public function unserialize($serialized)
 {
     list($data, $this->classes) = unserialize($serialized);
     $this->annotations = array();
     foreach ($data as $d) {
         $annotation = new AclAnnotation();
         $annotation->unserialize($d);
         $this->annotations[$annotation->getId()] = $annotation;
     }
 }