Skip to content

Commit

Permalink
Don't overwrite minute and hour when specifying as time with twiceMon…
Browse files Browse the repository at this point in the history
…thly() (#35436)

* Don't overwrite minute and hour

* Add test

* Style
  • Loading branch information
JayBizzle committed Dec 1, 2020
1 parent 5a3f7cf commit 24636f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/Illuminate/Console/Scheduling/ManagesFrequencies.php
Expand Up @@ -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);
}

/**
Expand Down
5 changes: 5 additions & 0 deletions tests/Console/Scheduling/FrequencyTest.php
Expand Up @@ -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());
Expand Down

0 comments on commit 24636f0

Please sign in to comment.