You are here

public function vfsStreamPrintVisitorTestCase::visitRecursiveDirectoryStructure in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/visitor/vfsStreamPrintVisitorTestCase.php \org\bovigo\vfs\visitor\vfsStreamPrintVisitorTestCase::visitRecursiveDirectoryStructure()

@test

File

vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/visitor/vfsStreamPrintVisitorTestCase.php, line 86

Class

vfsStreamPrintVisitorTestCase
Test for org\bovigo\vfs\visitor\vfsStreamPrintVisitor.

Namespace

org\bovigo\vfs\visitor

Code

public function visitRecursiveDirectoryStructure() {
  $root = vfsStream::setup('root', null, array(
    'test' => array(
      'foo' => array(
        'test.txt' => 'hello',
      ),
      'baz.txt' => 'world',
    ),
    'foo.txt' => '',
  ));
  $printVisitor = new vfsStreamPrintVisitor(fopen('vfs://root/foo.txt', 'wb'));
  $this
    ->assertSame($printVisitor, $printVisitor
    ->visitDirectory($root));
  $this
    ->assertEquals("- root\n  - test\n    - foo\n      - test.txt\n    - baz.txt\n  - foo.txt\n", file_get_contents('vfs://root/foo.txt'));
}