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))
{
if (in_array($class, pdo_drivers()))
if (in_array($class, PDO::getAvailableDrivers()))
{
array_map('do_include', glob("{$driver_path}/*.php"));
}

View File

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

View File

@ -43,12 +43,16 @@ class MySQLQBTest extends QBTest {
$this->db = new Query_Builder($params);
}
else
{
die("Error with mysql credentials");
}
}
// --------------------------------------------------------------------------
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()
{
$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/';
$test_path = QTEST_DIR.'/databases/';
foreach(pdo_drivers() as $d)
foreach(PDO::getAvailableDrivers() as $d)
{
// PDO firebird isn't stable enough to
// bother, so skip it.
@ -48,7 +48,7 @@ foreach(pdo_drivers() as $d)
$src_dir = "{$test_path}{$d}";
if(is_dir($src_dir))
if (is_dir($src_dir))
{
require_once("{$test_path}{$d}/{$d}.php");
require_once("{$test_path}{$d}/{$d}-qb.php");