Beispiel #1
0
 /**
  * @param string $rootFolder
  */
 public function setRootFolder($rootFolder)
 {
     if (!is_dir($rootFolder)) {
         throw new \InvalidArgumentException('Root folder [' . $rootFolder . '] is not an existing folder!');
     }
     $this->rootFolder = $rootFolder;
     $this->uriToIndexMapper->setRoot($rootFolder);
 }
Beispiel #2
0
 /**
  * @test
  * it should set index with uri to index map when setting index for uri
  */
 public function it_should_set_index_with_uri_to_index_map_when_setting_index_for_uri()
 {
     $uri = '/foo';
     $this->uriToIndexMapper->setRoot($this->root->url())->shouldBeCalled();
     $this->uriToIndexMapper->getIndexForUri($uri)->willReturn('/some-index.php');
     $sut = $this->make_instance();
     $sut->setRootFolder($this->root->url());
     $sut->setIndexFor($uri);
     $this->assertEquals($this->root->url() . '/some-index.php', $sut->getIndex());
 }