Commit 010751c7 authored by Katherine Walker's avatar Katherine Walker

Add testSeekBeforeReading()

parent be949d91
...@@ -190,6 +190,15 @@ class ReadableStreamFunctionalTest extends FunctionalTestCase ...@@ -190,6 +190,15 @@ class ReadableStreamFunctionalTest extends FunctionalTestCase
$stream->readBytes(-1); $stream->readBytes(-1);
} }
public function testSeekBeforeReading()
{
$fileDocument = $this->collectionWrapper->findFileById('length-10');
$stream = new ReadableStream($this->collectionWrapper, $fileDocument);
$stream->seek(8);
$this->assertSame('ij', $stream->readBytes(2));
}
/** /**
* @expectedException MongoDB\Exception\InvalidArgumentException * @expectedException MongoDB\Exception\InvalidArgumentException
* @expectedExceptionMessage $offset must be >= 0 and <= 10; given: 11 * @expectedExceptionMessage $offset must be >= 0 and <= 10; given: 11
......
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