summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xext/pdo_odbc/tests/pdo_012.phpt72
-rwxr-xr-xext/pdo_odbc/tests/pdo_013.phpt60
-rwxr-xr-xext/pdo_odbc/tests/pdo_014.phpt52
3 files changed, 184 insertions, 0 deletions
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--
+<?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
index 0000000000..f573a88f74
--- /dev/null
+++ b/ext/pdo_odbc/tests/pdo_013.phpt
@@ -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
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--
+<?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===