/** * @test */ public function substituteMarkerArrayCachedStoresResultInCaches() { /** @var PageRepositoryFixture|\PHPUnit_Framework_MockObject_MockObject $pageRepo */ $pageRepo = $this->typoScriptFrontendControllerMock->sys_page; $pageRepo->resetCallCount(); $content = 'Please tell me this ###FOO###.'; $markContentArray = array('###FOO###' => 'foo', '###NOTUSED###' => 'blub'); $resultContent = $this->subject->substituteMarkerArrayCached($content, $markContentArray); $storeKey = md5('substituteMarkerArrayCached_storeKey:' . serialize(array($content, array_keys($markContentArray)))); $storeArr = array('c' => array('Please tell me this ', '.'), 'k' => array('###FOO###')); $this->assertSame(1, $pageRepo::$getHashCallCount); $this->assertSame('Please tell me this foo.', $resultContent); $this->assertSame($storeArr, $this->subject->substMarkerCache[$storeKey]); $this->assertSame(1, $pageRepo::$storeHashCallCount); }
/** * Generates a success message. * @author Martin Helmich <*****@*****.**> * @param array $conf The plugin's configuration vars * @param string $msg The success message * @return string The HTML success message */ function successMessage($conf, $msg) { $template = $this->cObj->fileResource($conf['template.']['login_error']); $template = $this->cObj->getSubpart($template, '###SUCCESSNOTICE###'); $marker = array(); $marker['###LOGINERROR_MESSAGE###'] = $msg; return $this->cObj->substituteMarkerArrayCached($template, $marker); }