]> granicus.if.org Git - php/commitdiff
fix tests, add more
authorAntony Dovgal <tony2001@php.net>
Sat, 5 May 2007 21:44:52 +0000 (21:44 +0000)
committerAntony Dovgal <tony2001@php.net>
Sat, 5 May 2007 21:44:52 +0000 (21:44 +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 36aaa55a39354d94e347b2218792483c035d4d2c..1d42c637d6cfbe2bc477a3ae356cd16a59b93d0b 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 7a5246e686ab4f1234edb3c7bbfe49cf1397a4a9..5e5009c323d3cd53b30b422bb9eeb73937ea1563 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 0210e2937299371e6d321497dc17ca62c9c1300b..9327ee58bc6245bd22eddb4e07a8b0e15a0e4e1a 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 50c553f3017e1380723455129ff880b0fb4db9e3..69131cd5cd7568c80a00be551ce2d4bd6e7adf9c 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 c7c9d384505f30022e95941507fe249f0b76592f..4f5cd80b542afaf895f84e038a12954138f618ad 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 b44258ffd6c6d53a2a96ef7af5fcfea9dd1c2597..743983b97fa98d415148757760ebb082ef3d56a4 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..8f6572e
--- /dev/null
@@ -0,0 +1,20 @@
+--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!"
diff --git a/Zend/tests/exception_handler_002.phpt b/Zend/tests/exception_handler_002.phpt
new file mode 100644 (file)
index 0000000..3e0e4f0
--- /dev/null
@@ -0,0 +1,23 @@
+--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
diff --git a/Zend/tests/exception_handler_003.phpt b/Zend/tests/exception_handler_003.phpt
new file mode 100644 (file)
index 0000000..137a6ca
--- /dev/null
@@ -0,0 +1,24 @@
+--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!"
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..cc99bc6
--- /dev/null
@@ -0,0 +1,23 @@
+--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!"
diff --git a/Zend/tests/exception_handler_006.phpt b/Zend/tests/exception_handler_006.phpt
new file mode 100644 (file)
index 0000000..05a5d92
--- /dev/null
@@ -0,0 +1,25 @@
+--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!"