#32 assign aircraft to subfleets, and aircraft to subfleets
This commit is contained in:
@@ -20,7 +20,7 @@ class AircraftTest extends TestCase
|
||||
|
||||
protected function findByICAO($icao)
|
||||
{
|
||||
$ac_repo = app('App\Repositories\AircraftRepository');
|
||||
$ac_repo = app('App\Repositories\SubfleetRepository');
|
||||
return $ac_repo->findByICAO($icao);
|
||||
}
|
||||
|
||||
@@ -36,28 +36,14 @@ class AircraftTest extends TestCase
|
||||
*/
|
||||
protected function addAircraft()
|
||||
{
|
||||
$svc = app('App\Services\AircraftService');
|
||||
$err = $svc->create([
|
||||
'icao' => $this->ICAO,
|
||||
'name' => 'Boeing 777',
|
||||
], $this->getAircraftClass());
|
||||
|
||||
$this->assertNotFalse($err);
|
||||
$mdl = new App\Models\Aircraft;
|
||||
$mdl->icao = $this->ICAO;
|
||||
$mdl->name = 'Boeing 777';
|
||||
$mdl->save();
|
||||
|
||||
return $this->findByICAO($this->ICAO);
|
||||
}
|
||||
|
||||
public function testAircraftClasses()
|
||||
{
|
||||
$aircraft = $this->addAircraft();
|
||||
$this->assertEquals($this->ICAO, $aircraft->icao, 'ICAO matching');
|
||||
$this->assertEquals(
|
||||
$this->getAircraftClass(),
|
||||
$aircraft->class,
|
||||
'Check belongsTo relationship'
|
||||
);
|
||||
}
|
||||
|
||||
public function testAircraftFaresNoOverride()
|
||||
{
|
||||
$fare_svc = app('App\Services\FareService');
|
||||
|
||||
Reference in New Issue
Block a user