]> granicus.if.org Git - php/commitdiff
Added test for PDO_FETCH_LAZY.
authorIlia Alshanetsky <iliaa@php.net>
Thu, 21 Jul 2005 19:33:48 +0000 (19:33 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 21 Jul 2005 19:33:48 +0000 (19:33 +0000)
# This currently fails, see bug 33785

ext/pdo/tests/pdo_027.phpt [new file with mode: 0644]

diff --git a/ext/pdo/tests/pdo_027.phpt b/ext/pdo/tests/pdo_027.phpt
new file mode 100644 (file)
index 0000000..3a74f26
--- /dev/null
@@ -0,0 +1,26 @@
+--TEST--
+PDO Common: PDO_FETCH_LAZY
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo')) die('skip');
+$dir = getenv('REDIR_TEST_DIR');
+if (false == $dir) die('skip no driver');
+require_once $dir . 'pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+$db = PDOTest::factory();
+
+$db->exec('create table test (id int, name varchar(10) NULL)');
+$db->exec("INSERT INTO test (id,name) VALUES(1,'test1')");
+$db->exec("INSERT INTO test (id,name) VALUES(2,'test2')");
+
+foreach ($db->query("SELECT * FROM test", PDO_FETCH_LAZY) as $v) {
+       echo $v->id.$v->name."\n";
+}
+?>
+--EXPECT--
+1test1
+2test2