26 lines
614 B
PHP
26 lines
614 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 {
|
|
it('creates a valid period', function (): void {
|
|
// GIVEN
|
|
$start = new DateTime('2026-01-01');
|
|
$end = new DateTime('2026-01-31');
|
|
|
|
// WHEN
|
|
$period = new Period($start, $end);
|
|
|
|
// THEN
|
|
expect($period)->toBeInstanceOf(Period::class)
|
|
->and($period->start)->toBe($start)
|
|
->and($period->end)->toBe($end);
|
|
});
|
|
});
|