Assuming you have the following tree and you want file operations on it, this is the minimum PHP you have to write to test it.
$ tree foo
foo
`-- bar
1 directory, 0 files
Add this to your composer.json
:
{
"require-dev": {
"mikey179/vfsStream": "*"
}
}
Here's a shiny example test case:
<?php
use org\bovigo\vfs\vfsStream;
class DirTest extends \PHPUnit_Framework_TestCase
{
public function testSimple()
{
vfsStream::setup('my-root', 'null', ['foo' => ['bar' => []]]);
$this->assertTrue(file_exists(vfsStream::url('my-root/foo')));
}
}