timezone_hasSameRules_basic.phpt 839 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. IntlTimeZone::hasSameRules(): basic test
  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. $lsb = IntlTimeZone::createTimeZone('Europe/Lisbon');
  11. $prt = IntlTimeZone::createTimeZone('Portugal');
  12. $azo = IntlTimeZone::createTimeZone('Atlantic/Azores');
  13. echo "Europe/Lisbon has same rules as itself:\n";
  14. var_dump($lsb->hasSameRules($lsb));
  15. echo "\nEurope/Lisbon has same rules as Portugal:\n";
  16. var_dump($lsb->hasSameRules($prt));
  17. echo "\nEurope/Lisbon has same rules as Atlantic/Azores:\n";
  18. var_dump(intltz_has_same_rules($lsb, $azo));
  19. ?>
  20. ==DONE==
  21. --EXPECT--
  22. Europe/Lisbon has same rules as itself:
  23. bool(true)
  24. Europe/Lisbon has same rules as Portugal:
  25. bool(true)
  26. Europe/Lisbon has same rules as Atlantic/Azores:
  27. bool(false)
  28. ==DONE==