{@inheritDoc}
public setMethods ( phpDocumentor\Descriptor\Collection $methods ) | ||
$methods | phpDocumentor\Descriptor\Collection |
/** * @covers phpDocumentor\Descriptor\TraitDescriptor::setMethods * @covers phpDocumentor\Descriptor\TraitDescriptor::getMethods */ public function testSettingAndGettingMethods() { $this->assertInstanceOf('phpDocumentor\\Descriptor\\Collection', $this->fixture->getMethods()); $mock = m::mock('phpDocumentor\\Descriptor\\Collection'); $this->fixture->setMethods($mock); $this->assertSame($mock, $this->fixture->getMethods()); }
/** * @covers phpDocumentor\Descriptor\TraitDescriptor::setPackage */ public function testSettingAndGettingPackage() { $package = new \phpDocumentor\Descriptor\PackageDescriptor(); $mockPropertyDescriptor = m::mock('phpDocumentor\\Descriptor\\PropertyDescriptor'); $mockPropertyDescriptor->shouldReceive('setPackage')->with($package); $mockMethodDescriptor = m::mock('phpDocumentor\\Descriptor\\MethodDescriptor'); $mockMethodDescriptor->shouldReceive('setPackage')->with($package); $propertyCollection = new Collection(array($mockPropertyDescriptor)); $methodCollection = new Collection(array($mockMethodDescriptor)); $this->fixture->setProperties($propertyCollection); $this->fixture->setMethods($methodCollection); $this->fixture->setPackage($package); $this->assertSame($package, $this->fixture->getPackage()); }