Add IATA and ZFW to aircraft import/export and tables

This commit is contained in:
Nabeel Shahzad
2018-03-30 20:21:18 -05:00
parent 777167f46e
commit 70e5ccda6f
10 changed files with 71 additions and 28 deletions

View File

@@ -223,6 +223,36 @@ class ImporterTest extends TestCase
}
}
/**
* Test exporting all the flights to a file
*/
public function testAircraftExporter(): void
{
$aircraft = factory(App\Models\Aircraft::class)->create();
$exporter = new \App\Services\ImportExport\AircraftExporter();
$exported = $exporter->export($aircraft);
$this->assertEquals($aircraft->iata, $exported['iata']);
$this->assertEquals($aircraft->icao, $exported['icao']);
$this->assertEquals($aircraft->name, $exported['name']);
$this->assertEquals($aircraft->zfw, $exported['zfw']);
$this->assertEquals($aircraft->subfleet->type, $exported['subfleet']);
}
/**
* Test exporting all the flights to a file
*/
public function testAirportExporter(): void
{
$airport = factory(App\Models\Airport::class)->create();
$exporter = new \App\Services\ImportExport\AirportExporter();
$exported = $exporter->export($airport);
$this->assertEquals($airport->iata, $exported['iata']);
$this->assertEquals($airport->icao, $exported['icao']);
$this->assertEquals($airport->name, $exported['name']);
}
/**
* Test exporting all the flights to a file
*/