コード例 #1
0
 /**
  * @covers phpDocumentor\Descriptor\ConstantDescriptor::getTypes
  * @covers phpDocumentor\Descriptor\ConstantDescriptor::getVar
  */
 public function testgetTypesDerivedFromVarTag()
 {
     $expected = array('string', 'null');
     $varTag = m::mock('phpDocumentor\\Descriptor\\Tag\\VarDescriptor');
     $varTag->shouldReceive('getTypes')->andReturn($expected);
     $this->fixture->getTags()->set('var', new Collection(array($varTag)));
     $this->assertSame($expected, $this->fixture->getTypes());
 }
コード例 #2
0
 /**
  * @covers phpDocumentor\Descriptor\DescriptorAbstract::getCopyright
  */
 public function testCopyrightTagsInheritWhenNoneArePresent()
 {
     // Arrange
     $copyrightTagDescriptor = new TagDescriptor('copyright');
     $copyrightCollection = new Collection(array($copyrightTagDescriptor));
     $this->fixture->getTags()->clear();
     $parentProperty = $this->whenFixtureHasConstantInParentClassWithSameName($this->fixture->getName());
     $parentProperty->getTags()->set('copyright', $copyrightCollection);
     // Act
     $result = $this->fixture->getCopyright();
     // Assert
     $this->assertSame($copyrightCollection, $result);
 }