/** * @covers phpDocumentor\Compiler\Linker\Linker::getDescription */ public function testGetDescription() { $linker = new Linker(array()); $expected = 'Replace textual FQCNs with object aliases'; $this->assertSame($expected, $linker->getDescription()); }
/** * @covers phpDocumentor\Compiler\Linker\Linker::execute * @covers phpDocumentor\Compiler\Linker\Linker::replacePseudoTypes */ public function testReplaceThisWithCurrentClassInScope() { $fixture = new Linker(array('phpDocumentor\\Descriptor\\ClassDescriptor' => array('methods'), 'phpDocumentor\\Descriptor\\MethodDescriptor' => array('tags'), 'phpDocumentor\\Descriptor\\Tag\\SeeDescriptor' => array('reference'))); $methodName = 'myMethod'; $fqnn = '\\My\\Space'; $className = 'MyClass'; $seeDescriptor = $this->givenASeeDescriptorWithReference('$this::' . $methodName . '()'); $classDescriptor = $this->givenAClassWithNamespaceAndClassName($fqnn, $className); $methodDescriptor = $this->givenAMethodWithClassAndName($classDescriptor, $methodName); $methodDescriptor->getTags()->get($seeDescriptor->getName(), new Collection())->add($seeDescriptor); $classDescriptor->getMethods()->add($methodDescriptor); $fixture->setObjectAliasesList(array($fqnn . '\\' . $className => $classDescriptor, $fqnn . '\\' . $className . '::' . $methodName . '()' => $methodDescriptor)); $fixture->substitute($classDescriptor); $this->assertSame($methodDescriptor, $seeDescriptor->getReference()); }