public function new_item_info()
 {
     $origin = Airport::where('id', Input::get('origin_airport_id'))->first();
     $destination = Airport::where('id', Input::get('destination_airport_id'))->first();
     $distance = great_circle_distance($origin->lat, $origin->lng, $destination->lat, $destination->lng);
     return Response::json(array('flight_duration' => flight_duration(Input::get('speed'), $distance), 'origin_iata_code' => $origin->iata_code, 'distance' => $distance, 'destination_iata_code' => $destination->iata_code));
 }
예제 #2
0
 /**
  * @expectedException ErrorException
  */
 public function testFlightDurationNoArguments()
 {
     $flight_duration = flight_duration();
 }