42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Unit\Domain\Models\Entities;
|
|
|
|
use Carbon\CarbonImmutable;
|
|
use Domain\Enums\RepeatFrequency;
|
|
use Domain\Models\Entities\PickupExceptionOnDate;
|
|
use Domain\Models\ValueObjects\Entities\PickupExceptionId;
|
|
use Ramsey\Uuid\Uuid;
|
|
|
|
describe('PickupExceptionOnDate', function (): void {
|
|
it('can instantiate correctly', function (): void {
|
|
// GIVEN
|
|
$id = new PickupExceptionId(Uuid::uuid7());
|
|
$date = CarbonImmutable::now();
|
|
$label = 'Férié';
|
|
$repeatable = true;
|
|
$repeatFrequency = RepeatFrequency::YEARLY;
|
|
$autoUpdated = false;
|
|
|
|
// WHEN
|
|
$entity = new PickupExceptionOnDate(
|
|
$id,
|
|
$date,
|
|
$label,
|
|
$repeatable,
|
|
$repeatFrequency,
|
|
$autoUpdated
|
|
);
|
|
|
|
// THEN
|
|
expect($entity->id())->toBe($id)
|
|
->and($entity->id)->toBe($id)
|
|
->and($entity->date)->toBe($date)
|
|
->and($entity->label)->toBe($label)
|
|
->and($entity->repeatable)->toBe($repeatable)
|
|
->and($entity->repeatFrequency)->toBe($repeatFrequency)
|
|
->and($entity->autoUpdated)->toBe($autoUpdated);
|
|
});
|
|
});
|