Skip to content

Commit

Permalink
Drop support for old PHPUnit version
Browse files Browse the repository at this point in the history
That implies bumping the version of PHP, and should make PHPUnit
deprecations about @before and @after go away.
  • Loading branch information
greg0ire committed Dec 20, 2024
1 parent 7014f6c commit e3c9e71
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ jobs:
name: "PHPUnit"
uses: "doctrine/.github/.github/workflows/continuous-integration.yml@7.1.0"
with:
php-versions: '["7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]'
php-versions: '["8.1", "8.2", "8.3"]'
composer-options: '--ignore-platform-req=php+'
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@
"type": "library",
"homepage": "https://www.doctrine-project.org/",
"require": {
"php": "^7.1 || ^8.0"
"php": "^8.1"
},
"require-dev": {
"doctrine/coding-standard": "^9 || ^12",
"phpstan/phpstan": "1.4.10 || 2.0.3",
"phpstan/phpstan-phpunit": "^1.0 || ^2",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5",
"phpunit/phpunit": "^10.5 || ^11.5",
"psr/log": "^1 || ^2 || ^3"
},
"conflict": {
"phpunit/phpunit": "<=10.5"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
},
Expand Down
6 changes: 4 additions & 2 deletions src/PHPUnit/VerifyDeprecations.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
namespace Doctrine\Deprecations\PHPUnit;

use Doctrine\Deprecations\Deprecation;
use PHPUnit\Framework\Attributes\After;
use PHPUnit\Framework\Attributes\Before;

use function sprintf;

Expand All @@ -26,13 +28,13 @@ public function expectNoDeprecationWithIdentifier(string $identifier): void
$this->doctrineNoDeprecationsExpectations[$identifier] = Deprecation::getTriggeredDeprecations()[$identifier] ?? 0;
}

/** @before */
#[Before]
public function enableDeprecationTracking(): void
{
Deprecation::enableTrackingDeprecations();
}

/** @after */
#[After]
public function verifyDeprecationsAreTriggered(): void
{
foreach ($this->doctrineDeprecationsExpectations as $identifier => $expectation) {
Expand Down

0 comments on commit e3c9e71

Please sign in to comment.