From fe6e83b3aa4597d3689d0b146f9c8542258f9c7f Mon Sep 17 00:00:00 2001 From: Zoe Slattery Date: Thu, 18 Jun 2009 07:25:55 +0000 Subject: [PATCH] Tests from Berlin test fest --- ext/gettext/tests/gettext_basic-enus.phpt | 32 ++++++++++++++ ...ettext_bind_textdomain_codeset-retval.phpt | 22 ++++++++++ ...t_bind_textdomain_codeset-wrongparams.phpt | 23 +++++++++++ .../tests/gettext_bindtextdomain-cwd.phpt | 32 ++++++++++++++ .../gettext_bindtextdomain-emptydomain.phpt | 18 ++++++++ .../tests/gettext_bindtextdomain-path.phpt | 19 +++++++++ .../gettext_bindtextdomain-wrongparams.phpt | 21 ++++++++++ .../tests/gettext_dcgettext-wrongparams.phpt | 16 +++++++ ext/gettext/tests/gettext_dcgettext.phpt | 32 ++++++++++++++ ext/gettext/tests/gettext_dgettext.phpt | 37 +++++++++++++++++ .../gettext_dgettext_error_wrongparams.phpt | 39 ++++++++++++++++++ .../tests/gettext_dngettext-plural.phpt | 29 +++++++++++++ .../tests/gettext_dngettext-wrongparams.phpt | 29 +++++++++++++ .../gettext_gettext_error_wrongparams.phpt | 17 ++++++++ .../tests/gettext_ngettext-wrongparams.phpt | 32 ++++++++++++++ ext/gettext/tests/gettext_ngettext.phpt | 31 ++++++++++++++ ext/gettext/tests/gettext_phpinfo.phpt | 19 +++++++++ .../tests/gettext_textdomain-retval.phpt | 32 ++++++++++++++ .../tests/gettext_textdomain-wrongparams.phpt | 30 ++++++++++++++ .../tests/locale/en/LC_CTYPE/dgettextTest.mo | Bin 0 -> 84 bytes .../tests/locale/en/LC_CTYPE/dgettextTest.po | 4 ++ .../locale/en/LC_CTYPE/dgettextTest_switch.mo | Bin 0 -> 102 bytes .../locale/en/LC_CTYPE/dgettextTest_switch.po | 4 ++ .../en/LC_CTYPE/dgettextTest_switched.po | 2 + .../tests/locale/en/LC_CTYPE/dngettextTest.mo | Bin 0 -> 86 bytes .../tests/locale/en/LC_CTYPE/dngettextTest.po | 4 ++ .../locale/en/LC_MESSAGES/dgettextTest.mo | Bin 0 -> 84 bytes .../locale/en/LC_MESSAGES/dgettextTest.po | 4 ++ .../en/LC_MESSAGES/dgettextTest_switch.mo | Bin 0 -> 102 bytes .../en/LC_MESSAGES/dgettextTest_switch.po | 4 ++ .../locale/en/LC_MESSAGES/dngettextTest.mo | Bin 0 -> 84 bytes .../locale/en/LC_MESSAGES/dngettextTest.po | 4 ++ .../tests/locale/en/LC_MESSAGES/messages.mo | Bin 0 -> 201 bytes .../tests/locale/en/LC_MESSAGES/messages.po | 15 +++++++ 34 files changed, 551 insertions(+) create mode 100644 ext/gettext/tests/gettext_basic-enus.phpt create mode 100644 ext/gettext/tests/gettext_bind_textdomain_codeset-retval.phpt create mode 100644 ext/gettext/tests/gettext_bind_textdomain_codeset-wrongparams.phpt create mode 100644 ext/gettext/tests/gettext_bindtextdomain-cwd.phpt create mode 100644 ext/gettext/tests/gettext_bindtextdomain-emptydomain.phpt create mode 100644 ext/gettext/tests/gettext_bindtextdomain-path.phpt create mode 100644 ext/gettext/tests/gettext_bindtextdomain-wrongparams.phpt create mode 100644 ext/gettext/tests/gettext_dcgettext-wrongparams.phpt create mode 100644 ext/gettext/tests/gettext_dcgettext.phpt create mode 100644 ext/gettext/tests/gettext_dgettext.phpt create mode 100644 ext/gettext/tests/gettext_dgettext_error_wrongparams.phpt create mode 100644 ext/gettext/tests/gettext_dngettext-plural.phpt create mode 100644 ext/gettext/tests/gettext_dngettext-wrongparams.phpt create mode 100644 ext/gettext/tests/gettext_gettext_error_wrongparams.phpt create mode 100644 ext/gettext/tests/gettext_ngettext-wrongparams.phpt create mode 100644 ext/gettext/tests/gettext_ngettext.phpt create mode 100644 ext/gettext/tests/gettext_phpinfo.phpt create mode 100644 ext/gettext/tests/gettext_textdomain-retval.phpt create mode 100644 ext/gettext/tests/gettext_textdomain-wrongparams.phpt create mode 100644 ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest.mo create mode 100644 ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest.po create mode 100644 ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest_switch.mo create mode 100644 ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest_switch.po create mode 100644 ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest_switched.po create mode 100644 ext/gettext/tests/locale/en/LC_CTYPE/dngettextTest.mo create mode 100644 ext/gettext/tests/locale/en/LC_CTYPE/dngettextTest.po create mode 100644 ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest.mo create mode 100644 ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest.po create mode 100644 ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest_switch.mo create mode 100644 ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest_switch.po create mode 100644 ext/gettext/tests/locale/en/LC_MESSAGES/dngettextTest.mo create mode 100644 ext/gettext/tests/locale/en/LC_MESSAGES/dngettextTest.po create mode 100644 ext/gettext/tests/locale/en/LC_MESSAGES/messages.mo create mode 100644 ext/gettext/tests/locale/en/LC_MESSAGES/messages.po diff --git a/ext/gettext/tests/gettext_basic-enus.phpt b/ext/gettext/tests/gettext_basic-enus.phpt new file mode 100644 index 0000000000..0ff97cd7a2 --- /dev/null +++ b/ext/gettext/tests/gettext_basic-enus.phpt @@ -0,0 +1,32 @@ +--TEST-- +Gettext basic test with en_US locale that should be on nearly every system +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s.php on line %d +A basic test +A basic test +--CREDITS-- +Christian Weiske, cweiske@php.net +PHP Testfest Berlin 2009-05-09 diff --git a/ext/gettext/tests/gettext_bind_textdomain_codeset-retval.phpt b/ext/gettext/tests/gettext_bind_textdomain_codeset-retval.phpt new file mode 100644 index 0000000000..a5096cbaa7 --- /dev/null +++ b/ext/gettext/tests/gettext_bind_textdomain_codeset-retval.phpt @@ -0,0 +1,22 @@ +--TEST-- +test if bind_textdomain_codeset() returns correct value +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +bool(false) +%unicode|string%(5) "UTF-8" +Done +--CREDITS-- +Florian Holzhauer fh-pt@fholzhauer.de +PHP Testfest Berlin 2009-05-09 diff --git a/ext/gettext/tests/gettext_bind_textdomain_codeset-wrongparams.phpt b/ext/gettext/tests/gettext_bind_textdomain_codeset-wrongparams.phpt new file mode 100644 index 0000000000..eb50c5d6e5 --- /dev/null +++ b/ext/gettext/tests/gettext_bind_textdomain_codeset-wrongparams.phpt @@ -0,0 +1,23 @@ +--TEST-- +test if bind_textdomain_codeset() fails on wrong param count +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: bind_textdomain_codeset() expects exactly 2 parameters, 1 given in %s on line %d + +Warning: bind_textdomain_codeset() expects exactly 2 parameters, 3 given in %s on line %d +Done +--CREDITS-- +Florian Holzhauer fh-pt@fholzhauer.de +PHP Testfest Berlin 2009-05-09 \ No newline at end of file diff --git a/ext/gettext/tests/gettext_bindtextdomain-cwd.phpt b/ext/gettext/tests/gettext_bindtextdomain-cwd.phpt new file mode 100644 index 0000000000..24c0e6e7ba --- /dev/null +++ b/ext/gettext/tests/gettext_bindtextdomain-cwd.phpt @@ -0,0 +1,32 @@ +--TEST-- +Test if bindtextdomain() returns string id if no directory path is set(if directory path is 'null') +--SKIPIF-- + +--EXPECTF-- +Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s.php on line %d +string(10) "Basic test" +string(12) "A basic test" +--CREDIT-- +Moritz Neuhaeuser, info@xcompile.net +PHP Testfest Berlin 2009-05-09 diff --git a/ext/gettext/tests/gettext_bindtextdomain-emptydomain.phpt b/ext/gettext/tests/gettext_bindtextdomain-emptydomain.phpt new file mode 100644 index 0000000000..79ebdd6e89 --- /dev/null +++ b/ext/gettext/tests/gettext_bindtextdomain-emptydomain.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test if bindtextdomain() errors if the domain is empty. +--SKIPIF-- + +--EXPECTF-- +Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s.php on line %d + +Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s.php on line %d +string(7) "Produkt" +string(16) "Produkt_switched" +string(7) "Produkt" +--CREDITS-- +Moritz Neuhaeuser, info@xcompile.net +PHP Testfest Berlin 2009-05-09 diff --git a/ext/gettext/tests/gettext_dgettext_error_wrongparams.phpt b/ext/gettext/tests/gettext_dgettext_error_wrongparams.phpt new file mode 100644 index 0000000000..28c9cc785d --- /dev/null +++ b/ext/gettext/tests/gettext_dgettext_error_wrongparams.phpt @@ -0,0 +1,39 @@ +--TEST-- +Check how dgettext() with wrong parameter types and wrong parameter cou types and wrong parameter count behaves. +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s.php on line %d + +Warning: dgettext() expects exactly 2 parameters, 1 given in %s.php on line %d + +Warning: dgettext() expects exactly 2 parameters, 0 given in %s.php on line %d + +Warning: dgettext() expects parameter 1 to be binary string, array given in %s.php on line %d + +Warning: dgettext() expects parameter 2 to be binary string, array given in %s.php on line %d +--CREDITS-- +Moritz Neuhaeuser, info@xcompile.net +PHP Testfest Berlin 2009-05-09 diff --git a/ext/gettext/tests/gettext_dngettext-plural.phpt b/ext/gettext/tests/gettext_dngettext-plural.phpt new file mode 100644 index 0000000000..571746cfbd --- /dev/null +++ b/ext/gettext/tests/gettext_dngettext-plural.phpt @@ -0,0 +1,29 @@ +--TEST-- +Test if dngettext() returns the correct translations (optionally plural). +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: gettext() expects parameter 1 to be %binary_string_optional%, array given in %s on line 2 +--CREDITS-- +Moritz Neuhaeuser, info@xcompile.net +PHP Testfest Berlin 2009-05-09 diff --git a/ext/gettext/tests/gettext_ngettext-wrongparams.phpt b/ext/gettext/tests/gettext_ngettext-wrongparams.phpt new file mode 100644 index 0000000000..5010481a3d --- /dev/null +++ b/ext/gettext/tests/gettext_ngettext-wrongparams.phpt @@ -0,0 +1,32 @@ +--TEST-- +Check how ngettext() with wrong parameters behaves. +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: ngettext() expects parameter 1 to be %binary_string_optional%, array given in %s on line 2 + +Warning: ngettext() expects parameter 2 to be %binary_string_optional%, array given in %s on line 3 + +Warning: ngettext() expects parameter 3 to be long, array given in %s on line 4 + +Warning: ngettext() expects exactly 3 parameters, 0 given in %s on line 5 + +Warning: ngettext() expects exactly 3 parameters, 1 given in %s on line 6 + +Warning: ngettext() expects exactly 3 parameters, 2 given in %s on line 7 +--CREDITS-- +Tim Eggert, tim@elbart.com +PHP Testfest Berlin 2009-05-09 diff --git a/ext/gettext/tests/gettext_ngettext.phpt b/ext/gettext/tests/gettext_ngettext.phpt new file mode 100644 index 0000000000..16aec5f006 --- /dev/null +++ b/ext/gettext/tests/gettext_ngettext.phpt @@ -0,0 +1,31 @@ +--TEST-- +Test ngettext() functionality +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s.php on line %d +string(7) "Produkt" +string(8) "Produkte" +--CREDITS-- +Christian Weiske, cweiske@php.net +PHP Testfest Berlin 2009-05-09 diff --git a/ext/gettext/tests/gettext_phpinfo.phpt b/ext/gettext/tests/gettext_phpinfo.phpt new file mode 100644 index 0000000000..6a38943d10 --- /dev/null +++ b/ext/gettext/tests/gettext_phpinfo.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test phpinfo() displays gettext support +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +%a +%rGetText Support.*enabled%r +%a +--CREDITS-- +Tim Eggert, tim@elbart.com +PHP Testfest Berlin 2009-05-09 diff --git a/ext/gettext/tests/gettext_textdomain-retval.phpt b/ext/gettext/tests/gettext_textdomain-retval.phpt new file mode 100644 index 0000000000..b5d485764b --- /dev/null +++ b/ext/gettext/tests/gettext_textdomain-retval.phpt @@ -0,0 +1,32 @@ +--TEST-- +Check if textdomain() returns the new domain +--SKIPIF-- + +--FILE-- + +--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 diff --git a/ext/gettext/tests/gettext_textdomain-wrongparams.phpt b/ext/gettext/tests/gettext_textdomain-wrongparams.phpt new file mode 100644 index 0000000000..ac15dd0fd2 --- /dev/null +++ b/ext/gettext/tests/gettext_textdomain-wrongparams.phpt @@ -0,0 +1,30 @@ +--TEST-- +Check how textdomain() with wrong parameters behaves. +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s.php on line %d + +Warning: textdomain() expects parameter 1 to be %binary_string_optional%, array given in %s on line %d +--CREDITS-- +Christian Weiske, cweiske@php.net +PHP Testfest Berlin 2009-05-09 diff --git a/ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest.mo b/ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest.mo new file mode 100644 index 0000000000000000000000000000000000000000..255e1e937a214de18b5409833c1a962d60af08d4 GIT binary patch literal 84 zcmca7#4?ou2pEA_28dOFm>Gz5fS3!2Er3`6h@F8L20&^vOHy;eL@`4^QGQBkb_tA5 GWdHz75Db_A literal 0 HcmV?d00001 diff --git a/ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest.po b/ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest.po new file mode 100644 index 0000000000..159a90ffeb --- /dev/null +++ b/ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest.po @@ -0,0 +1,4 @@ +msgid "item" +msgid_plural "items" +msgstr[0] "Produkt" +msgstr[1] "Produkte" diff --git a/ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest_switch.mo b/ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest_switch.mo new file mode 100644 index 0000000000000000000000000000000000000000..c2ab696a3e08093e256479accce77b91c30df260 GIT binary patch literal 102 zcmca7#4?ou2pEA_28dOFm>Gz5fS3!2Er3`Fh@F8L20&^vOHy;eL@`4^QGQBkc1e73 Qd1gs+MrsO7AQd430EP7w9smFU literal 0 HcmV?d00001 diff --git a/ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest_switch.po b/ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest_switch.po new file mode 100644 index 0000000000..b56d1890e0 --- /dev/null +++ b/ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest_switch.po @@ -0,0 +1,4 @@ +msgid "item" +msgid_plural "items" +msgstr[0] "Produkt_switched" +msgstr[1] "Produkte_switched" diff --git a/ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest_switched.po b/ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest_switched.po new file mode 100644 index 0000000000..d6f6ea2369 --- /dev/null +++ b/ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest_switched.po @@ -0,0 +1,2 @@ +msgid "item" +msgstr[0] "cProdukt_switched" diff --git a/ext/gettext/tests/locale/en/LC_CTYPE/dngettextTest.mo b/ext/gettext/tests/locale/en/LC_CTYPE/dngettextTest.mo new file mode 100644 index 0000000000000000000000000000000000000000..e9c63ef95fbb054967b5ba440ed454e0a6a77a2a GIT binary patch literal 86 zcmca7#4?ou2pEA_28dOFm>Gz5fS3!2Er3`Eh@F8L20&^vOHy;eL@`5hKv8~5X?6*m Hk;(u7XI2eh literal 0 HcmV?d00001 diff --git a/ext/gettext/tests/locale/en/LC_CTYPE/dngettextTest.po b/ext/gettext/tests/locale/en/LC_CTYPE/dngettextTest.po new file mode 100644 index 0000000000..863e83cfd9 --- /dev/null +++ b/ext/gettext/tests/locale/en/LC_CTYPE/dngettextTest.po @@ -0,0 +1,4 @@ +msgid "item" +msgid_plural "items" +msgstr[0] "cProdukt" +msgstr[1] "cProdukte" diff --git a/ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest.mo b/ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest.mo new file mode 100644 index 0000000000000000000000000000000000000000..255e1e937a214de18b5409833c1a962d60af08d4 GIT binary patch literal 84 zcmca7#4?ou2pEA_28dOFm>Gz5fS3!2Er3`6h@F8L20&^vOHy;eL@`4^QGQBkb_tA5 GWdHz75Db_A literal 0 HcmV?d00001 diff --git a/ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest.po b/ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest.po new file mode 100644 index 0000000000..159a90ffeb --- /dev/null +++ b/ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest.po @@ -0,0 +1,4 @@ +msgid "item" +msgid_plural "items" +msgstr[0] "Produkt" +msgstr[1] "Produkte" diff --git a/ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest_switch.mo b/ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest_switch.mo new file mode 100644 index 0000000000000000000000000000000000000000..c2ab696a3e08093e256479accce77b91c30df260 GIT binary patch literal 102 zcmca7#4?ou2pEA_28dOFm>Gz5fS3!2Er3`Fh@F8L20&^vOHy;eL@`4^QGQBkc1e73 Qd1gs+MrsO7AQd430EP7w9smFU literal 0 HcmV?d00001 diff --git a/ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest_switch.po b/ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest_switch.po new file mode 100644 index 0000000000..b56d1890e0 --- /dev/null +++ b/ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest_switch.po @@ -0,0 +1,4 @@ +msgid "item" +msgid_plural "items" +msgstr[0] "Produkt_switched" +msgstr[1] "Produkte_switched" diff --git a/ext/gettext/tests/locale/en/LC_MESSAGES/dngettextTest.mo b/ext/gettext/tests/locale/en/LC_MESSAGES/dngettextTest.mo new file mode 100644 index 0000000000000000000000000000000000000000..255e1e937a214de18b5409833c1a962d60af08d4 GIT binary patch literal 84 zcmca7#4?ou2pEA_28dOFm>Gz5fS3!2Er3`6h@F8L20&^vOHy;eL@`4^QGQBkb_tA5 GWdHz75Db_A literal 0 HcmV?d00001 diff --git a/ext/gettext/tests/locale/en/LC_MESSAGES/dngettextTest.po b/ext/gettext/tests/locale/en/LC_MESSAGES/dngettextTest.po new file mode 100644 index 0000000000..159a90ffeb --- /dev/null +++ b/ext/gettext/tests/locale/en/LC_MESSAGES/dngettextTest.po @@ -0,0 +1,4 @@ +msgid "item" +msgid_plural "items" +msgstr[0] "Produkt" +msgstr[1] "Produkte" diff --git a/ext/gettext/tests/locale/en/LC_MESSAGES/messages.mo b/ext/gettext/tests/locale/en/LC_MESSAGES/messages.mo new file mode 100644 index 0000000000000000000000000000000000000000..335cbdde468bde181796c51016f14a6b1f5593d1 GIT binary patch literal 201 zcmca7#4?ou2$+Ca28eZlm=%a^fEWY, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: gettext_basic.phpt:11 +msgid "Basic test" +msgstr "A basic test" -- 2.50.1