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'); } }
/** * @expectedException Zend\Gdata\App\HttpException */ public function testGetAuthSubTokenInfoCatchesHttpClientException() { $adapter = new AdapterTest(); $adapter->setNextRequestWillFail(true); $client = new GData\HttpClient(); $client->setUri('http://example.com/AuthSub'); $client->setAdapter($adapter); $revoked = GData\AuthSub::getAuthSubTokenInfo($this->token, $client); }