diff options
author | Magnus M��tt� <magnus@php.net> | 2005-03-08 23:00:34 +0000 |
---|---|---|
committer | Magnus M��tt� <magnus@php.net> | 2005-03-08 23:00:34 +0000 |
commit | ddde4497b2343b0dd0e08a6bfba7b8ca0f4a3e12 (patch) | |
tree | 10d957e2aec359c54a3cb9a52a3dca13bd0c6b42 /ext/pdo_oci/tests | |
parent | d0bb8f5f12aaca0735b532a578eef79c7b283d2a (diff) | |
download | php-git-ddde4497b2343b0dd0e08a6bfba7b8ca0f4a3e12.tar.gz |
Add more tests.
Diffstat (limited to 'ext/pdo_oci/tests')
-rwxr-xr-x | ext/pdo_oci/tests/pdo_016.phpt | 117 | ||||
-rwxr-xr-x | ext/pdo_oci/tests/pdo_018.phpt | 135 | ||||
-rwxr-xr-x | ext/pdo_oci/tests/pdo_019.phpt | 52 | ||||
-rwxr-xr-x | ext/pdo_oci/tests/pdo_020.phpt | 21 |
4 files changed, 325 insertions, 0 deletions
diff --git a/ext/pdo_oci/tests/pdo_016.phpt b/ext/pdo_oci/tests/pdo_016.phpt new file mode 100755 index 0000000000..be0ca27d99 --- /dev/null +++ b/ext/pdo_oci/tests/pdo_016.phpt @@ -0,0 +1,117 @@ +--TEST-- +PDO_OCI: PDO_FETCH_BOUND +--SKIPIF-- +<?php # vim:ft=php +require_once('skipif.inc'); +?> +--FILE-- +<?php + +require_once('connection.inc'); +require_once('prepare.inc'); + +require_once($PDO_TESTS . 'pdo_016.inc'); + +?> +===DONE=== +<?php exit(0); ?> +--EXPECTF-- +===INIT=== +int(1) +int(1) +int(1) +string(1) "3" +array(3) { + [0]=> + string(7) "String0" + [1]=> + string(7) "String1" + [2]=> + string(7) "String2" +} +===WHILE=== +array(1) { + [0]=> + string(7) "String0" +} +array(1) { + [1]=> + string(7) "String1" +} +array(1) { + [2]=> + string(7) "String2" +} +===ALONE=== +array(1) { + [0]=> + string(7) "String0" +} +bool(true) +bool(true) +bool(true) +bool(true) +array(1) { + [0]=> + string(7) "String0" +} +array(1) { + [1]=> + string(7) "String1" +} +bool(true) +bool(true) +bool(true) +bool(true) +array(1) { + [1]=> + string(7) "String1" +} +array(1) { + [2]=> + string(7) "String2" +} +bool(true) +bool(true) +bool(true) +bool(true) +array(1) { + [2]=> + string(7) "String2" +} +===REBIND/SAME=== +array(1) { + [0]=> + string(7) "String0" +} +bool(true) +bool(true) +string(7) "String0" +bool(true) +bool(true) +string(1) "0" +array(1) { + [1]=> + string(7) "String1" +} +bool(true) +bool(true) +string(7) "String1" +bool(true) +bool(true) +string(1) "1" +array(1) { + [2]=> + string(7) "String2" +} +bool(true) +bool(true) +string(7) "String2" +bool(true) +bool(true) +string(1) "2" +===REBIND/CONFLICT=== +string(7) "String0" +string(7) "String1" +string(7) "String2" +===DONE=== diff --git a/ext/pdo_oci/tests/pdo_018.phpt b/ext/pdo_oci/tests/pdo_018.phpt new file mode 100755 index 0000000000..673efc3e25 --- /dev/null +++ b/ext/pdo_oci/tests/pdo_018.phpt @@ -0,0 +1,135 @@ +--TEST-- +PDO_OCI: PDO Unserializing +--SKIPIF-- +<?php # vim:ft=php +require_once('skipif.inc'); +?> +--FILE-- +<?php + +require_once('connection.inc'); +require_once('prepare.inc'); + +require_once($PDO_TESTS . 'pdo_018.inc'); + +?> +===DONE=== +<?php exit(0); ?> +--EXPECTF-- +===INIT=== +int(1) +int(1) +int(1) +string(1) "3" +array(3) { + [0]=> + string(8) "stdClass" + [1]=> + string(8) "TestBase" + [2]=> + string(11) "TestDerived" +} +===TYPES=== +array(4) { + ["stdClass"]=> + string(1) "0" + ["TestBase"]=> + string(1) "1" + ["TestDerived"]=> + string(1) "2" + ["TestLeaf"]=> + NULL +} +===INSERT=== +TestBase::serialize() = 'a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}' +TestDerived::serialize() +TestBase::serialize() = 'a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}' +TestDerived::serialize() +TestBase::serialize() = 'a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}' +===DATA=== +array(4) { + [0]=> + NULL + [1]=> + string(91) "a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}" + [2]=> + string(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}" + [3]=> + string(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}" +} +===FAILURE=== +Exception:Class stdClass cannot be unserialized +===COUNT=== +string(1) "3" +===DATABASE=== +array(3) { + [0]=> + array(2) { + ["name"]=> + string(8) "TestBase" + ["val"]=> + string(91) "a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}" + } + [1]=> + array(2) { + ["name"]=> + string(11) "TestDerived" + ["val"]=> + string(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}" + } + [2]=> + array(2) { + ["name"]=> + NULL + ["val"]=> + string(144) "a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}" + } +} +===FETCHCLASS=== +TestBase::unserialize[22](a:3:{s:7:"BasePub";s:6:"Public";s:7:"BasePro";s:9:"Protected";s:7:"BasePri";s:7:"Private";}) +TestDerived::unserialize() +TestBase::unserialize[22](a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}) +TestDerived::unserialize() +TestBase::unserialize[22](a:4:{s:7:"BasePub";s:13:"DerivedPublic";s:7:"BasePro";s:16:"DerivdeProtected";s:10:"DerivedPub";s:6:"Public";s:10:"DerivedPro";s:9:"Protected";}) +array(3) { + [0]=> + object(TestBase)#%d (3) { + ["BasePub"]=> + string(7) "#Public" + ["BasePro:protected"]=> + string(10) "#Protected" + ["BasePri:private"]=> + string(8) "#Private" + } + [1]=> + object(TestDerived)#%d (6) { + ["BasePub"]=> + string(14) "#DerivedPublic" + ["BasePro:protected"]=> + string(17) "#DerivdeProtected" + ["DerivedPub"]=> + string(7) "#Public" + ["DerivedPro:protected"]=> + string(10) "#Protected" + ["DerivedPri:private"]=> + string(7) "Private" + ["BasePri:private"]=> + string(7) "Private" + } + [2]=> + object(TestLeaf)#%d (6) { + ["BasePub"]=> + string(14) "#DerivedPublic" + ["BasePro:protected"]=> + string(17) "#DerivdeProtected" + ["DerivedPub"]=> + string(7) "#Public" + ["DerivedPro:protected"]=> + string(10) "#Protected" + ["DerivedPri:private"]=> + string(7) "Private" + ["BasePri:private"]=> + string(7) "Private" + } +} +===DONE=== diff --git a/ext/pdo_oci/tests/pdo_019.phpt b/ext/pdo_oci/tests/pdo_019.phpt new file mode 100755 index 0000000000..1dcdd92cb9 --- /dev/null +++ b/ext/pdo_oci/tests/pdo_019.phpt @@ -0,0 +1,52 @@ +--TEST-- +PDO_OCI: fetch() and while() +--SKIPIF-- +<?php # vim:ft=php +require_once('skipif.inc'); +?> +--FILE-- +<?php + +require_once('connection.inc'); +require_once('prepare.inc'); + +require_once($PDO_TESTS . 'pdo_019.inc'); + +?> +===DONE=== +<?php exit(0); ?> +--EXPECTF-- +===INIT=== +int(1) +int(1) +int(1) +int(1) +string(1) "4" +array(4) { + [0]=> + string(7) "String0" + [1]=> + string(7) "String1" + [2]=> + string(7) "String2" + [3]=> + string(7) "String3" +} +===WHILE=== +array(1) { + [0]=> + string(7) "String0" +} +array(1) { + [1]=> + string(7) "String1" +} +array(1) { + [2]=> + string(7) "String2" +} +array(1) { + [3]=> + string(7) "String3" +} +===DONE=== diff --git a/ext/pdo_oci/tests/pdo_020.phpt b/ext/pdo_oci/tests/pdo_020.phpt new file mode 100755 index 0000000000..90dba329b2 --- /dev/null +++ b/ext/pdo_oci/tests/pdo_020.phpt @@ -0,0 +1,21 @@ +--TEST-- +PDO_OCI: PDOStatement::columnCount +--SKIPIF-- +<?php # vim:ft=php +require_once('skipif.inc'); ?> +--FILE-- +<?php + +require_once('connection.inc'); +require_once('prepare.inc'); + +require_once($PDO_TESTS . 'pdo_020.inc'); + +?> +===DONE=== +<?php exit(0); ?> +--EXPECT-- +Counted 2 columns after select1. +Counted 3 columns after select2. +Counted 1 columns after select3. +===DONE=== |