- Add friendsofphp/php-cs-fixer to require-dev - Create .php-cs-fixer.dist.php configured for @PSR12 ruleset - Add php-cs-fixer dry-run step to CI pipeline - Auto-fix existing PSR-12 violations - Document code style tooling in readme.md
24 lines
606 B
PHP
24 lines
606 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Tests\Unit;
|
|
|
|
use App\Clock;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
final class ClockTest extends TestCase
|
|
{
|
|
public function testNowReturnsDateTimeImmutable(): void
|
|
{
|
|
$clock = new Clock();
|
|
$before = new \DateTimeImmutable();
|
|
$now = $clock->now();
|
|
$after = new \DateTimeImmutable();
|
|
|
|
self::assertInstanceOf(\DateTimeImmutable::class, $now);
|
|
self::assertGreaterThanOrEqual($before->getTimestamp(), $now->getTimestamp());
|
|
self::assertLessThanOrEqual($after->getTimestamp(), $now->getTimestamp());
|
|
}
|
|
}
|