From bbccc37f84e5ce7048ebf7515329ae036c86d173 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Mon, 7 Mar 2005 22:43:27 +0000 Subject: [PATCH] - Add new tests --- ext/pdo/tests/pdo_019.inc | 36 +++++++++++++++++++++ ext/pdo_mysql/tests/pdo_019.phpt | 52 +++++++++++++++++++++++++++++++ ext/pdo_pgsql/tests/pdo_019.phpt | 52 +++++++++++++++++++++++++++++++ ext/pdo_sqlite/tests/pdo_019.phpt | 52 +++++++++++++++++++++++++++++++ 4 files changed, 192 insertions(+) create mode 100755 ext/pdo/tests/pdo_019.inc create mode 100755 ext/pdo_mysql/tests/pdo_019.phpt create mode 100755 ext/pdo_pgsql/tests/pdo_019.phpt create mode 100755 ext/pdo_sqlite/tests/pdo_019.phpt diff --git a/ext/pdo/tests/pdo_019.inc b/ext/pdo/tests/pdo_019.inc new file mode 100755 index 0000000000..48b6d75f70 --- /dev/null +++ b/ext/pdo/tests/pdo_019.inc @@ -0,0 +1,36 @@ +exec($SQL['create1']); +var_dump($DB->exec($SQL['insert1'])); +var_dump($DB->exec($SQL['insert2'])); +var_dump($DB->exec($SQL['insert3'])); +var_dump($DB->exec($SQL['insert4'])); +var_dump($DB->query($SQL['select1'])->fetchSingle()); + +$cont = $DB->query($SQL['select2'])->fetchAll(PDO_FETCH_COLUMN|PDO_FETCH_UNIQUE); +var_dump($cont); + +echo "===WHILE===\n"; + +$stmt2 = $DB->prepare($SQL['select2']); +$stmt2->bindColumn('idx', $idx); +$stmt2->bindColumn('txt', $txt); +$stmt2->execute(); + +while($stmt2->fetch(PDO_FETCH_BOUND)) { + var_dump(array($idx=>$txt)); +} + +?> diff --git a/ext/pdo_mysql/tests/pdo_019.phpt b/ext/pdo_mysql/tests/pdo_019.phpt new file mode 100755 index 0000000000..3b5f43984e --- /dev/null +++ b/ext/pdo_mysql/tests/pdo_019.phpt @@ -0,0 +1,52 @@ +--TEST-- +PDO_MySQL: fetch() and while() +--SKIPIF-- + +--FILE-- + +===DONE=== + +--EXPECTF-- +===INIT=== +int(1) +int(1) +int(1) +int(1) +string(1) "4" +array(4) { + [0]=> + string(7) "String0" + [1]=> + string(7) "String1" + [2]=> + string(7) "String2" + [3]=> + string(7) "String3" +} +===WHILE=== +array(1) { + [0]=> + string(7) "String0" +} +array(1) { + [1]=> + string(7) "String1" +} +array(1) { + [2]=> + string(7) "String2" +} +array(1) { + [3]=> + string(7) "String3" +} +===DONE=== diff --git a/ext/pdo_pgsql/tests/pdo_019.phpt b/ext/pdo_pgsql/tests/pdo_019.phpt new file mode 100755 index 0000000000..21d12a75cd --- /dev/null +++ b/ext/pdo_pgsql/tests/pdo_019.phpt @@ -0,0 +1,52 @@ +--TEST-- +PDO_PGSQL: fetch() and while() +--SKIPIF-- + +--FILE-- + +===DONE=== + +--EXPECTF-- +===INIT=== +int(1) +int(1) +int(1) +int(1) +string(1) "4" +array(4) { + [0]=> + string(7) "String0" + [1]=> + string(7) "String1" + [2]=> + string(7) "String2" + [3]=> + string(7) "String3" +} +===WHILE=== +array(1) { + [0]=> + string(7) "String0" +} +array(1) { + [1]=> + string(7) "String1" +} +array(1) { + [2]=> + string(7) "String2" +} +array(1) { + [3]=> + string(7) "String3" +} +===DONE=== diff --git a/ext/pdo_sqlite/tests/pdo_019.phpt b/ext/pdo_sqlite/tests/pdo_019.phpt new file mode 100755 index 0000000000..11255774b8 --- /dev/null +++ b/ext/pdo_sqlite/tests/pdo_019.phpt @@ -0,0 +1,52 @@ +--TEST-- +PDO_SQLite: fetch() and while() +--SKIPIF-- + +--FILE-- + +===DONE=== + +--EXPECTF-- +===INIT=== +int(1) +int(1) +int(1) +int(1) +string(1) "4" +array(4) { + [0]=> + string(7) "String0" + [1]=> + string(7) "String1" + [2]=> + string(7) "String2" + [3]=> + string(7) "String3" +} +===WHILE=== +array(1) { + [0]=> + string(7) "String0" +} +array(1) { + [1]=> + string(7) "String1" +} +array(1) { + [2]=> + string(7) "String2" +} +array(1) { + [3]=> + string(7) "String3" +} +===DONE=== -- 2.40.0