ldc-cocotte/tests/Unit/App/Actions/Settings/UpdateSettingsInputTest.php
Jérémy Munsch d0efb0f527
refactor: update namespaces for actions and queries
Refactored the codebase to change the namespaces of various actions and queries from `App\Actions` to `App\Cqs\Actions` and `App\Queries` to `App\Cqs\Queries`. This restructuring improves organization and clarity in the codebase.
2026-11-10 15:13:26 +01:00

43 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
use App\Cqs\Actions\Settings\UpdateSettingsInput;
use Domain\Models\ValueObjects\ShopperSiteCode;
describe('UpdateSettingsInput', function (): void {
it('creates an input with valid ShopperSiteCode objects', function (): void {
// GIVEN
$sites = [
new ShopperSiteCode('PA'),
new ShopperSiteCode('LY'),
];
// WHEN
$input = new UpdateSettingsInput(employeeSites: $sites);
// THEN
expect($input->employeeSites)->toBe($sites);
});
it('creates an empty input', function (): void {
// GIVEN
$sites = [];
// WHEN
$input = new UpdateSettingsInput(employeeSites: $sites);
// THEN
expect($input->employeeSites)->toBeEmpty();
});
it('throws when site elements are not ShopperSiteCode', function (): void {
// GIVEN
$invalidSites = ['PA', 'LY'];
// WHEN / THEN
/** @phpstan-ignore argument.type */
expect(fn () => new UpdateSettingsInput(employeeSites: $invalidSites))
->toThrow(\InvalidArgumentException::class);
});
});