@@ -37,22 +37,22 @@ public function testOnce()
37
37
$ this ->artisan ('migrate:actions ' )->run ();
38
38
39
39
$ this ->assertDatabaseCount ($ table , 1 );
40
- $ this ->assertDatabaseCount ($ this ->table , 5 );
40
+ $ this ->assertDatabaseCount ($ this ->table , 6 );
41
41
$ this ->assertDatabaseMigrationDoesntLike ($ this ->table , $ table );
42
42
$ this ->artisan ('migrate:actions ' )->run ();
43
43
44
44
$ this ->assertDatabaseCount ($ table , 2 );
45
- $ this ->assertDatabaseCount ($ this ->table , 5 );
45
+ $ this ->assertDatabaseCount ($ this ->table , 6 );
46
46
$ this ->assertDatabaseMigrationDoesntLike ($ this ->table , $ table );
47
47
$ this ->artisan ('migrate:actions ' )->run ();
48
48
49
49
$ this ->assertDatabaseCount ($ table , 3 );
50
- $ this ->assertDatabaseCount ($ this ->table , 5 );
50
+ $ this ->assertDatabaseCount ($ this ->table , 6 );
51
51
$ this ->assertDatabaseMigrationDoesntLike ($ this ->table , $ table );
52
52
$ this ->artisan ('migrate:actions ' )->run ();
53
53
54
54
$ this ->assertDatabaseCount ($ table , 4 );
55
- $ this ->assertDatabaseCount ($ this ->table , 5 );
55
+ $ this ->assertDatabaseCount ($ this ->table , 6 );
56
56
$ this ->assertDatabaseMigrationDoesntLike ($ this ->table , $ table );
57
57
}
58
58
@@ -88,7 +88,8 @@ public function testFailedTransaction()
88
88
89
89
try {
90
90
$ this ->artisan ('migrate:actions ' )->run ();
91
- } catch (Exception $ e ) {
91
+ }
92
+ catch (Exception $ e ) {
92
93
$ this ->assertSame (Exception::class, get_class ($ e ));
93
94
$ this ->assertSame ('Random message ' , $ e ->getMessage ());
94
95
}
@@ -115,17 +116,17 @@ public function testSingleEnvironment()
115
116
$ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_except_testing ' );
116
117
$ this ->artisan ('migrate:actions ' )->run ();
117
118
118
- $ this ->assertDatabaseCount ($ table , 4 );
119
- $ this ->assertDatabaseCount ($ this ->table , 5 );
119
+ $ this ->assertDatabaseCount ($ table , 5 );
120
+ $ this ->assertDatabaseCount ($ this ->table , 6 );
120
121
$ this ->assertDatabaseMigrationHas ($ this ->table , 'run_on_all ' );
121
122
$ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_on_production ' );
122
123
$ this ->assertDatabaseMigrationHas ($ this ->table , 'run_on_testing ' );
123
124
$ this ->assertDatabaseMigrationHas ($ this ->table , 'run_except_production ' );
124
125
$ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_except_testing ' );
125
126
$ this ->artisan ('migrate:actions ' )->run ();
126
127
127
- $ this ->assertDatabaseCount ($ table , 4 );
128
- $ this ->assertDatabaseCount ($ this ->table , 5 );
128
+ $ this ->assertDatabaseCount ($ table , 5 );
129
+ $ this ->assertDatabaseCount ($ this ->table , 6 );
129
130
$ this ->assertDatabaseMigrationHas ($ this ->table , 'run_on_all ' );
130
131
$ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_on_production ' );
131
132
$ this ->assertDatabaseMigrationHas ($ this ->table , 'run_on_testing ' );
@@ -153,8 +154,8 @@ public function testManyEnvironments()
153
154
$ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_except_many_environments ' );
154
155
$ this ->artisan ('migrate:actions ' )->run ();
155
156
156
- $ this ->assertDatabaseCount ($ table , 4 );
157
- $ this ->assertDatabaseCount ($ this ->table , 5 );
157
+ $ this ->assertDatabaseCount ($ table , 5 );
158
+ $ this ->assertDatabaseCount ($ this ->table , 6 );
158
159
$ this ->assertDatabaseMigrationHas ($ this ->table , 'run_on_all ' );
159
160
$ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_on_production ' );
160
161
$ this ->assertDatabaseMigrationHas ($ this ->table , 'run_on_testing ' );
@@ -164,8 +165,8 @@ public function testManyEnvironments()
164
165
$ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_except_many_environments ' );
165
166
$ this ->artisan ('migrate:actions ' )->run ();
166
167
167
- $ this ->assertDatabaseCount ($ table , 4 );
168
- $ this ->assertDatabaseCount ($ this ->table , 5 );
168
+ $ this ->assertDatabaseCount ($ table , 5 );
169
+ $ this ->assertDatabaseCount ($ this ->table , 6 );
169
170
$ this ->assertDatabaseMigrationHas ($ this ->table , 'run_on_all ' );
170
171
$ this ->assertDatabaseMigrationDoesntLike ($ this ->table , 'run_on_production ' );
171
172
$ this ->assertDatabaseMigrationHas ($ this ->table , 'run_on_testing ' );
@@ -176,6 +177,33 @@ public function testManyEnvironments()
176
177
$ this ->artisan ('migrate:actions ' )->run ();
177
178
}
178
179
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
+
179
207
public function testMigrationNotFound ()
180
208
{
181
209
$ this ->assertDatabaseDoesntTable ($ this ->table );
0 commit comments