From 12f1993f8e79b02c389d28b112c8ecf9cc54bc21 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Thu, 3 Mar 2005 13:53:55 +0000 Subject: [PATCH] Next batch of tests for PDO_ODBC (tested against DB2 V8.2). --- ext/pdo_odbc/tests/pdo_006.phpt | 64 ++++++++++++++++++++++ ext/pdo_odbc/tests/pdo_007.phpt | 54 +++++++++++++++++++ ext/pdo_odbc/tests/pdo_008.phpt | 32 +++++++++++ ext/pdo_odbc/tests/pdo_009.phpt | 94 +++++++++++++++++++++++++++++++++ 4 files changed, 244 insertions(+) create mode 100755 ext/pdo_odbc/tests/pdo_006.phpt create mode 100755 ext/pdo_odbc/tests/pdo_007.phpt create mode 100755 ext/pdo_odbc/tests/pdo_008.phpt create mode 100755 ext/pdo_odbc/tests/pdo_009.phpt diff --git a/ext/pdo_odbc/tests/pdo_006.phpt b/ext/pdo_odbc/tests/pdo_006.phpt new file mode 100755 index 0000000000..5cb31fe962 --- /dev/null +++ b/ext/pdo_odbc/tests/pdo_006.phpt @@ -0,0 +1,64 @@ +--TEST-- +PDO_ODBC: PDO_FETCH_GROUP +--SKIPIF-- + +--FILE-- + +===DONE=== + +--EXPECTF-- +array(2) { + ["A"]=> + array(2) { + [0]=> + array(1) { + [0]=> + string(1) "1" + } + [1]=> + array(1) { + [0]=> + string(1) "2" + } + } + ["C"]=> + array(1) { + [0]=> + array(1) { + [0]=> + string(1) "3" + } + } +} +array(2) { + ["A"]=> + array(2) { + [0]=> + array(1) { + ["ID"]=> + string(1) "1" + } + [1]=> + array(1) { + ["ID"]=> + string(1) "2" + } + } + ["C"]=> + array(1) { + [0]=> + array(1) { + ["ID"]=> + string(1) "3" + } + } +} +===DONE=== diff --git a/ext/pdo_odbc/tests/pdo_007.phpt b/ext/pdo_odbc/tests/pdo_007.phpt new file mode 100755 index 0000000000..0412b977ab --- /dev/null +++ b/ext/pdo_odbc/tests/pdo_007.phpt @@ -0,0 +1,54 @@ +--TEST-- +PDO_ODBC: PDO_FETCH_UNIQUE +--SKIPIF-- + +--FILE-- +'CREATE TABLE test(id CHAR(1) NOT NULL PRIMARY KEY, val VARCHAR(10))'); + +require_once($PDO_TESTS . 'pdo_007.inc'); + +?> +===DONE=== + +--EXPECTF-- +array(3) { + ["A"]=> + array(1) { + [0]=> + string(1) "A" + } + ["B"]=> + array(1) { + [0]=> + string(1) "A" + } + ["C"]=> + array(1) { + [0]=> + string(1) "C" + } +} +array(3) { + ["A"]=> + array(1) { + ["VAL"]=> + string(1) "A" + } + ["B"]=> + array(1) { + ["VAL"]=> + string(1) "A" + } + ["C"]=> + array(1) { + ["VAL"]=> + string(1) "C" + } +} +===DONE=== diff --git a/ext/pdo_odbc/tests/pdo_008.phpt b/ext/pdo_odbc/tests/pdo_008.phpt new file mode 100755 index 0000000000..d1b3508b7d --- /dev/null +++ b/ext/pdo_odbc/tests/pdo_008.phpt @@ -0,0 +1,32 @@ +--TEST-- +PDO_ODBC: PDO_FETCH_UNIQUE conflict +--SKIPIF-- + +--FILE-- +'CREATE TABLE test(id CHAR(1) NOT NULL PRIMARY KEY, val VARCHAR(10))'); + +require_once($PDO_TESTS . 'pdo_008.inc'); + +?> +===DONE=== + +--EXPECTF-- +array(2) { + ["A"]=> + array(1) { + [0]=> + string(1) "B" + } + ["C"]=> + array(1) { + [0]=> + string(1) "C" + } +} +===DONE=== diff --git a/ext/pdo_odbc/tests/pdo_009.phpt b/ext/pdo_odbc/tests/pdo_009.phpt new file mode 100755 index 0000000000..291b1e8efb --- /dev/null +++ b/ext/pdo_odbc/tests/pdo_009.phpt @@ -0,0 +1,94 @@ +--TEST-- +PDO_ODBC: PDO_FETCH_CLASSTYPE +--SKIPIF-- + +--FILE-- +'CREATE TABLE classtypes(id INT NOT NULL PRIMARY KEY, name VARCHAR(10) NOT NULL UNIQUE)', + 'create2'=>'CREATE TABLE test(id INT NOT NULL PRIMARY KEY, classtype INT, val VARCHAR(10))' +); + +require_once($PDO_TESTS . 'pdo_009.inc'); + +?> +===DONE=== + +--EXPECTF-- +array(4) { + [0]=> + array(3) { + [0]=> + string(8) "stdClass" + [1]=> + string(1) "1" + [2]=> + string(1) "A" + } + [1]=> + array(3) { + [0]=> + string(5) "Test1" + [1]=> + string(1) "2" + [2]=> + string(1) "B" + } + [2]=> + array(3) { + [0]=> + string(5) "Test2" + [1]=> + string(1) "3" + [2]=> + string(1) "C" + } + [3]=> + array(3) { + [0]=> + NULL + [1]=> + string(1) "4" + [2]=> + string(1) "D" + } +} +Test1::__construct() +Test2::__construct() +Test3::__construct() +array(4) { + [0]=> + object(stdClass)#%d (2) { + ["ID"]=> + string(1) "1" + ["VAL"]=> + string(1) "A" + } + [1]=> + object(Test1)#%d (2) { + ["ID"]=> + string(1) "2" + ["VAL"]=> + string(1) "B" + } + [2]=> + object(Test2)#%d (2) { + ["ID"]=> + string(1) "3" + ["VAL"]=> + string(1) "C" + } + [3]=> + object(Test3)#%d (2) { + ["ID"]=> + string(1) "4" + ["VAL"]=> + string(1) "D" + } +} +===DONE=== -- 2.50.1