public function FileTest::testMoveWithNewName in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-foundation/Tests/File/FileTest.php \Symfony\Component\HttpFoundation\Tests\File\FileTest::testMoveWithNewName()
File
- vendor/
symfony/ http-foundation/ Tests/ File/ FileTest.php, line 91
Class
Namespace
Symfony\Component\HttpFoundation\Tests\FileCode
public function testMoveWithNewName() {
$path = __DIR__ . '/Fixtures/test.copy.gif';
$targetDir = __DIR__ . '/Fixtures/directory';
$targetPath = $targetDir . '/test.newname.gif';
@unlink($path);
@unlink($targetPath);
copy(__DIR__ . '/Fixtures/test.gif', $path);
$file = new File($path);
$movedFile = $file
->move($targetDir, 'test.newname.gif');
$this
->assertTrue(file_exists($targetPath));
$this
->assertFalse(file_exists($path));
$this
->assertEquals(realpath($targetPath), $movedFile
->getRealPath());
@unlink($targetPath);
}