public function test__construct() { $mock = $this->getMock('WebArchive\\Provider\\ProviderInterface'); $mock->expects($this->once())->method('createUrlRequest')->will($this->returnCallback(function ($url) { return $url; })); $request = new Request('http://test.test/'); $client = new Client($request, $mock); $this->assertInstanceOf('Zend\\Http\\Client', $client->getClient()); $this->assertEquals($request->getUrl(), (string) $client->getClient()->getUri()); }
/** * Send HTTP request and returns the collection of snapshots generated. * * @return SnapshotCollection * * @throws \Zend\Http\Exception\RuntimeException * @throws \Zend\Http\Client\Exception\RuntimeException */ public function retrieve() { return $this->provider->generateSnapshots($this->client->send(), $this->request->getUrl()); }