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 2
2
3
3
namespace Inertia \Tests ;
4
4
5
- use Illuminate \Foundation \Testing \TestResponse as LegacyTestResponse ;
6
5
use Illuminate \Support \Facades \View ;
7
6
use Illuminate \Testing \TestResponse ;
8
7
use Inertia \Inertia ;
9
8
use Inertia \ServiceProvider ;
10
- use LogicException ;
11
9
use Orchestra \Testbench \TestCase as Orchestra ;
12
10
13
11
abstract class TestCase extends Orchestra
@@ -30,26 +28,7 @@ protected function setUp(): void
30
28
config ()->set ('inertia.testing.page_paths ' , [realpath (__DIR__ )]);
31
29
}
32
30
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
53
32
{
54
33
app ('router ' )->get ('/example-url ' , function () use ($ view ) {
55
34
return $ view ;
Original file line number Diff line number Diff line change 3
3
namespace Inertia \Tests \Testing ;
4
4
5
5
use Illuminate \Testing \Fluent \AssertableJson ;
6
+ use Illuminate \Testing \TestResponse ;
6
7
use Inertia \Inertia ;
7
8
use Inertia \Tests \TestCase ;
8
9
@@ -30,7 +31,7 @@ public function test_it_preserves_the_ability_to_continue_chaining_laravel_test_
30
31
);
31
32
32
33
$ this ->assertInstanceOf (
33
- $ this -> getTestResponseClass () ,
34
+ TestResponse::class ,
34
35
$ response ->assertInertia ()
35
36
);
36
37
}
You can’t perform that action at this time.
0 commit comments