示例#1
0
 /**
  * @covers phpDocumentor\Parser\File::logErrorsForDescriptor
  * @covers phpDocumentor\Parser\File::log
  */
 public function testIfAllErrorsAreLogged()
 {
     // Arrange
     $this->initializeParserWithDefaultVariables(false);
     $fileDescriptor = $this->givenAFileDescriptorWithHash('12345');
     $builder = $this->givenABuilderMock();
     $this->whenFileDescriptorContainsErrors($fileDescriptor);
     $this->whenBuilderAlwaysReturnsTheFileDescriptor($builder, $fileDescriptor);
     $this->thenDispatcherShouldReceiveLoggingEvents();
     // Act
     $this->fixture->parse(__FILE__, $builder);
     $this->assertTrue(true);
 }
示例#2
0
 /**
  * Parses a file and creates a Descriptor for it in the project.
  *
  * @param ProjectDescriptorBuilder $builder
  * @param string                   $filename
  *
  * @return void
  */
 protected function parseFileIntoDescriptor(ProjectDescriptorBuilder $builder, $filename)
 {
     $parser = new File($this);
     $parser->parse($filename, $builder);
 }