2012-02-02 17:43:09 -05:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* OpenSQLManager
|
|
|
|
*
|
|
|
|
* Free Database manager for Open Source Databases
|
|
|
|
*
|
|
|
|
* @author Timothy J. Warren
|
|
|
|
* @copyright Copyright (c) 2012
|
|
|
|
* @link https://github.com/aviat4ion/OpenSQLManager
|
|
|
|
* @license http://philsturgeon.co.uk/code/dbad-license
|
|
|
|
*/
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unit test bootstrap - Using php simpletest
|
|
|
|
*/
|
2012-02-02 19:04:10 -05:00
|
|
|
define('BASE_DIR', '../src');
|
2012-03-06 21:32:49 -05:00
|
|
|
define('TEST_DIR', dirname(__FILE__));
|
|
|
|
define('DS', DIRECTORY_SEPARATOR);
|
2012-02-02 19:04:10 -05:00
|
|
|
|
|
|
|
// Include simpletest
|
|
|
|
// it has to be set in your php path, or put in the tests folder
|
|
|
|
require_once('simpletest/autorun.php');
|
|
|
|
|
|
|
|
|
|
|
|
// Bulk loading wrapper workaround for PHP < 5.4
|
|
|
|
function do_include($path)
|
|
|
|
{
|
|
|
|
require_once($path);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Include core tests
|
|
|
|
require_once("core.php");
|
2012-03-07 16:52:51 -05:00
|
|
|
require_once("../sys/db/db_pdo.php");
|
|
|
|
require_once("../sys/db/query_builder.php");
|
2012-03-01 12:05:32 -05:00
|
|
|
|
2012-02-02 19:04:10 -05:00
|
|
|
|
|
|
|
// Include db tests
|
2012-02-06 21:59:34 -05:00
|
|
|
// Load db classes based on capability
|
2012-03-07 16:52:51 -05:00
|
|
|
$src_path = "../sys/db/drivers/";
|
2012-02-06 21:59:34 -05:00
|
|
|
$test_path = "./databases/";
|
|
|
|
|
|
|
|
foreach(pdo_drivers() as $d)
|
|
|
|
{
|
2012-03-06 21:07:34 -05:00
|
|
|
// PDO firebird isn't stable enough to
|
|
|
|
// bother, so skip it.
|
|
|
|
if ($d === 'firebird')
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2012-02-06 21:59:34 -05:00
|
|
|
$src_file = "{$src_path}{$d}.php";
|
|
|
|
|
2012-02-06 22:04:03 -05:00
|
|
|
if(is_file($src_file))
|
2012-02-06 21:59:34 -05:00
|
|
|
{
|
2012-02-07 15:27:33 -05:00
|
|
|
require_once("{$src_path}{$d}.php");
|
2012-02-29 14:36:42 -05:00
|
|
|
require_once("{$src_path}{$d}_sql.php");
|
2012-02-07 15:27:33 -05:00
|
|
|
require_once("{$test_path}{$d}.php");
|
2012-02-06 21:59:34 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Load Firebird if there is support
|
2012-03-06 21:07:34 -05:00
|
|
|
if(function_exists('ibase_connect'))
|
2012-02-06 21:59:34 -05:00
|
|
|
{
|
2012-03-05 15:18:17 -05:00
|
|
|
require_once("{$src_path}firebird-ibase.php");
|
2012-02-29 14:36:42 -05:00
|
|
|
require_once("{$src_path}firebird_sql.php");
|
2012-02-06 21:59:34 -05:00
|
|
|
require_once("{$test_path}firebird.php");
|
|
|
|
}
|