From fdb7c47527b2817bd815c76ea2ba40dd1b60c8b9 Mon Sep 17 00:00:00 2001 From: catch Date: Thu, 17 Dec 2020 17:18:30 +0000 Subject: [PATCH] Issue #3188056 by longwave: [Symfony 5] Symfony\Component\Serializer\Encoder\DecoderInterface::decode() no longer accepts NULL as $format --- core/modules/rest/tests/src/Kernel/RequestHandlerTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php b/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php index 9897e8d2ad9..141a517b1f3 100644 --- a/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php +++ b/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php @@ -44,7 +44,7 @@ class RequestHandlerTest extends KernelTestBase { parent::setUp(); $serializer = $this->prophesize(SerializerInterface::class); $serializer->willImplement(DecoderInterface::class); - $serializer->decode(Json::encode(['this is an array']), NULL, Argument::type('array')) + $serializer->decode(Json::encode(['this is an array']), 'json', Argument::type('array')) ->willReturn(['this is an array']); $this->requestHandler = new RequestHandler($serializer->reveal()); } @@ -53,7 +53,7 @@ class RequestHandlerTest extends KernelTestBase { * @covers ::handle */ public function testHandle() { - $request = new Request([], [], [], [], [], [], Json::encode(['this is an array'])); + $request = new Request([], [], [], [], [], ['CONTENT_TYPE' => 'application/json'], Json::encode(['this is an array'])); $route_match = new RouteMatch('test', (new Route('/rest/test', ['_rest_resource_config' => 'restplugin', 'example' => ''], ['_format' => 'json']))->setMethods(['GET'])); $resource = $this->prophesize(StubRequestHandlerResourcePlugin::class);