function testClass() { $this->assertEquals('\\Acme\\ExampleClass', $this->class->getName()); $this->assertEquals('This is a description of this class', $this->class->getDescription()); $this->assertEquals('Class: \\Acme\\ExampleClass (abstract)', $this->class->generateTitle()); $this->assertEquals('class-acmeexampleclass-abstract', $this->class->generateAnchor()); $this->assertFalse($this->class->isDeprecated()); $this->assertFalse($this->class->hasIgnoreTag()); $refl = new \PHPDocsMD\Reflector('Acme\\ExampleClassDepr'); $class = $refl->getClassEntity(); $this->assertTrue($class->isDeprecated()); $this->assertEquals('This one is deprecated Lorem te ipsum', $class->getDeprecationMessage()); $this->assertFalse($class->hasIgnoreTag()); $refl = new \PHPDocsMD\Reflector('Acme\\ExampleInterface'); $class = $refl->getClassEntity(); $this->assertTrue($class->isInterface()); $this->assertTrue($class->hasIgnoreTag()); }
function testReferenceToImportedClass() { $reflector = new \PHPDocsMD\Reflector('Acme\\InterfaceReferringToImportedClass'); $functions = $reflector->getClassEntity()->getFunctions(); $this->assertEquals('\\PHPDocsMD\\Console\\CLI', $functions[1]->getReturnType()); $this->assertEquals('\\PHPDocsMD\\Console\\CLI[]', $functions[0]->getReturnType()); }