Return to assert.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / assert |
1.1 misho 1: --TEST-- 2: assert() 3: --INI-- 4: error_reporting = 2039 5: assert.active = 0 6: assert.warning = 1 7: assert.callback = 8: assert.bail = 0 9: assert.quiet_eval = 0 10: --FILE-- 11: <?php 12: function a($file,$line,$myev) 13: { 14: echo "assertion failed $line,\"$myev\"\n"; 15: } 16: 17: class a 18: { 19: function assert($file,$line,$myev) 20: { 21: echo "class assertion failed $line,\"$myev\"\n"; 22: } 23: } 24: 25: assert_options(ASSERT_ACTIVE,1); 26: assert_options(ASSERT_QUIET_EVAL,1); 27: assert_options(ASSERT_WARNING,0); 28: 29: $a = 0; 30: 31: assert_options(ASSERT_CALLBACK,"a"); 32: assert('$a != 0'); 33: 34: assert_options(ASSERT_CALLBACK,array("a","assert")); 35: assert('$a != 0'); 36: 37: $obj = new a(); 38: assert_options(ASSERT_CALLBACK,array(&$obj,"assert")); 39: assert('$a != 0'); 40: ?> 41: --EXPECT-- 42: assertion failed 22,"$a != 0" 43: class assertion failed 25,"$a != 0" 44: class assertion failed 29,"$a != 0"