@@ -79,6 +79,7 @@ public function output_generates_models($definition, $path, $model)
79
79
->with ('model/method-comment.stub ' )
80
80
->andReturn (file_get_contents ('stubs/model/method-comment.stub ' ));
81
81
82
+
82
83
$ this ->files ->expects ('exists ' )
83
84
->with (dirname ($ path ))
84
85
->andReturnTrue ();
@@ -163,6 +164,39 @@ public function output_generates_relationships()
163
164
$ this ->assertEquals (['created ' => ['app/Subscription.php ' ]], $ this ->subject ->output ($ tree ));
164
165
}
165
166
167
+ /**
168
+ * @test
169
+ */
170
+ public function output_generates_disabled_auto_columns ()
171
+ {
172
+ $ this ->files ->expects ('stub ' )
173
+ ->with ('model/class.stub ' )
174
+ ->andReturn (file_get_contents ('stubs/model/class.stub ' ));
175
+ $ this ->files ->expects ('stub ' )
176
+ ->with ('model/timestamps.stub ' )
177
+ ->andReturn (file_get_contents ('stubs/model/timestamps.stub ' ));
178
+ $ this ->files ->expects ('stub ' )
179
+ ->with ('model/fillable.stub ' )
180
+ ->andReturn (file_get_contents ('stubs/model/fillable.stub ' ));
181
+ $ this ->files ->expects ('stub ' )
182
+ ->with ('model/casts.stub ' )
183
+ ->andReturn (file_get_contents ('stubs/model/casts.stub ' ));
184
+ $ this ->files ->expects ('stub ' )
185
+ ->with ('model/method.stub ' )
186
+ ->andReturn (file_get_contents ('stubs/model/method.stub ' ));
187
+
188
+ $ this ->files ->expects ('exists ' )
189
+ ->with ('app ' )
190
+ ->andReturnTrue ();
191
+ $ this ->files ->expects ('put ' )
192
+ ->with ('app/State.php ' , $ this ->fixture ('models/disable-auto-columns.php ' ));
193
+
194
+ $ tokens = $ this ->blueprint ->parse ($ this ->fixture ('definitions/disable-auto-columns.bp ' ));
195
+ $ tree = $ this ->blueprint ->analyze ($ tokens );
196
+
197
+ $ this ->assertEquals (['created ' => ['app/State.php ' ]], $ this ->subject ->output ($ tree ));
198
+ }
199
+
166
200
/**
167
201
* @test
168
202
*/
@@ -214,6 +248,12 @@ public function output_generates_phpdoc_for_model($definition, $path, $model)
214
248
->with ('model/class.stub ' )
215
249
->andReturn (file_get_contents ('stubs/model/class.stub ' ));
216
250
251
+ if ($ definition === 'definitions/disable-auto-columns.bp ' ) {
252
+ $ this ->files ->expects ('stub ' )
253
+ ->with ('model/timestamps.stub ' )
254
+ ->andReturn (file_get_contents ('stubs/model/timestamps.stub ' ));
255
+ }
256
+
217
257
$ this ->files ->expects ('stub ' )
218
258
->with ('model/fillable.stub ' )
219
259
->andReturn (file_get_contents ('stubs/model/fillable.stub ' ));
0 commit comments