diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 052dc11..ed3020b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,4 +63,4 @@ jobs: run: composer install --ansi --no-interaction --no-progress - name: Execute Unit Tests - run: vendor/bin/phpunit --coverage-text + run: vendor/bin/phpunit diff --git a/composer.json b/composer.json index 687d50d..a27bf91 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^7.3 || ^8", "phpspec/prophecy": "^1.18", - "phpunit/phpunit":"^9.1 || ^10.1" + "phpunit/phpunit":"^9.1 || ^10.1 || ^11.0" }, "autoload": { "psr-4": { diff --git a/src/ProphecyTrait.php b/src/ProphecyTrait.php index 494c228..7c9ada2 100644 --- a/src/ProphecyTrait.php +++ b/src/ProphecyTrait.php @@ -3,6 +3,8 @@ namespace Prophecy\PhpUnit; use PHPUnit\Framework\AssertionFailedError; +use PHPUnit\Framework\Attributes\After; +use PHPUnit\Framework\Attributes\PostCondition; use PHPUnit\Framework\TestCase; use Prophecy\Exception\Doubler\DoubleException; use Prophecy\Exception\Doubler\InterfaceNotFoundException; @@ -57,6 +59,7 @@ protected function prophesize(?string $classOrInterface = null): ObjectProphecy /** * @postCondition */ + #[PostCondition] protected function verifyProphecyDoubles(): void { if ($this->prophet === null) { @@ -75,6 +78,7 @@ protected function verifyProphecyDoubles(): void /** * @after */ + #[After] protected function tearDownProphecy(): void { if (null !== $this->prophet && !$this->prophecyAssertionsCounted) {