/** * @test * @author Jürg Hunziker <*****@*****.**> */ public function showActionAssignsAnswer() { $answer = $this->mockAnswerRepositoryFindByUid(); // the actual test $expectedAnswer = 42; // $answer->getValue() + $this->settings['magicNumber'] $this->view->expects($this->at(0))->method('assign')->with('theAnswer', $expectedAnswer); // call the controller action $this->controller->showAction(); // tear down locally defined variables unset($answer); unset($expectedAnswer); }
/** * @test * @author Sebastian Kurfürst <*****@*****.**> */ public function layoutEngineMergesTemplateAndLayout() { $this->markTestSkipped('needs refactoring - this is a functional test with too many side effects'); $templateView = new Tx_Fluid_View_TemplateView(); $templateView->setTemplatePathAndFilename(dirname(__FILE__) . '/Fixtures/TemplateViewSectionFixture.html'); $templateView->setLayoutPathAndFilename(dirname(__FILE__) . '/Fixtures/LayoutFixture.html'); $this->assertEquals($templateView->renderWithLayout('LayoutFixture'), '<div>Output</div>', 'Specific section was not rendered correctly!'); }
/** * Parse the given template and return it. * * Will cache the results for one call. * * @param string $templatePathAndFilename absolute filename of the template to be parsed * @return Tx_Fluid_Core_Parser_ParsedTemplateInterface the parsed template tree * @throws Tx_Fluid_View_Exception_InvalidTemplateResourceException * @author Sebastian Kurfürst <*****@*****.**> */ protected function parseTemplate($templatePathAndFilename) { $cacheIdentifier = md5($templatePathAndFilename); if (!$this->cache->has($cacheIdentifier)) { $parsedTemplate = parent::parseTemplate($templatePathAndFilename); $this->cache->set($cacheIdentifier, $parsedTemplate); } else { $parsedTemplate = $this->cache->get($cacheIdentifier); } return $parsedTemplate; }