Skip to content

Commit

Permalink
Merge pull request #297 from facile-it/phpunit-12-support
Browse files Browse the repository at this point in the history
PHPUnit 12 support
  • Loading branch information
Jean85 authored Feb 8, 2025
2 parents 6648d89 + 7ec0071 commit aafd330
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
schedule:
- cron: "42 7 * * 1"

permissions:
repository-projects: read
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'

jobs:
Tests:
runs-on: 'ubuntu-latest'
Expand All @@ -28,6 +33,10 @@ jobs:
- description: 'PHP 8.4'
php: '8.4'
composer_options: '--ignore-platform-req=php+'
- description: 'PHPUnit 12'
coverage: 'xdebug3'
php: '8.3'
phpunit: "^12"
- description: 'PHPUnit 11'
coverage: 'xdebug3'
php: '8.3'
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. For previou
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## Unreleased
* ...

## [2.5.0] - 2025-02-08
* Add PHPUnit 12 support [#297](https://github.com/facile-it/paraunit/pull/297)
* Add PHP 8.4 support [#279](https://github.com/facile-it/paraunit/pull/279)

## [2.4.0] - 2024-09-25
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ You can use Paraunit with many versions of PHPUnit or Symfony, following this co

| Paraunit version | Compatible PHPUnit Version | Compatible Symfony Version |
|------------------|----------------------------|----------------------------|
| 2.5 | 10.5.4+, 11+, 12+ | 4.4, 5, 6, 7 |
| 2.3 | 10.5.4+, 11+ | 4.4, 5, 6, 7 |
| 2.0 | 10+ | 4.4, 5, 6, 7 |
| 1.3 | 9.3+ | 4.4, 5, 6 |
Expand Down
28 changes: 21 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,28 @@
"email": "[email protected]"
}
],
"repositories": [
{
"type": "github",
"url": "https://github.com/jean85/phpstan-prophecy"
},
{
"type": "github",
"url": "https://github.com/jean85/prophecy"
},
{
"type": "github",
"url": "https://github.com/jean85/prophecy-phpunit"
}
],
"require": {
"php": "^8.1",
"ext-dom": "*",
"ext-json": "*",
"jean85/pretty-package-versions": "^1.5.1||^2.0.1",
"phpunit/php-code-coverage": "^10.0||^11.0",
"phpunit/php-file-iterator": "^4.0||^5.0",
"phpunit/phpunit": "^10.5.4||^11.0",
"phpunit/php-code-coverage": "^10.0||^11.0||^12.0",
"phpunit/php-file-iterator": "^4.0||^5.0||^6.0",
"phpunit/phpunit": "^10.5.4||^11.0||^12.0",
"psr/event-dispatcher": "^1.0",
"symfony/console": "^4.4||^5.0||^6.0||^7.0",
"symfony/dependency-injection": "^4.4||^5.0||^6.0||^7.0",
Expand All @@ -39,13 +53,13 @@
},
"require-dev": {
"facile-it/facile-coding-standard": "^1.0",
"jangregor/phpstan-prophecy": "^2.0.0",
"phpspec/prophecy": "^1.20",
"phpspec/prophecy-phpunit": "^2.3.0",
"jangregor/phpstan-prophecy": "^2.0.0||dev-phpunit-12-support as 2.1.0",
"phpspec/prophecy": "^1.20||dev-allow-sebastian-comparator-7 as 1.21",
"phpspec/prophecy-phpunit": "^2.3.0||dev-phpunit-12-support as 2.4.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "2.1.2",
"phpstan/phpstan-phpunit": "^2.0",
"phpunit/php-invoker": "^4.0||^5.0",
"phpunit/php-invoker": "^4.0||^5.0||^6.0",
"psalm/plugin-phpunit": "^0.19",
"psalm/plugin-symfony": "^5.0",
"rector/rector": "2.0.7",
Expand Down
5 changes: 4 additions & 1 deletion tests/Unit/Logs/TestHook/AbstractTestHookTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use PHPUnit\Event\Telemetry\Php81GarbageCollectorStatusProvider;
use PHPUnit\Event\Telemetry\Php83GarbageCollectorStatusProvider;
use PHPUnit\Event\Telemetry\Snapshot;
use PHPUnit\Event\Telemetry\SystemGarbageCollectorStatusProvider;
use Tests\BaseUnitTestCase;
use Tests\Stub\TestHookStub;

Expand Down Expand Up @@ -147,7 +148,9 @@ private function createGarbageCollectorStatus(): GarbageCollectorStatus
{
static $factory;

if (PHP_VERSION_ID >= 8_03_00) {
if (class_exists(SystemGarbageCollectorStatusProvider::class)) {
$factory ??= new SystemGarbageCollectorStatusProvider();
} elseif (PHP_VERSION_ID >= 8_03_00) {
$factory ??= new Php83GarbageCollectorStatusProvider();
} else {
$factory ??= new Php81GarbageCollectorStatusProvider();
Expand Down

0 comments on commit aafd330

Please sign in to comment.