diff --git a/tests/Library/Benzina/StreamTest.php b/tests/Library/Benzina/StreamTest.php new file mode 100644 index 0000000..21c3062 --- /dev/null +++ b/tests/Library/Benzina/StreamTest.php @@ -0,0 +1,35 @@ +stream = new Stream(\str_repeat("0", self::STREAM_SIZE)); + } + + public function testStreamReadsLength() + { + $chunk = $this->stream->read(self::CHUNK_SIZE + 1); + + $this->assertEquals(\str_repeat("0", self::CHUNK_SIZE), $chunk); + } + + public function testStreamTells() + { + $this->assertEquals(0, $this->stream->tell()); + + $chunk = $this->stream->read(self::CHUNK_SIZE); + + $this->assertEquals(\strlen($chunk), $this->stream->tell()); + } +}