/**
  * @test
  */
 public function storeResolvedUriPathConvertsObjectsImplementingCacheAwareInterfaceToCacheEntryIdentifier()
 {
     $mockObject = $this->getMock(\TYPO3\Flow\Cache\CacheAwareInterface::class);
     $mockObject->expects($this->atLeastOnce())->method('getCacheEntryIdentifier')->will($this->returnValue('objectIdentifier'));
     $routeValues = array('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);
 }
 /**
  * Builds the corresponding uri (excluding protocol and host) by iterating
  * through all configured routes and calling their respective resolves()
  * method. If no matching route is found, an empty string is returned.
  * Note: calls of this message are cached by RouterCachingAspect
  *
  * @param array $routeValues Key/value pairs to be resolved. E.g. array('@package' => 'MyPackage', '@controller' => 'MyController');
  * @return string
  * @throws NoMatchingRouteException
  */
 public function resolve(array $routeValues)
 {
     $cachedResolvedUriPath = $this->routerCachingService->getCachedResolvedUriPath($routeValues);
     if ($cachedResolvedUriPath !== FALSE) {
         return $cachedResolvedUriPath;
     }
     $this->lastResolvedRoute = NULL;
     $this->createRoutesFromConfiguration();
     /** @var $route Route */
     foreach ($this->routes as $route) {
         if ($route->resolves($routeValues)) {
             $this->lastResolvedRoute = $route;
             $resolvedUriPath = $route->getResolvedUriPath();
             if ($resolvedUriPath !== NULL) {
                 $this->routerCachingService->storeResolvedUriPath($resolvedUriPath, $routeValues);
             }
             return $resolvedUriPath;
         }
     }
     $this->systemLogger->log('Router resolve(): Could not resolve a route for building an URI for the given route values.', LOG_WARNING, $routeValues);
     throw new NoMatchingRouteException('Could not resolve a route and its corresponding URI for the given parameters. This may be due to referring to a not existing package / controller / action while building a link or URI. Refer to log and check the backtrace for more details.', 1301610453);
 }