Skip to content

Commit

Permalink
randomize testinput and fix some area tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mprins committed Aug 29, 2014
1 parent 73a69fb commit 55d9d5c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ php:
- 5.4
- 5.3
- hhvm

matrix:
fast_finish: false
allow_failures:
# php 5.3 does not support random file list as an argument to scandir
- php: 5.3
2 changes: 1 addition & 1 deletion tests/postgis.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function run_test() {
// Working with PostGIS and EWKB
// ----------------------------

foreach (scandir('./input') as $file) {
foreach (scandir('./input', SCANDIR_SORT_NONE) as $file) {
$parts = explode('.',$file);
if ($parts[0]) {
$name = $parts[0];
Expand Down
2 changes: 1 addition & 1 deletion tests/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function run_test() {
print "GEOS is not installed.\n";
}

foreach (scandir('./input') as $file) {
foreach (scandir('./input', SCANDIR_SORT_NONE) as $file) {
$parts = explode('.',$file);
if ($parts[0]) {
$format = $parts[1];
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/adaptersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function setUp() {
}

function testAdapters() {
foreach (scandir('./input') as $file) {
foreach (scandir('./input', SCANDIR_SORT_NONE) as $file) {
$parts = explode('.',$file);
if ($parts[0]) {
$format = $parts[1];
Expand Down
6 changes: 3 additions & 3 deletions tests/tests/aliasesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function setUp() {
}

function testAliases() {
foreach (scandir('./input') as $file) {
foreach (scandir('./input', SCANDIR_SORT_NONE) as $file) {
$parts = explode('.',$file);
if ($parts[0]) {
$format = $parts[1];
Expand Down Expand Up @@ -71,10 +71,10 @@ function testAliases() {
break;
case 'getArea':
if ($geometry->geometryType() == 'Point') {
$this->assertNull($geometry->$alias_name($argument), 'Failed on ' . $alias_name .' (test file: ' . $file . ')');
$this->assertEquals(0, $geometry->$alias_name($argument), 'Failed on ' . $alias_name .' (test file: ' . $file . ')');
}
if ($geometry->geometryType() == 'LineString') {
$this->assertNull($geometry->$alias_name($argument), 'Failed on ' . $alias_name .' (test file: ' . $file . ')');
$this->assertEquals(0, $geometry->$alias_name($argument), 'Failed on ' . $alias_name .' (test file: ' . $file . ')');
}
if ($geometry->geometryType() == 'MultiLineString') {
$this->assertNotNull($geometry->$alias_name($argument), 'Failed on ' . $alias_name .' (test file: ' . $file . ')');
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/geosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function setUp() {
}

function testGeos() {
foreach (scandir('./input') as $file) {
foreach (scandir('./input', SCANDIR_SORT_NONE) as $file) {
$parts = explode('.',$file);
if ($parts[0]) {
$format = $parts[1];
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/methodsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function setUp() {
}

function testMethods() {
foreach (scandir('./input') as $file) {
foreach (scandir('./input', SCANDIR_SORT_NONE) as $file) {
$parts = explode('.',$file);
if ($parts[0]) {
$format = $parts[1];
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/placeholdersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function setUp() {
}

function testPlaceholders() {
foreach (scandir('./input') as $file) {
foreach (scandir('./input', SCANDIR_SORT_NONE) as $file) {
$parts = explode('.',$file);
if ($parts[0]) {
$format = $parts[1];
Expand Down

0 comments on commit 55d9d5c

Please sign in to comment.