/** * @test */ public function visitFileWritesBlockDeviceToStream() { $output = vfsStream::newFile('foo.txt')->at(vfsStream::setup()); $printVisitor = new vfsStreamPrintVisitor(fopen('vfs://root/foo.txt', 'wb')); $this->assertSame($printVisitor, $printVisitor->visitBlockDevice(vfsStream::newBlock('bar'))); $this->assertEquals("- [bar]\n", $output->getContent()); }
/** * @test */ public function visitFileCreatesStructureForBlock() { $structureVisitor = new vfsStreamStructureVisitor(); $this->assertEquals(array('[foo]' => 'test'), $structureVisitor->visitBlockDevice(vfsStream::newBlock('foo')->withContent('test'))->getStructure()); }