public function storeResolvedUriPath($uriPath, array $routeValues)
{
$uriPath = trim($uriPath, '/');
$routeValues = $this->convertObjectsToHashes($routeValues);
if ($routeValues === null) {
return;
}
$cacheIdentifier = $this->buildResolveCacheIdentifier($routeValues);
if ($cacheIdentifier !== null) {
$tags = $this->generateRouteTags($uriPath, $routeValues);
$this->resolveCache->set($cacheIdentifier, $uriPath, $tags);
}
}
/** * @test */ public function storeResolvedUriPathConvertsObjectsImplementingCacheAwareInterfaceToCacheEntryIdentifier() { $mockObject = $this->createMock(CacheAwareInterface::class); $mockObject->expects($this->atLeastOnce())->method('getCacheEntryIdentifier')->will($this->returnValue('objectIdentifier')); $routeValues = ['b' => 'route values', 'someObject' => $mockObject]; $cacheIdentifier = '264b593d59582adea4ccc52b33cc093f'; $matchingUriPath = 'uncached/matching/uri'; $this->mockResolveCache->expects($this->once())->method('set')->with($cacheIdentifier, $matchingUriPath); $this->routerCachingService->storeResolvedUriPath($matchingUriPath, $routeValues); }