Skip to content

Commit 2bcebad

Browse files
committed
test: remove testCallWithJsonRequestObject() and add testAssertJsonExactObject()
testCallWithJsonRequestObject() is not a test for FeatureTestTrait.
1 parent 66526a8 commit 2bcebad

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

tests/system/Test/FeatureTestTraitTest.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -372,20 +372,6 @@ public function testCallWithJsonRequest()
372372
$response->assertJSONExact(['foo' => 'bar']);
373373
}
374374

375-
public function testCallWithJsonRequestObject()
376-
{
377-
$this->withRoutes([
378-
[
379-
'post',
380-
'home',
381-
'\Tests\Support\Controllers\Popcorn::echoJson',
382-
],
383-
]);
384-
$response = $this->withBodyFormat('json')->call('post', 'home', ['foo' => 'bar']);
385-
$response->assertOK();
386-
$response->assertJSONExact((object) ['foo' => 'bar']);
387-
}
388-
389375
public function testSetupRequestBodyWithParams()
390376
{
391377
$request = $this->setupRequest('post', 'home');

tests/system/Test/TestResponseTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,20 @@ public function testAssertJsonExactArray()
405405
$this->testResponse->assertJSONExact($data);
406406
}
407407

408+
public function testAssertJsonExactObject()
409+
{
410+
$data = (object) [
411+
'config' => [
412+
'key-a',
413+
'key-b',
414+
],
415+
];
416+
$this->getTestResponse('');
417+
$this->response->setJSON($data, true);
418+
419+
$this->testResponse->assertJSONExact($data);
420+
}
421+
408422
public function testAssertJsonExactString()
409423
{
410424
$data = [

0 commit comments

Comments
 (0)