@@ -71,7 +71,7 @@ public function the_component_exists_on_the_filesystem(): void
71
71
Inertia::render ('Stubs/ExamplePage ' )
72
72
);
73
73
74
- config ()->set ('inertia.page.should_exist ' , true );
74
+ config ()->set ('inertia.testing.ensure_pages_exist ' , true );
75
75
$ response ->assertInertia (function (Assert $ inertia ) {
76
76
$ inertia ->component ('Stubs/ExamplePage ' );
77
77
});
@@ -84,7 +84,7 @@ public function the_component_does_not_exist_on_the_filesystem(): void
84
84
Inertia::render ('foo ' )
85
85
);
86
86
87
- config ()->set ('inertia.page.should_exist ' , true );
87
+ config ()->set ('inertia.testing.ensure_pages_exist ' , true );
88
88
$ this ->expectException (AssertionFailedError::class);
89
89
$ this ->expectExceptionMessage ('Inertia page component file [foo] does not exist. ' );
90
90
@@ -100,7 +100,7 @@ public function it_can_force_enable_the_component_file_existence(): void
100
100
Inertia::render ('foo ' )
101
101
);
102
102
103
- config ()->set ('inertia.page.should_exist ' , false );
103
+ config ()->set ('inertia.testing.ensure_pages_exist ' , false );
104
104
$ this ->expectException (AssertionFailedError::class);
105
105
$ this ->expectExceptionMessage ('Inertia page component file [foo] does not exist. ' );
106
106
@@ -116,7 +116,7 @@ public function it_can_force_disable_the_component_file_existence_check(): void
116
116
Inertia::render ('foo ' )
117
117
);
118
118
119
- config ()->set ('inertia.page.should_exist ' , true );
119
+ config ()->set ('inertia.testing.ensure_pages_exist ' , true );
120
120
121
121
$ response ->assertInertia (function (Assert $ inertia ) {
122
122
$ inertia ->component ('foo ' , false );
@@ -130,8 +130,8 @@ public function the_component_does_not_exist_on_the_filesystem_when_it_does_not_
130
130
Inertia::render ('fixtures/ExamplePage ' )
131
131
);
132
132
133
- config ()->set ('inertia.page.should_exist ' , true );
134
- config ()->set ('inertia.page.paths ' , [realpath (__DIR__ )]);
133
+ config ()->set ('inertia.testing.ensure_pages_exist ' , true );
134
+ config ()->set ('inertia.testing.page_paths ' , [realpath (__DIR__ )]);
135
135
$ this ->expectException (AssertionFailedError::class);
136
136
$ this ->expectExceptionMessage ('Inertia page component file [fixtures/ExamplePage] does not exist. ' );
137
137
@@ -147,8 +147,8 @@ public function the_component_does_not_exist_on_the_filesystem_when_it_does_not_
147
147
Inertia::render ('fixtures/ExamplePage ' )
148
148
);
149
149
150
- config ()->set ('inertia.page.should_exist ' , true );
151
- config ()->set ('inertia.page.extensions ' , ['bin ' , 'exe ' , 'svg ' ]);
150
+ config ()->set ('inertia.testing.ensure_pages_exist ' , true );
151
+ config ()->set ('inertia.testing.page_extensions ' , ['bin ' , 'exe ' , 'svg ' ]);
152
152
$ this ->expectException (AssertionFailedError::class);
153
153
$ this ->expectExceptionMessage ('Inertia page component file [fixtures/ExamplePage] does not exist. ' );
154
154
@@ -943,76 +943,76 @@ public function it_fails_when_it_does_not_interact_with_all_props_in_the_scope_a
943
943
}
944
944
945
945
/** @test */
946
- public function it_does_not_fail_when_not_interacting_with_every_top_level_prop_by_default (): void
946
+ public function it_can_disable_the_interaction_check_for_the_current_scope (): void
947
947
{
948
948
$ response = $ this ->makeMockRequest (
949
949
Inertia::render ('foo ' , [
950
- 'foo ' => 'bar ' ,
951
- 'bar ' => 'baz ' ,
950
+ 'bar ' => true ,
952
951
])
953
952
);
954
953
955
954
$ response ->assertInertia (function (Assert $ inertia ) {
956
- $ inertia ->has ( ' foo ' );
955
+ $ inertia ->etc ( );
957
956
});
958
957
}
959
958
960
959
/** @test */
961
- public function it_fails_when_not_interacting_with_every_top_level_prop_while_the_force_setting_is_enabled (): void
960
+ public function it_cannot_disable_the_interaction_check_for_any_other_scopes (): void
962
961
{
963
962
$ response = $ this ->makeMockRequest (
964
963
Inertia::render ('foo ' , [
965
- 'foo ' => 'bar ' ,
966
- 'bar ' => 'baz ' ,
964
+ 'bar ' => true ,
965
+ 'baz ' => [
966
+ 'foo ' => 'bar ' ,
967
+ 'example ' => 'value ' ,
968
+ ],
967
969
])
968
970
);
969
971
970
- config ()->set ('inertia.force_top_level_property_interaction ' , true );
971
-
972
972
$ this ->expectException (AssertionFailedError::class);
973
- $ this ->expectExceptionMessage ('Unexpected Inertia properties were found on the root level . ' );
973
+ $ this ->expectExceptionMessage ('Unexpected Inertia properties were found in scope [baz] . ' );
974
974
975
975
$ response ->assertInertia (function (Assert $ inertia ) {
976
- $ inertia ->has ('foo ' );
976
+ $ inertia
977
+ ->etc ()
978
+ ->has ('baz ' , function (Assert $ inertia ) {
979
+ $ inertia ->where ('foo ' , 'bar ' );
980
+ });
977
981
});
978
982
}
979
983
980
984
/** @test */
981
- public function it_can_disable_the_interaction_check_for_the_current_scope (): void
985
+ public function it_does_not_fail_when_not_interacting_with_every_top_level_prop (): void
982
986
{
983
987
$ response = $ this ->makeMockRequest (
984
988
Inertia::render ('foo ' , [
985
- 'bar ' => true ,
989
+ 'foo ' => 'bar ' ,
990
+ 'bar ' => 'baz ' ,
986
991
])
987
992
);
988
993
989
994
$ response ->assertInertia (function (Assert $ inertia ) {
990
- $ inertia ->etc ( );
995
+ $ inertia ->has ( ' foo ' );
991
996
});
992
997
}
993
998
994
999
/** @test */
995
- public function it_cannot_disable_the_interaction_check_for_any_other_scopes (): void
1000
+ public function it_fails_when_not_interacting_with_every_top_level_prop_while_the_interacted_flag_is_set (): void
996
1001
{
997
1002
$ response = $ this ->makeMockRequest (
998
1003
Inertia::render ('foo ' , [
999
- 'bar ' => true ,
1000
- 'baz ' => [
1001
- 'foo ' => 'bar ' ,
1002
- 'example ' => 'value ' ,
1003
- ],
1004
+ 'foo ' => 'bar ' ,
1005
+ 'bar ' => 'baz ' ,
1004
1006
])
1005
1007
);
1006
1008
1007
1009
$ this ->expectException (AssertionFailedError::class);
1008
- $ this ->expectExceptionMessage ('Unexpected Inertia properties were found in scope [baz] . ' );
1010
+ $ this ->expectExceptionMessage ('Unexpected Inertia properties were found on the root level . ' );
1009
1011
1010
1012
$ response ->assertInertia (function (Assert $ inertia ) {
1011
1013
$ inertia
1012
- ->etc ()
1013
- ->has ('baz ' , function (Assert $ inertia ) {
1014
- $ inertia ->where ('foo ' , 'bar ' );
1015
- });
1014
+ ->has ('foo ' )
1015
+ ->interacted ();
1016
1016
});
1017
1017
}
1018
1018
0 commit comments