本文整理匯總了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());
}