public function setUp() { $this->entryText = file_get_contents('ZendGData/App/_files/EntrySample1.xml', true); $this->httpEntrySample = file_get_contents('ZendGData/App/_files/EntrySampleHttp1.txt', true); $this->entry = new App\Entry(); $this->adapter = new \ZendGDataTest\TestAsset\MockHttpClient(); $this->client = new HttpClient(); $this->client->setAdapter($this->adapter); $this->service = new App($this->client); }
public function setUp() { $this->fileName = __DIR__ . '/App/_files/FeedSample1.xml'; $this->expectedEtagValue = 'W/"CkcHQH8_fCp7ImA9WxRTGEw."'; $this->expectedMajorProtocolVersion = 1; $this->expectedMinorProtocolVersion = 2; $this->httpEntrySample = file_get_contents(__DIR__ . '/_files/AppSample1.txt', true); $this->httpEntrySampleWithoutVersion = file_get_contents(__DIR__ . '/_files/AppSample2.txt', true); $this->httpFeedSample = file_get_contents(__DIR__ . '/_files/AppSample3.txt', true); $this->httpFeedSampleWithoutVersion = file_get_contents(__DIR__ . '/_files/AppSample4.txt', true); $this->adapter = new TestAsset\MockHttpClient(); $this->client = new HttpClient(); $this->client->setAdapter($this->adapter); $this->service = new App($this->client); }
/** * @expectedException ZendGData\App\HttpException */ public function testGetAuthSubTokenInfoCatchesHttpClientException() { $adapter = new AdapterTest(); $adapter->setNextRequestWillFail(true); $client = new HttpClient(); $client->setUri('http://example.com/AuthSub'); $client->setAdapter($adapter); $revoked = AuthSub::getAuthSubTokenInfo($this->token, $client); }