@@ -27,7 +27,9 @@ public function testBasicCreateDumpsAutoload()
2727 $ app = new Application ;
2828 $ app ->useDatabasePath (__DIR__ );
2929 $ command ->setLaravel ($ app );
30- $ creator ->shouldReceive ('create ' )->once ()->with ('create_foo ' , __DIR__ .DIRECTORY_SEPARATOR .'migrations ' , 'foo ' , true );
30+ $ creator ->shouldReceive ('create ' )->once ()
31+ ->with ('create_foo ' , __DIR__ .DIRECTORY_SEPARATOR .'migrations ' , 'foo ' , true )
32+ ->andReturn (__DIR__ .'/migrations/2021_04_23_110457_create_foo.php ' );
3133 $ composer ->shouldReceive ('dumpAutoloads ' )->once ();
3234
3335 $ this ->runCommand ($ command , ['name ' => 'create_foo ' ]);
@@ -42,7 +44,9 @@ public function testBasicCreateGivesCreatorProperArguments()
4244 $ app = new Application ;
4345 $ app ->useDatabasePath (__DIR__ );
4446 $ command ->setLaravel ($ app );
45- $ creator ->shouldReceive ('create ' )->once ()->with ('create_foo ' , __DIR__ .DIRECTORY_SEPARATOR .'migrations ' , 'foo ' , true );
47+ $ creator ->shouldReceive ('create ' )->once ()
48+ ->with ('create_foo ' , __DIR__ .DIRECTORY_SEPARATOR .'migrations ' , 'foo ' , true )
49+ ->andReturn (__DIR__ .'/migrations/2021_04_23_110457_create_foo.php ' );
4650
4751 $ this ->runCommand ($ command , ['name ' => 'create_foo ' ]);
4852 }
@@ -56,7 +60,9 @@ public function testBasicCreateGivesCreatorProperArgumentsWhenNameIsStudlyCase()
5660 $ app = new Application ;
5761 $ app ->useDatabasePath (__DIR__ );
5862 $ command ->setLaravel ($ app );
59- $ creator ->shouldReceive ('create ' )->once ()->with ('create_foo ' , __DIR__ .DIRECTORY_SEPARATOR .'migrations ' , 'foo ' , true );
63+ $ creator ->shouldReceive ('create ' )->once ()
64+ ->with ('create_foo ' , __DIR__ .DIRECTORY_SEPARATOR .'migrations ' , 'foo ' , true )
65+ ->andReturn (__DIR__ .'/migrations/2021_04_23_110457_create_foo.php ' );
6066
6167 $ this ->runCommand ($ command , ['name ' => 'CreateFoo ' ]);
6268 }
@@ -70,7 +76,9 @@ public function testBasicCreateGivesCreatorProperArgumentsWhenTableIsSet()
7076 $ app = new Application ;
7177 $ app ->useDatabasePath (__DIR__ );
7278 $ command ->setLaravel ($ app );
73- $ creator ->shouldReceive ('create ' )->once ()->with ('create_foo ' , __DIR__ .DIRECTORY_SEPARATOR .'migrations ' , 'users ' , true );
79+ $ creator ->shouldReceive ('create ' )->once ()
80+ ->with ('create_foo ' , __DIR__ .DIRECTORY_SEPARATOR .'migrations ' , 'users ' , true )
81+ ->andReturn (__DIR__ .'/migrations/2021_04_23_110457_create_foo.php ' );
7482
7583 $ this ->runCommand ($ command , ['name ' => 'create_foo ' , '--create ' => 'users ' ]);
7684 }
@@ -84,7 +92,9 @@ public function testBasicCreateGivesCreatorProperArgumentsWhenCreateTablePattern
8492 $ app = new Application ;
8593 $ app ->useDatabasePath (__DIR__ );
8694 $ command ->setLaravel ($ app );
87- $ creator ->shouldReceive ('create ' )->once ()->with ('create_users_table ' , __DIR__ .DIRECTORY_SEPARATOR .'migrations ' , 'users ' , true );
95+ $ creator ->shouldReceive ('create ' )->once ()
96+ ->with ('create_users_table ' , __DIR__ .DIRECTORY_SEPARATOR .'migrations ' , 'users ' , true )
97+ ->andReturn (__DIR__ .'/migrations/2021_04_23_110457_create_users_table.php ' );
8898
8999 $ this ->runCommand ($ command , ['name ' => 'create_users_table ' ]);
90100 }
@@ -98,7 +108,9 @@ public function testCanSpecifyPathToCreateMigrationsIn()
98108 $ app = new Application ;
99109 $ command ->setLaravel ($ app );
100110 $ app ->setBasePath ('/home/laravel ' );
101- $ creator ->shouldReceive ('create ' )->once ()->with ('create_foo ' , '/home/laravel/vendor/laravel-package/migrations ' , 'users ' , true );
111+ $ creator ->shouldReceive ('create ' )->once ()
112+ ->with ('create_foo ' , '/home/laravel/vendor/laravel-package/migrations ' , 'users ' , true )
113+ ->andReturn ('/home/laravel/vendor/laravel-package/migrations/2021_04_23_110457_create_foo.php ' );
102114 $ this ->runCommand ($ command , ['name ' => 'create_foo ' , '--path ' => 'vendor/laravel-package/migrations ' , '--create ' => 'users ' ]);
103115 }
104116
0 commit comments