Exemplo n.º 1
0
 /**
  * @test
  */
 public function setLayoutRootPathsOverridesValuesSetBySetLayoutRootPath()
 {
     $this->view->setLayoutRootPath('/foo/bar');
     $this->view->setLayoutRootPaths(array('/overruled/path'));
     $expected = array('/overruled/path');
     $actual = $this->view->_call('getLayoutRootPaths');
     $this->assertEquals($expected, $actual, 'A set layout root path was not returned correctly.');
 }
 /**
  * Set layout root path if given in configuration
  *
  * @param array $conf Configuration array
  * @return void
  */
 protected function setLayoutRootPath(array $conf)
 {
     $layoutRootPath = isset($conf['layoutRootPath.']) ? $this->cObj->stdWrap($conf['layoutRootPath'], $conf['layoutRootPath.']) : $conf['layoutRootPath'];
     if ($layoutRootPath) {
         $layoutRootPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($layoutRootPath);
         $this->view->setLayoutRootPath($layoutRootPath);
     }
 }
Exemplo n.º 3
0
 /**
  * @test
  */
 public function getLayoutSourceReturnsContentOfDefaultLayoutFileIfNoLayoutExistsForTheSpecifiedFormat()
 {
     $layoutRootPath = __DIR__ . '/Fixtures';
     $this->view->setLayoutRootPath($layoutRootPath);
     $this->mockRequest->expects($this->once())->method('getFormat')->will($this->returnValue('foo'));
     $expectedResult = file_get_contents($layoutRootPath . '/LayoutFixture');
     $actualResult = $this->view->_call('getLayoutSource', 'LayoutFixture');
     $this->assertEquals($expectedResult, $actualResult);
 }