@@ -17,7 +17,7 @@ class TestCaseTest extends BaseTestCase
17
17
public function test_it_includes_response_exceptions_on_test_failures ()
18
18
{
19
19
$ testCase = new ExampleTestCase ();
20
- $ testCase-> latestResponse = TestResponse::fromBaseResponse (new Response ())
20
+ $ testCase:: $ latestResponse = TestResponse::fromBaseResponse (new Response ())
21
21
->withExceptions (collect ([new Exception ('Unexpected exception. ' )]));
22
22
23
23
$ this ->expectException (ExpectationFailedException::class);
@@ -29,7 +29,7 @@ public function test_it_includes_response_exceptions_on_test_failures()
29
29
public function test_it_includes_validation_errors_on_test_failures ()
30
30
{
31
31
$ testCase = new ExampleTestCase ();
32
- $ testCase-> latestResponse = TestResponse::fromBaseResponse (
32
+ $ testCase:: $ latestResponse = TestResponse::fromBaseResponse (
33
33
tap (new RedirectResponse ('/ ' ))
34
34
->setSession (new Store ('test-session ' , new NullSessionHandler ()))
35
35
->withErrors ([
@@ -45,7 +45,7 @@ public function test_it_includes_validation_errors_on_test_failures()
45
45
public function test_it_includes_json_validation_errors_on_test_failures ()
46
46
{
47
47
$ testCase = new ExampleTestCase ();
48
- $ testCase-> latestResponse = TestResponse::fromBaseResponse (
48
+ $ testCase:: $ latestResponse = TestResponse::fromBaseResponse (
49
49
new Response (['errors ' => ['first_name ' => 'The first name field is required. ' ]])
50
50
);
51
51
@@ -57,7 +57,7 @@ public function test_it_includes_json_validation_errors_on_test_failures()
57
57
public function test_it_doesnt_fail_with_false_json ()
58
58
{
59
59
$ testCase = new ExampleTestCase ();
60
- $ testCase-> latestResponse = TestResponse::fromBaseResponse (
60
+ $ testCase:: $ latestResponse = TestResponse::fromBaseResponse (
61
61
new Response (false , 200 , ['Content-Type ' => 'application/json ' ])
62
62
);
63
63
@@ -69,7 +69,7 @@ public function test_it_doesnt_fail_with_false_json()
69
69
public function test_it_doesnt_fail_with_encoded_json ()
70
70
{
71
71
$ testCase = new ExampleTestCase ();
72
- $ testCase-> latestResponse = TestResponse::fromBaseResponse (
72
+ $ testCase:: $ latestResponse = TestResponse::fromBaseResponse (
73
73
tap (new Response , function ($ response ) {
74
74
$ response ->header ('Content-Type ' , 'application/json ' );
75
75
$ response ->header ('Content-Encoding ' , 'gzip ' );
@@ -81,6 +81,11 @@ public function test_it_doesnt_fail_with_encoded_json()
81
81
$ this ->expectExceptionMessageMatches ('/Assertion message/s ' );
82
82
$ testCase ->onNotSuccessfulTest (new ExpectationFailedException ('Assertion message. ' ));
83
83
}
84
+
85
+ public function tearDown (): void
86
+ {
87
+ ExampleTestCase::$ latestResponse = null ;
88
+ }
84
89
}
85
90
86
91
class ExampleTestCase extends TestCase
0 commit comments