summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Schneider2008-10-01 14:15:52 +0000
committerChristian Schneider2008-10-01 14:15:52 +0000
commit4813565b22eadbdf23985a7635b69e6c7e3d3659 (patch)
tree392a45a0106bc133a9dbb8ce432b861a17efaa7d /tests
parent752b1bd0ed2bf16450f090d337b2e87b5e0e59c4 (diff)
downloaditools-4813565b22eadbdf23985a7635b69e6c7e3d3659.tar.gz
itools-4813565b22eadbdf23985a7635b69e6c7e3d3659.tar.bz2
itools-4813565b22eadbdf23985a7635b69e6c7e3d3659.zip
Added test for dbi Iterator
Diffstat (limited to 'tests')
-rwxr-xr-xtests/it_dbi.t21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/it_dbi.t b/tests/it_dbi.t
index 6e14657..cd8c650 100755
--- a/tests/it_dbi.t
+++ b/tests/it_dbi.t
@@ -159,3 +159,24 @@ is(
"integer/integer/integer/string",
"automatic type detection"
);
+
+$count = 0;
+foreach (new it_dbi_test as $id => $record)
+{
+ $count++;
+ is($record->_key, $id, "Iterator id $id");
+}
+is($count, 3, "Iterator without select");
+
+$count = 0;
+foreach (new it_dbi_test('foo <>' => "") as $id => $record)
+{
+ $count++;
+ is($record->_key, $id, "Iterator id $id");
+}
+is($count, 2, "Iterator with select");
+
+$count = 0;
+foreach ($record as $rec)
+ $count++;
+is($count, 2, "Iterator reused");