@@ -37,22 +37,22 @@ public function testOnce()
3737 $ this ->artisan ('migrate:actions ' )->run ();
3838
3939 $ this ->assertDatabaseCount ($ table , 1 );
40- $ this ->assertDatabaseCount ($ this ->table , 5 );
40+ $ this ->assertDatabaseCount ($ this ->table , 6 );
4141 $ this ->assertDatabaseMigrationDoesntLike ($ this ->table , $ table );
4242 $ this ->artisan ('migrate:actions ' )->run ();
4343
4444 $ this ->assertDatabaseCount ($ table , 2 );
45- $ this ->assertDatabaseCount ($ this ->table , 5 );
45+ $ this ->assertDatabaseCount ($ this ->table , 6 );
4646 $ this ->assertDatabaseMigrationDoesntLike ($ this ->table , $ table );
4747 $ this ->artisan ('migrate:actions ' )->run ();
4848
4949 $ this ->assertDatabaseCount ($ table , 3 );
50- $ this ->assertDatabaseCount ($ this ->table , 5 );
50+ $ this ->assertDatabaseCount ($ this ->table , 6 );
5151 $ this ->assertDatabaseMigrationDoesntLike ($ this ->table , $ table );
5252 $ this ->artisan ('migrate:actions ' )->run ();
5353
5454 $ this ->assertDatabaseCount ($ table , 4 );
55- $ this ->assertDatabaseCount ($ this ->table , 5 );
55+ $ this ->assertDatabaseCount ($ this ->table , 6 );
5656 $ this ->assertDatabaseMigrationDoesntLike ($ this ->table , $ table );
5757 }
5858
@@ -88,7 +88,8 @@ public function testFailedTransaction()
8888
8989 try {
9090 $ this ->artisan ('migrate:actions ' )->run ();
91- } catch (Exception $ e ) {
91+ }
92+ catch (Exception $ e ) {
9293 $ this ->assertSame (Exception::class, get_class ($ e ));
9394 $ this ->assertSame ('Random message ' , $ e ->getMessage ());
9495 }
@@ -115,17 +116,17 @@ public function testSingleEnvironment()
115116 $ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_except_testing ' );
116117 $ this ->artisan ('migrate:actions ' )->run ();
117118
118- $ this ->assertDatabaseCount ($ table , 4 );
119- $ this ->assertDatabaseCount ($ this ->table , 5 );
119+ $ this ->assertDatabaseCount ($ table , 5 );
120+ $ this ->assertDatabaseCount ($ this ->table , 6 );
120121 $ this ->assertDatabaseMigrationHas ($ this ->table , 'run_on_all ' );
121122 $ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_on_production ' );
122123 $ this ->assertDatabaseMigrationHas ($ this ->table , 'run_on_testing ' );
123124 $ this ->assertDatabaseMigrationHas ($ this ->table , 'run_except_production ' );
124125 $ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_except_testing ' );
125126 $ this ->artisan ('migrate:actions ' )->run ();
126127
127- $ this ->assertDatabaseCount ($ table , 4 );
128- $ this ->assertDatabaseCount ($ this ->table , 5 );
128+ $ this ->assertDatabaseCount ($ table , 5 );
129+ $ this ->assertDatabaseCount ($ this ->table , 6 );
129130 $ this ->assertDatabaseMigrationHas ($ this ->table , 'run_on_all ' );
130131 $ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_on_production ' );
131132 $ this ->assertDatabaseMigrationHas ($ this ->table , 'run_on_testing ' );
@@ -153,8 +154,8 @@ public function testManyEnvironments()
153154 $ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_except_many_environments ' );
154155 $ this ->artisan ('migrate:actions ' )->run ();
155156
156- $ this ->assertDatabaseCount ($ table , 4 );
157- $ this ->assertDatabaseCount ($ this ->table , 5 );
157+ $ this ->assertDatabaseCount ($ table , 5 );
158+ $ this ->assertDatabaseCount ($ this ->table , 6 );
158159 $ this ->assertDatabaseMigrationHas ($ this ->table , 'run_on_all ' );
159160 $ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_on_production ' );
160161 $ this ->assertDatabaseMigrationHas ($ this ->table , 'run_on_testing ' );
@@ -164,8 +165,8 @@ public function testManyEnvironments()
164165 $ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_except_many_environments ' );
165166 $ this ->artisan ('migrate:actions ' )->run ();
166167
167- $ this ->assertDatabaseCount ($ table , 4 );
168- $ this ->assertDatabaseCount ($ this ->table , 5 );
168+ $ this ->assertDatabaseCount ($ table , 5 );
169+ $ this ->assertDatabaseCount ($ this ->table , 6 );
169170 $ this ->assertDatabaseMigrationHas ($ this ->table , 'run_on_all ' );
170171 $ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_on_production ' );
171172 $ this ->assertDatabaseMigrationHas ($ this ->table , 'run_on_testing ' );
@@ -176,6 +177,33 @@ public function testManyEnvironments()
176177 $ this ->artisan ('migrate:actions ' )->run ();
177178 }
178179
180+ public function testAllow ()
181+ {
182+ $ this ->copyFiles ();
183+
184+ $ table = 'environment ' ;
185+
186+ $ this ->artisan ('migrate:actions:install ' )->run ();
187+
188+ $ this ->assertDatabaseCount ($ table , 0 );
189+ $ this ->assertDatabaseCount ($ this ->table , 0 );
190+ $ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_allow ' );
191+ $ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_disallow ' );
192+ $ this ->artisan ('migrate:actions ' )->run ();
193+
194+ $ this ->assertDatabaseCount ($ table , 5 );
195+ $ this ->assertDatabaseCount ($ this ->table , 6 );
196+ $ this ->assertDatabaseMigrationHas ($ this ->table , 'run_allow ' );
197+ $ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_disallow ' );
198+ $ this ->artisan ('migrate:actions ' )->run ();
199+
200+ $ this ->assertDatabaseCount ($ table , 5 );
201+ $ this ->assertDatabaseCount ($ this ->table , 6 );
202+ $ this ->assertDatabaseMigrationHas ($ this ->table , 'run_allow ' );
203+ $ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_disallow ' );
204+ $ this ->artisan ('migrate:actions ' )->run ();
205+ }
206+
179207 public function testMigrationNotFound ()
180208 {
181209 $ this ->assertDatabaseDoesntTable ($ this ->table );
0 commit comments