Ejemplo n.º 1
0
 /**
  * @test
  */
 public function testRename()
 {
     $file = new Filesystem();
     $dir = static::getTempPath(__FUNCTION__);
     mkdir($dir);
     $file1 = rand(1, 10) . rand(0, getrandmax());
     $path1 = $dir . DIRECTORY_SEPARATOR . $file1;
     $file2 = rand(1, 10) . rand(0, getrandmax());
     $path2 = $dir . DIRECTORY_SEPARATOR . $file2;
     file_put_contents($path1, __FUNCTION__, FILE_APPEND);
     $this->assertFileExists($path1);
     $file->rename($path1, $path2);
     $this->assertFileExists($path2);
 }