2 declare(strict_types = 1);
18 use Prophecy\Argument;
26 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
37 protected function setUp(): void
50 $site =
new Site(
'dummy', $pageId, [
'base' =>
'http://sub.domainhostname.tld/path/']);
51 $siteFinderProphecy = $this->prophesize(SiteFinder::class);
52 $siteFinderProphecy->getSiteByPageId($pageId,
null)->willReturn($site);
53 GeneralUtility::addInstance(SiteFinder::class, $siteFinderProphecy->reveal());
55 $cacheFrontendProphecy = $this->prophesize(FrontendInterface::class);
56 $cacheFrontendProphecy->has(Argument::any())->willReturn(
false);
57 $cacheFrontendProphecy->set(Argument::any(), Argument::any())->willReturn(
null);
58 $cacheManagerProphecy = $this->prophesize(CacheManager::class);
59 $cacheManagerProphecy->getCache(
'cache_core')->willReturn($cacheFrontendProphecy->reveal());
60 GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
62 $backendUserAuthentication = $this->prophesize(BackendUserAuthentication::class);
63 $GLOBALS[
'BE_USER'] = $backendUserAuthentication->reveal();
65 $languages = $this->subject->getSystemLanguages($pageId);
66 $this->assertArrayHasKey(0, $languages);