/** * @test * @expectedException \TYPO3\Fluid\View\Exception\InvalidTemplateResourceException */ public function getPartialPathAndFilenameThrowsExceptionIfPartialFileIsADirectory() { vfsStreamWrapper::register(); mkdir('vfs://MyPartials/NotAFile'); $this->standaloneView->setPartialRootPath('vfs://MyPartials'); $this->standaloneView->_call('getPartialPathAndFilename', 'NotAFile'); }
/** * @test */ public function getPartialSourceReturnsContentOfDefaultPartialFileIfNoPartialExistsForTheSpecifiedFormat() { $partialRootPath = dirname(__FILE__) . '/Fixtures'; $this->view->setPartialRootPath($partialRootPath); $this->mockRequest->expects($this->once())->method('getFormat')->will($this->returnValue('foo')); $expectedResult = file_get_contents($partialRootPath . '/LayoutFixture'); $actualResult = $this->view->_call('getPartialSource', 'LayoutFixture'); $this->assertEquals($expectedResult, $actualResult); }