public function testUploadEncryption()
{
$snippet = $this->snippetFromMethod(Bucket::class, 'upload', 2);
$snippet->addLocal('bucket', $this->bucket);
$snippet->replace("__DIR__ . '/image.jpg'", '"php://temp"');
$uploader = $this->prophesize(MultipartUploader::class);
$uploader->upload()->shouldBeCalled()->willReturn(['name' => 'Foo', 'generation' => 'Bar']);
$this->connection->insertObject(Argument::any())->shouldBeCalled()->willReturn($uploader->reveal());
$this->bucket->setConnection($this->connection->reveal());
$res = $snippet->invoke('object');
$this->assertInstanceOf(StorageObject::class, $res->returnVal());
}