File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -180,4 +180,26 @@ public function isActive() : bool
180180 {
181181 return $ this ->active ;
182182 }
183+
184+ /**
185+ * Activate the command.
186+ *
187+ * @return static
188+ */
189+ public function activate () : static
190+ {
191+ $ this ->active = true ;
192+ return $ this ;
193+ }
194+
195+ /**
196+ * Deactivate the command.
197+ *
198+ * @return static
199+ */
200+ public function deactivate () : static
201+ {
202+ $ this ->active = false ;
203+ return $ this ;
204+ }
183205}
Original file line number Diff line number Diff line change @@ -48,4 +48,13 @@ public function testOptions() : void
4848 $ this ->command ->setOptions (['-a ' => 'baz ' ]);
4949 self ::assertSame (['-a ' => 'baz ' ], $ this ->command ->getOptions ());
5050 }
51+
52+ public function testActive () : void
53+ {
54+ self ::assertTrue ($ this ->command ->isActive ());
55+ $ this ->command ->deactivate ();
56+ self ::assertFalse ($ this ->command ->isActive ());
57+ $ this ->command ->activate ();
58+ self ::assertTrue ($ this ->command ->isActive ());
59+ }
5160}
You can’t perform that action at this time.
0 commit comments