bovigo / vfsStream

vfsStream is a stream wrapper for a virtual file system that may be helpful in unit tests to mock the real file system. It can be used with any unit test framework, like PHPUnit or SimpleTest.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vfsStream::newDirectory() does not return result when called recursively [not a bug, closed]

yyaremenko opened this issue · comments

The result of following code line is never used:

self::newDirectory($subDirs, $permissions)->at($directory);

If I understand things correctly the code should look as follows

        ...
        $directory = new vfsStreamDirectory($ownName, $permissions);

        return is_string($subDirs) && strlen($subDirs) > 0
            ? self::newDirectory($subDirs, $permissions)->at($directory)
            : $directory;

sorry, looks like this is an expected code behaviour, though it looks a bit confusing on a first sight