/** * generateDirectoryStructure * * @param $destDir * @param array $dirs * @return $this */ public function generateDirectoryStructure($destDir, array $dirs = []) { foreach ($dirs as $dirPath) { $dirPath = Path::join($destDir, $dirPath); if (!$this->files->exists($dirPath)) { $this->files->makeDirectory($dirPath, 0755, true); } } return $this; }
public function testMakeDirectory() { $files = new Filesystem(); $this->assertTrue($files->makeDirectory(__DIR__ . '/foo')); $this->assertFileExists(__DIR__ . '/foo'); @rmdir(__DIR__ . '/foo'); }