move() 공개 정적인 메소드

Moves file from the source to the destination, throws FileNotFoundException if the source directory does not exist.
public static move ( string $sourcePath, string $destinationPath ) : boolean
$sourcePath string
$destinationPath string
리턴 boolean
예제 #1
0
 /**
  * @test
  */
 public function shouldMoveFile()
 {
     //given
     $filePath = Path::joinWithTemp('files_test');
     file_put_contents($filePath, 'test');
     $newPath = Path::joinWithTemp('new_files_test');
     //when
     $isMoved = Files::move($filePath, $newPath);
     //then
     $this->assertTrue($isMoved);
     $this->assertFileNotExists($filePath);
     $this->assertFileExists($newPath);
     Files::delete($newPath);
 }