8000 merged branch bdmu/ticket_5345 (PR #5346) · meistro2k/symfony@71732b1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 71732b1

Browse files
committed
merged branch bdmu/ticket_5345 (PR symfony#5346)
Commits ------- 85a53c1 [FrameworkBundle] fixed *FrameworkExtensionTest::testTranslator fail on Windows on master branch Discussion ---------- [FrameworkBundle] fixed *FrameworkExtensionTest::testTranslator fail on Windows on master branch Bug fix: yes Feature addition: no Backwards compatibility break: no Symfony2 tests pass: yes Fixes the following tickets: symfony#5345 Todo: - License of the code: MIT Documentation PR: fixed using some str_replace('/', DIRECTORY_SEPARATOR, <value>) so it works on Windows because it replaces the / in \ and shouldn't affect linux based OS, since it will replace / with /. Not very nice, but it works, if anyone wants to do better, he/she is most welcome.
2 parents f8f4408 + 85a53c1 commit 71732b1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,15 @@ public function testTranslator()
182182
}
183183
}
184184

185-
$files = array_map(function($resource) use ($resources) { return str_replace(realpath(__DIR__.'/../../../../..').'/', '', realpath($resource[1])); }, $resources);
185+
$rootDirectory = str_replace('/', DIRECTORY_SEPARATOR, realpath(__DIR__.'/../../../../..').'/');
186+
$files = array_map(function($resource) use ($rootDirectory, $resources) { return str_replace($rootDirectory, '', realpath($resource[1])); }, $resources);
186187
$this->assertContains(
187-
'Symfony/Component/Validator/Resources/translations/validators.en.xlf',
188+
str_replace('/', DIRECTORY_SEPARATOR, 'Symfony/Component/Validator/Resources/translations/validators.en.xlf'),
188189
$files,
189190
'->registerTranslatorConfiguration() finds Validator translation resources'
190191
);
191192
$this->assertContains(
192-
'Symfony/Component/Form/Resources/translations/validators.en.xlf',
193+
str_replace('/', DIRECTORY_SEPARATOR, 'Symfony/Component/Form/Resources/translations/validators.en.xlf'),
193194
$files,
194195
'->registerTranslatorConfiguration() finds Form translation resources'
195196
);

0 commit comments

Comments
 (0)
0