summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Schneider2008-06-26 15:08:57 +0000
committerChristian Schneider2008-06-26 15:08:57 +0000
commitabfc7d5e3419e6f317a6366b7e4c273b0465ed2e (patch)
tree50fdafa7efa4c82494ddeefc4be1d9a5ee915993 /tests
parent156228c730ac944b751f6e8bb7d463c2fee3763c (diff)
downloaditools-abfc7d5e3419e6f317a6366b7e4c273b0465ed2e.tar.gz
itools-abfc7d5e3419e6f317a6366b7e4c273b0465ed2e.tar.bz2
itools-abfc7d5e3419e6f317a6366b7e4c273b0465ed2e.zip
Replaced deprecated mysql_list_tables by SHOW TABLES
Constructor of generated classes now take varargs too and added tests for it
Diffstat (limited to 'tests')
-rwxr-xr-xtests/it_dbi.t38
1 files changed, 37 insertions, 1 deletions
diff --git a/tests/it_dbi.t b/tests/it_dbi.t
index 63c7413..6e14657 100755
--- a/tests/it_dbi.t
+++ b/tests/it_dbi.t
@@ -51,6 +51,43 @@ is(
"select with multiple parameters (foo part)"
);
+it_dbi::createclass(array('table' => "it_dbi_test", 'forcecreate' => true));
+
+$record = new it_dbi_test;
+is(
+ $record->x,
+ null,
+ "constructor of created class without argument"
+);
+
+$record = new it_dbi_test(2);
+is(
+ $record->ID,
+ 2,
+ "constructor of created class with id parameter"
+);
+
+$record = new it_dbi_test(array('x >' => 0), "ORDER BY x DESC");
+is(
+ $record->x,
+ 64738,
+ "constructor of created class with multiple select parameters"
+);
+
+$record = new it_dbi_test(array('foo' => 'bar'));
+is(
+ $record->ID,
+ 2,
+ "constructor of created class with single array parameter"
+);
+
+$record = new it_dbi($db + array('table' => "it_dbi_test"));
+is(
+ $record->x,
+ null,
+ "constructor without parameters"
+);
+
$record = new it_dbi($db + array('table' => "it_dbi_test"), array('x >' => 0), "ORDER BY x DESC");
is(
$record->x,
@@ -58,7 +95,6 @@ is(
"constructor with multiple select parameters"
);
-
$record->select(array('x' => 64738));
is(
array($record->_key, $record->x, $record->foo),