本文整理汇总了PHP中vfsStream::copyFromFileSystem方法的典型用法代码示例。如果您正苦于以下问题:PHP vfsStream::copyFromFileSystem方法的具体用法?PHP vfsStream::copyFromFileSystem怎么用?PHP vfsStream::copyFromFileSystem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vfsStream
的用法示例。
在下文中一共展示了vfsStream::copyFromFileSystem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: copyFromPreservesFilePermissions
/**
* @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());
}
示例2: copyFromFileSystemMocksLargeFiles
/**
* 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());
}