Skip to content

Commit

Permalink
Add tests for assertNow and assertSameTime
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdekker committed Jan 2, 2025
1 parent d59f63b commit 901332c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/Unit/Symfony/ClockTestTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace DR\PHPUnitExtensions\Tests\Unit\Symfony;

use DateTimeImmutable;
use DR\PHPUnitExtensions\Symfony\ClockTestTrait;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
Expand All @@ -28,4 +29,14 @@ public function testSleep(): void
self::sleep(123.456);
self::assertSame(1634050698, self::time());
}

public function testAssertNow(): void
{
self::assertNow((new DateTimeImmutable())->setTimestamp(1634050575));
}

public function testAssertTime(): void
{
self::assertSameTime(1634050575, self::now());
}
}

0 comments on commit 901332c

Please sign in to comment.