From fe028c91fecbe3c1ae624bd4c3189b5ff5baec3e Mon Sep 17 00:00:00 2001 From: umpirsky Date: Fri, 7 Jan 2011 14:53:41 +0100 Subject: [PATCH 1/4] Fixed FileTest::testRename to work for windows file system. --- .../Symfony/Tests/Component/HttpFoundation/File/FileTest.php | 4 ++-- tests/bootstrap.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php b/tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php index c6b953d032eb0..224efa89d9284 100644 --- a/tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php +++ b/tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php @@ -96,10 +96,10 @@ public function testMove() public function testRename() { $path = __DIR__.'/Fixtures/test.copy.gif'; - $targetPath = __DIR__.'/Fixtures/test.target.gif'; + $targetPath = realpath(__DIR__.'/Fixtures') . DIRECTORY_SEPARATOR . 'test.target.gif'; @unlink($path); @unlink($targetPath); - copy(__DIR__.'/Fixtures/test.gif', $path); + copy(realpath(__DIR__.'/Fixtures/test.gif'), $path); $file = new File($path); $file->rename('test.target.gif'); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index fb080edd1bea2..2302d13bdedb0 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -9,6 +9,8 @@ * file that was distributed with this source code. */ +date_default_timezone_set('Europe/Paris'); + if (file_exists($file = __DIR__.'/../autoload.php')) { require_once $file; } elseif (file_exists($file = __DIR__.'/../autoload.php.dist')) { From 2e38dade3f160f2fc530b4655a1a37a59e927d04 Mon Sep 17 00:00:00 2001 From: umpirsky Date: Fri, 7 Jan 2011 14:56:37 +0100 Subject: [PATCH 2/4] Revert "Fixed FileTest::testRename to work for windows file system." This reverts commit fe028c91fecbe3c1ae624bd4c3189b5ff5baec3e. --- .../Symfony/Tests/Component/HttpFoundation/File/FileTest.php | 4 ++-- tests/bootstrap.php | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php b/tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php index 224efa89d9284..c6b953d032eb0 100644 --- a/tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php +++ b/tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php @@ -96,10 +96,10 @@ public function testMove() public function testRename() { $path = __DIR__.'/Fixtures/test.copy.gif'; - $targetPath = realpath(__DIR__.'/Fixtures') . DIRECTORY_SEPARATOR . 'test.target.gif'; + $targetPath = __DIR__.'/Fixtures/test.target.gif'; @unlink($path); @unlink($targetPath); - copy(realpath(__DIR__.'/Fixtures/test.gif'), $path); + copy(__DIR__.'/Fixtures/test.gif', $path); $file = new File($path); $file->rename('test.target.gif'); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 2302d13bdedb0..fb080edd1bea2 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -9,8 +9,6 @@ * file that was distributed with this source code. */ -date_default_timezone_set('Europe/Paris'); - if (file_exists($file = __DIR__.'/../autoload.php')) { require_once $file; } elseif (file_exists($file = __DIR__.'/../autoload.php.dist')) { From 4d222e2d8c39a684047839dab72dc0e809908f49 Mon Sep 17 00:00:00 2001 From: umpirsky Date: Fri, 7 Jan 2011 15:02:22 +0100 Subject: [PATCH 3/4] Fixed FileTest::testRename to work for windows file system. --- .../Symfony/Tests/Component/HttpFoundation/File/FileTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php b/tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php index c6b953d032eb0..224efa89d9284 100644 --- a/tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php +++ b/tests/Symfony/Tests/Component/HttpFoundation/File/FileTest.php @@ -96,10 +96,10 @@ public function testMove() public function testRename() { $path = __DIR__.'/Fixtures/test.copy.gif'; - $targetPath = __DIR__.'/Fixtures/test.target.gif'; + $targetPath = realpath(__DIR__.'/Fixtures') . DIRECTORY_SEPARATOR . 'test.target.gif'; @unlink($path); @unlink($targetPath); - copy(__DIR__.'/Fixtures/test.gif', $path); + copy(realpath(__DIR__.'/Fixtures/test.gif'), $path); $file = new File($path); $file->rename('test.target.gif'); From f598182afc54972c677952d8b32a75cdd32a1a6c Mon Sep 17 00:00:00 2001 From: umpirsky Date: Fri, 7 Jan 2011 15:09:46 +0100 Subject: [PATCH 4/4] Set default timezone on bootstrap. --- tests/bootstrap.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index fb080edd1bea2..2302d13bdedb0 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -9,6 +9,8 @@ * file that was distributed with this source code. */ +date_default_timezone_set('Europe/Paris'); + if (file_exists($file = __DIR__.'/../autoload.php')) { require_once $file; } elseif (file_exists($file = __DIR__.'/../autoload.php.dist')) {