gettext_bindtextdomain-cwd.phpt 740 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Test if bindtextdomain() returns string id if no directory path is set(if directory path is 'null')
  3. --EXTENSIONS--
  4. gettext
  5. --SKIPIF--
  6. <?php
  7. if (!setlocale(LC_ALL, 'en_US.UTF-8')) {
  8. die("skip en_US.UTF-8 locale not supported.");
  9. }
  10. if (getenv('SKIP_REPEAT')) {
  11. die('skip gettext leaks global state across requests');
  12. }
  13. ?>
  14. --FILE--
  15. <?php
  16. $base_dir = __DIR__;
  17. chdir($base_dir);
  18. putenv('LC_ALL=en_US.UTF-8');
  19. setlocale(LC_ALL, 'en_US.UTF-8');
  20. bindtextdomain('messages',null);
  21. var_dump(gettext('Basic test'));
  22. bindtextdomain('messages', './locale');
  23. var_dump(gettext('Basic test'));
  24. ?>
  25. --EXPECT--
  26. string(10) "Basic test"
  27. string(12) "A basic test"
  28. --CREDITS--
  29. Moritz Neuhaeuser, info@xcompile.net
  30. PHP Testfest Berlin 2009-05-09