/** * Dump current files structure * * @return array */ public function dump() { $currentRoot = StreamWrapper::getRoot(); if (!$currentRoot) { return array(); } $visitor = new StreamVisitor(); $visitor->visit($currentRoot); return $visitor->getStructure(); }
/** * @test */ public function visitRecursiveDirectoryStructure() { $root = vfsStream::setup('root', null, array('test' => array('foo' => array('test.txt' => 'hello'), 'baz.txt' => 'world'), 'foo.txt' => '')); $structureVisitor = new vfsStreamStructureVisitor(); $this->assertEquals(array('root' => array('test' => array('foo' => array('test.txt' => 'hello'), 'baz.txt' => 'world'), 'foo.txt' => '')), $structureVisitor->visitDirectory($root)->getStructure()); }