Skip to content

Commit a288e20

Browse files
committed
add docblock for assertJsonByKeys
1 parent d7293d3 commit a288e20

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Tempest/Framework/Testing/Http/TestResponseHelper.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,15 @@ public function assertJson(array $expected): self
230230
return $this;
231231
}
232232

233+
/**
234+
* This assertion lets you assert that the response contains the given keys and values.
235+
* The first array is the expected values, the second array is the keys to check.
236+
*
237+
* @param array<string, mixed> $expected The expected values.
238+
* @param array<string> $keys The keys to check.
239+
*
240+
* @example assertJsonByKeys(['id' => 1, 'title' => 'The Odyssee'], keys: ['id', 'title'])
241+
*/
233242
public function assertJsonByKeys(array $expected, array $keys): self
234243
{
235244
$filteredBody = array_reduce(

0 commit comments

Comments
 (0)