sitecrafting / conifer

:evergreen_tree: A powerful WordPress library plugin for OO development
https://www.coniferplug.in
MIT License
18 stars 2 forks source link

Feature/filesystem tests #62

Closed dknoben closed 5 years ago

dknoben commented 5 years ago

Issue

Adding new unit tests to the site class that test methods that interact with the file system

Solution

I added a new composer package that creates a virtual file system for unit testing

Impact

We don't skip any tests in the site class anymore

Testing

Three new tests have been added to the site test class, but I did not add unit tests to test the new unit tests.

acobster commented 5 years ago

@dknoben I accidentally left these notes in a commit message instead of a GH comment, so not sure if you saw them. Just copying them here...

Nice job!

One minor piece of feedback: the whole point of use \org\bovigo\vfs\vfsStream; at the top is so that you don't have to do reference the fully qualified class name later. So

$this->file_system = \org\bovigo\vfs\vfsStream::setup('root', null, $structure);

can be shortened to:

$this->file_system = vfsStream::setup('root', null, $structure);

Leading slashes in use declarations are also unnecessary. :)

Thanks!