diff --git a/.travis.yml b/.travis.yml index 12c6ba92..1c56368b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ # docs available at http://docs.travis-ci.com/user/languages/php/ # example available at https://github.com/travis-ci/travis-ci-php-example +dist: trusty +sudo: false language: php before_script: @@ -12,9 +14,9 @@ install: # TODO Install geos library -- as a matrix test # TODO optionally set up a postgis database for testing -script: +script: + - ./vendor/bin/phpunit --verbose --colors --stderr --bootstrap tests/tests/bootstrap.php tests - cd tests - - phpunit --verbose --colors --stderr tests - php test.php # run tests on the following versions @@ -22,8 +24,10 @@ php: - 5.6 - 5.5 - 5.4 - - 5.3 - hhvm - + matrix: fast_finish: false + include: + - php: 5.3 + dist: precise diff --git a/composer.json b/composer.json index a02eba8a..21d287cc 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "description": "GeoPHP is a open-source native PHP library for doing geometry operations. It is written entirely in PHP and can therefore run on shared hosts. It can read and write a wide variety of formats: WKT (including EWKT), WKB (including EWKB), GeoJSON, KML, GPX, GeoRSS). It works with all Simple-Feature geometries (Point, LineString, Polygon, GeometryCollection etc.) and can be used to get centroids, bounding-boxes, area, and a wide variety of other useful information.", "homepage": "https://github.com/phayes/geoPHP", "autoload": { - "classmap": ["geoPHP.inc"] + "files": ["geoPHP.inc"] }, "authors":[ { diff --git a/tests/test.php b/tests/test.php index 9f4fe91c..957220c5 100644 --- a/tests/test.php +++ b/tests/test.php @@ -15,7 +15,7 @@ function run_test() { header("Content-type: text"); - include_once('../geoPHP.inc'); + include_once(__DIR__ . '/tests/bootstrap.php'); if (geoPHP::geosInstalled()) { print "GEOS is installed.\n"; @@ -24,11 +24,12 @@ function run_test() { print "GEOS is not installed.\n"; } - foreach (scandir('./input') as $file) { + $input_dir = __DIR__ . '/input/'; + foreach (scandir($input_dir) as $file) { $parts = explode('.',$file); if ($parts[0]) { $format = $parts[1]; - $value = file_get_contents('./input/'.$file); + $value = file_get_contents($input_dir . $file); print '---- Testing '.$file."\n"; $geometry = geoPHP::load($value, $format); test_adapters($geometry, $format, $value); diff --git a/tests/tests/20120702Test.php b/tests/tests/20120702Test.php index 5486e0a5..c0dfc5e1 100644 --- a/tests/tests/20120702Test.php +++ b/tests/tests/20120702Test.php @@ -1,5 +1,5 @@ markTestSkipped('Skipping GEOS -- not installed'); } foreach (scandir('./input') as $file) { $parts = explode('.',$file); diff --git a/tests/tests/methodsTest.php b/tests/tests/methodsTest.php index a946b4a7..c3659474 100644 --- a/tests/tests/methodsTest.php +++ b/tests/tests/methodsTest.php @@ -1,5 +1,5 @@