Query/tests/index.php

63 lines
1.5 KiB
PHP
Raw Normal View History

2012-03-15 09:25:18 -04:00
<?php
/**
* Query
*
* Free Query Builder / Database Abstraction Layer
*
* @author Timothy J. Warren
* @copyright Copyright (c) 2012
* @link https://github.com/aviat4ion/Query
* @license http://philsturgeon.co.uk/code/dbad-license
*/
// --------------------------------------------------------------------------
/**
* Unit test bootstrap - Using php simpletest
*/
define('TEST_DIR', dirname(__FILE__));
2012-03-22 15:43:44 -04:00
define('BASE_DIR', str_replace(basename(TEST_DIR), '', TEST_DIR));
2012-03-15 09:25:18 -04:00
define('DS', DIRECTORY_SEPARATOR);
// Include simpletest
// it has to be set in your php path, or put in the tests folder
require_once('simpletest/autorun.php');
2012-04-10 14:06:34 -04:00
// Include db classes
require_once(BASE_DIR . 'autoload.php');
2012-03-15 09:25:18 -04:00
// Require base testing classes
require_once(TEST_DIR . '/core/core.php');
require_once(TEST_DIR . '/core/settings.php');
require_once(TEST_DIR . '/core/db_test.php');
require_once(TEST_DIR . '/core/db_qb_test.php');
2012-03-15 09:25:18 -04:00
// Include db tests
// Load db classes based on capability
$src_path = BASE_DIR.'drivers/';
2012-03-22 15:47:31 -04:00
$test_path = TEST_DIR.'/databases/';
2012-03-15 09:25:18 -04:00
foreach(pdo_drivers() as $d)
{
// PDO firebird isn't stable enough to
// bother, so skip it.
if ($d === 'firebird')
{
continue;
}
2012-04-10 14:06:34 -04:00
$src_dir = "{$src_path}{$d}";
2012-03-15 09:25:18 -04:00
2012-04-10 14:06:34 -04:00
if(is_dir($src_dir))
2012-03-15 09:25:18 -04:00
{
2012-04-11 11:53:18 -04:00
require_once("{$test_path}{$d}/{$d}.php");
require_once("{$test_path}{$d}/{$d}-qb.php");
2012-03-15 09:25:18 -04:00
}
}
// Load Firebird if there is support
2012-03-19 12:08:52 -04:00
if(function_exists('fbird_connect'))
2012-03-15 09:25:18 -04:00
{
2012-04-11 11:53:18 -04:00
require_once("{$test_path}/firebird/firebird.php");
require_once("{$test_path}/firebird/firebird-qb.php");
2012-03-15 09:25:18 -04:00
}