Skip to content

Commit 49686a5

Browse files
committed
fix RequestBodyParamConverter tests
1 parent 0c21d0a commit 49686a5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Tests/Request/RequestBodyParamConverterTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function testContextMergeDuringExecution()
7171
$configuration = $this->createConfiguration('FooClass', null, $options);
7272
$converter = new RequestBodyParamConverter($this->serializer, ['foogroup'], 'fooversion');
7373

74-
$request = $this->createRequest('body');
74+
$request = $this->createRequest('body', 'application/json');
7575

7676
$expectedContext = new Context();
7777
$expectedContext->setGroups(['foo', 'bar']);
@@ -259,7 +259,7 @@ public function testNoContentTypeCausesUnsupportedMediaTypeException()
259259
protected function launchExecution($converter, $request = null, $configuration = null)
260260
{
261261
if (null === $request) {
262-
$request = $this->createRequest('body');
262+
$request = $this->createRequest('body', 'application/json');
263263
}
264264
if (null === $configuration) {
265265
$configuration = $this->createConfiguration('FooClass', 'foo');
@@ -278,7 +278,7 @@ protected function createConfiguration($class, $name = null, array $options = ar
278278
]);
279279
}
280280

281-
protected function createRequest($body = null)
281+
protected function createRequest($body = null, $contentType = null)
282282
{
283283
$request = new Request(
284284
[],
@@ -289,7 +289,7 @@ protected function createRequest($body = null)
289289
[],
290290
$body
291291
);
292-
$request->headers->set('CONTENT_TYPE', 'application/json');
292+
$request->headers->set('CONTENT_TYPE', $contentType);
293293

294294
return $request;
295295
}

0 commit comments

Comments
 (0)