Query/tests/core/core.php

73 lines
1.4 KiB
PHP
Raw Normal View History

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