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);
 }
Exemplo n.º 2
0
 public function test_add_filter()
 {
     $router = new Router();
     $router->addFilter('foo', [self::class, 'test_add_filter']);
     $filters = $router->getRoutesMatcher()->getFiltersMatcher()->getFilters();
     $this->assertEquals(1, count($filters));
 }