public function vfsStreamTestCase::copyFromPreservesFilePermissions in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamTestCase.php \org\bovigo\vfs\vfsStreamTestCase::copyFromPreservesFilePermissions()
@test @group issue_4 @group issue_29 @since 0.11.2
File
- vendor/
mikey179/ vfsStream/ src/ test/ php/ org/ bovigo/ vfs/ vfsStreamTestCase.php, line 684
Class
- vfsStreamTestCase
- Test for org\bovigo\vfs\vfsStream.
Namespace
org\bovigo\vfsCode
public function copyFromPreservesFilePermissions() {
if (DIRECTORY_SEPARATOR !== '/') {
$this
->markTestSkipped('Only applicable on Linux style systems.');
}
$copyDir = $this
->getFileSystemCopyDir();
$root = vfsStream::setup();
$this
->assertEquals($root, vfsStream::copyFromFileSystem($copyDir, null));
$this
->assertEquals(fileperms($copyDir . '/withSubfolders') - vfsStreamContent::TYPE_DIR, $root
->getChild('withSubfolders')
->getPermissions());
$this
->assertEquals(fileperms($copyDir . '/withSubfolders/aFile.txt') - vfsStreamContent::TYPE_FILE, $root
->getChild('withSubfolders/aFile.txt')
->getPermissions());
}