/** * Get an array of all possible place name pairs. * * @return array An array of place name pairs. */ public function getPlaceNamePairs() { $pairs = array(); $fixture = new LatLongsFixture(); $places = $fixture->getSupportedPlaces(); foreach ($places as $place1) { foreach ($places as $place2) { if ($place1 !== $place2) { $pairs[] = array($place1, $place2); } } } return $pairs; }
/** * Data provider for testing with LatLongs and bearings. * * @return array An array, each element an array of two LatLongs and initial and final bearings between them. */ public static function getLatLongsWithBearings() { $dataArray = array(); $latLongsFixture = new LatLongsFixture(); foreach ($latLongsFixture->getPlaceNamePairs() as $pair) { $dataArray[] = array($latLongsFixture->getLatLongForPlace($pair[0]), $latLongsFixture->getLatLongForPlace($pair[1]), $latLongsFixture->getInitialBearingBetweenPlaces($pair[0], $pair[1]), $latLongsFixture->getFinalBearingBetweenPlaces($pair[0], $pair[1])); } return $dataArray; }