@@ -174,6 +174,7 @@ public function testDownloadToStream($input)
174
174
$ id = $ this ->bucket ->uploadFromStream ('filename ' , $ this ->createStream ($ input ));
175
175
$ destination = $ this ->createStream ();
176
176
$ this ->bucket ->downloadToStream ($ id , $ destination );
177
+ rewind ($ destination );
177
178
178
179
$ this ->assertStreamContents ($ input , $ destination );
179
180
}
@@ -208,30 +209,37 @@ public function testDownloadToStreamByName()
208
209
209
210
$ destination = $ this ->createStream ();
210
211
$ this ->bucket ->downloadToStreamByName ('filename ' , $ destination );
212
+ rewind ($ destination );
211
213
$ this ->assertStreamContents ('baz ' , $ destination );
212
214
213
215
$ destination = $ this ->createStream ();
214
216
$ this ->bucket ->downloadToStreamByName ('filename ' , $ destination , ['revision ' => -3 ]);
217
+ rewind ($ destination );
215
218
$ this ->assertStreamContents ('foo ' , $ destination );
216
219
217
220
$ destination = $ this ->createStream ();
218
221
$ this ->bucket ->downloadToStreamByName ('filename ' , $ destination , ['revision ' => -2 ]);
222
+ rewind ($ destination );
219
223
$ this ->assertStreamContents ('bar ' , $ destination );
220
224
221
225
$ destination = $ this ->createStream ();
222
226
$ this ->bucket ->downloadToStreamByName ('filename ' , $ destination , ['revision ' => -1 ]);
227
+ rewind ($ destination );
223
228
$ this ->assertStreamContents ('baz ' , $ destination );
224
229
225
230
$ destination = $ this ->createStream ();
226
231
$ this ->bucket ->downloadToStreamByName ('filename ' , $ destination , ['revision ' => 0 ]);
232
+ rewind ($ destination );
227
233
$ this ->assertStreamContents ('foo ' , $ destination );
228
234
229
235
$ destination = $ this ->createStream ();
230
236
$ this ->bucket ->downloadToStreamByName ('filename ' , $ destination , ['revision ' => 1 ]);
237
+ rewind ($ destination );
231
238
$ this ->assertStreamContents ('bar ' , $ destination );
232
239
233
240
$ destination = $ this ->createStream ();
234
241
$ this ->bucket ->downloadToStreamByName ('filename ' , $ destination , ['revision ' => 2 ]);
242
+ rewind ($ destination );
235
243
$ this ->assertStreamContents ('baz ' , $ destination );
236
244
}
237
245
0 commit comments