Move subfleet add/remove to fleet service for a flight
This commit is contained in:
@@ -170,6 +170,28 @@ class FlightTest extends TestCase
|
||||
$this->assertEquals($flight->id, $body['data'][0]['id']);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testAddSubfleet()
|
||||
{
|
||||
$subfleet = factory(App\Models\Subfleet::class)->create();
|
||||
$flight = factory(App\Models\Flight::class)->create();
|
||||
|
||||
$fleetSvc = app(App\Services\FleetService::class);
|
||||
$fleetSvc->addSubfleetToFlight($subfleet, $flight);
|
||||
|
||||
$flight->refresh();
|
||||
$found = $flight->subfleets()->get();
|
||||
$this->assertCount(1, $found);
|
||||
|
||||
# Make sure it hasn't been added twice
|
||||
$fleetSvc->addSubfleetToFlight($subfleet, $flight);
|
||||
$flight->refresh();
|
||||
$found = $flight->subfleets()->get();
|
||||
$this->assertCount(1, $found);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add/remove a bid, test the API, etc
|
||||
* @throws \App\Services\Exception
|
||||
|
||||
Reference in New Issue
Block a user