Query/tests/core/core_test.php

66 lines
1.3 KiB
PHP
Raw Normal View History

2016-10-12 22:12:25 -04:00
<?php declare(strict_types=1);
/**
2016-10-12 22:12:25 -04:00
* Query
*
2016-10-12 22:12:25 -04:00
* SQL Query Builder / Database Abstraction Layer
*
2016-10-12 22:12:25 -04:00
* PHP version 7
*
* @package Query
* @author Timothy J. Warren <tim@timshomepage.net>
* @copyright 2012 - 2016 Timothy J. Warren
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link https://git.timshomepage.net/aviat4ion/Query
*/
2016-10-12 22:12:25 -04:00
// --------------------------------------------------------------------------
2014-04-02 17:08:50 -04:00
/**
* CoreTest class - Compatibility and core functionality tests
2014-02-19 13:45:05 -05:00
*
* @extends UnitTestCase
*/
2014-02-14 22:08:19 -05:00
class CoreTest extends Query_TestCase {
2014-02-19 13:45:05 -05:00
/**
* TestPHPVersion function.
2014-02-19 13:45:05 -05:00
*
* @access public
* @return void
*/
2014-02-14 22:08:19 -05:00
public function testPHPVersion()
{
2014-02-19 13:45:05 -05:00
$this->assertTrue(version_compare(PHP_VERSION, "5.3", "ge"));
}
2014-02-19 13:45:05 -05:00
2012-04-24 14:00:44 -04:00
// --------------------------------------------------------------------------
2014-02-19 13:45:05 -05:00
/**
* TestHasPDO function.
2014-02-19 13:45:05 -05:00
*
* @access public
* @return void
*/
2014-02-14 22:08:19 -05:00
public function testHasPDO()
{
// PDO class exists
$this->assertTrue(class_exists('PDO'));
2014-02-19 13:45:05 -05:00
// Make sure at least one of the supported drivers is enabled
$supported = array(
'firebird',
'mysql',
'pgsql',
'odbc',
'sqlite',
);
2014-02-19 13:45:05 -05:00
$drivers = PDO::getAvailableDrivers();
2014-02-19 13:45:05 -05:00
$num_supported = count(array_intersect($drivers, $supported));
2014-02-19 13:45:05 -05:00
$this->assertTrue($num_supported > 0);
}
}