Skip to content

Instantly share code, notes, and snippets.

@lcharette
Created December 2, 2020 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lcharette/9304e71b7e6827e5363521d974dbedc0 to your computer and use it in GitHub Desktop.
Save lcharette/9304e71b7e6827e5363521d974dbedc0 to your computer and use it in GitHub Desktop.
PHPUnit always output “No tests executed!” on MacOS Big Sur

In response to https://stackoverflow.com/questions/65064182/phpunit-always-output-no-tests-executed-on-macos-big-sur#comment115098156_65064182:

    public static function main(bool $exit = true): int
    {
        var_dump(ini_get("auto_prepend_file"));
        var_dump($_SERVER['argv']); die;
        return (new static)->run($_SERVER['argv'], $exit);
    }

When executing vendor/bin/phpunit:

/{...}/vendor/phpunit/phpunit/src/TextUI/Command.php:163:
string(0) ""
/{...}/vendor/phpunit/phpunit/src/TextUI/Command.php:164:
array(1) {
  [0] =>
  string(18) "vendor/bin/phpunit"
}

When executing vendor/bin/phpunit --testsuite Unit

/{...}/vendor/phpunit/phpunit/src/TextUI/Command.php:163:
string(0) ""
/{...}/vendor/phpunit/phpunit/src/TextUI/Command.php:164:
array(3) {
  [0] =>
  string(18) "vendor/bin/phpunit"
  [1] =>
  string(11) "--testsuite"
  [2] =>
  string(4) "Unit"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment