public function testNextShouldRaiseDeprecationNoticeWhenInvokedWithErrorArgument()
{
$route = new Route('/', function ($err, $req, $res, $next) {
return $this->response;
});
$this->queue->enqueue($route);
$done = function ($req, $res, $err) {
$this->fail('Should not hit final handler');
};
$next = new Next($this->queue, $done);
set_error_handler(function ($errno, $errmsg) {
$this->assertContains('Usage of error middleware is deprecated', $errmsg);
}, E_USER_DEPRECATED);
$result = $next($this->request, $this->response, 'Error');
restore_error_handler();
$this->assertSame($this->response, $result);
}