ldc-mesbr-app/tests/Unit/Domain/Models/ValueObjects/RequestedCoupon/PeriodTest.php
2026-10-02 12:48:00 +02:00

30 lines
718 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Unit\Domain\Models\ValueObjects\RequestedCoupon;
use Domain\Models\ValueObjects\Period;
use DateTime;
covers(Period::class);
describe('period', function (): void {
beforeEach(function (): void {
$this->start = new DateTime('2026-01-01');
$this->end = new DateTime('2026-01-31');
});
it('creates a valid period', function (): void {
// GIVEN / WHEN
$period = new Period(
$this->start,
$this->end
);
// THEN
expect($period)->toBeInstanceOf(Period::class)
->and($period->start)->toBe($this->start)
->and($period->end)->toBe($this->end);
});
});