Skip to content

Instantly share code, notes, and snippets.

@lcharette
Created Dec 2, 2020
Embed
What would you like to do?
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