pgsql; $this->db = new PgSQL("host={$params->host};port={$params->port};dbname={$params->database}", $params->user, $params->pass); } elseif ( ! empty(getenv('CI'))) { $this->db = new PgSQL('host=127.0.0.1;port=5432;dbname=test', 'postgres'); } } function TestExists() { $this->assertTrue(in_array('pgsql', pdo_drivers())); } function TestConnection() { if (empty($this->db)) return; $this->assertIsA($this->db, 'PgSQL'); } /*function TestCreateTable() { if (empty($this->db)) return; //Attempt to create the table $sql = $this->db->sql->create_table('create_test', array( 'id' => 'integer', 'key' => 'TEXT', 'val' => 'TEXT', ), array( 'id' => 'PRIMARY KEY' ) ); $this->db->query($sql); //Attempt to create the table $sql = $this->db->sql->create_table('create_join', array( 'id' => 'integer', 'key' => 'TEXT', 'val' => 'TEXT', ), array( 'id' => 'PRIMARY KEY' ) ); $this->db->query($sql); echo $sql.'
'; //Check $dbs = $this->db->get_tables(); $this->assertTrue(in_array('create_test', $dbs)); }*/ }