timezone_open_error.phpt 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. Test timezone_open() function : error conditions
  3. --FILE--
  4. <?php
  5. /* Prototype : DateTimeZone timezone_open ( string $timezone )
  6. * Description: Returns new DateTimeZone object
  7. * Source code: ext/date/php_date.c
  8. * Alias to functions: DateTime::__construct()
  9. */
  10. echo "*** Testing timezone_open() : error conditions ***\n";
  11. echo "\n-- Testing timezone_open() function with zero arguments --\n";
  12. var_dump( timezone_open() );
  13. echo "\n-- Testing timezone_open() function with more than expected no. of arguments --\n";
  14. $time = "GMT";
  15. $extra_arg = 99;
  16. var_dump( timezone_open($time, $extra_arg) );
  17. ?>
  18. ===DONE===
  19. --EXPECTF--
  20. *** Testing timezone_open() : error conditions ***
  21. -- Testing timezone_open() function with zero arguments --
  22. Warning: timezone_open() expects exactly 1 parameter, 0 given in %s on line %d
  23. bool(false)
  24. -- Testing timezone_open() function with more than expected no. of arguments --
  25. Warning: timezone_open() expects exactly 1 parameter, 2 given in %s on line %d
  26. bool(false)
  27. ===DONE===