diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/AbstractControllerTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/AbstractControllerTest.php index 40f9104139..41dc62aaea 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/AbstractControllerTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/AbstractControllerTest.php @@ -429,10 +429,10 @@ class AbstractControllerTest extends TestCase { $formView = new FormView(); - $form = $this->getMockBuilder(FormInterface::class)->getMock(); + $form = $this->createMock(FormInterface::class); $form->expects($this->once())->method('createView')->willReturn($formView); - $twig = $this->getMockBuilder(Environment::class)->disableOriginalConstructor()->getMock(); + $twig = $this->createMock(Environment::class); $twig->expects($this->once())->method('render')->with('foo', ['form' => $formView, 'bar' => 'bar'])->willReturn('bar'); $container = new Container(); @@ -451,12 +451,12 @@ class AbstractControllerTest extends TestCase { $formView = new FormView(); - $form = $this->getMockBuilder(FormInterface::class)->getMock(); + $form = $this->createMock(FormInterface::class); $form->expects($this->once())->method('createView')->willReturn($formView); $form->expects($this->once())->method('isSubmitted')->willReturn(true); $form->expects($this->once())->method('isValid')->willReturn(false); - $twig = $this->getMockBuilder(Environment::class)->disableOriginalConstructor()->getMock(); + $twig = $this->createMock(Environment::class); $twig->expects($this->once())->method('render')->with('foo', ['form' => $formView, 'bar' => 'bar'])->willReturn('bar'); $container = new Container(); diff --git a/src/Symfony/Component/Security/Core/Tests/Authorization/AccessDecisionManagerTest.php b/src/Symfony/Component/Security/Core/Tests/Authorization/AccessDecisionManagerTest.php index e2c5ea0fde..375fb6d6d4 100644 --- a/src/Symfony/Component/Security/Core/Tests/Authorization/AccessDecisionManagerTest.php +++ b/src/Symfony/Component/Security/Core/Tests/Authorization/AccessDecisionManagerTest.php @@ -44,7 +44,7 @@ class AccessDecisionManagerTest extends TestCase */ public function testDeprecatedVoter($strategy) { - $token = $this->getMockBuilder(\Symfony\Component\Security\Core\Authentication\Token\TokenInterface::class)->getMock(); + $token = $this->createMock(TokenInterface::class); $manager = new AccessDecisionManager([$this->getVoter(3)], $strategy); $this->expectDeprecation('Since symfony/security-core 5.3: Returning "3" in "%s::vote()" is deprecated, return one of "Symfony\Component\Security\Core\Authorization\Voter\VoterInterface" constants: "ACCESS_GRANTED", "ACCESS_DENIED" or "ACCESS_ABSTAIN".'); diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/ArrayDenormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/ArrayDenormalizerTest.php index 62b51946d2..dfbf01806b 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/ArrayDenormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/ArrayDenormalizerTest.php @@ -74,7 +74,7 @@ class ArrayDenormalizerTest extends TestCase */ public function testDenormalizeLegacy() { - $serializer = $this->getMockBuilder(Serializer::class)->getMock(); + $serializer = $this->createMock(Serializer::class); $serializer->expects($this->exactly(2)) ->method('denormalize')