You are here

public function vfsStreamTestCase::copyFromWithSubFoldersWithRoot 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::copyFromWithSubFoldersWithRoot()

@test @group issue_4 @since 0.11.0

File

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

Class

vfsStreamTestCase
Test for org\bovigo\vfs\vfsStream.

Namespace

org\bovigo\vfs

Code

public function copyFromWithSubFoldersWithRoot() {
  $root = vfsStream::setup();
  $this
    ->assertEquals($root, vfsStream::copyFromFileSystem($this
    ->getFileSystemCopyDir(), null, 3));
  $this
    ->assertTrue($root
    ->hasChildren());
  $this
    ->assertTrue($root
    ->hasChild('emptyFolder'));
  $this
    ->assertTrue($root
    ->hasChild('withSubfolders'));
  $subfolderDir = $root
    ->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');
}