]> granicus.if.org Git - php/commitdiff
Tests from Berlin test fest
authorZoe Slattery <zoe@php.net>
Thu, 18 Jun 2009 07:25:55 +0000 (07:25 +0000)
committerZoe Slattery <zoe@php.net>
Thu, 18 Jun 2009 07:25:55 +0000 (07:25 +0000)
34 files changed:
ext/gettext/tests/gettext_basic-enus.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_bind_textdomain_codeset-retval.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_bind_textdomain_codeset-wrongparams.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_bindtextdomain-cwd.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_bindtextdomain-emptydomain.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_bindtextdomain-path.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_bindtextdomain-wrongparams.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_dcgettext-wrongparams.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_dcgettext.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_dgettext.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_dgettext_error_wrongparams.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_dngettext-plural.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_dngettext-wrongparams.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_gettext_error_wrongparams.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_ngettext-wrongparams.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_ngettext.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_phpinfo.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_textdomain-retval.phpt [new file with mode: 0644]
ext/gettext/tests/gettext_textdomain-wrongparams.phpt [new file with mode: 0644]
ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest.mo [new file with mode: 0644]
ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest.po [new file with mode: 0644]
ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest_switch.mo [new file with mode: 0644]
ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest_switch.po [new file with mode: 0644]
ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest_switched.po [new file with mode: 0644]
ext/gettext/tests/locale/en/LC_CTYPE/dngettextTest.mo [new file with mode: 0644]
ext/gettext/tests/locale/en/LC_CTYPE/dngettextTest.po [new file with mode: 0644]
ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest.mo [new file with mode: 0644]
ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest.po [new file with mode: 0644]
ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest_switch.mo [new file with mode: 0644]
ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest_switch.po [new file with mode: 0644]
ext/gettext/tests/locale/en/LC_MESSAGES/dngettextTest.mo [new file with mode: 0644]
ext/gettext/tests/locale/en/LC_MESSAGES/dngettextTest.po [new file with mode: 0644]
ext/gettext/tests/locale/en/LC_MESSAGES/messages.mo [new file with mode: 0644]
ext/gettext/tests/locale/en/LC_MESSAGES/messages.po [new file with mode: 0644]

