/** * @expectedException Google\Cloud\Exception\GoogleException */ public function testThrowsExceptionWithFailedUpload() { $resumeUriResponse = new Response(200, ['Location' => 'theResumeUri']); $this->requestWrapper->send(Argument::which('getMethod', 'POST'), Argument::type('array'))->willReturn($resumeUriResponse); $this->requestWrapper->send(Argument::which('getMethod', 'PUT'), Argument::type('array'))->willThrow('Google\\Cloud\\Exception\\GoogleException'); $uploader = new ResumableUploader($this->requestWrapper->reveal(), $this->stream, 'http://www.example.com'); $uploader->upload(); }