diff --git a/README.md b/README.md index 63419ad..e11db0b 100644 --- a/README.md +++ b/README.md @@ -76,13 +76,13 @@ If you wish to run the tests yourself you should run the following: ``` # Install the Distical Library with the 'development' packages this then including PHPUnit! -composer install --dev +composer install # Now we run the unit tests (from the root of the project) like so: ./vendor/bin/phpunit ``` -Code coverage can also be ran but rquires XDebug installed... +Code coverage can also be ran but requires XDebug installed... ``` ./vendor/bin/phpunit --coverage-html ./report ``` diff --git a/src/Distical.inc.php b/src/Distical.inc.php index 2b2e0d6..0c0fe33 100644 --- a/src/Distical.inc.php +++ b/src/Distical.inc.php @@ -12,7 +12,6 @@ * @link http://bobbyallen.me * */ - /* * ***************************************************************************** * THIS FILE SHOULD BE USED FOR AUTOMATICALLY LOADING THIS LIBRARY WHEN YOU ARE * USING IT "STANDALONE" AND NOT USING COMPOSER OR ANOTHER PACKAGE MANAGER. diff --git a/src/Entities/LatLong.php b/src/Entities/LatLong.php index abf8a72..fbfe1f7 100644 --- a/src/Entities/LatLong.php +++ b/src/Entities/LatLong.php @@ -1,11 +1,12 @@ - * @license http://opensource.org/licenses/MIT @@ -27,21 +28,21 @@ class LatLong const LNG_VALIDATION_REGEX = "/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/"; /** - * The latitude co-ordinate. + * The latitude coordinate. * @var double */ protected $latitude; /** - * The longitude co-ordinate. + * The longitude coordinate. * @var double */ protected $longitude; /** * Create a new latitude and longitude object. - * @param double $lat The latitude co-ordinate. - * @param double $lng The longitude co-ordinate. + * @param double $lat The latitude coordinate. + * @param double $lng The longitude coordinate. * @throws \InvalidArgumentException */ public function __construct($lat, $lng) @@ -56,7 +57,7 @@ public function __construct($lat, $lng) } } - /** + /** * Validates the Latitude value. * * @return boolean @@ -82,7 +83,7 @@ private function validateLng() } /** - * Returns the current Latitude co-ordinate. + * Returns the current Latitude coordinate. * @return double */ public function getLatitude() @@ -91,7 +92,7 @@ public function getLatitude() } /** - * Returns the current Longitude co-ordinate. + * Returns the current Longitude coordinate. * @return double */ public function getLongitude() diff --git a/tests/DistanceEntityTest.php b/tests/DistanceEntityTest.php index f98bf0b..6e20460 100644 --- a/tests/DistanceEntityTest.php +++ b/tests/DistanceEntityTest.php @@ -1,20 +1,19 @@ - * @version 2.0.0 * @license http://opensource.org/licenses/MIT - * @link https://github.com/bobsta63/distical - * @link http://www.bobbyallen.me + * @link https://github.com/allebb/distical + * @link http://bobbyallen.me * */ use \Ballen\Distical\Entities\Distance; -use \PHPUnit_Framework_TestCase; class DistanceEntityTest extends PHPUnit_Framework_TestCase { diff --git a/tests/DisticalTest.php b/tests/DisticalTest.php index 7491e30..626a33e 100644 --- a/tests/DisticalTest.php +++ b/tests/DisticalTest.php @@ -1,21 +1,20 @@ - * @version 2.0.0 * @license http://opensource.org/licenses/MIT - * @link https://github.com/bobsta63/distical - * @link http://www.bobbyallen.me + * @link https://github.com/allebb/distical + * @link http://bobbyallen.me * */ use \Ballen\Distical\Calculator; use \Ballen\Distical\Entities\LatLong; -use \PHPUnit_Framework_TestCase; class DisticalTest extends PHPUnit_Framework_TestCase { diff --git a/tests/LatLongEntityTest.php b/tests/LatLongEntityTest.php index d0ec5e1..04cf0f7 100644 --- a/tests/LatLongEntityTest.php +++ b/tests/LatLongEntityTest.php @@ -1,20 +1,19 @@ - * @version 2.0.0 * @license http://opensource.org/licenses/MIT - * @link https://github.com/bobsta63/distical - * @link http://www.bobbyallen.me + * @link https://github.com/allebb/distical + * @link http://bobbyallen.me * */ use \Ballen\Distical\Entities\LatLong; -use \PHPUnit_Framework_TestCase; class LatLongEntityTest extends PHPUnit_Framework_TestCase { @@ -68,6 +67,12 @@ public function testInvalidLonCoordValidation() public function testInvalidCoords() { $this->setExpectedException('Ballen\Distical\Exceptions\InvalidLatitudeFormatException', 'The latitude parameter is invalid, value must be between -90 and 90'); - $test = new LatLong(-91, 51); + $test = new LatLong(-91, 251); + } + + public function testValidCoords() + { + $test = new LatLong($this->test_lat, $this->test_lng); + $this->assertInstanceOf(LatLong::class, $test); } }