Example #1
0
 public function testBasicProperties()
 {
     $stream = $this->makeStream('some text here and things');
     $buffer = new StreamBuffer($stream);
     static::assertEquals(0, $buffer->getPosition());
     static::assertEquals('', $buffer->getContents());
     static::assertEquals(0, $buffer->getLength());
     static::assertTrue($buffer->isEof());
     static::assertFalse($buffer->isSourceEof());
     $buffer->read();
     static::assertEquals(0, $buffer->getPosition());
     static::assertEquals('some text here and things', $buffer->getContents());
     static::assertEquals(25, $buffer->getLength());
     static::assertFalse($buffer->isEof());
     static::assertFalse($buffer->isSourceEof());
     $buffer->read();
     static::assertTrue($buffer->isSourceEof());
 }