Fix column headers

This commit is contained in:
Nabeel Shahzad
2018-03-30 20:57:30 -05:00
parent 70e5ccda6f
commit 217da07007
5 changed files with 8 additions and 3 deletions
+3
View File
@@ -318,6 +318,7 @@ flights:
level: 360 level: 360
dpt_time: 6PM CST dpt_time: 6PM CST
arr_time: 11PM EST arr_time: 11PM EST
flight_time: 240
flight_type: J flight_type: J
created_at: NOW created_at: NOW
updated_at: NOW updated_at: NOW
@@ -329,6 +330,7 @@ flights:
arr_airport_id: LGRP arr_airport_id: LGRP
dpt_time: 9AM CST dpt_time: 9AM CST
arr_time: 1030AM CST arr_time: 1030AM CST
flight_time: 30
flight_type: J flight_type: J
route: PITZZ4 MNURE WLEEE4 route: PITZZ4 MNURE WLEEE4
created_at: NOW created_at: NOW
@@ -340,6 +342,7 @@ flights:
route_leg: 1 route_leg: 1
dpt_airport_id: EGLL dpt_airport_id: EGLL
arr_airport_id: KJFK arr_airport_id: KJFK
flight_time: 480
flight_type: J flight_type: J
dpt_time: 9AM CST dpt_time: 9AM CST
arr_time: 1030AM CST arr_time: 1030AM CST
+3
View File
@@ -20,6 +20,9 @@ use PhpUnitsOfMeasure\Exception\NonStringUnitName;
* @property Collection fares * @property Collection fares
* @property Collection subfleets * @property Collection subfleets
* @property integer days * @property integer days
* @property Airport dep_airport
* @property Airport arr_airport
* @property Airport alt_airport
* @property string dpt_airport_id * @property string dpt_airport_id
* @property string arr_airport_id * @property string arr_airport_id
* @property string alt_airport_id * @property string alt_airport_id
+1 -1
View File
@@ -53,7 +53,7 @@ class ExportService extends Service
$writer = $this->openCsv($path); $writer = $this->openCsv($path);
// Write out the header first // Write out the header first
$writer->insertOne(array_keys($exporter->getColumns())); $writer->insertOne($exporter->getColumns());
// Write the rest of the rows // Write the rest of the rows
foreach ($collection as $row) { foreach ($collection as $row) {
@@ -4,7 +4,6 @@ namespace App\Services\ImportExport;
use App\Interfaces\ImportExport; use App\Interfaces\ImportExport;
use App\Models\Enums\Days; use App\Models\Enums\Days;
use App\Models\Enums\FlightType;
use App\Models\Flight; use App\Models\Flight;
/** /**
@@ -47,7 +46,6 @@ class FlightExporter extends ImportExport
} }
$ret['days'] = $this->getDays($flight); $ret['days'] = $this->getDays($flight);
#$ret['flight_type'] = FlightType::convertToCode($ret['flight_type']);
$ret['fares'] = $this->getFares($flight); $ret['fares'] = $this->getFares($flight);
$ret['fields'] = $this->getFields($flight); $ret['fields'] = $this->getFields($flight);
+1
View File
@@ -301,6 +301,7 @@ class ImporterTest extends TestCase
$this->assertEquals('27', $exported['days']); $this->assertEquals('27', $exported['days']);
$this->assertEquals('VMS', $exported['airline']); $this->assertEquals('VMS', $exported['airline']);
$this->assertEquals($flight->flight_time, $exported['flight_time']);
$this->assertEquals('J', $exported['flight_type']); $this->assertEquals('J', $exported['flight_type']);
$this->assertEquals('A32X;B74X', $exported['subfleets']); $this->assertEquals('A32X;B74X', $exported['subfleets']);
$this->assertEquals('Y?capacity=100;F', $exported['fares']); $this->assertEquals('Y?capacity=100;F', $exported['fares']);