From e03ad061e153680feb575e8da9195f68af67a7f4 Mon Sep 17 00:00:00 2001 From: Athos Ribeiro Date: Mon, 5 Sep 2022 15:04:05 -0300 Subject: [PATCH] Migrate to phpspec/prophecy-phpunit https://github.com/sebastianbergmann/phpunit/issues/5033 changed phpunit to no longer depend on phpspec/prophecy. This results in the need to add a development dependency for phpspec/prophecy. Doing so results in a warning, since PHPUnit\Framework\TestCase::prophesize() is deprecated and will be removed in PHPUnit 10. Let's use the trait provided by phpspec/prophecy-phpunit instead. * Fixes #177 --- composer.json | 1 + tests/DeepCopyTest/TypeFilter/Spl/ArrayObjectFilterTest.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 66fb34a..46f6116 100644 --- a/composer.json +++ b/composer.json @@ -16,6 +16,7 @@ "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "conflict": { diff --git a/tests/DeepCopyTest/TypeFilter/Spl/ArrayObjectFilterTest.php b/tests/DeepCopyTest/TypeFilter/Spl/ArrayObjectFilterTest.php index 12cf81d..adb1cca 100644 --- a/tests/DeepCopyTest/TypeFilter/Spl/ArrayObjectFilterTest.php +++ b/tests/DeepCopyTest/TypeFilter/Spl/ArrayObjectFilterTest.php @@ -6,7 +6,7 @@ use DeepCopy\DeepCopy; use DeepCopy\TypeFilter\Spl\ArrayObjectFilter; use PHPUnit\Framework\TestCase; -use Prophecy\Prophecy\ObjectProphecy; +use Prophecy\PhpUnit\ProphecyTrait; use RecursiveArrayIterator; /** @@ -16,13 +16,14 @@ */ final class ArrayObjectFilterTest extends TestCase { + use ProphecyTrait; /** * @var ArrayObjectFilter */ private $arrayObjectFilter; /** - * @var DeepCopy|ObjectProphecy + * @var DeepCopy|ProphecyTrait */ private $copierProphecy;