Make sure arr_airport and dep_airport are included in PIREP prefile response #120
This commit is contained in:
parent
c43eef6be2
commit
dd629b2af8
@ -14,6 +14,13 @@ class Pirep extends Resource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return parent::toArray($request);
|
||||
$pirep = parent::toArray($request);
|
||||
|
||||
$pirep['airline'] = new Airline($this->airline);
|
||||
$pirep['dpt_airport'] = new Airport($this->dpt_airport);
|
||||
$pirep['arr_airport'] = new Airport($this->arr_airport);
|
||||
$pirep['position'] = new Acars($this->position);
|
||||
|
||||
return $pirep;
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,10 @@ class AcarsTest extends TestCase
|
||||
$response->assertStatus(201);
|
||||
|
||||
# Get the PIREP ID
|
||||
$pirep_id = $response->json()['id'];
|
||||
$body = $response->json();
|
||||
$pirep_id = $body['id'];
|
||||
|
||||
$this->assertHasKeys($body, ['airline', 'arr_airport', 'dpt_airport', 'position']);
|
||||
$this->assertNotNull($pirep_id);
|
||||
|
||||
# Check the PIREP state and status
|
||||
|
Loading…
Reference in New Issue
Block a user