summaryrefslogtreecommitdiff
path: root/tests/simple_unit/TableGateway
diff options
context:
space:
mode:
Diffstat (limited to 'tests/simple_unit/TableGateway')
-rw-r--r--tests/simple_unit/TableGateway/BaseGatewayTest.php2
-rw-r--r--tests/simple_unit/TableGateway/TableInfoGatewayTest.php17
2 files changed, 18 insertions, 1 deletions
diff --git a/tests/simple_unit/TableGateway/BaseGatewayTest.php b/tests/simple_unit/TableGateway/BaseGatewayTest.php
index 825f2d0e..ff7a58b0 100644
--- a/tests/simple_unit/TableGateway/BaseGatewayTest.php
+++ b/tests/simple_unit/TableGateway/BaseGatewayTest.php
@@ -88,7 +88,7 @@ class BaseGatewayTest extends UnitTestCase
}
function delete_all()
{
- $this->getGateway()->deleteAll('true');
+ $this->getGateway()->deleteAll('1=1');
}
}
?> \ No newline at end of file
diff --git a/tests/simple_unit/TableGateway/TableInfoGatewayTest.php b/tests/simple_unit/TableGateway/TableInfoGatewayTest.php
new file mode 100644
index 00000000..2be848c5
--- /dev/null
+++ b/tests/simple_unit/TableGateway/TableInfoGatewayTest.php
@@ -0,0 +1,17 @@
+<?php
+
+require_once(dirname(__FILE__).'/BaseGatewayTest.php');
+
+class TableInfoGatewayTest extends BaseGatewayTest
+{
+ function test_table_info()
+ {
+ $conn = $this->getGateway()->getDbConnection();
+ $this->add_record1();
+ $this->add_record2();
+ $info = TDbMetaData::getInstance($conn)->getTableInfo('address');
+ $table = new TTableGateway($info, $conn);
+ $this->assertEqual(count($table->findAll()->readAll()), 2);
+ }
+}
+?> \ No newline at end of file