public function vfsStreamFileTestCase::read in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamFileTestCase.php \org\bovigo\vfs\vfsStreamFileTestCase::read()
test reading contents from the file
@test
File
- vendor/
mikey179/ vfsStream/ src/ test/ php/ org/ bovigo/ vfs/ vfsStreamFileTestCase.php, line 92
Class
Namespace
org\bovigo\vfsCode
public function read() {
$this->file
->setContent('foobarbaz');
$this
->assertFalse($this->file
->eof());
$this
->assertEquals(9, $this->file
->size());
$this
->assertEquals('foo', $this->file
->read(3));
$this
->assertEquals(3, $this->file
->getBytesRead());
$this
->assertFalse($this->file
->eof());
$this
->assertEquals(9, $this->file
->size());
$this
->assertEquals('bar', $this->file
->read(3));
$this
->assertEquals(6, $this->file
->getBytesRead());
$this
->assertFalse($this->file
->eof());
$this
->assertEquals(9, $this->file
->size());
$this
->assertEquals('baz', $this->file
->read(3));
$this
->assertEquals(9, $this->file
->getBytesRead());
$this
->assertEquals(9, $this->file
->size());
$this
->assertTrue($this->file
->eof());
$this
->assertEquals('', $this->file
->read(3));
}