/** * @test */ public function resolvesKeepsCaseOfResolvedUriIfToLowerCaseIsFalse() { $this->route->setUriPattern('CamelCase/{someKey}'); $this->route->setLowerCase(false); $this->routeValues = array('someKey' => 'CamelCase'); $this->assertTrue($this->route->resolves($this->routeValues)); $this->assertEquals('CamelCase/CamelCase', $this->route->getResolvedUriPath()); }
/** * Creates \TYPO3\Flow\Mvc\Routing\Route objects from the injected routes * configuration. * * @return void * @throws InvalidRouteSetupException */ protected function createRoutesFromConfiguration() { if ($this->routesCreated === FALSE) { $this->routes = array(); $routesWithHttpMethodConstraints = array(); foreach ($this->routesConfiguration as $routeConfiguration) { $route = new Route(); if (isset($routeConfiguration['name'])) { $route->setName($routeConfiguration['name']); } $uriPattern = $routeConfiguration['uriPattern']; $route->setUriPattern($uriPattern); if (isset($routeConfiguration['defaults'])) { $route->setDefaults($routeConfiguration['defaults']); } if (isset($routeConfiguration['routeParts'])) { $route->setRoutePartsConfiguration($routeConfiguration['routeParts']); } if (isset($routeConfiguration['toLowerCase'])) { $route->setLowerCase($routeConfiguration['toLowerCase']); } if (isset($routeConfiguration['appendExceedingArguments'])) { $route->setAppendExceedingArguments($routeConfiguration['appendExceedingArguments']); } if (isset($routeConfiguration['httpMethods'])) { if (isset($routesWithHttpMethodConstraints[$uriPattern]) && $routesWithHttpMethodConstraints[$uriPattern] === FALSE) { throw new InvalidRouteSetupException(sprintf('There are multiple routes with the uriPattern "%s" and "httpMethods" option set. Please specify accepted HTTP methods for all of these, or adjust the uriPattern', $uriPattern), 1365678427); } $routesWithHttpMethodConstraints[$uriPattern] = TRUE; $route->setHttpMethods($routeConfiguration['httpMethods']); } else { if (isset($routesWithHttpMethodConstraints[$uriPattern]) && $routesWithHttpMethodConstraints[$uriPattern] === TRUE) { throw new InvalidRouteSetupException(sprintf('There are multiple routes with the uriPattern "%s" and "httpMethods" option set. Please specify accepted HTTP methods for all of these, or adjust the uriPattern', $uriPattern), 1365678432); } $routesWithHttpMethodConstraints[$uriPattern] = FALSE; } $this->routes[] = $route; } $this->routesCreated = TRUE; } }