Goal-Calibration/tests/Fakes/FakeClock.php
2026-04-24 13:23:46 +03:00

23 lines
409 B
PHP

<?php
namespace Tests\Fakes;
use App\Auth\Clock;
use DateTimeImmutable;
class FakeClock implements Clock
{
public function __construct(
private DateTimeImmutable $currentTime,
) {}
public function now(): DateTimeImmutable
{
return $this->currentTime;
}
public function setTime(DateTimeImmutable $newTime): void
{
$this->currentTime = $newTime;
}
}