Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
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:
jobs:
- build:
matrix:
parameters:
php: ["php74", "php80"]
php: ["php83"]
composer-opts: ["", "--prefer-lowest"]

jobs:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
20 changes: 10 additions & 10 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,7 @@
or your current system user. See core/tests/README.md and
https://www.drupal.org/node/2116263 for details.
-->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" colors="true" beStrictAboutTestsThatDoNotTestAnything="true" beStrictAboutOutputDuringTests="true" beStrictAboutChangesToGlobalState="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory>./src</directory>
</include>
<exclude>
<directory suffix="Test.php">./</directory>
<directory suffix="TestBase.php">./</directory>
</exclude>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" colors="true" beStrictAboutTestsThatDoNotTestAnything="true" beStrictAboutOutputDuringTests="true" beStrictAboutChangesToGlobalState="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd">
<php>
<!-- Set error reporting to E_ALL. -->
<ini name="error_reporting" value="32767"/>
Expand All @@ -27,4 +18,13 @@
</testsuite>
</testsuites>
<!-- Filter for coverage reports. -->
<source>
<include>
<directory>./src</directory>
</include>
<exclude>
<directory suffix="Test.php">./</directory>
<directory suffix="TestBase.php">./</directory>
</exclude>
</source>
</phpunit>
13 changes: 10 additions & 3 deletions src/FinderCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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());
Expand Down
3 changes: 0 additions & 3 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
* @file
* Boostrap for PHPUnit.
*/

assert_options(ASSERT_ACTIVE, FALSE);

$autoloader = __DIR__ . '/../vendor/autoload.php';
$loader = require $autoloader;

Expand Down