/** * @dataProvider emptyDirectoryProvider */ 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) { } } }