]> granicus.if.org Git - php/commitdiff
Next three tests for PDO_ODBC (tested with DB2 V8.2).
authorDan Scott <dbs@php.net>
Thu, 3 Mar 2005 20:23:29 +0000 (20:23 +0000)
committerDan Scott <dbs@php.net>
Thu, 3 Mar 2005 20:23:29 +0000 (20:23 +0000)
ext/pdo_odbc/tests/pdo_012.phpt [new file with mode: 0755]
ext/pdo_odbc/tests/pdo_013.phpt [new file with mode: 0755]
ext/pdo_odbc/tests/pdo_014.phpt [new file with mode: 0755]

diff --git a/ext/pdo_odbc/tests/pdo_012.phpt b/ext/pdo_odbc/tests/pdo_012.phpt
new file mode 100755 (executable)
index 0000000..59a30b3
--- /dev/null
@@ -0,0 +1,72 @@
+--TEST--
+PDO_ODBC: PDOStatement::setFetchMode
+--SKIPIF--
+<?php # vim:ft=php
+require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+require_once('connection.inc');
+require_once('prepare.inc');
+
+$SQL = array('create'=>'CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), grp VARCHAR(10))');
+
+require_once($PDO_TESTS . 'pdo_012.inc');
+
+?>
+===DONE===
+<?php exit(0); ?>
+--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 (executable)
index 0000000..f573a88
--- /dev/null
@@ -0,0 +1,60 @@
+--TEST--
+PDO_ODBC: PDOStatement is Traversable
+--SKIPIF--
+<?php # vim:ft=php
+require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+require_once('connection.inc');
+require_once('prepare.inc');
+
+$SQL = array('create'=>'CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), grp VARCHAR(10))');
+
+require_once($PDO_TESTS . 'pdo_013.inc');
+
+?>
+===DONE===
+<?php exit(0); ?>
+--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 (executable)
index 0000000..f0b1c55
--- /dev/null
@@ -0,0 +1,52 @@
+--TEST--
+PDO_ODBC: PDOStatement and SPL Iterators
+--SKIPIF--
+<?php # vim:ft=php
+require_once('skipif.inc');
+if (!extension_loaded('SPL')) die('skip SPL not available');
+?>
+--FILE--
+<?php
+
+require_once('connection.inc');
+require_once('prepare.inc');
+
+$SQL = array('create'=>'CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val VARCHAR(10), grp VARCHAR(10))');
+
+require_once($PDO_TESTS . 'pdo_014.inc');
+
+?>
+===DONE===
+<?php exit(0); ?>
+--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===