public function testCallbacksAreCalled() { $called = false; $this->router->resource('singular')->onMatch(function ($action) use(&$called) { $this->assertEquals('edit', $action); $called = true; }); $this->router->match(new Request('GET', 'singular/edit')); $this->assertTrue($called); }