org\bovigo\vfs\vfsStreamWrapperFileTimesTestCase::renameFileChangesAttributeAndModificationTimeOfAffectedDirectories PHP Метод

renameFileChangesAttributeAndModificationTimeOfAffectedDirectories() публичный Метод

    public function renameFileChangesAttributeAndModificationTimeOfAffectedDirectories()
    {
        $target = vfsStream::newDirectory('target')->at(vfsStreamWrapper::getRoot())->lastModified(200)->lastAccessed(200)->lastAttributeModified(200);
        $source = vfsStream::newDirectory('bar')->at(vfsStreamWrapper::getRoot());
        $file = vfsStream::newFile('baz.txt')->at($source)->lastModified(300)->lastAccessed(300)->lastAttributeModified(300);
        $source->lastModified(100)->lastAccessed(100)->lastAttributeModified(100);
        rename($this->bazUrl, vfsStream::url('root/target/baz.txt'));
        $this->assertLessThanOrEqual(time(), filemtime($this->barUrl));
        $this->assertLessThanOrEqual(time(), filectime($this->barUrl));
        $this->assertEquals(100, fileatime($this->barUrl));
        $this->assertFileTimesEqualStreamTimes($this->barUrl, $source);
        $this->assertLessThanOrEqual(time(), filemtime(vfsStream::url('root/target')));
        $this->assertLessThanOrEqual(time(), filectime(vfsStream::url('root/target')));
        $this->assertEquals(200, fileatime(vfsStream::url('root/target')));
        $this->assertFileTimesEqualStreamTimes(vfsStream::url('root/target'), $target);
    }