public function testParamWithError() { $this->router->param('id', function ($req, $res, $next) { $next($req, $res, 'error'); }); $this->router->get('/{id}', function ($req, $res) { return $res->write('get'); }); $result = $this->router->__invoke($this->newTonisRequest('/1234'), $this->newTonisResponse()); $this->assertSame('error', $result->getBody()->__toString()); }