public function vfsStreamWrapperFileTestCase::usingFilePointer in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperFileTestCase.php \org\bovigo\vfs\vfsStreamWrapperFileTestCase::usingFilePointer()
using a file pointer should work without any problems
@test
File
- vendor/
mikey179/ vfsStream/ src/ test/ php/ org/ bovigo/ vfs/ vfsStreamWrapperFileTestCase.php, line 119
Class
Namespace
org\bovigo\vfsCode
public function usingFilePointer() {
$fp = fopen($this->baz1URL, 'r');
$this
->assertEquals(0, ftell($fp));
$this
->assertFalse(feof($fp));
$this
->assertEquals(0, fseek($fp, 2));
$this
->assertEquals(2, ftell($fp));
$this
->assertEquals(0, fseek($fp, 1, SEEK_CUR));
$this
->assertEquals(3, ftell($fp));
$this
->assertEquals(0, fseek($fp, 1, SEEK_END));
$this
->assertEquals(6, ftell($fp));
$this
->assertTrue(feof($fp));
$this
->assertEquals(0, fseek($fp, 2));
$this
->assertFalse(feof($fp));
$this
->assertEquals(2, ftell($fp));
$this
->assertEquals('z', fread($fp, 1));
$this
->assertEquals(3, ftell($fp));
$this
->assertEquals(' 1', fread($fp, 8092));
$this
->assertEquals(5, ftell($fp));
$this
->assertTrue(fclose($fp));
}