/** * Test move method * * @return void * * @covers Joomla\Filesystem\File::move * @since 1.0 */ public function testMove() { $name = 'tempFile'; $path = __DIR__; $movedFileName = 'movedTempFile'; $data = 'Lorem ipsum dolor sit amet'; // Create a temp file to test copy operation $this->object->write($path . '/' . $name, $data); $this->assertThat(File::move($path . '/' . $name, $path . '/' . $movedFileName), $this->isTrue(), 'Line:' . __LINE__ . ' File should be moved successfully.'); $this->assertThat(File::move($movedFileName, $name, $path), $this->isTrue(), 'Line:' . __LINE__ . ' File should be moved successfully.'); // Using streams. $this->assertThat(File::move($name, $movedFileName, $path, true), $this->isTrue(), 'Line:' . __LINE__ . ' File should be moved successfully.'); File::delete($path . '/' . $movedFileName); }