Neos\Flow\Tests\Unit\Mvc\Routing\RouterTest::routeDoesNotStoreMatchResultsInCacheIfTheyAreNull PHP Метод

routeDoesNotStoreMatchResultsInCacheIfTheyAreNull() публичный Метод

    public function routeDoesNotStoreMatchResultsInCacheIfTheyAreNull()
    {
        $router = $this->getAccessibleMock(Router::class, ['createRoutesFromConfiguration']);
        $this->inject($router, 'routerCachingService', $this->mockRouterCachingService);
        $this->inject($router, 'systemLogger', $this->mockSystemLogger);
        $matchResults = null;
        $mockHttpRequest = $this->getMockBuilder(Request::class)->disableOriginalConstructor()->getMock();
        $mockRoute1 = $this->getMockBuilder(Route::class)->getMock();
        $mockRoute1->expects($this->once())->method('matches')->with($mockHttpRequest)->will($this->returnValue(false));
        $mockRoute2 = $this->getMockBuilder(Route::class)->getMock();
        $mockRoute2->expects($this->once())->method('matches')->with($mockHttpRequest)->will($this->returnValue(true));
        $mockRoute2->expects($this->once())->method('getMatchResults')->will($this->returnValue($matchResults));
        $router->_set('routes', [$mockRoute1, $mockRoute2]);
        $mockRouterCachingService = $this->getMockBuilder(RouterCachingService::class)->getMock();
        $mockRouterCachingService->expects($this->once())->method('getCachedMatchResults')->with($mockHttpRequest)->will($this->returnValue(false));
        $mockRouterCachingService->expects($this->never())->method('storeMatchResults');
        $router->_set('routerCachingService', $mockRouterCachingService);
        $router->route($mockHttpRequest);
    }