public function testIgnoresUnsentRequests()
 {
     $h = new HistoryPlugin();
     $request = RequestFactory::getInstance()->create('GET', 'http://localhost/');
     $h->add($request);
     $this->assertEquals(0, count($h));
 }
 /**
  * Adds multiple requests to a plugin
  *
  * @param HistoryPlugin $h Plugin
  * @param int $num Number of requests to add
  *
  * @return array
  */
 protected function addRequests(HistoryPlugin $h, $num)
 {
     $requests = array();
     $client = new Client('http://127.0.0.1/');
     for ($i = 0; $i < $num; $i++) {
         $requests[$i] = $client->get();
         $requests[$i]->setResponse(new Response(200), true);
         $requests[$i]->send();
         $h->add($requests[$i]);
     }
     return $requests;
 }