diff --git a/.circleci/config.yml b/.circleci/config.yml index eb3a036..c35a017 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,12 +1,9 @@ version: 2.1 executors: - php74: + php83: docker: - - image: skpr/php-cli:7.4-1.x - php80: - docker: - - image: skpr/php-cli:8.0-1.x + - image: skpr/php-cli:8.3-v2-latest workflows: build: @@ -14,7 +11,7 @@ workflows: - build: matrix: parameters: - php: ["php74", "php80"] + php: ["php83"] composer-opts: ["", "--prefer-lowest"] jobs: @@ -33,7 +30,7 @@ jobs: - deps-{{ arch }} - run: name: "Install Dependencies" - command: composer2 update --prefer-dist --no-progress --no-suggest --no-interaction << parameters.composer-opts >> + command: composer update --prefer-dist --no-progress --no-interaction << parameters.composer-opts >> - save_cache: key: deps-{{ arch }} paths: @@ -45,7 +42,7 @@ jobs: name: "Test" command: | mkdir -p ~/phpunit - ./bin/phpunit --testsuite unit --log-junit ~/phpunit/phpunit.xml + ./bin/phpunit --log-junit ~/phpunit/phpunit.xml - store_test_results: path: ~/phpunit - store_artifacts: diff --git a/composer.json b/composer.json index 552014e..73ec539 100644 --- a/composer.json +++ b/composer.json @@ -14,9 +14,9 @@ } ], "require": { - "php": "^7.4||^8.0", - "phpunit/phpunit": "^9.5", - "symfony/console": "^3.4||^4.4||^5||^6||^7" + "php": "^8.1", + "phpunit/phpunit": "^10.5", + "symfony/console": "^6.4||^7" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", diff --git a/phpunit.xml b/phpunit.xml index c07996d..86e75cb 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -4,16 +4,7 @@ or your current system user. See core/tests/README.md and https://www.drupal.org/node/2116263 for details. --> - - - - ./src - - - ./ - ./ - - + @@ -27,4 +18,13 @@ + + + ./src + + + ./ + ./ + + diff --git a/src/FinderCommand.php b/src/FinderCommand.php index f444da5..1a8304c 100644 --- a/src/FinderCommand.php +++ b/src/FinderCommand.php @@ -3,8 +3,10 @@ namespace PhpUnitFinder; use PHPUnit\Framework\TestCase; -use PHPUnit\TextUI\TestSuiteMapper; +use PHPUnit\TextUI\CliArguments\Builder; +use PHPUnit\TextUI\Configuration\Registry; use PHPUnit\TextUI\XmlConfiguration\Loader; +use PHPUnit\TextUI\XmlConfiguration\TestSuiteMapper; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -28,7 +30,7 @@ protected function configure() { /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $configFile = $input->getOption('config-file'); $bootstrap = $input->getOption('bootstrap-file'); include_once $bootstrap; @@ -37,11 +39,16 @@ protected function execute(InputInterface $input, OutputInterface $output) { $config = (new Loader())->load($configFile); + Registry::init( + (new Builder)->fromParameters([]), + $config, + ); + foreach ($config->testSuite() as $suite) { if ($testSuites && !in_array($suite->name(), $testSuites, TRUE)) { continue; } - $testSuite = (new TestSuiteMapper)->map($config->testSuite(), $suite->name()); + $testSuite = (new TestSuiteMapper())->map($config->filename(), $config->testSuite(), $suite->name(), ''); foreach (new \RecursiveIteratorIterator($testSuite) as $test) { if ($test instanceof TestCase) { $testFilenames[] = ((new \ReflectionClass($test))->getFileName()); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 7ddf755..0bf42f5 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -4,9 +4,6 @@ * @file * Boostrap for PHPUnit. */ - -assert_options(ASSERT_ACTIVE, FALSE); - $autoloader = __DIR__ . '/../vendor/autoload.php'; $loader = require $autoloader;