Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions ext/gettext/tests/44938.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,107 +12,107 @@ $category = "cat";
try {
bindtextdomain($overflown, 'path');
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
dngettext($overflown, $msgid, $msgid, 1);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
dngettext($domain, $overflown, $msgid, 1);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
dngettext($domain, $msgid, $overflown, 1);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
gettext($overflown);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
ngettext($overflown, $msgid, -1);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
ngettext($msgid, $overflown, -1);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
dcgettext($overflown, $msgid, -1);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
dcgettext($domain, $overflown, -1);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
dcngettext($overflown, $msgid, $msgid, -1, -1);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
dcngettext($domain, $overflown, $msgid, -1, -1);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
dcngettext($domain, $msgid, $overflown, -1, -1);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
dgettext($overflown, $msgid);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
dgettext($domain, $overflown);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
textdomain($overflown);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

?>
--EXPECT--
bindtextdomain(): Argument #1 ($domain) is too long
dngettext(): Argument #1 ($domain) is too long
dngettext(): Argument #2 ($singular) is too long
dngettext(): Argument #3 ($plural) is too long
gettext(): Argument #1 ($message) is too long
ngettext(): Argument #1 ($singular) is too long
ngettext(): Argument #2 ($plural) is too long
dcgettext(): Argument #1 ($domain) is too long
dcgettext(): Argument #2 ($message) is too long
dcngettext(): Argument #1 ($domain) is too long
dcngettext(): Argument #2 ($singular) is too long
dcngettext(): Argument #3 ($plural) is too long
dgettext(): Argument #1 ($domain) is too long
dgettext(): Argument #2 ($message) is too long
textdomain(): Argument #1 ($domain) is too long
ValueError: bindtextdomain(): Argument #1 ($domain) is too long
ValueError: dngettext(): Argument #1 ($domain) is too long
ValueError: dngettext(): Argument #2 ($singular) is too long
ValueError: dngettext(): Argument #3 ($plural) is too long
ValueError: gettext(): Argument #1 ($message) is too long
ValueError: ngettext(): Argument #1 ($singular) is too long
ValueError: ngettext(): Argument #2 ($plural) is too long
ValueError: dcgettext(): Argument #1 ($domain) is too long
ValueError: dcgettext(): Argument #2 ($message) is too long
ValueError: dcngettext(): Argument #1 ($domain) is too long
ValueError: dcngettext(): Argument #2 ($singular) is too long
ValueError: dcngettext(): Argument #3 ($plural) is too long
ValueError: dgettext(): Argument #1 ($domain) is too long
ValueError: dgettext(): Argument #2 ($message) is too long
ValueError: textdomain(): Argument #1 ($domain) is too long
8 changes: 4 additions & 4 deletions ext/gettext/tests/dcgettext_lcall.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ gettext
try {
dcgettext('dngettextTest', 'item', LC_ALL);
} catch (ValueError $e) {
echo $e->getMessage() . PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

try {
dcngettext('dngettextTest', 'item', 'item2', 1, LC_ALL);
} catch (ValueError $e) {
echo $e->getMessage();
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
dcgettext(): Argument #3 ($category) cannot be LC_ALL
dcngettext(): Argument #5 ($category) cannot be LC_ALL
ValueError: dcgettext(): Argument #3 ($category) cannot be LC_ALL
ValueError: dcngettext(): Argument #5 ($category) cannot be LC_ALL
8 changes: 4 additions & 4 deletions ext/gettext/tests/dcngettext.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ var_dump(dcngettext("test","test","test",-1,-1));
try {
dcngettext("","","",1,1);
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

try {
dcngettext("","","",0,1);
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

echo "Done\n";
Expand All @@ -33,6 +33,6 @@ string(1) "1"
string(4) "test"
string(4) "test"
string(4) "test"
dcngettext(): Argument #1 ($domain) must not be empty
dcngettext(): Argument #1 ($domain) must not be empty
ValueError: dcngettext(): Argument #1 ($domain) must not be empty
ValueError: dcngettext(): Argument #1 ($domain) must not be empty
Done
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ gettext
try {
bind_textdomain_codeset(false,false);
} catch (ValueError $e) {
echo $e->getMessage() . PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

try {
bind_textdomain_codeset("", "UTF-8");
} catch (ValueError $e) {
echo $e->getMessage() . PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

// bind_textdomain_codeset() always returns false on musl
Expand All @@ -28,8 +28,8 @@ gettext
echo "Done\n";
?>
--EXPECT--
bind_textdomain_codeset(): Argument #1 ($domain) must not be empty
bind_textdomain_codeset(): Argument #1 ($domain) must not be empty
ValueError: bind_textdomain_codeset(): Argument #1 ($domain) must not be empty
ValueError: bind_textdomain_codeset(): Argument #1 ($domain) must not be empty
bool(true)
Done
--CREDITS--
Expand Down
4 changes: 2 additions & 2 deletions ext/gettext/tests/gettext_bindtextdomain-emptydomain.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ chdir(__DIR__);
try {
bindtextdomain('', 'foobar');
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

?>
--EXPECT--
bindtextdomain(): Argument #1 ($domain) must not be empty
ValueError: bindtextdomain(): Argument #1 ($domain) must not be empty
--CREDITS--
Till Klampaeckel, till@php.net
PHP Testfest Berlin 2009-05-09
8 changes: 4 additions & 4 deletions ext/gettext/tests/gettext_textdomain-retval.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ echo textdomain('foo'), "\n";
try {
textdomain('0');
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

try {
textdomain('');
} catch (\ValueError $e) {
echo $e->getMessage();
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
test
test
foo
textdomain(): Argument #1 ($domain) cannot be zero
textdomain(): Argument #1 ($domain) must not be empty
ValueError: textdomain(): Argument #1 ($domain) cannot be zero
ValueError: textdomain(): Argument #1 ($domain) must not be empty
--CREDITS--
Christian Weiske, cweiske@php.net
PHP Testfest Berlin 2009-05-09
4 changes: 2 additions & 2 deletions ext/gettext/tests/gh17400.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ $utf16le_char_bad = pack("H*", "00dc00dc");
try {
bindtextdomain($utf16le_char_bad,$utf16_first_le);
} catch (\ValueError $e) {
echo $e->getMessage();
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
bindtextdomain(): Argument #1 ($domain) must not contain any null bytes
ValueError: bindtextdomain(): Argument #1 ($domain) must not contain any null bytes
Loading