summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-10-27 08:43:52 +0000
committerMarcus Boerger <helly@php.net>2003-10-27 08:43:52 +0000
commitdcc060382aa4730cfa0d0ed42108da52dd1722db (patch)
tree16fd2847e044e4ecf8d2f9d88d92f4358c6ac530
parentda9ce6380ca100a74ca1ca1ec6d9afb901eee6ba (diff)
downloadphp-git-dcc060382aa4730cfa0d0ed42108da52dd1722db.tar.gz
Add another test
-rwxr-xr-xext/sqlite/tests/sqlite_oo_026.phpt56
1 files changed, 56 insertions, 0 deletions
diff --git a/ext/sqlite/tests/sqlite_oo_026.phpt b/ext/sqlite/tests/sqlite_oo_026.phpt
new file mode 100755
index 0000000000..f9e2503b76
--- /dev/null
+++ b/ext/sqlite/tests/sqlite_oo_026.phpt
@@ -0,0 +1,56 @@
+--TEST--
+sqlite-oo: unbuffered
+--INI--
+sqlite.assoc_case=0
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded("sqlite")) print "skip";
+?>
+--FILE--
+<?php
+include "blankdb_oo.inc";
+
+$data = array(
+ "one",
+ "two",
+ "three"
+ );
+
+$db->query("CREATE TABLE strings(a VARCHAR)");
+
+foreach ($data as $str) {
+ $db->query("INSERT INTO strings VALUES('$str')");
+}
+
+echo "====FOREACH====\n";
+$r = $db->unbuffered_query("SELECT a from strings", SQLITE_NUM);
+foreach($r as $idx => $row) {
+ var_dump($row[0]);
+ var_dump($row[0]);
+}
+echo "====FOR====\n";
+$r = $db->unbuffered_query("SELECT a from strings", SQLITE_NUM);
+for(;$r->hasMore(); $r->next()) {
+ $v = $r->column(0);
+ var_dump($v);
+ $c = $r->column(0);
+ var_dump(is_null($c) || $c==$v);
+}
+echo "===DONE===\n";
+?>
+--EXPECT--
+====FOREACH====
+string(3) "one"
+string(3) "one"
+string(3) "two"
+string(3) "two"
+string(5) "three"
+string(5) "three"
+====FOR====
+string(3) "one"
+bool(true)
+string(3) "two"
+bool(true)
+string(5) "three"
+bool(true)
+===DONE===