public function dispatch() { $granted = \CMSAuth::getInstance()->check(); if ($granted) { parent::dispatch(); } else { } }
public function testCallback() { $request = new HttpRequest(); $request->uri(self::fixtureTestUrl); $called = false; $route = new HttpRoute(array('url' => self::fixtureTestUrl, 'callback' => function () use(&$called) { $called = true; })); $this->assertTrue((bool) $route->test($request)); $this->assertFalse($called); $route->dispatch(); $this->assertTrue($called); }