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); } /** diff --git a/tests/Console/Scheduling/FrequencyTest.php b/tests/Console/Scheduling/FrequencyTest.php index cf2dff84845c..fb9a502aa7ca 100644 --- a/tests/Console/Scheduling/FrequencyTest.php +++ b/tests/Console/Scheduling/FrequencyTest.php @@ -104,6 +104,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() { $this->assertSame('15 15 4 * *', $this->event->monthlyOn(4, '15:15')->getExpression());