Google\Cloud\Tests\Storage\Connection\RestTest::testDownloadObject PHP Method

testDownloadObject() public method

public testDownloadObject ( )
    public function testDownloadObject()
    {
        $actualRequest = null;
        $response = new Response(200, [], $this->successBody);
        $this->requestWrapper->send(Argument::type('Psr\\Http\\Message\\RequestInterface'), Argument::type('array'))->will(function ($args) use(&$actualRequest, $response) {
            $actualRequest = $args[0];
            return $response;
        });
        $rest = new Rest();
        $rest->setRequestWrapper($this->requestWrapper->reveal());
        $actualBody = $rest->downloadObject(['bucket' => 'bigbucket', 'object' => 'myfile.txt', 'generation' => 100, 'httpOptions' => ['debug' => true], 'retries' => 0]);
        $actualUri = (string) $actualRequest->getUri();
        $this->assertEquals($this->successBody, $actualBody);
        $this->assertEquals('https://storage.googleapis.com/bigbucket/myfile.txt?generation=100&alt=media', $actualUri);
    }