File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,14 @@ public function getExpression() {
107107 return $ this ->cron ->getExpression ();
108108 }
109109
110+ /**
111+ * @param string $value
112+ */
113+ public function setExpression (string $ value ) {
114+ $ this ->cron ->setExpression ($ value );
115+ return $ this ;
116+ }
117+
110118 /**
111119 * Return true if the schedule is due to now
112120 * @param $currentTime
Original file line number Diff line number Diff line change @@ -70,4 +70,13 @@ public function testDaily() {
7070 "1 2 * 4 5 "
7171 );
7272 }
73+ public function testSetExpression () {
74+ $ schedule = new Schedule ("* * * * * " );
75+ $ schedule ->setExpression ("0 * * * * " );
76+
77+ $ this ->assertEquals (
78+ $ schedule ->getExpression (),
79+ "0 * * * * "
80+ );
81+ }
7382}
You can’t perform that action at this time.
0 commit comments