mirror of
https://github.com/php/php-src.git
synced 2024-10-04 00:06:16 +00:00
33 lines
760 B
Plaintext
33 lines
760 B
Plaintext
|
--TEST--
|
||
|
Check if textdomain() returns the new domain
|
||
|
--SKIPIF--
|
||
|
<?php
|
||
|
if (!extension_loaded("gettext")) {
|
||
|
die("skip\n");
|
||
|
}
|
||
|
if (!setlocale(LC_ALL, 'en_US.UTF-8')) {
|
||
|
die("skip en_US.UTF-8 locale not supported.");
|
||
|
}
|
||
|
?>
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
// Using deprectated setlocale() in PHP6. The test needs to be changed
|
||
|
// when there is an alternative available.
|
||
|
|
||
|
chdir(dirname(__FILE__));
|
||
|
setlocale(LC_ALL, 'en_US.UTF-8');
|
||
|
bindtextdomain ("messages", "./locale");
|
||
|
echo textdomain('test'), "\n";
|
||
|
echo textdomain(null), "\n";
|
||
|
echo textdomain('foo'), "\n";
|
||
|
?>
|
||
|
--EXPECTF--
|
||
|
Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s.php on line %d
|
||
|
test
|
||
|
test
|
||
|
foo
|
||
|
--CREDITS--
|
||
|
Christian Weiske, cweiske@php.net
|
||
|
PHP Testfest Berlin 2009-05-09
|