Return to assert04.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / assert |
1.1 misho 1: --TEST-- 2: misc assert() tests tests 3: --INI-- 4: assert.active = 1 5: assert.warning = 1 6: assert.callback = 7: assert.bail = 0 8: assert.quiet_eval = 0 9: --FILE-- 10: <?php 11: /* Assert not active */ 12: assert_options(ASSERT_ACTIVE, 0); 13: assert(1); 14: 15: 16: /* Wrong parameter count in assert */ 17: assert_options(ASSERT_ACTIVE, 1); 1.1.1.2 ! misho 18: assert(2, "failure", 3); 1.1 misho 19: 20: /* Wrong parameter count in assert_options */ 21: assert_options(ASSERT_ACTIVE, 0, 2); 22: 23: /* Wrong parameter name in assert_options */ 24: $test="ASSERT_FRED"; 25: assert_options($test, 1); 26: 27: /* Assert false */ 28: assert(0); 29: 30: 31: /* Assert false and bail*/ 32: assert_options(ASSERT_BAIL, 1); 33: assert(0); 34: 35: echo "not reached\n"; 36: 37: ?> 38: --EXPECTF-- 1.1.1.2 ! misho 39: Warning: assert() expects at most 2 parameters, 3 given in %s on line %d 1.1 misho 40: 41: Warning: assert_options() expects at most 2 parameters, 3 given in %s on line %d 42: 43: Warning: assert_options() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d 44: 45: Warning: assert(): Assertion failed in %s on line %d 46: 47: Warning: assert(): Assertion failed in %s on line %d 1.1.1.2 ! misho 48: