@@ -174,6 +174,7 @@ public function testDownloadToStream($input)
174174 $ id = $ this ->bucket ->uploadFromStream ('filename ' , $ this ->createStream ($ input ));
175175 $ destination = $ this ->createStream ();
176176 $ this ->bucket ->downloadToStream ($ id , $ destination );
177+ rewind ($ destination );
177178
178179 $ this ->assertStreamContents ($ input , $ destination );
179180 }
@@ -208,30 +209,37 @@ public function testDownloadToStreamByName()
208209
209210 $ destination = $ this ->createStream ();
210211 $ this ->bucket ->downloadToStreamByName ('filename ' , $ destination );
212+ rewind ($ destination );
211213 $ this ->assertStreamContents ('baz ' , $ destination );
212214
213215 $ destination = $ this ->createStream ();
214216 $ this ->bucket ->downloadToStreamByName ('filename ' , $ destination , ['revision ' => -3 ]);
217+ rewind ($ destination );
215218 $ this ->assertStreamContents ('foo ' , $ destination );
216219
217220 $ destination = $ this ->createStream ();
218221 $ this ->bucket ->downloadToStreamByName ('filename ' , $ destination , ['revision ' => -2 ]);
222+ rewind ($ destination );
219223 $ this ->assertStreamContents ('bar ' , $ destination );
220224
221225 $ destination = $ this ->createStream ();
222226 $ this ->bucket ->downloadToStreamByName ('filename ' , $ destination , ['revision ' => -1 ]);
227+ rewind ($ destination );
223228 $ this ->assertStreamContents ('baz ' , $ destination );
224229
225230 $ destination = $ this ->createStream ();
226231 $ this ->bucket ->downloadToStreamByName ('filename ' , $ destination , ['revision ' => 0 ]);
232+ rewind ($ destination );
227233 $ this ->assertStreamContents ('foo ' , $ destination );
228234
229235 $ destination = $ this ->createStream ();
230236 $ this ->bucket ->downloadToStreamByName ('filename ' , $ destination , ['revision ' => 1 ]);
237+ rewind ($ destination );
231238 $ this ->assertStreamContents ('bar ' , $ destination );
232239
233240 $ destination = $ this ->createStream ();
234241 $ this ->bucket ->downloadToStreamByName ('filename ' , $ destination , ['revision ' => 2 ]);
242+ rewind ($ destination );
235243 $ this ->assertStreamContents ('baz ' , $ destination );
236244 }
237245
0 commit comments