public function testDownloadToFile()
{
$snippet = $this->snippetFromMethod(StorageObject::class, 'downloadToFile');
$snippet->addLocal('object', $this->object);
$snippet->replace("__DIR__ . '/my-file.txt'", "'php://temp'");
$this->connection->downloadObject(Argument::any())->shouldBeCalled()->willReturn(\GuzzleHttp\Psr7\stream_for('test'));
$this->object->setConnection($this->connection->reveal());
$res = $snippet->invoke('stream');
$this->assertInstanceOf(StreamInterface::class, $res->returnVal());
}