From aa2c89bf0765c6cec89cf302f25856f31837996c Mon Sep 17 00:00:00 2001 From: Mark Beech Date: Tue, 1 Dec 2020 13:28:34 +0000 Subject: [PATCH 1/3] Don't overwrite minute and hour --- src/Illuminate/Console/Scheduling/ManagesFrequencies.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Illuminate/Console/Scheduling/ManagesFrequencies.php b/src/Illuminate/Console/Scheduling/ManagesFrequencies.php index 540217dd3c4b..7e1cdf17c0a8 100644 --- a/src/Illuminate/Console/Scheduling/ManagesFrequencies.php +++ b/src/Illuminate/Console/Scheduling/ManagesFrequencies.php @@ -425,9 +425,7 @@ public function twiceMonthly($first = 1, $second = 16, $time = '0:0') $this->dailyAt($time); - return $this->spliceIntoPosition(1, 0) - ->spliceIntoPosition(2, 0) - ->spliceIntoPosition(3, $daysOfMonth); + return $this->spliceIntoPosition(3, $daysOfMonth); } /** From fba470ec42a42f1ca684d7dd0e4957a6d8896605 Mon Sep 17 00:00:00 2001 From: Mark Beech Date: Tue, 1 Dec 2020 13:31:19 +0000 Subject: [PATCH 2/3] Add test --- tests/Console/Scheduling/FrequencyTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/Console/Scheduling/FrequencyTest.php b/tests/Console/Scheduling/FrequencyTest.php index cf2dff84845c..d997935ac4b7 100644 --- a/tests/Console/Scheduling/FrequencyTest.php +++ b/tests/Console/Scheduling/FrequencyTest.php @@ -103,6 +103,11 @@ public function testTwiceMonthly() { $this->assertSame('0 0 1,16 * *', $this->event->twiceMonthly(1, 16)->getExpression()); } + + public function testTwiceMonthlyAtTime() + { + $this->assertSame('30 1 1,16 * *', $this->event->twiceMonthly(1, 16, "1:30")->getExpression()); + } public function testMonthlyOnWithMinutes() { From 144f760a73459e55c5baf5bf226320a89c1146c5 Mon Sep 17 00:00:00 2001 From: Mark Beech Date: Tue, 1 Dec 2020 13:32:43 +0000 Subject: [PATCH 3/3] Style --- tests/Console/Scheduling/FrequencyTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Console/Scheduling/FrequencyTest.php b/tests/Console/Scheduling/FrequencyTest.php index d997935ac4b7..fb9a502aa7ca 100644 --- a/tests/Console/Scheduling/FrequencyTest.php +++ b/tests/Console/Scheduling/FrequencyTest.php @@ -103,10 +103,10 @@ public function testTwiceMonthly() { $this->assertSame('0 0 1,16 * *', $this->event->twiceMonthly(1, 16)->getExpression()); } - + public function testTwiceMonthlyAtTime() { - $this->assertSame('30 1 1,16 * *', $this->event->twiceMonthly(1, 16, "1:30")->getExpression()); + $this->assertSame('30 1 1,16 * *', $this->event->twiceMonthly(1, 16, '1:30')->getExpression()); } public function testMonthlyOnWithMinutes()