From bfd559afcba835d5c81ac1e78e2b3b00155a08d8 Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Mon, 22 Nov 2021 12:11:55 +0000 Subject: [PATCH] Issue #3250442 by daffie, andypost, longwave: [Symfony 6] Symfony 6 adds static return type hinting and Prophecy fails on it --- .../media/tests/src/Unit/IFrameUrlHelperTest.php | 11 +++++++---- core/tests/Drupal/Tests/Core/Routing/RouterTest.php | 8 +++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php b/core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php index 99a1362b486f..1d2837958397 100644 --- a/core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php +++ b/core/modules/media/tests/src/Unit/IFrameUrlHelperTest.php @@ -76,11 +76,14 @@ public function providerIsSecure() { * @dataProvider providerIsSecure */ public function testIsSecure($url, $base_url, $secure) { - $request_context = $this->prophesize(RequestContext::class); - $request_context->getCompleteBaseUrl()->willReturn($base_url); + $request_context = $this->createMock(RequestContext::class); + $request_context->expects($this->any()) + ->method('getCompleteBaseUrl') + ->willReturn($base_url); + $url_helper = new IFrameUrlHelper( - $request_context->reveal(), - $this->prophesize(PrivateKey::class)->reveal() + $request_context, + $this->createMock(PrivateKey::class) ); $this->assertSame($secure, $url_helper->isSecure($url)); diff --git a/core/tests/Drupal/Tests/Core/Routing/RouterTest.php b/core/tests/Drupal/Tests/Core/Routing/RouterTest.php index d6ba1d43fb0a..a9f150aa2a79 100644 --- a/core/tests/Drupal/Tests/Core/Routing/RouterTest.php +++ b/core/tests/Drupal/Tests/Core/Routing/RouterTest.php @@ -42,9 +42,11 @@ public function testMatchesWithDifferentFitOrder() { $current_path_stack = $this->prophesize(CurrentPathStack::class); $router = new Router($route_provider->reveal(), $current_path_stack->reveal(), $url_generator->reveal()); - $request_context = $this->prophesize(RequestContext::class); - $request_context->getScheme()->willReturn('http'); - $router->setContext($request_context->reveal()); + $request_context = $this->createMock(RequestContext::class); + $request_context->expects($this->any()) + ->method('getScheme') + ->willReturn('http'); + $router->setContext($request_context); $current_path_stack->getPath(Argument::any())->willReturn('/user/1'); $result = $router->match('/user/1'); -- GitLab