switch from pdo_drivers to PDO::getAvailableDrivers

This commit is contained in:
Timothy Warren 2012-07-03 13:00:17 -04:00
parent 977434977e
commit 7649f75cac
6 changed files with 10 additions and 6 deletions

View File

@ -68,7 +68,7 @@ function query_autoload($class)
} }
elseif (is_dir($driver_path)) elseif (is_dir($driver_path))
{ {
if (in_array($class, pdo_drivers())) if (in_array($class, PDO::getAvailableDrivers()))
{ {
array_map('do_include', glob("{$driver_path}/*.php")); array_map('do_include', glob("{$driver_path}/*.php"));
} }

View File

@ -64,7 +64,7 @@ class CoreTest extends UnitTestCase {
'sqlite', 'sqlite',
); );
$drivers = pdo_drivers(); $drivers = PDO::getAvailableDrivers();
$num_supported = count(array_intersect($drivers, $supported)); $num_supported = count(array_intersect($drivers, $supported));

View File

@ -43,12 +43,16 @@ class MySQLQBTest extends QBTest {
$this->db = new Query_Builder($params); $this->db = new Query_Builder($params);
} }
else
{
die("Error with mysql credentials");
}
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
public function TestExists() public function TestExists()
{ {
$this->assertTrue(in_array('mysql', pdo_drivers())); $this->assertTrue(in_array('mysql', PDO::getAvailableDrivers()));
} }
} }

View File

@ -40,7 +40,7 @@ class MySQLTest extends DBTest {
public function TestExists() public function TestExists()
{ {
$this->assertTrue(in_array('mysql', pdo_drivers())); $this->assertTrue(in_array('mysql', PDO::getAvailableDrivers()));
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------

Binary file not shown.

View File

@ -37,7 +37,7 @@ require_once(QTEST_DIR . '/core/db_qb_test.php');
$src_path = QBASE_DIR.'drivers/'; $src_path = QBASE_DIR.'drivers/';
$test_path = QTEST_DIR.'/databases/'; $test_path = QTEST_DIR.'/databases/';
foreach(pdo_drivers() as $d) foreach(PDO::getAvailableDrivers() as $d)
{ {
// PDO firebird isn't stable enough to // PDO firebird isn't stable enough to
// bother, so skip it. // bother, so skip it.