Refactored according to http://www.slashnode.com/mocking-filesystem-bdd-behat-phpspec/ - still don't really understand this, but maybe at some point in the future I'll come back and recognise what's going on here