@@ -70,11 +70,12 @@ public function output_generates_test_for_controller_tree_l8($definition, $path,
70
70
->with ($ dirname , 0755 , true );
71
71
72
72
$ this ->filesystem ->expects ('put ' )
73
- ->with ($ path , $ this ->fixture ($ test ));
73
+ ->with ($ path , $ this ->fixture ($ test ));
74
74
}
75
75
76
76
$ tokens = $ this ->blueprint ->parse ($ this ->fixture ($ definition ));
77
77
$ tree = $ this ->blueprint ->analyze ($ tokens );
78
+
78
79
$ this ->assertEquals (['created ' => array_keys ($ paths )], $ this ->subject ->output ($ tree ));
79
80
}
80
81
@@ -97,17 +98,20 @@ public function output_works_for_pascal_case_definition_l8()
97
98
$ this ->filesystem ->expects ('exists ' )
98
99
->with (dirname ($ certificateControllerTest ))
99
100
->andReturnTrue ();
101
+
100
102
$ this ->filesystem ->expects ('put ' )
101
103
->with ($ certificateControllerTest , $ this ->fixture ('tests/certificate-pascal-case-example.php ' ));
102
104
103
105
$ this ->filesystem ->expects ('exists ' )
104
106
->with (dirname ($ certificateTypeControllerTest ))
105
107
->andReturnTrue ();
108
+
106
109
$ this ->filesystem ->expects ('put ' )
107
110
->with ($ certificateTypeControllerTest , $ this ->fixture ('tests/certificate-type-pascal-case-example.php ' ));
108
111
109
112
$ tokens = $ this ->blueprint ->parse ($ this ->fixture ('drafts/pascal-case.yaml ' ));
110
113
$ tree = $ this ->blueprint ->analyze ($ tokens );
114
+
111
115
$ this ->assertEquals (['created ' => [$ certificateControllerTest , $ certificateTypeControllerTest ]], $ this ->subject ->output ($ tree ));
112
116
}
113
117
@@ -123,11 +127,14 @@ public function output_generates_test_for_controller_tree_using_cached_model_l8(
123
127
$ this ->filesystem ->expects ('stub ' )
124
128
->with ('test.case.stub ' )
125
129
->andReturn ($ this ->stub ('test.case.stub ' ));
130
+
126
131
$ this ->filesystem ->expects ('exists ' )
127
132
->with ('tests/Feature/Http/Controllers ' )
128
133
->andReturnFalse ();
134
+
129
135
$ this ->filesystem ->expects ('makeDirectory ' )
130
136
->with ('tests/Feature/Http/Controllers ' , 0755 , true );
137
+
131
138
$ this ->filesystem ->expects ('put ' )
132
139
->with ('tests/Feature/Http/Controllers/UserControllerTest.php ' , $ this ->fixture ('tests/reference-cache.php ' ));
133
140
@@ -161,17 +168,21 @@ public function output_generates_tests_with_models_with_custom_namespace_correct
161
168
$ this ->filesystem ->expects ('stub ' )
162
169
->with ('test.case.stub ' )
163
170
->andReturn ($ this ->stub ('test.case.stub ' ));
171
+
164
172
$ dirname = dirname ($ path );
165
173
$ this ->filesystem ->expects ('exists ' )
166
174
->with ($ dirname )
167
175
->andReturnFalse ();
176
+
168
177
$ this ->filesystem ->expects ('makeDirectory ' )
169
- ->with ($ dirname , 0755 , true );
178
+ ->with ($ dirname , 0755 , true );
179
+
170
180
$ this ->filesystem ->expects ('put ' )
171
181
->with ($ path , $ this ->fixture ($ test ));
172
182
173
183
$ tokens = $ this ->blueprint ->parse ($ this ->fixture ($ definition ));
174
184
$ tree = $ this ->blueprint ->analyze ($ tokens );
185
+
175
186
$ this ->assertEquals (['created ' => [$ path ]], $ this ->subject ->output ($ tree ));
176
187
}
177
188
@@ -187,8 +198,8 @@ public function output_using_return_types()
187
198
$ this ->app ['config ' ]->set ('blueprint.use_return_types ' , true );
188
199
189
200
$ this ->filesystem ->expects ('stub ' )
190
- ->with ('test.class.stub ' )
191
- ->andReturn ($ this ->stub ('test.class.stub ' ));
201
+ ->with ('test.class.stub ' )
202
+ ->andReturn ($ this ->stub ('test.class.stub ' ));
192
203
193
204
$ this ->filesystem ->expects ('stub ' )
194
205
->with ('test.case.stub ' )
@@ -219,6 +230,7 @@ public function controllerTreeDataProvider()
219
230
['drafts/readme-example-notification-model.yaml ' , 'tests/Feature/Http/Controllers/PostControllerTest.php ' , 'tests/readme-example-notification.php ' ],
220
231
['drafts/respond-statements.yaml ' , 'tests/Feature/Http/Controllers/Api/PostControllerTest.php ' , 'tests/respond-statements.php ' ],
221
232
['drafts/full-crud-example.yaml ' , 'tests/Feature/Http/Controllers/PostControllerTest.php ' , 'tests/full-crud-example.php ' ],
233
+ ['drafts/crud-show-only.yaml ' , 'tests/Feature/Http/Controllers/PostControllerTest.php ' , 'tests/crud-show-only.php ' ],
222
234
['drafts/model-reference-validate.yaml ' , 'tests/Feature/Http/Controllers/CertificateControllerTest.php ' , 'tests/api-shorthand-validation.php ' ],
223
235
['drafts/controllers-only-no-context.yaml ' , 'tests/Feature/Http/Controllers/ReportControllerTest.php ' , 'tests/controllers-only-no-context.php ' ],
224
236
['drafts/call-to-a-member-function-columns-on-null.yaml ' , [
0 commit comments