Skip to content

Commit

Permalink
Unit test Helpers\Dates : Try to fix an error with hours modify for s…
Browse files Browse the repository at this point in the history
…ome hours
  • Loading branch information
bulton-fr committed May 2, 2019
1 parent 250ade3 commit e491d2c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/unit/src/Helpers/Dates.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,16 @@ public function testLstTimeZoneCountries()

protected function prepareHumanReadable()
{
//For yesterday tests, we do a -25h, so we need to no be between
//minigth and 1am
//and for tomorrow, not between 11pm and minight
$currentHour = (int) $this->mock->getHour();
if ($currentHour < 1) {
$this->mock->modify('+1 hour');
} elseif ($currentHour >= 23) {
$this->mock->modify('-1 hour');
}

$this
->and($this->calling($this->mock)->humanDateNow = function($parsedTxt) {
$parsedTxt->date = 'dateNow';
Expand Down

0 comments on commit e491d2c

Please sign in to comment.