ErrorException_construct.phpt 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. --TEST--
  2. Test default value handling of ErrorException::__construct()
  3. --FILE--
  4. <?php
  5. $e = new ErrorException();
  6. var_dump($e->getMessage());
  7. var_dump($e->getFile());
  8. var_dump($e->getLine());
  9. $e = new ErrorException("Second", 0, E_ERROR, null);
  10. var_dump($e->getMessage());
  11. var_dump($e->getFile());
  12. var_dump($e->getLine());
  13. $e = new ErrorException("Third", 0, E_ERROR, null, null);
  14. var_dump($e->getMessage());
  15. var_dump($e->getFile());
  16. var_dump($e->getLine());
  17. $e = new ErrorException("Forth", 0, E_ERROR, null, 123);
  18. var_dump($e->getMessage());
  19. var_dump($e->getFile());
  20. var_dump($e->getLine());
  21. $e = new ErrorException("Fifth", 0, E_ERROR, "abc.php");
  22. var_dump($e->getMessage());
  23. var_dump($e->getFile());
  24. var_dump($e->getLine());
  25. $e = new ErrorException("Sixth", 0, E_ERROR, "abc.php", null);
  26. var_dump($e->getMessage());
  27. var_dump($e->getFile());
  28. var_dump($e->getLine());
  29. $e = new ErrorException("Seventh", 0, E_ERROR, "abc.php", 123);
  30. var_dump($e->getMessage());
  31. var_dump($e->getFile());
  32. var_dump($e->getLine());
  33. ?>
  34. --EXPECTF--
  35. string(0) ""
  36. string(%d) "%sErrorException_construct.php"
  37. int(3)
  38. string(6) "Second"
  39. string(%d) "%sErrorException_construct.php"
  40. int(8)
  41. string(5) "Third"
  42. string(%d) "%sErrorException_construct.php"
  43. int(13)
  44. string(5) "Forth"
  45. string(%d) "%sErrorException_construct.php"
  46. int(123)
  47. string(5) "Fifth"
  48. string(7) "abc.php"
  49. int(0)
  50. string(5) "Sixth"
  51. string(7) "abc.php"
  52. int(0)
  53. string(7) "Seventh"
  54. string(7) "abc.php"
  55. int(123)