org\bovigo\vfs\vfsStreamWrapperFileTimesTestCase::readFileChangesAccessTime PHP Method

readFileChangesAccessTime() public method

    public function readFileChangesAccessTime()
    {
        $file = vfsStream::newFile('foo.txt')->withContent('test')->at(vfsStreamWrapper::getRoot())->lastModified(100)->lastAccessed(100)->lastAttributeModified(100);
        $fp = fopen($this->fooUrl, 'rb');
        $openTime = time();
        sleep(2);
        fread($fp, 1024);
        fclose($fp);
        $this->assertLessThanOrEqual($openTime, filemtime($this->fooUrl));
        $this->assertLessThanOrEqual($openTime + 3, fileatime($this->fooUrl));
        $this->assertEquals(100, filectime($this->fooUrl));
        $this->assertFileTimesEqualStreamTimes($this->fooUrl, $file);
    }