Skip to content

Commit

Permalink
Merge pull request #5 from lifesign/hotfix/windows_check
Browse files Browse the repository at this point in the history
fix windows environment check not work on mac
  • Loading branch information
slince authored Jul 10, 2017
2 parents 7f4eca8 + 812336b commit d56fb9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ConfigPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function getHomeConfigDir()
*/
public static function isWindows()
{
return stripos(PHP_OS, 'win') !== false;
return DIRECTORY_SEPARATOR == '\\';
}

/**
Expand All @@ -63,4 +63,4 @@ public static function getUserConfigFile()
{
return static::getHomeConfigDir() . '/crm.json';
}
}
}
4 changes: 2 additions & 2 deletions tests/ConfigPathTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ class ConfigPathTest extends TestCase
{
public function testHomeConfigDir()
{
$this->assertTrue((boolean)preg_match('/win/i', PHP_OS) === ConfigPath::isWindows());
$this->assertTrue((boolean)(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') === ConfigPath::isWindows());
}

public function testDefaultConfigFile()
{
$this->assertFileExists(ConfigPath::getDefaultConfigFile());
}
}
}

0 comments on commit d56fb9c

Please sign in to comment.