Skip to content

Commit

Permalink
Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
esyede committed Jun 14, 2024
1 parent 31276ff commit b4d25a1
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 106 deletions.
8 changes: 4 additions & 4 deletions system/carbon.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public function setTimezone($value)
return $this;
}

public static function setTestNow(Carbon $now = null)
public static function setNow(Carbon $now = null)
{
static::$now = $now;
}
Expand Down Expand Up @@ -845,7 +845,7 @@ public function secondsUntilEndOfDay()
}

public function diffForHumans(Carbon $other = null, $absolute = false)
{
{
$now = $other === null;
$other = $now ? static::now($this->tz) : $other;
$future = $this->gt($other);
Expand All @@ -859,7 +859,7 @@ public function diffForHumans(Carbon $other = null, $absolute = false)
break;
}

$delta = floor($delta / $value);
$delta = round($delta / $value);
}

$delta = ($delta < 1) ? 1 : $delta;
Expand All @@ -874,7 +874,7 @@ public function diffForHumans(Carbon $other = null, $absolute = false)
}

return $str . ' ' . Lang::line('carbon.' . ($future ? 'after' : 'before'))->get();
}
}

public function startOfDay()
{
Expand Down
Loading

0 comments on commit b4d25a1

Please sign in to comment.