We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 79b83c0 commit faa014cCopy full SHA for faa014c
1 file changed
tests/system/Test/FeatureTestTraitTest.php
@@ -548,6 +548,23 @@ public function testSetupRequestBodyWithParams()
548
$this->assertSame('application/json', $request->header('Content-Type')->getValue());
549
}
550
551
+ public function testSetupJSONRequestBodyWithBody()
552
+ {
553
+ $request = $this->setupRequest('post', 'home');
554
+ $request = $this->withBodyFormat('json')
555
+ ->withBody(json_encode(['foo1' => 'bar1']))
556
+ ->setRequestBody($request);
557
+
558
+ $this->assertJsonStringEqualsJsonString(
559
+ json_encode(['foo1' => 'bar1']),
560
+ $request->getBody()
561
+ );
562
+ $this->assertSame(
563
+ 'application/json',
564
+ $request->header('Content-Type')->getValue()
565
566
+ }
567
568
public function testSetupRequestBodyWithXml()
569
{
570
$request = $this->setupRequest('post', 'home');
0 commit comments