From e03ad061e153680feb575e8da9195f68af67a7f4 Mon Sep 17 00:00:00 2001 From: Athos Ribeiro Date: Mon, 5 Sep 2022 15:04:05 -0300 Subject: [PATCH 1/3] 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; From a39619110ffb7d57da5dc7c653b3523b569c07a2 Mon Sep 17 00:00:00 2001 From: Athos Ribeiro Date: Thu, 8 Sep 2022 11:06:50 -0300 Subject: [PATCH 2/3] Revert "Migrate to phpspec/prophecy-phpunit" This reverts commit e03ad061e153680feb575e8da9195f68af67a7f4. Supporting phpspec/prophecy-phpunit at this point, would require dropping php <= 7.2 support. We can re-visit this matter once we start supporting phpunit 10. --- composer.json | 1 - tests/DeepCopyTest/TypeFilter/Spl/ArrayObjectFilterTest.php | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 46f6116..66fb34a 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,6 @@ "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 adb1cca..12cf81d 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\PhpUnit\ProphecyTrait; +use Prophecy\Prophecy\ObjectProphecy; use RecursiveArrayIterator; /** @@ -16,14 +16,13 @@ */ final class ArrayObjectFilterTest extends TestCase { - use ProphecyTrait; /** * @var ArrayObjectFilter */ private $arrayObjectFilter; /** - * @var DeepCopy|ProphecyTrait + * @var DeepCopy|ObjectProphecy */ private $copierProphecy; From b95de666f16061508471890510392ea82c8b57c2 Mon Sep 17 00:00:00 2001 From: Athos Ribeiro Date: Thu, 8 Sep 2022 11:12:03 -0300 Subject: [PATCH 3/3] Require phpspec/prophecy as a dev dependency While e03ad06 (reverted) is not applied, we require phpspec/prophecy as a development dependency. This is needed because phpunit dropped ptophecy as a dependency in recent releases. See e03ad06 for further reference. --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 66fb34a..7f7d087 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": "^1.10.3", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "conflict": {