ldc-cocotte/tests/Integration/WithApp/App/Queries/Settings/GetSettingsQueryTest.php
Jérémy Munsch 8b96ce90be
test(casts): add tests for EmployeeSitesCast functionality
test(casts): add tests for ShopperEstablishmentCodeCast functionality

test(casts): add tests for ShopperServiceCodeCast functionality

test(casts): add tests for ShopperSiteCodeCast functionality

test(dto): update ProductDtoTest to include additional fields

test(dto): update SettingDtoTest to remove arcadiaSites assertions

test(events): update AnOrderHasBeenPlacedTest to use value objects

test(entities): update OrderTest to use value objects for employee details

test(value-objects): update EmployeeUpsertDataTest to use value objects

test(pagination): update PaginationTest to access value properties

test(services): update AppCustomerAuthServiceTest to use CrmHashcode

test(services): update CrmServiceTest to use CrmHashcode for customer retrieval
2026-10-27 09:58:45 +01:00

30 lines
817 B
PHP

<?php
declare(strict_types=1);
use App\Contracts\QueryInputEmpty;
use App\Dto\SettingDto;
use App\Models\Setting;
use App\Queries\Settings\GetSettingsQuery;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);
describe('GetSettingsQuery', function (): void {
it('returns settings as SettingDto', function (): void {
// GIVEN
$setting = Setting::getSingleton();
$setting->employee_sites = ['NA', 'BO'];
$setting->saveOrFail();
$query = new GetSettingsQuery();
// WHEN
$dto = $query(new QueryInputEmpty());
// THEN
expect($dto)->toBeInstanceOf(SettingDto::class)
->and($dto->id)->toBe(Setting::SINGLETON_ID)
->and($dto->employeeSites)->toBe(['NA', 'BO']);
});
});