/**
  * Method to test copy().
  *
  * @return void
  *
  * @covers Windwalker\Filesystem\Folder::copy
  */
 public function testCopy()
 {
     Folder::delete(static::$dest);
     Folder::copy(static::$src, static::$dest);
     $this->assertTrue(is_dir(static::$dest));
     $this->assertFileExists(static::$dest . '/folder1/level2/file3');
 }
 /**
  * copy
  *
  * @param string  $src
  * @param string  $dest
  * @param bool    $force
  *
  * @return  bool
  */
 public static function copy($src, $dest, $force = false)
 {
     if (is_dir($src)) {
         Folder::copy($src, $dest, $force);
     } elseif (is_file($src)) {
         File::copy($src, $dest, $force);
     }
     return true;
 }
示例#3
0
 /**
  * copy
  *
  * @param string $src
  * @param string $dest
  *
  * @return  void
  */
 protected function copyFolder($src, $dest)
 {
     $this->out('<info>Create</info>: ' . $dest);
     if (is_dir($dest)) {
         Folder::delete($dest);
     }
     Folder::copy($src, $dest);
 }