Tests for the CSV import fix

#1007
This commit is contained in:
Nabeel Shahzad
2021-01-25 16:49:32 -05:00
parent 5821067231
commit 3f92191126
5 changed files with 27 additions and 7 deletions

View File

@@ -101,7 +101,7 @@ class AirportService extends Service
}
// Don't lookup the airport, so just add in something generic
if (!setting('general.auto_airport_lookup')) {
if (!setting('general.auto_airport_lookup', false)) {
$airport = new Airport([
'id' => $icao,
'icao' => $icao,

View File

@@ -51,8 +51,13 @@ class FlightImporter extends ImportExport
'fields' => 'nullable',
];
/** @var AirportService */
private $airportSvc;
/** @var FareService */
private $fareSvc;
/** @var FlightService */
private $flightSvc;
/**

View File

@@ -117,12 +117,7 @@ class ImportService extends Service
// turn it into a collection and run some filtering
$row = collect($row)->map(function ($val, $index) {
$val = trim($val);
if ($val === '') {
return;
}
return $val;
return trim($val);
})->toArray();
// Try to validate