function it_should_set_response_time_to_response_header(Request $req, Response $res, ResponseHeaderBag $bag) { $res->headers = $bag; static::$timer->getStartMilliseconds()->willReturn(1426009224940.0); static::$timer->getEndMilliseconds()->willReturn(1426009226260.0); $bag->set('X-Response-Time', '1320ms', false)->shouldBeCalled(); $next = function ($req) use($res) { return $res->getWrappedObject(); }; $this->handle($req, $next)->shouldReturn($res); }
function it_should_set_response_time_to_response_header(Request $req, Response $res, ResponseHeaderBag $bag) { $res->headers = $bag; $uuid = '25769c6c-d34d-4bfe-ba98-e0ee856f3e7a'; static::$generator->getV4Uuid()->willReturn($uuid); $req->merge(['request-id' => $uuid])->shouldBeCalled(); $bag->set('Request-Id', $uuid, false)->shouldBeCalled(); $next = function ($req) use($res) { return $res->getWrappedObject(); }; $this->handle($req, $next)->shouldReturn($res); }