1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 08:32:56 +00:00

Remove PHPUnit direct require again

This commit is contained in:
Jordi Boggiano 2021-12-09 11:35:09 +01:00
parent bf72afec44
commit 59603a357a
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
6 changed files with 45 additions and 1069 deletions

View file

@ -52,6 +52,7 @@ parameters:
- '~Dynamic call to static method PHPUnit\\Framework\\TestCase::(once|at|exactly|will|exactly|returnValue|returnCallback|any|atLeastOnce|throwException|onConsecutiveCalls|never|returnValueMap)\(\)~'
bootstrapFiles:
- ./locate-phpunit-autoloader.php
- ../tests/bootstrap.php
paths:

View file

@ -0,0 +1,22 @@
<?php
$bestDirFound = null;
$dirs = glob(__DIR__.'/../vendor/bin/.phpunit/phpunit-*');
natsort($dirs);
foreach (array_reverse($dirs) as $dir) {
$bestDirFound = $dir;
if (PHP_VERSION_ID >= 80000 && false !== strpos($dir, 'phpunit-9')) {
break;
}
if (PHP_VERSION_ID < 80000 && false !== strpos($dir, 'phpunit-8')) {
break;
}
}
if (null === $bestDirFound) {
echo 'Run "composer test" to initialize PHPUnit sources before running PHPStan'.PHP_EOL;
exit(1);
}
include $bestDirFound.'/vendor/autoload.php';