diff --git a/ext/gettext/tests/gettext_basic-enus.phpt b/ext/gettext/tests/gettext_basic-enus.phpt
new file mode 100644 (file)
index 0000000..0ff97cd
--- /dev/null
@@ -0,0 +1,32 @@
+--TEST--
+Gettext basic test with en_US locale that should be on nearly every system
+--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");
+textdomain ("messages");
+echo gettext("Basic test"), "\n";
+echo _("Basic test"), "\n";
+
+?>
+--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 (file)
index 0000000..a5096cb
--- /dev/null
@@ -0,0 +1,22 @@
+--TEST--
+test if bind_textdomain_codeset() returns correct value 
+--SKIPIF--
+<?php 
+       if (!extension_loaded("gettext")) {
+               die("skip"); 
+       }
+?>
+--FILE--
+<?php
+       var_dump(bind_textdomain_codeset(false,false));
+       var_dump(bind_textdomain_codeset('messages', "UTF-8"));
+
+       echo "Done\n";
+?>
+--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 (file)
index 0000000..eb50c5d
--- /dev/null
@@ -0,0 +1,23 @@
+--TEST--
+test if bind_textdomain_codeset() fails on wrong param count
+--SKIPIF--
+<?php 
+       if (!extension_loaded("gettext")) {
+               die("skip"); 
+       }
+?>
+--FILE--
+<?php
+       bind_textdomain_codeset('messages');
+       bind_textdomain_codeset('messages','foo','bar');
+
+       echo "Done\n";
+?>
+--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 (file)
index 0000000..24c0e6e
--- /dev/null
@@ -0,0 +1,32 @@
+--TEST--
+Test if bindtextdomain() returns string id if no directory path is set(if directory path is 'null')
+--SKIPIF--
+<?php
+if (!extension_loaded("gettext")) {
+    die("skip gettext extension is not loaded.\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.
+
+$base_dir = dirname(__FILE__);
+chdir($base_dir);
+setlocale(LC_ALL, 'en_US.UTF-8');
+bindtextdomain('messages',null);
+var_dump(gettext('Basic test'));
+bindtextdomain('messages', './locale');
+var_dump(gettext('Basic test'));
+
+?>
+--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 (file)
index 0000000..79ebdd6
--- /dev/null
@@ -0,0 +1,18 @@
+--TEST--
+Test if bindtextdomain() errors if the domain is empty.
+--SKIPIF--
+<?php
+if (!extension_loaded("gettext")) {
+    die("skip gettext extension is not loaded.\n");
+}
+--FILE--
+<?php
+
+
+chdir(dirname(__FILE__));
+bindtextdomain('', 'foobar');
+--EXPECTF--
+Warning: bindtextdomain(): the first parameter must not be empty in %s.php on line %d
+--CREDITS--
+Till Klampaeckel, till@php.net
+PHP Testfest Berlin 2009-05-09
diff --git a/ext/gettext/tests/gettext_bindtextdomain-path.phpt b/ext/gettext/tests/gettext_bindtextdomain-path.phpt
new file mode 100644 (file)
index 0000000..c34bb37
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+Test if bindtextdomain() returns false if path does not exist.
+--SKIPIF--
+<?php
+if (!extension_loaded("gettext")) {
+    die("skip gettext extension is not loaded.\n");
+}
+
+--FILE--
+<?php
+
+chdir(dirname(__FILE__));
+
+var_dump(bindtextdomain('example.org', 'foobar'));
+--EXPECTF--
+bool(false)
+--CREDITS--
+Till Klampaeckel, till@php.net
+PHP Testfest Berlin 2009-05-09
diff --git a/ext/gettext/tests/gettext_bindtextdomain-wrongparams.phpt b/ext/gettext/tests/gettext_bindtextdomain-wrongparams.phpt
new file mode 100644 (file)
index 0000000..4bc69ed
--- /dev/null
@@ -0,0 +1,21 @@
+--TEST--
+Test if bindtextdomain() errors if you don't supply enough parameters.
+--SKIPIF--
+<?php
+if (!extension_loaded("gettext")) {
+    die("skip gettext extension is not loaded.\n");
+}
+--FILE--
+<?php
+
+chdir(dirname(__FILE__));
+
+bindtextdomain('foobar');
+bindtextdomain();
+--EXPECTF--
+Warning: bindtextdomain() expects exactly 2 parameters, 1 given in %s on line %d
+
+Warning: bindtextdomain() expects exactly 2 parameters, 0 given in %s on line %d
+--CREDITS--
+Till Klampaeckel, till@php.net
+PHP Testfest Berlin 2009-05-09
diff --git a/ext/gettext/tests/gettext_dcgettext-wrongparams.phpt b/ext/gettext/tests/gettext_dcgettext-wrongparams.phpt
new file mode 100644 (file)
index 0000000..372a957
--- /dev/null
@@ -0,0 +1,16 @@
+--TEST--
+Test if dcgettext() errors when you don't supply the correct params.
+--SKIPIF--
+<?php
+if (!extension_loaded("gettext")) {
+    die("skip gettext extension is not loaded.\n");
+}
+--FILE--
+<?php
+var_dump(dcgettext('a', 'b'));
+--EXPECTF--
+Warning: dcgettext() expects exactly 3 parameters, 2 given in %s on line %d
+NULL
+--CREDITS--
+Christian Weiske, cweiske@php.net
+PHP Testfest Berlin 2009-05-09
\ No newline at end of file
diff --git a/ext/gettext/tests/gettext_dcgettext.phpt b/ext/gettext/tests/gettext_dcgettext.phpt
new file mode 100644 (file)
index 0000000..44e013d
--- /dev/null
@@ -0,0 +1,32 @@
+--TEST--
+Test dcgettext() functionality
+--SKIPIF--
+<?php
+if (!extension_loaded("gettext")) {
+    die("skip gettext extension is not loaded.\n");
+}
+if (!setlocale(LC_ALL, 'en_US.UTF-8')) {
+    die("skip en_US.UTF-8 locale not supported.");
+}
+--FILE--
+<?php
+chdir(dirname(__FILE__));
+
+// Using deprectated setlocale() in PHP6. The test needs to be changed
+// when there is an alternative available.
+
+setlocale(LC_MESSAGES, 'en_US.UTF-8');
+setlocale(LC_ALL, 'en_US.UTF-8');
+bindtextdomain('dngettextTest', './locale');
+
+var_dump(dcgettext('dngettextTest', 'item', LC_CTYPE));
+var_dump(dcgettext('dngettextTest', 'item', LC_MESSAGES));
+--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(8) "cProdukt"
+string(7) "Produkt"
+--CREDITS--
+Christian Weiske, cweiske@php.net
+PHP Testfest Berlin 2009-05-09
diff --git a/ext/gettext/tests/gettext_dgettext.phpt b/ext/gettext/tests/gettext_dgettext.phpt
new file mode 100644 (file)
index 0000000..7d55ca5
--- /dev/null
@@ -0,0 +1,37 @@
+--TEST--
+Test dgettext() functionality
+--SKIPIF--
+<?php
+if (!extension_loaded("gettext")) {
+    die("SKIP gettext extension is not loaded.\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_MESSAGES, 'en_US.UTF-8');
+setlocale(LC_ALL, 'en_US.UTF-8');
+bindtextdomain('dgettextTest', './locale');
+bindtextdomain('dgettextTest_switch', './locale');
+textdomain('dgettextTest');
+
+var_dump(gettext('item'));
+var_dump(dgettext('dgettextTest_switch', 'item'));
+var_dump(gettext('item'));
+?>
+--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 (file)
index 0000000..28c9cc7
--- /dev/null
@@ -0,0 +1,39 @@
+--TEST--
+Check how dgettext() with wrong parameter types and wrong parameter cou types and wrong parameter count behaves.
+--SKIPIF--
+<?php 
+       if (!extension_loaded("gettext")) {
+               die("skip extension gettext not loaded\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');
+    dgettext ('foo');
+    dgettext ();
+
+    dgettext(array(), 'foo');
+    dgettext('foo', array());
+
+?>
+--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 (file)
index 0000000..571746c
--- /dev/null
@@ -0,0 +1,29 @@
+--TEST--
+Test if dngettext() returns the correct translations (optionally plural).
+--SKIPIF--
+<?php
+if (!extension_loaded("gettext")) {
+    die("skip gettext extension is not loaded.\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('dngettextTest', './locale');
+
+var_dump(dngettext('dngettextTest', 'item', 'items', 1));
+var_dump(dngettext('dngettextTest', 'item', 'items', 2));
+--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--
+Till Klampaeckel, till@php.net
+PHP Testfest Berlin 2009-05-09
diff --git a/ext/gettext/tests/gettext_dngettext-wrongparams.phpt b/ext/gettext/tests/gettext_dngettext-wrongparams.phpt
new file mode 100644 (file)
index 0000000..142dfdc
--- /dev/null
@@ -0,0 +1,29 @@
+--TEST--
+Test if dngettext() errors when you don't supply the correct params.
+--SKIPIF--
+<?php
+if (!extension_loaded("gettext")) {
+    die("skip gettext extension is not loaded.\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('dngettextTest', './locale');
+
+var_dump(dngettext('dngettextTest', 'item', 'items'));
+--EXPECTF--
+Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s.php on line %d
+
+Warning: dngettext() expects exactly 4 parameters, 3 given in %s.php on line %d
+bool(false)
+--CREDITS--
+Till Klampaeckel, till@php.net
+PHP Testfest Berlin 2009-05-09
diff --git a/ext/gettext/tests/gettext_gettext_error_wrongparams.phpt b/ext/gettext/tests/gettext_gettext_error_wrongparams.phpt
new file mode 100644 (file)
index 0000000..2fd8c90
--- /dev/null
@@ -0,0 +1,17 @@
+--TEST--
+Check how gettext() with wrong parameters behaves.
+--SKIPIF--
+<?php 
+       if (!extension_loaded("gettext")) {
+               die("skip extension gettext not loaded\n");
+       }
+?>
+--FILE--
+<?php 
+gettext (array());
+?>
+--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 (file)
index 0000000..5010481
--- /dev/null
@@ -0,0 +1,32 @@
+--TEST--
+Check how ngettext() with wrong parameters behaves.
+--SKIPIF--
+<?php 
+       if (!extension_loaded("gettext")) {
+               die("SKIP extension gettext not loaded\n");
+       }
+?>
+--FILE--
+<?php
+ngettext(array(), "", 1);
+ngettext("", array(), 1);
+ngettext("", "", array());
+ngettext();
+ngettext("");
+ngettext("", "");
+?>
+--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 (file)
index 0000000..16aec5f
--- /dev/null
@@ -0,0 +1,31 @@
+--TEST--
+Test ngettext() functionality
+--SKIPIF--
+<?php 
+       if (!extension_loaded("gettext")) {
+               die("SKIP extension gettext not loaded\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('dngettextTest', './locale');
+textdomain('dngettextTest');
+var_dump(ngettext('item', 'items', 1));
+var_dump(ngettext('item', 'items', 2));
+?>
+--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 (file)
index 0000000..6a38943
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+Test phpinfo() displays gettext support 
+--SKIPIF--
+<?php 
+       if (!extension_loaded("gettext")) {
+               die("SKIP extension gettext not loaded\n");
+       }
+?>
+--FILE--
+<?php
+phpinfo();
+?>
+--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 (file)
index 0000000..b5d4857
--- /dev/null
@@ -0,0 +1,32 @@
+--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
diff --git a/ext/gettext/tests/gettext_textdomain-wrongparams.phpt b/ext/gettext/tests/gettext_textdomain-wrongparams.phpt
new file mode 100644 (file)
index 0000000..ac15dd0
--- /dev/null
@@ -0,0 +1,30 @@
+--TEST--
+Check how textdomain() with wrong parameters behaves.
+--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");
+textdomain (array());
+
+?>
+--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 (file)
index 0000000..255e1e9
Binary files /dev/null and b/ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest.mo differ
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 (file)
index 0000000..159a90f
--- /dev/null
@@ -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 (file)
index 0000000..c2ab696
Binary files /dev/null and b/ext/gettext/tests/locale/en/LC_CTYPE/dgettextTest_switch.mo differ
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 (file)
index 0000000..b56d189
--- /dev/null
@@ -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 (file)
index 0000000..d6f6ea2
--- /dev/null
@@ -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 (file)
index 0000000..e9c63ef
Binary files /dev/null and b/ext/gettext/tests/locale/en/LC_CTYPE/dngettextTest.mo differ
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 (file)
index 0000000..863e83c
--- /dev/null
@@ -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 (file)
index 0000000..255e1e9
Binary files /dev/null and b/ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest.mo differ
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 (file)
index 0000000..159a90f
--- /dev/null
@@ -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 (file)
index 0000000..c2ab696
Binary files /dev/null and b/ext/gettext/tests/locale/en/LC_MESSAGES/dgettextTest_switch.mo differ
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 (file)
index 0000000..b56d189
--- /dev/null
@@ -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 (file)
index 0000000..255e1e9
Binary files /dev/null and b/ext/gettext/tests/locale/en/LC_MESSAGES/dngettextTest.mo differ
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 (file)
index 0000000..159a90f
--- /dev/null
@@ -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 (file)
index 0000000..335cbdd
Binary files /dev/null and b/ext/gettext/tests/locale/en/LC_MESSAGES/messages.mo differ
diff --git a/ext/gettext/tests/locale/en/LC_MESSAGES/messages.po b/ext/gettext/tests/locale/en/LC_MESSAGES/messages.po
new file mode 100644 (file)
index 0000000..2faf01f
--- /dev/null
@@ -0,0 +1,15 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 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"