2012-03-15 09:25:18 -04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Query
|
|
|
|
*
|
|
|
|
* Free Query Builder / Database Abstraction Layer
|
|
|
|
*
|
2012-04-20 13:17:39 -04:00
|
|
|
* @package Query
|
|
|
|
* @author Timothy J. Warren
|
2012-03-15 09:25:18 -04:00
|
|
|
* @copyright Copyright (c) 2012
|
|
|
|
* @link https://github.com/aviat4ion/Query
|
2012-04-20 13:17:39 -04:00
|
|
|
* @license http://philsturgeon.co.uk/code/dbad-license
|
2012-03-15 09:25:18 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Firebird Query Builder Tests
|
|
|
|
*/
|
2012-03-19 13:24:36 -04:00
|
|
|
class FirebirdQBTest extends QBTest {
|
2012-03-15 09:25:18 -04:00
|
|
|
|
2012-04-24 14:00:44 -04:00
|
|
|
public function __construct()
|
2012-03-15 09:25:18 -04:00
|
|
|
{
|
|
|
|
parent::__construct();
|
2012-11-08 14:28:49 -05:00
|
|
|
|
2012-04-30 16:06:06 -04:00
|
|
|
$dbpath = QTEST_DIR.QDS.'db_files'.QDS.'FB_TEST_DB.FDB';
|
2012-03-15 09:25:18 -04:00
|
|
|
|
|
|
|
// Test the query builder
|
|
|
|
$params = new Stdclass();
|
|
|
|
$params->type = 'firebird';
|
|
|
|
$params->file = $dbpath;
|
|
|
|
$params->host = 'localhost';
|
|
|
|
$params->user = 'sysdba';
|
|
|
|
$params->pass = 'masterkey';
|
2012-11-07 08:42:34 -05:00
|
|
|
$params->prefix = 'create_';
|
2012-11-08 14:28:49 -05:00
|
|
|
$this->db = Query($params);
|
|
|
|
|
2012-03-19 13:58:14 -04:00
|
|
|
// echo '<hr /> Firebird Queries <hr />';
|
2012-04-20 16:33:40 -04:00
|
|
|
}
|
2012-11-08 14:28:49 -05:00
|
|
|
|
2012-05-08 15:37:36 -04:00
|
|
|
public function TestTypeList()
|
|
|
|
{
|
|
|
|
$sql = $this->db->sql->type_list();
|
|
|
|
$query = $this->db->query($sql);
|
2012-11-08 14:28:49 -05:00
|
|
|
|
2012-05-08 15:37:36 -04:00
|
|
|
$this->assertIsA($query, 'PDOStatement');
|
2012-11-08 14:28:49 -05:00
|
|
|
|
2012-05-08 15:37:36 -04:00
|
|
|
$res = $query->fetchAll(PDO::FETCH_ASSOC);
|
2012-11-08 14:28:49 -05:00
|
|
|
|
2012-05-08 15:37:36 -04:00
|
|
|
$this->assertTrue(is_array($res));
|
|
|
|
}
|
2012-03-15 09:25:18 -04:00
|
|
|
}
|