You are here

public function FileTest::testMoveWithNonLatinName in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Tests/File/FileTest.php \Symfony\Component\HttpFoundation\Tests\File\FileTest::testMoveWithNonLatinName()

@dataProvider getFilenameFixtures

File

vendor/symfony/http-foundation/Tests/File/FileTest.php, line 125

Class

FileTest

Namespace

Symfony\Component\HttpFoundation\Tests\File

Code

public function testMoveWithNonLatinName($filename, $sanitizedFilename) {
  $path = __DIR__ . '/Fixtures/' . $sanitizedFilename;
  $targetDir = __DIR__ . '/Fixtures/directory/';
  $targetPath = $targetDir . $sanitizedFilename;
  @unlink($path);
  @unlink($targetPath);
  copy(__DIR__ . '/Fixtures/test.gif', $path);
  $file = new File($path);
  $movedFile = $file
    ->move($targetDir, $filename);
  $this
    ->assertInstanceOf('Symfony\\Component\\HttpFoundation\\File\\File', $movedFile);
  $this
    ->assertTrue(file_exists($targetPath));
  $this
    ->assertFalse(file_exists($path));
  $this
    ->assertEquals(realpath($targetPath), $movedFile
    ->getRealPath());
  @unlink($targetPath);
}