ldc-boutique-cnc-sable/tests/Unit/App/Dto/OrderReminderDtoTest.php
2026-10-27 09:58:12 +01:00

55 lines
1.7 KiB
PHP

<?php
declare(strict_types=1);
use App\Dto\OrderReminderDto;
use App\Dto\OrderReminderLineDto;
describe('OrderReminderDto', function () {
it('can be instantiated with valid properties', function () {
// GIVEN
$firstname = 'John';
$lastname = 'Doe';
$reference = 'REF123';
$total = '10.00';
$pickupDayFormatted = 'Monday';
$lines = [
new OrderReminderLineDto(
name: 'Product',
quantity: 1,
priceKgTtc: '10.00',
totalTtc: '10.00',
),
];
$shopName = 'Shop';
$shopAddress = '123 Main St';
$shopPostcode = '12345';
$shopCity = 'City';
// WHEN
$dto = new OrderReminderDto(
firstname: $firstname,
lastname: $lastname,
reference: $reference,
total: $total,
pickupDayFormatted: $pickupDayFormatted,
lines: $lines,
shopName: $shopName,
shopAddress: $shopAddress,
shopPostcode: $shopPostcode,
shopCity: $shopCity,
);
// THEN
expect($dto->firstname)->toBe($firstname)
->and($dto->lastname)->toBe($lastname)
->and($dto->reference)->toBe($reference)
->and($dto->total)->toBe($total)
->and($dto->pickupDayFormatted)->toBe($pickupDayFormatted)
->and($dto->lines)->toBe($lines)
->and($dto->shopName)->toBe($shopName)
->and($dto->shopAddress)->toBe($shopAddress)
->and($dto->shopPostcode)->toBe($shopPostcode)
->and($dto->shopCity)->toBe($shopCity);
});
});