public function testRename() { $pathOld = 'temp/the-file-formerly-known-as.txt'; $pathNew = 'temp/the-file.txt'; $file = new File($this->filesystem, $pathOld); $this->assertFalse($file->exists()); $file->write('Writing tests is so much fun… everyone should do it!'); $file->rename($pathNew); $newFile = new File($this->filesystem, $pathNew); $this->assertSame('Writing tests is so much fun… everyone should do it!', $newFile->read()); }