public setBasePath ( $basePath ) | ||
$basePath |
public function setBasePath($basePath)
{
$this->basePath = rtrim($basePath, '/');
}
public function testMatchRouterUsingBasePath() { $collection = new RouteCollection(); $collection->attach(new Route('/users/', array('_controller' => 'PHPRouter\\Test\\SomeController::usersCreate', 'methods' => 'GET'))); $router = new Router($collection); $router->setBasePath('/localhost/webroot'); foreach ($this->serverProvider() as $server) { $_SERVER = $server; self::assertTrue((bool) $router->matchCurrentRequest()); } }