Skip to content

PHPUnit 11 #4057

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

Merged
merged 11 commits into from
Jun 13, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/apiref.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.1"
php-version: "8.2"

- name: "Install dependencies"
run: "composer install --no-interaction --no-progress"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/backward-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.1"
php-version: "8.2"

- name: "Install dependencies"
run: "composer install --no-dev --no-interaction --no-progress"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog-generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.1"
php-version: "8.2"

- name: "Install dependencies"
run: "composer install --no-interaction --no-progress"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.1"
php-version: "8.2"
extensions: mbstring
ini-values: memory_limit=256M

Expand Down Expand Up @@ -401,7 +401,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.1"
php-version: "8.2"
tools: ${{ matrix.tools }}
extensions: ${{ matrix.extensions }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ jobs:
php-version: "${{ matrix.php-version }}"

- name: "Downgrade PHPUnit"
if: matrix.php-version == '7.4' || matrix.php-version == '8.0'
if: matrix.php-version == '7.4' || matrix.php-version == '8.0' || matrix.php-version == '8.1'
run: "composer require --dev phpunit/phpunit:^9.6 sebastian/diff:^4.0 --update-with-dependencies --ignore-platform-reqs"

- name: "Install dependencies"
run: "composer install --no-interaction --no-progress"

- name: "Transform source code"
if: matrix.php-version == '7.4' || matrix.php-version == '8.0'
if: matrix.php-version == '7.4' || matrix.php-version == '8.0' || matrix.php-version == '8.1'
run: |
composer install --no-interaction --no-progress --working-dir=compiler
./compiler/vendor/bin/simple-downgrade downgrade -c build/downgrade.php ${{ matrix.php-version }}
Expand All @@ -73,7 +73,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.1"
php-version: "8.2"

- name: "Validate Composer"
run: "composer validate"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/reflection-golden-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ jobs:
fail-fast: false
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ jobs:
extensions: mbstring

- name: "Downgrade PHPUnit"
if: matrix.php-version == '7.4' || matrix.php-version == '8.0'
if: matrix.php-version == '7.4' || matrix.php-version == '8.0' || matrix.php-version == '8.1'
shell: bash
run: "composer require --dev phpunit/phpunit:^9.6 sebastian/diff:^4.0 --update-with-dependencies --ignore-platform-reqs"

- name: "Install dependencies"
run: "composer install --no-interaction --no-progress"

- name: "Transform source code"
if: matrix.php-version == '7.4' || matrix.php-version == '8.0'
if: matrix.php-version == '7.4' || matrix.php-version == '8.0' || matrix.php-version == '8.1'
shell: bash
run: |
composer install --no-interaction --no-progress --working-dir=compiler
Expand All @@ -77,7 +77,6 @@ jobs:
fail-fast: false
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
Expand Down Expand Up @@ -128,7 +127,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.1"
php-version: "8.2"
ini-file: development

- name: "Install dependencies"
Expand All @@ -154,7 +153,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.1"
php-version: "8.2"
ini-file: development

- name: "Install dependencies"
Expand Down
22 changes: 10 additions & 12 deletions .github/workflows/tests-levels-matrix.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
<?php declare(strict_types = 1);

shell_exec('php vendor/bin/phpunit --list-tests-xml test-list.xml');
shell_exec('php vendor/bin/phpunit --group levels --list-tests-xml test-list.xml');

$simpleXml = simplexml_load_file('test-list.xml');
if ($simpleXml === false) {
throw new RuntimeException('Error loading test-list.xml');
}

$testFilters = [];
foreach($simpleXml->testCaseClass as $testCaseClass) {
foreach($testCaseClass->testCaseMethod as $testCaseMethod) {
if ((string) $testCaseMethod['groups'] !== 'levels') {
continue;
}

$testCaseName = (string) $testCaseMethod['id'];
foreach($simpleXml->tests as $testClasses) {
foreach($testClasses->testClass as $testClass) {
foreach($testClass->testMethod as $testMethod) {
$testCaseName = (string)$testMethod['id'];

[$className, $testName] = explode('::', $testCaseName, 2);
$fileName = 'tests/'. str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php';
[$className, $testName] = explode('::', $testCaseName, 2);
$fileName = 'tests/' . str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php';

$filter = str_replace('\\', '\\\\', $testCaseName);
$filter = str_replace('\\', '\\\\', $testCaseName);

$testFilters[] = sprintf("%s --filter %s", escapeshellarg($fileName), escapeshellarg($filter));
$testFilters[] = sprintf("%s --filter %s", escapeshellarg($fileName), escapeshellarg($filter));
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs:
fail-fast: false
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
Expand Down Expand Up @@ -76,7 +75,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.1"
php-version: "8.2"
tools: pecl
extensions: ds,mbstring
ini-file: development
Expand Down Expand Up @@ -159,6 +158,7 @@ jobs:
php-version:
- "7.4"
- "8.0"
- "8.1"
operating-system: [ ubuntu-latest, windows-latest ]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-phpstorm-stubs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.1"
php-version: "8.2"
- name: "Install dependencies"
run: "composer install --no-interaction --no-progress"
- name: "Checkout stubs"
Expand Down
2 changes: 1 addition & 1 deletion build/ignore-by-php-version.neon.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
$includes[] = __DIR__ . '/deprecated-8.4.neon';
}

if (PHP_VERSION_ID < 80100) {
if (PHP_VERSION_ID < 80200) {
$includes[] = __DIR__ . '/old-phpunit.neon';
} else {
$includes[] = __DIR__ . '/new-phpunit.neon';
Expand Down
2 changes: 1 addition & 1 deletion compiler/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"require": {
"php": "^8.0",
"nette/neon": "^3.0.0",
"ondrejmirtes/simple-downgrader": "^2.1.8",
"ondrejmirtes/simple-downgrader": "^2.2.0",
"seld/phar-utils": "^1.2",
"symfony/console": "^5.4.43",
"symfony/filesystem": "^5.4.43",
Expand Down
14 changes: 7 additions & 7 deletions compiler/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"MIT"
],
"require": {
"php": "^8.1",
"php": "^8.2",
"composer-runtime-api": "^2.0",
"clue/ndjson-react": "^1.0",
"composer/ca-bundle": "^1.2",
Expand Down Expand Up @@ -38,7 +38,7 @@
"react/promise": "^3.2",
"react/socket": "^1.3",
"react/stream": "^1.1",
"sebastian/diff": "^5.0",
"sebastian/diff": "^6.0.2",
"symfony/console": "^5.4.3",
"symfony/finder": "^5.4.3",
"symfony/polyfill-intl-grapheme": "^1.23",
Expand All @@ -61,14 +61,14 @@
"phpstan/phpstan-nette": "^2.0",
"phpstan/phpstan-phpunit": "^2.0.7",
"phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "10.5.31",
"phpunit/phpunit": "^11.5.23",
"shipmonk/composer-dependency-analyser": "^1.5",
"shipmonk/dead-code-detector": "^0.12.0",
"shipmonk/name-collision-detector": "^2.0"
},
"config": {
"platform": {
"php": "8.1.99"
"php": "8.2.99"
},
"platform-check": false,
"sort-packages": true,
Expand Down
Loading
Loading