public function setUp() { $this->skipInVersionBelow('7.6'); $TSFE = $this->getDumbMock('\\TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController'); $GLOBALS['TSFE'] = $TSFE; /** @var $GLOBALS ['TSFE']->tmpl \TYPO3\CMS\Core\TypoScript\TemplateService */ $GLOBALS['TSFE']->tmpl = $this->getMock('\\TYPO3\\CMS\\Core\\TypoScript\\TemplateService', array('linkData')); $GLOBALS['TSFE']->tmpl->init(); $GLOBALS['TSFE']->tmpl->getFileName_backPath = PATH_site; $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['search.']['targetPage'] = '0'; $GLOBALS['TSFE']->tmpl->setup['config.']['tx_realurl_enable'] = '0'; // setup up ts objects $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['search.']['detailPage'] = 5050; $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['renderObjects.'] = array('testContent' => 'TEXT', 'testContent.' => array('field' => 'argument_0'), 'testContent2' => 'TEXT', 'testContent2.' => array('field' => 'argument_1', 'stripHtml' => 1)); $this->fixtures = array('argument content', '<span>argument content with html</span>', 'third argument content'); $cObj = $this->getMock('\\TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer', array('getResourceFactory', 'getEnvironmentVariable'), array($TSFE)); $cObj->setContentObjectClassMap(array('TEXT' => 'TYPO3\\CMS\\Frontend\\ContentObject\\TextContentObject')); $this->viewHelper = new Ts(); $this->viewHelper->setContentObject($cObj); }
public function setUp() { $this->skipInVersionBelow('7.6'); $TSFE = $this->getDumbMock('\\TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController'); $GLOBALS['TSFE'] = $TSFE; /** @var $GLOBALS ['TSFE']->tmpl \TYPO3\CMS\Core\TypoScript\TemplateService */ $GLOBALS['TSFE']->tmpl = $this->getMockBuilder(TemplateService::class)->setMethods(['linkData'])->getMock(); $GLOBALS['TSFE']->tmpl->init(); $GLOBALS['TSFE']->tmpl->getFileName_backPath = PATH_site; $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['search.']['targetPage'] = '0'; $GLOBALS['TSFE']->tmpl->setup['config.']['tx_realurl_enable'] = '0'; // setup up ts objects $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['search.']['detailPage'] = 5050; $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['renderObjects.'] = array('testContent' => 'TEXT', 'testContent.' => array('field' => 'argument_0'), 'testContent2' => 'TEXT', 'testContent2.' => array('field' => 'argument_1', 'stripHtml' => 1)); $this->fixtures = array('argument content', '<span>argument content with html</span>', 'third argument content'); $cObj = $this->getMockBuilder(ContentObjectRenderer::class)->setMethods(['getResourceFactory', 'getEnvironmentVariable'])->setConstructorArgs([$TSFE])->getMock(); $cObj->setContentObjectClassMap(array('TEXT' => 'TYPO3\\CMS\\Frontend\\ContentObject\\TextContentObject')); /** @var \ApacheSolrForTypo3\Solr\System\Configuration\ConfigurationManager $configurationManager */ $configurationManager = GeneralUtility::makeInstance('ApacheSolrForTypo3\\Solr\\System\\Configuration\\ConfigurationManager'); $configurationManager->reset(); $this->viewHelper = new Ts(); $this->viewHelper->setContentObject($cObj); }