gettext_textdomain-retval.phpt 510 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Check if textdomain() returns the new domain
  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. ?>
  11. --FILE--
  12. <?php
  13. chdir(__DIR__);
  14. setlocale(LC_ALL, 'en_US.UTF-8');
  15. bindtextdomain ("messages", "./locale");
  16. echo textdomain('test'), "\n";
  17. echo textdomain(null), "\n";
  18. echo textdomain('foo'), "\n";
  19. ?>
  20. --EXPECT--
  21. test
  22. test
  23. foo
  24. --CREDITS--
  25. Christian Weiske, cweiske@php.net
  26. PHP Testfest Berlin 2009-05-09