summaryrefslogtreecommitdiff
path: root/ext/pdo_sqlite
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2005-03-07 22:36:12 +0000
committerMarcus Boerger <helly@php.net>2005-03-07 22:36:12 +0000
commitefb3529b7fd31253e4f69a71cd6cb43da0942199 (patch)
tree46548b11eb4653ed8fa794ef5888fac5d5e2b7fe /ext/pdo_sqlite
parent9c08e3ccae97d885eee75c36d4ab06793c06ac5c (diff)
downloadphp-git-efb3529b7fd31253e4f69a71cd6cb43da0942199.tar.gz
- Add new tests
Diffstat (limited to 'ext/pdo_sqlite')
-rwxr-xr-xext/pdo_sqlite/tests/pdo_018.phpt135
1 files changed, 135 insertions, 0 deletions
diff --git a/ext/pdo_sqlite/tests/pdo_018.phpt b/ext/pdo_sqlite/tests/pdo_018.phpt
new file mode 100755
index 0000000000..8a7339f983
--- /dev/null
+++ b/ext/pdo_sqlite/tests/pdo_018.phpt
@@ -0,0 +1,135 @@
+--TEST--
+PDO_SQLite: 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===