Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PHPUnit 10 #15

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
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
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
}
],
"require": {
"php": "^7.4||^8.0",
"phpunit/phpunit": "^9.5",
"php": "^8.1",
"phpunit/phpunit": "^10.5",
"symfony/console": "^3.4||^4.4||^5||^6"
},
"require-dev": {
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>
4 changes: 2 additions & 2 deletions src/FinderCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace PhpUnitFinder;

use PHPUnit\Framework\TestCase;
use PHPUnit\TextUI\TestSuiteMapper;
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 Down Expand Up @@ -41,7 +41,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {
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(), '');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is right

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