You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHPUnit called with the name of a file that doesn't have an extension throws an unhandled TypeError exception.
How to reproduce
Assume there is a file without extension in the current directory (e.g. LICENSE).
$ phpunit LICENSE
Fatal error: Uncaught TypeError: substr() expects parameter 3 to be int, bool given in /home/morozov/Projects/dbal/vendor/phpunit/phpunit/src/TextUI/Command.php on line 808
TypeError: substr() expects parameter 3 to be int, bool given in /home/morozov/Projects/dbal/vendor/phpunit/phpunit/src/TextUI/Command.php on line 808
Call Stack:
0.0002 491064 1. {main}() /home/morozov/Projects/dbal/vendor/phpunit/phpunit/phpunit:0
0.0037 1047904 2. PHPUnit\TextUI\Command::main() /home/morozov/Projects/dbal/vendor/phpunit/phpunit/phpunit:61
0.0037 1048016 3. PHPUnit\TextUI\Command->run() /home/morozov/Projects/dbal/vendor/phpunit/phpunit/src/TextUI/Command.php:159
0.0037 1048016 4. PHPUnit\TextUI\Command->handleArguments() /home/morozov/Projects/dbal/vendor/phpunit/phpunit/src/TextUI/Command.php:167
0.0047 1217712 5. substr() /home/morozov/Projects/dbal/vendor/phpunit/phpunit/src/TextUI/Command.php:808
Expected behavior
According to the usage, the first passed parameter is the test class. Since the class does not exist in the suite, PHPUnit should not run any tests and report a human-readable error.
The text was updated successfully, but these errors were encountered:
Summary
PHPUnit called with the name of a file that doesn't have an extension throws an unhandled
TypeError
exception.How to reproduce
Assume there is a file without extension in the current directory (e.g.
LICENSE
).Expected behavior
According to the usage, the first passed parameter is the test class. Since the class does not exist in the suite, PHPUnit should not run any tests and report a human-readable error.
The text was updated successfully, but these errors were encountered: