]> granicus.if.org Git - php/commitdiff
fix tests, add more
authorAntony Dovgal <tony2001@php.net>
Sat, 5 May 2007 21:43:41 +0000 (21:43 +0000)
committerAntony Dovgal <tony2001@php.net>
Sat, 5 May 2007 21:43:41 +0000 (21:43 +0000)
13 files changed:
Zend/tests/compare_001.phpt
Zend/tests/compare_002.phpt
Zend/tests/compare_003.phpt
Zend/tests/compare_004.phpt
Zend/tests/compare_005.phpt
Zend/tests/compare_006.phpt
Zend/tests/decrement_001.phpt
Zend/tests/exception_handler_001.phpt [new file with mode: 0644]
Zend/tests/exception_handler_002.phpt [new file with mode: 0644]
Zend/tests/exception_handler_003.phpt [new file with mode: 0644]
Zend/tests/exception_handler_004.phpt [new file with mode: 0644]
Zend/tests/exception_handler_005.phpt [new file with mode: 0644]
Zend/tests/exception_handler_006.phpt [new file with mode: 0644]

index 1ab64f0a1001476ede2455582414281bdcc564b8..059ed4a46517f2ceefd4116bc9bb946bd75dc4ed 100644 (file)
@@ -1,5 +1,7 @@
 --TEST--
 comparing different variables for equality
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
 --FILE--
 <?php
 
index de7e06a2e70b2423909a4749a21b9060bc72dba4..889f700c4904a2191c4bd697451026fcd88c29ba 100644 (file)
@@ -1,5 +1,7 @@
 --TEST--
 comparing different variables for identity
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
 --FILE--
 <?php
 
index 9889181b8c90d119858ced4d264586d7b357661b..6bd4f5d8bd55bd55ce96689f69f6fcbb5fea84a9 100644 (file)
@@ -1,5 +1,7 @@
 --TEST--
 comparing different variables (greater than)
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
 --FILE--
 <?php
 
index eb4193744559e3e5b9d4564bef7f2b64b9e6d35d..bcf80653bb40a5e41e48dd47679356040847a486 100644 (file)
@@ -1,5 +1,7 @@
 --TEST--
 comparing different variables (less than)
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
 --FILE--
 <?php
 
index 4001444b7666bb9892b09d10f2bb81ce6751eb49..1fa6749e476c2983110fd85ba224787f52982a11 100644 (file)
@@ -1,5 +1,7 @@
 --TEST--
 comparing different variables (greater or equal than)
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
 --FILE--
 <?php
 
index f8be0f92bdf4145d8198e11e389561f6b094fce3..7107fd8bc00d4564abc870a417660783988b7660 100644 (file)
@@ -1,5 +1,7 @@
 --TEST--
 comparing different variables (smaller or equal than)
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
 --FILE--
 <?php
 
index 558f92eecd724d30ea2e5ac8f6ac3a2559824ed4..027e68f2b661b2ef53df3cde601039166a790f1b 100644 (file)
@@ -1,5 +1,7 @@
 --TEST--
 decrementing different variables
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
 --FILE--
 <?php
 
diff --git a/Zend/tests/exception_handler_001.phpt b/Zend/tests/exception_handler_001.phpt
new file mode 100644 (file)
index 0000000..085abb0
--- /dev/null
@@ -0,0 +1,22 @@
+--TEST--
+exception handler tests - 1
+--FILE--
+<?php
+
+set_exception_handler("foo");
+
+function foo($e) {
+       var_dump(get_class($e)." thrown!");
+}
+
+class test extends Exception {
+}
+
+throw new test();
+
+echo "Done\n";
+?>
+--EXPECTF--    
+string(12) "test thrown!"
+--UEXPECTF--
+unicode(12) "test thrown!"
diff --git a/Zend/tests/exception_handler_002.phpt b/Zend/tests/exception_handler_002.phpt
new file mode 100644 (file)
index 0000000..6003efe
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+exception handler tests - 2
+--FILE--
+<?php
+
+set_exception_handler("foo");
+
+function foo($e) {
+       var_dump(get_class($e)." thrown!");
+       throw new Exception();
+}
+
+class test extends Exception {
+}
+
+throw new test();
+
+echo "Done\n";
+?>
+--EXPECTF--    
+string(12) "test thrown!"
+
+Fatal error: Exception thrown without a stack frame in Unknown on line 0
+--UEXPECTF--
+unicode(12) "test thrown!"
+
+Fatal error: Exception thrown without a stack frame in Unknown on line 0
diff --git a/Zend/tests/exception_handler_003.phpt b/Zend/tests/exception_handler_003.phpt
new file mode 100644 (file)
index 0000000..b980b9c
--- /dev/null
@@ -0,0 +1,26 @@
+--TEST--
+exception handler tests - 3
+--FILE--
+<?php
+
+class test {
+
+       function foo () {
+               set_exception_handler(array($this, "bar"));
+       }
+
+       function bar($e) {
+               var_dump(get_class($e)." thrown!");
+       }
+}
+
+$a = new test;
+$a->foo();
+throw new Exception();
+
+echo "Done\n";
+?>
+--EXPECTF--    
+string(17) "Exception thrown!"
+--UEXPECTF--
+unicode(17) "Exception thrown!"
diff --git a/Zend/tests/exception_handler_004.phpt b/Zend/tests/exception_handler_004.phpt
new file mode 100644 (file)
index 0000000..2f36781
--- /dev/null
@@ -0,0 +1,21 @@
+--TEST--
+exception handler tests - 4
+--FILE--
+<?php
+
+set_exception_handler("fo");
+set_exception_handler(array("", ""));
+set_exception_handler();
+set_exception_handler("foo", "bar");
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Warning: set_exception_handler() expects the argument (fo) to be a valid callback in %s on line %d
+
+Warning: set_exception_handler() expects the argument (::) to be a valid callback in %s on line %d
+
+Warning: Wrong parameter count for set_exception_handler() in %s on line %d
+
+Warning: Wrong parameter count for set_exception_handler() in %s on line %d
+Done
diff --git a/Zend/tests/exception_handler_005.phpt b/Zend/tests/exception_handler_005.phpt
new file mode 100644 (file)
index 0000000..11ac0ba
--- /dev/null
@@ -0,0 +1,25 @@
+--TEST--
+exception handler tests - 5
+--FILE--
+<?php
+
+set_exception_handler("foo");
+set_exception_handler("foo1");
+
+function foo($e) {
+       var_dump(__FUNCTION__."(): ".get_class($e)." thrown!");
+}
+
+function foo1($e) {
+       var_dump(__FUNCTION__."(): ".get_class($e)." thrown!");
+}
+
+
+throw new excEption();
+
+echo "Done\n";
+?>
+--EXPECTF--    
+string(25) "foo1(): Exception thrown!"
+--UEXPECTF--
+unicode(25) "foo1(): Exception thrown!"
diff --git a/Zend/tests/exception_handler_006.phpt b/Zend/tests/exception_handler_006.phpt
new file mode 100644 (file)
index 0000000..63b4eff
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+exception handler tests - 6
+--FILE--
+<?php
+
+set_exception_handler("foo");
+set_exception_handler("foo1");
+
+restore_exception_handler();
+
+function foo($e) {
+       var_dump(__FUNCTION__."(): ".get_class($e)." thrown!");
+}
+
+function foo1($e) {
+       var_dump(__FUNCTION__."(): ".get_class($e)." thrown!");
+}
+
+
+throw new excEption();
+
+echo "Done\n";
+?>
+--EXPECTF--    
+string(24) "foo(): Exception thrown!"
+--UEXPECTF--
+unicode(24) "foo(): Exception thrown!"