You are here

public function vfsStreamTestCase::copyFromWithSubFolders in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamTestCase.php \org\bovigo\vfs\vfsStreamTestCase::copyFromWithSubFolders()

@test @group issue_4 @since 0.11.0

File

vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamTestCase.php, line 634

Class

vfsStreamTestCase
Test for org\bovigo\vfs\vfsStream.

Namespace

org\bovigo\vfs

Code

public function copyFromWithSubFolders() {
  $baseDir = vfsStream::copyFromFileSystem($this
    ->getFileSystemCopyDir(), vfsStream::newDirectory('test'), 3);
  $this
    ->assertTrue($baseDir
    ->hasChildren());
  $this
    ->assertTrue($baseDir
    ->hasChild('emptyFolder'));
  $this
    ->assertTrue($baseDir
    ->hasChild('withSubfolders'));
  $subfolderDir = $baseDir
    ->getChild('withSubfolders');
  $this
    ->assertTrue($subfolderDir
    ->hasChild('subfolder1'));
  $this
    ->assertTrue($subfolderDir
    ->getChild('subfolder1')
    ->hasChild('file1.txt'));
  $this
    ->assertVfsFile($subfolderDir
    ->getChild('subfolder1/file1.txt'), '      ');
  $this
    ->assertTrue($subfolderDir
    ->hasChild('subfolder2'));
  $this
    ->assertTrue($subfolderDir
    ->hasChild('aFile.txt'));
  $this
    ->assertVfsFile($subfolderDir
    ->getChild('aFile.txt'), 'foo');
}