summaryrefslogtreecommitdiff
path: root/ext/pdo_odbc/tests
diff options
context:
space:
mode:
authorDan Scott <dbs@php.net>2005-03-03 20:23:29 +0000
committerDan Scott <dbs@php.net>2005-03-03 20:23:29 +0000
commitdc4501cf993fcfdca0f7a1965d8510f2040f73f4 (patch)
treea4e4850abee988b9f825484a42d7818527845443 /ext/pdo_odbc/tests
parent12f1993f8e79b02c389d28b112c8ecf9cc54bc21 (diff)
downloadphp-git-dc4501cf993fcfdca0f7a1965d8510f2040f73f4.tar.gz
Next three tests for PDO_ODBC (tested with DB2 V8.2).
Diffstat (limited to 'ext/pdo_odbc/tests')
-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===