コード例 #1
0
ファイル: RouterTest.php プロジェクト: nullptr-cc/yen2
 public function testRoute()
 {
     $router = Router::createDefault();
     $route = $router->route('/test');
     $this->assertInstanceOf(IRoutePoint::class, $route);
     $this->assertEquals('test', $route->path());
     $this->assertEquals([], $route->arguments());
 }
コード例 #2
0
ファイル: UrlBuilderTest.php プロジェクト: nullptr-cc/yen2
 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);
 }