toBeInstanceOf(\DateTimeInterface::class) ->and($result->format('Y-m-d'))->toBe('2025-12-25') ->and($result->format('H:i:s'))->toBe('12:10:23'); }); it('can verify a date is in between', function (): void { // GIVEN $now = Date::create(2025, 12, 25, 12, 0, 0); $from = Date::createFromDate(2025, 12, 24); $to = Date::createFromDate(2025, 12, 26); // WHEN Date::setTestNow($now); $result = DatesHelper::isIn($from, $to); // THEN expect($result)->toBeTruthy(); }); it('can verify a date is not in between', function (): void { // GIVEN $now = Date::create(2025, 12, 25, 12, 0, 0); $from = Date::createFromDate(2025, 12, 26); $to = Date::createFromDate(2025, 12, 27); // WHEN Date::setTestNow($now); $result = DatesHelper::isIn($from, $to); // THEN expect($result)->toBeFalse(); }); it('can format a date time to RFC3339', function (): void { // GIVEN $date = '2025-12-25 12:10:23'; // WHEN $result = DatesHelper::toRfc3339($date); // THEN expect($result)->toBe('2025-12-25T12:10:23+00:00'); }); });