Ejemplo n.º 1
0
 public function testBasePath()
 {
     $called = false;
     $config = new Configuration();
     $config->basePath = 'base/';
     $router = new Router($config);
     $router->get('hello')->name('hello')->onMatch(function () use(&$called) {
         $called = true;
     });
     $_SERVER['REQUEST_METHOD'] = 'GET';
     $_SERVER['REQUEST_URI'] = 'base/hello';
     $router->matchCurrentRequest();
     $this->assertTrue($called);
     $this->assertEquals('base/hello', $router->to('hello'));
 }