dis-bench / src /php /php-src /ext /gettext /tests /gettext_ngettext.phpt
meddyrat's picture
Replace repository contents with the original corrected artifact
1e94262
Raw History Blame Contribute Delete
574 Bytes
--TEST--
Test ngettext() functionality
--EXTENSIONS--
gettext
--SKIPIF--
<?php
if (!setlocale(LC_ALL, 'en_US.UTF-8')) {
die("SKIP en_US.UTF-8 locale not supported.");
}
?>
--FILE--
<?php
chdir(__DIR__);
putenv('LC_ALL=en_US.UTF-8');
setlocale(LC_ALL, 'en_US.UTF-8');
bindtextdomain('dngettextTest', './locale');
textdomain('dngettextTest');
var_dump(ngettext('item', 'items', 1));
var_dump(ngettext('item', 'items', 2));
?>
--EXPECT--
string(7) "Produkt"
string(8) "Produkte"
--CREDITS--
Christian Weiske, cweiske@php.net
PHP Testfest Berlin 2009-05-09