Skip to content

Commit

Permalink
use value of DIRECTORY_SEPARATOR to detect Windows
Browse files Browse the repository at this point in the history
This commit unifies the detection of Windows builds across the Symfony
codebase.
  • Loading branch information
xabbuh committed Dec 31, 2014
1 parent 3817839 commit ee728f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Filesystem.php
Expand Up @@ -286,7 +286,7 @@ public function rename($origin, $target, $overwrite = false)
*/
public function symlink($originDir, $targetDir, $copyOnWindows = false)
{
if (defined('PHP_WINDOWS_VERSION_MAJOR') && $copyOnWindows) {
if ('\\' === DIRECTORY_SEPARATOR && $copyOnWindows) {
$this->mirror($originDir, $targetDir);

return;
Expand Down
4 changes: 2 additions & 2 deletions Tests/FilesystemTest.php
Expand Up @@ -59,7 +59,7 @@ public function testCopyFails()
public function testCopyUnreadableFileFails()
{
// skip test on Windows; PHP can't easily set file as unreadable on Windows
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
if ('\\' === DIRECTORY_SEPARATOR) {
$this->markTestSkipped('This test cannot run on Windows.');
}

Expand Down Expand Up @@ -133,7 +133,7 @@ public function testCopyOverridesExistingFileIfForced()
public function testCopyWithOverrideWithReadOnlyTargetFails()
{
// skip test on Windows; PHP can't easily set file as unwritable on Windows
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
if ('\\' === DIRECTORY_SEPARATOR) {
$this->markTestSkipped('This test cannot run on Windows.');
}

Expand Down

0 comments on commit ee728f8

Please sign in to comment.