now(); $after = new \DateTimeImmutable(); self::assertInstanceOf(\DateTimeImmutable::class, $now); self::assertGreaterThanOrEqual($before->getTimestamp(), $now->getTimestamp()); self::assertLessThanOrEqual($after->getTimestamp(), $now->getTimestamp()); } public function testNowReturnsDifferentInstances(): void { $clock = new Clock(); $first = $clock->now(); usleep(1000); $second = $clock->now(); self::assertNotSame($first, $second); } }