Exemplo n.º 1
0
 /**
  * @param $source
  * @param $target
  */
 protected function mirror($source, $target)
 {
     $isDir = $this->filesystem->isDir($source);
     $targetDir = $isDir ? $target : dirname($target);
     if (!$this->filesystem->exists($targetDir)) {
         $this->filesystem->mkdir($targetDir);
     }
     if ($isDir) {
         $this->filesystem->mirror($source, $target);
     } else {
         $this->filesystem->copy($source, $target);
     }
 }
Exemplo n.º 2
0
 /**
  * @param $path
  * @param $isDir
  * @dataProvider provideIsDirTestCases
  */
 public function testIsDir($path, $isDir)
 {
     $filesystem = new Filesystem();
     $actual = $filesystem->isDir($path);
     $this->assertEquals($isDir, $actual);
 }