Issue #3188056 by longwave: [Symfony 5] Symfony\Component\Serializer\Encoder\DecoderInterface::decode() no longer accepts NULL as $format

merge-requests/172/head
catch 2020-12-17 17:18:30 +00:00
parent 5486534637
commit fdb7c47527
1 changed files with 2 additions and 2 deletions

View File

@ -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);