Skip to content

Fatal error when PHAR-specific end-to-end tests with a scoped phpunit.phar are run and Xdebug is used #895

@sebastianbergmann

Description

@sebastianbergmann

As can be seen here, when the PHAR-specific end-to-end tests with a scoped phpunit.phar are run, the following error occurs:

Warning: file_get_contents(Standard input code): Failed to open stream: No such file or directory in phar:///usr/local/src/phpunit/build/artifacts/phpunit-snapshot.phar/php-code-coverage/StaticAnalysis/ParsingFileAnalyser.php on line 92

Fatal error: Uncaught TypeError: substr_count(): Argument #1 ($haystack) must be of type string, bool given in phar:///usr/local/src/phpunit/build/artifacts/phpunit-snapshot.phar/php-code-coverage/StaticAnalysis/ParsingFileAnalyser.php:93
Stack trace:
#0 phar:///usr/local/src/phpunit/build/artifacts/phpunit-snapshot.phar/php-code-coverage/StaticAnalysis/ParsingFileAnalyser.php(93): substr_count()
#1 phar:///usr/local/src/phpunit/build/artifacts/phpunit-snapshot.phar/php-code-coverage/StaticAnalysis/ParsingFileAnalyser.php(76): PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis\ParsingFileAnalyser->analyse()
#2 phar:///usr/local/src/phpunit/build/artifacts/phpunit-snapshot.phar/php-code-coverage/CodeCoverage.php(315): PHPUnit\SebastianBergmann\CodeCoverage\StaticAnalysis\ParsingFileAnalyser->executableLinesIn()
#3 phar:///usr/local/src/phpunit/build/artifacts/phpunit-snapshot.phar/php-code-coverage/CodeCoverage.php(154): PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage->applyExecutableLinesFilter()
#4 phar:///usr/local/src/phpunit/build/artifacts/phpunit-snapshot.phar/php-code-coverage/CodeCoverage.php(136): PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage->append()
#5 Standard input code(49): PHPUnit\SebastianBergmann\CodeCoverage\CodeCoverage->stop()
#6 [internal function]: {closure}()
#7 {main}
  thrown in phar:///usr/local/src/phpunit/build/artifacts/phpunit-snapshot.phar/php-code-coverage/StaticAnalysis/ParsingFileAnalyser.php on line 93'

This only happens when the Xdebug driver is used. This does not happen when the PCOV driver is used.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions