Skip to content

Commit f50e200

Browse files
crissitaylorotwell
authored andcommitted
[5.5] Fix unit test for assertJsonCount (#22938)
* Improve unit test for assertJsonCount * style missing comma
1 parent f42f37d commit f50e200

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/Foundation/FoundationTestResponseTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ public function testAssertJsonCount()
156156
$response->assertJsonCount(3, 'bars');
157157

158158
// With nested key
159-
$response->assertJsonCount(2, 'baz.*.bar');
159+
$response->assertJsonCount(1, 'barfoo.0.bar');
160+
$response->assertJsonCount(3, 'barfoo.2.bar');
160161

161162
// Without structure
162163
$response = TestResponse::fromBaseResponse(new Response(new JsonSerializableSingleResourceStub));
163-
164164
$response->assertJsonCount(4);
165165
}
166166

@@ -211,6 +211,11 @@ public function jsonSerialize()
211211
['foo' => 'bar 0', 'bar' => ['foo' => 'bar 0', 'bar' => 'foo 0']],
212212
['foo' => 'bar 1', 'bar' => ['foo' => 'bar 1', 'bar' => 'foo 1']],
213213
],
214+
'barfoo' => [
215+
['bar' => ['bar' => 'foo 0']],
216+
['bar' => ['bar' => 'foo 0', 'bar' => 'foo 0']],
217+
['bar' => ['foo' => 'bar 0', 'bar' => 'foo 0', 'rab' => 'rab 0']],
218+
],
214219
];
215220
}
216221
}

0 commit comments

Comments
 (0)