diff --git a/tests/core/parent.php b/tests/core/parent.php index 908680d..f664af2 100644 --- a/tests/core/parent.php +++ b/tests/core/parent.php @@ -48,60 +48,6 @@ abstract class DBTest extends UnitTestCase { $res = $this->db->beginTransaction(); $this->assertTrue($res); } - - function TestPreparedStatements() - { - if (empty($this->db)) return; - - $sql = <<db->prepare_query($sql, array(1,"boogers", "Gross")); - - $statement->execute(); - - } - - function TestPrepareExecute() - { - if (empty($this->db)) return; - - $sql = <<db->prepare_execute($sql, array( - 2, "works", 'also?' - )); - - } - - function TestCommitTransaction() - { - if (empty($this->db)) return; - - $res = $this->db->beginTransaction(); - - $sql = 'INSERT INTO "create_test" ("id", "key", "val") VALUES (10, 12, 14)'; - $this->db->query($sql); - - $res = $this->db->commit(); - $this->assertTrue($res); - } - - function TestRollbackTransaction() - { - if (empty($this->db)) return; - - $res = $this->db->beginTransaction(); - - $sql = 'INSERT INTO "create_test" ("id", "key", "val") VALUES (182, 96, 43)'; - $this->db->query($sql); - - $res = $this->db->rollback(); - $this->assertTrue($res); - } } // -------------------------------------------------------------------------- @@ -236,6 +182,7 @@ abstract class QBTest extends UnitTestCase { ->where('id >', 0) ->where('id <', 9000) ->group_by('k') + ->group_by('id') ->group_by('val') ->order_by('id', 'DESC') ->order_by('k', 'ASC') diff --git a/tests/databases/mysql.php b/tests/databases/mysql.php index 9cb249b..1eb5a5a 100644 --- a/tests/databases/mysql.php +++ b/tests/databases/mysql.php @@ -85,6 +85,69 @@ class MySQLTest extends DBTest { } + function TestTruncate() + { + $this->db->truncate('create_test'); + $this->db->truncate('create_join'); + + $ct_query = $this->db->query('SELECT * FROM create_test'); + $cj_query = $this->db->query('SELECT * FROM create_join'); + } + + function TestPreparedStatements() + { + if (empty($this->db)) return; + + $sql = <<db->prepare_query($sql, array(1,"boogers", "Gross")); + + $statement->execute(); + + } + + function TestPrepareExecute() + { + if (empty($this->db)) return; + + $sql = <<db->prepare_execute($sql, array( + 2, "works", 'also?' + )); + + } + + function TestCommitTransaction() + { + if (empty($this->db)) return; + + $res = $this->db->beginTransaction(); + + $sql = 'INSERT INTO `create_test` (`id`, `key`, `val`) VALUES (10, 12, 14)'; + $this->db->query($sql); + + $res = $this->db->commit(); + $this->assertTrue($res); + } + + function TestRollbackTransaction() + { + if (empty($this->db)) return; + + $res = $this->db->beginTransaction(); + + $sql = 'INSERT INTO `create_test` (`id`, `key`, `val`) VALUES (182, 96, 43)'; + $this->db->query($sql); + + $res = $this->db->rollback(); + $this->assertTrue($res); + } + function TestGetSchemas() { $this->assertFalse($this->db->get_schemas()); diff --git a/tests/databases/pgsql.php b/tests/databases/pgsql.php index dabd0e8..470c34a 100644 --- a/tests/databases/pgsql.php +++ b/tests/databases/pgsql.php @@ -102,6 +102,69 @@ class PgTest extends DBTest { } + function TestTruncate() + { + $this->db->truncate('create_test'); + $this->db->truncate('create_join'); + + $ct_query = $this->db->query('SELECT * FROM create_test'); + $cj_query = $this->db->query('SELECT * FROM create_join'); + } + + function TestPreparedStatements() + { + if (empty($this->db)) return; + + $sql = <<db->prepare_query($sql, array(1,"boogers", "Gross")); + + $statement->execute(); + + } + + function TestPrepareExecute() + { + if (empty($this->db)) return; + + $sql = <<db->prepare_execute($sql, array( + 2, "works", 'also?' + )); + + } + + function TestCommitTransaction() + { + if (empty($this->db)) return; + + $res = $this->db->beginTransaction(); + + $sql = 'INSERT INTO "create_test" ("id", "key", "val") VALUES (10, 12, 14)'; + $this->db->query($sql); + + $res = $this->db->commit(); + $this->assertTrue($res); + } + + function TestRollbackTransaction() + { + if (empty($this->db)) return; + + $res = $this->db->beginTransaction(); + + $sql = 'INSERT INTO "create_test" ("id", "key", "val") VALUES (182, 96, 43)'; + $this->db->query($sql); + + $res = $this->db->rollback(); + $this->assertTrue($res); + } + function TestGetSchemas() { $this->assertTrue(is_array($this->db->get_schemas())); diff --git a/tests/test_dbs/FB_TEST_DB.FDB b/tests/test_dbs/FB_TEST_DB.FDB index d78e6c1..2cc7d47 100755 Binary files a/tests/test_dbs/FB_TEST_DB.FDB and b/tests/test_dbs/FB_TEST_DB.FDB differ