public function testInvoke()
 {
     $requestId = new RequestId(new Generator(), true);
     $processor = new Processor($requestId, true);
     $extra = $processor(array());
     $this->assertEquals(array('extra' => array('request_id' => $requestId->getRequestId(), 'pid' => $requestId->getPid())), $extra);
 }
 public function testOnRequestBeforeSend()
 {
     $requestId = new RequestId(new Generator(), true);
     $guzzzleAdapter = new Guzzle($requestId);
     $event = new Event();
     $request = new Request('GET', 'test');
     $event->offsetSet('request', $request);
     $guzzzleAdapter->onRequestBeforeSend($event);
     $this->assertEquals($requestId->getRequestId(), $event['request']->getHeader("X-RequestId"));
 }
Beispiel #3
0
 /**
  * @param RequestId $requestId
  */
 public function __construct(RequestId $requestId)
 {
     $this->requestId = $requestId->getRequestId();
 }