From 741607fd150ede7ae9448be8e0175e9343882cee Mon Sep 17 00:00:00 2001 From: David Maicher Date: Sun, 28 Nov 2021 21:33:03 +0100 Subject: [PATCH] fix "PHPUnit\Framework\TestCase::prophesize() is deprecated" --- composer.json | 1 + tests/Doctrine/DBAL/Types/PhoneNumberTypeTest.php | 3 +++ tests/Serializer/Normalizer/PhoneNumberNormalizerTest.php | 3 +++ tests/Templating/Helper/PhoneNumberHelperTest.php | 3 +++ 4 files changed, 10 insertions(+) diff --git a/composer.json b/composer.json index 5af1b539..940decdb 100644 --- a/composer.json +++ b/composer.json @@ -19,6 +19,7 @@ }, "require-dev": { "doctrine/doctrine-bundle": "^1.12|^2.0", + "phpspec/prophecy-phpunit": "2.0.x-dev", "phpunit/phpunit": "^9.5", "symfony/form": "^4.4|^5.3|^6.0", "symfony/property-access": "^4.4|^5.3|^6.0", diff --git a/tests/Doctrine/DBAL/Types/PhoneNumberTypeTest.php b/tests/Doctrine/DBAL/Types/PhoneNumberTypeTest.php index d6c5fbe2..ba5e64ed 100644 --- a/tests/Doctrine/DBAL/Types/PhoneNumberTypeTest.php +++ b/tests/Doctrine/DBAL/Types/PhoneNumberTypeTest.php @@ -18,12 +18,15 @@ use libphonenumber\PhoneNumberUtil; use Misd\PhoneNumberBundle\Doctrine\DBAL\Types\PhoneNumberType; use PHPUnit\Framework\TestCase; +use Prophecy\PhpUnit\ProphecyTrait; /** * Phone number type test. */ class PhoneNumberTypeTest extends TestCase { + use ProphecyTrait; + /** * @var AbstractPlatform */ diff --git a/tests/Serializer/Normalizer/PhoneNumberNormalizerTest.php b/tests/Serializer/Normalizer/PhoneNumberNormalizerTest.php index 36626ace..20abdebe 100644 --- a/tests/Serializer/Normalizer/PhoneNumberNormalizerTest.php +++ b/tests/Serializer/Normalizer/PhoneNumberNormalizerTest.php @@ -18,6 +18,7 @@ use Misd\PhoneNumberBundle\Serializer\Normalizer\PhoneNumberNormalizer; use PHPUnit\Framework\TestCase; use Prophecy\Argument; +use Prophecy\PhpUnit\ProphecyTrait; use Symfony\Component\Serializer\Exception\UnexpectedValueException; use Symfony\Component\Serializer\Serializer; @@ -26,6 +27,8 @@ */ class PhoneNumberNormalizerTest extends TestCase { + use ProphecyTrait; + protected function setUp(): void { if (!class_exists(Serializer::class)) { diff --git a/tests/Templating/Helper/PhoneNumberHelperTest.php b/tests/Templating/Helper/PhoneNumberHelperTest.php index 7a923cad..4a97b986 100644 --- a/tests/Templating/Helper/PhoneNumberHelperTest.php +++ b/tests/Templating/Helper/PhoneNumberHelperTest.php @@ -17,12 +17,15 @@ use Misd\PhoneNumberBundle\Exception\InvalidArgumentException; use Misd\PhoneNumberBundle\Templating\Helper\PhoneNumberHelper; use PHPUnit\Framework\TestCase; +use Prophecy\PhpUnit\ProphecyTrait; /** * Phone number templating helper test. */ class PhoneNumberHelperTest extends TestCase { + use ProphecyTrait; + protected $phoneNumberUtil; protected $helper;