/** * @test * @group issue_4 * @group issue_29 * @since 0.11.2 */ 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()); }
/** * To test this the max file size is reduced to something reproduceable. * * @test * @group issue_91 * @since 1.5.0 */ public function copyFromFileSystemMocksLargeFiles() { if (DIRECTORY_SEPARATOR !== '/') { $this->markTestSkipped('Only applicable on Linux style systems.'); } $copyDir = $this->getFileSystemCopyDir(); $root = vfsStream::setup(); vfsStream::copyFromFileSystem($copyDir, $root, 3); $this->assertEquals(' ', $root->getChild('withSubfolders/subfolder1/file1.txt')->getContent()); }