/** * Sets up this test case */ public function setUp() { $this->routerCachingService = $this->getAccessibleMock(\TYPO3\Flow\Mvc\Routing\RouterCachingService::class, array('dummy')); $this->mockRouteCache = $this->getMockBuilder(\TYPO3\Flow\Cache\Frontend\VariableFrontend::class)->disableOriginalConstructor()->getMock(); $this->inject($this->routerCachingService, 'routeCache', $this->mockRouteCache); $this->mockResolveCache = $this->getMockBuilder(\TYPO3\Flow\Cache\Frontend\StringFrontend::class)->disableOriginalConstructor()->getMock(); $this->inject($this->routerCachingService, 'resolveCache', $this->mockResolveCache); $this->mockPersistenceManager = $this->getMockBuilder(\TYPO3\Flow\Persistence\PersistenceManagerInterface::class)->getMock(); $this->inject($this->routerCachingService, 'persistenceManager', $this->mockPersistenceManager); $this->mockSystemLogger = $this->getMockBuilder(\TYPO3\Flow\Log\SystemLoggerInterface::class)->getMock(); $this->inject($this->routerCachingService, 'systemLogger', $this->mockSystemLogger); $this->mockHttpRequest = $this->getMockBuilder(\TYPO3\Flow\Http\Request::class)->disableOriginalConstructor()->getMock(); $this->mockHttpRequest->expects($this->any())->method('getMethod')->will($this->returnValue('GET')); $this->mockHttpRequest->expects($this->any())->method('getRelativePath')->will($this->returnValue('some/route/path')); $this->mockUri = $this->getMockBuilder(\TYPO3\Flow\Http\Uri::class)->disableOriginalConstructor()->getMock(); $this->mockUri->expects($this->any())->method('getHost')->will($this->returnValue('subdomain.domain.com')); $this->mockHttpRequest->expects($this->any())->method('getUri')->will($this->returnValue($this->mockUri)); }
/** * Sets up this test case */ public function setUp() { $this->routerCachingService = $this->getAccessibleMock('TYPO3\\Flow\\Mvc\\Routing\\RouterCachingService', array('dummy')); $this->mockFindMatchResultsCache = $this->getMockBuilder('TYPO3\\Flow\\Cache\\Frontend\\VariableFrontend')->disableOriginalConstructor()->getMock(); $this->routerCachingService->_set('findMatchResultsCache', $this->mockFindMatchResultsCache); $this->mockResolveCache = $this->getMockBuilder('TYPO3\\Flow\\Cache\\Frontend\\StringFrontend')->disableOriginalConstructor()->getMock(); $this->routerCachingService->_set('resolveCache', $this->mockResolveCache); $this->mockPersistenceManager = $this->getMockBuilder('TYPO3\\Flow\\Persistence\\PersistenceManagerInterface')->getMock(); $this->routerCachingService->_set('persistenceManager', $this->mockPersistenceManager); $this->mockSystemLogger = $this->getMockBuilder('TYPO3\\Flow\\Log\\SystemLoggerInterface')->getMock(); $this->routerCachingService->_set('systemLogger', $this->mockSystemLogger); $this->mockHttpRequest = $this->getMockBuilder('TYPO3\\Flow\\Http\\Request')->disableOriginalConstructor()->getMock(); $this->mockHttpRequest->expects($this->any())->method('getMethod')->will($this->returnValue('GET')); $this->mockHttpRequest->expects($this->any())->method('getRelativePath')->will($this->returnValue('some/route/path')); $this->mockUri = $this->getMockBuilder('TYPO3\\Flow\\Http\\Uri')->disableOriginalConstructor()->getMock(); $this->mockUri->expects($this->any())->method('getHost')->will($this->returnValue('subdomain.domain.com')); $this->mockHttpRequest->expects($this->any())->method('getUri')->will($this->returnValue($this->mockUri)); }