You are here

function run_test in geoPHP 7

Same name in this branch
  1. 7 geoPHP/tests/test.php \run_test()
  2. 7 geoPHP/tests/postgis.php \run_test()
Same name and namespace in other branches
  1. 8 geoPHP/tests/test.php \run_test()
1 call to run_test()
test.php in geoPHP/tests/test.php

File

geoPHP/tests/test.php, line 11

Code

function run_test() {
  set_time_limit(0);
  set_error_handler("FailOnError");
  header("Content-type: text");
  include_once '../geoPHP.inc';
  if (geoPHP::geosInstalled()) {
    print "GEOS is installed.\n";
  }
  else {
    print "GEOS is not installed.\n";
  }
  foreach (scandir('./input') as $file) {
    $parts = explode('.', $file);
    if ($parts[0]) {
      $format = $parts[1];
      $value = file_get_contents('./input/' . $file);
      print '---- Testing ' . $file . "\n";
      $geometry = geoPHP::load($value, $format);
      test_adapters($geometry, $format, $value);
      test_methods($geometry);
      test_geometry($geometry);
      test_detection($value, $format, $file);
    }
  }
  print "\33[32m" . "PASS" . "\33[39m\n";
}