Commit aa125b30 authored by Jeremy Mikola's avatar Jeremy Mikola

Revert "Explicitly rewind in-memory streams before asserting contents"

This reverts commit b251eb26, since readable GridFS streams now support seeking.
parent 480da55f
......@@ -187,7 +187,6 @@ class BucketFunctionalTest extends FunctionalTestCase
$id = $this->bucket->uploadFromStream('filename', $this->createStream($input));
$destination = $this->createStream();
$this->bucket->downloadToStream($id, $destination);
rewind($destination);
$this->assertStreamContents($input, $destination);
}
......@@ -222,37 +221,30 @@ class BucketFunctionalTest extends FunctionalTestCase
$destination = $this->createStream();
$this->bucket->downloadToStreamByName('filename', $destination);
rewind($destination);
$this->assertStreamContents('baz', $destination);
$destination = $this->createStream();
$this->bucket->downloadToStreamByName('filename', $destination, ['revision' => -3]);
rewind($destination);
$this->assertStreamContents('foo', $destination);
$destination = $this->createStream();
$this->bucket->downloadToStreamByName('filename', $destination, ['revision' => -2]);
rewind($destination);
$this->assertStreamContents('bar', $destination);
$destination = $this->createStream();
$this->bucket->downloadToStreamByName('filename', $destination, ['revision' => -1]);
rewind($destination);
$this->assertStreamContents('baz', $destination);
$destination = $this->createStream();
$this->bucket->downloadToStreamByName('filename', $destination, ['revision' => 0]);
rewind($destination);
$this->assertStreamContents('foo', $destination);
$destination = $this->createStream();
$this->bucket->downloadToStreamByName('filename', $destination, ['revision' => 1]);
rewind($destination);
$this->assertStreamContents('bar', $destination);
$destination = $this->createStream();
$this->bucket->downloadToStreamByName('filename', $destination, ['revision' => 2]);
rewind($destination);
$this->assertStreamContents('baz', $destination);
}
......
......@@ -38,7 +38,7 @@ abstract class FunctionalTestCase extends BaseFunctionalTestCase
{
$this->assertInternalType('resource', $stream);
$this->assertSame('stream', get_resource_type($stream));
$this->assertEquals($expectedContents, stream_get_contents($stream));
$this->assertEquals($expectedContents, stream_get_contents($stream, -1, 0));
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment