phpunit icon indicating copy to clipboard operation
phpunit copied to clipboard

use current directory for default cache path

Open remicollet opened this issue 4 years ago • 5 comments

As phpunit command path seems a poor default:

  • will result on vendor/bin/phpunit in most case
  • will result on some global directory when global phpunit is used (phar) thus being used for "all" projects.

Open against master, but will be nice to have a better default in 8.x and 9.x

P.S. seems minor, as will only affects project without configuration file, as in most case path to configuration will be used.

remicollet avatar Jun 17 '20 08:06 remicollet

Codecov Report

Merging #4300 into master will increase coverage by 0.01%. The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #4300      +/-   ##
============================================
+ Coverage     84.70%   84.71%   +0.01%     
  Complexity     4562     4562              
============================================
  Files           257      257              
  Lines         11484    11484              
============================================
+ Hits           9727     9729       +2     
+ Misses         1757     1755       -2     
Impacted Files Coverage Δ Complexity Δ
src/TextUI/TestRunner.php 63.80% <66.66%> (+0.16%) 218.00 <0.00> (ø)
src/Runner/DefaultTestResultCache.php 93.65% <0.00%> (+1.58%) 29.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5d5b6ec...34d04e1. Read the comment docs.

codecov[bot] avatar Jun 17 '20 09:06 codecov[bot]

master is what will become PHPUnit 9.3 in August. I am open to have this is in 8.5 for PHPUnit 8.5 as well.

sebastianbergmann avatar Jun 17 '20 09:06 sebastianbergmann

May result in some error such as:

Warning: file_put_contents(/usr/bin/.phpunit.result.cache): failed to open stream: Permission denied in ...

remicollet avatar Jun 17 '20 09:06 remicollet

@remicollet I agree that we should try to address this, and thank you for sending this pull request. But please note that the PHPUnit documentation explicitly advises against installing PHPUnit globally:

Please note that it is not recommended to install PHPUnit globally, as /usr/bin/phpunit or /usr/local/bin/phpunit, for instance.

sebastianbergmann avatar Jun 17 '20 09:06 sebastianbergmann

@remicollet thanks for looking into this, I will have a good look. I'm in favour of cleaner solutions for the cache file management.

epdenouden avatar Jun 17 '20 11:06 epdenouden

Thank you for your contribution. I appreciate the time you invested in preparing this pull request. However, I have decided not to merge it.

sebastianbergmann avatar Jan 13 '24 13:01 sebastianbergmann