File tree Expand file tree Collapse file tree 4 files changed +63
-0
lines changed Expand file tree Collapse file tree 4 files changed +63
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Jaspaul \LaravelRollout \Console ;
4
+
5
+ use Jaspaul \LaravelRollout \Helpers \User ;
6
+
7
+ class EveryoneCommand extends RolloutCommand
8
+ {
9
+ /**
10
+ * The name and signature of the console command.
11
+ *
12
+ * @var string
13
+ */
14
+ protected $ signature = 'rollout:everyone {feature} ' ;
15
+
16
+ /**
17
+ * The console command description.
18
+ *
19
+ * @var string
20
+ */
21
+ protected $ description = 'Rolls out the feature to all of the users in the system. ' ;
22
+
23
+ /**
24
+ * Updates the feature to rollout to 100% of users!
25
+ *
26
+ * @return void
27
+ */
28
+ public function handle ()
29
+ {
30
+ $ name = $ this ->argument ('feature ' );
31
+ $ this ->rollout ->activatePercentage ($ name , 100 );
32
+ }
33
+ }
Original file line number Diff line number Diff line change 8
8
use Jaspaul \LaravelRollout \Console \CreateCommand ;
9
9
use Jaspaul \LaravelRollout \Console \DeleteCommand ;
10
10
use Jaspaul \LaravelRollout \Console \AddUserCommand ;
11
+ use Jaspaul \LaravelRollout \Console \EveryoneCommand ;
11
12
use Jaspaul \LaravelRollout \Console \RemoveUserCommand ;
12
13
use Illuminate \Support \ServiceProvider as IlluminateServiceProvider ;
13
14
@@ -28,6 +29,7 @@ public function boot()
28
29
AddUserCommand::class,
29
30
CreateCommand::class,
30
31
DeleteCommand::class,
32
+ EveryoneCommand::class,
31
33
ListCommand::class,
32
34
RemoveUserCommand::class
33
35
]);
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Tests \Drivers ;
4
+
5
+ use Tests \TestCase ;
6
+ use Opensoft \Rollout \Rollout ;
7
+ use Illuminate \Support \Facades \Artisan ;
8
+ use Jaspaul \LaravelRollout \Drivers \Cache ;
9
+
10
+ class EveryoneCommandTest extends TestCase
11
+ {
12
+ /**
13
+ * @test
14
+ */
15
+ function running_the_command_with_a_feature_will_set_the_rollout_percentage_to_100 ()
16
+ {
17
+ Artisan::call ('rollout:everyone ' , [
18
+ 'feature ' => 'derp '
19
+ ]);
20
+
21
+ $ store = app ()->make ('cache.store ' )->getStore ();
22
+
23
+ $ this ->assertEquals ('derp ' , $ store ->get ('rollout.feature:__features__ ' ));
24
+ $ this ->assertEquals ('100||| ' , $ store ->get ('rollout.feature:derp ' ));
25
+ }
26
+ }
Original file line number Diff line number Diff line change 11
11
use Jaspaul \LaravelRollout \Console \CreateCommand ;
12
12
use Jaspaul \LaravelRollout \Console \DeleteCommand ;
13
13
use Jaspaul \LaravelRollout \Console \AddUserCommand ;
14
+ use Jaspaul \LaravelRollout \Console \EveryoneCommand ;
14
15
use Jaspaul \LaravelRollout \Console \RemoveUserCommand ;
15
16
use Illuminate \Support \ServiceProvider as IlluminateServiceProvider ;
16
17
@@ -69,6 +70,7 @@ function booting_registers_our_commands()
69
70
AddUserCommand::class,
70
71
CreateCommand::class,
71
72
DeleteCommand::class,
73
+ EveryoneCommand::class,
72
74
ListCommand::class,
73
75
RemoveUserCommand::class
74
76
],
You can’t perform that action at this time.
0 commit comments