phpvms/tests/FlightTest.php
2017-07-04 13:09:44 -05:00

41 lines
899 B
PHP

<?php
class FlightTest extends TestCase
{
public function setUp()
{
parent::setUp();
$this->addData('airline');
$this->addData('airports');
}
public function addFlight()
{
$flight = new App\Models\Flight;
$flight->airline_id = 1;
$flight->flight_number = 100;
$flight->dpt_airport_id = 1;
$flight->arr_airport_id = 2;
$flight->save();
}
/**
* mainly to test the model relationships work correctly
*/
public function XtestAddFlight()
{
$this->markTestSkipped(
'This test has not been implemented yet.'
);
$this->addFlight();
$flight = App\Models\Flight::where('flight_number', 100)->first();
$this->assertEquals($flight->dpt_airport->icao, 'KAUS');
$this->assertEquals($flight->arr_airport->icao, 'KJFK');
}
}