detectColumnsFromCsv($tmpPath, true); expect($delim)->toBe(';'); expect($cols)->toBe(['Col A', 'Col B', 'Col C']); @unlink($tmpPath); }); it('returns positional indices when hasHeader is false', function () { $tmpPath = storage_path('app/test_csv_detection_positional.csv'); $content = "\n\nA;B;C\n"; file_put_contents($tmpPath, $content); $svc = new CsvImportService; [$delim, $cols] = $svc->detectColumnsFromCsv($tmpPath, false); expect($delim)->toBe(';'); expect($cols)->toBe(['0', '1', '2']); @unlink($tmpPath); });