public function testInvokeWithRoute() { $request = $this->newTonisRequest('/bar'); $response = $this->newTonisResponse(); $that = $this; $this->router->get('/{foo}', function ($req, $res) use($that) { return $res->write('success'); }); $result = $this->router->__invoke($request, $response, function () { }); $this->assertSame('success', $result->getBody()->__toString()); }