From 58d45bfe2e50e1f64e4486604ea94a4d6f1ee9c6 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Tue, 5 Apr 2005 09:23:14 +0000 Subject: [PATCH] - Add new test --- ext/spl/tests/spl_autoload_003.phpt | 44 ++++++ ext/standard/tests/serialize/005.phpt | 186 ++++++++++++++++++++++++++ 2 files changed, 230 insertions(+) create mode 100755 ext/spl/tests/spl_autoload_003.phpt create mode 100755 ext/standard/tests/serialize/005.phpt diff --git a/ext/spl/tests/spl_autoload_003.phpt b/ext/spl/tests/spl_autoload_003.phpt new file mode 100755 index 0000000000..00fdd2734f --- /dev/null +++ b/ext/spl/tests/spl_autoload_003.phpt @@ -0,0 +1,44 @@ +--TEST-- +SPL: spl_autoload() and friends +--INI-- +include_path=. +--FILE-- +getMessage() . "\n"; +} + +?> +===DONE=== + +--EXPECTF-- +TestFunc1(TestClass) +TestFunc2(TestClass) +Exception: Class TestClass missing +===DONE=== diff --git a/ext/standard/tests/serialize/005.phpt b/ext/standard/tests/serialize/005.phpt new file mode 100755 index 0000000000..d67f6fbf70 --- /dev/null +++ b/ext/standard/tests/serialize/005.phpt @@ -0,0 +1,186 @@ +--TEST-- +serialize()/unserialize() objects +--SKIPIF-- + +--FILE-- + +===DONE=== + +--EXPECTF-- +===O1=== +TestOld::__sleep() +string(18) "O:7:"TestOld":0:{}" +TestOld::__wakeup() +object(TestOld)#%d (0) { +} +===N1=== +TestNew::serialize() +string(2) "N;" +NULL +===N2=== +TestNew::serialize() +string(19) "C:7:"TestNew":1:{2}" +TestNew::unserialize() +object(TestNew)#%d (0) { +} +===NAOld=== +unserializer(TestNAOld) +TestOld::__wakeup() +object(TestNAOld)#%d (0) { +} +===NANew=== +unserializer(TestNANew) +TestNew::__wakeup() +object(TestNANew)#%d (0) { +} +===NANew2=== +unserializer(TestNANew2) +TestNew::unserialize() +object(TestNANew2)#%d (0) { +} +===AutoOld=== +unserializer(autoload_implements) +Try __autoload() +do_autoload(autoload_interface) +do_autoload(autoload_implements) +object(autoload_implements)#%d (0) { +} +===AutoNA=== +do_autoload(autoload_not_available) +unserializer(autoload_not_available) +Try __autoload() +do_autoload(autoload_not_available) +do_autoload(autoload_not_available) + +Warning: unserialize(): Function unserializer() hasn't defined the class it was called for in %s005.php on line %d +object(__PHP_Incomplete_Class)#1 (1) { + ["__PHP_Incomplete_Class_Name"]=> + string(22) "autoload_not_available" +} +===DONE=== -- 2.50.1