timezone_hasSameRules_error.phpt 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. IntlTimeZone::hasSameRules(): errors
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded('intl'))
  6. die('skip intl extension not enabled');
  7. --FILE--
  8. <?php
  9. ini_set("intl.error_level", E_WARNING);
  10. function error_handler($errno, $errstr, $errfile, $errline)
  11. {
  12. var_dump($errno, $errstr);
  13. return true;
  14. }
  15. set_error_handler("error_handler");
  16. $tz = IntlTimeZone::createTimeZone('Europe/Lisbon');
  17. var_dump($tz->hasSameRules('foo'));
  18. var_dump(intltz_has_same_rules(null, $tz));
  19. --EXPECT--
  20. int(4096)
  21. string(99) "Argument 1 passed to IntlTimeZone::hasSameRules() must be an instance of IntlTimeZone, string given"
  22. int(2)
  23. string(81) "IntlTimeZone::hasSameRules() expects parameter 1 to be IntlTimeZone, string given"
  24. int(2)
  25. string(66) "IntlTimeZone::hasSameRules(): intltz_has_same_rules: bad arguments"
  26. bool(false)
  27. int(4096)
  28. string(92) "Argument 1 passed to intltz_has_same_rules() must be an instance of IntlTimeZone, null given"
  29. int(2)
  30. string(74) "intltz_has_same_rules() expects parameter 1 to be IntlTimeZone, null given"
  31. int(2)
  32. string(61) "intltz_has_same_rules(): intltz_has_same_rules: bad arguments"
  33. bool(false)