File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+
3+ namespace de \codenamephp \deployer \crontab \Task ;
4+
5+ use de \codenamephp \deployer \base \task \iTaskWithDescription ;
6+ use de \codenamephp \deployer \base \task \iTaskWithName ;
7+
8+ /**
9+ * Deletes the crontab without asking for confirmation
10+ *
11+ * @psalm-api
12+ */
13+ final class Delete extends AbstractCrontabCommand implements iTaskWithName, iTaskWithDescription {
14+
15+ public const NAME = 'crontab:delete ' ;
16+
17+ public function getOptions () : array {
18+ return ['-r ' ];
19+ }
20+
21+ public function getDescription () : string {
22+ return 'Deletes the crontab ' ;
23+ }
24+
25+ public function getName () : string {
26+ return self ::NAME ;
27+ }
28+ }
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+
3+ namespace de \codenamephp \deployer \crontab \test \Task ;
4+
5+ use de \codenamephp \deployer \crontab \Task \Delete ;
6+ use PHPUnit \Framework \TestCase ;
7+
8+ final class DeleteTest extends TestCase {
9+
10+ public function testGetName () : void {
11+ self ::assertSame (Delete::NAME , (new Delete ())->getName ());
12+ }
13+
14+ public function testGetDescription () : void {
15+ self ::assertSame ('Deletes the crontab ' , (new Delete ())->getDescription ());
16+ }
17+
18+ public function testGetOptions () : void {
19+ self ::assertSame (['-r ' ], (new Delete ())->getOptions ());
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments