php-vfs icon indicating copy to clipboard operation
php-vfs copied to clipboard

scandir call doesn't return '.' and '..' pseudofolders

Open etki opened this issue 10 years ago • 2 comments

Hi. It seems that php-vfs doesn't return default . and .. pseudo folders on scandir call, so i'm having problems in setting up an environment that would repeat real one.

etki avatar May 17 '15 05:05 etki

Can you show me how are you initialising the filesystem?

Sent from my phone.

On 17 May 2015, at 06:30, Etki [email protected] wrote:

Hi. It seems that php-vfs doesn't return default . and .. pseudo folders on scandir call, so i'm having problems in setting up an environment that would repeat real one.

— Reply to this email directly or view it on GitHub.

michael-donat avatar May 17 '15 06:05 michael-donat

Here it goes

use VirtualFileSystem\FileSystem as VFS;
class CleanerTest extends AbstractTest
{
    // ...
    protected function setUp()
    {
        $this->vfs = new VFS;
    }
    protected function tearDown()
    {
        unset($this->vfs);
    }
    private function getVfsRoot()
    {
        return $this->vfs->path('/');
    }
    public function testCleaner()
    {
        // ...
        $initialContent = scandir($this->getVfsRoot());
        // ...
    }
    // ...
}

I've tried to use /tmp (non-root directory) as well, but it returned empty array on scandir() as well.

etki avatar May 17 '15 09:05 etki