public function testFailRequestOnDemand() { $this->adapter->setNextRequestWillFail(true); try { // Make a connection that will fail $this->adapter->connect('http://foo'); $this->fail(); } catch (\Zend\Http\Client\Adapter\Exception\RuntimeException $e) { // Connect again to see that the next request does not fail $this->adapter->connect('http://foo'); } }