From dc4501cf993fcfdca0f7a1965d8510f2040f73f4 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Thu, 3 Mar 2005 20:23:29 +0000 Subject: [PATCH] Next three tests for PDO_ODBC (tested with DB2 V8.2). --- ext/pdo_odbc/tests/pdo_012.phpt | 72 +++++++++++++++++++++++++++++++++ ext/pdo_odbc/tests/pdo_013.phpt | 60 +++++++++++++++++++++++++++ ext/pdo_odbc/tests/pdo_014.phpt | 52 ++++++++++++++++++++++++ 3 files changed, 184 insertions(+) create mode 100755 ext/pdo_odbc/tests/pdo_012.phpt create mode 100755 ext/pdo_odbc/tests/pdo_013.phpt create mode 100755 ext/pdo_odbc/tests/pdo_014.phpt diff --git a/ext/pdo_odbc/tests/pdo_012.phpt b/ext/pdo_odbc/tests/pdo_012.phpt new file mode 100755 index 0000000000..59a30b3cf4 --- /dev/null +++ b/ext/pdo_odbc/tests/pdo_012.phpt @@ -0,0 +1,72 @@ +--TEST-- +PDO_ODBC: PDOStatement::setFetchMode +--SKIPIF-- + +--FILE-- +'CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), grp VARCHAR(10))'); + +require_once($PDO_TESTS . 'pdo_012.inc'); + +?> +===DONE=== + +--EXPECTF-- +array(2) { + [0]=> + array(2) { + [0]=> + string(1) "A" + [1]=> + string(6) "Group1" + } + [1]=> + array(2) { + [0]=> + string(1) "B" + [1]=> + string(6) "Group2" + } +} +Test::__construct(N/A) +Test::__construct(N/A) +array(2) { + [0]=> + object(Test)#%d (2) { + ["VAL"]=> + string(1) "A" + ["GRP"]=> + string(6) "Group1" + } + [1]=> + object(Test)#%d (2) { + ["VAL"]=> + string(1) "B" + ["GRP"]=> + string(6) "Group2" + } +} +Test::__construct(Changed) +Test::__construct(Changed) +array(2) { + [0]=> + object(Test)#%d (2) { + ["VAL"]=> + string(1) "A" + ["GRP"]=> + string(6) "Group1" + } + [1]=> + object(Test)#%d (2) { + ["VAL"]=> + string(1) "B" + ["GRP"]=> + string(6) "Group2" + } +} +===DONE=== diff --git a/ext/pdo_odbc/tests/pdo_013.phpt b/ext/pdo_odbc/tests/pdo_013.phpt new file mode 100755 index 0000000000..f573a88f74 --- /dev/null +++ b/ext/pdo_odbc/tests/pdo_013.phpt @@ -0,0 +1,60 @@ +--TEST-- +PDO_ODBC: PDOStatement is Traversable +--SKIPIF-- + +--FILE-- +'CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), grp VARCHAR(10))'); + +require_once($PDO_TESTS . 'pdo_013.inc'); + +?> +===DONE=== + +--EXPECTF-- +array(2) { + [0]=> + string(1) "A" + [1]=> + string(6) "Group1" +} +array(2) { + [0]=> + string(1) "B" + [1]=> + string(6) "Group2" +} +Test::__construct(N/A) +object(Test)#%d (2) { + ["VAL"]=> + string(1) "A" + ["GRP"]=> + string(6) "Group1" +} +Test::__construct(N/A) +object(Test)#%d (2) { + ["VAL"]=> + string(1) "B" + ["GRP"]=> + string(6) "Group2" +} +Test::__construct(WOW) +object(Test)#%d (2) { + ["VAL"]=> + string(1) "A" + ["GRP"]=> + string(6) "Group1" +} +Test::__construct(WOW) +object(Test)#%d (2) { + ["VAL"]=> + string(1) "B" + ["GRP"]=> + string(6) "Group2" +} +===DONE=== diff --git a/ext/pdo_odbc/tests/pdo_014.phpt b/ext/pdo_odbc/tests/pdo_014.phpt new file mode 100755 index 0000000000..f0b1c550bc --- /dev/null +++ b/ext/pdo_odbc/tests/pdo_014.phpt @@ -0,0 +1,52 @@ +--TEST-- +PDO_ODBC: PDOStatement and SPL Iterators +--SKIPIF-- + +--FILE-- +'CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), grp VARCHAR(10))'); + +require_once($PDO_TESTS . 'pdo_014.inc'); + +?> +===DONE=== + +--EXPECTF-- +Test::__construct(WOW) +object(Test)#%d (2) { + ["VAL"]=> + string(1) "A" + ["GRP"]=> + string(6) "Group1" +} +Test::__construct(WOW) +object(Test)#%d (2) { + ["VAL"]=> + string(1) "B" + ["GRP"]=> + string(6) "Group2" +} +NULL +bool(false) +PDOStatementAggregate::__construct +PDOStatementAggregate::getIterator +array(2) { + [0]=> + string(1) "A" + [1]=> + string(6) "Group1" +} +array(2) { + [0]=> + string(1) "B" + [1]=> + string(6) "Group2" +} +===DONE=== -- 2.50.1