/** * @param string $currentDomain * @test * @dataProvider getSysDomainCacheDataProvider */ public function getSysDomainCacheReturnsForcedDomainRecord($currentDomain) { $_SERVER['HTTP_HOST'] = $currentDomain; $domainRecords = array('typo3.org' => array('uid' => '1', 'pid' => '1', 'domainName' => 'typo3.org', 'forced' => 0), 'foo.bar' => array('uid' => '2', 'pid' => '1', 'domainName' => 'foo.bar', 'forced' => 1), 'example.com' => array('uid' => '3', 'pid' => '1', 'domainName' => 'example.com', 'forced' => 0)); $GLOBALS['TYPO3_DB'] = $this->getMock(DatabaseConnection::class, array('exec_SELECTgetRows')); $GLOBALS['TYPO3_DB']->expects($this->any())->method('exec_SELECTgetRows')->willReturn($domainRecords); GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime')->flush(); $expectedResult = array($domainRecords[$currentDomain]['pid'] => $domainRecords['foo.bar']); $this->assertEquals($expectedResult, $this->subject->_call('getSysDomainCache')); }
/** * @param string $tablePid * @param int $now * @return int */ public function getFirstTimeValueForRecordCall($tablePid, $now) { return $this->tsFrontendController->_call('getFirstTimeValueForRecord', $tablePid, $now); }