Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

First unit test.

Related to #373.
commit 0fc822a744abcb2f61f7c495f50f9d1d13a8283a 1 parent 8b89bd6
@franzliedke franzliedke authored
Showing with 18 additions and 2 deletions.
  1. +2 −2 src/Database/Query.php
  2. +16 −0 tests/Database/Adapter.php
View
4 src/Database/Query.php
@@ -39,8 +39,8 @@ public function getTable()
public function run(array $params = array())
{
- // This query type does not support multiple executions
- if ($this->run)
+ // This query type does not support multiple executions with different parameters
+ if ($this->run && !empty($params))
{
throw new Exception('This query type does not support multiple executions with different parameter sets.');
}
View
16 tests/Database/Adapter.php
@@ -19,4 +19,20 @@ public function setUp()
* @return Flux_Database_Adapter
*/
abstract public function createAdapter();
+
+ public function testCreateAndRemoveTable()
+ {
+ $q1 = $this->db->createTable('test1');
+ $q1->run();
+
+ $q2 = $this->db->tableExists('test1');
+ $r2 = $q2->run();
+ $this->assertTrue($r2);
+
+ $q3 = $this->db->dropTable('test1');
+ $q3->run();
+
+ $r4 = $q2->run();
+ $this->assertFalse($r4);
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.