@@ -35,18 +35,18 @@ protected function defineEnvironment($app)
3535 $ app ->setBasePath (__DIR__ . '/.. ' );
3636 }
3737
38- public function exportJson ($ fixture , $ data ): void
38+ public function exportJson (string $ fixtureName , $ data ): void
3939 {
4040 if ($ data instanceof TestResponse) {
4141 $ data = $ data ->json ();
4242 }
4343
44- $ this ->exportContent (json_encode ($ data , JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE ), "{$ fixture }.json " );
44+ $ this ->exportContent (json_encode ($ data , JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE ), "{$ fixtureName }.json " );
4545 }
4646
47- protected function exportContent ($ content , string $ fixture ): void
47+ protected function exportContent ($ content , string $ fixtureName ): void
4848 {
49- file_put_contents ($ this ->getFixturePath ($ fixture ), $ content );
49+ file_put_contents ($ this ->getFixturePath ($ fixtureName ), $ content );
5050 }
5151
5252 public function getFixturePath (string $ fixtureName ): string
@@ -58,18 +58,27 @@ public function getFixturePath(string $fixtureName): string
5858 return base_path ("tests/fixtures/ {$ className }/ {$ fixtureName }" );
5959 }
6060
61- protected function getJsonFixture ($ name )
61+ protected function getJsonFixture (string $ name )
6262 {
6363 return json_decode ($ this ->getFixture ("{$ name }.json " ), true );
6464 }
6565
66- public function assertEqualsJsonFixture (string $ fixture , $ data , bool $ exportMode = false ): void
66+ public function assertEqualsJsonFixture (string $ fixtureName , $ data , bool $ exportMode = false ): void
6767 {
6868 if ($ exportMode || $ this ->globalExportMode ) {
69- $ this ->exportJson ($ fixture , $ data );
69+ $ this ->exportJson ($ fixtureName , $ data );
7070 }
7171
72- $ this ->assertEquals ($ this ->getJsonFixture ($ fixture ), $ data );
72+ $ this ->assertEquals ($ this ->getJsonFixture ($ fixtureName ), $ data );
73+ }
74+
75+ public function assertEqualsFixture (string $ fixtureName , $ data , bool $ exportMode = false ): void
76+ {
77+ if ($ exportMode || $ this ->globalExportMode ) {
78+ $ this ->exportContent ($ fixtureName , $ data );
79+ }
80+
81+ $ this ->assertEquals ($ this ->getFixture ($ fixtureName ), $ data );
7382 }
7483
7584 protected function getFixture ($ name )
0 commit comments