From 44fe249baec9df975944498d9677c4397423444d Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Fri, 18 Jan 2013 21:36:32 +0100 Subject: [PATCH] Fixed some tests on Windows --- .../Tests/DependencyInjection/FrameworkExtensionTest.php | 2 +- .../Component/Finder/Tests/Iterator/IteratorTestCase.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index 129ae0aa4d..00c0098a0d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -206,7 +206,7 @@ abstract class FrameworkExtensionTest extends TestCase '->registerTranslatorConfiguration() finds Form translation resources' ); $this->assertContains( - 'Symfony/Component/Security/Resources/translations/security.en.xlf', + str_replace('/', DIRECTORY_SEPARATOR, 'Symfony/Component/Security/Resources/translations/security.en.xlf'), $files, '->registerTranslatorConfiguration() finds Security translation resources' ); diff --git a/src/Symfony/Component/Finder/Tests/Iterator/IteratorTestCase.php b/src/Symfony/Component/Finder/Tests/Iterator/IteratorTestCase.php index 226469b4e7..7b3f8934e8 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/IteratorTestCase.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/IteratorTestCase.php @@ -17,7 +17,9 @@ abstract class IteratorTestCase extends \PHPUnit_Framework_TestCase { // set iterator_to_array $use_key to false to avoid values merge // this made FinderTest::testAppendWithAnArray() failed with GnuFinderAdapter - $values = array_map(function (\SplFileInfo $fileinfo) { return $fileinfo->getPathname(); }, iterator_to_array($iterator, false)); + $values = array_map(function (\SplFileInfo $fileinfo) { return str_replace('/', DIRECTORY_SEPARATOR, $fileinfo->getPathname()); }, iterator_to_array($iterator, false)); + + $expected = array_map(function ($path) { return str_replace('/', DIRECTORY_SEPARATOR, $path); }, $expected); sort($values); sort($expected);