fix pgsql tests

This commit is contained in:
Timothy Warren 2012-03-22 16:46:47 -04:00
parent 6c932bf576
commit 6974a04ffd
3 changed files with 23 additions and 5 deletions

View File

@ -89,8 +89,15 @@ SQL;
$res = $this->query($sql); $res = $this->query($sql);
$tables = $res->fetchAll(PDO::FETCH_ASSOC); $tables = $res->fetchAll(PDO::FETCH_ASSOC);
$good_tables = array();
foreach($tables as $t)
{
$good_tables[] = $t['tablename'];
}
return $tables; return $good_tables;
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------

View File

@ -52,9 +52,16 @@ class PgTest extends DBTest {
$this->assertIsA($this->db, 'PgSQL'); $this->assertIsA($this->db, 'PgSQL');
} }
/*function TestCreateTable() function TestCreateTable()
{ {
if (empty($this->db)) return; if (empty($this->db)) return;
// Drop the table(s) if they exist
$sql = 'DROP TABLE IF EXISTS "create_test"';
$this->db->query($sql);
$sql = 'DROP TABLE IF EXISTS "create_join"';
$this->db->query($sql);
//Attempt to create the table //Attempt to create the table
$sql = $this->db->sql->create_table('create_test', $sql = $this->db->sql->create_table('create_test',
@ -83,12 +90,16 @@ class PgTest extends DBTest {
); );
$this->db->query($sql); $this->db->query($sql);
echo $sql.'<br />'; //echo $sql.'<br />';
//Reset
unset($this->db);
$this->setUp();
//Check //Check
$dbs = $this->db->get_tables(); $dbs = $this->db->get_tables();
print_r($dbs);
$this->assertTrue(in_array('create_test', $dbs)); $this->assertTrue(in_array('create_test', $dbs));
}*/ }
} }

Binary file not shown.