assert04.phpt 1020 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. /* Wrong parameter count in assert */
  15. assert_options(ASSERT_ACTIVE, 1);
  16. assert(2, "failure", 3);
  17. /* Wrong parameter count in assert_options */
  18. assert_options(ASSERT_ACTIVE, 0, 2);
  19. /* Wrong parameter name in assert_options */
  20. $test="ASSERT_FRED";
  21. assert_options($test, 1);
  22. /* Assert false */
  23. assert(0);
  24. /* Assert false and bail*/
  25. assert_options(ASSERT_BAIL, 1);
  26. assert(0);
  27. echo "not reached\n";
  28. ?>
  29. --EXPECTF--
  30. Warning: assert() expects at most 2 parameters, 3 given in %s on line %d
  31. Warning: assert_options() expects at most 2 parameters, 3 given in %s on line %d
  32. Warning: assert_options() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
  33. Warning: assert(): Assertion failed in %s on line %d
  34. Warning: assert(): Assertion failed in %s on line %d