You are here

function run_test in geoPHP 8

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

Run_test();.

File

geoPHP/tests/test.php, line 11
Uncomment to test.

Code

function run_test() {
  set_time_limit(0);
  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 "Testing Done!";
}