1 | <?php |
||
7 | trait AssertJsonResponse |
||
8 | { |
||
9 | use AssertArrays; |
||
10 | |||
11 | public function __construct() |
||
17 | |||
18 | /** |
||
19 | * Add the functions to the TestResponse objects. |
||
20 | */ |
||
21 | 1 | public function addJsonResponseMacros() |
|
37 | |||
38 | /** |
||
39 | * Assert that the JSON response has exactly the given structure. |
||
40 | * |
||
41 | * @param array $structure |
||
42 | * @param array|null $responseData |
||
43 | * |
||
44 | * @return $this |
||
45 | */ |
||
46 | 2 | public function assertJsonStructureEquals($structure, $responseData = null) |
|
54 | |||
55 | /** |
||
56 | * Assert that the JSON response has a given typed structure. |
||
57 | * |
||
58 | * @param array $structure |
||
59 | * @param array|null $responseData |
||
60 | * @return $this |
||
61 | */ |
||
62 | 2 | public function seeJsonTypedStructure($structure, $responseData = null) |
|
70 | |||
71 | /** |
||
72 | * Return the json response or a part of it as an array. |
||
73 | * |
||
74 | * @param string $key |
||
75 | * @param array|null $responseData |
||
76 | * |
||
77 | * @return mixed |
||
78 | */ |
||
79 | 2 | public function jsonResponse($key = null, $responseData = null) |
|
87 | } |
||
88 |