<?php

it('implements batched cashier name lookup with cache-first fallback behavior', function (): void {
    $usersFile = app_path('objects/users_o.php');
    $content = file_get_contents($usersFile);

    expect($content)->not->toBeFalse();
    expect($content)->toContain('public function getCashierNames(array $cashier_ids): array');
    expect($content)->toContain("getCachedForMultipleObjects(\$cache_key, \$virtual_cache_ids)");
    expect($content)->toContain("getFieldsWhereIn(");
    expect($content)->toContain("'Unknown Cashier'");
    expect($content)->toContain("setCachedExpiration(\$cache_key, self::\$cashierNameCacheExpiration");
});

it('sanitizes and deduplicates cashier ids before batch lookup', function (): void {
    $usersFile = app_path('objects/users_o.php');
    $content = file_get_contents($usersFile);

    expect($content)->not->toBeFalse();
    expect($content)->toContain("array_values(array_unique(array_filter(array_map('intval', \$cashier_ids)");
});
