From bc95fd2884cdce0bbb49a289a3a87b8e2689293d Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Wed, 17 Feb 2016 22:01:11 +0000 Subject: [PATCH] Tests: Add test for `wp_get_installed_translations()`. Introduces language files in /tests/phpunit/data/language. Each file includes the header and 5 translations. Props realloc for initial patch. Fixes #35284. git-svn-id: https://develop.svn.wordpress.org/trunk@36563 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/data/languages/admin-en_GB.mo | Bin 0 -> 1219 bytes tests/phpunit/data/languages/admin-en_GB.po | 34 ++++++++++++++++ tests/phpunit/data/languages/admin-es_ES.mo | Bin 0 -> 1301 bytes tests/phpunit/data/languages/admin-es_ES.po | 34 ++++++++++++++++ .../data/languages/admin-network-en_GB.mo | Bin 0 -> 894 bytes .../data/languages/admin-network-en_GB.po | 32 +++++++++++++++ .../data/languages/admin-network-es_ES.mo | Bin 0 -> 1012 bytes .../data/languages/admin-network-es_ES.po | 32 +++++++++++++++ .../data/languages/continents-cities-es_ES.mo | Bin 0 -> 504 bytes .../data/languages/continents-cities-es_ES.po | 31 +++++++++++++++ tests/phpunit/data/languages/en_GB.mo | Bin 0 -> 698 bytes tests/phpunit/data/languages/en_GB.po | 37 ++++++++++++++++++ tests/phpunit/data/languages/es_ES.mo | Bin 0 -> 723 bytes tests/phpunit/data/languages/es_ES.po | 37 ++++++++++++++++++ tests/phpunit/includes/bootstrap.php | 2 + tests/phpunit/tests/l10n.php | 22 +++++++++++ 16 files changed, 261 insertions(+) create mode 100644 tests/phpunit/data/languages/admin-en_GB.mo create mode 100644 tests/phpunit/data/languages/admin-en_GB.po create mode 100644 tests/phpunit/data/languages/admin-es_ES.mo create mode 100644 tests/phpunit/data/languages/admin-es_ES.po create mode 100644 tests/phpunit/data/languages/admin-network-en_GB.mo create mode 100644 tests/phpunit/data/languages/admin-network-en_GB.po create mode 100644 tests/phpunit/data/languages/admin-network-es_ES.mo create mode 100644 tests/phpunit/data/languages/admin-network-es_ES.po create mode 100644 tests/phpunit/data/languages/continents-cities-es_ES.mo create mode 100644 tests/phpunit/data/languages/continents-cities-es_ES.po create mode 100644 tests/phpunit/data/languages/en_GB.mo create mode 100644 tests/phpunit/data/languages/en_GB.po create mode 100644 tests/phpunit/data/languages/es_ES.mo create mode 100644 tests/phpunit/data/languages/es_ES.po diff --git a/tests/phpunit/data/languages/admin-en_GB.mo b/tests/phpunit/data/languages/admin-en_GB.mo new file mode 100644 index 0000000000000000000000000000000000000000..690efdb2c2fab6f6ade01cfcd1bd6cea335f08af GIT binary patch literal 1219 zcmeHF&2AGh5MH2g2se(1!xS~A;xxMzqS`74RGO+%3lW5$tFt?4Om^+X_BKS~!b9*5 zaOVwp0N#KjufUbhy9oiFfCD3q$CkhOzL~MV-P-yP!EV6sz|Y_};qTzVKEmI_Kf!Oq zcdxW}L&Uo{e?feP_#N>FVtTd3C)Zm1XT-qu6*1t?wpzSFL`q}WHip#3u44`LAZ24m zrYu=|dQ-Di>`0ph&EzFhCbJo1tMfwX3-X3kSy_XditW_cQtFI*^q3bU?L{3(94Sp* zN2Q!2-^!^Enbu5d=PCP3$bqh4+lzj$V7V4)=%PU0jd$EV>Ly`DG1T4Pabza1IfGuK zq_k%%vqo&8{ETocfnF)D@-+K}v2)}YiykcJD)VwuaKj3YT6u-;&_ZT%?nPs;{32%xH}cIB(Pet&Db%??t00 z;wfJ$r;HYlr00~9etciViReF|xSuBbX&mqNVV(2S^JDRXZNR1!_xhb9gIQ=V#>)zc zp5OYts*p+_QZ|#;u^&7i55>U-XQg&iw&GZ$Y1E$5!9@AasHm+h#1PNyQqom(bc5uO z+U-Eo_JHEU&MR@k8q@d2rgTym-?Y7lT7)dBnG|u1LPyqw_Y$Z1rrd{lskCw)xhTK$ N$2a)@5&waY_!AD_ec}KB literal 0 HcmV?d00001 diff --git a/tests/phpunit/data/languages/admin-en_GB.po b/tests/phpunit/data/languages/admin-en_GB.po new file mode 100644 index 0000000000..f51e83103e --- /dev/null +++ b/tests/phpunit/data/languages/admin-en_GB.po @@ -0,0 +1,34 @@ +# Translation of Administration in English (UK) +# This file is distributed under the same license as the Administration package. +msgid "" +msgstr "" +"PO-Revision-Date: 2015-12-07 10:23:11+0000\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: GlotPress/1.0-alpha-1100\n" +"Project-Id-Version: Administration\n" + +#: wp-admin/about.php:42 wp-admin/credits.php:23 wp-admin/freedoms.php:22 +msgid "Thank you for updating! WordPress %s makes your site more connected and responsive." +msgstr "Thank you for updating! WordPress %s makes your site more connected and responsive." + +#. translators: 1: WP_Term class name, WP_Comment class name, WP_Network class +#. name +#: wp-admin/about.php:185 +msgid "New %1$s, %2$s, and %3$s objects make interacting with terms, comments, and networks more predictable and intuitive in code." +msgstr "New %1$s, %2$s, and %3$s objects make interacting with terms, comments, and networks more predictable and intuitive in code." + +#. translators: WP_Comment_Query class name +#: wp-admin/about.php:178 +msgid "Comment queries now have cache handling to improve performance. New arguments in %s make crafting robust comment queries simpler." +msgstr "Comment queries now have cache handling to improve performance. New arguments in %s make crafting robust comment queries simpler." + +#: wp-admin/about.php:182 +msgid "Term, comment, and network objects" +msgstr "Term, comment, and network objects" + +#: wp-admin/about.php:175 +msgid "Comment query improvements" +msgstr "Comment query improvements" diff --git a/tests/phpunit/data/languages/admin-es_ES.mo b/tests/phpunit/data/languages/admin-es_ES.mo new file mode 100644 index 0000000000000000000000000000000000000000..01e87d2ed8895aee7e3920095cfeabf6defc3ccb GIT binary patch literal 1301 zcmaJ=J#Q2-5H%1ej*b#hOi)e~VK2D@qUfR&QAnal2|2;>(K@@6oReL9vAqe0XsD@a z=+coA@ejC~zd*@9K(su2?{ZNJEX|IsotgJ${QT?A%x8gh3w95-1G^3T01N9Y>?7

