assert_custom_exception.phpt 370 B

123456789101112131415
  1. --TEST--
  2. Throwing custom exception object from assert() throws given object
  3. --INI--
  4. zend.assertions = 1
  5. assert.exception = 1
  6. --FILE--
  7. <?php
  8. class CustomException extends Exception {}
  9. assert(false, new CustomException('Exception message'));
  10. ?>
  11. --EXPECTF--
  12. Fatal error: Uncaught CustomException: Exception message in %s:%d
  13. Stack trace:
  14. #0 {main}
  15. thrown in %s on line %d