public function testBeforeAndAfterFilterOrder() { $stack = array(); $this->app->before(function () use(&$stack) { $stack[] = 'before'; }); $this->app->after(function () use(&$stack) { $stack[] = 'after'; }); Router::get('/', function () use(&$stack) { $stack[] = 'route'; return 'Hello'; }); $this->app->run(); $this->assertEquals(array('before', 'route', 'after'), $stack); }
public function register() { $route = Router::get($this->mountPath . '/{asset}', function ($asset) { return $this->render($asset); }); $route->where('asset', '.+\\..+'); return $this; }