This repository has been archived by the owner on Jul 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ae81ce
commit 669c8ca
Showing
14 changed files
with
159 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<phpunit backupGlobals="true" | ||
backupStaticAttributes="false" | ||
bootstrap="tests/bootstrap.php" | ||
cacheTokens="false" | ||
colors="true"> | ||
<testsuites> | ||
<testsuite name="Navigator Test Suite"> | ||
<directory suffix="Test.php">tests</directory> | ||
<directory suffix="TestUnder7.php" phpVersion="7.0.0" phpVersionOperator="<">tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
/** | ||
* Navigator: a geographic calculation library for PHP | ||
* @link http://navigator.simonholywell.com | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD 2-Clause License | ||
* @copyright 2012, Simon Holywell | ||
* @author Simon Holywell <treffynnon@php.net> | ||
*/ | ||
use Treffynnon\Navigator as N; | ||
use Treffynnon\Navigator\Coordinate as C; | ||
|
||
class CoordinateTestUnder7 extends PHPUnit_Framework_TestCase { | ||
|
||
/** | ||
* @expectedException PHPUnit_Framework_Error | ||
*/ | ||
public function testIncorrectParser() { | ||
$Coordinate = new N\Coordinate; | ||
$Coordinate->setParser(new stdClass()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
tests/Treffynnon/Navigator/Distance/Calculator/CosineLawTestUnder7.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
/** | ||
* Navigator: a geographic calculation library for PHP | ||
* @link http://navigator.simonholywell.com | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD 2-Clause License | ||
* @copyright 2012, Simon Holywell | ||
* @author Simon Holywell <treffynnon@php.net> | ||
*/ | ||
use Treffynnon\Navigator as N; | ||
use Treffynnon\Navigator\Distance\Calculator as C; | ||
|
||
class CosineLawTestUnder7 extends PHPUnit_Framework_TestCase { | ||
|
||
/** | ||
* @expectedException PHPUnit_Framework_Error | ||
*/ | ||
public function testFailedCalculator() { | ||
$CosineLaw = new C\CosineLaw; | ||
$CosineLaw->calculate(new stdClass, new stdClass); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
tests/Treffynnon/Navigator/Distance/Calculator/GreatCircleTestUnder7.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
/** | ||
* Navigator: a geographic calculation library for PHP | ||
* @link http://navigator.simonholywell.com | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD 2-Clause License | ||
* @copyright 2012, Simon Holywell | ||
* @author Simon Holywell <treffynnon@php.net> | ||
*/ | ||
use Treffynnon\Navigator as N; | ||
use Treffynnon\Navigator\Distance\Calculator as C; | ||
|
||
class GreatCircleTestUnder7 extends PHPUnit_Framework_TestCase { | ||
|
||
/** | ||
* @expectedException PHPUnit_Framework_Error | ||
*/ | ||
public function testFailedCalculator() { | ||
$GreatCircle = new C\GreatCircle; | ||
$GreatCircle->calculate(new stdClass, new stdClass); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
tests/Treffynnon/Navigator/Distance/Calculator/HaversineTestUnder7.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
/** | ||
* Navigator: a geographic calculation library for PHP | ||
* @link http://navigator.simonholywell.com | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD 2-Clause License | ||
* @copyright 2012, Simon Holywell | ||
* @author Simon Holywell <treffynnon@php.net> | ||
*/ | ||
use Treffynnon\Navigator as N; | ||
use Treffynnon\Navigator\Distance\Calculator as C; | ||
|
||
class HaversineTestUnder7 extends PHPUnit_Framework_TestCase { | ||
|
||
/** | ||
* @expectedException PHPUnit_Framework_Error | ||
*/ | ||
public function testFailedCalculator() { | ||
$Haversine = new C\Haversine; | ||
$Haversine->calculate(new stdClass, new stdClass); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
tests/Treffynnon/Navigator/Distance/Calculator/VincentyTestUnder7.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
/** | ||
* Navigator: a geographic calculation library for PHP | ||
* @link http://navigator.simonholywell.com | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD 2-Clause License | ||
* @copyright 2012, Simon Holywell | ||
* @author Simon Holywell <treffynnon@php.net> | ||
*/ | ||
use Treffynnon\Navigator as N; | ||
use Treffynnon\Navigator\Distance\Calculator as C; | ||
|
||
class VincentyTestUnder7 extends PHPUnit_Framework_TestCase { | ||
|
||
/** | ||
* @expectedException PHPUnit_Framework_Error | ||
*/ | ||
public function testFailedCalculator() { | ||
$Vincenty = new C\Vincenty; | ||
$Vincenty->calculate(new stdClass, new stdClass); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
/** | ||
* Navigator: a geographic calculation library for PHP | ||
* @link http://navigator.simonholywell.com | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD 2-Clause License | ||
* @copyright 2012, Simon Holywell | ||
* @author Simon Holywell <treffynnon@php.net> | ||
*/ | ||
use Treffynnon\Navigator as N; | ||
|
||
class DistanceTestUnder7 extends PHPUnit_Framework_TestCase { | ||
|
||
/** | ||
* @expectedException PHPUnit_Framework_Error | ||
*/ | ||
public function testFailedGet() { | ||
$point1 = new N\LatLong(new N\Coordinate(80.9), new N\Coordinate(20.1)); | ||
$point2 = new N\LatLong(new N\Coordinate(20.1), new N\Coordinate(80.9)); | ||
$Distance = new N\Distance($point1, $point2); | ||
$metres = $Distance->get(new stdClass, new stdClass); | ||
} | ||
|
||
/** | ||
* @expectedException PHPUnit_Framework_Error | ||
*/ | ||
public function testFailedConstructor() { | ||
$Distance = new N\Distance(new stdClass, new stdClass); | ||
} | ||
|
||
} |