function it_runs(IInput $input, IOutput $output)
 {
     $router = new Router();
     $router->addFilter('filter', function () {
     });
     for ($i = 0; $i < 15; $i++) {
         $router->get('/some/path', 'value');
     }
     for ($i = 0; $i < 15; $i++) {
         $router->group()->get('/another/path', 'value');
     }
     $router->enableFilter('filter');
     $this->run($input, $output, $router);
 }
예제 #2
0
파일: RouterTest.php 프로젝트: weew/router
 public function test_that_exceptions_thrown_by_filters_do_not_get_swallowed()
 {
     $router = new Router();
     $router->addFilter('foo', function () {
         throw new Exception('foo bar');
     });
     $router->group(function (IRouter $router) {
         $router->enableFilter(['foo']);
         $router->get('profile', 'profile');
     });
     $this->setExpectedException(Exception::class, 'foo bar');
     $router->match(HttpRequestMethod::GET, new Url('profile'));
 }