We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f1a8004 commit c3c9368Copy full SHA for c3c9368
2 files changed
Task/Schedule.php
@@ -107,6 +107,14 @@ public function getExpression() {
107
return $this->cron->getExpression();
108
}
109
110
+ /**
111
+ * @param string $value
112
+ */
113
+ public function setExpression(string $value) {
114
+ $this->cron->setExpression($value);
115
+ return $this;
116
+ }
117
+
118
/**
119
* Return true if the schedule is due to now
120
* @param $currentTime
Tests/Task/ScheduleTest.php
@@ -70,4 +70,13 @@ public function testDaily() {
70
"1 2 * 4 5"
71
);
72
73
+ public function testSetExpression() {
74
+ $schedule = new Schedule("* * * * *");
75
+ $schedule->setExpression("0 * * * *");
76
77
+ $this->assertEquals(
78
+ $schedule->getExpression(),
79
+ "0 * * * *"
80
+ );
81
82
0 commit comments