Skip to content

Commit 300c101

Browse files
committed
minor #13147 [2.3] for consistency, use value of DIRECTORY_SEPARATOR to detect Windows (xabbuh)
This PR was merged into the 2.3 branch. Discussion ---------- [2.3] for consistency, use value of DIRECTORY_SEPARATOR to detect Windows | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | This commit unifies the detection of Windows builds across the Symfony codebase. Commits ------- 20a427d use value of DIRECTORY_SEPARATOR to detect Windows
2 parents d139e0c + 1bc2fec commit 300c101

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Tests/KernelTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ public function doStuff()
340340

341341
// Heredocs are preserved, making the output mixing Unix and Windows line
342342
// endings, switching to "\n" everywhere on Windows to avoid failure.
343-
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
343+
if ('\\' === DIRECTORY_SEPARATOR) {
344344
$expected = str_replace("\r\n", "\n", $expected);
345345
$output = str_replace("\r\n", "\n", $output);
346346
}

0 commit comments

Comments
 (0)