Skip to content

Commit

Permalink
[4.x] Fix test that fails on February 29th (#9620)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Feb 29, 2024
1 parent 341c86f commit d1b036a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/Modifiers/RelativeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ class RelativeTest extends TestCase
/** @test */
public function it_converts_a_date_to_relative()
{
$date = new Carbon('today -1 year');
$date = new Carbon('today -1 month');

$this->assertEquals('1 year ago', $this->modify($date));
$this->assertEquals('1 month ago', $this->modify($date));
}

/** @test */
public function it_converts_a_date_to_relative_without_modifiers()
{
$date = new Carbon('today -1 year');
$date = new Carbon('today -1 month');

$this->assertEquals('1 year', $this->modify($date, true));
$this->assertEquals('1 year', $this->modify($date, 'true'));
$this->assertEquals('1 month', $this->modify($date, true));
$this->assertEquals('1 month', $this->modify($date, 'true'));
}

protected function modify($arr, ...$args)
Expand Down

0 comments on commit d1b036a

Please sign in to comment.