From 6180c4816fdbd3b418b61c1bcf8b77ffea17a87b Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 6 Feb 2012 21:59:34 -0500 Subject: [PATCH] Load db tests based on php capabilities --- tests/index.php | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/tests/index.php b/tests/index.php index 62f07b7..9dc4c9f 100644 --- a/tests/index.php +++ b/tests/index.php @@ -32,8 +32,27 @@ function do_include($path) // Include core tests require_once("core.php"); -// Include db classes -array_map('do_include', glob("../src/databases/*.php")); - // Include db tests -array_map('do_include', glob("./databases/*.php")); \ No newline at end of file +// Load db classes based on capability +$src_path = "../src/databases/"; +$test_path = "./databases/"; + +foreach(pdo_drivers() as $d) +{ + + $src_file = "{$src_path}{$d}.php"; + $test_file = "{$test_path}{$d}.php"; + + if(is_file($file)) + { + require_once($src_file); + require_once($test_file); + } +} + +// Load Firebird if there is support +if(function_exists('ibase_connect')) +{ + require_once("{$src_path}firebird.php"); + require_once("{$test_path}firebird.php"); +} \ No newline at end of file