/** * @covers phpDocumentor\Descriptor\ClassDescriptor::setConstants * @covers phpDocumentor\Descriptor\ClassDescriptor::getConstants */ public function testSettingAndGettingConstants() { $this->assertInstanceOf('phpDocumentor\\Descriptor\\Collection', $this->fixture->getConstants()); $mock = m::mock('phpDocumentor\\Descriptor\\Collection'); $this->fixture->setConstants($mock); $this->assertSame($mock, $this->fixture->getConstants()); }
/** * @param string $name The name of the current constant. * * @return ConstantDescriptor */ protected function whenFixtureHasConstantInParentClassWithSameName($name) { $result = new ConstantDescriptor(); $result->setName($name); $parent = new ClassDescriptor(); $parent->getConstants()->set($name, $result); $class = new ClassDescriptor(); $class->setParent($parent); $this->fixture->setParent($class); return $result; }