Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FileUtil::getUserHomeDir on Mac #165

Merged
merged 1 commit into from Dec 4, 2014
Merged

Conversation

monmon
Copy link
Contributor

@monmon monmon commented Jul 19, 2014

getUserHomeDir of PDepend\Util\FileUtil is using stripos(PHP_OS, 'win')
for judgment of Windows system.
But it is not right, because PHP_OS on Mac is 'Darwin'.

% php -r 'var_dump(PHP_OS);'
string(6) "Darwin"
  • before
PHPUnit 3.7.35 by Sebastian Bergmann.

.FF

Time: 27 ms, Memory: 3.25Mb

There were 2 failures:

1) PDepend\Util\FileUtilTest::testGetUserHomeDirReturnsExpectedDirectory
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'/Users/monmon'
+''

/Users/monmon/tmp/2014-07-18/pdpend/pdepend/src/test/php/PDepend/Util/FileUtilTest.php:81

2) PDepend\Util\FileUtilTest::testGetUserHomeDirOrSysTempDirReturnsExpectedUserHomeDirectory
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'/Users/monmon'
+'/var/folders/sr/d025cb3s2xs7mx0w_qy8kcnh0000gn/T'

/Users/monmon/tmp/2014-07-18/pdpend/pdepend/src/test/php/PDepend/Util/FileUtilTest.php:94

FAILURES!
Tests: 3, Assertions: 3, Failures: 2.
  • after
% phpunit --colors --bootstrap=test/php/PDepend/bootstrap.php test/php/PDepend/Util/FileUtilTest.php
PHPUnit 3.7.35 by Sebastian Bergmann.

...

Time: 29 ms, Memory: 3.00Mb

OK (3 tests, 3 assertions)

@grogy
Copy link
Contributor

grogy commented Nov 12, 2014

I have the same problem. Pull-request is good.

Can you squash commits?

@monmon monmon force-pushed the master branch 2 times, most recently from ca73873 to 2075f70 Compare November 12, 2014 13:27
getUserHomeDir of PDepend\Util\FileUtil is using stripos(PHP_OS, 'win')
for judgment of Windows system.
But it is not right, because PHP_OS on Mac is 'Darwin'.

% php -r 'var_dump(PHP_OS);'
string(6) "Darwin"
@monmon monmon changed the title fix FileUtil::getUserHomeDir on Mac Fix FileUtil::getUserHomeDir on Mac Nov 12, 2014
@monmon
Copy link
Contributor Author

monmon commented Nov 12, 2014

done.

@grogy
Copy link
Contributor

grogy commented Nov 12, 2014

Great! Thank you.

manuelpichler added a commit that referenced this pull request Dec 4, 2014
Fix FileUtil::getUserHomeDir on Mac
@manuelpichler manuelpichler merged commit 1da6824 into pdepend:master Dec 4, 2014
@ravage84 ravage84 added this to the 2.x (unspecific) milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants