Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fe028c9

Browse files
committed
Fixed FileTest::testRename to work for windows file system.
1 parent f946355 commit fe028c9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ public function testMove()
9696
public function testRename()
9797
{
9898
$path = __DIR__.'/Fixtures/test.copy.gif';
99-
$targetPath = __DIR__.'/Fixtures/test.target.gif';
99+
$targetPath = realpath(__DIR__.'/Fixtures') . DIRECTORY_SEPARATOR . 'test.target.gif';
100100
@unlink($path);
101101
@unlink($targetPath);
102-
copy(__DIR__.'/Fixtures/test.gif', $path);
102+
copy(realpath(__DIR__.'/Fixtures/test.gif'), $path);
103103

104104
$file = new File($path);
105105
$file->rename('test.target.gif');

tests/bootstrap.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* file that was distributed with this source code.
1010
*/
1111

12+
date_default_timezone_set('Europe/Paris');
13+
1214
if (file_exists($file = __DIR__.'/../autoload.php')) {
1315
require_once $file;
1416
} elseif (file_exists($file = __DIR__.'/../autoload.php.dist')) {

0 commit comments

Comments
 (0)