Use icecave/isolator to mock filesystem and getenv. - #6
Conversation
Discussed in dnoegel#4, this uses the Isolator class (really just a mock, but its nice to have something to point to) in order to mock out filesystem calls. These changes mean that the actual filesystem is no longer touched when running the tests.
There was a problem hiding this comment.
This rmdir call doesn't seem right to me. Shouldn't this be unlink instead as the $fallback isn't a directory and rmdir wouldn't work?
|
I created a alternative for this in PR #7, at least for the I'm not certain about your The I added the tests that write to the filesystem to the "filesystem" group in the phpunit tests, so they can be skipped. In the future I would like to separate the |
|
You are right about the order of things being tricky. I'd much rather see things split out into something else that could be mocked away more easily without the complicated series of mocks. But why do you think that it should run against a real filesystem? We don't need to make sure that I wholeheartedly agree that things could be factored out differently in order to reduce the amount of calls that are being made by the function under test. |
Discussed in #4, this uses the Isolator class (really just a mock, but its nice to have something to point to) in order to mock out filesystem calls. These changes mean that the actual filesystem is no longer touched when running the tests.