Download src/php/php-src/ext/gettext/tests/gettext_textdomain-retval.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 780 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/gettext/tests/gettext_textdomain-retval.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/gettext/tests/gettext_textdomain-retval.phpt
-
curl -L -o gettext_textdomain-retval.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/gettext/tests/gettext_textdomain-retval.phpt
780 Bytes
| --TEST-- | |
| Check if textdomain() returns the new domain | |
| --EXTENSIONS-- | |
| gettext | |
| --SKIPIF-- | |
| if (!setlocale(LC_ALL, 'en_US.UTF-8')) { | |
| die("skip en_US.UTF-8 locale not supported."); | |
| } | |
| --FILE-- | |
| chdir(__DIR__); | |
| setlocale(LC_ALL, 'en_US.UTF-8'); | |
| bindtextdomain ("messages", "./locale"); | |
| echo textdomain('test'), "\n"; | |
| echo textdomain(null), "\n"; | |
| echo textdomain('foo'), "\n"; | |
| try { | |
| textdomain('0'); | |
| } catch (\ValueError $e) { | |
| echo $e->getMessage() . PHP_EOL; | |
| } | |
| try { | |
| textdomain(''); | |
| } catch (\ValueError $e) { | |
| echo $e->getMessage(); | |
| } | |
| --EXPECT-- | |
| test | |
| test | |
| foo | |
| textdomain(): Argument #1 ($domain) cannot be zero | |
| textdomain(): Argument #1 ($domain) must not be empty | |
| --CREDITS-- | |
| Christian Weiske, cweiske@php.net | |
| PHP Testfest Berlin 2009-05-09 | |