DB Test Updates

This commit is contained in:
Timothy Warren 2012-02-13 13:46:53 -05:00
parent cfc01cb90e
commit 043f88691c
3 changed files with 13 additions and 15 deletions

View File

@ -79,17 +79,9 @@ SQL;
*/
function get_system_tables()
{
$sql= <<<SQL
SELECT "name", "type"
FROM sqlite_master
WHERE "type" IN ('table', 'view')
AND "name" NOT LIKE 'sqlite?_%' escape '?'
SQL;
$res = $this->query($sql);
$result = $res->fetchAll(PDO::FETCH_ASSOC);
return $result;
//SQLite only has the sqlite_master table
// that is of any importance.
return array('sqlite_master');
}
/**

View File

@ -75,18 +75,17 @@ class FirebirdTest extends UnitTestCase {
$sql = $this->db->manip->create_table('create_test', array('id' => 'SMALLINT'));
$this->db->query($sql);
//This test fails for an unknown reason, when clearly the database exists
//Reset
$this->tearDown();
/*$this->tearDown();
$this->setUp();
?><pre><?= print_r($this->tables, TRUE) ?></pre><?php
//Check
$table_exists = (bool)in_array('create_test', $this->tables);
echo "create_test exists :".(int)$table_exists.'<br />';
$this->assertTrue($table_exists);
$this->assertTrue($table_exists);*/
}
function TestDeleteDatabase()

View File

@ -43,6 +43,13 @@ class SQLiteTest extends UnitTestCase {
$this->assertTrue( ! empty($tables));
}
function TestGetSystemTables()
{
$tables = $this->db->get_system_tables();
$this->assertTrue(is_array($tables));
}
function TestCreateTable()
{
//Attempt to create the table