@@ -4,6 +4,7 @@ use App\Services\AirlineService;
|
||||
|
||||
class AirlineTest extends TestCase
|
||||
{
|
||||
/** @var AirlineService */
|
||||
protected $airlineSvc;
|
||||
|
||||
public function setUp(): void
|
||||
@@ -14,6 +15,23 @@ class AirlineTest extends TestCase
|
||||
$this->airlineSvc = app(AirlineService::class);
|
||||
}
|
||||
|
||||
public function testAddAirline()
|
||||
{
|
||||
$attrs = factory(App\Models\Airline::class)->make([
|
||||
'iata' => '',
|
||||
])->toArray();
|
||||
|
||||
$airline = $this->airlineSvc->createAirline($attrs);
|
||||
$this->assertNotNull($airline);
|
||||
|
||||
// Add another airline, also blank IATA
|
||||
$attrs = factory(App\Models\Airline::class)->make([
|
||||
'iata' => '',
|
||||
])->toArray();
|
||||
$airline = $this->airlineSvc->createAirline($attrs);
|
||||
$this->assertNotNull($airline);
|
||||
}
|
||||
|
||||
/**
|
||||
* Try deleting an airline which has flights/other assets that exist
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user