コード例 #1
0
 /**
  * @covers \phpDocumentor\Transformer\Template\Collection::getTemplatesPath
  */
 public function testCollectionProvidesTemplatePath()
 {
     // Arrange
     $path = '/tmp';
     $this->factoryMock->shouldReceive('getTemplatePath')->andReturn($path);
     // Act
     $result = $this->fixture->getTemplatesPath();
     // Assert
     $this->assertSame($path, $result);
 }
コード例 #2
0
 /**
  * @covers phpDocumentor\Transformer\Template\Factory::getAllNames
  */
 public function testRetrieveAllTemplateNames()
 {
     // Arrange
     $expected = array('template1', 'template2');
     $root = vfsStream::setup('exampleDir');
     $root->addChild(vfsStream::newDirectory($expected[0]));
     $root->addChild(vfsStream::newFile('aFile.txt'));
     $root->addChild(vfsStream::newDirectory($expected[1]));
     $this->pathResolverMock->shouldReceive('getTemplatePath')->andReturn(vfsStream::url('exampleDir'));
     // Act
     $result = $this->fixture->getAllNames();
     // Assert
     $this->assertSame($expected, $result);
 }
コード例 #3
0
 /**
  * Returns the path where all templates are stored.
  *
  * @return string
  */
 public function getTemplatesPath()
 {
     return $this->factory->getTemplatePath();
 }