File tree Expand file tree Collapse file tree 2 files changed +3
-23
lines changed Expand file tree Collapse file tree 2 files changed +3
-23
lines changed Original file line number Diff line number Diff line change 22
33namespace Inertia \Tests ;
44
5- use Illuminate \Foundation \Testing \TestResponse as LegacyTestResponse ;
65use Illuminate \Support \Facades \View ;
76use Illuminate \Testing \TestResponse ;
87use Inertia \Inertia ;
98use Inertia \ServiceProvider ;
10- use LogicException ;
119use Orchestra \Testbench \TestCase as Orchestra ;
1210
1311abstract class TestCase extends Orchestra
@@ -30,26 +28,7 @@ protected function setUp(): void
3028 config ()->set ('inertia.testing.page_paths ' , [realpath (__DIR__ )]);
3129 }
3230
33- /**
34- * @throws LogicException
35- */
36- protected function getTestResponseClass (): string
37- {
38- // Laravel >= 7.0
39- if (class_exists (TestResponse::class)) {
40- return TestResponse::class;
41- }
42-
43- // Laravel <= 6.0
44- if (class_exists (LegacyTestResponse::class)) {
45- return LegacyTestResponse::class;
46- }
47-
48- throw new LogicException ('Could not detect TestResponse class. ' );
49- }
50-
51- /** @returns TestResponse|LegacyTestResponse */
52- protected function makeMockRequest ($ view )
31+ protected function makeMockRequest ($ view ): TestResponse
5332 {
5433 app ('router ' )->get ('/example-url ' , function () use ($ view ) {
5534 return $ view ;
Original file line number Diff line number Diff line change 33namespace Inertia \Tests \Testing ;
44
55use Illuminate \Testing \Fluent \AssertableJson ;
6+ use Illuminate \Testing \TestResponse ;
67use Inertia \Inertia ;
78use Inertia \Tests \TestCase ;
89
@@ -30,7 +31,7 @@ public function test_it_preserves_the_ability_to_continue_chaining_laravel_test_
3031 );
3132
3233 $ this ->assertInstanceOf (
33- $ this -> getTestResponseClass () ,
34+ TestResponse::class ,
3435 $ response ->assertInertia ()
3536 );
3637 }
You can’t perform that action at this time.
0 commit comments