summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
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");