public function FileTest::testMoveToAnUnexistentDirectory 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::testMoveToAnUnexistentDirectory()
File
- vendor/
symfony/ http-foundation/ Tests/ File/ FileTest.php, line 145
Class
Namespace
Symfony\Component\HttpFoundation\Tests\FileCode
public function testMoveToAnUnexistentDirectory() {
$sourcePath = __DIR__ . '/Fixtures/test.copy.gif';
$targetDir = __DIR__ . '/Fixtures/directory/sub';
$targetPath = $targetDir . '/test.copy.gif';
@unlink($sourcePath);
@unlink($targetPath);
@rmdir($targetDir);
copy(__DIR__ . '/Fixtures/test.gif', $sourcePath);
$file = new File($sourcePath);
$movedFile = $file
->move($targetDir);
$this
->assertFileExists($targetPath);
$this
->assertFileNotExists($sourcePath);
$this
->assertEquals(realpath($targetPath), $movedFile
->getRealPath());
@unlink($sourcePath);
@unlink($targetPath);
@rmdir($targetDir);
}