Skip to content

Commit 010751c

Browse files
committed
Add testSeekBeforeReading()
1 parent be949d9 commit 010751c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/GridFS/ReadableStreamFunctionalTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,15 @@ public function testReadBytesWithNegativeLength()
190190
$stream->readBytes(-1);
191191
}
192192

193+
public function testSeekBeforeReading()
194+
{
195+
$fileDocument = $this->collectionWrapper->findFileById('length-10');
196+
$stream = new ReadableStream($this->collectionWrapper, $fileDocument);
197+
198+
$stream->seek(8);
199+
$this->assertSame('ij', $stream->readBytes(2));
200+
}
201+
193202
/**
194203
* @expectedException MongoDB\Exception\InvalidArgumentException
195204
* @expectedExceptionMessage $offset must be >= 0 and <= 10; given: 11

0 commit comments

Comments
 (0)