This repository has been archived on 2018-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
OpenSQLManager/tests/core.php

70 lines
1.3 KiB
PHP

<?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
*/
// --------------------------------------------------------------------------
/**
* CoreTest class - Compatibility and core functionality tests
*
* @extends UnitTestCase
*/
class CoreTest extends UnitTestCase {
/**
* __construct function.
*
* @access public
* @return void
*/
function __construct()
{
parent::__construct();
}
/**
* TestPHPVersion function.
*
* @access public
* @return void
*/
function TestPHPVersion()
{
$this->assertTrue(version_compare(PHP_VERSION, "5.2", "ge"));
$this->assertTrue(version_compare(PHP_VERSION, "5.4", "<"));
}
/**
* TestHasPDO function.
*
* @access public
* @return void
*/
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_drivers();
$num_supported = count(array_intersect($drivers, $supported));
$this->assertTrue($num_supported > 0);
}
}