Closed muglug closed 5 years ago
krakjoe@fiji:/opt/src/psalm$ php -n -d zend_extension=xdebug.so -d xdebug.coverage_enable=1 vendor/bin/phpunit --debug --verbose
PHPUnit 8.2.1 by Sebastian Bergmann and contributors.
Runtime: PHP 7.2.20-dev with Xdebug 2.7.0alpha2-dev
Configuration: /opt/src/psalm/phpunit.xml.dist
Test 'Psalm\Tests\AnnotationTest::testPhpStormGenericsWithValidArrayIteratorArgument' started
Undefined variable: argv
Not a bug in pcov, and I can't find out what is outputting that extremely useless warning ...
@sebastianbergmann what's going on ?
Note worthy, this is a bug that has been introduced since I first developed this code, I know this because psalm is one of the repositories I tested against when developing the code, I've seen it run these tests hundreds and hundreds of time ...
At src/psalm-refactor.php line 19 argv is actually null ...
Trace:
PHPUnit\Framework\Error\Notice: Undefined variable: argv in /opt/src/psalm/src/psalm-refactor.php on line 19
#0 include_once in /opt/src/psalm/vendor/phpunit/php-code-coverage/src/CodeCoverage.php on line 959
#1 SebastianBergmann\CodeCoverage\CodeCoverage->initializeData in /opt/src/psalm/vendor/phpunit/php-code-coverage/src/CodeCoverage.php on line 239
#2 SebastianBergmann\CodeCoverage\CodeCoverage->start in /opt/src/psalm/vendor/phpunit/phpunit/src/Framework/TestResult.php on line 635
#3 PHPUnit\Framework\TestResult->run in /opt/src/psalm/vendor/phpunit/phpunit/src/Framework/TestCase.php on line 823
#4 PHPUnit\Framework\TestCase->run in /opt/src/psalm/vendor/phpunit/phpunit/src/Framework/TestSuite.php on line 568
#5 PHPUnit\Framework\TestSuite->run in /opt/src/psalm/vendor/phpunit/phpunit/src/Framework/TestSuite.php on line 568
#6 PHPUnit\Framework\TestSuite->run in /opt/src/psalm/vendor/phpunit/phpunit/src/TextUI/TestRunner.php on line 619
#7 PHPUnit\TextUI\TestRunner->doRun in /opt/src/psalm/vendor/phpunit/phpunit/src/TextUI/Command.php on line 201
#8 PHPUnit\TextUI\Command->run in /opt/src/psalm/vendor/phpunit/phpunit/src/TextUI/Command.php on line 160
#9 PHPUnit\TextUI\Command::main in /opt/src/psalm/vendor/phpunit/phpunit/phpunit on line 61
This will have to be reported upstream, there's nothing I can do about it since it's not pcov causing the bug ...
Sorry for wasting your time - fixed in https://github.com/vimeo/psalm/commit/6fa8b986ccbe4a261321e800856f0a575b71ded7
Ah, I'm very glad you figured it out, I was still picking psalm apart ...
FWIW, I remember that sebastian had some issues surrounding $argv in phpunit, I can't remember the exact nature of it, but it was solved by using $_SERVER["argv"]
in it's place, which doe not rely on ini settings ... if you dig through commit logs, you might find some useful information that applies to your use of argv, even though it works, it might be worth a look ...
Running PHPUnit on https://github.com/vimeo/psalm I get
It works just fine without
pcov
enabled. Unsure how to proceed.in my php.ini (but setting it to
On
doesn't help either).