2012-04-13 13:48:38 -04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* OpenSQLManager
|
|
|
|
*
|
|
|
|
* Free Database manager for Open Source Databases
|
|
|
|
*
|
|
|
|
* @author Timothy J. Warren
|
2014-02-18 15:18:01 -05:00
|
|
|
* @copyright Copyright (c) 2012 - 2014
|
2012-04-13 13:48:38 -04:00
|
|
|
* @link https://github.com/aviat4ion/OpenSQLManager
|
2014-02-19 13:45:05 -05:00
|
|
|
* @license http://philsturgeon.co.uk/code/dbad-license
|
2012-04-13 13:48:38 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
2014-04-02 17:08:50 -04:00
|
|
|
|
2012-04-13 13:48:38 -04:00
|
|
|
/**
|
|
|
|
* CoreTest class - Compatibility and core functionality tests
|
2014-02-19 13:45:05 -05:00
|
|
|
*
|
2012-04-13 13:48:38 -04:00
|
|
|
* @extends UnitTestCase
|
|
|
|
*/
|
2014-02-14 22:08:19 -05:00
|
|
|
class CoreTest extends Query_TestCase {
|
2014-02-19 13:45:05 -05:00
|
|
|
|
2012-04-13 13:48:38 -04:00
|
|
|
/**
|
|
|
|
* TestPHPVersion function.
|
2014-02-19 13:45:05 -05:00
|
|
|
*
|
2012-04-13 13:48:38 -04:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2014-02-14 22:08:19 -05:00
|
|
|
public function testPHPVersion()
|
2012-04-13 13:48:38 -04:00
|
|
|
{
|
2014-02-19 13:45:05 -05:00
|
|
|
$this->assertTrue(version_compare(PHP_VERSION, "5.3", "ge"));
|
2012-04-13 13:48:38 -04:00
|
|
|
}
|
2014-02-19 13:45:05 -05:00
|
|
|
|
2012-04-24 14:00:44 -04:00
|
|
|
// --------------------------------------------------------------------------
|
2014-02-19 13:45:05 -05:00
|
|
|
|
2012-04-13 13:48:38 -04:00
|
|
|
/**
|
|
|
|
* TestHasPDO function.
|
2014-02-19 13:45:05 -05:00
|
|
|
*
|
2012-04-13 13:48:38 -04:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2014-02-14 22:08:19 -05:00
|
|
|
public function testHasPDO()
|
2012-04-13 13:48:38 -04:00
|
|
|
{
|
|
|
|
// PDO class exists
|
|
|
|
$this->assertTrue(class_exists('PDO'));
|
2014-02-19 13:45:05 -05:00
|
|
|
|
|
|
|
|
2012-04-13 13:48:38 -04:00
|
|
|
// Make sure at least one of the supported drivers is enabled
|
|
|
|
$supported = array(
|
2015-07-16 16:56:13 -04:00
|
|
|
'firebird',
|
2012-04-13 13:48:38 -04:00
|
|
|
'mysql',
|
|
|
|
'pgsql',
|
|
|
|
'odbc',
|
|
|
|
'sqlite',
|
|
|
|
);
|
2014-02-19 13:45:05 -05:00
|
|
|
|
2012-07-03 13:00:17 -04:00
|
|
|
$drivers = PDO::getAvailableDrivers();
|
2014-02-19 13:45:05 -05:00
|
|
|
|
2012-04-13 13:48:38 -04:00
|
|
|
$num_supported = count(array_intersect($drivers, $supported));
|
2014-02-19 13:45:05 -05:00
|
|
|
|
2012-04-13 13:48:38 -04:00
|
|
|
$this->assertTrue($num_supported > 0);
|
|
|
|
}
|
|
|
|
}
|