n6T|4^pOU-4q3DPj4%>iXCZlN&|Vql*)9#*y=1-`jEUKRg~7?Ps#Sc*h1=*Tl9=i zN!r6I6mg_9H60c582MHn_>gJMe&sx+SAZPK6Zi%3d)wla-ir^*iq#{$t~#BrWxe`@S8a*Ra}mNS)lxu0{aiW-&j3f-ZF z)MVTeeN?$9Qe%&6OyETy<2k0GsR#q1s?1~{F-xzF&3cxdn@q!nAWKepuJKc&H9Fud zq9e34+5x^LdV9%pK2c5?ojjGEyVO~1KS|o1q|?E++ga*9UYcLTYV2w^oJ!9J-_n{WiFLop>!avW54>cznLsgtYMNc8_DbVTvc($H_r`Wpv2y#OwW%*%mH+HDZ+SrhIn z+0LeP*Rn!sqGRF;bC6T4btUQ1?3K7BWOJx zeb3aPnFdYtY+7P(%mpKzKtx%O5l{pL#gDTsydj15N=O;6sgk*RFYOgE2l^4zS3%9n a5Ia<@2Z`&$Ez8WH<^^4u$uhpPmiPx&$)hL$ literal 0 HcmV?d00001 diff --git a/tests/phpunit/data/languages/admin-es_ES.po b/tests/phpunit/data/languages/admin-es_ES.po new file mode 100644 index 0000000000..445396872f --- /dev/null +++ b/tests/phpunit/data/languages/admin-es_ES.po @@ -0,0 +1,34 @@ +# Translation of Administration in Spanish (Spain) +# This file is distributed under the same license as the Administration package. +msgid "" +msgstr "" +"PO-Revision-Date: 2015-12-22 20:26:46+0000\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: GlotPress/1.0-alpha-1100\n" +"Project-Id-Version: Administration\n" + +#: wp-admin/about.php:42 wp-admin/credits.php:23 wp-admin/freedoms.php:22 +msgid "Thank you for updating! WordPress %s makes your site more connected and responsive." +msgstr "¡Gracias por actualizar! WordPress %s hace que tu sitio esté más conectado y sea más adaptable." + +#. translators: 1: WP_Term class name, WP_Comment class name, WP_Network class +#. name +#: wp-admin/about.php:185 +msgid "New %1$s, %2$s, and %3$s objects make interacting with terms, comments, and networks more predictable and intuitive in code." +msgstr "Ahora los objetos %1$s, %2$s y %3$s hacen que interactuar con términos, comentarios y redes sea más predecible y que el código sea más intuitivo." + +#. translators: WP_Comment_Query class name +#: wp-admin/about.php:178 +msgid "Comment queries now have cache handling to improve performance. New arguments in %s make crafting robust comment queries simpler." +msgstr "Las consultas de comentarios ahora tiene una caché que mejora el rendimiento. Nuevos argumentos en %s hacen que sea más fácil crear consultas robustas." + +#: wp-admin/about.php:182 +msgid "Term, comment, and network objects" +msgstr "Objetos de término, comentario y red" + +#: wp-admin/about.php:175 +msgid "Comment query improvements" +msgstr "Mejoras en las consultas de comentarios" diff --git a/tests/phpunit/data/languages/admin-network-en_GB.mo b/tests/phpunit/data/languages/admin-network-en_GB.mo new file mode 100644 index 0000000000000000000000000000000000000000..e74c83063501d6ae39dd70665605fc1b1c742370 GIT binary patch literal 894 zcmd^6!EO^V5M7{fSPn=W5r;vdCvdtO3Dj4dxb`JO+yfp1`@ntR5=ik4*aE%-SHLge z0Wi9iWskrCoP$4se}lh*lm7GVmHr1f>EGO0=}*8(FJMU9NVWgQ+VuiyZ9taYO{;Bc zw8*&+H3b%qWQ{web7L)yn1o%V=qb*a7Q%tfj3%CIV>{Vkf{dw=7<4q=krAqm=#l06 zIW?BGr2I(h4|A!=HSJdV-5%POPWq0X^r`ISCu)x!qrW~>v}b)BVn(t7FG|~H frr{e#hrxeD1J$6uvHO-IW_n87_1w7pf1C0jGV}xA literal 0 HcmV?d00001 diff --git a/tests/phpunit/data/languages/admin-network-en_GB.po b/tests/phpunit/data/languages/admin-network-en_GB.po new file mode 100644 index 0000000000..3fb0935010 --- /dev/null +++ b/tests/phpunit/data/languages/admin-network-en_GB.po @@ -0,0 +1,32 @@ +# Translation of Network Admin in English (UK) +# This file is distributed under the same license as the Network Admin package. +msgid "" +msgstr "" +"PO-Revision-Date: 2015-11-26 00:00:19+0000\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: GlotPress/1.0-alpha-1100\n" +"Project-Id-Version: Network Admin\n" + +#: wp-admin/network/site-users.php:329 wp-admin/network/user-new.php:106 +msgid "A password reset link will be sent to the user via email." +msgstr "A password reset link will be sent to the user via email." + +#. translators: 1: NOBLOGREDIRECT 2: wp-config.php +#: wp-admin/network/settings.php:142 +msgid "If registration is disabled, please set %1$s in %2$s to a URL you will redirect visitors to if they visit a non-existent site." +msgstr "If registration is disabled, please set %1$s in %2$s to a URL you will redirect visitors to if they visit a non-existent site." + +#: wp-admin/network/site-users.php:42 +msgid "Site users list" +msgstr "Site users list" + +#: wp-admin/network/site-users.php:41 +msgid "Site users list navigation" +msgstr "Site users list navigation" + +#: wp-admin/network/sites.php:51 +msgid "Sites list" +msgstr "Sites list" diff --git a/tests/phpunit/data/languages/admin-network-es_ES.mo b/tests/phpunit/data/languages/admin-network-es_ES.mo new file mode 100644 index 0000000000000000000000000000000000000000..0e67cad091cbcc5902a3cd825ee862c69ce19a49 GIT binary patch literal 1012 zcmbVKyKWOf6kQ-tm;woj1}H9wRAe2mB~aqXMFdF{q^<4iK1S!QOPL_(Bw zlr&U48YmH;kT2i|Xb`_Z&6#zg5K2aS_w3%ek27=6kLy!!6Raz++pr$&D(odJuFtS} z*caF<*iYCs*x*8v+ypw{4d5H#Z{R236X3gxN%9`}3wR6o`cjfKfggc)f!~1$J+~r< zsS^*<>V>f6a{OAPlD$8$t{^8~0%>LT=|E{s10gRaP_Ptsg(@$O#)?TstaLM3-9g4s z`QSJxYe;!2l;?q#VungB>|=hQ>Fk~-WoWt$L@lQ6jUFA@YSP6?p`7FarM(K))iG)( zwmh2nkYTJzrCe>&mfCm#rK54woIf~%5(J>@(aAeuB&j&nOq_V_Eu5s>Ip5m+kXJSuj|dJ-Q{ zyb#ZMP-8AE%|u^R2U_KJWNFMA9g$QEL{0=!nTb9MYp_*|Lk*RK1~kgn8ev?$ulaGF xgP_4CjsaOH3!$Cr1RCi<7<`Ub0m5})vd&`}a;}cQnfmBBT-4G3gx3Xq@&}@&Gs^$~ literal 0 HcmV?d00001 diff --git a/tests/phpunit/data/languages/admin-network-es_ES.po b/tests/phpunit/data/languages/admin-network-es_ES.po new file mode 100644 index 0000000000..037f8792bc --- /dev/null +++ b/tests/phpunit/data/languages/admin-network-es_ES.po @@ -0,0 +1,32 @@ +# Translation of Network Admin in Spanish (Spain) +# This file is distributed under the same license as the Network Admin package. +msgid "" +msgstr "" +"PO-Revision-Date: 2015-11-26 00:00:19+0000\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: GlotPress/1.0-alpha-1100\n" +"Project-Id-Version: Network Admin\n" + +#: wp-admin/network/site-users.php:329 wp-admin/network/user-new.php:106 +msgid "A password reset link will be sent to the user via email." +msgstr "Se te enviará un enlace por email para que puedas cambiar la contraseña." + +#. translators: 1: NOBLOGREDIRECT 2: wp-config.php +#: wp-admin/network/settings.php:142 +msgid "If registration is disabled, please set %1$s in %2$s to a URL you will redirect visitors to if they visit a non-existent site." +msgstr "Si el registro de usuarios está desactivado , establece como valor de %1$s en %2$s una URL donde redirigir a los visitantes que accedan a un sitio inexistente." + +#: wp-admin/network/site-users.php:41 +msgid "Site users list navigation" +msgstr "Navegación por la lista de usuarios del sitio" + +#: wp-admin/network/site-users.php:42 +msgid "Site users list" +msgstr "Lista de usuarios del sitio" + +#: wp-admin/network/sites.php:50 +msgid "Sites list navigation" +msgstr "Navegación por la lista de sitios" diff --git a/tests/phpunit/data/languages/continents-cities-es_ES.mo b/tests/phpunit/data/languages/continents-cities-es_ES.mo new file mode 100644 index 0000000000000000000000000000000000000000..504d237e334ee6acbc718d3ebaae040176b2ab2a GIT binary patch literal 504 zcma)&u};G<6h#db5Mg6xFbfMZO(KEXRGCU!1yK>9QdmuDs3Cm`wo`$`Z}1PWF)}i< zATcm@Waa}Hcxf$laMG8M z2mqnUnFM^7kocILh_Tc%19rfT2&nIRd(88hU#FfMxch-$-*IuAZq#kDzEEX0px&NT8m))62SH<=1(C(TT(gw|E;!g!hwIrBU$8msJDB!)$U WdEK(A1T3rRHf>5Hg?9e`m;M0J?0Xjg literal 0 HcmV?d00001 diff --git a/tests/phpunit/data/languages/continents-cities-es_ES.po b/tests/phpunit/data/languages/continents-cities-es_ES.po new file mode 100644 index 0000000000..5c7ce1c6c5 --- /dev/null +++ b/tests/phpunit/data/languages/continents-cities-es_ES.po @@ -0,0 +1,31 @@ +# Translation of Continents & Cities in Spanish (Spain) +# This file is distributed under the same license as the Continents & Cities package. +msgid "" +msgstr "" +"PO-Revision-Date: 2015-12-29 10:06:29+0000\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: GlotPress/1.0-alpha-1100\n" +"Project-Id-Version: Continents & Cities\n" + +#: wp-admin/includes/continents-cities.php:140 +msgid "Vincennes" +msgstr "Vincennes" + +#: wp-admin/includes/continents-cities.php:141 +msgid "Winamac" +msgstr "Winamac" + +#: wp-admin/includes/continents-cities.php:142 +msgid "Inuvik" +msgstr "Inuvik" + +#: wp-admin/includes/continents-cities.php:143 +msgid "Iqaluit" +msgstr "Iqaluit" + +#: wp-admin/includes/continents-cities.php:144 +msgid "Jamaica" +msgstr "Jamaica" diff --git a/tests/phpunit/data/languages/en_GB.mo b/tests/phpunit/data/languages/en_GB.mo new file mode 100644 index 0000000000000000000000000000000000000000..b569b3b2c502c8fd5c1f534bfe3daa2051667d9a GIT binary patch literal 698 zcmb_Z!EVz)5H%1u7;&it7dQ-uO08g>Y!sogNsy{0ts+r13I%ap;-PW1*|laTp^*^( zz=3}#Kfvd3ufd@Z~${4A_+DeMWq3%7*7 zgpY;4H~R2a?Q79L;tfQr{Qm9Q|04QG>aU^?L@!0}i2e|j=o(dBeP66=+})fSS57Z7 z1%LKxIGLPGdd*E`;7uS}JqMmyhDAj3c8*X)@PWZP7d~O0B_qGIuE?RZByC2@k~#WC zW9MK&gr40BA~J9=upM{TJ#b-axd{F`RQDJ!81jN}x^6nAWPG9~xGbWC)xa_uXt(qW z)zV6LpskJWnD)zOEkSxbIv%QbNLAK=&RXd~@GKLk(^V-CR&Q^X&KAB4)0riis{i)% zQ0?91$olvZNe%rpERROR: Sorry, that username is not allowed." +msgstr "ERROR: Sorry, that username is not allowed." + +#: wp-includes/rest-api/class-wp-rest-request.php:850 +msgid "Invalid parameter." +msgstr "Invalid parameter." + +#. translators: %s: menu name +#: wp-includes/customize/class-wp-customize-nav-menu-control.php:76 +msgctxt "menu location" +msgid "(Current: %s)" +msgstr "(Current: %s)" + +#. translators: %s: menu location slug +#: wp-includes/class-wp-customize-nav-menus.php:340 +msgctxt "menu" +msgid "(Currently set to: %s)" +msgstr "(Currently set to: %s)" diff --git a/tests/phpunit/data/languages/es_ES.mo b/tests/phpunit/data/languages/es_ES.mo new file mode 100644 index 0000000000000000000000000000000000000000..921c9a7dc017aeb3fc7e244b63fa78a98facb58d GIT binary patch literal 723 zcmZ`$!EO^V5M3Z}2%IV*4saL_NU5kd*^)xENsy{0ts=E*6bj<%W~YrS$6k$RLnHAG z-1vZA5c~%D0RDg@|A54S*(9_lMtXXldC&IP^K+x}Ig+?1cp^9y+!uTll<`&25quMD z2!0733x2Qp;jL9Y5&k2!o^W}_?(HagB>YLZ^nVe4ApBkUj_?m*u`Z*`%loBt9e3BO z%D+k{FnM?Wx<48nk2>{rmckoPG~WWAXoeynIXy)%0i0*h*7^^a#nHgcv^5#znnY%# zIGUm>Dz&|W2p!uw1Y}^J!n3fs)WG_&X5-zpX{9kc8~e<-^AuXAhO0wckhW^y(=?>u@?{#j+ih4ayAGaqA!%3N zs{?dMnmwg(U_B2BL#RtHO51#*Rgy@fL-H5$L^a56+U?;Ct7;4S98DDNzqyNq2 z&_gid^jm-dWgOE}LdZ~tRA@3@DkAXW3UZ{WVUzhd8fscx$$)4n&lXoQG#^7$+Z}VE XZFw`onYqxJY?co!hqcyLNjZ+cmI}p3 literal 0 HcmV?d00001 diff --git a/tests/phpunit/data/languages/es_ES.po b/tests/phpunit/data/languages/es_ES.po new file mode 100644 index 0000000000..005ae62c3b --- /dev/null +++ b/tests/phpunit/data/languages/es_ES.po @@ -0,0 +1,37 @@ +# Translation of Development (4.4.x) in Spanish (Spain) +# This file is distributed under the same license as the Development (4.4.x) package. +msgid "" +msgstr "" +"PO-Revision-Date: 2016-01-07 18:35:45+0000\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: GlotPress/1.0-alpha-1100\n" +"Project-Id-Version: Development (4.4.x)\n" + +#. translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. +#: wp-includes/locale.php:201 +msgctxt "text direction" +msgid "ltr" +msgstr "ltr" + +#: wp-includes/user.php:2132 +msgid "ERROR: Sorry, that username is not allowed." +msgstr "ERROR: Lo siento, ese nombre de usuario no está permitido." + +#: wp-includes/rest-api/class-wp-rest-request.php:850 +msgid "Invalid parameter." +msgstr "Parámetro no válido. " + +#. translators: %s: menu name +#: wp-includes/customize/class-wp-customize-nav-menu-control.php:76 +msgctxt "menu location" +msgid "(Current: %s)" +msgstr "(Actual: %s)" + +#. translators: %s: menu location slug +#: wp-includes/class-wp-customize-nav-menus.php:340 +msgctxt "menu" +msgid "(Currently set to: %s)" +msgstr "(Actualmente fijado en: %s)" diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php index 19aa9a446c..d85799a910 100644 --- a/tests/phpunit/includes/bootstrap.php +++ b/tests/phpunit/includes/bootstrap.php @@ -26,6 +26,8 @@ require_once $config_file_path; define( 'WP_TESTS_TABLE_PREFIX', $table_prefix ); define( 'DIR_TESTDATA', dirname( __FILE__ ) . '/../data' ); +define( 'WP_LANG_DIR', DIR_TESTDATA . '/languages' ); + if ( ! defined( 'WP_TESTS_FORCE_KNOWN_BUGS' ) ) define( 'WP_TESTS_FORCE_KNOWN_BUGS', false ); diff --git a/tests/phpunit/tests/l10n.php b/tests/phpunit/tests/l10n.php index 62e89ceac9..2d55bb282b 100644 --- a/tests/phpunit/tests/l10n.php +++ b/tests/phpunit/tests/l10n.php @@ -46,4 +46,26 @@ class Tests_L10n extends WP_UnitTestCase { __( 'just some string', 'wp-tests-domain' ); $this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) ); } + + /** + * @ticket 35284 + */ + function test_wp_get_installed_translations_for_core() { + $installed_translations = wp_get_installed_translations( 'core' ); + $this->assertInternalType( 'array', $installed_translations ); + $textdomains_expected = array( 'admin', 'admin-network', 'continents-cities', 'default' ); + $this->assertEqualSets( $textdomains_expected, array_keys( $installed_translations ) ); + + $this->assertNotEmpty( $installed_translations['default']['en_GB'] ); + $data_en_GB = $installed_translations['default']['en_GB']; + $this->assertEquals( '2016-01-14 21:14:29+0000', $data_en_GB['PO-Revision-Date'] ); + $this->assertEquals( 'Development (4.4.x)', $data_en_GB['Project-Id-Version'] ); + $this->assertEquals( 'GlotPress/1.0-alpha-1100', $data_en_GB['X-Generator'] ); + + $this->assertNotEmpty( $installed_translations['admin']['es_ES'] ); + $data_es_ES = $installed_translations['admin']['es_ES']; + $this->assertEquals( '2015-12-22 20:26:46+0000', $data_es_ES['PO-Revision-Date'] ); + $this->assertEquals( 'Administration', $data_es_ES['Project-Id-Version'] ); + $this->assertEquals( 'GlotPress/1.0-alpha-1100', $data_es_ES['X-Generator'] ); + } }