Elgg\Filesystem\DirectoryTest::testPathsCannotContainDots PHP Method

testPathsCannotContainDots() public method

public testPathsCannotContainDots ( Elgg\Filesystem\Directory $directory )
$directory Elgg\Filesystem\Directory
    public function testPathsCannotContainDots(Directory $directory)
    {
        $funcs = [function () use($directory) {
            $directory->chroot('.');
        }, function () use($directory) {
            $directory->chroot('..');
        }, function () use($directory) {
            $directory->getFile('.');
        }, function () use($directory) {
            $directory->getFile('..');
        }];
        foreach ($funcs as $i => $f) {
            try {
                $f();
                $this->fail("A path was allowed to contain . or .. in function #{$i}");
            } catch (\InvalidArgumentException $e) {
            }
        }
    }