@@ -70,29 +70,6 @@ public function output_generates_migrations($definition, $path, $model): void
70
70
$ this ->assertEquals (['created ' => [$ timestamp_path ]], $ this ->subject ->output ($ tree ));
71
71
}
72
72
73
- #[Test]
74
- public function output_writes_migration_for_foreign_shorthand (): void
75
- {
76
- $ this ->filesystem ->expects ('stub ' )
77
- ->with ('migration.stub ' )
78
- ->andReturn ($ this ->stub ('migration.stub ' ));
79
-
80
- $ now = Carbon::now ();
81
- Carbon::setTestNow ($ now );
82
-
83
- $ timestamp_path = str_replace ('timestamp ' , $ now ->format ('Y_m_d_His ' ), 'database/migrations/timestamp_create_comments_table.php ' );
84
-
85
- $ this ->filesystem ->expects ('exists ' )->andReturn (false );
86
-
87
- $ this ->filesystem ->expects ('put ' )
88
- ->with ($ timestamp_path , $ this ->fixture ('migrations/foreign-key-shorthand.php ' ));
89
-
90
- $ tokens = $ this ->blueprint ->parse ($ this ->fixture ('drafts/foreign-key-shorthand.yaml ' ));
91
- $ tree = $ this ->blueprint ->analyze ($ tokens );
92
-
93
- $ this ->assertEquals (['created ' => [$ timestamp_path ]], $ this ->subject ->output ($ tree ));
94
- }
95
-
96
73
#[Test]
97
74
public function output_uses_past_timestamp_for_multiple_migrations (): void
98
75
{
@@ -396,55 +373,6 @@ public function output_creates_foreign_keys_with_nullable_chained_correctly(): v
396
373
$ this ->assertEquals (['created ' => [$ model_migration ]], $ this ->subject ->output ($ tree ));
397
374
}
398
375
399
- #[Test]
400
- public function output_creates_nullable_foreign_key_without_column_type_beeing_id (): void
401
- {
402
- $ this ->filesystem ->expects ('stub ' )
403
- ->with ('migration.stub ' )
404
- ->andReturn ($ this ->stub ('migration.stub ' ));
405
-
406
- $ now = Carbon::now ();
407
- Carbon::setTestNow ($ now );
408
-
409
- $ model_migration = str_replace ('timestamp ' , $ now ->format ('Y_m_d_His ' ), 'database/migrations/timestamp_create_comments_table.php ' );
410
-
411
- $ this ->filesystem ->expects ('exists ' )->with ($ model_migration )->andReturn (false );
412
-
413
- $ this ->files
414
- ->expects ('put ' )
415
- ->with ($ model_migration , $ this ->fixture ('migrations/nullable-columns-with-foreign.php ' ));
416
-
417
- $ tokens = $ this ->blueprint ->parse ($ this ->fixture ('drafts/nullable-columns-with-foreign.yaml ' ));
418
-
419
- $ tree = $ this ->blueprint ->analyze ($ tokens );
420
-
421
- $ this ->assertEquals (['created ' => [$ model_migration ]], $ this ->subject ->output ($ tree ));
422
- }
423
-
424
- #[Test]
425
- public function output_creates_foreign_keys_with_on_delete (): void
426
- {
427
- $ this ->filesystem ->expects ('stub ' )
428
- ->with ('migration.stub ' )
429
- ->andReturn ($ this ->stub ('migration.stub ' ));
430
-
431
- $ now = Carbon::now ();
432
- Carbon::setTestNow ($ now );
433
-
434
- $ model_migration = str_replace ('timestamp ' , $ now ->format ('Y_m_d_His ' ), 'database/migrations/timestamp_create_comments_table.php ' );
435
-
436
- $ this ->filesystem ->expects ('exists ' )->andReturn (false );
437
-
438
- $ this ->files
439
- ->expects ('put ' )
440
- ->with ($ model_migration , $ this ->fixture ('migrations/foreign-key-on-delete.php ' ));
441
-
442
- $ tokens = $ this ->blueprint ->parse ($ this ->fixture ('drafts/foreign-key-on-delete.yaml ' ));
443
- $ tree = $ this ->blueprint ->analyze ($ tokens );
444
-
445
- $ this ->assertEquals (['created ' => [$ model_migration ]], $ this ->subject ->output ($ tree ));
446
- }
447
-
448
376
#[Test]
449
377
public function output_works_with_polymorphic_relationships (): void
450
378
{
@@ -474,29 +402,6 @@ public function output_works_with_polymorphic_relationships(): void
474
402
$ this ->assertEquals (['created ' => [$ post_migration , $ user_migration , $ image_migration ]], $ this ->subject ->output ($ tree ));
475
403
}
476
404
477
- #[Test]
478
- public function output_works_with_multiple_morphto_statements_in_polymorphic_relationship (): void
479
- {
480
- $ this ->filesystem ->expects ('stub ' )
481
- ->with ('migration.stub ' )
482
- ->andReturn ($ this ->stub ('migration.stub ' ));
483
-
484
- $ now = Carbon::now ();
485
- Carbon::setTestNow ($ now );
486
-
487
- $ image_migration = str_replace ('timestamp ' , $ now ->format ('Y_m_d_His ' ), 'database/migrations/timestamp_create_images_table.php ' );
488
-
489
- $ this ->filesystem ->expects ('exists ' )->andReturn (false );
490
-
491
- $ this ->filesystem ->expects ('put ' )
492
- ->with ($ image_migration , $ this ->fixture ('migrations/polymorphic_relationships_images_table_multiple_morphto.php ' ));
493
-
494
- $ tokens = $ this ->blueprint ->parse ($ this ->fixture ('drafts/polymorphic-relationships-multiple-morphto.yaml ' ));
495
- $ tree = $ this ->blueprint ->analyze ($ tokens );
496
-
497
- $ this ->assertEquals (['created ' => [$ image_migration ]], $ this ->subject ->output ($ tree ));
498
- }
499
-
500
405
#[Test]
501
406
public function output_does_not_generate_relationship_for_uuid (): void
502
407
{
@@ -606,31 +511,6 @@ public function output_generates_custom_pivot_tables(): void
606
511
$ this ->assertEquals (['created ' => [$ user_migration , $ team_migration , $ pivot_migration ]], $ this ->subject ->output ($ tree ));
607
512
}
608
513
609
- #[Test]
610
- public function output_omits_length_for_integers (): void
611
- {
612
- $ this ->filesystem ->expects ('stub ' )
613
- ->with ('migration.stub ' )
614
- ->andReturn ($ this ->stub ('migration.stub ' ));
615
-
616
- $ now = Carbon::now ();
617
- Carbon::setTestNow ($ now );
618
-
619
- $ timestamp_path = 'database/migrations/ ' . $ now ->format ('Y_m_d_His ' ) . '_create_omits_table.php ' ;
620
-
621
- $ this ->filesystem ->expects ('exists ' )
622
- ->with ($ timestamp_path )
623
- ->andReturn (false );
624
-
625
- $ this ->filesystem ->expects ('put ' )
626
- ->with ($ timestamp_path , $ this ->fixture ('migrations/omits-length-for-integers.php ' ));
627
-
628
- $ tokens = $ this ->blueprint ->parse ($ this ->fixture ('drafts/omits-length-for-integers.yaml ' ));
629
- $ tree = $ this ->blueprint ->analyze ($ tokens );
630
-
631
- $ this ->assertEquals (['created ' => [$ timestamp_path ]], $ this ->subject ->output ($ tree ));
632
- }
633
-
634
514
public static function modelTreeDataProvider ()
635
515
{
636
516
return [
@@ -659,6 +539,11 @@ public static function modelTreeDataProvider()
659
539
['drafts/full-text.yaml ' , 'database/migrations/timestamp_create_posts_table.php ' , 'migrations/full-text.php ' ],
660
540
['drafts/model-with-meta.yaml ' , 'database/migrations/timestamp_create_post_table.php ' , 'migrations/model-with-meta.php ' ],
661
541
['drafts/infer-belongsto.yaml ' , 'database/migrations/timestamp_create_conferences_table.php ' , 'migrations/infer-belongsto.php ' ],
542
+ ['drafts/foreign-key-shorthand.yaml ' , 'database/migrations/timestamp_create_comments_table.php ' , 'migrations/foreign-key-shorthand.php ' ],
543
+ ['drafts/polymorphic-relationships-multiple-morphto.yaml ' , 'database/migrations/timestamp_create_images_table.php ' , 'migrations/polymorphic_relationships_images_table_multiple_morphto.php ' ],
544
+ ['drafts/foreign-key-on-delete.yaml ' , 'database/migrations/timestamp_create_comments_table.php ' , 'migrations/foreign-key-on-delete.php ' ],
545
+ ['drafts/nullable-columns-with-foreign.yaml ' , 'database/migrations/timestamp_create_comments_table.php ' , 'migrations/nullable-columns-with-foreign.php ' ],
546
+ ['drafts/omits-length-for-integers.yaml ' , 'database/migrations/timestamp_create_omits_table.php ' , 'migrations/omits-length-for-integers.php ' ],
662
547
];
663
548
}
664
549
}
0 commit comments