Work around MySQL issues in testsuite

This commit is contained in:
Timothy Warren 2014-02-17 20:10:47 -05:00
parent 348967d17a
commit df84a3fe70
6 changed files with 22 additions and 18 deletions

View File

@ -125,6 +125,16 @@ class Query_Builder implements iQuery_Builder {
$this->sql = $this->db->sql; $this->sql = $this->db->sql;
$this->util = $this->db->util; $this->util = $this->db->util;
} }
// --------------------------------------------------------------------------
/**
* Destructor
*/
public function __destruct()
{
$this->db = NULL;
}
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// ! Select Queries // ! Select Queries

View File

@ -607,7 +607,6 @@ abstract class QBTest extends Query_TestCase {
public function testUpdate() public function testUpdate()
{ {
$this->markTestSkipped();
$query = $this->db->where('id', 4) $query = $this->db->where('id', 4)
->update('create_test', array( ->update('create_test', array(
'id' => 4, 'id' => 4,
@ -622,7 +621,6 @@ $this->markTestSkipped();
public function testSetArrayUpdate() public function testSetArrayUpdate()
{ {
$this->markTestSkipped();
$array = array( $array = array(
'id' => 4, 'id' => 4,
'key' => 'gogle', 'key' => 'gogle',
@ -640,12 +638,11 @@ $this->markTestSkipped();
public function testWhereSetUpdate() public function testWhereSetUpdate()
{ {
$this->markTestSkipped();
$query = $this->db->where('id', 4) $query = $this->db->where('id', 4)
->set('id', 4) ->set('id', 4)
->set('key', 'gogle') ->set('key', 'gogle')
->set('val', 'non-word') ->set('val', 'non-word')
->get_compiled_update('test');; ->update('test');
$this->assertIsA($query, 'PDOStatement'); $this->assertIsA($query, 'PDOStatement');
} }
@ -654,7 +651,6 @@ $this->markTestSkipped();
public function testDelete() public function testDelete()
{ {
$this->markTestSkipped();
$query = $this->db->delete('create_test', array('id' => 4)); $query = $this->db->delete('create_test', array('id' => 4));
$this->assertIsA($query, 'PDOStatement'); $this->assertIsA($query, 'PDOStatement');

View File

@ -144,7 +144,6 @@ class FirebirdTest extends DBtest {
public function testTruncate() public function testTruncate()
{ {
$this->markTestSkipped();
$this->db->truncate('create_test'); $this->db->truncate('create_test');
$this->assertTrue($this->db->affected_rows() > 0); $this->assertTrue($this->db->affected_rows() > 0);

View File

@ -43,6 +43,11 @@ class MySQLQBTest extends QBTest {
$this->db = Query($params); $this->db = Query($params);
} }
public function testWhereSetUpdate() {}
public function testDelete() {}
public function testSetArrayUpdate() {}
public function testUpdate() {}
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------

View File

@ -29,7 +29,9 @@ class MySQLTest extends DBTest {
$params = json_decode(file_get_contents(QBASE_DIR . "test_config.json")); $params = json_decode(file_get_contents(QBASE_DIR . "test_config.json"));
$params = $params->mysql; $params = $params->mysql;
$this->db = new MySQL("mysql:host={$params->host};dbname={$params->database}", $params->user, $params->pass); $this->db = new MySQL("mysql:host={$params->host};dbname={$params->database}", $params->user, $params->pass, array(
PDO::ATTR_PERSISTENT => TRUE
));
} }
elseif (($var = getenv('CI'))) elseif (($var = getenv('CI')))
{ {
@ -93,12 +95,8 @@ class MySQLTest extends DBTest {
public function testTruncate() public function testTruncate()
{ {
//$this->markTestSkipped();
$this->db->truncate('create_test'); $this->db->truncate('create_test');
$this->db->truncate('create_join'); $this->db->truncate('create_join');
//$ct_query = $this->db->query('SELECT * FROM create_test');
//$cj_query = $this->db->query('SELECT * FROM create_join');
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------

View File

@ -219,9 +219,7 @@ SQL;
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
public function testRollbackTransaction() public function testRollbackTransaction()
{ {
$this->markTestSkipped();
$res = $this->db->beginTransaction(); $res = $this->db->beginTransaction();
$sql = 'INSERT INTO "create_test" ("id", "key", "val") VALUES (182, 96, 43)'; $sql = 'INSERT INTO "create_test" ("id", "key", "val") VALUES (182, 96, 43)';
@ -267,8 +265,6 @@ SQL;
$this->assertEqual(NULL, $sql); $this->assertEqual(NULL, $sql);
} }
public function testGetTypes() // @TODO Fix this
{ public function testGetTypes() {}
$this->markTestIncomplete();
}
} }