Remove PHPUnit direct require again
parent
bf72afec44
commit
59603a357a
|
@ -105,11 +105,11 @@ jobs:
|
|||
|
||||
- name: "Run tests"
|
||||
if: "matrix.php-version != '7.3'"
|
||||
run: "SYMFONY_PHPUNIT_VERSION=8.5 vendor/bin/simple-phpunit --verbose"
|
||||
run: "vendor/bin/simple-phpunit --verbose"
|
||||
|
||||
- name: "Run complete test suite on 7.3"
|
||||
if: "matrix.php-version == '7.3'"
|
||||
run: "SYMFONY_PHPUNIT_VERSION=8.5 vendor/bin/simple-phpunit --configuration tests/complete.phpunit.xml"
|
||||
run: "vendor/bin/simple-phpunit --configuration tests/complete.phpunit.xml"
|
||||
|
||||
validation:
|
||||
name: "Composer validation"
|
||||
|
|
|
@ -21,7 +21,8 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
php-version:
|
||||
- "7.4"
|
||||
- "7.2"
|
||||
- "8.1"
|
||||
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
|
@ -46,8 +47,16 @@ jobs:
|
|||
key: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}-${{ hashFiles('**/composer.lock') }}"
|
||||
restore-keys: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}"
|
||||
|
||||
- name: "Install highest dependencies from composer.json using composer binary provided by system"
|
||||
- name: "Install highest dependencies"
|
||||
if: "matrix.php-version != '7.2'"
|
||||
run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}"
|
||||
|
||||
- name: "Install locked dependencies"
|
||||
if: "matrix.php-version == '7.2'"
|
||||
run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}"
|
||||
|
||||
- name: "Initialize PHPUnit sources"
|
||||
run: "vendor/bin/simple-phpunit --filter NO_TEST_JUST_AUTOLOAD_THANKS"
|
||||
|
||||
- name: "Run PHPStan"
|
||||
run: "composer phpstan"
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
"homepage": "https://seld.be"
|
||||
}
|
||||
],
|
||||
"_comment": [
|
||||
"symfony/polyfill-php73 sould be removed once https://github.com/symfony/symfony/pull/44523 is released and the symfony/console requirement bumped to match that release"
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.2.5 || ^8.0",
|
||||
"composer/ca-bundle": "^1.0",
|
||||
|
@ -36,8 +39,9 @@
|
|||
"symfony/filesystem": "^5.4 || ^6.0",
|
||||
"symfony/finder": "^5.4 || ^6.0",
|
||||
"symfony/process": "^5.4 || ^6.0",
|
||||
"react/promise": "^2.7",
|
||||
"composer/pcre": "^1.0"
|
||||
"react/promise": "^2.8",
|
||||
"composer/pcre": "^1.0",
|
||||
"symfony/polyfill-php73": "^1.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/phpunit-bridge": "^6.0",
|
||||
|
@ -45,8 +49,7 @@
|
|||
"phpstan/phpstan": "^1.0",
|
||||
"phpstan/phpstan-phpunit": "^1.0",
|
||||
"phpstan/phpstan-deprecation-rules": "^1",
|
||||
"phpstan/phpstan-strict-rules": "^1",
|
||||
"phpunit/phpunit": "^8.5"
|
||||
"phpstan/phpstan-strict-rules": "^1"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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:
|
||||
|
|
|
@ -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';
|
Loading…
Reference in New Issue