mikey179/vfsStream — Issue #23: unlink empty directory
Author: wiltave
Created: 2011-10-24 15:16:00+00:00
State: open

I've tried to learn TDD using PHPUnit with vfsStream. Using PHP's unlink in a directory normally raises up an warning ("Warning: unlink(/tmp/foo): Operation not permitted in ..."). Empty directories must be removed with rmdir. Doing the same with vfsStreamDirectory doesn't return an warning. I don't know if I'm missing something or if it's a real bug.

Test:

```php
addChild(vfsStream::newDirectory('dir'));
$recursiveDelete = new Recursive_Delete(vfsStream::url('root/dir'));
$recursiveDelete->delete();
$this->assertFileNotExists(vfsStream::url('root/dir'));
}
}
```

Production code:

```php
_file = $file;
}

public function delete()
{
unlink($this->_file);
}
}
```

Thank you very much.