Example #1
0
 public function testAdd()
 {
     $descriptor = new Descriptor();
     $descriptor->setManager($this->manager);
     $descriptor->load(new \ReflectionClass('ClassF'));
     $this->manager->add($descriptor);
     $this->assertEquals($descriptor, $this->manager->describe('ClassF'));
 }
Example #2
0
 /**
  * @return boolean
  */
 public function isShared()
 {
     if (!$this->isShared) {
         return false;
     }
     if ($this->parent && !$this->parent->isShared()) {
         return false;
     }
     if (is_array($this->interfaces)) {
         /** @var $interface Descriptor */
         foreach ($this->interfaces as $interface) {
             if ($interface->getName() === $this->getName()) {
                 continue;
             }
             if (!$interface->isShared()) {
                 return false;
             }
         }
     }
     return true;
 }
Example #3
0
 /**
  * @expectedException RuntimeException
  */
 public function testResolveArgumentValueException()
 {
     $reflectionClass = new ReflectionClass('ClassA');
     $this->descriptor->load($reflectionClass);
 }