setDocumentationDirectory() 공개 메소드

public setDocumentationDirectory ( $documentationPath )
예제 #1
0
 public function getStaticRoot()
 {
     $config = new Config();
     $config->setDocumentationDirectory('');
     $config['mode'] = Daux::STATIC_MODE;
     $config['index_key'] = 'index.html';
     $config['valid_content_extensions'] = ['md'];
     return new Root($config);
 }
예제 #2
0
 protected function createContent($content)
 {
     $config = new Config();
     $config->setDocumentationDirectory('');
     $dir = new Directory(new Root($config), '');
     $obj = new Content($dir, '');
     $obj->setContent($content);
     return $obj;
 }
예제 #3
0
 protected function getTree(Config $config)
 {
     $structure = ['Content' => ['Page.md' => 'some text content'], 'Widgets' => ['Page.md' => 'another page', 'Button.md' => 'another page']];
     $root = vfsStream::setup('root', null, $structure);
     $config->setDocumentationDirectory($root->url());
     $config['valid_content_extensions'] = ['md'];
     $config['mode'] = Daux::STATIC_MODE;
     $config['index_key'] = 'index.html';
     $tree = new Root($config);
     Builder::build($tree, []);
     return $tree;
 }
예제 #4
0
 /**
  * @dataProvider providerSort
  */
 public function testSort($list, $expected)
 {
     shuffle($list);
     $config = new Config();
     $config->setDocumentationDirectory('');
     $directory = new Directory(new Root($config), 'dir');
     foreach ($list as $value) {
         $entry = new Content($directory, $value);
         $entry->setName($value);
     }
     $directory->sort();
     $final = [];
     foreach ($directory->getEntries() as $obj) {
         $final[] = $obj->getName();
     }
     $this->assertEquals($expected, $final);
 }
예제 #5
0
 public function testCreateHierarchy()
 {
     $config = new Config();
     $config->setDocumentationDirectory($this->root->url());
     $config['valid_content_extensions'] = ['md'];
     $config['mode'] = Daux::STATIC_MODE;
     $config['index_key'] = 'index.html';
     $tree = new Root($config);
     Builder::build($tree, []);
     $this->assertCount(2, $tree);
     $this->assertTrue(array_key_exists('Contents', $tree->getEntries()));
     $this->assertInstanceOf(Directory::class, $tree['Contents']);
     $this->assertTrue(array_key_exists('Widgets', $tree->getEntries()));
     $this->assertInstanceOf(Directory::class, $tree['Widgets']);
     // TODO :: should not be Page.html, this should not depend on the mode
     $this->assertEquals('Page', $tree['Contents']['Page.html']->getTitle());
     $this->assertInstanceOf(Content::class, $tree['Contents']['Page.html']);
 }