/**
     * @covers phpDocumentor\Descriptor\ProjectAnalyzer::__toString
     */
    public function testIfStringOutputContainsAllCounters()
    {
        // Arrange
        $classDescriptor1 = $this->givenAClassWithParent('phpDocumentor\\Descriptor\\ClassDescriptor');
        $projectDescriptor = $this->givenAProjectMock();
        $this->whenProjectDescriptorHasTheFollowingFiles($projectDescriptor, array(1, 2, 3, 4));
        $this->whenProjectDescriptorHasTheFollowingElements($projectDescriptor, array('ds1' => $classDescriptor1, 'ds2' => $this->givenAClassWithParent($classDescriptor1), 'ds3' => $this->givenAnInterfaceWithParent('123')));
        $this->whenProjectHasTheFollowingChildrenOfRootNamespace($projectDescriptor, array(1, 2, 3));
        $this->fixture->analyze($projectDescriptor);
        $expected = <<<TEXT
In the ProjectDescriptor are:
         4 files
         3 top-level namespaces
         1 unresolvable parent classes
         2 phpDocumentor\\Descriptor\\ClassDescriptor elements
         1 phpDocumentor\\Descriptor\\InterfaceDescriptor elements

TEXT;
        // Act
        $result = (string) $this->fixture;
        // Assert
        $this->assertSame($expected, $result);
    }
Esempio n. 2
0
 /**
  * {@inheritDoc}
  */
 public function execute(ProjectDescriptor $project)
 {
     $this->analyzer->analyze($project);
     $this->log->debug((string) $this->analyzer);
 }