public function testInvokesHandlerWhenMatched()
{
// e.g., if route is "/foo", but path is "/foobar", no match
$triggered = null;
$route = new Route('/foo', function ($req, $res, $next) use(&$triggered) {
$triggered = true;
});
$this->queue->enqueue($route);
$phpunit = $this;
$done = function ($req, $res, $err = null) use($phpunit) {
$phpunit->fail('Should not hit done handler');
};
$request = $this->request->withUri(new Uri('http://local.example.com/foo'));
$next = new Next($this->queue, $done);
$next($request, $this->response);
$this->assertTrue($triggered);
}