File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -11,16 +11,17 @@ trait MatchesSnapshots
1111 use BaseMatchesSnapshots;
1212
1313 /**
14- * Asserts the structure of the response json with a snapshot.
14+ * Asserts the structure of the json structure with a snapshot.
1515 *
16- * @param \Illuminate\Foundation\Testing\TestResponse $response
16+ * @param mixed $actual
1717 * @return void
1818 */
19- public function assertJsonStructureSnapshot (TestResponse $ response ): void
19+ public function assertJsonStructureSnapshot ($ actual ): void
2020 {
21- $ this ->assertMatchesSnapshot (
22- $ response ->json (),
23- new JsonStructureDriver ()
24- );
21+ $ json = $ actual instanceof TestResponse
22+ ? $ actual ->json ()
23+ : $ actual ;
24+
25+ $ this ->assertMatchesSnapshot ($ json , new JsonStructureDriver ());
2526 }
2627}
You can’t perform that action at this time.
0 commit comments