コード例 #1
0
 public function testMapPrependsGroupPattern()
 {
     $methods = ['GET'];
     $pattern = '/hello/{first}/{last}';
     $callable = function ($request, $response, $args) {
         echo sprintf('Hello %s %s', $args['first'], $args['last']);
     };
     $this->router->pushGroup('/prefix', function () {
     });
     $route = $this->router->map($methods, $pattern, $callable);
     $this->router->popGroup();
     $this->assertAttributeEquals('/prefix/hello/{first}/{last}', 'pattern', $route);
 }