Created
March 10, 2010 22:49
-
-
Save olleolleolle/328553 to your computer and use it in GitHub Desktop.
(it does not yet run right...) PHPT test file for gettext functionality, see bug http://bugs.php.net/bug.php?id=49349 and http://qa.php.net/write-test.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --TEST-- | |
| #49349: gettext behaves differently in php 5.3.0 (5.2.x ignored setlocale errors) | |
| --SKIPIF-- | |
| <?php | |
| if (!extension_loaded("gettext")) { | |
| die("skip\n"); | |
| } | |
| --FILE-- | |
| <?php | |
| $lang = 'en'; //"fi" or "en" | |
| putenv("LANG=$lang"); | |
| putenv("LC_ALL=$lang"); | |
| $tradFile = 'messages'; | |
| bindtextdomain($tradFile, 'locale/'); // We should use the existing en and fi files only! | |
| bind_textdomain_codeset($tradFile,'UTF-8'); | |
| textdomain($tradFile); | |
| echo _('Basic test'); | |
| ?> | |
| ==DONE== | |
| <?php exit(0); ?> | |
| --EXPECTF-- | |
| Perustesti | |
| ==DONE== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment