DateTimeZone_getName_error.phpt 898 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. Test DateTimeZone::getName() function : error conditions
  3. --FILE--
  4. <?php
  5. /* Prototype : public string DateTimeZone::getName ( void )
  6. * Description: Returns the name of the timezone
  7. * Source code: ext/date/php_date.c
  8. * Alias to functions: timezone_name_get()
  9. */
  10. //Set the default time zone
  11. date_default_timezone_set("GMT");
  12. $tz = new DateTimeZone("Europe/London");
  13. echo "*** Testing DateTimeZone::getName() : error conditions ***\n";
  14. echo "\n-- Testing DateTimeZone::getName() function with more than expected no. of arguments --\n";
  15. $extra_arg = 99;
  16. var_dump( $tz->getName($extra_arg) );
  17. ?>
  18. ===DONE===
  19. --EXPECTF--
  20. *** Testing DateTimeZone::getName() : error conditions ***
  21. -- Testing DateTimeZone::getName() function with more than expected no. of arguments --
  22. Warning: DateTimeZone::getName() expects exactly 0 parameters, 1 given in %s on line %d
  23. bool(false)
  24. ===DONE===