public function testCollect()
 {
     $history = $this->getHistoryMock();
     $collector = new GuzzleCollector($history);
     $request = Request::createFromGlobals();
     $response = $this->getMock('Symfony\\Component\\HttpFoundation\\Response');
     $collector->collect($request, $response, new \Exception());
     $this->assertCount(1, $collector->getCalls());
 }
 public function testCollect()
 {
     $mocks = array_fill(0, 3, new Response(204));
     $mock = new MockHandler($mocks);
     $handler = HandlerStack::create($mock);
     $collector = new GuzzleCollector();
     $handler->push(Middleware::history($collector->getHistory()));
     $client = new Client(['handler' => $handler]);
     $request = Request::createFromGlobals();
     $response = $this->getMock('Symfony\\Component\\HttpFoundation\\Response');
     $collector->collect($request, $response, new \Exception());
     $this->assertCount(0, $collector->getCalls());
     $client->get('http://foo.bar');
     $collector->collect($request, $response, new \Exception());
     $this->assertCount(1, $collector->getCalls());
     $client->get('http://foo.bar');
     $collector->collect($request, $response, new \Exception());
     $this->assertCount(2, $collector->getCalls());
 }