public function vfsStreamWrapperFileTimesTestCase::writeFileChangesModificationTime in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperFileTimesTestCase.php \org\bovigo\vfs\vfsStreamWrapperFileTimesTestCase::writeFileChangesModificationTime()
@test @group issue_7
File
- vendor/
mikey179/ vfsStream/ src/ test/ php/ org/ bovigo/ vfs/ vfsStreamWrapperFileTimesTestCase.php, line 155
Class
Namespace
org\bovigo\vfsCode
public function writeFileChangesModificationTime() {
$file = vfsStream::newFile('foo.txt')
->at(vfsStreamWrapper::getRoot())
->lastModified(100)
->lastAccessed(100)
->lastAttributeModified(100);
$fp = fopen($this->fooUrl, 'wb');
$openTime = time();
sleep(2);
fwrite($fp, 'test');
fclose($fp);
$this
->assertLessThanOrEqual($openTime + 3, filemtime($this->fooUrl));
$this
->assertLessThanOrEqual($openTime, fileatime($this->fooUrl));
$this
->assertEquals(100, filectime($this->fooUrl));
$this
->assertFileTimesEqualStreamTimes($this->fooUrl, $file);
}