Example #1
0
 public function testRoute()
 {
     $router = Router::createDefault();
     $route = $router->route('/test');
     $this->assertInstanceOf(IRoutePoint::class, $route);
     $this->assertEquals('test', $route->path());
     $this->assertEquals([], $route->arguments());
 }
Example #2
0
 public function testUnknownRoute()
 {
     $this->expectException(\LogicException::class);
     $this->expectExceptionMessage('Unknown route: unknown');
     $router = Router::createDefault();
     $url_builder = new UrlBuilder($router);
     $uri = \Yen\Http\Uri::createFromString('route:unknown');
     $url_builder->build($uri);
 }