From dfaa25703fb4a32cd3933ac30c8abc71aa49246d Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Tue, 20 Oct 2020 09:06:36 +0200 Subject: [PATCH] Replace references to old PHPUnit objects --- Tests/DependencyInjection/AbstractMongoDBExtensionTest.php | 7 ++----- Tests/Form/Type/DocumentTypeTest.php | 4 ++-- Tests/Form/Type/TypeGuesserTest.php | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Tests/DependencyInjection/AbstractMongoDBExtensionTest.php b/Tests/DependencyInjection/AbstractMongoDBExtensionTest.php index 32fe2826..c8f8bcf4 100644 --- a/Tests/DependencyInjection/AbstractMongoDBExtensionTest.php +++ b/Tests/DependencyInjection/AbstractMongoDBExtensionTest.php @@ -21,8 +21,7 @@ use Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver; use Doctrine\Persistence\Mapping\Driver\MappingDriverChain; use MongoDB\Client; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit_Framework_AssertionFailedError; +use PHPUnit\Framework\AssertionFailedError; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -478,9 +477,7 @@ private function assertDefinitionMethodCallAny(Definition $definition, $methodNa $this->assertSame($params, $call[1], "Expected parameters to method '" . $methodName . "' did not match the actual parameters."); return; - } catch (PHPUnit_Framework_AssertionFailedError $e) { - $lastError = $e; - } catch (ExpectationFailedException $e) { + } catch (AssertionFailedError $e) { $lastError = $e; } } diff --git a/Tests/Form/Type/DocumentTypeTest.php b/Tests/Form/Type/DocumentTypeTest.php index 11415275..35e01390 100644 --- a/Tests/Form/Type/DocumentTypeTest.php +++ b/Tests/Form/Type/DocumentTypeTest.php @@ -12,7 +12,7 @@ use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\Persistence\ManagerRegistry; use MongoDB\BSON\ObjectId; -use PHPUnit_Framework_MockObject_MockObject; +use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\FormType; use Symfony\Component\Form\FormView; @@ -25,7 +25,7 @@ class DocumentTypeTest extends TypeTestCase /** @var DocumentManager */ private $dm; - /** @var PHPUnit_Framework_MockObject_MockObject */ + /** @var MockObject */ private $dmRegistry; private $typeFQCN; diff --git a/Tests/Form/Type/TypeGuesserTest.php b/Tests/Form/Type/TypeGuesserTest.php index 59ad240a..281ef96a 100644 --- a/Tests/Form/Type/TypeGuesserTest.php +++ b/Tests/Form/Type/TypeGuesserTest.php @@ -11,7 +11,7 @@ use Doctrine\Bundle\MongoDBBundle\Tests\TestCase; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\Persistence\ManagerRegistry; -use PHPUnit_Framework_MockObject_MockObject; +use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Test\TypeTestCase; use function array_merge; @@ -22,7 +22,7 @@ class TypeGuesserTest extends TypeTestCase /** @var DocumentManager */ private $dm; - /** @var PHPUnit_Framework_MockObject_MockObject */ + /** @var MockObject */ private $dmRegistry; private $typeFQCN;