From a4edbfa031eb4cd72678051f1510afde4f77951e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 28 Feb 2014 08:36:29 +0100 Subject: Update to MediaWiki 1.22.3 --- RELEASE-NOTES-1.22 | 36 +- extensions/Cite/COPYING | 339 +++++++++++++++ extensions/Cite/Cite.i18n.php | 208 ++++++--- extensions/Cite/Cite.php | 20 - extensions/Cite/Cite_body.php | 7 + extensions/Cite/SpecialCite.alias.php | 2 +- extensions/Cite/SpecialCite.i18n.php | 249 ++++++++++- extensions/Cite/citeParserTests.txt | 12 +- extensions/ConfirmEdit/Asirra.i18n.php | 93 ++++- extensions/ConfirmEdit/Captcha.php | 170 ++++++-- extensions/ConfirmEdit/ConfirmEdit.i18n.php | 327 +++++++++------ extensions/ConfirmEdit/ConfirmEdit.php | 3 +- extensions/ConfirmEdit/ConfirmEditHooks.php | 14 +- extensions/ConfirmEdit/FancyCaptcha.class.php | 3 +- extensions/ConfirmEdit/FancyCaptcha.i18n.php | 185 ++++---- extensions/ConfirmEdit/FancyCaptcha.php | 11 + extensions/ConfirmEdit/HTMLCaptchaField.php | 81 ---- extensions/ConfirmEdit/QuestyCaptcha.i18n.php | 51 +-- extensions/ConfirmEdit/ReCaptcha.i18n.php | 74 ++-- extensions/Gadgets/ApiQueryGadgets.php | 2 +- extensions/Gadgets/COPYING | 339 +++++++++++++++ extensions/Gadgets/Gadgets.alias.php | 4 +- extensions/Gadgets/Gadgets.i18n.php | 185 ++++---- extensions/Gadgets/SpecialGadgets.php | 2 +- extensions/ImageMap/COPYING | 339 +++++++++++++++ extensions/ImageMap/ImageMap.i18n.php | 8 +- extensions/ImageMap/ImageMap.php | 16 + extensions/ImageMap/ImageMap_body.php | 6 +- extensions/InputBox/InputBox.classes.php | 16 +- extensions/InputBox/InputBox.i18n.php | 49 ++- extensions/Interwiki/COPYING | 339 +++++++++++++++ extensions/Interwiki/Interwiki.alias.php | 2 +- extensions/Interwiki/Interwiki.i18n.php | 169 +++++--- extensions/Interwiki/Interwiki_body.php | 10 +- extensions/LocalisationUpdate/KNOWN_ISSUES.txt | 11 - .../LocalisationUpdate.class.php | 113 +++-- .../LocalisationUpdate/LocalisationUpdate.i18n.php | 14 +- .../LocalisationUpdate/LocalisationUpdate.php | 14 +- extensions/LocalisationUpdate/QuickArrayReader.php | 199 +++++---- extensions/LocalisationUpdate/README | 34 ++ extensions/LocalisationUpdate/README_FIRST.txt | 8 - extensions/LocalisationUpdate/tests/tokenTest.php | 61 +-- extensions/LocalisationUpdate/update.php | 5 +- extensions/Nuke/COPYING | 8 - extensions/Nuke/Nuke.alias.php | 4 +- extensions/Nuke/Nuke.hooks.php | 27 ++ extensions/Nuke/Nuke.i18n.php | 300 ++++++++++--- extensions/Nuke/Nuke.php | 5 +- .../ParserFunctions/ParserFunctions.i18n.magic.php | 95 +++-- .../ParserFunctions/ParserFunctions.i18n.php | 97 ++++- extensions/ParserFunctions/ParserFunctions.php | 12 +- .../ParserFunctions/ParserFunctions_body.php | 2 +- extensions/PdfHandler/COPYING | 339 +++++++++++++++ extensions/PdfHandler/PdfHandler.i18n.php | 17 +- extensions/PdfHandler/PdfHandler_body.php | 4 +- extensions/Poem/Poem.i18n.php | 19 +- extensions/Renameuser/COPYING | 339 +++++++++++++++ extensions/Renameuser/README | 2 +- extensions/Renameuser/Renameuser.alias.php | 4 +- extensions/Renameuser/Renameuser.hooks.php | 14 +- extensions/Renameuser/Renameuser.i18n.php | 137 ++++-- extensions/Renameuser/Renameuser.php | 1 + extensions/Renameuser/RenameuserSQL.php | 3 +- .../Renameuser/specials/SpecialRenameuser.php | 2 +- extensions/SpamBlacklist/SpamBlacklist.i18n.php | 194 +++++++-- extensions/SpamBlacklist/SpamBlacklist.php | 4 + extensions/SpamBlacklist/SpamBlacklist_body.php | 9 +- extensions/SpamBlacklist/api/ApiSpamBlacklist.php | 78 ++++ extensions/SyntaxHighlight_GeSHi/COPYING | 339 +++++++++++++++ .../SyntaxHighlight_GeSHi.class.php | 43 +- .../SyntaxHighlight_GeSHi.i18n.php | 27 +- extensions/SyntaxHighlight_GeSHi/geshi/geshi.php | 2 +- .../SyntaxHighlight_GeSHi/geshi/geshi/haskell.php | 10 +- extensions/TitleBlacklist/COPYING | 339 +++++++++++++++ extensions/TitleBlacklist/TitleBlacklist.i18n.php | 78 ++-- .../TitleBlacklist/TitleBlacklist.library.php | 33 ++ extensions/TitleBlacklist/TitleBlacklist.list.php | 53 ++- extensions/TitleBlacklist/TitleBlacklist.php | 11 + .../TitleBlacklist/mw.ext.TitleBlacklist.lua | 22 + .../tests/ApiQueryTitleBlacklistTest.php | 22 + extensions/TitleBlacklist/tests/testSource | 1 + extensions/WikiEditor/.jshintignore | 2 + extensions/WikiEditor/.jshintrc | 32 +- extensions/WikiEditor/COPYING | 339 +++++++++++++++ extensions/WikiEditor/WikiEditor.i18n.php | 465 +++++++++++++++------ .../WikiEditor/modules/ext.wikiEditor.dialogs.js | 7 +- .../WikiEditor/modules/ext.wikiEditor.highlight.js | 3 +- extensions/WikiEditor/modules/ext.wikiEditor.js | 3 +- .../WikiEditor/modules/ext.wikiEditor.preview.js | 3 +- .../modules/ext.wikiEditor.previewDialog.js | 3 +- .../WikiEditor/modules/ext.wikiEditor.publish.js | 3 +- .../modules/ext.wikiEditor.templateEditor.js | 19 +- .../WikiEditor/modules/ext.wikiEditor.templates.js | 19 +- .../modules/ext.wikiEditor.tests.toolbar.js | 16 +- .../WikiEditor/modules/ext.wikiEditor.toc.js | 3 +- .../modules/ext.wikiEditor.toolbar.hideSig.js | 4 +- .../WikiEditor/modules/ext.wikiEditor.toolbar.js | 3 +- .../modules/images/toolbar/format-bold-hy.png | Bin 0 -> 1675 bytes .../modules/images/toolbar/format-italic-hy.png | Bin 0 -> 1475 bytes .../WikiEditor/modules/jquery.wikiEditor.css | 3 - .../modules/jquery.wikiEditor.dialogs.config.js | 59 +-- .../modules/jquery.wikiEditor.dialogs.js | 34 +- .../modules/jquery.wikiEditor.highlight.js | 41 +- .../WikiEditor/modules/jquery.wikiEditor.iframe.js | 202 ++++----- extensions/WikiEditor/modules/jquery.wikiEditor.js | 61 +-- .../modules/jquery.wikiEditor.preview.js | 15 +- .../modules/jquery.wikiEditor.previewDialog.js | 15 +- .../modules/jquery.wikiEditor.publish.js | 13 +- .../modules/jquery.wikiEditor.templateEditor.js | 137 +++--- .../modules/jquery.wikiEditor.templates.js | 51 ++- .../WikiEditor/modules/jquery.wikiEditor.toc.js | 136 +++--- .../modules/jquery.wikiEditor.toolbar.config.js | 7 +- .../modules/jquery.wikiEditor.toolbar.js | 53 ++- includes/DefaultSettings.php | 2 +- includes/User.php | 22 +- includes/Wiki.php | 13 +- includes/api/ApiFormatBase.php | 18 +- includes/db/DatabaseOracle.php | 32 +- includes/db/DatabasePostgres.php | 16 +- includes/installer/WebInstallerPage.php | 9 +- includes/specials/SpecialPrefixindex.php | 1 + includes/upload/UploadBase.php | 71 +++- languages/messages/MessagesEn.php | 1 + languages/messages/MessagesQqq.php | 8 + maintenance/postgres/tables.sql | 4 +- 125 files changed, 6813 insertions(+), 1661 deletions(-) create mode 100644 extensions/Cite/COPYING delete mode 100644 extensions/ConfirmEdit/HTMLCaptchaField.php create mode 100644 extensions/Gadgets/COPYING create mode 100644 extensions/ImageMap/COPYING create mode 100644 extensions/Interwiki/COPYING delete mode 100644 extensions/LocalisationUpdate/KNOWN_ISSUES.txt create mode 100644 extensions/LocalisationUpdate/README delete mode 100644 extensions/LocalisationUpdate/README_FIRST.txt create mode 100644 extensions/Nuke/Nuke.hooks.php create mode 100644 extensions/PdfHandler/COPYING create mode 100644 extensions/Renameuser/COPYING create mode 100644 extensions/SpamBlacklist/api/ApiSpamBlacklist.php create mode 100644 extensions/SyntaxHighlight_GeSHi/COPYING create mode 100644 extensions/TitleBlacklist/COPYING create mode 100644 extensions/TitleBlacklist/TitleBlacklist.library.php create mode 100644 extensions/TitleBlacklist/mw.ext.TitleBlacklist.lua create mode 100644 extensions/WikiEditor/COPYING create mode 100644 extensions/WikiEditor/modules/images/toolbar/format-bold-hy.png create mode 100644 extensions/WikiEditor/modules/images/toolbar/format-italic-hy.png diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index ed64aa4d..9862e5eb 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -3,15 +3,45 @@ Security reminder: MediaWiki does not require PHP's register_globals. If you have it on, turn it '''off''' if you can. +== MediaWiki 1.22.3 == + +This is a security and bugfix release of the MediaWiki 1.22 branch. + +=== Changes since 1.22.2 === +* (bug 60771) SECURITY: Disallow uploading SVG files using non-whitelisted + namespaces. Also disallow iframe elements. User will get an error + including the namespace name if they use a non- whitelisted namespace. +* (bug 61346) SECURITY: Make token comparison use constant time. It seems like + our token comparison would be vulnerable to timing attacks. This will take + constant time. +* (bug 61362) SECURITY: API: Don't find links in the middle of api.php links. +* (bug 53710) Add sequence support for upsert in DatabaseOracle in the same way + as in selectInsert +* (bug 60231, 58719) Various fixes to job running code in Wiki.php: Make it + async on Windows. Fixed possible "invalid filename" errors on Windows. + Redirect output to dev/null to avoid hanging PHP. +* (bug 60083) Correct sequence name for fresh Postgres installation. Spotted + by gebhkla +* (bug 60531) Avoid variable naming conflicts in + DatabasePostgres::selectSQLText. Spotted by gebhkla +* (bug 60094) Fix rebuildall.php fatal error with PostgreSQL. The fix for + 47055 introduced a fatal error when running rebuildall.php. This is a + workaround suggested by gebhkla on Bugzilla. It just checks to make sure + $options is actually an array before calling array_search on it. +* (bug 43817c12) Add error handling if descriptionmsg isn't defined for + extension. +* (bug 60543) Special:PrefixIndex omits stripprefix=1 for "Next page" link. + == MediaWiki 1.22.2 == This is a security and bugfix release of the MediaWiki 1.22 branch. === Changes since 1.22.1 === -* (bug 60339) SECURITY: Sanitize shell arguments to DjVu files, and other media formats -* (bug 58253) Check for very old PCRE versions in installer and updater -* (bug 60054) Make WikiPage::$mPreparedEdit public +* (bug 60339) SECURITY: Sanitize shell arguments to DjVu files, and other media + formats. +* (bug 58253) Check for very old PCRE versions in installer and updater. +* (bug 60054) Make WikiPage::$mPreparedEdit public. == MediaWiki 1.22.1 == diff --git a/extensions/Cite/COPYING b/extensions/Cite/COPYING new file mode 100644 index 00000000..d159169d --- /dev/null +++ b/extensions/Cite/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/extensions/Cite/Cite.i18n.php b/extensions/Cite/Cite.i18n.php index 2f204203..895a4d80 100644 --- a/extensions/Cite/Cite.i18n.php +++ b/extensions/Cite/Cite.i18n.php @@ -249,6 +249,7 @@ Defina-ne mas en o mensache [[MediaWiki:$2]].', /** Arabic (العربية) * @author Aiman titi + * @author Asaifm * @author Meno25 * @author OsamaK * @author زكريا @@ -279,7 +280,7 @@ $messages['ar'] = array( لا نص تم توفيره للمراجع المسماة $1', 'cite_error_included_ref' => 'إغلاق </ref> مفقود لوسم <ref>', 'cite_error_refs_without_references' => 'وسم <ref> موجود، لكن لا وسم <references/> تم العثور عليه', - 'cite_error_group_refs_without_references' => 'وسوم <ref> موجودة لمجموعة اسمها "$1"، لكن لا وسم <references group="$1"/> مماثل تم العثور عليه', # Fuzzy + 'cite_error_group_refs_without_references' => 'وسوم <ref> موجودة لمجموعة اسمها "$1"، ولكن لم يتم العثور على وسم <references group="$1"/> أو هناك وسم </ref> ناقص', 'cite_error_references_group_mismatch' => 'الوسم <ref> في <references> فيه خاصية group متضاربة "$1".', 'cite_error_references_missing_group' => 'الوسم <ref> المُعرّف في <references> فيه خاصية group "$1" التي لا تظهر في النص السابق.', 'cite_error_references_missing_key' => 'الوسم <ref> ذو الاسم "$1" المُعرّف في <references> غير مستخدم في النص السابق.', @@ -287,6 +288,8 @@ $messages['ar'] = array( 'cite_error_empty_references_define' => 'الوسم <ref> المُعرّف في <references> بالاسم "$1" ليس له محتوى.', 'cite_references_link_many' => '
  • ^ $2 $3
  • ', 'cite_references_link_many_format_backlink_labels' => 'أ ب ت ث ج ح خ د ذ ر ز س ش ص ض ط ظ ع غ ف ق ك ل م ن ه و ي أأ أب أت أث أج أح أخ أد أذ أر أز أس أش أص أض أط أظ أع أغ أف أق أك أل أم أن أه أو أي بأ بب بت بث بج بح بخ بد بذ بر بز بس بش بص بض بط بظ بع بغ بف بق بك بل بم بن به بو بي تأ تب تت تث تج تح تخ تد تذ تر تز تس تش تص تض تط تظ تع تغ تف تق تك تل تم تن ته تو تي ثأ ثب ثت ثث ثج ثح ثخ ثد ثذ ثر ثز ثس ثش ثص ثض ثط ثظ ثع ثغ ثف ثق ثك ثل ثم ثن ثه ثو ثي جأ جب جت جث جج جح جخ جد جذ جر جز جس جش جص جض جط جظ جع جغ جف جق جك جل جم جن جه جو جي حأ حب حت حث حج حح حخ حد حذ حر حز حس حش حص حض حط حظ حع حغ حف حق حك حل حم حن حه حو حي خأ خب خت خث خج خح خخ خد خذ خر خز خس خش خص خض خط خظ خع خغ خف خق خك خل خم خن خه خو خي دأ دب دت دث دج دح دخ دد دذ در دز دس دش دص دض دط دظ دع دغ دف دق دك دل دم دن ده دو دي ذأ ذب ذت ذث ذج ذح ذخ ذد ذذ ذر ذز ذس ذش ذص ذض ذط ذظ ذع ذغ ذف ذق ذك ذل ذم ذن ذه ذو ذي رأ رب رت رث رج رح رخ رد رذ رر رز رس رش رص رض رط رظ رع رغ رف رق رك رل رم رن ره رو ري زأ زب زت زث زج زح زخ زد زذ زر زز زس زش زص زض زط زظ زع زغ زف زق زك زل زم زن زه زو زي سأ سب ست سث سج سح سخ سد سذ سر سز سس سش سص سض سط سظ سع سغ سف سق سك سل سم سن سه سو سي شأ شب شت شث شج شح شخ شد شذ شر شز شس شش شص شض شط شظ شع شغ شف شق شك شل شم شن شه شو شي صأ صب صت صث صج صح صخ صد صذ صر صز صس صش صص صض صط صظ صع صغ صف صق صك صل صم صن صه صو صي ضأ ضب ضت ضث ضج ضح ضخ ضد ضذ ضر ضز ضس ضش ضص ضض ضط ضظ ضع ضغ ضف ضق ضك ضل ضم ضن ضه ضو ضي طأ طب طت طث طج طح طخ طد طذ طر طز طس طش طص طض طط طظ طع طغ طف طق طك طل طم طن طه طو طي ظأ ظب ظت ظث ظج ظح ظخ ظد ظذ ظر ظز ظس ظش ظص ظض ظط ظظ ظع ظغ ظف ظق ظك ظل ظم ظن ظه ظو ظي عأ عب عت عث عج عح عخ عد عذ عر عز عس عش عص عض عط عظ عع عغ عف عق عك عل عم عن عه عو عي غأ غب غت غث غج غح غخ غد غذ غر غز غس غش غص غض غط غظ غع غغ غف غق غك غل غم غن غه غو غي فأ فب فت فث فج فح فخ فد فذ فر فز فس فش فص فض فط فظ فع فغ فف فق فك فل فم فن فه فو في قأ قب قت قث قج قح قخ قد قذ قر قز قس قش قص قض قط قظ قع قغ قف قق قك قل قم قن قه قو قي كأ كب كت كث كج كح كخ كد كذ كر كز كس كش كص كض كط كظ كع كغ كف كق كك كل كم كن كه كو كي لأ لب لت لث لج لح لخ لد لذ لر لز لس لش لص لض لط لظ لع لغ لف لق لك لل لم لن له لو لي مأ مب مت مث مج مح مخ مد مذ مر مز مس مش مص مض مط مظ مع مغ مف مق مك مل مم من مه مو مي نأ نب نت نث نج نح نخ ند نذ نر نز نس نش نص نض نط نظ نع نغ نف نق نك نل نم نن نه نو ني هأ هب هت هث هج هح هخ هد هذ هر هز هس هش هص هض هط هظ هع هغ هف هق هك هل هم هن هه هو هي وأ وب وت وث وج وح وخ ود وذ ور وز وس وش وص وض وط وظ وع وغ وف وق وك ول وم ون وه وو وي يأ يب يت يث يج يح يخ يد يذ ير يز يس يش يص يض يط يظ يع يغ يف يق يك يل يم ين يه يو يي', + 'cite_references_link_accessibility_label' => 'تعدى المحتوى الحالي إلى أعلى الصفحة', + 'cite_references_link_many_accessibility_label' => 'تعدى إلى الأعلى ل:', ); /** Aramaic (ܐܪܡܝܐ) @@ -714,7 +717,7 @@ Defineix més al missatge [[MediaWiki:$2]].', 'cite_error_references_no_text' => "Etiqueta <ref> no vàlida; no s'ha proporcionat text per les refs amb l'etiqueta $1", 'cite_error_included_ref' => 'Es tanca el </ref> que manca per una etiqueta <ref>', - 'cite_error_refs_without_references' => 'Hi ha etiquetes <ref> però no cap etiqueta <references/>', + 'cite_error_refs_without_references' => "Hi ha etiquetes <ref> però no s'ha trobat cap etiqueta <references/>", 'cite_error_group_refs_without_references' => 'Existeixen etiquetes <ref> pel grup «$1» però no l\'etiqueta <references group="$1"/> corresponent', # Fuzzy 'cite_error_references_group_mismatch' => 'L\'etiqueta <ref> a <references> té un conflicte amb l\'atribut de grup "$1".', 'cite_error_references_missing_group' => 'L\'etiqueta <ref> definida a <references> té l\'atribut de grup "$1" que no apareix en el text anterior.', @@ -727,6 +730,7 @@ no s'ha proporcionat text per les refs amb l'etiqueta $1", * @author Умар */ $messages['ce'] = array( + 'cite-desc' => ' а тегаш тӀетовжорашан тӀетуху', 'cite_error' => 'ГӀалат дешнаш далорна $1', 'cite_error_references_no_text' => 'Тег <ref> нийса яц; тIетовжаран $1 йоза яздина дац', 'cite_error_refs_without_references' => 'Йолуш йолу тегаца <ref> йогӀуш йолу тег <references/> ца карийна', @@ -735,7 +739,7 @@ $messages['ce'] = array( 'cite_references_link_many_accessibility_label' => 'Дехьа гӀо:', ); -/** Czech (česky) +/** Czech (čeština) * @author Danny B. * @author Li-sung * @author Littledogboy @@ -770,7 +774,7 @@ Zvyšte jejich počet ve zprávě [[MediaWiki:$2]].', 'cite_references_link_many_accessibility_label' => 'Skočit nahoru k:', ); -/** Church Slavic (словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) +/** Church Slavic (словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) * @author ОйЛ */ $messages['cu'] = array( @@ -853,12 +857,13 @@ Definer flere i beskeden [[MediaWiki:$2]].', /** German (Deutsch) * @author Kghbln * @author Metalhead64 + * @author Purodha * @author Raimond Spekking * @author The Evil IP address * @author Umherirrender */ $messages['de'] = array( - 'cite-desc' => 'Ergänzt die Tags und für die Referenzierung von Wikiseiten', + 'cite-desc' => 'Ergänzt die Tags und für Referenzierungen in Wikiseiten', 'cite_error' => 'Referenzfehler: $1', 'cite_error_ref_numeric_key' => 'Ungültige Verwendung von <ref>: Der Parameter „name“ darf kein reiner Zahlenwert sein. Benutze einen beschreibenden Namen.', 'cite_error_ref_no_key' => 'Ungültige Verwendung von <ref>: Der Parameter „ref“ ohne Inhalt muss einen Namen haben.', @@ -980,12 +985,14 @@ Definěruj dalšne w powěsći [[MediaWiki:$2]].', za ref z mjenim $1 njejo se tekst pódał', 'cite_error_included_ref' => 'Kóńceca toflicka </ref> felujo za toflicku <ref>', 'cite_error_refs_without_references' => 'Toflicki <ref> eksistěruju, ale toflicka <references/> njejo se namakała', - 'cite_error_group_refs_without_references' => 'Toflicki <ref> eksistěruju za kupku z mjenim "$1", ale wótpowědujuca toflicka <references group="$1"/> njejo se namakała', # Fuzzy + 'cite_error_group_refs_without_references' => 'Toflicki <ref> eksistěruju za kupku z mjenim "$1", ale wótpowědujuca toflicka <references group="$1"/> njejo se namakała abo zacynjacy </ref> felujo', 'cite_error_references_group_mismatch' => 'Toflicka <ref> w <references> jo ze kupkowym atributom "$1" w konflikśe.', 'cite_error_references_missing_group' => 'Toflicka <ref>, kótaraž jo w <references> definěrowana, ma kupkowy atribut "$1", kótaryž njepokazujo se w pjerwjejšnem teksće.', 'cite_error_references_missing_key' => 'Toflicka <ref> z mjenim "$1", kótaraž jo w <references> definěrowana, njewužywa se w pjerwjejšnem teksće.', 'cite_error_references_no_key' => 'Toflicka <ref>, kótaraž jo w <references> definěrowana, njama mjenjowy atribut.', 'cite_error_empty_references_define' => 'Toflicka <ref>, kótaraž jo w <references> z mjenim "$1" definěrowana, njama wopśimjeśe.', + 'cite_references_link_accessibility_label' => 'Górjej skócyś', + 'cite_references_link_many_accessibility_label' => 'Górjej skócys do:', ); /** Greek (Ελληνικά) @@ -1070,7 +1077,9 @@ neniu teksto estis donita por ref-oj nomataj $1', * @author Crazymadlover * @author Drini * @author Erdemaslancan + * @author Fitoschido * @author Gustronico + * @author Ihojose * @author Locos epraix * @author Manuelt15 * @author McDutchie @@ -1104,13 +1113,15 @@ Define más en el mensaje [[MediaWiki:$2]].', no se ha definido el contenido de las referencias llamadas $1', 'cite_error_included_ref' => 'Etiqueta de apertura <ref> sin su correspondiente cierre </ref>', 'cite_error_refs_without_references' => 'Existen etiquetas <ref>, pero no se encontró una etiqueta <references />', - 'cite_error_group_refs_without_references' => 'Existen etiquetas <ref> para un grupo llamado "$1", pero no se encontró una etiqueta <references group="$1"/>', # Fuzzy + 'cite_error_group_refs_without_references' => 'Existen etiquetas <ref> para un grupo llamado «$1», pero no se encontró la etiqueta <references group="$1"/> correspondiente, o falta la etiqueta </ref> de cierre', 'cite_error_references_group_mismatch' => 'La etiqueta <ref> en <references> presenta el atributo de grupo "$1" en conflicto.', 'cite_error_references_missing_group' => 'La etiqueta <ref> definida en <references> pertenece al grupo "$1" no declarado en el texto precedente.', 'cite_error_references_missing_key' => 'La etiqueta <ref> con nombre "$1" definida en <references> no se utiliza en el texto precedente.', 'cite_error_references_no_key' => 'La etiqueta <ref> definida en <references> no tiene atributo de nombre.', 'cite_error_empty_references_define' => 'La etiqueta <ref> definida en <references> con nombre "$1" no tiene contenido.', 'cite_references_link_many_format_backlink_labels' => 'a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej ek el em en eo ep eq er es et eu ev ew ex ey ez fa fb fc fd fe ff fg fh fi fj fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gf gg gh gi gj gk gl gm gn go gp gq gr gs gt gu gv gw gx gy gz ha hb hc hd he hf hg hh hi hj hk hl hm hn ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il im in io ip iq ir is it iu iv iw ix iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn ko kp kq kr ks kt ku kv kw kx ky kz la lb lc ld le lf lg lh li lj lk ll lm ln lo lp lq lr ls lt lu lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo op oq or os ot ou ov ow ox oy oz pa pb pc pd pe pf pg ph pi pj pk pl pm pn po pp pq pr ps pt pu pv pw px py pz qa qb qc qd qe qf qg qh qi qj qk ql qm qn qo qp qq qr qs qt qu qv qw qx qy qz ra rb rc rd re rf rg rh ri rj rk rl rm rn ro rp rq rr rs rt ru rv rw rx ry rz sa sb sc sd se sf sg sh si sj sk sl sm sn so sp sq sr ss st su sv sw sx sy sz ta tb tc td te tf tg th ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty tz ua ub uc ud ue uf ug uh ui uj uk ul um un uo up uq ur us ut uu uv uw ux uy uz va vb vc vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz wa wb wc wd we wf wg wh wi wj wk wl wm wn wo wp wq wr ws wt wu wv ww wx wy wz xa xb xc xd xe xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk yl ym yn yo yp yq yr ys yt yu yv yw yx yy yz za zb zc zd ze zf zg zh zi zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz', + 'cite_references_link_accessibility_label' => 'Ir a', + 'cite_references_link_many_accessibility_label' => 'Saltar a:', ); /** Estonian (eesti) @@ -1180,7 +1191,7 @@ $messages['fa'] = array( 'cite_error_references_no_text' => 'برچسب نامجاز؛ متنی برای یادکردهای با نام $1 وارد نشده‌است', 'cite_error_included_ref' => 'برچسب تمام کنندهٔ </ref> بدون برچسب <ref>', 'cite_error_refs_without_references' => 'برچسب <ref> وجود دارد اما برچسب <references/> پیدا نشد', - 'cite_error_group_refs_without_references' => 'برچسب <ref> برای گروهی به نام «$1» وجود دارد، اما برچسب <references group="$1"/> متناظر پیدا نشد', # Fuzzy + 'cite_error_group_refs_without_references' => 'برچسب <ref> برای گروهی به نام «$1» وجود دارد، اما برچسب متناظر با <references group="$1"/> یافت نشد یا </ref> بسته جا گذاشته شده‌است.', 'cite_error_references_group_mismatch' => 'برچسپ <ref> درون <references> در تضاد با ویژگی‌های گروه «$1» است.', 'cite_error_references_missing_group' => 'برچسپ <ref> در <references> تعریف شده، ویژگی‌های گروهی «$1» را دارد که درون متن قبل از آن ظاهر نمی‌شود.', 'cite_error_references_missing_key' => 'پرچسپ <ref> که با نام «$1» درون <references> تعریف شده، در متن قبل از آن استفاده نشده‌است.', @@ -1188,6 +1199,8 @@ $messages['fa'] = array( 'cite_error_empty_references_define' => 'برچسپ <ref> تعریف شده درون <references> با نام «$1» محتوایی ندارد.', 'cite_reference_link_key_with_num' => '$1_$2', 'cite_reference_link_prefix' => 'cite_ref-', + 'cite_references_link_accessibility_label' => 'پرش به بالا', + 'cite_references_link_many_accessibility_label' => 'پرش به بالا به:', ); /** Finnish (suomi) @@ -1278,6 +1291,7 @@ aucun texte n’a été fourni pour les références nommées $1.', 'cite_error_references_missing_key' => 'La balise <ref> avec le nom « $1 » définie dans <references> n’est pas utilisé dans le texte précédent.', 'cite_error_references_no_key' => 'La balise <ref> définie dans <references> n’a pas d’attribut de nom.', 'cite_error_empty_references_define' => 'La balise <ref> défini dans <references> avec le nom « $1 » n’a pas de contenu.', + 'cite_references_link_many_format' => '[[#$1|$2]]', 'cite_references_link_many_sep' => ', ', 'cite_references_link_many_and' => ' et ', 'cite_references_link_accessibility_label' => 'Aller', @@ -1490,10 +1504,11 @@ $messages['he'] = array( /** Hindi (हिन्दी) * @author Ansumang * @author Kaustubh + * @author Shubhamkanodia * @author Siddhartha Ghai */ $messages['hi'] = array( - 'cite-desc' => ' और टैग जोड़ता है, उद्धरणों के लिये।', + 'cite-desc' => 'उद्धरणों के लिये और टैग जोड़ता है।', 'cite_error' => 'सन्दर्भ त्रुटि: $1', 'cite_error_ref_numeric_key' => 'अमान्य <ref> टैग; नाम साधारण संख्या (integer) नहीं हो सकता, कृपया विस्तृत शीर्षक दें।', @@ -1523,8 +1538,9 @@ $messages['hi'] = array( 'cite_error_references_missing_key' => '<references> में "$1" नाम के साथ परिभाषित <ref> टैग उससे पहले के पाठ में प्रयुक्त नहीं है।', 'cite_error_references_no_key' => '<references> टैग में परिभाषित <ref> टैग का कोई नाम नहीं है।', 'cite_error_empty_references_define' => '<references> टैग में परिभाषित "$1" नामक <ref> टैग में कोई सामग्री नहीं है।', - 'cite_references_link_accessibility_label' => 'वापिस ऊपर जायें', - 'cite_references_link_many_accessibility_label' => 'इस तक वापिस ऊपर जायें:', + 'cite_references_link_many_format_backlink_labels' => 'अ आ इ ई उ ऊ ए ऐ ओ औ क ख ग घ ङ च छ ज झ ञ ट ठ ड ढ ण त थ द ध न प फ ब भ म य र ल व श ष स ह अ॰अ अ॰आ अ॰इ अ॰ई अ॰उ अ॰ऊ अ॰ए अ॰ऐ अ॰ओ अ॰औ अ॰क अ॰ख अ॰ग अ॰घ अ॰ङ अ॰च अ॰छ अ॰ज अ॰झ अ॰ञ अ॰ट अ॰ठ अ॰ड अ॰ढ अ॰ण अ॰त अ॰थ अ॰द अ॰ध अ॰न अ॰प अ॰फ अ॰ब अ॰भ अ॰म अ॰य अ॰र अ॰ल अ॰व अ॰श अ॰ष अ॰स अ॰ह आ॰अ आ॰आ आ॰इ आ॰ई आ॰उ आ॰ऊ आ॰ए आ॰ऐ आ॰ओ आ॰औ आ॰क आ॰ख आ॰ग आ॰घ आ॰ङ आ॰च आ॰छ आ॰ज आ॰झ आ॰ञ आ॰ट आ॰ठ आ॰ड आ॰ढ आ॰ण आ॰त आ॰थ आ॰द आ॰ध आ॰न आ॰प आ॰फ आ॰ब आ॰भ अ॰म आ॰य आ॰र आ॰ल आ॰व आ॰श आ॰ष आ॰स आ॰ह इ॰अ इ॰आ इ॰इ इ॰ई इ॰उ इ॰ऊ इ॰ए इ॰ऐ इ॰ओ इ॰औ इ॰क इ॰ख इ॰ग इ॰घ इ॰ङ इ॰च इ॰छ इ॰ज इ॰झ इ॰ञ इ॰ट इ॰ठ इ॰ड इ॰ढ इ॰ण इ॰त इ॰थ इ॰द इ॰ध इ॰न इ॰प इ॰फ इ॰ब इ॰भ इ॰म इ॰य इ॰र इ॰ल इ॰व इ॰श इ॰ष इ॰स इ॰ह ई॰अ ई॰आ ई॰इ ई॰ई ई॰उ ई॰ऊ ई॰ए ई॰ऐ ई॰ओ ई॰औ ई॰क ई॰ख ई॰ग ई॰घ ई॰ङ ई॰च ई॰छ ई॰ज ई॰झ ई॰ञ ई॰ट ई॰ठ ई॰ड ई॰ढ ई॰ण ई॰त ई॰थ ई॰द ई॰ध ई॰न ई॰प ई॰फ ई॰ब ई॰भ ई॰म ई॰य ई॰र ई॰ल ई॰व ई॰श ई॰ष ई॰स ई॰ह उ॰अ उ॰आ उ॰इ उ॰ई उ॰उ उ॰ऊ उ॰ए उ॰ऐ उ॰ओ उ॰औ उ॰क उ॰ख उ॰ग उ॰घ उ॰ङ उ॰च उ॰छ उ॰ज उ॰झ उ॰ञ उ॰ट उ॰ठ उ॰ड उ॰ढ उ॰ण उ॰त उ॰थ उ॰द उ॰ध उ॰न उ॰प उ॰फ उ॰ब उ॰भ उ॰म उ॰य उ॰र उ॰ल उ॰व उ॰श उ॰ष उ॰स उ॰ह ऊ॰अ ऊ॰आ ऊ॰इ ऊ॰ई ऊ॰उ ऊ॰ऊ ऊ॰ए ऊ॰ऐ ऊ॰ओ ऊ॰औ ऊ॰क ऊ॰ख ऊ॰ग ऊ॰घ ऊ॰ङ ऊ॰च ऊ॰छ ऊ॰ज ऊ॰झ ऊ॰ञ ऊ॰ट ऊ॰ठ ऊ॰ड ऊ॰ढ ऊ॰ण ऊ॰त ऊ॰थ ऊ॰द ऊ॰ध ऊ॰न ऊ॰प ऊ॰फ ऊ॰ब ऊ॰भ ऊ॰म ऊ॰य ऊ॰र ऊ॰ल ऊ॰व ऊ॰श ऊ॰ष ऊ॰स ऊ॰ह ए॰अ ए॰आ ए॰इ ए॰ई ए॰उ ए॰ऊ ए॰ए ए॰ऐ ए॰ओ ए॰औ ए॰क ए॰ख ए॰ग ए॰घ ए॰ङ ए॰च ए॰छ ए॰ज ए॰झ ए॰ञ ए॰ट ए॰ठ ए॰ड ए॰ढ ए॰ण ए॰त ए॰थ ए॰द ए॰ध ए॰न ए॰प ए॰फ ए॰ब ए॰भ ए॰म ए॰य ए॰र ए॰ल ए॰व ए॰श ए॰ष ए॰स ए॰ह ऐ॰अ ऐ॰आ ऐ॰इ ऐ॰ई ऐ॰उ ऐ॰ऊ ऐ॰ए ऐ॰ऐ ऐ॰ओ ऐ॰औ ऐ॰क ऐ॰ख ऐ॰ग ऐ॰घ ऐ॰ङ ऐ॰च ऐ॰छ ऐ॰ज ऐ॰झ ऐ॰ञ ऐ॰ट ऐ॰ठ ऐ॰ड ऐ॰ढ ऐ॰ण ऐ॰त ऐ॰थ ऐ॰द ऐ॰ध ऐ॰न ऐ॰प ऐ॰फ ऐ॰ब ऐ॰भ ऐ॰म ऐ॰य ऐ॰र ऐ॰ल ऐ॰व ऐ॰श ऐ॰ष ऐ॰स ऐ॰ह ओ॰अ ओ॰आ ओ॰इ ओ॰ई ओ॰उ ओ॰ऊ ओ॰ए ओ॰ऐ ओ॰ओ ओ॰औ ओ॰क ओ॰ख ओ॰ग ओ॰घ ओ॰ङ ओ॰च ओ॰छ ओ॰ज ओ॰झ ओ॰ञ ओ॰ट ओ॰ठ ओ॰ड ओ॰ढ ओ॰ण ओ॰त ओ॰थ ओ॰द ओ॰ध ओ॰न ओ॰प ओ॰फ ओ॰ब ओ॰भ ओ॰म ओ॰य ओ॰र ओ॰ल ओ॰व ओ॰श ओ॰ष ओ॰स ओ॰ह औ॰अ औ॰आ औ॰इ औ॰ई औ॰उ औ॰ऊ औ॰ए औ॰ऐ औ॰ओ औ॰औ औ॰क औ॰ख औ॰ग औ॰घ औ॰ङ औ॰च औ॰छ औ॰ज औ॰झ औ॰ञ औ॰ट औ॰ठ औ॰ड औ॰ढ औ॰ण औ॰त औ॰थ औ॰द औ॰ध औ॰न औ॰प औ॰फ औ॰ब औ॰भ औ॰म औ॰य औ॰र औ॰ल औ॰व औ॰श औ॰ष औ॰स औ॰ह क॰अ क॰आ क॰इ क॰ई क॰उ क॰ऊ क॰ए क॰ऐ क॰ओ क॰औ क॰क क॰ख क॰ग क॰घ क॰ङ क॰च क॰छ क॰ज क॰झ क॰ञ क॰ट क॰ठ क॰ड क॰ढ क॰ण क॰त क॰थ क॰द क॰ध क॰न क॰प क॰फ क॰ब क॰भ क॰म क॰य क॰र क॰ल क॰व क॰श क॰ष क॰स क॰ह ख॰अ ख॰आ ख॰इ ख॰ई ख॰उ ख॰ऊ ख॰ए ख॰ऐ ख॰ओ ख॰औ ख॰क ख॰ख ख॰ग ख॰घ ख॰ङ ख॰च ख॰छ ख॰ज ख॰झ ख॰ञ ख॰ट ख॰ठ ख॰ड ख॰ढ ख॰ण ख॰त ख॰थ ख॰द ख॰ध ख॰न ख॰प ख॰फ ख॰ब ख॰भ ख॰म ख॰य ख॰र ख॰ल ख॰व ख॰श ख॰ष ख॰स ख॰ह ग॰अ ग॰आ ग॰इ ग॰ई ग॰उ ग॰ऊ ग॰ए ग॰ऐ ग॰ओ ग॰औ ग॰क ग॰ख ग॰ग ग॰घ ग॰ङ ग॰च ग॰छ ग॰ज ग॰झ ग॰ञ ग॰ट ग॰ठ ग॰ड ग॰ढ ग॰ण ग॰त ग॰थ ग॰द ग॰ध ग॰न ग॰प ग॰फ ग॰ब ग॰भ ग॰म ग॰य ग॰र ग॰ल ग॰व ग॰श ग॰ष ग॰स ग॰ह घ॰अ घ॰आ घ॰इ घ॰ई घ॰उ घ॰ऊ घ॰ए घ॰ऐ घ॰ओ घ॰औ घ॰क घ॰ख घ॰ग घ॰घ घ॰ङ घ॰च घ॰छ घ॰ज घ॰झ घ॰ञ घ॰ट घ॰ठ घ॰ड घ॰ढ घ॰ण घ॰त घ॰थ घ॰द घ॰ध घ॰न घ॰प घ॰फ घ॰ब घ॰भ घ॰म घ॰य घ॰र घ॰ल घ॰व घ॰श घ॰ष घ॰स घ॰ह ङ॰अ ङ॰आ ङ॰इ ङ॰ई ङ॰उ ङ॰ऊ ङ॰ए ङ॰ऐ ङ॰ओ ङ॰औ ङ॰क ङ॰ख ङ॰ग ङ॰घ ङ॰ङ ङ॰च ङ॰छ ङ॰ज ङ॰झ ङ॰ञ ङ॰ट ङ॰ठ ङ॰ड ङ॰ढ ङ॰ण ङ॰त ङ॰थ ङ॰द ङ॰ध ङ॰न ङ॰प ङ॰फ ङ॰ब ङ॰भ ङ॰म ङ॰य ङ॰र ङ॰ल ङ॰व ङ॰श ङ॰ष ङ॰स ङ॰ह', + 'cite_references_link_accessibility_label' => 'ऊपर जायें', + 'cite_references_link_many_accessibility_label' => 'इस तक ऊपर जायें:', ); /** Croatian (hrvatski) @@ -1579,12 +1595,14 @@ Definuj dalše w zdźělence [[MediaWiki:$2]].', 'cite_error_references_no_text' => 'Njepłaćiwa referenca formy <ref>; žadyn tekst za referency z mjenom $1 podaty.', 'cite_error_included_ref' => 'Kónčny </ref> za tafličku <ref> faluje', 'cite_error_refs_without_references' => 'Taflički <ref> ekistuja, ale žana taflička code><references/> je so namakała', - 'cite_error_group_refs_without_references' => 'Taflički <ref> eksistuja za skupinu z mjenom "$1", ale njeje so wotpowědowaca taflička <references group="$1"/> namakała', # Fuzzy + 'cite_error_group_refs_without_references' => 'Taflički <ref> eksistuja za skupinu z mjenom "$1", ale njeje so wotpowědowaca taflička <references group="$1"/> namakała abo začinjacy </ref> faluje', 'cite_error_references_group_mismatch' => 'Taflička <ref> w <references> je ze skupinskim atributom "$1" w konflikće.', 'cite_error_references_missing_group' => 'Taflička <ref>, kotraž je w <references> definowana, ma skupinski atribut "$1", kotryž so w prjedawšim teksće njejewi.', 'cite_error_references_missing_key' => 'Taflička <ref> z mjenom "$1", kotraž je w <references> definowana, so w prjedawšim teksće njewužiwa.', 'cite_error_references_no_key' => 'Taflička <ref>, kotraž je w <references> definowana, mjenowy atribut nima.', 'cite_error_empty_references_define' => 'Taflička <ref>, kotraž je w <references> z mjenom "$1" definowana, wobsah nima.', + 'cite_references_link_accessibility_label' => 'Horje skočić', + 'cite_references_link_many_accessibility_label' => 'Horje skočić do:', ); /** Haitian (Kreyòl ayisyen) @@ -1734,38 +1752,38 @@ $messages['ig'] = array( * @author Lam-ang */ $messages['ilo'] = array( - 'cite-desc' => 'Agnayon ti ken nga etiketa, para kadagiti pagdakamat', + 'cite-desc' => 'Aginayon kadagiti etiketa ti ken , para kadagiti panagdakamat', 'cite_error' => 'Biddut ti dakamat: $1', - 'cite_error_ref_numeric_key' => 'Imbalido a <ref> nga etiketa; -ti nagan ket saan a mabalin a nalaka a sibubukel. Agusar ti agipalpalawag a titulo', - 'cite_error_ref_no_key' => 'Imbalido a <ref> nga etiketa; -dagita ref nga awan nagyanna ket masapul a managanan', - 'cite_error_ref_too_many_keys' => 'Imbalido a <ref> nga etiketa; + 'cite_error_ref_numeric_key' => 'Imbalido ti etiketa ti <ref>; +ti nagan ket saan a mabalin a nalaka a sibubukel. Agusar ti makaipalawag a titulo', + 'cite_error_ref_no_key' => 'Imbalido nga etiketa ti <ref> ; +dagita ref nga awan nagyanna ket masapul nga adda naganna', + 'cite_error_ref_too_many_keys' => 'Imbalido nga etiketa ti <ref> ; imbalido a nag-nagan, a kas adu unay', - 'cite_error_ref_no_input' => 'Imbalido a <ref> nga etiketa; + 'cite_error_ref_no_input' => 'Imbalido nga etiketa ti <ref> ; dagiti ref nga awan ti naganna ket masapul nga addaan ti nagyan', - 'cite_error_references_invalid_parameters' => 'Imbalido a <references> nga etiketa -awan dagiti parametro a maipalubos. + 'cite_error_references_invalid_parameters' => 'Imbalido nga etiketa ti <references>; +saan a maipalubos dagiti parametro. Usaren ti <references />', - 'cite_error_references_invalid_parameters_group' => 'Imbalido a <references> nga etiketa; -parametro a "grupo" ket ti maipalubos laeng. + 'cite_error_references_invalid_parameters_group' => 'Imbalido nga etiketa ti <references> ; +maipalubos laeng ti parametro ti "grupo" . Usaren ti <references /> , wenno<references group="..." />', - 'cite_error_references_no_backlink_label' => 'Naibusan kadagiti nagrunaan a likud ti silpo nga etiketa. -Ipalawag pay ti adu idiay [[MediaWiki:Cite references link many format backlink labels]] a mensahe', - 'cite_error_no_link_label_group' => 'Naibusan ti nangruna a silpo nga etiketa para iti grupo ti "$1". -Ipalawag pay ti adu idiay [[MediaWiki:$2]] a mensahe.', - 'cite_error_references_no_text' => 'Imbalido a <ref> nga etiketa; -awan ti testo a naited para dagiti ref a nanaganan $1', - 'cite_error_included_ref' => 'Irikrikep ti </ref> napukaw para iti <ref> nga etiketa', - 'cite_error_refs_without_references' => 'Ti <ref> nga etiketa ket addan, ngem awan ti <references/> nga etiketa a nabirukan', - 'cite_error_group_refs_without_references' => 'Adda dagiti <ref> para iti grupo a nanaganan ti "$1", ngem awan ti kapada a <references group="$1"/> nga etiketa ti nabirukan, wenno pangrikep a </ref> ket awan', - 'cite_error_references_group_mismatch' => 'Ti <ref> nga etiketa iday <references> ket addan ti nagsungat a gupit ti grupo "$1".', - 'cite_error_references_missing_group' => 'Ti <ref> nga etiketa a naipalawag idiay <references> ket addaan ti gupit ti grupo ti "$1" a saan nga agparang iti napalabas a testo.', - 'cite_error_references_missing_key' => 'Ti <ref> nga etiketa nga addaan ti nagan ti "$1" a naipalawag idiay <references> ket saan a nausar iti napalabas a testo.', - 'cite_error_references_no_key' => 'Ti <ref> nga etiketa a naipalawag idiay <references> ket awan ti nainagan a gupit.', - 'cite_error_empty_references_define' => 'Ti <ref> nga etiketa a naipalawag idiay <references> nga addaan ti nagan a "$1" ket awan ti nagyanna.', - 'cite_references_link_accessibility_label' => 'Lumagto ti ngato', - 'cite_references_link_many_accessibility_label' => 'Lumagto ti ngato iti:', + 'cite_error_references_no_backlink_label' => 'Naibusan kadagiti etiketa ti naisangayan a silpo ti likud. +Ipalawag pay ti adu idiay mensahe ti [[MediaWiki:Cite references link many format backlink labels]]', + 'cite_error_no_link_label_group' => 'Naibusan kadagiti etiketa ti nangruna a silpo para iti grupo ti "$1". +Ipalawag pay ti adu idiay mensahe ti [[MediaWiki:$2]] .', + 'cite_error_references_no_text' => 'Imbalido nga etiketa ti <ref> ; +awan ti testo a naited para kadagiti ref a nanaganan $1', + 'cite_error_included_ref' => 'Irikepen ti </ref> napukaw para iti etiketa ti <ref>', + 'cite_error_refs_without_references' => 'Ti etiketa ti <ref> ket addan, ngem awan ti etiketa ti <references/> a nabirukan', + 'cite_error_group_refs_without_references' => 'Adda dagiti etiketa ti <ref> para iti grupo a nanaganan ti "$1", ngem awan ti kapada nga etiketa ti <references group="$1"/> a nabirukan, wenno awan ti pangrikep ti </ref>', + 'cite_error_references_group_mismatch' => 'Ti etiketa ti <ref> iday <references> ket addan ti kasinnungat a gupit ti grupo ti "$1".', + 'cite_error_references_missing_group' => 'Ti etiketa ti <ref> a naipalawag idiay <references> ket addaan ti gupit ti grupo ti "$1" a saan nga agparang iti napalabas a testo.', + 'cite_error_references_missing_key' => 'Ti etiketa ti <ref> nga addaan ti nagan ti "$1" a naipalawag idiay <references> ket saan a nausar iti napalabas a testo.', + 'cite_error_references_no_key' => 'Ti etiketa ti <ref> a naipalawag idiay <references> ket awan ti nainagan a gupit.', + 'cite_error_empty_references_define' => 'Ti etiketa ti <ref> a naipalawag idiay <references> nga addaan ti nagan a "$1" ket awan ti nagyanna.', + 'cite_references_link_accessibility_label' => 'Mapan iti ngato', + 'cite_references_link_many_accessibility_label' => 'Mapan aginggana iti:', ); /** Ido (Ido) @@ -1878,6 +1896,8 @@ $messages['ja'] = array( 'cite_error_references_missing_key' => '<references> で定義されている <ref> タグ (name="$1") は、先行するテキスト内で使用されていません。', 'cite_error_references_no_key' => '<references> で定義されている <ref> タグに name 属性がありません。', 'cite_error_empty_references_define' => '<references> で定義されている <ref> タグ (name="$1") に内容がありません。', + 'cite_references_link_accessibility_label' => '元の位置に戻る', + 'cite_references_link_many_accessibility_label' => '以下の位置に戻る:', ); /** Jutish (jysk) @@ -1895,6 +1915,7 @@ $messages['jut'] = array( ); /** Javanese (Basa Jawa) + * @author Bennylin * @author Iwan Novirion * @author Meursault2004 * @author NoiX180 @@ -1925,10 +1946,12 @@ Tambahaké katemton nèng layang [[MediaWiki:$2]].', ora ditemokaké tèks kanggo ref mawa jeneng $1', 'cite_error_included_ref' => 'Panutupan </ref> kélangan tag <ref>', 'cite_error_refs_without_references' => 'Tag <ref> ditemokaké, nanging tag <references/> ora ditemokaké', - 'cite_error_group_refs_without_references' => 'Tag <ref> ditemokaké kanggo paguyuban ajeneng "$1", nanging tag <references group="$1"/> sing ana kaitané ora ditemokaké', # Fuzzy + 'cite_error_group_refs_without_references' => 'Tag <ref> ditemokaké kanggo paguyuban ajeneng "$1", nanging tag <references group="$1"/> sing ana kaitané ora ditemokaké, utawa tag panutup </ref> ora diwénéhi', 'cite_error_references_group_mismatch' => '<ref> tandha <references> nduwèni atribut klompok sing marai konflik "$1".', 'cite_error_references_missing_group' => '<ref> tag sing didhèfinisikaké <references> nduwèni atribut klompok "$1" sing ora njedhul sing tèks sakdurungé.', 'cite_error_references_missing_key' => '<ref> tag sing didhefinisikaké mawa jeneng "$1" <references> ora dianggo nèng tèks sakdurungé.', + 'cite_error_references_no_key' => 'Tag <ref> yang didefinisikan di di <references> tidak memiliki nama atribut.', + 'cite_error_empty_references_define' => 'Tag <ref> yang didefinisikan di di <references> dengan nama "$1" tidak memiliki isi.', 'cite_reference_link_key_with_num' => '$1_$2', 'cite_reference_link_prefix' => 'cite_ref-', 'cite_references_link_prefix' => 'cite_note-', @@ -1939,6 +1962,8 @@ ora ditemokaké tèks kanggo ref mawa jeneng $1', 'cite_references_link_many_format_backlink_labels' => 'a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej ek el em en eo ep eq er es et eu ev ew ex ey ez fa fb fc fd fe ff fg fh fi fj fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gf gg gh gi gj gk gl gm gn go gp gq gr gs gt gu gv gw gx gy gz ha hb hc hd he hf hg hh hi hj hk hl hm hn ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il im in io ip iq ir is it iu iv iw ix iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn ko kp kq kr ks kt ku kv kw kx ky kz la lb lc ld le lf lg lh li lj lk ll lm ln lo lp lq lr ls lt lu lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo op oq or os ot ou ov ow ox oy oz pa pb pc pd pe pf pg ph pi pj pk pl pm pn po pp pq pr ps pt pu pv pw px py pz qa qb qc qd qe qf qg qh qi qj qk ql qm qn qo qp qq qr qs qt qu qv qw qx qy qz ra rb rc rd re rf rg rh ri rj rk rl rm rn ro rp rq rr rs rt ru rv rw rx ry rz sa sb sc sd se sf sg sh si sj sk sl sm sn so sp sq sr ss st su sv sw sx sy sz ta tb tc td te tf tg th ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty tz ua ub uc ud ue uf ug uh ui uj uk ul um un uo up uq ur us ut uu uv uw ux uy uz va vb vc vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz wa wb wc wd we wf wg wh wi wj wk wl wm wn wo wp wq wr ws wt wu wv ww wx wy wz xa xb xc xd xe xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk yl ym yn yo yp yq yr ys yt yu yv yw yx yy yz za zb zc zd ze zf zg zh zi zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz', 'cite_references_link_many_sep' => ' ', 'cite_references_link_many_and' => ' ', + 'cite_references_link_accessibility_label' => 'Mencolot munggah', + 'cite_references_link_many_accessibility_label' => 'Mencolot munggah menyang:', ); /** Georgian (ქართული) @@ -1971,7 +1996,7 @@ $messages['ka'] = array( სქოლიოსათვის $1 არ არის მითითებული ტექსტი', 'cite_error_included_ref' => 'დამხურავი ტეგი </ref> დაკარგულია', 'cite_error_refs_without_references' => 'არსებული ტეგისათვის <ref> ვერ მოიძებნა შესაბამისი ტეგი <references/>', - 'cite_error_group_refs_without_references' => 'ჯგუფი „$1“ არსებული ტეგებისათვის <ref> ვერ მოიძებნა შესაბამისი ტეგი <references group="$1"/>', # Fuzzy + 'cite_error_group_refs_without_references' => 'ჯგუფი „$1“ არსებული ტეგებისათვის <ref> ვერ მოიძებნა შესაბამისი ტეგი <references group="$1"/>, ან გამოტოვებულია დამხურავი ტეგი </ref>', 'cite_error_references_group_mismatch' => 'ტეგს <ref> <references>-ში გააჩნია ატრიბუტთა კონფლიქტური ჯგუფები „$1“.', 'cite_error_references_missing_group' => 'ტეგს <ref>, განმარტებულს <references>-ში, გააჩნია ჯგუფის ატრიბუტი „$1“, რომელიც ადრეულ ტექსტში არ მოიხსენიება.', 'cite_error_references_missing_key' => 'ტეგი <ref> სახელად „$1“, გარკვეული <references>-ში, არ გამოიყენება წინა ტექსტში.', @@ -1999,18 +2024,38 @@ $messages['kk-arab'] = array( ); /** Kazakh (Cyrillic script) (қазақша (кирил)‎) + * @author Arystanbek * @author Kaztrans */ $messages['kk-cyrl'] = array( - 'cite_error' => 'Дәйексөз алу $1 қатесі', - 'cite_error_ref_numeric_key' => 'Жарамсыз <ref> белгішесі; атау кәдімгі бүтін сан болуы мүмкін емес, сиппатауыш атау қолданыңыз', - 'cite_error_ref_no_key' => 'Жарамсыз <ref> белгішесі; мағлұматсыз түсініктемелерде атау болуы қажет', - 'cite_error_ref_too_many_keys' => 'Жарамсыз <ref> белгіше; жарамсыз атаулар, мысалы, тым көп', - 'cite_error_ref_no_input' => 'Жарамсыз <ref> белгіше; атаусыз түсініктемелерде мағлұматы болуы қажет', - 'cite_error_references_invalid_parameters' => 'Жарамсыз <references> белгіше; еш баптар рұқсат етілмейді, былай <references /> қолданыңыз', - 'cite_error_references_no_backlink_label' => 'Қосымша белгілердің саны бітті, одан әрі көбірек [[MediaWiki:Cite_references_link_many_format_backlink_labels]] жүйе хабарында белгілеңіз', # Fuzzy + 'cite-desc' => 'Сілтемелер үшін және белгішелерін қолданыңыз', + 'cite_error' => 'Дереккөз алу қатесі: $1', + 'cite_error_ref_numeric_key' => 'Жарамсыз <ref> белгішесі; +атау кәдімгі бүтін сан болуы мүмкін емес. Сипатауыш атау қолданыңыз', + 'cite_error_ref_no_key' => 'Жарамсыз <ref> белгішесі; +мағлұматсыз дерекөздерде атау болуы қажет', + 'cite_error_ref_too_many_keys' => 'Жарамсыз <ref> белгіше; +жарамсыз атаулар, мысалы, тым көп', + 'cite_error_ref_no_input' => 'Жарамсыз <ref> белгіше; +атаусыз дереккөздерде мағлұматы болуы қажет', + 'cite_error_references_invalid_parameters' => 'Жарамсыз <references> белгіше; +еш параметр рұқсат етілмейді, +былай <references /> қолданыңыз', + 'cite_error_references_invalid_parameters_group' => 'Жарамсыз <references> тегі; +тек "group" параметрін рұқсат етеді. +Келесідей қолданыңыз: <references />, or <references group="..." />', + 'cite_error_references_no_backlink_label' => 'Өзгертпелі белгілердің саны бітті, одан әрі көбірек [[MediaWiki:Cite references link many format backlink labels]] жүйе хабарында белгілеңіз', + 'cite_error_no_link_label_group' => '"$1" тобы үшін өзгертпелі сілтеме белгілері бітті. +Define more in the [[MediaWiki:$2]] message.', + 'cite_error_references_no_text' => 'Жарамсыз <ref> тегі; +no text was provided for refs named $1', + 'cite_error_included_ref' => '<ref> тегін </ref> тегімен жабуды қажет етеді', + 'cite_error_refs_without_references' => '<ref> тегі бар, бірақ <references/> тегі табылмады', + 'cite_error_group_refs_without_references' => '"$1" деп аталған дереккөз тобында <ref> тегі бар, бірақ тиісті <references group="$1"/> тегі табылмады, немесе </ref> жабу тегін қажет етеді', 'cite_references_link_one' => '
  • [[#$2|↑]] $3
  • ', 'cite_references_link_many' => '
  • ↑ $2 $3
  • ', + 'cite_references_link_accessibility_label' => 'Жоғарыға көтеріліңіз', + 'cite_references_link_many_accessibility_label' => 'Мынаған өту:', ); /** Kazakh (Latin script) (qazaqşa (latın)‎) @@ -2110,7 +2155,7 @@ Et wohr keine Tex aanjejovve för de <ref>s met dämm Name „$1“.', 'cite_error_included_ref' => 'Hee för dat <ref> ham_mer kei zopaß </ref>', 'cite_error_refs_without_references' => 'Et sinn_er <ref>-Befähle en dä Sigg, ävver mer han keine <references/>-Befähl jefunge.', - 'cite_error_group_refs_without_references' => 'Et sinn_er <ref>-Befähle för de jrop „$1“ en hee dä Sigg, ävver mer han keine <references group="$1"/>-Befähl jefunge.', # Fuzzy + 'cite_error_group_refs_without_references' => 'Et sinn_er <ref>-Befähle för de Jrop „$1“ en heh dä Sigg, ävver mer han keine <references group="$1"/>-Befähl jefonge, udder dä Befähl </ref> zom zohmaache es nit doh.', 'cite_error_references_group_mismatch' => 'Dä <ref> Befähl en <references> hät en widerschpröschlesche Jroppe-Eijeschaff „$1“.', 'cite_error_references_missing_group' => 'Dä <ref> Befähl, aanjejoove em Befähl <references>, hät en Jroppe-Eijeschaff „$1“, di ävver em Täx doför nit vörjekumme es.', 'cite_error_references_missing_key' => 'Dä <ref> Befähl mem Naame „$1“, aanjejoove em Befähl <references>, es em Täx doför nit vörjekumme.', @@ -2120,6 +2165,8 @@ Et wohr keine Tex aanjejovve för de 'cite_reference_link_prefix' => 'fohss_noht_betreck_', 'cite_references_link_prefix' => 'fohss_noht_nommer_', 'cite_references_link_many_and' => ' ', + 'cite_references_link_accessibility_label' => 'Jangk noh bovve', + 'cite_references_link_many_accessibility_label' => 'Jangk noh bovve op:', ); /** Cornish (kernowek) @@ -2195,6 +2242,17 @@ Doe kans d\'r mier insjtelle in \'t sysyeemberich [[MediaWiki:$2]] 'De tag <ref> dae is gedefinieerd in <references> mit de naam "$1" haet geinen inhawd.', ); +/** لوری (لوری) + * @author Bonevarluri + * @author Mogoeilor + */ +$messages['lrc'] = array( + 'cite-desc' => ' و <سرچشمه یا/> tags,و تگیا نه د گوتنیا اضاف بکید', + 'cite_error' => 'خطا جاگه:$1', + 'cite_references_link_accessibility_label' => 'بالا پرسن', + 'cite_references_link_many_accessibility_label' => 'پرستن د', +); + /** Lithuanian (lietuvių) * @author Garas * @author Homo @@ -2314,6 +2372,7 @@ $messages['mk'] = array( 'cite_error_references_missing_key' => 'Ознаката <ref> со име „$1“ определена во <references> не се користи во претходен текст.', 'cite_error_references_no_key' => 'Ознаката <ref> определена во <referencesgt; нема именски атрибут.', 'cite_error_empty_references_define' => 'Ознаката <ref> определена во <references> со име „$1“ нема содржина.', + 'cite_references_link_many_format_backlink_labels' => 'а б в г д ѓ е ж з ѕ и ј к л љ м н њ о п р с т ќ у ф х ц ч џ ш аа аб ав аг ад аѓ ае аж аз аѕ аи ај ак ал аљ ам ан ањ ао ап ар ас ат аќ ау аф ах ац ач аџ аш ба бб бв бг бд бѓ бе бж бз бѕ би бј бк бл бљ бм бн бњ бо бп бр бс бт бќ бу бф бх бц бч бџ бш ва вб вв вг вд вѓ ве вж вз бѕ ви вј вк вл вљ вм вн вњ во вп вр вс вт вќ ву вф вх вц вч вџ вш га гб гв гг гд гѓ ге гж гз гѕ ги гј гк гл гљ гм гн гњ го гп гр гс гт гќ гу гф гх гц гч гџ гш да дб дв дг дд дѓ де дж дз дѕ ди дј дк дл дљ дм дн дњ до дп др дс дт дќ ду дф дх дц дч дџ дш ѓа ѓб ѓв ѓг ѓд ѓе ѓж ѓз ѓѕ ѓи ѓј ѓк ѓл ѓљ ѓм ѓн ѓњ ѓо ѓп ѓр ѓс ѓт ѓќ ѓу ѓф ѓх ѓц ѓч ѓџ ѓш еа еб ев ег ед еѓ ее еж ез еѕ еи еј ек ел ељ ем ен ењ ео еп ер ес ет еќ еу еф ех ец еч еџ еш жа жб жв жг жд жѓ же жж жз жѕ жи жј жк жл жљ жм жн жњ жо жп жр жс жт жќ жу жф жх жц жч жџ жш за зб зв зг зд зѓ зе зж зз зѕ зи зј зк зл зљ зм зн зњ зо зп зр зс зт зќ зу зф зх зц зч зџ зш ѕа ѕб ѕв ѕг ѕд ѕѓ ѕе ѕж ѕз ѕѕ ѕи ѕј ѕк ѕл ѕљ ѕм ѕн ѕњ ѕо ѕп ѕр ѕс ѕт ѕќ ѕу ѕф ѕх ѕц ѕч ѕџ ѕш иа иб ив иг ид иѓ ие иж из иѕ ии иј ик ил иљ им ин ињ ио ип ир ис ит иќ иу иф их иц ич иџ иш ја јб јв јг јд јѓ је јж јз јѕ ји јј јк јл јљ јм јн јњ јо јп јр јс јт јќ ју јф јх јц јч јџ јш ка кб кв кг кд кѓ ке кж кз кѕ ки кј кк кл кљ км кн књ ко кп кр кс кт кќ ку кф кх кц кч кџ кш ла лб лв лг лд лѓ ле лж лз лѕ ли лј лк лл лљ лм лн лњ ло лп лр лс лт лќ лу лф лх лц лч лџ лш ља љб љв љг љд љѓ ље љж љз љѕ љи љј љк љл љљ љм љн љњ љо љп љр љс љт љќ љу љф љх љц љч љџ љш ма мб мв мг мд мѓ ме мж мз мѕ ми мј мк мл мљ мм мн мњ мо мп мр мс мт мќ му мф мх мц мч мџ мш на нб нв нг нд нѓ не нж нз нѕ ни нј нк нл нљ нм нн нњ но нп нр нс нт нќ ну нф нх нц нч нџ нш ња њб њв њг њд њѓ ње њж њз њѕ њи њј њк њл њљ њм њн њњ њо њп њр њс њт њќ њу њф њх њц њч њџ њш оа об ов ог од оѓ ое ож оз оѕ ои ој ок ол ољ ом он оњ оо оп ор ос от оќ оу оф ох оц оч оџ ош па пб пв пг пд пѓ пе пж пз пѕ пи пј пк пл пљ пм пн пњ по пп пр пс пт пќ пу пф пх пц пч пџ пш ра рб рв рг рд рѓ ре рж рз рѕ ри рј рк рл рљ рм рн рњ ро рп рр рс рт рќ ру рф рх рц рч рџ рш са сб св сг сд сѓ се сж сз сѕ си сј ск сл сљ см сн сњ со сп ср сс ст сќ су сф сх сц сч сџ сш та тб тв тг тд тѓ те тж тз тѕ ти тј тк тл тљ тм тн тњ то тп тр тс тт тќ ту тф тх тц тч тџ тш ќа ќб ќв ќг ќд ќѓ ќе ќж ќз ќѕ ќи ќј ќк ќл ќљ ќм ќн ќњ ќо ќп ќр ќс ќт ќќ ќу ќф ќх ќц ќч ќџ ќш уа уб ув уг уд уѓ уе уж уз уѕ уи уј ук ул уљ ум ун уњ уо уп ур ус ут уќ уу уф ух уц уч уџ уш фа фб фв фг фд фѓ фе фж фз фѕ фи фј фк фл фљ фм фн фњ фо фп фр фс фт фќ фу фф фх фц фч фџ фш ха хб хв хг хд хѓ хе хж хз хѕ хи хј хк хл хљ хм хн хњ хо хп хр хс хт хќ ху хф хх хц хч хџ хш ца цб цв цг цд цѓ це цж цз цѕ ци цј цк цл цљ цм цн цњ цо цп цр цс цт цќ цу цф цх цц цч цџ цш ча чб чв чг чд чѓ че чж чз чѕ чи чј чк чл чљ чм чн чњ чо чп чр чс чт чќ чу чф чх чц чч чџ чш џа џб џв џг џд џѓ џе џж џз џѕ џи џј џк џл џљ џм џн џњ џо џп џр џс џт џќ џу џф џх џц џч џџ џш ша шб шв шг шд шѓ ше шж шз шѕ ши шј шк шл шљ шм шн шњ шо шп шр шс шт шќ шу шф шх шц шч шџ шш', 'cite_references_link_accessibility_label' => 'Следно', 'cite_references_link_many_accessibility_label' => 'Отиди кај:', ); @@ -2353,6 +2412,8 @@ $messages['ml'] = array( 'cite_error_empty_references_define' => ' <references> ആവശ്യത്തിനായി "$1" എന്ന പേരിൽ നിർ‌വചിക്കപ്പെട്ട <ref> റ്റാഗിന് ഉള്ളടക്കമൊന്നുമില്ല.', 'cite_reference_link_prefix' => 'ഉദ്ധരിണി_അവലംബം-', 'cite_references_link_prefix' => 'ഉദ്ധരിണി_കുറിപ്പ്-', + 'cite_references_link_accessibility_label' => 'മുകളിലേയ്ക്ക്', + 'cite_references_link_many_accessibility_label' => 'മുകളിൽ ഇവിടേയ്ക്ക്:', ); /** Mongolian (монгол) @@ -2370,7 +2431,7 @@ $messages['mn'] = array( * @author V.narsikar */ $messages['mr'] = array( - 'cite-desc' => ' हे दोन संदर्भ देण्यासाठी वापरण्यात येणारे शब्द वाढविले जातील.', + 'cite-desc' => ' हे दोन संदर्भ देण्यासाठी वापरण्यात येणारे शब्द जोडल्या जातील.', 'cite_error' => 'त्रूटी उधृत करा: $1', 'cite_error_ref_numeric_key' => '<ref> चुकीचा कोड; नाव हे पूर्णांकी संख्या असू शकत नाही, कृपया माहितीपूर्ण शीर्षक द्या', 'cite_error_ref_no_key' => '<ref> चुकीचा कोड; रिकाम्या संदर्भांना नाव असणे गरजेचे आहे', @@ -2383,14 +2444,17 @@ $messages['mr'] = array( 'cite_error_no_link_label_group' => '"$1" करिता नमूदकेलेल्या कस्टम लिंक खूणा संपल्या . [[MediaWiki:$2]] संदेशात अधिक खूणा नमूद करा', 'cite_error_references_no_text' => '<ref> चुकीचा कोड; $1 नावाने दिलेल्या संदर्भांमध्ये काहीही माहिती नाही', - 'cite_error_included_ref' => '<ref> ला बंद करणारी </ref> ही खूण गायब आहे.', - 'cite_error_refs_without_references' => 'पानामधे <ref> (संदर्भ) आहे, परंतु <references/> ({{संदर्भयादी}}) सापडले नाही. {{संदर्भयादी}} असल्याशिवाय पानाच्या तळाशी संदर्भांचे तपशील दिसणार नाहीत.', + 'cite_error_included_ref' => '<ref> ला बंद करणारी </ref> ही खूणपताका गायब आहे.', + 'cite_error_refs_without_references' => "या पानामधे \"<ref>\" ही खूणपताका(संदर्भटॅग) आहे, परंतु <references/> अथवा {{ +संदर्भयादी}}या पैकी एकही लावण्यात आलेले नाही.''' या पानात \"{{संदर्भयादी}}\" हा साचा कॉपीपेस्ट करावा''' ''कारण,त्याशिवाय पानाच्या तळाशी संदर्भांचे तपशील दिसणार नाहीत.''", 'cite_error_group_refs_without_references' => '"$1" नावाच्या गटाकरिता <ref>खूणपताका उपलब्ध आहेत, पण संबंधीत <references group="$1"/> खूण मिळाली नाही.', - 'cite_error_references_group_mismatch' => 'tag in <references>मधील <ref> खूणांना खटका उडणारे group attribute "$1" आहे.', - 'cite_error_references_missing_group' => 'गट "$1" मधील <ref> ट्याग <references> ह्या पूर्वी वापल्या गेलेले नाही', - 'cite_error_references_missing_key' => '<references> ह्या मध्ये सांगितलेला <ref> "$1" ह्या नावाचा ट्याग ह्या पूर्वी वापरण्यात आलेला नाही.', - 'cite_error_references_no_key' => '<ref> ट्याग मध्ये विशारद गोष्टींना <references> ला नाम गुणधर्म नाहीत', - 'cite_error_empty_references_define' => '<ref> ट्याग मध्ये विशारद गोष्टीं <references> ज्या "$1" ह्या नावाने संबोधल्या आहेत त्यात माहिती नाही', + 'cite_error_references_group_mismatch' => '<references>मधील खूणपताकेस<ref> खूणांशी विसंवाद असणारे group attribute "$1" आहे.', + 'cite_error_references_missing_group' => 'गट "$1" मधील <ref> खूणपताका <references> ह्या पूर्वी वापल्या गेलेल्या नाहीत.', + 'cite_error_references_missing_key' => '<references> ह्या मध्ये टाकलेला <ref> "$1" ह्या नावाची खूणपताका ह्या पूर्वी वापरण्यात आलेली नाही.', + 'cite_error_references_no_key' => '<ref>खूणपताकेत नमूद गोष्टींना <references> ला नाम-गुणधर्म नाहीत.', + 'cite_error_empty_references_define' => '<ref>खूणपताकेत नमूद गोष्टींना, <references> ज्या "$1" ह्या नावाने संबोधल्या आहेत, त्यात माहिती नाही.', + 'cite_references_link_accessibility_label' => 'वर उडी मारा', + 'cite_references_link_many_accessibility_label' => 'ला वर उडी मारा:', ); /** Malay (Bahasa Melayu) @@ -2508,6 +2572,7 @@ $messages['nds-nl'] = array( ); /** Dutch (Nederlands) + * @author Flightmare * @author Niels * @author Romaine * @author Siebrand @@ -2544,6 +2609,8 @@ er is geen tekst opgegeven voor refs met de naam $1', 'cite_error_references_missing_key' => 'De tag <ref> met de naam "$1" gedefinieerd in <references> wordt niet eerder in de tekst gebruikt.', 'cite_error_references_no_key' => 'De tag <ref> die is gedefinieerd in <references> heeft geen eigenschapsnaam.', 'cite_error_empty_references_define' => 'De tag <ref> die is gedefinieerd in <references> met de naam "$1" heeft geen inhoud.', + 'cite_references_link_accessibility_label' => 'Omhoog', + 'cite_references_link_many_accessibility_label' => 'Omhoog naar:', ); /** Norwegian Nynorsk (norsk nynorsk) @@ -2596,6 +2663,8 @@ pas de tèxte per las referéncias nomenadas $1.', 'cite_error_references_missing_key' => 'La balisa <ref> amb lo nom « $1 » definida dins <references> es pas utilizada dins lo tèxte precedent.', 'cite_error_references_no_key' => 'La balisa <ref> definida dins <references> a pas de nom d’atribut.', 'cite_error_empty_references_define' => 'La balisa <ref> definida dins <references> amb lo nom « $1 » a pas de contengut.', + 'cite_references_link_accessibility_label' => 'Anar', + 'cite_references_link_many_accessibility_label' => 'Anar a :', ); /** Oriya (ଓଡ଼ିଆ) @@ -2784,12 +2853,14 @@ Defina mais na mensagem [[MediaWiki:$2]].', 'cite_error_references_no_text' => 'Tag <ref> inválida; não foi fornecido texto para as refs chamadas $1', 'cite_error_included_ref' => '</ref> de fecho em falta, para o elemento <ref>', 'cite_error_refs_without_references' => 'existem tags <ref>, mas nenhuma tag <references/> foi encontrada', - 'cite_error_group_refs_without_references' => 'existem tags <ref> para um grupo chamado "$1", mas nenhuma tag <references group="$1"/> correspondente foi encontrada', # Fuzzy + 'cite_error_group_refs_without_references' => 'existem marcas <ref> para um grupo chamado "$1", mas nenhuma marca <references group="$1"/> correspondente foi encontrada (ou uma marca de fechamento </ref> está faltando)', 'cite_error_references_group_mismatch' => 'O elemento <ref> em <references> tem o atributo de grupo "$1", que está em conflito com o de <references>.', 'cite_error_references_missing_group' => 'O elemento <ref> definido em <references> tem o atributo de grupo "$1", que não aparece no texto anterior.', 'cite_error_references_missing_key' => 'A etiqueta <ref> com nome "$1" definida em <references> não é utilizada no texto acima.', 'cite_error_references_no_key' => 'O elemento <ref> definido em <references> não tem um atributo de nome.', 'cite_error_empty_references_define' => 'O elemento <ref> definido em <references> com o nome "$1" não tem conteúdo.', + 'cite_references_link_accessibility_label' => 'Ir para cima', + 'cite_references_link_many_accessibility_label' => 'Ir para:', ); /** Brazilian Portuguese (português do Brasil) @@ -3114,6 +3185,13 @@ Usari <references /> oppuru <references group="..." 'cite_references_link_many_format_backlink_labels' => 'a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej ek el em en eo ep eq er es et eu ev ew ex ey ez fa fb fc fd fe ff fg fh fi fj fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gf gg gh gi gj gk gl gm gn go gp gq gr gs gt gu gv gw gx gy gz ha hb hc hd he hf hg hh hi hj hk hl hm hn ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il im in io ip iq ir is it iu iv iw ix iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn ko kp kq kr ks kt ku kv kw kx ky kz la lb lc ld le lf lg lh li lj lk ll lm ln lo lp lq lr ls lt lu lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo op oq or os ot ou ov ow ox oy oz pa pb pc pd pe pf pg ph pi pj pk pl pm pn po pp pq pr ps pt pu pv pw px py pz qa qb qc qd qe qf qg qh qi qj qk ql qm qn qo qp qq qr qs qt qu qv qw qx qy qz ra rb rc rd re rf rg rh ri rj rk rl rm rn ro rp rq rr rs rt ru rv rw rx ry rz sa sb sc sd se sf sg sh si sj sk sl sm sn so sp sq sr ss st su sv sw sx sy sz ta tb tc td te tf tg th ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty tz ua ub uc ud ue uf ug uh ui uj uk ul um un uo up uq ur us ut uu uv uw ux uy uz va vb vc vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz wa wb wc wd we wf wg wh wi wj wk wl wm wn wo wp wq wr ws wt wu wv ww wx wy wz xa xb xc xd xe xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk yl ym yn yo yp yq yr ys yt yu yv yw yx yy yz za zb zc zd ze zf zg zh zi zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz', ); +/** Serbo-Croatian (srpskohrvatski / српскохрватски) + * @author Kolega2357 + */ +$messages['sh'] = array( + 'cite_error' => 'Greška citiranja $1; $2', # Fuzzy +); + /** Sinhala (සිංහල) * @author Budhajeewa * @author Thameera123 @@ -3261,6 +3339,7 @@ asnjë tekst nuk u dha për refs e quajtura $1', ); /** Serbian (Cyrillic script) (српски (ћирилица)‎) + * @author Milicevic01 * @author Millosh * @author Rancher * @author Михајло Анђелковић @@ -3286,13 +3365,14 @@ $messages['sr-ec'] = array( 'cite_references_link_one' => '
  • [[#$2|↑]] $3
  • ', 'cite_references_link_many' => '
  • ↑ $2 $3
  • ', 'cite_references_link_many_format' => '[[#$1|$2]]', - 'cite_references_link_many_format_backlink_labels' => 'a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej ek el em en eo ep eq er es et eu ev ew ex ey ez fa fb fc fd fe ff fg fh fi fj fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gf gg gh gi gj gk gl gm gn go gp gq gr gs gt gu gv gw gx gy gz ha hb hc hd he hf hg hh hi hj hk hl hm hn ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il im in io ip iq ir is it iu iv iw ix iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn ko kp kq kr ks kt ku kv kw kx ky kz la lb lc ld le lf lg lh li lj lk ll lm ln lo lp lq lr ls lt lu lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo op oq or os ot ou ov ow ox oy oz pa pb pc pd pe pf pg ph pi pj pk pl pm pn po pp pq pr ps pt pu pv pw px py pz qa qb qc qd qe qf qg qh qi qj qk ql qm qn qo qp qq qr qs qt qu qv qw qx qy qz ra rb rc rd re rf rg rh ri rj rk rl rm rn ro rp rq rr rs rt ru rv rw rx ry rz sa sb sc sd se sf sg sh si sj sk sl sm sn so sp sq sr ss st su sv sw sx sy sz ta tb tc td te tf tg th ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty tz ua ub uc ud ue uf ug uh ui uj uk ul um un uo up uq ur us ut uu uv uw ux uy uz va vb vc vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz wa wb wc wd we wf wg wh wi wj wk wl wm wn wo wp wq wr ws wt wu wv ww wx wy wz xa xb xc xd xe xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk yl ym yn yo yp yq yr ys yt yu yv yw yx yy yz za zb zc zd ze zf zg zh zi zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz', + 'cite_references_link_many_format_backlink_labels' => 'а б в г д ђ е ж з и ј к л љ м н њ о п р с т ћ у ф х ц ч џ ш аа аб ав аг ад ађ ае аж аз аи ај ак ал аљ ам ан ањ ао ап ар ас ат аћ ау аф ах ац ач аџ аш ба бб бв бг бд бђ бе бж бз би бј бк бл бљ бм бн бњ бо бп бр бс бт бћ бу бф бх бц бч бџ бш ва вб вв вг вд вђ ве вж вз ви вј вк вл вљ вм вн вњ во вп вр вс вт вћ ву вф вх вц вч вџ вш га гб гв гг гд гђ ге гж гз ги гј гк гл гљ гм гн гњ го гп гр гс гт гћ гу гф гх гц гч гџ гш да дб дв дг дд дђ де дж дз ди дј дк дл дљ дм дн дњ до дп др дс дт дћ ду дф дх дц дч дџ дш ђа ђб ђв ђг ђд ]] ђе ђж ђз ђи ђј ђк ђл ђљ ђм ђн ђњ ђо ђп ђр ђс ђт ђћ ђу ђф ђх ђц ђч ђџ ђш еа еб ев ег ед еђ ее еж ез еи еј ек ел ељ ем ен ењ ео еп ер ес ет ећ еу еф ех ец еч еџ еш жа жб жв жг жд жђ же жж жз жи жј жк жл жљ жм жн жњ жо жп жр жс жт жћ жу жф жх жц жч жџ жш за зб зв зг зд зђ зе зж зз зи зј зк зл зљ зм зн зњ зо зп зр зс зт зћ зу зф зх зц зч зџ зш иа иб ив иг ид иђ ие иж из ии иј ик ил иљ им ин ињ ио ип ир ис ит ић иу иф их иц ич иџ иш ја јб јв јг јд јђ је јж јз ји јј јк јл јљ јм јн јњ јо јп јр јс јт јћ ју јф јх јц јч јџ јш ка кб кв кг кд кђ ке кж кз ки кј кк кл кљ км кн књ ко кп кр кс кт кћ ку кф кх кц кч кџ кш ла лб лв лг лд лђ ле лж лз ли лј лк лл лљ лм лн лњ ло лп лр лс лт лћ лу лф лх лц лч лџ лш ља љб љв љг љд љђ ље љж љз љи љј љк љл љљ љм љн љњ љо љп љр љс љт љћ љу љф љх љц љч љџ љш ма мб мв мг мд мђ ме мж мз ми мј мк мл мљ мм мн мњ мо мп мр мс мт мћ му мф мх мц мч мџ мш на нб нв нг нд нђ не нж нз ни нј нк нл нљ нм нн нњ но нп нр нс нт нћ ну нф нх нц нч нџ нш ња њб њв њг њд њђ ње њж њз њи њј њк њл њљ њм њн њњ њо њп њр њс њт њћ њу њф њх њц њч њџ њш оа об ов ог од ођ ое ож оз ои ој ок ол ољ ом он оњ оо оп ор ос от оћ оу оф ох оц оч оџ ош па пб пв пг пд пђ пе пж пз пи пј пк пл пљ пм пн пњ по пп пр пс пт пћ пу пф пх пц пч пџ пш ра рб рв рг рд рђ ре рж рз ри рј рк рл рљ рм рн рњ ро рп рр рс рт рћ ру рф рх рц рч рџ рш са сб св сг сд сђ се сж сз си сј ск сл сљ см сн сњ со сп ср сс ст сћ су сф сх сц сч сџ сш та тб тв тг тд тђ те тж тз ти тј тк тл тљ тм тн тњ то тп тр тс тт тћ ту тф тх тц тч тџ тш ћа ћб ћв ћг ћд ћђ ће ћж ћз ћи ћј ћк ћл ћљ ћм ћн ћњ ћо ћп ћр ћс ћт ћћ ћу ћф ћх ћц ћч ћџ ћш уа уб ув уг уд уђ уе уж уз уи уј ук ул уљ ум ун уњ уо уп ур ус ут ућ уу уф ух уц уч уџ уш фа фб фв фг фд фђ фе фж фз фи фј фк фл фљ фм фн фњ фо фп фр фс фт фћ фу фф фх фц фч фџ фш ха хб хв хг хд хђ хе хж хз хи хј хк хл хљ хм хн хњ хо хп хр хс хт хћ ху хф хх хц хч хџ хш ца цб цв цг цд цђ це цж цз ци цј цк цл цљ цм цн цњ цо цп цр цс цт цћ цу цф цх цц цч цџ цш ча чб чв чг чд чђ че чж чз чи чј чк чл чљ чм чн чњ чо чп чр чс чт чћ чу чф чх чц чч чџ чш џа џб џв џг џд џђ џе џж џз џи џј џк џл џљ џм џн џњ џо џп џр џс џт џћ џу џф џх џц џч џџ џш ша шб шв шг шд шђ ше шж шз ши шј шк шл шљ шм шн шњ шо шп шр шс шт шћ шу шф шх шц шч шџ шш', # Fuzzy 'cite_references_link_many_sep' => ' ', 'cite_references_link_many_and' => ' ', ); /** Serbian (Latin script) (srpski (latinica)‎) * @author Michaello + * @author Milicevic01 */ $messages['sr-el'] = array( 'cite-desc' => 'Dodaje i oznake za citiranje.', @@ -3315,7 +3395,7 @@ $messages['sr-el'] = array( 'cite_references_link_one' => '
  • [[#$2|↑]] $3
  • ', 'cite_references_link_many' => '
  • ↑ $2 $3
  • ', 'cite_references_link_many_format' => '[[#$1|$2]]', - 'cite_references_link_many_format_backlink_labels' => 'a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej ek el em en eo ep eq er es et eu ev ew ex ey ez fa fb fc fd fe ff fg fh fi fj fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gf gg gh gi gj gk gl gm gn go gp gq gr gs gt gu gv gw gx gy gz ha hb hc hd he hf hg hh hi hj hk hl hm hn ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il im in io ip iq ir is it iu iv iw ix iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn ko kp kq kr ks kt ku kv kw kx ky kz la lb lc ld le lf lg lh li lj lk ll lm ln lo lp lq lr ls lt lu lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo op oq or os ot ou ov ow ox oy oz pa pb pc pd pe pf pg ph pi pj pk pl pm pn po pp pq pr ps pt pu pv pw px py pz qa qb qc qd qe qf qg qh qi qj qk ql qm qn qo qp qq qr qs qt qu qv qw qx qy qz ra rb rc rd re rf rg rh ri rj rk rl rm rn ro rp rq rr rs rt ru rv rw rx ry rz sa sb sc sd se sf sg sh si sj sk sl sm sn so sp sq sr ss st su sv sw sx sy sz ta tb tc td te tf tg th ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty tz ua ub uc ud ue uf ug uh ui uj uk ul um un uo up uq ur us ut uu uv uw ux uy uz va vb vc vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz wa wb wc wd we wf wg wh wi wj wk wl wm wn wo wp wq wr ws wt wu wv ww wx wy wz xa xb xc xd xe xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk yl ym yn yo yp yq yr ys yt yu yv yw yx yy yz za zb zc zd ze zf zg zh zi zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz', + 'cite_references_link_many_format_backlink_labels' => 'a b v g d đ e ž z i j k l lj m n nj o p r s t ć u f h c č dž š aa ab av ag ad ađ ae až az ai aj ak al alj am an anj ao ap ar as at ać au af ah ac ač adž aš ba bb bv bg bd bđ be bž bz bi bj bk bl blj bm bn bnj bo bp br bs bt bć bu bf bh bc bč bdž bš va vb vv vg vd vđ ve vž vz vi vj vk vl vlj vm vn vnj vo vp vr vs vt vć vu vf vh vc vč vdž vš ga gb gv gg gd gđ ge gž gz gi gj gk gl glj gm gn gnj go gp gr gs gt gć gu gf gh gc gč gdž gš da db dv dg dd dđ de dž dz di dj dk dl dlj dm dn dnj do dp dr ds dt dć du df dh dc dč ddž dš đa đb đv đg đd ]] đe đž đz đi đj đk đl đlj đm đn đnj đo đp đr đs đt đć đu đf đh đc đč đdž đš ea eb ev eg ed eđ ee ež ez ei ej ek el elj em en enj eo ep er es et eć eu ef eh ec eč edž eš ža žb žv žg žd žđ že žž žz ži žj žk žl žlj žm žn žnj žo žp žr žs žt žć žu žf žh žc žč ždž žš za zb zv zg zd zđ ze zž zz zi zj zk zl zlj zm zn znj zo zp zr zs zt zć zu zf zh zc zč zdž zš ia ib iv ig id iđ ie iž iz ii ij ik il ilj im in inj io ip ir is it ić iu if ih ic ič idž iš ja jb jv jg jd jđ je jž jz ji jj jk jl jlj jm jn jnj jo jp jr js jt jć ju jf jh jc jč jdž jš ka kb kv kg kd kđ ke kž kz ki kj kk kl klj km kn knj ko kp kr ks kt kć ku kf kh kc kč kdž kš la lb lv lg ld lđ le lž lz li lj lk ll llj lm ln lnj lo lp lr ls lt lć lu lf lh lc lč ldž lš lja ljb ljv ljg ljd ljđ lje ljž ljz lji ljj ljk ljl ljlj ljm ljn ljnj ljo ljp ljr ljs ljt ljć lju ljf ljh ljc ljč ljdž ljš ma mb mv mg md mđ me mž mz mi mj mk ml mlj mm mn mnj mo mp mr ms mt mć mu mf mh mc mč mdž mš na nb nv ng nd nđ ne nž nz ni nj nk nl nlj nm nn nnj no np nr ns nt nć nu nf nh nc nč ndž nš nja njb njv njg njd njđ nje njž njz nji njj njk njl njlj njm njn njnj njo njp njr njs njt njć nju njf njh njc njč njdž njš oa ob ov og od ođ oe ož oz oi oj ok ol olj om on onj oo op or os ot oć ou of oh oc oč odž oš pa pb pv pg pd pđ pe pž pz pi pj pk pl plj pm pn pnj po pp pr ps pt pć pu pf ph pc pč pdž pš ra rb rv rg rd rđ re rž rz ri rj rk rl rlj rm rn rnj ro rp rr rs rt rć ru rf rh rc rč rdž rš sa sb sv sg sd sđ se sž sz si sj sk sl slj sm sn snj so sp sr ss st sć su sf sh sc sč sdž sš ta tb tv tg td tđ te tž tz ti tj tk tl tlj tm tn tnj to tp tr ts tt tć tu tf th tc tč tdž tš ća ćb ćv ćg ćd ćđ će ćž ćz ći ćj ćk ćl ćlj ćm ćn ćnj ćo ćp ćr ćs ćt ćć ću ćf ćh ćc ćč ćdž ćš ua ub uv ug ud uđ ue už uz ui uj uk ul ulj um un unj uo up ur us ut uć uu uf uh uc uč udž uš fa fb fv fg fd fđ fe fž fz fi fj fk fl flj fm fn fnj fo fp fr fs ft fć fu ff fh fc fč fdž fš ha hb hv hg hd hđ he hž hz hi hj hk hl hlj hm hn hnj ho hp hr hs ht hć hu hf hh hc hč hdž hš ca cb cv cg cd cđ ce cž cz ci cj ck cl clj cm cn cnj co cp cr cs ct cć cu cf ch cc cč cdž cš ča čb čv čg čd čđ če čž čz či čj čk čl člj čm čn čnj čo čp čr čs čt čć ču čf čh čc čč čdž čš dža džb džv džg džd džđ dže džž džz dži džj džk džl džlj džm džn džnj džo džp džr džs džt džć džu džf džh džc džč dždž džš ša šb šv šg šd šđ še šž šz ši šj šk šl šlj šm šn šnj šo šp šr šs št šć šu šf šh šc šč šdž šš', # Fuzzy 'cite_references_link_many_sep' => ' ', 'cite_references_link_many_and' => ' ', ); @@ -3389,16 +3469,21 @@ Definera fler i [[MediaWiki:$2]]-meddelandet.', ); /** Tamil (தமிழ்) + * @author Jayarathina * @author Shanmugamp7 * @author செல்வா */ $messages['ta'] = array( 'cite-desc' => 'சேர்க்கிறது மற்றும் குறிச்சொற்கள், மேற்கோள்களுக்காக', 'cite_error' => 'பிழை காட்டு: $1', + 'cite_error_references_no_text' => 'செல்லாத <ref> குறிச்சொல்; +$1 என்னும் பெயரில் உள்ள ref குறிச்சொல்லுக்கு உரையேதும் வழங்கப்படவில்லை', + 'cite_error_refs_without_references' => '<ref> குறிச்சொல் உள்ளது, ஆனால் <references/> குறிச்சொல் காணப்படவில்லை', ); /** Telugu (తెలుగు) * @author Chaduvari + * @author Ravichandra * @author Veeven */ $messages['te'] = array( @@ -3411,6 +3496,7 @@ $messages['te'] = array( 'cite_error_references_invalid_parameters' => 'సరైన <references> ట్యాగు కాదు; పారామీటర్లకు కు అనుమతి లేదు, ఈ లోపాన్ని కలుగజేసే ఒక ఉదాహరణ: ', 'cite_error_references_no_backlink_label' => 'మీ స్వంత బ్యాక్‌లింకు లేబుళ్ళు అయిపోయాయి. [[MediaWiki:Cite references link many format backlink labels]] సందేశంలో మరిన్ని లేబుళ్ళను నిర్వచించుకోండి.', 'cite_error_references_no_text' => 'సరైన <ref> కాదు; $1 అనే పేరుగల ref లకు పాఠ్యమేమీ ఇవ్వలేదు', + 'cite_references_link_accessibility_label' => 'పైకి దూకు', ); /** Tajik (Cyrillic script) (тоҷикӣ) @@ -3599,6 +3685,8 @@ sadece "group" parametresine izin verilir. 'cite_error_references_no_key' => "<references>'da tanımlanan <ref> etiketinin hiçbir ad özniteliği yok.", 'cite_error_empty_references_define' => '<references>\'da tanımlanan "$1" adlı <ref> etiketinin içeriği yok.', 'cite_references_link_many_format_backlink_labels' => 'a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej ek el em en eo ep eq er es et eu ev ew ex ey ez fa fb fc fd fe ff fg fh fi fj fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gf gg gh gi gj gk gl gm gn go gp gq gr gs gt gu gv gw gx gy gz ha hb hc hd he hf hg hh hi hj hk hl hm hn ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il im in io ip iq ir is it iu iv iw ix iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn ko kp kq kr ks kt ku kv kw kx ky kz la lb lc ld le lf lg lh li lj lk ll lm ln lo lp lq lr ls lt lu lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo op oq or os ot ou ov ow ox oy oz pa pb pc pd pe pf pg ph pi pj pk pl pm pn po pp pq pr ps pt pu pv pw px py pz qa qb qc qd qe qf qg qh qi qj qk ql qm qn qo qp qq qr qs qt qu qv qw qx qy qz ra rb rc rd re rf rg rh ri rj rk rl rm rn ro rp rq rr rs rt ru rv rw rx ry rz sa sb sc sd se sf sg sh si sj sk sl sm sn so sp sq sr ss st su sv sw sx sy sz ta tb tc td te tf tg th ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty tz ua ub uc ud ue uf ug uh ui uj uk ul um un uo up uq ur us ut uu uv uw ux uy uz va vb vc vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz wa wb wc wd we wf wg wh wi wj wk wl wm wn wo wp wq wr ws wt wu wv ww wx wy wz xa xb xc xd xe xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk yl ym yn yo yp yq yr ys yt yu yv yw yx yy yz za zb zc zd ze zf zg zh zi zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz', + 'cite_references_link_accessibility_label' => 'Yukarı git', + 'cite_references_link_many_accessibility_label' => 'Şuraya git:', ); /** Tatar (Cyrillic script) (татарча) diff --git a/extensions/Cite/Cite.php b/extensions/Cite/Cite.php index 4b2f70ff..045bb8cc 100644 --- a/extensions/Cite/Cite.php +++ b/extensions/Cite/Cite.php @@ -18,8 +18,6 @@ if ( ! defined( 'MEDIAWIKI' ) ) */ $wgHooks['ParserFirstCallInit'][] = 'wfCite'; -$wgHooks['BeforePageDisplay'][] = 'wfCiteBeforePageDisplay'; - $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, @@ -98,22 +96,4 @@ $wgResourceModules['ext.rtlcite'] = $citeResourceTemplate + array( 'position' => 'top', ); -/** - * @param $out OutputPage - * @param $sk Skin - * @return bool - */ -function wfCiteBeforePageDisplay( $out, &$sk ) { - global $wgCiteEnablePopups; - - $out->addModules( 'ext.cite' ); - if ( $wgCiteEnablePopups ) { - $out->addModules( 'ext.cite.popups' ); - } - - /* RTL support quick-fix module */ - $out->addModuleStyles( 'ext.rtlcite' ); - return true; -} - /**#@-*/ diff --git a/extensions/Cite/Cite_body.php b/extensions/Cite/Cite_body.php index 27432f47..08c60722 100644 --- a/extensions/Cite/Cite_body.php +++ b/extensions/Cite/Cite_body.php @@ -155,6 +155,7 @@ class Cite { * @return string */ function ref( $str, $argv, $parser ) { + global $wgCiteEnablePopups; if ( $this->mInCite ) { return htmlspecialchars( "$str" ); } else { @@ -162,6 +163,12 @@ class Cite { $this->mInCite = true; $ret = $this->guardedRef( $str, $argv, $parser ); $this->mInCite = false; + $parserOutput = $parser->getOutput(); + $parserOutput->addModules( 'ext.cite' ); + if ( $wgCiteEnablePopups ) { + $parserOutput->addModules( 'ext.cite.popups' ); + } + $parserOutput->addModuleStyles( 'ext.rtlcite' ); return $ret; } } diff --git a/extensions/Cite/SpecialCite.alias.php b/extensions/Cite/SpecialCite.alias.php index 8061afcc..cbcdafbb 100644 --- a/extensions/Cite/SpecialCite.alias.php +++ b/extensions/Cite/SpecialCite.alias.php @@ -74,7 +74,7 @@ $specialPageAliases['ce'] = array( 'Cite' => array( 'Дош' ), ); -/** Czech (česky) */ +/** Czech (čeština) */ $specialPageAliases['cs'] = array( 'Cite' => array( 'Citovat' ), ); diff --git a/extensions/Cite/SpecialCite.i18n.php b/extensions/Cite/SpecialCite.i18n.php index 635025d4..79665633 100644 --- a/extensions/Cite/SpecialCite.i18n.php +++ b/extensions/Cite/SpecialCite.i18n.php @@ -395,7 +395,7 @@ $messages['arz'] = array( * @author Gitartha.bordoloi */ $messages['as'] = array( - 'cite_article_desc' => 'এখন [[Special:Cite|উদ্ধৃতি]] পৃষ্ঠা আৰু এটা টুলবক্স লিংক যোগ কৰে', + 'cite_article_desc' => 'এটা [[Special:Cite|উদ্ধৃতি]] পৃষ্ঠা আৰু এটা সা-সৰঞ্জাম লিংক যোগ কৰে', 'cite_article_link' => 'এই পৃষ্ঠাৰ উদ্ধৃতি দিয়ক', 'tooltip-cite-article' => 'এই পৃষ্ঠাখনৰ উদ্ধৃতি দিয়াৰ বিষয়ে তথ্য', 'cite' => '↓উদ্ধৃত', @@ -1014,6 +1014,7 @@ $messages['cdo'] = array( * @author Умар */ $messages['ce'] = array( + 'cite_article_desc' => 'ГӀирсан тӀе туху [[Special:Cite|дешнаш дало]] белхан агӀо а хьажораг а', 'cite_article_link' => 'АгӀонах лаьцна дешнаш дало', 'tooltip-cite-article' => 'ХӀара бу хаам агӀонах лаьцна дешнаш муха дало деза гойтуш', 'cite' => 'Далийнадош', @@ -1048,7 +1049,7 @@ $messages['co'] = array( 'cite_page' => 'Pagina:', ); -/** Czech (česky) +/** Czech (čeština) * @author Beren * @author Li-sung * @author Martin Kozák @@ -1130,7 +1131,7 @@ Při použití [[LaTeX]]ového balíčku url (někde na začátku dokumentu je u ", ); -/** Church Slavic (словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) +/** Church Slavic (словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) * @author ОйЛ */ $messages['cu'] = array( @@ -1285,9 +1286,10 @@ Når du bruger [[LaTeX]] pakkens URL-adressen (\\usepackage{url} et /** German (Deutsch) * @author Kghbln + * @author Purodha */ $messages['de'] = array( - 'cite_article_desc' => 'Ergänzt eine [[Special:Cite|Spezialseite]] als Zitierhilfe sowie einen zugehörigen Link im Bereich Werkzeuge', + 'cite_article_desc' => 'Erweitert das Wiki um eine [[Special:Cite|Spezialseite]] als Zitierhilfe sowie einen Link darauf im Bereich Werkzeuge', 'cite_article_link' => 'Seite zitieren', 'tooltip-cite-article' => 'Hinweis, wie diese Seite zitiert werden kann', 'cite' => 'Zitierhilfe', @@ -1955,6 +1957,77 @@ $messages['frp'] = array( 'cite_submit' => 'Citar', ); +/** Northern Frisian (Nordfriisk) + * @author Murma174 + */ +$messages['frr'] = array( + 'cite_article_desc' => 'Diar komt en nei [[Special:Cite|spezial-sidj]] tu, am sitiarin ianfacher tu maagin, an uk en ferwisang bi a werktjüügen', + 'cite_article_link' => 'Detdiar sidj sitiare', + 'tooltip-cite-article' => 'Hü detdiar sidj sitiaret wurd koon', + 'cite' => 'Sitiare', + 'cite_page' => 'Sidj:', + 'cite_submit' => 'Sitiare', + 'cite_text' => "__NOTOC__ +
    + +== Bibliograafisk dooten för {{FULLPAGENAME}} == + +* Sidj: {{FULLPAGENAME}} +* Skriiwer: {{SITENAME}} contributors +* Ütjden faan: ''{{SITENAME}}, {{int:sitesubtitle}}''. +* Leetst feranrang: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} {{CURRENTTIME}} UTC +* Ufrepen: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} {{CURRENTTIME}} UTC +* Permanent URL: {{canonicalurl:{{FULLPAGENAME}}|oldid={{REVISIONID}}}} +* Sidjenwerjuun ID: {{REVISIONID}} + +
    + ", +); + /** Friulian (furlan) * @author Klenje * @author MF-Warburg @@ -1989,6 +2062,13 @@ $messages['ga'] = array( 'cite_submit' => 'Luaigh', ); +/** Scottish Gaelic (Gàidhlig) + * @author Akerbeltz + */ +$messages['gd'] = array( + 'cite_article_link' => 'Thoir iomradh air an duilleag seo', +); + /** Galician (galego) * @author Toliño * @author Xosé @@ -3585,6 +3665,7 @@ $messages['kw'] = array( ); /** Latin (Latina) + * @author Autokrator * @author MissPetticoats * @author SPQRobin * @author UV @@ -3592,17 +3673,26 @@ $messages['kw'] = array( $messages['la'] = array( 'cite_article_desc' => ' Addet [[Special:Cite|citation]] specialem paginam et arcam instrumenti', # Fuzzy 'cite_article_link' => 'Hanc paginam citare', + 'tooltip-cite-article' => 'Institutiones de hanc pagina citanda', 'cite' => 'Paginam citare', 'cite_page' => 'Pagina:', 'cite_submit' => 'Citare', ); +/** Ladino (Ladino) + * @author Menachem.Moreira + */ +$messages['lad'] = array( + 'cite_page' => 'Pajina:', +); + /** Luxembourgish (Lëtzebuergesch) * @author Kaffi * @author Robby + * @author Soued031 */ $messages['lb'] = array( - 'cite_article_desc' => "Setzt eng [[Special:Cite|Zitatioun op dëser Spezialsäit]] bäi an e Link an d'Geschiirkëscht", + 'cite_article_desc' => "Setzt eng [[Special:Cite|Zitatioun op dëser Spezialsäit]] bei an e Link an d'Geschiirkëscht", 'cite_article_link' => 'Dës Säit zitéieren', 'tooltip-cite-article' => 'Informatioune wéi een dës Säit zitéiere kann', 'cite' => 'Zitéierhëllef', @@ -3726,10 +3816,15 @@ $messages['lo'] = array( ); /** لوری (لوری) + * @author Bonevarluri * @author Mogoeilor */ $messages['lrc'] = array( + 'cite_article_link' => 'جاگه ای بلگه', + 'tooltip-cite-article' => 'دونسمنیا چه جور دای بلگه جاگر بوئه', + 'cite' => 'جاگه', 'cite_page' => 'بلگه', + 'cite_submit' => 'جاگه', ); /** Lithuanian (lietuvių) @@ -4086,7 +4181,7 @@ $messages['mn'] = array( * @author V.narsikar */ $messages['mr'] = array( - 'cite_article_desc' => 'एक विशेष [[Special:Cite|बाह्यदुवे]] देणारे पान व टूलबॉक्सची लिंक तयार करा', + 'cite_article_desc' => 'एक [[Special:Cite|बाह्यदुवे]] देणारे विशेषपान व साधनपेटीचा दुवा जोडते', 'cite_article_link' => 'हे पान उधृत करा', 'tooltip-cite-article' => 'हे पृष्ठ बघण्यासाठीची माहिती', 'cite' => 'उधृत करा', @@ -5411,6 +5506,16 @@ $messages['sgs'] = array( 'cite_page' => 'Poslapis:', ); +/** Serbo-Croatian (srpskohrvatski / српскохрватски) + * @author Kolega2357 + */ +$messages['sh'] = array( + 'cite_article_link' => 'Citiraj ovaj članak', + 'cite' => 'Citiraj', + 'cite_page' => 'Stranica:', + 'cite_submit' => 'Citiraj - Цитирај', +); + /** Sinhala (සිංහල) * @author Budhajeewa * @author නන්දිමිතුරු @@ -5580,6 +5685,7 @@ When using the [[LaTeX]] package url (\\usepackage{url} somewhere i ); /** Serbian (Cyrillic script) (српски (ћирилица)‎) + * @author Milicevic01 * @author Millosh * @author Rancher * @author Sasa Stefanovic @@ -5588,25 +5694,144 @@ When using the [[LaTeX]] package url (\\usepackage{url} somewhere i */ $messages['sr-ec'] = array( 'cite_article_desc' => 'Додаје посебну страницу за [[Special:Cite|цитирање]] и везу с алаткама', - 'cite_article_link' => 'Библиографски подаци', + 'cite_article_link' => 'Цитирај ову страницу', 'tooltip-cite-article' => 'Информације о томе како цитирати ову страну', - 'cite' => 'цитат', + 'cite' => 'Цитирање', 'cite_page' => 'Страница:', - 'cite_submit' => 'цитат', + 'cite_submit' => 'Цитирај', + 'cite_text' => "__NOTOC__ +
    + +== Библиографски детаљи за страну {{FULLPAGENAME}} == + +* Назив стране: {{FULLPAGENAME}} +* Аутор: {{SITENAME}} сарадници +* Издавач: ''{{SITENAME}}, {{int:sitesubtitle}}''. +* Датум последње ревизије: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} {{CURRENTTIME}} UTC +* Датум узимања: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} {{CURRENTTIME}} UTC +* Стални URL: {{fullurl:{{FULLPAGENAME}}|oldid={{REVISIONID}}}} +* ID верзије стране: {{REVISIONID}} + +
    +", ); /** Serbian (Latin script) (srpski (latinica)‎) * @author Liangent * @author Michaello + * @author Milicevic01 * @author Жељко Тодоровић */ $messages['sr-el'] = array( 'cite_article_desc' => 'Dodaje specijalnu stranu za [[Special:Cite|citiranje]] i vezu ka oruđima.', - 'cite_article_link' => 'citiranje ove strane', + 'cite_article_link' => 'Citiraj ovu stranicu', 'tooltip-cite-article' => 'Informacije o tome kako citirati ovu stranu', - 'cite' => 'citat', + 'cite' => 'Citiranje', 'cite_page' => 'Stranica:', - 'cite_submit' => 'citat', + 'cite_submit' => 'Citiraj', + 'cite_text' => "__NOTOC__ +
    + +== Bibliografski detalji za stranu {{FULLPAGENAME}} == + +* Naziv strane: {{FULLPAGENAME}} +* Autor: {{SITENAME}} saradnici +* Izdavač: ''{{SITENAME}}, {{int:sitesubtitle}}''. +* Datum poslednje revizije: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} {{CURRENTTIME}} UTC +* Datum uzimanja: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} {{CURRENTTIME}} UTC +* Stalni URL: {{fullurl:{{FULLPAGENAME}}|oldid={{REVISIONID}}}} +* ID verzije strane: {{REVISIONID}} + +
    +", ); /** Seeltersk (Seeltersk) diff --git a/extensions/Cite/citeParserTests.txt b/extensions/Cite/citeParserTests.txt index 3076eeb6..052cd56a 100644 --- a/extensions/Cite/citeParserTests.txt +++ b/extensions/Cite/citeParserTests.txt @@ -311,16 +311,20 @@ AAAref aBBBnote bCCC[参 1]BBB[注 1]CCC[参 2]

    -
    refs -
    +
    +
    refs +
    +
    1. ref a
    2. ref c
    -
    notes -
    +
    +
    notes +
    +
    1. note b
    2. diff --git a/extensions/ConfirmEdit/Asirra.i18n.php b/extensions/ConfirmEdit/Asirra.i18n.php index 23190c29..451107bb 100644 --- a/extensions/ConfirmEdit/Asirra.i18n.php +++ b/extensions/ConfirmEdit/Asirra.i18n.php @@ -76,10 +76,28 @@ $messages['be-tarask'] = array( * @author Fohanno */ $messages['br'] = array( + 'asirra-desc' => 'Modulenn Asirra evit ConfirmEdit', + 'asirra-edit' => 'Evit sikour da wareziñ ar wiki diouzh ar stroboù emgefre, diuzit ar skeudennoù kizhier er voest dindan :', 'asirra-nojs' => "'''Gweredekait JavaScript, mar plij, hag adkasit ar bajenn.'''", + 'asirra-failed' => 'Diuzit an holl skeudennoù kizhier, mar plij', ); -/** Czech (česky) +/** Catalan (català) + * @author Toniher + */ +$messages['ca'] = array( + 'asirra-desc' => 'Mòdul Asirra de ConfirmEdit', + 'asirra-edit' => 'Per tal de protegir el wiki contra les edicions brosses, us demanem que seleccioneu només les fotos de gats del requadre a continuació:', + 'asirra-addurl' => "La modificació inclou nous enllaços externs. Per tal de protegir el wiki davant d'edicions brossa, us demanem que seleccioneu només les fotos de gots del requadre a continuació:", + 'asirra-badlogin' => 'Per tal de protegir el wiki contra els intents de trencament de contrasenyes, us demanem que seleccioneu només les fotos de gats del requadre a continuació:', + 'asirra-createaccount' => 'Per tal de protegir el wiki contra la creació automatitzada de comptes, us demanem que seleccioneu només les fotos de gats del requadre a continuació:', + 'asirra-createaccount-fail' => 'Identifiqueu correctament els gats.', + 'asirra-create' => 'Per tal de protegir el wiki contra la creació automàtica de pàgines, us demanem que seleccioneu només les fotos de gats del requadre a continuació:', + 'asirra-nojs' => "'''Habilitieu el JavaScript i torneu a enviar la pàgina.'''", + 'asirra-failed' => 'Identifiqueu totes les imatges de gats', +); + +/** Czech (čeština) * @author Vks */ $messages['cs'] = array( @@ -123,19 +141,35 @@ $messages['diq'] = array( /** Spanish (español) * @author Armando-Martin + * @author Ciencia Al Poder */ $messages['es'] = array( 'asirra-desc' => 'Módulo de Asirra para ConfirmEdit', 'asirra-edit' => 'Para ayudar a protegernos contra el spam de edición automática, seleccione sólo las fotos de gatos en el cuadro siguiente:', # Fuzzy - 'asirra-addurl' => 'Su edición incluye nuevos enlaces externos. Para ayudar a protegernos contra el spam automatizado, por favor, seleccione solo las fotos de gato en el cuadro siguiente:', # Fuzzy - 'asirra-badlogin' => 'Para ayudar a protegernos del robo automatizado de contraseñas, seleccione sólo las fotos de gatos en el cuadro siguiente:', # Fuzzy - 'asirra-createaccount' => 'Para ayudar a protegernos contra la creación automatizada de cuentas, seleccione sólo las fotos de gato en el cuadro siguiente:', # Fuzzy + 'asirra-addurl' => 'Tu edición incluye nuevos enlaces externos. Para proteger el wiki contra el spam automatizado, por favor, te pedimos que selecciones solo las fotos de gatos en el cuadro siguiente:', + 'asirra-badlogin' => 'Para proteger el wiki contra el robo automatizado de contraseñas, te pedimos por favor que selecciones únicamente las fotos de gatos en el cuadro siguiente:', + 'asirra-createaccount' => 'Para proteger el wiki contra la creación automatizada de cuentas de usuario, te pedimos por favor que selecciones únicamente las fotos de gatos en el cuadro siguiente:', 'asirra-createaccount-fail' => 'Identifique correctamente los gatos.', - 'asirra-create' => 'Para ayudar a protegernos contra la creación automática de páginas, seleccione sólo las fotos de gato en el cuadro siguiente:', # Fuzzy + 'asirra-create' => 'Para proteger el wiki contra la creación automatizada de páginas, te pedimos por favor que selecciones únicamente las fotos de gatos en el cuadro siguiente:', 'asirra-nojs' => "'''Por favor active JavaScript y vuelva a la página.'''", 'asirra-failed' => 'Identifique todas las imágenes de gatos', ); +/** Persian (فارسی) + * @author Armin1392 + */ +$messages['fa'] = array( + 'asirra-desc' => 'بخش آسیرا برای تایید ویرایش', + 'asirra-edit' => ' برای محافظت ویکی دربرابر ویرایش خودکار اسپم، ما دوستانه از شما درخواست می‌کنیم که تنها عکس‌های گربه را در جعبهٔ زیر انتخاب کنید:', + 'asirra-addurl' => 'ویرایش شما شامل لینک‌های خارجی جدید است.برای محافظت ویکی دربرابر ویرایش خودکار اسپم، ما دوستانه از شما درخواست می‌کنیم که تنها عکس‌های گربه را در جعبهٔ زیر انتخاب کنید:', + 'asirra-badlogin' => 'برای محافظت ویکی دربرابر رخنه به رمز‌ عبور به طور خودکار، ما دوستانه از شما درخواست می‌کنیم که تنها عکس‌های گربه را در جعبهٔ زیر انتخاب کنید:', + 'asirra-createaccount' => 'برای محافظت ویکی دربرابر ایجاد حساب به طور خودکار، ما دوستانه از شما درخواست می‌کنیم که تنها عکس‌های گربه را در جعبهٔ زیر انتخاب کنید:', + 'asirra-createaccount-fail' => 'لطفاً این گربه‌ها را به درستی شناسایی کنید.', + 'asirra-create' => 'برای محافظت ویکی دربرابر ایجاد صفحه به طور خودکار، ما دوستانه از شما درخواست می‌کنیم که تنها عکس‌های گربه را در جعبهٔ زیر انتخاب کنید:', + 'asirra-nojs' => "'''لطفاً جاوااسکریپت را فعال کنید و صفحه را دوباره ارائه کنید.'''", + 'asirra-failed' => 'لطفاً همهٔ عکس‌های گربه را شناسایی کنید', +); + /** Finnish (suomi) * @author VezonThunder */ @@ -183,17 +217,33 @@ $messages['gl'] = array( 'asirra-failed' => 'Identifique todas as fotos de gatos', ); +/** Hebrew (עברית) + * @author Yona b + * @author ערן + */ +$messages['he'] = array( + 'asirra-desc' => 'מודול Asirra לאישור עריכה (ConfirmEdit)', + 'asirra-edit' => 'כדי להגן על הוויקי מעריכות ספאם אוטומטיות, נבקשך לבחור רק את תמונות החתולים בתיבה שלהלן:', + 'asirra-addurl' => 'העריכה שלך כוללת קישורים חיצוניים חדשים. כדי להגן על הויקי מעריכות ספאם אוטומטיות, נבקשך לבחור רק את תמונות החתולים בתיבה שלהלן:', + 'asirra-badlogin' => 'כדי להגן על הוויקי מפיצוח אוטומטי של סיסמאות, נבקשך לבחור רק את תמונות החתולים בתיבה שלהלן:', + 'asirra-createaccount' => 'כדי להגן על הוויקי מפני יצירה אוטומטית של חשבונות, נבקשך לבחור רק את תמונות החתולים בתיבה שלהלן:', + 'asirra-createaccount-fail' => 'יש לזהות כראוי את החתולים.', + 'asirra-create' => 'כדי להגן על הוויקי מפני יצירה אוטומטית של דפים, נבקשך לבחור רק את תמונות החתולים בתיבה שלהלן:', + 'asirra-nojs' => "'''יש לאפשר JavaScript ולשלוח מחדש את הדף.'''", + 'asirra-failed' => 'יש לזהות את כל תמונות החתולים', +); + /** Upper Sorbian (hornjoserbsce) * @author Michawiki */ $messages['hsb'] = array( 'asirra-desc' => 'Modul Asirra za ConfirmEdit', - 'asirra-edit' => 'Za škit přećiwo awtomatizowanemu spamej, prošu wubjer jenož fota kóčkow w slědowacym polu:', # Fuzzy - 'asirra-addurl' => 'Twoja změna wobsahuje nowe eksterne wotkazy. Za škit přećiwo awtomatizowanemu spamej, prošu wubjer jenož fota kóčkow w slědowacym polu:', # Fuzzy - 'asirra-badlogin' => 'Za škit přećiwo awtomatizowanemu złamanju hesłow, prošu wubjer jenož fota kóčkow w slědowacym polu:', # Fuzzy - 'asirra-createaccount' => 'Za škit přećiwo awtomatiskemu wutworjenju konta, prošu wubjer jenož fota kóčkow w slědowacym polu:', # Fuzzy + 'asirra-edit' => 'Za škit přećiwo awtomatizowanemu spamej, prošu wubjer jenož fota kóčkow w slědowacym polu:', + 'asirra-addurl' => 'Twoja změna wobsahuje nowe eksterne wotkazy. Za škit přećiwo awtomatizowanemu spamej, prošu wubjer jenož fota kóčkow w slědowacym polu:', + 'asirra-badlogin' => 'Za škit přećiwo awtomatizowanemu złamanju hesłow, prošu wubjer jenož fota kóčkow w slědowacym polu:', + 'asirra-createaccount' => 'Za škit přećiwo awtomatiskemu wutworjenju konta, prošu wubjer jenož fota kóčkow w slědowacym polu:', 'asirra-createaccount-fail' => 'Prošu identifikuj kóčki.', - 'asirra-create' => 'Za škit přećiwo awtomatiskemu wutworjenju strony, prošu wubjer jenož fota kóčkow w slědowacym polu:', # Fuzzy + 'asirra-create' => 'Za škit přećiwo awtomatiskemu wutworjenju strony, prošu wubjer jenož fota kóčkow w slědowacym polu:', 'asirra-nojs' => "'''Prošu zmóžń JavaScript a składuj stronu hišće raz.'''", 'asirra-failed' => 'Prošu identifikuj wšě wobrazy z kóčkami', ); @@ -245,16 +295,17 @@ $messages['ja'] = array( ); /** Korean (한국어) + * @author Hym411 * @author 아라 */ $messages['ko'] = array( 'asirra-desc' => 'ConfirmEdit에 대한 Asirra 모듈', - 'asirra-edit' => '자동화된 편집 스팸으로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', # Fuzzy - 'asirra-addurl' => '편집에 새로운 바깥 링크가 포함되어 있습니다. 자동화된 스팸으로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', # Fuzzy - 'asirra-badlogin' => '비밀번호 깨기로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', # Fuzzy - 'asirra-createaccount' => '자동화된 계정 만들기로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', # Fuzzy + 'asirra-edit' => '자동화된 편집 스팸으로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', + 'asirra-addurl' => '편집에 새로운 바깥 링크가 포함되어 있습니다. 자동화된 스팸으로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', + 'asirra-badlogin' => '자동화된 비밀번호 크래킹으로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', + 'asirra-createaccount' => '자동화된 계정 만들기로부터 위키를 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', 'asirra-createaccount-fail' => '고양이를 올바르게 선택하세요.', - 'asirra-create' => '자동화된 문서 만들기로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', # Fuzzy + 'asirra-create' => '자동화된 문서 만들기로부터 위키를 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', 'asirra-nojs' => "'''자바스크립트를 활성화하고 문서를 다시 제출하세요.'''", 'asirra-failed' => '고양이 그림을 모두 선택하세요', ); @@ -421,12 +472,12 @@ $messages['pt'] = array( */ $messages['roa-tara'] = array( 'asirra-desc' => 'Module Asirra pe confermà le cangiaminde', - 'asirra-edit' => "Pe darne 'na màne a proteggere condre le cangiaminde automatece de le rummate, pe piacere scacchie ìa categorije de le fote jndr'à buatte aqquà sotte:", # Fuzzy - 'asirra-addurl' => "Le cangiaminde tune 'ngludone collegaminde de fore nuève. Pe darne 'na màne a proteggere condre le cangiaminde automatece de le rummate, pe piacere scacchie 'a categorije d'a fote 'ndruche jndr'à buatte aqquà sotte:", # Fuzzy - 'asirra-badlogin' => "Pe darne 'na màne a proteggere condre le futteminde automatece de le passuord, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:", # Fuzzy - 'asirra-createaccount' => "Pe darne 'na màne a proteggere condre le ccrejaziune automatece de le cunde, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:", # Fuzzy + 'asirra-edit' => "Pe proteggere condre le cangiaminde automatece de le rummate, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:", + 'asirra-addurl' => "Le cangiaminde tune 'ngludone collegaminde de fore nuève. Pe proteggere condre le cangiaminde automatece de le rummate, pe piacere scacchie 'a categorije d'a fote 'ndruche jndr'à buatte aqquà sotte:", + 'asirra-badlogin' => "Pe proteggere condre le futteminde automatece de le passuord, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:", + 'asirra-createaccount' => "Pe proteggere condre le ccrejaziune automatece de le cunde, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:", 'asirra-createaccount-fail' => 'Pe piacere idendifiche correttamende le categorije.', - 'asirra-create' => "Pe darne 'na màne a proteggere condre le ccrejaziune automatece de le pàggene, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:", # Fuzzy + 'asirra-create' => "Pe proteggere condre le ccrejaziune automatece de le pàggene, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:", 'asirra-nojs' => "'''Pe piacere abbilite JavaScript e conferme arrete 'a pàgene.'''", 'asirra-failed' => 'Pe piacere idendifiche tutte le categorije de le immaggine', ); @@ -459,6 +510,7 @@ $messages['si'] = array( /** Swedish (svenska) * @author Jopparn * @author Rotsee + * @author Tobulos1 * @author WikiPhoenix */ $messages['sv'] = array( @@ -466,6 +518,7 @@ $messages['sv'] = array( 'asirra-addurl' => 'Din redigering innehåller nya externa länkar. För att skydda wikin mot automatiserat redigerings-spam ber vi dig att endast markera fotografierna på katter i rutan nedan:', 'asirra-badlogin' => 'För att skydda wikin mot automatiserade försök att knäcka lösenord ber vi dig att endast markera fotografierna på katter i rutan nedan:', 'asirra-createaccount' => 'För att skydda wikin mot automatiserat kontoskapande ber vi dig att endast markera fotografierna på katter i rutan nedan:', + 'asirra-createaccount-fail' => 'Vänligen identifiera katterna korrekt.', 'asirra-create' => 'För att skydda wikin mot automatiserat sidskapande ber vi dig att endast markera fotografierna på katter i rutan nedan:', 'asirra-nojs' => "'''Var god aktivera JavaScript och hämta sidan igen.'''", 'asirra-failed' => 'Var god identifiera alla kattbilder', diff --git a/extensions/ConfirmEdit/Captcha.php b/extensions/ConfirmEdit/Captcha.php index 3be6d917..20b2dfd4 100644 --- a/extensions/ConfirmEdit/Captcha.php +++ b/extensions/ConfirmEdit/Captcha.php @@ -355,26 +355,38 @@ class SimpleCaptcha { */ function filterLink( $url ) { global $wgCaptchaWhitelist; - $source = wfMessage( 'captcha-addurl-whitelist' )->inContentLanguage()->text(); + static $regexes = null; - $whitelist = wfMessage( 'captcha-addurl-whitelist', $source )->isDisabled() - ? false - : $this->buildRegexes( explode( "\n", $source ) ); + if ( $regexes === null ) { + $source = wfMessage( 'captcha-addurl-whitelist' )->inContentLanguage(); - $cwl = $wgCaptchaWhitelist !== false ? preg_match( $wgCaptchaWhitelist, $url ) : false; - $wl = $whitelist !== false ? preg_match( $whitelist, $url ) : false; + $regexes = $source->isDisabled() + ? array() + : $this->buildRegexes( explode( "\n", $source->plain() ) ); - return !( $cwl || $wl ); + if ( $wgCaptchaWhitelist !== false ) { + array_unshift( $regexes, $wgCaptchaWhitelist ); + } + } + + foreach ( $regexes as $regex ) { + if ( preg_match( $regex, $url ) ) { + return false; + } + } + + return true; } /** * Build regex from whitelist * @param $lines string from [[MediaWiki:Captcha-addurl-whitelist]] - * @return string Regex or bool false if whitelist is empty + * @return array Regexes * @access private */ function buildRegexes( $lines ) { # Code duplicated from the SpamBlacklist extension (r19197) + # and later modified. # Strip comments and whitespace, then remove blanks $lines = array_filter( array_map( 'trim', preg_replace( '/#.*$/', '', $lines ) ) ); @@ -382,34 +394,59 @@ class SimpleCaptcha { # No lines, don't make a regex which will match everything if ( count( $lines ) == 0 ) { wfDebug( "No lines\n" ); - return false; + return array(); } else { # Make regex # It's faster using the S modifier even though it will usually only be run once // $regex = 'http://+[a-z0-9_\-.]*(' . implode( '|', $lines ) . ')'; // return '/' . str_replace( '/', '\/', preg_replace('|\\\*/|', '/', $regex) ) . '/Si'; - $regexes = ''; - $regexStart = '/^https?:\/\/+[a-z0-9_\-.]*('; - $regexEnd = ')/Si'; + $regexes = array(); + $regexStart = array( + 'normal' => '/^https?:\/\/+[a-z0-9_\-.]*(?:', + 'noprotocol' => '/^(?:', + ); + $regexEnd = array( + 'normal' => ')/Si', + 'noprotocol' => ')/Si', + ); $regexMax = 4096; - $build = false; + $build = array(); foreach ( $lines as $line ) { + # Extract flags from the line + $options = array(); + if ( preg_match( '/^(.*?)\s*<([^<>]*)>$/', $line, $matches ) ) { + if ( $matches[1] === '' ) { + wfDebug( "Line with empty regex\n" ); + continue; + } + $line = $matches[1]; + $opts = preg_split( '/\s*\|\s*/', trim( $matches[2] ) ); + foreach ( $opts as $opt ) { + $opt = strtolower( $opt ); + if ( $opt == 'noprotocol' ) { + $options['noprotocol'] = true; + } + } + } + + $key = isset( $options['noprotocol'] ) ? 'noprotocol' : 'normal'; + // FIXME: not very robust size check, but should work. :) - if ( $build === false ) { - $build = $line; - } elseif ( strlen( $build ) + strlen( $line ) > $regexMax ) { - $regexes .= $regexStart . - str_replace( '/', '\/', preg_replace( '|\\\*/|', '/', $build ) ) . - $regexEnd; - $build = $line; + if ( !isset( $build[$key] ) ) { + $build[$key] = $line; + } elseif ( strlen( $build[$key] ) + strlen( $line ) > $regexMax ) { + $regexes[] = $regexStart[$key] . + str_replace( '/', '\/', preg_replace( '|\\\*/|', '/', $build[$key] ) ) . + $regexEnd[$key]; + $build[$key] = $line; } else { - $build .= '|' . $line; + $build[$key] .= '|' . $line; } } - if ( $build !== false ) { - $regexes .= $regexStart . - str_replace( '/', '\/', preg_replace( '|\\\*/|', '/', $build ) ) . - $regexEnd; + foreach ( $build as $key => $value ) { + $regexes[] = $regexStart[$key] . + str_replace( '/', '\/', preg_replace( '|\\\*/|', '/', $build[$key] ) ) . + $regexEnd[$key]; } return $regexes; } @@ -500,25 +537,42 @@ class SimpleCaptcha { * Hook for user creation form submissions. * @param User $u * @param string $message + * @param Status $status * @return bool true to continue, false to abort user creation */ - function confirmUserCreate( $u, &$message ) { + function confirmUserCreate( $u, &$message, &$status = null ) { + if ( $this->needCreateAccountCaptcha() ) { + $this->trigger = "new account '" . $u->getName() . "'"; + if ( !$this->passCaptcha() ) { + // For older MediaWiki + $message = wfMessage( 'captcha-createaccount-fail' )->text(); + // For MediaWiki 1.23+ + $status = Status::newFatal( 'captcha-createaccount-fail' ); + return false; + } + } + return true; + } + + /** + * Logic to check if we need to pass a captcha for the current user + * to create a new account, or not + * + * @return bool true to show captcha, false to skip captcha + */ + function needCreateAccountCaptcha() { global $wgCaptchaTriggers, $wgUser; if ( $wgCaptchaTriggers['createaccount'] ) { if ( $wgUser->isAllowed( 'skipcaptcha' ) ) { wfDebug( "ConfirmEdit: user group allows skipping captcha on account creation\n" ); - return true; + return false; } - if ( $this->isIPWhitelisted() ) - return true; - - $this->trigger = "new account '" . $u->getName() . "'"; - if ( !$this->passCaptcha() ) { - $message = wfMessage( 'captcha-createaccount-fail' )->text(); + if ( $this->isIPWhitelisted() ) { return false; } + return true; } - return true; + return false; } /** @@ -582,7 +636,7 @@ class SimpleCaptcha { * @return bool */ protected function isAPICaptchaModule( $module ) { - return $module instanceof ApiEditPage; + return $module instanceof ApiEditPage || $module instanceof ApiCreateAccount; } /** @@ -733,4 +787,50 @@ class SimpleCaptcha { $wgOut->addWikiMsg( 'captchahelp-cookies-needed' ); } } + + /** + * Pass API captcha parameters on to the login form when using + * API account creation. + * + * @param ApiCreateAccount $apiModule + * @param LoginForm $loginForm + * @return hook return value + */ + function addNewAccountApiForm( $apiModule, $loginForm ) { + global $wgRequest; + $main = $apiModule->getMain(); + + $id = $main->getVal( 'captchaid' ); + if ( $id ) { + $wgRequest->setVal( 'wpCaptchaId', $id ); + + // Suppress "unrecognized parameter" warning: + $main->getVal( 'wpCaptchaId' ); + } + + $word = $main->getVal( 'captchaword' ); + if ( $word ) { + $wgRequest->setVal( 'wpCaptchaWord', $word ); + + // Suppress "unrecognized parameter" warning: + $main->getVal( 'wpCaptchaWord' ); + } + + return true; + } + + /** + * Pass extra data back in API results for account creation. + * + * @param ApiCreateAccount $apiModule + * @param LoginForm &loginForm + * @param array &$params + * @return hook return value + */ + function addNewAccountApiResult( $apiModule, $loginPage, &$result ) { + if ( $result['result'] !== 'Success' && $this->needCreateAccountCaptcha() ) { + $this->addCaptchaAPI( $result ); + } + return true; + } } diff --git a/extensions/ConfirmEdit/ConfirmEdit.i18n.php b/extensions/ConfirmEdit/ConfirmEdit.i18n.php index e5e4c6bf..21a451e1 100644 --- a/extensions/ConfirmEdit/ConfirmEdit.i18n.php +++ b/extensions/ConfirmEdit/ConfirmEdit.i18n.php @@ -16,11 +16,11 @@ $messages['en'] = array( To protect the wiki against automated spam, we kindly ask you to solve the simple sum below and enter the answer in the box in order to save your edit ([[Special:Captcha/help|more info]]):', 'captcha-badlogin' => 'To protect the wiki against automated password cracking, we kindly ask you to solve the simple sum below and enter the answer in the box ([[Special:Captcha/help|more info]]):', 'captcha-createaccount' => 'To protect the wiki against automated account creation, we kindly ask you to solve the simple sum below and enter the answer in the box ([[Special:Captcha/help|more info]]):', - 'captcha-createaccount-fail' => 'Incorrect or missing confirmation code.', + 'captcha-createaccount-fail' => 'Incorrect or missing CAPTCHA.', 'captcha-create' => 'To create the page, please solve the simple sum below and enter the answer in the box ([[Special:Captcha/help|more info]]):', 'captcha-sendemail' => 'To protect the wiki against automated spamming, we kindly ask you to solve the simple sum below and enter the answer in the box ([[Special:Captcha/help|more info]]):', - 'captcha-sendemail-fail' => 'Incorrect or missing confirmation code.', - 'captcha-disabledinapi' => 'This action requires a captcha, so it cannot be performed through the API.', + 'captcha-sendemail-fail' => 'Incorrect or missing CAPTCHA.', + 'captcha-disabledinapi' => 'This action requires a CAPTCHA, so it cannot be performed through the API.', 'captchahelp-title' => 'CAPTCHA help', 'captchahelp-cookies-needed' => 'You will need to have cookies enabled in your browser for this to work.', 'captchahelp-text' => "Web sites that accept postings from the public, like this wiki, are often abused by spammers who use automated tools to post their links to many sites. @@ -31,7 +31,7 @@ Since this is a task that's hard to automate, it will allow most real humans to Unfortunately this may inconvenience users with limited vision or using text-based or speech-based browsers. At the moment we do not have an audio alternative available. -Please contact the [[Special:ListAdmins|site administrators]] for assistance if this is unexpectedly preventing you from making legitimate actions. +Please contact the [[Special:ListAdmins|site administrators]] for assistance if this is unexpectedly preventing you from making legitimate actions. Hit the \"back\" button in your browser to return to the page editor.", 'captcha-addurl-whitelist' => ' #
      @@ -213,11 +213,11 @@ $messages['ar'] = array(
       للمساعدة في الحماية من السبام الأوتوماتيكي، من فضلك حل عملية الجمع بالأسفل وأدخل الإجابة في الصندوق لكي يتم حفظ تعديلك ([[Special:Captcha/help|مزيد من المعلومات]]):',
       	'captcha-badlogin' => 'للمساعدة في الحماية ضد سرقة كلمات السر، من فضلك حل عملية الجمع البسيطة بالأسفل وأدخل الحل في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):',
       	'captcha-createaccount' => 'كحماية ضد إنشاء الحسابات الأوتوماتيكي، من فضلك حل عملية الجمع البسيطة بالأسفل وأدخل الإجابة في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):',
      -	'captcha-createaccount-fail' => 'كود تأكيد غير صحيح أو مفقود.',
      +	'captcha-createaccount-fail' => 'كابتشا غير صحيحة أو مفقودة.',
       	'captcha-create' => 'لإنشاء هذه الصفحة، من فضلك حل المسألة الرياضية التالية وأدخل
       الإجابة في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):',
       	'captcha-sendemail' => 'للمساعدة في الحماية ضد السخام الأتوماتيكي، من فضلك حل عملية الجمع البسيطة بالأسفل وأدخل الإجابة في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):',
      -	'captcha-sendemail-fail' => 'كود تأكيد غير صحيح أو مفقود',
      +	'captcha-sendemail-fail' => 'كابتشا غير صحيحة أو مفقودة.',
       	'captcha-disabledinapi' => 'هذا الإجراء يتطلب تحقيق , لذلك لايمكن أعتمادها من API.',
       	'captchahelp-title' => 'مساعدة الكابتشا',
       	'captchahelp-cookies-needed' => 'ستحتاج إلى أن تكون الكوكيز مفعلة في متصفحك لكي يعمل هذا',
      @@ -330,10 +330,10 @@ $messages['ast'] = array(
       	'captcha-addurl' => "La to edición inclúi nuevos enllaces esternos. Pa protexer la wiki escontra'l spam automatizáu, pidimoste por favor que resuelvas la suma simple d'embaxo y pongas la rempuesta na caxella pa guardar la edición ([[Special:Captcha/help|más información]]):",
       	'captcha-badlogin' => "Pa protexer la wiki escontra'l descifráu automáticu de claves, pidimoste por favor que resuelvas la suma simple d'embaxo y pongas la rempuesta na caxella ([[Special:Captcha/help|más información]]):",
       	'captcha-createaccount' => "Pa protexer la wiki escontra la creación automática de cuentes, pidimoste por favor que resuelvas la suma simple d'embaxo y pongas la rempuesta na caxella ([[Special:Captcha/help|más información]]):",
      -	'captcha-createaccount-fail' => 'Códigu de confirmación incorreutu o ausente.',
      +	'captcha-createaccount-fail' => 'CAPTCHA incorreutu o ausente.',
       	'captcha-create' => "Pa crear la páxina, por favor resuelvi la suma simple d'embaxo y pon la rempuesta nel caxellu ([[Special:Captcha/help|más información]]):",
       	'captcha-sendemail' => "Pa protexer la wiki escontra la puxarra automatizada, pidimoste por favor que resuelvas la suma cenciella d'embaxo y pongas la rempuesta na caxella ([[Special:Captcha/help|más información]]):",
      -	'captcha-sendemail-fail' => 'Códigu de confirmación incorreutu o ausente.',
      +	'captcha-sendemail-fail' => 'CAPTCHA incorreutu o ausente.',
       	'captcha-disabledinapi' => 'Esta aición requier un captcha y, poro, nun pue facese pel API',
       	'captchahelp-title' => 'Ayuda tocante al CAPTCHA',
       	'captchahelp-cookies-needed' => "Has tener les cookies habilitaes nel to navegador pa que'l sistema funcione.",
      @@ -600,6 +600,7 @@ $messages['bn'] = array(
       
       /** Breton (brezhoneg)
        * @author BrokenArrow
      + * @author Fohanno
        * @author Fulup
        * @author VIGNERON
        * @author Y-M D
      @@ -608,13 +609,13 @@ $messages['br'] = array(
       	'captcha-edit' => "A-raok gellout kemmañ ar bajenn-mañ e c'houlenner ouzhoc'h respont d'ar jedadenn eeun a-is ha lakaat an disoc'h er vaezienn ([[Special:Captcha/help|Petra eo se?]])",
       	'captcha-desc' => 'Pourchas a ra teknikoù CAPTCHA evit en em wareziñ diouzh ar strob hag an diskuliañ gerioù-tremen',
       	'captcha-label' => 'CAPTCHA',
      -	'captcha-addurl' => "Liammoù diavaez nevez zo bet ouzhpennet ganeoc'h. A-benn talañ ouzh ar strob emgefre skrivit disoc'h ar jedadennig eeun-mañ er stern : 
      ([[Special:Captcha/help|Petra eo se?]])", # Fuzzy - 'captcha-badlogin' => "A-benn talañ ouzh preizhadur emgefre ar gerioù-tremen gant ar botoù e c'houlenner ouzhoc'h jediñ an tamm oberiadenn ha skrivañ an disoc'h anezhi er vaezienn a-is ([[Special:Captcha/help|Petra eo se ?]]):", # Fuzzy - 'captcha-createaccount' => "A-benn hor skoazellañ da dalañ ouzh ar c'hrouiñ kontoù emgefre, jediñ an tamm oberiadenn ha skrivañ an disoc'h anezhi er vaezienn a-is ([[Special:Captcha/help|gouzout hiroc'h]]) :", # Fuzzy - 'captcha-createaccount-fail' => "Pe e vank ar c'hod kadarnaat pe eo fall anezhañ.", + 'captcha-addurl' => "Liammoù diavaez nevez zo bet ouzhpennet ganeoc'h. A-benn talañ ouzh ar strob emgefre skrivit disoc'h ar jedadennig eeun-mañ er stern :
      ([[Special:Captcha/help|Petra eo se?]])", + 'captcha-badlogin' => "A-benn talañ ouzh preizhadur emgefre ar gerioù-tremen e c'houlenner ouzhoc'h jediñ an tamm oberiadenn ha skrivañ an disoc'h anezhi er vaezienn a-is ([[Special:Captcha/help|Petra eo se ?]]):", + 'captcha-createaccount' => "A-benn hor sikour da dalañ ouzh ar c'hrouiñ kontoù emgefre, jedit an tamm oberiadenn ha skrivañ an disoc'h anezhi er vaezienn a-is ([[Special:Captcha/help|gouzout hiroc'h]]) :", + 'captcha-createaccount-fail' => "Pe e vank ar c'hod CAPTCHA pe ez eo fall.", 'captcha-create' => "A-benn krouiñ ar bajenn, skrivit disoc'h ar jedadennig eeun-mañ er vaezienn :
      ([[Special:Captcha/help|Petra eo se?]])", - 'captcha-sendemail' => "Evit hor skoazellañ da zizarbenn ar strob emgefre, sammit ar sifroù a-is ha skrivit an disoc'h er voest ([[Special:Captcha/help|gouzout hiroc'h]]) :", # Fuzzy - 'captcha-sendemail-fail' => "Pe e vank ar c'hod kadarnaat pe eo fall anezhañ.", + 'captcha-sendemail' => "Evit hor sikourda zizarbenn ar strob emgefre, sammit ar sifroù a-is ha skrivit an disoc'h er voest ([[Special:Captcha/help|gouzout hiroc'h]]) :", + 'captcha-sendemail-fail' => "Pe e vank ar c'hod CAPTCHA pe ez eo fall.", 'captcha-disabledinapi' => "Evit an obererezh-mañ ez eus ezhomm ur captcha, dre-se ne c'hell ket bezañ graet dre an API.", 'captchahelp-title' => 'Skoazell Capcha', 'captchahelp-cookies-needed' => "Ret eo deoc'h gweredekaet an toupinoù war ho merdeer Web evit ma'z afe en-dro.", @@ -687,13 +688,14 @@ $messages['ca'] = array( 'captcha-edit' => 'Per a poder modificar aquesta pàgina cal que resolgueu aquesta simple suma i introduïu el resultat en el quadre ([[Special:Captcha/help|més informació]]):', 'captcha-desc' => "Proporciona tècniques CAPTCHA per a protegir contra la publicitat no desitjada i l'obtenció de contrasenyes", 'captcha-label' => 'CAPTCHA', - 'captcha-addurl' => 'La vostra modificació conté enllaços externs nous. Com a protecció contra la brossa de propaganda automàtica, cal que resolgueu aquesta simple suma i introduïu el resultat en el quadre a continuació ([[Special:Captcha/help|més informació]]):', # Fuzzy - 'captcha-badlogin' => "Per a ajudar en la protecció contra l'obtenció automatitzada de contrasenyes haureu de resoldre la suma que apareix a continuació ([[Special:Captcha/help|més informació]]):", # Fuzzy - 'captcha-createaccount' => "Com a protecció contra la creació automàtica de comptes d'usuari necessitem que resolgueu aquesta simple suma i introduïu el resultat en el quadre a continuació ([[Special:Captcha/help|més informació]]):", # Fuzzy - 'captcha-createaccount-fail' => 'Manca el codi de confirmació, o bé és incorrecte.', + 'captcha-addurl' => 'La vostra modificació conté enllaços externs nous. +Com a protecció contra la brossa de propaganda automàtica, cal que resolgueu aquesta simple suma i introduïu el resultat en el quadre a continuació ([[Special:Captcha/help|més informació]]):', + 'captcha-badlogin' => "Com a protecció contra l'obtenció automatitzada de contrasenyes, cal que resolgueu aquesta simple suma i introduïu el resultat en el quadre a continuació ([[Special:Captcha/help|més informació]]):", + 'captcha-createaccount' => "Com a protecció contra la creació automàtica de comptes d'usuari, cal que resolgueu aquesta simple suma i introduïu el resultat en el quadre a continuació ([[Special:Captcha/help|més informació]]):", + 'captcha-createaccount-fail' => 'Hi manca el CAPTCHA o bé eś incorrecte.', 'captcha-create' => 'La vostra modificació conté enllaços externs nous. Com a protecció contra la brossa de propaganda automàtica, cal que resolgueu aquesta simple suma i introduïu el resultat en el quadre a continuació ([[Special:Captcha/help|més informació]]):', - 'captcha-sendemail' => "Per tal d'ajudar-nos en la lluita contra la publicitat automatitzada, cal que solucioneu la senzilla suma que apareix a continuació, i escrigueu el resultat a la casella ([[Special:Captcha/help|més informació]]):", # Fuzzy - 'captcha-sendemail-fail' => 'Manca el codi de confirmació, o bé és incorrecte.', + 'captcha-sendemail' => 'Com a protecció contra la brossa de propaganda automàtica, cal que resolgueu aquesta simple suma i introduïu el resultat en el quadre a continuació ([[Special:Captcha/help|més informació]]):', + 'captcha-sendemail-fail' => 'Hi manca el CAPTCHA o bé és incorrecte.', 'captcha-disabledinapi' => "Aquesta acció requereix un captcha (codi d'imatge), per la qual cosa no es pot realitzar a través de l'API.", 'captchahelp-title' => 'Ajuda amb el sistema captcha', 'captchahelp-cookies-needed' => "Heu d'activar les galetes al vostre navegador per a que funcioni.", @@ -735,6 +737,7 @@ Buóh diōng kó̤ piĕng-cĭk hiĕk-miêng, áik \"diōng kó̤ sèng 1 hiĕk\" * @author Умар */ $messages['ce'] = array( + 'captcha-desc' => 'Спамах ларо а пароль харжа а CAPTCHA таронаш хуьлуьйту', 'right-skipcaptcha' => 'CAPTCHA-хьажар кхочушдар, CAPTCHA чекхдалар доцуш', ); @@ -745,7 +748,7 @@ $messages['ckb'] = array( 'right-skipcaptcha' => 'جێبەجێکردنی کردەوەکانی پێویست بە کاپچا بەبێ بەکارھێنانی کاپچا', ); -/** Czech (česky) +/** Czech (čeština) * @author Danny B. * @author Li-sung * @author Matěj Grabovský @@ -792,10 +795,10 @@ $messages['cy'] = array( Er mwyn gwarchod y wici rhag peiriant sbam, byddwch gystal â theipio cyfanswm y swm canlynol yn y blwch isod i roi eich golygiad ar gadw ([[Special:Captcha/help|mwy o wybodaeth]]):', 'captcha-badlogin' => 'Er mwyn arbed y wici rhag peiriannau datrys cyfrineiriau, byddwch gystal â gwneud y swm syml isod a gosod yr ateb yn y blwch ([[Special:Captcha/help|rhagor o wybodaeth]]):', 'captcha-createaccount' => 'Er mwyn arbed y wici rhag peiriannau dechrau cyfrifon, byddwch gystal â gwneud y swm syml isod a gosod yr ateb yn y blwch ([[Special:Captcha/help|mwy o wybodaeth]]):', - 'captcha-createaccount-fail' => "Côd cadarnhau ar goll neu'n anghywir.", + 'captcha-createaccount-fail' => "CAPTCHA ar goll neu'n anghywir.", 'captcha-create' => "Er mwyn gallu creu'r dudalen, gwnewch y swm isod a gosodwch y canlyniad yn y blwch ([[Special:Captcha/help|rhagor o wybodaeth]]):", 'captcha-sendemail' => "Er mwyn arbed y wici rhag sbamio awtomatig, byddwch gystal â gwneud y swm syml isod ac ysgrifennu'r ateb yn y blwch ([[Special:Captcha/help|rhagor o wybodaeth]]):", - 'captcha-sendemail-fail' => 'Y cod cadarnhau yn anghywir neu yn eisiau.', + 'captcha-sendemail-fail' => 'CAPTCHA yn anghywir neu yn eisiau.', 'captcha-disabledinapi' => 'Mae angen "captcha" i gyflawni\'r weithred hon, felly nid oes modd ei gyflawni trwy\'r API.', 'captchahelp-title' => 'Cymorth "captcha"', 'captchahelp-cookies-needed' => "Er mwyn i hyn weithio mae'n rhaid bod cookies wedi eu galluogi ar eich gwe-lywiwr.", @@ -822,6 +825,7 @@ Gwasgwch botwm 'nôl' eich porwr er mwyn dychwelyd at y dudalen golygu.", /** Danish (dansk) * @author Aputtu * @author Byrial + * @author Christian List * @author Hylle * @author Kaare * @author Peter Alberti @@ -834,13 +838,13 @@ $messages['da'] = array( Som beskyttelse af wikien mod automatiseret spam, skal du løse det enkle regnestykke nedenfor og skrive resultatet i boksen, for at kunne gemme din redigering ([[Special:Captcha/help|flere oplysninger]]):', 'captcha-badlogin' => 'For at beskytte wikien mod automatiseret adgangskodegætning, skal du løse det enkle regnestykke nedenfor og skrive resultatet i boksen ([[Special:Captcha/help|flere oplysninger]]):', 'captcha-createaccount' => 'For at beskytte wikien mod automatisk oprettelse af brugernavne, skal du løse det enkle regnestykke nedenfor og skrive resultatet i boksen ([[Special:Captcha/help|flere oplysninger]]):', - 'captcha-createaccount-fail' => 'Forkert eller manglende kodeord.', + 'captcha-createaccount-fail' => 'Forkert eller manglende CAPTCHA.', 'captcha-create' => 'For at oprette en ny side, skal du give svaret på regnestyket nedenfor, og angive resultatet i feltet under det. ([[Special:Captcha/help|mere information]]):', 'captcha-sendemail' => 'For at beskytte wikien mod automatisk spamning, skal du løse det enkle regnestykke nedenfor og skrive resultatet i boksen ([[Special:Captcha/help|flere oplysninger]]):', - 'captcha-sendemail-fail' => 'Forkert eller manglende bekræftelseskode.', + 'captcha-sendemail-fail' => 'Forkert eller manglende CAPTCHA.', 'captcha-disabledinapi' => "Denne handling kræver en captcha, så det ikke kan udføres via API'en.", 'captchahelp-title' => 'Captcha-hjælp', - 'captchahelp-cookies-needed' => 'Din browser skal understøtte cookies, før dette kan gennemføres.', + 'captchahelp-cookies-needed' => 'Din browser skal have cookies slået til, før dette kan virke.', 'captchahelp-text' => "Websites der accepterer indhold fra offentligheden, bliver ofte udsat for angreb fra spammere. Disse angreb sker med automatiske værktøjer, der anbringer de samme links på et stort antal websites på kort tid. Selvom disse links kan fjernes, er de en vedligeholdelsesmæssig byrde. I visse tilfælde, specielt når der tilføjes nye links til denne wiki, vil softwaren vise dig et billede af et stykke forvredet og sløret tekst. Du skal indtaste det ord, der vises, før du kan gennemføre handlingen. Formålet er at skelne mellem mennesker og automatiserede værktøjer, da de sidste har meget svært ved at genkende ordene. @@ -873,10 +877,10 @@ $messages['de'] = array( Um das Wiki vor automatisiertem Spam zu schützen, bitten wir dich die untenstehende einfache Rechenaufgabe zu lösen und deine Antwort in das Feld einzugeben, damit deine Bearbeitung gespeichert werden kann ([[Special:Captcha/help|mehr Informationen …]]):', 'captcha-badlogin' => 'Um das Wiki vor der automatisierten Kompromittierung der Benutzerkonten zu schützen, bitten wir dich die untenstehende einfache Rechenaufgabe zu lösen und deine Antwort in das Feld einzugeben ([[Special:Captcha/help|mehr Informationen …]]):', 'captcha-createaccount' => 'Um das Wiki vor der automatisierten Erstellung von Benutzerkonten zu schützen, bitten wir dich die untenstehende einfache Rechenaufgabe zu lösen und deine Antwort in das Feld einzugeben ([[Special:Captcha/help|mehr Informationen …]]):', - 'captcha-createaccount-fail' => 'Falscher oder fehlender Bestätigungscode.', + 'captcha-createaccount-fail' => 'Falsches oder fehlendes CAPTCHA.', 'captcha-create' => 'Zur Erstellung der Seite löse die nachfolgende Rechenaufgabe und trage das Ergebnis in das Feld unten ein [[Special:Captcha/help|(Fragen oder Probleme?)]].', 'captcha-sendemail' => 'Um das Wiki vor automatisiertem Spam zu schützen, bitten wir dich die untenstehende einfache Rechenaufgabe zu lösen und deine Antwort in das Feld einzugeben ([[Special:Captcha/help|mehr Informationen …]]):', - 'captcha-sendemail-fail' => 'Falscher oder fehlender Bestätigungscode.', + 'captcha-sendemail-fail' => 'Falsches oder fehlendes CAPTCHA.', 'captcha-disabledinapi' => 'Diese Aktion benötigt ein CAPTCHA. Sie kann nicht über die API ausgeführt werden.', 'captchahelp-title' => 'CAPTCHA-Hilfe', 'captchahelp-cookies-needed' => "'''Wichtiger Hinweis:''' Es müssen Cookies im Browser erlaubt sein.", @@ -925,8 +929,10 @@ Der „Zurück“-Knopf des Browsers führt zurück zum Bearbeitungsfenster.', ); /** Zazaki (Zazaki) + * @author Asmen * @author Aspar * @author Erdemaslancan + * @author Marmase * @author Xoser */ $messages['diq'] = array( @@ -939,11 +945,11 @@ Otomatik spamî ra pawitîş, ma rica keno cewabê problemî qutiyê ke cor de z ([[Special:Captcha/help|malumato detayın]]):', 'captcha-createaccount' => 'Otomatik spam ra pawıtışi, ma rica keno cewabê problemî qutiyê ke cor de zerre ey ra binuse ([[Special:Captcha/help|malumato detayın]]):', - 'captcha-createaccount-fail' => 'Kodê testiqî vin biyo ya zi raşt niyo.', + 'captcha-createaccount-fail' => 'CAPTCHA ğeleto ya ki kemio', 'captcha-create' => 'Qe pel viraştîşî, ma rica keno cewabê problemî qutiyê ke cor de zerre ey ra binuse ([[Special:Captcha/help|enformasyonê bînî]]):', 'captcha-sendemail' => 'Otomatik spam ra pawıtışi, ma rica keno cewabê problemî qutiyê ke cor de zerre ey ra binuse ([[Special:Captcha/help|malumato detayın]]):', - 'captcha-sendemail-fail' => 'Kodê testiqî vin biyo ya zi raşt niyo.', + 'captcha-sendemail-fail' => 'CAPTCHA ğeleto ya ki kemio', 'captcha-disabledinapi' => 'Ena hereket de captcha lazim o, aye ra ser API ra ena hereket nibena.', 'captchahelp-title' => 'Yardimê captchayî', 'captchahelp-cookies-needed' => 'Eka şıma wazeno bıkewê pela Wikipedia, programê internetê şıma de cookiesi gani aktiv bê.', @@ -977,10 +983,10 @@ $messages['dsb'] = array( Za šćit pśeśiwo zawtomatizěrowanemu spamoju, pšosymy śi slědujucy jadnory liceński nadawk rozwězaś a zapódaj wuslědk do kašćika, aby swóju změnu składował ([[Special:Captcha/help|dalšne info]]):', 'captcha-badlogin' => 'Aby wiki pśeśiwo zawtomatizěrowanemu wuzgónjowanjeju gronidła šćitał, pšosymy śi slědujucy jadnory liceński nadawk rozwězaś a zapódaj wuslědk do kašćika ([[Special:Captcha/help|dalšne info]]):', 'captcha-createaccount' => 'Aby wiki pśeśiwo zawtomatizěrowanemu załoženjeju kontow šćitał, pšosymy śi slědujucy jadnory liceński nadawk rozwězaś a zapódaj wuslědk do kašćika ([[Special:Captcha/help|dalšne info]]):', - 'captcha-createaccount-fail' => 'Wopacny abo felujucy wobkšuśeński kod.', + 'captcha-createaccount-fail' => 'Wopacny abo felujucy wobkšuśeński kod CAPTCHA.', 'captcha-create' => 'Aby napórał bok, rozwěž pšosym slědujucy jadnory liceński nadawk a zapódaj wuslědk do kašćika ([[Special:Captcha/help|dalšne info]]):', 'captcha-sendemail' => 'Aby wiki pśeśiwo awtomatiskemu spamowanjeju šćitał, pšosymy śi jadnory liceński nadawk rozwězaś a zapódaj wótegrono do kašćika ([[Special:Captcha/help|dalšne informacije]]):', - 'captcha-sendemail-fail' => 'Wopacny abo felujucy wobkšuśeński kod.', + 'captcha-sendemail-fail' => 'Wopacny abo felujucy wobkšuśeński kod CAPTCHA.', 'captcha-disabledinapi' => 'Toś ta akcija pomina se captcha, togodla njedajo se pśez API wuwjasć.', 'captchahelp-title' => 'Pomoc wó captcha', 'captchahelp-cookies-needed' => 'Aby to funkcioněrowało, muse cookieje dowólone byś.', @@ -1127,6 +1133,7 @@ Klaku la 'reiru' butonon en via retumilo por reiri al la paĝo-redaktilo.", /** Spanish (español) * @author Armando-Martin + * @author Ciencia Al Poder * @author Crazymadlover * @author Drini * @author Icvav @@ -1145,10 +1152,10 @@ $messages['es'] = array( Para proteger el wiki contra el spam automatizado, por favor resuelve la sencilla suma de abajo e introduce la respuesta en la caja para guardar tu edición ([[Special:Captcha/help|más información]]):', 'captcha-badlogin' => 'Para proteger el wiki del descifrado de contraseñas automatizado, por favor resuelve la simple suma de abajo e introduce la respuesta en la caja ([[Special:Captcha/help|más información]]):', 'captcha-createaccount' => 'Para proteger el wiki de la creación automática de cuentas, resuelve por favor la simple suma de abajo e introduce la respuesta en la caja ([[Special:Captcha/help|más información]]):', - 'captcha-createaccount-fail' => 'Falta el código de confirmación, o éste es incorrecto.', + 'captcha-createaccount-fail' => 'Falta el código CAPTCHA, o éste es incorrecto.', 'captcha-create' => 'Para crear la página, por favor resuelve la simple suma de abajo e introduce la respuesta en la caja ([[Special:Captcha/help|más información]]):', 'captcha-sendemail' => 'Para proteger el wiki contra el spam automatizado, por favor resuelve la simple suma que se presenta a continuación e introduce la respuesta en el cuadro de texto ([[Special:Captcha/help|más información]]):', - 'captcha-sendemail-fail' => 'El código de confirmación falta o es incorrecto.', + 'captcha-sendemail-fail' => 'Falta el código CAPTCHA, o éste es incorrecto.', 'captcha-disabledinapi' => 'Esta acción requiere un captcha, así que no puede ser ejecutada a través de un API.', 'captchahelp-title' => 'Ayuda sobre el captcha', 'captchahelp-cookies-needed' => 'Debe tener las cookies activadas en el navegador para que el sistema funcione.', @@ -1182,11 +1189,11 @@ $messages['et'] = array( Palun lahenda allpool lihtne tehe ja sisesta vastus kasti, et saaksid muudatuse salvestada. Abinõu on viki kaitseks automaadistatud rämpsmuudatuste eest ([[Special:Captcha/help|lisateave]]):', 'captcha-badlogin' => 'Palun lahenda allpool lihtne tehe ja sisesta vastus kasti. Abinõu on viki kaitseks automaatsete parooliäraarvajate eest ([[Special:Captcha/help|lisateave]]):', 'captcha-createaccount' => 'Palun lahenda lihtne tehe ja sisesta vastus kasti. Abinõu on viki kaitseks kontode automaatse loomise eest ([[Special:Captcha/help|lisateave]]):', - 'captcha-createaccount-fail' => 'Puuduv või valesti sisestatud kinnituskood.', + 'captcha-createaccount-fail' => 'Puuduv või valesti sisestatud robotilõksu tekst.', 'captcha-create' => 'Lehekülje loomiseks lahenda palun lihtne tehe ja sisesta vastus kasti ([[Special:Captcha/help|lisateave]]):', 'captcha-sendemail' => 'Palun lahenda allpool lihtne tehe ja sisesta vastus kasti. Abinõu on viki kaitseks automaadistatud rämpsmuudatuste eest ([[Special:Captcha/help|lisateave]]):', - 'captcha-sendemail-fail' => 'Vigane või puuduv kinnituskood.', + 'captcha-sendemail-fail' => 'Vigane või puuduv robotilõksu tekst.', 'captcha-disabledinapi' => 'Ühes selle toiminguga tuleb läbida robotilõks ja seetõttu ei saa seda API kaudu sooritada.', 'captchahelp-title' => 'Mis on robotilõks?', 'captchahelp-cookies-needed' => 'Selle toimimiseks peab veebilehitseja lubama küpsiseid.', @@ -1246,10 +1253,10 @@ $messages['fa'] = array( برای کمک به جلوگیری از ارسال خودکار هرزنامه‌ها، لطفاً حاصل جمع زیر را حساب کنید و نتیجه را در جعبه وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', 'captcha-badlogin' => 'برای کمک به جلوگیری از شکستن خودکار گذرواژه، لطفاً حاصل جمع زیر را حساب کنید و نتیجه را وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', 'captcha-createaccount' => 'برای جلوگیری از ایجاد خودکار حساب کاربری، لطفاً حاصل جمع زیر را حساب کنید و نتیجه را در جعبه وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', - 'captcha-createaccount-fail' => 'کد تأییدی وجود ندارد یا نادرست است.', + 'captcha-createaccount-fail' => 'کد تأییدی وجود ندارد یا نادرست است.', 'captcha-create' => 'برای ایجاد صفحه لطفاً حاصل جمع زیر را حساب کنید و نتیجه را در جعبه وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', 'captcha-sendemail' => 'برای کمک به حفاظت ویکی در برابر هرزنامه‌های خودکار، لطفاً جمع سادهٔ زیر را حل کنید و جواب را در جعبه وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', - 'captcha-sendemail-fail' => 'کد تأییدی وجود ندارد یا نادرست است.', + 'captcha-sendemail-fail' => 'کد تأییدی وجود ندارد یا نادرست است.', 'captcha-disabledinapi' => 'این اقدام به کپچا نیاز دارد، بنابراین نمی‌تواند از طریق API انجام شود.', 'captchahelp-title' => 'راهنمای Captcha', 'captchahelp-cookies-needed' => 'برای کار کردن آن، شما باید کوکی‌های مرورگرتان را فعال کنید.', @@ -1334,6 +1341,7 @@ $messages['fo'] = array( /** French (français) * @author Crochet.david + * @author Gomoko * @author Grondin * @author IAlex * @author Meithal @@ -1355,10 +1363,10 @@ $messages['fr'] = array( Pour nous aider dans la protection contre le pourriel automatisé, veuillez calculer l’opération simple ci-dessous et en inscrire le résultat dans le champ ([[Special:Captcha/help|plus d’informations]]) :', 'captcha-badlogin' => 'Afin de nous aider à prévenir le cassage automatisé des mots de passe, veuillez calculer l’opération simple ci-dessous et en inscrire le résultat dans le champ ([[Special:Captcha/help|plus d’informations]]) :', 'captcha-createaccount' => 'Afin de nous aider à lutter contre les créations automatiques de comptes, veuillez calculer l’opération simple ci-dessous et en inscrire le résultat dans le champ ([[Special:Captcha/help|plus d’informations]]) :', - 'captcha-createaccount-fail' => 'Code de confirmation erroné ou manquant.', + 'captcha-createaccount-fail' => 'CAPTCHA erroné ou manquant.', 'captcha-create' => 'Pour créer la page, veuillez calculer l’opération simple ci-dessous et en inscrire le résultat dans le champ ([[Special:Captcha/help|plus d’informations]]) :', 'captcha-sendemail' => 'Afin de nous aider à prévenir le pollupostage automatisé, veuillez calculer l’opération simple ci-dessous et en inscrire le résultat dans le champ ([[Special:Captcha/help|plus d’informations]]) :', - 'captcha-sendemail-fail' => 'Code de confirmation incorrect ou manquant.', + 'captcha-sendemail-fail' => 'CAPTCHA incorrect ou absent.', 'captcha-disabledinapi' => 'Cette action requiert un captcha, donc elle ne peut pas être effectuée via l’IPA.', 'captchahelp-title' => 'Aide sur le captcha', 'captchahelp-cookies-needed' => "Il vous faudra autoriser les témoins (''cookies'') de votre navigateur pour que cela fonctionne.", @@ -1461,6 +1469,7 @@ $messages['ga'] = array( /** Galician (galego) * @author Alma + * @author Elisardojm * @author Toliño * @author Xosé */ @@ -1472,10 +1481,10 @@ $messages['gl'] = array( Para protexer o wiki contra o spam automático, resolva a suma que aparece a continuación e introduza a resposta na caixa ([[Special:Captcha/help|máis información]]):', 'captcha-badlogin' => 'Para protexer o wiki contra o roubo de contrasinais, resolva a suma que aparece a continuación e introduza a resposta na caixa ([[Special:Captcha/help|máis información]]):', 'captcha-createaccount' => 'Para protexer o wiki contra a creación automática de contas, resolva a suma que aparece a continuación e introduza a resposta na caixa ([[Special:Captcha/help|máis información]]):', - 'captcha-createaccount-fail' => 'Falta o código de confirmación ou é incorrecto.', + 'captcha-createaccount-fail' => 'Falta o código de confirmación (CAPTCHA) ou é incorrecto.', 'captcha-create' => 'Para crear a páxina, resolva a suma que aparece a continuación e introduza a resposta na caixa ([[Special:Captcha/help|máis información]]):', 'captcha-sendemail' => 'Para protexer o wiki contra o spam automático, resolva a suma que aparece a continuación e introduza a resposta na caixa ([[Special:Captcha/help|máis información]]):', - 'captcha-sendemail-fail' => 'Falta o código de confirmación ou é incorrecto.', + 'captcha-sendemail-fail' => 'Falta o código de confirmación (CAPTCHA) ou é incorrecto.', 'captcha-disabledinapi' => 'Esta acción necesita o captcha, polo que non se pode realizar a través da API.', 'captchahelp-title' => 'Axuda acerca do CAPTCHA', 'captchahelp-cookies-needed' => 'Necesita ter as cookies habilitadas no seu navegador para que funcione.', @@ -1579,19 +1588,20 @@ $messages['gu'] = array( /** Hebrew (עברית) * @author Amire80 + * @author Guycn2 * @author Rotem Liss * @author Rotemliss * @author YaronSh */ $messages['he'] = array( 'captcha-edit' => 'כדי לערוך את הדף, אנא פתרו את תרגיל החיבור הפשוט שלהלן והקלידו את התשובה בתיבה ([[Special:Captcha/help|מידע נוסף]]):', - 'captcha-desc' => 'מתן טכניקות CAPTCHA להגנה נגד זיבול וניחוש ססמאות', + 'captcha-desc' => 'מתן טכניקות CAPTCHA להגנה נגד ספאם וניחוש סיסמאות', 'captcha-label' => 'CAPTCHA', 'captcha-addurl' => 'עריכתכם כוללת קישורים חיצוניים חדשים. לשם הגנה מפני ספאם אוטומטי, אנא פתרו את תרגיל החיבור הפשוט שלהלן והקלידו את התשובה בתיבה כדי לשמור את עריכתכם ([[Special:Captcha/help|מידע נוסף]]):', 'captcha-badlogin' => 'לשם הגנה מפני פריצת סיסמאות אוטומטית, אנא פתרו את תרגיל החיבור הפשוט שלהלן והקלידו את התשובה בתיבה ([[Special:Captcha/help|מידע נוסף]]):', 'captcha-createaccount' => 'לשם הגנה מפני יצירת חשבונות אוטומטית, אנא פתרו את תרגיל החיבור הפשוט שלהלן והקלידו את התשובה בתיבה ([[Special:Captcha/help|מידע נוסף]]):', - 'captcha-createaccount-fail' => 'לא הקלדתם קוד אישור, או שהוא שגוי.', + 'captcha-createaccount-fail' => 'קוד אישור שגוי או חסר.', 'captcha-create' => 'כדי ליצור את הדף, אנא פתרו את תרגיל החיבור הפשוט שלהלן והקלידו את התשובה בתיבה ([[Special:Captcha/help|מידע נוסף]]):', 'captcha-sendemail' => 'כדי לעזור להילחם במציפי זבל אוטומטיים, עליך לחשב את הסכום הפשוט שלהלן ולהזין את התוצאה בתיבה ([[Special:Captcha/help|מידע נוסף]]):', 'captcha-sendemail-fail' => 'קוד האישור שגוי או חסר.', @@ -1707,10 +1717,10 @@ $messages['hsb'] = array( 'captcha-addurl' => 'W twojej změnje su nowe eksterne wotkazy. Zo by wiki přećiwo awtomatizowanemu spamej škitał, prosymy će slědowacy nadawk wuličić a wuslědk do kašćika zapisować, zo by so twoja změna składowała ([[Special:Captcha/help|dalše informacije]]).', 'captcha-badlogin' => 'Zo by wiki přećiwo awtomatiskemu zadobywanju do hesłow škitał, prosymy će slědowacy nadawk wuličeć a wuslědk do kašćika zapisować ([[Special:Captcha/help|dalše informacije]]):', 'captcha-createaccount' => 'Zo by wiki přećiwo awtomatiskemu wutworjenju wužiwarskich kontow škitał, prosymy će slědowacy nadawk nadawk rozrisać a wuslědk do kašćika zapisować ([[Special:Captcha/help|dalše informacije]]):', - 'captcha-createaccount-fail' => 'Wopačny abo pobrachowacy wobkrućenski kod.', + 'captcha-createaccount-fail' => 'Wopačny abo falowacy wobkrućenski kod CAPTCHA.', 'captcha-create' => 'Zo by stronu wutworił, rozrisaj prošu slědowacy ličenski nadawk a zapodaj wuslědk do kašćika ([[Special:Captcha/help|Dalše informacije]]):', 'captcha-sendemail' => 'Za škit přećiwo awtomatiskemu spamowanju, rozrisaj prošu slědowacy jednory ličenski nadawk a zapodaj wotmołwu do kašćika ([[Special:Captcha/help|dalše informacije]]):', - 'captcha-sendemail-fail' => 'Wopačny abo falowacy wobkrućenski kod.', + 'captcha-sendemail-fail' => 'Wopačny abo falowacy wobkrućenski kod CAPTCHA.', 'captcha-disabledinapi' => 'Tuta akcija wužaduje sej captcha, tohodla njeda so přez API wuwjesć.', 'captchahelp-title' => 'Pomoc za CAPTCHA', 'captchahelp-cookies-needed' => 'Dyrbiš placki (cookies) w swojim wobhladowaku zmóžnić.', @@ -1798,10 +1808,10 @@ $messages['ia'] = array( Pro proteger le wiki contra le spam automatisate, per favor resolve le simple summa hic infra e entra le resultato in le quadro a fin de salveguardar tu modification ([[Special:Captcha/help|plus info]]):', 'captcha-badlogin' => 'Pro proteger le wiki contra le furto automatisate de contrasignos, per favor resolve le simple summa hic infra e entra le resultato in le quadro ([[Special:Captcha/help|plus info]]):', 'captcha-createaccount' => 'Pro proteger le wiki contra le creation automatisate de contos, per favor resolve le simple summa hic infra e entra le resultato in le quadro ([[Special:Captcha/help|plus info]]):', - 'captcha-createaccount-fail' => 'Codice de confirmation incorrecte o mancante.', + 'captcha-createaccount-fail' => 'Codice de confirmation (CAPTCHA) incorrecte o mancante.', 'captcha-create' => 'Pro crear le pagina, per favor resolve le simple summa hic infra e entra le resultato in le quadro ([[Special:Captcha/help|plus info]]):', 'captcha-sendemail' => 'Pro proteger le wiki contra le spam automatisate, per favor resolve le simple summa hic infra e entra le resultato in le quadro ([[Special:Captcha/help|plus info]]):', - 'captcha-sendemail-fail' => 'Codice de confirmation incorrecte o mancante.', + 'captcha-sendemail-fail' => 'Codice de confirmation (CAPTCHA) incorrecte o mancante.', 'captcha-disabledinapi' => 'Iste action require un captcha, dunque illo non pote esser exequite per medio del API.', 'captchahelp-title' => 'Adjuta super le captcha', 'captchahelp-cookies-needed' => 'Tu debe haber le cookies activate in tu navigator a fin que isto pote functionar.', @@ -1830,20 +1840,22 @@ Clicca le button 'retro' in tu navigator pro retornar al pagina de modification. * @author Ilham151096 * @author IvanLanin * @author Iwan Novirion + * @author Kenrick95 * @author Rex */ $messages['id'] = array( 'captcha-edit' => 'Untuk menyunting halaman ini, harap pecahkan penjumlahan sederhana di bawah ini dan masukkan jawaban di kotak yang tersedia ([[Special:Captcha/help|info lengkap]]):', 'captcha-desc' => 'Menyediakan teknik captcha untuk melindungi terhadap spam dan penebakan sandi', 'captcha-label' => 'CAPTCHA', - 'captcha-addurl' => "Suntingan Anda menyertakan pranala luar baru. Sebagai pelindungan terhadap ''spam'' otomatis, Anda harus mengetikkan kata atau hasil perhitungan yang tertera berikut ini:
      -([[Special:Captcha/help|info lengkap]])", # Fuzzy - 'captcha-badlogin' => 'Untuk membantu pelindungan terhadap perengkahan kunci sandi otomatis, tolong masukkan kata atau hasil perhitungan sederhana berikut dalam kotak yang tersedia ([[Special:Captcha/help|info lengkap]]):', # Fuzzy - 'captcha-createaccount' => 'Sebagai pelindungan terhadap spam, Anda diharuskan untuk mengetikkan kata atau hasil perhitungan di bawah ini di kotak yang tersedia untuk dapat mendaftarkan pengguna baru:
      -([[Special:Captcha/help|info lengkap]])', # Fuzzy + 'captcha-addurl' => "Suntingan Anda menyertakan pranala luar baru. +Sebagai pelindungan terhadap ''spam'' otomatis, Anda harus mengetikkan hasil perhitungan sederhana berikut ini +([[Special:Captcha/help|info lengkap]]):", + 'captcha-badlogin' => 'Untuk melindungi wiki ini dari perengkahan kunci sandi otomatis, harap masukkan hasil perhitungan sederhana berikut dalam kotak yang tersedia ([[Special:Captcha/help|info lengkap]]):', + 'captcha-createaccount' => 'Untuk melindungi wiki ini dari pembuatan akun otomatis, kami meminta Anda untuk mengetikkan hasil perhitungan sederhana di bawah ini dalam kotak yang tersedia +([[Special:Captcha/help|info lengkap]]):', 'captcha-createaccount-fail' => 'Kode konfirmasi salah atau belum diisi.', 'captcha-create' => 'Untuk menyunting halaman ini, silakan pecahkan penjumlahan sederhana di bawah ini dan masukkan jawaban di kotak yang tersedia ([[Special:Captcha/help|info lengkap]]):', - 'captcha-sendemail' => 'Sebagai pelindungan terhadap spam, silakan pecahkan penjumlahan sederhana di bawah ini dan masukkan jawaban di kotak yang tersedia ([[Special:Captcha/help|more info]]):', # Fuzzy + 'captcha-sendemail' => 'Untuk melindungi wiki ini dari spam otomatis, kami meminta Anda untuk memecahkan penjumlahan sederhana di bawah ini dan masukkan jawaban di kotak yang tersedia ([[Special:Captcha/help|more info]]):', 'captcha-sendemail-fail' => 'Kode konfirmasi salah atau belum diisi.', 'captcha-disabledinapi' => 'Tindakan ini membutuhkan captcha, sehingga tidak dapat dilakukan melalui API.', 'captchahelp-title' => 'Mengenai Captcha', @@ -1986,10 +1998,10 @@ $messages['ja'] = array( 自動でのスパム攻撃を防ぐため、お手数ですが下記の簡単な数式を計算してその答えを欄に入力してください ([[Special:Captcha/help|ヘルプ]]):', 'captcha-badlogin' => '自動でのパスワードクラック攻撃からウィキを保護するため、お手数ですが下記の簡単な数式を計算してその答えを欄に入力してください ([[Special:Captcha/help|詳細]]):', 'captcha-createaccount' => 'アカウントの自動登録からウィキを保護するため、お手数ですが下記の簡単な数式を計算してその答えを欄に入力してください ([[Special:Captcha/help|ヘルプ]]):', - 'captcha-createaccount-fail' => '確認コードが正しくない、または入力されていません。', + 'captcha-createaccount-fail' => 'CAPTCHA が正しくない、または入力されていません。', 'captcha-create' => 'ページを新規作成するには、下記の簡単な数式を計算してその答えを欄に入力してください ([[Special:Captcha/help|ヘルプ]]):', 'captcha-sendemail' => '自動でのスパム攻撃からウィキを保護するため、お手数ですが下記の簡単な数式を計算してその答えを欄に入力してください ([[Special:Captcha/help|詳細]]):', - 'captcha-sendemail-fail' => '確認コードが正しくない、または入力されていません。', + 'captcha-sendemail-fail' => 'CAPTCHA が正しくない、または入力されていません。', 'captcha-disabledinapi' => 'この操作には CAPTCHA 認証が必要なため、API では実行できません。', 'captchahelp-title' => 'CAPTCHA (画像認証) ヘルプ', 'captchahelp-cookies-needed' => 'ブラウザーの Cookie を有効にする必要があります。', @@ -2013,6 +2025,7 @@ $messages['ja'] = array( ); /** Jutish (jysk) + * @author Christian List * @author Huslåke * @author Ælsån */ @@ -2020,9 +2033,9 @@ $messages['jut'] = array( 'captcha-edit' => 'For at redigere denne side, skal du give svaret på regnestyket nedenfor, og angive resultatet i feltet under det. ([[Special:Captcha/help|mere information]]):', 'captcha-desc' => 'Semple captcha implementåsje', # Fuzzy 'captcha-addurl' => 'Din redigering tilføjer nye eksterne henvisninger til artiklen. Som beskyttelse mod automatiseret spam, skal du give svaret på regnestyket nedenfor, og angive resultatet i feltet under det. ([[Special:Captcha/help|mere information]]):', # Fuzzy - 'captcha-badlogin' => 'For at beskytte mod automatiserede gæt på kodeord, skal du give svaret på regnestyket nedenfor, og angive resultatet i feltet under det. ([[Special:Captcha/help|mere information]]):', # Fuzzy + 'captcha-badlogin' => 'For at beskytte mod automatiske forsøg på at gætte adgangskoden, skal du give svaret på regnestykket nedenfor, og angive resultatet i feltet under det. ([[Special:Captcha/help|mere information]]):', 'captcha-createaccount' => 'For at beskytte mod automatisk oprettelse af brugernavne, skal du give svaret på regnestyket nedenfor, og angive resultatet i feltet under det. ([[Special:Captcha/help|mere information]]):', # Fuzzy - 'captcha-createaccount-fail' => 'Forkert eller manglende kodeord.', + 'captcha-createaccount-fail' => 'Forkert eller manglende bekræftelseskode.', 'captcha-create' => 'For at oprette en ny side, skal du give svaret på regnestyket nedenfor, og angive resultatet i feltet under det. ([[Special:Captcha/help|mere information]]):', 'captchahelp-title' => 'Captcha-hjælp', 'captchahelp-cookies-needed' => 'Din browser skal understøtte cookies, før dette kan gennemføres.', @@ -2041,6 +2054,7 @@ Tryk på 'tilbage'-knappen i din browser for at returnere til redigeringssiden." ); /** Javanese (Basa Jawa) + * @author Bennylin * @author Meursault2004 * @author NoiX180 * @author Pras @@ -2050,12 +2064,14 @@ $messages['jv'] = array( 'captcha-desc' => 'Nyadhiyakaké tèhnik CAPTCHA kanggo njaga saka spam lan pambedhèk sandhi', 'captcha-label' => 'CAPTCHA', 'captcha-addurl' => "Suntingan panjenengan iku nyertakaké pranala jaba anyar. -Kanggo ngéwangi ngreksa lawan ''spam'' otomatis, tulung pecahna itung-itungan ing ngisor iki lan lebokna kasilna sajroning kothak ([[Special:Captcha/help|info sabanjuré]]):", # Fuzzy - 'captcha-badlogin' => 'Kanggo ngreksa lawan parengkahan kunci sandhi otomatis, tulung lebokna tembung utawa kasil itung-itungan gampang ing ngisor sajroning kothak sing wis sumedya ([[Special:Captcha/help|info sabanjuré]]):', # Fuzzy - 'captcha-createaccount' => 'Kanggo ngreksa lawan panggawéyan rékening (akun) otomatis, tulung pecahna itung-itungan ing ngisor iki lan lebokna kasilna sajroning kothak ([[Special:Captcha/help|info sabanjuré]]):', # Fuzzy - 'captcha-createaccount-fail' => 'Kode pandhedhesan (konfirmasi) salah utawa durung diisi.', +Kanggo ngéwangi ngreksa lawan ''spam'' otomatis, tulung pecahna itung-itungan ing ngisor iki lan lebokna kasilna sajroning kothak ([[Special:Captcha/help|info sabanjuré]]):", + 'captcha-badlogin' => 'Kanggo ngreksa lawan parengkahan tembung sandhi otomatis, tulung lebokna tembung utawa kasil itung-itungan gampang ing ngisor sajroning kothak sing wis sumedya ([[Special:Captcha/help|info sabanjuré]]):', + 'captcha-createaccount' => 'Kanggo ngreksa lawan panggawéyan rékening (akun) otomatis, tulung pecahna itung-itungan ing ngisor iki lan lebokna kasilna sajroning kothak ([[Special:Captcha/help|info sabanjuré]]):', + 'captcha-createaccount-fail' => 'Kode CAPTCHA salah utawa durung diisi.', 'captcha-create' => 'Kanggo nggawé kaca iki, mangga itung-itungan ing ngisor iki diwangsuli sajroning kothak ([[Special:Captcha/help|info sabanjuré]]):', - 'captcha-sendemail-fail' => 'Kodhe pepesthèn salah utawa durung diisi.', + 'captcha-sendemail' => 'Kanggo ngreksa lawan spam otomatis, tulung lebokna tembung utawa kasil itung-itungan gampang ing ngisor sajroning kothak sing wis sumedya ([[Special:Captcha/help|info sabanjuré]]):', + 'captcha-sendemail-fail' => 'Kode CAPTCHA salah utawa durung diisi.', + 'captcha-disabledinapi' => 'Tindakan ini membutuhkan CAPTCHA, sehingga tidak dapat dilakukan melalui API.', 'captchahelp-title' => 'Pitulung Captcha', 'captchahelp-cookies-needed' => 'Panjenengan perlu ngaktifaké cookie ing panjlajah wèb panjenengan kanggo nganggo fitur iki.', 'captchahelp-text' => "Situs-situs wèb sing nampa data saka umum, kaya ta wiki iki, kerep disalahgunakaké déning panganggo-panganggo sing ora bertanggungjawab kanggo ngirimaké ''spam'' mawa program-program otomatis. Senadyan spam-spam iku bisa dibuang kabèh, nanging waé tetep ngrusuhi lan dianggep gawé masalah. @@ -2208,9 +2224,9 @@ Bet öñdewine qaýtw barw üşin «Artqa» degen tüýmesin basıñız.', # Fuz $messages['km'] = array( 'captcha-edit' => 'ដើម្បីកែប្រែ​ទំព័រនេះ សូមដោះស្រាយ​ប្រមាណវិធីបូក​ខាងក្រោម​នេះរួច​បញ្ជូលចម្លើយ​ទៅក្នុង​ប្រអប់សិន([[Special:Captcha/help|ព័ត៌មាន​បន្ថែម]])៖', 'captcha-desc' => 'ផ្ដល់បច្ចេកទេស CAPTCHA ដើម្បីការពារពីស្ប៉ាមនិងការការទាយពាក្យសំងាត់', - 'captcha-addurl' => 'កំណែ​របស់អ្នក​មាន​តំណភ្ជាប់ក្រៅ​ថ្មី។ ដើម្បី​ជួយបង្ការ​ស្ប៉ាម​ស្វ័យប្រវត្តិ សូមដោះស្រាយ​ប្រមាណវិធីបូក​ខាងក្រោម​នេះរួច​បញ្ជូលចម្លើយ​ទៅក្នុង​ប្រអប់សិន([[Special:Captcha/help|ព័ត៌មាន​បន្ថែម]])៖', # Fuzzy - 'captcha-badlogin' => 'ដើម្បីការពារការបំបែកពាក្យសំងាត់ដោយស្វ័យប្រវត្តិ សូមដោះស្រាយផលបូកខាងក្រោមរួចបញ្ជូលចម្លើយទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', # Fuzzy - 'captcha-createaccount' => 'ដើម្បី​បង្ការការបង្កើត​គណនី​ស្វ័យប្រវត្តិ សូមដោះស្រាយ​ប្រមាណវិធីបូក​ខាងក្រោម​នេះរួច​បញ្ជូលចម្លើយ​ទៅក្នុង​ប្រអប់សិន([[Special:Captcha/help|ព័ត៌មាន​បន្ថែម]])៖', # Fuzzy + 'captcha-addurl' => 'កំណែ​របស់អ្នក​មាន​តំណភ្ជាប់ក្រៅ​ថ្មី។ ដើម្បី​ជួយបង្ការ​ស្ប៉ាម​ស្វ័យប្រវត្តិ សូមដោះស្រាយ​ប្រមាណវិធីបូក​ខាងក្រោម​នេះរួច​បញ្ជូលចម្លើយ​ទៅក្នុង​ប្រអប់សិនមុនពេលរក្សាទុកកំណែរបស់អ្នក([[Special:Captcha/help|ព័ត៌មាន​បន្ថែម]])៖', + 'captcha-badlogin' => 'ដើម្បីការពារការបំបែកពាក្យសម្ងាត់ដោយស្វ័យប្រវត្តិ សូមដោះស្រាយផលបូកខាងក្រោមរួចបញ្ជូលចម្លើយទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', + 'captcha-createaccount' => 'ដើម្បី​បង្ការការបង្កើត​គណនី​ស្វ័យប្រវត្តិ សូមដោះស្រាយ​ប្រមាណវិធីបូក​ខាងក្រោម​នេះរួច​បញ្ជូលចម្លើយ​ទៅក្នុង​ប្រអប់សិន([[Special:Captcha/help|ព័ត៌មាន​បន្ថែម]])៖', 'captcha-createaccount-fail' => 'កូដផ្ទៀងផ្ទាត់បាត់បង់ឬមិនត្រឹមត្រូវ។', 'captcha-create' => 'ដើម្បី​បង្កើត​ទំព័រ សូមដោះស្រាយ​ប្រមាណវិធីបូក​ខាងក្រោម​នេះរួច​បញ្ជូលចម្លើយ​ទៅក្នុង​ប្រអប់សិន([[Special:Captcha/help|ព័ត៌មាន​បន្ថែម]])៖', 'captchahelp-title' => 'ជំនួយអំពី Captcha', @@ -2220,6 +2236,7 @@ $messages['km'] = array( * @author IRTC1015 * @author Klutzy * @author Kwj2772 + * @author Priviet * @author ToePeu * @author 아라 */ @@ -2231,10 +2248,10 @@ $messages['ko'] = array( 자동화된 스팸으로부터 위키를 보호하기 위해, 편집을 저장하려면 아래의 간단한 계산 값을 입력 상자에 적어 주세요 ([[Special:Captcha/help|자세한 정보]]):', 'captcha-badlogin' => '자동화된 비밀번호 깨기로부터 위키를 보호하기 위해, 아래의 간단한 계산 값을 입력 상자에 입력해주세요 ([[Special:Captcha/help|자세한 정보]]):', 'captcha-createaccount' => '자동화된 계정 만들기로부터 위키를 보호하기 위해, 아래의 간단한 계산 값을 입력 상자에 적어 주세요 ([[Special:Captcha/help|자세한 정보]]):', - 'captcha-createaccount-fail' => '입력값이 잘못되었거나 없습니다.', + 'captcha-createaccount-fail' => '캡챠가 올바르지 않거나 입력되지 않았습니다.', 'captcha-create' => '문서를 만드려면 아래의 간단한 계산 값을 입력 상자에 적어 주세요 ([[Special:Captcha/help|자세한 정보]]):', 'captcha-sendemail' => '자동화된 스팸으로부터 위키를 보호하기 위해, 아래의 간단한 계산 값을 입력 상자에 적어 주세요 ([[Special:Captcha/help|자세한 정보]]):', - 'captcha-sendemail-fail' => '입력값이 잘못되었거나 없습니다.', + 'captcha-sendemail-fail' => '캡챠가 올바르지 않거나 입력되지 않았습니다.', 'captcha-disabledinapi' => '이 동작은 캡차를 거쳐야 하기 때문에 API로 이 작업을 수행할 수 없습니다.', 'captchahelp-title' => 'CAPTCHA(캡차) 도움말', 'captchahelp-cookies-needed' => '정상적으로 작동하려면 웹 브라우저의 쿠키 사용이 활성화되어 있어야 합니다.', @@ -2338,6 +2355,14 @@ $messages['la'] = array( 'captchahelp-title' => 'Captcha auxilium', ); +/** Ladino (Ladino) + * @author Menachem.Moreira + */ +$messages['lad'] = array( + 'captcha-label' => 'CAPTCHA', + 'captchahelp-title' => 'Ayudo de CAPTCHA', +); + /** Luxembourgish (Lëtzebuergesch) * @author Les Meloures * @author Robby @@ -2351,18 +2376,18 @@ $messages['lb'] = array( Fir dës Wiki virun automatiséiertem Spam ze schütze froe mir Iech fir déi folgend einfach Additioun ze léisen an d'Resultat an d'Feld ënnen anzedroen fir Är Ännerung ze späicheren ([[Special:Captcha/help|méi Informatiounen]]):", 'captcha-badlogin' => "Fir dës Wiki géint automatescht Hacke vu Passwierder ze schützen, léist w.e.g. déi einfach Additioun hei ënnendrënner an tippt d'Äntwert an d'Këscht ([[Special:Captcha/help|méi Informatiounen]]):", 'captcha-createaccount' => "Fir dës Wiki géint d'automatescht Uleeë vu Benotzerkonten ze schützen, léist w.e.g. déi einfach Additioun hei ënnendrënner, an tippt d'Äntwert an d'Këscht ([[Special:Captcha/help|méi Informatiounen]]):", - 'captcha-createaccount-fail' => 'Falschen oder kee Confirmatiouns-Code.', + 'captcha-createaccount-fail' => 'Falschen oder kee CAPTCHA.', 'captcha-create' => "Fir eng Nei Säit unzeleeën, léist w.e.g. déi einfach Additioun hei ënnendrënner an tippt d'Äntwert an d'Këscht ([[Special:Captcha/help|méi Informatiounen]]):", 'captcha-sendemail' => "Fir dës Wiki géint automatescht Spammen ze schützen, léist w.e.g. déi einfach Additioun hei ënnendrënner an tippt d'Äntwert an d'Këscht ([[Special:Captcha/help|méi Informatiounen]]):", - 'captcha-sendemail-fail' => 'Falschen oder kee Confirmatiouns-Code.', + 'captcha-sendemail-fail' => 'Falschen oder kee CAPTCHA.', 'captcha-disabledinapi' => 'Dës Aktioun brauch e Captcha, dofir ka se net mat enger API gemaach ginn.', 'captchahelp-title' => 'Captcha-Hëllef', 'captchahelp-cookies-needed' => 'Dir musst Cookien an Ärem Browser erlabe fir dat dëst funktionéiert.', - 'captchahelp-text' => "Websäiten, déi et jiddwerengem erlaben Ännerunge virzehuelen, sou wéi op dëser Wiki, ginn dacks vu sougenannte Spammer mëssbraucht, déi automatiséiert hir Linken op vill Internetsäite setzen. Esou Spam-Linke kënne wuel geläscht ginn, mä se sinn trotzdem eng grouss Plo. + 'captchahelp-text' => "Websäiten, déi et jiddwerengem erlaben Ännerunge virzehuelen, sou wéi op dëser Wiki, ginn dacks vu sougenannte Spammer mëssbraucht, déi automatiséiert hir Linken op vill Internetsäite setzen. Sou Spam-Linke kënne wuel geläscht ginn, mä se sinn trotzdem eng grouss Plo. Heiansdo, besonnesch wann nei Internet-Linken op eng Säit derbäigesat ginn, weist dës Wiki Iech e Bild mat faarwegem oder verzerrtem Text a freet Iech fir déi gewise Wierder anzetipppen. Well dëst eng Aufgab ass déi schwéier ze automatiséieren ass, erlaabt dëst, datt Mënschen hir Ännerunge kënnen agi während déi meescht Spammer an aner Roboter-Attacke kënnen ofgewiert ginn. -Leider kann dat zu Schwierigkeete féiere fir Persounen déi net esou gutt gesinn oder déi text-baséiert oder sprooch-baséiert Browser benotzen. +Leider kann dat zu Schwierigkeete féiere fir Persounen déi net sou gutt gesinn oder déi text-baséiert oder sprooch-baséiert Browser benotzen. Zu dësem Zäitpunkt hu mir leider keng audio-Alternativ zu eiser Verfügung. Kontaktéiert w.e.g. [[Special:ListAdmins|een Administrateur]] fir Hëllef wann dëst iech onerwaarter Weis vu legitimen Editen ofhält. @@ -2423,7 +2448,10 @@ $messages['lo'] = array( */ $messages['lrc'] = array( 'captcha-label' => 'كپچا', + 'captcha-createaccount-fail' => 'کد کپچا غلط یا گم بیه.', + 'captcha-sendemail-fail' => 'کد کپچا غلط یا گم بیه.', 'captchahelp-title' => 'هومياری كپچا', + 'captchahelp-cookies-needed' => 'شما با کوکیانه د جاگرد تو فعال بکید سی یه وه کار بکه.', ); /** Lithuanian (lietuvių) @@ -2442,15 +2470,17 @@ $messages['lt'] = array( /** Latvian (latviešu) * @author BrokenArrow + * @author Edgars2007 * @author Marozols * @author Yyy */ $messages['lv'] = array( 'captcha-edit' => 'Lai izmainītu šo lapu, atrisini šo vienādojumu un iegūto skaitli ieraksti šajā lodziņā:
      ([[Special:Captcha/help|Kāpēc tā?]])', - 'captcha-addurl' => 'Tavas izmaiņas ietver jaunu URL saiti. Lai pasargātos no automātiskas mēstuļošanas, Tev ir jāieraksta te redzamā vienādojuma rezultāts:
      ([[Special:Captcha/help|Kāpēc tā?]])', # Fuzzy + 'captcha-addurl' => 'Tavas izmaiņas ietver jaunu URL saiti. +Lai pasargātos no automātiskas mēstuļošanas, Tev ir jāieraksta te redzamā vienādojuma rezultāts:
      ([[Special:Captcha/help|vairāk informācijas]])', 'captcha-badlogin' => 'Lai pasargātos no automātiskiem paroļu lauzējiem, lūdzu aprēķini šīs izteiksmes vērtību un rezultātu ieraksti apakšā esošajā lodziņā ([[Special:Captcha/help|papildus informācija]]):', # Fuzzy 'captcha-createaccount' => 'Lai pasargātos no automātiskas mēstuļošanas, Tev reģistrējoties ir jāieraksta šī vienādojuma rezultāts:
      ([[Special:Captcha/help|Kāpēc tā?]])', # Fuzzy - 'captcha-createaccount-fail' => 'Nepareizs apstiprinājuma kods vai arī tas nav ievadīts.', + 'captcha-createaccount-fail' => 'Nepareizs apstiprinājuma kods vai arī tas nav ievadīts.', # Fuzzy 'captcha-create' => 'Lai izveidotu šo lapu, atrisini šo vienādojumu un rezulātu ieraksti šajā lodziņā:
      ([[Special:Captcha/help|Kāpēc tā?]])', 'captchahelp-cookies-needed' => "Lai šis darbotos, pārlūkprogrammā jābūt iespējotām (''enabled'') sīkdatnēm (''cookies'').", 'captchahelp-text' => "Interneta lapas, kurās iespējams pievienot tekstu, kā šajā wiki, bieži cieš no mēstuļotājiem, kuri izmanto automatizētus līdzekļus, lai pievienotu savus saites daudzās jo daudzās interneta lapās. @@ -2500,10 +2530,10 @@ $messages['mk'] = array( За да ни помогнете да се заштитиме од автоматизиран спам, би ве замолиле да ја решите простата задача подолу и да го внесете резултатот во полето за да можете да го зачувате уредувањето ([[Special:Captcha/help|повеќе инфо]]):', 'captcha-badlogin' => 'За да ни помогнете да се заштитиме од автоматизирано пробивање на лозинки, би ве замолиле да ја решите простата задача подолу и внесете резултатот во полето ([[Special:Captcha/help|повеќе информации]]):', 'captcha-createaccount' => 'За да ни помогнете да се заштитиме од автоматизирано создавање на сметки, би ве замолиле да ја решите простата задача подолу и да го внесете резултатот во полето ([[Special:Captcha/help|повеќе инфо]]):', - 'captcha-createaccount-fail' => 'Потврдниот код е неточен или недостасува.', + 'captcha-createaccount-fail' => 'CAPTCHA е неточен или недостасува.', 'captcha-create' => 'За да ја создадете страницата, прво решете ја простата задача подолу и впишете го решението во полето ([[Special:Captcha/help|повеќе инфо]]):', 'captcha-sendemail' => 'За да се заштитиме од автоматизирано спамирање, би сакале да ве замолиме да ја решите простата задача подолу и да го внесете резултатот во полето ([[Special:Captcha/help|повеќе информации]]):', - 'captcha-sendemail-fail' => 'Потврдниот код е неточен или недостасува.', + 'captcha-sendemail-fail' => 'CAPTCHA е неточен или недостасува.', 'captcha-disabledinapi' => 'Ова дејство бара captcha, така што не може да се изврши преку API.', 'captchahelp-title' => 'Помош со Captcha', 'captchahelp-cookies-needed' => 'Треба да имате овозможено колачиња за да може ова да работи.', @@ -2516,7 +2546,7 @@ $messages['mk'] = array( Во моментов немаме аудио-алтернатива за ова. Контактирајте ги [[Special:ListAdmins|администраторите на страната]] за помош доколку ова неочекувано ве спречува во правењето на искрени придонеси. -Кликнете на копчето „назад“ во вашиот прелисувач за да се вратите на уредувањето на страницата.', +Стиснете на копчето „назад“ во вашиот прелисувач за да се вратите на уредувањето на страницата.', 'captcha-addurl-whitelist' => ' #
       # Опис на синтаксата:
       #  * Сето она што стои по знакот „#“, па до крајот на редот е коментар
      @@ -2537,10 +2567,10 @@ $messages['ml'] = array(
       യാന്ത്രികമായി പാഴെഴുത്തുൾപ്പെടുത്തുന്നതിൽ നിന്നും വിക്കി സം‌രക്ഷിക്കുന്നതിന്റെ ഭാഗമായി, ദയവായി താഴെ കൊടുത്തിരിക്കുന്ന ലഘു ഗണിത ക്രിയ ചെയ്ത് അതിന്റെ ഉത്തരം താഴെയുള്ള പെട്ടിയിൽ ടൈപ്പു ചെയ്യുക ([[Special:Captcha/help|കൂടുതൽ വിവരങ്ങൾ]]):',
       	'captcha-badlogin' => 'യാന്ത്രികമായി രഹസ്യവാക്ക് പൊളിക്കുന്നതിൽ നിന്നും വിക്കി സംരക്ഷിക്കുന്നതിന്റെ ഭാഗമായി, ദയവായി താഴെ കൊടുത്തിരിക്കുന്ന ലഘു ഗണിത ക്രിയ ചെയ്ത്, ഉത്തരം താഴെയുള്ള പെട്ടിയിൽ ടൈപ്പു ചെയ്യുക ([[Special:Captcha/help|കൂടുതൽ വിവരങ്ങൾ]]):',
       	'captcha-createaccount' => 'യാന്ത്രികമായി അംഗത്വം സൃഷ്ടിക്കുന്നതിൽ നിന്നും വിക്കി സം‌രക്ഷിക്കുന്നതിന്റെ ഭാഗമായി, ദയവായി താഴെ കൊടുത്തിരിക്കുന്ന ലഘു ഗണിത ക്രിയ ചെയ്ത് അതിന്റെ ഉത്തരം താഴെയുള്ള പെട്ടിയിൽ ടൈപ്പു ചെയ്യുക ([[Special:Captcha/help|കൂടുതൽ വിവരങ്ങൾ]]):',
      -	'captcha-createaccount-fail' => 'തെറ്റായതോ ലഭ്യമല്ലാത്തതോ ആയ സ്ഥിരീകരണ കോഡ്.',
      +	'captcha-createaccount-fail' => 'തെറ്റായതോ ലഭ്യമല്ലാത്തതോ ആയ കാപ്ച്ച.',
       	'captcha-create' => 'ഈ താൾ സൃഷ്ടിക്കുവാൻ, ദയവായി താഴെ കൊടുത്തിരിക്കുന്ന കൂട്ടൽ ക്രിയയുടെ ഉത്തരം താഴെയുള്ള പെട്ടിയിൽ എഴുതുക  ([[Special:Captcha/help|കൂടുതൽ വിവരങ്ങൾ]]):',
       	'captcha-sendemail' => 'യാന്ത്രികമായ പാഴെഴുത്ത് ഉൾപ്പെടുത്തുന്നതിൽ നിന്നും വിക്കി സംരക്ഷിക്കുന്നതിന്റെ  ഭാഗമായി, ദയവായി താഴെ കൊടുത്തിരിക്കുന്ന ലഘു ഗണിത ക്രിയ ചെയ്ത്, ഉത്തരം പെട്ടിയിൽ എഴുതുക ([[Special:Captcha/help|കൂടുതൽ വിവരങ്ങൾ]]):',
      -	'captcha-sendemail-fail' => 'തെറ്റായതോ ലഭ്യമല്ലാത്തതോ ആയ സ്ഥിരീകരണ കോഡ്.',
      +	'captcha-sendemail-fail' => 'തെറ്റായതോ ലഭ്യമല്ലാത്തതോ ആയ കാപ്ച്ച.',
       	'captcha-disabledinapi' => 'ഈ പ്രവൃത്തി പൂർണ്ണമാകാൻ കാപ്ച ആവശ്യമാണ്, അതുകൊണ്ടിത് എ.പി.ഐ. ഉപയോഗിച്ച് ചെയ്യാൻ കഴിയില്ല.',
       	'captchahelp-title' => 'കാപ്ച്ച സഹായം',
       	'captchahelp-cookies-needed' => 'ഇതു പ്രവർത്തിക്കണമെങ്കിൽ താങ്കളുടെ ബ്രൗസറിൽ കുക്കികൾ സജ്ജീകരിച്ചിരിക്കണം.',
      @@ -2705,6 +2735,7 @@ $messages['nan'] = array(
       /** Norwegian Bokmål (norsk bokmål)
        * @author Audun
        * @author Danmichaelo
      + * @author Event
        * @author Laaknor
        * @author Nghtwlkr
        */
      @@ -2712,13 +2743,14 @@ $messages['nb'] = array(
       	'captcha-edit' => 'Skriv inn summen nedenfor i boksen for å kunne redigere denne siden ([[Special:Captcha/help|mer informasjon]]):',
       	'captcha-desc' => 'Gir tilgang til CAPTCHA-teknikker for å beskytte mot søppl og passordgjetting',
       	'captcha-label' => 'CAPTCHA',
      -	'captcha-addurl' => 'Din redigering inneholder nye eksterne lenker. Løs det enkle regnestykket i boksen nedenfor for å hjelpe oss å beskytte oss mot automatisk spam ([[Special:Captcha/help|mer informasjon]]):', # Fuzzy
      -	'captcha-badlogin' => 'Løs det enkle regnestykket i boksen nedenfor for å hjelpe oss å beskytte oss mot automatisk passordtyveri ([[Special:Captcha/help|mer informasjon]]):', # Fuzzy
      -	'captcha-createaccount' => 'Løs det enkle regnestykket i boksen nedenfor for å hjelpe oss å beskytte oss mot automatisk kontoopprettelse ([[Special:Captcha/help|mer informasjon]]):', # Fuzzy
      -	'captcha-createaccount-fail' => 'Feil eller manglende bekreftelseskode.',
      +	'captcha-addurl' => 'Din redigering inneholder nye eksterne lenker.
      +Løs den enkle summeringen i boksen nedenfor for å beskytte mot automatisk spam ([[Special:Captcha/help|Mer informasjon]]):',
      +	'captcha-badlogin' => 'Løs den enkle summeringen i boksen nedenfor for å beskytte mot automatisk passordtyveri ([[Special:Captcha/help|Mer informasjon]]):',
      +	'captcha-createaccount' => 'Løs den enkle summeringen i boksen nedenfor for å beskytte mot automatisk kontoopprettelse ([[Special:Captcha/help|Mer informasjon]]):',
      +	'captcha-createaccount-fail' => 'Feil eller manglende CAPTCHA-svar.',
       	'captcha-create' => 'Løs det enkle regnestykket i boksen nedenfor for å opprette siden ([[Special:Captcha/help|mer informasjon]]):',
      -	'captcha-sendemail' => 'Løs det enkle regnestykket i boksen nedenfor for å hjelpe oss å beskytte oss mot automatisk spamming ([[Special:Captcha/help|mer informasjon]]):', # Fuzzy
      -	'captcha-sendemail-fail' => 'Ukorrekt eller manglende bekreftelseskode.',
      +	'captcha-sendemail' => 'Løs den enkle summeringen i boksen nedenfor for å beskytte mot automatisk spamming ([[Special:Captcha/help|m\\Mer informasjon]]):',
      +	'captcha-sendemail-fail' => 'Feil eller manglende CAPTCHA-svar.',
       	'captcha-disabledinapi' => 'Denne handlinger krever en captcha, så den kan ikke bli gjort gjennom APIet.',
       	'captchahelp-title' => 'Hjelp med Captcha',
       	'captchahelp-cookies-needed' => 'Du må slå på informasjonskapsler for at dette skal fungere.',
      @@ -2780,9 +2812,9 @@ Mit den „Trüch“-Knopp vun dien Browser kummst du trüch na dat Ännerfinste
        */
       $messages['nds-nl'] = array(
       	'captcha-edit' => "Um disse zied te bewarken, mu'j eerst t antwoord op disse eenvoudige somme invullen ([[Special:Captcha/help|meer informasie]]):",
      -	'captcha-desc' => 'Biejt CAPTCHA-technieken um bescharming te biejen tegen moekpost en t raojen van wachtwoorden',
      +	'captcha-desc' => 'Biedt CAPTCHA-technieken um bescharming te biejen tegen spam en t raojen van wachtwoorden',
       	'captcha-addurl' => 'In joew bewarking staon nieje uutgaonde verwiezingen.
      -Vul ter de bescharming van disse wiki tegen automatiese moekpost t antwoord op de somme in, in t invoerveld dat hieronder steet, um joew bewarking op te slaon:
      +Vul ter de bescharming van disse wiki tegen automatiese moekbiedragen t antwoord op de somme in, in t invoerveld dat hieronder steet, um joew bewarking op te slaon:
      ([[Special:Captcha/help|meer informasie]])', 'captcha-badlogin' => 'Vul ter de bescharming van disse wiki tegen t automaties kraken van wachtwoorden t antwoord op de somme in, in t invoerveld ([[Special:Captcha/help|meer informasie]]):', 'captcha-createaccount' => 'Vul ter bescharming van disse wiki tegen t automaties anmaken van gebrukers t antwoord op de somme in, in t invoerveld ([[Special:Captcha/help|meer informasie]]):', @@ -2821,11 +2853,11 @@ Voer het antwoord op de onderstaande eenvoudige som in het invoervenster in ([[S Voer ter bescherming tegen geautomatiseerde spam het antwoord op de onderstaande eenvoudige som in in het invoerveld om uw bewerking op te slaan ([[Special:Captcha/help|meer informatie]]):", 'captcha-badlogin' => 'Los de onderstaande eenvoudige som op en voer het antwoord in het invoervenster in ter bescherming tegen het automatisch kraken van wachtwoorden ([[Special:Captcha/help|meer informatie]]):', 'captcha-createaccount' => 'Voer ter bescherming tegen het geautomatiseerd gebruikers aanmaken, het antwoord op de onderstaande eenvoudige som in in het invoervenster ([[Special:Captcha/help|meer informatie]]):', - 'captcha-createaccount-fail' => 'De bevestigingscode ontbreekt of is onjuist.', + 'captcha-createaccount-fail' => 'De CAPTCHA ontbreekt of is onjuist.', 'captcha-create' => 'U wilt een nieuwe pagina aanmaken. Voer het antwoord op de onderstaande eenvoudige som in het invoervenster in ([[Special:Captcha/help|meer informatie]]):', 'captcha-sendemail' => 'Voer ter bescherming tegen geautomatiseerde spam het antwoord op de onderstaande eenvoudige som in het invoervenster in ([[Special:Captcha/help|meer informatie]]):', - 'captcha-sendemail-fail' => 'De bevestigingscode ontbreekt of is onjuist.', + 'captcha-sendemail-fail' => 'De CAPTCHA ontbreekt of is onjuist.', 'captcha-disabledinapi' => 'Voor deze handeling is een captcha nodig die niet afgehandeld kan worden via de API.', 'captchahelp-title' => 'Captcha-hulppagina', 'captchahelp-cookies-needed' => 'U dient in uw browser cookies ingeschakeld te hebben om dit te laten werken.', @@ -2910,9 +2942,10 @@ Trykk på «attende»-knappen for å kome tilbake til endringssida.', */ $messages['oc'] = array( 'captcha-edit' => "Per modificar aquesta pagina, vos cal efectuar lo calcul çaijós e n'inscriure lo resultat dins lo camp ([[Special:Captcha/help|Mai d’entresenhas]]) :", - 'captcha-desc' => 'Implementacion captcha simpla', # Fuzzy + 'captcha-desc' => 'Ofèrta de tecnicas CAPTCHA per protegir contra lo spam e la descobèrta dels senhals per ensages multiples', 'captcha-label' => 'CAPTCHA', - 'captcha-addurl' => "Vòstra modificacion inclutz de ligams URL novèla ; per empachar las connexions automatizadas, vos cal picar los mots que s’afichan dins l’imatge que seguís :
      ([[Special:Captcha/help|Qu'es aquò?]])", # Fuzzy + 'captcha-addurl' => "Vòstra modificacion inclutz de ligams extèrnes. +Per nos ajudar dins la proteccion contra lo corrièr indesirable automatizat, calculatz l'operacion simpla çaijós e inscrivissètz-ne lo resultat dins lo camp ([[Special:Captcha/help|mai d'informacions]]) :", 'captcha-badlogin' => "Per ensajar de contornar las temptativas de cracatge de senhals automatizadas per de robòts, recopiatz lo tèxte çaijós dins la bóstia de tèxte plaçada al dejós d'aqueste. ([[Special:Captcha/help|Mai d’entresenhas]])", # Fuzzy 'captcha-createaccount' => 'Coma proteccion contra las creacions de compte abusivas, entratz lo resultat de l’addicion dins la bóstia çaijós:
      ([[Special:Captcha/help|mai d’entresenhas]])', # Fuzzy @@ -3052,11 +3085,11 @@ e ch'a buta l'arzulta ant ël quadrèt ([[Special:Captcha/help|për savejne dë 'captcha-badlogin' => "Për goerné la wiki da ij programa ch'a fan ciav fàusse n'automàtich, i-j ciamoma për piasì ch'a fasa ël total ambelessì-sota e ch'a buta l'arzultà ant ël quadrèt ([[Special:Captcha/help|për savejne dë pì]]):", 'captcha-createaccount' => "Për goerné la wiki da ij programa ch'a deurbo dij cont n'automàtich, i-j ciamoma për piasì ch'a fasa ël total ambelessì-sota e ch'a buta l'arzultà ant ël quadrèt ([[Special:Captcha/help|për savejne dë pì]]):", - 'captcha-createaccount-fail' => "Ël còdes ëd verìfica ò ch'a manca d'autut ò ch'a l'é pa bon.", + 'captcha-createaccount-fail' => "Ël còde tërbol ò ch'a manca d'autut ò ch'a l'é pa bon.", 'captcha-create' => "Për creé d'amblé sta pàgina-sì, për piasì ch'a fasa ël total ambelessì sota e ch'a buta l'arzultà
      ant ël quadrèt ([[Special:Captcha/help|për savejne dë pì]]):", 'captcha-sendemail' => "Për protegi la wiki contra la rumenta automàtica, i-j ciamoma për piasì ch'a fasa l'adission sempia sì-sota e ch'a buta l'arspòsta ant la casela ([[Special:Captcha/help|për savèjne ëd pi]]):", - 'captcha-sendemail-fail' => "Ël còdes ëd verìfica ò ch'a manca d'autut ò ch'a l'é pa bon.", + 'captcha-sendemail-fail' => "Ël còdes tërbol ò ch'a manca d'autut ò ch'a l'é pa bon.", 'captcha-disabledinapi' => "St'assion-sì a ciama na captcha, parèj a peul pa esse fàita con na API.", 'captchahelp-title' => 'Còs é-lo mai ës captcha?', 'captchahelp-cookies-needed' => "Për podej dovré sossì a l'ha da manca che sò navigator (browser) a pija ij cookies.", @@ -3186,10 +3219,10 @@ $messages['pt-br'] = array( Como prevenção contra sistemas automatizados que inserem spam, será necessário resolver a simples soma abaixo e inserir sua resposta no respectivo campo ([[Special:Captcha/help|detalhes]])', 'captcha-badlogin' => 'Como prevenção contra sistemas automatizados de pesquisa e descoberta de senhas, será necessário resolver a simples soma abaixo e inserir sua resposta no respectivo campo ([[Special:Captcha/help|detalhes]])', 'captcha-createaccount' => 'Para proteger a wiki contra sistemas automatizados de criação de contas, solicitamos que resolva a soma simples apresentada abaixo e introduza a resposta no respectivo campo ([[Special:Captcha/help|mais informações]]):', - 'captcha-createaccount-fail' => 'Código de confirmação incorreto ou não preenchido.', + 'captcha-createaccount-fail' => 'Código de confirmação incorreto ou não preenchido.', # Fuzzy 'captcha-create' => 'Para criar a página, por favor resolva a simples soma abaixo e entre com a resposta no respectivo campo ([[Special:Captcha/help|o que é isto?]])', 'captcha-sendemail' => 'Como proteção ao wiki contra spam automatizado, será necessário resolver a simples soma abaixo e inserir sua resposta no respectivo campo ([[Special:Captcha/help|detalhes]]):', - 'captcha-sendemail-fail' => 'Código de confirmação incorreto ou não preenchido.', + 'captcha-sendemail-fail' => 'Código CAPTCHA incorreto ou não preenchido.', 'captcha-disabledinapi' => 'Esta operação necessita de captcha, por isso não pode ser realizada através da API.', 'captchahelp-title' => 'Ajuda com o Captcha', 'captchahelp-cookies-needed' => 'Você precisa ter cookies habilitados em seu navegador para que possa funcionar', @@ -3216,6 +3249,7 @@ Pressione o botão 'voltar' de seu navegador para retornar à página de ediçã * @author AlimanRuna */ $messages['qu'] = array( + 'captcha-badlogin' => 'Wikita kikinmanta millay ruraq yaykuna rima chamqaymanta amachanapaqqa, kay qatiq yapayta ruraspa yapasqata kahachapi yaykuchiy ([[Special:Captcha/help|astawan yachay]]):', 'captchahelp-title' => 'Captcha nisqamanta yanapay', ); @@ -3479,10 +3513,48 @@ Fari clic supra ô buttuni 'back' dû browser pi turnari a la pàggina di mudìf ); /** Scots (Scots) + * @author John Reid * @author OchAyeTheNoo */ $messages['sco'] = array( - 'captcha-edit' => 'Tae edit this airticle, please dae the eisy sum ablo an put the answer in the box ([[Special:Captcha/help|mair info]])', # Fuzzy + 'captcha-edit' => 'Tae edit this page, please solve the simple sum ablow an enter the answer in the box ([[Special:Captcha/help|more info]]):', + 'captcha-desc' => 'Provides CAPTCHA techniques fer tae protect again spam an passwaird-guessin', + 'captcha-label' => 'CAPTCHA.', + 'captcha-addurl' => 'Yer eidit inclædes new external airtins. +Tae protect the wiki again autæmated spam, we kindly ask ye tae solve the symple sum ablow an enter the answer in the box in order tae save yer eidit ([[Special:Captcha/help|mair info]]):', + 'captcha-badlogin' => 'Tae protect the wiki fae autaemated passwaird cracking, we kindly ask ye tae solve the symple sum ablow an enter the answer in the box ([[Special:Captcha/help|mair info]]):', + 'captcha-createaccount' => 'Tae protect the wiki fae autæmated accoont creation, we kindly ask ye tae solve the symple sum ablow an enter the answer in the box ([[Special:Captcha/help|mair info]]):', + 'captcha-createaccount-fail' => 'Oncorrect or missing CAPTCHA.', + 'captcha-create' => 'Tae mak the page, please solve the symple sum ablow an enter the answer in the box ([[Special:Captcha/help|mair info]]):', + 'captcha-sendemail' => 'Tae protect the wiki fae autæmated spamming, we kindly ask ye tae solve the symple sum ablow an enter the answer in the box ([[Special:Captcha/help|mair info]]):', + 'captcha-sendemail-fail' => 'Oncorrect or missing CAPTCHA.', + 'captcha-disabledinapi' => 'This action needs ae CAPTCHA, sae it canna be performed through the API.', + 'captchahelp-title' => 'CAPTCHA heelp', + 'captchahelp-cookies-needed' => "Ye'll need tae haee cookies enabled in yer brouser fer this tae wairk.", + 'captchahelp-text' => 'Wab sites that accept postings fae the public, like this wiki, ar aften abused bi spammers wha uise autaemated tuils tae post their links til moni sites. +While these spam links can be remuived, they ar ae signeeficant nuisance. + +Sometimes, especially whan adding new wab links til ae page, the wiki micht shaw ye aen eimage o coloured or distorted tex an ask ye tae type the wairds shawn. +Syne this is ae task that\'s hard tae autæmate, it will allou maist real bodies tae mak their posts while stapping maist spammers an ither robotic attackers. + +Onfortunately this can inconvenience uisers with limited vision or uising tex-based or speech-based brousers. +At the moment we dinna hae aen audio alternative available. +Please contact the [[Special:ListAdmins|site admeenistraters]] fer assistance gif this is onexpectedly preventin ye fae makin legeetimate actions. + +Hit the "back" button in yer brouser tae return til the page eiditer.', + 'captcha-addurl-whitelist' => ' #
      +# Syntax is aes follows:
      +#   * Awthin fae ae "#" chairacter til the end o the line is ae comment
      +#   * Ilka no-blank line is ae regex fragment that will yinly match hosts inside URLs
      + #
      ', + 'right-skipcaptcha' => 'Perform CAPTCHA-triggering actions wiout haein tae gae through the CAPTCHA', +); + +/** Serbo-Croatian (srpskohrvatski / српскохрватски) + * @author Kolega2357 + */ +$messages['sh'] = array( + 'captcha-createaccount-fail' => 'Netačan unos ili nedostatak koda za potvrđivanje.', ); /** Sinhala (සිංහල) @@ -3632,6 +3704,7 @@ Shtypni butonin "prapa" ("back") të shfletuesit tuaj për tu kthyer tek faqja e ); /** Serbian (Cyrillic script) (српски (ћирилица)‎) + * @author Milicevic01 * @author Millosh * @author Rancher */ @@ -3641,31 +3714,46 @@ $messages['sr-ec'] = array( 'captcha-addurl' => 'Ваша измена садржи нове спољашње везе. У циљу заштите од непожељних порука, решите просту рачуницу испод и унесите одговор у поље ([[Special:Captcha/help|више информација]]):', # Fuzzy 'captcha-badlogin' => 'У циљу заштите од пробијања лозинки, решите просту рачуницу испод и унесите одговор у поље ([[Special:Captcha/help|више информација]]):', # Fuzzy - 'captcha-createaccount' => 'У циљу заштите од самоотварања налога, решите просту рачуницу испод и унесите одговор у поље ([[Special:Captcha/help|више информација]]):', # Fuzzy - 'captcha-createaccount-fail' => 'Неправилан или непостојећи код за потврду.', + 'captcha-createaccount' => 'У циљу заштите од аутоматизованог вандализма, решите просту рачуницу испод и унесите одговор у поље ([[Special:Captcha/help|више информација]]):', + 'captcha-createaccount-fail' => 'Неправилан или непостојећи код за потврду.', # Fuzzy 'captcha-create' => 'Да бисте направили страницу, решите просту рачуницу испод и унесите одговор у поље ([[Special:Captcha/help|више информација]]):', 'captcha-sendemail' => 'У циљу заштите од слања непожељних порука, решите просту рачуницу испод и унесите одговор у поље ([[Special:Captcha/help|више информација]]):', # Fuzzy - 'captcha-sendemail-fail' => 'Неправилан или непостојећи код за потврду.', - 'captchahelp-title' => 'Помоћ око потврдног кôда', + 'captcha-sendemail-fail' => 'Неправилан или непостојећи код за потврду.', # Fuzzy + 'captchahelp-title' => 'Помоћ око потврдног кoда', 'captchahelp-cookies-needed' => 'Потребно је да омогућите колачиће да би ово радило.', + 'captchahelp-text' => 'Веб-сајтове који подржавају слање садржаја из јавности, као што је овај вики, често злоупотребљавају вандали који користе аутоматизоване алате да шаљу своје повезнице ка многим сајтовима. Иако се ове нежељене повезнице могу уклонити, оне задају велику муку. + +Понекад, поготово када се додају нове интернет повезнице на страну, вики софтвер вам може показати слику обојеног и изврнутог текста и тражити да укуцате тражену реч. Пошто је тешко аутоматизовати овакав задатак, он омогућује свим правим људима да врше своје измене, али ће зато спречити вандале и остале роботске нападаче. + +Нажалост, ово може да буде неповољно за кориснике са ограниченим видом и за оне који користе прегледаче базиране на тексту или говору. У овом тренутку, аудио алтернатива није доступна. Молимо контактирајте администраторе сајта ради помоћи ако вас ово неочекивано омета у прављењу добрих измена. + +Кликните на дугме „назад“ вашег прегледача да се вратите на поље за унос текста.', # Fuzzy 'right-skipcaptcha' => 'прескакање радњи које захтевају унос потврдног кода', ); /** Serbian (Latin script) (srpski (latinica)‎) * @author Michaello + * @author Milicevic01 */ $messages['sr-el'] = array( 'captcha-edit' => 'Za izmenu ove strane, reši jednostavan zbri ispod i unesi odgovor u kutiju ([[Special:Captcha/help|detaljnije]]):', 'captcha-desc' => 'Pruža zaštitu protiv nepoželjnih poruka u vidu potvrdnog koda', 'captcha-addurl' => 'Tvoja izmena uključuje nove spoljašnje veze. U cilju zaštite protiv automatskog spama, reši jednostavan zbir ispod i upiši odgovor u kutiju ([[Special:Captcha/help|detaljnije]]):', # Fuzzy 'captcha-badlogin' => 'U cilju zaštite od automatske provale u lozinku, reši jednostavan zbir ispod i unesi odgovor u kutiju ([[Special:Captcha/help|detaljnije]]):', # Fuzzy - 'captcha-createaccount' => 'U cilju zaštite od automatskog stvaranja naloga, reši jednostavan zbir dole i unesi ga u kutiju ([[Special:Captcha/help|detaljnije]]):', # Fuzzy - 'captcha-createaccount-fail' => 'Nepravilan ili nepostojeći kod za potvrdu.', + 'captcha-createaccount' => 'U cilju zaštite od automatizovanog vandalizma, rešite prostu računicu ispod i unesite odgovor u polje ([[Special:Captcha/help|više informacija]]):', + 'captcha-createaccount-fail' => 'Nepravilan ili nepostojeći kod za potvrdu.', # Fuzzy 'captcha-create' => 'Za stvaranje strane reši jednostavan zbir dole i unesi ga u kutiju ([[Special:Captcha/help|detaljnije]]):', - 'captcha-sendemail-fail' => 'Nepravilan ili nepostojeći kod za potvrdu.', - 'captchahelp-title' => 'pomoć za kapču', + 'captcha-sendemail-fail' => 'Nepravilan ili nepostojeći kod za potvrdu.', # Fuzzy + 'captchahelp-title' => 'Pomoć oko potvrdnog koda', 'captchahelp-cookies-needed' => 'Da bi ovo uradio, neophodno je da su ti kolačići omogućeni u brauzeru.', - 'right-skipcaptcha' => 'Izvedi akcije kapče bez potrebe da se prođe kroz kapču.', + 'captchahelp-text' => 'Veb-sajtove koji podržavaju slanje sadržaja iz javnosti, kao što je ovaj viki, često zloupotrebljavaju vandali koji koriste automatizovane alate da šalju svoje poveznice ka mnogim sajtovima. Iako se ove neželjene poveznice mogu ukloniti, one zadaju veliku muku. + +Ponekad, pogotovo kada se dodaju nove internet poveznice na stranu, viki softver vam može pokazati sliku obojenog i izvrnutog teksta i tražiti da ukucate traženu reč. Pošto je teško automatizovati ovakav zadatak, on omogućuje svim pravim ljudima da vrše svoje izmene, ali će zato sprečiti vandale i ostale robotske napadače. + +Nažalost, ovo može da bude nepovoljno za korisnike sa ograničenim vidom i za one koji koriste pregledače bazirane na tekstu ili govoru. U ovom trenutku, audio alternativa nije dostupna. Molimo kontaktirajte administratore sajta radi pomoći ako vas ovo neočekivano ometa u pravljenju dobrih izmena. + +Kliknite na dugme „nazad“ vašeg pregledača da se vratite na polje za unos teksta.', # Fuzzy + 'right-skipcaptcha' => 'preskakanje radnji koje zahtevaju unos potvrdnog koda', ); /** Seeltersk (Seeltersk) @@ -3734,6 +3822,7 @@ Hit the 'back' button in your browser to return to the page editor.", # Fuzzy * @author Martinwiss * @author Per * @author Rotsee + * @author WikiPhoenix */ $messages['sv'] = array( 'captcha-edit' => 'För att redigera den här sidan måste du först skriva svaret på följande @@ -3743,11 +3832,11 @@ räkneuppgift i rutan ([[Special:Captcha/help|mer information]]):', 'captcha-addurl' => 'Din ändring innebär nya externa länkar i texten. För att skydda wikin mot automatisk spam måste du skriva svaret på följande räkneuppgift i rutan ([[Special:Captcha/help|mer information]]):', 'captcha-badlogin' => 'För att skydda mot wikin mot försök att knäcka lösenord på automatisk väg, måste du skriva svaret på följande räkneuppgift i rutan ([[Special:Captcha/help|mer information]]):', 'captcha-createaccount' => 'För att skydda wikin mot automatiskt skapade användarkonton, måste du skriva svaret på följande räkneuppgift i rutan ([[Special:Captcha/help|mer information]]):', - 'captcha-createaccount-fail' => 'Bekräftelsekoden är felaktig eller saknas.', + 'captcha-createaccount-fail' => 'Felaktig eller saknad CAPTCHA.', 'captcha-create' => 'För att skapa den här sidan måste du skriva svaret på följande räkneuppgift i rutan ([[Special:Captcha/help|mer information]]):', 'captcha-sendemail' => 'För att skydda wikin mot spam, ber vi dig att lösa den här enkla räkneuppgiften, och skriva in svaret i rutan ([[Special:Captcha/help|mer information]]):', - 'captcha-sendemail-fail' => 'Felaktig eller saknad bekräftelsekod.', + 'captcha-sendemail-fail' => 'Felaktig eller saknad CAPTCHA.', 'captcha-disabledinapi' => 'Denna åtgärd kräver en captcha, så den kan inte utföras genom APIet.', 'captchahelp-title' => 'Captchahjälp', 'captchahelp-cookies-needed' => 'Du måste ha cookies aktiverade i din webbläsare för att det här ska fungera.', @@ -3977,13 +4066,13 @@ $messages['tr'] = array( 'captcha-desc' => 'Spam ve parola tahminine karşı korunmak için "Güvenlik Kodu" (CAPTCHA) tekniği sağlar.', 'captcha-label' => 'Güvenlik Kodu', 'captcha-addurl' => 'Değişikliğiniz yeni dış bağlantılar içeriyor. -Otomatik spamdan korunmak için lütfen aşağıdaki basit soruyu yanıtlayın ve yanıtı kutunun içine yazın ([[Special:Captcha/help|ayrıntılı bilgi]]):', # Fuzzy - 'captcha-badlogin' => 'Otomatik parola çözülmesine karşı korunmak için, lütfen aşağıdaki basit soruyu yanıtlayın ve kutunın içinde yanıtı yazın ([[Special:Captcha/help|ayrıntılı bilgi]]):', # Fuzzy - 'captcha-createaccount' => 'Otomatik hesap oluşturmaya karşı korunmak için, lütfen aşağıdaki basit soruyu yanıtlayın ve kutunın içinde yanıtı yazın ([[Special:Captcha/help|ayrıntılı bilgi]]):', # Fuzzy - 'captcha-createaccount-fail' => 'Hatalı ya da eksik onay kodu.', +Vikiyi otomatik spamdan korumak ve değişikliğinizi kaydetmek için, aşağıdaki basit toplamı çözmenizi ve yanıtı kutunun içine yazmanızı rica ediyoruz ([[Special:Captcha/help|ayrıntılı bilgi]]):', + 'captcha-badlogin' => 'Vikiyi otomatik parola çözülmesine karşı korumak için, aşağıdaki basit toplamı çözmenizi ve yanıtı kutunun içine yazmanızı rica ediyoruz ([[Special:Captcha/help|ayrıntılı bilgi]]):', + 'captcha-createaccount' => 'Vikiyi otomatik hesap oluşturmaya karşı korumak için, aşağıdaki basit toplamı çözmenizi ve yanıtı kutunun içine yazmanızı rica ediyoruz ([[Special:Captcha/help|ayrıntılı bilgi]]):', + 'captcha-createaccount-fail' => 'Hatalı ya da eksik CAPTCHA.', 'captcha-create' => 'Bu sayfayı oluşturmak için, lütfen aşağıdaki basit soruyu yanıtlayın ve kutunun içinde yanıtı yazın ([[Special:Captcha/help|ayrıntılı bilgi]]):', - 'captcha-sendemail' => 'Otomatik spamlara karşı korunmaya yardımcı olmak için, lütfen aşağıdaki basit işlemi çözün ve yanıtı kutuya yazın ([[Special:Captcha/help|ayrıntılı bilgi]]):', # Fuzzy - 'captcha-sendemail-fail' => 'Hatalı ya da eksik onay kodu.', + 'captcha-sendemail' => 'Vikiyi otomatik spamlara karşı korumaya yardımcı olmak için, aşağıdaki basit toplamı çözmenizi ve yanıtı kutunun içine yazmanızı rica ediyoruz ([[Special:Captcha/help|ayrıntılı bilgi]]):', + 'captcha-sendemail-fail' => 'Hatalı ya da eksik CAPTCHA.', 'captcha-disabledinapi' => 'Bu eylem güvenlik kodu gerektiriyor, dolayısıyla API aracılığıyla yapılamaz.', 'captchahelp-title' => 'Güvenlik kodu yardımı', 'captchahelp-cookies-needed' => 'Bunun çalışabilmesi için tarayıcınızın çerezleri etkinleştirilmelidir.', @@ -4012,6 +4101,7 @@ $messages['tru'] = array( /** Ukrainian (українська) * @author Ahonc * @author Alex Khimich + * @author Andriykopanytsia * @author NickK * @author Olvin * @author Riwnodennyk @@ -4026,10 +4116,10 @@ $messages['uk'] = array( Із метою захисту від автоматичного спаму, будь ласка, виконайте просту арифметичну дію і введіть відповідь у текстове поле, щоб редагування було збережене ([[Special:Captcha/help|докладніше]]):', 'captcha-badlogin' => 'Із метою захисту від автоматичного злому пароля, будь ласка, виконайте просту арифметичну дію і введіть відповідь у текстове поле ([[Special:Captcha/help|докладніше]]):', 'captcha-createaccount' => 'Із метою захисту від автоматичного створення облікового запису просимо виконати просту арифметичну дію і ввести відповідь у текстове поле ([[Special:Captcha/help|докладніше]]):', - 'captcha-createaccount-fail' => 'Неправильний або відсутній код підтвердження.', + 'captcha-createaccount-fail' => 'Неправильна або відсутня капча.', 'captcha-create' => 'Щоб створити сторінку, будь ласка, виконайте просту арифметичну дію і введіть відповідь у текстове поле ([[Special:Captcha/help|докладніше]]):', 'captcha-sendemail' => "Із метою захисту вікі від автоматичного спаму просимо розв'язати простий математичний приклад і ввести відповідь ([[Special:Captcha/help|деталі]]):", - 'captcha-sendemail-fail' => 'Неправильний або відсутній код підтвердження.', + 'captcha-sendemail-fail' => 'Неправильна або відсутня капча.', 'captcha-disabledinapi' => 'Ця дія потребує перевірки CAPTCHA, тому не може бути здійснена за допомогою API.', 'captchahelp-title' => 'Довідка про CAPTCHA', 'captchahelp-cookies-needed' => 'Вам потрібно ввімкнути куки у браузері, щоб ця функція запрацювала.', @@ -4095,11 +4185,11 @@ $messages['vi'] = array( 'captcha-addurl' => 'Sửa đổi của bạn có chứa các liên kết ra bên ngoài. Để tránh spam tự động trong wiki, xin bạn vui lòng giải phép toán đơn giản ở dưới và nhập kết quả vào ô để lưu giữ các sửa đổi của bạn ([[Special:Captcha/help|thông tin thêm]]):', 'captcha-badlogin' => 'Để tránh vụ tự động bẻ mật khẩu của người dùng wiki, xin bạn vui lòng giải phép cộng đơn giản ở dưới và nhập kết quả vào ô ([[Special:Captcha/help|thông tin thêm]]):', 'captcha-createaccount' => 'Để tránh vụ tự động mở tài khoản trong wiki, xin bạn vui lòng giải phép cộng đơn giản ở dưới và nhập kết quả vào ô ([[Special:Captcha/help|thông tin thêm]]):', - 'captcha-createaccount-fail' => 'Thiếu mã xác nhận hoặc mã xác nhận sai.', + 'captcha-createaccount-fail' => 'CAPTCHA bị thiếu hoặc không chính xác.', 'captcha-create' => 'Để tạo mới trang, xin hãy giải phép cộng đơn giản ở dưới và gõ câu trả lời vào ô ([[Special:Captcha/help|thông tin thêm]]):', 'captcha-sendemail' => 'Để xác nhận rằng bạn không phải là tay spam, xin bạn vui lòng giải phép cộng đơn giản ở dưới và nhập kết quả vào ô ([[Special:Captcha/help|thông tin thêm]]):', - 'captcha-sendemail-fail' => 'Mã xác nhận không chính xác hoặc chưa được cung cấp.', + 'captcha-sendemail-fail' => 'CAPTCHA bị thiếu hoặc không chính xác.', 'captcha-disabledinapi' => 'Tác vụ này đòi người dùng giải CAPTCHA trước tiên, nên không thể thực hiện nó qua API.', 'captchahelp-title' => 'Trợ giúp Captcha', 'captchahelp-cookies-needed' => 'Bạn cần phải bật cookie trong trình duyệt để chức năng này hoạt động được.', @@ -4128,7 +4218,8 @@ Nhấn chuột vào nút “Back” của trình duyệt để trở lại trang */ $messages['vo'] = array( 'captcha-edit' => 'Ad redakön yegedi at, dunolös, begö! saedami dono e penolös saedoti in bokil ([[Special:Captcha/help|nüns pluik]]):', - 'captcha-addurl' => 'Redakam olik keninükon yümis plödik nulik. Ad jelön siti ta peneds itjäfidik, dunolös, begö! saedami sököl, e penolös saedoti in bokil ([[Special:Captcha/help|nüns pluik]]):', # Fuzzy + 'captcha-addurl' => 'Redakam olik keninükon yümis plödik nulik. +Ad jelön siti ta peneds badik itjäfidik, dunolös, begö! saedami balugik sököl, e penolös saedoti in bokil ad dakipön redakam ola ([[Special:Captcha/help|nüns pluik]]):', 'captcha-badlogin' => 'Ad jelön siti ta daget itjäfidik letavödas, dunolös, begö! saedami sököl e penolös saedoti in bokil ([[Special:Captcha/help|nüns pluik]]):', # Fuzzy 'captcha-createaccount' => 'Ad jelön siti ta kalijafam itjäfidik, dunolös, begö! saedami sököl e penolös saedoti in bokil ([[Special:Captcha/help|nüns pluik]]):', # Fuzzy 'captcha-createaccount-fail' => 'Kot fümükama paneveräton u paseleton.', diff --git a/extensions/ConfirmEdit/ConfirmEdit.php b/extensions/ConfirmEdit/ConfirmEdit.php index d861a04a..f0836973 100644 --- a/extensions/ConfirmEdit/ConfirmEdit.php +++ b/extensions/ConfirmEdit/ConfirmEdit.php @@ -189,6 +189,8 @@ $wgHooks['EmailUser'][] = 'ConfirmEditHooks::confirmEmailUser'; $wgHooks['APIEditBeforeSave'][] = 'ConfirmEditHooks::confirmEditAPI'; $wgHooks['APIGetAllowedParams'][] = 'ConfirmEditHooks::APIGetAllowedParams'; $wgHooks['APIGetParamDescription'][] = 'ConfirmEditHooks::APIGetParamDescription'; +$wgHooks['AddNewAccountApiForm'][] = 'ConfirmEditHooks::addNewAccountApiForm'; +$wgHooks['AddNewAccountApiResult'][] = 'ConfirmEditHooks::addNewAccountApiResult'; $wgAutoloadClasses['ConfirmEditHooks'] = "$wgConfirmEditIP/ConfirmEditHooks.php"; $wgAutoloadClasses['SimpleCaptcha'] = "$wgConfirmEditIP/Captcha.php"; @@ -196,7 +198,6 @@ $wgAutoloadClasses['CaptchaStore'] = "$wgConfirmEditIP/CaptchaStore.php"; $wgAutoloadClasses['CaptchaSessionStore'] = "$wgConfirmEditIP/CaptchaStore.php"; $wgAutoloadClasses['CaptchaCacheStore'] = "$wgConfirmEditIP/CaptchaStore.php"; $wgAutoloadClasses['CaptchaSpecialPage'] = "$wgConfirmEditIP/ConfirmEditHooks.php"; -$wgAutoloadClasses['HTMLCaptchaField'] = "$wgConfirmEditIP/HTMLCaptchaField.php"; /** * Set up $wgWhitelistRead diff --git a/extensions/ConfirmEdit/ConfirmEditHooks.php b/extensions/ConfirmEdit/ConfirmEditHooks.php index bc85138d..af8b9c44 100644 --- a/extensions/ConfirmEdit/ConfirmEditHooks.php +++ b/extensions/ConfirmEdit/ConfirmEditHooks.php @@ -4,7 +4,7 @@ class ConfirmEditHooks { /** * Get the global Captcha instance * - * @return Captcha|SimpleCaptcha + * @return SimpleCaptcha */ static function getInstance() { global $wgCaptcha, $wgCaptchaClass; @@ -26,13 +26,21 @@ class ConfirmEditHooks { static function confirmEditAPI( $editPage, $newtext, &$resultArr ) { return self::getInstance()->confirmEditAPI( $editPage, $newtext, $resultArr ); } + + static function addNewAccountApiForm( $apiModule, $loginForm ) { + return self::getInstance()->addNewAccountApiForm( $apiModule, $loginForm ); + } + + static function addNewAccountApiResult( $apiModule, $loginPage, &$result ) { + return self::getInstance()->addNewAccountApiResult( $apiModule, $loginPage, $result ); + } static function injectUserCreate( &$template ) { return self::getInstance()->injectUserCreate( $template ); } - static function confirmUserCreate( $u, &$message ) { - return self::getInstance()->confirmUserCreate( $u, $message ); + static function confirmUserCreate( $u, &$message, &$status = null ) { + return self::getInstance()->confirmUserCreate( $u, $message, $status ); } static function triggerUserLogin( $user, $password, $retval ) { diff --git a/extensions/ConfirmEdit/FancyCaptcha.class.php b/extensions/ConfirmEdit/FancyCaptcha.class.php index d1c6a41f..e2dbb82b 100644 --- a/extensions/ConfirmEdit/FancyCaptcha.class.php +++ b/extensions/ConfirmEdit/FancyCaptcha.class.php @@ -14,7 +14,8 @@ class FancyCaptcha extends SimpleCaptcha { if ( !$backend ) { $backend = new FSFileBackend( array( 'name' => 'captcha-backend', - 'lockManager' => 'nullLockManager', + 'wikiId' => wfWikiId(), + 'lockManager' => new NullLockManager( array() ), 'containerPaths' => array( 'captcha-render' => $wgCaptchaDirectory ), 'fileMode' => 777 ) ); diff --git a/extensions/ConfirmEdit/FancyCaptcha.i18n.php b/extensions/ConfirmEdit/FancyCaptcha.i18n.php index 7f28d048..b5a262c8 100644 --- a/extensions/ConfirmEdit/FancyCaptcha.i18n.php +++ b/extensions/ConfirmEdit/FancyCaptcha.i18n.php @@ -37,7 +37,8 @@ $messages['qqq'] = array( 'fancycaptcha-create' => '{{Related|ConfirmEdit-create}}', 'fancycaptcha-edit' => '{{Related|ConfirmEdit-edit}}', 'fancycaptcha-sendemail' => '{{Related|ConfirmEdit-sendemail}}', - 'fancycaptcha-reload-text' => 'Prompts a click to get a new FancyCaptcha image.', + 'fancycaptcha-reload-text' => 'Prompts a click to get a new FancyCaptcha image. +{{Identical|Refresh}}', ); /** Gheg Albanian (Gegë) @@ -76,19 +77,21 @@ $messages['an'] = array( /** Arabic (العربية) * @author Aiman titi + * @author Asaifm * @author Meno25 */ $messages['ar'] = array( 'fancycaptcha-desc' => 'مولد فانسي كابتشا لConfirm Edit', 'fancycaptcha-addurl' => 'تعديلك يتضمن وصلات خارجية جديدة. -للحماية من السبام الأوتوماتيكي، من فضلك أدخل الكلمات التي تظهر بالأسفل في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', # Fuzzy - 'fancycaptcha-badlogin' => 'للمساعدة في الحماية ضد سرقة كلمات السر، من فضلك أدخل الكلمات التي تظهر بالأسفل في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', # Fuzzy - 'fancycaptcha-createaccount' => 'للمساعدة في منع إنشاء حسابات بطريقة أوتوماتيكية، قم من فضلك بإدخال الكلمات التي تظهر أدناه في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', # Fuzzy +للحماية من السخام الأوتوماتيكي، من فضلك أدخل الكلمات التي تظهر بالأسفل في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', + 'fancycaptcha-badlogin' => 'للمساعدة في الحماية ضد سرقة كلمات السر، من فضلك أدخل الكلمات التي تظهر أدناه في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', + 'fancycaptcha-createaccount' => 'للمساعدة في منع إنشاء حسابات بطريقة أوتوماتيكية، قم من فضلك بإدخال الكلمات التي تظهر أدناه في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', 'fancycaptcha-create' => 'لإنشاء الصفحة، من فضلك أدخل الكلمات التي تظهر بالأسفل في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', 'fancycaptcha-edit' => 'لتعديل هذه الصفحة، من فضلك أدخل الكلمات التي تظهر بالأسفل في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', - 'fancycaptcha-sendemail' => 'للمساعدة في منع إنشاء حسابات بطريقة أوتوماتيكية، قم من فضلك بإدخال الكلمات التي تظهر أدناه في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', # Fuzzy + 'fancycaptcha-sendemail' => 'للمساعدة في منع إنشاء حسابات بطريقة أوتوماتيكية، قم من فضلك بإدخال الكلمات التي تظهر أدناه في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', + 'fancycaptcha-reload-text' => 'تحديث', ); /** Egyptian Spoken Arabic (مصرى) @@ -272,7 +275,7 @@ $messages['cdo'] = array( * @author Умар */ $messages['ce'] = array( - 'fancycaptcha-addurl' => 'Хьан нисдар чохь керла арахьара хьажоригаш ю. Спамах лардала дерхар до лахахь гура чохь гайтан дешнаш язъе ([[Special:Captcha/help|ма-дарра…]]):', # Fuzzy + 'fancycaptcha-addurl' => 'Хьан нисдар чохь керла арахьара хьажорагаш ю. Спамах лардала дехар до лахахь гура чохь гайтан дешнаш язъе ([[Special:Captcha/help|ма-дарра…]]):', ); /** Sorani Kurdish (کوردی) @@ -282,21 +285,23 @@ $messages['ckb'] = array( 'fancycaptcha-createaccount' => 'بۆ یارمەتیدانی بەرگری لە دروستکردنی خۆکاری ھەژمار، تکایە ئەو وشانە لە خوارەوەدا دیارن لە بۆکسەکەدا بنووسە ([[Special:Captcha/help|زانیاریی زۆرتر]]):', # Fuzzy ); -/** Czech (česky) +/** Czech (čeština) * @author Mormegil + * @author Tchoř */ $messages['cs'] = array( 'fancycaptcha-desc' => 'Pokročilý generátor captcha pro rozšíření „Confirm Edit“', - 'fancycaptcha-addurl' => 'Vaše editace obsahuje nové odkazy formou URL; v zájmu ochrany před automatickým spamováním musíte opsat text z následujícího obrázku: ([[Special:Captcha/help|Co tohle znamená?]])', # Fuzzy - 'fancycaptcha-badlogin' => 'V rámci ochrany proti automatickým pokusům uhodnout heslo musíte opsat text z následujícího obrázku. ([[Special:Captcha/help|Co tohle znamená?]])', # Fuzzy - 'fancycaptcha-createaccount' => 'V rámci ochrany před automatickým zakládáním účtů musíte pro provedení registrace opsat text z následujícího obrázku: ([[Special:Captcha/help|Co tohle znamená?]])', # Fuzzy + 'fancycaptcha-addurl' => 'Vaše editace obsahuje nové odkazy formou URL. +Abychom wiki ochránili před automatizovaným spamováním, žádáme vás o opsání textu z následujícího obrázku ([[Special:Captcha/help|více informací]]):', + 'fancycaptcha-badlogin' => 'Abychom wiki ochránili proti automatizovaným pokusům uhodnout heslo, žádáme vás o opsání textu z následujícího obrázku ([[Special:Captcha/help|více informací]]):', + 'fancycaptcha-createaccount' => 'Abychom wiki ochránili proti automatizovanému zakládání účtů, žádáme vás o opsání textu z následujícího obrázku ([[Special:Captcha/help|více informací]]):', 'fancycaptcha-create' => 'Abyste mohli založit stránku, musíte opsat text z následujícího obrázku: ([[Special:Captcha/help|Co tohle znamená?]])', 'fancycaptcha-edit' => 'Abyste mohli editovat tuto stránku, musíte opsat text z následujícího obrázku: ([[Special:Captcha/help|Co tohle znamená?]])', - 'fancycaptcha-sendemail' => 'V rámci ochrany proti automatickému spamování musíte opsat níže zobrazená slova ([[Special:Captcha/help|více informací]]):', # Fuzzy + 'fancycaptcha-sendemail' => 'Abychom wiki ochránili proti automatizovanému spamování, žádáme vás o opsání textu z následujícího obrázku ([[Special:Captcha/help|více informací]]):', 'fancycaptcha-reload-text' => 'Vygenerovat nový kód', ); -/** Church Slavic (словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) +/** Church Slavic (словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) * @author ОйЛ */ $messages['cu'] = array( @@ -326,7 +331,7 @@ Er mwyn arbed y wici rhag peiriannau sbam, byddwch gystal â theipio'r geiriau a $messages['da'] = array( 'fancycaptcha-addurl' => 'Din ændring tilføjer nye eksterne henvisninger. For at beskytte mod automatiseret spam, skal du indtaste ordene som vises i feltet nedenfor. ([[Special:Captcha/help|mere information]]):', - 'fancycaptcha-badlogin' => 'For at beskytte mod automatiske forsøg på at gætte kodeord, skal du indtaste ordene som vises i feltet nedenfor. ([[Special:Captcha/help|mere information]]):', + 'fancycaptcha-badlogin' => 'For at beskytte mod automatiske forsøg på at gætte adgangskoden, skal du indtaste ordene som vises i feltet nedenfor. ([[Special:Captcha/help|mere information]]):', 'fancycaptcha-createaccount' => 'For at beskytte mod automatisk oprettelse af brugerkonti, der bruges til spam, skal du indtaste ordet som vises i feltet nedenfor. ([[Special:Captcha/help|mere information]]):', 'fancycaptcha-create' => 'For at oprette en ny side, skal du indtaste ordet som vises nedenfor i feltet under det. ([[Special:Captcha/help|mere information]]):', 'fancycaptcha-edit' => 'For at redigere denne side, indtast da venligst ordene, der står i feltet nedenfor ([[Special:Captcha/help|mere information]]):', @@ -368,17 +373,18 @@ Zum Schutz vor automatisiertem Spamming geben Sie das folgende Wort in das Feld /** Zazaki (Zazaki) * @author Gorizon + * @author Mirzali * @author Xoser */ $messages['diq'] = array( - 'fancycaptcha-addurl' => 'Vırnayışané tod linkané hariciyé newe esto. -Qe otomatik spami ra pawıtış, ma rica keno çekuyané ke qutiya cor de inan binuse ([[Special:Captcha/help|enformasyoné bini]]):', - 'fancycaptcha-badlogin' => 'Qe otomatik parola crack kerdişî ra pawitîş, ma rica keno çekuyanê ke qutiya cor de înan binuse ([[Special:Captcha/help|enformasyonê bînî]]):', # Fuzzy - 'fancycaptcha-createaccount' => 'Qe otomatik hesab viraştişî ra pawitîş, ma rica keno çekuyanê ke qutiya cor de înan binuse ([[Special:Captcha/help|enformasyonê bînî]]):', # Fuzzy + 'fancycaptcha-addurl' => 'Vurnayışanê to de gıreyê teberiê newey estê. +Seba pawıtışê spamê otomatiki ra, ma reca kenime ke çekuyanê cêrênan zerreyê qutiye de bınusê ([[Special:Captcha/help|zêde melumat]]):', + 'fancycaptcha-badlogin' => 'Qe otomatik parola crack kerdişî ra pawitîş, ma rica keno çekuyanê ke qutiya cor de înan binuse ([[Special:Captcha/help|enformasyonê bînî]]):', + 'fancycaptcha-createaccount' => 'Qe otomatik hesab viraştişî ra pawitîş, ma rica keno çekuyanê ke qutiya cor de înan binuse ([[Special:Captcha/help|enformasyonê bînî]]):', 'fancycaptcha-create' => 'Qe pel viraştîşî, ma rica keno çekuyanê ke qutiya cor de înan binuse ([[Special:Captcha/help|enformasyonê bînî]]):', 'fancycaptcha-edit' => 'Qe pel vurnayîşî, ma rica keno çekuyanê ke qutiya cor de înan binuse ([[Special:Captcha/help|enformasyonê bînî]]):', 'fancycaptcha-sendemail' => 'Qe spamê otomayoni ra pawitîşi, ma rica keno çekuyanê ke qutiya cor de înan binuse -([[Special:Captcha/help|enformasyonê bînî]]):', # Fuzzy +([[Special:Captcha/help|enformasyonê bînî]]):', 'fancycaptcha-reload-text' => 'Newe ke', ); @@ -387,12 +393,13 @@ Qe otomatik spami ra pawıtış, ma rica keno çekuyané ke qutiya cor de inan b */ $messages['dsb'] = array( 'fancycaptcha-addurl' => 'Twója změna wopśimujo nowe eksterne wótkaze. -Za šćit pśeśiwo awtomatiskemu spamowanjeju, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', # Fuzzy - 'fancycaptcha-badlogin' => 'Za šćit pśeśiwo awtomatiskemu wugódanjeju gronidła, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', # Fuzzy - 'fancycaptcha-createaccount' => 'Za šćit pśeśiwo awtomatiskemu załoženjeju kontow, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', # Fuzzy +Aby wiki pśeśiwo awtomatiskemu spamowanjeju šćitał, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', + 'fancycaptcha-badlogin' => 'Aby wiki pśeśiwo awtomatiskemu wugódanjeju gronidła šćitał, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', + 'fancycaptcha-createaccount' => 'Aby wiki pśeśiwo awtomatiskemu załoženjeju kontow šćitał, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', 'fancycaptcha-create' => 'Aby bok napórał, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', 'fancycaptcha-edit' => 'Aby toś ten bok wobźěłał, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', - 'fancycaptcha-sendemail' => 'Za šćit pśeśiwo awtomatiskemu spamowanjeju, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', # Fuzzy + 'fancycaptcha-sendemail' => 'Aby wiki pśeśiwo awtomatiskemu spamowanjeju šćitał, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', + 'fancycaptcha-reload-text' => 'Aktualizěrowaś', ); /** Greek (Ελληνικά) @@ -461,12 +468,13 @@ Palun sisesta allpool olevas kastis kuvatud sõnad. Abinõu on kaitseks automaad /** Basque (euskara) * @author An13sa + * @author Xabier Armendaritz */ $messages['eu'] = array( 'fancycaptcha-addurl' => 'Zure aldaketak kanpo lotura berriak ditu. Spam automatikoa saihestu ahal izateko, beheko koadroan ageri diren hitzak idatzi ([[Special:Captcha/help|informazio gehigarria]]):', # Fuzzy 'fancycaptcha-badlogin' => 'Pasahitzen cracking automatikoa saihestu asmoz, beheko koadroan ageri diren hitzak idazteko eskatzen dizugu ([[Special:Captcha/help|informazio gehigarria]]):', # Fuzzy 'fancycaptcha-createaccount' => 'Erabiltzaile kontuak automatikoki sortzea saihestu asmoz, beheko koadroan ageri diren hitzak idazteko eskatzen dizugu ([[Special:Captcha/help|informazio gehigarria]]):', # Fuzzy - 'fancycaptcha-create' => 'Orrialde sortu ahal izateko, beheko koadroan ageri hitzak idatzi ([[Special:Captcha/help|informazio gehigarria]]):', + 'fancycaptcha-create' => 'Orri sortu ahal izateko, idatz itzazu beheko koadroan ageri diren hitzak ([[Special:Captcha/help|informazio gehigarria]]):', 'fancycaptcha-edit' => 'Orrialde hau aldatu ahal izateko, beheko koadroan ageri diren hitzak idatzi ([[Special:Captcha/help|informazio gehigarria]]):', 'fancycaptcha-sendemail' => 'Zabor-posta automatizatuaz babesteko, idatzi azpiko kutxako hitzak ([[Special:Captcha/help|informazio gehiago]]):', # Fuzzy ); @@ -481,13 +489,13 @@ $messages['eu'] = array( */ $messages['fa'] = array( 'fancycaptcha-addurl' => 'ویرایش شما حاوی پیوند به بیرون جدیدی است. -برای کمک به جلوگیری از هرزنگاری خودکار، لطفاً واژه‌ای را که در تصویر می‌بینید در جعبه وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', # Fuzzy +برای جلوگیری از هرزنگاری خودکار ویکی، ما با احترام از شما می‌خواهیم واژه‌ای را که در تصویر می‌بینید در جعبهٔ زیر وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', 'fancycaptcha-badlogin' => 'برای کمک به جلوگیری از شکستن خودکار گذرواژه، لطفاً واژه‌ای را که در تصویر می‌بینید را وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', - 'fancycaptcha-createaccount' => 'برای کمک به جلوگیری از ایجاد خودکار حساب کاربری، لطفاً واژه‌ای را که در تصویر می‌بینید وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', # Fuzzy + 'fancycaptcha-createaccount' => 'برای کمک به جلوگیری از ایجاد خودکار حساب کاربری، ما با احترام از شما می‌خواهید واژه‌ای را که در تصویر می‌بینید را در جعبهٔ زیر وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', 'fancycaptcha-create' => 'برای ایجاد این صفحه، لطفاً واژه‌ای را که در تصویر می‌بینید وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', 'fancycaptcha-edit' => 'برای ویرایش این صفحه، لطفاً واژه‌ای را که در تصویر می‌بینید وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', - 'fancycaptcha-sendemail' => 'برای کمک به محافظت در برابر هرزه‌نگاری خودکار، لطفاً واژه‌هایی را که در جعبهٔ زیر نمایش داده می‌شوند وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', # Fuzzy - 'fancycaptcha-reload-text' => 'تازه کردن', + 'fancycaptcha-sendemail' => 'برای کمک به محافظت در برابر هرزه‌نگاری خودکار، ما با احترام از شما می‌خواهیم واژه‌هایی را که در جعبهٔ زیر نمایش داده می‌شوند وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', + 'fancycaptcha-reload-text' => 'تازه‌کردن', ); /** Finnish (suomi) @@ -594,18 +602,19 @@ Zum Schutz vor automatisiertem Spamming gib des Wort in s Fäld unten yy. Druck ); /** Gujarati (ગુજરાતી) + * @author Ashok modhvadia * @author Dsvyas * @author Sushant savla */ $messages['gu'] = array( - 'fancycaptcha-addurl' => 'તમારા ફેરફારમાં નવી બાહ્ય કડીઓ શામિલ છે. -તમે કરેલા ફેરફારોમાં નવી બાહ્ય કડીઓ સામેલ છે. સ્વચાલિત સ્પેમ/સ્પામ(spam) થી બચવા માટે નીચે આપેલા સરળ દાખલાનો જવાબ તેની બાજુના ખાનામાં લખો -([[Special:Captcha/help|more info]]):', # Fuzzy - 'fancycaptcha-badlogin' => 'આપોઆપ થતી ગુપ્તસંજ્ઞાની ચોરી (password cracking)થી બચાવવા માટે નીચે આપેલા શબ્દ તેની બાજુના ખાનામાં લખો ([[Special:Captcha/help|more info]]):', # Fuzzy - 'fancycaptcha-createaccount' => 'આપોઆપ નવા ખાતા ખુલતા રોકવા માટે નીચે દેખાતા શબ્દો ખાનામાં લખો ([[Special:Captcha/help|વધુ માહિતી]]):', # Fuzzy + 'fancycaptcha-addurl' => 'તમે કરેલા ફેરફારોમાં નવી બાહ્ય કડીઓ સામેલ છે. +વિકિને સ્વચાલિત સ્પેમ/સ્પામ(spam)થી બચાવવા માટે અમે તમને જણાવીએ છીએ કે કૃપયા નીચે આપેલા સરળ દાખલાનો જવાબ તેની બાજુના ખાનામાં લખો. +([[Special:Captcha/help|વધુ વિગત]]):', + 'fancycaptcha-badlogin' => 'આપોઆપ થતી ગુપ્તસંજ્ઞાની ચોરી (password cracking)થી વિકિને બચાવવા માટે અમે તમને જણાવીએ છીએ કે કૃપયા નીચે આપેલા શબ્દ તેની બાજુના ખાનામાં લખો. ([[Special:Captcha/help|વધુ વિગત]]):', + 'fancycaptcha-createaccount' => 'આપોઆપ નવા ખાતા ખુલતા રોકવા અને વિકીને તેનાથી બચાવવા માટે. અમે તમને જણાવીએ છીએ કે કૃપયા નીચે દેખાતા શબ્દો ખાનામાં લખો. ([[Special:Captcha/help|વધુ માહિતી]]):', 'fancycaptcha-create' => 'પાનું બનાવવા માટે નીચે દેખાતા શબ્દો ખાનામાં ટાઈપ કરો ([[Special:Captcha/help|વધુ માહિતી]]):', 'fancycaptcha-edit' => 'આ પાનામાં ફેરફાર કરવા માટે નીચે દેખાતા શબ્દો ખાનામાં ટાઈપ કરો ([[Special:Captcha/help|વધુ માહિતી]]):', - 'fancycaptcha-sendemail' => 'આપોઆપ થતી સ્પૅમીંગથી બચાવવા માટે નીચે આપેલા શબ્દ તેની બાજુના ખાનામાં લખો ([[Special:Captcha/help|more info]]):', # Fuzzy + 'fancycaptcha-sendemail' => 'વિકિને આપોઆપ થતી સ્પૅમીંગથી બચાવવા માટે. અમે તમને જણાવીએ છીએ કે કૃપયા નીચે આપેલા શબ્દ તેની બાજુના ખાનામાં લખો ([[Special:Captcha/help|વધુ માહિતી]]):', ); /** Hebrew (עברית) @@ -657,12 +666,13 @@ slova koja vidite na slici dolje:
      ([[Special:Captcha/help|Pomoć]])', * @author Michawiki */ $messages['hsb'] = array( - 'fancycaptcha-addurl' => 'W twojej změnje su nowe eksterne wotkazy. Jako škitna naprawa přećiwo awtomatiskemu spamej zapodaj prošu sćěhowace znamješka do kašćika ([[Special:Captcha/help|čehodla?]]).', # Fuzzy - 'fancycaptcha-badlogin' => 'Jako škitna naprawa přećiwo awtomatiskemu zadobywanju do wužiwarskich kontow zapodaj prošu sćěhowace znamješka do kašćika ([[Special:Captcha/help|čehodla?]]):', # Fuzzy - 'fancycaptcha-createaccount' => 'Jako škitna naprawa přećiwo awtomatiskemu wutworjenju wužiwarskich kontow zapodaj prošu sćěhowace znamješka do kašćika ([[Special:Captcha/help|čehodla?]]):', # Fuzzy + 'fancycaptcha-addurl' => 'W twojej změnje su nowe eksterne wotkazy. Jako škitnu naprawu přećiwo awtomatiskemu spamej zapodaj prošu slědowace znamješka do kašćika ([[Special:Captcha/help|dalše informacije]]):', + 'fancycaptcha-badlogin' => 'Zo by wiki přećiwo awtomatiskemu kradnjenju hesłow škitał, prosymy će, slědowace słowa do kašćika zapisować ([[Special:Captcha/help|dalše informacije]]):', + 'fancycaptcha-createaccount' => 'Jako škitna naprawa přećiwo awtomatiskemu wutworjenju wužiwarskich kontow, zapodaj prošu slědowace słowa do kašćika ([[Special:Captcha/help|dalše informacije]]):', 'fancycaptcha-create' => 'Zo by stronu wutworić móhł zapodaj prošu sćěhowace znamješka do kašćika ([[Special:Captcha/help|čehodla?]]):', 'fancycaptcha-edit' => 'Zo by stronu wobdźěłować móhł zapodaj prošu sćěhowace znamješka do kašćika ([[Special:Captcha/help|čehodla?]]):', - 'fancycaptcha-sendemail' => 'Za škit přećiwo awtomatiskemu spamowanju, zapodaj prošu słowa, kotrež so deleka w kašćiku jewi ([[Special:Captcha/help|dalše informacije]]):', # Fuzzy + 'fancycaptcha-sendemail' => 'Za škit přećiwo awtomatiskemu spamowanju, zapodaj prošu słowa, kotrež so deleka w kašćiku jewja ([[Special:Captcha/help|dalše informacije]]):', + 'fancycaptcha-reload-text' => 'Aktualizować', ); /** Hungarian (magyar) @@ -711,13 +721,13 @@ $messages['id'] = array( * @author Lam-ang */ $messages['ilo'] = array( - 'fancycaptcha-addurl' => 'Ti inurnos mo ket adda nagyan na a baro a panilpo ti ruar. -Tapno masalakniban kadagiti automatiko a spam, pangaasim nga ikabil ti balikas nga agparang dita baba a kahon. ([[Special:Captcha/help|adu pay a pakaammo]]):', # Fuzzy - 'fancycaptcha-badlogin' => 'Tapno masalakniban kadagiti automatiko a pinagsulbar ti kontrasenias, pangaasim nga ikabil ti balikas nga agparang dita baba a kahon. ([[Special:Captcha/help|adu pay a pakaammo]]):', # Fuzzy - 'fancycaptcha-createaccount' => 'Tapno makasalaknib kadagiti automatiko a pinagaramid ti pakabilangan, pangaasim nga ikabil ti balikas nga agparang dita baba a kahon. ([[Special:Captcha/help|adu pay a pakaammo]]):', # Fuzzy + 'fancycaptcha-addurl' => 'Dagiti inurnosmo ket aglaon kadagiti baro a silpo ti ruar. +Tapno masalakniban ti wiki kadagiti automatiko nga spam, naemmakami nga agdawat nga ikabilmo dagiti balikas nga agparang dita baba iti kahon ([[Special:Captcha/help|adu pay a pakaammo]]):', + 'fancycaptcha-badlogin' => 'Tapno masalakniban kadagiti automatiko a panagsulbar ti kontrasenias, naemmakami nga agdawat nga ikabilmo dagiti balikas nga agparang dita baba iti kahon ([[Special:Captcha/help|adu pay a pakaammo]]):', + 'fancycaptcha-createaccount' => 'Tapno makasalakniban ti wiki kadagiti automatiko a panagpartuat ti pakabilangan, naemmakami nga agdawat nga ikabilmo dagiti balikas nga agparang dita baba iti kahon ([[Special:Captcha/help|adu pay a pakaammo]]):', 'fancycaptcha-create' => 'Tapno makaaramid ti panid, pangaasim nga ikabil ti balikas nga agparang dita baba a kahon. ([[Special:Captcha/help|adu pay a pakaammo]]):', 'fancycaptcha-edit' => 'Tapno makaurnos daytoy a panid, pangaasim nga ikabil ti balikas nga agparang dita baba a kahon. ([[Special:Captcha/help|adu pay a pakaammo]]):', - 'fancycaptcha-sendemail' => 'Tapno makasalaknib kadagiti automatiko a pinagspam, pangaasim nga ikabil ti balikas nga agparang dita baba a kahon. ([[Special:Captcha/help|adu pay a pakaammo]]):', # Fuzzy + 'fancycaptcha-sendemail' => 'Tapno makasalakniban ti wiki kadagiti automatiko a panag-spam, naemmakami nga agdawat nga ikabilmo dagiti balikas nga agparang dita baba iti kahon ([[Special:Captcha/help|adu pay a pakaammo]]):', 'fancycaptcha-reload-text' => 'Pasadiwaen', ); @@ -770,11 +780,12 @@ $messages['ja'] = array( ); /** Jutish (jysk) + * @author Christian List * @author Huslåke */ $messages['jut'] = array( 'fancycaptcha-addurl' => 'Din ændring tilføjer nye eksterne henvisninger. For at beskytte mod automatiseret spam, skal du indtaste ordet som vises nedenfor i feltet under det. ([[Special:Captcha/help|mere information]]):', # Fuzzy - 'fancycaptcha-badlogin' => 'For at beskytte mod automatiske forsøg på at gætte kodeord, skal du indtaste ordet som vises nedenfor i feltet under det. ([[Special:Captcha/help|mere information]]):', # Fuzzy + 'fancycaptcha-badlogin' => 'For at beskytte mod automatiske forsøg på at gætte adgangskoden, skal du indtaste ordet som vises i feltet nedenfor. ([[Special:Captcha/help|mere information]]):', 'fancycaptcha-createaccount' => 'For at beskytte mod automatisk oprettelse af brugernavne, der bruges til spam, skal du indtaste ordet som vises nedenfor i feltet under det. ([[Special:Captcha/help|mere information]]):', # Fuzzy 'fancycaptcha-create' => 'For at oprette en ny side, skal du indtaste ordet som vises nedenfor i feltet under det. ([[Special:Captcha/help|mere information]]):', 'fancycaptcha-edit' => 'or at redigere denne side @@ -782,28 +793,33 @@ $messages['jut'] = array( ); /** Javanese (Basa Jawa) + * @author Bennylin * @author Meursault2004 */ $messages['jv'] = array( - 'fancycaptcha-addurl' => 'Suntingan panjenengan iku ngandhut pranala jaba anyar. Kanggo pangreksan marang spam otomatis, mangga lebokna tembung sing kapacak ing ngisor iki ing kothak sing wis cumepak ([[Special:Captcha/help|info jangkep]]):', # Fuzzy - 'fancycaptcha-badlogin' => 'Kanggo ngréwangi pangreksan marang parengkahan kunci sandhi otomatis, mangga lebokna tembung sing kapacak ing ngisor iki ing kothak sing wis cumepak ([[Special:Captcha/help|info jangkep]]):', # Fuzzy - 'fancycaptcha-createaccount' => 'Minangka pangreksan marang rékening (akun) sing digawé otomatis, tulung lebokna tembung sing kapacak ing ngisor iki ing kothak sing wis cumepak ([[Special:Captcha/help|info jangkep]]):', # Fuzzy + 'fancycaptcha-addurl' => 'Suntingan panjenengan iku ngandhut pranala jaba anyar. Kanggo pangreksan marang spam otomatis, mangga lebokna tembung sing kapacak ing ngisor iki ing kothak sing wis cumepak ([[Special:Captcha/help|info jangkep]]):', + 'fancycaptcha-badlogin' => 'Kanggo ngreksa lawan parengkahan tembung sandhi otomatis, tulung lebokna ukara ing ngisor iki menyang sajroning kothak sing wis sumedya ([[Special:Captcha/help|info sabanjuré]]):', + 'fancycaptcha-createaccount' => 'Kanggo ngreksa lawan panggawéyan rékening (akun) otomatis, tulung lebokna ukara ing ngisor iki menyang sajroning kothak ([[Special:Captcha/help|info sabanjuré]]):', 'fancycaptcha-create' => 'Suntingan panjenengan ngandhut pranala jaba anyar. Kanggo nggawé kaca iki, mangga isèkna tembung-tembung sing ana ing kothak iki ([[Special:Captcha/help|info jangkep]]):', 'fancycaptcha-edit' => 'Suntingan panjenengan ngandhut pranala jaba anyar. Kanggo nyunting kaca iki, mangga isèkna tembung-tembung sing ana ing kothak iki ([[Special:Captcha/help|info jangkep]]):', + 'fancycaptcha-sendemail' => 'Kanggo ngreksa lawan spam otomatis, tulung lebokna ukara ing ngisor iki menyang sajroning kothak sing wis sumedya ([[Special:Captcha/help|info sabanjuré]]):', + 'fancycaptcha-reload-text' => 'Anyarana', ); /** Georgian (ქართული) * @author David1010 * @author ITshnik + * @author Tokoko */ $messages['ka'] = array( 'fancycaptcha-addurl' => 'თქვენი ცვლილება შეიცავს ახალ გარე ბმულებს. -ავტომატური სპამინგისგან თავდაცვის მიზნით, გთხოვთ, შეიყვანოთ ქვემოთ მოცემული სიტყვები ყუთში ([[Special:Captcha/help|მეტი ინფორმაცია]]):', # Fuzzy - 'fancycaptcha-badlogin' => 'პაროლების ავტომატური გატეხვისგან თავდაცვის მიზნით, გთხოვთ, შეიყვანოთ ქვემოთ მოცემული სიტყვები ყუთში ([[Special:Captcha/help|მეტი ინფორმაცია]]):', # Fuzzy - 'fancycaptcha-createaccount' => 'ანგარიშების ავტომატური რეგისტრაციისაგან თავდაცვის მიზნით, გთხოვთ, შეიყვანოთ ნაჩვენები სიმბოლოები ტექსტურ ველში ([[Special:Captcha/help|დეტალურად]]):', # Fuzzy +ვიკის ავტომატური სპამინგისგან თავდაცვის მიზნით, ჩვენ მოგიწოდებთ, შეიყვანოთ ქვემოთ მოცემული სიტყვები ყუთში ([[Special:Captcha/help|მეტი ინფორმაცია]]):', + 'fancycaptcha-badlogin' => 'ვიკის პაროლების ავტომატური გატეხვისგან თავდაცვის მიზნით, ჩვენ მოგიწოდებთ, შეიყვანოთ ქვემოთ მოცემული სიტყვები ყუთში ([[Special:Captcha/help|მეტი ინფორმაცია]]):', + 'fancycaptcha-createaccount' => 'ვიკის ანგარიშების ავტომატური რეგისტრაციისაგან თავდაცვის მიზნით, ჩვენ მოგიწოდებთ, შეიყვანოთ ნაჩვენები სიმბოლოები ტექსტურ ველში ([[Special:Captcha/help|დეტალურად]]):', 'fancycaptcha-create' => 'გვერდის შესაქმნელად, გთხოვთ, შეიყვანეთ ასოები, რომლებიც ნაჩვენებია ქვედა სურათზე ([[Special:Captcha/help|დეტალურად…]]):', 'fancycaptcha-edit' => 'გვერდის რედაქტირებისათვის, გთხოვთ, შეიყვანეთ ასოები, რომლებიც ნაჩვენებია ქვედა სურათზე ([[Special:Captcha/help|დეტალურად…]]):', - 'fancycaptcha-sendemail' => 'ავტომატური სპამისაგან თავდაცვის მიზნით, გთხოვთ, შეიყვანოთ ქვევით ნაჩვენები სიტყვა ტექსტურ ველში ([[Special:Captcha/help|მეტი ინფორმაცია]]):', # Fuzzy + 'fancycaptcha-sendemail' => 'ვიკის ავტომატური სპამისაგან თავდაცვის მიზნით, ჩვენ მოგიწოდებთ, შეიყვანოთ ქვევით ნაჩვენები სიტყვა ტექსტურ ველში ([[Special:Captcha/help|მეტი ინფორმაცია]]):', + 'fancycaptcha-reload-text' => 'განახლება', ); /** Kara-Kalpak (Qaraqalpaqsha) @@ -868,9 +884,9 @@ tömendegi körsetilgen sözderdi awmaqqa engiziñiz ([[{{ns:special}}:Captcha/h $messages['km'] = array( 'fancycaptcha-addurl' => 'កំណែប្រែរបស់អ្នកមានតំណភ្ជាប់ខាងក្រៅ។ -ដើម្បីការពារពីស្ប៉ាម(spam)ស្វ័យប្រវត្តិ សូមបញ្ជូលពាក្យខាងក្រោមទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', # Fuzzy - 'fancycaptcha-badlogin' => 'ដើម្បីការពារការបំបែកពាក្យសំងាត់ដោយស្វ័យប្រវត្តិ សូមបញ្ជូលពាក្យខាងក្រោមទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', # Fuzzy - 'fancycaptcha-createaccount' => 'ដើម្បីការពារការបង្កើតគណនីដោយស្វ័យប្រវត្តិ សូមបញ្ជូលពាក្យខាងក្រោមទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', # Fuzzy +ដើម្បីការពារពីស្ប៉ាមស្វ័យប្រវត្តិ សូមបញ្ជូលពាក្យខាងក្រោមទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', + 'fancycaptcha-badlogin' => 'ដើម្បីការពារការបំបែកពាក្យសម្ងាត់ដោយស្វ័យប្រវត្តិ សូមបញ្ជូលពាក្យខាងក្រោមទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', + 'fancycaptcha-createaccount' => 'ដើម្បីការពារការបង្កើតគណនីដោយស្វ័យប្រវត្តិ សូមបញ្ជូលពាក្យខាងក្រោមទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', 'fancycaptcha-create' => 'ដើម្បីបង្កើតទំព័រនេះ សូមបញ្ជូលពាក្យខាងក្រោមទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', 'fancycaptcha-edit' => 'ដើម្បីកែប្រែទំព័រនេះ សូមបញ្ជូលពាក្យខាងក្រោមទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', ); @@ -904,20 +920,21 @@ $messages['krc'] = array( */ $messages['ksh'] = array( 'fancycaptcha-desc' => 'Määt e nett Käptsche för dä Confirm Edit Projramm-Zohsatz', - 'fancycaptcha-addurl' => 'Do häß neu Lingks op frembde Websigge dobei jedonn. -Mer schöze uns Wiki jäje automatesche SPAM, dröm -don di Wööter en dat Käßje endraare. (Verklierung)', # Fuzzy + 'fancycaptcha-addurl' => 'Do häß neuje Lengks op frembde Websigge dobei jedonn. +Mer schöze ons Wiki jäje automattesche SPAM, dröm +don di Wööter en dat Käßje endraare. ([[Special:Captcha/help|Verklierung]])', 'fancycaptcha-badlogin' => 'Mer schöze Metmaacher en unsem Wiki jäje automatesche Paßwoot-Knackerei, dröm don di Wööt onge en dat Käßje -endraare. (Verklierung)', # Fuzzy +endraare. ([[Special:Captcha/help|Verklierung]])', 'fancycaptcha-createaccount' => 'Mer schöze uns Wiki dojäje, dat mer en Masse automatesch -Metmaacher aanmeldt. Dröm beß esu joot un -don di Wööt onge en dat Käßje endraare. (Verklierung)', # Fuzzy +Metmaacher aanmeldt. +Dröm beß esu joot un +don di Wööt onge en dat Käßje endraare. ([[Special:Captcha/help|Verklierung]])', 'fancycaptcha-create' => 'Öm di Sigg neu aanzelääje, don di Wööt onge en dat Käßje endraare. (Verklierung)', 'fancycaptcha-edit' => 'Öm de Sigg ze ändere, don di Wööt onge en dat Käßje endraare. ([[Special:Captcha/help|Verklierung]])', - 'fancycaptcha-sendemail' => 'Öm et Wiki jääje automattesch enjedraare SPAM ze schötze, + 'fancycaptcha-sendemail' => 'Öm et Wiki jääje automattesch enjedraare SPAM ze schötze, bes esu joot, donn di Wööter enjävve, di en däm Käßje heh dronger shtonn. -([[Special:Captcha/help|Mieh Enfommazjuhne]])', # Fuzzy +([[Special:Captcha/help|Mieh Enfommazjuhne]])', 'fancycaptcha-reload-text' => 'Nöü Aanzeije!', ); @@ -1123,12 +1140,12 @@ As Schutz gegen automaatsch Spam, geev disse Bookstavenreeg in dat Feld ünnen i */ $messages['nds-nl'] = array( 'fancycaptcha-addurl' => "Joew bewarking bevat uutgaonde verwiezingen. -Um dit projekt te bescharmen tegen ongewunste reklame, mu'j t woord dat hieronder steet invullen ([[Special:Captcha/help|hulpe]]):", +Um dit projekt te bescharmen tegen automatiese spam, mu'j t woord dat hieronder steet invullen ([[Special:Captcha/help|hulpe]]):", 'fancycaptcha-badlogin' => "Um disse webstee te beveiligen tegen t kraken van wachtwoorden, mu'j de woorden die'j hieronder zien effen invullen ([[Special:Captcha/help|hulpe]]):", 'fancycaptcha-createaccount' => "Um disse wiki te bescharmen tegen t automaties anmaken van gebrukersprofielen mu'j t woord hieronder invullen ([[Special:Captcha/help|hulpe]]):", 'fancycaptcha-create' => "Um n pagina an te maken, mö'j t woord dat hieronder steet invullen ([[Special:Captcha/help|hulpe]]):", - 'fancycaptcha-edit' => "Joew bewarking bevat nieje uutgaonde verwiezingen. Um disse wiki te bescharmen tegen ongewunste reklame mö'j de woorden hieronder invullen ([[Special:Captcha/help|hulpe]]):", + 'fancycaptcha-edit' => 'Vul de woorden die hieronder staon in um disse zied te bewarken ([[Special:Captcha/help|hulpe]]):', 'fancycaptcha-sendemail' => 'Voer de woorden die hieronder staon in t invoerveld in as bescharming tegen automatiese ongewunste reklame ([[Special:Captcha/help|hulpe]]):', 'fancycaptcha-reload-text' => 'Verniejen', @@ -1147,7 +1164,7 @@ Voer de woorden die hieronder verschijnen in het invoerveld in als bescherming t 'fancycaptcha-create' => 'Voer de woorden die hieronder verschijnen in het invoerveld in om de pagina aan te maken ([[Special:Captcha/help|meer informatie]]):', 'fancycaptcha-edit' => 'Voer de woorden die hieronder verschijnen in het invoerveld in om deze pagina te bewerken ([[Special:Captcha/help|meer informatie]]):', 'fancycaptcha-sendemail' => 'Voer de woorden die hieronder getoond worden in het invoerveld in als bescherming tegen spam ([[Special:Captcha/help|meer informatie]]):', - 'fancycaptcha-reload-text' => 'Verversen', + 'fancycaptcha-reload-text' => 'Vernieuwen', ); /** Nederlands (informeel)‎ (Nederlands (informeel)‎) @@ -1207,12 +1224,12 @@ $messages['or'] = array( */ $messages['pl'] = array( 'fancycaptcha-desc' => 'Generator obrazka, którego odczytanie jest wymagane dla zatwierdzenia edycji.', - 'fancycaptcha-addurl' => 'Twoja edycja zawiera nowe linki zewnętrzne. Ze względu na ochronę przed zautomatyzowanym spamem prosimy o wpisanie słów, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|pomoc]]):', # Fuzzy - 'fancycaptcha-badlogin' => 'Ze względu na zabezpieczenie przed automatycznym łamaniem haseł prosimy o wpisanie słów, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|pomoc]]):', # Fuzzy - 'fancycaptcha-createaccount' => 'Ze względu na ochronę przed automatycznym spamem, aby się zarejestrować musisz wpisać słowo, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|pomoc]])', # Fuzzy + 'fancycaptcha-addurl' => 'Twoja edycja zawiera nowe linki zewnętrzne. Ze względu na ochronę przed zautomatyzowanym spamem prosimy o wpisanie słów, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|więcej informacji]]):', + 'fancycaptcha-badlogin' => 'Ze względu na ochronę przed automatycznym łamaniem haseł prosimy o wpisanie słów, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|więcej informacji]]):', + 'fancycaptcha-createaccount' => 'Ze względu na ochronę przed automatycznym tworzeniem kont prosimy o wpisanie słów, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|więcej informacji]])', 'fancycaptcha-create' => 'Aby utworzyć tę stronę, przepisz słowa, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|pomoc]]):', 'fancycaptcha-edit' => 'Aby edytować tę stronę, przepisz słowa, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|pomoc]]):', - 'fancycaptcha-sendemail' => 'Zabezpieczenie przed automatycznie dodawanym spamem. Wprowadzić słowa widoczne w poniższym prostokącie ([[Special:Captcha/help|więcej informacji]]).', # Fuzzy + 'fancycaptcha-sendemail' => 'Ze względu na ochronę przed zautomatyzowanym spamem prosimy o wpisanie słów, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|więcej informacji]]).', 'fancycaptcha-reload-text' => 'Odśwież', ); @@ -1282,6 +1299,14 @@ $messages['pt-br'] = array( 'fancycaptcha-reload-text' => 'Atualizar', ); +/** Quechua (Runa Simi) + * @author AlimanRuna + */ +$messages['qu'] = array( + 'fancycaptcha-create' => "P'anqata kamarinaykipaqqa kay qatiq kahachapi kaq rimakunata yaykuchiy ([[Special:Captcha/help|astawan yachay]]):", + 'fancycaptcha-edit' => "Kay p'anqata llamk'anaykipaqqa kay qatiq kahachapi kaq rimakunata yaykuchiy ([[Special:Captcha/help|astawan yachay]]):", +); + /** Romansh (rumantsch) * @author Kazu89 */ @@ -1309,13 +1334,13 @@ Pentru a împiedica roboții de spam, vă rugăm să introduceți cuvintele care * @author Joetaras */ $messages['roa-tara'] = array( - 'fancycaptcha-addurl' => "'U cangiamende tue inglude de le collegaminde esterne. -Pe aiutà a proteggere condre a 'u spam automateche, pe piacere mitte le parole ca combare sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", # Fuzzy - 'fancycaptcha-badlogin' => 'Pe aiutà a proteggere condre a futteminde automatece de password, pe piacere mitte le parole ca combare aqquà sotte ([[Special:Captcha/help|more info]]):', # Fuzzy - 'fancycaptcha-createaccount' => 'Pe aiutà a proteggere condre a ccreazione automateche de cunde utinde, pe piacere mitte le parole ca combare aqquà sotte ([[Special:Captcha/help|more info]]):', # Fuzzy + 'fancycaptcha-addurl' => "'U cangiamende tune 'nglude de le collegaminde de fore. +Pe proteggere condre a 'u spam automateche, pe piacere mitte le parole ca iessene sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", + 'fancycaptcha-badlogin' => "Pe proteggere condre a futteminde automatece de passuord, pe piacere mitte le parole ca iessene aqquà sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", + 'fancycaptcha-createaccount' => "Pe proteggere condre a ccreazione automateche de cunde utinde, pe piacere mitte le parole ca iessene aqquà sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", 'fancycaptcha-create' => 'Pe ccrejà sta pàgene, pe piacere mitte le parole ca combare aqquà sotte ([[Special:Captcha/help|more info]]):', 'fancycaptcha-edit' => 'Pe cangià sta pàgene, pe piacere mitte le parole combare aqquà sotte ([[Special:Captcha/help|more info]]):', - 'fancycaptcha-sendemail' => "Pe aiutà a proteggere condre a spam automatece, pe piacere mitte le parole ca combare aqquà sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", # Fuzzy + 'fancycaptcha-sendemail' => "Pe proteggere condre a spam automatece, pe piacere mitte le parole ca iessene aqquà sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", 'fancycaptcha-reload-text' => 'Aggiorne', ); @@ -1605,12 +1630,12 @@ Upang makatulong sa pagsasanggalang laban sa kusang pinapadalang mga \"manluluso */ $messages['tr'] = array( 'fancycaptcha-addurl' => 'Değişikliğiniz yeni dış bağlantılar içeriyor. -Otomatik spamdan korunmak için, lütfen aşağıdaki sözcükleri kutunun içine yazın ([[Special:Captcha/help|ayrıntılı bilgiler]]):', # Fuzzy - 'fancycaptcha-badlogin' => 'Otomatik parola kırma yöntemine karşı korunmak için lütfen aşağıdaki sözcükleri kutunun içine yazınız ([[Special:Captcha/help|ayrıntılı bilgi]]):', # Fuzzy - 'fancycaptcha-createaccount' => 'Otomatik hesap oluşturmaya karşı korumaya yardım etmek için, lütfen aşağıdaki kutuda görünen kelimeleri girin ([[Special:Captcha/help|daha fazla bilgi]]):', # Fuzzy +Vikiyi otomatik spamdan korumak için, aşağıdaki sözcükleri kutunun içine yazmanızı rica ediyoruz ([[Special:Captcha/help|ayrıntılı bilgi]]):', + 'fancycaptcha-badlogin' => 'Vikiyi otomatik parola kırma yöntemine karşı korumak için, aşağıdaki sözcükleri kutunun içine yazmanızı rica ediyoruz ([[Special:Captcha/help|ayrıntılı bilgi]]):', + 'fancycaptcha-createaccount' => 'Vikiyi otomatik hesap oluşturmaya karşı korumaya yardım etmek için, aşağıdaki sözcükleri kutunun içine yazmanızı rica ediyoruz ([[Special:Captcha/help|ayrıntılı bilgi]]):', 'fancycaptcha-create' => 'Sayfayı oluşturmak için, lütfen aşağıdaki kutuda görünen kelimeleri girin ([[Special:Captcha/help|daha fazla bilgi]]):', 'fancycaptcha-edit' => 'Bu sayfayı değiştirmek için, lütfen aşağıdaki kutuda görünen kelimeleri girin ([[Special:Captcha/help|daha fazla bilgi]]):', - 'fancycaptcha-sendemail' => 'Otomatik spamlerden korunmaya yardımcı olmak için, lütfen aşağıda görünen sözcükleri kutuya yazın ([[Special:Captcha/help|daha fazla bilgi]]):', # Fuzzy + 'fancycaptcha-sendemail' => 'Vikiyi otomatik spamlerden korumak için, aşağıdaki sözcükleri kutunun içine yazmanızı rica ediyoruz ([[Special:Captcha/help|ayrıntılı bilgi]]):', 'fancycaptcha-reload-text' => 'Yenile', ); @@ -1744,10 +1769,10 @@ $messages['zh-hans'] = array( $messages['zh-hant'] = array( 'fancycaptcha-addurl' => '您的編輯內容中含有本網站以外的連結。 為防止不當程式大量破壞,請輸入以下的文字([[Special:Captcha/help|相關資訊]]):', - 'fancycaptcha-badlogin' => '為防止不當程式破解密碼,請輸入以下的文字([[Special:Captcha/help|相關資訊]]):', # Fuzzy - 'fancycaptcha-createaccount' => '為防止不當程式大量建立帳戶,請輸入以下的文字([[Special:Captcha/help|相關資訊]]):', # Fuzzy + 'fancycaptcha-badlogin' => '為幫助wiki防範可自動破解密碼之不當程式,我們請您鍵入下面資訊框中的單詞([[Special:Captcha/help|相關資訊]]):', + 'fancycaptcha-createaccount' => '為幫助wiki防範可自動創建賬戶之不當程式,我們請您鍵入下面資訊框中的單詞([[Special:Captcha/help|相關資訊]]):', 'fancycaptcha-create' => '為防止不當程式大量建立頁面,請輸入以下的文字([[Special:Captcha/help|相關資訊]]):', 'fancycaptcha-edit' => '如您想要編輯此頁面,請輸入以下的文字([[Special:Captcha/help|相關資訊]]):', - 'fancycaptcha-sendemail' => '為防止不當程式進行破壞,請輸入以下的文字([[Special:Captcha/help|相關資訊]]):', # Fuzzy + 'fancycaptcha-sendemail' => '為幫助wiki防範垃圾電郵,我們請您鍵入下面資訊框中的單詞([[Special:Captcha/help|相關資訊]]):', 'fancycaptcha-reload-text' => '重新整理', ); diff --git a/extensions/ConfirmEdit/FancyCaptcha.php b/extensions/ConfirmEdit/FancyCaptcha.php index 46002e22..cbabb4a0 100644 --- a/extensions/ConfirmEdit/FancyCaptcha.php +++ b/extensions/ConfirmEdit/FancyCaptcha.php @@ -62,6 +62,7 @@ $wgAutoloadClasses['FancyCaptcha'] = $dir . '/FancyCaptcha.class.php'; $wgResourceModules['ext.confirmEdit.fancyCaptcha.styles'] = array( 'localBasePath' => $dir . '/resources', 'remoteExtPath' => 'ConfirmEdit/resources', + 'targets' => array( 'mobile', 'desktop' ), 'styles' => 'ext.confirmEdit.fancyCaptcha.css', ); @@ -72,5 +73,15 @@ $wgResourceModules['ext.confirmEdit.fancyCaptcha'] = array( 'dependencies' => 'mediawiki.api', ); +// FIXME: remove, add mobile target to ext.confirmEdit.fancyCaptcha and update +// MobileFrontend accordingly when bug 57629 is resolved +$wgResourceModules['ext.confirmEdit.fancyCaptchaMobile'] = array( + 'localBasePath' => $dir . '/resources', + 'remoteExtPath' => 'ConfirmEdit/resources', + 'scripts' => 'ext.confirmEdit.fancyCaptcha.js', + 'targets' => array( 'mobile', 'desktop' ), + 'dependencies' => 'mobile.startup', +); + $wgAutoloadClasses['ApiFancyCaptchaReload'] = $dir . '/ApiFancyCaptchaReload.php'; $wgAPIModules['fancycaptchareload'] = 'ApiFancyCaptchaReload'; diff --git a/extensions/ConfirmEdit/HTMLCaptchaField.php b/extensions/ConfirmEdit/HTMLCaptchaField.php deleted file mode 100644 index c069ce9e..00000000 --- a/extensions/ConfirmEdit/HTMLCaptchaField.php +++ /dev/null @@ -1,81 +0,0 @@ -prefix = $params['prefix']; - } - } - - /** - * Get the captcha body. Don't include any of the surrounding table cells/rows - * - * @param $value String - * @return String - */ - public function getInputHTML( $value ) { - # TODO - } - - public function validate( $data, $alldata ) { - // We sent back the exists status of the captcha before. If it *doesn't* exist - // we actually want to validate this as true, because we don't want an angry red - // error message, just for the user to put the captcha in again - if ( $data === false ) { - return true; - } - } - - /** - * @param $request WebRequest - * @return void - */ - public function loadDataFromRequest( $request ) { - $this->captcha = Captcha::factory(); - $this->captcha->loadFromRequest( $request, $this ); - if ( !$this->captcha->exists() ) { - // The captcha doesn't exist; probably because it's already been used and - // then deleted for security. Load the field up with a new captcha which - // will be shown to the user when the validation of said new object fails - $this->captcha = Captcha::newRandom(); - } - - // This will be useful as the difference between "the captcha doesn't exist" and - // "you answered the captcha wrongly" - return $this->captcha->exists(); - } -} diff --git a/extensions/ConfirmEdit/QuestyCaptcha.i18n.php b/extensions/ConfirmEdit/QuestyCaptcha.i18n.php index ddf2ab6a..12d372a3 100644 --- a/extensions/ConfirmEdit/QuestyCaptcha.i18n.php +++ b/extensions/ConfirmEdit/QuestyCaptcha.i18n.php @@ -208,17 +208,17 @@ Per ajudar a protegir-se contra la brossa automàtica, responeu la pregunta que 'questycaptcha-create' => 'Per crear la pàgina, per favor responeu la pregunta que apareix a continuació ([[Special:Captcha/help|més informació]]):', ); -/** Czech (česky) +/** Czech (čeština) * @author Mormegil */ $messages['cs'] = array( 'questycaptcha-addurl' => 'Vaše editace obsahuje nové externí odkazy. -V zájmu ochrany před automatickým spamováním musíte zodpovědět níže uvedenou otázku ([[Special:Captcha/help|další informace]]):', # Fuzzy - 'questycaptcha-badlogin' => 'V rámci ochrany proti automatickým pokusům uhodnout heslo musíte zodpovědět níže uvedenou otázku ([[Special:Captcha/help|další informace]]):', # Fuzzy - 'questycaptcha-createaccount' => 'V rámci ochrany před automatickým vytvářením účtů musíte pro provedení registrace zodpovědět níže uvedenou otázku ([[Special:Captcha/help|další informace]]):', # Fuzzy +V zájmu ochrany této wiki před automatickým spamováním vás prosíme o zodpovězení níže uvedené otázky ([[Special:Captcha/help|další informace]]):', + 'questycaptcha-badlogin' => 'V zájmu ochrany této wiki proti automatickým pokusům uhodnout heslo vás prosíme o zodpovězení níže uvedené otázky ([[Special:Captcha/help|další informace]]):', + 'questycaptcha-createaccount' => 'V zájmu ochrany této wiki před automatickým vytvářením účtů vás prosíme o zodpovězení níže uvedené otázky ([[Special:Captcha/help|další informace]]):', 'questycaptcha-create' => 'Abyste mohli založit stránku, musíte zodpovědět níže uvedenou otázku ([[Special:Captcha/help|další informace]]):', 'questycaptcha-edit' => 'Abyste mohli editovat tuto stránku, musíte zodpovědět níže uvedenou otázku ([[Special:Captcha/help|další informace]]):', - 'questycaptcha-sendemail' => 'V rámci ochrany proti automatickému spamování musíte zodpovědět níže zobrazenou otázku ([[Special:Captcha/help|více informací]]):', # Fuzzy + 'questycaptcha-sendemail' => 'V zájmu ochrany této wiki před automatickým spamováním vás prosíme o zodpovězení níže uvedené otázky ([[Special:Captcha/help|další informace]]):', 'questycaptchahelp-text' => 'Webové stránky, do kterých mohou přispívat jejich návštěvníci (jako například tato wiki), jsou často terčem spammerů, kteří pomocí automatických nástrojů vkládají své odkazy na velké množství stránek. Přestože lze tento spam odstranit, představuje nepříjemné obtěžování. Někdy, zvláště při přidávání nových webových odkazů, vás wiki může požádat o zodpovězení otázky. @@ -303,12 +303,12 @@ Der „Zurück“-Knopf des Browsers führt zurück zum Bearbeitungsfenster.', # */ $messages['dsb'] = array( 'questycaptcha-addurl' => 'Twója změna wopśimujo nowe eksterne wótkaze. -Za šćit pśeśiwo zawtomatizěrowanemu spamoju, wótegroń pšosym na pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', # Fuzzy - 'questycaptcha-badlogin' => 'Za šćit pśeśiwo zawtomatizěrowanemu wusnuchlenjeju gronidła, wótegroń pšosym na pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', # Fuzzy - 'questycaptcha-createaccount' => 'Za šćit pśeśiwo zawtomatizěrowanemu napóranjeju kontow, wótegroń pšosym na pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', # Fuzzy +Aby wiki pśeśiwo zawtomatizěrowanemu spamoju šćitał, wótegroń pšosym na pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', + 'questycaptcha-badlogin' => 'Aby wiki pśeśiwo zawtomatizěrowanemu wusnuchlenjeju gronidła šćitał, wótegroń pšosym na pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', + 'questycaptcha-createaccount' => 'Aby wiki pśeśiwo zawtomatizěrowanemu napóranjeju kontow šćitał, wótegroń pšosym na pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', 'questycaptcha-create' => 'Aby napórał bok, wótegroń pšosym na pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', 'questycaptcha-edit' => 'Aby wobźěłał toś ten bok, wótegroń pšosym na pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', - 'questycaptcha-sendemail' => 'Za šćit pśeśiwo awtomatiskemu spamowanjeju, wótegroń pšosym pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', # Fuzzy + 'questycaptcha-sendemail' => 'Aby wiki pśeśiwo awtomatiskemu spamowanjeju šćitał, wótegroń pšosym pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', 'questycaptchahelp-text' => 'Websedła, kótarež akceptěruju zjawne pśinoski, ako toś ten wiki, znjewužywaju se cesto wót spamowarjow, kótarež wužywaju zawtomatizěrowane rědy, aby pśidali swóje wótkaze na wjele sedłow. Lěcrownož toś te spamowe wótkaze daju se wótpóraś, su wóne bejna pógóršota. Wótergi, wósebnje, gaž se nowe wótkaze pśidawaju bokoju, jo móžno, až se śi wiki něco pšaša. @@ -557,12 +557,12 @@ $messages['he'] = array( */ $messages['hsb'] = array( 'questycaptcha-addurl' => 'Twoja změna wobsahuje nowe eksterne wotkazy. -Za škit přećiwo awtomatizowanemu spamej, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', # Fuzzy - 'questycaptcha-badlogin' => 'Za škit přećiwo awtomatiskemu kradnjenju hesła, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', # Fuzzy - 'questycaptcha-createaccount' => 'Za škit přećiwo awtomatizowanemu tworjenju kontow, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalš informacije]]):', # Fuzzy +Za škit přećiwo awtomatizowanemu spamej, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', + 'questycaptcha-badlogin' => 'Za škit přećiwo awtomatiskemu kradnjenju hesła, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', + 'questycaptcha-createaccount' => 'Za škit přećiwo awtomatizowanemu tworjenju kontow, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', 'questycaptcha-create' => 'Zo by stronu wutworił, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', 'questycaptcha-edit' => 'Zo by tutu stronu změnił, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', - 'questycaptcha-sendemail' => 'Za škit přećiwo awtomatiskemu spamowanju, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', # Fuzzy + 'questycaptcha-sendemail' => 'Za škit přećiwo awtomatiskemu spamowanju, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', 'questycaptchahelp-text' => 'Websydła, kotrež přinoški ze zjawnosće akceptuja, kaž tutón wiki, so často wot spamarjow znjewužiwaja, kotřiž awtomatizowane nastroje wužiwaja, zo bychu swoje wotkazy wjele sydłam přidali. Hačrunjež so tute spamowe wotkazy hodźa wotstronić, su wone njesnadne mjerzanje. Druhdy, wosebje, hdyž so nowe webwotkazy stronje přidawaja, wiki so ći něčeho praša. @@ -715,17 +715,18 @@ $messages['ja'] = array( /** Korean (한국어) * @author Kwj2772 + * @author Priviet * @author 아라 */ $messages['ko'] = array( 'questycaptcha-desc' => '편집 확인에 대한 탐구적인 CAPCHA(캡차) 생성기', - 'questycaptcha-addurl' => '편집에 새로운 바깥 링크가 포함되어 있습니다. -자동화된 스팸으로부터 보호하기 위해, 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', # Fuzzy - 'questycaptcha-badlogin' => '자동화된 비밀번호 깨기로부터 보호하기 위해, 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', # Fuzzy - 'questycaptcha-createaccount' => '자동화된 계정 만들기로부터 보호하기 위해, 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', # Fuzzy + 'questycaptcha-addurl' => '편집에 새로운 바깥 고리가 포함되어 있습니다. +자동 편집 스팸으로부터 보호하기 위해, 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', + 'questycaptcha-badlogin' => '자동 비밀번호 크래킹으로부터 보호하기 위해, 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', + 'questycaptcha-createaccount' => '자동 계정 만들기로부터 보호하기 위해, 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', 'questycaptcha-create' => '문서를 만드려면 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', 'questycaptcha-edit' => '이 문서를 편집하려면 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', - 'questycaptcha-sendemail' => '자동화된 스팸으로부터 보호하기 위해, 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', # Fuzzy + 'questycaptcha-sendemail' => '자동 스팸으로부터 보호하기 위해, 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', 'questycaptchahelp-text' => '이 위키와 같이 사람의 공개적인 참여가 가능한 웹 사이트에서는 자동 프로그램이 스팸을 뿌리는 경우가 있습니다. 물론 이러한 스팸은 제거할 수는 있지만 번거로운 작업이 늘어납니다. @@ -793,7 +794,7 @@ Fir d'Wiki géint automatesche Spam-Ännerungen ze schützen, froe mir Iech d'Fr 'questycaptcha-edit' => "Fir dës Säit z'änneren, beäntwert w.e.g. déi Fro hei ënnedrënner ([[Special:Captcha/help|méi Informatiounen]]):", 'questycaptcha-sendemail' => 'Fir ze hëllefe dës Wiki géint automatiséierte Spam ze schütze, beäntwert w.e.g. déi Fro hei ënnendrënner ([[Special:Captcha/help|méi Informatiounen]]):', 'questycaptchahelp-text' => "Websäiten, déi et jiddwerengem erlaben Ännerunge virzehuelen, sou wéi dës Wiki, ginn dacks vu sougenannte Spammer mëssbraucht, déi automatiséiert hir Linken op vill Internetsäite setzen. -Esou Spam-Linke kënne wuel geläscht ginn, mä si sinn trotzdem eng grouss Plo. +Sou Spam-Linke kënne wuel geläscht ginn, mä si sinn trotzdeem eng grouss Plo. Heiansdo, besonnesch wann nei Internet-Linken op eng Säit derbäigesat ginn, freet dës Wiki Iech eng Fro ze beäntwerten. Well dëst eng Aufgab ass déi schwéier z'automatiséieren ass, erlaabt dëst datt Mënschen hir Ännerunge kënnen agi während déi meescht Spammer an aner Roboter-Attacke kënnen ofgewiert ginn. @@ -837,7 +838,7 @@ $messages['mk'] = array( Контактирајте ги [[Special:ListAdmins|администраторите на страната]] за помош доколку ова неочекувано ве спречува во правењето на искрени придонеси. -Кликнете на копчето „назад“ во вашиот прелисувач за да се вратите на уредувањето на страницата.', +Стиснете на копчето „назад“ во вашиот прелисувач за да се вратите на уредувањето на страницата.', ); /** Malayalam (മലയാളം) @@ -1108,13 +1109,13 @@ Apăsați butonul „Înapoi” al navigatorului pentru a vă reîntoarce la pag * @author Joetaras */ $messages['roa-tara'] = array( - 'questycaptcha-addurl' => "'U cangiamende tue inglude de le collegaminde esterne. -Pe aiutà a proteggere condre a 'u spam automateche, pe piacere respunne a 'a domande ca combare sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", # Fuzzy - 'questycaptcha-badlogin' => "Pe aiutà a proteggere condre a futteminde automatece de password, pe piacere respunne a 'a domande ca combare aqquà sotte ([[Special:Captcha/help|more info]]):", # Fuzzy - 'questycaptcha-createaccount' => "Pe aiutà a proteggere condre a ccreazione automateche de cunde utinde, pe piacere respunne a 'a domande ca combare aqquà sotte ([[Special:Captcha/help|more info]]):", # Fuzzy + 'questycaptcha-addurl' => "'U cangiamende tune 'nglude de le collegaminde de fore. +Peproteggere condre a 'u spam automateche, pe piacere respunne a 'a domande ca iesse sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", + 'questycaptcha-badlogin' => "Pe proteggere condre a futteminde automatece de password, pe piacere respunne a 'a domande ca iesse aqquà sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", + 'questycaptcha-createaccount' => "Pe proteggere condre a ccreazione automateche de cunde utinde, pe piacere respunne a 'a domande ca iesse aqquà sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", 'questycaptcha-create' => "Pe ccrejà sta pàgene, pe piacere respunne a 'a domande ca combare aqquà sotte ([[Special:Captcha/help|more info]]):", 'questycaptcha-edit' => "Pe cangià sta pàgene, pe piacere respunne a 'a domande ca combare aqquà sotte ([[Special:Captcha/help|more info]]):", - 'questycaptcha-sendemail' => "Pe aiutà a proteggere condre a spam automatece, pe piacere respunne a 'a domande ca combare aqquà sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", # Fuzzy + 'questycaptcha-sendemail' => "Pe proteggere condre a spam automatece, pe piacere respunne a 'a domande ca iesse aqquà sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", 'questycaptchahelp-text' => "Le site web ca accettane condrebbute da 'u pubbleche, cumme sta Uicchi, sonde spesse abusate da le ''spammer'' ca ausane struminde automatece e aggiungene le lore collegaminde a 'nu sacche de site.
      Pure ca chiste collegaminde de spam ponne essere luate, lore sò sembre 'nu scassamende de palle.

      diff --git a/extensions/ConfirmEdit/ReCaptcha.i18n.php b/extensions/ConfirmEdit/ReCaptcha.i18n.php index 9e2c4781..5572656a 100644 --- a/extensions/ConfirmEdit/ReCaptcha.i18n.php +++ b/extensions/ConfirmEdit/ReCaptcha.i18n.php @@ -81,10 +81,10 @@ $messages['be-tarask'] = array( $messages['br'] = array( 'recaptcha-edit' => "Evit sikour en em wareziñ diouzh ar stroboù emgefre, merkit an daou c'her a welit er voest dindan :", 'recaptcha-addurl' => "Liamm diavaez nevez zo bet degaset ganeoc'h. Evit sikour en em wareziñ diouzh ar stroboù, merkit an daou c'her a welit er voest dindan :", - 'recaptcha-badlogin' => "Da sikour en em wareziñ diouzh an diskuliañ gerioù-tremen emgefre dre daolioù-esae, merkit an daou c'her a welit er voest dindan :", # Fuzzy - 'recaptcha-createaccount' => "Da sikour en em wareziñ diouzh ar c'hrouiñ kontoù emgefre, merkit an daou c'her a welit er voest dindan :", # Fuzzy + 'recaptcha-badlogin' => "Evit sikour da wareziñ ar wiki diouzh an diskuliañ gerioù-tremen emgefre dre daolioù-esae, merkit an daou c'her a welit er voest dindan :", + 'recaptcha-createaccount' => "Evit sikour d'en em wareziñ diouzh ar c'hrouiñ kontoù emgefre, merkit an daou c'her a welit er voest dindan :", 'recaptcha-createaccount-fail' => 'Respont reCAPTHCA faziek pe ezvezant.', - 'recaptcha-create' => "Da sikour en em wareziñ diouzh ar c'hrouiñ pajennoù emgefre, merkit an daou c'her a welit er voest dindan :", # Fuzzy + 'recaptcha-create' => "Evit sikour d'en em wareziñ diouzh ar c'hrouiñ pajennoù emgefre, merkit an daou c'her a welit er voest dindan :", ); /** Bosnian (bosanski) @@ -99,18 +99,18 @@ $messages['bs'] = array( 'recaptcha-create' => 'Da bismo pomogli protiv automatiziranog pravljenja stranica, molimo upišite dvije riječi koje vidite u kutiju ispod:', # Fuzzy ); -/** Czech (česky) +/** Czech (čeština) * @author Jkjk * @author Mormegil */ $messages['cs'] = array( 'recaptcha-desc' => 'Podpora reCAPTCHA pro rozšíření Confirm Edit', - 'recaptcha-edit' => 'V zájmu ochrany před automatickým spamováním opište dvě slova, která vidíte na obrázku:', # Fuzzy - 'recaptcha-addurl' => 'Vaše editace obsahuje nové externí odkazy. V zájmu ochrany před automatickým spamováním opište dvě slova, která vidíte na obrázku:', # Fuzzy - 'recaptcha-badlogin' => 'V zájmu ochrany proti automatickým pokusům uhodnout heslo opište dvě slova, která vidíte na obrázku:', # Fuzzy - 'recaptcha-createaccount' => 'V rámci ochrany před automatickým vytvářením účtů opište dvě slova, která vidíte na obrázku:', # Fuzzy + 'recaptcha-edit' => 'V zájmu ochrany této wiki před automatickým spamováním vás prosíme o opsání dvou slov, která vidíte v rámečku níže:', + 'recaptcha-addurl' => 'Vaše editace obsahuje nové externí odkazy. V zájmu ochrany této wiki před automatickým spamováním vás prosíme o opsání dvou slov, která vidíte v rámečku níže:', + 'recaptcha-badlogin' => 'V zájmu ochrany této wiki proti automatickým pokusům uhodnout heslo vás prosíme o opsání dvou slov, která vidíte v rámečku níže:', + 'recaptcha-createaccount' => 'V zájmu ochrany této wiki před automatickým vytvářením účtů vás prosíme o opsání dvou slov, která vidíte v rámečku níže:', 'recaptcha-createaccount-fail' => 'Nesprávná nebo chybějící odpověď na reCAPTCHA.', - 'recaptcha-create' => 'V zájmu ochrany před automatickým zakládáním stránek opište dvě slova, která vidíte na obrázku:', # Fuzzy + 'recaptcha-create' => 'V zájmu ochrany před automatickým zakládáním stránek vás prosíme o opsání dvou slov, která vidíte v rámečku níže:', ); /** Welsh (Cymraeg) @@ -166,6 +166,18 @@ $messages['es'] = array( 'recaptcha-create' => 'Para protegernos de la creación automática de páginas, escribe las dos palabras que ves en el cuadro de abajo:', # Fuzzy ); +/** Persian (فارسی) + * @author Armin1392 + */ +$messages['fa'] = array( + 'recaptcha-edit' => 'برای محافظت ویکی دربرابر ویرایش خودکار اسپم، ما دوستانه از شما درخواست می‌کنیم که دو کلمه‌ای را که در جعبهٔ زیر می‌بینید را بنویسید:', + 'recaptcha-addurl' => 'ویرایش شما شامل لینک‌های خارجی جدید است.برای محافظت ویکی دربرابر اسپم خودکار، ما دوستانه از شما درخواست می‌کنیم که دو کلمه‌ای را که در جعبهٔ زیر می‌بینید را بنویسید:', + 'recaptcha-badlogin' => 'برای محافظت ویکی دربرابر رخنهٔ رمز عبور به طور خودکار، ما دوستانه از شما درخواست می‌کنیم که دو کلمه‌ای را که در جعبهٔ زیر می‌بینید را بنویسید:', + 'recaptcha-createaccount' => 'برای محافظت ویکی دربرابر ایجاد حساب به طور خودکار، ما دوستانه از شما درخواست می‌کنیم که دو کلمه‌ای را که در جعبهٔ زیر می‌بینید را بنویسید:', + 'recaptcha-createaccount-fail' => 'پاسخ نادرست یا عدم وجود ری‌سی‌اِی‌پی‌تی‌سی‌اچ‌اِی.', + 'recaptcha-create' => 'برای محافظت ویکی دربرابر ایجاد صفحه به طور خودکار، ما دوستانه از شما درخواست می‌کنیم که دو کلمه‌ای را که در جعبهٔ زیر می‌بینید را بنویسید:', +); + /** Finnish (suomi) * @author Nedergard * @author VezonThunder @@ -182,8 +194,10 @@ $messages['fi'] = array( /** French (français) * @author Gomoko * @author Urhixidur + * @author Verdy p */ $messages['fr'] = array( + 'recaptcha-desc' => 'module reCAPTCHA pour Confirmer Modifier', 'recaptcha-edit' => 'Afin de protéger le wiki du spam des modifications automatisées, nous vous demandons de bien vouloir écrire les deux mots visibles dans le cadre ci-dessous :', 'recaptcha-addurl' => 'Votre contribution contient des liens vers un site externe. Pour protéger le wiki contre le spam automatisé, nous vous demandons de bien vouloir écrire les deux mots visibles dans le cadre qui suit :', 'recaptcha-badlogin' => 'Pour protéger le wiki des essais automatiques de cassage de mot de passe, nous vous demandons de bien vouloir écrire les deux mots visibles dans le cadre qui suit:', @@ -218,26 +232,27 @@ $messages['gsw'] = array( ); /** Hebrew (עברית) + * @author Yona b */ $messages['he'] = array( - 'recaptcha-edit' => 'אינכם משתמש רשום.כהגנה מפני ספאם אוטומטי, אנא הקלידו את שתי המילים שלהלן. תודה.', # Fuzzy - 'recaptcha-addurl' => 'אינכם משתמש רשום.כהגנה מפני ספאם אוטומטי, אנא הקלידו את שתי המילים שלהלן. תודה.', # Fuzzy - 'recaptcha-badlogin' => 'כהגנה מפני מפצחי סיסמאות אוטומטיים אנא הקלידו את שתי המילים שלהלן:', # Fuzzy - 'recaptcha-createaccount' => 'כהגנה מפני יצירת חשבונות פיקטיביים ע"י אוטומטים אנא הקלידו את שתי המילים שלהלן:', # Fuzzy + 'recaptcha-edit' => 'אינכם משתמש רשום. כהגנה מפני ספאם אוטומטי, אנא הקלידו את שתי המילים שלהלן. תודה.', + 'recaptcha-addurl' => 'עריכתכם כוללת קישורים חיצוניים חדשים. כהגנה מפני ספאם אוטומטי, אנא הקלידו את שתי המילים שלהלן. תודה.', + 'recaptcha-badlogin' => 'כהגנה מפני מפצחי סיסמאות אוטומטיים, אנא הקלידו את שתי המילים שלהלן:', + 'recaptcha-createaccount' => 'כהגנה מפני יצירה אוטומטית של חשבונות, נא הקלידו את שתי המילים שלהלן:', 'recaptcha-createaccount-fail' => 'לא הוקלדו מילות האישור, או שהוקלדו מילים לא נכונות. נסו שנית.', - 'recaptcha-create' => 'אינכם משתמש רשום.כהגנה מפני ספאם אוטומטי, אנא הקלידו את שתי המילים שלהלן. תודה.', # Fuzzy + 'recaptcha-create' => 'אינכם משתמש רשום. כהגנה מפני ספאם אוטומטי, אנא הקלידו את שתי המילים שלהלן. תודה.', ); /** Upper Sorbian (hornjoserbsce) * @author Michawiki */ $messages['hsb'] = array( - 'recaptcha-edit' => 'Za škit přećiwo awtomatizowanemu spamej, prošu zapisaj dwě słowje, kotrejž w slědowacym polu widźiš:', # Fuzzy - 'recaptcha-addurl' => 'Twoja změna wobsahuje nowe eksterne wotkazy. Za škit přećiwo awtomatizowanemu spamej, prošu zapisaj dwě słowje, kotrerjž w slědowacym polu widźiš:', # Fuzzy - 'recaptcha-badlogin' => 'Za škit přećiwo awtomatizowanemu złamanju hesłow, zapisaj prošu wobě słowje, kotrejž widźiš, do slědowaceho pola:', # Fuzzy - 'recaptcha-createaccount' => 'Za škit přećiwo awtomatiskemu wutworjenju konta, prošu zapisaj tej wobě słowje, kotrejž w slědowacym polu widźiš:', # Fuzzy + 'recaptcha-edit' => 'Zo by wiki přećiwo awtomatizowanemu spamej škitał, zapisaj prošu dwě słowje, kotrejž w slědowacym polu widźiš:', + 'recaptcha-addurl' => 'Twoja změna wobsahuje nowe eksterne wotkazy. Zo by wiki přećiwo awtomatizowanemu spamej škitał, zapisaj prošu dwě słowje, kotrejž w slědowacym polu widźiš:', + 'recaptcha-badlogin' => 'Zo by wiki přećiwo awtomatizowanemu złamanju hesłow škitał, zapisaj prošu dwě słowje, kotrejž widźiš, do slědowaceho pola:', + 'recaptcha-createaccount' => 'Zo by wiki přećiwo awtomatiskemu wutworjenju konta škitał, zapisaj prošu dwě słowje, kotrejž w slědowacym polu widźiš:', 'recaptcha-createaccount-fail' => 'Wopačna abo falowaca wotmołwa reCAPTCHA.', - 'recaptcha-create' => 'Za škit přećiwo awtomatiskemu wutworjenju strony, prošu zapisaj tej wobě słowje, kotrejž w slědowacym polu widźiš:', # Fuzzy + 'recaptcha-create' => 'Zo by wiki přećiwo awtomatiskemu wutworjenju strony škitał, zapisaj prošu dwě słowje, kotrejž w slědowacym polu widźiš:', ); /** Interlingua (interlingua) @@ -291,16 +306,17 @@ $messages['ja'] = array( ); /** Korean (한국어) + * @author Priviet * @author 아라 */ $messages['ko'] = array( 'recaptcha-desc' => '편집 확인에 대한 reCAPCHA 모듈', - 'recaptcha-edit' => '자동화된 편집 스팸으로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', # Fuzzy - 'recaptcha-addurl' => '편집에 새로운 바깥 링크가 포함되어 있습니다. 자동화된 스팸으로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', # Fuzzy - 'recaptcha-badlogin' => '자동화된 비밀번호 깨기로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', # Fuzzy - 'recaptcha-createaccount' => '자동화된 계정 만들기로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', # Fuzzy + 'recaptcha-edit' => '자동 편집 스팸으로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', + 'recaptcha-addurl' => '편집에 새로운 바깥 고리가 포함되어 있습니다. 자동 스팸으로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', + 'recaptcha-badlogin' => '자동 비밀번호 크래킹으로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', + 'recaptcha-createaccount' => '자동화된 계정 만들기로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', 'recaptcha-createaccount-fail' => 'reCAPTCHA 답이 올바르지 않거나 없습니다.', - 'recaptcha-create' => '자동화된 문서 만들기로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', # Fuzzy + 'recaptcha-create' => '자동 문서 생성을 막기 위해 아래 상자에 보이는 두 낱말을 입력하세요:', ); /** Colognian (Ripoarisch) @@ -464,12 +480,12 @@ $messages['pt-br'] = array( * @author Joetaras */ $messages['roa-tara'] = array( - 'recaptcha-edit' => "Pe darne 'na màne a proteggere condre le cangiaminde automatece de le rummate, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", # Fuzzy - 'recaptcha-addurl' => "Le cangiaminde tune 'ngludone collegaminde de fore nuève. Pe darne 'na màne a proteggere condre le cangiaminde automatece de le rummate, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", # Fuzzy - 'recaptcha-badlogin' => "Pe darne 'na màne a proteggere condre le futteminde automatece de le passuord, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", # Fuzzy - 'recaptcha-createaccount' => "Pe darne 'na màne a proteggere condre le ccrejaziune automatece de le cunde, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", # Fuzzy + 'recaptcha-edit' => "Pe proteggere condre le cangiaminde automatece de le rummate, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", + 'recaptcha-addurl' => "Le cangiaminde tune 'ngludone collegaminde de fore nuève. Pe proteggere condre le cangiaminde automatece de le rummate, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", + 'recaptcha-badlogin' => "Pe proteggere condre le futteminde automatece de le passuord, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", + 'recaptcha-createaccount' => "Pe proteggere condre le ccrejaziune automatece de le cunde, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", 'recaptcha-createaccount-fail' => 'Resposte reCAPTCHA ingorrette o mangande.', - 'recaptcha-create' => "Pe darne 'na màne a proteggere condre le ccrejaziune automatece de le pàggene, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", # Fuzzy + 'recaptcha-create' => "Pe proteggere condre le ccrejaziune automatece de le pàggene, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", ); /** Russian (русский) diff --git a/extensions/Gadgets/ApiQueryGadgets.php b/extensions/Gadgets/ApiQueryGadgets.php index a529daf0..94c4f04d 100644 --- a/extensions/Gadgets/ApiQueryGadgets.php +++ b/extensions/Gadgets/ApiQueryGadgets.php @@ -214,7 +214,7 @@ class ApiQueryGadgets extends ApiQueryBase { ' api.php?action=query&list=gadgets&gaprop=id|desc', 'Get a list of gadgets with all possible properties:', " api.php?action=query&list=gadgets&gaprop=$allProps", - 'Get a list of gadgets belonging to caregory "foo":', + 'Get a list of gadgets belonging to category "foo":', ' api.php?action=query&list=gadgets&gacategories=foo', 'Get information about gadgets "foo" and "bar":', ' api.php?action=query&list=gadgets&gaids=foo|bar&gaprop=id|desc|metadata', diff --git a/extensions/Gadgets/COPYING b/extensions/Gadgets/COPYING new file mode 100644 index 00000000..d159169d --- /dev/null +++ b/extensions/Gadgets/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/extensions/Gadgets/Gadgets.alias.php b/extensions/Gadgets/Gadgets.alias.php index 7f3307a5..5ec050c9 100644 --- a/extensions/Gadgets/Gadgets.alias.php +++ b/extensions/Gadgets/Gadgets.alias.php @@ -59,7 +59,7 @@ $specialPageAliases['ce'] = array( 'Gadgets' => array( 'Гаджеташ' ), ); -/** Czech (česky) */ +/** Czech (čeština) */ $specialPageAliases['cs'] = array( 'Gadgets' => array( 'Udělátka' ), ); @@ -136,7 +136,7 @@ $specialPageAliases['haw'] = array( /** Hebrew (עברית) */ $specialPageAliases['he'] = array( - 'Gadgets' => array( 'סקריפטים' ), + 'Gadgets' => array( 'גאדג\'טים', 'סקריפטים' ), ); /** Hindi (हिन्दी) */ diff --git a/extensions/Gadgets/Gadgets.i18n.php b/extensions/Gadgets/Gadgets.i18n.php index 2cef466a..b5cbc28a 100644 --- a/extensions/Gadgets/Gadgets.i18n.php +++ b/extensions/Gadgets/Gadgets.i18n.php @@ -379,9 +379,9 @@ $messages['ba'] = array( 'gadgets' => 'Гаджеттар', 'gadgets-title' => 'Гаджеттар', 'gadgets-uses' => 'Ҡулланыла', - 'gadgets-required-rights' => '{{PLURAL:$2|Хоҡуҡ талап ителә|Хоҡутар талап ителә}}: + 'gadgets-required-rights' => '{{PLURAL:$2|1=Хоҡуҡ талап ителә|Хоҡутар талап ителә}}: -$1', +$1', # Fuzzy 'gadgets-export' => 'Сығарырға', 'gadgets-not-found' => '"$1" гаджеты табылманы.', 'gadgets-export-download' => 'Күсереп алырға', @@ -459,10 +459,10 @@ $messages['be-tarask'] = array( 'gadgets-pagetext' => 'Ніжэй знаходзіцца сьпіс гаджэтаў, якія ўдзельнікі могуць уключыць у [[Special:Preferences#mw-prefsection-gadgets|сваіх наладах]], у адпаведнасьці са сьпісам на старонцы [[MediaWiki:Gadgets-definition|вызначэньняў]]. Гэты сьпіс дазваляе лёгка атрымаць доступ да старонак сыстэмных паведамленьняў, якія вызначаюць апісаньні і крынічныя коды гаджэтаў.', 'gadgets-uses' => 'Выкарыстоўвае', - 'gadgets-required-rights' => '{{PLURAL:$2|Патрабуецца права|Патрабуюцца наступныя правы}}: + 'gadgets-required-rights' => '{{PLURAL:$2|1=Патрабуецца права|Патрабуюцца наступныя правы}}: -$1', - 'gadgets-required-skins' => 'Даступны ў {{PLURAL:$2|тэме $1|наступных тэмах: $1}}.', +$1', # Fuzzy + 'gadgets-required-skins' => 'Даступны ў {{PLURAL:$2|1=тэме $1|наступных тэмах: $1}}.', # Fuzzy 'gadgets-default' => 'Дазволеныя для ўсіх па змоўчваньні.', 'gadgets-export' => 'Экспартаваць', 'gadgets-export-title' => 'Экспарт гаджэта', @@ -634,19 +634,29 @@ Heu de tenir els permisos adequats en el wiki de destinació (incloent-hi els pe */ $messages['ce'] = array( 'gadgets-desc' => 'Атто бо декъашхошна харжам ба [[Special:Preferences#mw-prefsection-gadgets|гIирс нисбарца]] CSS- а JavaScript-хIоттончаш, лато лууш йерш', # Fuzzy - 'prefs-gadgets' => 'Хlоттончаш', - 'gadgets-prefstext' => 'Лаххьа балийна леррина хlоттончаш могlам, шуьга шайга латалур йолуш хьай долахь долучу дакъан. -Хlара хlоттончаш дукхачу хьоляхь болх беш ю оцу JavaScript тlяхь, цундела аша латоеза JavaScript шай дуьнена машан гlирса чохь, цаьрга болх байта. -Диц маделаш, хlара хlоттончаш болх бяш яз хlо гlирс нисбо агlон чохь. + 'prefs-gadgets' => 'Гаджеташ', + 'gadgets-prefstext' => 'Лаххьа балийна леррина гаджеташ могӀам, шуьга шайга латалур йолуш хьай долахь долучу дакъан. +ХӀара гаджеташ дуккхачу хьолехь болх беш ю оцу JavaScript тӀехь, цундела аша латоеза JavaScript шай браузер чохь, цаьрга болх байта. +Диц маделаш, хӀара гаджеташ болх бяш яц хӀо гӀирс нисбо агӀон чохь. -Ишта диц маде, хlара хlоттончаш юкъа йогуш яз кху MediaWiki гlирсашна, мадарра аьльча шу санна декъашхоша шаьш йеш ю. +Ишта диц маде, хӀара гаджеташ юкъа йогуш яц кху MediaWiki гlирсашна, мадарра аьльча шу санна декъашхоша шаьш йеш ю. Адманкуьйгалхошка шайг хийцало и хlоттончи могlам, хlокх могlам гlонца [[MediaWiki:Gadgets-definition|къастам бало]] а [[Special:Gadgets|церах лаьцна]].', - 'gadgets' => 'Хlоттончаш', - 'gadgets-title' => 'Хlоттончаш', + 'gadgets' => 'Гаджеташ', + 'gadgets-title' => 'Гаджеташ', 'gadgets-pagetext' => 'Гlирса хааман могlамаш, къастош йолу хlоттончи цlераш, хуьлаш йолу хIокху [[MediaWiki:Gadgets-definition|къастамца]]]]. ХIокху могIамо атто бо гIирсан хаамаш атта тIе кхочуш барца, цуьнах лаьцна хIоттош а йолш йолучу хIоттончи ишарца.', # Fuzzy - 'gadgets-uses' => 'Лелош йу', + 'gadgets-uses' => 'Лелош ю', + 'gadgets-required-rights' => '{{PLURAL:$2|1=Оьшуш ю бакъо|Оьшуш ю бакъонаш}}: + +$1', # Fuzzy + 'gadgets-default' => 'Латае массарна Iад йитарца.', 'gadgets-export' => 'Экспорт ян', + 'gadgets-export-title' => 'Гаджет экспорт яр', + 'gadgets-export-text' => 'Гаджет $1 экспорт ян тӀетаӀае кнопка «{{int:gadgets-export-download}}», тӀакха чуяьккхина файл Ӏалаше, +Special:Import агӀона дехьа гӀой чуяккха файл. ТӀакха MediaWiki:Gadgets-definition агӀона чу билла лахара могӀа: +
      $2
      +И болх бан хьан бакъо хила еза (кхин системин хаамаш та ян бакъо а хила еза), кхи серверан чохь файлаш импорт йо гӀирс латина хила беза.', + 'gadgets-export-download' => 'Чуяккха', ); /** Sorani Kurdish (کوردی) @@ -679,7 +689,7 @@ $1', 'gadgets-export-download' => 'دایبگرە', ); -/** Czech (česky) +/** Czech (čeština) * @author Danny B. * @author Li-sung * @author Mormegil @@ -712,7 +722,7 @@ Na cílové wiki musíte mít příslušná oprávnění (včetně práva editov 'gadgets-export-download' => 'Stáhnout', ); -/** Church Slavic (словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) +/** Church Slavic (словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) * @author ОйЛ */ $messages['cu'] = array( @@ -849,6 +859,7 @@ Sie müssen über die notwendigen Berechtigungen auf dem für den Import vorgese /** Zazaki (Zazaki) * @author Erdemaslancan * @author Gorizon + * @author Mirzali * @author Neribij * @author Olvörg * @author Xoser @@ -856,12 +867,12 @@ Sie müssen über die notwendigen Berechtigungen auf dem für den Import vorgese $messages['diq'] = array( 'gadgets-desc' => "Karberan ré destur bidek [[Special:Preferences#mw-prefsection-gadgets|hesıbyayan]]'ra [[Special:Gadgets|Hacetanê CSS u JavaScriptî]] bışé weçiné", 'prefs-gadgets' => 'Haleti', - 'gadgets-prefstext' => 'Cor de yew listeya hacetanê xasî esta ke ti eşkenî xesabê xo de a bikî. -Enê hacatî JavaScript ser o gurêyenê, aya ra ti ganî browserê xo de JavaScript a bikî. -Ena pela opsiyonî de hacetî tesîr nêkenê. + 'gadgets-prefstext' => 'Cêr de yew lista hacetanê xasan esta ke tı şenay xesabê xo de a kerê. +Enê haceti JavaScript sero gureyenê, aye ra tı gani ageyrayoğê xo de JavaScript a kerê. +Ena pela opsiyoni de haceti tesir nêkenê. -Enê hacatanê xasî parçê sofwarê Mediyawîkî nîyê, aye ra karberê localî enê hacetî virazenê. -Îdarekarê mehelî eşkenê hacetan [[MediaWiki:Gadgets-definition|definitions]] û [[Special:Gadgets|descriptions]] ra bivurnê.', +Enê hacetê xasi parçê sofwarê Mediyawiki niyê, aye ra karberê locali enê haceti vırazenê. +İdarekarê meheli şenê be [[MediaWiki:Gadgets-definition|kıfşkerdeyan]] û [[Special:Gadgets|arezekerdışan]] ra hacetanê mınasıban bıvurnê.', 'gadgets' => 'Haleti', 'gadgets-title' => 'Haleti', 'gadgets-pagetext' => 'Cêr de yew listeya hacetanê xasan esta ke ti eşkenî [[Special:Preferences#mw-prefsection-gadgets|xesabê xo]] de a bikî, seke [[MediaWiki:Gadgets-definition|definitions]] nîşan dîyayo. @@ -1116,7 +1127,7 @@ $1', 'gadgets-export-text' => 'برای برون‌بری ابزار $1، بر دکمهٔ «{{int:gadgets-export-download}}» کلیک کنید، پروندهٔ بارگیری‌شده را ذخیره کنید، به ویژه:درون‌ریزی در ویکی مقصد بروید و بارگذاری‌اش کنید. سپس این را به صفحهٔ مدیاویکی:Gadgets-definition بیفزایید:
      $2
      لازم است تا در ویکی مقصد دسترسی‌های مناسب (شامل حق ویرایش پیغام‌های سامانه) را داشته باشید و درون‌ریزی از بارگذاری‌های پرونده باید فعال شده باشد.', - 'gadgets-export-download' => 'بارگیری', + 'gadgets-export-download' => 'دریافت', ); /** Finnish (suomi) @@ -1380,6 +1391,7 @@ Special:Import નિયોજીત વિકિ પર Special:Import પર /** Hebrew (עברית) * @author Amire80 * @author Guycn1 + * @author Guycn2 * @author Rotem Liss * @author YaronSh */ @@ -1401,7 +1413,7 @@ $messages['he'] = array( $1', 'gadgets-required-skins' => 'זמין {{PLURAL:$2|בערכות העיצוב הבאות: $1|בערכת העיצוב $1}}', - 'gadgets-default' => 'מופעל לכולם לפי בררת מחדל.', + 'gadgets-default' => 'מופעל לכולם כברירת מחדל.', 'gadgets-export' => 'יצוא', 'gadgets-export-title' => "יצוא גאדג'טים", 'gadgets-not-found' => 'הגאדג׳ט "$1" לא נמצא.', @@ -1637,32 +1649,32 @@ Anda harus memeroleh izin pada wiki tujuan (termasuk hak menyunting pesan sistem * @author Lam-ang */ $messages['ilo'] = array( - 'gadgets-desc' => 'Mabalin dagiti agar-aramat nga agpili iti [[Special:Gadgets|CSS ken JavaScript gadgets]] idiay [[Special:Preferences#mw-prefsection-gadgets|kaykayat da]]', - 'prefs-gadgets' => 'Gadgets', - 'gadgets-prefstext' => 'Adda dita baba ti listaan ti naipangruna a gadgets nga usaren idiay pakabilangam. -Dagitoy a gadgets ket naibasta iti JavaScript, masapul a pakabaelan ti JavaScript idiay "pagbasabasam" tapno agbalin da. -Saan a mabalin nga usaren dagitoy a gadgets ditoy kaykayat a panid. - -Dagitoy a gadgets ket saan a paset ti MediaWiki software, inaramid ken inayaywanan dagiti agar-aramat ti lokal a wiki. -Mabaliwan dagita administrador nga urnosen ti [[MediaWiki:Gadgets-definition|pinakailawag]] ken [[Special:Gadgets|deskripsion]] ti gadgets.', - 'gadgets' => 'Gadgets', - 'gadgets-title' => 'Gadgets', - 'gadgets-pagetext' => 'Dita baba ket adda listaan dagiti naipangruna a gadgets a dagiti agar-aramat ket mapagbalin da idiay [[Special:Preferences#mw-prefsection-gadgets|kaykayat da a panid]], a naipalawag iti [[MediaWiki:Gadgets-definition|dagiti pinakailawag]]. -Daytoy a pinakabuklan ket mangted ti nalaka a pinagserrek kadagit mensahe ti sistema a panid a nagpailawag iti deskripsion ti gadget ken kodigo.', + 'gadgets-desc' => 'Agpalubos kadagiti agar-aramat nga agpili kadagiti naiduma a [[Special:Gadgets|CSS ken JavaScript a gadget]] iti [[Special:Preferences#mw-prefsection-gadgets|kakaykayatanda]]', + 'prefs-gadgets' => 'Dagiti gadget', + 'gadgets-prefstext' => 'Dita baba ket listaan kadagiti naipangruna a gadget a mabalinmo a pakabaelan iti pakabilangam. +Dagitoy a gadget ket naibatay iti JavaScript, isunga masapul a pakabaelan ti JavaScript idiay "pagbasabasam" tapno agbalin dagitoy. +Laglagipen a dagitoy a gadget ket awan ti pagbanaganna iti daytoy panid ti kakaykayatan. + +Laglagipen pay a dagitoy a naipangruna a gadget ket saan a paset ti sopwer ti MediaWiki, ken kadawyan a pinarang-ay ken tinartaripato babaen dagiti agar-aramat iti lokal a wiki. +Dagiti lokal nga administrador ket mabalinda nga urnosen dagiti [[MediaWiki:Gadgets-definition|panangipalplawag]] ken dagiti [[Special:Gadgets|deskripsion]] dagiti magun-od a gadget.', + 'gadgets' => 'Dagiti gadget', + 'gadgets-title' => 'Dagiti gadget', + 'gadgets-pagetext' => 'Dita baba ket listaan dagiti naipangruna a gadget a mabalin a pakabaelan dagiti agar-aramat iti bukodda a [[Special:Preferences#mw-prefsection-gadgets|panid ti kakaykayatan]], a kas naipalawag babaen dagiti [[MediaWiki:Gadgets-definition|pannakaipalawag]]. +Daytoy a nakabuklan ket mangted ti nalaka a panagserrek kadagiti panid ti mensahe ti sistema a mangipalawag ti tungngal maysa a deskripsion ken kodigo ti gadget.', 'gadgets-uses' => 'Usar', - 'gadgets-required-rights' => 'Masapul dagiti sumaganad {{PLURAL:$2|a karbengan|dagiti karbengan}}: + 'gadgets-required-rights' => 'Masapul ti sumaganad a {{PLURAL:$2|karbengan|karkarbengan}}: $1', - 'gadgets-required-skins' => 'Adda mabalin idiay {{PLURAL:$2|$1 a kudil|dagiti sumaganad a kudil: $1}}.', - 'gadgets-default' => 'Pakabaelan a kinasigud iti amin nga agar-aramat.', + 'gadgets-required-skins' => 'Mabalin a magun-od {{PLURAL:$2|iti $1 a kudil|kadagiti sumaganad a kudil: $1}}.', + 'gadgets-default' => 'Pakabaelan a kasisigud para kadagiti amin.', 'gadgets-export' => 'Agipan', 'gadgets-export-title' => 'Agipan ti gadget', 'gadgets-not-found' => 'Saan a nabirukan ti "$1" a gadget.', - 'gadgets-export-text' => 'Ti pinag-ipan ti $1 a gadget, agtakla idiay "{{int:gadgets-export-download}}" a buton, idulin ti inkarga nga agpababa a papeles, -mapan idiay Special:Import ti papanan a wiki ken ikarga nga agpangato. Ken inayon dagiti sumaganad idiay MediaWiki:Gadgets-definition page: + 'gadgets-export-text' => 'Ti panag-ipan ti $1 a gadget, pinduten ti buton ti "{{int:gadgets-export-download}}", idulin ti naikarga a papeles, +mapan idiay Special:Import iti papanan a wiki ken ikarganto. Kalpasanna inayon dagiti sumaganad idiay panid ti MediaWiki:Gadgets-definition:
      $2
      -Masapul nga addaan ka ti husto a pammalubos iti papanan a wiki (nairaman ti karbegnan a pinagbaliw dagiti mensahe ti sistema) ken naipabalin ti pinagala kadagiti naggapu a papeles a naikarga nga agpangato.', - 'gadgets-export-download' => 'Ikarga nga agpababa', +Nasken nga addaanka ti maitunos a pammalubos iti papanan a wiki (mairaman ti karbengan a panag-urnos kadagiti mensahe ti sistema) ken nasken a napakabaelan ti panagikarga kadagiti papeles.', + 'gadgets-export-download' => 'Agikaraga', ); /** Ido (Ido) @@ -1789,6 +1801,7 @@ Bemærk også at disse specielle gadgets ikke er en del af MediaWiki-softwaren o ); /** Javanese (Basa Jawa) + * @author Bennylin * @author Meursault2004 * @author NoiX180 * @author Pras @@ -1813,6 +1826,10 @@ $1', 'gadgets-export' => 'Èkspor', 'gadgets-export-title' => 'Èkspor perkakas', 'gadgets-not-found' => 'Perkasas "$1" ora ditemokaké.', + 'gadgets-export-text' => 'Untuk mengekspor perkakas $1, klik tombol "{{int:gadgets-export-download}}", simpan berkas yang diunduh, +tuju ke Special:Import pada wiki tujuan dan unggah berkas itu. Kemudian tambahkan berkas tersebut ke halaman MediaWiki:Gadgets-definition: +
      $2
      +Anda harus memeroleh izin pada wiki tujuan (termasuk hak menyunting pesan sistem) dan mengimpor dari unggahan berkas yang harus diaktifkan.', 'gadgets-export-download' => 'Undhuh', ); @@ -1872,18 +1889,23 @@ $messages['kk-arab'] = array( */ $messages['kk-cyrl'] = array( 'prefs-gadgets' => 'Қажет құралдар', - 'gadgets-prefstext' => 'Төменде өз тіркелгіңізде қоса алатын арнаулы қажет құралдар тізімі беріледі. -Осы қажет құралдар көбінесе JavaScript әмірлеріне негізделінеді, сондықтан бұлар жұмыс істеуі үшін шолғышыңызда JavaScript қосылған болуы керек. -Бұл баптау бетіне осы қажет құралдар әсер етпейтінің ескеріңіз. + 'gadgets-prefstext' => 'Төменде өз тіркелгіңізде қоса алатын арнаулы қажет құралдар тізімі берілген. +Осы қажет құралдар көбінесе JavaScript әмірлеріне негізделеді, сондықтан бұлар жұмыс істеуі үшін шолғышыңызда JavaScript қосылған болуы керек. +Бұл баптау бетіне осы қажет құралдар әсер етпейтінін ескеріңіз. -Тағы да ескеріңіз: осы қажет құралдар MediaWiki бағдарламасының бөлігі емес, және де бұларды жайшылықта жергілікті уикидің қатысушылары дамытады және қоштайды. -Жергілікті әкімшілер жетімді қажет нәрсе тізімін [[{{ns:mediawiki}}:Gadgets-definition]] және [[{{ns:special}}:Gadgets]] беттері арқылы +Тағы да ескеріңіз: осы қажет құралдар MediaWiki бағдарламасының бөлігі емес және бұларды әдетте сіздің жергілікті уикиіңіздің қатысушылары дамытады және қоштайды. +Жергілікті әкімшілер жетімді гаджеттерді [[MediaWiki:Gadgets-definition]] және [[Special:Gadgets|сипаттама]] беттері арқылы өңдей алады.', # Fuzzy 'gadgets' => 'Қажет құралдар', 'gadgets-title' => 'Қажет құралдар', - 'gadgets-pagetext' => 'Төменде арнаулы қажет құралдар тізімі беріледі. [[{{ns:mediawiki}}:Gadgets-definition]] бетінде анықталған қажет құралдарды қатысушылар өзінің баптауында қоса алады. -Бұл шолу беті арқылы әрбір қажет құралдың сипаттамасы мен әмірін анықтайтын жүйе хабар беттеріне жеңіл қатынай аласыз.', # Fuzzy + 'gadgets-pagetext' => 'Төменде қатысушылар өзінің [[Special:Preferences#mw-prefsection-gadgets|баптауларынан]] қоса алатын арнаулы қажет құралдар тізімі берілген. [[MediaWiki:Gadgets-definition]] шолу беті арқылы әрбір қажет құралдың сипаттамасы мен әмірін анықтайтын жүйе хабар беттеріне жеңіл қатынай аласыз.', 'gadgets-uses' => 'Қолданыстағылар', + 'gadgets-required-rights' => 'Келесі {{PLURAL:$2|құқықты|құқықтарды}} қажет етеді: $1', + 'gadgets-default' => 'Әркімге автоматты түрде қосылады.', + 'gadgets-export' => 'Экспорттау', + 'gadgets-export-title' => 'Гаджетті экспорттау', + 'gadgets-not-found' => '"$1" гаджеті табылмады.', + 'gadgets-export-download' => 'Түсіру', ); /** Kazakh (Latin script) (qazaqşa (latın)‎) @@ -2051,7 +2073,7 @@ Ausserdeem sollt Dir wëssen, datt dës Gadgete generell net Deel vu MediaWiki s Lokal Wiki-Administrateure kënnen d'Lëscht von den disponibele Gadgeten op de Säiten [[MediaWiki:Gadgets-definition|Definitioune vun Gadgeten]] a [[Special:Gadgets|Beschreiwunge vu Gadgeten]] änneren.", 'gadgets' => 'Gadgeten', 'gadgets-title' => 'Gadgeten', - 'gadgets-pagetext' => "Ënnendrënner ass eng Lëscht vun de spezielle Gadgeten déi d'Benotzer op hire [[Special:Preferences#mw-prefsection-gadgets|Benotzer-Astellungen]] aschalte kënnen, esou wéi dat op [[MediaWiki:Gadgets-definition|definéiert]] ass. + 'gadgets-pagetext' => "Ënnendrënner ass eng Lëscht vun de spezielle Gadgeten déi d'Benotzer op hire [[Special:Preferences#mw-prefsection-gadgets|Benotzer-Astellungen]] aschalte kënnen, sou wéi dat op [[MediaWiki:Gadgets-definition|definéiert]] ass. Dës Iwwersiicht gëtt einfachen Zougang zu de Systemmessage-Säiten, déi all Gadget beschreiwen an zum Programméiercode vun dem Gadget.", 'gadgets-uses' => 'Benotzt', 'gadgets-required-rights' => "Erfuerdert {{PLURAL:$2|d'Recht|dës Rechter}}: $1.", @@ -2060,8 +2082,8 @@ Dës Iwwersiicht gëtt einfachen Zougang zu de Systemmessage-Säiten, déi all G 'gadgets-export' => 'Export', 'gadgets-export-title' => 'Export vu Gadgeten', 'gadgets-not-found' => 'Gadget "$1" net fonnt.', - 'gadgets-export-text' => 'Fir de Gadget $1 z\'exportéieren klickt w.e.g. op de(n) "{{int:gadgets-export-download}}"-Knäppchen, späichert den erofgelueden Fichier, gitt op Spezial:Import op der Zil-Wiki a lued en do erop. Duerno setzt der op d\'MediaWiki:Gadgets-Definitiouns Säit dëst derbäi:
      $2
      -Dir musst déi erfuerdert Rechter(inklusiv d\'Recht fir System-Messagen z\'änneren) op der Zil-Wiki hunn an den Import vun eropgelueden Fichiere muss ageschalt sinn.', + 'gadgets-export-text' => 'Fir de Gadget $1 z\'exportéieren klickt w.e.g. op de(n) "{{int:gadgets-export-download}}"-Knäppchen, späichert den erofgelueden Fichier, gitt op Spezial:Import op der Zil-Wiki a luet en do erop. Duerno setzt der op d\'MediaWiki:Gadgets-Definitiouns Säit dëst derbäi:
      $2
      +Dir musst déi erfuerdert Rechter(inklusiv d\'Recht fir Systemmessagen z\'änneren) op der Zil-Wiki hunn an den Import vun eropgelueden Fichiere muss ageschalt sinn.', 'gadgets-export-download' => 'Eroflueden', ); @@ -2070,6 +2092,7 @@ Dir musst déi erfuerdert Rechter(inklusiv d\'Recht fir System-Messagen z\'änne * @author Soul Train */ $messages['lez'] = array( + 'prefs-gadgets' => 'Гажетар', 'gadgets' => 'Гаджетар', 'gadgets-title' => 'Гажетар', ); @@ -2109,11 +2132,16 @@ Doe mós de juuste rèchte höbben óppe doelwie, ouch óm bewirkinge aan systee ); /** لوری (لوری) + * @author Bonevarluri * @author Mogoeilor */ $messages['lrc'] = array( 'prefs-gadgets' => 'چيا هنی', + 'gadgets' => 'گجت یا', + 'gadgets-title' => 'گجت یا', + 'gadgets-uses' => 'کاروردیا', 'gadgets-export' => 'وه صحرا ديئن', + 'gadgets-not-found' => 'گجت "$1" پیدا نبی.', 'gadgets-export-download' => 'گرتن', ); @@ -2244,7 +2272,7 @@ $1', 'gadgets-export' => 'Извези', 'gadgets-export-title' => 'Извоз на алатка', 'gadgets-not-found' => 'Алатката „$1“ не е пронајдена.', - 'gadgets-export-text' => 'За да ја извезете алатката $1, кликнете на копчето „{{int:gadgets-export-download}}“, зачувајте ја преземената податотека, + 'gadgets-export-text' => 'За да ја извезете алатката $1, стиснете на копчето „{{int:gadgets-export-download}}“, зачувајте ја преземената податотека, одете на Special:Import на целното вики и подигнете ја. Потоа на страницата MediaWiki:Gadgets-definition внесете го следново:
      $2
      Мора да имате соодветни дозволи на целното вики (вклучувајќи го правото за уредување на системски пораки), и мора да биде овозможен увозот од подигања.', @@ -2301,7 +2329,7 @@ $messages['mr'] = array( 'gadgets-title' => 'गॅजेट', 'gadgets-pagetext' => 'खाली तुम्ही तुमच्या सदस्यत्वासाठी [[Special:Preferences#mw-prefsection-gadgets|माझ्या पसंती]] पानावर वापरू शकत असलेल्या [[MediaWiki:Gadgets-definition|व्याख्या]]ने सांगितलेल्या गॅजेट्सची यादी दिलेली आहे. हे पान तुम्हाला प्रत्येक गॅजेट्सचा कोड व व्याख्या देणार्‍या पानासाठी सोपी संपर्क सुविधा पुरविते.', 'gadgets-uses' => 'उपयोग', - 'gadgets-required-rights' => 'खलील गोष्ठी साठी विनंती {{PLURAL:$2|right|rights}}: + 'gadgets-required-rights' => 'खालील {{PLURAL:$2|अधिकार}} हवेच : $1', 'gadgets-required-skins' => '{{PLURAL:$2|$1 skin|खालील देखाव्यांवर : $1}} उपलब्ध आहेत', @@ -2309,11 +2337,11 @@ $1', 'gadgets-export' => 'निर्यात करा', 'gadgets-export-title' => 'उपकरण निर्यात', 'gadgets-not-found' => 'उपकरण "$1" सापडत नाही.', - 'gadgets-export-text' => '$1 उपकरण-सुविधा निर्यातकरण्या करिता, "{{int:gadgets-export-download}}" कलीवर टिचकी मारा, उतरवलेली संचिका-फाईल जतन करा + 'gadgets-export-text' => '$1 उपकरण-सुविधा निर्यात करण्याकरिता, "{{int:gadgets-export-download}}" कळीवर टिचकी मारा, उतरवलेली संचिका-फाईल जतन करा डेस्टिनेशन विकिच्या विशेष:आयात पानावर जाऊन संचिका-फाईल चढवावी.नंतर खालील MediaWiki:Gadgets-definition पान चढवावे :
      $2
      तुमच्याकडे डेस्टिनेशन विकिवर (सिस्टीम मेसेजेस सुद्धा संपादीत करण्यासहीत ) सुयोग्य परवानग्या उपलब्ध असणे अत्यावश्यक आहे आणि चढवलेल्या संचिकाकरिता आयात सुविधा सक्षम असणे आवश्यक आहे.', - 'gadgets-export-download' => 'उतरवा', + 'gadgets-export-download' => 'अधिभारण करा', ); /** Malay (Bahasa Melayu) @@ -2457,16 +2485,17 @@ Dit overzichte biejt eenvoudige toegang tot de systeemtekstzied waor de beschrie /** Nepali (नेपाली) * @author Bhawani Gautam + * @author Nirmal Dulal */ $messages['ne'] = array( - 'gadgets-desc' => 'प्रयोगकर्ताको [[Special:Preferences#mw-prefsection-gadgets|अभिरुचि अनुसार]] [[Special:Gadgets|CSS र जाभास्क्रीप्ट उपकरणहरु]] छान्न दिनुहोस्', - 'prefs-gadgets' => 'उपकरणहरु', - 'gadgets-prefstext' => 'विशेष उपकरणहरुको सूची तल दिइएकोछ तपाईंले आफ्नो खातामा सक्रिय पार्न सक्नुहुन्छ। -प्राय सबै उपकरणहरु जाभास्क्रीप्टमा आधारित छन्, यस कारण ब्राउजरमा काम गराउनको लागि जाभास्क्रीप्टलाई सक्रिय गर्नु पर्छ। -याद राख्नुहोस् ती उपकरणहरुले अभिरुचि पृष्ठमा असर गर्दैनन्। -यो पनि याद राखुहोस् यी विशेष उपकरणहरु मीडिया विकि सफ्टवेयरभित्र पर्दैनन् र प्राय स्थानीय विकि प्रयोगकर्ताहरुले विकास यसको विकास र सञ्चालन गर्दछन्। स्थानीय प्रबन्धकहरुले उपलब्ध उपकरणहरुका [[MediaWiki:Gadgets-definition|परिभाषाहरु]] र [[Special:Gadgets|विवरणहरु]] सम्पादन गर्दछन्।', - 'gadgets' => 'उपकरणहरु', - 'gadgets-title' => 'उपकरणहरु', + 'gadgets-desc' => 'प्रयोगकर्ताको [[Special:Preferences#mw-prefsection-gadgets|अभिरुचि अनुसार]] [[Special:Gadgets|CSS र जाभास्क्रीप्ट उपकरणहरू]] छान्न दिनुहोस', + 'prefs-gadgets' => 'उपकरणहरू', + 'gadgets-prefstext' => 'विशेष उपकरणहरूको सूची तल दिइएकोछ तपाईंले आफ्नो खातामा सक्रिय पार्न सक्नुहुन्छ। +प्राय सबै उपकरणहरू जाभास्क्रीप्टमा आधारित छन्, यस कारण ब्राउजरमा काम गराउनको लागि जाभास्क्रीप्टलाई सक्रिय गर्नु पर्छ। +याद राख्नुहोस् ती उपकरणहरूले अभिरुचि पृष्ठमा असर गर्दैनन्। +यो पनि याद राखुहोस् यी विशेष उपकरणहरू मीडिया विकि सफ्टवेयरभित्र पर्दैनन् र प्राय स्थानीय विकि प्रयोगकर्ताहरुले विकास यसको विकास र सञ्चालन गर्दछन्। स्थानीय प्रबन्धकहरूले उपलब्ध उपकरणहरूका [[MediaWiki:Gadgets-definition|परिभाषाहरू]] र [[Special:Gadgets|विवरणहरू]] सम्पादन गर्दछन्।', + 'gadgets' => 'उपकरणहरू', + 'gadgets-title' => 'उपकरणहरू', 'gadgets-pagetext' => 'विशेष उपकरणहरुको सूची तल दिइएकोछ प्रयोगकर्ताहरुले [[MediaWiki:Gadgets-definition|परिभाषाहरु]]मा जनाए अनुसार आफ्नो [[Special:Preferences#mw-prefsection-gadgets|अभिरुचि पृष्ठमा]], सक्रिय पार्न सक्नेछन्।। यस सिंहावलोकनले प्रणाली सन्देश पृष्ठ सजिलै प्राप्त गर्न सकिनेछ जसले प्रत्येक उपकरणको विवरण र कोडलाई परिभाषित गरेको छ।', 'gadgets-uses' => 'प्रयोगहरु', @@ -2913,6 +2942,7 @@ Tu a ave le permesse appropriate sus 'a Uicchi de destinazione (ingludenne le de * @author Eleferen * @author Ignatus * @author Illusion + * @author Kaganer * @author MaxSem * @author VasilievVV * @author Александр Сигачёв @@ -2931,10 +2961,10 @@ $messages['ru'] = array( 'gadgets-pagetext' => 'Ниже приведён список гаджетов, которые участники могут включить на своей странице настроек, в соответствии со списком на странице [[MediaWiki:Gadgets-definition|определений]]. Этот список позволяет легко получить доступ к страницам системных сообщений, определяющих описания и исходные коды гаджетов.', 'gadgets-uses' => 'Использует', - 'gadgets-required-rights' => '{{PLURAL:$2|Требуется право|Требуются права}}: + 'gadgets-required-rights' => '{{PLURAL:$2|1=Требуется право|Требуются права}}: $1', - 'gadgets-required-skins' => 'Доступен при {{PLURAL:$2|теме оформления $1|следующих темах оформления: $1}}.', + 'gadgets-required-skins' => 'Доступен в {{PLURAL:$2|1=теме оформления «$1»|следующих темах оформления: $1}}.', 'gadgets-default' => 'Включён для всех по умолчанию.', 'gadgets-export' => 'Экспортировать', 'gadgets-export-title' => 'Экспорт гаджета', @@ -3042,6 +3072,15 @@ $messages['sgs'] = array( 'gadgets' => 'Rakondā', ); +/** Serbo-Croatian (srpskohrvatski / српскохрватски) + * @author Kolega2357 + */ +$messages['sh'] = array( + 'gadgets' => 'Alatke / Алатке', + 'gadgets-title' => 'Alatke / Алатке', + 'gadgets-uses' => 'Upotrebe / Употребе', +); + /** Sinhala (සිංහල) * @author Budhajeewa * @author නන්දිමිතුරු @@ -3179,6 +3218,7 @@ Ju duhet të keni leje të përshtatshme në wiki-n e destinuar (duke përfshir ); /** Serbian (Cyrillic script) (српски (ћирилица)‎) + * @author Milicevic01 * @author Millosh * @author Nikola Smolenski * @author Rancher @@ -3186,12 +3226,12 @@ Ju duhet të keni leje të përshtatshme në wiki-n e destinuar (duke përfshir */ $messages['sr-ec'] = array( 'gadgets-desc' => 'Омогућава корисницима да изаберу прилагођене [[Special:Gadgets|CSS и јаваскрипт гаџете]] у својим [[Special:Preferences#mw-prefsection-gadgets|подешавањима]]', - 'prefs-gadgets' => 'Гаџети', + 'prefs-gadgets' => 'Геџети', 'gadgets-prefstext' => 'Испод се налази списак посебних гаџета које можете да омогућите на свом налогу. Ове справице су углавном засноване на јаваскрипти, тако да она мора бити омогућена. Гаџети неће утицати на страницу за подешавање. -Они нису део софтвера Медијавики, већ се развијају и одржавају од стране корисника ваше викије. +Они нису део софтвера Медијавики, већ се развијају и одржавају од стране корисника на вашем локалном викију. Администратори могу да измене [[MediaWiki:Gadgets-definition|значења]] и [[Special:Gadgets|описе]] доступних гаџета.', 'gadgets' => 'Гаџети', 'gadgets-title' => 'Гаџети', @@ -3215,6 +3255,7 @@ $1', /** Serbian (Latin script) (srpski (latinica)‎) * @author Michaello + * @author Milicevic01 * @author Жељко Тодоровић */ $messages['sr-el'] = array( @@ -3224,7 +3265,7 @@ $messages['sr-el'] = array( Ove spravice su uglavnom zasnovane na javaskripti, tako da ona mora biti omogućena. Gadžeti neće uticati na stranicu za podešavanje. -Oni nisu deo softvera Medijaviki, već se razvijaju i održavaju od strane korisnika vaše vikije. +Oni nisu deo softvera Medijaviki, već se razvijaju i održavaju od strane korisnika na vašem lokalnom vikiju. Administratori mogu da izmene [[MediaWiki:Gadgets-definition|značenja]] i [[Special:Gadgets|opise]] dostupnih gadžeta.', 'gadgets' => 'gedžeti', 'gadgets-title' => 'gedžeti', @@ -3279,6 +3320,7 @@ $messages['su'] = array( * @author Diupwijk * @author Lejonel * @author M.M.S. + * @author Skalman */ $messages['sv'] = array( 'gadgets-desc' => 'Låter användare aktivera personliga [[Special:Gadgets|CSS- och JavaScript-finesser]] genom sina [[Special:Preferences#mw-prefsection-gadgets|inställningar]]', @@ -3291,7 +3333,7 @@ Notera också att dessa finesser inte är en del av MediaWiki-programvaran, och Lokala administratörer kan redigera [[MediaWiki:Gadgets-definition|definitionerna]] och [[Special:Gadgets|beskrivningarna]] av de tillgängliga finesserna.', 'gadgets' => 'Finesser', 'gadgets-title' => 'Finesser', - 'gadgets-pagetext' => 'Härunder finns en lista över finesser som användare kan aktivera i sina [[Special:Preferences#mw-prefsection-gadgets|inställningar]], definierad av [[MediaWiki:Gadgets-definition|definieringarna]]. + 'gadgets-pagetext' => 'Härunder finns en lista över finesser som användare kan aktivera i sina [[Special:Preferences#mw-prefsection-gadgets|inställningar]], definierad av [[MediaWiki:Gadgets-definition|definitionerna]]. Den här översikten ger enkel åtkomst till de systemmeddelanden som definierar beskrivningarna och koden för varje finess.', 'gadgets-uses' => 'Använder', 'gadgets-required-rights' => 'Kräver följande {{PLURAL:$2|rättighet|rättigheter}}: @@ -3513,6 +3555,7 @@ $messages['ug-arab'] = array( /** Ukrainian (українська) * @author AS * @author Ahonc + * @author Andriykopanytsia * @author Dim Grits * @author Olvin * @author Prima klasy4na @@ -3535,10 +3578,10 @@ $messages['uk'] = array( 'gadgets-pagetext' => 'Нижче наведено перелік додатків, які можна ввімкнути на [[Special:Preferences#mw-prefsection-gadgets|сторінці налаштувань]]. Цей перелік задано на [[MediaWiki:Gadgets-definition|сторінці визначень]]. Таким чином, можна отримати простий доступ до системних сторінок, де задається опис кожного додатку та його код.', 'gadgets-uses' => 'Використовує', - 'gadgets-required-rights' => '{{PLURAL:$2|Потрібне право|Потрібні такі права}}: + 'gadgets-required-rights' => '{{PLURAL:$2|1=Потрібне право|Потрібні такі права}}: $1', - 'gadgets-required-skins' => 'Доступний на {{PLURAL:$2|$1 skin|наступних темах оформлення: $1}}.', + 'gadgets-required-skins' => 'Доступний на {{PLURAL:$2|1=$1 skin|наступних темах оформлення: $1}}.', 'gadgets-default' => 'Увімкнено для всіх за замовчуванням.', 'gadgets-export' => 'Експортувати', 'gadgets-export-title' => 'Експорт додатка', diff --git a/extensions/Gadgets/SpecialGadgets.php b/extensions/Gadgets/SpecialGadgets.php index 888ba6e2..f6c3d74c 100644 --- a/extensions/Gadgets/SpecialGadgets.php +++ b/extensions/Gadgets/SpecialGadgets.php @@ -95,7 +95,7 @@ class SpecialGadgets extends SpecialPage { array( 'action' => 'edit' ) ); $links[] = Linker::link( - $this->getTitle( "export/{$gadget->getName()}" ), + $this->getPageTitle( "export/{$gadget->getName()}" ), $this->msg( 'gadgets-export' )->escaped() ); diff --git a/extensions/ImageMap/COPYING b/extensions/ImageMap/COPYING new file mode 100644 index 00000000..d159169d --- /dev/null +++ b/extensions/ImageMap/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/extensions/ImageMap/ImageMap.i18n.php b/extensions/ImageMap/ImageMap.i18n.php index 1e07d69c..3e7e9f76 100644 --- a/extensions/ImageMap/ImageMap.i18n.php +++ b/extensions/ImageMap/ImageMap.i18n.php @@ -1,6 +1,6 @@ '<imagemap> টেগ্‌ ব্যৱহাৰ কৰি ক্লায়েণ্ট-চাইড ক্লিকেবল্‌ ইমেজ্‌ মেপৰ অনুমতি দিয়ে', 'imagemap_no_image' => 'ত্ৰুটী: প্ৰথম শাৰীত এখন ছবি নিৰ্দিষ্ট কৰিবই লাগিব', 'imagemap_invalid_image' => 'ত্ৰুটী: ছবিখন অবৈধ বা ছবিখন নাই', - 'imagemap_bad_image' => 'ত্ৰুটী: এই পৃষ্ঠাত ছবিখন ব্লেকলিষ্টেড কৰা হৈছে', + 'imagemap_bad_image' => 'ত্ৰুটী: এই পৃষ্ঠাত ছবিখন ব্লেকলিষ্টেড কৰা হৈছে।', 'imagemap_no_link' => "ত্ৰুটী: $1 শাৰীৰ শেষত কোনো বৈধ লিংক পোৱা নগ'ল", 'imagemap_invalid_title' => 'ত্ৰুটী: $1 শাৰীত থকা লিংকৰ শিৰোনাম অবৈধ', 'imagemap_missing_coord' => 'ত্ৰুটী: $1 শাৰীত আকৃতিৰ বাবে যথেষ্ট স্থানাংক নাই', @@ -365,7 +365,9 @@ $messages['ca'] = array( * @author Умар */ $messages['ce'] = array( + 'imagemap_desc' => 'Таро хуьлуьйту картан суьрта таӀийча латораш билгалдан <imagemap> теган гӀуьнца', 'imagemap_invalid_image' => 'ГӀалат: нийса дац я ишта сурт дац кху чохь', + 'imagemap_no_link' => 'ГӀалат: $1 могӀанан чаккхехь нийса йоцу хьажораг ю', 'imagemap_invalid_title' => 'ГӀалат: могӀана $1 хьажориган корта нийса яц', 'imagemap_description' => 'Суьртах лаьцна', ); @@ -376,7 +378,7 @@ $messages['co'] = array( 'imagemap_description' => "À prupositu d'issa imagine", ); -/** Czech (česky) +/** Czech (čeština) * @author Li-sung * @author Mormegil */ diff --git a/extensions/ImageMap/ImageMap.php b/extensions/ImageMap/ImageMap.php index aa4cfa0d..b263bbb5 100644 --- a/extensions/ImageMap/ImageMap.php +++ b/extensions/ImageMap/ImageMap.php @@ -1,4 +1,20 @@ diff --git a/extensions/InputBox/InputBox.classes.php b/extensions/InputBox/InputBox.classes.php index 380015cc..314bc6c8 100644 --- a/extensions/InputBox/InputBox.classes.php +++ b/extensions/InputBox/InputBox.classes.php @@ -84,10 +84,10 @@ class InputBox { // Use button label fallbacks if ( !$this->mButtonLabel ) { - $this->mButtonLabel = wfMessage( 'tryexact' )->escaped(); + $this->mButtonLabel = wfMessage( 'tryexact' )->text(); } if ( !$this->mSearchButtonLabel ) { - $this->mSearchButtonLabel = wfMessage( 'searchfulltext' )->escaped(); + $this->mSearchButtonLabel = wfMessage( 'searchfulltext' )->text(); } // Build HTML @@ -101,7 +101,7 @@ class InputBox { 'name' => 'searchbox', 'id' => 'searchbox', 'class' => 'searchbox', - 'action' => SpecialPage::getTitleFor( 'Search' )->escapeLocalUrl(), + 'action' => SpecialPage::getTitleFor( 'Search' )->getLocalUrl(), ) ); $htmlOut .= Xml::element( 'input', @@ -239,7 +239,7 @@ class InputBox { public function getSearchForm2() { // Use button label fallbacks if ( !$this->mButtonLabel ) { - $this->mButtonLabel = wfMessage( 'tryexact' )->escaped(); + $this->mButtonLabel = wfMessage( 'tryexact' )->text(); } $id = Sanitizer::escapeId( $this->mID, 'noninitial' ); @@ -255,7 +255,7 @@ class InputBox { 'name' => 'bodySearch' . $id, 'id' => 'bodySearch' . $id, 'class' => 'bodySearch', - 'action' => SpecialPage::getTitleFor( 'Search' )->escapeLocalUrl(), + 'action' => SpecialPage::getTitleFor( 'Search' )->getLocalUrl(), 'style' => $this->mInline ? 'display: inline;' : '' ) ); @@ -312,11 +312,11 @@ class InputBox { if ( $this->mType == "comment" ) { if ( !$this->mButtonLabel ) { - $this->mButtonLabel = wfMessage( "postcomment" )->escaped(); + $this->mButtonLabel = wfMessage( 'postcomment' )->text(); } } else { if ( !$this->mButtonLabel ) { - $this->mButtonLabel = wfMessage( 'createarticle' )->escaped(); + $this->mButtonLabel = wfMessage( 'createarticle' )->text(); } } @@ -427,7 +427,7 @@ class InputBox { global $wgScript; if ( !$this->mButtonLabel ) { - $this->mButtonLabel = wfMessage( "postcomment" )->escaped(); + $this->mButtonLabel = wfMessage( 'postcomment' )->text(); } $htmlOut = Xml::openElement( 'div', diff --git a/extensions/InputBox/InputBox.i18n.php b/extensions/InputBox/InputBox.i18n.php index 1c8519f0..972aea54 100644 --- a/extensions/InputBox/InputBox.i18n.php +++ b/extensions/InputBox/InputBox.i18n.php @@ -142,7 +142,7 @@ $messages['as'] = array( অনুগ্ৰহ কৰি "create", "comment", "search", "search2" বা "fulltext" নিৰ্ধাৰণ কৰক', 'tryexact' => 'কেবল দিয়া শব্দহে বিচাৰিব', 'searchfulltext' => 'সম্পূৰ্ণ পাঠ্য বিচাৰিব', - 'createarticle' => 'পৃষ্ঠা বনাওক', + 'createarticle' => 'পৃষ্ঠা সৃষ্টি কৰক', 'inputbox-ns-main' => 'মূখ্য', ); @@ -355,9 +355,11 @@ $messages['cdo'] = array( * @author Умар */ $messages['ce'] = array( + 'inputbox-desc' => 'Аьтту хуьлуьйту хьалхе билгалйина HTML-формаш лато', + 'inputbox-error-no-type' => 'Ахьа язъечу меттиган тайп билгала йина яц.', 'tryexact' => 'Леррина лахар', 'searchfulltext' => 'Дуьззина йозанца лахар', - 'createarticle' => 'Яззам кхоллар', + 'createarticle' => 'АгӀо кхолла', ); /** Sorani Kurdish (کوردی) @@ -791,11 +793,12 @@ $messages['hak'] = array( /** Hebrew (עברית) * @author Amire80 + * @author Guycn2 * @author Rotem Liss */ $messages['he'] = array( 'inputbox-desc' => 'אפשרות להכללת טופסי HTML שהוגדרו מראש', - 'inputbox-error-no-type' => 'לא ציינתם את סוג תיבת הקלט ליצירה.', + 'inputbox-error-no-type' => 'לא ציינת את סוג תיבת הקלט ליצירה.', 'inputbox-error-bad-type' => 'סוג תיבת הקלט "$1" אינו ידוע. אנא ציינו "create", "comment", "search", "search2" או "fulltext".', 'tryexact' => 'לדף בשם זה', @@ -949,14 +952,14 @@ $messages['ig'] = array( * @author Lam-ang */ $messages['ilo'] = array( - 'inputbox-desc' => 'Pakabaelan na nga agikabil kadagiti napalasin a kinabuklan ti HTML', - 'inputbox-error-no-type' => 'Saan mo pay nga imbaga no ania a kita ti pagikabilan a kahon ti aramiden.', - 'inputbox-error-bad-type' => 'Ti kita ti pigikabilan a kahon "$1" ket saan a ma-ammoan. -Pangaasi ta ibagam nga "agaramid", "komentario", "biruken", "biruken2", "wenno sibubukel a testo".', + 'inputbox-desc' => 'Mangipalubos ti panangiraman kadagiti nasakbayan a naipalawag a porma ti HTML', + 'inputbox-error-no-type' => 'Saanmo pay a nainaganan no ania a kita ti partuaten a kahon ti pagikabilan.', + 'inputbox-error-bad-type' => 'Ti kita ti kahon a pigikabilan ti "$1" ket saan a mabigbigan. +Pangngaasi nga inaganam ti "agpartuat", "komento", "biruken", "biruken2", "wenno sibubukel a testo".', 'tryexact' => 'Padasem to pudno a kapada', - 'searchfulltext' => 'Agbiruk ti sibubukel a testo', - 'createarticle' => 'Agaramid ti panid', - 'inputbox-ns-main' => 'Dati', + 'searchfulltext' => 'Agbiruk ti napno a testo', + 'createarticle' => 'Agpartuat ti panid', + 'inputbox-ns-main' => 'Nangruna', ); /** Ido (Ido) @@ -1063,11 +1066,12 @@ $messages['kaa'] = array( /** Kabyle (Taqbaylit) * @author Agurzil + * @author Mmistmurt */ $messages['kab'] = array( 'tryexact' => 'Nadi ɣef uzwel kif-kif', 'searchfulltext' => 'Nadi aḍris ettmam', - 'createarticle' => 'Xleq amagrad', # Fuzzy + 'createarticle' => 'Xleq amagrad', ); /** Kazakh (Arabic script) (قازاقشا (تٴوتە)‏) @@ -1124,7 +1128,7 @@ $messages['ko'] = array( 'inputbox-error-bad-type' => '"$1" 입력 상자 종류는 정의되어 있지 않습니다. "create", "comment", "search", "search2"나 "fulltext" 중 하나를 지정하세요.', 'tryexact' => '일치하는 항목 찾기', - 'searchfulltext' => '전체 글 찾기', + 'searchfulltext' => '전체 글 검색', 'createarticle' => '문서 만들기', 'inputbox-ns-main' => '문서', ); @@ -1163,6 +1167,13 @@ $messages['la'] = array( 'createarticle' => 'Paginam creare', ); +/** Ladino (Ladino) + * @author Menachem.Moreira + */ +$messages['lad'] = array( + 'createarticle' => 'Krear pajina', +); + /** Luxembourgish (Lëtzebuergesch) * @author Robby */ @@ -1231,9 +1242,11 @@ $messages['lo'] = array( ); /** لوری (لوری) + * @author Bonevarluri * @author Mogoeilor */ $messages['lrc'] = array( + 'searchfulltext' => 'پی جوری متنی', 'createarticle' => 'راس كردن بلگه', 'inputbox-ns-main' => 'اصلی', ); @@ -1348,7 +1361,7 @@ $messages['mn'] = array( */ $messages['mr'] = array( 'inputbox-desc' => 'पूर्वी लिहिलेले HTML अर्ज वापरण्याची परवानगी द्या', - 'inputbox-error-no-type' => 'तुम्ही कुठल्या प्रकारची पृष्ठपेटी तयार करायची ते स्पष्ट केलेले नाही.', + 'inputbox-error-no-type' => 'कुठल्या प्रकारची पृष्ठपेटी तयार करायची ते तुम्ही स्पष्ट केलेले नाही.', 'inputbox-error-bad-type' => 'तुम्ही दिलेला पृष्ठपेटीचा "$1" हा प्रकार ओळखीचा नाही. कृपया "create", "comment", "search" किंवा "search2" किंवा "fulltext".यातील एक निवडा.', 'tryexact' => 'दिलेलेच शब्द शोधा', @@ -1654,6 +1667,7 @@ Por favor, especifique "create", "comment", "search", "search2" ou "fulltext".', * @author Brunoy Anastasiya Seryozhenko * @author Eduardo.mps * @author MetalBrasil + * @author Opraco */ $messages['pt-br'] = array( 'inputbox-desc' => 'Permite a inclusão de formulários definidos de HTML', @@ -1662,7 +1676,7 @@ $messages['pt-br'] = array( Por favor, especifique "create", "comment", "search", "search2" ou "fulltext".', 'tryexact' => 'Tentar a expressão exata', 'searchfulltext' => 'Pesquisar em todo o texto.', - 'createarticle' => 'Criar página.', + 'createarticle' => 'Criar página', 'inputbox-ns-main' => 'Principal', ); @@ -1810,6 +1824,13 @@ $messages['sgs'] = array( 'searchfulltext' => 'Ėiškuotė pėlna teksta', ); +/** Serbo-Croatian (srpskohrvatski / српскохрватски) + * @author Kolega2357 + */ +$messages['sh'] = array( + 'searchfulltext' => 'Pretraži cijeli tekst - Претражи цео текст', +); + /** Sinhala (සිංහල) * @author Asiri wiki * @author Budhajeewa diff --git a/extensions/Interwiki/COPYING b/extensions/Interwiki/COPYING new file mode 100644 index 00000000..d159169d --- /dev/null +++ b/extensions/Interwiki/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/extensions/Interwiki/Interwiki.alias.php b/extensions/Interwiki/Interwiki.alias.php index 30098f05..3e49249e 100644 --- a/extensions/Interwiki/Interwiki.alias.php +++ b/extensions/Interwiki/Interwiki.alias.php @@ -251,5 +251,5 @@ $specialPageAliases['zh-hans'] = array( /** Traditional Chinese (中文(繁體)‎) */ $specialPageAliases['zh-hant'] = array( - 'Interwiki' => array( '跨維基連結' ), + 'Interwiki' => array( '跨wiki', '跨維基' ), ); \ No newline at end of file diff --git a/extensions/Interwiki/Interwiki.i18n.php b/extensions/Interwiki/Interwiki.i18n.php index a2619ff3..cebc7dc4 100644 --- a/extensions/Interwiki/Interwiki.i18n.php +++ b/extensions/Interwiki/Interwiki.i18n.php @@ -435,8 +435,11 @@ $messages['arz'] = array( /** Assamese (অসমীয়া) * @author Bishnu Saikia + * @author Gitartha.bordoloi */ $messages['as'] = array( + 'interwiki' => 'আন্তঃৱিকি তথ্য চাওক আৰু সম্পাদনা কৰক', + 'interwiki-title-norights' => 'আন্তঃৱিকি তথ্য চাওক', 'interwiki_1' => 'হয়', 'interwiki_0' => 'নহয়', 'interwiki_edit' => 'সম্পাদনা কৰক', @@ -798,6 +801,7 @@ Ho pezet soñj e c'hall an dra-se terriñ liammoù zo anezho dija.", Marteze n\'eus ket anezhañ.', 'interwiki-badprefix' => 'Arouezennoù direizh zo er rakger etrewiki spisaet "$1', 'interwiki-submit-empty' => "N'hall ket ar rakger hag an URL bezañ goullo.", + 'interwiki-submit-invalidurl' => 'Direizh eo protokol an URL.', 'log-name-interwiki' => 'Deizlevr taolenn an etrewiki', 'logentry-interwiki-iw_add' => '$1 {{GENDER:$2|en deus|he deus}} ouzhpennet ar rakger "$4" ($5) (treuz: $6; lec\'hel: $7) d\'an daolenn etrewiki', 'logentry-interwiki-iw_edit' => '$1 {{GENDER:$2|en deus|he deus}} kemmet ar rakger "$4" ($5) (treuz: $6; lec\'hel: $7) en daolenn etrewiki', @@ -931,6 +935,7 @@ Possiblement no existeix.', */ $messages['ce'] = array( 'interwiki-title-norights' => 'Юкъарвикишан хаамаш хьажар', + 'interwiki-desc' => 'ТӀетуху [[Special:Interwiki|белхан агӀо]] юкъаравикин дешхьалхенашка хьажа а уьш тая а.', 'interwiki_intro' => 'ХӀара ду юкъарвикишан таблице хьажар.', 'interwiki-legend-show' => 'Гайта хьехар', 'interwiki-legend-hide' => 'Къайладаккха хьехар', @@ -951,7 +956,9 @@ $messages['ce'] = array( 'interwiki_0' => 'яц', 'interwiki_edit' => 'Нисйé', 'interwiki_reasonfield' => 'Бахьан:', - 'interwiki_addbutton' => 'Тlетоха', + 'interwiki_delquestion' => '«$1» дӀаяккхар', + 'interwiki_addbutton' => 'ТӀетоха', + 'logentry-interwiki-iw_edit' => '$1 {{GENDER:$2|хийцина}} префикс «$4» ($5) (trans: $6; local: $7) юкъарвики-таблицехь', ); /** Sorani Kurdish (کوردی) @@ -968,7 +975,7 @@ $messages['co'] = array( 'interwiki_reasonfield' => 'Mutivu:', ); -/** Czech (česky) +/** Czech (čeština) * @author Danny B. * @author Mormegil */ @@ -1030,7 +1037,7 @@ Pravděpodobně neexistuje.', 'action-interwiki' => 'změnit tento záznam interwiki', ); -/** Church Slavic (словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) +/** Church Slavic (словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) * @author ОйЛ */ $messages['cu'] = array( @@ -1086,8 +1093,8 @@ $messages['da'] = array( 'interwiki-legend-hide' => 'Skjul forklaring', 'interwiki_prefix' => 'Præfiks', 'interwiki-prefix-label' => 'Præfiks:', - 'interwiki_prefix_intro' => 'Interwiki præfiks som skal anvendes i [[præfiks:sidenavn]] wikitext syntaks.', - 'interwiki_url_intro' => 'Skabelon til URL-adresser. Pladsholderen $1 vil blive erstattet af sidenavn af wikitext, når den ovennævnte wikitext syntaks bruges.', + 'interwiki_prefix_intro' => 'Interwiki præfiks som skal anvendes i [[præfiks:sidenavn]] wikitekst syntaks.', + 'interwiki_url_intro' => 'Skabelon til URL-adresser. Pladsholderen $1 vil blive erstattet af sidenavn af wikitekst, når den ovennævnte wikitekst syntaks bruges.', 'interwiki_local' => 'Videresend', 'interwiki-local-label' => 'Videresend:', 'interwiki_local_intro' => 'En HTTP-forespørgsel til den lokale wiki med denne interwiki præfiks i URL-adressen er:', @@ -1095,7 +1102,7 @@ $messages['da'] = array( 'interwiki_local_1_intro' => 'Omdirigeret til target URL i interwiki link definitioner (dvs. behandles som referencer i lokale sider).', 'interwiki_trans' => 'Transkluder', 'interwiki-trans-label' => 'Transkluder:', - 'interwiki_trans_intro' => 'Hvis wikitext syntaksen [[præfiks:sidenavn]] bruges, så:', + 'interwiki_trans_intro' => 'Hvis wikitekst syntaksen [[præfiks:sidenavn]] bruges, så:', 'interwiki_1' => 'ja', 'interwiki_0' => 'nej', 'interwiki_error' => 'Fejl: Interwikitabellen er tom eller noget andet gik galt.', @@ -1121,7 +1128,7 @@ Husk, at dette kan bryde eksisterende hyperlinks.', Det findes muligvis ikke.', 'interwiki-badprefix' => 'Det angivne interwikipræfiks "$1" indeholder ugyldige tegn.', 'right-interwiki' => 'Redigere interwikidata', - 'action-interwiki' => 'ændre dette interwiki-element', + 'action-interwiki' => 'redigere interwikidata', ); /** German (Deutsch) @@ -1402,6 +1409,7 @@ Verŝajne ĝi ne ekzistas.', /** Spanish (español) * @author Armando-Martin + * @author Ciencia Al Poder * @author Crazymadlover * @author Imre * @author Invadinado @@ -1421,18 +1429,18 @@ $messages['es'] = array( 'interwiki-legend-hide' => 'Ocultar la leyenda', 'interwiki_prefix' => 'Prefijo', 'interwiki-prefix-label' => 'Prefijo:', - 'interwiki_prefix_intro' => 'Prefijo interwiki que se utilizará en sintaxis wikitexto [[prefix:pagename]] wikitext syntax.', - 'interwiki_url_intro' => 'Plantilla para URLs. El marcador $1 será reemplazado por el nombre de página del wikitexto cuando se use la sintaxis de wikitexto arriba mostrada.', - 'interwiki_local' => 'Adelante', - 'interwiki-local-label' => 'Adelante:', - 'interwiki_local_intro' => 'Una solicitud HTTP a la wiki local con este prefijo interwiki en la URL es:', - 'interwiki_local_0_intro' => 'no se satisfizo, normalmente bloqueado por "página no encontrada",', - 'interwiki_local_1_intro' => 'redirigido a la URL objetivo en las definiciones de enlaces interwiki (es decir, se la trata como a las referencias en páginas locales)', + 'interwiki_prefix_intro' => 'Prefijo interwiki que se utilizará en sintaxis wikitexto [[prefijo:nombre de página]].', + 'interwiki_url_intro' => 'Plantilla para URLs. El marcador $1 será reemplazado por el nombre de página del wikitexto cuando se use la sintaxis de wikitexto mostrada arriba.', + 'interwiki_local' => 'Remitir', + 'interwiki-local-label' => 'Remitir:', + 'interwiki_local_intro' => 'Una solicitud HTTP a la wiki local con este prefijo interwiki en la URL:', + 'interwiki_local_0_intro' => 'no será satisfecha, normalmente mostrando una página de error "título incorrecto" en su lugar.', + 'interwiki_local_1_intro' => 'será remitida a la URL objetivo definida en los enlaces de interwiki.', 'interwiki_trans' => 'transcluir', 'interwiki-trans-label' => 'Transcluir:', - 'interwiki_trans_intro' => 'Si se utiliza la sintaxis de wikitexto {{prefix:pagename}}, entonces:', - 'interwiki_trans_1_intro' => 'permitir la transclusión desde la wiki foránea, si las transclusiones de interwiki son por lo general permitidas en esta wiki,', - 'interwiki_trans_0_intro' => 'no permitirlo. En su lugar, buscar una página en el espacio de nombre de la plantilla.', + 'interwiki_trans_intro' => 'Si se utiliza la sintaxis de wikitexto {{prefijo:nombre de la página}}, entonces:', + 'interwiki_trans_1_intro' => 'se permitirá la transclusión desde la wiki foránea, si las transclusiones de interwiki son por lo general permitidas en este wiki.', + 'interwiki_trans_0_intro' => 'no se permitirá, y en su lugar, buscará una página en el espacio de nombres de plantilla.', 'interwiki_intro_footer' => 'Para más información consulte [//www.mediawiki.org/wiki/Manual:Interwiki_table MediaWiki.org] acerca de la tabla de interwiki. Hay un [[Special:Log/interwiki|registro de cambios]] a esta tabla de interwiki.', 'interwiki_1' => 'sí', @@ -1535,10 +1543,23 @@ Võimalik, et seda pole olemas.', /** Basque (euskara) * @author An13sa * @author Kobazulo + * @author Theklan + * @author Xabier Armendaritz */ $messages['eu'] = array( + 'interwiki' => 'Ikusi eta aldatu interwikiak', + 'interwiki-title-norights' => 'Ikusi interwikiak', + 'interwiki-desc' => 'Interwiki taula ikusi eta aldatzeko [[Special:Interwiki|orrialde berezi]] bat gehitzen du', + 'interwiki_intro' => 'Hau interwiki taularen ikuspegi orokor bat da.', + 'interwiki-legend-show' => 'Erakutsi azalpenak', + 'interwiki-legend-hide' => 'Ezkutatu azalpenak', 'interwiki_prefix' => 'Aurrizkia', 'interwiki-prefix-label' => 'Aurrizkia:', + 'interwiki_local' => 'Aurrera', + 'interwiki-local-label' => 'Aurrera:', + 'interwiki_trans' => 'Txertatu', + 'interwiki-trans-label' => 'Txertatu:', + 'interwiki_trans_intro' => '{{prefix:pagename}} wikitestu erako sintaxia erabiltzen bada, orduan:', 'interwiki_1' => 'bai', 'interwiki_0' => 'ez', 'interwiki_edit' => 'Aldatu', @@ -1547,30 +1568,48 @@ $messages['eu'] = array( 'interwiki_deleting' => '"$1" aurrizkia ezabatzen ari zara.', 'interwiki_addbutton' => 'Gehitu', 'interwiki_edittext' => 'Interwiki aurrizkia editatzen', + 'right-interwiki' => 'Interwiki datuak aldatu', + 'action-interwiki' => 'aldatu interwiki sarrera hau', ); /** Persian (فارسی) + * @author Armin1392 * @author Ebraminio * @author Hamid rostami * @author Huji * @author Mjbmr + * @author Omidh + * @author Reza1615 */ $messages['fa'] = array( 'interwiki' => 'نمایش و ویرایش اطلاعات میان‌ویکی', 'interwiki-title-norights' => 'مشاهدهٔ اطلاعات میان‌ویکی', 'interwiki-desc' => 'یک [[Special:Interwiki|صفحهٔ ویژه]] برای مشاهده و ویرایش جدول میان‌ویکی می‌افزاید.', - 'interwiki_intro' => 'قمستی از افزونهٔ میان‌ویکی. به صورت یک مرور کلی در Special:Interwiki نمایش داده شده.', # Fuzzy + 'interwiki_intro' => 'این یک نمای کلی از جدول interwiki است.', + 'interwiki-legend-show' => 'نمایش افسانه', + 'interwiki-legend-hide' => 'پنهان کردن افسانه', 'interwiki_prefix' => 'پیشوند', 'interwiki-prefix-label' => 'پیشوند:', - 'interwiki_local' => 'مشخص کردن به عنوان یک ویکی محلی', # Fuzzy - 'interwiki-local-label' => 'مشخص کردن به عنوان یک ویکی محلی:', # Fuzzy - 'interwiki_trans' => 'اجازهٔ گنجاندن میان‌ویکی را بده', # Fuzzy - 'interwiki-trans-label' => 'اجازهٔ گنجاندن میان‌ویکی را بده:', # Fuzzy + 'interwiki_prefix_intro' => 'پیشوند ویکی داخلی در [[prefix:pagename]] نحو متن ویکی استفاده شده‌است.', + 'interwiki_url' => 'نشانی اینترنتی', + 'interwiki-url-label' => 'نشانی اینترنتی:', + 'interwiki_url_intro' => 'الگو برای یو‌ار‌ال‌ها. هنگامی که نحو متن ویکی فوق‌الذکر استفاده شده‌است، نگه‌دارندهٔ جا $1 توسط pagename متن ویکی جایگزین خواهد شد.', + 'interwiki_local' => 'جلو', + 'interwiki-local-label' => 'جلو:', + 'interwiki_local_intro' => 'درخواست اچ‌تی‌تی‌پی برای ویکی داخلی با این پیشوند ویکی داخلی در یوآر‌ال هست:', + 'interwiki_local_0_intro' => 'بدون افتخار، اغلب توسط "صفحه پیدا نشد" مسدود شده.', + 'interwiki_local_1_intro' => 'هدایت به یوآر‌ال مورد نظر داده‌ شده در تعاریف لینک ویکی داخلی (یعنی مانند منابع در صفحات داخلی مطرح می‌شود).', + 'interwiki_trans' => 'تراگنجایش', + 'interwiki-trans-label' => 'تراگنجایش:', + 'interwiki_trans_intro' => 'اگر نحو متن ویکی {{prefix:pagename}} استفاده شده‌است، سپس:', + 'interwiki_trans_1_intro' => 'اجازه دادن ترنس‌کلوژن از ویکی خارجی، اگر ترنس‌کلوژن‌های ویکی داخلی در این ویکی به طور کلی اجازه داده خواهد شد.', + 'interwiki_trans_0_intro' => 'اجازه به این ندهید، بلکه به دنبال یک صفحه در فضای نام الگو باشید.', 'interwiki_intro_footer' => 'برای اطلاعات بیشتر در مورد Interwiki به [//www.mediawiki.org/wiki/Manual:Interwiki_table MediaWiki.org] مراحعه نمائید. همچنین می‌توانید [[Special:Log/interwiki|تاریخچهٔ تغییرات]] چدول Interwiki را مشاهده کنید.', 'interwiki_1' => 'بله', 'interwiki_0' => 'خیر', 'interwiki_error' => 'خطا: جدول میان‌ویکی خالی است، یا چیز دیگری مشکل دارد.', + 'interwiki-cached' => 'اطلاعات ویکی داخلی ذخیره شده‌است. اصلاح ذخیره ممکن نیست.', 'interwiki_edit' => 'ویرایش', 'interwiki_reasonfield' => 'دلیل:', 'interwiki_delquestion' => 'حذف «$1»', @@ -1592,7 +1631,11 @@ $messages['fa'] = array( احتمالاً این پیشوند وجود ندارد.', 'interwiki-badprefix' => 'پیشوند میان‌ویکی «$1» حاوی نویسه‌های نامجاز است', 'interwiki-submit-empty' => 'پیشوند و آدرس URL نمی‌توانند خالی باشند.', + 'interwiki-submit-invalidurl' => 'تفاهم‌نامهٔ یوآر‌ال نامعتبر است.', 'log-name-interwiki' => 'سیاههٔ جدول میان‌ویکی', + 'logentry-interwiki-iw_add' => '$1 {{GENDER:$2|اضافه شده}} پیشوند "$4" ($5) (ترانس: $6; local: $7) به جدول ویکی داخلی', + 'logentry-interwiki-iw_edit' => '$1 {{GENDER:$2|اصلاح شده}} پیشوند "$4" ($5) (tترنس: $6; داخلی: $7) در جدول ویکی داخلی', + 'logentry-interwiki-iw_delete' => '$1 {{GENDER:$2|حذف شده}} پیشوند "$4" از جدول ویکی داخلی', 'log-description-interwiki' => 'این یک تاریخچه از تغییرات [[Special:Interwiki|interwiki table]] است.', 'right-interwiki' => 'ویرایش اطلاعات میان‌ویکی', 'action-interwiki' => 'تغییر این مدخل میان‌ویکی', @@ -1745,6 +1788,13 @@ $messages['frp'] = array( 'action-interwiki' => 'changiér ceta entrâ entèrvouiqui', ); +/** Northern Frisian (Nordfriisk) + * @author Murma174 + */ +$messages['frr'] = array( + 'interwiki-title-norights' => 'Interwiki-dooten uunluke', +); + /** Friulian (furlan) * @author Klenje */ @@ -1969,6 +2019,7 @@ $messages['haw'] = array( /** Hebrew (עברית) * @author Agbad * @author Amire80 + * @author Guycn2 * @author Rotemliss * @author YaronSh * @author דניאל ב. @@ -1987,12 +2038,12 @@ $messages['he'] = array( 'interwiki_local' => 'העברה', 'interwiki-local-label' => 'העברה:', 'interwiki_local_intro' => 'בקשת HTTP לאתר הוויקי המקומי עם קידומת בינוויקי זו בכתובת:', - 'interwiki_local_0_intro' => 'לא מכובדת, לרוב נחסמת עם הודעת "הדף לא נמצא",', + 'interwiki_local_0_intro' => 'לא מכובדת, לרוב נחסמת עם הודעת "הדף לא נמצא".', 'interwiki_local_1_intro' => 'מופנית אל כתובת היעד שניתנה בהגדרות קישור הבינוויקי (כלומר מטופלת כמו הפניה בדפים מקומיים)', 'interwiki_trans' => 'הכללה', 'interwiki-trans-label' => 'הכללה:', 'interwiki_trans_intro' => 'אם נעשה שימוש בתחביר {{prefix:pagename}}, אז:', - 'interwiki_trans_1_intro' => 'תינתן האפשרות להכללת מקטעים חיצוניים מאתר ויקי חיצוני, אם הכללות מקטעי ויקי חיצוניים מורשים באופן כללי באתר ויקי זה,', + 'interwiki_trans_1_intro' => 'תינתן האפשרות להכללת מקטעים חיצוניים מאתר ויקי חיצוני, אם הכללות מקטעי ויקי חיצוניים מורשים באופן כללי באתר ויקי זה.', 'interwiki_trans_0_intro' => 'אין לאפשר זאת, במקום זאת יש לחפש דף במרחב השם תבנית.', 'interwiki_intro_footer' => 'עיינו ב־[//www.mediawiki.org/wiki/Manual:Interwiki_table MediaWiki.org] למידע נוסף על טבלת הבינוויקי. ישנו [[Special:Log/interwiki|יומן שינויים]] לטבלת הבינוויקי.', @@ -2363,6 +2414,7 @@ Memora que isto pote rumper ligamines existente.', Es possibile que illo non existe.', 'interwiki-badprefix' => 'Le prefixo interwiki specificate "$1" contine characteres invalide', 'interwiki-submit-empty' => 'Le prefixo e le URL non pote esser vacue.', + 'interwiki-submit-invalidurl' => 'Le protocollo del URL es invalide.', 'log-name-interwiki' => 'Registro del tabella interwiki', 'logentry-interwiki-iw_add' => '$1 {{GENDER:$2|addeva}} le prefixo "$4" ($5) (trans: $6; local: $7) al tabella interwiki', 'logentry-interwiki-iw_edit' => '$1 {{GENDER:$2|modificava}} le prefixo "$4" ($5) (trans: $6; local: $7) in le tabella interwiki', @@ -2828,7 +2880,7 @@ $messages['ko'] = array( 'logentry-interwiki-iw_add' => '$1 사용자가 "$4" ($5) (틀 포함: $6, 로컬: $7) 접두어를 인터위키 테이블에 {{GENDER:$2|추가}}했습니다.', 'logentry-interwiki-iw_edit' => '$1 사용자가 인터위키 테이블의 "$4" ($5) (틀 포함: $6, 로컬: $7) 접두어를 {{GENDER:$2|수정}}했습니다.', 'logentry-interwiki-iw_delete' => '$1 사용자가 인터위키 테이블의 "$4" 접두어를 {{GENDER:$2|삭제}}했습니다.', - 'log-description-interwiki' => '[[Special:Interwiki|인터위키]] 목록의 바뀐 내역입니다.', + 'log-description-interwiki' => '[[Special:Interwiki|인터위키 테이블]]이 바뀐 기록입니다.', 'right-interwiki' => '인터위키 목록 고치기', 'action-interwiki' => '이 인터위키 접두어 바꾸기', ); @@ -2979,11 +3031,11 @@ $messages['lb'] = array( 'interwiki_delfailed' => 'Prefix "$1" konnt net aus der Interwiki-Tabell erausgeholl ginn.', 'interwiki_addtext' => 'En Interwiki-prefix derbäisetzen', 'interwiki_addintro' => 'Dir setzt en neien Interwiki-Prefix derbäi. -Denkt drunn datt keng Espacen ( ), Et-commerciale (&), Gläichzeechen (=) a keng Doppelpunkten (:) däerfen dra sinn.', +Denkt drun datt keng Espacen ( ), Et-commerciale (&), Gläichzeechen (=) a keng Doppelpunkten (:) däerfen dra sinn.', 'interwiki_addbutton' => 'Derbäisetzen', 'interwiki_added' => 'De Prefix "$1" gou an d\'Interwiki-Tabell derbäigesat.', 'interwiki_addfailed' => 'De Prefix "$1" konnt net an d\'Interwiki-Tabell derbäigesat ginn. -Méiglecherweis gëtt et e schn an der Interwiki-Tabell.', +Méiglecherweis gëtt et e schonn an der Interwiki-Tabell.', 'interwiki_edittext' => 'En interwiki Prefix änneren', 'interwiki_editintro' => 'Dir ännert en Interwiki Prefix. Denkt drun, datt dat kann dozou féieren datt Linken déi et scho gëtt net méi funktionéieren.', @@ -3157,7 +3209,7 @@ $messages['mk'] = array( 'interwiki_1' => 'да', 'interwiki_0' => 'не', 'interwiki_error' => 'Грешка: Mеѓувики-табелата е празна, или нешто друго не е во ред.', - 'interwiki-cached' => 'Податоците за меѓувики се кеширани. Кешот не може да се измени.', + 'interwiki-cached' => 'Податоците за меѓувики се меѓускладирани. Меѓускладот не може да се измени.', 'interwiki_edit' => 'Уреди', 'interwiki_reasonfield' => 'Причина:', 'interwiki_delquestion' => 'Бришење на „$1“', @@ -3261,11 +3313,12 @@ $messages['mn'] = array( /** Marathi (मराठी) * @author Kaustubh + * @author V.narsikar */ $messages['mr'] = array( 'interwiki' => 'आंतरविकि डाटा पहा व संपादा', 'interwiki-title-norights' => 'अंतरविकि डाटा पहा', - 'interwiki-desc' => 'आंतरविकि सारणी पाहण्यासाठी व संपादन्यासाठी एक [[Special:Interwiki|विशेष पान]] वाढविते', + 'interwiki-desc' => 'आंतरविकि सारणी पाहण्यासाठी व संपादण्यासाठी एक [[Special:Interwiki|विशेष पान]] वाढविते', 'interwiki_intro' => 'आंतरविकि सारणी बद्दल अधिक माहीतीसाठी [http://www.mediawiki.org/wiki/Interwiki_table MediaWiki.org] पहा.', # Fuzzy 'interwiki_prefix' => 'उपपद (पूर्वप्रत्यय)', 'interwiki-prefix-label' => 'उपपद (पूर्वप्रत्यय):', # Fuzzy @@ -3280,11 +3333,11 @@ $messages['mr'] = array( 'interwiki_addbutton' => 'वाढवा', 'interwiki_added' => '"$1" उपपद आंतरविकि सारणी मध्ये वाढविण्यात आलेले आहे.', 'interwiki_addfailed' => '"$1" उपपद आंतरविकि सारणी मध्ये वाढवू शकलेलो नाही. कदाचित ते अगोदरच अस्तित्वात असण्याची शक्यता आहे.', - 'interwiki_edittext' => 'एक अंतरविकि उपपद संपादित आहे', - 'interwiki_editintro' => 'तुम्ही एक अंतरविकि उपपद संपादित आहात. + 'interwiki_edittext' => 'एक आंतरविकि उपपद संपादित आहे', + 'interwiki_editintro' => 'तुम्ही एक आंतरविकि उपपद संपादित आहात. लक्षात ठेवा की यामुळे अगोदर दिलेले दुवे तुटू शकतात.', - 'interwiki_edited' => 'अंतरविकि सारणीमध्ये "$1" उपपद यशस्वीरित्या बदलण्यात आलेले आहे.', - 'interwiki_editerror' => 'अंतरविकि सारणीमध्ये "$1" उपपद बदलू शकत नाही. + 'interwiki_edited' => 'आंतरविकि सारणीमध्ये "$1" उपपद यशस्वीरित्या बदलण्यात आलेले आहे.', + 'interwiki_editerror' => 'आंतरविकि सारणीमध्ये "$1" उपपद बदलू शकत नाही. कदाचित ते अस्तित्वात नसेल.', 'log-name-interwiki' => 'आंतरविकि सारणी नोंद', 'log-description-interwiki' => '[[Special:Interwiki|आंतरविकि सारणीत]] झालेल्या बदलांची ही सूची आहे.', @@ -3783,6 +3836,7 @@ Vielaischd hods des a ned.", /** Polish (polski) * @author BeginaFelicysym + * @author Chrumps * @author Leinad * @author Matma Rex * @author McMonster @@ -3808,7 +3862,7 @@ $messages['pl'] = array( 'interwiki_trans' => 'Transkluzja', 'interwiki-trans-label' => 'Transkluzja:', 'interwiki_trans_intro' => 'Jeśli składnia wiki {{przedrostek:nazwastrony}} została użyta, to:', - 'interwiki_trans_1_intro' => 'pozwala na transkluzję z innych wiki, jeśli transkluzja interwiki jest w ogóle dozwolona na tej wiki,', + 'interwiki_trans_1_intro' => 'pozwala na transkluzję z innych wiki, jeśli transkluzja interwiki jest w ogóle dozwolona na tej wiki.', 'interwiki_trans_0_intro' => 'nie pozwalaj na nią, raczej szukaj strony w przestrzeni szablonów.', 'interwiki_intro_footer' => 'Na [//www.mediawiki.org/wiki/Manual:Interwiki_table MediaWiki.org] odnajdziesz więcej informacji na temat tabeli interwiki. Tutaj znajduje się [[Special:Log/interwiki|rejestr zmian]] tabeli interwiki.', @@ -4054,6 +4108,9 @@ Existe um [[Special:Log/interwiki|registro de modificações]] à tabela de inte 'interwiki-submit-empty' => 'O prefixo e o URL não podem estar vazios.', 'interwiki-submit-invalidurl' => 'O protocolo do URL é inválido.', 'log-name-interwiki' => 'Registro da tabela de interwikis', + 'logentry-interwiki-iw_add' => '$1 {{GENDER:$2|adicionou}} o prefixo "$4" ($5) (trans: $6; local: $7) à tabela de interwikis', + 'logentry-interwiki-iw_edit' => '$1 {{GENDER:$2|modificou}} o prefixo "$4" ($5) (trans: $6; local: $7) na tabela de interwikis', + 'logentry-interwiki-iw_delete' => '$1 {{GENDER:$2|removeu}} o prefixo "$4" da tabela de interwikis', 'log-description-interwiki' => 'Este é um registro das alterações à [[Special:Interwiki|tabela de interwikis]].', 'right-interwiki' => 'Editar dados de interwiki', 'action-interwiki' => 'alterar esta entrada interwiki', @@ -4107,12 +4164,16 @@ $messages['roa-tara'] = array( 'interwiki_prefix_intro' => "'U prefisse inderuicchi avène ausate jndr'à [[prefix:pagename]] sindasse uicchiteste.", 'interwiki_local' => 'Inoltre', 'interwiki-local-label' => 'Inoltre:', + 'interwiki_local_intro' => "'Na richieste HTTP sus a sta uicchi locale cu ste prefisse inderuicchi jndr'à URL jè:", + 'interwiki_local_0_intro' => 'none onorate, normalmende bloccate da "pàgene none acchiate".', 'interwiki_1' => 'sine', 'interwiki_0' => 'none', 'interwiki_edit' => 'Cange', 'interwiki_reasonfield' => 'Mutive:', 'interwiki_delquestion' => 'Scangellamende de "$1"', 'interwiki_deleting' => 'Tu ste scangille \'u prefisse "$1".', + 'interwiki_deleted' => '\'U prefisse "$1" ha state luate da \'a tabbelle de inderuicchi.', + 'interwiki_delfailed' => '\'U prefisse "$1" non ge pò essere luate da \'a tabbelle de inderuicchi.', 'interwiki_addtext' => "Aggiunge 'nu prefisse inderuicchi", 'interwiki_addbutton' => 'Aggiunge', 'right-interwiki' => 'Cange le date de inderuicchi', @@ -4267,16 +4328,21 @@ Lu prifissu putissi èssiri ca non c\'è.', /** Sassaresu (Sassaresu) * @author Felis + * @author Jun Misugi */ $messages['sdc'] = array( - 'interwiki' => 'Vidè e mudìfiggà li dati interwiki', + 'interwiki' => 'Vidè e mudifiggà li dati interwiki', + 'interwiki-title-norights' => 'Vidé li dati interwiki', 'interwiki_prefix' => 'Prefissu', - 'interwiki-prefix-label' => 'Prefissu:', # Fuzzy - 'interwiki_reasonfield' => 'Rasgioni', # Fuzzy - 'interwiki_delquestion' => 'Canzillendi "$1"', - 'interwiki_deleting' => 'Sei canzillendi lu prefissu "$1".', + 'interwiki-prefix-label' => 'Prefissu:', + 'interwiki_1' => 'si', + 'interwiki_0' => 'no', + 'interwiki_edit' => 'Mudifiggà', + 'interwiki_reasonfield' => 'Rasgioni', + 'interwiki_delquestion' => 'Canzillendhi "$1"', + 'interwiki_deleting' => 'Sei canzillendhi lu prefissu "$1".', 'interwiki_addtext' => 'Aggiungi un prefissu interwiki', - 'interwiki_addbutton' => 'Aggiungi', + 'interwiki_addbutton' => 'Aggiungì', 'log-name-interwiki' => 'Rigisthru di la table interwiki', ); @@ -4411,6 +4477,7 @@ Morda ne obstaja.', ); /** Serbian (Cyrillic script) (српски (ћирилица)‎) + * @author Milicevic01 * @author Rancher * @author Sasa Stefanovic * @author Жељко Тодоровић @@ -4452,13 +4519,14 @@ $messages['sr-ec'] = array( 'interwiki_editerror' => 'Префикс "$1" не може бити измењен у табели међувикија. Вероватно затшо што не постоји.', 'interwiki-badprefix' => 'Задати међувики префикс "$1" садржи недозвољене знакове', - 'log-name-interwiki' => 'Историја табеле међувикија', + 'log-name-interwiki' => 'Дневник табеле међувикија', 'log-description-interwiki' => 'Ово је историја измена [[Special:Interwiki|табеле међувикија]].', 'right-interwiki' => 'уређивање међувикија', ); /** Serbian (Latin script) (srpski (latinica)‎) * @author Michaello + * @author Milicevic01 * @author Жељко Тодоровић */ $messages['sr-el'] = array( @@ -4497,9 +4565,9 @@ Imajte na umu da može da ošteti postojeće međuviki veze.', 'interwiki_editerror' => 'Prefiks "$1" ne može biti izmenjen u tabeli međuvikija. Verovatno zatšo što ne postoji.', 'interwiki-badprefix' => 'Zadati međuviki prefiks "$1" sadrži nedozvoljene znakove', - 'log-name-interwiki' => 'Istorija tabele međuvikija', + 'log-name-interwiki' => 'Dnevnik tabele međuvikija', 'log-description-interwiki' => 'Ovo je istorija izmena [[Special:Interwiki|tabele međuvikija]].', - 'right-interwiki' => 'Izmeni međuviki', + 'right-interwiki' => 'uređivanje međuvikija', ); /** Seeltersk (Seeltersk) @@ -4556,13 +4624,16 @@ $messages['sv'] = array( 'interwiki_prefix' => 'Prefix', 'interwiki-prefix-label' => 'Prefix:', 'interwiki_prefix_intro' => 'Interwiki-prefix avsedda att användas i [[prefix:pagename]]-wikisyntax.', + 'interwiki_url_intro' => 'Mall för webbadresser. Platshållaren $1 kommer att ersättas av sidnamnet i wikitexten, när den ovannämnda wikitextsyntaxen används.', 'interwiki_local' => 'Vidarebefordra', 'interwiki-local-label' => 'Vidarebefordra:', 'interwiki_local_intro' => 'En HTTP-förfrågan till den lokala wikin med denna interwiki-prefix i webbadressen är:', 'interwiki_local_0_intro' => 'inte accepterad, vanligtvis blockerad av "sidan kunde inte hittas".', + 'interwiki_local_1_intro' => 'omdirigeras till måladressen som anges i definitionerna av interwiki-länken (d.v.s. behandlas som referenser i lokala sidor).', 'interwiki_trans' => 'Transkludera', 'interwiki-trans-label' => 'Transkludera:', 'interwiki_trans_intro' => 'Om wikitextsyntax {{prefix:pagename}} används så:', + 'interwiki_trans_1_intro' => 'tillåt inkludering från utländska wikin, om interwiki-inkluderingar är allmänt tillåten på denna wiki.', 'interwiki_trans_0_intro' => 'tillåt inte det, leta istället efter en sida i mall-namnrymden.', 'interwiki_intro_footer' => 'Se [//www.mediawiki.org/wiki/Manual:Interwiki_table MediaWiki.org] för mer information om interwikitabellen. Det finns en [[Special:Log/interwiki|logg över ändringar]] i interwikitabellen.', @@ -4648,6 +4719,7 @@ $messages['tcy'] = array( ); /** Telugu (తెలుగు) + * @author Chaduvari * @author Kiranmayee * @author Veeven */ @@ -4663,7 +4735,7 @@ $messages['te'] = array( అంతర్వికీ పట్టికకి జరిగిన [[Special:Log/interwiki|మార్పుల యొక్క చిట్టా]] కూడా ఉంది.', 'interwiki_1' => 'అవును', 'interwiki_0' => 'కాదు', - 'interwiki_error' => 'పొరపాటు: అంతర్వికీ పట్టిక ఖాళీగా ఉంది, లేదా ఏదో తప్పు జరిగింది.', + 'interwiki_error' => 'లోపం: అంతర్వికీ పట్టిక ఖాళీగా ఉంది, లేదా మరేదో తప్పు జరిగింది.', 'interwiki_edit' => 'మార్చు', 'interwiki_reasonfield' => 'కారణం:', 'interwiki_delquestion' => '"$1"ని తొలగిస్తున్నారు', @@ -5153,6 +5225,7 @@ $messages['yi'] = array( ); /** Cantonese (粵語) + * @author Antonytse */ $messages['yue'] = array( 'interwiki' => '去睇同編輯跨維基資料', @@ -5165,7 +5238,7 @@ $messages['yue'] = array( 'interwiki_trans' => '容許跨維基包含', # Fuzzy 'interwiki-trans-label' => '容許跨維基包含:', # Fuzzy 'interwiki_error' => '錯誤: 跨維基表係空、又或者有其它嘢出錯。', - 'interwiki_reasonfield' => '原因', # Fuzzy + 'interwiki_reasonfield' => '原因:', 'interwiki_delquestion' => '刪緊 "$1"', 'interwiki_deleting' => '你而家拎走緊前綴 "$1"。', 'interwiki_deleted' => '前綴 "$1" 已經成功噉響個跨維基表度拎走咗。', @@ -5201,7 +5274,7 @@ $messages['yue'] = array( */ $messages['zh-hans'] = array( 'interwiki' => '查看和编辑跨wiki数据', - 'interwiki-title-norights' => '查看跨维基数据', + 'interwiki-title-norights' => '查看跨wiki数据', 'interwiki-desc' => '新增[[Special:Interwiki|特殊页面]]以查看和编辑跨wiki表', 'interwiki_intro' => '这是跨wiki表的概览。', 'interwiki-legend-show' => '显示说明', @@ -5224,7 +5297,7 @@ $messages['zh-hans'] = array( 'interwiki_1' => '是', 'interwiki_0' => '否', 'interwiki_error' => '错误: 跨wiki表为空,或是发生其它错误。', - 'interwiki-cached' => '跨wiki数据已缓存。缓存不能编辑。', + 'interwiki-cached' => '跨维基数据是缓存的。缓存不能被修改。', 'interwiki_edit' => '编辑', 'interwiki_reasonfield' => '理由:', 'interwiki_delquestion' => '正在删除“$1”', @@ -5252,7 +5325,7 @@ $messages['zh-hans'] = array( 'logentry-interwiki-iw_edit' => '$1{{GENDER:$2|已修改}}跨wiki表中的前缀“$4”($5) (包含:$6;本地:$7)', 'logentry-interwiki-iw_delete' => '$1已从跨wiki表中{{GENDER:$2|删除}}前缀“$4”', 'log-description-interwiki' => '这是一个[[Special:Interwiki|跨wiki表]]的更改日志。', - 'right-interwiki' => '编辑跨维基数据', + 'right-interwiki' => '编辑跨wiki数据', 'action-interwiki' => '更改该跨维基条目', ); diff --git a/extensions/Interwiki/Interwiki_body.php b/extensions/Interwiki/Interwiki_body.php index ec104968..fd982811 100644 --- a/extensions/Interwiki/Interwiki_body.php +++ b/extensions/Interwiki/Interwiki_body.php @@ -36,7 +36,7 @@ class SpecialInterwiki extends SpecialPage { $out->addModules( 'ext.interwiki.specialpage' ); $action = $par ? $par : $request->getVal( 'action', $par ); - $return = $this->getTitle(); + $return = $this->getPageTitle(); switch( $action ) { case 'delete': @@ -186,7 +186,7 @@ class SpecialInterwiki extends SpecialPage { array( 'id' => "mw-interwiki-{$action}form", 'method' => 'post', - 'action' => $this->getTitle()->getLocalUrl( array( + 'action' => $this->getPageTitle()->getLocalUrl( array( 'action' => 'submit', 'prefix' => $prefix ) ) @@ -229,7 +229,7 @@ class SpecialInterwiki extends SpecialPage { return; } $reason = $request->getText( 'wpInterwikiReason' ); - $selfTitle = $this->getTitle(); + $selfTitle = $this->getPageTitle(); $dbw = wfGetDB( DB_MASTER ); switch( $do ) { case 'delete': @@ -325,7 +325,7 @@ class SpecialInterwiki extends SpecialPage { if ( $canModify ) { $this->getOutput()->addHTML( "
      " . $this->msg( 'interwiki_intro_footer' )->parse() ); $addtext = $this->msg( 'interwiki_addtext' )->escaped(); - $addlink = Linker::linkKnown( $this->getTitle( 'add' ), $addtext ); + $addlink = Linker::linkKnown( $this->getPageTitle( 'add' ), $addtext ); $this->getOutput()->addHTML( '' ); } @@ -363,7 +363,7 @@ class SpecialInterwiki extends SpecialPage { ); $out .= Html::closeElement( 'tr' ) . "\n"; - $selfTitle = $this->getTitle(); + $selfTitle = $this->getPageTitle(); # Output the existing Interwiki prefixes table rows foreach ( $iwPrefixes as $iwPrefix ) { diff --git a/extensions/LocalisationUpdate/KNOWN_ISSUES.txt b/extensions/LocalisationUpdate/KNOWN_ISSUES.txt deleted file mode 100644 index 7ce14cd0..00000000 --- a/extensions/LocalisationUpdate/KNOWN_ISSUES.txt +++ /dev/null @@ -1,11 +0,0 @@ -- Only works with SVN revision 50605 or later of the - MediaWiki core - - - -Key issues at the moment: -* Seems to want to store a copy of the localization updates in each local database. -We've got hundreds of wikis run from the same installation set; we don't want to multiply our effort by 1000. - -* It doesn't seem to be using available memcached stuff; unsure yet whether this is taken care of -by the general message caching or if we're going to end up making extra hits we don't need. diff --git a/extensions/LocalisationUpdate/LocalisationUpdate.class.php b/extensions/LocalisationUpdate/LocalisationUpdate.class.php index 66b63232..24620545 100644 --- a/extensions/LocalisationUpdate/LocalisationUpdate.class.php +++ b/extensions/LocalisationUpdate/LocalisationUpdate.class.php @@ -3,7 +3,7 @@ /** * Class for localization updates. * - * TODO: refactor code to remove duplication + * @todo Refactor code to remove duplication */ class LocalisationUpdate { @@ -60,7 +60,7 @@ class LocalisationUpdate { $skipCore = isset( $options['skip-core'] ); $skipExtensions = isset( $options['skip-extensions'] ); - if( isset( $options['outdir'] ) ) { + if ( isset( $options['outdir'] ) ) { $wgLocalisationUpdateDirectory = $options['outdir']; } @@ -82,25 +82,25 @@ class LocalisationUpdate { $result = 0; // Update all MW core messages. - if( !$skipCore ) { + if ( !$skipCore ) { $result = self::updateMediawikiMessages( $verbose, $coreUrl ); } // Update all Extension messages. - if( !$skipExtensions ) { - if( $all ) { + if ( !$skipExtensions ) { + if ( $all ) { global $IP; $extFiles = array(); // Look in extensions/ for all available items... - // TODO: add support for $wgExtensionAssetsPath + // @todo Add support for $wgExtensionAssetsPath $dirs = new RecursiveDirectoryIterator( "$IP/extensions/" ); // I ain't kidding... RecursiveIteratorIterator. - foreach( new RecursiveIteratorIterator( $dirs ) as $pathname => $item ) { + foreach ( new RecursiveIteratorIterator( $dirs ) as $pathname => $item ) { $filename = basename( $pathname ); $matches = array(); - if( preg_match( '/^(.*)\.i18n\.php$/', $filename, $matches ) ) { + if ( preg_match( '/^(.*)\.i18n\.php$/', $filename, $matches ) ) { $group = $matches[1]; $extFiles[$group] = $pathname; } @@ -187,7 +187,14 @@ class LocalisationUpdate { ); // Compare the files. - $changedCount += self::compareFiles( $repoUrl, $localUrl, $verbose, $changedEnglishStrings, false, true ); + $changedCount += self::compareFiles( + $repoUrl, + $localUrl, + $verbose, + $changedEnglishStrings, + false, + true + ); } // Log some nice info. @@ -218,7 +225,7 @@ class LocalisationUpdate { preg_match_all( '/\$messages(.*\s)*?\);/', $contents, $results ); // But we want them all in one string. - if( !empty( $results[0] ) && is_array( $results[0] ) ) { + if ( !empty( $results[0] ) && is_array( $results[0] ) ) { $contents = implode( "\n\n", $results[0] ); } else { $contents = ''; @@ -245,8 +252,8 @@ class LocalisationUpdate { // Use cURL to get the SVN contents. if ( preg_match( "/^http/", $file ) ) { - while( !$filecontents && $attempts <= $wgLocalisationUpdateRetryAttempts ) { - if( $attempts > 0 ) { + while ( !$filecontents && $attempts <= $wgLocalisationUpdateRetryAttempts ) { + if ( $attempts > 0 ) { $delay = 1; self::myLog( 'Failed to download ' . $file . "; retrying in ${delay}s..." ); sleep( $delay ); @@ -257,11 +264,13 @@ class LocalisationUpdate { } if ( !$filecontents ) { self::myLog( 'Cannot get the contents of ' . $file . ' (curl)' ); + return false; } - } else {// otherwise try file_get_contents + } else { // otherwise try file_get_contents if ( !( $filecontents = file_get_contents( $file ) ) ) { self::myLog( 'Cannot get the contents of ' . $file ); + return false; } } @@ -281,16 +290,20 @@ class LocalisationUpdate { * * @return array */ - public static function loadFilesToCompare( $tag, $file1, $file2, $verbose, $alwaysGetResult = true ) { + public static function loadFilesToCompare( $tag, $file1, $file2, $verbose, + $alwaysGetResult = true + ) { $file1contents = self::getFileContents( $file1 ); if ( $file1contents === false || $file1contents === '' ) { self::myLog( "Failed to read $file1" ); + return array( null, null ); } $file2contents = self::getFileContents( $file2 ); if ( $file2contents === false || $file2contents === '' ) { self::myLog( "Failed to read $file2" ); + return array( null, null ); } @@ -304,7 +317,11 @@ class LocalisationUpdate { // Check if the file has changed since our last update. if ( !$alwaysGetResult ) { if ( !self::checkHash( $file1, $file1hash ) && !self::checkHash( $file2, $file2hash ) ) { - self::myLog( "Skipping {$tag} since the files haven't changed since our last update", $verbose ); + self::myLog( + "Skipping {$tag} since the files haven't changed since our last update", + $verbose + ); + return array( null, null ); } } @@ -318,6 +335,7 @@ class LocalisationUpdate { } else { // Broken file? Report and bail self::myLog( "Failed to parse $file1" ); + return array( null, null ); } } @@ -330,6 +348,7 @@ class LocalisationUpdate { $messages2 = array(); } else { self::myLog( "Failed to parse $file2" ); + return array( null, null ); } } @@ -353,7 +372,9 @@ class LocalisationUpdate { * * @return array|int */ - private static function compareLanguageArrays( $langcode, $old_messages, $new_messages, $verbose, $forbiddenKeys, $saveResults ) { + private static function compareLanguageArrays( $langcode, $old_messages, + $new_messages, $verbose, $forbiddenKeys, $saveResults + ) { // Get the currently-cached messages, if any $cur_messages = self::readFile( $langcode ); @@ -369,7 +390,6 @@ class LocalisationUpdate { ); } - if ( $saveResults ) { // If anything has changed from the saved version, save the new version if ( $new_messages != $cur_messages ) { @@ -384,10 +404,12 @@ class LocalisationUpdate { } else { $updates = 0; } + return $updates; } else { // Find all deleted or changed messages $changedStrings = array_diff_assoc( $old_messages, $new_messages ); + return $changedStrings; } } @@ -404,7 +426,9 @@ class LocalisationUpdate { * * @return array|int */ - public static function compareFiles( $newfile, $oldfile, $verbose, array $forbiddenKeys = array(), $alwaysGetResult = true, $saveResults = false ) { + public static function compareFiles( $newfile, $oldfile, $verbose, + array $forbiddenKeys = array(), $alwaysGetResult = true, $saveResults = false + ) { // Get the languagecode. $langcode = Language::getCodeFromFileName( $newfile, 'Messages' ); @@ -415,7 +439,14 @@ class LocalisationUpdate { return $saveResults ? 0 : array(); } - return self::compareLanguageArrays( $langcode, $old_messages, $new_messages, $verbose, $forbiddenKeys, $saveResults ); + return self::compareLanguageArrays( + $langcode, + $old_messages, + $new_messages, + $verbose, + $forbiddenKeys, + $saveResults + ); } /** @@ -449,7 +480,14 @@ class LocalisationUpdate { } // Find the changed english strings. - $forbiddenKeys = self::compareLanguageArrays( 'en', $old_messages['en'], $new_messages['en'], $verbose, array(), false ); + $forbiddenKeys = self::compareLanguageArrays( + 'en', + $old_messages['en'], + $new_messages['en'], + $verbose, + array(), + false + ); // Do an update for each language. foreach ( $new_messages as $language => $messages ) { @@ -461,7 +499,14 @@ class LocalisationUpdate { $old_messages[$language] = array(); } - $updates += self::compareLanguageArrays( $language, $old_messages[$language], $messages, $verbose, $forbiddenKeys, true ); + $updates += self::compareLanguageArrays( + $language, + $old_messages[$language], + $messages, + $verbose, + $forbiddenKeys, + true + ); } // And log some stuff. @@ -473,7 +518,7 @@ class LocalisationUpdate { /** * Checks whether a messages file has a certain hash. * - * TODO: Swap return values, this is insane + * @todo Swap return values, this is insane * * @param $file string Filename * @param $hash string Hash @@ -482,7 +527,12 @@ class LocalisationUpdate { */ public static function checkHash( $file, $hash ) { $hashes = self::readFile( 'hashes' ); - return @$hashes[$file] !== $hash; + + wfSuppressWarnings(); + $return = $hashes[$file] !== $hash; + wfRestoreWarnings(); + + return $return; } /** @@ -514,7 +564,7 @@ class LocalisationUpdate { if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) { wfDebug( $log . "\n" ); } else { - print( $log . "\n" ); + print "$log\n"; } } @@ -525,10 +575,12 @@ class LocalisationUpdate { */ public static function parsePHP( $php, $varname ) { try { - $reader = new QuickArrayReader("getVar( $varname ); - } catch( Exception $e ) { + } catch ( Exception $e ) { self::myLog( "Failed to read file: " . $e ); + return false; } } @@ -559,7 +611,9 @@ class LocalisationUpdate { public static function readFile( $lang ) { if ( !isset( self::$filecache[$lang] ) ) { $file = self::filename( $lang ); - $contents = @file_get_contents( $file ); + wfSuppressWarnings(); + $contents = file_get_contents( $file ); + wfRestoreWarnings(); if ( $contents === false ) { wfDebug( "Failed to read file '$file'\n" ); @@ -586,11 +640,12 @@ class LocalisationUpdate { public static function writeFile( $lang, $var ) { $file = self::filename( $lang ); - if ( !@file_put_contents( $file, serialize( $var ) ) ) { + wfSuppressWarnings(); + if ( !file_put_contents( $file, serialize( $var ) ) ) { throw new MWException( "Failed to write to file '$file'" ); } + wfRestoreWarnings(); self::$filecache[$lang] = $var; } - } diff --git a/extensions/LocalisationUpdate/LocalisationUpdate.i18n.php b/extensions/LocalisationUpdate/LocalisationUpdate.i18n.php index c45af9e2..0e73e3bc 100644 --- a/extensions/LocalisationUpdate/LocalisationUpdate.i18n.php +++ b/extensions/LocalisationUpdate/LocalisationUpdate.i18n.php @@ -5,7 +5,7 @@ * @file * @ingroup Extensions */ - + $messages = array(); /** English @@ -102,7 +102,14 @@ $messages['ca'] = array( 'localisationupdate-desc' => 'Manté els missatges localitzats tan actualitzats com sigui possible', ); -/** Czech (česky) +/** Chechen (нохчийн) + * @author Умар + */ +$messages['ce'] = array( + 'localisationupdate-desc' => 'Таро ма хуьйла хаамашан болх бан гӀо до', +); + +/** Czech (čeština) * @author Mormegil */ $messages['cs'] = array( @@ -304,9 +311,10 @@ $messages['ksh'] = array( /** Luxembourgish (Lëtzebuergesch) * @author Robby + * @author Soued031 */ $messages['lb'] = array( - 'localisationupdate-desc' => 'hält déi lokaliséiert Messagen esou aktuell wéi méiglech.', + 'localisationupdate-desc' => 'hält déi lokaliséiert Messagen sou aktuell wéi méiglech.', ); /** Macedonian (македонски) diff --git a/extensions/LocalisationUpdate/LocalisationUpdate.php b/extensions/LocalisationUpdate/LocalisationUpdate.php index abec5406..f73304cd 100644 --- a/extensions/LocalisationUpdate/LocalisationUpdate.php +++ b/extensions/LocalisationUpdate/LocalisationUpdate.php @@ -11,7 +11,6 @@ */ $wgLocalisationUpdateDirectory = false; - /** * These should point to either an HTTP-accessible file or local file system. * $1 is the name of the repo (for extensions) and $2 is the name of file in the repo. @@ -19,7 +18,8 @@ $wgLocalisationUpdateDirectory = false; */ $wgLocalisationUpdateCoreURL = "https://git.wikimedia.org/raw/mediawiki%2Fcore.git/HEAD/$4"; -$wgLocalisationUpdateExtensionURL = "https://git.wikimedia.org/raw/mediawiki%2Fextensions%2F$3.git/HEAD/$4"; +$wgLocalisationUpdateExtensionURL = + "https://git.wikimedia.org/raw/mediawiki%2Fextensions%2F$3.git/HEAD/$4"; /// Deprecated $wgLocalisationUpdateSVNURL = false; @@ -28,11 +28,11 @@ $wgLocalisationUpdateRetryAttempts = 5; // Info about me! $wgExtensionCredits['other'][] = array( - 'path' => __FILE__, - 'name' => 'LocalisationUpdate', - 'author' => array( 'Tom Maaswinkel', 'Niklas Laxström', 'Roan Kattouw' ), - 'version' => '1.0', - 'url' => 'https://www.mediawiki.org/wiki/Extension:LocalisationUpdate', + 'path' => __FILE__, + 'name' => 'LocalisationUpdate', + 'author' => array( 'Tom Maaswinkel', 'Niklas Laxström', 'Roan Kattouw' ), + 'version' => '1.0', + 'url' => 'https://www.mediawiki.org/wiki/Extension:LocalisationUpdate', 'descriptionmsg' => 'localisationupdate-desc', ); diff --git a/extensions/LocalisationUpdate/QuickArrayReader.php b/extensions/LocalisationUpdate/QuickArrayReader.php index 214d5a61..453032f2 100644 --- a/extensions/LocalisationUpdate/QuickArrayReader.php +++ b/extensions/LocalisationUpdate/QuickArrayReader.php @@ -8,7 +8,7 @@ * order of magnitude slower than eval(). */ class QuickArrayReader { - var $vars = array(); + private $vars = array(); /** * @param $string string @@ -27,96 +27,100 @@ class QuickArrayReader { ); $tokens = token_get_all( $string ); $count = count( $tokens ); - for( $i = 0; $i < $count; ) { - while( isset($skipTypes[$tokens[$i][0]] ) ) { + for ( $i = 0; $i < $count; ) { + while ( isset( $skipTypes[$tokens[$i][0]] ) ) { $i++; } - switch( $tokens[$i][0] ) { - case T_OPEN_TAG: - $i++; - continue; - case T_VARIABLE: - // '$messages' -> 'messages' - $varname = trim( substr( $tokens[$i][1], 1 ) ); - $varindex = null; - - while( isset($skipTypes[$tokens[++$i][0]] ) ); + switch ( $tokens[$i][0] ) { + case T_OPEN_TAG: + $i++; + continue; + case T_VARIABLE: + // '$messages' -> 'messages' + $varname = trim( substr( $tokens[$i][1], 1 ) ); + $varindex = null; + + while ( isset( $skipTypes[$tokens[++$i][0]] ) ); + + if ( $tokens[$i] === '[' ) { + while ( isset( $skipTypes[$tokens[++$i][0]] ) ); + + if ( isset( $scalarTypes[$tokens[$i][0]] ) ) { + $varindex = $this->parseScalar( $tokens[$i] ); + } else { + throw $this->except( $tokens[$i], 'scalar index' ); + } + while ( isset( $skipTypes[$tokens[++$i][0]] ) ); - if( $tokens[$i] === '[' ) { - while( isset($skipTypes[$tokens[++$i][0]] ) ); + if ( $tokens[$i] !== ']' ) { + throw $this->except( $tokens[$i], ']' ); + } + while ( isset( $skipTypes[$tokens[++$i][0]] ) ); + } - if( isset($scalarTypes[$tokens[$i][0]] ) ) { - $varindex = $this->parseScalar( $tokens[$i] ); + if ( $tokens[$i] !== '=' ) { + throw $this->except( $tokens[$i], '=' ); + } + while ( isset( $skipTypes[$tokens[++$i][0]] ) ); + + if ( isset( $scalarTypes[$tokens[$i][0]] ) ) { + $buildval = $this->parseScalar( $tokens[$i] ); + } elseif ( $tokens[$i][0] === T_ARRAY ) { + while ( isset( $skipTypes[$tokens[++$i][0]] ) ); + if ( $tokens[$i] !== '(' ) { + throw $this->except( $tokens[$i], '(' ); + } + $buildval = array(); + do { + while ( isset( $skipTypes[$tokens[++$i][0]] ) ); + + if ( $tokens[$i] === ')' ) { + break; + } + if ( isset( $scalarTypes[$tokens[$i][0]] ) ) { + $key = $this->parseScalar( $tokens[$i] ); + } + while ( isset( $skipTypes[$tokens[++$i][0]] ) ); + + if ( $tokens[$i][0] !== T_DOUBLE_ARROW ) { + throw $this->except( $tokens[$i], '=>' ); + } + while ( isset( $skipTypes[$tokens[++$i][0]] ) ); + + if ( isset( $scalarTypes[$tokens[$i][0]] ) ) { + $val = $this->parseScalar( $tokens[$i] ); + } + wfSuppressWarnings(); + $buildval[$key] = $val; + wfRestoreWarnings(); + while ( isset( $skipTypes[$tokens[++$i][0]] ) ); + + if ( $tokens[$i] === ',' ) { + continue; + } elseif ( $tokens[$i] === ')' ) { + break; + } else { + throw $this->except( $tokens[$i], ', or )' ); + } + } while ( true ); } else { - throw $this->except( $tokens[$i], 'scalar index' ); + throw $this->except( $tokens[$i], 'scalar or array' ); } - while( isset($skipTypes[$tokens[++$i][0]] ) ); - - if( $tokens[$i] !== ']' ) { - throw $this->except( $tokens[$i], ']' ); + if ( is_null( $varindex ) ) { + $this->vars[$varname] = $buildval; + } else { + wfSuppressWarnings(); + $this->vars[$varname][$varindex] = $buildval; + wfRestoreWarnings(); } - while( isset($skipTypes[$tokens[++$i][0]] ) ); - } - - if( $tokens[$i] !== '=' ) { - throw $this->except( $tokens[$i], '=' ); - } - while( isset($skipTypes[$tokens[++$i][0]] ) ); - - if( isset($scalarTypes[$tokens[$i][0]] ) ) { - $buildval = $this->parseScalar( $tokens[$i] ); - } elseif( $tokens[$i][0] === T_ARRAY ) { - while( isset($skipTypes[$tokens[++$i][0]] ) ); - if( $tokens[$i] !== '(' ) { - throw $this->except( $tokens[$i], '(' ); + while ( isset( $skipTypes[$tokens[++$i][0]] ) ); + if ( $tokens[$i] !== ';' ) { + throw $this->except( $tokens[$i], ';' ); } - $buildval = array(); - do { - while( isset($skipTypes[$tokens[++$i][0]] ) ); - - if( $tokens[$i] === ')' ) { - break; - } - if( isset($scalarTypes[$tokens[$i][0]] ) ) { - $key = $this->parseScalar( $tokens[$i] ); - } - while( isset($skipTypes[$tokens[++$i][0]] ) ); - - if( $tokens[$i][0] !== T_DOUBLE_ARROW ) { - throw $this->except( $tokens[$i], '=>' ); - } - while( isset($skipTypes[$tokens[++$i][0]] ) ); - - if( isset($scalarTypes[$tokens[$i][0]] ) ) { - $val = $this->parseScalar( $tokens[$i] ); - } - @$buildval[$key] = $val; - while( isset($skipTypes[$tokens[++$i][0]] ) ); - - if( $tokens[$i] === ',' ) { - continue; - } elseif( $tokens[$i] === ')' ) { - break; - } else { - throw $this->except( $tokens[$i], ', or )' ); - } - } while(true); - } else { - throw $this->except( $tokens[$i], 'scalar or array' ); - } - if( is_null( $varindex ) ) { - $this->vars[$varname] = $buildval; - } else { - @$this->vars[$varname][$varindex] = $buildval; - } - while( isset($skipTypes[$tokens[++$i][0]] ) ); - if( $tokens[$i] !== ';' ) { - throw $this->except($tokens[$i], ';'); - } - $i++; - break; - default: - throw $this->except($tokens[$i], 'open tag, whitespace, or variable.'); + $i++; + break; + default: + throw $this->except( $tokens[$i], 'open tag, whitespace, or variable.' ); } } } @@ -127,11 +131,12 @@ class QuickArrayReader { * @return Exception */ private function except( $got, $expected ) { - if( is_array( $got ) ) { + if ( is_array( $got ) ) { $got = token_name( $got[0] ) . " ('" . $got[1] . "')"; } else { $got = "'" . $got . "'"; } + return new Exception( "Expected $expected, got $got" ); } @@ -143,30 +148,42 @@ class QuickArrayReader { * @return mixed Parsed value */ function parseScalar( $token ) { - if( is_array( $token ) ) { + if ( is_array( $token ) ) { $str = $token[1]; } else { $str = $token; } - if ( $str !== '' && $str[0] == '\'' ) + if ( $str !== '' && $str[0] == '\'' ) { // Single-quoted string // @fixme trim() call is due to mystery bug where whitespace gets // appended to the token; without it we ended up reading in the // extra quote on the end! return strtr( substr( trim( $str ), 1, -1 ), array( '\\\'' => '\'', '\\\\' => '\\' ) ); - if ( $str !== '' && @$str[0] == '"' ) + } + + wfSuppressWarnings(); + if ( $str !== '' && $str[0] == '"' ) { // Double-quoted string // @fixme trim() call is due to mystery bug where whitespace gets // appended to the token; without it we ended up reading in the // extra quote on the end! return stripcslashes( substr( trim( $str ), 1, -1 ) ); - if ( substr( $str, 0, 4 ) === 'true' ) + } + wfRestoreWarnings(); + + if ( substr( $str, 0, 4 ) === 'true' ) { return true; - if ( substr( $str, 0, 5 ) === 'false' ) + } + + if ( substr( $str, 0, 5 ) === 'false' ) { return false; - if ( substr( $str, 0, 4 ) === 'null' ) + } + + if ( substr( $str, 0, 4 ) === 'null' ) { return null; + } + // Must be some kind of numeric value, so let PHP's weak typing // be useful for a change return $str; @@ -177,7 +194,7 @@ class QuickArrayReader { * @return null|string */ function getVar( $varname ) { - if( isset( $this->vars[$varname] ) ) { + if ( isset( $this->vars[$varname] ) ) { return $this->vars[$varname]; } else { return null; diff --git a/extensions/LocalisationUpdate/README b/extensions/LocalisationUpdate/README new file mode 100644 index 00000000..3df784b5 --- /dev/null +++ b/extensions/LocalisationUpdate/README @@ -0,0 +1,34 @@ +== Localisation Update == +Localisation Update extension can update the MediaWiki messages at any time, +without needing to upgrade the MediaWiki software. + +For more information see: + https://www.mediawiki.org/wiki/Extension:LocalisationUpdate + +== Installation == +1. Add the following to LocalSettings.php of your MediaWiki setup: + + require_once "$IP/extensions/LocalisationUpdate/LocalisationUpdate.php"; + $wgLocalisationUpdateDirectory = "$IP/cache"; + +2. Create a cache folder in the installation directory, and be sure the server +has permissions to write on it. + +If localization updates don't seem to come through, you may need to run, + + php maintenance/rebuildLocalisationCache.php --force. + +3. Whenever you want to run an update, run, + + php extensions/LocalisationUpdate/update.php + +For detailed help, see: + + php extensions/LocalisationUpdate/update.php --help + +4. If you are on Unix like system, you should add LocalisationUpdate to +crontab: + + crontab -e + # Add the following line + @daily php /path/to/your/wiki/extensions/LocalisationUpdate/update.php --quiet diff --git a/extensions/LocalisationUpdate/README_FIRST.txt b/extensions/LocalisationUpdate/README_FIRST.txt deleted file mode 100644 index 3973c435..00000000 --- a/extensions/LocalisationUpdate/README_FIRST.txt +++ /dev/null @@ -1,8 +0,0 @@ -To install this extension first include -LocalisationUpdate/LocalisationUpdate.php in your LocalSettings.php - -Then add the required new tables to your database by running -php maintenance/update.php on the command line. - -Whenever you want to run an update, run -php extensions/LocalisationUpdate/update.php on the command line. diff --git a/extensions/LocalisationUpdate/tests/tokenTest.php b/extensions/LocalisationUpdate/tests/tokenTest.php index 1112313c..2b71cc46 100644 --- a/extensions/LocalisationUpdate/tests/tokenTest.php +++ b/extensions/LocalisationUpdate/tests/tokenTest.php @@ -4,47 +4,53 @@ $IP = strval( getenv( 'MW_INSTALL_PATH' ) ) !== '' ? getenv( 'MW_INSTALL_PATH' ) : realpath( dirname( __FILE__ ) . "/../../../" ); -require_once( "$IP/maintenance/commandLine.inc" ); +require_once "$IP/maintenance/commandLine.inc"; function evalExtractArray( $php, $varname ) { eval( $php ); - return @$$varname; + wfSuppressWarnings(); + + return $$varname; + wfRestoreWarnings(); } function confExtractArray( $php, $varname ) { try { - $ce = new ConfEditor("getVars(); - $retval = @$vars[$varname]; - } catch( Exception $e ) { + wfSuppressWarnings(); + $retval = $vars[$varname]; + wfRestoreWarnings(); + } catch ( Exception $e ) { print $e . "\n"; $retval = null; } + return $retval; } function quickTokenExtractArray( $php, $varname ) { - $reader = new QuickArrayReader("getVar( $varname ); } - -if( count( $args ) ) { +if ( count( $args ) ) { $sources = $args; } else { $sources = array_merge( - glob("$IP/extensions/*/*.i18n.php"), - glob("$IP/languages/messages/Messages*.php") ); + glob( "$IP/extensions/*/*.i18n.php" ), + glob( "$IP/languages/messages/Messages*.php" ) ); } -foreach( $sources as $sourceFile ) { +foreach ( $sources as $sourceFile ) { $rel = basename( $sourceFile ); $out = str_replace( '/', '-', $rel ); $sourceData = file_get_contents( $sourceFile ); - if( preg_match( '!extensions/!', $sourceFile ) ) { + if ( preg_match( '!extensions/!', $sourceFile ) ) { $sourceData = LocalisationUpdate::cleanupExtensionFile( $sourceData ); $items = 'langs'; } else { @@ -54,30 +60,33 @@ foreach( $sources as $sourceFile ) { file_put_contents( "$out.txt", $sourceData ); - $start = microtime(true); + $start = microtime( true ); $eval = evalExtractArray( $sourceData, 'messages' ); - $deltaEval = microtime(true) - $start; + $deltaEval = microtime( true ) - $start; - $start = microtime(true); + $start = microtime( true ); $quick = quickTokenExtractArray( $sourceData, 'messages' ); - $deltaQuick = microtime(true) - $start; + $deltaQuick = microtime( true ) - $start; - $start = microtime(true); + $start = microtime( true ); $token = confExtractArray( $sourceData, 'messages' ); - $deltaToken = microtime(true) - $start; + $deltaToken = microtime( true ) - $start; - $hashEval = md5(serialize($eval)); - $hashToken = md5(serialize($token)); - $hashQuick = md5(serialize($quick)); - $countEval = count( (array)$eval); + $hashEval = md5( serialize( $eval ) ); + $hashToken = md5( serialize( $token ) ); + $hashQuick = md5( serialize( $quick ) ); + $countEval = count( (array)$eval ); $countToken = count( (array)$token ); $countQuick = count( (array)$quick ); - printf( "%s %s %d $items - %0.1fms - eval\n", $rel, $hashEval, $countEval, $deltaEval * 1000 ); - printf( "%s %s %d $items - %0.1fms - QuickArrayReader\n", $rel, $hashQuick, $countQuick, $deltaQuick * 1000 ); - printf( "%s %s %d $items - %0.1fms - ConfEditor\n", $rel, $hashToken, $countToken, $deltaToken * 1000 ); + printf( "%s %s %d $items - %0.1fms - eval\n", + $rel, $hashEval, $countEval, $deltaEval * 1000 ); + printf( "%s %s %d $items - %0.1fms - QuickArrayReader\n", + $rel, $hashQuick, $countQuick, $deltaQuick * 1000 ); + printf( "%s %s %d $items - %0.1fms - ConfEditor\n", + $rel, $hashToken, $countToken, $deltaToken * 1000 ); - if( $hashEval !== $hashToken || $hashEval !== $hashQuick ) { + if ( $hashEval !== $hashToken || $hashEval !== $hashQuick ) { echo "FAILED on $rel\n"; file_put_contents( "$out-eval.txt", var_export( $eval, true ) ); file_put_contents( "$out-token.txt", var_export( $token, true ) ); diff --git a/extensions/LocalisationUpdate/update.php b/extensions/LocalisationUpdate/update.php index 750fc4f2..04ea64c7 100644 --- a/extensions/LocalisationUpdate/update.php +++ b/extensions/LocalisationUpdate/update.php @@ -5,9 +5,9 @@ $IP = strval( getenv( 'MW_INSTALL_PATH' ) ) !== '' : realpath( dirname( __FILE__ ) . "/../../" ); // TODO: migrate to maintenance class -require_once( "$IP/maintenance/commandLine.inc" ); +require_once "$IP/maintenance/commandLine.inc"; -if( isset( $options['help'] ) ) { +if ( isset( $options['help'] ) ) { print "Fetches updated localisation files from MediaWiki development SVN\n"; print "and saves into local database to merge with release defaults.\n"; print "\n"; @@ -23,7 +23,6 @@ if( isset( $options['help'] ) ) { exit( 0 ); } - $starttime = microtime( true ); // Prevent the script from timing out diff --git a/extensions/Nuke/COPYING b/extensions/Nuke/COPYING index f1537d13..d159169d 100644 --- a/extensions/Nuke/COPYING +++ b/extensions/Nuke/COPYING @@ -1,11 +1,3 @@ -The license text below "----" applies to all files within this distribution, other -than those that are in a directory which contains files named "LICENSE" or -"COPYING", or a subdirectory thereof. For those files, the license text contained in -said file overrides any license information contained in directories of smaller depth. -Alternative licenses are typically used for software that is provided by external -parties, and merely packaged with the Semantic MediaWiki release for convenience. ----- - GNU GENERAL PUBLIC LICENSE Version 2, June 1991 diff --git a/extensions/Nuke/Nuke.alias.php b/extensions/Nuke/Nuke.alias.php index 0b27b4a5..be9f3450 100644 --- a/extensions/Nuke/Nuke.alias.php +++ b/extensions/Nuke/Nuke.alias.php @@ -61,7 +61,7 @@ $specialPageAliases['dsb'] = array( /** Spanish (español) */ $specialPageAliases['es'] = array( - 'Nuke' => array( 'BorradoMasivo', 'Borrado_en_masa' ), + 'Nuke' => array( 'BorradoMasivo', 'Borrado_en_masa', 'Borrado_masivo' ), ); /** Estonian (eesti) */ @@ -201,7 +201,7 @@ $specialPageAliases['nl'] = array( /** Norwegian Nynorsk (norsk nynorsk) */ $specialPageAliases['nn'] = array( - 'Nuke' => array( 'Massesletting' ), + 'Nuke' => array( 'Massesletting', 'Masseslett' ), ); /** Polish (polski) */ diff --git a/extensions/Nuke/Nuke.hooks.php b/extensions/Nuke/Nuke.hooks.php new file mode 100644 index 00000000..fddcf51a --- /dev/null +++ b/extensions/Nuke/Nuke.hooks.php @@ -0,0 +1,27 @@ +isAllowed( 'nuke' ) ) { + $toolLinks[] = Linker::link( + SpecialPage::getTitleFor( 'Nuke' ), + wfMessage( 'nuke-linkoncontribs' )->escaped(), + array( 'title' => wfMessage( 'nuke-linkoncontribs-text' )->text() ), + array( 'target' => $userPageTitle->getText() ) + ); + } + return true; + } +} diff --git a/extensions/Nuke/Nuke.i18n.php b/extensions/Nuke/Nuke.i18n.php index f72d208d..2b4a9abb 100644 --- a/extensions/Nuke/Nuke.i18n.php +++ b/extensions/Nuke/Nuke.i18n.php @@ -40,6 +40,8 @@ Input the username or IP address to get a list of pages to delete, or leave blan 'nuke-nopages-global' => 'There are no new pages in [[Special:RecentChanges|recent changes]].', 'nuke-viewchanges' => 'view changes', 'nuke-namespace' => 'Limit to namespace:', + 'nuke-linkoncontribs' => 'mass delete', + 'nuke-linkoncontribs-text' => "Mass delete pages where this user is the only author", ); /** Message documentation (Message documentation) @@ -56,8 +58,9 @@ Input the username or IP address to get a list of pages to delete, or leave blan */ $messages['qqq'] = array( 'nuke' => '{{doc-special|Nuke}} -The Nuke extension allows for sysops to delete a large number of pages ("Mass delete"). -For more information, see http://www.mediawiki.org/wiki/Extension:Nuke', +The Nuke extension allows for sysops to delete a large number of pages ("Mass delete"). +For more information, see http://www.mediawiki.org/wiki/Extension:Nuke +{{Identical|Mass delete}}', 'action-nuke' => '{{doc-action|nuke}}', 'nuke-desc' => '{{desc|name=Nuke|url=http://www.mediawiki.org/wiki/Extension:Nuke}} The Nuke extension allows for sysops to delete a large number of pages ("Mass delete").', @@ -92,7 +95,7 @@ Parameters: 'nuke-submit-delete' => 'Submit button to delete the selected pages.', 'right-nuke' => '{{doc-right|nuke}}', 'nuke-select' => 'Parameters: -* $1 - two links: {{msg-mw|Powersearch-toggleall}} and {{msg-mw|Powersearch-togglenone}} which respectively selects all pages and de-selects all +* $1 - two links: {{msg-mw|Powersearch-toggleall}} and {{msg-mw|Powersearch-togglenone}} which respectively selects all pages and de-selects all pages {{Identical|Select}}', 'nuke-userorip' => 'Used as label for "target" input box.', @@ -121,8 +124,16 @@ The link points to History page of the page. This message follows: * {{msg-mw|nuke-editby}} and {{msg-mw|comma-separator}} -* or empty string (if username is empty).', +* or empty string (if username is empty). +{{Identical|View changes}}', 'nuke-namespace' => 'Label shown on [[Special:Nuke]] in front of the namespace input that allows choosing a namespace to filter the search by', + 'nuke-linkoncontribs' => 'Used as link text which is used on [[Special:Contributions]] and [[Special:DeletedContributions]]. + +Only added if a user has rights to nuke pages. + +The link has the tooltip {{msg-mw|Nuke-linkoncontribs-text}}. +{{Identical|Mass delete}}', + 'nuke-linkoncontribs-text' => 'Tooltip for the link which is labeled {{msg-mw|Nuke-linkoncontribs}}.', ); /** Afrikaans (Afrikaans) @@ -228,8 +239,10 @@ $messages['arz'] = array( /** Assamese (অসমীয়া) * @author Bishnu Saikia + * @author Gitartha.bordoloi */ $messages['as'] = array( + 'nuke' => 'সমূহীয়া বিলোপন', 'nuke-submit-user' => 'যাওক', ); @@ -262,6 +275,8 @@ un comentariu y calca nel botón pa desaniciales.', 'nuke-nopages-global' => 'Nun hai páxines nueves nos [[Special:RecentChanges|cambios recientes]].', 'nuke-viewchanges' => 'ver los cambios', 'nuke-namespace' => 'Llendar al espaciu de nomes:', + 'nuke-linkoncontribs' => 'desaniciar en masa', + 'nuke-linkoncontribs-text' => "Desaniciar en masa les páxines nes qu'esti usuariu ye l'únicu autor", ); /** Azerbaijani (azərbaycanca) @@ -413,7 +428,7 @@ Merkañ un tamm notenn ha klikañ war ar bouton d'o diverkañ.", # Fuzzy Lakait un notenn ha klikit war ar bouton evit o diverkañ.', 'nuke-defaultreason' => 'Diverkañ a-vras ar pajennoù bet ouzhpennet gant $1', # Fuzzy 'nuke-multiplepeople' => 'Diverkañ a-vras ar pajennoù nevez-ouzhpennet', - 'nuke-tools' => "Talvezout a ra an ostilh-mañ da ziverkañ a-vras pajennoù bet ouzhpennet nevez zo gant un implijer enrollet pe gant ur chomlec'h IP. + 'nuke-tools' => "Talvezout a ra an ostilh-mañ da ziverkañ a-vras pajennoù bet ouzhpennet nevez zo gant un implijer enrollet pe gant ur chomlec'h IP. Merkañ ar c'homlec'h IP pe anv an implijer evit kaout roll ar pajennoù da ziverkañ, pe lezel gwenn evit an holl implijerien.", 'nuke-submit-user' => 'Mont', 'nuke-submit-delete' => 'Dilemel ar re diuzet', @@ -443,7 +458,7 @@ navedite razloge i komentare te kliknite na dugme da bi ste ih obrisali.', # Fuz stavite ih u komentar i pritisnite dugme za njihovo brisanje.', 'nuke-defaultreason' => 'Masovno uklanjanje stranica koje je dodao $1', # Fuzzy 'nuke-multiplepeople' => 'više korisnika', # Fuzzy - 'nuke-tools' => 'Ovaj alat omogućuje masovno brisanje stranica koje je nedavno dodao određeni korisnik ili IP adresa. + 'nuke-tools' => 'Ovaj alat omogućuje masovno brisanje stranica koje je nedavno dodao određeni korisnik ili IP adresa. Unesite korisničko ime ili IP adresu za izlistavanje stranica koje se brišu ili ostavite prazno za prikaz svih korisnika.', 'nuke-submit-user' => 'Idi', 'nuke-submit-delete' => 'Obriši označeno', @@ -456,22 +471,41 @@ Unesite korisničko ime ili IP adresu za izlistavanje stranica koje se brišu il /** Catalan (català) * @author Aleator + * @author Alvaro Vidal-Abarca * @author Paucabot * @author SMP * @author Toniher + * @author Vriullop */ $messages['ca'] = array( 'nuke' => 'Eliminació massiva', + 'action-nuke' => 'eliminació massiva', 'nuke-desc' => "Dóna als administradors l'habilitat d'[[Special:Nuke|esborrar pàgines massivament]]", - 'nuke-nopages' => 'No hi ha pàgines noves de [[Special:Contributions/$1|$1]] als canvis recents.', # Fuzzy - 'nuke-list' => 'Les següents pàgines han estat creades recentment per [[Special:Contributions/$1|$1]]; -feu un comentari i cliqueu el botó per a esborrar-les.', # Fuzzy - 'nuke-defaultreason' => 'Esborrat massiu de pàgines creades per $1', # Fuzzy + 'nuke-nopages' => 'No hi ha pàgines noves de [[Special:Contributions/$1|{{GENDER:$1|$1}}]] als canvis recents.', + 'nuke-list' => 'Les següents pàgines han estat creades recentment per [[Special:Contributions/$1|{{GENDER:$1|$1}}]]; +afegiu un comentari i cliqueu el botó per a esborrar-les.', + 'nuke-list-multiple' => 'Les següents pàgines han estat creades recentment; +afegiu un comentari i cliqueu el botó per a esborrar-les.', + 'nuke-defaultreason' => 'Esborrat massiu de pàgines creades per [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', + 'nuke-multiplepeople' => 'Esborrat massiu de pàgines creades recentment', 'nuke-tools' => "Aquesta eina permet l'eliminació massiva de pàgines creades recentment per un usuari o IP. -Per obtenir la llista de pàgines per esborrar podeu introduir el nom d'un usuari o una IP.", +Indiqueu el nom d'usuari o adreça IP per obtenir la llista de pàgines a esborrar, o deixeu-ho en blanc per tots els usuaris.", 'nuke-submit-user' => 'Vés-hi', - 'nuke-submit-delete' => 'Esborra la selecció', + 'nuke-submit-delete' => 'Esborra els seleccionats', 'right-nuke' => 'Esborrar pàgines de forma massiva', + 'nuke-select' => 'Selecciona: $1', + 'nuke-userorip' => "Nom d'usuari, adreça IP o en blanc:", + 'nuke-maxpages' => 'Nombre màxim de pàgines:', + 'nuke-editby' => 'Creada per [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', + 'nuke-deleted' => "La pàgina '''$1''' ha estat esborrada.", + 'nuke-not-deleted' => "La pàgina [[:$1]] '''no s'ha pogut''' esborrar.", + 'nuke-delete-more' => '[[Special:Nuke|Esborra més pàgines]]', + 'nuke-pattern' => 'Patró pel nom de pàgina:', + 'nuke-nopages-global' => 'No hi ha cap pàgina nova als [[Special:RecentChanges|canvis recents]].', + 'nuke-viewchanges' => 'mostra els canvis', + 'nuke-namespace' => "Limitat a l'espai de noms:", + 'nuke-linkoncontribs' => 'eliminació massiva', + 'nuke-linkoncontribs-text' => "Eliminació massiva de pàgines on aquest usuari és l'únic autor", ); /** Chechen (нохчийн) @@ -479,8 +513,9 @@ Per obtenir la llista de pàgines per esborrar podeu introduir el nom d'un usuar * @author Умар */ $messages['ce'] = array( - 'nuke' => 'Дуккха дӀяккхар', + 'nuke' => 'Дуккха дӀаяккхар', 'action-nuke' => 'дуккха агIонаш дӀаяхар', + 'nuke-desc' => 'Куьйгалхошна таро хуьлуьйту [[Special:Nuke|дуккха агӀонаш]] дӀаяха', 'nuke-list-multiple' => 'Лахахь гайтина агӀонаш дукху хан йоцуш кхолийна. Уьш дӀаяха билгалонаш Ӏадйите тӀетаӀе кнопка.', 'nuke-defaultreason' => 'Декъашхочо $1 кхоьллина агIонаш, дуккха дӀаяхар', # Fuzzy @@ -492,9 +527,12 @@ $messages['ce'] = array( 'nuke-userorip' => 'Декъашхочун цӀе, IP-адрес (еса йита мега):', 'nuke-maxpages' => 'АгӀонашан максимальни дукхалла:', 'nuke-editby' => 'Кхолийна {{GENDER:$1|декъашхочо}} [[Special:Contributions/$1|$1]]', + 'nuke-delete-more' => '[[Special:Nuke|Дуккха агӀонаш дӀаяхар]]', 'nuke-pattern' => 'Кеп агӀона цӀеран:', 'nuke-viewchanges' => 'ХӀоттина болу хийцам', 'nuke-namespace' => 'Къастае ана цӀераш:', + 'nuke-linkoncontribs' => 'дуккха дӀаяккхар', + 'nuke-linkoncontribs-text' => 'ХӀокху декъашхочо кхоьллина агӀонаш массо дӀаяха', ); /** Chamorro (Chamoru) @@ -511,10 +549,11 @@ $messages['ckb'] = array( 'right-nuke' => 'سڕینەوەی پەڕەکان بەکۆمەڵ', ); -/** Czech (česky) +/** Czech (čeština) * @author Danny B. * @author Jkjk * @author Li-sung + * @author Littledogboy * @author Matěj Grabovský * @author Mormegil */ @@ -527,8 +566,8 @@ $messages['cs'] = array( vyplňte komentář a všechny smažte kliknutím na tlačítko.', 'nuke-list-multiple' => 'Nedávno byly vytvořeny následující stránky; zadáním komentáře a stisknutím tlačítka je smažete.', - 'nuke-defaultreason' => 'Hromadné odstranění stránek, které {{GENDER:$1|vytvořil|vytvořila}} [[Special:Contributions/$1|$1]]', - 'nuke-multiplepeople' => 'Hromadné odstranění nedávno založených stránek', + 'nuke-defaultreason' => 'Hromadné smazání stránek, které {{GENDER:$1|vytvořil|vytvořila}} [[Special:Contributions/$1|$1]]', + 'nuke-multiplepeople' => 'Hromadné smazání nedávno založených stránek', 'nuke-tools' => 'Tento nástroj umožňuje hromadné smazání stránek nedávno vytvořených zadaným uživatelem nebo IP adresou. Zadejte uživatelské jméno nebo IP adresu, zobrazí se seznam stránek ke smazání; případně ponechte prázdné pro všechny uživatele.', 'nuke-submit-user' => 'Provést', @@ -545,6 +584,8 @@ Zadejte uživatelské jméno nebo IP adresu, zobrazí se seznam stránek ke smaz 'nuke-nopages-global' => 'V [[Special:RecentChanges|posledních změnách]] nejsou žádné nové stránky.', 'nuke-viewchanges' => 'ukázat změny', 'nuke-namespace' => 'Omezit na jmenný prostor:', + 'nuke-linkoncontribs' => 'hromadné mazání', + 'nuke-linkoncontribs-text' => 'Hromadně smazat stránky, jichž je tento uživatel jediným autorem', ); /** Danish (dansk) @@ -585,6 +626,7 @@ Skriv et brugernavn eller en IP-adresse for at få en liste over sider at slette * @author Geitost * @author Kghbln * @author Metalhead64 + * @author Purodha * @author Raimond Spekking * @author SVG */ @@ -615,6 +657,8 @@ Gib die IP-Adresse oder den Benutzernamen ein, um eine Liste der zu löschenden 'nuke-nopages-global' => 'Es gibt keine neuen Seiten unter den [[Special:RecentChanges|letzten Änderungen]].', 'nuke-viewchanges' => 'Änderungen ansehen', 'nuke-namespace' => 'Auf den folgenden Namensraum begrenzen:', + 'nuke-linkoncontribs' => 'Massenlöschungen', + 'nuke-linkoncontribs-text' => 'Massengelöschte Seiten, bei denen dieser Benutzer der einzige Autor ist.', ); /** German (formal address) (Deutsch (Sie-Form)‎) @@ -650,7 +694,7 @@ Listanê peleyê ke besternaya vinayışi rê namey karberi yana ip adresi deker 'right-nuke' => 'pelan yew hew de hewnaker', 'nuke-select' => 'Weçinaye: $1', 'nuke-delete-more' => '[[Special:Nuke|Zewbi pera besterne]]', - 'nuke-viewchanges' => 'Vurnayışa bıvin', + 'nuke-viewchanges' => 'vurnayışan bıvêne', ); /** Lower Sorbian (dolnoserbski) @@ -682,6 +726,8 @@ zapódaj komentar a klikni na tłocašk, aby je wulašował.', 'nuke-nopages-global' => 'Njejsu žedne nowe boki w [[Special:RecentChanges|aktualnych změnach]].', 'nuke-viewchanges' => 'změny pokazaś', 'nuke-namespace' => 'Na slědujucy mjenjowy rum wobgranicowaś:', + 'nuke-linkoncontribs' => 'masowe wulašowanje', + 'nuke-linkoncontribs-text' => 'Bok masowego wulašowanja, źož toś ten wužywaŕ jo jadnučki awtor', ); /** Ewe (eʋegbe) @@ -820,6 +866,8 @@ Kustutatavate lehekülgede nimekirja näitamiseks sisesta kasutajanimi või IP-a 'nuke-nopages-global' => '[[Special:RecentChanges|Viimaste muudatuste]] all pole uusi lehekülgi.', 'nuke-viewchanges' => 'vaata muudatusi', 'nuke-namespace' => 'Nimeruumipiirang:', + 'nuke-linkoncontribs' => 'lauskustutamine', + 'nuke-linkoncontribs-text' => 'Lauskustuta leheküljed, mille ainus autor on see kasutaja', ); /** Basque (euskara) @@ -839,6 +887,7 @@ idatz ezazu ohar bat, eta sakatu botoia orri horiek ezabatzeko.', ); /** Persian (فارسی) + * @author Armin1392 * @author Ebraminio * @author Huji * @author Mjbmr @@ -865,21 +914,25 @@ $messages['fa'] = array( 'nuke-userorip' => 'نام کاربری، نشانی آی‌پی یا خالی:', 'nuke-maxpages' => 'حداکثر تعداد صفحه‌ها:', 'nuke-editby' => 'ایجاد شده توسط [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', - 'nuke-deleted' => "صفحهٔ '''$1''' حذف شده است.", + 'nuke-deleted' => "صفحهٔ '''$1''' حذف شده‌است.", 'nuke-not-deleted' => "صفحهٔ [[:$1]] را '''نمی‌توان''' حذف کرد.", 'nuke-delete-more' => '[[Special:Nuke|حذف صفحه‌های بیشتر]]', 'nuke-pattern' => 'الگو برای نام صفحه:', 'nuke-nopages-global' => 'هیچ صفحهٔ جدیدی در [[Special:RecentChanges|فهرست تغییرات اخیر]] نیست.', 'nuke-viewchanges' => 'نمایش تغییرات', 'nuke-namespace' => 'محدودیت به فضای نام:', + 'nuke-linkoncontribs' => 'حذف گروه', + 'nuke-linkoncontribs-text' => 'حذف دستهٔ صفحات جایی که این کاربر تنها نویسنده است', ); /** Finnish (suomi) * @author Beluga * @author Crt * @author Jaakonam + * @author Mies * @author Nike * @author Olli + * @author Pxos * @author Stryn */ $messages['fi'] = array( @@ -888,15 +941,15 @@ $messages['fi'] = array( 'nuke-desc' => 'Mahdollistaa ylläpitäjille sivujen [[Special:Nuke|massapoistamisen]].', 'nuke-nopages' => 'Ei käyttäjän [[Special:Contributions/$1|{{GENDER:$1|$1}}]] lisäämiä uusia sivuja tuoreissa muutoksissa.', 'nuke-list' => 'Käyttäjä [[Special:Contributions/$1|{{GENDER:$1|$1}}]] on äskettäin luonut seuraavat sivut. -Lisää kommentti ja poista napsauttamalla painiketta.', - 'nuke-list-multiple' => 'Seuraavat sivut tehtiin äskettäin. -Lisää kommentti ja poista napsauttamalla painiketta.', +Lisää kommentti ja poista sivut napsauttamalla painiketta.', + 'nuke-list-multiple' => 'Seuraavat sivut on luotu äskettäin. +Lisää kommentti ja poista sivut napsauttamalla painiketta.', 'nuke-defaultreason' => 'Käyttäjän [[Special:Contributions/$1|{{GENDER:$1|$1}}]] lisäämien sivujen massapoistaminen', 'nuke-multiplepeople' => 'Äskettäin lisättyjen sivujen massapoistaminen', 'nuke-tools' => 'Tämä työkalu mahdollistaa äskettäin lisättyjen sivujen massapoistamisen käyttäjänimen tai IP-osoitteen perusteella. Kirjoita käyttäjänimi tai IP-osoite, niin saat listan poistettavista sivuista, tai jätä kenttä tyhjäksi niin saat kaikkien käyttäjien tekemät sivut.', 'nuke-submit-user' => 'Siirry', - 'nuke-submit-delete' => 'Poista valitut', + 'nuke-submit-delete' => 'Poista valitut sivut', 'right-nuke' => 'Massapoistaa sivuja', 'nuke-select' => 'Valinta: $1', 'nuke-userorip' => 'Käyttäjänimi tai IP-osoite (voi jättää myös tyhjäksi):', @@ -904,11 +957,13 @@ Kirjoita käyttäjänimi tai IP-osoite, niin saat listan poistettavista sivuista 'nuke-editby' => 'Luonut [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', 'nuke-deleted' => "Sivu '''$1''' on poistettu.", 'nuke-not-deleted' => "Sivua [[:$1]] '''ei voitu''' poistaa.", - 'nuke-delete-more' => '[[Special:Nuke|Poista lisää sivuja]]', - 'nuke-pattern' => 'Sivun nimien etuliite', + 'nuke-delete-more' => '[[Special:Nuke|Poista enemmän sivuja]]', + 'nuke-pattern' => 'Malli sivun nimelle:', 'nuke-nopages-global' => '[[Special:RecentChanges|Tuoreissa muutoksissa]] ei ole uusia sivuja.', 'nuke-viewchanges' => 'näytä muutokset', 'nuke-namespace' => 'Rajoita nimiavaruuteen:', + 'nuke-linkoncontribs' => 'massapoisto', + 'nuke-linkoncontribs-text' => 'Massapoista ne sivut, joissa tämä käyttäjä on ainoa sivuja muokannut', ); /** French (français) @@ -930,7 +985,7 @@ $messages['fr'] = array( 'nuke-desc' => 'Donne la possibilité aux administrateurs de [[Special:Nuke|supprimer en masse]] des pages', 'nuke-nopages' => 'Aucune nouvelle page créée par [[Special:Contributions/$1|{{GENDER:$1|$1}}]] dans la liste des changements récents.', 'nuke-list' => 'Les pages suivantes ont été créées récemment par [[Special:Contributions/$1|{{GENDER:$1|$1}}]]; saisissez un commentaire et cliquez sur le bouton pour les supprimer.', - 'nuke-list-multiple' => 'Les pages suivantes ont été récemment créées ; + 'nuke-list-multiple' => 'Les pages suivantes ont été récemment créées ; entrez un commentaire et cliquez sur le bouton pour les supprimer.', 'nuke-defaultreason' => 'Suppression en masse des pages ajoutées par [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', 'nuke-multiplepeople' => 'Suppression de masse de pages récemment ajoutées', @@ -949,6 +1004,8 @@ entrez un commentaire et cliquez sur le bouton pour les supprimer.', 'nuke-nopages-global' => "Il n'y a pas de nouvelle page dans [[Special:RecentChanges|changements récents]].", 'nuke-viewchanges' => 'voir les modifications', 'nuke-namespace' => "Se limiter à l'espace de nommage:", + 'nuke-linkoncontribs' => 'suppression de masse', + 'nuke-linkoncontribs-text' => 'Supprimer des pages en masse quand cet utilisateur est l’unique auteur', ); /** Franco-Provençal (arpetan) @@ -983,6 +1040,41 @@ Buchiér lo nom d’usanciér ou ben l’adrèce IP por avêr la lista de les p 'nuke-namespace' => 'Sè limitar a cet’èspâço de noms :', ); +/** Northern Frisian (Nordfriisk) + * @author Murma174 + */ +$messages['frr'] = array( + 'nuke' => 'Sidjen bonkerwiis strik', + 'action-nuke' => 'sidjen bonkerwiis tu striken', + 'nuke-desc' => 'Administratooren kön diarmä sidjen [[Special:Nuke|bonkerwiis strik]]', + 'nuke-nopages' => 'Bi a „leetst feranrangen“ san nian nei sidjen faan [[Special:Contributions/$1|{{GENDER:$1|$1}}]].', + 'nuke-list' => 'Jodiar sidjen san faan [[Special:Contributions/$1|{{GENDER:$1|$1}}]] skrewen wurden. +Skriiw ap, huaram dü jo strikst, an do trak üüb di knoop tu striken.', + 'nuke-list-multiple' => 'Jodiar sidjen san jüst skrewen wurden. +Skriiw ap, huaram dü jo strikst, an do trak üüb di knoop tu striken.', + 'nuke-defaultreason' => 'Sidjen faan [[Special:Contributions/$1|{{GENDER:$1|$1}}]] bonkerwiis strik', + 'nuke-multiplepeople' => 'Jüst skrewen sidjen bonkerwiis strik', + 'nuke-tools' => 'Diarmä kön sidjen, diar faan en was IP of en wasen brüker skrewen wurden san, bonkerwiis stregen wurd. +Skriiw diar det IP-adres of di brükernööm iin, an do könst dü det list faan sidjen sä, diar stregen wurd kön. +Wan dü diar niks henskrafst, wurd aal a brükern uunwiset.', + 'nuke-submit-user' => 'Widjer', + 'nuke-submit-delete' => 'Enkelten strik', + 'right-nuke' => 'Sidjen bonkerwiis strik', + 'nuke-select' => 'Schük ütj: $1', + 'nuke-userorip' => 'Brükernööm, IP-adres of niks:', + 'nuke-maxpages' => 'Ei muar sidjen üs:', + 'nuke-editby' => 'Skrewen faan [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', + 'nuke-deleted' => "Sidj '''„$1“''' as stregen wurden.", + 'nuke-not-deleted' => "Sidj [[:$1]] '''küd ei''' stregen wurd.", + 'nuke-delete-more' => '[[Special:Nuke|Muar sidjen strik]]', + 'nuke-pattern' => 'Münster för di sidjnööm:', + 'nuke-nopages-global' => 'Diar san nian sidjen uun a [[Special:RecentChanges|leetst feranrangen]].', + 'nuke-viewchanges' => 'Feranrangen wise', + 'nuke-namespace' => 'Bluas uun di nöömrüm:', + 'nuke-linkoncontribs' => 'Bonkerwiis strik', + 'nuke-linkoncontribs-text' => 'Bonkerwiis stregen sidjen, huar di brüker di iansagst skriiwer as.', +); + /** Friulian (furlan) * @author Klenje */ @@ -1022,6 +1114,8 @@ Introduza o nome do usuario ou enderezo IP para obter unha lista das páxinas pa 'nuke-nopages-global' => 'Non hai páxinas novas nos [[Special:RecentChanges|cambios recentes]].', 'nuke-viewchanges' => 'ollar os cambios', 'nuke-namespace' => 'Limitar ao espazo de nomes:', + 'nuke-linkoncontribs' => 'eliminar en masa', + 'nuke-linkoncontribs-text' => 'Eliminar en masa as páxinas das que este usuario é o único autor', ); /** Ancient Greek (Ἀρχαία ἑλληνικὴ) @@ -1082,8 +1176,10 @@ $messages['gv'] = array( /** Hebrew (עברית) * @author Amire80 * @author Guycn1 + * @author Guycn2 * @author Rotem Liss * @author YaronSh + * @author Yona b */ $messages['he'] = array( 'nuke' => 'מחיקה מרובה', @@ -1096,8 +1192,8 @@ $messages['he'] = array( אנא כתבו נימוק למחיקה ולחצו על הכפתור כדי למחוק אותם.', 'nuke-defaultreason' => 'הסרה מרובה של דפים שנוצרו על־ידי [[Special:Contributions/$1|$1]]', 'nuke-multiplepeople' => 'מחיקה מרובה של דפים שנוספו לאחרונה', - 'nuke-tools' => 'כלי זה מאפשר מחיקות המוניות של דפים שנוספו לאחרונה על ידי משתמש או כתובת IP מסוימים. -כתבו את שם המשתמש או כתובת ה־IP כדי לקבל את רשימת הדפים למחיקה או השאירו את השדה הזה ריק עבור כל המשתמשים.', + 'nuke-tools' => 'כלי זה מאפשר מחיקות המוניות של דפים שנוספו לאחרונה על־ידי משתמש או כתובת IP מסוימים. +כתבו את שם המשתמש או כתובת ה־IP כדי לקבל את רשימת הדפים למחיקה, או השאירו את השדה ריק עבור כל המשתמשים.', 'nuke-submit-user' => 'הצגה', 'nuke-submit-delete' => 'מחיקת הדפים שנבחרו', 'right-nuke' => 'מחיקה מרובה של דפים', @@ -1112,6 +1208,8 @@ $messages['he'] = array( 'nuke-nopages-global' => 'אין דפים חדשים ב[[Special:RecentChanges|שינויים אחרונים]].', 'nuke-viewchanges' => 'הצגת שינויים', 'nuke-namespace' => 'להגביל למרחב השמות הבא:', + 'nuke-linkoncontribs' => 'מחיקה מרובה', + 'nuke-linkoncontribs-text' => 'מחיקת דפים רבים בהם משתמש זה הוא הכותב היחיד', ); /** Hindi (हिन्दी) @@ -1159,6 +1257,7 @@ $messages['hil'] = array( /** Croatian (hrvatski) * @author Dalibor Bosits * @author Dnik + * @author MaGa * @author Roberta F. * @author SpeedyGonsales */ @@ -1173,6 +1272,9 @@ $messages['hr'] = array( 'nuke-submit-delete' => 'Obriši označeno', 'right-nuke' => 'Skupno brisanje stranica', 'nuke-select' => 'Odaberite: $1', + 'nuke-viewchanges' => 'prikaži promjene', + 'nuke-linkoncontribs' => 'skupno brisanje', + 'nuke-linkoncontribs-text' => 'Skupno brisanje stranica kojima je ovaj suradnik jedini autor', ); /** Upper Sorbian (hornjoserbsce) @@ -1203,6 +1305,8 @@ napisaj komentar a klikń na tłóčatko, zo by je wušmórnył.', 'nuke-nopages-global' => 'Njejsu žane nowe strony w [[Special:RecentChanges|aktualnych změnach]].', 'nuke-viewchanges' => 'změny pokazać', 'nuke-namespace' => 'Na slědowacy mjenowy rum wobmjezować:', + 'nuke-linkoncontribs' => 'masowe zhašenje', + 'nuke-linkoncontribs-text' => 'Strony masoweho zhašenja, hdźež tutón wužiwar je jenički awtor', ); /** Hungarian (magyar) @@ -1280,7 +1384,7 @@ $messages['id'] = array( 'nuke-desc' => 'Memberikan kemampuan bagi pengurus untuk [[Special:Nuke|menghapus halaman secara massal]]', 'nuke-nopages' => 'Tak ditemukan halaman baru dari [[Special:Contributions/$1|{{GENDER:$1|$1}}]] di perubahan terbaru.', 'nuke-list' => 'Halaman berikut baru saja dibuat oleh [[Special:Contributions/$1|{{GENDER:$1|$1}}]]; berikan komentar dan tekan tombol untuk menghapus halaman-halaman tersebut.', - 'nuke-list-multiple' => 'Halaman berikut baru dibuat; + 'nuke-list-multiple' => 'Halaman berikut baru dibuat; berikan komentar dan tekan tombol untuk menghapus.', 'nuke-defaultreason' => 'Penghapusan masal halaman-halaman yang dibuat oleh [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', 'nuke-multiplepeople' => 'Penghapusan masal halaman yang baru saja ditambahkan', @@ -1313,9 +1417,9 @@ $messages['ig'] = array( * @author Lam-ang */ $messages['ilo'] = array( - 'nuke' => 'Paga-adduan nga pinag-ikkat', + 'nuke' => 'Paga-adduan nga panagikkat', 'action-nuke' => 'ikkaten dagiti panid', - 'nuke-desc' => 'Ikkan na ti administrador ti abilidad nga [[Special:Nuke| paga-adduan nga pang-ikkat]] kadagit panid', + 'nuke-desc' => 'Ikkanna ti administrador ti abilidad iti [[Special:Nuke|adu a panagikkat]] kadagiti panid', 'nuke-nopages' => 'Awan dagiti baro a panid babaen ni [[Special:Contributions/$1|{{GENDER:$1|$1}}]] idiay kaudian abalbaliw.', 'nuke-list' => 'Dagiti sumaganad a panid ket kadamdamaan a pinartuat babaen ni [[Special:Contributions/$1|{{GENDER:$1|$1}}]]; ikkam ti komentario ken pindutem ti buton tapno maikkatda.', @@ -1339,6 +1443,8 @@ Ikabil ti nagan ti agar-aramat wenno IP address tapno maalam dagiti listaan dagi 'nuke-nopages-global' => 'Awan dagiti baro a panid idiay [[Special:RecentChanges|kinaudian a pinagbaliw]].', 'nuke-viewchanges' => 'kitaen dagiti sinukatan', 'nuke-namespace' => 'Patingga iti nagan a lugar:', + 'nuke-linkoncontribs' => 'agikkat ti adu', + 'nuke-linkoncontribs-text' => 'Agikkat ti adu a pampanid a ti agar-aramat ket isu laeng ti nagsurat', ); /** Ido (Ido) @@ -1415,6 +1521,8 @@ Inserisci il nome utente o l'indirizzo IP per la lista delle pagine da cancellar 'nuke-nopages-global' => 'Non ci sono nuove pagine negli [[Special:RecentChanges|ultimi cambiamenti]].', 'nuke-viewchanges' => 'vedi modifiche', 'nuke-namespace' => 'Limita al namespace:', + 'nuke-linkoncontribs' => 'cancella massivamente', + 'nuke-linkoncontribs-text' => "Cancella massivamente le pagine dove questo utente è l'unico contributore", ); /** Japanese (日本語) @@ -1457,6 +1565,7 @@ $messages['ja'] = array( 'nuke-nopages-global' => '[[Special:RecentChanges|最近の更新]]には新しいページはありません。', 'nuke-viewchanges' => '履歴を表示', 'nuke-namespace' => '名前空間:', + 'nuke-linkoncontribs' => '一括削除', ); /** Jutish (jysk) @@ -1528,7 +1637,9 @@ $messages['ka'] = array( 'nuke-deleted' => "გვერდი '''$1''' წაიშალა.", 'nuke-not-deleted' => "გვერდი [[:$1]] წაშლა '''შეუძლებელია'''.", 'nuke-delete-more' => '[[Special:Nuke|მრავალრიცხოვანი გვერდების წაშლა]]', + 'nuke-pattern' => 'გვერდის სახელის თარგი:', 'nuke-viewchanges' => 'ცვლილებების ჩვენება', + 'nuke-namespace' => 'სახელთა სივრცის შეზღუდვა:', ); /** Kazakh (Cyrillic script) (қазақша (кирил)‎) @@ -1587,6 +1698,7 @@ $messages['kn'] = array( * @author Albamhandae * @author Klutzy * @author Kwj2772 + * @author Priviet * @author ToePeu * @author 아라 */ @@ -1617,13 +1729,17 @@ $messages['ko'] = array( 'nuke-nopages-global' => '[[Special:RecentChanges|최근 바뀜]]에 새 문서가 없습니다.', 'nuke-viewchanges' => '차이 보기', 'nuke-namespace' => '이름공간 제한:', + 'nuke-linkoncontribs' => '문서 대량 삭제', + 'nuke-linkoncontribs-text' => '이 사용자가 유일한 기여자인 문서를 대량 삭제', ); /** Krio (Krio) * @author Jose77 + * @author Protostar */ $messages['kri'] = array( 'nuke-submit-user' => 'Go to am', + 'nuke-linkoncontribs' => 'mass delet', ); /** Kinaray-a (Kinaray-a) @@ -1681,6 +1797,7 @@ $messages['ku-latn'] = array( /** Luxembourgish (Lëtzebuergesch) * @author Les Meloures * @author Robby + * @author Soued031 */ $messages['lb'] = array( 'nuke' => 'Masseläschung', @@ -1691,7 +1808,7 @@ $messages['lb'] = array( 'nuke-list-multiple' => 'Dës Säite goufe rezent gemaach; setzt eng Bemierkung derbäi a klickt op de Knäppche fir se ze läschen.', 'nuke-defaultreason' => 'Masseläschung vu Säiten, déi vum [[Special:Contributions/$1|{{GENDER:$1|$1}}]] ugefaang goufen', - 'nuke-multiplepeople' => 'Masse-Läschung vu Säiten déi rezent derbäi gesat goufen', + 'nuke-multiplepeople' => 'Masse-Läschung vu Säiten déi rezent derbäigesat goufen', 'nuke-tools' => "Dësen Tool erlaabt vill Säite mateneen ze läschen, déi vun engem Benotzer oder vun enger IP-Adress ugeluecht goufen. Gitt w.e.g. d'IP-Adress respektiv de Benotzer u fir eng Lëscht vun de Säiten ze kréien déi geläscht solle ginn, oder loosst et eidel fir all Benotzer.", 'nuke-submit-user' => 'Lass', @@ -1708,6 +1825,8 @@ Gitt w.e.g. d'IP-Adress respektiv de Benotzer u fir eng Lëscht vun de Säiten z 'nuke-nopages-global' => 'Et si keng nei Säiten an de [[Special:RecentChanges|rezenten Ännerungen]].', 'nuke-viewchanges' => 'Ännerunge weisen', 'nuke-namespace' => 'Op dësen Nummraum limitéieren:', + 'nuke-linkoncontribs' => 'Masseläschungen', + 'nuke-linkoncontribs-text' => 'Massegeläschte Säite wou dëse Benotzer den eenzegen Auteur ass', ); /** Limburgish (Limburgs) @@ -1785,7 +1904,7 @@ $messages['mg'] = array( */ $messages['min'] = array( 'nuke' => 'Pangapuihan masal', - 'nuke-list-multiple' => 'Laman ko baru sajo dibuek; + 'nuke-list-multiple' => 'Laman ko baru sajo dibuek; agiah komentar dan takan tombol untuak mangapuih.', 'nuke-defaultreason' => 'Pangapuihan masal laman-laman nan dibuek dek [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', 'nuke-tools' => 'Pakakeh ko mamungkinkan pangapuihan masal laman-laman nan baru sajo dibuek jo sorang pangguno atau alamaik IP. @@ -1832,6 +1951,8 @@ $messages['mk'] = array( 'nuke-nopages-global' => 'Нема нови страници во [[Special:RecentChanges|скорешните промени]].', 'nuke-viewchanges' => 'прикажи промени', 'nuke-namespace' => 'Само во имен. простор:', + 'nuke-linkoncontribs' => 'масовно бришење', + 'nuke-linkoncontribs-text' => 'Масовното бришење на страници чиј единствен автор е овој корисник', ); /** Malayalam (മലയാളം) @@ -1864,21 +1985,26 @@ $messages['ml'] = array( 'nuke-nopages-global' => '[[Special:RecentChanges|സമീപകാലമാറ്റങ്ങളിൽ]] പുതിയ താളുകളൊന്നുമില്ല.', 'nuke-viewchanges' => 'മാറ്റങ്ങൾ കാണുക', 'nuke-namespace' => 'ഈ നാമമേഖലയിൽ ഒതുക്കുക:', + 'nuke-linkoncontribs' => 'കൂട്ട മായ്ക്കൽ', + 'nuke-linkoncontribs-text' => 'ഈ ഉപയോക്താവ് കൂട്ടത്തോടെ മായ്ച്ച താളുകൾ', ); /** Marathi (मराठी) * @author Kaustubh + * @author V.narsikar */ $messages['mr'] = array( 'nuke' => 'एकदम खूप पाने वगळा', - 'nuke-desc' => 'प्रबंधकांना एकाचवेळी [[Special:Nuke|अनेक पाने वगळण्याची]] परवानगी देते', + 'nuke-desc' => 'प्रबंधकांना [[Special:Nuke|गठ्ठ्याने वगळण्याची(मास डिलीट)]] क्षमता देते', 'nuke-nopages' => '[[Special:Contributions/$1|$1]] कडून अलीकडील बदलांमध्ये नवीन पाने नाहीत.', # Fuzzy 'nuke-list' => 'खालील पाने ही [[Special:Contributions/$1|$1]] ने अलिकडे वाढविलेली आहेत; शेरा द्या व वगळण्यासाठी कळीवर टिचकी द्या.', # Fuzzy 'nuke-defaultreason' => '$1 ने नवीन वाढविलेली अनेक पाने एकावेळी वगळा', # Fuzzy 'nuke-tools' => 'हे उपकरण एखाद्या विशिष्ट सदस्य अथवा अंकपत्त्याद्वारे नवीन तयार करण्यात आलेल्या पानांना एकाचवेळी वगळण्याची संधी देते. सदस्य नाव अथवा अंकपत्ता दिल्यास वगळण्यासाठी पानांची यादी मिळेल:', # Fuzzy 'nuke-submit-user' => 'जा', 'nuke-submit-delete' => 'निवडलेले वगळा', - 'right-nuke' => 'खूप पाने एकत्र वगळा', + 'right-nuke' => 'गठ्ठ्याने पाने वगळा', + 'nuke-linkoncontribs' => 'एकगठ्ठा वगळा', + 'nuke-linkoncontribs-text' => 'ती पाने एकगठ्ठा वगळा, ज्यांचा हा सदस्य एकमेव लेखक आहे', ); /** Malay (Bahasa Melayu) @@ -1911,6 +2037,8 @@ Isikan nama pengguna atau alamat IP untuk mendapat senarai laman yang hendak dik 'nuke-nopages-global' => 'Tiada laman baru dalam [[Special:RecentChanges|perubahan terkini]].', 'nuke-viewchanges' => 'lihat perubahan', 'nuke-namespace' => 'Had ruang nama:', + 'nuke-linkoncontribs' => 'hapus pukal', + 'nuke-linkoncontribs-text' => 'Hapus pukal halaman-halaman di mana pengguna ini satu-satunya pengarangnya', ); /** Maltese (Malti) @@ -1988,6 +2116,8 @@ Skriv et brukernavn eller en IP-adresse for å få en liste over sider som kan s 'nuke-delete-more' => '[[Special:Nuke|Slett flere sider]]', 'nuke-pattern' => 'Mønster for sidenavnet:', 'nuke-nopages-global' => 'Det er ingen sider i [[Special:RecentChanges|siste endringer]].', + 'nuke-linkoncontribs' => 'masseslett', + 'nuke-linkoncontribs-text' => 'Masseslett sider der denne brukeren er den eneste oppretteren', ); /** Low German (Plattdüütsch) @@ -2044,6 +2174,7 @@ $messages['niu'] = array( /** Dutch (Nederlands) * @author SPQRobin * @author Siebrand + * @author Sjoerddebruin * @author Wiki13 */ $messages['nl'] = array( @@ -2072,6 +2203,7 @@ Voer de gebruikersnaam of het IP-adres in voor een lijst van te verwijderen pagi 'nuke-nopages-global' => "Er zijn geen nieuwe pagina's in de [[Special:RecentChanges|recente wijzigingen]].", 'nuke-viewchanges' => 'wijzigingen bekijken', 'nuke-namespace' => 'Beperk tot naamruimte:', + 'nuke-linkoncontribs' => 'massaal verwijderen', ); /** Norwegian Nynorsk (norsk nynorsk) @@ -2089,7 +2221,7 @@ skriv inn ei sletteårsak og trykk på knappen for å sletta dei.', skriv inn ein kommentar og trykk på knappen for å sletta dei.', 'nuke-defaultreason' => 'Massesletting av sider lagde inn av [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', 'nuke-multiplepeople' => 'Massesletting av nyleg oppretta sider', - 'nuke-tools' => 'Dette verktøyet mogeleggjer massesletting av sider som nyleg er lagde inn av ein viss brukar eller ei viss IP-adresse. + 'nuke-tools' => 'Dette verktøyet mogeleggjer massesletting av sider som nyleg er lagde inn av ein viss brukar eller ei viss IP-adresse. Skriv inn eit brukarnamn eller ei IP-adresse for å få ei liste over sider som kan verta sletta, eller lat feltet stå tomt for alle brukarar.', 'nuke-submit-user' => 'Gå', 'nuke-submit-delete' => 'Slett valde', @@ -2120,9 +2252,9 @@ $messages['nso'] = array( $messages['oc'] = array( 'nuke' => 'Supression en massa', 'nuke-desc' => 'Balha la possiblitat als administrators de [[Special:Nuke|suprimir en massa]] de paginas.', - 'nuke-nopages' => 'Cap de pagina novèla creada per [[Special:Contributions/$1|$1]] dins la lista dels darrièrs cambiaments.', # Fuzzy - 'nuke-list' => 'Las paginas seguentas son estadas creadas recentament per [[Special:Contributions/$1|$1]]; Indicatz un comentari e clicatz sul boton per los suprimir.', # Fuzzy - 'nuke-defaultreason' => 'Supression en massa de las paginas apondudas per $1', # Fuzzy + 'nuke-nopages' => 'Cap de pagina novèla pas creada per [[Special:Contributions/$1|{{GENDER:$1|$1}}]] dins la lista dels darrièrs cambiaments.', + 'nuke-list' => 'Las paginas seguentas son estadas creadas recentament per [[Special:Contributions/$1|{{GENDER:$1|$1}}]]; picatz un comentari e clicatz sul boton per los suprimir.', + 'nuke-defaultreason' => 'Supression en massa de las paginas apondudas per [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', 'nuke-tools' => 'Aquesta aisina autoriza las supressions en massa de las paginas apondudas recentament per un utilizaire enregistrat o per una adreça IP. Indicatz l’adreça IP per obténer la lista de las paginas de suprimir, o daissar blanc per totes los utilizaires.', 'nuke-submit-user' => 'Validar', 'nuke-submit-delete' => 'Supression seleccionada', @@ -2174,6 +2306,7 @@ $messages['pdc'] = array( * @author Olgak85 * @author Rezonansowy * @author Sp5uhe + * @author WTM * @author Woytecr */ $messages['pl'] = array( @@ -2202,6 +2335,8 @@ Wpisz nazwę użytkownika lub adres IP, by otrzymać listę stron do usunięcia. 'nuke-nopages-global' => 'Brak nowych stron w [[Special:RecentChanges|ostatnich zmianach]].', 'nuke-viewchanges' => 'widok zmian', 'nuke-namespace' => 'Tylko w przestrzeni nazw:', + 'nuke-linkoncontribs' => 'masowe usuwanie', + 'nuke-linkoncontribs-text' => 'Masowe usuwanie stron, których jedynym autorem jest ten użytkownik', ); /** Piedmontese (Piemontèis) @@ -2245,7 +2380,7 @@ $messages['ps'] = array( 'nuke-multiplepeople' => 'د تازه راگډ شويو مخونو ټول ړنگېدنه', 'nuke-submit-user' => 'ورځه', 'nuke-submit-delete' => 'ټاکل شوی ړنگول', - 'right-nuke' => 'د ډله ايز ړنګون مخونه', + 'right-nuke' => 'د ډله ايز ړنگون مخونه', 'nuke-select' => 'ټاکل: $1', 'nuke-userorip' => 'کارن-نوم، آي پي پته يا تش:', 'nuke-maxpages' => 'د حد اکثر شمېر مخونه:', @@ -2257,6 +2392,7 @@ $messages['ps'] = array( /** Portuguese (português) * @author Hamilton Abreu + * @author Imperadeiro98 * @author Luckas * @author Malafaya * @author 555 @@ -2280,6 +2416,8 @@ introduza um comentário e clique o botão para eliminá-las.', 'nuke-editby' => 'Criada por [[Special:Contributions/$1|$1]]', # Fuzzy 'nuke-deleted' => "A página '''$1''' foi eliminada.", 'nuke-not-deleted' => 'Não foi possível eliminar a página [[:$1]].', + 'nuke-linkoncontribs' => 'eliminação em massa', + 'nuke-linkoncontribs-text' => 'Eliminar em massa páginas em que este utilizador é o único autor', ); /** Brazilian Portuguese (português do Brasil) @@ -2421,6 +2559,7 @@ Mitte 'u nome de l'utende o l'indirizze IP pe avè 'n'elenghe de le pàggene de 'nuke-nopages-global' => "Non ge stonne pàggene nove jndr'à le [[Special:RecentChanges|cangiaminde recende]].", 'nuke-viewchanges' => 'vide le cangiaminde', 'nuke-namespace' => 'Limite a namespace:', + 'nuke-linkoncontribs' => 'scangellazione de masse', ); /** Russian (русский) @@ -2429,6 +2568,7 @@ Mitte 'u nome de l'utende o l'indirizze IP pe avè 'n'elenghe de le pàggene de * @author HalanTul * @author KPu3uC B Poccuu * @author Kaganer + * @author Okras * @author VasilievVV * @author Александр Сигачёв */ @@ -2458,6 +2598,8 @@ $messages['ru'] = array( 'nuke-nopages-global' => 'В [[Special:RecentChanges|недавних изменениях]] нет новых страниц.', 'nuke-viewchanges' => 'Внесённые изменения', 'nuke-namespace' => 'Ограничить пространством имён:', + 'nuke-linkoncontribs' => 'множественное удаление', + 'nuke-linkoncontribs-text' => 'Массово удалить страницы, где этот участник является единственным автором', ); /** Rusyn (русиньскый) @@ -2497,7 +2639,7 @@ $messages['sah'] = array( Соторго быһаарыыта суруйан баран тимэҕи баттаа.', 'nuke-defaultreason' => '$1 кыттааччы айбыт сирэйдэрин бүтүннүү суох оҥоруу', # Fuzzy 'nuke-multiplepeople' => 'элбэх кыттааччы', # Fuzzy - 'nuke-tools' => 'Бу сирэй көмөтүнэн ханнык эмэ кыттааччы оҥорбут көннөрүүлэрин эбэтэр биир IP-ттан оҥоһуллубут көннөрүүлэри бүтүннүү суох гынахха сөп. + 'nuke-tools' => 'Бу сирэй көмөтүнэн ханнык эмэ кыттааччы оҥорбут көннөрүүлэрин эбэтэр биир IP-ттан оҥоһуллубут көннөрүүлэри бүтүннүү суох гынахха сөп. Кыттааччы аатын эбэтэр IP-тын киллэрдэххинэ оҥорбут көннөрүүлэрин тиһигэ тахсыа, кураанах хааллардаххына бары кыттааччылар көннөрүүлэрэ көстүө.', 'nuke-submit-user' => 'Толор', 'nuke-submit-delete' => 'Талыллыбыты сот', @@ -2523,6 +2665,45 @@ $messages['scn'] = array( 'right-nuke' => "Scancella pàggini 'n massa", ); +/** Scots (Scots) + * @author John Reid + */ +$messages['sco'] = array( + 'nuke-linkoncontribs' => 'nuke-delete', + 'nuke-linkoncontribs-text' => 'nuke-delete pages whaur this uiser is the yinly author', +); + +/** Serbo-Croatian (srpskohrvatski / српскохрватски) + * @author Kolega2357 + */ +$messages['sh'] = array( + 'nuke' => 'Masovno brisanje', + 'action-nuke' => 'masovno brisanje stranica', + 'nuke-desc' => 'Daje administratoru mogućnost da [[Special:Nuke|masovno briše]] stranice.', + 'nuke-nopages' => 'Nema novih stranica od strane korisnika [[Special:Contributions/$1|$1]] u skorašnjim izmenama.', + 'nuke-list' => 'Sledeće stranice je skoro napravio korisnik [[Special:Contributions/$1|{{GENDER:$1|$1}}]]; ostavite komentar i pritisnite dugme za njihovo brisanje.', + 'nuke-list-multiple' => 'Sledeće stranice su nedavno napravljenje, ostavite komentar i pritisnite dugme da biste ih obrisali.', + 'nuke-defaultreason' => 'Masovno brisanje stranica koje je napravio korisnik [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', + 'nuke-multiplepeople' => 'Masovno brisanje nedavno dodatih stranica', + 'nuke-tools' => 'Ova alatka omogućava zbirno brisanje stranica koje je nedavno dodao određeni korisnik (sa nalogom ili bez njega). +Unesite korisničko ime ili IP adresu da biste dobili spisak stranica za brisanje, ili ostavite prazno ako želite da se navedu svi korisnici.', + 'nuke-submit-user' => 'Idi', + 'nuke-submit-delete' => 'Obriši izabrano', + 'right-nuke' => 'masovno brisanje stranica', + 'nuke-select' => 'Izaberi: $1', + 'nuke-userorip' => 'Korisničko ime, IP adresa ili prazno:', + 'nuke-maxpages' => 'Najveći broj stranica:', + 'nuke-editby' => 'Napravio [[Special:Contributions/$1|$1]]', + 'nuke-deleted' => "Stranica '''$1''' je obrisana.", + 'nuke-not-deleted' => "'''Ne mogu''' da obrišem stranicu [[:$1]].", + 'nuke-delete-more' => '[[Special:Nuke|Obriši još stranica]]', + 'nuke-pattern' => 'Obrazac za naziv stranice:', + 'nuke-nopages-global' => 'Nema novih stranica u [[Special:RecentChanges|skorašnjim izmenama]].', + 'nuke-viewchanges' => 'pogledaj izmene', + 'nuke-namespace' => 'Ograničenja na imenskim prostorima:', + 'nuke-linkoncontribs' => 'masovno brisanje', +); + /** Sinhala (සිංහල) * @author නන්දිමිතුරු * @author පසිඳු කාවින්ද @@ -2631,6 +2812,9 @@ $messages['sr-ec'] = array( 'nuke-not-deleted' => "'''Не могу''' да обришем страницу [[:$1]].", 'nuke-delete-more' => '[[Special:Nuke|Обриши још страница]]', 'nuke-pattern' => 'Образац за назив странице:', + 'nuke-viewchanges' => 'прикажи измене', + 'nuke-linkoncontribs' => 'масовно брисање', + 'nuke-linkoncontribs-text' => 'Скупно брисање страница чије једини аутор овај корисник', ); /** Serbian (Latin script) (srpski (latinica)‎) @@ -2650,7 +2834,7 @@ $messages['sr-el'] = array( Unesite korisničko ime ili IP adresu da biste dobili spisak stranica za brisanje, ili ostavite prazno ako želite da se navedu svi korisnici.', 'nuke-submit-user' => 'Idi', 'nuke-submit-delete' => 'Obriši obeleženo', - 'right-nuke' => 'Masovno brisanje strana.', + 'right-nuke' => 'masovno brisanje strana', 'nuke-select' => 'Izaberi: $1', 'nuke-userorip' => 'Korisničko ime, IP adresa ili prazno:', 'nuke-maxpages' => 'Najveći broj stranica:', @@ -2659,6 +2843,9 @@ Unesite korisničko ime ili IP adresu da biste dobili spisak stranica za brisanj 'nuke-not-deleted' => "'''Ne mogu''' da obrišem stranicu [[:$1]].", 'nuke-delete-more' => '[[Special:Nuke|Obriši još stranica]]', 'nuke-pattern' => 'Obrazac za naziv stranice:', + 'nuke-viewchanges' => 'prikaži izmene', + 'nuke-linkoncontribs' => 'masovno brisanje', + 'nuke-linkoncontribs-text' => 'Skupno brisanje stranica čije jedini autor ovaj korisnik', ); /** Seeltersk (Seeltersk) @@ -2695,6 +2882,7 @@ tuliskeun pamanggih anjeun, terus pencét tombolna pikeun ngahapus.', # Fuzzy /** Swedish (svenska) * @author Cybjit + * @author Hangsna * @author Lejonel * @author Martinwiss * @author Tobulos1 @@ -2726,6 +2914,8 @@ Ange användarnamnet eller IP-adressen för att se en lista över sidor som kan 'nuke-nopages-global' => 'Det finns inga nya sidor i [[Special:RecentChanges|senaste ändringar]].', 'nuke-viewchanges' => 'visa ändringar', 'nuke-namespace' => 'Begränsa till namnrymd:', + 'nuke-linkoncontribs' => 'massradering', + 'nuke-linkoncontribs-text' => 'Radera alla sidor där användaren är ensam bidragsgivare', ); /** Swahili (Kiswahili) @@ -2755,6 +2945,7 @@ $messages['ta'] = array( ); /** Telugu (తెలుగు) + * @author Ravichandra * @author Veeven */ $messages['te'] = array( @@ -2774,6 +2965,7 @@ $messages['te'] = array( 'nuke-delete-more' => '[[Special:Nuke|మరిన్ని పేజీలను తొలగించండి]]', 'nuke-nopages-global' => '[[Special:RecentChanges|ఇటీవలి మార్పుల]]లో కొత్త పేజీలు ఏమీ లేవు.', 'nuke-viewchanges' => 'మార్పులను చూడండి', + 'nuke-linkoncontribs' => 'మూకుమ్మడి తొలగింపు', ); /** Tetum (tetun) @@ -2910,7 +3102,9 @@ $messages['ug-latn'] = array( /** Ukrainian (українська) * @author AS + * @author Aced * @author Ahonc + * @author Andriykopanytsia * @author Base * @author Dim Grits * @author Microcell @@ -2933,7 +3127,7 @@ $messages['uk'] = array( 'nuke-submit-delete' => 'Вилучити обрані', 'right-nuke' => 'Масове вилучення сторінок', 'nuke-select' => 'Вибір: $1', - 'nuke-userorip' => "Ім'я користувача, IP-адреса (за бажанням):", + 'nuke-userorip' => "Ім'я користувача, IP-адреса (необов'язковий параметр):", 'nuke-maxpages' => 'Максимальна кількість сторінок:', 'nuke-editby' => 'Створено {{GENDER:$1|користувачем|користувачкою}} [[Special:Contributions/$1|$1]]', 'nuke-deleted' => "Сторінка '''$1''' була вилучена.", @@ -2943,6 +3137,8 @@ $messages['uk'] = array( 'nuke-nopages-global' => 'У [[Special:RecentChanges|нових редагуваннях]] немає нових сторінок.', 'nuke-viewchanges' => 'переглянути зміни', 'nuke-namespace' => 'Обмежити за простором назв:', + 'nuke-linkoncontribs' => 'масове вилучення', + 'nuke-linkoncontribs-text' => 'Масове вилучення сторінок, де цей користувач є єдиним автором', ); /** Urdu (اردو) @@ -3011,17 +3207,20 @@ Hãy nhập tên thành viên hoặc địa chỉ IP để lấy danh sách các 'nuke-nopages-global' => 'Không có trang mới trong các [[Special:RecentChanges|thay đổi gần đây]].', 'nuke-viewchanges' => 'xem thay đổi', 'nuke-namespace' => 'Giới hạn theo không gian tên:', + 'nuke-linkoncontribs' => 'xóa hàng loạt', + 'nuke-linkoncontribs-text' => 'Xóa hàng loạt các trang có người dùng này là tác giả duy nhất', ); /** Volapük (Volapük) + * @author Malafaya * @author Smeira */ $messages['vo'] = array( 'nuke' => 'Moükön pademi', 'nuke-desc' => 'Gevon guvanes fägi ad moükön padamödotis', - 'nuke-nopages' => 'Pads nonik fa geban: [[Special:Contributions/$1|$1]] pejaföls binons su lised votükamas nulik.', # Fuzzy - 'nuke-list' => 'Pads sököl pejafons brefabüo fa geban: [[Special:Contributions/$1|$1]]; penolös küpeti e klikolös gnobi ad moükön onis.', # Fuzzy - 'nuke-defaultreason' => 'Moükam padas fa geban: $1 pejafölas', # Fuzzy + 'nuke-nopages' => 'Pads nonik fa geban: [[Special:Contributions/$1|{{GENDER:$1|$1}}]] pejaföls binons su lised votükamas nulik.', + 'nuke-list' => 'Pads sököl pejafons brefabüo fa geban: [[Special:Contributions/$1|{{GENDER:$1|$1}}]]; penolös küpeti e klikolös gnobi ad moükön onis.', + 'nuke-defaultreason' => 'Moükam masifik padas fa [[Special:Contributions/$1|{{GENDER:$1|$1}}]] pejafölas', 'nuke-tools' => 'Stum at kanon moükön mödoti padas fa geban u ladet-IP semik brefabüo pejafölas. Penolös gebananemi u ladeti-IP ad dagetön lisedi padas moükovik:', # Fuzzy 'nuke-submit-user' => 'Ledunolöd', 'nuke-submit-delete' => 'Pevalöl ad pamoükön', @@ -3068,8 +3267,8 @@ $messages['zh-hans'] = array( 'action-nuke' => '删除大量页面', 'nuke-desc' => '让管理员可以[[Special:Nuke|批量删除]]页面', 'nuke-nopages' => '在最近更改中没有[[Special:Contributions/$1|{{GENDER:$1|$1}}]]创建的新页面。', - 'nuke-list' => '以下为[[Special:Contributions/$1|{{GENDER:$1|$1}}]]最近创建的页面,请填写注释并点击按钮删除它们。', - 'nuke-list-multiple' => '以下为最近创建的页面,请填写注释并点击按钮删除它们。', + 'nuke-list' => '以下为[[Special:Contributions/$1|{{GENDER:$1|$1}}]]最近创建的页面,请填写注释再点击按钮删除它们。', + 'nuke-list-multiple' => '以下为最近创建的页面,请填写注释再点击按钮删除它们。', 'nuke-defaultreason' => '大量删除[[Special:Contributions/$1|{{GENDER:$1|$1}}]]创建的页面', 'nuke-multiplepeople' => '大量删除最近添加的页面', 'nuke-tools' => '此工具允许大量删除指定用户或IP地址在最近创建的页面。输入用户名或IP地址可获取可删除页面列表,留白则检索所有用户。', @@ -3078,7 +3277,7 @@ $messages['zh-hans'] = array( 'right-nuke' => '删除大量页面', 'nuke-select' => '选择:$1', 'nuke-userorip' => '用户名、IP地址或空白:', - 'nuke-maxpages' => '最多页面数:', + 'nuke-maxpages' => '最大页面数:', 'nuke-editby' => '由[[Special:Contributions/$1|{{GENDER:$1|$1}}]]创建', 'nuke-deleted' => "已删除页面'''$1'''。", 'nuke-not-deleted' => "'''无法'''删除[[:$1]]页面。", @@ -3087,6 +3286,8 @@ $messages['zh-hans'] = array( 'nuke-nopages-global' => '[[Special:RecentChanges|最近更改]]中没有新的页面。', 'nuke-viewchanges' => '查看变更', 'nuke-namespace' => '限制名字空间为:', + 'nuke-linkoncontribs' => '大量删除', + 'nuke-linkoncontribs-text' => '大量删除仅此用户为作者的页面', ); /** Traditional Chinese (中文(繁體)‎) @@ -3094,6 +3295,7 @@ $messages['zh-hans'] = array( * @author Cwlin0416 * @author Justincheng12345 * @author Liangent + * @author Liuxinyu970226 * @author Mark85296341 * @author Shinjiman */ @@ -3121,4 +3323,6 @@ $messages['zh-hant'] = array( 'nuke-nopages-global' => '[[Special:RecentChanges|最近更改]]中沒有新的頁面。', 'nuke-viewchanges' => '查看變更', 'nuke-namespace' => '限制名字空間為:', + 'nuke-linkoncontribs' => '大量刪除', + 'nuke-linkoncontribs-text' => '大量刪除僅此用戶創建之頁面', ); diff --git a/extensions/Nuke/Nuke.php b/extensions/Nuke/Nuke.php index 80a41631..e10ce422 100644 --- a/extensions/Nuke/Nuke.php +++ b/extensions/Nuke/Nuke.php @@ -4,7 +4,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { die( 'Not an entry point.' ); } -define( 'Nuke_VERSION', '1.1.7' ); +define( 'Nuke_VERSION', '1.1.8' ); $dir = dirname( __FILE__ ) . '/'; @@ -24,9 +24,12 @@ $wgGroupPermissions['sysop']['nuke'] = true; $wgAvailableRights[] = 'nuke'; $wgAutoloadClasses['SpecialNuke'] = $dir . 'Nuke_body.php'; +$wgAutoloadClasses['NukeHooks'] = $dir . 'Nuke.hooks.php'; $wgSpecialPages['Nuke'] = 'SpecialNuke'; $wgSpecialPageGroups['Nuke'] = 'pagetools'; +$wgHooks['ContributionsToolLinks'][] = 'NukeHooks::nukeContributionsLinks'; + // Resource loader modules $moduleTemplate = array( 'localBasePath' => dirname( __FILE__ ) . '/', diff --git a/extensions/ParserFunctions/ParserFunctions.i18n.magic.php b/extensions/ParserFunctions/ParserFunctions.i18n.magic.php index 5d26cb71..e92ffe12 100644 --- a/extensions/ParserFunctions/ParserFunctions.i18n.magic.php +++ b/extensions/ParserFunctions/ParserFunctions.i18n.magic.php @@ -58,25 +58,26 @@ $magicWords['ar'] = array( /** Egyptian Spoken Arabic (مصرى) */ $magicWords['arz'] = array( - 'expr' => array( 0, 'تعبير', 'expr' ), - 'if' => array( 0, 'لو', 'if' ), - 'ifeq' => array( 0, 'لومعادلة', 'ifeq' ), - 'ifexpr' => array( 0, 'لوتعبير', 'ifexpr' ), - 'iferror' => array( 0, 'لوخطأ', 'iferror' ), - 'switch' => array( 0, 'تبديل', 'switch' ), - 'default' => array( 0, '#افتراضي', '#default' ), - 'ifexist' => array( 0, 'لوموجود', 'ifexist' ), - 'time' => array( 0, 'وقت', 'time' ), - 'timel' => array( 0, 'تيمل', 'timel' ), - 'rel2abs' => array( 0, 'ريلتوآبس', 'rel2abs' ), - 'titleparts' => array( 0, 'أجزاء_العنوان', 'titleparts' ), - 'len' => array( 0, 'لين', 'len' ), - 'pos' => array( 0, 'بوس', 'pos' ), - 'rpos' => array( 0, 'آربوس', 'rpos' ), - 'sub' => array( 0, 'متفرع', 'sub' ), - 'count' => array( 0, 'عدد', 'count' ), - 'replace' => array( 0, 'استبدال', 'replace' ), - 'explode' => array( 0, 'انفجار', 'explode' ), + 'expr' => array( 0, 'تعبير' ), + 'if' => array( 0, 'لو' ), + 'ifeq' => array( 0, 'لومعادلة' ), + 'ifexpr' => array( 0, 'لوتعبير' ), + 'iferror' => array( 0, 'لوخطأ' ), + 'switch' => array( 0, 'تبديل' ), + 'default' => array( 0, '#افتراضي' ), + 'ifexist' => array( 0, 'لوموجود' ), + 'time' => array( 0, 'وقت' ), + 'timel' => array( 0, 'تيمل' ), + 'rel2abs' => array( 0, 'ريلتوآبس' ), + 'titleparts' => array( 0, 'أجزاء_العنوان' ), + 'len' => array( 0, 'لين' ), + 'pos' => array( 0, 'بوس' ), + 'rpos' => array( 0, 'آربوس' ), + 'sub' => array( 0, 'متفرع' ), + 'count' => array( 0, 'عدد' ), + 'replace' => array( 0, 'استبدال' ), + 'explode' => array( 0, 'انفجار' ), + 'urldecode' => array( 0, 'فك_مسار' ), ); /** South Azerbaijani (تورکجه) */ @@ -100,7 +101,7 @@ $magicWords['ce'] = array( 'replace' => array( 0, 'хийцарна', 'замена' ), ); -/** Czech (česky) */ +/** Czech (čeština) */ $magicWords['cs'] = array( 'expr' => array( 0, 'výraz' ), 'if' => array( 0, 'když' ), @@ -122,8 +123,15 @@ $magicWords['de'] = array( /** Zazaki (Zazaki) */ $magicWords['diq'] = array( + 'expr' => array( 0, 'ifade' ), 'if' => array( 0, 'se' ), 'ifeq' => array( 0, 'sek' ), + 'ifexpr' => array( 0, 'ifadeyose' ), + 'iferror' => array( 0, 'çınyose' ), + 'time' => array( 0, 'zeman' ), + 'sub' => array( 0, 'bın' ), + 'count' => array( 0, 'hesabk' ), + 'replace' => array( 0, 'vırnayen' ), ); /** Esperanto (Esperanto) */ @@ -145,12 +153,14 @@ $magicWords['eo'] = array( /** Spanish (español) */ $magicWords['es'] = array( 'if' => array( 0, 'si' ), + 'ifeq' => array( 0, 'siigual' ), 'ifexpr' => array( 0, 'siexpr' ), 'iferror' => array( 0, 'sierror' ), 'switch' => array( 0, 'según' ), 'default' => array( 0, '#predeterminado' ), 'ifexist' => array( 0, 'siexiste' ), 'time' => array( 0, 'tiempo' ), + 'timel' => array( 0, 'tiempol' ), 'len' => array( 0, 'long', 'longitud' ), 'replace' => array( 0, 'reemplazar' ), 'explode' => array( 0, 'separar' ), @@ -293,7 +303,7 @@ $magicWords['ja'] = array( 'count' => array( 0, '回数' ), 'replace' => array( 0, '置き換え' ), 'explode' => array( 0, '分割' ), - 'urldecode' => array( 0, 'URLデコード' ), + 'urldecode' => array( 0, 'URLデコード', 'URLデコード' ), ); /** Korean (한국어) */ @@ -375,7 +385,7 @@ $magicWords['mk'] = array( $magicWords['ml'] = array( 'expr' => array( 0, 'ദ്യോതകം' ), 'if' => array( 0, 'എങ്കിൽ' ), - 'ifeq' => array( 0, 'സമെമെങ്കിൽ' ), + 'ifeq' => array( 0, 'സമമെങ്കിൽ' ), 'ifexpr' => array( 0, 'എക്സ്പ്രെഷനെങ്കിൽ' ), 'iferror' => array( 0, 'പിഴവെങ്കിൽ' ), 'switch' => array( 0, 'മാറ്റുക' ), @@ -580,22 +590,22 @@ $magicWords['uz'] = array( /** Vietnamese (Tiếng Việt) */ $magicWords['vi'] = array( - 'expr' => array( 0, 'côngthức' ), + 'expr' => array( 0, 'công_thức', 'côngthức' ), 'if' => array( 0, 'nếu' ), - 'ifeq' => array( 0, 'nếubằng' ), - 'ifexpr' => array( 0, 'nếucôngthức' ), - 'iferror' => array( 0, 'nếulỗi' ), - 'default' => array( 0, '#mặcđịnh' ), - 'ifexist' => array( 0, 'nếutồntại' ), + 'ifeq' => array( 0, 'nếu_bằng', 'nếubằng' ), + 'ifexpr' => array( 0, 'nếu_công_thức', 'nếucôngthức' ), + 'iferror' => array( 0, 'nếu_lỗi', 'nếulỗi' ), + 'default' => array( 0, '#mặc_định', '#mặcđịnh' ), + 'ifexist' => array( 0, 'nếu_tồn_tại', 'nếutồntại' ), 'time' => array( 0, 'giờ' ), - 'timel' => array( 0, 'giờđịaphương' ), - 'len' => array( 0, 'sốchữ', 'sốkýtự', 'sốkítự' ), - 'pos' => array( 0, 'vịtrí' ), - 'rpos' => array( 0, 'vịtríphải' ), - 'sub' => array( 0, 'chuỗicon' ), + 'timel' => array( 0, 'giờ_địa_phương', 'giờđịaphương' ), + 'len' => array( 0, 'số_chữ', 'sốchữ', 'số_ký_tự', 'sốkýtự', 'số_kí_tự', 'sốkítự' ), + 'pos' => array( 0, 'vị_trí', 'vịtrí' ), + 'rpos' => array( 0, 'vị_trí_phải', 'vịtríphải' ), + 'sub' => array( 0, 'chuỗi_con', 'chuỗicon' ), 'count' => array( 0, 'số' ), - 'replace' => array( 0, 'thaythế' ), - 'urldecode' => array( 0, 'giảimãurl' ), + 'replace' => array( 0, 'thay_thế', 'thaythế' ), + 'urldecode' => array( 0, 'giải_mã_url', 'giảimãurl' ), ); /** Yiddish (ייִדיש) */ @@ -632,7 +642,22 @@ $magicWords['zh'] = array( /** Simplified Chinese (中文(简体)‎) */ $magicWords['zh-hans'] = array( + 'if' => array( 0, '若' ), 'ifeq' => array( 0, '若相等', '如果相等' ), + 'iferror' => array( 0, '如果错误' ), + 'switch' => array( 0, '开关' ), 'default' => array( 0, '#默认' ), 'ifexist' => array( 0, '若有', '如果存在' ), + 'time' => array( 0, '时间' ), + 'pos' => array( 0, '终端' ), + 'rpos' => array( 0, '反终端' ), + 'sub' => array( 0, 'PF子' ), + 'count' => array( 0, '计数' ), +); + +/** Traditional Chinese (中文(繁體)‎) */ +$magicWords['zh-hant'] = array( + 'if' => array( 0, '若' ), + 'time' => array( 0, '時間' ), + 'timel' => array( 0, '時間L' ), ); \ No newline at end of file diff --git a/extensions/ParserFunctions/ParserFunctions.i18n.php b/extensions/ParserFunctions/ParserFunctions.i18n.php index e026b693..f61310b2 100644 --- a/extensions/ParserFunctions/ParserFunctions.i18n.php +++ b/extensions/ParserFunctions/ParserFunctions.i18n.php @@ -177,6 +177,7 @@ $messages['an'] = array( /** Arabic (العربية) * @author Aiman titi + * @author Asaifm * @author Meno25 */ $messages['ar'] = array( @@ -184,6 +185,7 @@ $messages['ar'] = array( 'pfunc_time_error' => 'خطأ: زمن غير صحيح', 'pfunc_time_too_long' => 'خطأ: استدعاءات #time كثيرة جدا', 'pfunc_time_too_big' => 'خطأ : # الوقت يدعم فقط حتى 9999 سنة', + 'pfunc_time_too_small' => 'خطأ: #time تدعم الأعوام بدءاً من 0.', 'pfunc_rel2abs_invalid_depth' => 'خطأ: عمق غير صحيح في المسار: "$1" (حاول دخول عقدة فوق العقدة الجذرية)', 'pfunc_expr_stack_exhausted' => 'خطأ في التعبير: ستاك مجهد', 'pfunc_expr_unexpected_number' => 'خطأ في التعبير: رقم غير متوقع', @@ -237,6 +239,7 @@ $messages['arz'] = array( /** Assamese (অসমীয়া) * @author Bishnu Saikia + * @author Gitartha.bordoloi * @author Rajuonline */ $messages['as'] = array( @@ -254,7 +257,7 @@ $messages['as'] = array( 'pfunc_expr_unexpected_closing_bracket' => 'এক্সপ্ৰেছন ত্ৰুটী: অবাঞ্চিত সমাপ্তকাৰী বন্ধনী', 'pfunc_expr_unrecognised_punctuation' => 'এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "$1"', 'pfunc_expr_unclosed_bracket' => 'এক্সপ্ৰেছন ত্ৰুটী: উন্মুক্ত বন্ধনী', - 'pfunc_expr_division_by_zero' => 'শূন্যৰ দ্বাৰা হৰণ কৰা হৈছে', + 'pfunc_expr_division_by_zero' => 'শূন্যৰে হৰণ কৰা হৈছে।', 'pfunc_expr_invalid_argument' => '$1 ৰ বাবে ভুল চৰ্ত: < -1 অথবা > 1', 'pfunc_expr_invalid_argument_ln' => 'ln ৰ বাবে অমান্য চৰ্ত: <= 0', 'pfunc_expr_unknown_error' => 'এক্সপ্ৰেছন ত্ৰুটী: : অজ্ঞাত ত্ৰুটী ($1)', @@ -545,14 +548,16 @@ $messages['ca'] = array( * @author Умар */ $messages['ce'] = array( + 'pfunc_desc' => 'Дика тайина маьӀнийн функцешца анализатор', 'pfunc_time_error' => 'Гlалато: хан нийса яц', 'pfunc_expr_stack_exhausted' => 'Яздарехь гlалат ду: хьаладуьззина татол', 'pfunc_expr_unrecognised_word' => 'Яздарехь гlалат ду: дойзуш доцу дош «$1»', - 'pfunc_expr_unexpected_operator' => 'Дешнийн гӀалам : ца хаа оператор $1', + 'pfunc_expr_unexpected_operator' => 'Дешнийн гӀалат: ца хаа оператор $1', 'pfunc_expr_unrecognised_punctuation' => 'Дешнашан гӀалат: евзина йоцу пунктуацин символ «$1»', + 'pfunc_expr_unknown_error' => 'Дешнийн гӀалат: ца хаа гӀалат ($1)', ); -/** Czech (česky) +/** Czech (čeština) * @author Danny B. * @author Li-sung * @author Matěj Grabovský @@ -564,6 +569,7 @@ $messages['cs'] = array( 'pfunc_time_error' => 'Chyba: neplatný čas', 'pfunc_time_too_long' => 'Chyba: příliš mnoho volání #time', 'pfunc_time_too_big' => 'Chyba: #time nepodporuje roky nad 9999', + 'pfunc_time_too_small' => 'Chyba: #time nepodporuje roky menší než 0.', 'pfunc_rel2abs_invalid_depth' => 'Chyba: Neplatná hloubka v cestě: "$1" (pokus o přístup do uzlu vyššího než kořen)', 'pfunc_expr_stack_exhausted' => 'Chyba ve výrazu: Zásobník plně obsazen', 'pfunc_expr_unexpected_number' => 'Chyba ve výrazu: Očekáváno číslo', @@ -631,12 +637,13 @@ $messages['da'] = array( * @author Kghbln * @author LWChris * @author Metalhead64 + * @author Purodha * @author Raimond Spekking * @author Rentenirer * @author Rillke */ $messages['de'] = array( - 'pfunc_desc' => 'Ergänzt den Parser um logische Funktionen', + 'pfunc_desc' => 'Erweitert den Parser um logische Funktionen', 'pfunc_time_error' => 'Fehler: Ungültige Zeitangabe', 'pfunc_time_too_long' => 'Fehler: Zu viele #time-Aufrufe', 'pfunc_time_too_big' => 'Fehler: #time unterstützt nur Jahre bis 9999', @@ -702,6 +709,8 @@ $messages['dsb'] = array( 'pfunc_desc' => 'Rozšyrja parser wó logiske funkcije', 'pfunc_time_error' => 'Zmólka: njepłaśiwy cas', 'pfunc_time_too_long' => 'Zmólka: pśewjele zawołanjow #time', + 'pfunc_time_too_big' => 'Zmólka: #time pódpěra jano lěta až do 9999.', + 'pfunc_time_too_small' => 'Zmólka: #time pódpěra jano lěta wót 0.', 'pfunc_rel2abs_invalid_depth' => 'Zmólka: Njepłaśiwy dłym w sćažce: "$1" (wopyt na suk pśistup měś, kótaryž jo wušej kórjenjowego suka)', 'pfunc_expr_stack_exhausted' => 'Wurazowa zmólka: Stack wupócerany', 'pfunc_expr_unexpected_number' => 'Wurazowa zmólka: Njewócakana licba', @@ -823,7 +832,10 @@ $messages['et'] = array( 'pfunc_time_error' => 'Tõrge: Vigane aeg', 'pfunc_time_too_long' => 'Tõrge: Liiga palju #time-kutseid.', 'pfunc_time_too_big' => 'Tõrge: #time toetab vaid aastaid kuni väärtuseni 9999.', + 'pfunc_time_too_small' => 'Tõrge: #time toetab aastaid alates 0-st.', + 'pfunc_rel2abs_invalid_depth' => 'Tõrge: Vigane tee pikkus: "$1" (üritati pöörduda juursõlmest kõrgema sõlme poole).', 'pfunc_expr_unexpected_number' => 'Avaldistõrge: Ootamatu number', + 'pfunc_expr_preg_match_failure' => 'Avaldistõrge: preg_match nurjus ootamatult.', 'pfunc_expr_unrecognised_word' => 'Avaldistõrge: Tundmatu sõna "$1"', 'pfunc_expr_unexpected_operator' => 'Avaldistõrge: Ootamatu $1-tehtemärk', 'pfunc_expr_missing_operand' => 'Avaldistõrge: Puudub $1-tehte operand', @@ -1135,6 +1147,7 @@ $messages['hsb'] = array( 'pfunc_time_error' => 'Zmylk: njepłaćiwe časowe podaće', 'pfunc_time_too_long' => 'Zmylk: přewjele zawołanjow #time', 'pfunc_time_too_big' => 'Zmylk: #time jenož lěta hač do 9999 podpěruje.', + 'pfunc_time_too_small' => 'Zmylk: #time jenož lěta wot 0 podpěruje.', 'pfunc_rel2abs_invalid_depth' => 'Zmylk: Njepłaćiwa hłubokosć w pućiku: "$1" (Pospyt, zo by na suk wyše hłowneho suka dohrabnyło)', 'pfunc_expr_stack_exhausted' => 'Wurazowy zmylk: Staplowy skład wučerpany', 'pfunc_expr_unexpected_number' => 'Wurazowy zmylk: Njewočakowana ličba', @@ -1187,6 +1200,7 @@ $messages['ia'] = array( 'pfunc_time_error' => 'Error: tempore invalide', 'pfunc_time_too_long' => 'Error: troppo de appellos a #time', 'pfunc_time_too_big' => 'Error: #time supporta solmente annos usque a 9999', + 'pfunc_time_too_small' => 'Error: #time supporta solmente annos desde 0.', 'pfunc_rel2abs_invalid_depth' => 'Error: Profunditate invalide in cammino: "$1" (essayava acceder a un nodo superior al radice)', 'pfunc_expr_stack_exhausted' => 'Error in expression: Pila exhaurite', 'pfunc_expr_unexpected_number' => 'Error in expression: Numero non expectate', @@ -1233,6 +1247,33 @@ $messages['id'] = array( 'pfunc_string_too_long' => 'Kesalahan: String melebihi limit $1 karakter', ); +/** Iloko (Ilokano) + * @author Lam-ang + */ +$messages['ilo'] = array( + 'pfunc_desc' => 'Napasayaat a parser nga adda kadagiti lohikal nga annong', + 'pfunc_time_error' => 'Biddut: Imbalido nga oras.', + 'pfunc_time_too_long' => 'Biddut: Adu unay dagiti panagtawag ti #time.', + 'pfunc_time_too_big' => 'Biddut: Ti #time ket suportaranna laeng dagiti tawen aginggana iti 9999.', + 'pfunc_time_too_small' => 'Biddut: ti #time ket suportaranna laeng dagiti tawen manipud ti 0.', + 'pfunc_rel2abs_invalid_depth' => 'Biddut: Imbalido a kauneg iti dalan: "$1" (nagpadas a nangserrek ti nodo iti ngato ti ramut a nodo).', + 'pfunc_expr_stack_exhausted' => 'Biddut a panangiyebkas: Naibusen ti tuon.', + 'pfunc_expr_unexpected_number' => 'Biddut a panangiyebkas:Di nanamnama a bilang.', + 'pfunc_expr_preg_match_failure' => 'Biddut a panangiyebkas: Di nanamnama a pannakapaay ti preg_match.', + 'pfunc_expr_unrecognised_word' => 'Biddut a panangiyebkas: Di mabigbigan a balikas ti "$1".', + 'pfunc_expr_unexpected_operator' => 'Biddut a panangiyebkas: Di nanamnama nga operator ti $1.', + 'pfunc_expr_missing_operand' => 'Biddut a panangiyebkas: Napukaw nga operand para iti $1.', + 'pfunc_expr_unexpected_closing_bracket' => 'Biddut a panangiyebkas: Di nanamnama a pangrikep a braket.', + 'pfunc_expr_unrecognised_punctuation' => 'Biddut a panangiyebkas: Di nanamnama a karakter ti tuldek ti "$1".', + 'pfunc_expr_unclosed_bracket' => 'Biddut a panangiyebkas: Di narikpan a braket.', + 'pfunc_expr_division_by_zero' => 'Panagbingbingay babaen ti sero.', + 'pfunc_expr_invalid_argument' => 'Imbalido nga argumento para iti $1: < -1 wenno > 1.', + 'pfunc_expr_invalid_argument_ln' => 'Imbalido nga argumento para iti ln: <= 0.', + 'pfunc_expr_unknown_error' => 'Biddut a panangiyebkas: Di ammo a biddut ($1).', + 'pfunc_expr_not_a_number' => 'Iti $1: Ti resulta ket saan a bilang.', + 'pfunc_string_too_long' => 'Biddut: Ti kuerdas ket nasurokanna ti limitado ti karakter iti $1.', +); + /** Ido (Ido) * @author Malafaya */ @@ -1241,6 +1282,28 @@ $messages['io'] = array( 'pfunc_expr_division_by_zero' => 'Divido per zero', ); +/** Icelandic (íslenska) + * @author Snævar + */ +$messages['is'] = array( + 'pfunc_time_error' => 'Villa: Ógildur tími.', + 'pfunc_time_too_long' => 'Villa: Of mörg köll til #time.', + 'pfunc_time_too_big' => 'Villa: #time styður aðeins ár upp til 9999.', + 'pfunc_time_too_small' => 'Villa: #time styður aðeins ár frá 0.', + 'pfunc_expr_unexpected_number' => 'Villa í segð: Óvænt tala.', + 'pfunc_expr_unrecognised_word' => 'Villa í segð: Óþekkt orð „$1”.', + 'pfunc_expr_unexpected_operator' => 'Villa í segð: Óvæntur $1 virki.', + 'pfunc_expr_missing_operand' => 'Villa í segð: Vantar þolanda fyrir $1.', + 'pfunc_expr_unrecognised_punctuation' => 'Villa í segð: Óþekkt greinarmerki „$1”.', + 'pfunc_expr_unclosed_bracket' => 'Villa í segð: Ólokaður svigi.', + 'pfunc_expr_division_by_zero' => 'Deiling með núlli.', + 'pfunc_expr_invalid_argument' => 'Ógilt frumgildi fyrir $1: < -1 eða > 1.', + 'pfunc_expr_invalid_argument_ln' => 'Ógilt frumgildi fyrir ln: <= 0.', + 'pfunc_expr_unknown_error' => 'Villa í segð: Óþekkt villa ($1).', + 'pfunc_expr_not_a_number' => 'Niðurstaðan úr $1 er ekki tala.', + 'pfunc_string_too_long' => 'Villa: Strengurinn er lengri en hámarkslengdin $1 segir til um.', +); + /** Italian (italiano) * @author Beta16 * @author BrokenArrow @@ -1494,6 +1557,7 @@ $messages['lb'] = array( 'pfunc_time_error' => 'Feeler: ongëlteg Zäit', 'pfunc_time_too_long' => 'Feeler: ze dacks #time opgeruff', 'pfunc_time_too_big' => 'Feeler: #time ënnerstëtzt nëmme Jore bis 9999', + 'pfunc_time_too_small' => 'Feeler: #time ënnerstëtzt nëmme Jore vun 0 un.', 'pfunc_expr_stack_exhausted' => 'Expressiouns-Feeler: Stack iwwergelaf', 'pfunc_expr_unexpected_number' => 'Expressiouns-Feeler: Onerwarten Zuel', 'pfunc_expr_unrecognised_word' => 'Expressiouns-Feeler: Onerkantent Wuert "$1"', @@ -1536,6 +1600,13 @@ $messages['li'] = array( 'pfunc_string_too_long' => 'Fout: De teks is lenger es de limiet van $1 {{PLURAL:$1|teike|teikes}}', ); +/** لوری (لوری) + * @author Bonevarluri + */ +$messages['lrc'] = array( + 'pfunc_time_error' => 'خطا:وخت نامعتور.', +); + /** Lithuanian (lietuvių) * @author Hugo.arg */ @@ -1564,7 +1635,7 @@ $messages['min'] = array( * @author Brest */ $messages['mk'] = array( - 'pfunc_desc' => 'Проширување на можностите на парсерот со логички функции', + 'pfunc_desc' => 'Проширување на можностите на расчленувачот со логички функции', 'pfunc_time_error' => 'Грешка: погрешен формат за време', 'pfunc_time_too_long' => 'Грешка: премногу повикувања на функцијата #time', 'pfunc_time_too_big' => 'Грешка: #time поддржува само години до 9999', @@ -1763,7 +1834,7 @@ $messages['nl'] = array( 'pfunc_expr_preg_match_failure' => 'Fout in uitdrukking: onverwacht falen van preg_match.', 'pfunc_expr_unrecognised_word' => 'Fout in uitdrukking: woord "$1" niet herkend.', 'pfunc_expr_unexpected_operator' => 'Fout in uitdrukking: niet verwachte operator $1.', - 'pfunc_expr_missing_operand' => 'Fout in uitdrukking: operand voor $1 mist.', + 'pfunc_expr_missing_operand' => 'Fout in uitdrukking: operand voor $1 ontbreekt.', 'pfunc_expr_unexpected_closing_bracket' => 'Fout in uitdrukking: haakje sluiten op onverwachte plaats.', 'pfunc_expr_unrecognised_punctuation' => 'Fout in uitdrukking: niet herkend leesteken "$1".', 'pfunc_expr_unclosed_bracket' => 'Fout in uitdrukking: niet gesloten haakje openen.', @@ -1898,6 +1969,7 @@ $messages['pms'] = array( 'pfunc_time_error' => 'Eror: temp nen bon', 'pfunc_time_too_long' => 'Eror: #time a ven ciamà tròpe vire', 'pfunc_time_too_big' => "Eror: #time a përmët mach j'agn fin al 9999.", + 'pfunc_time_too_small' => "Eror: #time a përmet j'agn mach da 0.", 'pfunc_rel2abs_invalid_depth' => 'Eror: profondità nen bon-a ant ël përcors: "$1" (a l\'é provasse a ciamé un grop dzora a la rèis)', 'pfunc_expr_stack_exhausted' => "Eror ëd l'espression: stach esaurìa", 'pfunc_expr_unexpected_number' => "Eror ëd l'espression: nùmer pa spetà", @@ -1941,7 +2013,8 @@ $messages['pt'] = array( 'pfunc_desc' => 'Melhora o analisador sintático com funções lógicas', 'pfunc_time_error' => 'Erro: tempo inválido', 'pfunc_time_too_long' => 'Erro: demasiadas chamadas a #time', - 'pfunc_time_too_big' => 'Erro: #time só lida com anos até 9999', + 'pfunc_time_too_big' => 'Erro: #time só permite anos até 9999', + 'pfunc_time_too_small' => 'Erro: #time só permite anos a partir de 0.', 'pfunc_rel2abs_invalid_depth' => 'Erro: Profundidade inválida no caminho: "$1" (foi tentado o acesso a um nó acima do nó raiz)', 'pfunc_expr_stack_exhausted' => 'Erro de expressão: Pilha esgotada', 'pfunc_expr_unexpected_number' => 'Erro de expressão: Número inesperado', @@ -2176,6 +2249,15 @@ $messages['scn'] = array( 'pfunc_string_too_long' => 'Erruri: la stringa supira lu limiti di $1 carattiri', ); +/** Serbo-Croatian (srpskohrvatski / српскохрватски) + * @author Kolega2357 + */ +$messages['sh'] = array( + 'pfunc_time_error' => 'Greška: pogrešno vreme', + 'pfunc_time_too_long' => 'Greška: previše pozivanja funkcije #time', + 'pfunc_rel2abs_invalid_depth' => 'Greška: Nepravilna dubina u putanji: "$1"', +); + /** Sinhala (සිංහල) * @author Budhajeewa * @author නන්දිමිතුරු @@ -2379,6 +2461,7 @@ $messages['sv'] = array( 'pfunc_time_error' => 'Fel: ogiltig tid', 'pfunc_time_too_long' => 'Fel: för många anrop av #time', 'pfunc_time_too_big' => 'Fel: # tid stöder endast år fram till 9999', + 'pfunc_time_too_small' => 'Fel: #tid stödjer enbart år från 0.', 'pfunc_rel2abs_invalid_depth' => 'Fel: felaktig djup i sökväg: "$1" (försöker nå en nod ovanför rotnoden)', 'pfunc_expr_stack_exhausted' => 'Fel i uttryck: Stackutrymmet tog slut', 'pfunc_expr_unexpected_number' => 'Fel i uttryck: Oväntat tal', diff --git a/extensions/ParserFunctions/ParserFunctions.php b/extensions/ParserFunctions/ParserFunctions.php index 4ef62047..99c8444c 100644 --- a/extensions/ParserFunctions/ParserFunctions.php +++ b/extensions/ParserFunctions/ParserFunctions.php @@ -25,10 +25,20 @@ $wgPFStringLengthLimit = 1000; * * WARNING: enabling this may have an adverse impact on the sanity of your users. * An alternative, saner solution for embedding complex text processing in - * MediaWiki templates can be found at: http://www.mediawiki.org/wiki/Extension:Lua + * MediaWiki templates can be found at: http://www.mediawiki.org/wiki/Extension:Scribunto */ $wgPFEnableStringFunctions = false; +/** + * Enable string functions, when running Wikimedia Jenkins unit tests. + * + * Running Jenkins unit tests without setting $wgPFEnableStringFunctions = true; + * will cause all the parser tests for string functions to be skipped. + */ +if ( isset( $wgWikimediaJenkinsCI ) && ( $wgWikimediaJenkinsCI === true ) ) { + $wgPFEnableStringFunctions = true ; +} + /** REGISTRATION */ $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, diff --git a/extensions/ParserFunctions/ParserFunctions_body.php b/extensions/ParserFunctions/ParserFunctions_body.php index 3567cc58..e4ede065 100644 --- a/extensions/ParserFunctions/ParserFunctions_body.php +++ b/extensions/ParserFunctions/ParserFunctions_body.php @@ -669,7 +669,7 @@ class ExtParserFunctions { } if ( intval( $inLength ) == 0 ) { - $result = mb_substr( $inStr, $inStart ); + $result = mb_substr( $inStr, intval( $inStart ) ); } else { $result = mb_substr( $inStr, intval( $inStart ), intval( $inLength ) ); } diff --git a/extensions/PdfHandler/COPYING b/extensions/PdfHandler/COPYING new file mode 100644 index 00000000..d159169d --- /dev/null +++ b/extensions/PdfHandler/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/extensions/PdfHandler/PdfHandler.i18n.php b/extensions/PdfHandler/PdfHandler.i18n.php index 06143e7b..213f4462 100644 --- a/extensions/PdfHandler/PdfHandler.i18n.php +++ b/extensions/PdfHandler/PdfHandler.i18n.php @@ -226,7 +226,7 @@ $messages['ckb'] = array( 'exif-pdf-pagesize' => 'قەبارەی پەڕە', ); -/** Czech (česky) +/** Czech (čeština) * @author Matěj Grabovský * @author Mormegil */ @@ -542,6 +542,10 @@ $messages['ia'] = array( 'pdf-desc' => 'Gestor pro visualisar files PDF in modo de imagine', 'pdf_no_metadata' => 'Non pote obtener metadatos ab PDF', 'pdf_page_error' => 'Numero de pagina foras del intervallo', + 'exif-pdf-producer' => 'Programma de conversion', + 'exif-pdf-version' => 'Version del formato PDF', + 'exif-pdf-encrypted' => 'Cryptate', + 'exif-pdf-pagesize' => 'Dimension del pagina', ); /** Indonesian (Bahasa Indonesia) @@ -672,6 +676,7 @@ $messages['lb'] = array( 'pdf-desc' => '"Programm" den et erméiglecht PDF-Fichieren als Bild ze kucken', 'pdf_no_metadata' => 'Meta-Informatiounen aus dem PDF Dokument kënnen net gelies ginn', 'pdf_page_error' => "D'Säitenzuel ass net an dem Beräich.", + 'exif-pdf-producer' => 'Ëmwandlungsprogramm', 'exif-pdf-version' => 'Versioun vum PDF-Format', 'exif-pdf-encrypted' => 'Verschlësselt', 'exif-pdf-pagesize' => 'Gréisst vun der Säit', @@ -686,6 +691,13 @@ $messages['li'] = array( 'pdf_page_error' => 'paginanómmer besteit neet', ); +/** لوری (لوری) + * @author Mogoeilor + */ +$messages['lrc'] = array( + 'exif-pdf-pagesize' => 'انازه بلگه', +); + /** Lithuanian (lietuvių) * @author Matasg */ @@ -726,11 +738,12 @@ $messages['ml'] = array( /** Marathi (मराठी) * @author Kaustubh * @author Sankalpdravid + * @author V.narsikar */ $messages['mr'] = array( 'pdf-desc' => 'चित्र मोडमध्ये पीडीएफ संचिका पाहण्यासाठी आवश्यक प्रणाली', 'pdf_no_metadata' => 'पीडीएफमधून मेटाडाटा घेऊ शकत नाही', - 'pdf_page_error' => 'पान क्रमांक सीमेमध्ये नाही', + 'pdf_page_error' => 'पान क्रमांक आवाक्यात नाही', ); /** Malay (Bahasa Melayu) diff --git a/extensions/PdfHandler/PdfHandler_body.php b/extensions/PdfHandler/PdfHandler_body.php index d9ed4884..495f3bb8 100644 --- a/extensions/PdfHandler/PdfHandler_body.php +++ b/extensions/PdfHandler/PdfHandler_body.php @@ -188,12 +188,12 @@ class PdfHandler extends ImageHandler { "-", $dstPath ); - $cmd .= ") 2>&1"; + $cmd .= ")"; wfProfileIn( 'PdfHandler' ); wfDebug( __METHOD__ . ": $cmd\n" ); $retval = ''; - $err = wfShellExec( $cmd, $retval ); + $err = wfShellExecWithStderr( $cmd, $retval ); wfProfileOut( 'PdfHandler' ); $removed = $this->removeBadFile( $dstPath, $retval ); diff --git a/extensions/Poem/Poem.i18n.php b/extensions/Poem/Poem.i18n.php index c58ce78d..29740252 100644 --- a/extensions/Poem/Poem.i18n.php +++ b/extensions/Poem/Poem.i18n.php @@ -124,6 +124,13 @@ $messages['ca'] = array( 'poem-desc' => "Afegeix l'etiqueta <poem> per al formatatge de poemes", ); +/** Chechen (нохчийн) + * @author Умар + */ +$messages['ce'] = array( + 'poem-desc' => 'ТӀетуху тег <poem> дешнаш дӀадаха', +); + /** Sorani Kurdish (کوردی) * @author Asoxor */ @@ -131,7 +138,7 @@ $messages['ckb'] = array( 'poem-desc' => 'تاگی <poem> زێدەدەکات بۆ ڕێکخستنی ھۆنراوەکان', ); -/** Czech (česky) +/** Czech (čeština) * @author Matěj Grabovský */ $messages['cs'] = array( @@ -147,6 +154,7 @@ $messages['da'] = array( /** German (Deutsch) * @author Kghbln + * @author Purodha * @author Raimond Spekking */ $messages['de'] = array( @@ -310,7 +318,7 @@ $messages['id'] = array( * @author Lam-ang */ $messages['ilo'] = array( - 'poem-desc' => 'Ikkan na iti<poem> nga tag para ti pagporma ti daniw', + 'poem-desc' => 'Agnayon ti etiketa ti <poem> para iti panagporma ti daniw', ); /** Italian (italiano) @@ -558,6 +566,13 @@ $messages['scn'] = array( 'poem-desc' => 'Iunci lu tag <poem> pi la furmattazioni di li testa puetici', ); +/** Scots (Scots) + * @author John Reid + */ +$messages['sco'] = array( + 'poem-desc' => 'Adds <poem> tag fr poem formattin', +); + /** Slovak (slovenčina) * @author Helix84 */ diff --git a/extensions/Renameuser/COPYING b/extensions/Renameuser/COPYING new file mode 100644 index 00000000..d159169d --- /dev/null +++ b/extensions/Renameuser/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/extensions/Renameuser/README b/extensions/Renameuser/README index e44aaafe..a344ebf6 100644 --- a/extensions/Renameuser/README +++ b/extensions/Renameuser/README @@ -1,4 +1,4 @@ -These is the readme file for the MediaWiki Renameuser extension. +This is the readme file for the MediaWiki Renameuser extension. Extension page on mediawiki.org: https://www.mediawiki.org/wiki/Extension:Renameuser Latest version of the readme file: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Renameuser.git;a=blob;f=README diff --git a/extensions/Renameuser/Renameuser.alias.php b/extensions/Renameuser/Renameuser.alias.php index 0523c045..13997709 100644 --- a/extensions/Renameuser/Renameuser.alias.php +++ b/extensions/Renameuser/Renameuser.alias.php @@ -64,7 +64,7 @@ $specialPageAliases['ce'] = array( 'Renameuser' => array( 'Декъашхочун_цӀе_хийца' ), ); -/** Czech (česky) */ +/** Czech (čeština) */ $specialPageAliases['cs'] = array( 'Renameuser' => array( 'Přejmenovat_uživatele' ), ); @@ -131,7 +131,7 @@ $specialPageAliases['frp'] = array( /** Galician (galego) */ $specialPageAliases['gl'] = array( - 'Renameuser' => array( 'Renomear_o_usuario' ), + 'Renameuser' => array( 'Renomear_o_usuario', 'Renomear_usuario', 'Renomear_a_usuaria', 'Renomear_usuaria' ), ); /** Swiss German (Alemannisch) */ diff --git a/extensions/Renameuser/Renameuser.hooks.php b/extensions/Renameuser/Renameuser.hooks.php index 41dcc43e..e5271735 100644 --- a/extensions/Renameuser/Renameuser.hooks.php +++ b/extensions/Renameuser/Renameuser.hooks.php @@ -9,14 +9,14 @@ class RenameuserHooks { * @return bool */ public static function onShowMissingArticle( $article ) { - global $wgOut; $title = $article->getTitle(); $oldUser = User::newFromName( $title->getBaseText() ); if ( ($title->getNamespace() == NS_USER || $title->getNamespace() == NS_USER_TALK ) && ($oldUser && $oldUser->isAnon() )) { // Get the title for the base userpage $page = Title::makeTitle( NS_USER, str_replace( ' ', '_', $title->getBaseText() ) )->getPrefixedDBkey(); + $out = $article->getContext()->getOutput(); LogEventsList::showLogExtract( - $wgOut, + $out, 'renameuser', $page, '', @@ -53,4 +53,14 @@ class RenameuserHooks { } return true; } + + /** + * So users can just type in a username for target and it'll work + * @param array $types + * @return bool + */ + public static function onGetLogTypesOnUser( array &$types ) { + $types[] = 'renameuser'; + return true; + } } diff --git a/extensions/Renameuser/Renameuser.i18n.php b/extensions/Renameuser/Renameuser.i18n.php index c1411037..3cf2cfa7 100644 --- a/extensions/Renameuser/Renameuser.i18n.php +++ b/extensions/Renameuser/Renameuser.i18n.php @@ -328,7 +328,7 @@ $messages['as'] = array( 'renameuser' => 'ব্যৱহাৰকাৰীৰ নাম সলাওক', 'renameuser-linkoncontribs' => 'ব্যৱহাৰীৰ নাম সলাওক', 'renameuser-linkoncontribs-text' => 'এই ব্যৱহাৰকাৰীৰ পুনৰ্নামাকৰণ কৰক', - 'renameuser-desc' => "এজন ব্যৱহাৰকাৰীৰ পুনৰ্নামাকৰণ কৰিবলৈ এখন [[Special:Renameuser|বিশেষ পৃষ্ঠা]] যোগ দিয়ে (''renameuser'' অধিকাৰৰ প্ৰয়োজন)", + 'renameuser-desc' => "এজন ব্যৱহাৰকাৰীৰ পুনৰ্নামাকৰণ কৰিবলৈ এটা [[Special:Renameuser|বিশেষ পৃষ্ঠা]] যোগ দিয়ে (''renameuser'' অধিকাৰৰ প্ৰয়োজন)", 'renameuserold' => 'বৰ্তমানৰ সদস্যনাম:', 'renameusernew' => 'নতুন সদস্যনাম:', 'renameuserreason' => 'কাৰণ:', @@ -346,9 +346,9 @@ $messages['as'] = array( অনুগ্ৰহ কৰি ঘূৰি গৈ পুনৰ চেষ্টা কৰক।', 'renameuser-error-same-user' => 'আপুনি এজন সদস্যক আগৰ নামটোলৈকে নামান্তৰ কৰিব নোৱাৰে।', 'renameusersuccess' => '"$1" সদস্যজনক "$2"লৈ নামান্তৰিত কৰা হৈছে।', - 'renameuser-page-exists' => '$1 পৃষ্ঠাখন ইতিমধ্যেই আছে আৰু তাৰ ওপৰত স্বয়ংক্ৰিয়ভাৱে লিখিব নোৱাৰি।', - 'renameuser-page-moved' => "$1 পৃষ্ঠাখন $2-লৈ স্থানান্তৰ কৰা হ'ল।", - 'renameuser-page-unmoved' => '$1 পৃষ্ঠাখন $2-লৈ স্থানান্তৰ কৰা সম্ভৱ নহয়।', + 'renameuser-page-exists' => '$1 পৃষ্ঠাটো ইতিমধ্যেই আছে আৰু তাৰ ওপৰত স্বয়ংক্ৰিয়ভাৱে লিখিব নোৱাৰি।', + 'renameuser-page-moved' => "$1 পৃষ্ঠাটো $2-লৈ স্থানান্তৰ কৰা হ'ল।", + 'renameuser-page-unmoved' => '$1 পৃষ্ঠাটো $2-লৈ স্থানান্তৰ কৰা সম্ভৱ নহয়।', 'log-name-renameuser' => 'সদস্যৰ পুনৰ্নামাকৰণ অভিলেখ', 'log-description-renameuser' => 'সদস্যনাম পৰিৱৰ্তনৰ অভিলেখ', 'logentry-renameuser-renameuser-legacier' => 'সদস্য $4ৰ পৰা $5লৈ, $1’য়ে পুনৰ নামাকৰণ কৰিলে', @@ -790,12 +790,15 @@ A continuació es proporciona el registre de reanomenaments per a més informaci $messages['ce'] = array( 'renameuser' => 'Декъашхочун цӀе хийца', 'renameuser-linkoncontribs' => 'декъашхочун цӀе хийца', + 'renameuser-desc' => 'ТӀетуху декъашхойн цӀераш хийца [[Special:Renameuser|аьтту]] (оьшу бакъо renameuser)', 'renameuserreason' => 'Бахьан:', 'renameusersubmit' => 'Кхочушдé', 'renameuser-page-exists' => 'Агӏо $1 йолуш ю цундела и ша юху дӏаязъян йиш яц.', - 'renameuser-page-moved' => 'АгӀона $1 цӀе хийцина оцу $2.', + 'renameuser-page-moved' => 'АгӀона $1 цӀе хийцина → $2.', 'log-name-renameuser' => 'Декъашхойн цӀераш хийцар долу тептар', - 'renameuser-move-log' => 'Автоматически декъашхочун цӀе хийцина дела «[[User:$1|$1]]» оцу «[[User:$2|$2]]»', + 'log-description-renameuser' => 'ХӀокху тептар чохь гойту дӀабазбелла декъашхойн цӀераш хийцар.', + 'logentry-renameuser-renameuser-legacier' => '$1 $4 декъашхочун цӀе хийцина → $5', + 'renameuser-move-log' => 'Автоматически декъашхочун цӀе хийцина дела «[[User:$1|$1]]» → «[[User:$2|$2]]»', 'action-renameuser' => 'декъашхойн цӀераш хийцар', 'right-renameuser' => 'декъашхойн цӀераш хийцар', ); @@ -824,7 +827,7 @@ $messages['crh-latn'] = array( 'log-name-renameuser' => 'Qullanıcı adı deñişikligi jurnalı', ); -/** Czech (česky) +/** Czech (čeština) * @author Danny B. * @author Li-sung * @author Martin Kozák @@ -866,7 +869,7 @@ $messages['cs'] = array( Pro přehled je níže zobrazen výpis z knihy přejmenování uživatelů.', ); -/** Church Slavic (словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) +/** Church Slavic (словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) * @author Svetko * @author ОйЛ */ @@ -978,6 +981,7 @@ Til information er omdøbningsloggen vist nedenfor.', /** German (Deutsch) * @author Kghbln * @author Metalhead64 + * @author Purodha * @author Raimond Spekking * @author Spacebirdy * @author The Evil IP address @@ -1022,6 +1026,7 @@ Zur Information folgt das Benutzernamenänderungs-Logbuch.', /** Zazaki (Zazaki) * @author Aspar * @author Erdemaslancan + * @author Gorizon * @author Mirzali * @author Xoser */ @@ -1036,7 +1041,7 @@ $messages['diq'] = array( 'renameusermove' => 'nameyê karberan u pelê werêaameyişan bıkırışi nameyo newe', 'renameusersuppress' => 'Name de newi re hetenayışo newe vıraştış', 'renameuserreserve' => 'nameyê karberi yo verini bloke bıker.', - 'renameuserwarnings' => 'hişyariyi', + 'renameuserwarnings' => 'İğtari:', 'renameuserconfirm' => 'bele karberi newe ra name bıker', 'renameusersubmit' => 'bierşawê/biruşnê', 'renameuser-submit-blocklog' => 'Rocekanê bloqandê karbari bıvin', @@ -1722,6 +1727,7 @@ $messages['gu'] = array( /** Hebrew (עברית) * @author Amire80 + * @author Guycn2 * @author Ofekalef * @author Rotem Liss * @author Rotemliss @@ -1747,7 +1753,7 @@ $messages['he'] = array( 'renameusererrorexists' => 'המשתמש "$1" כבר קיים.', 'renameusererrorinvalid' => 'שם המשתמש "$1" אינו תקין.', 'renameuser-error-request' => 'הייתה בעיה בקבלת הבקשה. אנא חזרו לדף הקודם ונסו שנית.', - 'renameuser-error-same-user' => 'אינכם יכולים לשנות את שם המשתמש לשם זהה לשמו הישן.', + 'renameuser-error-same-user' => 'לא ניתן לשנות את שם המשתמש לשם זהה לשמו הישן.', 'renameusersuccess' => 'שם המשתמש של "$1" שונה ל"$2".', 'renameuser-page-exists' => 'הדף $1 כבר קיים ולא ניתן לדרוס אותו אוטומטית.', 'renameuser-page-moved' => 'הדף $1 הועבר לשם $2.', @@ -1758,7 +1764,7 @@ $messages['he'] = array( 'logentry-renameuser-renameuser-legacier' => '$1 {{GENDER:$2|שינה|שינתה}} את שם המשתמש $4 ל{{GRAMMAR:תחילית|$5}}', 'renameuser-move-log' => 'העברה אוטומטית בעקבות שינוי שם המשתמש "[[User:$1|$1]]" ל־"[[User:$2|$2]]"', 'action-renameuser' => 'לשנות שמות משתמש', - 'right-renameuser' => 'שינוי שמות משתמש', + 'right-renameuser' => 'שינוי שמות משתמשים', 'renameuser-renamed-notice' => 'שם המשתמש הזה שונה. יומן שינויי שמות המשתמש מוצג להלן.', ); @@ -1981,6 +1987,9 @@ Per favor retorna e reproba.', 'renameuser-page-moved' => 'Le pagina $1 ha essite renominate a $2.', 'renameuser-page-unmoved' => 'Le pagina $1 non poteva esser renominate a $2.', 'log-name-renameuser' => 'Registro de renominationes de usatores', + 'log-description-renameuser' => 'Isto es un registro de cambiamentos de nomines de usator.', + 'logentry-renameuser-renameuser' => '$1 {{GENDER:$2|renominava}} le usator $4 ({{PLURAL:$6|$6 modification|$6 modificationes}}) a $5', + 'logentry-renameuser-renameuser-legacier' => '$1 renominava le usator $4 a $5', 'renameuser-move-log' => 'Le pagina ha essite automaticamente renominate con le renomination del usator "[[User:$1|$1]]" a "[[User:$2|$2]]"', 'action-renameuser' => 'renominar usatores', 'right-renameuser' => 'Renominar usatores', @@ -2504,7 +2513,7 @@ $messages['ksh'] = array( 'renameusernew' => 'Dä neue Metmaacher-Name', 'renameuserreason' => 'Jrund för et Ömdäufe:', # Fuzzy 'renameusermove' => 'De Metmaachersigg met Klaaf- un Ungersigge op dä neue Metmaacher-Name ömstelle', - 'renameusersuppress' => 'Donn kein Ömleidung op dä neue Name aanlääje', + 'renameusersuppress' => 'Donn kein Ömleidong op dä neue Name aanlääje', 'renameuserreserve' => 'Donn dä Name fun dämm Metmaacher dobei sperre, dat_e nit norrens neu aanjemelldt weed.', 'renameuserwarnings' => 'Warnunge:', 'renameuserconfirm' => 'Jo, dunn dä Metmaacher ömbenenne un em singe Name ändere', @@ -2602,6 +2611,16 @@ $messages['la'] = array( Commodule notatio renominationum usoris subter datur.', ); +/** Ladino (Ladino) + * @author Menachem.Moreira + * @author Universal Life + */ +$messages['lad'] = array( + 'renameusernew' => 'Nombre de kullaneador muevo:', + 'renameuserreason' => 'Razon:', + 'renameuserwarnings' => 'Avisos:', +); + /** Luxembourgish (Lëtzebuergesch) * @author Les Meloures * @author Robby @@ -2681,6 +2700,22 @@ $messages['li'] = array( Relevante regels oet 't logbook staon hieónger.", ); +/** لوری (لوری) + * @author Bonevarluri + * @author Mogoeilor + */ +$messages['lrc'] = array( + 'renameusernew' => 'نوم کاروری تازه:', + 'renameuserreason' => 'دلیل:', + 'renameuser-submit-blocklog' => 'قلف پهرستنومه سی کارور نشو بیه', + 'renameuser-page-moved' => 'بلگه $1 د $2 جا وه جا بیه', + 'renameuser-page-unmoved' => 'نبوئه بلگه $1 د $2 جا وه جا بوئه', + 'log-name-renameuser' => 'پهرستنومه دواره نوم دئن د کارور', + 'log-description-renameuser' => 'یه پهرستنومه آلشت دئن نوم کاروریا هئ.', + 'renameuser-renamed-notice' => 'ای کارور یه گل نوم هنی وش دئه بیه. +پهرستنومه نوم هنی دئن وا سرچشمه زیر دروس بیه.', +); + /** Lithuanian (lietuvių) * @author Eitvys200 * @author Homo @@ -2820,7 +2855,7 @@ $messages['ml'] = array( 'renameuserold' => 'ഇപ്പോഴത്തെ ഉപയോക്തൃനാമം:', 'renameusernew' => 'പുതിയ ഉപയോക്തൃനാമം:', 'renameuserreason' => 'കാരണം:', - 'renameusermove' => 'നിലവിലുള്ള ഉപയോക്തൃതാളും, ഉപയോക്താവിന്റെ സം‌വാദം താളും (ഉപതാളുകൾ അടക്കം) പുതിയ നാമത്തിലേക്കു മാറ്റുക.', + 'renameusermove' => 'നിലവിലുള്ള ഉപയോക്തൃതാളും, ഉപയോക്താവിന്റെ സം‌വാദത്താളും (ഉപതാളുകൾ അടക്കം) പുതിയ നാമത്തിലേക്കു മാറ്റുക.', 'renameusersuppress' => 'പുതിയ നാമത്തിലേയ്ക്ക് തിരിച്ചുവിടലുകളൊന്നും സൃഷ്ടിക്കരുത്', 'renameuserreserve' => 'പഴയ ഉപയോക്തൃനാമം ഭാവിയിൽ ഉപയോഗിക്കുന്നതു തടയുക', 'renameuserwarnings' => 'മുന്നറിയിപ്പുകൾ:', @@ -2873,7 +2908,7 @@ $messages['mr'] = array( 'renameuserreserve' => 'जुने सदस्य खाते पुढील वापरासाठी अवरुद्ध करा', 'renameuserwarnings' => 'ताकीद:', 'renameuserconfirm' => 'होय, सदस्याचे नाव बदला', - 'renameusersubmit' => 'पाठवा', + 'renameusersubmit' => 'सादर करा', 'renameusererrordoesnotexist' => '"$1" नावाचा सदस्य अस्तित्वात नाही.', 'renameusererrorexists' => '"$1" नावाचा सदस्य अगोदरच अस्तित्वात आहे', 'renameusererrorinvalid' => '"$1" हे नाव चुकीचे आहे.', @@ -3459,9 +3494,12 @@ $messages['ps'] = array( 'renameuserold' => 'اوسنی کارن-نوم:', 'renameusernew' => 'نوی کارن-نوم:', 'renameuserreason' => 'سبب:', + 'renameusermove' => 'د کارن او د خبرو اترو مخونه (او د هغوی څېرمه مخونه) نوي نوم ته ورلېږدول', + 'renameusersuppress' => 'نوي نوم ته مخ گرځونی مه جوړوه', 'renameuserwarnings' => 'ګواښنې:', 'renameuserconfirm' => 'هو، کارن-نوم بدلوم', 'renameusersubmit' => 'سپارل', + 'renameuser-submit-blocklog' => 'د کارن بنديز يادښت ښکاره کول', 'renameusererrordoesnotexist' => 'د "$1" په نامه کوم کارن نه شته.', 'renameusererrorexists' => 'د "$1" په نامه يو کارن له پخوا نه شته.', 'renameusererrorinvalid' => 'د "$1" کارن نوم سم نه دی.', @@ -3593,6 +3631,13 @@ $messages['qu'] = array( Kay qatiqpiqa hukchay hallch'atam rikunki.", ); +/** Romansh (rumantsch) + * @author Kazu89 + */ +$messages['rm'] = array( + 'log-name-renameuser' => "Protocol da midadas da num d'utilisader", +); + /** Romani (Romani) * @author Desiphral */ @@ -3684,6 +3729,7 @@ L'archivije de le renomenaziune 'u iacchie aqquà sotte cumme referimende.", /** Russian (русский) * @author Ahonc + * @author Amire80 * @author Anonim.one * @author DCamer * @author DR @@ -3719,7 +3765,7 @@ $messages['ru'] = array( 'renameuser-page-unmoved' => 'Страница $1 не может быть переименована в $2.', 'log-name-renameuser' => 'Журнал переименований участников', 'log-description-renameuser' => 'Это журнал произведённых переименований зарегистрированных участников.', - 'logentry-renameuser-renameuser' => '$1 {{GENDER:$2|переименовал}} участника $4 ({{PLURAL:$6|$6 правка|$6 правки|$6 правок}}) в $5', + 'logentry-renameuser-renameuser' => '$1 {{GENDER:$2|переименовал}} участника $4 ({{PLURAL:$6|$6 правка|$6 правок|$6 правки}}) в $5', 'logentry-renameuser-renameuser-legacier' => '$1 переименовал пользователя $4 в $5', 'renameuser-move-log' => 'Автоматически в связи с переименованием учётной записи «[[User:$1|$1]]» в «[[User:$2|$2]]»', 'action-renameuser' => 'переименование участников', @@ -3889,10 +3935,43 @@ $messages['sgs'] = array( ); /** Serbo-Croatian (srpskohrvatski / српскохрватски) + * @author Kolega2357 * @author OC Ripper */ $messages['sh'] = array( + 'renameuser' => 'Promijeni ime korisnika', + 'renameuser-linkoncontribs' => 'preimenuj korisnika', + 'renameuser-linkoncontribs-text' => 'Preimenuj ovog korisnika', + 'renameuser-desc' => 'Preimenuj korisnika', # Fuzzy + 'renameuserold' => 'Trenutno korisničko ime:', + 'renameusernew' => 'Novo korisničko ime:', + 'renameuserreason' => 'Razlog:', + 'renameusermove' => 'Premjesti korisnikove stranice (glavnu, stranicu za razgovor i podstranice, ako postoje) na novo ime', + 'renameusersuppress' => 'Ne pravi preusmerenja na novo korisničko ime', + 'renameuserreserve' => 'Blokiraj staro korisničko ime za dalju upotrebu', + 'renameuserwarnings' => 'Upozorenja:', + 'renameuserconfirm' => 'Da, preimenuj korisnika', 'renameusersubmit' => 'Unesi', + 'renameuser-submit-blocklog' => 'Evidencija blokiranja za korisnika', + 'renameusererrordoesnotexist' => 'Korisničko ime "$1" ne postoji', + 'renameusererrorexists' => 'Korisničko ime "$1" već postoji', + 'renameusererrorinvalid' => 'Korisničko ime "$1" ne valja', + 'renameuser-error-request' => 'Nastao je problem prilikom primanja zahteva. +Molimo vas pokušajte ponovo.', + 'renameuser-error-same-user' => 'Ne možete preimenovati korisnika u isto ime kao i pre.', + 'renameusersuccess' => 'Korisnik "$1" je preimenovan u "$2"', + 'renameuser-page-exists' => 'Stranica $1 već postoji i ne može se automatski presnimiti.', + 'renameuser-page-moved' => 'Stranica $1 je premeštena na $2.', + 'renameuser-page-unmoved' => 'Strana $1 se ne može premestiti na $2.', + 'log-name-renameuser' => 'Evidencija preimenovanja', + 'log-description-renameuser' => 'Ovo je evidencija izmjena preimenovanja korisnika.', + 'logentry-renameuser-renameuser' => '$1 {{GENDER:$2|preimenovao}} korisnika $4 ({{PLURAL:$6|$6 edit|$6 edits}}) na $5', + 'logentry-renameuser-renameuser-legacier' => '$1 preimenovao korisnika $4 na $5', + 'renameuser-move-log' => 'Automatski premeštena stranica dok je korisnik "[[User:$1|$1]]" preimenovan u "[[User:$2|$2]]"', + 'action-renameuser' => 'preimenovanje korisnika', + 'right-renameuser' => 'preimenovanje korisničkih imena', + 'renameuser-renamed-notice' => 'Ovom korisniku je promenjeno ime. +Evidencija promena imena je priložena ispod, kao informacija.', ); /** Sinhala (සිංහල) @@ -4089,15 +4168,17 @@ $messages['sr-ec'] = array( 'renameuser-submit-blocklog' => 'Дневник блокирања за корисника', 'renameusererrordoesnotexist' => 'Корисник „$1“ не постоји.', 'renameusererrorexists' => 'Корисник „$1“ већ постоји.', - 'renameusererrorinvalid' => 'Погрешно корисничко име: "$1"', + 'renameusererrorinvalid' => 'Погрешно корисничко име: „$1“', 'renameuser-error-request' => 'Дошло је до проблема при примању захтева. Вратите се назад и покушајте поново.', 'renameuser-error-same-user' => 'Не можете преименовати корисника у исто име.', - 'renameusersuccess' => 'Корисник "$1" је преименован на "$2"', + 'renameusersuccess' => 'Корисник „$1“ је преименован на „$2“', 'renameuser-page-exists' => 'Страница $1 већ постоји и не може се заменити.', - 'renameuser-page-moved' => 'Страница $1 је премештена у $2.', + 'renameuser-page-moved' => 'Страница $1 је премештена на $2.', 'renameuser-page-unmoved' => 'Страница $1 не може да се премести на $2.', 'log-name-renameuser' => 'Дневник преименовања корисника', + 'log-description-renameuser' => 'Испод је списак преименованих корисника.', + 'logentry-renameuser-renameuser' => '$1 је {{GENDER:$2|преименовао|преименовала}} корисника $4 ({{PLURAL:$6|$6 измену|$6 измена}}) у $5', 'renameuser-move-log' => 'Премештене странице приликом преименовања корисника: „[[User:$1|$1]]“ у „[[User:$2|$2]]“.', 'action-renameuser' => 'преименовање корисника', 'right-renameuser' => 'преименовање корисничких имена', @@ -4132,12 +4213,14 @@ $messages['sr-el'] = array( 'renameusererrorinvalid' => 'Pogrešno korisničko ime: "$1"', 'renameuser-error-request' => 'Javio se problem prilikom prihvatanja zahteva. Idi nazad i pokušaj ponovo.', 'renameuser-error-same-user' => 'Ne možeš preimenovati korisničko ime u isto kao i prethodno.', - 'renameusersuccess' => 'Korisnik "$1" je preimenovan na "$2"', + 'renameusersuccess' => 'Korisnik „$1“ je preimenovan na „$2“', 'renameuser-page-exists' => 'Stranica $1 već postoji i ne može biti automatski presnimljena.', 'renameuser-page-moved' => 'Stranica $1 je premeštena na $2.', 'renameuser-page-unmoved' => 'Stranica $1 ne može biti premeštena na $2.', 'log-name-renameuser' => 'Dnevnik preimenovanja korisnika', - 'renameuser-move-log' => 'Automatski pomerene stranice prilikom preimenovanja korisničkog imena: „[[User:$1|$1]]“ u „[[User:$2|$2]]“.', + 'log-description-renameuser' => 'Ispod je spisak preimenovanih korisnika.', + 'logentry-renameuser-renameuser' => '$1 je {{GENDER:$2|preimenovao|preimenovala}} korisnika $4 ({{PLURAL:$6|$6 izmenu|$6 izmena}}) u $5', + 'renameuser-move-log' => 'Premeštene stranice prilikom preimenovanja korisnika: „[[User:$1|$1]]“ u „[[User:$2|$2]]“.', 'action-renameuser' => 'preimenovanje korisnika', 'right-renameuser' => 'preimenovanje korisničkih imena', 'renameuser-renamed-notice' => 'Ovom korisniku je promenjeno ime. @@ -4318,7 +4401,7 @@ $messages['te'] = array( 'renameuser-desc' => "వాడుకరి పేరు మార్చండి (''renameuser'' అన్న అధికారం కావాలి)", 'renameuserold' => 'ప్రస్తుత వాడుకరి పేరు:', 'renameusernew' => 'కొత్త వాడుకరి పేరు:', - 'renameuserreason' => 'పేరు మార్చడానికి కారణం:', # Fuzzy + 'renameuserreason' => 'కారణం:', 'renameusermove' => 'వాడుకరి పేజీ, చర్చాపేజీలను (వాటి ఉపపేజీలతో సహా) కొత్త పేరుకు తరలించండి', 'renameusersuppress' => 'కొత్త పేరుకి దారిమార్పులు సృష్టించకు', 'renameuserreserve' => 'పాత వాడుకరిపేరుని భవిష్యత్తులో వాడకుండా నిరోధించు', @@ -4534,6 +4617,7 @@ $messages['to'] = array( /** Turkish (Türkçe) * @author Joseph * @author Karduelis + * @author Marmase * @author Runningfridgesrule * @author Uğur Başak * @author Vito Genovese @@ -4545,7 +4629,7 @@ $messages['tr'] = array( 'renameuser-desc' => "Kullanıcıyı yeniden adlandırmak için bir [[Special:Renameuser|özel sayfa]] ekler (''kullanıcıyıyenidenadlandır'' hakkı gerekir)", 'renameuserold' => 'Şu anda ki kullanıcı adı:', 'renameusernew' => 'Yeni kullanıcı adı:', - 'renameuserreason' => 'Neden:', # Fuzzy + 'renameuserreason' => 'Neden:', 'renameusermove' => 'Kullanıcı ve tartışma sayfalarını (ve alt sayfalarını) yeni isme taşı', 'renameusersuppress' => 'Yeni ada yönlendirmeler oluşturma', 'renameuserreserve' => 'Eski kullanıcı adını ilerdeki kullanımlar için engelle', @@ -4639,9 +4723,10 @@ $messages['ur'] = array( /** Uzbek (oʻzbekcha) * @author CoderSI + * @author Sociologist */ $messages['uz'] = array( - 'log-name-renameuser' => 'Ishtirokchilarni qayta nomlash qaydlari', + 'log-name-renameuser' => 'Foydalanuvchilarni qayta nomlash qaydlari', ); /** vèneto (vèneto) @@ -4745,7 +4830,7 @@ $messages['vo'] = array( 'renameuser-desc' => "Votanemön gebani (gität: ''renameuser'' zesüdon)", 'renameuserold' => 'Gebananem anuik:', 'renameusernew' => 'Gebananem nulik:', - 'renameuserreason' => 'Kod votanemama:', # Fuzzy + 'renameuserreason' => 'Kod:', 'renameusermove' => 'Topätükön padi e bespikapadi gebana (e donapadis onsik) ad nem nulik', 'renameuserreserve' => 'Neletön gebananemi rigik (pos votanemam) ad pagebön ün fütür', 'renameuserwarnings' => 'Nuneds:', @@ -4836,13 +4921,15 @@ $messages['yo'] = array( ); /** Cantonese (粵語) + * @author Antonytse + * @author Liuxinyu970226 */ $messages['yue'] = array( 'renameuser' => '改用戶名', 'renameuser-desc' => "幫用戶改名 (需要 ''renameuser'' 權限)", 'renameuserold' => '現時嘅用戶名:', 'renameusernew' => '新嘅用戶名:', - 'renameuserreason' => '改名嘅原因:', # Fuzzy + 'renameuserreason' => '原因:', 'renameusermove' => '搬用戶頁同埋佢嘅對話頁(同埋佢哋嘅細頁)到新名', 'renameuserwarnings' => '警告:', 'renameuserconfirm' => '係,改呢個用戶名', diff --git a/extensions/Renameuser/Renameuser.php b/extensions/Renameuser/Renameuser.php index e9e83143..40636b54 100644 --- a/extensions/Renameuser/Renameuser.php +++ b/extensions/Renameuser/Renameuser.php @@ -48,4 +48,5 @@ $wgJobClasses['renameUser'] = 'RenameUserJob'; $wgHooks['ShowMissingArticle'][] = 'RenameuserHooks::onShowMissingArticle'; $wgHooks['ContributionsToolLinks'][] = 'RenameuserHooks::onContributionsToolLinks'; +$wgHooks['GetLogTypesOnUser'][] = 'RenameuserHooks::onGetLogTypesOnUser'; diff --git a/extensions/Renameuser/RenameuserSQL.php b/extensions/Renameuser/RenameuserSQL.php index eeb879a0..153cac88 100644 --- a/extensions/Renameuser/RenameuserSQL.php +++ b/extensions/Renameuser/RenameuserSQL.php @@ -112,6 +112,7 @@ class RenameuserSQL { if ( !$dbw->affectedRows() && $this->checkIfUserExists ) { $dbw->rollback(); + wfProfileOut( __METHOD__ ); return false; } @@ -221,7 +222,7 @@ class RenameuserSQL { } if ( count( $jobs ) > 0 ) { - Job::safeBatchInsert( $jobs ); // don't commit yet + JobQueueGroup::singleton()->push( $jobs, JobQueue::QOS_ATOMIC ); // don't commit yet } // Commit the transaction diff --git a/extensions/Renameuser/specials/SpecialRenameuser.php b/extensions/Renameuser/specials/SpecialRenameuser.php index d869e2a8..f6b9bac1 100644 --- a/extensions/Renameuser/specials/SpecialRenameuser.php +++ b/extensions/Renameuser/specials/SpecialRenameuser.php @@ -58,7 +58,7 @@ class SpecialRenameuser extends SpecialPage { } $out->addHTML( - Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalUrl(), 'id' => 'renameuser' ) ) . + Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getPageTitle()->getLocalUrl(), 'id' => 'renameuser' ) ) . Xml::openElement( 'fieldset' ) . Xml::element( 'legend', null, $this->msg( 'renameuser' )->text() ) . Xml::openElement( 'table', array( 'id' => 'mw-renameuser-table' ) ) . diff --git a/extensions/SpamBlacklist/SpamBlacklist.i18n.php b/extensions/SpamBlacklist/SpamBlacklist.i18n.php index af397dba..3dd1a487 100644 --- a/extensions/SpamBlacklist/SpamBlacklist.i18n.php +++ b/extensions/SpamBlacklist/SpamBlacklist.i18n.php @@ -56,7 +56,7 @@ $messages['en'] = array( 'spam-blacklist-desc' => 'Regex-based anti-spam tool allowing to blacklist URLs in pages and email addresses for registered users', 'log-name-spamblacklist' => 'Spam blacklist log', 'log-description-spamblacklist' => 'These events track spam blacklist hits.', - 'logentry-spamblacklist-hit' => '$1 caused a spam blacklist hit on $3 by attempting to add $4.', + 'logentry-spamblacklist-hit' => '{{GENDER:$2|$1}} caused a spam blacklist hit on $3 by attempting to add $4.', 'right-spamblacklistlog' => 'View spam blacklist log', 'action-spamblacklistlog' => 'view the spam blacklist log', ); @@ -88,10 +88,8 @@ Parameters: 'log-description-spamblacklist' => 'Description of spam blacklist log', 'logentry-spamblacklist-hit' => 'Log entry that is created when a user adds a link that is blacklisted on the spam blacklist. -Parameters: -* $1 - a user link, for example "Jane Doe (Talk | contribs)" -* $2 - (Optional) a username. Can be used for GENDER -* $3 - the page the user attempted to edit +{{logentry}} +Additional parameters: * $4 - the URL the user tried to add', 'right-spamblacklistlog' => '{{doc-right|spamblacklistlog}}', 'action-spamblacklistlog' => '{{doc-action|spamblacklistlog}}', @@ -144,6 +142,7 @@ $messages['an'] = array( ); /** Arabic (العربية) + * @author Asaifm * @author Meno25 * @author OsamaK */ @@ -167,8 +166,15 @@ $messages['ar'] = array( # * كل سطر غير فارغ هو تعبير منتظم يطابق فقط المضيفين داخل الوصلات الخارجية #
      ', + 'spam-blacklisted-email' => 'هذا البريد الإلكتروني مدرج في القائمة السوداء', + 'spam-blacklisted-email-text' => 'بريدك الإلكتروني مدرج في القائمة السوداء وبناءً على ذلك لا يمكنك استخدامه لإرسال رسائل للمستخدمين الأخرين.', + 'spam-blacklisted-email-signup' => 'هذا البريد الإلكتروني مدرج في القائمة السوداء وممنوع من الإستخدام.', 'spam-invalid-lines' => '{{PLURAL:$1||السطر التالي|السطران التاليان|السطور التالية}} في قائمة السبام السوداء {{PLURAL:$1|ليس تعبيرًا منتظمًا صحيحًا|ليسا تعبيرين منتظمين صحيحين|ليست تعبيرات منتظمة صحيحة}} و{{PLURAL:$1||يحتاج|يحتاجان|تحتاج}} إلى أن {{PLURAL:$1||يصحح|يصححان|تصحح}} قبل حفظ الصفحة:', - 'spam-blacklist-desc' => 'أداة ضد السبام تعتمد على التعبيرات المنتظمة: [[MediaWiki:Spam-blacklist]] و [[MediaWiki:Spam-whitelist]]', # Fuzzy + 'spam-blacklist-desc' => 'أداة ضد السخام تعتمد على التعبيرات النمطية وتسمح بمنع روابط في الصفحات وعنواين البريد الإلكتروني للمستخدمين المسجلين', + 'log-name-spamblacklist' => 'سجل السخام المدرج على القائمة السوداء', + 'log-description-spamblacklist' => 'هذا الأحداث توثق مشاهدات القائمة السوداء للسخام.', + 'right-spamblacklistlog' => 'اعرض سجل السخام المدرج على القائمة السوداء', + 'action-spamblacklistlog' => 'اعرض سجل السخام المدرج على القائمة السوداء', ); /** Egyptian Spoken Arabic (مصرى) @@ -248,16 +254,16 @@ $messages['as'] = array( * @author Xuacu */ $messages['ast'] = array( - 'spam-blacklist' => ' # Les URLs que casen con esta llista se bloquiarán cuando s\'añadan a una páxina. - # Esta llista afeuta namái a esta wiki; mira tamién la llista negra global. - # Pa ver la documentación visita https://www.mediawiki.org/wiki/Extension:SpamBlacklist - #
      +	'spam-blacklist' => '# 
      +# Les URLs esternes que casen con esta llista bloquiaránse cuando s\'amiesten a una páxina.
      +# Esta llista afeuta namái a esta wiki; mire tamién la llista negra global.
      +# Pa ver la documentación vea https://www.mediawiki.org/wiki/Extension:SpamBlacklist
       #
       # La sintaxis ye ésta:
       #  * Tol testu dende un caráuter "#" hasta lo cabero la llinia ye un comentariu
       #  * Toa llinia non balera ye un fragmentu regex qu\'afeuta namái a los sirvidores de les URLs
       
      - #
      ', +#
      ', 'spam-whitelist' => ' #
       # Les URLs esternes d\'esta llista *nun* se bloquiarán inda si quedaríen bloquiaes
       # por una entrada na llista negra.
      @@ -317,7 +323,7 @@ $messages['ba'] = array(
       # * # хәрефенән башлап юл аҙағына тиклем барыһы ла иҫкәрмә тип иҫәпләнә
       # * Һәр буш булмаған юл URL эсендәге төйөнгә генә ҡулланылған регуляр аңлатманың өлөшө булып тора
       #
      ', - 'spam-invalid-lines' => 'Түбәндәге ҡара исемлек {{PLURAL:$1|юлында|юлдарында}} хаталы регуляр {{PLURAL:$1|аңлатма|аңлатмалар}} бар һәм {{PLURAL:$1|ул|улар}} битте һаҡлар алдынан төҙәтелергә тейеш:', + 'spam-invalid-lines' => 'Түбәндәге ҡара исемлек {{PLURAL:$1|1=юлында|юлдарында}} хаталы регуляр {{PLURAL:$1|1=аңлатма|аңлатмалар}} бар һәм {{PLURAL:$1|1=ул|улар}} битте һаҡлар алдынан төҙәтелергә тейеш:', # Fuzzy 'spam-blacklist-desc' => 'Регуляр аңлатмаларға нигеҙләнгән спамға ҡаршы ҡорал: [[MediaWiki:Spam-blacklist]] һәм [[MediaWiki:Spam-whitelist]]', # Fuzzy ); @@ -427,7 +433,7 @@ $messages['be-tarask'] = array( 'spam-blacklisted-email' => 'Адрасы электроннай пошты з чорнага сьпісу', 'spam-blacklisted-email-text' => 'З Вашага адрасу электроннай пошты ў цяперашні момант забаронена дасылаць электронныя лісты іншым удзельнікам.', 'spam-blacklisted-email-signup' => 'Пададзены Вамі адрас электроннай пошты ў цяперашні момант знаходзіцца ў чорным сьпісе.', - 'spam-invalid-lines' => '{{PLURAL:$1|Наступны радок чорнага сьпісу ўтрымлівае няслушны рэгулярны выраз|Наступныя радкі чорнага сьпісу ўтрымліваюць няслушныя рэгулярныя выразы}} і {{PLURAL:$1|павінен быць|павінныя быць}} выпраўлены перад захаваньнем старонкі:', + 'spam-invalid-lines' => '{{PLURAL:$1|1=Наступны радок чорнага сьпісу ўтрымлівае няслушны рэгулярны выраз|Наступныя радкі чорнага сьпісу ўтрымліваюць няслушныя рэгулярныя выразы}} і {{PLURAL:$1|1=павінен быць|павінныя быць}} выпраўлены перад захаваньнем старонкі:', # Fuzzy 'spam-blacklist-desc' => 'Антыспамавы інструмэнт, які базуецца на рэгулярных выразах: [[MediaWiki:Spam-blacklist]] і [[MediaWiki:Spam-whitelist]]', # Fuzzy ); @@ -447,6 +453,7 @@ $messages['bjn'] = array( ); /** Bengali (বাংলা) + * @author Aftab1995 * @author Bellayet * @author Nasir8891 * @author Zaheen @@ -477,6 +484,10 @@ $messages['bn'] = array( 'spam-blacklisted-email-signup' => 'আপনার লেখা ইমেইল ঠিকানাটি কালোতালিকাভুক্ত।', 'spam-invalid-lines' => 'নিচের স্প্যাম কালোতালিকার {{PLURAL:$1|লাইন|লাইনগুলি}} অবৈধ রেগুলার {{PLURAL:$1|এক্সপ্রেশন|এক্সপ্রেশন}} ধারণ করছে এবং পাতাটি সংরক্ষণের আগে এগুলি ঠিক করা {{PLURAL:$1|প্রয়োজন|প্রয়োজন}}:', 'spam-blacklist-desc' => 'রেজেক্স-ভিত্তিক স্প্যামরোধী সরঞ্জাম: [[MediaWiki:Spam-blacklist]] এবং [[MediaWiki:Spam-whitelist]]', # Fuzzy + 'log-name-spamblacklist' => 'স্প্যাম কালোতালিকা লগ', + 'log-description-spamblacklist' => 'এই ঘটনাগুলি স্প্যাম কালোতালিকার হিট অনুসরণ।', + 'right-spamblacklistlog' => 'স্প্যাম কালোতালিকা লগ দেখুন', + 'action-spamblacklistlog' => 'স্প্যাম কালোতালিকা লগ দেখুন', ); /** Breton (brezhoneg) @@ -588,6 +599,15 @@ $messages['ca'] = array( 'spam-blacklist-desc' => 'Eina anti-spam basada en regexp: [[MediaWiki:Spam-blacklist]] i [[MediaWiki:Spam-whitelist]]', # Fuzzy ); +/** Chechen (нохчийн) + * @author Умар + */ +$messages['ce'] = array( + 'spam-blacklist-desc' => 'Анти-спам гӀирс URL дӀакъовла таро хуьлуьйту агӀонашкахь а электронан почтехь а дӀабазбелачу декъашхошна', + 'log-name-spamblacklist' => 'Спам-кехатан тептар', + 'log-description-spamblacklist' => 'Спам-кехато зулам долоре хьожу тептар.', +); + /** Sorani Kurdish (کوردی) * @author Calak */ @@ -595,7 +615,7 @@ $messages['ckb'] = array( 'right-spamblacklistlog' => 'دیتنی لۆگی پێرستی ڕەشی ڕیکلام', ); -/** Czech (česky) +/** Czech (čeština) * @author Li-sung * @author Matěj Grabovský * @author Mormegil @@ -642,7 +662,12 @@ $messages['cs'] = array( 'spam-blacklisted-email-text' => 'Vaše e-mailová adresa je momentálně uvedena na černé listině, takže ostatním uživatelům nemůžete posílat e-maily.', 'spam-blacklisted-email-signup' => 'Uvedená e-mailová adresa je v současné době na černé listině.', 'spam-invalid-lines' => 'Na černé listině spamu {{PLURAL:$1|je následující řádka neplatný regulární výraz|jsou následující řádky neplatné regulární výrazy|jsou následující řádky regulární výrazy}} a je nutné {{PLURAL:$1|ji|je|je}} před uložením stránky opravit :', - 'spam-blacklist-desc' => 'Antispamový nástroj na základě regulárních výrazů: [[MediaWiki:Spam-blacklist]] a [[MediaWiki:Spam-whitelist]]', # Fuzzy + 'spam-blacklist-desc' => 'Antispamový nástroj na základě regulárních výrazů umožňující zakázat URL ve stránkách a e-mailových adresách registrovaných uživatelů', + 'log-name-spamblacklist' => 'Kniha protispamové černé listiny', + 'log-description-spamblacklist' => 'Tyto události sledují zásahy protispamové černé listiny.', + 'logentry-spamblacklist-hit' => '{{GENDER:$2|Uživateli|Uživatelce}} $1 zabránila protispamová černá listina přidat $4 na stránku $3.', + 'right-spamblacklistlog' => 'Prohlížení knihy protispamové černé listiny', + 'action-spamblacklistlog' => 'prohlížet knihu protispamové černé listiny', ); /** Welsh (Cymraeg) @@ -700,6 +725,7 @@ $messages['cy'] = array( 'log-description-spamblacklist' => "Mae'r digwyddiadau hyn yn cofnodi trawiadau ar y rhestr sbam waharddedig.", 'logentry-spamblacklist-hit' => 'Fe geisiodd $1 ychwanegu $4 sydd ar y rhestr waharddedig $3.', 'right-spamblacklistlog' => 'Gallu gweld lòg y rhestr sbam waharddedig', + 'action-spamblacklistlog' => 'gweld lòg rhestr y sbam gwaharddedig', ); /** Danish (dansk) @@ -742,7 +768,7 @@ $messages['da'] = array( # * hver ikke-tomme linjer anvendes som regulære udtryk for at matcha domænenavne i webadresser #
      ', 'spam-blacklisted-email' => 'Sortlistet e-mailadresse', - 'spam-blacklisted-email-text' => 'Din e-mailadresse er i øjeblikket blokeret for at sende e-mails til andre brugere.', + 'spam-blacklisted-email-text' => 'Din e-mailadresse er i øjeblikket blokeret fra at sende e-mails til andre brugere.', 'spam-blacklisted-email-signup' => 'Den angivne e-mailadresse er i øjeblikket blokeret for brug.', 'spam-invalid-lines' => 'Følgende {{PLURAL:$1|linje|linjer}} i spamsortelisten er {{PLURAL:$1|et ugyldigt regulært udtryk|ugyldige regulære udtryk}} og må rettes før lagring af siden:', 'spam-blacklist-desc' => 'Antispamværktøj baseret på regulære udtryk der giver mulighed for at sortliste URLs i sider og e-mailadresser for registrerede brugere', @@ -802,7 +828,7 @@ $messages['de'] = array( 'spam-blacklisted-email-text' => 'Deine E-Mail-Adresse ist derzeit für das Senden von E-Mail-Nachrichten an andere Benutzer blockiert.', 'spam-blacklisted-email-signup' => 'Die angegebene E-Mail-Adresse ist derzeit für das Senden von E-Mail-Nachrichten an andere Benutzer blockiert.', 'spam-invalid-lines' => 'Die {{PLURAL:$1|folgende Zeile|folgenden Zeilen}} in der Blockierliste {{PLURAL:$1|ist ein ungültiger regulärer Ausdruck|sind ungültige reguläre Ausdrücke}}. Sie {{PLURAL:$1|muss|müssen}} vor dem Speichern der Seite korrigiert werden:', - 'spam-blacklist-desc' => 'Ein auf regulären Ausdrücken basiertes Anti-Spam-Werkzeug, um URLs in Seiten und E-Mail-Adressen für registrierte Benutzer auf die schwarze Liste zu setzen', + 'spam-blacklist-desc' => 'Ergänzt ein auf reguläre Ausdrücke gestütztes Anti-Spam-Werkzeug zum Sperren von URLs und E-Mail-Adressen für das Einfügen durch registrierte Benutzer', 'log-name-spamblacklist' => 'Spam-Blacklist-Logbuch', 'log-description-spamblacklist' => 'Es folgt ein Logbuch von Spam-Blacklist-Treffern.', 'logentry-spamblacklist-hit' => '$1 verursachte einen Spam-Blacklist-Treffer auf „$3“ durch das versuchte Hinzufügen von $4.', @@ -836,6 +862,7 @@ $messages['de-formal'] = array( /** Zazaki (Zazaki) * @author Aspar * @author Erdemaslancan + * @author Marmase * @author Olvörg */ $messages['diq'] = array( @@ -877,7 +904,7 @@ $messages['diq'] = array( 'spam-blacklisted-email-text' => 'Nıka adresa e-postayê to qande karberê bini ra mesac riştene listeyê siya dero.', 'spam-blacklisted-email-signup' => 'E-posta adresiyo ke deyayo karkerdışe cı newke groto siyaliste.', 'spam-invalid-lines' => 'na qerelisteya spami {{PLURAL:$1|satır|satıran}} {{PLURAL:$1|nemeqbulo|nemeqbuli}};', - 'spam-blacklist-desc' => 'Regex-tabanlı anti-spam aracı: [[MediaWiki:Spam-blacklist]] ve [[MediaWiki:Spam-whitelist]]', # Fuzzy + 'spam-blacklist-desc' => "Regex-tabanın haleta anti-spami URL'ya perer u adresa e-posta qande karberande qeydınan geriyayo", ); /** Lower Sorbian (dolnoserbski) @@ -905,7 +932,7 @@ $messages['dsb'] = array( # ', 'spam-blacklisted-email' => 'Blokěrowana e-mailowa adresa', 'spam-invalid-lines' => '{{PLURAL:$1|Slědujuca smužka|Slědujucej smužce|Slědujuce smužki|Slědujuce smužki}} corneje lisćiny spama {{PLURAL:$1|jo njepłaśiwy regularny wuraz|stej njepłaśiwej regularnej wuraza|su njepłaśiwe regularne wuraze|su njepłaśiwe regularne wuraze}} a {{PLURAL:$1|musy|musytej|muse|muse}} se korigěrowaś, pjerwjej až składujoš bok:', - 'spam-blacklist-desc' => 'Antispamowy rěd na zakłaźe regularnych wurazow: [[MediaWiki:Spam-blacklist]] a [[MediaWiki:Spam-whitelist]]', # Fuzzy + 'spam-blacklist-desc' => 'Pśeśiwospamowy rěd na zakłaźe Regex, kótaryž zmóznja URL na bokach a e-mailowe adresy za zregistrěrowanych wužywarjow do carneje lisćiny stajiś', ); /** Greek (Ελληνικά) @@ -1079,9 +1106,14 @@ $messages['et'] = array( # * Iga rida, mis ei ole tühi, on regulaaravaldise osa, mis vastab ainult e-posti aadressides sisalduvatele hostinimedele.', 'spam-blacklisted-email' => 'Musta nimekirja kantud e-posti aadress', 'spam-blacklisted-email-text' => 'Musta nimekirja sissekande tõttu on sinu e-posti aadressilt teistele kasutajatele e-kirjade saatmine praegu keelatud.', - 'spam-blacklisted-email-signup' => 'Selle e-posti aadressi kasutamine praegu musta nimekirja sissekandega keelatud.', + 'spam-blacklisted-email-signup' => 'Selle e-posti aadressi kasutamine on praegu musta nimekirja sissekandega keelatud.', 'spam-invalid-lines' => '{{PLURAL:$1|Järgmine rida|Järgmised read}} rämpspostituste mustas nimekirjas on {{PLURAL:$1|vigane regulaaravaldis|vigased regulaaravaldised}} ja {{PLURAL:$1|see|need}} tuleb enne lehekülje salvestamist parandada:', 'spam-blacklist-desc' => 'Regulaaravaldisel põhinev tööriist, mis võimaldab lisada musta nimekirja lehekülgedel toodud internetiaadresse ning registreeritud kasutajate e-posti aadresse.', + 'log-name-spamblacklist' => 'Rämpsu musta nimekirja logi', + 'log-description-spamblacklist' => 'Siin on loetletud rämpspostituse musta nimekirja tabamused.', + 'logentry-spamblacklist-hit' => '$1 püüdis lisada leheküljele $3 rämpspostituse mustas nimekirjas olevat linki $4.', + 'right-spamblacklistlog' => 'Vaadata rämpsu musta nimekirja', + 'action-spamblacklistlog' => 'vaadata rämpsu musta nimekirja', ); /** Persian (فارسی) @@ -1104,28 +1136,35 @@ $messages['fa'] = array( # در فهرست سیاه قرار داشته باشند. # # ', - 'email-blacklist' => ' # از ثبت نام یا ارسال نامه توسط نشانی‌های پست الکترونیکی که با این فهرست مطابقت کنند جلوگیری می‌شود. + 'email-blacklist' => ' # از ثبت نام یا ارسال نامه توسط نشانی‌های رایانامه‌ای که با این فهرست مطابقت کنند جلوگیری می‌شود. # این فهرست فقط روی همین ویکی اثر دارد؛ به فهرست سیاه سراسری نیز مراجعه کنید. # برای مستندات به https://www.mediawiki.org/wiki/Extension:SpamBlacklist مراجعه کنید #
       # دستورات به این شکل هستند:
       #  * همه چیز از «#» تا پایان سطر به عنوان توضیح در نظر گرفته می‌شود
      -#  * هر سطر از متن به عنوان یک دستور از نوع عبارت باقاعده در نظر گرفته می‌شود که فقط با نام میزبان در نشانی پست الکترونیکی مطابقت داده می‌شود
      +#  * هر سطر از متن به عنوان یک دستور از نوع عبارت باقاعده در نظر گرفته می‌شود که فقط با نام میزبان در نشانی رایانامه مطابقت داده می‌شود
       
        #
      ', 'email-whitelist' => ' #
      -# نشانی‌های پست الکترونیکی که با این فهرست مطابقت کنند محدود *نمی‌شوند* حتی اگر
      +# نشانی‌های رایانامه که با این فهرست مطابقت کنند محدود *نمی‌شوند* حتی اگر
       # با فهرست سیاه مطابقت داشته باشند.
       #
        #
      # دستورات به این شکل هستند: # * همه چیز از «#» تا پایان سطر به عنوان توضیح در نظر گرفته می‌شود -# * هر سطر از متن به عنوان یک دستور از نوع عبارت باقاعده در نظر گرفته می‌شود که فقط با نام میزبان در نشانی پست الکترونیکی مطابقت داده می‌شود', - 'spam-blacklisted-email' => 'نشانی پست الکترونیکی موجود در لیست سیاه', - 'spam-blacklisted-email-text' => 'نشانی پست الکترونیکی شما در حال حاضر در فهرست سیاه قرار دارد و نمی‌توانید به دیگر کاربران نامه بفرستید.', - 'spam-blacklisted-email-signup' => 'نشانی پست الکترونیکی داده شده در حال حاضر در فهرست سیاه است و قابل استفاده نیست.', +# * هر سطر از متن به عنوان یک دستور از نوع عبارت باقاعده در نظر گرفته می‌شود که فقط با نام میزبان در نشانی رایانامه مطابقت داده می‌شود', + 'spam-blacklisted-email' => 'نشانی رایانامه موجود در فهرست سیاه', + 'spam-blacklisted-email-text' => 'نشانی رایانامهٔ شما در حال حاضر در فهرست سیاه قرار دارد و نمی‌توانید به دیگر کاربران نامه بفرستید.', + 'spam-blacklisted-email-signup' => 'نشانی رایانامه داده‌شده در حال حاضر در فهرست سیاه است.', 'spam-invalid-lines' => '{{PLURAL:$1|سطر|سطرهای}} زیر در فهرست سیاه هرزنگاری، عبارات باقاعدهٔ نامجاز {{PLURAL:$1|است|هستند}} و قبل از ذخیره کردن صفحه باید اصلاح {{PLURAL:$1|شود|شوند}}:', - 'spam-blacklist-desc' => 'ابزار ضد هرزنویسی مبتنی بر regular expressions: [[MediaWiki:Spam-blacklist]] و [[MediaWiki:Spam-whitelist]]', # Fuzzy + 'spam-blacklist-desc' => 'Regex-based anti-spam tool allowing to blacklist URLs in pages and email addresses for registered users + +ابزار بر پایهٔ عبارت باقاعده ضدهرزنگاری اجازهٔ فهرست سیاه‌کردن نشانی‌های اینترنتی در صفحه‌ها و نشانی‌های رایانامه برای کاربران ثبت نام کرده', + 'log-name-spamblacklist' => 'سیاههٔ فهرست سیاه هرزنگاری', + 'log-description-spamblacklist' => 'این رویدادها وقوع فهرست سیاه هزنگاری را دنبال می‌کند.', + 'logentry-spamblacklist-hit' => '$1 در $3 با تلاش در افزودن $4 باعث برخورد به فهرست سیاه هرزنامه شده‌است.', + 'right-spamblacklistlog' => 'دیدن یک سیاههٔ فهرست سیاه هرزنامه', + 'action-spamblacklistlog' => 'دیدن سیاههٔ فهرست سیاه هرزنامه', ); /** Finnish (suomi) @@ -1229,7 +1268,7 @@ $messages['fr'] = array( 'spam-blacklist-desc' => 'Outil anti-pourriel basé sur des expressions rationnelles permettant de mettre en liste noire des URLs dans les pages et des adresses de courriel pour les utilisateurs enregistrés', 'log-name-spamblacklist' => 'Journal de liste noire des pourriels', 'log-description-spamblacklist' => 'Ces événements tracent les correspondances avec la liste noire des pourriels.', - 'logentry-spamblacklist-hit' => '$1 a provoqué un correspondance avec la liste noire des pourriels sur $3 en essayant d’ajouter $4.', + 'logentry-spamblacklist-hit' => '{{GENDER:$2|$1}} a provoqué une correspondance avec la liste noire des pourriels sur $3 en essayant d’ajouter $4.', 'right-spamblacklistlog' => 'Afficher le journal de la liste noire des pourriels', 'action-spamblacklistlog' => 'afficher le journal de la liste noir des pourriels', ); @@ -1567,7 +1606,7 @@ $messages['hsb'] = array( 'spam-blacklisted-email-text' => 'Twoja e-mejlowa adresa je tuchwilu w čornej lisćinje a tohodla za słanje e-mejlow do druhich wužiwarjow zablokowana.', 'spam-blacklisted-email-signup' => 'Podata e-mejlowa adresa je tuchwilu přećiwo wužiwanju zablokowana.', 'spam-invalid-lines' => '{{PLURAL:$1|slědowaca linka je njepłaćiwy regularny wuraz|slědowacych linkow je regularny wuraz|slědowace linki su regularne wurazy|slědowacej lince stej regularnej wurazaj}} a {{PLURAL:$1|dyrbi|dyrbi|dyrbja|dyrbjetej}} so korigować, prjedy hač so strona składuje:', - 'spam-blacklist-desc' => 'Přećiwospamowy nastroj na zakładźe Regex: [[MediaWiki:Spam-blacklist]] a [[MediaWiki:Spam-whitelist]]', # Fuzzy + 'spam-blacklist-desc' => 'Přećiwospamowy nastroj na zakładźe Regex, kotryž zmóznja URL na stronach a e-mejlowe adresy za zregistrowanych wužiwarjow do čorneje lisćiny stajić', ); /** Hungarian (magyar) @@ -1644,7 +1683,12 @@ $messages['ia'] = array( 'spam-blacklisted-email-text' => 'Tu adresse de e-mail es actualmente blocate de inviar messages a altere usatores.', 'spam-blacklisted-email-signup' => 'Le adresse de e-mail specificate es actualmente blocate per le lista nigre.', 'spam-invalid-lines' => 'Le sequente {{PLURAL:$1|linea|lineas}} del lista nigre antispam es {{PLURAL:$1|un expression|expressiones}} regular invalide e debe esser corrigite ante que tu immagazina le pagina:', - 'spam-blacklist-desc' => 'Instrumento antispam a base de regex: [[MediaWiki:Spam-blacklist]] e [[MediaWiki:Spam-whitelist]]', # Fuzzy + 'spam-blacklist-desc' => 'Instrumento antispam a base de regex que permitte blocar URLs in paginas e adresses de e-mail pro usatores registrate', + 'log-name-spamblacklist' => 'Registro del lista nigre de spam', + 'log-description-spamblacklist' => 'Iste eventos tracia le activationes del lista nigre de spam.', + 'logentry-spamblacklist-hit' => '{{GENDER:$2|$1}} ha provocate un activation del lista nigre de spam sur $3 con su tentativa de inserer $4.', + 'right-spamblacklistlog' => 'Vider le registro del lista nigre de spam', + 'action-spamblacklistlog' => 'vider le registro del lista nigre de spam', ); /** Indonesian (Bahasa Indonesia) @@ -1719,7 +1763,12 @@ $messages['ilo'] = array( 'spam-blacklisted-email-text' => 'Ti e-suratmo a pagtaengan ket agdama a naiparit manipud ti panagipatulod kadagiti e-surat kadagiti sabsabali nga agar-aramat.', 'spam-blacklisted-email-signup' => 'Ti naited nga e-surat a pagatengan ket agdama a naiparit manipud ti panagusar.', 'spam-invalid-lines' => 'Ti sumaganad a spam blacklist {{PLURAL:$1| a linia ket|kadagiti linia ket}} imbalido a kadawyan {{PLURAL:$1|a nangisao|kadagiti panangisao}} ken {{PLURAL:$1|masapsapol|masapol}} a mapudnuan sakbay nga idulin ti panid:', - 'spam-blacklist-desc' => 'Naibantay ti regex kontra-spam a ramit: [[MediaWiki:Spam-blacklist]] ken [[MediaWiki:Spam-whitelist]]', # Fuzzy + 'spam-blacklist-desc' => 'Naibatay ti regex a ramit ti kontra-spam a mangpalubos a mangiparit kadagiti URL kadagiti panid ken dagiti esurat a pagtaengan para kadagiti nakarehistro nga agar-aramat', + 'log-name-spamblacklist' => 'Listaan ti naiparit para iti spam', + 'log-description-spamblacklist' => 'Dagitoy a pasamak ket surotenna dagiti naiparit a listaan a napuntaan ti spam.', + 'logentry-spamblacklist-hit' => 'Ti $1 ket gapuanan ti pannakapunta ti naiparit a listaan ti spam iti $3 babaen ti panagpadas nga aginayon iti $4.', + 'right-spamblacklistlog' => 'Kitaen ti naiparit a listaan ti spam', + 'action-spamblacklistlog' => 'kitaen ti naiparit a listaan ti spam', ); /** Icelandic (íslenska) @@ -1873,7 +1922,7 @@ $messages['ja'] = array( 'spam-blacklist-desc' => 'ページ内の URL や登録利用者のメールアドレスをブラックリスト化できるようにする、正規表現に基づいたスパム対策ツール', 'log-name-spamblacklist' => 'スパムブラックリスト記録', 'log-description-spamblacklist' => 'これらのイベントはスパムブラックリストとの一致を追跡します。', - 'logentry-spamblacklist-hit' => '$1 が $3 に $4 を追加しようとした際にスパムブラックリストが発動しました。', + 'logentry-spamblacklist-hit' => '{{GENDER:$2|$1}} が $3 に $4 を追加しようとした際にスパムブラックリストが発動しました。', 'right-spamblacklistlog' => 'スパムブラックリストを閲覧', 'action-spamblacklistlog' => 'スパムブラックリスト記録の閲覧', ); @@ -2207,6 +2256,15 @@ $messages['li'] = array( 'spam-blacklist-desc' => 'Antispamfunctionaliteit via reguliere expressies: [[MediaWiki:Spam-blacklist]] en [[MediaWiki:Spam-whitelist]]', # Fuzzy ); +/** لوری (لوری) + * @author Bonevarluri + */ +$messages['lrc'] = array( + 'log-name-spamblacklist' => 'پهرستنومه نوم گه سئ اسپم', + 'right-spamblacklistlog' => 'دیئن پهرستنومه نوم گه سئ اسپم', + 'action-spamblacklistlog' => 'دیئن پهرستنومه نوم گه سئ اسپم', +); + /** Minangkabau (Baso Minangkabau) * @author Iwan Novirion */ @@ -2312,7 +2370,12 @@ $messages['ml'] = array( 'spam-blacklisted-email-text' => 'താങ്കളുടെ ഇമെയിൽ വിലാസം ഇപ്പോൾ മറ്റുള്ളവർക്ക് എഴുത്തയക്കാനാവാത്ത കരിമ്പട്ടികയിൽ ഉൾപ്പെട്ടിരിക്കുന്നു.', 'spam-blacklisted-email-signup' => 'നൽകിയ ഇമെയിൽ വിലാസം ഇപ്പോൾ കരിമ്പട്ടികയിൽ പെട്ടിരിക്കുന്ന ഒന്നാണ്.', 'spam-invalid-lines' => 'താഴെ കൊടുത്തിരിക്കുന്ന പാഴെഴുത്ത് കരിമ്പട്ടികയിലെ {{PLURAL:$1|വരി ഒരു|വരികൾ}} അസാധുവായ റെഗുലർ {{PLURAL:$1|എക്സ്‌‌പ്രെഷൻ|എക്സ്‌‌പ്രെഷനുകൾ}} ആണ്, താൾ സേവ് ചെയ്യുന്നതിനു മുമ്പ് {{PLURAL:$1|അത്|അവ}} ശരിയാക്കേണ്ടതുണ്ട്:', - 'spam-blacklist-desc' => 'റെജെക്സ്-അധിഷ്ഠിത പാഴെഴുത്ത് തടയൽ ഉപകരണം: [[MediaWiki:Spam-blacklist]] ഒപ്പം [[MediaWiki:Spam-whitelist]]', # Fuzzy + 'spam-blacklist-desc' => 'അംഗത്വമെടുത്ത ഉപയോക്താക്കൾ യു.ആർ.എല്ലുകളും ഇമെയിൽ വിലാസങ്ങളും, താളുകളിൽ ചേർക്കുന്നത് കരിമ്പട്ടികയിൽ പെടുത്താനുള്ള റെജെക്സ്-അധിഷ്ഠിത പാഴെഴുത്ത് തടയൽ ഉപകരണം', + 'log-name-spamblacklist' => 'പാഴെഴുത്ത് കരിമ്പട്ടിക രേഖ', + 'log-description-spamblacklist' => 'പാഴെഴുത്ത് കരിമ്പട്ടികയെ ഉണർത്തിയ പ്രവൃത്തികളുടെ രേഖ.', + 'logentry-spamblacklist-hit' => '$3 എന്ന താളിൽ $4 എന്നത് ചേർക്കാൻ $1 നടത്തിയ ശ്രമം പാഴെഴുത്ത് കരിമ്പട്ടികയിൽ കുടുങ്ങിയിരിക്കുന്നു.', + 'right-spamblacklistlog' => 'പാഴെഴുത്ത് കരിമ്പട്ടിക രേഖ കാണുക', + 'action-spamblacklistlog' => 'പാഴെഴുത്ത് കരിമ്പട്ടിക രേഖ കാണുക', ); /** Marathi (मराठी) @@ -2524,6 +2587,11 @@ $messages['nl'] = array( 'spam-blacklisted-email-signup' => 'Het opgegeven e-mailadres staat momenteel op de zwarte lijst.', 'spam-invalid-lines' => 'De volgende {{PLURAL:$1|regel|regels}} van de zwarte lijst {{PLURAL:$1|is een|zijn}} onjuiste reguliere {{PLURAL:$1|expressie|expressies}} en {{PLURAL:$1|moet|moeten}} verbeterd worden alvorens de pagina kan worden opgeslagen:', 'spam-blacklist-desc' => "Op reguliere expressies gebaseed antispamhulpprogramma dat het mogelijk maakt URL's in pagina's te blokkeren en e-mailadressen voor geblokkeerde gebruikers", + 'log-name-spamblacklist' => 'Logboek zwarte lijst', + 'log-description-spamblacklist' => 'Deze lijst bevat gebeurtenissen met betrekking tot de zwarte lijst.', + 'logentry-spamblacklist-hit' => '{{GENDER:$2|$1}} heeft geprobeerd $4 van de zwarte lijst toe te voegen op $3', + 'right-spamblacklistlog' => 'Logboek zwarte lijst bekijken', + 'action-spamblacklistlog' => 'logboek zwarte lijst te bekijken', ); /** Nederlands (informeel)‎ (Nederlands (informeel)‎) @@ -2631,6 +2699,7 @@ $messages['or'] = array( /** Polish (polski) * @author BeginaFelicysym + * @author Chrumps * @author Derbeth * @author Sp5uhe */ @@ -2677,6 +2746,8 @@ $messages['pl'] = array( 'spam-blacklisted-email-signup' => 'Podany adres e-mail jest obecnie na czarnej liście blokującej przed użyciem.', 'spam-invalid-lines' => '{{PLURAL:$1|Następująca linia jest niepoprawnym wyrażeniem regularnym i musi być poprawiona przed zapisaniem strony:|Następujące linie są niepoprawnymi wyrażeniami regularnymi i muszą być poprawione przed zapisaniem strony:}}', 'spam-blacklist-desc' => 'Narzędzie antyspamowe oparte o wyrażenia regularne: [[MediaWiki:Spam-blacklist|spam – lista zabronionych]] oraz [[MediaWiki:Spam-whitelist|spam – lista dozwolonych]]', # Fuzzy + 'logentry-spamblacklist-hit' => '$1 {{GENDER:$2|uruchomił|uruchomiła}} filtr antyspamowy na stronie $3 próbując dodać $4.', + 'right-spamblacklistlog' => 'Podgląd rejestru czarnej listy spamu', ); /** Piedmontese (Piemontèis) @@ -2709,7 +2780,12 @@ $messages['pms'] = array( 'spam-blacklisted-email-text' => "Soa adrëssa ëd pòsta eletrònica a l'é al moment an na lista nèira për mandé dij mëssagi a j'àutri utent.", 'spam-blacklisted-email-signup' => "L'adrëssa ëd pòsta eletrònica dàita a l'é al moment an na lista nèira për l'utilisassion.", 'spam-invalid-lines' => "{{PLURAL:$1|St'|Sti}} element dla lista nèira dla rumenta ëd reclam a {{PLURAL:$1|l'é|son}} {{PLURAL:$1|n'|dj'}}espression regolar nen {{PLURAL:$1|bon-a|bon-e}} e a l'{{PLURAL:$1|ha|han}} da manca d'esse coregiùe anans che salvé la pàgina:", - 'spam-blacklist-desc' => 'Strument anti-spam basà an dzora a Regex: [[MediaWiki:Spam-blacklist]] e [[MediaWiki:Spam-whitelist]]', # Fuzzy + 'spam-blacklist-desc' => "Utiss contra la rumenta basà su dj'espression regolar ch'a permëtto ëd buté an sla lista nèira dj'adrësse an sl'Aragnà ant le pàgine e dj'adrësse ëd pòsta eletrònica për j'utent argistrà.", + 'log-name-spamblacklist' => 'Argistr dla lista nèira dla rumenta', + 'log-description-spamblacklist' => 'Costi eveniment a marco le rëspondense con la lista nèira dla rumenta.', + 'logentry-spamblacklist-hit' => "$1 a l'ha causà na rëspondensa con la lista nèira dla rumenta su $3 an sërcand ëd gionté $4.", + 'right-spamblacklistlog' => "Smon-e l'argistr dla lista nèira dla rumenta", + 'action-spamblacklistlog' => "vëdde l'argistr dla lista nèira dla rumenta", ); /** Western Punjabi (پنجابی) @@ -2850,6 +2926,13 @@ $messages['pt-br'] = array( 'action-spamblacklistlog' => 'ver os registros da lista negra de spam', ); +/** Romansh (rumantsch) + * @author Kazu89 + */ +$messages['rm'] = array( + 'log-name-spamblacklist' => 'Protocol da la glista naira da spam', +); + /** Romanian (română) * @author Firilacroco * @author Minisarm @@ -2924,9 +3007,11 @@ $messages['roa-tara'] = array( /** Russian (русский) * @author Ahonc + * @author Amire80 * @author Express2000 * @author HalanTul * @author Kaganer + * @author NBS * @author Okras * @author Александр Сигачёв */ @@ -2970,8 +3055,13 @@ $messages['ru'] = array( 'spam-blacklisted-email' => 'Адреса электронной почты, занесённые в чёрный список', 'spam-blacklisted-email-text' => 'Ваш адрес электронной почты в настоящее время находится в чёрном списке, поэтому вы не можете отправлять сообщения другим пользователям.', 'spam-blacklisted-email-signup' => 'Указанный адрес электронной почты в настоящее время занесён в чёрный список и не может быть использован.', - 'spam-invalid-lines' => '{{PLURAL:$1|Следующая строка чёрного списка ссылок содержит ошибочное регулярное выражение и должна быть исправлена|Следующие строки чёрного списка ссылок содержат ошибочные регулярные выражения и должны быть исправлены}} перед сохранением:', + 'spam-invalid-lines' => '{{PLURAL:$1|1=Следующая строка чёрного списка ссылок содержит ошибочное регулярное выражение и должна быть исправлена|Следующие строки чёрного списка ссылок содержат ошибочные регулярные выражения и должны быть исправлены}} перед сохранением:', 'spam-blacklist-desc' => 'Основанный на регулярных выражениях анти-спам инструмент позволяет добавлять в чёрный список URL на страницах и адреса электронной почты для зарегистрированных пользователей', + 'log-name-spamblacklist' => 'Журнал спам-листа', + 'log-description-spamblacklist' => 'Это журнал, отслеживающий срабатывание спам-листа.', + 'logentry-spamblacklist-hit' => '$1 вызвал срабатывание спам-листа на странице $3 из-за попытки добавить $4.', + 'right-spamblacklistlog' => 'Просмотр журнала чёрного списка по спаму', + 'action-spamblacklistlog' => 'просмотр журнала чёрного списка по спаму', ); /** Rusyn (русиньскый) @@ -3301,7 +3391,9 @@ $messages['stq'] = array( ); /** Swedish (svenska) + * @author Ainali * @author Lejonel + * @author Lokal Profil * @author Skalman * @author WikiPhoenix */ @@ -3325,10 +3417,34 @@ $messages['sv'] = array( # * All text från ett #-tecken till radens slut är en kommentar # * Alla icke-tomma rader används som reguljära uttryck för att matcha domännamn i URL:er + # ', + 'email-blacklist' => ' #
      +# E-postadresser som matchar den här listan kommer att hindras att registrera och skicka e-post
      +# Denna lista gäller endast denna wiki; se även den globala svartlistan.
      +# För dokumentation se https://www.mediawiki.org/wiki/Extension:SpamBlacklist
      +#
      +# Syntaxen är följande:
      +#   * Allt från ett "#"-tecken till slutet av raden är en kommentar
      +#   * Varje icke-tom rad är ett regex-fragment som endast kommer att matcha värdnamn i e-postadresser
      + #
      ', + 'email-whitelist' => ' #
      +# E-postadresser som matchar den här listan kommer *inte* att blockeras, även om de skulle ha blivit blockerade av svartlistan.
      +#
      +# Syntaxen är följande:
      +#   * Allt från ett "#"-tecken till slutet av raden är en kommentar
      +#   * Varje icke-tom rad är ett regex-fragment som endast kommer att matcha värdnamn i e-postadresser
      +
        #
      ', 'spam-blacklisted-email' => 'Svartlistad e-postadress', + 'spam-blacklisted-email-text' => 'Din e-postadress är för närvarande svartlistad från att skicka e-post till andra användare.', + 'spam-blacklisted-email-signup' => 'Den angivna e-postadressen är förnärvarande svartlistad från användning.', 'spam-invalid-lines' => 'Följande {{PLURAL:$1|rad|rader}} i svarta listan för spam innehåller inte något giltigt reguljärt uttryck och måste rättas innan sidan sparas:', 'spam-blacklist-desc' => 'Antispamverktyg baserat på reguljära uttryck som gör det möjligt att svartlista webbadresser på sidor och e-postadresser för registrerade användare', + 'log-name-spamblacklist' => 'Svartlistningslogg för spam', + 'log-description-spamblacklist' => 'Dessa händelser spårar träffar is svartlistningsloggen för spam.', + 'logentry-spamblacklist-hit' => '$1 orsakade en träff i svartlistningsloggen för spam på $3 genom att försöka lägga till $4.', + 'right-spamblacklistlog' => 'Visa svartlistningslogg för spam', + 'action-spamblacklistlog' => 'visa svartlistningsloggen för spam', ); /** Tamil (தமிழ்) @@ -3559,7 +3675,7 @@ $messages['uk'] = array( 'spam-blacklisted-email' => 'Адреса електронної пошти з чорного списку', 'spam-blacklisted-email-text' => 'Ваша адреса електронної пошти в даний час знаходиться в чорному списку, тому ви не можете надсилати повідомлення іншим користувачам.', 'spam-blacklisted-email-signup' => 'Вказана Вами адреса електронної пошти наразі занесена до чорного списку і не може бути використаною.', - 'spam-invalid-lines' => '{{PLURAL:$1|Наступний рядок із чорного списку посилань містить помилковий регулярний вираз і його треба виправити|Наступні рядки із чорного списку посилань містять помилкові регулярні вирази і їх треба виправити}} перед збереженням:', + 'spam-invalid-lines' => '{{PLURAL:$1|1=Наступний рядок із чорного списку посилань містить помилковий регулярний вираз і його треба виправити|Наступні рядки із чорного списку посилань містять помилкові регулярні вирази і їх треба виправити}} перед збереженням:', 'spam-blacklist-desc' => 'Засновану на регулярних виразах антиспам інструмент, який дозволяє кидати у чорний список URL сторінки і адреси електронної пошти для зареєстрованих користувачів', 'log-name-spamblacklist' => 'Журнал чорного списку спамерів', 'log-description-spamblacklist' => 'Ці події відстежують потрапляння у чорний список спамерів.', @@ -3803,8 +3919,10 @@ $messages['zh-hant'] = array( 'spam-blacklisted-email-text' => '您的電郵地址目前已列入黑名單以防止您發送電郵予其他用戶。', 'spam-blacklisted-email-signup' => '此電郵地址目前被禁止使用。', 'spam-invalid-lines' => '以下在灌水黑名單的{{PLURAL:$1|一行|多行}}有無效的表示式,請在儲存這頁前先將{{PLURAL:$1|它|它們}}修正:', - 'spam-blacklist-desc' => '以正則表達式為本的防灌水工具:[[MediaWiki:Spam-blacklist]] 與 [[MediaWiki:Spam-whitelist]]', # Fuzzy + 'spam-blacklist-desc' => '基於正則表達式的反垃圾電郵工具,允許加入濫發電郵的URL和/或註冊用戶於此頁面', 'log-name-spamblacklist' => '垃圾連結黑名單日誌', + 'log-description-spamblacklist' => '這些事件已被垃圾郵件黑名單觸發。', + 'logentry-spamblacklist-hit' => '$1於$3嘗試加入$4而觸發垃圾電郵黑名單。', 'right-spamblacklistlog' => '查閱垃圾電郵黑名單日誌', 'action-spamblacklistlog' => '查閱垃圾電郵黑名單日誌', ); diff --git a/extensions/SpamBlacklist/SpamBlacklist.php b/extensions/SpamBlacklist/SpamBlacklist.php index 2fd7855d..45e5237c 100644 --- a/extensions/SpamBlacklist/SpamBlacklist.php +++ b/extensions/SpamBlacklist/SpamBlacklist.php @@ -18,6 +18,10 @@ $wgExtensionCredits['antispam'][] = array( $dir = __DIR__ . '/'; $wgExtensionMessagesFiles['SpamBlackList'] = $dir . 'SpamBlacklist.i18n.php'; +// Register the API method +$wgAutoloadClasses['ApiSpamBlacklist'] = "$dir/api/ApiSpamBlacklist.php"; +$wgAPIModules['spamblacklist'] = 'ApiSpamBlacklist'; + /** * Array of settings for blacklist classes */ diff --git a/extensions/SpamBlacklist/SpamBlacklist_body.php b/extensions/SpamBlacklist/SpamBlacklist_body.php index bf5c9aab..15fbc72f 100644 --- a/extensions/SpamBlacklist/SpamBlacklist_body.php +++ b/extensions/SpamBlacklist/SpamBlacklist_body.php @@ -34,10 +34,13 @@ class SpamBlacklist extends BaseBlacklist { * This is used to load the old links already on the page, so * the filter is only applied to links that got added. If not given, * the filter is applied to all $links. + * @param boolean $preventLog Whether to prevent logging of hits. Set to true when + * the action is testing the links rather than attempting to save them + * (e.g. the API spamblacklist action) * * @return Array Matched text(s) if the edit should not be allowed, false otherwise */ - function filter( array $links, Title $title = null ) { + function filter( array $links, Title $title = null, $preventLog = false ) { $fname = 'wfSpamBlacklistFilter'; wfProfileIn( $fname ); @@ -93,7 +96,9 @@ class SpamBlacklist extends BaseBlacklist { $ip = $wgRequest->getIP(); $imploded = implode( ' ', $matches[0] ); wfDebugLog( 'SpamBlacklistHit', "$ip caught submitting spam: $imploded\n" ); - $this->logFilterHit( $title, $imploded ); // Log it + if( !$preventLog ) { + $this->logFilterHit( $title, $imploded ); // Log it + } if( $retVal === false ){ $retVal = array(); } diff --git a/extensions/SpamBlacklist/api/ApiSpamBlacklist.php b/extensions/SpamBlacklist/api/ApiSpamBlacklist.php new file mode 100644 index 00000000..dad9e8e0 --- /dev/null +++ b/extensions/SpamBlacklist/api/ApiSpamBlacklist.php @@ -0,0 +1,78 @@ +extractRequestParams(); + $matches = BaseBlacklist::getInstance( 'spam' )->filter( $params['url'], NULL, true ); + $res = $this->getResult(); + + if ( $matches !== false ) { + // this url is blacklisted. + $res->addValue( 'spamblacklist', 'result', 'blacklisted' ); + $res->setIndexedTagName( $matches, 'match' ); + $res->addValue( 'spamblacklist', 'matches', $matches ); + } else { + // not blacklisted + $res->addValue( 'spamblacklist', 'result', 'ok' ); + } + } + + public function getAllowedParams() { + return array( + 'url' => array( + ApiBase::PARAM_REQUIRED => true, + ApiBase::PARAM_ISMULTI => true, + ) + ); + } + + public function getParamDescription() { + return array( + 'url' => 'A pipe-separated list of URLs to validate against the blacklist', + ); + } + + public function getDescription() { + return 'Validate one or more URLs against the SpamBlacklist.'; + } + + public function getExamples() { + return array( + 'api.php?action=spamblacklist&url=http%3A%2F%2Fwww.example.com%2F%7Chttp%3A%2F%2Fwww.example.org%2F', + 'api.php?action=spamblacklist&url=https%3A%2F%2Fwww.example.net%2Findex.php', + ); + } + + public function getHelpUrls() { + return array( 'https://www.mediawiki.org/wiki/Extension:SpamBlacklist/API' ); + } +} diff --git a/extensions/SyntaxHighlight_GeSHi/COPYING b/extensions/SyntaxHighlight_GeSHi/COPYING new file mode 100644 index 00000000..d159169d --- /dev/null +++ b/extensions/SyntaxHighlight_GeSHi/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php b/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php index 7318574d..b1c9851d 100644 --- a/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php +++ b/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php @@ -28,12 +28,6 @@ class SyntaxHighlight_GeSHi { // Don't trim leading spaces away, just the linefeeds $text = preg_replace( '/^\n+/', '', $text ); - if( $wgUseTidy ) { - // HTML Tidy will convert tabs to spaces incorrectly (bug 30930). - // Preemptively replace the spaces in a more controlled fashion. - $text = self::tabsToSpaces( $text ); - } - // Validate language if( isset( $args['lang'] ) && $args['lang'] ) { $lang = $args['lang']; @@ -101,6 +95,12 @@ class SyntaxHighlight_GeSHi { if( $enclose === GESHI_HEADER_DIV ) { $out = str_replace( "\n", '', $out ); } + // HTML Tidy will convert tabs to spaces incorrectly (bug 30930). + // But the conversion from tab to space occurs while reading the input, + // before the conversion from to tab, so we can armor it that way. + if( $wgUseTidy ) { + $out = str_replace( "\t", ' ', $out ); + } // Register CSS $parser->getOutput()->addHeadItem( self::buildHeadItem( $geshi ), "source-{$lang}" ); @@ -488,35 +488,4 @@ class SyntaxHighlight_GeSHi { public static function hOldSpecialVersion_GeSHi( &$sp, &$extensionTypes ) { return self::hSpecialVersion_GeSHi( $extensionTypes ); } - - /** - * Convert tabs to spaces - * - * @param string $text - * @return string - */ - private static function tabsToSpaces( $text ) { - $lines = explode( "\n", $text ); - $lines = array_map( array( __CLASS__, 'tabsToSpacesLine' ), $lines ); - return implode( "\n", $lines ); - } - - /** - * Convert tabs to spaces for a single line - * - * @param $line - * @internal param string $text - * @return string - */ - private static function tabsToSpacesLine( $line ) { - $parts = explode( "\t", $line ); - $width = 8; // To match tidy's config & typical browser defaults - $out = $parts[0]; - foreach( array_slice( $parts, 1 ) as $chunk ) { - $spaces = $width - (strlen( $out ) % $width); - $out .= str_repeat( ' ', $spaces ); - $out .= $chunk; - } - return $out; - } } diff --git a/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.i18n.php b/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.i18n.php index 8555c4f9..d385b01c 100644 --- a/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.i18n.php +++ b/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.i18n.php @@ -202,11 +202,12 @@ $messages['ca'] = array( * @author Умар */ $messages['ce'] = array( + 'syntaxhighlight-desc' => 'Таро хуьлуьйту тег <syntaxhighlight> лело [http://qbnz.com/highlighter/ GeSHi Highlighter] гӀоьнца синтаксисан бос хилийта', 'syntaxhighlight-supported' => 'Ловш долу меттанаш:', 'geshi.css' => '/* CSS-код, кху чу хlоттайахь, оцо болх бийра бу сизашдо беснашна хlокхуньца GeSHI */', ); -/** Czech (česky) +/** Czech (čeština) * @author Li-sung * @author Matěj Grabovský */ @@ -320,7 +321,7 @@ $messages['es'] = array( $messages['et'] = array( 'syntaxhighlight-desc' => 'Võimaldab [http://qbnz.com/highlighter/ GeSHi] abil <syntaxhighlight>-silti kasutades süntaksit esile tõsta.', 'syntaxhighlight-specify' => 'Sa pead täpsustama keelt nõnda:', - 'syntaxhighlight-supported' => 'Süntaksi esiletoomise on toetatud järgnevates keeltes:', + 'syntaxhighlight-supported' => 'Süntaksi esiletõstu toetavad keeled:', 'syntaxhighlight-err-loading' => '(toetatud keelte loetelu laadimisel esines viga)', 'syntaxhighlight-err-language' => 'Vigane keel.', 'geshi.css' => '/* CSS mis on asetatud siia, määrab GeSHi süntaksi esiletoomise stiili */', @@ -442,11 +443,12 @@ $messages['gu'] = array( ); /** Hebrew (עברית) + * @author Guycn2 * @author Rotem Liss */ $messages['he'] = array( 'syntaxhighlight-desc' => 'אפשרות לסימון קוד מקור בצבעים עם התגית <syntaxhighlight> באמצעות [http://qbnz.com/highlighter/ GeSHi Highlighter]', - 'syntaxhighlight-specify' => 'עליכם לציין שפה באופן הבא:', + 'syntaxhighlight-specify' => 'יש לציין שפה באופן הבא:', 'syntaxhighlight-supported' => 'שפות נתמכות:', 'syntaxhighlight-err-loading' => '(שגיאה בטעינת הרשימה של השפות הנתמכות)', 'syntaxhighlight-err-language' => 'שפה שגויה.', @@ -545,6 +547,18 @@ $messages['ig'] = array( 'syntaxhighlight-err-language' => 'Asụsụ ámághị.', ); +/** Iloko (Ilokano) + * @author Lam-ang + */ +$messages['ilo'] = array( + 'syntaxhighlight-desc' => 'Mangited ti panangimaris ti eskritu <syntaxhighlight> nga agus-usar iti [http://qbnz.com/highlighter/ GeSHi - Generic Syntax Highlighter]', + 'syntaxhighlight-specify' => 'Nasken nga inaganan ti pagsasao a kasla daytoy:', + 'syntaxhighlight-supported' => 'Dagiti nasuportaran a pagsasao para iti panangimaris ti eskritu:', + 'syntaxhighlight-err-loading' => '(biddut ti panangikarga ti listaan ti nasuportaran a pagsasao)', + 'syntaxhighlight-err-language' => 'Imbalido a pagsasao.', + 'geshi.css' => '/* Ti CSS a maikabil ditoy ket maipakatto iti panangimaris ti eskritu ti GeSHi */', +); + /** Ido (Ido) * @author Malafaya */ @@ -688,10 +702,11 @@ $messages['ksh'] = array( /** Luxembourgish (Lëtzebuergesch) * @author Les Meloures * @author Robby + * @author Soued031 */ $messages['lb'] = array( 'syntaxhighlight-desc' => "Syntax-Ervirhiewung <syntaxhighlight> mat Hëllef vu [http://qbnz.com/highlighter/ 'GeSHi Highlighter']", - 'syntaxhighlight-specify' => 'Déi gewënscht Sprooch muss esou definéiert ginn:', + 'syntaxhighlight-specify' => 'Déi gewënscht Sprooch muss sou definéiert ginn:', 'syntaxhighlight-supported' => "Ënnerstëtzte Sprooche fir d'Syntax faarweg ze markéieren", 'syntaxhighlight-err-loading' => '(Feeler beim Luede vun der Lëscht vun den ënnerstëtzte Sproochen)', 'syntaxhighlight-err-language' => 'Net valabel Sprooch.', @@ -936,7 +951,6 @@ $messages['pt'] = array( /** Brazilian Portuguese (português do Brasil) * @author Helder.wiki - * @author Heldergeovane */ $messages['pt-br'] = array( 'syntaxhighlight-desc' => 'Providencia realce de sintaxe <syntaxhighlight> através do [http://qbnz.com/highlighter/ GeSHi Highlighter]', @@ -1124,12 +1138,13 @@ $messages['ta'] = array( ); /** Telugu (తెలుగు) + * @author Chaduvari * @author Veeven */ $messages['te'] = array( 'syntaxhighlight-specify' => 'భాషని ఈ విధంగా ఇవ్వాలి:', 'syntaxhighlight-supported' => 'ఛందస్సు ఉద్దీపనకి తోడ్పాటు ఉన్న భాషలు:', - 'syntaxhighlight-err-loading' => '(తోడ్పాటున్న భాషల జాబితా లోడింగులో పొరపాటు జరిగింది)', + 'syntaxhighlight-err-loading' => '(తోడ్పాటున్న భాషల జాబితా లోడింగులో లోపం జరిగింది)', 'syntaxhighlight-err-language' => 'చెల్లని భాష.', ); diff --git a/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php b/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php index 60741577..4323d05c 100644 --- a/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php +++ b/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php @@ -41,7 +41,7 @@ // /** The version of this GeSHi file */ -define('GESHI_VERSION', '1.0.8.11'); +define('GESHI_VERSION', '1.0.8.11-wmf1'); // WMF fix for Haskell (bug 52509) // Define the root directory for the GeSHi code tree if (!defined('GESHI_ROOT')) { diff --git a/extensions/SyntaxHighlight_GeSHi/geshi/geshi/haskell.php b/extensions/SyntaxHighlight_GeSHi/geshi/geshi/haskell.php index adae1116..d3b494ed 100644 --- a/extensions/SyntaxHighlight_GeSHi/geshi/geshi/haskell.php +++ b/extensions/SyntaxHighlight_GeSHi/geshi/geshi/haskell.php @@ -13,6 +13,14 @@ * ------- * 2005/08/27 (1.0.0) * - First Release + * 2013/09/28 + * - Single quotes dropped from QUOTEMARKS to resolve . + * Change is local to SyntaxHighlight_GeSHi, made by Ori Livneh (ori@wikimedia.org), based + * on a proposed upstream patch. + * Upstream bug report: + * + * Upstream patch (stalled since 2012): + * * * TODO (updated 2005/08/27) * ------------------------- @@ -46,7 +54,7 @@ $language_data = array ( 3 => "/{-(?:(?R)|.)-}/s", //Nested Comments ), 'CASE_KEYWORDS' => 0, - 'QUOTEMARKS' => array('"',"'"), + 'QUOTEMARKS' => array('"'), // SyntaxHighlight_GeSHi modification; see CHANGES above. 'ESCAPE_CHAR' => '\\', 'KEYWORDS' => array( /* main haskell keywords */ diff --git a/extensions/TitleBlacklist/COPYING b/extensions/TitleBlacklist/COPYING new file mode 100644 index 00000000..d159169d --- /dev/null +++ b/extensions/TitleBlacklist/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/extensions/TitleBlacklist/TitleBlacklist.i18n.php b/extensions/TitleBlacklist/TitleBlacklist.i18n.php index ca05a33d..39ce9d24 100644 --- a/extensions/TitleBlacklist/TitleBlacklist.i18n.php +++ b/extensions/TitleBlacklist/TitleBlacklist.i18n.php @@ -127,7 +127,7 @@ $messages['ar'] = array( هو يطابق مدخلة القائمة السوداء التالية: $1', 'titleblacklist-invalid' => '{{PLURAL:$1||السطر التالي|السطران التاليان|السطور التالية}} في قائمة العناوين السوداء {{PLURAL:$1||غير صحيح|غير صحيحان|غير صحيحة}}؛ من فضلك {{PLURAL:$1||صححه|صححهما|صححهم}} قبل الحفظ:', 'titleblacklist-override' => 'تجاهل القائمة السوداء', - 'right-tboverride' => 'تجاوز قائمة العناوين السوداء', # Fuzzy + 'right-tboverride' => 'تجاوز قائمتي العناوين أو أسماء المستخدمين السوداوين', 'right-tboverride-account' => 'تجاوز قائمة اسم المستخدم السوداء.', ); @@ -227,8 +227,8 @@ $messages['ba'] = array( Ул түбәндәге ҡара исемлек яҙмаһы менән тап килә: $1', 'titleblacklist-forbidden-new-account' => '"$2" исемле ҡатнашыусы булдырыла алмай. Ул түбәндәге ҡара исемлек яҙмаһы менән тап килә: $1', - 'titleblacklist-invalid' => 'Ҡара исемлектә түбәндәге {{PLURAL:$1|юл|юлдар}} дөрөҫ түгел; -зинһар, һаҡлар алдынан {{PLURAL:$1|уны|уларҙы}} төҙәтегеҙ:', + 'titleblacklist-invalid' => 'Ҡара исемлектә түбәндәге {{PLURAL:$1|1=юл|юлдар}} дөрөҫ түгел; +зинһар, һаҡлар алдынан {{PLURAL:$1|1=уны|уларҙы}} төҙәтегеҙ:', # Fuzzy 'titleblacklist-override' => 'Ҡара исемлекте иғтибарға алмаҫҡа', 'right-tboverride' => 'Исемдәр ҡара исемлеген иғтибарға алмау', # Fuzzy 'right-tboverride-account' => 'Ҡатнашыусы исемдәре ҡара исемлеген иғтибарға алмау', @@ -296,8 +296,8 @@ $messages['be-tarask'] = array( Яна адпавядае наступнаму элемэнту чорнага сьпісу: $1', 'titleblacklist-forbidden-new-account' => 'Імя ўдзельніка «$2» было забаронена для стварэньня. Яно адпавядае наступнаму элемэнту чорнага сьпісу: $1', - 'titleblacklist-invalid' => '{{PLURAL:$1|Наступны радок у|Наступныя радкі ў}} сьпісе забароненых назваў — {{PLURAL:$1|няслушны|няслушныя}}; -калі ласка, выпраўце {{PLURAL:$1|яго|іх}} перад захаваньнем:', + 'titleblacklist-invalid' => '{{PLURAL:$1|1=Наступны радок у|Наступныя радкі ў}} сьпісе забароненых назваў — {{PLURAL:$1|1=няслушны|няслушныя}}; +калі ласка, выпраўце {{PLURAL:$1|1=яго|іх}} перад захаваньнем:', # Fuzzy 'titleblacklist-override' => 'Ігнараваць чорны сьпіс', 'right-tboverride' => 'Ігнараваньне чорнага сьпісу назваў і імёнаў удзельнікаў', 'right-tboverride-account' => 'ігнараваньне чорнага сьпісу ўдзельнікаў', @@ -404,6 +404,7 @@ molimo da {{PLURAL:$1|ga|ih}} ispravite prije spremanja:', * @author Aleator * @author El libre * @author Jordi Roqué + * @author Papapep * @author Pitort * @author SMP * @author Vriullop @@ -417,7 +418,7 @@ $messages['ca'] = array( # Per defecte, no distingeix majúscules de minúscules', 'titleblacklist-forbidden-edit' => 'El títol «$2» està prohibit i no es pot crear. Concorda amb la següent entrada de la llista negra: $1', 'titleblacklist-forbidden-move' => "No es pot moure «$2» a «$3», perquè el títol «$3» està prohibit. Concorda amb l'entrada de la llista negra següent: $1", - 'titleblacklist-forbidden-upload' => "El nom de fitxer «$2» ha estat prohibit i se n'impedeix la creació. Concorda amb la següent línia de la llista negra: $1", + 'titleblacklist-forbidden-upload' => "S'ha prohibit el nom de fitxer «$2» i se n'impedeix la creació. Concorda amb la següent línia de la llista negra: $1", 'titleblacklist-forbidden-new-account' => "No es pot crear el nom d'usuari «$2». Coincideix amb la següent entrada de la llista negra: $1", 'titleblacklist-invalid' => '{{PLURAL:$1|La línia següent|Les línies següents}} de la llista negra no {{PLURAL:$1|és vàlida|són vàlides}}; heu de corregir-{{PLURAL:$1|la|les}} abans de guardar:', 'titleblacklist-override' => 'Ignora la llista negra', @@ -429,6 +430,7 @@ $messages['ca'] = array( * @author Умар */ $messages['ce'] = array( + 'titleblacklist-desc' => '[[MediaWiki:Titleblacklist|Ӏаьржа]] а [[MediaWiki:Titlewhitelist|къайн]] а могӀанийн гӀоьнца куьйгалхошна таро хуьлуьйту декъашхойн дӀаяздарш ца кхоллийта.', 'right-tboverride' => 'Ӏаьржачу могӀанийн чура агӀонийн цӀераш тергалцаяр я декъашхой тергалцабар', 'right-tboverride-account' => 'Ӏаьржачу могӀанийн чура декъашхойн цӀераш тергалцаяр', ); @@ -441,7 +443,7 @@ $messages['ckb'] = array( 'right-tboverride' => 'تێپەڕاندنی تاوتوێی پێرستی ڕەشی سەردێڕ یان ناوی بەکارھێنەری', ); -/** Czech (česky) +/** Czech (čeština) * @author Danny B. * @author Li-sung * @author Matěj Grabovský @@ -557,6 +559,7 @@ $messages['de-formal'] = array( /** Zazaki (Zazaki) * @author Aspar * @author Erdemaslancan + * @author Marmase */ $messages['diq'] = array( 'titleblacklist-desc' => 'serkaran re desturê vıraştışê pel u hesabê karberan dano, qey qedexekerdışi re yew [[MediaWiki:Titleblacklist|listeya risiyayan]] u [[MediaWiki:Titlewhitelist|listeya risıpiyan]] dano.', @@ -573,8 +576,8 @@ malumatê ey na listeyasiya de zepê ya: $1', malumatê ey na listeyasiya de zêpê ya: $1', 'titleblacklist-forbidden-new-account' => 'vıraştışê nameyê karberê"$2" i qedexe bı. malumatê ey na listeyasiya de zêpê ya: $1', - 'titleblacklist-invalid' => 'nê {{PLURAL:$1|satır o ke|satır ê ke}} listeyasiyayi de qedexe yê; -kerem kerê verqeydkerdışi de raşt kerê:', + 'titleblacklist-invalid' => 'Na ğırab lista dı {{PLURAL:$1|en asatır|ené satıri}} néravérené; +Verdé qeyd kerdışi timar keré:', 'titleblacklist-override' => 'Tenilisti mehesebne', 'right-tboverride' => 'Siya listeya sernuşti nêravêrde ke', 'right-tboverride-account' => 'Tenilisteya naman dê karberan mehesebnê', @@ -696,14 +699,14 @@ $messages['et'] = array( 'titlewhitelist' => '# See pealkiri on valges nimekirjas. Kommentaariks kasuta märki "#". # Vaikimisi on see tõstutundetu', 'titleblacklist-forbidden-edit' => 'Lehekülje pealkirjaga "$2" loomine on keelatud. -See vastab järgnevale musta nimekirja sissekandele: $1', - 'titleblacklist-forbidden-move' => 'Lehekülge "$2" ei saa teisaldada pealkirja "$3" alla, sest lehekülgede pealkirjaga "$3" loomine on keelatud. -See vastab järgnevale musta nimekirja sissekandele: $1', - 'titleblacklist-forbidden-upload' => 'Pealkirjaga "$2" on keelatud faili üles laadida. -See vastab järgnevale musta nimekirja sissekandele: $1', - 'titleblacklist-forbidden-new-account' => 'Kasutaja nimega "$2" loomine on keelatud. -See vastab järgnevale musta nimekirja sissekandele: $1', - 'titleblacklist-invalid' => '{{PLURAL:$1|Järgnev|Järgnevad}} musta nimekirja {{PLURAL:$1|rida on vigane|read on vigased}}. +See vastab järgmisele musta nimekirja sissekandele: $1', + 'titleblacklist-forbidden-move' => 'Lehekülge "$2" ei saa teisaldada pealkirja "$3" alla, sest lehekülje loomine pealkirjaga "$3" on keelatud. +See vastab järgmisele musta nimekirja sissekandele: $1', + 'titleblacklist-forbidden-upload' => 'Faili pealkirjaga "$2" on keelatud üles laadida. +See vastab järgmisele musta nimekirja sissekandele: $1', + 'titleblacklist-forbidden-new-account' => 'Kasutajat nimega "$2" on keelatud luua. +See vastab järgmisele musta nimekirja sissekandele: $1', + 'titleblacklist-invalid' => '{{PLURAL:$1|Järgmine|Järgmised}} musta nimekirja {{PLURAL:$1|rida on vigane|read on vigased}}. Palun paranda {{PLURAL:$1|see|need}} enne salvestamist:', 'titleblacklist-override' => 'Eira musta nimekirja', 'right-tboverride' => 'Eirata pealkirjade või kasutajanimede musta nimekirja', @@ -915,10 +918,12 @@ $messages['gu'] = array( /** Hebrew (עברית) * @author Amire80 + * @author Guycn2 * @author Rotem Liss + * @author Rotemliss */ $messages['he'] = array( - 'titleblacklist-desc' => 'אפשרות למנהלים לאסור על יצירת דפים וחשבונות משתמש לפי [[MediaWiki:Titleblacklist|רשימה שחורה]] ו[[MediaWiki:Titlewhitelist|רשימה לבנה]]', + 'titleblacklist-desc' => 'אפשרות למפעילי המערכת לאסור יצירת דפים וחשבונות משתמש לפי [[MediaWiki:Titleblacklist|רשימה שחורה]] ו[[MediaWiki:Titlewhitelist|רשימה לבנה]]', 'titleblacklist' => '# זוהי רשימת הכותרות האסורות. לא ניתן ליצור כותרות וחשבונות משתמש שמתאימים לביטוי רגולרי המופיע כאן. # השתמשו בסימן "#" להערות. #רשימה זו אינה תלויה ברישיות כברירת מחדל.', @@ -936,7 +941,7 @@ $messages['he'] = array( אנא תקנו {{PLURAL:$1|אותה|אותן}} לפני השמירה:', 'titleblacklist-override' => 'התעלם מהרשימה השחורה', 'right-tboverride' => 'עקיפת רשימת שמות המשתמשים האסורים', - 'right-tboverride-account' => 'לעקוף את הרשימה השחורה של שמות המשתמשים', + 'right-tboverride-account' => 'עקיפת הרשימה השחורה של שמות המשתמשים', ); /** Hindi (हिन्दी) @@ -1374,14 +1379,15 @@ Hic titulus congruit cum expressione regulari: $1', /** Luxembourgish (Lëtzebuergesch) * @author Robby + * @author Soued031 */ $messages['lb'] = array( 'titleblacklist-desc' => "Erlaabt den Administrateuren et d'Uleeë vu Säiten a Benotzerkonte mat spezifeschen Titelen iwwer eng [[MediaWiki:Titleblacklist|schwaarz Lëscht]] an eng [[MediaWiki:Titlewhitelist|wäiss Lëscht]] ze verbidden", 'titleblacklist' => '# Dëst ass een Titel deen op enger schwaarzer Lëscht steet. Titelen a Benotzernimm op déi dës Ausdréck passe kann net ugeluecht ginn # Benotzt "#" fir Bemierkungen -# Et gëtt tëschent groussen a klenge Buchstawen ënnerscheed', +# Et gëtt tëscht groussen a klenge Buchstawen ënnerscheet', 'titlewhitelist' => "# Dëst ass d'''Whitelist'' vun den Titelen. Benotzt \"#\" fir Bemierkungen. -# Et gëtt een Ënnerscheed tëschent groussen a klenge Buchstawe gemaach", +# Et gëtt een Ënnerscheed tëscht groussen a klenge Buchstawe gemaach", 'titleblacklist-forbidden-edit' => 'Den Titel "$2" dàerf net ugeluecht ginn. En ass op der schwaarzer Lëscht wéint folgendem Begrëff: $1', 'titleblacklist-forbidden-move' => '"$2" kann net op "$3" geréckelt ginn, well den Titel "$3" net däerf ugeluecht ginn. @@ -1389,7 +1395,7 @@ En entsprécht dëser Rubrik vun der schwaarzr Lëscht: $1', 'titleblacklist-forbidden-upload' => 'De Fichiersnumm "$2" kann net benotzt ginn. Hien ass identesch mat dësem Numm vun der schwaarzer Lëscht (black list): $1', 'titleblacklist-forbidden-new-account' => 'De Benotzermumm "$2" gouf gespaart fir benotzt ze ginn. -En ass esou op der \'\'schwaarzer Lëscht\'\': $1', +En ass sou op der \'\'schwaarzer Lëscht\'\': $1', 'titleblacklist-invalid' => 'Dës {{PLURAL:$1|Linn|Linnen}} op der schwaarzer Lëscht vun den {{PLURAL:$1|Titelen ass|Titele sinn}} net valabel; verbessert se virum späicheren:', 'titleblacklist-override' => 'Schwaarz Lëscht ignoréieren', @@ -1498,9 +1504,10 @@ $messages['ml'] = array( * @author Kaustubh * @author Mahitgar * @author Rahuldeshmukh101 + * @author V.narsikar */ $messages['mr'] = array( - 'titleblacklist-desc' => '[[MediaWiki:Titleblacklist|ब्लॅकलीस्ट]] व [[MediaWiki:Titlewhitelist|व्हाईट लीस्ट]] ला अनुसरून पाने आणि सदस्य खात्यांना प्रतिबंधतीअ करण्याची प्रचालकांना परवानगी द्या', + 'titleblacklist-desc' => '[[MediaWiki:Titleblacklist|ब्लॅकलीस्ट]] व [[MediaWiki:Titlewhitelist|व्हाईट लीस्ट]] ला अनुसरून पाने आणि सदस्य खात्यांना प्रतिबंधित करण्याची प्रचालकांना परवानगी द्या', 'titleblacklist' => '# ही ब्लॉक केलेल्या शीर्षकांची यादी आहे. या यादीत असलेल्या शीर्षकांचे लेख लिहिता येणार नाहीत. # शेरा देण्यासाठी "#" वापरा.', 'titlewhitelist' => '# ही वापरू शकत असलेल्या शीर्षकांची यादी आहे. शेरा देण्यासाठी "#" वापरा', @@ -1698,15 +1705,17 @@ $messages['or'] = array( /** Polish (polski) * @author Beau * @author BeginaFelicysym + * @author Chrumps * @author Derbeth + * @author Peter Bowman * @author Sp5uhe */ $messages['pl'] = array( 'titleblacklist-desc' => 'Pozwala na blokowanie tworzenia stron i kont użytkowników o określonych nazwach wykorzystując [[MediaWiki:Titleblacklist|czarną]] oraz [[MediaWiki:Titlewhitelist|białą]] listę', - 'titleblacklist' => '# Lista zabronionych nazw. Strony i konta o nazwach odpowiadających poniższym wyrażeniom regularnym, nie będą mogły zostać utworzone. -# Użyj znaku „#”, by utworzyć komentarz. + 'titleblacklist' => '# Lista zabronionych nazw. Strony i konta o nazwach odpowiadających poniższym wyrażeniom regularnym nie będą mogły zostać utworzone. +# Użyj znaku „#”, aby utworzyć komentarz. # Domyślnie we wpisach ma znaczenie wielkość znaków.', - 'titlewhitelist' => '# To jest lista dopuszczalnych nazw artykułów. Użyj znaku „#” by utworzyć komentarz. + 'titlewhitelist' => '# To jest lista dopuszczalnych nazw artykułów. Użyj znaku „#”, aby utworzyć komentarz. # Domyślnie we wpisach ma znaczenie wielkość znaków.', 'titleblacklist-forbidden-edit' => 'Utworzenie strony o nazwie „$2” nie jest możliwe. Nazwa ta pasuje do wpisu z czarnej listy: $1', @@ -1718,7 +1727,7 @@ Nazwa ta pasuje do wpisu z czarnej listy: $1', Nazwa ta pasuje do wpisu z czarnej listy: $1', 'titleblacklist-invalid' => '{{PLURAL:$1|Następująca linia|Następujące linie}} na liście zabronionych tytułów stron {{PLURAL:$1|jest nieprawidłowa|są nieprawidłowe}}. Popraw {{PLURAL:$1|ją|je}} przed zapisaniem:', 'titleblacklist-override' => 'Ignoruj czarną listę', - 'right-tboverride' => 'Zastąp czarną listę zabronionych tytułów stron lub nazw użytkowników', + 'right-tboverride' => 'Ignorowanie czarnej listy tytułów lub nazw użytkowników', 'right-tboverride-account' => 'Ignorowanie czarnej listy użytkowników', ); @@ -1920,7 +1929,7 @@ $messages['ru'] = array( 'titleblacklist-forbidden-upload' => 'Файл с названием «$2» был запрещён к созданию. Он попадает под следующую запись списка запрещенных названий: $1', 'titleblacklist-forbidden-new-account' => 'Запрещено использовать имя участника «$2». Имя соответствует следующей записи из чёрного списка: $1', - 'titleblacklist-invalid' => '{{PLURAL:$1|Следующая строка|Следующие строки}} в списке запрещённых названий {{PLURAL:$1|не является правильным регулярным выражением|не являются правильными регулярными выражениями}}. Пожалуйста, исправьте {{PLURAL:$1|её|их}} перед сохранением:', + 'titleblacklist-invalid' => '{{PLURAL:$1|1=Следующая строка|Следующие строки}} в списке запрещённых названий {{PLURAL:$1|1=не является правильным регулярным выражением|не являются правильными регулярными выражениями}}. Пожалуйста, исправьте {{PLURAL:$1|1=её|их}} перед сохранением:', 'titleblacklist-override' => 'Игнорировать чёрный список', 'right-tboverride' => 'игнорирование чёрного списка имён страниц или участников', 'right-tboverride-account' => 'игнорирование чёрного списка имён участников', @@ -1998,6 +2007,14 @@ $messages['sah'] = array( 'right-tboverride-account' => 'кыттааччылар ааттарын "хара тиһигин" туттума', ); +/** Serbo-Croatian (srpskohrvatski / српскохрватски) + * @author Kolega2357 + */ +$messages['sh'] = array( + 'right-tboverride' => 'Zaobilaženje spiska zabranjenih naslova', + 'right-tboverride-account' => 'Zaobilaženje spiska zabranjenih korisničkih imena', +); + /** Sinhala (සිංහල) * @author Budhajeewa * @author පසිඳු කාවින්ද @@ -2324,6 +2341,7 @@ lütfen kaydetmeden önce düzeltin:', /** Ukrainian (українська) * @author AS * @author Ahonc + * @author Andriykopanytsia * @author Base * @author JenVan * @author Prima klasy4na @@ -2342,8 +2360,8 @@ $messages['uk'] = array( Вона підпадає під наступний запис із списку заборонених назв: $1', 'titleblacklist-forbidden-new-account' => "Заборонено використовувати ім'я користувача «$2». Ім'я відповідає наступному запису з чорного списку: $1", - 'titleblacklist-invalid' => '{{PLURAL:$1|Наступнинй рядок|Наступні рядки}} списку заборонених назв є {{PLURAL:$1|помилковим|помилковими}}; -будь ласка, виправіть {{PLURAL:$1|його|їх}} перед збереженням:', + 'titleblacklist-invalid' => '{{PLURAL:$1|1=Наступний рядок|Наступні рядки}} списку заборонених назв є {{PLURAL:$1|1=помилковим|помилковими}}; +будь ласка, виправте {{PLURAL:$1|1=його|їх}} перед збереженням:', 'titleblacklist-override' => 'Ігнорувати чорний список', 'right-tboverride' => 'ігнорування чорного списку назв сторінок або користувачів', 'right-tboverride-account' => 'ігнорування чорного списку імен користувачів', diff --git a/extensions/TitleBlacklist/TitleBlacklist.library.php b/extensions/TitleBlacklist/TitleBlacklist.library.php new file mode 100644 index 00000000..0c2a599c --- /dev/null +++ b/extensions/TitleBlacklist/TitleBlacklist.library.php @@ -0,0 +1,33 @@ + array( $this, 'test' ), + ); + + $this->getEngine()->registerInterface( __DIR__ . '/mw.ext.TitleBlacklist.lua', $lib, array() ); + } + + public function test( $action = null, $title = null ) { + $this->checkType( 'mw.ext.TitleBlacklist.test', 1, $action, 'string' ); + $this->checkTypeOptional( 'mw.ext.TitleBlacklist.test', 2, $title, 'string', '' ); + $this->incrementExpensiveFunctionCount(); + if ( $title == '' ) { + $title = $this->getParser()->mTitle->getPrefixedText(); + } + $entry = TitleBlacklist::singleton()->isBlacklisted( $title, $action ); + if ( $entry ) { + return array( array( + 'params' => $entry->getParams(), + 'regex' => $entry->getRegex(), + 'raw' => $entry->getRaw(), + 'version' => $entry->getFormatVersion(), + 'message' => $entry->getErrorMessage( $action ), + 'custommessage' => $entry->getCustomMessage() + ) ); + } + return array( null ); + } + +} diff --git a/extensions/TitleBlacklist/TitleBlacklist.list.php b/extensions/TitleBlacklist/TitleBlacklist.list.php index d197a9c5..3947e8ae 100644 --- a/extensions/TitleBlacklist/TitleBlacklist.list.php +++ b/extensions/TitleBlacklist/TitleBlacklist.list.php @@ -156,7 +156,12 @@ class TitleBlacklist { if ( $override && self::userCanOverride( $user, $action ) ) { return false; } else { - return $this->isBlacklisted( $title, $action ); + $entry = $this->isBlacklisted( $title, $action ); + if ( !$entry ) { + return false; + } + $params = $entry->getParams(); + return isset( $params['autoconfirmed'] ) && $user->isAllowed( 'autoconfirmed' ) ? false : $entry; } } @@ -172,17 +177,29 @@ class TitleBlacklist { public function isBlacklisted( $title, $action = 'edit' ) { if ( !( $title instanceof Title ) ) { $title = Title::newFromText( $title ); + if ( !( $title instanceof Title ) ) { + // The fact that the page name is invalid will stop whatever + // action is going through. No sense in doing more work here. + return false; + } } $blacklist = $this->getBlacklist(); + $autoconfirmedItem = false; foreach ( $blacklist as $item ) { - if ( $item->matches( $title, $action ) ) { + if ( $item->matches( $title->getFullText(), $action ) ) { if ( $this->isWhitelisted( $title, $action ) ) { return false; } - return $item; // "returning true" + $params = $item->getParams(); + if ( !isset( $params['autoconfirmed'] ) ) { + return $item; + } + if ( !$autoconfirmedItem ) { + $autoconfirmedItem = $item; + } } } - return false; + return $autoconfirmedItem; } /** @@ -199,7 +216,7 @@ class TitleBlacklist { } $whitelist = $this->getWhitelist(); foreach ( $whitelist as $item ) { - if ( $item->matches( $title, $action ) ) { + if ( $item->matches( $title->getFullText(), $action ) ) { return true; } } @@ -343,7 +360,7 @@ class TitleBlacklistEntry { * Check whether a user can perform the specified action * on the specified Title * - * @param $title Title to check + * @param $title string to check * @param $action %Action to check * @return bool TRUE if the the regex matches the title, and is not overridden * else false if it doesn't match (or was overridden) @@ -357,15 +374,20 @@ class TitleBlacklistEntry { return false; } + if ( isset( $this->mParams['antispoof'] ) && is_callable( 'AntiSpoof::checkUnicodeString' ) ) { + list( $ok, $norm ) = AntiSpoof::checkUnicodeString( $title ); + if ( $ok == "OK" ) { + list( $ver, $title ) = explode( ':', $norm, 2 ); + } else { + wfDebugLog( 'TitleBlacklist', 'AntiSpoof could not normalize "' . $title . '".' ); + } + } + wfSuppressWarnings(); - $match = preg_match( "/^(?:{$this->mRegex})$/us" . ( isset( $this->mParams['casesensitive'] ) ? '' : 'i' ), $title->getFullText() ); + $match = preg_match( "/^(?:{$this->mRegex})$/us" . ( isset( $this->mParams['casesensitive'] ) ? '' : 'i' ), $title ); wfRestoreWarnings(); - global $wgUser; if ( $match ) { - if ( isset( $this->mParams['autoconfirmed'] ) && $wgUser->isAllowed( 'autoconfirmed' ) ) { - return false; - } if ( isset( $this->mParams['moveonly'] ) && $action != 'move' ) { return false; } @@ -427,6 +449,9 @@ class TitleBlacklistEntry { if ( preg_match( '/errmsg\s*=\s*(.+)/i', $opt, $matches ) ) { $options['errmsg'] = $matches[1]; } + if ( $opt2 == 'antispoof' ) { + $options['antispoof'] = true; + } } // Process magic words preg_match_all( '/{{\s*([a-z]+)\s*:\s*(.+?)\s*}}/', $regex, $magicwords, PREG_SET_ORDER ); @@ -469,10 +494,10 @@ class TitleBlacklistEntry { } /** - * @return array This entry's options + * @return array This entry's parameters */ - public function getOptions() { - return $this->mOptions; + public function getParams() { + return $this->mParams; } /** diff --git a/extensions/TitleBlacklist/TitleBlacklist.php b/extensions/TitleBlacklist/TitleBlacklist.php index 68fb6778..acd946d6 100644 --- a/extensions/TitleBlacklist/TitleBlacklist.php +++ b/extensions/TitleBlacklist/TitleBlacklist.php @@ -22,6 +22,7 @@ $dir = __DIR__; $wgExtensionMessagesFiles['TitleBlacklist'] = $dir . '/TitleBlacklist.i18n.php'; $wgAutoloadClasses['TitleBlacklist'] = $dir . '/TitleBlacklist.list.php'; $wgAutoloadClasses['TitleBlacklistHooks'] = $dir . '/TitleBlacklist.hooks.php'; +$wgAutoloadClasses['Scribunto_LuaTitleBlacklistLibrary'] = $dir . '/TitleBlacklist.library.php'; /** @defgroup Title blacklist source types * @{ @@ -76,6 +77,16 @@ $wgHooks['CentralAuthAutoCreate'][] = 'TitleBlacklistHooks::centralAuthAutoCreat $wgHooks['EditFilter'][] = 'TitleBlacklistHooks::validateBlacklist'; $wgHooks['ArticleSaveComplete'][] = 'TitleBlacklistHooks::clearBlacklist'; $wgHooks['UserCreateForm'][] = 'TitleBlacklistHooks::addOverrideCheckbox'; +$wgHooks['UnitTestsList'][] = function( &$files ) { + $files += glob( __DIR__ . '/tests/*Test.php' ); + return true; +}; +$wgHooks['ScribuntoExternalLibraries'][] = function( $engine, array &$extraLibraries ) { + if( $engine == 'lua' ) { + $extraLibraries['mw.ext.TitleBlacklist'] = 'Scribunto_LuaTitleBlacklistLibrary'; + } + return true; +}; $wgResourceModules['mediawiki.api.titleblacklist'] = array( 'scripts' => 'mediawiki.api.titleblacklist.js', diff --git a/extensions/TitleBlacklist/mw.ext.TitleBlacklist.lua b/extensions/TitleBlacklist/mw.ext.TitleBlacklist.lua new file mode 100644 index 00000000..1b48eed1 --- /dev/null +++ b/extensions/TitleBlacklist/mw.ext.TitleBlacklist.lua @@ -0,0 +1,22 @@ +local TitleBlacklist = {} +local php + +function TitleBlacklist.test( action, title ) + return php.test( action, title ) +end + +function TitleBlacklist.setupInterface( options ) + -- Boilerplate + TitleBlacklist.setupInterface = nil + php = mw_interface + mw_interface = nil + + -- Register this library in the "mw" global + mw = mw or {} + mw.ext = mw.ext or {} + mw.ext.TitleBlacklist = TitleBlacklist + + package.loaded['mw.ext.TitleBlacklist'] = TitleBlacklist +end + +return TitleBlacklist diff --git a/extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php b/extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php index 1f8164e7..344e9996 100644 --- a/extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php +++ b/extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php @@ -105,6 +105,28 @@ class ApiQueryTitleBlacklistTest extends ApiTestCase { $listed[0]['titleblacklist']['line'], 'Correct blacklist line is returned' ); + } + + /** + * Tests integration with the AntiSpoof extension + */ + function testAntiSpoofIntegration() { + if ( !class_exists( 'AntiSpoof') ) { + $this->markTestSkipped( "This test requires the AntiSpoof extension" ); + } + + $listed = $this->doApiRequest( array( + 'action' => 'titleblacklist', + 'tbtitle' => 'AVVVV', + 'tbaction' => 'create', + 'tbnooverride' => true, + ) ); + + $this->assertEquals( + 'blacklisted', + $listed[0]['titleblacklist']['result'], + 'Spoofed title is blacklisted' + ); } } diff --git a/extensions/TitleBlacklist/tests/testSource b/extensions/TitleBlacklist/tests/testSource index f73d9dd7..235cc671 100644 --- a/extensions/TitleBlacklist/tests/testSource +++ b/extensions/TitleBlacklist/tests/testSource @@ -2,3 +2,4 @@ .*[Ff]ail.* .*[Nn]yancat.* .*evil_acc.* +AW{1,10} diff --git a/extensions/WikiEditor/.jshintignore b/extensions/WikiEditor/.jshintignore index 66a218b5..b97a47d3 100644 --- a/extensions/WikiEditor/.jshintignore +++ b/extensions/WikiEditor/.jshintignore @@ -1,2 +1,4 @@ # upstream lib from Google modules/contentCollector.js +# messy +modules/jquery.wikiEditor.iframe.js diff --git a/extensions/WikiEditor/.jshintrc b/extensions/WikiEditor/.jshintrc index 64cd5087..5d335e32 100644 --- a/extensions/WikiEditor/.jshintrc +++ b/extensions/WikiEditor/.jshintrc @@ -1,9 +1,33 @@ { + /* Common */ + + // Enforcing + "camelcase": true, + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": true, + "newcap": true, + "noarg": true, + "noempty": true, + "nonew": true, + "quotmark": "single", + "trailing": true, + "undef": true, + "unused": true, + // Legacy + "onevar": true, + + /* Local */ + + // Relaxing + "loopfunc": true, + "multistr": true, + // Environment + "browser": true, + "predef": [ "mediaWiki", "jQuery" - ], - "browser": true, - "smarttabs": true, - "multistr": true + ] } diff --git a/extensions/WikiEditor/COPYING b/extensions/WikiEditor/COPYING new file mode 100644 index 00000000..d159169d --- /dev/null +++ b/extensions/WikiEditor/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/extensions/WikiEditor/WikiEditor.i18n.php b/extensions/WikiEditor/WikiEditor.i18n.php index 26f1e2ca..fa3c1b0b 100644 --- a/extensions/WikiEditor/WikiEditor.i18n.php +++ b/extensions/WikiEditor/WikiEditor.i18n.php @@ -334,6 +334,7 @@ I guess that "feature-providing modules" means the same as "modules providing fe {{Identical|Publish}}", 'wikieditor-publish-dialog-goback' => 'Button that closes the dialog that opens when the user clicks the Publish button. {{Identical|Go back}}', + 'wikieditor-template-editor-dialog-title' => '{{Identical|Edit template}}', 'wikieditor-template-editor-dialog-submit' => '{{Identical|Update}}', 'wikieditor-template-editor-dialog-cancel' => '{{Identical|Cancel}}', 'wikieditor-toc-preference' => "Option at [[Special:Preferences]], tab ''{{int:prefs-editing}}''", @@ -1281,6 +1282,7 @@ $1:Eixemplo.jpg|Piet_de_foto_2', /** Old English (Ænglisc) * @author Gott wisst + * @author Shirayuki * @author Wōdenhelm */ $messages['ang'] = array( @@ -4032,6 +4034,7 @@ $1:Cuntuh.jpg|Judul2', ); /** Bengali (বাংলা) + * @author Aftab1995 * @author Bellayet * @author Leemon2010 * @author Nasir8891 @@ -4149,8 +4152,8 @@ $messages['bn'] = array( 'wikieditor-toolbar-tool-subscript-example' => 'সাবস্ক্রিপ্ট লেখা', 'wikieditor-toolbar-group-insert' => 'যোগ করো', 'wikieditor-toolbar-tool-gallery' => 'ছবির গ্যালারী', - 'wikieditor-toolbar-tool-gallery-example' => '$1:Example.jpg|ক্যাপশন১ -$1:Example.jpg|ক্যাপশন২', + 'wikieditor-toolbar-tool-gallery-example' => '$1:উদাহরণ.jpg|ক্যাপশন১ +$1:উদাহরণ.jpg|ক্যাপশন২', 'wikieditor-toolbar-tool-newline' => 'নতুন লাইন', 'wikieditor-toolbar-tool-table' => 'ছক', 'wikieditor-toolbar-tool-table-example-old' => '- @@ -5069,7 +5072,7 @@ Voleu convertir-lo en un enllaç intern?", 'wikieditor-toolbar-tool-link-empty' => 'No heu entrat res per enllaçar.', 'wikieditor-toolbar-tool-file' => 'Fitxer incrustat', 'wikieditor-toolbar-tool-file-example' => 'Exemple.png', - 'wikieditor-toolbar-tool-file-title' => 'Insereix arxiu', + 'wikieditor-toolbar-tool-file-title' => 'Inserir un fitxer', 'wikieditor-toolbar-file-target' => 'Nom del fitxer:', 'wikieditor-toolbar-file-caption' => 'Títol:', 'wikieditor-toolbar-file-size' => 'Mida:', @@ -5077,7 +5080,7 @@ Voleu convertir-lo en un enllaç intern?", 'wikieditor-toolbar-file-default' => '(per defecte)', 'wikieditor-toolbar-file-format' => 'Format:', 'wikieditor-toolbar-file-format-none' => 'cap', - 'wikieditor-toolbar-tool-file-insert' => 'Inserta', + 'wikieditor-toolbar-tool-file-insert' => 'Insereix', 'wikieditor-toolbar-tool-file-cancel' => 'Cancel·la', 'wikieditor-toolbar-tool-reference' => 'Referència', 'wikieditor-toolbar-tool-reference-example' => 'Inseriu la nota al peu aquí', @@ -5251,8 +5254,8 @@ $1:Example.jpg|Peu2', * @author Умар */ $messages['ce'] = array( - 'wikieditor' => 'Викийозан рéдоккхучечохь аллсам чулоцург', - 'wikieditor-desc' => 'Аьтто бо тlе хуттучо, викийозан аъ ишта кхечу харжамна рéдоккхучечохь аллсам чулоцучо', + 'wikieditor' => 'Викийоза тадаран шоьйра интерфейс', + 'wikieditor-desc' => 'Тадарш даран шоьйра интерфейс латайо кхин дукху фукцеш а', 'wikieditor-wikitext-tab' => 'Викийоза', 'wikieditor-loading' => 'Чуйолуш', 'wikieditor-preview-preference' => 'Латайé хьалха муха ю хьажар дуьхь дуьхьал', @@ -5265,7 +5268,7 @@ $messages['ce'] = array( 'wikieditor-publish-preference' => 'Латайé цхьац ког бокхуш чутохар', 'wikieditor-publish-button-publish' => 'Нахангайта', 'wikieditor-publish-button-cancel' => 'Цаоьшу', - 'wikieditor-publish-dialog-title' => 'Нахангайта оцу кхолламехь {{SITENAME}}', + 'wikieditor-publish-dialog-title' => '{{SITENAME}} проектехь арахецар', 'wikieditor-publish-dialog-summary' => 'Хийцамах лаьцна (доц язде хlу хийцам бина ахьа):', 'wikieditor-publish-dialog-minor' => 'Жим хийцам', 'wikieditor-publish-dialog-watch' => 'Тергам бé хlокху агlон', @@ -5279,41 +5282,42 @@ $messages['ce'] = array( 'wikieditor-toc-preference' => 'Латедé коьрта дерг шавигарна аттонца', 'wikieditor-toc-show' => 'Гайта коьртехь дерг', 'wikieditor-toc-hide' => 'Къайлахьо коьртехь дерг', - 'wikieditor-toolbar' => 'Рéдоккху меттиг', - 'wikieditor-toolbar-desc' => 'Рéдоккху меттиг гlоле лелорца', + 'wikieditor-toolbar' => 'Тадаран меттиг', + 'wikieditor-toolbar-desc' => 'Тадаран меттиг гӀоле лелорца', 'wikieditor-toolbar-preference' => 'Латайé гlоле йолу тадар', - 'wikieditor-toolbar-dialogs-preference' => 'Латайé йозан хьажориг йуьллург, таблийцан аъ кхин хlумнашна', # Fuzzy + 'wikieditor-toolbar-dialogs-preference' => 'Латайé йозан хьажораг йуьллург, таблицан а кхин хӀумнашна а', 'wikieditor-toolbar-loading' => 'Чуйолуш…', 'wikieditor-toolbar-tool-bold' => 'Дерстино', 'wikieditor-toolbar-tool-bold-example' => 'Дерстино до йоза', 'wikieditor-toolbar-tool-italic' => 'Сетта', 'wikieditor-toolbar-tool-italic-example' => 'Сеттан до йоза', - 'wikieditor-toolbar-tool-ilink' => 'Чоьхьа хьажориг', + 'wikieditor-toolbar-tool-ilink' => 'Чоьхьа хьажораг', 'wikieditor-toolbar-tool-ilink-example' => 'Хьажориган коьрта могlа', 'wikieditor-toolbar-tool-xlink' => 'Арахьара хьажораг (йиц ма йе хӀотталушерг http://)', - 'wikieditor-toolbar-tool-xlink-example' => 'http://www.example.com хьажориг корта', - 'wikieditor-toolbar-tool-link' => 'Хьажориг', - 'wikieditor-toolbar-tool-link-title' => 'Чуйилла хьажориг', - 'wikieditor-toolbar-tool-link-int' => 'Оцу вики агlон', - 'wikieditor-toolbar-tool-link-int-target' => 'Хьажийна агlо йа URL:', - 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'Агlон цlе йа URL', + 'wikieditor-toolbar-tool-xlink-example' => 'http://www.example.com хьажораг корта', + 'wikieditor-toolbar-tool-link' => 'Хьажораг', + 'wikieditor-toolbar-tool-link-title' => 'Чуйилла хьажораг', + 'wikieditor-toolbar-tool-link-int' => 'Вики агӀоне', + 'wikieditor-toolbar-tool-link-int-target' => 'Хьажийна агӀо я URL:', + 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'АгӀон цӀе я URL', 'wikieditor-toolbar-tool-link-int-text' => 'Гойтуш долу йоза:', 'wikieditor-toolbar-tool-link-int-text-tooltip' => 'Чудилла схьагайта дезаш долу йоза', 'wikieditor-toolbar-tool-link-ext' => 'Хьалхара агlон чохь', - 'wikieditor-toolbar-tool-link-ext-target' => 'URL хьажоригаш:', - 'wikieditor-toolbar-tool-link-ext-text' => 'Хьажориган йоза:', - 'wikieditor-toolbar-tool-link-insert' => 'Чуйилла хьажориг', + 'wikieditor-toolbar-tool-link-ext-target' => 'URL хьажорагаш:', + 'wikieditor-toolbar-tool-link-ext-text' => 'Хьажораган йоза:', + 'wikieditor-toolbar-tool-link-insert' => 'Чуйилла хьажораг', 'wikieditor-toolbar-tool-link-cancel' => 'Цаоьшу', 'wikieditor-toolbar-tool-link-int-target-status-exists' => 'Ишта агlо йолш ю', 'wikieditor-toolbar-tool-link-int-target-status-notexists' => 'Ишта агlо яц', 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Ца магайо цlе', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Арахьара хьажораг', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'Агlо ю яц хьоьжуш…', + 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'Дуккха маьӀнаш долу агӀонаш', 'wikieditor-toolbar-tool-link-int-invalid' => 'Гойтуш йолу цlе ца магайо.', - 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'Ахьа хоттийна URL кхечу вики-агlонан хьажоригах тера ю. Лаьий хьуна и хьажориг чоьхьарчех я?', - 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Чоьхьа хьажориг', + 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'Ахьа хоттийна URL кхечу вики-агӀонан хьажорагах тера ю. Лаьий хьуна и хьажораг чоьхьарчех я?', + 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Чоьхьа хьажораг', 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' => 'Арахьара хьажораг', - 'wikieditor-toolbar-tool-link-empty' => 'Ахьа ца гайтин мичхьа хьажойеза хьажориг.', + 'wikieditor-toolbar-tool-link-empty' => 'Ахьа ца гайтин мичхьа хьажойеза хьажораг.', 'wikieditor-toolbar-tool-file' => 'Чохь йолу файл', 'wikieditor-toolbar-tool-file-example' => 'Example.jpg', 'wikieditor-toolbar-tool-file-title' => 'Файл чуйиллар', @@ -5322,6 +5326,7 @@ $messages['ce'] = array( 'wikieditor-toolbar-file-size' => 'Барам:', 'wikieditor-toolbar-file-float' => 'Нисдар:', 'wikieditor-toolbar-file-default' => '(Iад йитарца)', + 'wikieditor-toolbar-file-format-none' => 'цхьаа', 'wikieditor-toolbar-tool-file-insert' => 'Чудилла', 'wikieditor-toolbar-tool-file-cancel' => 'Цаоьшу', 'wikieditor-toolbar-tool-reference' => 'ТIетовжар', @@ -5331,7 +5336,7 @@ $messages['ce'] = array( 'wikieditor-toolbar-tool-reference-insert' => 'Чудилла', 'wikieditor-toolbar-tool-reference-text' => 'ТIетовжаран йоза', 'wikieditor-toolbar-tool-signature' => 'Куьгтаlор хан хlоттош', - 'wikieditor-toolbar-section-advanced' => 'Кхин тlе дукха', + 'wikieditor-toolbar-section-advanced' => 'Кхин тӀе', 'wikieditor-toolbar-tool-heading' => 'Корта', 'wikieditor-toolbar-tool-heading-1' => 'Локхалла 1', 'wikieditor-toolbar-tool-heading-2' => 'Локхалла 2', @@ -5362,26 +5367,26 @@ $messages['ce'] = array( 'wikieditor-toolbar-tool-gallery' => 'Дуккха суьрташ', 'wikieditor-toolbar-tool-gallery-example' => '$1:Example.jpg|Цуьнах лаце1 $1:Example.jpg|Цуьнах лаце2', - 'wikieditor-toolbar-tool-newline' => 'Керла могlа', + 'wikieditor-toolbar-tool-newline' => 'Керла могӀа', 'wikieditor-toolbar-tool-table' => 'Таблица', 'wikieditor-toolbar-tool-table-example-old' => '- -! коьрта могlа 1 -! коьрта могlа 2 -! коьрта могlа 3 +! коьрта могӀа 1 +! коьрта могӀа 2 +! коьрта могӀа 3 |- -| могlа 1, чоь 1 -| могlа 1, чоь 2 -| могlа 1, чоь 3 +| могӀа 1, чоь 1 +| могӀа 1, чоь 2 +| могӀа 1, чоь 3 |- -| могlа 2, чоь 1 -| могlа 2, чоь 2 -| могlа 2, чоь 3', +| могӀа 2, чоь 1 +| могӀа 2, чоь 2 +| могӀа 2, чоь 3', 'wikieditor-toolbar-tool-table-example-cell-text' => 'Чоьнан йоза', 'wikieditor-toolbar-tool-table-example-header' => 'Коьрта йоза', 'wikieditor-toolbar-tool-table-title' => 'Чуйилла таблица', 'wikieditor-toolbar-tool-table-dimensions-rows' => 'МогӀанаш', 'wikieditor-toolbar-tool-table-dimensions-columns' => 'Бlогlамаш', - 'wikieditor-toolbar-tool-table-dimensions-header' => 'Тlетоха коьрта могlан могlа', + 'wikieditor-toolbar-tool-table-dimensions-header' => 'ТӀетоха коьрта могӀанан могӀа', 'wikieditor-toolbar-tool-table-wikitable' => 'Кечйеш дозанашца', 'wikieditor-toolbar-tool-table-sortable' => 'Листалуш йе таблица', 'wikieditor-toolbar-tool-table-example' => 'Чоьнан йоза', @@ -5405,12 +5410,12 @@ $1:Example.jpg|Цуьнах лаце2', 'wikieditor-toolbar-tool-replace-success' => 'Балийна хийцам: $1.', # Fuzzy 'wikieditor-toolbar-tool-replace-emptysearch' => 'Ахьа ца гайтна хlу лаха деза.', 'wikieditor-toolbar-tool-replace-invalidregex' => 'Ахьа язйина цlе юх-юха нийса яц: $1', - 'wikieditor-toolbar-section-characters' => 'Саболу куьцаш', + 'wikieditor-toolbar-section-characters' => 'Леррина символаш', 'wikieditor-toolbar-characters-page-latin' => 'Латинан', 'wikieditor-toolbar-characters-page-latinextended' => 'Латинан алсам', 'wikieditor-toolbar-characters-page-ipa' => 'ДАЭ (IPA)', - 'wikieditor-toolbar-characters-page-symbols' => 'Саболурш', - 'wikieditor-toolbar-characters-page-greek' => 'Гlайрхойн', + 'wikieditor-toolbar-characters-page-symbols' => 'Символаш', + 'wikieditor-toolbar-characters-page-greek' => 'Грекийн', 'wikieditor-toolbar-characters-page-cyrillic' => 'Кирилан', 'wikieditor-toolbar-characters-page-arabic' => 'Ӏарбийн', 'wikieditor-toolbar-characters-page-arabicextended' => 'Iаьрбийн шординарш', @@ -5429,7 +5434,7 @@ $1:Example.jpg|Цуьнах лаце2', 'wikieditor-toolbar-help-heading-syntax' => 'Хlу йуьллу ахьа', 'wikieditor-toolbar-help-heading-result' => 'Хlу хуьлу хьуна', 'wikieditor-toolbar-help-page-format' => 'Бáрамхlоттор', - 'wikieditor-toolbar-help-page-link' => 'Хьажоригаш', + 'wikieditor-toolbar-help-page-link' => 'Хьажорагаш', 'wikieditor-toolbar-help-page-heading' => 'Коьрта могlнаш', 'wikieditor-toolbar-help-page-list' => 'Могlамаш', 'wikieditor-toolbar-help-page-file' => 'Файлаш', @@ -5444,7 +5449,7 @@ $1:Example.jpg|Цуьнах лаце2', 'wikieditor-toolbar-help-content-bolditalic-description' => 'Дерстино курсеттан', 'wikieditor-toolbar-help-content-bolditalic-syntax' => "'''''Дерстино курсеттан'''''", 'wikieditor-toolbar-help-content-bolditalic-result' => 'Дерстино курсеттан', - 'wikieditor-toolbar-help-content-ilink-description' => 'Чоьхьа хьажориг', + 'wikieditor-toolbar-help-content-ilink-description' => 'Чоьхьа хьажораг', 'wikieditor-toolbar-help-content-ilink-syntax' => '[[Агlонан коьрта могlа|Хьажориган йоза]]
      [[Агlонан коьрта могlа]]', 'wikieditor-toolbar-help-content-ilink-result' => "Хьажориган йоза
      Агlонан коьрта могlа", 'wikieditor-toolbar-help-content-xlink-description' => 'Арахьара хьажораг', @@ -5476,7 +5481,7 @@ $1:Example.jpg|Цуьнах лаце2', 'wikieditor-toolbar-help-content-reference-description' => 'Билгалдаккхар', 'wikieditor-toolbar-help-content-reference-syntax' => 'Агlонан йоза.<ref name="test">[http://www.example.org Хьажориган йоза], кхин тlе дузуш йоза.</ref>', 'wikieditor-toolbar-help-content-reference-result' => "Агlонан йоза.[1]", - 'wikieditor-toolbar-help-content-rereference-description' => 'Кхин тlе лело изза хьажориг', + 'wikieditor-toolbar-help-content-rereference-description' => 'Кхин тӀе лело изза хьажораг', 'wikieditor-toolbar-help-content-rereference-result' => "Агlонан йоза[1].", 'wikieditor-toolbar-help-content-showreferences-description' => 'Гайта билгалдаккхар', 'wikieditor-toolbar-help-content-showreferences-result' => "
      1. ^ Хьажориган йоза, кхин тlе дузуш йоза.
      ", @@ -5739,7 +5744,7 @@ $messages['co'] = array( 'wikieditor-toolbar-tool-heading-5' => 'Livellu 5', ); -/** Czech (česky) +/** Czech (čeština) * @author Jkjk * @author Kuvaly * @author Littledogboy @@ -5777,7 +5782,7 @@ $messages['cs'] = array( 'wikieditor-toolbar' => 'Editační panel nástrojů', 'wikieditor-toolbar-desc' => 'Editační panel nástrojů s vylepšenou použitelností', 'wikieditor-toolbar-preference' => 'Zapnout vylepšený panel nástrojů', - 'wikieditor-toolbar-dialogs-preference' => 'Používat dialogy pro vkládání odkazů, tabulek atd.', # Fuzzy + 'wikieditor-toolbar-dialogs-preference' => 'Používat průvodce pro vkládání odkazů a tabulek i pro funkci hledání a nahrazování.', 'wikieditor-toolbar-hidesig' => 'Skrýt tlačítko podpisu na stránkách v hlavním jmenném prostoru', 'wikieditor-toolbar-loading' => 'Načítá se…', 'wikieditor-toolbar-tool-bold' => 'Tučně', @@ -6048,7 +6053,7 @@ $messages['csb'] = array( 'wikieditor-toolbar-help-content-xlink-description' => 'Bùtnowé lënczi', ); -/** Church Slavic (словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) +/** Church Slavic (словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) * @author ОйЛ */ $messages['cu'] = array( @@ -6131,7 +6136,7 @@ $messages['cy'] = array( 'wikieditor-toolbar' => 'Bar offer golygu', 'wikieditor-toolbar-desc' => 'Bar offer y dudalen olygu gyda gwelliannau defnyddioldeb', 'wikieditor-toolbar-preference' => "Defnyddio'r bar offer golygu estynedig", - 'wikieditor-toolbar-dialogs-preference' => "Galluoger y dewin sy'n mewnosod cysylltau a thablau, ac sy'n gallu chwilio a disodli", + 'wikieditor-toolbar-dialogs-preference' => "Galluogi'r dewin sy'n mewnosod cysylltau a thablau, ac sy'n gallu chwilio a disodli", 'wikieditor-toolbar-hidesig' => "Cuddio'r botwm llofnodi rhag y tudalennau yn y prif barth", 'wikieditor-toolbar-loading' => "Wrthi'n llwytho...", 'wikieditor-toolbar-tool-bold' => 'Praff', @@ -6861,9 +6866,11 @@ $1:Beispiel.jpg|Beschreibung2', ); /** Swiss High German (Schweizer Hochdeutsch) + * @author Filzstift * @author Geitost */ $messages['de-ch'] = array( + 'wikieditor-toolbar-dialogs-preference' => 'Assistenten zum Einfügen von Links und Tabellen sowie die Funktion «Suchen und Ersetzen» aktivieren', 'wikieditor-toolbar-tool-reference-example' => 'Fussnotentext hier einfügen', 'wikieditor-toolbar-tool-big' => 'Gross', 'wikieditor-toolbar-tool-big-example' => 'Grosser Text', @@ -6892,6 +6899,7 @@ Möchten Sie daraus einen internen Link machen?', /** Zazaki (Zazaki) * @author Erdemaslancan * @author Gorizon + * @author Marmase * @author Mirzali * @author Xoser */ @@ -6909,7 +6917,7 @@ $messages['diq'] = array( 'wikieditor-previewDialog-loading' => 'Ho bar keno...', 'wikieditor-publish-preference' => 'Game be game çap kerdişi a bike', 'wikieditor-publish-button-publish' => 'Vıla ke', - 'wikieditor-publish-button-cancel' => 'Bıterkne', + 'wikieditor-publish-button-cancel' => 'Bıtexelne', 'wikieditor-publish-dialog-title' => '{{SITENAME}} rê çap ke', 'wikieditor-publish-dialog-summary' => 'Xulasayê vurnayişi (ser vurnayişê xo xulasa binuse):', 'wikieditor-publish-dialog-minor' => 'Vurnayişo qickek', @@ -6943,13 +6951,13 @@ $messages['diq'] = array( 'wikieditor-toolbar-tool-link-int' => 'yew pelê wiki re', 'wikieditor-toolbar-tool-link-int-target' => 'sernameyê peli', 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'Sernamey ya zi URL', - 'wikieditor-toolbar-tool-link-int-text' => 'metnê gıreyi', + 'wikieditor-toolbar-tool-link-int-text' => 'Metnê asnayışi:', 'wikieditor-toolbar-tool-link-int-text-tooltip' => 'Nuştewo ke gani bımocniyo ey bınuse', 'wikieditor-toolbar-tool-link-ext' => 'yew keyepelê teberi re', 'wikieditor-toolbar-tool-link-ext-target' => "Greyê URL'i:", 'wikieditor-toolbar-tool-link-ext-text' => 'Metnê gri:', 'wikieditor-toolbar-tool-link-insert' => 'Gıre bıerz', - 'wikieditor-toolbar-tool-link-cancel' => 'Bıterkne', + 'wikieditor-toolbar-tool-link-cancel' => 'Bıtexelne', 'wikieditor-toolbar-tool-link-int-target-status-exists' => 'pel esto', 'wikieditor-toolbar-tool-link-int-target-status-notexists' => 'pel çino', 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Sernameyo xırab.', @@ -6974,10 +6982,10 @@ $messages['diq'] = array( 'wikieditor-toolbar-file-format-none' => 'çıniyo', 'wikieditor-toolbar-tool-file-insert' => 'Têare ker', 'wikieditor-toolbar-tool-file-cancel' => 'Bıterkne', - 'wikieditor-toolbar-tool-reference' => 'çıme', + 'wikieditor-toolbar-tool-reference' => 'Referans', 'wikieditor-toolbar-tool-reference-example' => 'metnê notê bınini tiya kerê', 'wikieditor-toolbar-tool-reference-cancel' => 'Bıtexelne', - 'wikieditor-toolbar-tool-reference-title' => 'Referance de bike', + 'wikieditor-toolbar-tool-reference-title' => 'Referans dek', 'wikieditor-toolbar-tool-reference-insert' => 'de bike', 'wikieditor-toolbar-tool-reference-text' => 'Nusteyê Referansi', 'wikieditor-toolbar-tool-signature' => 'tamğayê imza ve zamani', @@ -6992,13 +7000,13 @@ $messages['diq'] = array( 'wikieditor-toolbar-group-format' => 'Format', 'wikieditor-toolbar-tool-ulist' => 'listeya maddeya işaretıni', 'wikieditor-toolbar-tool-ulist-example' => 'unsuro listeya maddeya işaretıni', - 'wikieditor-toolbar-tool-olist' => 'listeya numreyıni', + 'wikieditor-toolbar-tool-olist' => 'Listeya nımreyın', 'wikieditor-toolbar-tool-olist-example' => 'unsuro listeya numreyıni', 'wikieditor-toolbar-tool-indent' => 'Paragraf', 'wikieditor-toolbar-tool-indent-example' => 'Rêza paragrafi', 'wikieditor-toolbar-tool-nowiki' => 'Formetê wiki çıniyo', 'wikieditor-toolbar-tool-nowiki-example' => 'Ne-format nuşte itiya ra bıerz', - 'wikieditor-toolbar-tool-redirect' => 'Hetenayış', + 'wikieditor-toolbar-tool-redirect' => 'Serçarnayış', 'wikieditor-toolbar-tool-redirect-example' => 'Nameyê pele ke hedef biyo', 'wikieditor-toolbar-tool-big' => 'gırd', 'wikieditor-toolbar-tool-big-example' => 'metno gırd', @@ -7037,7 +7045,7 @@ $1:misal.jpg|nuşteyê resmi2', 'wikieditor-toolbar-tool-table-example' => 'metnê hucreyi', 'wikieditor-toolbar-tool-table-preview' => 'Verqayt', 'wikieditor-toolbar-tool-table-insert' => 'têare ker', - 'wikieditor-toolbar-tool-table-cancel' => 'Bıterkne', + 'wikieditor-toolbar-tool-table-cancel' => 'Bıtexelne', 'wikieditor-toolbar-tool-table-toomany' => '1000 hucrara ziyed tablo eştış pê no mesaj mumkın niyo', 'wikieditor-toolbar-tool-table-invalidnumber' => 'şıma pê yew amaro meqbul o satır u estun cı nêkewti', 'wikieditor-toolbar-tool-table-zero' => 'tablo ya ke tede satır u estun çinibo şıma nêşkeni têare bıkeri', @@ -7055,7 +7063,7 @@ $1:misal.jpg|nuşteyê resmi2', 'wikieditor-toolbar-tool-replace-success' => '$1 {{PLURAL:$1|yedeg|yedegi}} vıraziya.', 'wikieditor-toolbar-tool-replace-emptysearch' => 'şıma qey cıgêrayiş taway/çiyek nênuşt', 'wikieditor-toolbar-tool-replace-invalidregex' => 'ifadeya normal a ke şıma kwene cı meqbul niya: $1', - 'wikieditor-toolbar-section-characters' => 'karakterê xususiyî', + 'wikieditor-toolbar-section-characters' => 'Karakterê xısusiy', 'wikieditor-toolbar-characters-page-latin' => 'Latin', 'wikieditor-toolbar-characters-page-latinextended' => 'latinkiya hêrabiyaye', 'wikieditor-toolbar-characters-page-ipa' => 'IPA', @@ -7083,12 +7091,12 @@ $1:misal.jpg|nuşteyê resmi2', 'wikieditor-toolbar-help-heading-syntax' => 'o yo ke şıma nuşt', 'wikieditor-toolbar-help-heading-result' => 'o yo ke şıma gırewt', 'wikieditor-toolbar-help-page-format' => 'fesal dayiş/format', - 'wikieditor-toolbar-help-page-link' => 'gıreyi', + 'wikieditor-toolbar-help-page-link' => 'Gırey', 'wikieditor-toolbar-help-page-heading' => 'sernameyi', 'wikieditor-toolbar-help-page-list' => 'Listey', 'wikieditor-toolbar-help-page-file' => 'dosyayi', 'wikieditor-toolbar-help-page-reference' => 'Çımey', - 'wikieditor-toolbar-help-page-discussion' => 'werê-ameyiş/munaqeşa', + 'wikieditor-toolbar-help-page-discussion' => 'Werênayış', 'wikieditor-toolbar-help-content-italic-description' => 'italik', 'wikieditor-toolbar-help-content-italic-syntax' => "''metno italik''", 'wikieditor-toolbar-help-content-italic-result' => 'metno italik', @@ -7119,19 +7127,19 @@ $1:misal.jpg|nuşteyê resmi2', 'wikieditor-toolbar-help-content-ulist-description' => 'listeya işareti ya maddeyın', 'wikieditor-toolbar-help-content-ulist-syntax' => '* unsurê listeyi
      * unsurê listeyi', 'wikieditor-toolbar-help-content-ulist-result' => '
      • unsurê listeyi
      • unsurê listeyi
      ', - 'wikieditor-toolbar-help-content-olist-description' => 'listeya numreyın', + 'wikieditor-toolbar-help-content-olist-description' => 'Listeya nımreyın', 'wikieditor-toolbar-help-content-olist-syntax' => '# unsurê listeyi
      # unsurê listeyi', 'wikieditor-toolbar-help-content-olist-result' => '
      1. unsurê listeyi
      2. unsurê listeyi
      ', 'wikieditor-toolbar-help-content-file-description' => 'dosyaya weradaye/nımıte', 'wikieditor-toolbar-help-content-file-syntax' => '[[$1:Example.png|thumb|Nuşteyê resîmî]]', 'wikieditor-toolbar-help-content-file-result' => "
      metnê resmi
      ", - 'wikieditor-toolbar-help-content-reference-description' => 'çıme/referans', + 'wikieditor-toolbar-help-content-reference-description' => 'Referans', 'wikieditor-toolbar-help-content-reference-syntax' => 'metnê peli.<ref name="tesel kerdış/cerebnayiş">[http://www.misal.org metnê gıreyi], zeylê metni.</ref>', 'wikieditor-toolbar-help-content-reference-result' => "metnê peli.[1]", 'wikieditor-toolbar-help-content-rereference-description' => 'şuxulnayişê zeylê o çımeyi', 'wikieditor-toolbar-help-content-rereference-result' => "metnê peli.[1]", 'wikieditor-toolbar-help-content-showreferences-description' => 'çımeyi ramocın', - 'wikieditor-toolbar-help-content-showreferences-result' => "
      1. ^ metnê gıreyi, zeylê metni.
      ", + 'wikieditor-toolbar-help-content-showreferences-result' => "
      1. ^ metnê gırey, metno ilawe.
      ", 'wikieditor-toolbar-help-content-signaturetimestamp-description' => 'pê tamğayê zemani imza eştış', 'wikieditor-toolbar-help-content-signaturetimestamp-result' => "nameyê karberi (mesaj) 15:54, 10 Heziran 2009 (UTC)", 'wikieditor-toolbar-help-content-signature-description' => 'imza', @@ -7176,7 +7184,7 @@ $messages['dsb'] = array( 'wikieditor-toolbar' => 'Wobźěłowańska rědowa kšoma', 'wikieditor-toolbar-desc' => 'Rědowa kšoma za wobźěłowanje bokow z pólěpšoneju wužywajobnosću', 'wikieditor-toolbar-preference' => 'Pólěpšonu wobźěłowańsku rědowu kšomu aktiwěrowaś', - 'wikieditor-toolbar-dialogs-preference' => 'Dialogi za zasajźenje wótkazow, tabelow a hynakšego zmóžniś', # Fuzzy + 'wikieditor-toolbar-dialogs-preference' => 'Asistenty za zasajźenje wótkazow, tabelow a funkciju pytanja a wuměnjenja zmóžniś', 'wikieditor-toolbar-hidesig' => 'Pódpisowy tłočašk w bokach w głownem mjenjowem rumje schowaś', 'wikieditor-toolbar-loading' => 'Zacytujo se...', 'wikieditor-toolbar-tool-bold' => 'Tucny', @@ -7204,6 +7212,7 @@ $messages['dsb'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Njepłaśiwy titel', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Eksterny wótkaz', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'Eksistenca boka se pśekontrolěrujo...', + 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'Bok wěcejzmysłowosći', 'wikieditor-toolbar-tool-link-int-invalid' => 'Titel, kótaryž sy pódał, jo njepłaśiwy.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'URL, kótaryž sy pódał, wuglěda, ako by był za wótkaz k drugemu wikibokoju. Coš jen do internego wótkaza psétwóriś?', @@ -8463,7 +8472,7 @@ $messages['eu'] = array( 'wikieditor-toolbar-tool-xlink-example' => 'http://www.adibidea.com loturaren izenburua', 'wikieditor-toolbar-tool-link' => 'Lotura', 'wikieditor-toolbar-tool-link-title' => 'Sartu lotura', - 'wikieditor-toolbar-tool-link-int' => 'Wiki orrialde batera', + 'wikieditor-toolbar-tool-link-int' => 'Wiki orri batera', 'wikieditor-toolbar-tool-link-int-target' => 'Orrialdearen izenburua:', 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'Orriaren izenburua edo URL', 'wikieditor-toolbar-tool-link-int-text' => 'Lotutako testua:', @@ -8665,7 +8674,7 @@ $messages['fa'] = array( 'wikieditor' => 'رابط ویرایش پیشرفته ویکی‌متن', 'wikieditor-desc' => 'یک رابط ویرایش پیشرفته ویکی‌متن و چندین پودمان دارای قابلیت فراهم می‌کند', 'wikieditor-wikitext-tab' => 'ویکی‌متن', - 'wikieditor-loading' => 'در حال بارگیری', + 'wikieditor-loading' => 'در حال بارگیری...', 'wikieditor-preview-preference' => 'فعال‌سازی پیش‌نمایش کنار یک دیگر', 'wikieditor-preview-tab' => 'پیش‌نمایش', 'wikieditor-preview-changes-tab' => 'تغییرها', @@ -8721,7 +8730,7 @@ $messages['fa'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'عنوان نادرست', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'پیوند به بیرون', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'بررسی وجود داشتن صفحه...', - 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'صفحهٔ ابهام‌زدائی', + 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'صفحهٔ ابهام‌زدایی', 'wikieditor-toolbar-tool-link-int-invalid' => 'عنوان تعیین‌شده نامعتبر است.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'نشانی اینترنتی که وارد کردید به شکلی است که نمایانگر یک پیوند به صفحه‌ای داخل ویکی است. آیا می‌خواهید آن را به یک پیوند داخلی تبدیل کنید؟', 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'پیوند داخلی', @@ -8914,6 +8923,7 @@ $1:مثال.jpg|عنوان ۲', * @author Nedergard * @author Nike * @author Olli + * @author Pxos * @author Silvonen * @author Str4nd * @author Stryn @@ -8980,6 +8990,7 @@ $messages['fi'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Virheellinen otsikko', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Ulkoinen linkki', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'Tarkastetaan sivun olemassaolo…', + 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'Täsmennyssivu', 'wikieditor-toolbar-tool-link-int-invalid' => 'Antamasi otsikko on virheellinen.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'URL-osoite, jonka annoit näyttää siltä kuin se olisi linkki toiselle wikisivulle. Haluatko tehdä siitä sisäisen linkin?', @@ -9698,9 +9709,75 @@ $messages['fur'] = array( ); /** Western Frisian (Frysk) + * @author Kening Aldgilles */ $messages['fy'] = array( + 'wikieditor-publish-button-cancel' => 'Ofbrekke', + 'wikieditor-template-editor-dialog-cancel' => 'Ofbrekke', + 'wikieditor-toc-show' => 'Ynhâld sjen litte', + 'wikieditor-toc-hide' => 'Ynhâld ferbergje', + 'wikieditor-toolbar' => 'Bewurkingsbalke', + 'wikieditor-toolbar-tool-link-title' => 'Keppeling ynfoegje', + 'wikieditor-toolbar-tool-link-insert' => 'Keppeling ynfoegje', 'wikieditor-toolbar-tool-link-cancel' => 'Ofbrekke', + 'wikieditor-toolbar-tool-file-example' => 'Eksimpel.jpg', + 'wikieditor-toolbar-tool-file-title' => 'Bestân ynfoegje', + 'wikieditor-toolbar-file-size' => 'Grutte:', + 'wikieditor-toolbar-file-default' => '(standert)', + 'wikieditor-toolbar-file-format-none' => 'gjin', + 'wikieditor-toolbar-tool-file-insert' => 'Ynfoegje', + 'wikieditor-toolbar-tool-file-cancel' => 'Ofbrekke', + 'wikieditor-toolbar-tool-reference' => 'Referinsje', + 'wikieditor-toolbar-tool-reference-example' => 'Foettekst hjir ynfoegje', + 'wikieditor-toolbar-tool-reference-cancel' => 'Ofbrekke', + 'wikieditor-toolbar-tool-reference-title' => 'Referinsje ynfoegje', + 'wikieditor-toolbar-tool-reference-insert' => 'Ynfoegje', + 'wikieditor-toolbar-tool-reference-text' => 'Referinsjetekst', + 'wikieditor-toolbar-tool-heading-1' => 'Nivo 1', + 'wikieditor-toolbar-tool-heading-2' => 'Nivo 2', + 'wikieditor-toolbar-tool-heading-3' => 'Nivo 3', + 'wikieditor-toolbar-tool-heading-4' => 'Nivo 4', + 'wikieditor-toolbar-tool-heading-5' => 'Nivo 5', + 'wikieditor-toolbar-tool-heading-example' => 'Koptekst', + 'wikieditor-toolbar-tool-ulist' => 'List sûnder nûmers', + 'wikieditor-toolbar-tool-olist' => 'List mei nûmers', + 'wikieditor-toolbar-group-insert' => 'Ynfoegje', + 'wikieditor-toolbar-tool-table-title' => 'Tabel ynfoegje', + 'wikieditor-toolbar-tool-table-dimensions-rows' => 'Rigen', + 'wikieditor-toolbar-tool-table-dimensions-columns' => 'Kolommen', + 'wikieditor-toolbar-tool-table-dimensions-header' => 'Koprigel ynfoegje', + 'wikieditor-toolbar-tool-table-example' => 'Eksimpel', + 'wikieditor-toolbar-tool-table-insert' => 'Ynfoegje', + 'wikieditor-toolbar-tool-table-cancel' => 'Ofbrekke', + 'wikieditor-toolbar-tool-replace-search' => 'Sykje op:', + 'wikieditor-toolbar-tool-replace-replace' => 'Ferfange mei:', + 'wikieditor-toolbar-section-characters' => 'Spesjale tekens', + 'wikieditor-toolbar-characters-page-latin' => 'Latyn', + 'wikieditor-toolbar-help-page-reference' => 'Referinsjes', + 'wikieditor-toolbar-help-page-discussion' => 'Oerlis', + 'wikieditor-toolbar-help-content-italic-description' => 'Kursyf', + 'wikieditor-toolbar-help-content-italic-syntax' => "''Kursive tekst''", + 'wikieditor-toolbar-help-content-italic-result' => 'Kursive tekst', + 'wikieditor-toolbar-help-content-bold-description' => 'Fet', + 'wikieditor-toolbar-help-content-bold-syntax' => "'''Fette tekst'''", + 'wikieditor-toolbar-help-content-bold-result' => 'Fette tekst', + 'wikieditor-toolbar-help-content-bolditalic-description' => 'Fet & kursyf', + 'wikieditor-toolbar-help-content-bolditalic-syntax' => "'''''Fette & kursive tekst'''''", + 'wikieditor-toolbar-help-content-bolditalic-result' => 'Fette & kursive tekst', + 'wikieditor-toolbar-help-content-ilink-description' => 'Ynterne ferwizing', + 'wikieditor-toolbar-help-content-xlink-description' => 'Eksterne ferwizing', + 'wikieditor-toolbar-help-content-heading2-syntax' => '== Koptekst ==', + 'wikieditor-toolbar-help-content-heading2-result' => '

      Koptekst

      ', + 'wikieditor-toolbar-help-content-heading3-description' => 'Lytse kop tredde nivo', + 'wikieditor-toolbar-help-content-heading3-syntax' => '== Koptekst ==', + 'wikieditor-toolbar-help-content-heading3-result' => '

      Koptekst

      ', + 'wikieditor-toolbar-help-content-heading4-description' => 'Lytse kop fjirde nivo', + 'wikieditor-toolbar-help-content-heading4-syntax' => '== Koptekst ==', + 'wikieditor-toolbar-help-content-heading4-result' => '

      Koptekst

      ', + 'wikieditor-toolbar-help-content-heading5-description' => 'Lytse kop fyfte nivo', + 'wikieditor-toolbar-help-content-heading5-syntax' => '== Koptekst ==', + 'wikieditor-toolbar-help-content-heading5-result' => '
      Koptekst
      ', + 'wikieditor-toolbar-help-content-ulist-description' => 'List sûnder nûmers', ); /** Irish (Gaeilge) @@ -9731,6 +9808,7 @@ $messages['ga'] = array( /** Scottish Gaelic (Gàidhlig) * @author Akerbeltz + * @author Shirayuki */ $messages['gd'] = array( 'wikieditor' => 'Eadar-aghaidh deasachadh wikitext adhartach', @@ -9764,7 +9842,7 @@ $messages['gd'] = array( 'wikieditor-toolbar' => 'Am bàr-inneil deasachaidh', 'wikieditor-toolbar-desc' => 'Am bàr-inneil deasachaidh le comasan a bharrachd', 'wikieditor-toolbar-preference' => 'Cuir am bàr-inneil le comasan a bharrachd an comas', - 'wikieditor-toolbar-dialogs-preference' => 'Cuir an comas na còmhraidhean airson ceanglaichean, clàir is rudan eile a chur a-steach', # Fuzzy + 'wikieditor-toolbar-dialogs-preference' => 'Cuir an comas na draoidhean airson ceanglaichean, clàran agus am foincsean airson lorg a dhèanamh no rudan a chur an àite rudan eile', 'wikieditor-toolbar-loading' => "'Ga luchdadh...", 'wikieditor-toolbar-tool-bold' => 'Trom', 'wikieditor-toolbar-tool-bold-example' => 'Teacs trom', @@ -11424,7 +11502,7 @@ $1:उदाहरण.jpg|चित्रशीर्षक२', 'wikieditor-toolbar-tool-replace-close' => 'बंद करें', 'wikieditor-toolbar-tool-replace-nomatch' => 'आपके खोज कुछ मिला नहीं', 'wikieditor-toolbar-tool-replace-success' => '$1 प्रतिस्थापन बनें ।', # Fuzzy - 'wikieditor-toolbar-section-characters' => 'विशेष वर्ण', + 'wikieditor-toolbar-section-characters' => 'विशेष अक्षर', 'wikieditor-toolbar-characters-page-latin' => 'लाटिन', 'wikieditor-toolbar-characters-page-latinextended' => 'लाटिन विस्तारित', 'wikieditor-toolbar-characters-page-ipa' => 'आइपीए', @@ -11517,6 +11595,7 @@ $messages['hif-latn'] = array( /** Croatian (hrvatski) * @author Bugoslav + * @author Eleassar * @author Ex13 * @author Excaliboor * @author MaGa @@ -11538,7 +11617,7 @@ $messages['hr'] = array( 'wikieditor-publish-preference' => 'Omogućiti korak-po-korak izdavanje', 'wikieditor-publish-button-publish' => 'Objaviti', 'wikieditor-publish-button-cancel' => 'Odustani', - 'wikieditor-publish-dialog-title' => 'Objavi na {{SITENAME}}', + 'wikieditor-publish-dialog-title' => 'Objavi na {{GRAMMAR:dajalnik|{{SITENAME}}}}', 'wikieditor-publish-dialog-summary' => 'Uredi sažetak (kratko opišite promjene koje ste učinili):', 'wikieditor-publish-dialog-minor' => 'Manja promjena', 'wikieditor-publish-dialog-watch' => 'Prati ovu stranicu', @@ -11786,7 +11865,7 @@ $messages['hsb'] = array( 'wikieditor-toolbar' => 'Gratowa lajsta za wobdźěłowanje', 'wikieditor-toolbar-desc' => 'Gratowa lajsta za wobdźěłowanje stronow z polěpšenej wužiwajomnosću', 'wikieditor-toolbar-preference' => 'Polěpšenu gratowu lajstu za wobdźěłowanje aktiwizować', - 'wikieditor-toolbar-dialogs-preference' => 'Dialogi za zasunjenje wotkazow, tabelow a hinašeho zmóžnić', # Fuzzy + 'wikieditor-toolbar-dialogs-preference' => 'Asistenty za zasadźenje wotkazow, tabelow a funkciju pytanja a wuměnjenja zmóžnić', 'wikieditor-toolbar-hidesig' => 'Podpisowe tłóčatko w stronach we hłownym mjenowym rumje schować', 'wikieditor-toolbar-loading' => 'Čita so...', 'wikieditor-toolbar-tool-bold' => 'Tučny', @@ -11814,6 +11893,7 @@ $messages['hsb'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Njepłaćiwy titul', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Eksterny wotkaz', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'Eksistenca strony so přepruwuje...', + 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'Strona wjacewoznamowosće', 'wikieditor-toolbar-tool-link-int-invalid' => 'Titul, kotryž sy podał, je njepłaćiwy.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'URL, kotryž sy podał, wupada kaž by jako wotkaz k druhej wikistronje měrjeny był. Chceš jón do interneho wotkaza přetworić?', @@ -12527,7 +12607,7 @@ $messages['ia'] = array( 'wikieditor-toolbar' => 'Instrumentario de modification', 'wikieditor-toolbar-desc' => 'Barra con instrumentos de modification con augmento de usabilitate', 'wikieditor-toolbar-preference' => 'Activar le instrumentario de modification meliorate', - 'wikieditor-toolbar-dialogs-preference' => 'Activar dialogos pro inserer ligamines, tabulas e plus', # Fuzzy + 'wikieditor-toolbar-dialogs-preference' => 'Activar dialogos pro inserer ligamines, tabellas e le function de cercar e reimplaciar', 'wikieditor-toolbar-hidesig' => 'Celar le button de signatura in paginas in le spatio de nomines principal', 'wikieditor-toolbar-loading' => 'Cargamento in curso…', 'wikieditor-toolbar-tool-bold' => 'Grasse', @@ -12555,6 +12635,7 @@ $messages['ia'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Titulo invalide', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Ligamine externe', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'Verifica existentia del pagina...', + 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'Pagina de disambiguation', 'wikieditor-toolbar-tool-link-int-invalid' => 'Le titulo que tu specificava es invalide.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'Le URL que tu specificava pare esser intendite como ligamine a un altere pagina wiki. Vole tu facer lo un ligamine interne?', @@ -12570,6 +12651,7 @@ Vole tu facer lo un ligamine interne?', 'wikieditor-toolbar-file-float' => 'Alineamento:', 'wikieditor-toolbar-file-default' => '(predefinition)', 'wikieditor-toolbar-file-format' => 'Formato:', + 'wikieditor-toolbar-file-format-none' => 'nulle', 'wikieditor-toolbar-tool-file-insert' => 'Inserer', 'wikieditor-toolbar-tool-file-cancel' => 'Cancellar', 'wikieditor-toolbar-tool-reference' => 'Referentia', @@ -12636,9 +12718,9 @@ $1:Exemplo.jpg|Legenda2', 'wikieditor-toolbar-tool-table-preview' => 'Previsualisation', 'wikieditor-toolbar-tool-table-insert' => 'Inserer', 'wikieditor-toolbar-tool-table-cancel' => 'Cancellar', - 'wikieditor-toolbar-tool-table-toomany' => 'Inserer un tabula con plus de $1 cellulas non es possibile con iste dialogo.', # Fuzzy + 'wikieditor-toolbar-tool-table-toomany' => 'Inserer un tabella con plus de 1000 cellulas non es possibile con iste dialogo.', 'wikieditor-toolbar-tool-table-invalidnumber' => 'Tu non ha entrate un numero valide de lineas o columnas.', - 'wikieditor-toolbar-tool-table-zero' => 'Tu non pote inserer un tabula con zero lineas o columnas.', + 'wikieditor-toolbar-tool-table-zero' => 'Tu non pote inserer un tabella con zero lineas o columnas.', 'wikieditor-toolbar-tool-replace' => 'Cercar e reimplaciar', 'wikieditor-toolbar-tool-replace-title' => 'Cercar e reimplaciar', 'wikieditor-toolbar-tool-replace-search' => 'Cercar:', @@ -12650,7 +12732,7 @@ $1:Exemplo.jpg|Legenda2', 'wikieditor-toolbar-tool-replace-button-replaceall' => 'Reimplaciar toto', 'wikieditor-toolbar-tool-replace-close' => 'Clauder', 'wikieditor-toolbar-tool-replace-nomatch' => 'Tu recerca non ha producite resultatos.', - 'wikieditor-toolbar-tool-replace-success' => '$1 reimplaciamentos facite.', # Fuzzy + 'wikieditor-toolbar-tool-replace-success' => '$1 {{PLURAL:$1|reimplaciamento|reimplaciamentos}} facite.', 'wikieditor-toolbar-tool-replace-emptysearch' => 'Tu non entrava texto a cercar.', 'wikieditor-toolbar-tool-replace-invalidregex' => 'Le expression regular que tu entrava es invalide: $1', 'wikieditor-toolbar-section-characters' => 'Characteres special', @@ -12673,6 +12755,7 @@ $1:Exemplo.jpg|Legenda2', 'wikieditor-toolbar-characters-page-thai' => 'Thailandese', 'wikieditor-toolbar-characters-page-lao' => 'Laotiano', 'wikieditor-toolbar-characters-page-khmer' => 'Cambodgiano', + 'wikieditor-toolbar-characters-minus' => 'signo minus', 'wikieditor-toolbar-section-help' => 'Adjuta', 'wikieditor-toolbar-help-heading-description' => 'Description', 'wikieditor-toolbar-help-heading-syntax' => 'Entrata', @@ -13655,6 +13738,7 @@ $1:Example.jpg|Myndlýsing2', * @author Beta16 * @author Darth Kule * @author F. Cosoleto + * @author FRacco * @author Gianfranco * @author Gliu * @author McDutchie @@ -13694,7 +13778,7 @@ $messages['it'] = array( 'wikieditor-toc-hide' => 'Nascondi i contenuti', 'wikieditor-toolbar' => 'Barra degli strumenti di modifica', 'wikieditor-toolbar-desc' => 'Barra degli strumenti di modifica della pagina con migliorata usabilità', - 'wikieditor-toolbar-preference' => 'Abilita barra degli strumenti di modifica avanzata', + 'wikieditor-toolbar-preference' => 'Abilita la barra degli strumenti di modifica avanzata', 'wikieditor-toolbar-dialogs-preference' => "Abilita le finestre per l'inserimento di collegamenti, tabelle e la funzione di cerca e sostituisci", 'wikieditor-toolbar-hidesig' => 'Nasconde il pulsante della firma dalle pagine nel namespace principale', 'wikieditor-toolbar-loading' => 'Caricamento in corso...', @@ -15162,6 +15246,7 @@ $messages['kn'] = array( * @author Kwj2772 * @author LFM * @author Mintz0223 + * @author Priviet * @author 관인생략 * @author 아라 */ @@ -15213,8 +15298,8 @@ $messages['ko'] = array( 'wikieditor-toolbar-tool-link-int' => '위키 문서로 연결', 'wikieditor-toolbar-tool-link-int-target' => '대상 문서 또는 URL:', 'wikieditor-toolbar-tool-link-int-target-tooltip' => '문서 제목 또는 URL', - 'wikieditor-toolbar-tool-link-int-text' => '링크에 보여지는 글:', - 'wikieditor-toolbar-tool-link-int-text-tooltip' => '문서에 보여지는 글', + 'wikieditor-toolbar-tool-link-int-text' => '링크에 보이는 글:', + 'wikieditor-toolbar-tool-link-int-text-tooltip' => '문서에 보이는 글', 'wikieditor-toolbar-tool-link-ext' => '바깥 웹 페이지로 연결', 'wikieditor-toolbar-tool-link-ext-target' => '링크 URL:', 'wikieditor-toolbar-tool-link-ext-text' => '링크 텍스트:', @@ -15239,7 +15324,7 @@ $messages['ko'] = array( 'wikieditor-toolbar-file-caption' => '설명:', 'wikieditor-toolbar-file-size' => '크기:', 'wikieditor-toolbar-file-float' => '정렬:', - 'wikieditor-toolbar-file-default' => '(기본값)', + 'wikieditor-toolbar-file-default' => '(기본 값)', 'wikieditor-toolbar-file-format' => '형식:', 'wikieditor-toolbar-file-format-none' => '없음', 'wikieditor-toolbar-tool-file-insert' => '넣기', @@ -15313,7 +15398,7 @@ $1:Example.jpg|설명2', 'wikieditor-toolbar-tool-table-zero' => '행이나 열의 개수가 0인 표를 넣을 수 없습니다.', 'wikieditor-toolbar-tool-replace' => '찾아 바꾸기', 'wikieditor-toolbar-tool-replace-title' => '찾아 바꾸기', - 'wikieditor-toolbar-tool-replace-search' => '찾기:', + 'wikieditor-toolbar-tool-replace-search' => '찾을 대상:', 'wikieditor-toolbar-tool-replace-replace' => '바꾸기:', 'wikieditor-toolbar-tool-replace-case' => '대소문자를 구별', 'wikieditor-toolbar-tool-replace-regex' => '찾을 문자열에 정규 표현식을 적용', @@ -16468,6 +16553,8 @@ $1:Exemplum.jpg|Descriptio 2', 'wikieditor-toolbar-characters-page-telugu' => 'Telugu', 'wikieditor-toolbar-section-help' => 'Adiutatum', 'wikieditor-toolbar-help-heading-description' => 'Descriptio', + 'wikieditor-toolbar-help-heading-syntax' => 'Quod scribis', + 'wikieditor-toolbar-help-heading-result' => 'Quod accipies', 'wikieditor-toolbar-help-page-format' => 'Formatio', 'wikieditor-toolbar-help-page-link' => 'Nexus', 'wikieditor-toolbar-help-page-heading' => 'Tituli', @@ -16490,17 +16577,47 @@ $1:Exemplum.jpg|Descriptio 2', 'wikieditor-toolbar-help-content-xlink-description' => 'Nexus externus', 'wikieditor-toolbar-help-content-xlink-syntax' => '[http://www.example.org Titulus nexus]
      [http://www.example.org]
      http://www.example.org', 'wikieditor-toolbar-help-content-xlink-result' => "Titulus nexus
      [1]
      http://www.example.org", + 'wikieditor-toolbar-help-content-heading2-description' => 'Secundi ordinis titulus', + 'wikieditor-toolbar-help-content-heading2-syntax' => '== Textus tituli ==', + 'wikieditor-toolbar-help-content-heading2-result' => '

      Textus tituli

      ', + 'wikieditor-toolbar-help-content-heading3-description' => 'Tertii ordinis titulus', + 'wikieditor-toolbar-help-content-heading3-syntax' => '=== Textus tituli ===', + 'wikieditor-toolbar-help-content-heading3-result' => '

      Textus tituli

      ', + 'wikieditor-toolbar-help-content-heading4-description' => 'Quarti ordinis titulus', + 'wikieditor-toolbar-help-content-heading4-syntax' => '==== Textus tituli ====', + 'wikieditor-toolbar-help-content-heading4-result' => '

      Textus tituli

      ', + 'wikieditor-toolbar-help-content-heading5-description' => 'Quinti ordinis titulus', + 'wikieditor-toolbar-help-content-heading5-syntax' => '===== Textus tituli =====', + 'wikieditor-toolbar-help-content-heading5-result' => '
      Textus tituli
      ', + 'wikieditor-toolbar-help-content-ulist-description' => 'Index globosus', + 'wikieditor-toolbar-help-content-ulist-syntax' => '* Res indicata
      * Res indicata', + 'wikieditor-toolbar-help-content-ulist-result' => '
      • Res indicata
      • Res indicata
      ', 'wikieditor-toolbar-help-content-file-description' => 'Fasciculus in pagina impositus', 'wikieditor-toolbar-help-content-file-syntax' => '[[$1:Exemplum.png|thumb|Descriptio fasciculi]]', # Fuzzy 'wikieditor-toolbar-help-content-file-result' => "
      Descriptio fasciculi
      ", 'wikieditor-toolbar-help-content-reference-description' => 'Referentia bibliographica', + 'wikieditor-toolbar-help-content-reference-syntax' => 'Textus paginae.<ref name="test">[http://www.example.org Textus nexus], textus additus.</ref>', + 'wikieditor-toolbar-help-content-reference-result' => "Textus paginae.[1]", + 'wikieditor-toolbar-help-content-rereference-description' => 'Eiusdem referentiae usus additus', + 'wikieditor-toolbar-help-content-rereference-result' => "Textus paginae.[1]", 'wikieditor-toolbar-help-content-showreferences-description' => 'Referentias bibliographicas monstrare', + 'wikieditor-toolbar-help-content-showreferences-result' => "
      1. ^ Textus nexus, textus additus.
      ", 'wikieditor-toolbar-help-content-signaturetimestamp-description' => 'Subscriptio tua cum indicatione temporis', 'wikieditor-toolbar-help-content-signaturetimestamp-result' => "Nomen usoris (disputatio) 15:54, 10 Iunii 2009 (UTC)", 'wikieditor-toolbar-help-content-signature-description' => 'Subscriptio', 'wikieditor-toolbar-help-content-signature-result' => "Nomen usoris (disputatio)", ); +/** Ladino (Ladino) + * @author Menachem.Moreira + */ +$messages['lad'] = array( + 'wikieditor-wikitext-tab' => 'Vikiteksto', + 'wikieditor-publish-button-publish' => 'Publikar', + 'wikieditor-publish-dialog-title' => 'Publikar a {{SITENAME}}', + 'wikieditor-publish-dialog-publish' => 'Publikar', +); + /** Luxembourgish (Lëtzebuergesch) * @author Robby * @author Soued031 @@ -16537,7 +16654,7 @@ $messages['lb'] = array( 'wikieditor-toolbar' => 'Toolbar änneren', 'wikieditor-toolbar-desc' => 'Toolbar vun de Säitenännerunge mat erweiderter Benotzerfrëndlechkeet', 'wikieditor-toolbar-preference' => 'Déi erweidert Ännerungs-Toolbar aktivéieren', - 'wikieditor-toolbar-dialogs-preference' => "Assistene fir d'Drasetze vu Linken, Tabellen genee esou wéi d'Funktioun 'sichen an ersetzen' aschalten", + 'wikieditor-toolbar-dialogs-preference' => "Assistente fir d'Drasetze vu Linken, Tabellen genee sou wéi d'Funktioun 'sichen an ersetzen' aschalten", 'wikieditor-toolbar-hidesig' => 'Den Ënnerschrëftsknäppchen op Säiten am Haaptnummraum verstoppen', 'wikieditor-toolbar-loading' => 'Lueden...', 'wikieditor-toolbar-tool-bold' => 'Fettgedréckt', @@ -17004,6 +17121,7 @@ $1:Veurbeildj2|Biesjrif2', ); /** لوری (لوری) + * @author Bonevarluri * @author Mogoeilor */ $messages['lrc'] = array( @@ -17040,6 +17158,8 @@ $messages['lrc'] = array( 'wikieditor-toolbar-tool-link' => 'ديس ون', 'wikieditor-toolbar-tool-link-int' => 'سی ويكی بلگه', 'wikieditor-toolbar-tool-link-cancel' => 'رد كردن', + 'wikieditor-toolbar-tool-link-int-target-status-notexists' => 'بلگه نیئش', + 'wikieditor-toolbar-tool-file-title' => 'نیائن جانیا', 'wikieditor-toolbar-file-size' => 'انازه', 'wikieditor-toolbar-file-float' => 'د راست چيين', 'wikieditor-toolbar-file-default' => 'پيش فرض', @@ -17051,14 +17171,27 @@ $messages['lrc'] = array( 'wikieditor-toolbar-tool-reference-cancel' => 'رد كردن', 'wikieditor-toolbar-tool-reference-title' => 'دائن سرچشمه', 'wikieditor-toolbar-tool-reference-insert' => 'دائن', + 'wikieditor-toolbar-tool-signature' => 'امضا و دیسمن وخت', 'wikieditor-toolbar-section-advanced' => 'پيشرفته', 'wikieditor-toolbar-tool-heading' => 'سربلگه', + 'wikieditor-toolbar-tool-heading-1' => 'ریتراز1', + 'wikieditor-toolbar-tool-heading-3' => 'ریتراز3', + 'wikieditor-toolbar-tool-heading-5' => 'ریتراز5', + 'wikieditor-toolbar-tool-ulist' => 'نوم گه توپر بیه', + 'wikieditor-toolbar-tool-olist' => 'نوم گه شماره دار', + 'wikieditor-toolbar-tool-redirect-example' => 'نوم بلگه حاستنی', 'wikieditor-toolbar-tool-small' => 'كؤچك', 'wikieditor-toolbar-tool-small-example' => 'متن كؤچك', 'wikieditor-toolbar-group-insert' => 'دائن', + 'wikieditor-toolbar-tool-gallery' => 'عسگدونی', 'wikieditor-toolbar-tool-newline' => 'خط تازه', 'wikieditor-toolbar-tool-table' => 'جعوه', + 'wikieditor-toolbar-tool-replace' => 'بگرد و جاگزین کو', + 'wikieditor-toolbar-tool-replace-title' => 'بگرد و جاگزین کو', + 'wikieditor-toolbar-tool-replace-search' => 'پی جوری سی', + 'wikieditor-toolbar-tool-replace-button-findnext' => 'نهایی نه پیدا کو', 'wikieditor-toolbar-tool-replace-close' => 'بسن', + 'wikieditor-toolbar-tool-replace-emptysearch' => 'شما سی پی جوری هیچی وارد نکردیته.', 'wikieditor-toolbar-characters-page-latin' => 'لاتين', 'wikieditor-toolbar-characters-page-symbols' => 'نماديا', 'wikieditor-toolbar-characters-page-greek' => 'هلنی', @@ -17076,7 +17209,20 @@ $messages['lrc'] = array( 'wikieditor-toolbar-characters-page-lao' => 'لائو', 'wikieditor-toolbar-characters-page-khmer' => 'خمر', 'wikieditor-toolbar-section-help' => 'هومياری', + 'wikieditor-toolbar-help-page-list' => 'نوم گه یا', + 'wikieditor-toolbar-help-page-file' => 'جانیایا', 'wikieditor-toolbar-help-page-discussion' => 'گپ', + 'wikieditor-toolbar-help-content-heading2-description' => 'دوئمی ریتراز سرون', + 'wikieditor-toolbar-help-content-heading3-description' => 'سئمین ریتراز سرون', + 'wikieditor-toolbar-help-content-heading4-description' => 'چئارمی ریتراز سرون', + 'wikieditor-toolbar-help-content-heading5-description' => 'پنجمین ریتراز سرون', + 'wikieditor-toolbar-help-content-ulist-description' => 'نوم گه توپر بیه', + 'wikieditor-toolbar-help-content-ulist-syntax' => '* قلم نوم گه
      * قلم نوم گه', + 'wikieditor-toolbar-help-content-ulist-result' => '
      • قلم نوم گه
      • قلم نوم گه
      ', + 'wikieditor-toolbar-help-content-olist-syntax' => '# قلم نوم گه
      * قلم نوم گه', + 'wikieditor-toolbar-help-content-olist-result' => '
      • قلم نوم گه
      • قلم نوم گه
      ', + 'wikieditor-toolbar-help-content-signaturetimestamp-description' => 'امضا و دیسمن وخت', + 'wikieditor-toolbar-help-content-signature-description' => 'امضا', 'wikieditor-toolbar-help-content-indent-description' => 'مئن رئته', ); @@ -18603,22 +18749,22 @@ $messages['mr'] = array( 'wikieditor' => 'विकिमजकूर संपादनाची विकसित सुविधा', 'wikieditor-desc' => 'विस्तारणीय विकिमजकुर संपादन आंतरपृष्ठ (इंटरफेस) आणि बर्‍याच वैशिष्ट्यपूर्ण निश्चयिका (मॊड्यूल्स) पुरवते', 'wikieditor-wikitext-tab' => 'विकिमजकूर', - 'wikieditor-loading' => 'चढवत आहे…', + 'wikieditor-loading' => 'प्रभारण करीत आहे', 'wikieditor-preview-preference' => 'सोबतच आजु-बाजूस दिसणारी झलक शक्य करा.', 'wikieditor-preview-tab' => 'झलक', 'wikieditor-preview-changes-tab' => 'बदल', - 'wikieditor-preview-loading' => 'चढवत आहे…', + 'wikieditor-preview-loading' => 'प्रभारण करीत आहे', 'wikieditor-previewDialog-preference' => '"झलक पहा" चौकट सक्षम करा', 'wikieditor-previewDialog-tab' => 'झलक पहा', - 'wikieditor-previewDialog-loading' => 'चढवत आहे…', + 'wikieditor-previewDialog-loading' => 'प्रभारण करीत आहे', 'wikieditor-publish-preference' => 'टप्प्या-टप्प्याने प्रकाशन शक्य करा', 'wikieditor-publish-button-publish' => 'प्रकाशित करा दाखवा', 'wikieditor-publish-button-cancel' => 'रद्द करा', 'wikieditor-publish-dialog-title' => '{{संकेतस्थळनाव}} येथे प्रदर्शित करा', - 'wikieditor-publish-dialog-summary' => 'बदलांचा आढावा :(आपण केलेल्या बदलांचे थोडक्यात वर्णन करा.)', + 'wikieditor-publish-dialog-summary' => 'बदलांचा सारांश :(आपण केलेल्या बदलांचे थोडक्यात वर्णन करा):', 'wikieditor-publish-dialog-minor' => 'छोटा बदल', - 'wikieditor-publish-dialog-watch' => 'या पानावर बदलांसाठी लक्ष ठेवा', + 'wikieditor-publish-dialog-watch' => 'पान निरीक्षणांतर्गत ठेवा', 'wikieditor-publish-dialog-publish' => 'प्रकाशित करा', 'wikieditor-publish-dialog-goback' => 'मागे जा', 'wikieditor-template-editor-preference' => 'विकि साच्यांची नमुना संपादन सक्षम करा', @@ -18635,11 +18781,11 @@ $messages['mr'] = array( 'wikieditor-toolbar-preference' => 'वर्धित संपादन साधनपट्टी सक्षम करा', 'wikieditor-toolbar-dialogs-preference' => 'दुवे, सारण्या (टेबल) आणि इतर भरण्याकरिता dialogs सक्षम करा', # Fuzzy 'wikieditor-toolbar-hidesig' => 'मुख्य नामविश्वातील पानांपासून स्वाक्षरीची कळ लपवा', - 'wikieditor-toolbar-loading' => 'चढवत आहे…', + 'wikieditor-toolbar-loading' => 'प्रभारण करीत आहे', 'wikieditor-toolbar-tool-bold' => 'ठळक', 'wikieditor-toolbar-tool-bold-example' => 'ठळक मजकूर', 'wikieditor-toolbar-tool-italic' => 'तिरपी मुद्राक्षरे', - 'wikieditor-toolbar-tool-italic-example' => 'तिरपी मुद्राक्षरे', + 'wikieditor-toolbar-tool-italic-example' => 'तिरप्या मुद्राक्षरातील मजकूर', 'wikieditor-toolbar-tool-ilink' => 'अंतर्गत दुवा', 'wikieditor-toolbar-tool-ilink-example' => 'शीर्षकास दुवा द्या', 'wikieditor-toolbar-tool-xlink' => 'बाह्य दुव्यात (http:// हा उपसर्ग विसरू नका)', @@ -18660,7 +18806,8 @@ $messages['mr'] = array( 'wikieditor-toolbar-tool-link-int-target-status-notexists' => 'पान अस्तित्वात नाही', 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'अग्राह्य शीर्षक', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'बाह्य दुवा', - 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'पानाचे अस्तित्व तपासत आहे...', + 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'पान अस्तित्व आहे काय ते तपासत आहे...', + 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'निःसंदिग्धिकरण पान', 'wikieditor-toolbar-tool-link-int-invalid' => 'तुम्ही नमूद केलेले शीर्षक अग्राह्य आहे.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'तुम्ही नमूद केलेली यूआरएल इतर विकिपानास जोडावयाची आहे असे दिसते. तुम्हाला अंतर्गत दुवा बनवायचा आहे काय ?', 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'अंतर्गत दुवा', @@ -18670,13 +18817,14 @@ $messages['mr'] = array( 'wikieditor-toolbar-tool-file-example' => 'उदाहरण.jpg', 'wikieditor-toolbar-tool-file-title' => 'चित्र टाका', 'wikieditor-toolbar-file-target' => 'संचिकेचे नाव:', - 'wikieditor-toolbar-file-caption' => 'वर्णन:', + 'wikieditor-toolbar-file-caption' => 'मथळा:', 'wikieditor-toolbar-file-size' => 'आकार:', 'wikieditor-toolbar-file-float' => 'समास:', - 'wikieditor-toolbar-file-format' => 'प्रकार', + 'wikieditor-toolbar-file-default' => '(अविचल)', + 'wikieditor-toolbar-file-format' => 'प्रारुप:', 'wikieditor-toolbar-file-format-none' => 'काहीही नाही', 'wikieditor-toolbar-tool-file-insert' => 'समाविष्ट करा', - 'wikieditor-toolbar-tool-file-cancel' => 'रद्द', + 'wikieditor-toolbar-tool-file-cancel' => 'रद्द करा', 'wikieditor-toolbar-tool-reference' => 'संदर्भ', 'wikieditor-toolbar-tool-reference-example' => 'तळटीप मजकूर येथे भरा', 'wikieditor-toolbar-tool-reference-cancel' => 'रद्द करा', @@ -18692,10 +18840,10 @@ $messages['mr'] = array( 'wikieditor-toolbar-tool-heading-4' => 'स्तर ४', 'wikieditor-toolbar-tool-heading-5' => 'स्तर ५', 'wikieditor-toolbar-tool-heading-example' => 'अग्रशीर्ष मजकूर', - 'wikieditor-toolbar-group-format' => 'आराखडा', + 'wikieditor-toolbar-group-format' => 'प्रारुप', 'wikieditor-toolbar-tool-ulist' => 'बिंदी क्रमांकन', 'wikieditor-toolbar-tool-ulist-example' => 'बिंदी क्रमांकन घटक', - 'wikieditor-toolbar-tool-olist' => 'अनुक्रम यादी', + 'wikieditor-toolbar-tool-olist' => 'अनुक्रमित यादी', 'wikieditor-toolbar-tool-olist-example' => 'अनुक्रम यादी घटक', 'wikieditor-toolbar-tool-indent' => 'समासांतर', 'wikieditor-toolbar-tool-indent-example' => 'समासांतर ओळ', @@ -18733,7 +18881,7 @@ $1:Example.jpg|चित्रपरिचय २', 'wikieditor-toolbar-tool-table-title' => 'सारणी समाविष्ट करा', 'wikieditor-toolbar-tool-table-dimensions-rows' => 'ओळी', 'wikieditor-toolbar-tool-table-dimensions-columns' => 'रकाना', - 'wikieditor-toolbar-tool-table-dimensions-header' => 'मथळा ओळ जोडा', + 'wikieditor-toolbar-tool-table-dimensions-header' => 'शीर्ष ओळ जोडा', 'wikieditor-toolbar-tool-table-wikitable' => 'काठासहीत शैली', 'wikieditor-toolbar-tool-table-sortable' => 'सारणी क्रमानुसारी करण्याजोगी करा', 'wikieditor-toolbar-tool-table-example' => 'उदाहरण', @@ -18776,7 +18924,7 @@ $1:Example.jpg|चित्रपरिचय २', 'wikieditor-toolbar-characters-page-devanagari' => 'देवनागरी', 'wikieditor-toolbar-characters-page-thai' => 'थाई भाषा', 'wikieditor-toolbar-characters-page-lao' => 'लाऒ भाषा', - 'wikieditor-toolbar-characters-page-khmer' => 'खमेर', + 'wikieditor-toolbar-characters-page-khmer' => 'ख्मेर', 'wikieditor-toolbar-characters-minus' => 'ॠण चिन्ह', 'wikieditor-toolbar-section-help' => 'साहाय्य', 'wikieditor-toolbar-help-heading-description' => 'वर्णन', @@ -18819,7 +18967,7 @@ $1:Example.jpg|चित्रपरिचय २', 'wikieditor-toolbar-help-content-ulist-description' => 'बिंदीक्रमांकीत यादी', 'wikieditor-toolbar-help-content-ulist-syntax' => '* यादी कलम
      * यादी कलम', 'wikieditor-toolbar-help-content-ulist-result' => '
      • यादी घटक
      • यादी घटक
      ', - 'wikieditor-toolbar-help-content-olist-description' => 'अनुक्रम यादी', + 'wikieditor-toolbar-help-content-olist-description' => 'अनुक्रमित यादी', 'wikieditor-toolbar-help-content-olist-syntax' => '# यादी घटक
      # यादी घटक', 'wikieditor-toolbar-help-content-olist-result' => '
      1. यादी घटक
      2. यादी घटक
      ', 'wikieditor-toolbar-help-content-file-description' => 'संलग्न संचिका', @@ -18833,8 +18981,7 @@ $1:Example.jpg|चित्रपरिचय २', 'wikieditor-toolbar-help-content-rereference-result' => "पान मजकूर.[1]", 'wikieditor-toolbar-help-content-showreferences-description' => 'संदर्भ दर्शवा', 'wikieditor-toolbar-help-content-showreferences-result' => "
      1. ^ Link text, additional text.
      ", - 'wikieditor-toolbar-help-content-signaturetimestamp-description' => 'वेळेसह तुमची सही -तुमची सही व वेळ', + 'wikieditor-toolbar-help-content-signaturetimestamp-description' => 'सही आणि वेळठसा', 'wikieditor-toolbar-help-content-signaturetimestamp-result' => "सदस्यनाव (चर्चा) 15:54, 10 June 2009 (UTC)", 'wikieditor-toolbar-help-content-signature-description' => 'सही', 'wikieditor-toolbar-help-content-signature-result' => "सदस्यनाव (चर्चा)", @@ -20377,7 +20524,7 @@ $messages['nn'] = array( 'wikieditor-toolbar' => 'Verktøyline for redigering', 'wikieditor-toolbar-desc' => 'Ei meir brukarvenleg verktøylinje for redigering', 'wikieditor-toolbar-preference' => 'Ta i bruk utvida verktøylinje for redigering', - 'wikieditor-toolbar-dialogs-preference' => 'Aktiver dialogar for insetjing av lenkjer, tabellar og meir', # Fuzzy + 'wikieditor-toolbar-dialogs-preference' => 'Aktiver dialogar for insetjing av lenkjer, tabellar og søk og byt ut-funksjonen', 'wikieditor-toolbar-loading' => 'Lastar …', 'wikieditor-toolbar-tool-bold' => 'Feit', 'wikieditor-toolbar-tool-bold-example' => 'Feit tekst', @@ -20612,6 +20759,7 @@ $messages['nso'] = array( ); /** Occitan (occitan) + * @author Beta16 * @author Boulaur * @author Cedric31 * @author Jfblanc @@ -20646,7 +20794,7 @@ $messages['oc'] = array( 'wikieditor-toc-preference' => "Activar l'ensenhador navigable", 'wikieditor-toc-show' => 'Afichar lo contengut', 'wikieditor-toc-hide' => 'Amagar lo contengut', - 'wikieditor-toolbar' => 'Modificacion de la barra d’espleches', + 'wikieditor-toolbar' => 'Barra d’aisinas de modificacion', 'wikieditor-toolbar-desc' => "Modificacion de la barra d'aisinas amb l'utilizabilitat melhorada", 'wikieditor-toolbar-preference' => "Activar la barra d'aisinas melhorada", 'wikieditor-toolbar-dialogs-preference' => 'Activar las bóstias de dialòg per apondre de ligams, de tablèus e mai encara', # Fuzzy @@ -20686,7 +20834,7 @@ $messages['oc'] = array( 'wikieditor-toolbar-tool-file-example' => 'Exemple.jpg', 'wikieditor-toolbar-tool-file-title' => 'Importar un fichièr', 'wikieditor-toolbar-file-target' => 'Nom de fichièr :', - 'wikieditor-toolbar-file-caption' => 'Legenda :', + 'wikieditor-toolbar-file-caption' => 'Legenda:', 'wikieditor-toolbar-file-size' => 'Talha :', 'wikieditor-toolbar-file-float' => 'Alinhament :', 'wikieditor-toolbar-file-default' => '(per defaut)', @@ -21957,7 +22105,7 @@ $messages['pms'] = array( 'wikieditor-toolbar' => "Bara d'utiss ëd modìfica", 'wikieditor-toolbar-desc' => "Bara d'utiss ëd modìfica con dovrabilità ameliorà", 'wikieditor-toolbar-preference' => "Ativé la bara d'utiss ameliorà", - 'wikieditor-toolbar-dialogs-preference' => "Ativé ij quàder ëd diàlogh për anserì anliure, tàule e d'àutr", # Fuzzy + 'wikieditor-toolbar-dialogs-preference' => "Ativé j'assistent për gionté dle anliure, dle tàule e ëdcò la fonsion d'arserca e rampiass", 'wikieditor-toolbar-hidesig' => 'Stërmé ël boton ëd firma ant le pàgine ëd lë spassi nominal prinsipal', 'wikieditor-toolbar-loading' => 'Cariament...', 'wikieditor-toolbar-tool-bold' => 'Grassèt', @@ -21985,6 +22133,7 @@ $messages['pms'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Tìtol nen vàlid', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Anliura esterna', 'wikieditor-toolbar-tool-link-int-target-status-loading' => "Verìfica ëd l'esistensa dla pàgina...", + 'wikieditor-toolbar-tool-link-int-target-status-disambig' => "Pàgina d'omonimìa", 'wikieditor-toolbar-tool-link-int-invalid' => "Ël tìtol ch'a l'ha spessificà a va pa bin.", 'wikieditor-toolbar-tool-link-lookslikeinternal' => "L'URL ch'a l'ha spessificà a smijërìa n'anliura a n'àutra pàgina wiki. Veul-lo fene n'anliura anterna?", 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Anliura anterna', @@ -22526,8 +22675,8 @@ $messages['ps'] = array( 'wikieditor-toolbar-tool-table-dimensions-rows' => 'ليکې', 'wikieditor-toolbar-tool-table-dimensions-columns' => 'ستنې', 'wikieditor-toolbar-tool-table-wikitable' => 'ډول او پولې', - 'wikieditor-toolbar-tool-table-sortable' => 'لښتيال د اوډون وړ گرځول', - 'wikieditor-toolbar-tool-table-example' => 'بېلګه', + 'wikieditor-toolbar-tool-table-sortable' => 'لښتيال اوډون وړ گرځول', + 'wikieditor-toolbar-tool-table-example' => 'بېلگه', 'wikieditor-toolbar-tool-table-preview' => 'مخليدنه', 'wikieditor-toolbar-tool-table-insert' => 'ورټومبل', 'wikieditor-toolbar-tool-table-cancel' => 'ناگارل', @@ -23401,7 +23550,7 @@ $messages['ro'] = array( 'wikieditor-publish-dialog-title' => 'Publică pe {{SITENAME}}', 'wikieditor-publish-dialog-summary' => 'Descrierea modificărilor (descrieți pe scurt modificările făcute):', 'wikieditor-publish-dialog-minor' => 'Modificare minoră', - 'wikieditor-publish-dialog-watch' => 'Monitorizează această pagină', + 'wikieditor-publish-dialog-watch' => 'Urmărește această pagină', 'wikieditor-publish-dialog-publish' => 'Salvează pagina', 'wikieditor-publish-dialog-goback' => 'Înapoi', 'wikieditor-template-editor-preference' => 'Activează modificarea formatelor wiki prin formulare', @@ -23415,7 +23564,7 @@ $messages['ro'] = array( 'wikieditor-toolbar' => 'Modificarea barei de instrumente', 'wikieditor-toolbar-desc' => 'Modificarea barei de instrumente cu utilizare ridicată', 'wikieditor-toolbar-preference' => 'Activează varianta îmbunătățită a barei de unelte', - 'wikieditor-toolbar-dialogs-preference' => 'Activează casetele de dialog pentru inserarea legăturilor, tabelelor și a altor funcționalități', # Fuzzy + 'wikieditor-toolbar-dialogs-preference' => 'Activează asistență pentru inserarea legăturilor, tabelelor, precum și pentru funcțiile de căutare și înlocuire', 'wikieditor-toolbar-hidesig' => 'Ascunde butonul de semnătură în cazul paginilor din spațiul de nume principal', 'wikieditor-toolbar-loading' => 'Se încarcă...', 'wikieditor-toolbar-tool-bold' => 'Aldin', @@ -23443,6 +23592,7 @@ $messages['ro'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Titlu incorect', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Legătură externă', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'Verific existența paginii...', + 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'Pagină de dezambiguizare', 'wikieditor-toolbar-tool-link-int-invalid' => 'Titlul specificat nu este corect.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'URL-ul specificat pare a fi o legătură către o altă pagină wiki. Doriți să o transformați într-o legătură internă?', 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Legătură internă', @@ -23884,6 +24034,7 @@ $1:Example.jpg|Titele2', * @author Dim Grits * @author Eleferen * @author G0rn + * @author Iluvatar * @author KPu3uC B Poccuu * @author Kaganer * @author Lockal @@ -23906,7 +24057,7 @@ $messages['ru'] = array( 'wikieditor-publish-preference' => 'Включить пошаговую публикацию', 'wikieditor-publish-button-publish' => 'Опубликовать', 'wikieditor-publish-button-cancel' => 'Отмена', - 'wikieditor-publish-dialog-title' => 'Опубликование в проекте {{SITENAME}}', + 'wikieditor-publish-dialog-title' => 'Публикация в проекте {{SITENAME}}', 'wikieditor-publish-dialog-summary' => 'Описание изменений (кратко укажите какие изменения были произведены):', 'wikieditor-publish-dialog-minor' => 'Малое изменение', 'wikieditor-publish-dialog-watch' => 'Наблюдать за этой страницей', @@ -23951,6 +24102,7 @@ $messages['ru'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Недопустимое название', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Внешняя ссылка', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'Проверка существования страницы…', + 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'Страницы разрешения неоднозначностей', 'wikieditor-toolbar-tool-link-int-invalid' => 'Указанное название недопустимо.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'Указанный вами URL похож на ссылку на другую вики-страницу. Вы хотите сделать данную ссылку внутренней?', 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Внутренняя ссылка', @@ -24047,7 +24199,7 @@ $1:Example.jpg|Описание2', 'wikieditor-toolbar-tool-replace-button-replaceall' => 'Заменить все', 'wikieditor-toolbar-tool-replace-close' => 'Закрыть', 'wikieditor-toolbar-tool-replace-nomatch' => 'По вашему запросу ничего не найдено.', - 'wikieditor-toolbar-tool-replace-success' => '$1 {{PLURAL:$1|замена произведена|замены произведены|замен произведено}}.', + 'wikieditor-toolbar-tool-replace-success' => '$1 {{PLURAL:$1|замена произведена|замен произведено|замены произведены}}.', 'wikieditor-toolbar-tool-replace-emptysearch' => 'Вы не указали что следует искать.', 'wikieditor-toolbar-tool-replace-invalidregex' => 'Введённое вами регулярное выражение ошибочно: $1', 'wikieditor-toolbar-section-characters' => 'Спецсимволы', @@ -24070,6 +24222,7 @@ $1:Example.jpg|Описание2', 'wikieditor-toolbar-characters-page-thai' => 'Тайские', 'wikieditor-toolbar-characters-page-lao' => 'Лаосские', 'wikieditor-toolbar-characters-page-khmer' => 'Кхмерские', + 'wikieditor-toolbar-characters-endash' => 'среднее тире', 'wikieditor-toolbar-characters-emdash' => 'длинное тире', 'wikieditor-toolbar-characters-minus' => 'знак минус', 'wikieditor-toolbar-section-help' => 'Справка', @@ -25817,7 +25970,7 @@ $messages['sl'] = array( 'wikieditor-publish-preference' => 'Omogoči objavljanje korak-po-koraku', 'wikieditor-publish-button-publish' => 'Objavi', 'wikieditor-publish-button-cancel' => 'Prekliči', - 'wikieditor-publish-dialog-title' => 'Objavi na {{SITENAME}}', + 'wikieditor-publish-dialog-title' => 'Objavi na {{GRAMMAR:dajalnik|{{SITENAME}}}}', 'wikieditor-publish-dialog-summary' => 'Povzetek urejanja (na kratko opišite narejene spremembe):', 'wikieditor-publish-dialog-minor' => 'Manjše urejanje', 'wikieditor-publish-dialog-watch' => 'Opazuj stran', @@ -27012,7 +27165,7 @@ $messages['sv'] = array( 'wikieditor-previewDialog-preference' => 'Aktivera förhandsgranska', 'wikieditor-previewDialog-tab' => 'Förhandsgranska', 'wikieditor-previewDialog-loading' => 'Laddar...', - 'wikieditor-publish-preference' => 'Aktivera steg-efter-steg-publicering', + 'wikieditor-publish-preference' => 'Aktivera steg-för-steg-publicering', 'wikieditor-publish-button-publish' => 'Publicera', 'wikieditor-publish-button-cancel' => 'Avbryt', 'wikieditor-publish-dialog-title' => 'Publicera i {{SITENAME}}', @@ -27313,15 +27466,15 @@ $messages['sw'] = array( 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Kiungo cha ndani', 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' => 'Kiungo cha nje', 'wikieditor-toolbar-tool-link-empty' => 'Hukuandika kitu cha kuunganisha naye.', - 'wikieditor-toolbar-tool-file' => 'Faili futike', + 'wikieditor-toolbar-tool-file' => 'Ingiza faili', 'wikieditor-toolbar-tool-file-example' => 'Mfano.jpg', 'wikieditor-toolbar-tool-file-title' => 'Ingiza faili', 'wikieditor-toolbar-file-target' => 'Jina la faili:', 'wikieditor-toolbar-file-size' => 'Ukubwa:', 'wikieditor-toolbar-tool-file-insert' => 'Ingiza', 'wikieditor-toolbar-tool-file-cancel' => 'Ghairi', - 'wikieditor-toolbar-tool-reference' => 'Tiniwayo', - 'wikieditor-toolbar-tool-reference-example' => 'Weka maneno ya tiniwayo hapa', + 'wikieditor-toolbar-tool-reference' => 'Marejeo', + 'wikieditor-toolbar-tool-reference-example' => 'Weka maneno ya marejeo hapa', 'wikieditor-toolbar-tool-reference-cancel' => 'Batilisha', 'wikieditor-toolbar-tool-reference-title' => 'Ingiza marejeo', 'wikieditor-toolbar-tool-reference-insert' => 'Ingiza', @@ -27429,7 +27582,7 @@ Idadi ya mistari au ya safu si halali.', 'wikieditor-toolbar-help-page-heading' => 'Vichwa', 'wikieditor-toolbar-help-page-list' => 'Orodha', 'wikieditor-toolbar-help-page-file' => 'Mafaili', - 'wikieditor-toolbar-help-page-reference' => 'Tiniwayo', + 'wikieditor-toolbar-help-page-reference' => 'Marejeo', 'wikieditor-toolbar-help-page-discussion' => 'Majadiliano', 'wikieditor-toolbar-help-content-italic-description' => 'Italiki', 'wikieditor-toolbar-help-content-italic-syntax' => "''Maandishi ya italiki''", @@ -27464,15 +27617,15 @@ Idadi ya mistari au ya safu si halali.', 'wikieditor-toolbar-help-content-olist-description' => 'Orodha zenye namba', 'wikieditor-toolbar-help-content-olist-syntax' => '# Aya
      # Aya', 'wikieditor-toolbar-help-content-olist-result' => '
      1. Aya
      2. Aya
      ', - 'wikieditor-toolbar-help-content-file-description' => 'Faili futike', + 'wikieditor-toolbar-help-content-file-description' => 'Ingiza faili', 'wikieditor-toolbar-help-content-file-syntax' => '[[$1:Example.png|thumb|Maelezo mafupi]]', 'wikieditor-toolbar-help-content-file-result' => "
      Maelezo mafupi
      ", - 'wikieditor-toolbar-help-content-reference-description' => 'Tiniwayo', + 'wikieditor-toolbar-help-content-reference-description' => 'Marejeo', 'wikieditor-toolbar-help-content-reference-syntax' => 'Maandishi ya ukurasa.<ref name="mfano">[http://www.example.org Maandishi ya kiungo], maandishi mengine.</ref>', 'wikieditor-toolbar-help-content-reference-result' => "Maandiko.[1]", - 'wikieditor-toolbar-help-content-rereference-description' => 'Kutumia tiniwayo fulani kwa mara nyingine', + 'wikieditor-toolbar-help-content-rereference-description' => 'Kutumia marejeo fulani kwa mara nyingine', 'wikieditor-toolbar-help-content-rereference-result' => "Maandiko.[1]", - 'wikieditor-toolbar-help-content-showreferences-description' => 'Onyesha tiniwayo', + 'wikieditor-toolbar-help-content-showreferences-description' => 'Onyesha marejeo', 'wikieditor-toolbar-help-content-showreferences-result' => "
      1. ^ Maandishi ya kiungo, maandishi mengine.
      ", 'wikieditor-toolbar-help-content-signaturetimestamp-description' => 'Sahihi pamoja na stempu ya saa', 'wikieditor-toolbar-help-content-signaturetimestamp-result' => "Jina la mtumiaji (majadiliano) 15:54, 10 June 2009 (UTC)", @@ -27483,6 +27636,16 @@ Idadi ya mistari au ya safu si halali.', 'wikieditor-toolbar-help-content-indent-result' => 'Maandiko ya kawaida
      Yaliyojongezwa ndani
      Yaliyojongezwa ndani
      ', ); +/** Silesian (ślůnski) + * @author Krol111 + */ +$messages['szl'] = array( + 'wikieditor' => 'Zaawansowano tajla edycyji wikitekstu', + 'wikieditor-desc' => 'Dowo poszyrzalno tajla edycyji wikitekstu a wjela funkcyji uofyrowane bez moduły', + 'wikieditor-wikitext-tab' => 'Wikitext', + 'wikieditor-loading' => 'Trwo ładowańy…', +); + /** Tamil (தமிழ்) * @author Balajijagadesh * @author Karthi.dr @@ -28681,6 +28844,7 @@ $messages['tpi'] = array( * @author Joseph * @author Koc61 * @author Manco Capac + * @author Meelo * @author Rapsar * @author Sadrettin * @author Srhat @@ -28755,6 +28919,7 @@ $messages['tr'] = array( 'wikieditor-toolbar-tool-file' => 'Gömülü dosya', 'wikieditor-toolbar-tool-file-example' => 'Örnek.jpg', 'wikieditor-toolbar-file-float' => 'Hizalama:', + 'wikieditor-toolbar-tool-file-insert' => 'Ekle', 'wikieditor-toolbar-tool-reference' => 'Kaynakça', 'wikieditor-toolbar-tool-reference-example' => 'Dipnot metnini buraya ekleyin', 'wikieditor-toolbar-tool-reference-cancel' => 'İptal', @@ -29465,7 +29630,7 @@ $1:Example.jpg|Опис2', 'wikieditor-toolbar-tool-replace-button-replaceall' => 'Замінити всі', 'wikieditor-toolbar-tool-replace-close' => 'Закрити', 'wikieditor-toolbar-tool-replace-nomatch' => 'За Вашим запитом нічого не знайдено.', - 'wikieditor-toolbar-tool-replace-success' => '$1 {{PLURAL:$1|заміну|замін}} зроблено.', + 'wikieditor-toolbar-tool-replace-success' => '$1 {{PLURAL:$1|1=заміну|заміни|замін}} зроблено.', 'wikieditor-toolbar-tool-replace-emptysearch' => 'Ви не зазначили, що треба шукати.', 'wikieditor-toolbar-tool-replace-invalidregex' => 'Введений вами регулярний вираз помилковий: $1', 'wikieditor-toolbar-section-characters' => 'Спеціальні символи', @@ -29848,7 +30013,7 @@ $messages['uz'] = array( 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Ichki havola', 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' => 'Tashqi havola', 'wikieditor-toolbar-tool-link-empty' => 'Nimaga ishorat qilishni koʻrsatmadingiz', - 'wikieditor-toolbar-tool-file' => 'Oʻrnatilgan fayl', + 'wikieditor-toolbar-tool-file' => 'Fayl oʻrnatish', 'wikieditor-toolbar-tool-file-example' => 'Example.jpg', 'wikieditor-toolbar-tool-file-title' => 'Fayl qoʻyish', 'wikieditor-toolbar-file-target' => 'Fayl nomi:', @@ -30007,7 +30172,7 @@ $1:Example.jpg|Izoh2', 'wikieditor-toolbar-help-content-olist-description' => 'Raqamlangan roʻyxat', 'wikieditor-toolbar-help-content-olist-syntax' => '# Roʻyxat qismi
      # Roʻyxat qismi', 'wikieditor-toolbar-help-content-olist-result' => '
      1. Roʻyxat qismi
      2. Roʻyxat qismi
      ', - 'wikieditor-toolbar-help-content-file-description' => 'Oʻrnatilgan fayl', + 'wikieditor-toolbar-help-content-file-description' => 'Fayl oʻrnatish', 'wikieditor-toolbar-help-content-file-syntax' => '[[$1:Example.png|thumb|Izohlovchi matn]]', 'wikieditor-toolbar-help-content-file-result' => "
      @@ -30289,17 +30454,51 @@ $messages['vep'] = array( 'wikieditor-publish-dialog-minor' => 'Penikaine redakcii', 'wikieditor-publish-dialog-publish' => 'Publikuida', 'wikieditor-publish-dialog-goback' => 'Tagaze', + 'wikieditor-template-editor-dialog-submit' => 'Udištada', + 'wikieditor-template-editor-dialog-cancel' => 'Tühjitada tego', 'wikieditor-toc-show' => 'Ozutada südäiolend', + 'wikieditor-toc-hide' => 'Peitta südäiolend', + 'wikieditor-toolbar' => "Redaktiruindan panel'", + 'wikieditor-toolbar-loading' => 'Ozutase…', 'wikieditor-toolbar-tool-bold' => 'Lihavoitud', 'wikieditor-toolbar-tool-bold-example' => 'Lihavoitud tekst', + 'wikieditor-toolbar-tool-italic' => 'Kursiv', + 'wikieditor-toolbar-tool-italic-example' => 'Kursivtekst', + 'wikieditor-toolbar-tool-ilink' => 'Südäikosketuz', + 'wikieditor-toolbar-tool-ilink-example' => 'Kosketusen pälkirjutez', + 'wikieditor-toolbar-tool-xlink' => 'Irdkosketuz (muštkat prefiksas http://)', + 'wikieditor-toolbar-tool-xlink-example' => 'http://www.example.com kosketusen pälkirjutez', 'wikieditor-toolbar-tool-link' => 'Kosketuz', 'wikieditor-toolbar-tool-link-title' => 'Ližada kosketuz', + 'wikieditor-toolbar-tool-link-int' => 'Wiki-lehtpolele', + 'wikieditor-toolbar-tool-link-int-target' => "Metlehtpol' vai URL:", + 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'Lehtpolen nimi vai URL:', + 'wikieditor-toolbar-tool-link-int-text' => 'Ozutadud tekst:', + 'wikieditor-toolbar-tool-link-int-text-tooltip' => 'Ozutadud tekst:', + 'wikieditor-toolbar-tool-link-ext' => 'Irdaližele saitale', 'wikieditor-toolbar-tool-link-ext-target' => 'Kosketusen URL:', 'wikieditor-toolbar-tool-link-ext-text' => 'Kosketusen tekst:', + 'wikieditor-toolbar-tool-link-insert' => 'Ližada kosketuz', 'wikieditor-toolbar-tool-link-cancel' => 'Heitta', + 'wikieditor-toolbar-tool-link-int-target-status-exists' => "Lehtpol' om jo olmas", + 'wikieditor-toolbar-tool-link-int-target-status-notexists' => "Ei ole mugošt lehtpol't", 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Vär nimi', + 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Irdkosketuz', + 'wikieditor-toolbar-tool-link-int-invalid' => 'Nece pälkirjutez om vär.', + 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Südäikosketuz', + 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' => 'Irdkosketuz', 'wikieditor-toolbar-tool-file' => 'Mülütadud fail', 'wikieditor-toolbar-tool-file-example' => 'Ozutez.jpg', + 'wikieditor-toolbar-tool-file-title' => 'Ližada fail', + 'wikieditor-toolbar-file-target' => 'Failannimi:', + 'wikieditor-toolbar-file-caption' => 'Allekirjutez:', + 'wikieditor-toolbar-file-size' => 'Suruz', + 'wikieditor-toolbar-file-float' => 'Tazostamine:', + 'wikieditor-toolbar-file-default' => '(augotižjärgendusen mödhe)', + 'wikieditor-toolbar-file-format' => 'Format:', + 'wikieditor-toolbar-file-format-none' => 'Ei ole', + 'wikieditor-toolbar-tool-file-insert' => 'Ližata', + 'wikieditor-toolbar-tool-file-cancel' => 'Tühjištada', 'wikieditor-toolbar-tool-reference-insert' => 'Ližata', 'wikieditor-toolbar-tool-heading' => 'Pälkirjutez', 'wikieditor-toolbar-tool-heading-1' => 'Tazopind 1', @@ -30481,7 +30680,7 @@ $messages['vi'] = array( 'wikieditor-toolbar-tool-subscript' => 'Viết xuống dưới', 'wikieditor-toolbar-tool-subscript-example' => 'Chữ được viết xuống dưới', 'wikieditor-toolbar-group-insert' => 'Chèn', - 'wikieditor-toolbar-tool-gallery' => 'Album hình ảnh', + 'wikieditor-toolbar-tool-gallery' => 'Tập ảnh', 'wikieditor-toolbar-tool-gallery-example' => '$1:Ví dụ.jpg|Chú thích 1 $1:Ví dụ.jpg|Chú thích 2', 'wikieditor-toolbar-tool-newline' => 'Dòng mới', @@ -30625,7 +30824,7 @@ $messages['vo'] = array( 'wikieditor-toolbar-tool-link-int-target' => 'Tiäd pada:', 'wikieditor-toolbar-tool-link-int-text' => 'Vödem yüma', 'wikieditor-toolbar-tool-link-cancel' => 'Nosükön', - 'wikieditor-toolbar-group-format' => 'Lised', # Fuzzy + 'wikieditor-toolbar-group-format' => 'Fomät', 'wikieditor-toolbar-tool-big' => 'Gretik', 'wikieditor-toolbar-tool-big-example' => 'Vödem gretik', 'wikieditor-toolbar-tool-table' => 'Taib', @@ -31236,6 +31435,7 @@ $1:Example.jpg|Àkọlé2', * @author Horacewai2 * @author Simon Shek * @author Waihorace + * @author Xiaomingyan */ $messages['yue'] = array( 'wikieditor' => '進階維基文字編輯界面', @@ -31368,8 +31568,8 @@ $1:Example.jpg|標題2', | 行 2, 格 3', 'wikieditor-toolbar-tool-table-example-header' => '標題', 'wikieditor-toolbar-tool-table-title' => '插入表格', - 'wikieditor-toolbar-tool-table-dimensions-rows' => '行', - 'wikieditor-toolbar-tool-table-dimensions-columns' => '行', + 'wikieditor-toolbar-tool-table-dimensions-rows' => '行数', + 'wikieditor-toolbar-tool-table-dimensions-columns' => '列數', 'wikieditor-toolbar-tool-table-dimensions-header' => '新增標題行', 'wikieditor-toolbar-tool-table-wikitable' => '連埋外框同格式', 'wikieditor-toolbar-tool-table-sortable' => '整一個可以排序嘅表格', @@ -31526,9 +31726,9 @@ $messages['zh-hans'] = array( 'wikieditor-toc-show' => '显示内容', 'wikieditor-toc-hide' => '隐藏内容', 'wikieditor-toolbar' => '编辑工具栏', - 'wikieditor-toolbar-desc' => '具有增强可用性的页面编辑工具', - 'wikieditor-toolbar-preference' => '启用增强编辑工具栏', - 'wikieditor-toolbar-dialogs-preference' => '启用对话框插入链接、表格以及搜索和替换功能', + 'wikieditor-toolbar-desc' => '有增强的使用性能的页面编辑工具栏', + 'wikieditor-toolbar-preference' => '启用增强的编辑工具栏', + 'wikieditor-toolbar-dialogs-preference' => '启用插入链接表格向导及查找和替换功能', 'wikieditor-toolbar-hidesig' => '在主名字空间中隐藏签名按钮', 'wikieditor-toolbar-loading' => '正在载入', 'wikieditor-toolbar-tool-bold' => '粗体', @@ -31567,7 +31767,7 @@ $messages['zh-hans'] = array( 'wikieditor-toolbar-tool-file-title' => '插入文件', 'wikieditor-toolbar-file-target' => '文件名:', 'wikieditor-toolbar-file-caption' => '标题:', - 'wikieditor-toolbar-file-size' => '大小:', + 'wikieditor-toolbar-file-size' => '尺寸:', 'wikieditor-toolbar-file-float' => '对齐:', 'wikieditor-toolbar-file-default' => '(默认)', 'wikieditor-toolbar-file-format' => '格式:', @@ -31575,7 +31775,7 @@ $messages['zh-hans'] = array( 'wikieditor-toolbar-tool-file-insert' => '插入', 'wikieditor-toolbar-tool-file-cancel' => '取消', 'wikieditor-toolbar-tool-reference' => '参考', - 'wikieditor-toolbar-tool-reference-example' => '在此处插入注释文字', + 'wikieditor-toolbar-tool-reference-example' => '请在这里插入注释文字', 'wikieditor-toolbar-tool-reference-cancel' => '取消', 'wikieditor-toolbar-tool-reference-title' => '插入注释内容', 'wikieditor-toolbar-tool-reference-insert' => '插入', @@ -31597,7 +31797,7 @@ $messages['zh-hans'] = array( 'wikieditor-toolbar-tool-indent' => '缩进', 'wikieditor-toolbar-tool-indent-example' => '已缩进行', 'wikieditor-toolbar-tool-nowiki' => '非维基格式文字', - 'wikieditor-toolbar-tool-nowiki-example' => '在此处插入非维基格式文字', + 'wikieditor-toolbar-tool-nowiki-example' => '请在这里插入非格式化文字', 'wikieditor-toolbar-tool-redirect' => '重定向', 'wikieditor-toolbar-tool-redirect-example' => '目标页名称', 'wikieditor-toolbar-tool-big' => '大号', @@ -31629,8 +31829,8 @@ $1:Example.jpg|标题2', 'wikieditor-toolbar-tool-table-example-cell-text' => '单元格文字', 'wikieditor-toolbar-tool-table-example-header' => '标题文字', 'wikieditor-toolbar-tool-table-title' => '插入表格', - 'wikieditor-toolbar-tool-table-dimensions-rows' => '行', - 'wikieditor-toolbar-tool-table-dimensions-columns' => '列', + 'wikieditor-toolbar-tool-table-dimensions-rows' => '行数', + 'wikieditor-toolbar-tool-table-dimensions-columns' => '列数', 'wikieditor-toolbar-tool-table-dimensions-header' => '添加标题行', 'wikieditor-toolbar-tool-table-wikitable' => '显示边框', 'wikieditor-toolbar-tool-table-sortable' => '使表格内容可排序', @@ -31759,6 +31959,7 @@ $1:Example.jpg|标题2', * @author Waihorace * @author Wong128hk * @author Wrightbus + * @author Xiaomingyan */ $messages['zh-hant'] = array( 'wikieditor' => '進階維基文字編輯介面', @@ -31904,8 +32105,8 @@ $1:Example.jpg|標題2', | 行 2, 格 3', 'wikieditor-toolbar-tool-table-example-header' => '標題', 'wikieditor-toolbar-tool-table-title' => '插入表格', - 'wikieditor-toolbar-tool-table-dimensions-rows' => '行', - 'wikieditor-toolbar-tool-table-dimensions-columns' => '列', + 'wikieditor-toolbar-tool-table-dimensions-rows' => '行數', + 'wikieditor-toolbar-tool-table-dimensions-columns' => '列數', 'wikieditor-toolbar-tool-table-dimensions-header' => '新增標題行', 'wikieditor-toolbar-tool-table-wikitable' => '設定邊框格式', 'wikieditor-toolbar-tool-table-sortable' => '使表格內容可排序', diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.dialogs.js b/extensions/WikiEditor/modules/ext.wikiEditor.dialogs.js index 0e0dd090..c6d327f8 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.dialogs.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.dialogs.js @@ -1,15 +1,14 @@ /* * JavaScript for WikiEditor Dialogs */ - -$( document ).ready( function() { +jQuery( document ).ready( function ( $ ) { if ( !$.wikiEditor.isSupported( $.wikiEditor.modules.dialogs ) ) { return; } - + // Replace icons $.wikiEditor.modules.dialogs.config.replaceIcons( $( '#wpTextbox1' ) ); - + // Add dialogs module $( '#wpTextbox1' ).wikiEditor( 'addModule', $.wikiEditor.modules.dialogs.config.getDefaultConfig() ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.highlight.js b/extensions/WikiEditor/modules/ext.wikiEditor.highlight.js index a6b43851..92515cfd 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.highlight.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.highlight.js @@ -1,8 +1,7 @@ /* * JavaScript for WikiEditor Highlighting */ - -$( document ).ready( function() { +jQuery( document ).ready( function ( $ ) { // Add highlight module $( '#wpTextbox1' ).wikiEditor( 'addModule', 'highlight' ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.js b/extensions/WikiEditor/modules/ext.wikiEditor.js index 6056e63b..46087989 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.js @@ -1,8 +1,7 @@ /* * JavaScript for WikiEditor */ - -$( document ).ready( function() { +jQuery( document ).ready( function ( $ ) { // Initialize wikiEditor $( '#wpTextbox1' ).wikiEditor(); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.preview.js b/extensions/WikiEditor/modules/ext.wikiEditor.preview.js index 3fbca82d..cdc00f7b 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.preview.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.preview.js @@ -1,8 +1,7 @@ /* * JavaScript for WikiEditor Preview module */ - -$( document ).ready( function() { +jQuery( document ).ready( function ( $ ) { // Add preview module $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'preview' ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.previewDialog.js b/extensions/WikiEditor/modules/ext.wikiEditor.previewDialog.js index 67f97e00..3b1acd7c 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.previewDialog.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.previewDialog.js @@ -1,8 +1,7 @@ /* * JavaScript for WikiEditor Preview Dialog */ - -$( document ).ready( function() { +jQuery( document ).ready( function ( $ ) { // Add preview module $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'previewDialog' ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.publish.js b/extensions/WikiEditor/modules/ext.wikiEditor.publish.js index d874478c..423766d2 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.publish.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.publish.js @@ -1,8 +1,7 @@ /* * JavaScript for WikiEditor Publish module */ - -$( document ).ready( function() { +jQuery( document ).ready( function ( $ ) { // Add publish module $( '#wpTextbox1' ).wikiEditor( 'addModule', 'publish' ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.templateEditor.js b/extensions/WikiEditor/modules/ext.wikiEditor.templateEditor.js index 8879d10d..660a14fb 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.templateEditor.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.templateEditor.js @@ -1,12 +1,13 @@ /* * JavaScript for WikiEditor Template Editor */ - -$( document ).ready( function () { - // Disable in template namespace - if ( mw.config.get( 'wgNamespaceNumber' ) === 10 ) { - return true; - } - // Add template editor module - $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'templateEditor' ); -}); +( function ( mw, $ ) { + $( document ).ready( function () { + // Disable in template namespace + if ( mw.config.get( 'wgNamespaceNumber' ) === 10 ) { + return true; + } + // Add template editor module + $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'templateEditor' ); + } ); +}( mediaWiki, jQuery ) ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.templates.js b/extensions/WikiEditor/modules/ext.wikiEditor.templates.js index 6eae6de5..fec51866 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.templates.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.templates.js @@ -1,12 +1,13 @@ /* * JavaScript for WikiEditor Templates */ - -$( document ).ready( function () { - // Disable for template namespace - if ( mw.config.get( 'wgNamespaceNumber' ) === 10 ) { - return true; - } - // Add templates module - $( '#wpTextbox1' ).wikiEditor( 'addModule', 'templates' ); -} ); +( function ( mw, $ ) { + $( document ).ready( function () { + // Disable for template namespace + if ( mw.config.get( 'wgNamespaceNumber' ) === 10 ) { + return true; + } + // Add templates module + $( '#wpTextbox1' ).wikiEditor( 'addModule', 'templates' ); + } ); +}( mediaWiki, jQuery ) ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js b/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js index d4ffe5ae..7ed765e9 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js @@ -4,7 +4,7 @@ var textareaId = '#wpTextbox1'; var wikiEditorTests = { // Add emoticons section - add_sections_toolbar: { + 'add_sections_toolbar': { call: 'addToToolbar', data: { 'sections': { @@ -159,8 +159,8 @@ var wikiEditorTests = { data: { section: 'info', page: 'removeme' - }, - test: '*[rel=info].section *[rel=removeme].page', + }, + test: '*[rel=info].section *[rel=removeme].page', pre: 1, post: 0 }, @@ -171,8 +171,8 @@ var wikiEditorTests = { section: 'info', page: 'emoticons', 'character': ':))' - }, - test: '*[rel=info].section *[rel=emoticons].page *[rel=":))"]', + }, + test: '*[rel=info].section *[rel=emoticons].page *[rel=":))"]', pre: 1, post: 0 }, @@ -211,7 +211,7 @@ jQuery(document).ready( function ( $ ) { return false; } - var test, pre, post, + var test, pre, post, i, messages = [ 'Running tests for wikiEditor API' ], $target = $( textareaId ), $ui = $target.data( 'wikiEditor-context' ).$ui, @@ -234,13 +234,13 @@ jQuery(document).ready( function ( $ ) { } if ( window.console ) { - for ( var i = 0; i < messages.length; i++ ) { + for ( i = 0; i < messages.length; i++ ) { window.console.log( messages[i] ); } } $(this) - .attr( 'title', messages.join( " | " ) ) + .attr( 'title', messages.join( ' | ' ) ) .text( passes + ' / ' + tests + ' were successful' ) .css( 'backgroundColor', passes < tests ? 'red' : 'green' ) .data( 'testDone', 'true' ) diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.toc.js b/extensions/WikiEditor/modules/ext.wikiEditor.toc.js index 264e9f86..1fc542c5 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.toc.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.toc.js @@ -1,8 +1,7 @@ /* * JavaScript for WikiEditor Table of Contents */ - -$( document ).ready( function() { +jQuery( document ).ready( function ( $ ) { // Add table of contents module $( '#wpTextbox1' ).wikiEditor( 'addModule', 'toc' ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.hideSig.js b/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.hideSig.js index 3bc0f0b4..48d30274 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.hideSig.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.hideSig.js @@ -1,7 +1,7 @@ /* * Remove the signature button if the main namespace is edited. */ -$( document ).ready( function() { +jQuery( document ).ready( function ( $ ) { // This module is designed not to depend on ext.wikiEditor or jquery.wikiEditor. // Removing this dependency fixed various bugs, but it does mean that we have to // account for the situation where $.wikiEditor is not present @@ -11,4 +11,4 @@ $( document ).ready( function() { if ( $( 'body' ).hasClass( 'ns-0' ) ) { $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'signature' } ); } -}); +} ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js b/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js index 5cdeae57..3f30c0c4 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js @@ -1,8 +1,7 @@ /* * JavaScript for WikiEditor Toolbar */ - -$( document ).ready( function() { +jQuery( document ).ready( function ( $ ) { if ( !$.wikiEditor.isSupported( $.wikiEditor.modules.toolbar ) ) { $( '.wikiEditor-oldToolbar' ).show(); return; diff --git a/extensions/WikiEditor/modules/images/toolbar/format-bold-hy.png b/extensions/WikiEditor/modules/images/toolbar/format-bold-hy.png new file mode 100644 index 00000000..453a9580 Binary files /dev/null and b/extensions/WikiEditor/modules/images/toolbar/format-bold-hy.png differ diff --git a/extensions/WikiEditor/modules/images/toolbar/format-italic-hy.png b/extensions/WikiEditor/modules/images/toolbar/format-italic-hy.png new file mode 100644 index 00000000..108bae64 Binary files /dev/null and b/extensions/WikiEditor/modules/images/toolbar/format-italic-hy.png differ diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.css b/extensions/WikiEditor/modules/jquery.wikiEditor.css index d8e331cc..6e05ff03 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.css +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.css @@ -18,9 +18,6 @@ } .wikiEditor-ui textarea:focus { outline: none; -} -.wikiEditor-ui .wikiEditor-ui-bottom { - } .wikiEditor-ui .wikiEditor-ui-text { line-height: 0; diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js b/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js index 0d769164..f37d004e 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js @@ -1,6 +1,8 @@ /** * Configuration of Dialog module for wikiEditor */ +/*jshint curly:false, noarg:false, quotmark:false, onevar:false */ +/*global alert */ ( function ( $, mw ) { $.wikiEditor.modules.dialogs.config = { @@ -226,7 +228,7 @@ $.wikiEditor.modules.dialogs.config = { ); } $( '#wikieditor-toolbar-link-type-int, #wikieditor-toolbar-link-type-ext' ).click( function () { - if ( $( '#wikieditor-toolbar-link-type-ext' ).is( ':checked' ) ) { + if ( $( '#wikieditor-toolbar-link-type-ext' ).prop( 'checked' ) ) { // Abort previous request var request = $( '#wikieditor-toolbar-link-int-target-status' ).data( 'request' ); if ( request ) { @@ -234,8 +236,9 @@ $.wikiEditor.modules.dialogs.config = { } updateWidget( 'external' ); } - if ( $( '#wikieditor-toolbar-link-type-int' ).is( ':checked' ) ) + if ( $( '#wikieditor-toolbar-link-type-int' ).prop( 'checked' ) ) { updateExistence( true ); + } }); // Set labels of tabs based on rel values $(this).find( '[rel]' ).each( function () { @@ -250,12 +253,12 @@ $.wikiEditor.modules.dialogs.config = { .data( 'tooltip', mw.msg( 'wikieditor-toolbar-tool-link-int-text-tooltip' ) ); $( '#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text' ) .each( function () { - var tooltip = mw.msg( $( this ).attr( 'id' ) + '-tooltip' ); - if ( $( this ).val() === '' ) + if ( $( this ).val() === '' ) { $( this ) .addClass( 'wikieditor-toolbar-dialog-hint' ) .val( $( this ).data( 'tooltip' ) ) .data( 'tooltip-mode', true ); + } } ) .focus( function () { if ( $( this ).val() === $( this ).data( 'tooltip' ) ) { @@ -295,26 +298,30 @@ $.wikiEditor.modules.dialogs.config = { $( '#wikieditor-toolbar-link-type-int' ).prop( 'checked', true ); updateExistence(); } - if ( $( '#wikieditor-toolbar-link-int-text' ).data( 'untouched' ) ) + /*jshint eqeqeq:false */ + if ( $( '#wikieditor-toolbar-link-int-text' ).data( 'untouched' ) ) { if ( $( '#wikieditor-toolbar-link-int-target' ).val() == - $( '#wikieditor-toolbar-link-int-target' ).data( 'tooltip' ) ) { - $( '#wikieditor-toolbar-link-int-text' ) - .addClass( 'wikieditor-toolbar-dialog-hint' ) - .val( $( '#wikieditor-toolbar-link-int-text' ).data( 'tooltip' ) ) - .change(); - } else { - $( '#wikieditor-toolbar-link-int-text' ) - .val( $( '#wikieditor-toolbar-link-int-target' ).val() ) - .change(); - } + $( '#wikieditor-toolbar-link-int-target' ).data( 'tooltip' ) + ) { + $( '#wikieditor-toolbar-link-int-text' ) + .addClass( 'wikieditor-toolbar-dialog-hint' ) + .val( $( '#wikieditor-toolbar-link-int-text' ).data( 'tooltip' ) ) + .change(); + } else { + $( '#wikieditor-toolbar-link-int-text' ) + .val( $( '#wikieditor-toolbar-link-int-target' ).val() ) + .change(); + } + } }, 0 ); }); $( '#wikieditor-toolbar-link-int-text' ).bind( 'change keydown paste cut', function () { var oldVal = $(this).val(); var that = this; setTimeout( function () { - if ( $(that).val() !== oldVal ) + if ( $(that).val() !== oldVal ) { $(that).data( 'untouched', false ); + } }, 0 ); }); // Add images to the page existence widget, which will be shown mutually exclusively to communicate if @@ -379,7 +386,7 @@ $.wikiEditor.modules.dialogs.config = { // Title suggestions $( '#wikieditor-toolbar-link-int-target' ).data( 'suggcache', {} ).suggestions( { - fetch: function ( query ) { + fetch: function () { var that = this; var title = $(this).val(); @@ -608,7 +615,7 @@ $.wikiEditor.modules.dialogs.config = { // Execute the action associated with the first button // when the user presses Enter $(this).closest( '.ui-dialog' ).keypress( function ( e ) { - if ( ( e.keyCode || e.which ) == 13 ) { + if ( ( e.keyCode || e.which ) === 13 ) { var button = $(this).data( 'dialogaction' ) || $(this).find( 'button:first' ); button.click(); e.preventDefault(); @@ -706,7 +713,7 @@ $.wikiEditor.modules.dialogs.config = { // Execute the action associated with the first button // when the user presses Enter $( this ).closest( '.ui-dialog' ).keypress( function ( e ) { - if ( ( e.keyCode || e.which ) == 13 ) { + if ( ( e.keyCode || e.which ) === 13 ) { var button = $( this ).data( 'dialogaction' ) || $( this ).find( 'button:first' ); button.click(); e.preventDefault(); @@ -978,7 +985,7 @@ $.wikiEditor.modules.dialogs.config = { var hiddenHTML = $( '.wikieditor-toolbar-table-preview-hidden' ).html(); $( '.wikieditor-toolbar-table-preview-header' ).html( hiddenHTML ); $( '.wikieditor-toolbar-table-preview-hidden' ).html( headerHTML ); - if ( typeof jQuery.fn.tablesorter == 'function' ) { + if ( typeof jQuery.fn.tablesorter === 'function' ) { $( '#wikieditor-toolbar-table-preview, #wikieditor-toolbar-table-preview2' ) .filter( '.sortable' ) .tablesorter(); @@ -1070,7 +1077,7 @@ $.wikiEditor.modules.dialogs.config = { // Execute the action associated with the first button // when the user presses Enter $(this).closest( '.ui-dialog' ).keypress( function ( e ) { - if ( ( e.keyCode || e.which ) == 13 ) { + if ( ( e.keyCode || e.which ) === 13 ) { var button = $(this).data( 'dialogaction' ) || $(this).find( 'button:first' ); button.click(); e.preventDefault(); @@ -1202,7 +1209,7 @@ $.wikiEditor.modules.dialogs.config = { if ( !match ) { $( '#wikieditor-toolbar-replace-nomatch' ).show(); - } else if ( mode == 'replaceAll' ) { + } else if ( mode === 'replaceAll' ) { // Instead of using repetitive .match() calls, we use one .match() call with /g // and indexOf() followed by substr() to find the offsets. This is actually // faster because our indexOf+substr loop is faster than a match loop, and the @@ -1237,7 +1244,7 @@ $.wikiEditor.modules.dialogs.config = { $(this).data( 'offset', 0 ); } else { - if ( mode == 'replace' ) { + if ( mode === 'replace' ) { var actualReplacement; if (isRegex) { @@ -1330,7 +1337,7 @@ $.wikiEditor.modules.dialogs.config = { // Execute the action associated with the first button // when the user presses Enter $(this).closest( '.ui-dialog' ).keypress( function ( e ) { - if ( ( e.keyCode || e.which ) == 13 ) { + if ( ( e.keyCode || e.which ) === 13 ) { var button = $(this).data( 'dialogaction' ) || $(this).find( 'button:first' ); button.click(); e.preventDefault(); @@ -1350,12 +1357,12 @@ $.wikiEditor.modules.dialogs.config = { $( textbox ) .bind( 'keypress.srdialog', function ( e ) { - if ( e.which == 13 ) { + if ( e.which === 13 ) { // Enter var button = dialog.data( 'dialogaction' ) || dialog.find( 'button:first' ); button.click(); e.preventDefault(); - } else if ( e.which == 27 ) { + } else if ( e.which === 27 ) { // Escape $(that).dialog( 'close' ); } diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js b/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js index f6d86d78..6d92966f 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js @@ -42,8 +42,8 @@ $.wikiEditor.modules.dialogs = { }, openDialog: function ( context, module ) { if ( module in $.wikiEditor.modules.dialogs.modules ) { - var mod = $.wikiEditor.modules.dialogs.modules[module]; - var $dialog = $( '#' + mod.id ); + var mod = $.wikiEditor.modules.dialogs.modules[module], + $dialog = $( '#' + mod.id ); if ( $dialog.length === 0 ) { $.wikiEditor.modules.dialogs.fn.reallyCreate( context, mod, module ); $dialog = $( '#' + mod.id ); @@ -82,7 +82,7 @@ $.wikiEditor.modules.dialogs = { module = config[mod]; // Only create the dialog if it's supported, isn't filtered and doesn't exist yet filtered = false; - if ( typeof module.filters != 'undefined' ) { + if ( typeof module.filters !== 'undefined' ) { for ( i = 0; i < module.filters.length; i++ ) { if ( $( module.filters[i] ).length === 0 ) { filtered = true; @@ -92,7 +92,7 @@ $.wikiEditor.modules.dialogs = { } // If the dialog already exists, but for another textarea, simply remove it $existingDialog = $( '#' + module.id ); - if ( $existingDialog.length > 0 && $existingDialog.data( 'context' ).$textarea != context.$textarea ) { + if ( $existingDialog.length > 0 && $existingDialog.data( 'context' ).$textarea !== context.$textarea ) { $existingDialog.remove(); } // Re-select from the DOM, we might have removed the dialog just now @@ -119,13 +119,13 @@ $.wikiEditor.modules.dialogs = { * @param {String} name Dialog name (key in $.wikiEditor.modules.dialogs.modules) */ reallyCreate: function ( context, module, name ) { - var msg, + var msg, dialogDiv, configuration = module.dialog; // Add some stuff to configuration configuration.bgiframe = true; configuration.autoOpen = false; // By default our dialogs are modal, unless explicitely defined in their specific configuration. - if( typeof configuration.modal == "undefined" ) { + if( typeof configuration.modal === 'undefined' ) { configuration.modal = true; } configuration.title = $.wikiEditor.autoMsg( module, 'title' ); @@ -138,7 +138,7 @@ $.wikiEditor.modules.dialogs = { } configuration.buttons = configuration.newButtons; // Create the dialog
      - var dialogDiv = $( '
      ' ) + dialogDiv = $( '
      ' ) .attr( 'id', module.id ) .html( module.html ) .data( 'context', context ) @@ -171,26 +171,28 @@ $.wikiEditor.modules.dialogs = { * NOTE: This function assumes $.ui.dialog has already been loaded */ resize: function () { - var wrapper = $(this).closest( '.ui-dialog' ); - var oldWidth = wrapper.width(); - // Make sure elements don't wrapped so we get an accurate idea of whether they really fit. Also temporarily show - // hidden elements. Work around jQuery bug where
      inside a dialog is both - // :visible and :hidden - var oldHidden = $(this).find( '*' ).not( ':visible' ); + var oldWS, thisWidth, wrapperWidth, + wrapper = $(this).closest( '.ui-dialog' ), + oldWidth = wrapper.width(), + // Make sure elements don't wrapped so we get an accurate idea of whether they really fit. Also temporarily show + // hidden elements. Work around jQuery bug where
      inside a dialog is both + // :visible and :hidden + oldHidden = $(this).find( '*' ).not( ':visible' ); + // Save the style attributes of the hidden elements to restore them later. Calling hide() after show() messes up // for elements hidden with a class oldHidden.each( function () { $(this).data( 'oldstyle', $(this).attr( 'style' ) ); }); oldHidden.show(); - var oldWS = $(this).css( 'white-space' ); + oldWS = $(this).css( 'white-space' ); $(this).css( 'white-space', 'nowrap' ); if ( wrapper.width() <= $(this).get(0).scrollWidth ) { - var thisWidth = $(this).data( 'thisWidth' ) ? $(this).data( 'thisWidth' ) : 0; + thisWidth = $(this).data( 'thisWidth' ) ? $(this).data( 'thisWidth' ) : 0; thisWidth = Math.max( $(this).get(0).width, thisWidth ); $(this).width( thisWidth ); $(this).data( 'thisWidth', thisWidth ); - var wrapperWidth = $(this).data( 'wrapperWidth' ) ? $(this).data( 'wrapperWidth' ) : 0; + wrapperWidth = $(this).data( 'wrapperWidth' ) ? $(this).data( 'wrapperWidth' ) : 0; wrapperWidth = Math.max( wrapper.get(0).scrollWidth, wrapperWidth ); wrapper.width( wrapperWidth ); $(this).data( 'wrapperWidth', wrapperWidth ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.highlight.js b/extensions/WikiEditor/modules/jquery.wikiEditor.highlight.js index 9d964fa7..f646e456 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.highlight.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.highlight.js @@ -20,13 +20,21 @@ $.wikiEditor.modules.highlight = { * Internally used event handlers */ evt: { + /** + * @param context + * @param event + */ delayedChange: function ( context, event ) { - if ( event.data.scope == 'realchange' ) { + if ( event.data.scope === 'realchange' ) { $.wikiEditor.modules.highlight.fn.scan( context ); $.wikiEditor.modules.highlight.fn.mark( context, event.data.scope ); } }, - ready: function ( context, event ) { + /** + * @param context + * @param event + */ + ready: function ( context ) { $.wikiEditor.modules.highlight.fn.scan( context ); $.wikiEditor.modules.highlight.fn.mark( context, 'ready' ); } @@ -39,19 +47,22 @@ $.wikiEditor.modules.highlight = { /** * Creates a highlight module within a wikiEditor * + * @param context * @param config Configuration object to create module from */ - create: function ( context, config ) { + create: function ( context ) { context.modules.highlight.markersStr = ''; }, /** * Scans text division for tokens * + * @param context * @param division */ - scan: function ( context, division ) { + scan: function ( context ) { var tokenArray, text, module, exp, - left, right, match; + left, right, match, + regex, label, markAfter, offset; /*jshint eqnull: true */ // Remove all existing tokens @@ -65,11 +76,11 @@ $.wikiEditor.modules.highlight = { if ( module in $.wikiEditor.modules && 'exp' in $.wikiEditor.modules[module] ) { for ( exp in $.wikiEditor.modules[module].exp ) { // Prepare configuration - var regex = $.wikiEditor.modules[module].exp[exp].regex; - var label = $.wikiEditor.modules[module].exp[exp].label; - var markAfter = $.wikiEditor.modules[module].exp[exp].markAfter || false; + regex = $.wikiEditor.modules[module].exp[exp].regex; + label = $.wikiEditor.modules[module].exp[exp].label; + markAfter = $.wikiEditor.modules[module].exp[exp].markAfter || false; // Search for tokens - var offset = 0; + offset = 0; while ( ( match = text.substr( offset ).match( regex ) ) != null ) { right = ( left = offset + match.index ) + match[0].length; tokenArray[tokenArray.length] = { @@ -95,16 +106,19 @@ $.wikiEditor.modules.highlight = { /** * Marks up text with HTML * + * @param context * @param division * @param tokens */ // FIXME: What do division and tokens do? // TODO: Document the scan() and mark() APIs somewhere - mark: function ( context, division, tokens ) { - var i, subtracted, oldLength, j, o; + mark: function ( context, division ) { + /*jshint eqeqeq:false, onevar:false */ + var i, subtracted, oldLength, j, o, + markers; // Reset markers - var markers = []; + markers = []; // Recycle markers that will be skipped in this run if ( context.modules.highlight.markers && division !== '' ) { @@ -353,8 +367,9 @@ $.wikiEditor.modules.highlight = { // Don't remove these either return true; } - if ( marker && typeof marker.beforeUnwrap === 'function' ) + if ( marker && typeof marker.beforeUnwrap === 'function' ) { marker.beforeUnwrap( this ); + } if ( ( marker && marker.anchor === 'tag' ) || $(this).is( 'p' ) ) { // Remove all classes $(this).removeAttr( 'class' ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.iframe.js b/extensions/WikiEditor/modules/jquery.wikiEditor.iframe.js index 4d425012..538fcb18 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.iframe.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.iframe.js @@ -1,6 +1,6 @@ /* IFrame extension for wikiEditor */ - -( function( $ ) { $.wikiEditor.extensions.iframe = function( context ) { +/*jshint onevar:false, boss:true */ +( function ( $ ) { $.wikiEditor.extensions.iframe = function ( context ) { /* * Event Handlers @@ -14,18 +14,18 @@ context.evt = $.extend( context.evt, { * function is to both classify the scope of changes as 'division' or 'character' and to prevent further * processing of events which did not actually change the content of the iframe. */ - 'keydown': function( event ) { + keydown: function ( event ) { switch ( event.which ) { case 90: // z case 89: // y - if ( event.which == 89 && !$.browser.msie ) { + if ( event.which === 89 && !$.browser.msie ) { // only handle y events for IE return true; } else if ( ( event.ctrlKey || event.metaKey ) && context.history.length ) { // HistoryPosition is a negative number between -1 and -context.history.length, in other words // it's the number of steps backwards from the latest state. var newPosition; - if ( event.shiftKey || event.which == 89 ) { + if ( event.shiftKey || event.which === 89 ) { // Redo newPosition = context.historyPosition + 1; } else { @@ -35,7 +35,7 @@ context.evt = $.extend( context.evt, { // Only act if we are switching to a valid state if ( newPosition >= ( context.history.length * -1 ) && newPosition < 0 ) { // Make sure we run the history storing code before we make this change - context.fn.updateHistory( context.oldDelayedHTML != context.$content.html() ); + context.fn.updateHistory( context.oldDelayedHTML !== context.$content.html() ); context.oldDelayedHistoryPosition = context.historyPosition; context.historyPosition = newPosition; // Change state @@ -65,8 +65,8 @@ context.evt = $.extend( context.evt, { var $tabindexList = $( '[tabindex]:visible' ).sort( function( a, b ) { return a.tabIndex - b.tabIndex; } ); - for( var i=0; i < $tabindexList.length; i++ ) { - if( $tabindexList.eq( i ).attr( 'id' ) == context.$iframe.attr( 'id' ) ) { + for ( var i=0; i < $tabindexList.length; i++ ) { + if ( $tabindexList.eq( i ).attr( 'id' ) === context.$iframe.attr( 'id' ) ) { $tabindexList.get( i + 1 ).focus(); break; } @@ -74,48 +74,48 @@ context.evt = $.extend( context.evt, { return false; } break; - case 86: //v - if ( event.ctrlKey && $.browser.msie && 'paste' in context.evt ) { - //paste, intercepted for IE - context.evt.paste( event ); - } - break; + case 86: //v + if ( event.ctrlKey && $.browser.msie && 'paste' in context.evt ) { + //paste, intercepted for IE + context.evt.paste( event ); + } + break; } return true; }, - 'change': function( event ) { + change: function ( event ) { event.data.scope = 'division'; var newHTML = context.$content.html(); - if ( context.oldHTML != newHTML ) { + if ( context.oldHTML !== newHTML ) { context.fn.purgeOffsets(); context.oldHTML = newHTML; event.data.scope = 'realchange'; } // Never let the body be totally empty - if ( context.$content.children().length == 0 ) { + if ( context.$content.children().length === 0 ) { context.$content.append( '

      ' ); } return true; }, - 'delayedChange': function( event ) { + delayedChange: function ( event ) { event.data.scope = 'division'; var newHTML = context.$content.html(); - if ( context.oldDelayedHTML != newHTML ) { + if ( context.oldDelayedHTML !== newHTML ) { context.oldDelayedHTML = newHTML; event.data.scope = 'realchange'; // Surround by

      if it does not already have it var cursorPos = context.fn.getCaretPosition(); var t = context.fn.getOffset( cursorPos[0] ); - if ( ! $.browser.msie && t && t.node.nodeName == '#text' && t.node.parentNode.nodeName.toLowerCase() == 'body' ) { - $( t.node ).wrap( "

      " ); + if ( ! $.browser.msie && t && t.node.nodeName === '#text' && t.node.parentNode.nodeName.toLowerCase() === 'body' ) { + $( t.node ).wrap( '

      ' ); context.fn.purgeOffsets(); context.fn.setSelection( { start: cursorPos[0], end: cursorPos[1] } ); } } - context.fn.updateHistory( event.data.scope == 'realchange' ); + context.fn.updateHistory( event.data.scope === 'realchange' ); return true; }, - 'cut': function( event ) { + cut: function ( event ) { setTimeout( function() { context.$content.find( 'br' ).each( function() { if ( $(this).parent().is( 'body' ) ) { @@ -125,7 +125,7 @@ context.evt = $.extend( context.evt, { }, 100 ); return true; }, - 'paste': function( event ) { + paste: function ( event ) { // Save the cursor position to restore it after all this voodoo var cursorPos = context.fn.getCaretPosition(); var oldLength = context.fn.getContents().length; @@ -138,6 +138,7 @@ context.evt = $.extend( context.evt, { } setTimeout( function() { + /*jshint eqnull:true */ // Kill stuff we know we don't want context.$content.find( 'script,style,img,input,select,textarea,hr,button,link,meta' ).remove(); var nodeToDelete = []; @@ -152,30 +153,31 @@ context.evt = $.extend( context.evt, { } if ( elementAtCursor == null || elementAtCursor.node == null ) { context.$content.prepend( '

      ' ); - firstDirtyNode = context.$content.children()[0]; + firstDirtyNode = context.$content.children()[0]; } else { firstDirtyNode = elementAtCursor.node; } - //this is ugly but seems like the best way to handle the case where we select and replace all editor contents + // This is ugly but seems like the best way to handle the case where we select and replace all editor contents try { + /*jshint expr:true */ firstDirtyNode.parentNode; } catch ( err ) { context.$content.prepend( '

      ' ); - firstDirtyNode = context.$content.children()[0]; + firstDirtyNode = context.$content.children()[0]; } while ( firstDirtyNode != null ) { //we're going to replace the contents of the entire parent node. - while ( firstDirtyNode.parentNode && firstDirtyNode.parentNode.nodeName != 'BODY' - && ! $( firstDirtyNode ).hasClass( 'wikiEditor' ) - ) { + while ( firstDirtyNode.parentNode && firstDirtyNode.parentNode.nodeName !== 'BODY' && + !$( firstDirtyNode ).hasClass( 'wikiEditor' ) + ) { firstDirtyNode = firstDirtyNode.parentNode; } //go back till we find the first pasted node - while ( firstDirtyNode.previousSibling != null - && ! $( firstDirtyNode.previousSibling ).hasClass( 'wikiEditor' ) - ) { + while ( firstDirtyNode.previousSibling != null && + !$( firstDirtyNode.previousSibling ).hasClass( 'wikiEditor' ) + ) { if ( $( firstDirtyNode.previousSibling ).hasClass( '#comment' ) ) { $( firstDirtyNode ).remove(); @@ -185,9 +187,9 @@ context.evt = $.extend( context.evt, { } if ( firstDirtyNode.previousSibling != null ) { - $lastDirtyNode = $( firstDirtyNode.previousSibling ); + $lastDirtyNode = $( firstDirtyNode.previousSibling ); } else { - $lastDirtyNode = $( firstDirtyNode ); + $lastDirtyNode = $( firstDirtyNode ); } var cc = makeContentCollector( $.browser, null ); @@ -218,7 +220,7 @@ context.evt = $.extend( context.evt, { } - if( !pastedPretty && $.browser.msie && i == 0 ) { + if ( !pastedPretty && $.browser.msie && i === 0 ) { continue; } $newElement = $( '

      ' ); @@ -241,7 +243,7 @@ context.evt = $.extend( context.evt, { //anything without wikiEditor class was pasted. $selection = context.$content.find( ':not(.wikiEditor)' ); - if ( $selection.length == 0 ) { + if ( $selection.length === 0 ) { break; } else { firstDirtyNode = $selection.eq( 0 )[0]; @@ -260,7 +262,7 @@ context.evt = $.extend( context.evt, { }, 0 ); return true; }, - 'ready': function( event ) { + ready: function ( event ) { // Initialize our history queue if ( context.$content ) { context.history.push( { 'html': context.$content.html(), 'sel': context.fn.getCaretPosition() } ); @@ -275,7 +277,11 @@ context.evt = $.extend( context.evt, { * Internally used functions */ context.fn = $.extend( context.fn, { - 'highlightLine': function( $element, mode ) { + /** + * @param {jQuery} $element + * @param mode + */ + highlightLine: function ( $element ) { if ( !$element.is( 'p' ) ) { $element = $element.closest( 'p' ); } @@ -283,7 +289,7 @@ context.fn = $.extend( context.fn, { setTimeout( function() { $element.animate( { 'backgroundColor': 'white' }, 'slow' ); }, 100 ); setTimeout( function() { $element.css( 'backgroundColor', 'white' ); }, 1000 ); }, - 'htmlToText': function( html ) { + htmlToText: function ( html ) { // This function is slow for large inputs, so aggressively cache input/output pairs if ( html in context.htmlToTextMap ) { return context.htmlToTextMap[html]; @@ -294,15 +300,15 @@ context.fn = $.extend( context.fn, { // IE does overzealous whitespace collapsing for $( '
      ' ).html( html );
       		// We also do 
      and easy cases for

      conversion here, complicated cases are handled later html = html - .replace( /\r?\n/g, "" ) // IE7 inserts newlines before block elements - .replace( / /g, " " ) // We inserted these to prevent IE from collapsing spaces - .replace( /\]*\>\<\/p\>/gi, '

      ' ) // Remove trailing
      from

      - .replace( /\<\/p\>\s*\]*\>/gi, "\n" ) // Easy case for

      conversion - .replace( /\]*\>/gi, "\n" ) //
      conversion - .replace( /\<\/p\>(\n*)\]*\>/gi, "$1\n" ) + .replace( /\r?\n/g, '' ) // IE7 inserts newlines before block elements + .replace( / /g, ' ' ) // We inserted these to prevent IE from collapsing spaces + .replace( /]*\><\/p\>/gi, '

      ' ) // Remove trailing
      from

      + .replace( /<\/p\>\s*]*\>/gi, '\n' ) // Easy case for

      conversion + .replace( /]*\>/gi, '\n' ) //
      conversion + .replace( /<\/p\>(\n*)]*\>/gi, '$1\n' ) // Un-nest

      tags - .replace( /\]*\>]*\>/gi, '

      ' ) - .replace( /\<\/p\><\/p\>/gi, '

      ' ); + .replace( /]*\>]*\>/gi, '

      ' ) + .replace( /<\/p\><\/p\>/gi, '

      ' ); // Save leading and trailing whitespace now and restore it later. IE eats it all, and even Firefox // won't leave everything alone var leading = html.match( /^\s*/ )[0]; @@ -311,8 +317,8 @@ context.fn = $.extend( context.fn, { var $pre = $( '
      ' + html + '
      ' ); $pre.find( '.wikiEditor-noinclude' ).each( function() { $( this ).remove(); } ); // Convert tabs,

      s and
      s back - $pre.find( '.wikiEditor-tab' ).each( function() { $( this ).text( "\t" ); } ); - $pre.find( 'br' ).each( function() { $( this ).replaceWith( "\n" ); } ); + $pre.find( '.wikiEditor-tab' ).each( function() { $( this ).text( '\t' ); } ); + $pre.find( 'br' ).each( function() { $( this ).replaceWith( '\n' ); } ); // Converting

      s is wrong if there's nothing before them, so check that. // .find( '* + p' ) isn't good enough because textnodes aren't considered $pre.find( 'p' ).each( function() { @@ -323,21 +329,21 @@ context.fn = $.extend( context.fn, { // Check for preceding text var t = new context.fn.rawTraverser( this.firstChild, this, $pre.get( 0 ), true ).prev(); - while ( t && t.node.nodeName != '#text' && t.node.nodeName != 'BR' && t.node.nodeName != 'P' ) { + while ( t && t.node.nodeName !== '#text' && t.node.nodeName !== 'BR' && t.node.nodeName !== 'P' ) { t = t.prev(); } if ( t ) { - text = "\n" + text; + text = '\n' + text; } // Check for following text t = new context.fn.rawTraverser( this.lastChild, this, $pre.get( 0 ), true ).next(); - while ( t && t.node.nodeName != '#text' && t.node.nodeName != 'BR' && t.node.nodeName != 'P' ) { + while ( t && t.node.nodeName !== '#text' && t.node.nodeName !== 'BR' && t.node.nodeName !== 'P' ) { t = t.next(); } - if ( t && !t.inP && t.node.nodeName == '#text' && t.node.nodeValue.charAt( 0 ) != '\n' - && t.node.nodeValue.charAt( 0 ) != '\r' ) { - text += "\n"; + if ( t && !t.inP && t.node.nodeName === '#text' && t.node.nodeValue.charAt( 0 ) !== '\n' && + t.node.nodeValue.charAt( 0 ) !== '\r' ) { + text += '\n'; } $( this ).text( text ); } ); @@ -357,8 +363,8 @@ context.fn = $.extend( context.fn, { * @param strict If true, the element the selection starts in cannot match (default: false) * @return jQuery object or null if unknown */ - 'beforeSelection': function( classname, strict ) { - if ( typeof classname == 'undefined' ) { + beforeSelection: function ( classname, strict ) { + if ( typeof classname === 'undefined' ) { classname = ''; } var e = null, offset = null; @@ -381,7 +387,7 @@ context.fn = $.extend( context.fn, { // When the cursor is on an empty line, Opera gives us a bogus range object with // startContainer=endContainer=body and startOffset=endOffset=1 var body = context.$iframe[0].contentWindow.document.body; - if ( $.browser.opera && e == body && offset == 1 ) { + if ( $.browser.opera && e === body && offset === 1 ) { return null; } } @@ -400,14 +406,14 @@ context.fn = $.extend( context.fn, { return null; } var seekPos = context.fn.htmlToText( range2.htmlText ).length; - var offset = context.fn.getOffset( seekPos ); + offset = context.fn.getOffset( seekPos ); e = offset ? offset.node : null; offset = offset ? offset.offset : null; if ( !e ) { return null; } } - if ( e.nodeName != '#text' ) { + if ( e.nodeName !== '#text' ) { // The selection is not in a textnode, but between two non-text nodes // (usually inside the between two
      s). Go to the rightmost // child of the node just before the selection @@ -425,7 +431,7 @@ context.fn = $.extend( context.fn, { // constructor thousands of times is very inefficient var classStr = ' ' + classname + ' '; while ( e ) { - if ( !strict && ( !classname || ( ' ' + e.className + ' ' ).indexOf( classStr ) != -1 ) ) { + if ( !strict && ( !classname || ( ' ' + e.className + ' ' ).indexOf( classStr ) !== -1 ) ) { return $( e ); } var next = e.previousSibling; @@ -440,7 +446,7 @@ context.fn = $.extend( context.fn, { /** * Object used by traverser(). Don't use this unless you know what you're doing */ - 'rawTraverser': function( node, inP, ancestor, skipNoinclude ) { + rawTraverser: function ( node, inP, ancestor, skipNoinclude ) { this.node = node; this.inP = inP; this.ancestor = ancestor; @@ -450,16 +456,16 @@ context.fn = $.extend( context.fn, { var nextInP = this.inP; while ( p && !p.nextSibling ) { p = p.parentNode; - if ( p == this.ancestor ) { + if ( p === this.ancestor ) { // We're back at the ancestor, stop here p = null; } - if ( p && p.nodeName == "P" ) { + if ( p && p.nodeName === 'P' ) { nextInP = null; } } p = p ? p.nextSibling : null; - if ( p && p.nodeName == "P" ) { + if ( p && p.nodeName === 'P' ) { nextInP = p; } do { @@ -467,13 +473,13 @@ context.fn = $.extend( context.fn, { // Don't use $( p ).hasClass( 'wikiEditor-noinclude' ) because // $() is slow in a tight loop if ( this.skipNoinclude ) { - while ( p && ( ' ' + p.className + ' ' ).indexOf( ' wikiEditor-noinclude ' ) != -1 ) { + while ( p && ( ' ' + p.className + ' ' ).indexOf( ' wikiEditor-noinclude ' ) !== -1 ) { p = p.nextSibling; } } if ( p && p.firstChild ) { p = p.firstChild; - if ( p.nodeName == "P" ) { + if ( p.nodeName === 'P' ) { nextInP = p; } } @@ -487,16 +493,16 @@ context.fn = $.extend( context.fn, { var prevInP = this.inP; while ( p && !p.previousSibling ) { p = p.parentNode; - if ( p == this.ancestor ) { + if ( p === this.ancestor ) { // We're back at the ancestor, stop here p = null; } - if ( p && p.nodeName == "P" ) { + if ( p && p.nodeName === 'P' ) { prevInP = null; } } p = p ? p.previousSibling : null; - if ( p && p.nodeName == "P" ) { + if ( p && p.nodeName === 'P' ) { prevInP = p; } do { @@ -510,7 +516,7 @@ context.fn = $.extend( context.fn, { } if ( p && p.lastChild ) { p = p.lastChild; - if ( p.nodeName == "P" ) { + if ( p.nodeName == 'P' ) { prevInP = p; } } @@ -528,28 +534,28 @@ context.fn = $.extend( context.fn, { * @return Traverser object, use .next() or .prev() to get a traverser object referring to the * previous/next node */ - 'traverser': function( start ) { + traverser: function ( start ) { // Find the leftmost leaf node in the tree var startNode = start.jquery ? start.get( 0 ) : start; var node = startNode; - var inP = node.nodeName == "P" ? node : null; + var inP = node.nodeName === 'P' ? node : null; do { // Filter nodes with the wikiEditor-noinclude class // Don't use $( p ).hasClass( 'wikiEditor-noinclude' ) because // $() is slow in a tight loop - while ( node && ( ' ' + node.className + ' ' ).indexOf( ' wikiEditor-noinclude ' ) != -1 ) { + while ( node && ( ' ' + node.className + ' ' ).indexOf( ' wikiEditor-noinclude ' ) !== -1 ) { node = node.nextSibling; } if ( node && node.firstChild ) { node = node.firstChild; - if ( node.nodeName == "P" ) { + if ( node.nodeName === 'P' ) { inP = node; } } } while ( node && node.firstChild ); return new context.fn.rawTraverser( node, inP, startNode, true ); }, - 'getOffset': function( offset ) { + getOffset: function ( offset ) { if ( !context.offsets ) { context.fn.refreshOffsets(); } @@ -578,21 +584,21 @@ context.fn = $.extend( context.fn, { 'lastTextNode': base.lastTextNode }; }, - 'purgeOffsets': function() { + purgeOffsets: function () { context.offsets = null; }, - 'refreshOffsets': function() { + refreshOffsets: function () { context.offsets = [ ]; var t = context.fn.traverser( context.$content ); var pos = 0, lastTextNode = null; while ( t ) { - if ( t.node.nodeName != '#text' && t.node.nodeName != 'BR' ) { + if ( t.node.nodeName !== '#text' && t.node.nodeName !== 'BR' ) { t = t.next(); continue; } - var nextPos = t.node.nodeName == '#text' ? pos + t.node.nodeValue.length : pos + 1; + var nextPos = t.node.nodeName === '#text' ? pos + t.node.nodeValue.length : pos + 1; var nextT = t.next(); - var leavingP = t.node.nodeName == '#text' && t.inP && nextT && ( !nextT.inP || nextT.inP != t.inP ); + var leavingP = t.node.nodeName === '#text' && t.inP && nextT && ( !nextT.inP || nextT.inP !== t.inP ); context.offsets[pos] = { 'node': t.node, 'offset': 0, @@ -610,27 +616,27 @@ context.fn = $.extend( context.fn, { }; } pos = nextPos + ( leavingP ? 1 : 0 ); - if ( t.node.nodeName == '#text' ) { + if ( t.node.nodeName === '#text' ) { lastTextNode = t.node; } t = nextT; } }, - 'saveCursorAndScrollTop': function() { + saveCursorAndScrollTop: function () { // Stub out textarea behavior return; }, - 'restoreCursorAndScrollTop': function() { + restoreCursorAndScrollTop: function () { // Stub out textarea behavior return; }, - 'saveSelection': function() { + saveSelection: function () { if ( $.client.profile().name === 'msie' ) { context.$iframe[0].contentWindow.focus(); context.savedSelection = context.$iframe[0].contentWindow.document.selection.createRange(); } }, - 'restoreSelection': function() { + restoreSelection: function () { if ( $.client.profile().name === 'msie' && context.savedSelection !== null ) { context.$iframe[0].contentWindow.focus(); context.savedSelection.select(); @@ -640,10 +646,10 @@ context.fn = $.extend( context.fn, { /** * Update the history queue * - * @param htmlChange pass true or false to inidicate if there was a text change that should potentially + * @param htmlChange Pass true or false to inidicate if there was a text change that should potentially * be given a new history state. */ - 'updateHistory': function( htmlChange ) { + updateHistory: function ( htmlChange ) { var newHTML = context.$content.html(); var newSel = context.fn.getCaretPosition(); // Was text changed? Was it because of a REDO or UNDO action? @@ -675,7 +681,7 @@ context.fn = $.extend( context.fn, { /** * Sets up the iframe in place of the textarea to allow more advanced operations */ - 'setupIframe': function() { + setupIframe: function () { context.$iframe = $( '' ) .attr( { 'frameBorder': 0, @@ -834,7 +840,7 @@ context.fn = $.extend( context.fn, { * equivilant functionality to the otherwise textarea-based functionality. */ - 'getElementAtCursor': function() { + getElementAtCursor: function () { if ( context.$iframe[0].contentWindow.getSelection ) { // Firefox and Opera var selection = context.$iframe[0].contentWindow.getSelection(); @@ -855,7 +861,7 @@ context.fn = $.extend( context.fn, { /** * Gets the complete contents of the iframe (in plain text, not HTML) */ - 'getContents': function() { + getContents: function () { // For

      , .html() returns

       

      in IE // This seems to convince IE while not affecting display if ( !context.$content ) { @@ -880,7 +886,7 @@ context.fn = $.extend( context.fn, { * Gets the currently selected text in the content * DO NOT CALL THIS DIRECTLY, use $.textSelection( 'functionname', options ) instead */ - 'getSelection': function() { + getSelection: function () { var retval; if ( context.$iframe[0].contentWindow.getSelection ) { // Firefox and Opera @@ -915,7 +921,7 @@ context.fn = $.extend( context.fn, { * selection is empty. * DO NOT CALL THIS DIRECTLY, use $.textSelection( 'functionname', options ) instead */ - 'encapsulateSelection': function( options ) { + encapsulateSelection: function ( options ) { var selText = $(this).textSelection( 'getSelection' ); var selTextArr; var collapseToEnd = false; @@ -1127,7 +1133,7 @@ context.fn = $.extend( context.fn, { * Gets the position (in resolution of bytes not nessecarily characters) in a textarea * DO NOT CALL THIS DIRECTLY, use $.textSelection( 'functionname', options ) instead */ - 'getCaretPosition': function( options ) { + getCaretPosition: function ( options ) { var startPos = null, endPos = null; if ( context.$iframe[0].contentWindow.getSelection ) { var selection = context.$iframe[0].contentWindow.getSelection(); @@ -1264,7 +1270,7 @@ context.fn = $.extend( context.fn, { * @param startContainer Element in iframe to start selection in. If not set, start is a character offset * @param endContainer Element in iframe to end selection in. If not set, end is a character offset */ - 'setSelection': function( options ) { + setSelection: function ( options ) { var sc = options.startContainer, ec = options.endContainer; sc = sc && sc.jquery ? sc[0] : sc; ec = ec && ec.jquery ? ec[0] : ec; @@ -1351,7 +1357,7 @@ context.fn = $.extend( context.fn, { * Scroll a textarea to the current cursor position. You can set the cursor position with setSelection() * DO NOT CALL THIS DIRECTLY, use $.textSelection( 'functionname', options ) instead */ - 'scrollToCaretPosition': function( options ) { + scrollToCaretPosition: function ( options ) { context.fn.scrollToTop( context.fn.getElementAtCursor(), true ); }, /** @@ -1361,7 +1367,7 @@ context.fn = $.extend( context.fn, { * @param $element jQuery object containing an element in the iframe * @param force If true, scroll the element even if it's already visible */ - 'scrollToTop': function( $element, force ) { + scrollToTop: function ( $element, force ) { var html = context.$content.closest( 'html' ), body = context.$content.closest( 'body' ), parentHtml = $( 'html' ), diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.js b/extensions/WikiEditor/modules/jquery.wikiEditor.js index def8b69e..85030b66 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.js @@ -8,7 +8,8 @@ * $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'toolbar', { ... config ... } ); * */ -( function ( $ ) { +/*jshint onevar:false, boss:true */ +( function ( $, mw ) { /** * Global static object for wikiEditor that provides generally useful functionality to all modules and contexts. @@ -113,7 +114,7 @@ $.wikiEditor = { isRequired: function ( module, requirement ) { if ( typeof module.req !== 'undefined' ) { for ( var req in module.req ) { - if ( module.req[req] == requirement ) { + if ( module.req[req] === requirement ) { return true; } } @@ -132,9 +133,10 @@ $.wikiEditor = { * with the key 'bar'. */ autoMsg: function ( object, property ) { + var i, p; // Accept array of possible properties, of which the first one found will be used - if ( typeof property == 'object' ) { - for ( var i in property ) { + if ( typeof property === 'object' ) { + for ( i in property ) { if ( property[i] in object || property[i] + 'Msg' in object ) { property = property[i]; break; @@ -144,11 +146,11 @@ $.wikiEditor = { if ( property in object ) { return object[property]; } else if ( property + 'Msg' in object ) { - var p = object[property + 'Msg']; + p = object[property + 'Msg']; if ( $.isArray( p ) && p.length >= 2 ) { - return mediaWiki.message.apply( mediaWiki.message, p ).plain(); + return mw.message.apply( mw.message, p ).plain(); } else { - return mediaWiki.message( p ).plain(); + return mw.message( p ).plain(); } } else { return ''; @@ -181,10 +183,10 @@ $.wikiEditor = { var src = $.wikiEditor.autoLang( icon, lang ); path = path || $.wikiEditor.imgPath; // Prepend path if src is not absolute - if ( src.substr( 0, 7 ) != 'http://' && src.substr( 0, 8 ) != 'https://' && src[0] != '/' ) { + if ( src.substr( 0, 7 ) !== 'http://' && src.substr( 0, 8 ) !== 'https://' && src[0] !== '/' ) { src = path + src; } - return src + '?' + mw.loader.version( 'jquery.wikiEditor' ); + return src + '?' + mw.loader.getVersion( 'jquery.wikiEditor' ); }, /** @@ -197,9 +199,9 @@ $.wikiEditor = { */ autoIconOrOffset: function ( icon, offset, path, lang ) { lang = lang || mw.config.get( 'wgUserLanguage' ); - if ( typeof offset == 'object' && lang in offset ) { + if ( typeof offset === 'object' && lang in offset ) { return offset[lang]; - } else if ( typeof icon == 'object' && lang in icon ) { + } else if ( typeof icon === 'object' && lang in icon ) { return $.wikiEditor.autoIcon( icon, undefined, lang ); } else { return $.wikiEditor.autoLang( offset, lang ); @@ -223,7 +225,7 @@ if ( !$.wikiEditor.isSupported() ) { // where we left off var context = $(this).data( 'wikiEditor-context' ); // On first call, we need to set things up, but on all following calls we can skip right to the API handling -if ( !context || typeof context == 'undefined' ) { +if ( !context || typeof context === 'undefined' ) { // Star filling the context with useful data - any jQuery selections, as usual should be named with a preceding $ context = { @@ -247,7 +249,7 @@ if ( !context || typeof context == 'undefined' ) { 'oldDelayedHTML': null, // The previous selection of the iframe, stored to detect whether the selection has changed 'oldDelayedSel': null, - // Saved selection state for IE + // Saved selection state for old IE (<=10) 'savedSelection': null, // Stack of states in { html: [string] } form 'history': [], @@ -276,14 +278,14 @@ if ( !context || typeof context == 'undefined' ) { 'addModule': function ( context, data ) { var module, call, modules = {}; - if ( typeof data == 'string' ) { + if ( typeof data === 'string' ) { modules[data] = {}; - } else if ( typeof data == 'object' ) { + } else if ( typeof data === 'object' ) { modules = data; } for ( module in modules ) { // Check for the existance of an available / supported module with a matching name and a create function - if ( typeof module == 'string' && typeof $.wikiEditor.modules[module] !== 'undefined' && + if ( typeof module === 'string' && typeof $.wikiEditor.modules[module] !== 'undefined' && $.wikiEditor.isSupported( $.wikiEditor.modules[module] ) ) { // Extend the context's core API with this module's own API calls @@ -326,11 +328,11 @@ if ( !context || typeof context == 'undefined' ) { */ trigger: function ( name, event ) { // Event is an optional argument, but from here on out, at least the type field should be dependable - if ( typeof event == 'undefined' ) { + if ( typeof event === 'undefined' ) { event = { 'type': 'custom' }; } // Ensure there's a place for extra information to live - if ( typeof event.data == 'undefined' ) { + if ( typeof event.data === 'undefined' ) { event.data = {}; } @@ -393,7 +395,7 @@ if ( !context || typeof context == 'undefined' ) { // Return the newly appended tab return $( '
      ' ) .attr( 'rel', 'wikiEditor-ui-view-' + options.name ) - .addClass( context.view == options.name ? 'current' : null ) + .addClass( context.view === options.name ? 'current' : null ) .append( $( '' ) .attr( 'href', '#' ) .mousedown( function () { @@ -406,7 +408,7 @@ if ( !context || typeof context == 'undefined' ) { context.$tabs.find( 'div' ).removeClass( 'current' ); $(this).parent().addClass( 'current' ); $(this).blur(); - if ( 'init' in options && typeof options.init == 'function' ) { + if ( 'init' in options && typeof options.init === 'function' ) { options.init( context ); } event.preventDefault(); @@ -457,17 +459,17 @@ if ( !context || typeof context == 'undefined' ) { }, /** - * Save text selection for IE + * Save text selection for old IE (<=10) */ saveSelection: function () { - if ( $.client.profile().name === 'msie' ) { + if ( $.client.profile().name === 'msie' && document.selection && document.selection.createRange ) { context.$textarea.focus(); context.savedSelection = document.selection.createRange(); } }, /** - * Restore text selection for IE + * Restore text selection for old IE (<=10) */ restoreSelection: function () { if ( $.client.profile().name === 'msie' && context.savedSelection !== null ) { @@ -478,6 +480,13 @@ if ( !context || typeof context == 'undefined' ) { } }; + /** + * Workaround for a scrolling bug in IE8 (bug 61908) + */ + if ( $.client.profile().name === 'msie' ) { + context.$textarea.css( 'height', context.$textarea.height() ); + } + /** * Base UI Construction * @@ -539,9 +548,9 @@ if ( !context || typeof context == 'undefined' ) { var args = $.makeArray( arguments ); // Dynamically setup core extensions for modules that are required -if ( args[0] == 'addModule' && typeof args[1] !== 'undefined' ) { +if ( args[0] === 'addModule' && typeof args[1] !== 'undefined' ) { var modules = args[1]; - if ( typeof modules !== "object" ) { + if ( typeof modules !== 'object' ) { modules = {}; modules[args[1]] = ''; } @@ -577,4 +586,4 @@ return $(this).data( 'wikiEditor-context', context ); }; -}( jQuery ) ); +}( jQuery, mediaWiki ) ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.preview.js b/extensions/WikiEditor/modules/jquery.wikiEditor.preview.js index 39907364..372d2e8e 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.preview.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.preview.js @@ -1,6 +1,6 @@ /* Preview module for wikiEditor */ ( function ( $, mw ) { - +/*jshint onevar:false */ $.wikiEditor.modules.preview = { /** @@ -32,7 +32,7 @@ fn: { * @param context Context object of editor to create module in * @param config Configuration object to create module from */ - create: function ( context, config ) { + create: function ( context ) { if ( 'initialized' in context.modules.preview ) { return; } @@ -65,9 +65,9 @@ fn: { }, function ( data ) { if ( - typeof data.parse == 'undefined' || - typeof data.parse.text == 'undefined' || - typeof data.parse.text['*'] == 'undefined' + typeof data.parse === 'undefined' || + typeof data.parse.text === 'undefined' || + typeof data.parse.text['*'] === 'undefined' ) { return; } @@ -89,7 +89,7 @@ fn: { // Gets the latest copy of the wikitext var wikitext = context.$textarea.textSelection( 'getContents' ); // Aborts when nothing has changed since the last time - if ( context.modules.preview.changesText == wikitext ) { + if ( context.modules.preview.changesText === wikitext ) { return; } context.$changesTab.find( 'table.diff tbody' ).empty(); @@ -115,8 +115,9 @@ fn: { rvprop: '' }; var section = $( '[name="wpSection"]' ).val(); - if ( section !== '' ) + if ( section !== '' ) { postdata2.rvsection = section; + } $.post( mw.util.wikiScript( 'api' ), postdata2, function ( data ) { // Add diff CSS diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js b/extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js index ca88c79a..5381e605 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js @@ -1,5 +1,6 @@ /* Publish module for wikiEditor */ -( function( $ ) { $.wikiEditor.modules.previewDialog = { +/*jshint onevar:false */ +( function ( $, mw ) { $.wikiEditor.modules.previewDialog = { /** * Compatability map @@ -29,7 +30,7 @@ fn: { * @param context Context object of editor to create module in * @param config Configuration object to create module from */ - create: function( context, config ) { + create: function( context ) { // Build the dialog behind the Publish button var dialogID = 'wikiEditor-' + context.instance + '-preview-dialog'; $.wikiEditor.modules.dialogs.fn.create( @@ -78,7 +79,7 @@ fn: { .css( 'top', '25px' ); // $dialog.dialog( 'option', 'width', $( 'body' ).width() - 300 ); // Aborts when nothing has changed since the last preview - if ( context.modules.preview.previewText == wikitext ) { + if ( context.modules.preview.previewText === wikitext ) { return; } @@ -96,9 +97,9 @@ fn: { }, function( data ) { if ( - typeof data.parse == 'undefined' || - typeof data.parse.text == 'undefined' || - typeof data.parse.text['*'] == 'undefined' + typeof data.parse === 'undefined' || + typeof data.parse.text === 'undefined' || + typeof data.parse.text['*'] === 'undefined' ) { return; } @@ -128,4 +129,4 @@ fn: { } } -}; } )( jQuery ); +}; } )( jQuery, mediaWiki ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js b/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js index b61140dc..058fa1b3 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js @@ -1,4 +1,5 @@ /* Publish module for wikiEditor */ +/*jshint onevar:false */ ( function ( $ ) { $.wikiEditor.modules.publish = { @@ -31,7 +32,7 @@ fn: { * @param context Context object of editor to create module in * @param config Configuration object to create module from */ - create: function ( context, config ) { + create: function ( context ) { // Build the dialog behind the Publish button var dialogID = 'wikiEditor-' + context.instance + '-dialog'; $.wikiEditor.modules.dialogs.fn.create( @@ -89,16 +90,18 @@ fn: { ); /* END OF REALLY DIRTY HACK */ - if ( $( '#wpMinoredit' ).length === 0 ) + if ( $( '#wpMinoredit' ).length === 0 ) { $( '#wikiEditor-' + context.instance + '-dialog-minor' ).hide(); - else if ( $( '#wpMinoredit' ).is( ':checked' ) ) + } else if ( $( '#wpMinoredit' ).prop( 'checked' ) ) { $( '#wikiEditor-' + context.instance + '-dialog-minor' ) .prop( 'checked', true ); - if ( $( '#wpWatchthis' ).length === 0 ) + } + if ( $( '#wpWatchthis' ).length === 0 ) { $( '#wikiEditor-' + context.instance + '-dialog-watch' ).hide(); - else if ( $( '#wpWatchthis' ).is( ':checked' ) ) + } else if ( $( '#wpWatchthis' ).prop( 'checked' ) ) { $( '#wikiEditor-' + context.instance + '-dialog-watch' ) .prop( 'checked', true ); + } $(this).find( 'form' ).submit( function ( e ) { $(this).closest( '.ui-dialog' ).find( 'button:first' ).click(); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.templateEditor.js b/extensions/WikiEditor/modules/jquery.wikiEditor.templateEditor.js index bd00325f..3cbd5ba5 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.templateEditor.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.templateEditor.js @@ -1,5 +1,6 @@ /* TemplateEditor module for wikiEditor */ -( function( $ ) { $.wikiEditor.modules.templateEditor = { +/*jshint quotmark:false, onevar:false */ +( function ( $ ) { $.wikiEditor.modules.templateEditor = { /** * Name mappings, dirty hack which will be removed once "TemplateInfo" extension is more fully supported */ @@ -37,9 +38,13 @@ */ evt: { - mark: function( context, event ) { + /** + * @param context + * @param event + */ + mark: function( context ) { // The markers returned by this function are skipped on realchange, so don't regenerate them in that case - if ( context.modules.highlight.currentScope == 'realchange' ) { + if ( context.modules.highlight.currentScope === 'realchange' ) { return; } @@ -47,10 +52,9 @@ evt: { var markers = context.modules.highlight.markers; var tokenArray = context.modules.highlight.tokenArray; // Collect matching level 0 template call boundaries from the tokenArray - var level = 0; var tokenIndex = 0; while ( tokenIndex < tokenArray.length ){ - while ( tokenIndex < tokenArray.length && tokenArray[tokenIndex].label != 'TEMPLATE_BEGIN' ) { + while ( tokenIndex < tokenArray.length && tokenArray[tokenIndex].label !== 'TEMPLATE_BEGIN' ) { tokenIndex++; } //open template @@ -58,19 +62,18 @@ evt: { var beginIndex = tokenIndex; var endIndex = -1; //no match found var openTemplates = 1; - var templatesMatched = false; - while ( tokenIndex < tokenArray.length - 1 && endIndex == -1 ) { + while ( tokenIndex < tokenArray.length - 1 && endIndex === -1 ) { tokenIndex++; - if ( tokenArray[tokenIndex].label == 'TEMPLATE_BEGIN' ) { + if ( tokenArray[tokenIndex].label === 'TEMPLATE_BEGIN' ) { openTemplates++; - } else if ( tokenArray[tokenIndex].label == 'TEMPLATE_END' ) { + } else if ( tokenArray[tokenIndex].label === 'TEMPLATE_END' ) { openTemplates--; - if ( openTemplates == 0 ) { + if ( openTemplates === 0 ) { endIndex = tokenIndex; } //we can stop looping } }//while finding template ending - if ( endIndex != -1 ) { + if ( endIndex !== -1 ) { markers.push( { start: tokenArray[beginIndex].offset, end: tokenArray[endIndex].offset, @@ -92,7 +95,7 @@ evt: { } }, onSkip: function( node ) { - if ( $( node ).html() == $( node ).data( 'oldHTML' ) ) { + if ( $( node ).html() === $( node ).data( 'oldHTML' ) ) { // No change return; } @@ -104,7 +107,7 @@ evt: { if ( $( node ).parent().hasClass( 'wikiEditor-template' ) ) { var $label = $( node ).parent().find( '.wikiEditor-template-label' ); var displayName = $.wikiEditor.modules.templateEditor.fn.getTemplateDisplayName( model ); - if ( $label.text() != displayName ) { + if ( $label.text() !== displayName ) { $label.text( displayName ); } } @@ -119,7 +122,7 @@ evt: { $.wikiEditor.modules.templateEditor.fn.bindTemplateEvents( $( node ) ); } }, - getAnchor: function( ca1, ca2 ) { + getAnchor: function( ca1 ) { return $( ca1.parentNode ).is( 'span.wikiEditor-template-text' ) ? ca1.parentNode : null; }, @@ -142,7 +145,9 @@ evt: { var $evtElem = event.jQueryNode; if ( $evtElem.hasClass( 'wikiEditor-template-label' ) ) { // Allow anything if the command or control key are depressed - if ( event.ctrlKey || event.metaKey ) return true; + if ( event.ctrlKey || event.metaKey ) { + return true; + } switch ( event.which ) { case 13: // Enter $evtElem.click(); @@ -177,14 +182,22 @@ evt: { } } }, - keyup: function( context, event ) { + /** + * @param context + * @param event + */ + keyup: function( context ) { // Rest our ignoreKeypress variable if it's set to true if ( context.$iframe.data( 'ignoreKeypress' ) ) { context.$iframe.data( 'ignoreKeypress', false ); } return true; }, - keypress: function( context, event ) { + /** + * @param context + * @param event + */ + keypress: function( context ) { // If this event is from a keydown event which we want to block, ignore it return ( context.$iframe.data( 'ignoreKeypress' ) ? false : true ); } @@ -210,7 +223,7 @@ fn: { * @param context Context object of editor to create module in * @param config Configuration object to create module from */ - create: function( context, config ) { + create: function( context ) { // Initialize module within the context context.modules.templateEditor = {}; }, @@ -220,8 +233,7 @@ fn: { */ wrapTemplate: function( $wrapper ) { var model = $wrapper.data( 'model' ); - var context = $wrapper.data( 'marker' ).context; - var $template = $wrapper + $wrapper .wrap( '' ) .addClass( 'wikiEditor-template-text wikiEditor-template-text-shrunken' ) .parent() @@ -249,7 +261,7 @@ fn: { bindTemplateEvents: function( $wrapper ) { var $template = $wrapper.parent( '.wikiEditor-template' ); - if ( typeof ( opera ) == "undefined" ) { + if ( typeof opera === 'undefined' ) { $template.parent().attr('contentEditable', 'false'); } @@ -274,7 +286,7 @@ fn: { * Toggle the visisbilty of the wikitext for a given template * @param $wrapper The origianl wrapper we want expand/collapse */ - toggleWikiTextEditor: function( $wrapper ) { + toggleWikiTextEditor: function( $wrapper ) { var context = $wrapper.data( 'marker' ).context; var $template = $wrapper.parent( '.wikiEditor-template' ); context.fn.purgeOffsets(); @@ -285,11 +297,11 @@ fn: { var $templateText = $template.find( '.wikiEditor-template-text' ); $templateText.toggleClass( 'wikiEditor-template-text-shrunken' ); $templateText.toggleClass( 'wikiEditor-template-text-visible' ); - if( $templateText.hasClass('wikiEditor-template-text-shrunken') ){ + if ( $templateText.hasClass('wikiEditor-template-text-shrunken') ){ //we just closed the template // Update the model if we need to - if ( $templateText.html() != $templateText.data( 'oldHTML' ) ) { + if ( $templateText.html() !== $templateText.data( 'oldHTML' ) ) { var templateModel = $.wikiEditor.modules.templateEditor.fn.updateModel( $templateText ); //this is the only place the template name can be changed; keep the template name in sync @@ -350,7 +362,7 @@ fn: { var $templateText = $templateDiv.children( '.wikiEditor-template-text' ); var templateModel = $templateText.data( 'model' ); // Update the model if we need to - if ( $templateText.html() != $templateText.data( 'oldHTML' ) ) { + if ( $templateText.html() !== $templateText.data( 'oldHTML' ) ) { templateModel = $.wikiEditor.modules.templateEditor.fn.updateModel( $templateText ); } @@ -362,11 +374,11 @@ fn: { var $rows = $fields.find( '.wikiEditor-template-dialog-field-wrapper' ); for ( var paramIndex in params ) { var param = params[paramIndex]; - if ( typeof param.name == 'undefined' ) { + if ( typeof param.name === 'undefined' ) { // param is the template name, skip it continue; } - var paramText = typeof param == 'string' ? + var paramText = typeof param === 'string' ? param.name.replace( /[\_\-]/g, ' ' ) : param.name; var paramVal = templateModel.getValue( param.name ); @@ -397,11 +409,13 @@ fn: { .data( 'expanded', false ) .bind( 'cut paste keypress click change', function( e ) { // If this was fired by a tab keypress, let it go - if ( e.keyCode == '9' ) return true; + if ( e.keyCode === 9 || e.keyCode === '9' ) { + return true; + } var $this = $( this ); setTimeout( function() { var expanded = $this.data( 'expanded' ); - if ( $this.val().indexOf( '\n' ) != -1 || $this.val().length > 24 ) { + if ( $this.val().indexOf( '\n' ) !== -1 || $this.val().length > 24 ) { if ( !expanded ) { $this.animate( { 'height': '4.5em' }, 'fast' ); $this.data( 'expanded', true ); @@ -455,7 +469,7 @@ fn: { updateModel: function( $templateText, model ) { var context = $templateText.data( 'marker' ).context; var text; - if ( typeof model == 'undefined' ) { + if ( typeof model === 'undefined' ) { text = context.fn.htmlToText( $templateText.html() ); } else { text = model.getText(); @@ -464,7 +478,7 @@ fn: { $templateText.text( text ); $templateText.html( $templateText.html().replace( /\n/g, '
      ' ) ); $templateText.data( 'oldHTML', $templateText.html() ); - if ( typeof model == 'undefined' ) { + if ( typeof model === 'undefined' ) { model = new $.wikiEditor.modules.templateEditor.fn.model( text ); $templateText.data( 'model', model ); } @@ -476,9 +490,9 @@ fn: { */ getTemplateDisplayName: function ( model ) { var tName = model.getName(); - if( model.getValue( 'name' ) != '' ) { + if( model.getValue( 'name' ) !== '' ) { return tName + ': ' + model.getValue( 'name' ); - } else if( model.getValue( 'Name' ) != '' ) { + } else if( model.getValue( 'Name' ) !== '' ) { return tName + ': ' + model.getValue( 'Name' ); } else if( tName.toLowerCase() in $.wikiEditor.modules.templateEditor.nameMappings ) { return tName + ': ' + model.getValue( $.wikiEditor.modules.templateEditor.nameMappings[tName.toLowerCase()] ); @@ -541,27 +555,28 @@ fn: { var retVal; if ( isNaN( name ) ) { // It's a string! - if ( typeof paramsByName[name] == 'undefined' ) { + if ( typeof paramsByName[name] === 'undefined' ) { // Does not exist - return ""; + return ''; } rangeIndex = paramsByName[name]; } else { // It's a number! - rangeIndex = parseInt( name ); + rangeIndex = parseInt( name, 10 ); } - if ( typeof params[rangeIndex] == 'undefined' ) { + if ( typeof params[rangeIndex] === 'undefined' ) { // Does not exist - return ""; + return ''; } valueRange = ranges[params[rangeIndex].valueIndex]; - if ( typeof valueRange.newVal == 'undefined' || original ) { + if ( typeof valueRange.newVal === 'undefined' || original ) { // Value unchanged, return original wikitext retVal = wikitext.substring( valueRange.begin, valueRange.end ); } else { // New value exists, return new value retVal = valueRange.newVal; } + /*jshint eqnull:true */ if ( value != null ) { ranges[params[rangeIndex].valueIndex].newVal = value; } @@ -574,7 +589,7 @@ fn: { * Get template name */ this.getName = function() { - if( typeof ranges[templateNameIndex].newVal == 'undefined' ) { + if( typeof ranges[templateNameIndex].newVal === 'undefined' ) { return wikitext.substring( ranges[templateNameIndex].begin, ranges[templateNameIndex].end ); } else { return ranges[templateNameIndex].newVal; @@ -635,9 +650,9 @@ fn: { * Get modified template text */ this.getText = function() { - newText = ""; - for ( i = 0 ; i < ranges.length; i++ ) { - if( typeof ranges[i].newVal == 'undefined' ) { + var newText = ""; + for ( var i = 0 ; i < ranges.length; i++ ) { + if( typeof ranges[i].newVal === 'undefined' ) { newText += wikitext.substring( ranges[i].begin, ranges[i].end ); } else { newText += ranges[i].newVal; @@ -659,7 +674,7 @@ fn: { var adjustment = 0; for (var i = 0 ; i < ranges.length; i++ ) { ranges[i].begin += adjustment; - if( typeof ranges[i].adjust != 'undefined' ) { + if ( typeof ranges[i].adjust !== 'undefined' ) { adjustment += ranges[i].adjust(); // NOTE: adjust should be a function that has the information necessary to calculate the length of // this 'segment' @@ -680,15 +695,16 @@ fn: { // Get rid of first {{ with whitespace var sanatizedStr = wikitext.replace( /{{/, " " ); // Replace end - endBraces = sanatizedStr.match( /}}\s*$/ ); + var endBraces = sanatizedStr.match( /}}\s*$/ ); if ( endBraces ) { sanatizedStr = sanatizedStr.substring( 0, endBraces.index ) + " " + sanatizedStr.substring( endBraces.index + 2 ); } + var startIndex, endIndex, sanatizedSegment, openBraces, brace; //treat HTML comments like whitespace - while ( sanatizedStr.indexOf( '') + 3; if( endIndex < 3 ){ @@ -700,26 +716,26 @@ fn: { } // Match the open braces we just found with equivalent closing braces note, works for any level of braces - while ( sanatizedStr.indexOf( '{{' ) != -1 ) { + while ( sanatizedStr.indexOf( '{{' ) !== -1 ) { startIndex = sanatizedStr.indexOf( '{{' ) + 1; openBraces = 2; endIndex = startIndex; while ( (openBraces > 0) && (endIndex < sanatizedStr.length) ) { - var brace = sanatizedStr[++endIndex]; - openBraces += brace == '}' ? -1 : brace == '{' ? 1 : 0; + brace = sanatizedStr[++endIndex]; + openBraces += brace === '}' ? -1 : brace === '{' ? 1 : 0; } sanatizedSegment = sanatizedStr.substring( startIndex,endIndex ).replace( /[{}|=]/g , 'X' ); sanatizedStr = sanatizedStr.substring( 0, startIndex ) + sanatizedSegment + sanatizedStr.substring( endIndex ); } //links, images, etc, which also can nest - while ( sanatizedStr.indexOf( '[[' ) != -1 ) { + while ( sanatizedStr.indexOf( '[[' ) !== -1 ) { startIndex = sanatizedStr.indexOf( '[[' ) + 1; openBraces = 2; endIndex = startIndex; while ( (openBraces > 0) && (endIndex < sanatizedStr.length) ) { - var brace = sanatizedStr[++endIndex]; - openBraces += brace == ']' ? -1 : brace == '[' ? 1 : 0; + brace = sanatizedStr[++endIndex]; + openBraces += brace === ']' ? -1 : brace === '[' ? 1 : 0; } sanatizedSegment = sanatizedStr.substring( startIndex,endIndex ).replace( /[\[\]|=]/g , 'X' ); sanatizedStr = @@ -733,14 +749,16 @@ fn: { var params = []; var templateNameIndex = 0; var doneParsing = false; - oldDivider = 0; - divider = sanatizedStr.indexOf( '|', oldDivider ); - if ( divider == -1 ) { + var oldDivider = 0; + var divider = sanatizedStr.indexOf( '|', oldDivider ); + if ( divider === -1 ) { divider = sanatizedStr.length; doneParsing = true; collapsible = false; //zero params } - nameMatch = sanatizedStr.substring( 0, divider ).match( /[^\s]/ ); + var nameMatch = sanatizedStr.substring( 0, divider ).match( /[^\s]/ ); + var nameEndMatch; + /*jshint eqnull:true */ if ( nameMatch != null ) { ranges.push( new Range( 0 ,nameMatch.index ) ); //whitespace and squiggles upto the name nameEndMatch = sanatizedStr.substring( 0 , divider ).match( /[^\s]\s*$/ ); //last nonwhitespace character @@ -758,18 +776,21 @@ fn: { * Start looping over params */ var currentParamNumber = 0; + var currentField, currentValue, valueBeginIndex, valueBegin, valueEnd; + var nameIndex, equalsIndex, valueIndex; + var currentName, nameBegin, nameBeginIndex, nameEnd, nameEndIndex; var valueEndIndex = ranges[templateNameIndex].end; var paramsByName = []; while ( !doneParsing ) { currentParamNumber++; oldDivider = divider; divider = sanatizedStr.indexOf( '|', oldDivider + 1 ); - if ( divider == -1 ) { + if ( divider === -1 ) { divider = sanatizedStr.length; doneParsing = true; } currentField = sanatizedStr.substring( oldDivider+1, divider ); - if ( currentField.indexOf( '=' ) == -1 ) { + if ( currentField.indexOf( '=' ) === -1 ) { // anonymous field, gets a number //default values, since we'll allow empty values diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.templates.js b/extensions/WikiEditor/modules/jquery.wikiEditor.templates.js index b303e3fa..b0462563 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.templates.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.templates.js @@ -1,22 +1,23 @@ /* Templates Module for wikiEditor */ -( function( $ ) { $.wikiEditor.modules.templates = { +/*jshint onevar:false */ +( function ( $ ) { $.wikiEditor.modules.templates = { /** * Core Requirements */ -'req': [ 'iframe' ], +req: [ 'iframe' ], /** * Object Templates */ -'tpl': { - 'marker': { - 'type': 'template', - 'anchor': 'wrap', - 'skipDivision': 'realchange', - 'afterWrap': function( node ) { +tpl: { + marker: { + type: 'template', + anchor: 'wrap', + skipDivision: 'realchange', + afterWrap: function ( node ) { $( node ).addClass( 'wikiEditor-template' ); }, - 'getAnchor': function( ca1, ca2 ) { + getAnchor: function ( ca1 ) { return $( ca1.parentNode ).is( '.wikiEditor-template' ) ? ca1.parentNode : null; } } @@ -24,10 +25,14 @@ /** * Event handlers */ -'evt': { - 'mark': function( context, event ) { +evt: { + /** + * @param context + * @param event + */ + mark: function ( context ) { // The markers returned by this function are skipped on realchange, so don't regenerate them in that case - if ( context.modules.highlight.currentScope == 'realchange' ) { + if ( context.modules.highlight.currentScope === 'realchange' ) { return; } // Get references to the markers and tokens from the current context @@ -36,14 +41,14 @@ // Use depth-tracking to extract top-level templates from tokens var depth = 0, bias, start; for ( var i in tokens ) { - depth += ( bias = tokens[i].label == 'TEMPLATE_BEGIN' ? 1 : ( tokens[i].label == 'TEMPLATE_END' ? -1 : 0 ) ); - if ( bias > 0 && depth == 1 ) { + depth += ( bias = tokens[i].label === 'TEMPLATE_BEGIN' ? 1 : ( tokens[i].label === 'TEMPLATE_END' ? -1 : 0 ) ); + if ( bias > 0 && depth === 1 ) { // Top-level opening - use offset as start start = tokens[i].offset; - } else if ( bias < 0 && depth == 0 ) { + } else if ( bias < 0 && depth === 0 ) { // Top-level closing - use offset as end markers[markers.length] = $.extend( - { 'context': context, 'start': start, 'end': tokens[i].offset }, + { context: context, start: start, end: tokens[i].offset }, $.wikiEditor.modules.templates.tpl.marker ); } @@ -53,15 +58,19 @@ } } }, -'exp': [ - { 'regex': /{{/, 'label': "TEMPLATE_BEGIN" }, - { 'regex': /}}/, 'label': "TEMPLATE_END", 'markAfter': true } +exp: [ + { regex: /{{/, label: 'TEMPLATE_BEGIN' }, + { regex: /}}/, label: 'TEMPLATE_END', markAfter: true } ], /** * Internally used functions */ -'fn': { - 'create': function( context, config ) { +fn: { + /** + * @param context + * @param config + */ + create: function () { // Do some stuff here... } } diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.toc.js b/extensions/WikiEditor/modules/jquery.wikiEditor.toc.js index 54b8a863..3f186db6 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.toc.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.toc.js @@ -1,31 +1,32 @@ /* TOC Module for wikiEditor */ -( function( $ ) { $.wikiEditor.modules.toc = { +/*jshint onevar:false */ +( function ( $, mw ) { $.wikiEditor.modules.toc = { /** * Compatability map */ -'browsers': { +browsers: { // Left-to-right languages - 'ltr': { - 'msie': [['>=', 7]], - 'firefox': [['>=', 3]], - 'opera': [['>=', 10]], - 'safari': [['>=', 4]], - 'chrome': [['>=', 4]] + ltr: { + msie: [['>=', 7]], + firefox: [['>=', 3]], + opera: [['>=', 10]], + safari: [['>=', 4]], + chrome: [['>=', 4]] }, // Right-to-left languages - 'rtl': { - 'msie': [['>=', 8]], - 'firefox': [['>=', 3]], - 'opera': [['>=', 10]], - 'safari': [['>=', 4]], - 'chrome': [['>=', 4]] + rtl: { + msie: [['>=', 8]], + firefox: [['>=', 3]], + opera: [['>=', 10]], + safari: [['>=', 4]], + chrome: [['>=', 4]] } }, /** * Core Requirements */ -'req': [ 'iframe' ], +req: [ 'iframe' ], /** * Configuration */ @@ -51,10 +52,18 @@ api: { * Event handlers */ evt: { - change: function( context, event ) { + /** + * @param context + * @param event + */ + change: function( context ) { $.wikiEditor.modules.toc.fn.update( context ); }, - ready: function( context, event ) { + /** + * @param context + * @param event + */ + ready: function( context ) { // Add the TOC to the document $.wikiEditor.modules.toc.fn.build( context ); if ( !context.$content ) { @@ -68,28 +77,32 @@ evt: { $.wikiEditor.modules.toc.fn.improveUI(); $.wikiEditor.modules.toc.evt.resize( context ); }, - resize: function( context, event ) { + /** + * @param context + * @param event + */ + resize: function( context ) { var availableWidth = context.$wikitext.width() - parseFloat( $.wikiEditor.modules.toc.cfg.textMinimumWidth ), totalMinWidth = parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ) + parseFloat( $.wikiEditor.modules.toc.cfg.textMinimumWidth ); context.$ui.find( '.wikiEditor-ui-right' ) .resizable( 'option', 'maxWidth', availableWidth ); - if ( context.modules.toc.$toc.data( 'positionMode' ) != 'disabled' && + if ( context.modules.toc.$toc.data( 'positionMode' ) !== 'disabled' && context.$wikitext.width() < totalMinWidth ) { $.wikiEditor.modules.toc.fn.disable( context ); - } else if ( context.modules.toc.$toc.data( 'positionMode' ) == 'disabled' && + } else if ( context.modules.toc.$toc.data( 'positionMode' ) === 'disabled' && context.$wikitext.width() > totalMinWidth ) { $.wikiEditor.modules.toc.fn.enable( context ); - } else if ( context.modules.toc.$toc.data( 'positionMode' ) == 'regular' && + } else if ( context.modules.toc.$toc.data( 'positionMode' ) === 'regular' && context.$ui.find( '.wikiEditor-ui-right' ).width() > availableWidth ) { //switch mode $.wikiEditor.modules.toc.fn.switchLayout( context ); - } else if ( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' && + } else if ( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' && context.modules.toc.$toc.data( 'previousWidth' ) < context.$wikitext.width() ) { //switch mode $.wikiEditor.modules.toc.fn.switchLayout( context ); } - if ( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { + if ( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { context.modules.toc.$toc.find( 'div' ).autoEllipsis( { 'position': 'right', 'tooltip': true, 'restoreText': true } ); @@ -105,14 +118,18 @@ evt: { // store the width of the view for comparison on next resize context.modules.toc.$toc.data( 'previousWidth', context.$wikitext.width() ); }, - mark: function( context, event ) { + /** + * @param context + * @param event + */ + mark: function( context ) { var hash = ''; var markers = context.modules.highlight.markers; var tokenArray = context.modules.highlight.tokenArray; var outline = context.data.outline = []; var h = 0; for ( var i = 0; i < tokenArray.length; i++ ) { - if ( tokenArray[i].label != 'TOC_HEADER' ) { + if ( tokenArray[i].label !== 'TOC_HEADER' ) { continue; } h++; @@ -134,14 +151,14 @@ evt: { }, onSkip: function( node ) { var marker = $( node ).data( 'marker' ); - if ( $( node ).data( 'section' ) != marker.index ) { + if ( $( node ).data( 'section' ) !== marker.index ) { $( node ) .removeClass( 'wikiEditor-toc-section-' + $( node ).data( 'section' ) ) .addClass( 'wikiEditor-toc-section-' + marker.index ) .data( 'section', marker.index ); } }, - getAnchor: function( ca1, ca2 ) { + getAnchor: function( ca1 ) { return $( ca1.parentNode ).is( '.wikiEditor-toc-header' ) ? ca1.parentNode : null; } @@ -154,7 +171,7 @@ evt: { } ); } // Only update the TOC if it's been changed - we do this by comparing a hash of the headings this time to last - if ( typeof context.modules.toc.lastHash == 'undefined' || context.modules.toc.lastHash !== hash ) { + if ( typeof context.modules.toc.lastHash === 'undefined' || context.modules.toc.lastHash !== hash ) { $.wikiEditor.modules.toc.fn.build( context ); $.wikiEditor.modules.toc.fn.update( context ); // Remember the changed version @@ -175,13 +192,13 @@ fn: { * @param {Object} context Context object of editor to create module in * @param {Object} config Configuration object to create module from */ - create: function( context, config ) { + create: function( context ) { if ( '$toc' in context.modules.toc ) { return; } $.wikiEditor.modules.toc.cfg.rtl = $( 'body' ).is( '.rtl' ); $.wikiEditor.modules.toc.cfg.flexProperty = $.wikiEditor.modules.toc.cfg.rtl ? 'marginLeft' : 'marginRight'; - var height = context.$ui.find( '.wikiEditor-ui-left' ).height(); + context.$ui.find( '.wikiEditor-ui-left' ).height(); context.modules.toc.$toc = $( '
      ' ) .addClass( 'wikiEditor-ui-toc' ) .data( 'context', context ) @@ -196,14 +213,14 @@ fn: { }, redraw: function( context, fixedWidth ) { fixedWidth = parseFloat( fixedWidth ); - if( context.modules.toc.$toc.data( 'positionMode' ) == 'regular' ) { + if ( context.modules.toc.$toc.data( 'positionMode' ) === 'regular' ) { context.$ui.find( '.wikiEditor-ui-right' ) .css( 'width', fixedWidth + 'px' ); context.$ui.find( '.wikiEditor-ui-left' ) .css( $.wikiEditor.modules.toc.cfg.flexProperty, ( -1 * fixedWidth ) + 'px' ) .children() .css( $.wikiEditor.modules.toc.cfg.flexProperty, fixedWidth + 'px' ); - } else if( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { + } else if( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { context.$ui.find( '.wikiEditor-ui-left' ) .css( 'width', fixedWidth ); context.$ui.find( '.wikiEditor-ui-right' ) @@ -212,10 +229,10 @@ fn: { } }, switchLayout: function( context ) { - var width, - height = context.$ui.find( '.wikiEditor-ui-right' ).height(); - if ( context.modules.toc.$toc.data( 'positionMode' ) == 'regular' - && !context.modules.toc.$toc.data( 'collapsed' ) + var width; + context.$ui.find( '.wikiEditor-ui-right' ).height(); + if ( context.modules.toc.$toc.data( 'positionMode' ) === 'regular' && + !context.modules.toc.$toc.data( 'collapsed' ) ) { // store position mode context.modules.toc.$toc.data( 'positionMode', 'goofy' ); @@ -237,7 +254,7 @@ fn: { 'left' : $.wikiEditor.modules.toc.cfg.rtl ? 0 : 'auto' } ); context.$wikitext .css( 'position', 'relative' ); - } else if ( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { + } else if ( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { // store position mode context.modules.toc.$toc.data( 'positionMode', 'regular' ); // set width @@ -260,7 +277,7 @@ fn: { if ( context.modules.toc.$toc.data( 'collapsed' ) ) { context.$ui.find( '.wikiEditor-ui-toc-expandControl' ).hide(); } else { - if( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { + if( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { $.wikiEditor.modules.toc.fn.switchLayout( context ); } context.$ui.find( '.wikiEditor-ui-right' ).hide(); @@ -296,7 +313,7 @@ fn: { * * @param {Object} context */ - update: function( context ) { + update: function () { //temporarily commenting this out because it is causing all kinds of cursor //and text jumping issues in IE. WIll get back to this --pdhanda /* @@ -333,10 +350,10 @@ fn: { * * @param {Object} event Event object with context as data */ - collapse: function( event ) { + collapse: function () { var $this = $( this ), context = $this.data( 'context' ); - if( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { + if ( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { $.wikiEditor.modules.toc.fn.switchLayout( context ); } var pT = $this.parent().position().top - 1; @@ -366,7 +383,7 @@ fn: { // Let the UI know things have moved around context.fn.trigger( 'tocCollapse' ); context.fn.trigger( 'resize' ); - } ); + } ); $.cookie( 'wikiEditor-' + context.instance + '-toc-width', 0 ); return false; @@ -377,15 +394,19 @@ fn: { * * @param {Object} event Event object with context as data */ - expand: function( event ) { + expand: function () { var $this = $( this ), context = $this.data( 'context' ), openWidth = parseFloat( context.modules.toc.$toc.data( 'openWidth' ) ), availableSpace = context.$wikitext.width() - parseFloat( $.wikiEditor.modules.toc.cfg.textMinimumWidth ); - if ( availableSpace < $.wikiEditor.modules.toc.cfg.textMinmumWidth ) return false; + if ( availableSpace < $.wikiEditor.modules.toc.cfg.textMinmumWidth ) { + return false; + } context.modules.toc.$toc.data( 'collapsed', false ); // check if we've got enough room to open to our stored width - if ( availableSpace < openWidth ) openWidth = availableSpace; + if ( availableSpace < openWidth ) { + openWidth = availableSpace; + } context.$ui.find( '.wikiEditor-ui-toc-expandControl' ).hide(); var leftParam = {}, leftChildParam = {}; leftParam[ $.wikiEditor.modules.toc.cfg.flexProperty ] = parseFloat( openWidth ) * -1; @@ -407,7 +428,7 @@ fn: { 'top': 'auto' } ); context.fn.trigger( 'tocExpand' ); context.fn.trigger( 'resize' ); - } ); + } ); $.cookie( 'wikiEditor-' + context.instance + '-toc-width', context.modules.toc.$toc.data( 'openWidth' ) ); return false; @@ -432,7 +453,7 @@ fn: { } var sections = []; for ( var i = offset; i < outline.length; i++ ) { - if ( outline[i].nLevel == level ) { + if ( outline[i].nLevel === level ) { var sub = buildStructure( outline, i + 1, level + 1 ); if ( sub.length ) { outline[i].sections = sub; @@ -462,8 +483,9 @@ fn: { .click( function( event ) { var wrapper = context.$content.find( '.wikiEditor-toc-section-' + $( this ).data( 'index' ) ); - if ( wrapper.length === 0 ) + if ( wrapper.length === 0 ) { wrapper = context.$content; + } context.fn.scrollToTop( wrapper, true ); context.$textarea.textSelection( 'setSelection', { 'start': 0, @@ -481,8 +503,9 @@ fn: { event.preventDefault(); } ) .text( structure[i].text ); - if ( structure[i].text === '' ) + if ( structure[i].text === '' ) { div.html( ' ' ); + } var item = $( '
    3. ' ).append( div ); if ( structure[i].sections !== undefined ) { item.append( buildList( structure[i].sections ) ); @@ -546,7 +569,7 @@ fn: { .data( 'wikiEditor-ui-left', context.$ui.find( '.wikiEditor-ui-left' ) ) .resizable( { handles: 'w,e', preventPositionLeftChange: true, minWidth: parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ), - start: function( e, ui ) { + start: function () { var $this = $( this ); // Toss a transparent cover over our iframe $( '
      ' ) @@ -562,7 +585,7 @@ fn: { .appendTo( context.$ui.find( '.wikiEditor-ui-left' ) ); $this.resizable( 'option', 'maxWidth', $this.parent().width() - parseFloat( $.wikiEditor.modules.toc.cfg.textMinimumWidth ) ); - if(context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { + if ( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { $.wikiEditor.modules.toc.fn.switchLayout( context ); } }, @@ -596,7 +619,7 @@ fn: { var handle = $.wikiEditor.modules.toc.cfg.rtl ? 'w' : 'e'; context.$ui.find( '.ui-resizable-' + handle ) .removeClass( 'ui-resizable-' + handle ) - .addClass( 'ui-resizable-' + ( handle == 'w' ? 'e' : 'w' ) ) + .addClass( 'ui-resizable-' + ( handle === 'w' ? 'e' : 'w' ) ) .addClass( 'wikiEditor-ui-toc-resize-grip' ); // Bind collapse and expand event handlers to the TOC context.modules.toc.$toc @@ -604,12 +627,13 @@ fn: { .bind( 'expand.wikiEditor-toc', $.wikiEditor.modules.toc.fn.expand ); context.modules.toc.$toc.data( 'openWidth', $.wikiEditor.modules.toc.cfg.defaultWidth ); // If the toc-width cookie is set, reset the widths based upon that - if ( $.cookie( 'wikiEditor-' + context.instance + '-toc-width' ) == 0 ) { + if ( $.cookie( 'wikiEditor-' + context.instance + '-toc-width' ) === 0 ) { context.modules.toc.$toc.trigger( 'collapse.wikiEditor-toc', { data: context } ); } else if ( $.cookie( 'wikiEditor-' + context.instance + '-toc-width' ) > 0 ) { var initialWidth = $.cookie( 'wikiEditor-' + context.instance + '-toc-width' ); - if( initialWidth < parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ) ) + if ( initialWidth < parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ) ) { initialWidth = parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ) + 1; + } context.modules.toc.$toc.data( 'openWidth', initialWidth + 'px' ); $.wikiEditor.modules.toc.fn.redraw( context, initialWidth ); } @@ -664,7 +688,7 @@ fn: { * Extending resizable to allow west resizing without altering the left position attribute */ $.ui.plugin.add( 'resizable', 'preventPositionLeftChange', { - resize: function( event, ui ) { + resize: function () { $( this ).data( 'resizable' ).position.left = 0; } } ); @@ -673,4 +697,4 @@ fn: { }; -} ) ( jQuery ); +} )( jQuery, mediaWiki ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js b/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js index d3f7a9d5..cb24bfd5 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js @@ -1,7 +1,8 @@ /** * Configuration of Toolbar module for wikiEditor */ -( function( $ ) { $.wikiEditor.modules.toolbar.config = { +/*jshint camelcase:false, quotmark:false */ +( function ( $, mw ) { $.wikiEditor.modules.toolbar.config = { getDefaultConfig: function() { var fileNamespace = mw.config.get( 'wgFormattedNamespaces' )[6]; @@ -43,6 +44,7 @@ getDefaultConfig: function() { 'eu': 'format-bold-L.png', 'he': 'format-bold-B.png', 'hu': 'format-bold-F.png', + 'hy': 'format-bold-hy.png', 'it': 'format-bold-G.png', 'ka': 'format-bold-ka.png', 'ky': 'format-bold-ru.png', @@ -98,6 +100,7 @@ getDefaultConfig: function() { 'eu': 'format-italic-E.png', 'he': 'format-italic-I.png', 'hu': 'format-italic-D.png', + 'hy': 'format-italic-hy.png', 'it': 'format-italic-C.png', 'ka': 'format-italic-ka.png', 'ky': 'format-italic-K.png', @@ -1452,4 +1455,4 @@ getDefaultConfig: function() { } }; } -}; } ) ( jQuery ); +}; } ) ( jQuery, mediaWiki ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js b/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js index e1bc6f15..71592b53 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js @@ -1,6 +1,7 @@ /** * Toolbar module for wikiEditor */ +/*jshint onevar:false */ ( function ( mw, $ ) { $.wikiEditor.modules.toolbar = { /** @@ -17,7 +18,7 @@ api : { var $sections = context.modules.toolbar.$toolbar.find( 'div.sections' ), $tabs = context.modules.toolbar.$toolbar.find( 'div.tabs' ); for ( var section in data[type] ) { - if ( section == 'main' ) { + if ( section === 'main' ) { // Section context.modules.toolbar.$toolbar.prepend( $.wikiEditor.modules.toolbar.fn.buildSection( @@ -145,28 +146,28 @@ api : { } }, removeFromToolbar : function( context, data ) { - if ( typeof data.section == 'string' ) { + if ( typeof data.section === 'string' ) { // Section var tab = 'div.tabs span[rel="' + data.section + '"].tab'; var target = 'div[rel="' + data.section + '"].section'; var group = null; - if ( typeof data.group == 'string' ) { + if ( typeof data.group === 'string' ) { // Toolbar group target += ' div[rel="' + data.group + '"].group'; - if ( typeof data.tool == 'string' ) { + if ( typeof data.tool === 'string' ) { // Save for later checking if empty group = target; // Tool target += ' a[rel="' + data.tool + '"].tool'; } - } else if ( typeof data.page == 'string' ) { + } else if ( typeof data.page === 'string' ) { // Booklet page var index = target + ' div.index div[rel="' + data.page + '"]'; target += ' div.pages div[rel="' + data.page + '"].page'; - if ( typeof data.character == 'string' ) { + if ( typeof data.character === 'string' ) { // Character target += ' span[rel="' + data.character + '"]'; - } else if ( typeof data.row == 'number' ) { + } else if ( typeof data.row === 'number' ) { // Table row target += ' table tr:not(:has(th)):eq(' + data.row + ')'; } else { @@ -198,7 +199,11 @@ api : { * Event handlers */ evt: { - resize: function( context, event ) { + /** + * @param context + * @param event + */ + resize: function( context ) { context.$ui.find( '.sections' ).height( context.$ui.find( '.sections .section-visible' ).outerHeight() ); }, tocCollapse: function( context, event ) { @@ -235,7 +240,7 @@ fn: { * @param {Object} action * @param {Object} source */ - doAction : function( context, action, source ) { + doAction : function( context, action ) { switch ( action.type ) { case 'replace': case 'encapsulate': @@ -244,7 +249,7 @@ fn: { 'peri' : $.wikiEditor.autoMsg( action.options, 'peri' ), 'post' : $.wikiEditor.autoMsg( action.options, 'post' ) }; - var replace = action.type == 'replace'; + var replace = action.type === 'replace'; if ( 'regex' in action.options && 'regexReplace' in action.options ) { var selection = context.$textarea.textSelection( 'getSelection' ); if ( selection !== '' && selection.match( action.options.regex ) ) { @@ -263,7 +268,7 @@ fn: { } break; case 'callback': - if ( typeof action.execute == 'function' ) { + if ( typeof action.execute === 'function' ) { action.execute( context ); } break; @@ -287,7 +292,7 @@ fn: { if ( tool ) { // Consider a group with only hidden tools empty as well // .is( ':visible' ) always returns false because tool is not attached to the DOM yet - empty = empty && tool.css( 'display' ) == 'none'; + empty = empty && tool.css( 'display' ) === 'none'; $group.append( tool ); } } @@ -447,7 +452,7 @@ fn: { } ); }, buildPage : function( context, id, page ) { - var html; + var html, i; var $page = $( '
      ' ).attr( { 'class' : 'page page-' + id, 'rel' : id @@ -461,7 +466,7 @@ fn: { html += $.wikiEditor.modules.toolbar.fn.buildHeading( context, page.headings ); } if ( 'rows' in page ) { - for ( var i = 0; i < page.rows.length; i++ ) { + for ( i = 0; i < page.rows.length; i++ ) { html += $.wikiEditor.modules.toolbar.fn.buildRow( context, page.rows[i] ); } } @@ -484,7 +489,7 @@ fn: { } if ( 'characters' in page ) { html = ''; - for ( var i = 0; i < page.characters.length; i++ ) { + for ( i = 0; i < page.characters.length; i++ ) { html += $.wikiEditor.modules.toolbar.fn.buildCharacter( page.characters[i], actions ); } $characters @@ -527,7 +532,7 @@ fn: { return html + ''; }, buildCharacter : function( character, actions ) { - if ( typeof character == 'string' ) { + if ( typeof character === 'string' ) { character = { 'label' : character, 'action' : { @@ -564,8 +569,9 @@ fn: { return mw.html.element( 'span', { 'rel': character.label }, character.label ); } } - mw.log( "A character for the toolbar was undefined. This is not supposed to happen. Double check the config." ); - return ""; // bug 31673; also an additional fix for bug 24208... + mw.log( 'A character for the toolbar was undefined. This is not supposed to happen. Double check the config.' ); + // bug 31673; also an additional fix for bug 24208... + return ''; }, buildTab : function( context, id, section ) { var selected = $.cookie( 'wikiEditor-' + context.instance + '-toolbar-section' ); @@ -575,7 +581,7 @@ fn: { } var $link = $( '' ) - .addClass( selected == id ? 'current' : null ) + .addClass( selected === id ? 'current' : null ) .attr( { href: '#', role: 'button', @@ -584,7 +590,7 @@ fn: { } ) .text( $.wikiEditor.autoMsg( section, 'label' ) ) .data( 'context', context ) - .mouseup( function( e ) { + .mouseup( function () { $(this).blur(); } ) .mousedown( function( e ) { @@ -604,7 +610,7 @@ fn: { var $sections = $(this).data( 'context' ).$ui.find( '.sections' ); var $section = $(this).data( 'context' ).$ui.find( '.section-' + $(this).parent().attr( 'rel' ) ); - var show = $section.css( 'display' ) == 'none'; + var show = $section.css( 'display' ) === 'none'; $section.parent().find( '.section-visible' ) .css( 'position', 'absolute' ) .attr( 'aria-expanded', 'false' ) @@ -668,7 +674,7 @@ fn: { id: 'wikiEditor-section-' + id } ); var selected = $.cookie( 'wikiEditor-' + context.instance + '-toolbar-section' ); - var show = selected == id; + var show = selected === id; if ( section.deferLoad !== undefined && section.deferLoad && id !== 'main' && !show ) { // This class shows the spinner and serves as a marker for the click handler in buildTab() @@ -724,6 +730,7 @@ fn: { } }, updateBookletSelection : function( context, id, $pages, $index ) { + /*jshint eqnull:true */ var cookie = 'wikiEditor-' + context.instance + '-booklet-' + id + '-page'; var selected = $.cookie( cookie ); // Re-save cookie @@ -747,7 +754,7 @@ fn: { context.modules.toolbar.$toolbar.append( $( '
      ' ).css( 'clear', 'both' ) ); var sectionQueue = []; for ( var section in config ) { - if ( section == 'main' ) { + if ( section === 'main' ) { context.modules.toolbar.$toolbar.prepend( $.wikiEditor.modules.toolbar.fn.buildSection( context, section, config[section] ) ); diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index e9b4f490..820d6093 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -63,7 +63,7 @@ $wgConf = new SiteConfiguration; * MediaWiki version number * @since 1.2 */ -$wgVersion = '1.22.2'; +$wgVersion = '1.22.3'; /** * Name of the site. It must be changed in LocalSettings.php diff --git a/includes/User.php b/includes/User.php index 12912e1c..62324043 100644 --- a/includes/User.php +++ b/includes/User.php @@ -984,7 +984,8 @@ class User { # Get the token from DB/cache and clean it up to remove garbage padding. # This deals with historical problems with bugs and the default column value. $token = rtrim( $proposedUser->getToken( false ) ); // correct token - $passwordCorrect = ( strlen( $token ) && $token === $request->getCookie( 'Token' ) ); + // Make comparison in constant time (bug 61346) + $passwordCorrect = strlen( $token ) && $this->compareSecrets( $token, $request->getCookie( 'Token' ) ); $from = 'cookie'; } else { // No session or persistent login cookie @@ -1003,6 +1004,25 @@ class User { } } + /** + * A comparison of two strings, not vulnerable to timing attacks + * @param string $answer the secret string that you are comparing against. + * @param string $test compare this string to the $answer. + * @return bool True if the strings are the same, false otherwise + */ + protected function compareSecrets( $answer, $test ) { + if ( strlen( $answer ) !== strlen( $test ) ) { + $passwordCorrect = false; + } else { + $result = 0; + for ( $i = 0; $i < strlen( $answer ); $i++ ) { + $result |= ord( $answer{$i} ) ^ ord( $test{$i} ); + } + $passwordCorrect = ( $result == 0 ); + } + return $passwordCorrect; + } + /** * Load user and user_group data from the database. * $this->mId must be set, this is how the user is identified. diff --git a/includes/Wiki.php b/includes/Wiki.php index ae75bf33..074ec1ab 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -653,12 +653,19 @@ class MediaWiki { } if ( !wfShellExecDisabled() && is_executable( $wgPhpCli ) ) { - // Start a background process to run some of the jobs. - // This will be asynchronous on *nix though not on Windows. + // Start a background process to run some of the jobs wfProfileIn( __METHOD__ . '-exec' ); $retVal = 1; $cmd = wfShellWikiCmd( "$IP/maintenance/runJobs.php", array( '--maxjobs', $n ) ); - wfShellExec( "$cmd &", $retVal ); + $cmd .= " >" . wfGetNull() . " 2>&1"; // don't hang PHP on pipes + if ( wfIsWindows() ) { + // Using START makes this async and also works around a bug where using + // wfShellExec() with a quoted script name causes a filename syntax error. + $cmd = "START /B \"bg\" $cmd"; + } else { + $cmd = "$cmd &"; + } + wfShellExec( $cmd, $retVal ); wfProfileOut( __METHOD__ . '-exec' ); } else { try { diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index b89fb3a7..70495439 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -272,17 +272,33 @@ See the complete documentation, // encode all comments or tags as safe blue strings $text = str_replace( '<', '<', $text ); $text = str_replace( '>', '>', $text ); + // identify requests to api.php - $text = preg_replace( "#api\\.php\\?[^ <\n\t]+#", '\\0', $text ); + $text = preg_replace( '#^(\s*)(api\.php\?[^ <\n\t]+)$#m', '\1\2', $text ); if ( $this->mHelp ) { // make strings inside * bold $text = preg_replace( "#\\*[^<>\n]+\\*#", '\\0', $text ); } + + // Armor links (bug 61362) + $masked = array(); + $text = preg_replace_callback( '##', function ( $matches ) use ( &$masked ) { + $sha = sha1( $matches[0] ); + $masked[$sha] = $matches[0]; + return "<$sha>"; + }, $text ); + // identify URLs $protos = wfUrlProtocolsWithoutProtRel(); // This regex hacks around bug 13218 (" included in the URL) $text = preg_replace( "#(((?i)$protos).*?)(")?([ \\'\"<>\n]|<|>|")#", '\\1\\3\\4', $text ); + // Unarmor links + $text = preg_replace_callback( '#<([0-9a-f]{40})>#', function ( $matches ) use ( &$masked ) { + $sha = $matches[1]; + return isset( $masked[$sha] ) ? $masked[$sha] : $matches[0]; + }, $text ); + /** * Temporary fix for bad links in help messages. As a special case, * XML-escaped metachars are de-escaped one level in the help message diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 32d4d984..fb2d4359 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -551,8 +551,12 @@ class DatabaseOracle extends DatabaseBase { } else { $first = false; } - - $sql .= $this->fieldBindStatement( $table, $col, $val ); + if ( $this->isQuotedIdentifier( $val ) ) { + $sql .= $this->removeIdentifierQuotes( $val ); + unset( $row[$col] ); + } else { + $sql .= $this->fieldBindStatement( $table, $col, $val ); + } } $sql .= ')'; @@ -679,6 +683,30 @@ class DatabaseOracle extends DatabaseBase { return $retval; } + public function upsert( $table, array $rows, array $uniqueIndexes, array $set, + $fname = __METHOD__ + ) { + if ( !count( $rows ) ) { + return true; // nothing to do + } + + if ( !is_array( reset( $rows ) ) ) { + $rows = array( $rows ); + } + + $sequenceData = $this->getSequenceData( $table ); + if ( $sequenceData !== false ) { + // add sequence column to each list of columns, when not set + foreach ( $rows as &$row ) { + if ( !isset( $row[$sequenceData['column']] ) ) { + $row[$sequenceData['column']] = $this->addIdentifierQuotes('GET_SEQUENCE_VALUE(\'' . $sequenceData['sequence'] . '\')'); + } + } + } + + return parent::upsert( $table, $rows, $uniqueIndexes, $set, $fname ); + } + function tableName( $name, $format = 'quoted' ) { /* Replace reserved words with better ones diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index aed35f10..0bd966ba 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -729,13 +729,15 @@ __INDEXATTR__; * so causes a DB error. This wrapper checks which tables can be locked and adjusts it accordingly. */ function selectSQLText( $table, $vars, $conds = '', $fname = __METHOD__, $options = array(), $join_conds = array() ) { - $forUpdateKey = array_search( 'FOR UPDATE', $options ); - if ( $forUpdateKey !== false && $join_conds ) { - unset( $options[$forUpdateKey] ); - - foreach ( $join_conds as $table => $join_cond ) { - if ( 0 === preg_match( '/^(?:LEFT|RIGHT|FULL)(?: OUTER)? JOIN$/i', $join_cond[0] ) ) { - $options['FOR UPDATE'][] = $table; + if ( is_array( $options ) ) { + $forUpdateKey = array_search( 'FOR UPDATE', $options ); + if ( $forUpdateKey !== false && $join_conds ) { + unset( $options[$forUpdateKey] ); + + foreach ( $join_conds as $table_cond => $join_cond ) { + if ( 0 === preg_match( '/^(?:LEFT|RIGHT|FULL)(?: OUTER)? JOIN$/i', $join_cond[0] ) ) { + $options['FOR UPDATE'][] = $table_cond; + } } } } diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index ad399133..d3b550fe 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -955,11 +955,16 @@ class WebInstaller_Options extends WebInstallerPage { LinkCache::singleton()->useDatabase( false ); foreach ( $extensions as $ext ) { + if ( isset( $ext['descriptionmsg'] ) ) { + $desc = wfMessage( $ext['descriptionmsg'] )->useDatabase( false )->parse(); + } else { + $desc = ''; + } $extHtml .= $this->parent->getCheckBox( array( 'var' => "ext-{$ext['name']}", 'rawtext' => "{$ext['name']}: " . - wfMessage( $ext['descriptionmsg'] )->useDatabase( false )->parse(), - ) ); + $desc, + ) ); } diff --git a/includes/specials/SpecialPrefixindex.php b/includes/specials/SpecialPrefixindex.php index 28d07ffc..0d065b09 100644 --- a/includes/specials/SpecialPrefixindex.php +++ b/includes/specials/SpecialPrefixindex.php @@ -264,6 +264,7 @@ class SpecialPrefixindex extends SpecialAllpages { 'from' => $s->page_title, 'prefix' => $prefix, 'hideredirects' => $this->hideRedirects, + 'stripprefix' => $this->stripPrefix, ); if ( $namespace || $prefix == '' ) { diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 916ad6c1..c0c37b3f 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -44,7 +44,7 @@ abstract class UploadBase { protected $mFilteredName, $mFinalExtension; protected $mLocalFile, $mFileSize, $mFileProps; protected $mBlackListedExtensions; - protected $mJavaDetected; + protected $mJavaDetected, $mSVGNSError; protected static $safeXmlEncodings = array( 'UTF-8', 'ISO-8859-1', 'ISO-8859-2', 'UTF-16', 'UTF-32' ); @@ -1162,6 +1162,7 @@ abstract class UploadBase { * @return bool */ protected function detectScriptInSvg( $filename ) { + $this->mSVGNSError = false; $check = new XmlTypeCheck( $filename, array( $this, 'checkSvgScriptCallback' ), @@ -1172,6 +1173,9 @@ abstract class UploadBase { // Invalid xml (bug 58553) return array( 'uploadinvalidxml' ); } elseif ( $check->filterMatch ) { + if ( $this->mSVGNSError ) { + return array( 'uploadscriptednamespace', $this->mSVGNSError ); + } return array( 'uploadscripted' ); } return false; @@ -1198,7 +1202,51 @@ abstract class UploadBase { * @return bool */ public function checkSvgScriptCallback( $element, $attribs ) { - $strippedElement = $this->stripXmlNamespace( $element ); + list( $namespace, $strippedElement ) = $this->splitXmlNamespace( $element ); + + static $validNamespaces = array( + '', + 'adobe:ns:meta/', + 'http://creativecommons.org/ns#', + 'http://inkscape.sourceforge.net/dtd/sodipodi-0.dtd', + 'http://ns.adobe.com/adobeillustrator/10.0/', + 'http://ns.adobe.com/adobesvgviewerextensions/3.0/', + 'http://ns.adobe.com/extensibility/1.0/', + 'http://ns.adobe.com/flows/1.0/', + 'http://ns.adobe.com/illustrator/1.0/', + 'http://ns.adobe.com/imagereplacement/1.0/', + 'http://ns.adobe.com/pdf/1.3/', + 'http://ns.adobe.com/photoshop/1.0/', + 'http://ns.adobe.com/saveforweb/1.0/', + 'http://ns.adobe.com/variables/1.0/', + 'http://ns.adobe.com/xap/1.0/', + 'http://ns.adobe.com/xap/1.0/g/', + 'http://ns.adobe.com/xap/1.0/g/img/', + 'http://ns.adobe.com/xap/1.0/mm/', + 'http://ns.adobe.com/xap/1.0/rights/', + 'http://ns.adobe.com/xap/1.0/stype/dimensions#', + 'http://ns.adobe.com/xap/1.0/stype/font#', + 'http://ns.adobe.com/xap/1.0/stype/manifestitem#', + 'http://ns.adobe.com/xap/1.0/stype/resourceevent#', + 'http://ns.adobe.com/xap/1.0/stype/resourceref#', + 'http://ns.adobe.com/xap/1.0/t/pg/', + 'http://purl.org/dc/elements/1.1/', + 'http://purl.org/dc/elements/1.1', + 'http://schemas.microsoft.com/visio/2003/svgextensions/', + 'http://sodipodi.sourceforge.net/dtd/sodipodi-0.dtd', + 'http://web.resource.org/cc/', + 'http://www.freesoftware.fsf.org/bkchem/cdml', + 'http://www.inkscape.org/namespaces/inkscape', + 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', + 'http://www.w3.org/2000/svg', + ); + + if ( !in_array( $namespace, $validNamespaces ) ) { + wfDebug( __METHOD__ . ": Non-svg namespace '$namespace' in uploaded file.\n" ); + // @TODO return a status object to a closure in XmlTypeCheck, for MW1.21+ + $this->mSVGNSError = $namespace; + return true; + } /* * check for elements that can contain javascript @@ -1220,6 +1268,12 @@ abstract class UploadBase { return true; } + # Block iframes, in case they pass the namespace check + if ( $strippedElement == 'iframe' ) { + wfDebug( __METHOD__ . ": iframe in uploaded file.\n" ); + return true; + } + foreach ( $attribs as $attrib => $value ) { $stripped = $this->stripXmlNamespace( $attrib ); $value = strtolower( $value ); @@ -1293,6 +1347,19 @@ abstract class UploadBase { return false; //No scripts detected } + /** + * Divide the element name passed by the xml parser to the callback into URI and prifix. + * @param $name string + * @return array containing the namespace URI and prefix + */ + private static function splitXmlNamespace( $element ) { + // 'http://www.w3.org/2000/svg:script' -> array( 'http://www.w3.org/2000/svg', 'script' ) + $parts = explode( ':', strtolower( $element ) ); + $name = array_pop( $parts ); + $ns = implode( ':', $parts ); + return array( $ns, $name ); + } + /** * @param $name string * @return string diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index dca9779d..e0ff25e9 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2352,6 +2352,7 @@ You should check that file's deletion history before proceeding to re-upload it. 'php-uploaddisabledtext' => 'File uploads are disabled in PHP. Please check the file_uploads setting.', 'uploadscripted' => 'This file contains HTML or script code that may be erroneously interpreted by a web browser.', +'uploadscriptednamespace' => 'This SVG file contains an illegal namespace \'$1\'', 'uploadinvalidxml' => 'The XML in the uploaded file could not be parsed.', 'uploadvirus' => 'The file contains a virus! Details: $1', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index e770db61..63dc8453 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -4065,6 +4065,14 @@ See also: * {{msg-mw|uploadjava}} * {{msg-mw|uploadvirus}}', 'uploadinvalidxml' => 'Error message displayed when the uploaded file contains XML that cannot be properly parsed and checked.', +'uploadscriptednamespace' => 'Used as error message when uploading a file. This error is specific to SVG files, when they include a namespace that has not been whitelisted. + +Parameters: +* $1 - the invalid namespace name +See also: +* {{msg-mw|zip-wrong-format}} +* {{msg-mw|uploadjava}} +* {{msg-mw|uploadvirus}}', 'uploadvirus' => 'Error message displayed when uploaded file contains a virus. Parameters: diff --git a/maintenance/postgres/tables.sql b/maintenance/postgres/tables.sql index bc2428e4..0cc1b3d7 100644 --- a/maintenance/postgres/tables.sql +++ b/maintenance/postgres/tables.sql @@ -228,9 +228,9 @@ CREATE TABLE categorylinks ( CREATE UNIQUE INDEX cl_from ON categorylinks (cl_from, cl_to); CREATE INDEX cl_sortkey ON categorylinks (cl_to, cl_sortkey, cl_from); -CREATE SEQUENCE externallinks_id_seq; +CREATE SEQUENCE externallinks_el_id_seq; CREATE TABLE externallinks ( - el_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('externallinks_id_seq'), + el_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('externallinks_el_id_seq'), el_from INTEGER NOT NULL REFERENCES page(page_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, el_to TEXT NOT NULL, el_index TEXT NOT NULL -- cgit v1.2.2 From d417de70fcf39e0a7a15ba780b597914d16ca0f7 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 12 Mar 2014 18:12:23 +0100 Subject: Update to MediaWiki 1.22.4 --- .gitreview | 6 - .jshintignore | 29 - .jshintrc | 42 - RELEASE-NOTES-1.22 | 8 + extensions/Cite/.gitreview | 5 - extensions/Cite/.jshintignore | 1 - extensions/Cite/.jshintrc | 34 - extensions/Cite/COPYING | 339 - extensions/Cite/Cite.i18n.php | 208 +- extensions/Cite/Cite.php | 20 + extensions/Cite/Cite_body.php | 7 - extensions/Cite/SpecialCite.alias.php | 2 +- extensions/Cite/SpecialCite.i18n.php | 249 +- extensions/Cite/citeParserTests.txt | 12 +- extensions/ConfirmEdit/.gitreview | 5 - extensions/ConfirmEdit/Asirra.i18n.php | 93 +- extensions/ConfirmEdit/Captcha.php | 170 +- extensions/ConfirmEdit/ConfirmEdit.i18n.php | 327 +- extensions/ConfirmEdit/ConfirmEdit.php | 3 +- extensions/ConfirmEdit/ConfirmEditHooks.php | 14 +- extensions/ConfirmEdit/FancyCaptcha.class.php | 3 +- extensions/ConfirmEdit/FancyCaptcha.i18n.php | 185 +- extensions/ConfirmEdit/FancyCaptcha.php | 11 - extensions/ConfirmEdit/HTMLCaptchaField.php | 81 + extensions/ConfirmEdit/QuestyCaptcha.i18n.php | 51 +- extensions/ConfirmEdit/ReCaptcha.i18n.php | 74 +- extensions/Gadgets/.gitreview | 5 - extensions/Gadgets/ApiQueryGadgets.php | 2 +- extensions/Gadgets/COPYING | 339 - extensions/Gadgets/Gadgets.alias.php | 4 +- extensions/Gadgets/Gadgets.i18n.php | 185 +- extensions/Gadgets/SpecialGadgets.php | 2 +- extensions/Gadgets/tests/GadgetTest.php | 81 - extensions/ImageMap/.gitreview | 5 - extensions/ImageMap/COPYING | 339 - extensions/ImageMap/ImageMap.i18n.php | 8 +- extensions/ImageMap/ImageMap.php | 16 - extensions/ImageMap/ImageMap_body.php | 6 +- extensions/InputBox/.gitreview | 5 - extensions/InputBox/InputBox.classes.php | 16 +- extensions/InputBox/InputBox.i18n.php | 49 +- extensions/Interwiki/.gitreview | 6 - extensions/Interwiki/COPYING | 339 - extensions/Interwiki/Interwiki.alias.php | 2 +- extensions/Interwiki/Interwiki.i18n.php | 169 +- extensions/Interwiki/Interwiki_body.php | 10 +- extensions/LocalisationUpdate/.gitreview | 5 - extensions/LocalisationUpdate/KNOWN_ISSUES.txt | 11 + .../LocalisationUpdate.class.php | 113 +- .../LocalisationUpdate/LocalisationUpdate.i18n.php | 14 +- .../LocalisationUpdate/LocalisationUpdate.php | 14 +- extensions/LocalisationUpdate/QuickArrayReader.php | 199 +- extensions/LocalisationUpdate/README | 34 - extensions/LocalisationUpdate/README_FIRST.txt | 8 + extensions/LocalisationUpdate/tests/tokenTest.php | 100 - extensions/LocalisationUpdate/update.php | 5 +- extensions/Nuke/.gitreview | 5 - extensions/Nuke/COPYING | 8 + extensions/Nuke/Nuke.alias.php | 4 +- extensions/Nuke/Nuke.hooks.php | 27 - extensions/Nuke/Nuke.i18n.php | 300 +- extensions/Nuke/Nuke.php | 5 +- extensions/ParserFunctions/.gitreview | 5 - .../ParserFunctions/ParserFunctions.i18n.magic.php | 95 +- .../ParserFunctions/ParserFunctions.i18n.php | 97 +- extensions/ParserFunctions/ParserFunctions.php | 12 +- .../ParserFunctions/ParserFunctions_body.php | 2 +- .../ParserFunctions/tests/ExpressionTest.php | 76 - extensions/PdfHandler/.gitreview | 5 - extensions/PdfHandler/COPYING | 339 - extensions/PdfHandler/PdfHandler.i18n.php | 17 +- extensions/PdfHandler/PdfHandler_body.php | 4 +- extensions/Poem/.gitreview | 5 - extensions/Poem/Poem.i18n.php | 19 +- extensions/Renameuser/.gitreview | 5 - extensions/Renameuser/COPYING | 339 - extensions/Renameuser/README | 2 +- extensions/Renameuser/Renameuser.alias.php | 4 +- extensions/Renameuser/Renameuser.hooks.php | 14 +- extensions/Renameuser/Renameuser.i18n.php | 137 +- extensions/Renameuser/Renameuser.php | 1 - extensions/Renameuser/RenameuserSQL.php | 3 +- .../Renameuser/specials/SpecialRenameuser.php | 2 +- extensions/SimpleAntiSpam/.gitreview | 5 - extensions/SimpleAntiSpam/SimpleAntiSpam.i18n.php | 997 - extensions/SimpleAntiSpam/SimpleAntiSpam.php | 69 - extensions/SpamBlacklist/.gitreview | 5 - extensions/SpamBlacklist/SpamBlacklist.i18n.php | 194 +- extensions/SpamBlacklist/SpamBlacklist.php | 4 - extensions/SpamBlacklist/SpamBlacklist_body.php | 9 +- extensions/SpamBlacklist/api/ApiSpamBlacklist.php | 78 - extensions/SyntaxHighlight_GeSHi/.gitreview | 5 - extensions/SyntaxHighlight_GeSHi/COPYING | 339 - .../SyntaxHighlight_GeSHi.class.php | 43 +- .../SyntaxHighlight_GeSHi.i18n.php | 27 +- extensions/SyntaxHighlight_GeSHi/geshi/geshi.php | 2 +- .../SyntaxHighlight_GeSHi/geshi/geshi/haskell.php | 10 +- extensions/TitleBlacklist/.gitreview | 5 - extensions/TitleBlacklist/COPYING | 339 - extensions/TitleBlacklist/TitleBlacklist.i18n.php | 78 +- .../TitleBlacklist/TitleBlacklist.library.php | 33 - extensions/TitleBlacklist/TitleBlacklist.list.php | 53 +- extensions/TitleBlacklist/TitleBlacklist.php | 11 - .../TitleBlacklist/mw.ext.TitleBlacklist.lua | 22 - .../tests/ApiQueryTitleBlacklistTest.php | 132 - extensions/TitleBlacklist/tests/testSource | 5 - extensions/WikiEditor/.gitreview | 6 - extensions/WikiEditor/.jshintignore | 4 - extensions/WikiEditor/.jshintrc | 33 - extensions/WikiEditor/COPYING | 339 - extensions/WikiEditor/WikiEditor.i18n.php | 465 +- .../WikiEditor/modules/ext.wikiEditor.dialogs.js | 7 +- .../WikiEditor/modules/ext.wikiEditor.highlight.js | 3 +- extensions/WikiEditor/modules/ext.wikiEditor.js | 3 +- .../WikiEditor/modules/ext.wikiEditor.preview.js | 3 +- .../modules/ext.wikiEditor.previewDialog.js | 3 +- .../WikiEditor/modules/ext.wikiEditor.publish.js | 3 +- .../modules/ext.wikiEditor.templateEditor.js | 19 +- .../WikiEditor/modules/ext.wikiEditor.templates.js | 19 +- .../modules/ext.wikiEditor.tests.toolbar.js | 16 +- .../WikiEditor/modules/ext.wikiEditor.toc.js | 3 +- .../modules/ext.wikiEditor.toolbar.hideSig.js | 4 +- .../WikiEditor/modules/ext.wikiEditor.toolbar.js | 3 +- .../modules/images/toolbar/format-bold-hy.png | Bin 1675 -> 0 bytes .../modules/images/toolbar/format-italic-hy.png | Bin 1475 -> 0 bytes .../WikiEditor/modules/jquery.wikiEditor.css | 3 + .../modules/jquery.wikiEditor.dialogs.config.js | 59 +- .../modules/jquery.wikiEditor.dialogs.js | 34 +- .../modules/jquery.wikiEditor.highlight.js | 41 +- .../WikiEditor/modules/jquery.wikiEditor.iframe.js | 202 +- extensions/WikiEditor/modules/jquery.wikiEditor.js | 61 +- .../modules/jquery.wikiEditor.preview.js | 15 +- .../modules/jquery.wikiEditor.previewDialog.js | 15 +- .../modules/jquery.wikiEditor.publish.js | 13 +- .../modules/jquery.wikiEditor.templateEditor.js | 137 +- .../modules/jquery.wikiEditor.templates.js | 51 +- .../WikiEditor/modules/jquery.wikiEditor.toc.js | 136 +- .../modules/jquery.wikiEditor.toolbar.config.js | 7 +- .../modules/jquery.wikiEditor.toolbar.js | 53 +- .../tests/selenium/WikiDialogs_Links.php | 67 - .../tests/selenium/WikiDialogs_Links_Setup.php | 295 - .../tests/selenium/WikiEditorConstants.php | 84 - .../tests/selenium/WikiEditorSeleniumConfig.php | 27 - .../tests/selenium/WikiEditorTestSuite.php | 35 - includes/DefaultSettings.php | 2 +- skins/common/images/icons/fileicon-djvu.xcf | Bin 83394 -> 0 bytes skins/common/images/icons/fileicon-ogg.xcf | Bin 40236 -> 0 bytes tests/.htaccess | 1 - tests/TestsAutoLoader.php | 104 - tests/parser/ParserTestResult.php | 42 - tests/parser/README | 8 - tests/parser/extraParserTests.txt | Bin 1261 -> 0 bytes tests/parser/parserTest.inc | 1465 -- tests/parser/parserTests.txt | 18591 ------------------- tests/parser/parserTestsParserHook.php | 66 - .../parser/preprocess/All_system_messages.expected | 5625 ------ tests/parser/preprocess/All_system_messages.txt | 5624 ------ tests/parser/preprocess/Factorial.expected | 17 - tests/parser/preprocess/Factorial.txt | 16 - tests/parser/preprocess/Fundraising.expected | 18 - tests/parser/preprocess/Fundraising.txt | 17 - tests/parser/preprocess/NestedTemplates.expected | 90 - tests/parser/preprocess/NestedTemplates.txt | 89 - tests/parser/preprocess/QuoteQuran.expected | 140 - tests/parser/preprocess/QuoteQuran.txt | 139 - tests/parserTests.php | 94 - tests/phpunit/Makefile | 91 - tests/phpunit/MediaWikiLangTestCase.php | 33 - tests/phpunit/MediaWikiPHPUnitCommand.php | 119 - tests/phpunit/MediaWikiPHPUnitTestListener.php | 114 - tests/phpunit/MediaWikiTestCase.php | 948 - tests/phpunit/README | 53 - tests/phpunit/TODO | 10 - tests/phpunit/bootstrap.php | 15 - tests/phpunit/data/db/mysql/functions.sql | 12 - tests/phpunit/data/db/postgres/functions.sql | 12 - tests/phpunit/data/db/sqlite/tables-1.13.sql | 342 - tests/phpunit/data/db/sqlite/tables-1.15.sql | 454 - tests/phpunit/data/db/sqlite/tables-1.16.sql | 478 - tests/phpunit/data/db/sqlite/tables-1.17.sql | 511 - tests/phpunit/data/db/sqlite/tables-1.18.sql | 530 - .../data/less/common/test.common.mixins.less | 5 - tests/phpunit/data/less/module/dependency.less | 3 - tests/phpunit/data/less/module/styles.css | 6 - tests/phpunit/data/less/module/styles.less | 6 - tests/phpunit/data/media/1bit-png.png | Bin 167 -> 0 bytes tests/phpunit/data/media/80x60-2layers.xcf | Bin 1162 -> 0 bytes tests/phpunit/data/media/80x60-Greyscale.xcf | Bin 667 -> 0 bytes tests/phpunit/data/media/80x60-RGB.xcf | Bin 677 -> 0 bytes .../Animated_PNG_example_bouncing_beach_ball.png | Bin 72209 -> 0 bytes tests/phpunit/data/media/Gtk-media-play-ltr.svg | 35 - tests/phpunit/data/media/Png-native-test.png | Bin 4665 -> 0 bytes tests/phpunit/data/media/QA_icon.svg | 77 - tests/phpunit/data/media/README | 38 - tests/phpunit/data/media/Toll_Texas_1.svg | 150 - .../media/US_states_by_total_state_tax_revenue.svg | 248 - tests/phpunit/data/media/Wikimedia-logo.svg | 14 - .../data/media/Xmp-exif-multilingual_test.jpg | Bin 12544 -> 0 bytes tests/phpunit/data/media/animated-xmp.gif | Bin 3864 -> 0 bytes tests/phpunit/data/media/animated.gif | Bin 497 -> 0 bytes tests/phpunit/data/media/broken_exif_date.jpg | Bin 3233 -> 0 bytes tests/phpunit/data/media/exif-gps.jpg | Bin 665 -> 0 bytes tests/phpunit/data/media/exif-user-comment.jpg | Bin 484 -> 0 bytes tests/phpunit/data/media/greyscale-na-png.png | Bin 365 -> 0 bytes tests/phpunit/data/media/greyscale-png.png | Bin 415 -> 0 bytes tests/phpunit/data/media/iptc-invalid-psir.jpg | Bin 9574 -> 0 bytes tests/phpunit/data/media/iptc-timetest-invalid.jpg | Bin 9573 -> 0 bytes tests/phpunit/data/media/iptc-timetest.jpg | Bin 9573 -> 0 bytes tests/phpunit/data/media/jpeg-comment-binary.jpg | Bin 448 -> 0 bytes .../phpunit/data/media/jpeg-comment-iso8859-1.jpg | Bin 447 -> 0 bytes tests/phpunit/data/media/jpeg-comment-multiple.jpg | Bin 431 -> 0 bytes tests/phpunit/data/media/jpeg-comment-utf.jpg | Bin 445 -> 0 bytes tests/phpunit/data/media/jpeg-iptc-bad-hash.jpg | Bin 499 -> 0 bytes tests/phpunit/data/media/jpeg-iptc-good-hash.jpg | Bin 499 -> 0 bytes tests/phpunit/data/media/jpeg-padding-even.jpg | Bin 450 -> 0 bytes tests/phpunit/data/media/jpeg-padding-odd.jpg | Bin 451 -> 0 bytes tests/phpunit/data/media/jpeg-xmp-alt.jpg | Bin 3255 -> 0 bytes tests/phpunit/data/media/jpeg-xmp-psir.jpg | Bin 3308 -> 0 bytes tests/phpunit/data/media/jpeg-xmp-psir.xmp | 35 - tests/phpunit/data/media/landscape-plain.jpg | Bin 38771 -> 0 bytes tests/phpunit/data/media/nonanimated.gif | Bin 200 -> 0 bytes tests/phpunit/data/media/portrait-rotated.jpg | Bin 38577 -> 0 bytes tests/phpunit/data/media/rgb-na-png.png | Bin 593 -> 0 bytes tests/phpunit/data/media/rgb-png.png | Bin 663 -> 0 bytes tests/phpunit/data/media/test.jpg | Bin 437 -> 0 bytes tests/phpunit/data/media/test.tiff | Bin 566 -> 0 bytes tests/phpunit/data/media/xmp.png | Bin 582 -> 0 bytes tests/phpunit/data/xmp/1.result.php | 8 - tests/phpunit/data/xmp/1.xmp | 11 - tests/phpunit/data/xmp/2.result.php | 8 - tests/phpunit/data/xmp/2.xmp | 12 - tests/phpunit/data/xmp/3-invalid.result.php | 7 - tests/phpunit/data/xmp/3-invalid.xmp | 31 - tests/phpunit/data/xmp/3.result.php | 8 - tests/phpunit/data/xmp/3.xmp | 29 - tests/phpunit/data/xmp/4.result.php | 7 - tests/phpunit/data/xmp/4.xmp | 22 - tests/phpunit/data/xmp/5.result.php | 7 - tests/phpunit/data/xmp/5.xmp | 16 - tests/phpunit/data/xmp/6.result.php | 8 - tests/phpunit/data/xmp/6.xmp | 18 - tests/phpunit/data/xmp/7.result.php | 52 - tests/phpunit/data/xmp/7.xmp | 67 - tests/phpunit/data/xmp/README | 3 - tests/phpunit/data/xmp/bag-for-seq.result.php | 10 - tests/phpunit/data/xmp/bag-for-seq.xmp | 1 - tests/phpunit/data/xmp/flash.result.php | 8 - tests/phpunit/data/xmp/flash.xmp | 11 - tests/phpunit/data/xmp/gps.result.php | 11 - tests/phpunit/data/xmp/gps.xmp | 17 - .../data/xmp/invalid-child-not-struct.result.php | 7 - .../phpunit/data/xmp/invalid-child-not-struct.xmp | 12 - tests/phpunit/data/xmp/no-namespace.result.php | 7 - tests/phpunit/data/xmp/no-namespace.xmp | 11 - .../data/xmp/no-recognized-props.result.php | 2 - tests/phpunit/data/xmp/no-recognized-props.xmp | 8 - tests/phpunit/data/xmp/utf16BE.result.php | 12 - tests/phpunit/data/xmp/utf16BE.xmp | Bin 930 -> 0 bytes tests/phpunit/data/xmp/utf16LE.result.php | 12 - tests/phpunit/data/xmp/utf16LE.xmp | Bin 930 -> 0 bytes tests/phpunit/data/xmp/utf32BE.result.php | 12 - tests/phpunit/data/xmp/utf32BE.xmp | Bin 1856 -> 0 bytes tests/phpunit/data/xmp/utf32LE.result.php | 12 - tests/phpunit/data/xmp/utf32LE.xmp | Bin 1856 -> 0 bytes tests/phpunit/data/xmp/xmpExt.result.php | 8 - tests/phpunit/data/xmp/xmpExt.xmp | 13 - tests/phpunit/data/xmp/xmpExt2.xmp | 8 - tests/phpunit/data/zip/cd-gap.zip | Bin 182 -> 0 bytes tests/phpunit/data/zip/cd-truncated.zip | Bin 171 -> 0 bytes tests/phpunit/data/zip/class-trailing-null.zip | Bin 173 -> 0 bytes tests/phpunit/data/zip/class-trailing-slash.zip | Bin 173 -> 0 bytes tests/phpunit/data/zip/class.zip | Bin 173 -> 0 bytes tests/phpunit/data/zip/empty.zip | Bin 22 -> 0 bytes tests/phpunit/data/zip/looks-like-zip64.zip | Bin 173 -> 0 bytes tests/phpunit/data/zip/nosig.zip | Bin 173 -> 0 bytes tests/phpunit/data/zip/split.zip | Bin 196 -> 0 bytes tests/phpunit/data/zip/trail.zip | Bin 181 -> 0 bytes tests/phpunit/data/zip/wrong-cd-start-disk.zip | Bin 173 -> 0 bytes tests/phpunit/data/zip/wrong-central-entry-sig.zip | Bin 173 -> 0 bytes tests/phpunit/docs/ExportDemoTest.php | 39 - tests/phpunit/includes/ArticleTablesTest.php | 32 - tests/phpunit/includes/ArticleTest.php | 92 - tests/phpunit/includes/BlockTest.php | 354 - tests/phpunit/includes/CdbTest.php | 88 - tests/phpunit/includes/CollationTest.php | 111 - tests/phpunit/includes/DiffHistoryBlobTest.php | 44 - tests/phpunit/includes/EditPageTest.php | 491 - tests/phpunit/includes/ExternalStoreTest.php | 81 - tests/phpunit/includes/ExtraParserTest.php | 157 - tests/phpunit/includes/FallbackTest.php | 73 - tests/phpunit/includes/FauxRequestTest.php | 15 - tests/phpunit/includes/FauxResponseTest.php | 74 - .../includes/FormOptionsInitializationTest.php | 84 - tests/phpunit/includes/FormOptionsTest.php | 91 - .../includes/GlobalFunctions/GlobalTest.php | 652 - .../includes/GlobalFunctions/GlobalWithDBTest.php | 31 - tests/phpunit/includes/GlobalFunctions/README | 2 - .../includes/GlobalFunctions/wfAssembleUrlTest.php | 111 - .../includes/GlobalFunctions/wfBCP47Test.php | 120 - .../includes/GlobalFunctions/wfBaseConvertTest.php | 182 - .../includes/GlobalFunctions/wfBaseNameTest.php | 36 - .../includes/GlobalFunctions/wfExpandUrlTest.php | 111 - .../includes/GlobalFunctions/wfGetCallerTest.php | 40 - .../includes/GlobalFunctions/wfParseUrlTest.php | 146 - .../GlobalFunctions/wfRemoveDotSegmentsTest.php | 91 - .../GlobalFunctions/wfShorthandToIntegerTest.php | 30 - .../includes/GlobalFunctions/wfTimestampTest.php | 134 - .../includes/GlobalFunctions/wfUrlencodeTest.php | 119 - tests/phpunit/includes/HTMLCheckMatrixTest.php | 102 - tests/phpunit/includes/HashRingTest.php | 53 - tests/phpunit/includes/HooksTest.php | 158 - tests/phpunit/includes/HtmlFormatterTest.php | 81 - tests/phpunit/includes/HtmlTest.php | 631 - tests/phpunit/includes/HttpTest.php | 216 - tests/phpunit/includes/IPTest.php | 595 - tests/phpunit/includes/LanguageConverterTest.php | 148 - tests/phpunit/includes/LicensesTest.php | 22 - tests/phpunit/includes/LinkerTest.php | 71 - tests/phpunit/includes/LinksUpdateTest.php | 175 - tests/phpunit/includes/LocalFileTest.php | 107 - tests/phpunit/includes/LocalisationCacheTest.php | 31 - tests/phpunit/includes/MWExceptionHandlerTest.php | 73 - tests/phpunit/includes/MWFunctionTest.php | 30 - tests/phpunit/includes/MWNamespaceTest.php | 571 - tests/phpunit/includes/MessageTest.php | 130 - tests/phpunit/includes/OutputPageTest.php | 133 - tests/phpunit/includes/PathRouterTest.php | 263 - tests/phpunit/includes/PreferencesTest.php | 91 - tests/phpunit/includes/RecentChangeTest.php | 280 - tests/phpunit/includes/RequestContextTest.php | 73 - tests/phpunit/includes/ResourceLoaderTest.php | 149 - tests/phpunit/includes/RevisionStorageTest.php | 546 - .../RevisionStorageTest_ContentHandlerUseDB.php | 81 - tests/phpunit/includes/RevisionTest.php | 481 - tests/phpunit/includes/SampleTest.php | 105 - tests/phpunit/includes/SanitizerTest.php | 302 - .../includes/SanitizerValidateEmailTest.php | 103 - tests/phpunit/includes/SiteConfigurationTest.php | 335 - tests/phpunit/includes/StringUtilsTest.php | 147 - tests/phpunit/includes/TemplateCategoriesTest.php | 53 - tests/phpunit/includes/TestUser.php | 59 - tests/phpunit/includes/TimeAdjustTest.php | 41 - tests/phpunit/includes/TimestampTest.php | 304 - tests/phpunit/includes/TitleMethodsTest.php | 300 - tests/phpunit/includes/TitlePermissionTest.php | 742 - tests/phpunit/includes/TitleTest.php | 485 - tests/phpunit/includes/UIDGeneratorTest.php | 98 - tests/phpunit/includes/UserMailerTest.php | 14 - tests/phpunit/includes/UserTest.php | 237 - tests/phpunit/includes/WebRequestTest.php | 310 - tests/phpunit/includes/WikiPageTest.php | 1074 -- .../includes/WikiPageTest_ContentHandlerUseDB.php | 53 - tests/phpunit/includes/XmlJsTest.php | 24 - tests/phpunit/includes/XmlSelectTest.php | 173 - tests/phpunit/includes/XmlTest.php | 402 - tests/phpunit/includes/XmlTypeCheckTest.php | 30 - tests/phpunit/includes/ZipDirectoryReaderTest.php | 85 - .../includes/api/ApiAccountCreationTest.php | 159 - tests/phpunit/includes/api/ApiBlockTest.php | 95 - tests/phpunit/includes/api/ApiEditPageTest.php | 417 - tests/phpunit/includes/api/ApiOptionsTest.php | 420 - tests/phpunit/includes/api/ApiParseTest.php | 29 - tests/phpunit/includes/api/ApiPurgeTest.php | 40 - tests/phpunit/includes/api/ApiTest.php | 259 - tests/phpunit/includes/api/ApiTestCase.php | 253 - tests/phpunit/includes/api/ApiTestCaseUpload.php | 149 - tests/phpunit/includes/api/ApiUploadTest.php | 561 - tests/phpunit/includes/api/ApiWatchTest.php | 148 - .../phpunit/includes/api/PrefixUniquenessTest.php | 25 - .../phpunit/includes/api/RandomImageGenerator.php | 468 - .../includes/api/format/ApiFormatPhpTest.php | 17 - .../includes/api/format/ApiFormatTestBase.php | 22 - .../phpunit/includes/api/generateRandomImages.php | 46 - .../includes/api/query/ApiQueryBasicTest.php | 395 - .../includes/api/query/ApiQueryContinue2Test.php | 68 - .../includes/api/query/ApiQueryContinueTest.php | 313 - .../api/query/ApiQueryContinueTestBase.php | 209 - .../includes/api/query/ApiQueryRevisionsTest.php | 39 - tests/phpunit/includes/api/query/ApiQueryTest.php | 66 - .../includes/api/query/ApiQueryTestBase.php | 150 - tests/phpunit/includes/api/words.txt | 1000 - tests/phpunit/includes/cache/GenderCacheTest.php | 104 - tests/phpunit/includes/cache/MessageCacheTest.php | 128 - .../phpunit/includes/cache/ProcessCacheLRUTest.php | 237 - .../includes/content/ContentHandlerTest.php | 451 - tests/phpunit/includes/content/CssContentTest.php | 87 - .../includes/content/JavaScriptContentTest.php | 287 - tests/phpunit/includes/content/TextContentTest.php | 458 - .../content/WikitextContentHandlerTest.php | 227 - .../includes/content/WikitextContentTest.php | 404 - .../phpunit/includes/db/DatabaseMysqlBaseTest.php | 209 - tests/phpunit/includes/db/DatabaseSQLTest.php | 721 - tests/phpunit/includes/db/DatabaseSqliteTest.php | 421 - tests/phpunit/includes/db/DatabaseTest.php | 234 - tests/phpunit/includes/db/DatabaseTestHelper.php | 166 - tests/phpunit/includes/db/ORMRowTest.php | 226 - tests/phpunit/includes/db/ORMTableTest.php | 146 - tests/phpunit/includes/db/TestORMRowTest.php | 215 - tests/phpunit/includes/debug/MWDebugTest.php | 72 - .../includes/filebackend/FileBackendTest.php | 2306 --- tests/phpunit/includes/filerepo/FileRepoTest.php | 55 - tests/phpunit/includes/filerepo/StoreBatchTest.php | 134 - .../includes/installer/InstallDocFormatterTest.php | 65 - .../includes/installer/OracleInstallerTest.php | 48 - tests/phpunit/includes/jobqueue/JobQueueTest.php | 329 - tests/phpunit/includes/json/FormatJsonTest.php | 161 - tests/phpunit/includes/libs/CSSJanusTest.php | 606 - tests/phpunit/includes/libs/CSSMinTest.php | 133 - .../includes/libs/GenericArrayObjectTest.php | 263 - tests/phpunit/includes/libs/IEUrlExtensionTest.php | 126 - .../includes/libs/JavaScriptMinifierTest.php | 170 - .../phpunit/includes/logging/LogFormatterTest.php | 207 - tests/phpunit/includes/logging/LogTests.i18n.php | 15 - .../includes/media/BitmapMetadataHandlerTest.php | 167 - tests/phpunit/includes/media/BitmapScalingTest.php | 137 - tests/phpunit/includes/media/ExifBitmapTest.php | 139 - tests/phpunit/includes/media/ExifRotationTest.php | 248 - tests/phpunit/includes/media/ExifTest.php | 46 - tests/phpunit/includes/media/FakeDimensionFile.php | 28 - .../phpunit/includes/media/FormatMetadataTest.php | 59 - .../includes/media/GIFMetadataExtractorTest.php | 107 - tests/phpunit/includes/media/GIFTest.php | 120 - tests/phpunit/includes/media/IPTCTest.php | 81 - .../includes/media/JpegMetadataExtractorTest.php | 109 - tests/phpunit/includes/media/JpegTest.php | 33 - tests/phpunit/includes/media/MediaHandlerTest.php | 53 - .../includes/media/PNGMetadataExtractorTest.php | 155 - tests/phpunit/includes/media/PNGTest.php | 123 - .../includes/media/SVGMetadataExtractorTest.php | 112 - tests/phpunit/includes/media/TiffTest.php | 39 - tests/phpunit/includes/media/XMPTest.php | 166 - tests/phpunit/includes/media/XMPValidateTest.php | 46 - tests/phpunit/includes/normal/CleanUpTest.php | 409 - .../phpunit/includes/objectcache/BagOStuffTest.php | 149 - .../phpunit/includes/parser/MagicVariableTest.php | 242 - .../includes/parser/MediaWikiParserTest.php | 120 - tests/phpunit/includes/parser/NewParserTest.php | 969 - .../phpunit/includes/parser/ParserMethodsTest.php | 95 - tests/phpunit/includes/parser/ParserOutputTest.php | 59 - .../phpunit/includes/parser/ParserPreloadTest.php | 80 - tests/phpunit/includes/parser/PreprocessorTest.php | 239 - tests/phpunit/includes/parser/TagHooksTest.php | 82 - tests/phpunit/includes/parser/TidyTest.php | 44 - tests/phpunit/includes/search/SearchEngineTest.php | 176 - tests/phpunit/includes/search/SearchUpdateTest.php | 74 - tests/phpunit/includes/site/MediaWikiSiteTest.php | 90 - tests/phpunit/includes/site/SiteListTest.php | 197 - tests/phpunit/includes/site/SiteSQLStoreTest.php | 134 - tests/phpunit/includes/site/SiteTest.php | 296 - tests/phpunit/includes/site/TestSites.php | 100 - .../includes/specials/QueryAllSpecialPagesTest.php | 79 - .../includes/specials/SpecialPreferencesTest.php | 60 - .../includes/specials/SpecialRecentchangesTest.php | 125 - .../includes/specials/SpecialSearchTest.php | 139 - tests/phpunit/includes/upload/UploadBaseTest.php | 147 - .../phpunit/includes/upload/UploadFromUrlTest.php | 350 - tests/phpunit/includes/upload/UploadStashTest.php | 76 - tests/phpunit/install-phpunit.sh | 37 - tests/phpunit/languages/LanguageAmTest.php | 35 - tests/phpunit/languages/LanguageArTest.php | 87 - tests/phpunit/languages/LanguageBeTest.php | 42 - tests/phpunit/languages/LanguageBe_taraskTest.php | 95 - tests/phpunit/languages/LanguageBhoTest.php | 35 - tests/phpunit/languages/LanguageBsTest.php | 42 - .../phpunit/languages/LanguageClassesTestCase.php | 74 - tests/phpunit/languages/LanguageCsTest.php | 41 - tests/phpunit/languages/LanguageCuTest.php | 42 - tests/phpunit/languages/LanguageCyTest.php | 43 - tests/phpunit/languages/LanguageDsbTest.php | 41 - tests/phpunit/languages/LanguageFrTest.php | 35 - tests/phpunit/languages/LanguageGaTest.php | 35 - tests/phpunit/languages/LanguageGdTest.php | 53 - tests/phpunit/languages/LanguageGvTest.php | 44 - tests/phpunit/languages/LanguageHeTest.php | 132 - tests/phpunit/languages/LanguageHiTest.php | 35 - tests/phpunit/languages/LanguageHrTest.php | 42 - tests/phpunit/languages/LanguageHsbTest.php | 41 - tests/phpunit/languages/LanguageHuTest.php | 35 - tests/phpunit/languages/LanguageHyTest.php | 35 - tests/phpunit/languages/LanguageKshTest.php | 35 - tests/phpunit/languages/LanguageLnTest.php | 35 - tests/phpunit/languages/LanguageLtTest.php | 63 - tests/phpunit/languages/LanguageLvTest.php | 44 - tests/phpunit/languages/LanguageMgTest.php | 36 - tests/phpunit/languages/LanguageMkTest.php | 40 - tests/phpunit/languages/LanguageMlTest.php | 38 - tests/phpunit/languages/LanguageMoTest.php | 45 - tests/phpunit/languages/LanguageMtTest.php | 77 - tests/phpunit/languages/LanguageNlTest.php | 24 - tests/phpunit/languages/LanguageNsoTest.php | 34 - tests/phpunit/languages/LanguagePlTest.php | 77 - tests/phpunit/languages/LanguageRoTest.php | 45 - tests/phpunit/languages/LanguageRuTest.php | 105 - tests/phpunit/languages/LanguageSeTest.php | 53 - tests/phpunit/languages/LanguageSgsTest.php | 71 - tests/phpunit/languages/LanguageShTest.php | 42 - tests/phpunit/languages/LanguageSkTest.php | 42 - tests/phpunit/languages/LanguageSlTest.php | 44 - tests/phpunit/languages/LanguageSmaTest.php | 53 - tests/phpunit/languages/LanguageSrTest.php | 246 - tests/phpunit/languages/LanguageTest.php | 1567 -- tests/phpunit/languages/LanguageTiTest.php | 34 - tests/phpunit/languages/LanguageTlTest.php | 34 - tests/phpunit/languages/LanguageTrTest.php | 59 - tests/phpunit/languages/LanguageUkTest.php | 72 - tests/phpunit/languages/LanguageUzTest.php | 121 - tests/phpunit/languages/LanguageWaTest.php | 34 - .../utils/CLDRPluralRuleEvaluatorTest.php | 145 - tests/phpunit/maintenance/DumpTestCase.php | 379 - tests/phpunit/maintenance/MaintenanceTest.php | 816 - tests/phpunit/maintenance/backupPrefetchTest.php | 275 - tests/phpunit/maintenance/backupTextPassTest.php | 581 - tests/phpunit/maintenance/backup_LogTest.php | 228 - tests/phpunit/maintenance/backup_PageTest.php | 404 - tests/phpunit/maintenance/fetchTextTest.php | 238 - tests/phpunit/maintenance/getSlaveServerTest.php | 67 - tests/phpunit/mocks/filebackend/MockFSFile.php | 69 - .../phpunit/mocks/filebackend/MockFileBackend.php | 122 - tests/phpunit/mocks/media/MockBitmapHandler.php | 92 - tests/phpunit/phpunit.php | 119 - tests/phpunit/run-tests.bat | 1 - tests/phpunit/skins/SideBarTest.php | 206 - tests/phpunit/structure/AutoLoaderTest.php | 56 - tests/phpunit/structure/ResourcesTest.php | 131 - tests/phpunit/structure/StructureTest.php | 63 - tests/phpunit/suite.xml | 51 - tests/phpunit/suites/ExtensionsParserTestSuite.php | 8 - tests/phpunit/suites/ExtensionsTestSuite.php | 33 - tests/phpunit/suites/UploadFromUrlTestSuite.php | 207 - tests/qunit/.htaccess | 1 - tests/qunit/QUnitTestResources.php | 68 - tests/qunit/data/callMwLoaderTestCallback.js | 1 - tests/qunit/data/generateJqueryMsgData.php | 150 - tests/qunit/data/load.mock.php | 59 - tests/qunit/data/mediawiki.jqueryMsg.data.js | 492 - tests/qunit/data/qunitOkCall.js | 2 - tests/qunit/data/styleTest.css.php | 61 - tests/qunit/data/testrunner.js | 431 - .../resources/jquery/jquery.autoEllipsis.test.js | 58 - .../resources/jquery/jquery.byteLength.test.js | 37 - .../resources/jquery/jquery.byteLimit.test.js | 252 - .../suites/resources/jquery/jquery.client.test.js | 542 - .../resources/jquery/jquery.colorUtil.test.js | 63 - .../resources/jquery/jquery.delayedBind.test.js | 37 - .../resources/jquery/jquery.getAttrs.test.js | 13 - .../suites/resources/jquery/jquery.hidpi.test.js | 22 - .../resources/jquery/jquery.highlightText.test.js | 235 - .../resources/jquery/jquery.localize.test.js | 135 - .../jquery/jquery.makeCollapsible.test.js | 287 - .../resources/jquery/jquery.mwExtension.test.js | 57 - .../resources/jquery/jquery.tabIndex.test.js | 35 - .../resources/jquery/jquery.tablesorter.test.js | 1268 -- .../resources/jquery/jquery.textSelection.test.js | 275 - .../mediawiki.api/mediawiki.api.parse.test.js | 28 - .../resources/mediawiki.api/mediawiki.api.test.js | 61 - .../mediawiki.special.recentchanges.test.js | 63 - .../resources/mediawiki/mediawiki.Title.test.js | 416 - .../resources/mediawiki/mediawiki.Uri.test.js | 433 - .../resources/mediawiki/mediawiki.cldr.test.js | 81 - .../mediawiki/mediawiki.jqueryMsg.test.js | 714 - .../resources/mediawiki/mediawiki.jscompat.test.js | 70 - .../resources/mediawiki/mediawiki.language.test.js | 443 - .../suites/resources/mediawiki/mediawiki.test.js | 916 - .../resources/mediawiki/mediawiki.user.test.js | 57 - .../resources/mediawiki/mediawiki.util.test.js | 354 - tests/qunit/suites/resources/startup.test.js | 129 - tests/testHelpers.inc | 633 - 567 files changed, 1616 insertions(+), 98899 deletions(-) delete mode 100644 .gitreview delete mode 100644 .jshintignore delete mode 100644 .jshintrc delete mode 100644 extensions/Cite/.gitreview delete mode 100644 extensions/Cite/.jshintignore delete mode 100644 extensions/Cite/.jshintrc delete mode 100644 extensions/Cite/COPYING delete mode 100644 extensions/ConfirmEdit/.gitreview create mode 100644 extensions/ConfirmEdit/HTMLCaptchaField.php delete mode 100644 extensions/Gadgets/.gitreview delete mode 100644 extensions/Gadgets/COPYING delete mode 100644 extensions/Gadgets/tests/GadgetTest.php delete mode 100644 extensions/ImageMap/.gitreview delete mode 100644 extensions/ImageMap/COPYING delete mode 100644 extensions/InputBox/.gitreview delete mode 100644 extensions/Interwiki/.gitreview delete mode 100644 extensions/Interwiki/COPYING delete mode 100644 extensions/LocalisationUpdate/.gitreview create mode 100644 extensions/LocalisationUpdate/KNOWN_ISSUES.txt delete mode 100644 extensions/LocalisationUpdate/README create mode 100644 extensions/LocalisationUpdate/README_FIRST.txt delete mode 100644 extensions/LocalisationUpdate/tests/tokenTest.php delete mode 100644 extensions/Nuke/.gitreview delete mode 100644 extensions/Nuke/Nuke.hooks.php delete mode 100644 extensions/ParserFunctions/.gitreview delete mode 100644 extensions/ParserFunctions/tests/ExpressionTest.php delete mode 100644 extensions/PdfHandler/.gitreview delete mode 100644 extensions/PdfHandler/COPYING delete mode 100644 extensions/Poem/.gitreview delete mode 100644 extensions/Renameuser/.gitreview delete mode 100644 extensions/Renameuser/COPYING delete mode 100644 extensions/SimpleAntiSpam/.gitreview delete mode 100644 extensions/SimpleAntiSpam/SimpleAntiSpam.i18n.php delete mode 100644 extensions/SimpleAntiSpam/SimpleAntiSpam.php delete mode 100644 extensions/SpamBlacklist/.gitreview delete mode 100644 extensions/SpamBlacklist/api/ApiSpamBlacklist.php delete mode 100644 extensions/SyntaxHighlight_GeSHi/.gitreview delete mode 100644 extensions/SyntaxHighlight_GeSHi/COPYING delete mode 100644 extensions/TitleBlacklist/.gitreview delete mode 100644 extensions/TitleBlacklist/COPYING delete mode 100644 extensions/TitleBlacklist/TitleBlacklist.library.php delete mode 100644 extensions/TitleBlacklist/mw.ext.TitleBlacklist.lua delete mode 100644 extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php delete mode 100644 extensions/TitleBlacklist/tests/testSource delete mode 100644 extensions/WikiEditor/.gitreview delete mode 100644 extensions/WikiEditor/.jshintignore delete mode 100644 extensions/WikiEditor/.jshintrc delete mode 100644 extensions/WikiEditor/COPYING delete mode 100644 extensions/WikiEditor/modules/images/toolbar/format-bold-hy.png delete mode 100644 extensions/WikiEditor/modules/images/toolbar/format-italic-hy.png delete mode 100644 extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php delete mode 100644 extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php delete mode 100644 extensions/WikiEditor/tests/selenium/WikiEditorConstants.php delete mode 100644 extensions/WikiEditor/tests/selenium/WikiEditorSeleniumConfig.php delete mode 100644 extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php delete mode 100644 skins/common/images/icons/fileicon-djvu.xcf delete mode 100644 skins/common/images/icons/fileicon-ogg.xcf delete mode 100644 tests/.htaccess delete mode 100644 tests/TestsAutoLoader.php delete mode 100644 tests/parser/ParserTestResult.php delete mode 100644 tests/parser/README delete mode 100644 tests/parser/extraParserTests.txt delete mode 100644 tests/parser/parserTest.inc delete mode 100644 tests/parser/parserTests.txt delete mode 100644 tests/parser/parserTestsParserHook.php delete mode 100644 tests/parser/preprocess/All_system_messages.expected delete mode 100644 tests/parser/preprocess/All_system_messages.txt delete mode 100644 tests/parser/preprocess/Factorial.expected delete mode 100644 tests/parser/preprocess/Factorial.txt delete mode 100644 tests/parser/preprocess/Fundraising.expected delete mode 100644 tests/parser/preprocess/Fundraising.txt delete mode 100644 tests/parser/preprocess/NestedTemplates.expected delete mode 100644 tests/parser/preprocess/NestedTemplates.txt delete mode 100644 tests/parser/preprocess/QuoteQuran.expected delete mode 100644 tests/parser/preprocess/QuoteQuran.txt delete mode 100644 tests/parserTests.php delete mode 100644 tests/phpunit/Makefile delete mode 100644 tests/phpunit/MediaWikiLangTestCase.php delete mode 100644 tests/phpunit/MediaWikiPHPUnitCommand.php delete mode 100644 tests/phpunit/MediaWikiPHPUnitTestListener.php delete mode 100644 tests/phpunit/MediaWikiTestCase.php delete mode 100644 tests/phpunit/README delete mode 100644 tests/phpunit/TODO delete mode 100644 tests/phpunit/bootstrap.php delete mode 100644 tests/phpunit/data/db/mysql/functions.sql delete mode 100644 tests/phpunit/data/db/postgres/functions.sql delete mode 100644 tests/phpunit/data/db/sqlite/tables-1.13.sql delete mode 100644 tests/phpunit/data/db/sqlite/tables-1.15.sql delete mode 100644 tests/phpunit/data/db/sqlite/tables-1.16.sql delete mode 100644 tests/phpunit/data/db/sqlite/tables-1.17.sql delete mode 100644 tests/phpunit/data/db/sqlite/tables-1.18.sql delete mode 100644 tests/phpunit/data/less/common/test.common.mixins.less delete mode 100644 tests/phpunit/data/less/module/dependency.less delete mode 100644 tests/phpunit/data/less/module/styles.css delete mode 100644 tests/phpunit/data/less/module/styles.less delete mode 100644 tests/phpunit/data/media/1bit-png.png delete mode 100644 tests/phpunit/data/media/80x60-2layers.xcf delete mode 100644 tests/phpunit/data/media/80x60-Greyscale.xcf delete mode 100644 tests/phpunit/data/media/80x60-RGB.xcf delete mode 100644 tests/phpunit/data/media/Animated_PNG_example_bouncing_beach_ball.png delete mode 100644 tests/phpunit/data/media/Gtk-media-play-ltr.svg delete mode 100644 tests/phpunit/data/media/Png-native-test.png delete mode 100644 tests/phpunit/data/media/QA_icon.svg delete mode 100644 tests/phpunit/data/media/README delete mode 100644 tests/phpunit/data/media/Toll_Texas_1.svg delete mode 100644 tests/phpunit/data/media/US_states_by_total_state_tax_revenue.svg delete mode 100644 tests/phpunit/data/media/Wikimedia-logo.svg delete mode 100644 tests/phpunit/data/media/Xmp-exif-multilingual_test.jpg delete mode 100644 tests/phpunit/data/media/animated-xmp.gif delete mode 100644 tests/phpunit/data/media/animated.gif delete mode 100644 tests/phpunit/data/media/broken_exif_date.jpg delete mode 100644 tests/phpunit/data/media/exif-gps.jpg delete mode 100644 tests/phpunit/data/media/exif-user-comment.jpg delete mode 100644 tests/phpunit/data/media/greyscale-na-png.png delete mode 100644 tests/phpunit/data/media/greyscale-png.png delete mode 100644 tests/phpunit/data/media/iptc-invalid-psir.jpg delete mode 100644 tests/phpunit/data/media/iptc-timetest-invalid.jpg delete mode 100644 tests/phpunit/data/media/iptc-timetest.jpg delete mode 100644 tests/phpunit/data/media/jpeg-comment-binary.jpg delete mode 100644 tests/phpunit/data/media/jpeg-comment-iso8859-1.jpg delete mode 100644 tests/phpunit/data/media/jpeg-comment-multiple.jpg delete mode 100644 tests/phpunit/data/media/jpeg-comment-utf.jpg delete mode 100644 tests/phpunit/data/media/jpeg-iptc-bad-hash.jpg delete mode 100644 tests/phpunit/data/media/jpeg-iptc-good-hash.jpg delete mode 100644 tests/phpunit/data/media/jpeg-padding-even.jpg delete mode 100644 tests/phpunit/data/media/jpeg-padding-odd.jpg delete mode 100644 tests/phpunit/data/media/jpeg-xmp-alt.jpg delete mode 100644 tests/phpunit/data/media/jpeg-xmp-psir.jpg delete mode 100644 tests/phpunit/data/media/jpeg-xmp-psir.xmp delete mode 100644 tests/phpunit/data/media/landscape-plain.jpg delete mode 100644 tests/phpunit/data/media/nonanimated.gif delete mode 100644 tests/phpunit/data/media/portrait-rotated.jpg delete mode 100644 tests/phpunit/data/media/rgb-na-png.png delete mode 100644 tests/phpunit/data/media/rgb-png.png delete mode 100644 tests/phpunit/data/media/test.jpg delete mode 100644 tests/phpunit/data/media/test.tiff delete mode 100644 tests/phpunit/data/media/xmp.png delete mode 100644 tests/phpunit/data/xmp/1.result.php delete mode 100644 tests/phpunit/data/xmp/1.xmp delete mode 100644 tests/phpunit/data/xmp/2.result.php delete mode 100644 tests/phpunit/data/xmp/2.xmp delete mode 100644 tests/phpunit/data/xmp/3-invalid.result.php delete mode 100644 tests/phpunit/data/xmp/3-invalid.xmp delete mode 100644 tests/phpunit/data/xmp/3.result.php delete mode 100644 tests/phpunit/data/xmp/3.xmp delete mode 100644 tests/phpunit/data/xmp/4.result.php delete mode 100644 tests/phpunit/data/xmp/4.xmp delete mode 100644 tests/phpunit/data/xmp/5.result.php delete mode 100644 tests/phpunit/data/xmp/5.xmp delete mode 100644 tests/phpunit/data/xmp/6.result.php delete mode 100644 tests/phpunit/data/xmp/6.xmp delete mode 100644 tests/phpunit/data/xmp/7.result.php delete mode 100644 tests/phpunit/data/xmp/7.xmp delete mode 100644 tests/phpunit/data/xmp/README delete mode 100644 tests/phpunit/data/xmp/bag-for-seq.result.php delete mode 100644 tests/phpunit/data/xmp/bag-for-seq.xmp delete mode 100644 tests/phpunit/data/xmp/flash.result.php delete mode 100644 tests/phpunit/data/xmp/flash.xmp delete mode 100644 tests/phpunit/data/xmp/gps.result.php delete mode 100644 tests/phpunit/data/xmp/gps.xmp delete mode 100644 tests/phpunit/data/xmp/invalid-child-not-struct.result.php delete mode 100644 tests/phpunit/data/xmp/invalid-child-not-struct.xmp delete mode 100644 tests/phpunit/data/xmp/no-namespace.result.php delete mode 100644 tests/phpunit/data/xmp/no-namespace.xmp delete mode 100644 tests/phpunit/data/xmp/no-recognized-props.result.php delete mode 100644 tests/phpunit/data/xmp/no-recognized-props.xmp delete mode 100644 tests/phpunit/data/xmp/utf16BE.result.php delete mode 100644 tests/phpunit/data/xmp/utf16BE.xmp delete mode 100644 tests/phpunit/data/xmp/utf16LE.result.php delete mode 100644 tests/phpunit/data/xmp/utf16LE.xmp delete mode 100644 tests/phpunit/data/xmp/utf32BE.result.php delete mode 100644 tests/phpunit/data/xmp/utf32BE.xmp delete mode 100644 tests/phpunit/data/xmp/utf32LE.result.php delete mode 100644 tests/phpunit/data/xmp/utf32LE.xmp delete mode 100644 tests/phpunit/data/xmp/xmpExt.result.php delete mode 100644 tests/phpunit/data/xmp/xmpExt.xmp delete mode 100644 tests/phpunit/data/xmp/xmpExt2.xmp delete mode 100644 tests/phpunit/data/zip/cd-gap.zip delete mode 100644 tests/phpunit/data/zip/cd-truncated.zip delete mode 100644 tests/phpunit/data/zip/class-trailing-null.zip delete mode 100644 tests/phpunit/data/zip/class-trailing-slash.zip delete mode 100644 tests/phpunit/data/zip/class.zip delete mode 100644 tests/phpunit/data/zip/empty.zip delete mode 100644 tests/phpunit/data/zip/looks-like-zip64.zip delete mode 100644 tests/phpunit/data/zip/nosig.zip delete mode 100644 tests/phpunit/data/zip/split.zip delete mode 100644 tests/phpunit/data/zip/trail.zip delete mode 100644 tests/phpunit/data/zip/wrong-cd-start-disk.zip delete mode 100644 tests/phpunit/data/zip/wrong-central-entry-sig.zip delete mode 100644 tests/phpunit/docs/ExportDemoTest.php delete mode 100644 tests/phpunit/includes/ArticleTablesTest.php delete mode 100644 tests/phpunit/includes/ArticleTest.php delete mode 100644 tests/phpunit/includes/BlockTest.php delete mode 100644 tests/phpunit/includes/CdbTest.php delete mode 100644 tests/phpunit/includes/CollationTest.php delete mode 100644 tests/phpunit/includes/DiffHistoryBlobTest.php delete mode 100644 tests/phpunit/includes/EditPageTest.php delete mode 100644 tests/phpunit/includes/ExternalStoreTest.php delete mode 100644 tests/phpunit/includes/ExtraParserTest.php delete mode 100644 tests/phpunit/includes/FallbackTest.php delete mode 100644 tests/phpunit/includes/FauxRequestTest.php delete mode 100644 tests/phpunit/includes/FauxResponseTest.php delete mode 100644 tests/phpunit/includes/FormOptionsInitializationTest.php delete mode 100644 tests/phpunit/includes/FormOptionsTest.php delete mode 100644 tests/phpunit/includes/GlobalFunctions/GlobalTest.php delete mode 100644 tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php delete mode 100644 tests/phpunit/includes/GlobalFunctions/README delete mode 100644 tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php delete mode 100644 tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php delete mode 100644 tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php delete mode 100644 tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php delete mode 100644 tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php delete mode 100644 tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php delete mode 100644 tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php delete mode 100644 tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php delete mode 100644 tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php delete mode 100644 tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php delete mode 100644 tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php delete mode 100644 tests/phpunit/includes/HTMLCheckMatrixTest.php delete mode 100644 tests/phpunit/includes/HashRingTest.php delete mode 100644 tests/phpunit/includes/HooksTest.php delete mode 100644 tests/phpunit/includes/HtmlFormatterTest.php delete mode 100644 tests/phpunit/includes/HtmlTest.php delete mode 100644 tests/phpunit/includes/HttpTest.php delete mode 100644 tests/phpunit/includes/IPTest.php delete mode 100644 tests/phpunit/includes/LanguageConverterTest.php delete mode 100644 tests/phpunit/includes/LicensesTest.php delete mode 100644 tests/phpunit/includes/LinkerTest.php delete mode 100644 tests/phpunit/includes/LinksUpdateTest.php delete mode 100644 tests/phpunit/includes/LocalFileTest.php delete mode 100644 tests/phpunit/includes/LocalisationCacheTest.php delete mode 100644 tests/phpunit/includes/MWExceptionHandlerTest.php delete mode 100644 tests/phpunit/includes/MWFunctionTest.php delete mode 100644 tests/phpunit/includes/MWNamespaceTest.php delete mode 100644 tests/phpunit/includes/MessageTest.php delete mode 100644 tests/phpunit/includes/OutputPageTest.php delete mode 100644 tests/phpunit/includes/PathRouterTest.php delete mode 100644 tests/phpunit/includes/PreferencesTest.php delete mode 100644 tests/phpunit/includes/RecentChangeTest.php delete mode 100644 tests/phpunit/includes/RequestContextTest.php delete mode 100644 tests/phpunit/includes/ResourceLoaderTest.php delete mode 100644 tests/phpunit/includes/RevisionStorageTest.php delete mode 100644 tests/phpunit/includes/RevisionStorageTest_ContentHandlerUseDB.php delete mode 100644 tests/phpunit/includes/RevisionTest.php delete mode 100644 tests/phpunit/includes/SampleTest.php delete mode 100644 tests/phpunit/includes/SanitizerTest.php delete mode 100644 tests/phpunit/includes/SanitizerValidateEmailTest.php delete mode 100644 tests/phpunit/includes/SiteConfigurationTest.php delete mode 100644 tests/phpunit/includes/StringUtilsTest.php delete mode 100644 tests/phpunit/includes/TemplateCategoriesTest.php delete mode 100644 tests/phpunit/includes/TestUser.php delete mode 100644 tests/phpunit/includes/TimeAdjustTest.php delete mode 100644 tests/phpunit/includes/TimestampTest.php delete mode 100644 tests/phpunit/includes/TitleMethodsTest.php delete mode 100644 tests/phpunit/includes/TitlePermissionTest.php delete mode 100644 tests/phpunit/includes/TitleTest.php delete mode 100644 tests/phpunit/includes/UIDGeneratorTest.php delete mode 100644 tests/phpunit/includes/UserMailerTest.php delete mode 100644 tests/phpunit/includes/UserTest.php delete mode 100644 tests/phpunit/includes/WebRequestTest.php delete mode 100644 tests/phpunit/includes/WikiPageTest.php delete mode 100644 tests/phpunit/includes/WikiPageTest_ContentHandlerUseDB.php delete mode 100644 tests/phpunit/includes/XmlJsTest.php delete mode 100644 tests/phpunit/includes/XmlSelectTest.php delete mode 100644 tests/phpunit/includes/XmlTest.php delete mode 100644 tests/phpunit/includes/XmlTypeCheckTest.php delete mode 100644 tests/phpunit/includes/ZipDirectoryReaderTest.php delete mode 100644 tests/phpunit/includes/api/ApiAccountCreationTest.php delete mode 100644 tests/phpunit/includes/api/ApiBlockTest.php delete mode 100644 tests/phpunit/includes/api/ApiEditPageTest.php delete mode 100644 tests/phpunit/includes/api/ApiOptionsTest.php delete mode 100644 tests/phpunit/includes/api/ApiParseTest.php delete mode 100644 tests/phpunit/includes/api/ApiPurgeTest.php delete mode 100644 tests/phpunit/includes/api/ApiTest.php delete mode 100644 tests/phpunit/includes/api/ApiTestCase.php delete mode 100644 tests/phpunit/includes/api/ApiTestCaseUpload.php delete mode 100644 tests/phpunit/includes/api/ApiUploadTest.php delete mode 100644 tests/phpunit/includes/api/ApiWatchTest.php delete mode 100644 tests/phpunit/includes/api/PrefixUniquenessTest.php delete mode 100644 tests/phpunit/includes/api/RandomImageGenerator.php delete mode 100644 tests/phpunit/includes/api/format/ApiFormatPhpTest.php delete mode 100644 tests/phpunit/includes/api/format/ApiFormatTestBase.php delete mode 100644 tests/phpunit/includes/api/generateRandomImages.php delete mode 100644 tests/phpunit/includes/api/query/ApiQueryBasicTest.php delete mode 100644 tests/phpunit/includes/api/query/ApiQueryContinue2Test.php delete mode 100644 tests/phpunit/includes/api/query/ApiQueryContinueTest.php delete mode 100644 tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php delete mode 100644 tests/phpunit/includes/api/query/ApiQueryRevisionsTest.php delete mode 100644 tests/phpunit/includes/api/query/ApiQueryTest.php delete mode 100644 tests/phpunit/includes/api/query/ApiQueryTestBase.php delete mode 100644 tests/phpunit/includes/api/words.txt delete mode 100644 tests/phpunit/includes/cache/GenderCacheTest.php delete mode 100644 tests/phpunit/includes/cache/MessageCacheTest.php delete mode 100644 tests/phpunit/includes/cache/ProcessCacheLRUTest.php delete mode 100644 tests/phpunit/includes/content/ContentHandlerTest.php delete mode 100644 tests/phpunit/includes/content/CssContentTest.php delete mode 100644 tests/phpunit/includes/content/JavaScriptContentTest.php delete mode 100644 tests/phpunit/includes/content/TextContentTest.php delete mode 100644 tests/phpunit/includes/content/WikitextContentHandlerTest.php delete mode 100644 tests/phpunit/includes/content/WikitextContentTest.php delete mode 100644 tests/phpunit/includes/db/DatabaseMysqlBaseTest.php delete mode 100644 tests/phpunit/includes/db/DatabaseSQLTest.php delete mode 100644 tests/phpunit/includes/db/DatabaseSqliteTest.php delete mode 100644 tests/phpunit/includes/db/DatabaseTest.php delete mode 100644 tests/phpunit/includes/db/DatabaseTestHelper.php delete mode 100644 tests/phpunit/includes/db/ORMRowTest.php delete mode 100644 tests/phpunit/includes/db/ORMTableTest.php delete mode 100644 tests/phpunit/includes/db/TestORMRowTest.php delete mode 100644 tests/phpunit/includes/debug/MWDebugTest.php delete mode 100644 tests/phpunit/includes/filebackend/FileBackendTest.php delete mode 100644 tests/phpunit/includes/filerepo/FileRepoTest.php delete mode 100644 tests/phpunit/includes/filerepo/StoreBatchTest.php delete mode 100644 tests/phpunit/includes/installer/InstallDocFormatterTest.php delete mode 100644 tests/phpunit/includes/installer/OracleInstallerTest.php delete mode 100644 tests/phpunit/includes/jobqueue/JobQueueTest.php delete mode 100644 tests/phpunit/includes/json/FormatJsonTest.php delete mode 100644 tests/phpunit/includes/libs/CSSJanusTest.php delete mode 100644 tests/phpunit/includes/libs/CSSMinTest.php delete mode 100644 tests/phpunit/includes/libs/GenericArrayObjectTest.php delete mode 100644 tests/phpunit/includes/libs/IEUrlExtensionTest.php delete mode 100644 tests/phpunit/includes/libs/JavaScriptMinifierTest.php delete mode 100644 tests/phpunit/includes/logging/LogFormatterTest.php delete mode 100644 tests/phpunit/includes/logging/LogTests.i18n.php delete mode 100644 tests/phpunit/includes/media/BitmapMetadataHandlerTest.php delete mode 100644 tests/phpunit/includes/media/BitmapScalingTest.php delete mode 100644 tests/phpunit/includes/media/ExifBitmapTest.php delete mode 100644 tests/phpunit/includes/media/ExifRotationTest.php delete mode 100644 tests/phpunit/includes/media/ExifTest.php delete mode 100644 tests/phpunit/includes/media/FakeDimensionFile.php delete mode 100644 tests/phpunit/includes/media/FormatMetadataTest.php delete mode 100644 tests/phpunit/includes/media/GIFMetadataExtractorTest.php delete mode 100644 tests/phpunit/includes/media/GIFTest.php delete mode 100644 tests/phpunit/includes/media/IPTCTest.php delete mode 100644 tests/phpunit/includes/media/JpegMetadataExtractorTest.php delete mode 100644 tests/phpunit/includes/media/JpegTest.php delete mode 100644 tests/phpunit/includes/media/MediaHandlerTest.php delete mode 100644 tests/phpunit/includes/media/PNGMetadataExtractorTest.php delete mode 100644 tests/phpunit/includes/media/PNGTest.php delete mode 100644 tests/phpunit/includes/media/SVGMetadataExtractorTest.php delete mode 100644 tests/phpunit/includes/media/TiffTest.php delete mode 100644 tests/phpunit/includes/media/XMPTest.php delete mode 100644 tests/phpunit/includes/media/XMPValidateTest.php delete mode 100644 tests/phpunit/includes/normal/CleanUpTest.php delete mode 100644 tests/phpunit/includes/objectcache/BagOStuffTest.php delete mode 100644 tests/phpunit/includes/parser/MagicVariableTest.php delete mode 100644 tests/phpunit/includes/parser/MediaWikiParserTest.php delete mode 100644 tests/phpunit/includes/parser/NewParserTest.php delete mode 100644 tests/phpunit/includes/parser/ParserMethodsTest.php delete mode 100644 tests/phpunit/includes/parser/ParserOutputTest.php delete mode 100644 tests/phpunit/includes/parser/ParserPreloadTest.php delete mode 100644 tests/phpunit/includes/parser/PreprocessorTest.php delete mode 100644 tests/phpunit/includes/parser/TagHooksTest.php delete mode 100644 tests/phpunit/includes/parser/TidyTest.php delete mode 100644 tests/phpunit/includes/search/SearchEngineTest.php delete mode 100644 tests/phpunit/includes/search/SearchUpdateTest.php delete mode 100644 tests/phpunit/includes/site/MediaWikiSiteTest.php delete mode 100644 tests/phpunit/includes/site/SiteListTest.php delete mode 100644 tests/phpunit/includes/site/SiteSQLStoreTest.php delete mode 100644 tests/phpunit/includes/site/SiteTest.php delete mode 100644 tests/phpunit/includes/site/TestSites.php delete mode 100644 tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php delete mode 100644 tests/phpunit/includes/specials/SpecialPreferencesTest.php delete mode 100644 tests/phpunit/includes/specials/SpecialRecentchangesTest.php delete mode 100644 tests/phpunit/includes/specials/SpecialSearchTest.php delete mode 100644 tests/phpunit/includes/upload/UploadBaseTest.php delete mode 100644 tests/phpunit/includes/upload/UploadFromUrlTest.php delete mode 100644 tests/phpunit/includes/upload/UploadStashTest.php delete mode 100644 tests/phpunit/install-phpunit.sh delete mode 100644 tests/phpunit/languages/LanguageAmTest.php delete mode 100644 tests/phpunit/languages/LanguageArTest.php delete mode 100644 tests/phpunit/languages/LanguageBeTest.php delete mode 100644 tests/phpunit/languages/LanguageBe_taraskTest.php delete mode 100644 tests/phpunit/languages/LanguageBhoTest.php delete mode 100644 tests/phpunit/languages/LanguageBsTest.php delete mode 100644 tests/phpunit/languages/LanguageClassesTestCase.php delete mode 100644 tests/phpunit/languages/LanguageCsTest.php delete mode 100644 tests/phpunit/languages/LanguageCuTest.php delete mode 100644 tests/phpunit/languages/LanguageCyTest.php delete mode 100644 tests/phpunit/languages/LanguageDsbTest.php delete mode 100644 tests/phpunit/languages/LanguageFrTest.php delete mode 100644 tests/phpunit/languages/LanguageGaTest.php delete mode 100644 tests/phpunit/languages/LanguageGdTest.php delete mode 100644 tests/phpunit/languages/LanguageGvTest.php delete mode 100644 tests/phpunit/languages/LanguageHeTest.php delete mode 100644 tests/phpunit/languages/LanguageHiTest.php delete mode 100644 tests/phpunit/languages/LanguageHrTest.php delete mode 100644 tests/phpunit/languages/LanguageHsbTest.php delete mode 100644 tests/phpunit/languages/LanguageHuTest.php delete mode 100644 tests/phpunit/languages/LanguageHyTest.php delete mode 100644 tests/phpunit/languages/LanguageKshTest.php delete mode 100644 tests/phpunit/languages/LanguageLnTest.php delete mode 100644 tests/phpunit/languages/LanguageLtTest.php delete mode 100644 tests/phpunit/languages/LanguageLvTest.php delete mode 100644 tests/phpunit/languages/LanguageMgTest.php delete mode 100644 tests/phpunit/languages/LanguageMkTest.php delete mode 100644 tests/phpunit/languages/LanguageMlTest.php delete mode 100644 tests/phpunit/languages/LanguageMoTest.php delete mode 100644 tests/phpunit/languages/LanguageMtTest.php delete mode 100644 tests/phpunit/languages/LanguageNlTest.php delete mode 100644 tests/phpunit/languages/LanguageNsoTest.php delete mode 100644 tests/phpunit/languages/LanguagePlTest.php delete mode 100644 tests/phpunit/languages/LanguageRoTest.php delete mode 100644 tests/phpunit/languages/LanguageRuTest.php delete mode 100644 tests/phpunit/languages/LanguageSeTest.php delete mode 100644 tests/phpunit/languages/LanguageSgsTest.php delete mode 100644 tests/phpunit/languages/LanguageShTest.php delete mode 100644 tests/phpunit/languages/LanguageSkTest.php delete mode 100644 tests/phpunit/languages/LanguageSlTest.php delete mode 100644 tests/phpunit/languages/LanguageSmaTest.php delete mode 100644 tests/phpunit/languages/LanguageSrTest.php delete mode 100644 tests/phpunit/languages/LanguageTest.php delete mode 100644 tests/phpunit/languages/LanguageTiTest.php delete mode 100644 tests/phpunit/languages/LanguageTlTest.php delete mode 100644 tests/phpunit/languages/LanguageTrTest.php delete mode 100644 tests/phpunit/languages/LanguageUkTest.php delete mode 100644 tests/phpunit/languages/LanguageUzTest.php delete mode 100644 tests/phpunit/languages/LanguageWaTest.php delete mode 100644 tests/phpunit/languages/utils/CLDRPluralRuleEvaluatorTest.php delete mode 100644 tests/phpunit/maintenance/DumpTestCase.php delete mode 100644 tests/phpunit/maintenance/MaintenanceTest.php delete mode 100644 tests/phpunit/maintenance/backupPrefetchTest.php delete mode 100644 tests/phpunit/maintenance/backupTextPassTest.php delete mode 100644 tests/phpunit/maintenance/backup_LogTest.php delete mode 100644 tests/phpunit/maintenance/backup_PageTest.php delete mode 100644 tests/phpunit/maintenance/fetchTextTest.php delete mode 100644 tests/phpunit/maintenance/getSlaveServerTest.php delete mode 100644 tests/phpunit/mocks/filebackend/MockFSFile.php delete mode 100644 tests/phpunit/mocks/filebackend/MockFileBackend.php delete mode 100644 tests/phpunit/mocks/media/MockBitmapHandler.php delete mode 100644 tests/phpunit/phpunit.php delete mode 100644 tests/phpunit/run-tests.bat delete mode 100644 tests/phpunit/skins/SideBarTest.php delete mode 100644 tests/phpunit/structure/AutoLoaderTest.php delete mode 100644 tests/phpunit/structure/ResourcesTest.php delete mode 100644 tests/phpunit/structure/StructureTest.php delete mode 100644 tests/phpunit/suite.xml delete mode 100644 tests/phpunit/suites/ExtensionsParserTestSuite.php delete mode 100644 tests/phpunit/suites/ExtensionsTestSuite.php delete mode 100644 tests/phpunit/suites/UploadFromUrlTestSuite.php delete mode 100644 tests/qunit/.htaccess delete mode 100644 tests/qunit/QUnitTestResources.php delete mode 100644 tests/qunit/data/callMwLoaderTestCallback.js delete mode 100644 tests/qunit/data/generateJqueryMsgData.php delete mode 100644 tests/qunit/data/load.mock.php delete mode 100644 tests/qunit/data/mediawiki.jqueryMsg.data.js delete mode 100644 tests/qunit/data/qunitOkCall.js delete mode 100644 tests/qunit/data/styleTest.css.php delete mode 100644 tests/qunit/data/testrunner.js delete mode 100644 tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js delete mode 100644 tests/qunit/suites/resources/jquery/jquery.byteLength.test.js delete mode 100644 tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js delete mode 100644 tests/qunit/suites/resources/jquery/jquery.client.test.js delete mode 100644 tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js delete mode 100644 tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js delete mode 100644 tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js delete mode 100644 tests/qunit/suites/resources/jquery/jquery.hidpi.test.js delete mode 100644 tests/qunit/suites/resources/jquery/jquery.highlightText.test.js delete mode 100644 tests/qunit/suites/resources/jquery/jquery.localize.test.js delete mode 100644 tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js delete mode 100644 tests/qunit/suites/resources/jquery/jquery.mwExtension.test.js delete mode 100644 tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js delete mode 100644 tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js delete mode 100644 tests/qunit/suites/resources/jquery/jquery.textSelection.test.js delete mode 100644 tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js delete mode 100644 tests/qunit/suites/resources/mediawiki.api/mediawiki.api.test.js delete mode 100644 tests/qunit/suites/resources/mediawiki.special/mediawiki.special.recentchanges.test.js delete mode 100644 tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js delete mode 100644 tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js delete mode 100644 tests/qunit/suites/resources/mediawiki/mediawiki.cldr.test.js delete mode 100644 tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js delete mode 100644 tests/qunit/suites/resources/mediawiki/mediawiki.jscompat.test.js delete mode 100644 tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js delete mode 100644 tests/qunit/suites/resources/mediawiki/mediawiki.test.js delete mode 100644 tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js delete mode 100644 tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js delete mode 100644 tests/qunit/suites/resources/startup.test.js delete mode 100644 tests/testHelpers.inc diff --git a/.gitreview b/.gitreview deleted file mode 100644 index bb83fd3b..00000000 --- a/.gitreview +++ /dev/null @@ -1,6 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/core.git -defaultbranch=REL1_22 -defaultrebase=0 diff --git a/.jshintignore b/.jshintignore deleted file mode 100644 index f740f137..00000000 --- a/.jshintignore +++ /dev/null @@ -1,29 +0,0 @@ -# Generated documentation -docs/html/ -docs/js/ - -# third-party libs -extensions/ -node_modules/ -resources/jquery/jquery.appear.js -resources/jquery/jquery.async.js -resources/jquery/jquery.cycle.all.js -resources/jquery/jquery.cookie.js -resources/jquery/jquery.farbtastic.js -resources/jquery/jquery.form.js -resources/jquery/jquery.hoverIntent.js -resources/jquery/jquery.js -resources/jquery/jquery.json.js -resources/jquery/jquery.jStorage.js -resources/jquery/jquery.mockjax.js -resources/jquery/jquery.qunit.js -resources/jquery/jquery.validate.js -resources/jquery/jquery.xmldom.js -resources/jquery.effects/ -resources/jquery.tipsy/ -resources/jquery.ui/ -resources/mediawiki.libs/ -resources/jquery.chosen/chosen.jquery.js - -# github.com/jshint/jshint/issues/729 -tests/qunit/suites/resources/mediawiki/mediawiki.jscompat.test.js diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index c4e265a4..00000000 --- a/.jshintrc +++ /dev/null @@ -1,42 +0,0 @@ -{ - /* Common */ - - // Enforcing - "camelcase": true, - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": true, - "newcap": true, - "noarg": true, - "noempty": true, - "nonew": true, - "quotmark": "single", - "trailing": true, - "undef": true, - "unused": true, - // Legacy - "onevar": true, - - /* Local */ - - // Enforcing - "bitwise": true, - "forin": false, - "regexp": false, - "strict": false, - // Relaxing - "laxbreak": true, - "smarttabs": true, - "multistr": true, - // Environment - "browser": true, - // Legacy - "nomen": true, - - "predef": [ - "mediaWiki", - "jQuery", - "QUnit" - ] -} diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index 9862e5eb..284ef1f8 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -3,6 +3,14 @@ Security reminder: MediaWiki does not require PHP's register_globals. If you have it on, turn it '''off''' if you can. +== MediaWiki 1.22.4 == + +This is a maintenance release of the MediaWiki 1.22 branch. + +=== Changes since 1.22.3 === + +* Use the correct branch of the extensions' git repositories. + == MediaWiki 1.22.3 == This is a security and bugfix release of the MediaWiki 1.22 branch. diff --git a/extensions/Cite/.gitreview b/extensions/Cite/.gitreview deleted file mode 100644 index 6ae9db41..00000000 --- a/extensions/Cite/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/Cite.git -defaultbranch=master diff --git a/extensions/Cite/.jshintignore b/extensions/Cite/.jshintignore deleted file mode 100644 index df46ab97..00000000 --- a/extensions/Cite/.jshintignore +++ /dev/null @@ -1 +0,0 @@ -modules/jquery.tooltip/jquery.tooltip.js diff --git a/extensions/Cite/.jshintrc b/extensions/Cite/.jshintrc deleted file mode 100644 index 4b356f81..00000000 --- a/extensions/Cite/.jshintrc +++ /dev/null @@ -1,34 +0,0 @@ -{ - "camelcase": true, - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": true, - "newcap": true, - "supernew": true, - "shadow": true, - "noarg": true, - "noempty": true, - "nonew": true, - "quotmark": false, // sometimes double quotes make sense, e.g. "foo's" is better readable than 'foo\'s' - "trailing": true, - "undef": true, - "unused": "vars", // we want to allow unused function parameters - "laxbreak": true, - "laxcomma": false, - "onevar": false, - "bitwise": false, - "forin": false, - "regexp": false, - "strict": true, - "scripturl": true, - - // Environment - "browser": true, - - // Globals - "predef": [ - "jQuery", - "mediaWiki" - ] -} diff --git a/extensions/Cite/COPYING b/extensions/Cite/COPYING deleted file mode 100644 index d159169d..00000000 --- a/extensions/Cite/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/extensions/Cite/Cite.i18n.php b/extensions/Cite/Cite.i18n.php index 895a4d80..2f204203 100644 --- a/extensions/Cite/Cite.i18n.php +++ b/extensions/Cite/Cite.i18n.php @@ -249,7 +249,6 @@ Defina-ne mas en o mensache [[MediaWiki:$2]].', /** Arabic (العربية) * @author Aiman titi - * @author Asaifm * @author Meno25 * @author OsamaK * @author زكريا @@ -280,7 +279,7 @@ $messages['ar'] = array( لا نص تم توفيره للمراجع المسماة $1', 'cite_error_included_ref' => 'إغلاق </ref> مفقود لوسم <ref>', 'cite_error_refs_without_references' => 'وسم <ref> موجود، لكن لا وسم <references/> تم العثور عليه', - 'cite_error_group_refs_without_references' => 'وسوم <ref> موجودة لمجموعة اسمها "$1"، ولكن لم يتم العثور على وسم <references group="$1"/> أو هناك وسم </ref> ناقص', + 'cite_error_group_refs_without_references' => 'وسوم <ref> موجودة لمجموعة اسمها "$1"، لكن لا وسم <references group="$1"/> مماثل تم العثور عليه', # Fuzzy 'cite_error_references_group_mismatch' => 'الوسم <ref> في <references> فيه خاصية group متضاربة "$1".', 'cite_error_references_missing_group' => 'الوسم <ref> المُعرّف في <references> فيه خاصية group "$1" التي لا تظهر في النص السابق.', 'cite_error_references_missing_key' => 'الوسم <ref> ذو الاسم "$1" المُعرّف في <references> غير مستخدم في النص السابق.', @@ -288,8 +287,6 @@ $messages['ar'] = array( 'cite_error_empty_references_define' => 'الوسم <ref> المُعرّف في <references> بالاسم "$1" ليس له محتوى.', 'cite_references_link_many' => '
    4. ^ $2 $3
    5. ', 'cite_references_link_many_format_backlink_labels' => 'أ ب ت ث ج ح خ د ذ ر ز س ش ص ض ط ظ ع غ ف ق ك ل م ن ه و ي أأ أب أت أث أج أح أخ أد أذ أر أز أس أش أص أض أط أظ أع أغ أف أق أك أل أم أن أه أو أي بأ بب بت بث بج بح بخ بد بذ بر بز بس بش بص بض بط بظ بع بغ بف بق بك بل بم بن به بو بي تأ تب تت تث تج تح تخ تد تذ تر تز تس تش تص تض تط تظ تع تغ تف تق تك تل تم تن ته تو تي ثأ ثب ثت ثث ثج ثح ثخ ثد ثذ ثر ثز ثس ثش ثص ثض ثط ثظ ثع ثغ ثف ثق ثك ثل ثم ثن ثه ثو ثي جأ جب جت جث جج جح جخ جد جذ جر جز جس جش جص جض جط جظ جع جغ جف جق جك جل جم جن جه جو جي حأ حب حت حث حج حح حخ حد حذ حر حز حس حش حص حض حط حظ حع حغ حف حق حك حل حم حن حه حو حي خأ خب خت خث خج خح خخ خد خذ خر خز خس خش خص خض خط خظ خع خغ خف خق خك خل خم خن خه خو خي دأ دب دت دث دج دح دخ دد دذ در دز دس دش دص دض دط دظ دع دغ دف دق دك دل دم دن ده دو دي ذأ ذب ذت ذث ذج ذح ذخ ذد ذذ ذر ذز ذس ذش ذص ذض ذط ذظ ذع ذغ ذف ذق ذك ذل ذم ذن ذه ذو ذي رأ رب رت رث رج رح رخ رد رذ رر رز رس رش رص رض رط رظ رع رغ رف رق رك رل رم رن ره رو ري زأ زب زت زث زج زح زخ زد زذ زر زز زس زش زص زض زط زظ زع زغ زف زق زك زل زم زن زه زو زي سأ سب ست سث سج سح سخ سد سذ سر سز سس سش سص سض سط سظ سع سغ سف سق سك سل سم سن سه سو سي شأ شب شت شث شج شح شخ شد شذ شر شز شس شش شص شض شط شظ شع شغ شف شق شك شل شم شن شه شو شي صأ صب صت صث صج صح صخ صد صذ صر صز صس صش صص صض صط صظ صع صغ صف صق صك صل صم صن صه صو صي ضأ ضب ضت ضث ضج ضح ضخ ضد ضذ ضر ضز ضس ضش ضص ضض ضط ضظ ضع ضغ ضف ضق ضك ضل ضم ضن ضه ضو ضي طأ طب طت طث طج طح طخ طد طذ طر طز طس طش طص طض طط طظ طع طغ طف طق طك طل طم طن طه طو طي ظأ ظب ظت ظث ظج ظح ظخ ظد ظذ ظر ظز ظس ظش ظص ظض ظط ظظ ظع ظغ ظف ظق ظك ظل ظم ظن ظه ظو ظي عأ عب عت عث عج عح عخ عد عذ عر عز عس عش عص عض عط عظ عع عغ عف عق عك عل عم عن عه عو عي غأ غب غت غث غج غح غخ غد غذ غر غز غس غش غص غض غط غظ غع غغ غف غق غك غل غم غن غه غو غي فأ فب فت فث فج فح فخ فد فذ فر فز فس فش فص فض فط فظ فع فغ فف فق فك فل فم فن فه فو في قأ قب قت قث قج قح قخ قد قذ قر قز قس قش قص قض قط قظ قع قغ قف قق قك قل قم قن قه قو قي كأ كب كت كث كج كح كخ كد كذ كر كز كس كش كص كض كط كظ كع كغ كف كق كك كل كم كن كه كو كي لأ لب لت لث لج لح لخ لد لذ لر لز لس لش لص لض لط لظ لع لغ لف لق لك لل لم لن له لو لي مأ مب مت مث مج مح مخ مد مذ مر مز مس مش مص مض مط مظ مع مغ مف مق مك مل مم من مه مو مي نأ نب نت نث نج نح نخ ند نذ نر نز نس نش نص نض نط نظ نع نغ نف نق نك نل نم نن نه نو ني هأ هب هت هث هج هح هخ هد هذ هر هز هس هش هص هض هط هظ هع هغ هف هق هك هل هم هن هه هو هي وأ وب وت وث وج وح وخ ود وذ ور وز وس وش وص وض وط وظ وع وغ وف وق وك ول وم ون وه وو وي يأ يب يت يث يج يح يخ يد يذ ير يز يس يش يص يض يط يظ يع يغ يف يق يك يل يم ين يه يو يي', - 'cite_references_link_accessibility_label' => 'تعدى المحتوى الحالي إلى أعلى الصفحة', - 'cite_references_link_many_accessibility_label' => 'تعدى إلى الأعلى ل:', ); /** Aramaic (ܐܪܡܝܐ) @@ -717,7 +714,7 @@ Defineix més al missatge [[MediaWiki:$2]].', 'cite_error_references_no_text' => "Etiqueta <ref> no vàlida; no s'ha proporcionat text per les refs amb l'etiqueta $1", 'cite_error_included_ref' => 'Es tanca el </ref> que manca per una etiqueta <ref>', - 'cite_error_refs_without_references' => "Hi ha etiquetes <ref> però no s'ha trobat cap etiqueta <references/>", + 'cite_error_refs_without_references' => 'Hi ha etiquetes <ref> però no cap etiqueta <references/>', 'cite_error_group_refs_without_references' => 'Existeixen etiquetes <ref> pel grup «$1» però no l\'etiqueta <references group="$1"/> corresponent', # Fuzzy 'cite_error_references_group_mismatch' => 'L\'etiqueta <ref> a <references> té un conflicte amb l\'atribut de grup "$1".', 'cite_error_references_missing_group' => 'L\'etiqueta <ref> definida a <references> té l\'atribut de grup "$1" que no apareix en el text anterior.', @@ -730,7 +727,6 @@ no s'ha proporcionat text per les refs amb l'etiqueta $1", * @author Умар */ $messages['ce'] = array( - 'cite-desc' => ' а тегаш тӀетовжорашан тӀетуху', 'cite_error' => 'ГӀалат дешнаш далорна $1', 'cite_error_references_no_text' => 'Тег <ref> нийса яц; тIетовжаран $1 йоза яздина дац', 'cite_error_refs_without_references' => 'Йолуш йолу тегаца <ref> йогӀуш йолу тег <references/> ца карийна', @@ -739,7 +735,7 @@ $messages['ce'] = array( 'cite_references_link_many_accessibility_label' => 'Дехьа гӀо:', ); -/** Czech (čeština) +/** Czech (česky) * @author Danny B. * @author Li-sung * @author Littledogboy @@ -774,7 +770,7 @@ Zvyšte jejich počet ve zprávě [[MediaWiki:$2]].', 'cite_references_link_many_accessibility_label' => 'Skočit nahoru k:', ); -/** Church Slavic (словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) +/** Church Slavic (словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) * @author ОйЛ */ $messages['cu'] = array( @@ -857,13 +853,12 @@ Definer flere i beskeden [[MediaWiki:$2]].', /** German (Deutsch) * @author Kghbln * @author Metalhead64 - * @author Purodha * @author Raimond Spekking * @author The Evil IP address * @author Umherirrender */ $messages['de'] = array( - 'cite-desc' => 'Ergänzt die Tags und für Referenzierungen in Wikiseiten', + 'cite-desc' => 'Ergänzt die Tags und für die Referenzierung von Wikiseiten', 'cite_error' => 'Referenzfehler: $1', 'cite_error_ref_numeric_key' => 'Ungültige Verwendung von <ref>: Der Parameter „name“ darf kein reiner Zahlenwert sein. Benutze einen beschreibenden Namen.', 'cite_error_ref_no_key' => 'Ungültige Verwendung von <ref>: Der Parameter „ref“ ohne Inhalt muss einen Namen haben.', @@ -985,14 +980,12 @@ Definěruj dalšne w powěsći [[MediaWiki:$2]].', za ref z mjenim $1 njejo se tekst pódał', 'cite_error_included_ref' => 'Kóńceca toflicka </ref> felujo za toflicku <ref>', 'cite_error_refs_without_references' => 'Toflicki <ref> eksistěruju, ale toflicka <references/> njejo se namakała', - 'cite_error_group_refs_without_references' => 'Toflicki <ref> eksistěruju za kupku z mjenim "$1", ale wótpowědujuca toflicka <references group="$1"/> njejo se namakała abo zacynjacy </ref> felujo', + 'cite_error_group_refs_without_references' => 'Toflicki <ref> eksistěruju za kupku z mjenim "$1", ale wótpowědujuca toflicka <references group="$1"/> njejo se namakała', # Fuzzy 'cite_error_references_group_mismatch' => 'Toflicka <ref> w <references> jo ze kupkowym atributom "$1" w konflikśe.', 'cite_error_references_missing_group' => 'Toflicka <ref>, kótaraž jo w <references> definěrowana, ma kupkowy atribut "$1", kótaryž njepokazujo se w pjerwjejšnem teksće.', 'cite_error_references_missing_key' => 'Toflicka <ref> z mjenim "$1", kótaraž jo w <references> definěrowana, njewužywa se w pjerwjejšnem teksće.', 'cite_error_references_no_key' => 'Toflicka <ref>, kótaraž jo w <references> definěrowana, njama mjenjowy atribut.', 'cite_error_empty_references_define' => 'Toflicka <ref>, kótaraž jo w <references> z mjenim "$1" definěrowana, njama wopśimjeśe.', - 'cite_references_link_accessibility_label' => 'Górjej skócyś', - 'cite_references_link_many_accessibility_label' => 'Górjej skócys do:', ); /** Greek (Ελληνικά) @@ -1077,9 +1070,7 @@ neniu teksto estis donita por ref-oj nomataj $1', * @author Crazymadlover * @author Drini * @author Erdemaslancan - * @author Fitoschido * @author Gustronico - * @author Ihojose * @author Locos epraix * @author Manuelt15 * @author McDutchie @@ -1113,15 +1104,13 @@ Define más en el mensaje [[MediaWiki:$2]].', no se ha definido el contenido de las referencias llamadas $1', 'cite_error_included_ref' => 'Etiqueta de apertura <ref> sin su correspondiente cierre </ref>', 'cite_error_refs_without_references' => 'Existen etiquetas <ref>, pero no se encontró una etiqueta <references />', - 'cite_error_group_refs_without_references' => 'Existen etiquetas <ref> para un grupo llamado «$1», pero no se encontró la etiqueta <references group="$1"/> correspondiente, o falta la etiqueta </ref> de cierre', + 'cite_error_group_refs_without_references' => 'Existen etiquetas <ref> para un grupo llamado "$1", pero no se encontró una etiqueta <references group="$1"/>', # Fuzzy 'cite_error_references_group_mismatch' => 'La etiqueta <ref> en <references> presenta el atributo de grupo "$1" en conflicto.', 'cite_error_references_missing_group' => 'La etiqueta <ref> definida en <references> pertenece al grupo "$1" no declarado en el texto precedente.', 'cite_error_references_missing_key' => 'La etiqueta <ref> con nombre "$1" definida en <references> no se utiliza en el texto precedente.', 'cite_error_references_no_key' => 'La etiqueta <ref> definida en <references> no tiene atributo de nombre.', 'cite_error_empty_references_define' => 'La etiqueta <ref> definida en <references> con nombre "$1" no tiene contenido.', 'cite_references_link_many_format_backlink_labels' => 'a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej ek el em en eo ep eq er es et eu ev ew ex ey ez fa fb fc fd fe ff fg fh fi fj fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gf gg gh gi gj gk gl gm gn go gp gq gr gs gt gu gv gw gx gy gz ha hb hc hd he hf hg hh hi hj hk hl hm hn ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il im in io ip iq ir is it iu iv iw ix iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn ko kp kq kr ks kt ku kv kw kx ky kz la lb lc ld le lf lg lh li lj lk ll lm ln lo lp lq lr ls lt lu lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo op oq or os ot ou ov ow ox oy oz pa pb pc pd pe pf pg ph pi pj pk pl pm pn po pp pq pr ps pt pu pv pw px py pz qa qb qc qd qe qf qg qh qi qj qk ql qm qn qo qp qq qr qs qt qu qv qw qx qy qz ra rb rc rd re rf rg rh ri rj rk rl rm rn ro rp rq rr rs rt ru rv rw rx ry rz sa sb sc sd se sf sg sh si sj sk sl sm sn so sp sq sr ss st su sv sw sx sy sz ta tb tc td te tf tg th ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty tz ua ub uc ud ue uf ug uh ui uj uk ul um un uo up uq ur us ut uu uv uw ux uy uz va vb vc vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz wa wb wc wd we wf wg wh wi wj wk wl wm wn wo wp wq wr ws wt wu wv ww wx wy wz xa xb xc xd xe xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk yl ym yn yo yp yq yr ys yt yu yv yw yx yy yz za zb zc zd ze zf zg zh zi zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz', - 'cite_references_link_accessibility_label' => 'Ir a', - 'cite_references_link_many_accessibility_label' => 'Saltar a:', ); /** Estonian (eesti) @@ -1191,7 +1180,7 @@ $messages['fa'] = array( 'cite_error_references_no_text' => 'برچسب نامجاز؛ متنی برای یادکردهای با نام $1 وارد نشده‌است', 'cite_error_included_ref' => 'برچسب تمام کنندهٔ </ref> بدون برچسب <ref>', 'cite_error_refs_without_references' => 'برچسب <ref> وجود دارد اما برچسب <references/> پیدا نشد', - 'cite_error_group_refs_without_references' => 'برچسب <ref> برای گروهی به نام «$1» وجود دارد، اما برچسب متناظر با <references group="$1"/> یافت نشد یا </ref> بسته جا گذاشته شده‌است.', + 'cite_error_group_refs_without_references' => 'برچسب <ref> برای گروهی به نام «$1» وجود دارد، اما برچسب <references group="$1"/> متناظر پیدا نشد', # Fuzzy 'cite_error_references_group_mismatch' => 'برچسپ <ref> درون <references> در تضاد با ویژگی‌های گروه «$1» است.', 'cite_error_references_missing_group' => 'برچسپ <ref> در <references> تعریف شده، ویژگی‌های گروهی «$1» را دارد که درون متن قبل از آن ظاهر نمی‌شود.', 'cite_error_references_missing_key' => 'پرچسپ <ref> که با نام «$1» درون <references> تعریف شده، در متن قبل از آن استفاده نشده‌است.', @@ -1199,8 +1188,6 @@ $messages['fa'] = array( 'cite_error_empty_references_define' => 'برچسپ <ref> تعریف شده درون <references> با نام «$1» محتوایی ندارد.', 'cite_reference_link_key_with_num' => '$1_$2', 'cite_reference_link_prefix' => 'cite_ref-', - 'cite_references_link_accessibility_label' => 'پرش به بالا', - 'cite_references_link_many_accessibility_label' => 'پرش به بالا به:', ); /** Finnish (suomi) @@ -1291,7 +1278,6 @@ aucun texte n’a été fourni pour les références nommées $1.', 'cite_error_references_missing_key' => 'La balise <ref> avec le nom « $1 » définie dans <references> n’est pas utilisé dans le texte précédent.', 'cite_error_references_no_key' => 'La balise <ref> définie dans <references> n’a pas d’attribut de nom.', 'cite_error_empty_references_define' => 'La balise <ref> défini dans <references> avec le nom « $1 » n’a pas de contenu.', - 'cite_references_link_many_format' => '[[#$1|$2]]', 'cite_references_link_many_sep' => ', ', 'cite_references_link_many_and' => ' et ', 'cite_references_link_accessibility_label' => 'Aller', @@ -1504,11 +1490,10 @@ $messages['he'] = array( /** Hindi (हिन्दी) * @author Ansumang * @author Kaustubh - * @author Shubhamkanodia * @author Siddhartha Ghai */ $messages['hi'] = array( - 'cite-desc' => 'उद्धरणों के लिये और टैग जोड़ता है।', + 'cite-desc' => ' और टैग जोड़ता है, उद्धरणों के लिये।', 'cite_error' => 'सन्दर्भ त्रुटि: $1', 'cite_error_ref_numeric_key' => 'अमान्य <ref> टैग; नाम साधारण संख्या (integer) नहीं हो सकता, कृपया विस्तृत शीर्षक दें।', @@ -1538,9 +1523,8 @@ $messages['hi'] = array( 'cite_error_references_missing_key' => '<references> में "$1" नाम के साथ परिभाषित <ref> टैग उससे पहले के पाठ में प्रयुक्त नहीं है।', 'cite_error_references_no_key' => '<references> टैग में परिभाषित <ref> टैग का कोई नाम नहीं है।', 'cite_error_empty_references_define' => '<references> टैग में परिभाषित "$1" नामक <ref> टैग में कोई सामग्री नहीं है।', - 'cite_references_link_many_format_backlink_labels' => 'अ आ इ ई उ ऊ ए ऐ ओ औ क ख ग घ ङ च छ ज झ ञ ट ठ ड ढ ण त थ द ध न प फ ब भ म य र ल व श ष स ह अ॰अ अ॰आ अ॰इ अ॰ई अ॰उ अ॰ऊ अ॰ए अ॰ऐ अ॰ओ अ॰औ अ॰क अ॰ख अ॰ग अ॰घ अ॰ङ अ॰च अ॰छ अ॰ज अ॰झ अ॰ञ अ॰ट अ॰ठ अ॰ड अ॰ढ अ॰ण अ॰त अ॰थ अ॰द अ॰ध अ॰न अ॰प अ॰फ अ॰ब अ॰भ अ॰म अ॰य अ॰र अ॰ल अ॰व अ॰श अ॰ष अ॰स अ॰ह आ॰अ आ॰आ आ॰इ आ॰ई आ॰उ आ॰ऊ आ॰ए आ॰ऐ आ॰ओ आ॰औ आ॰क आ॰ख आ॰ग आ॰घ आ॰ङ आ॰च आ॰छ आ॰ज आ॰झ आ॰ञ आ॰ट आ॰ठ आ॰ड आ॰ढ आ॰ण आ॰त आ॰थ आ॰द आ॰ध आ॰न आ॰प आ॰फ आ॰ब आ॰भ अ॰म आ॰य आ॰र आ॰ल आ॰व आ॰श आ॰ष आ॰स आ॰ह इ॰अ इ॰आ इ॰इ इ॰ई इ॰उ इ॰ऊ इ॰ए इ॰ऐ इ॰ओ इ॰औ इ॰क इ॰ख इ॰ग इ॰घ इ॰ङ इ॰च इ॰छ इ॰ज इ॰झ इ॰ञ इ॰ट इ॰ठ इ॰ड इ॰ढ इ॰ण इ॰त इ॰थ इ॰द इ॰ध इ॰न इ॰प इ॰फ इ॰ब इ॰भ इ॰म इ॰य इ॰र इ॰ल इ॰व इ॰श इ॰ष इ॰स इ॰ह ई॰अ ई॰आ ई॰इ ई॰ई ई॰उ ई॰ऊ ई॰ए ई॰ऐ ई॰ओ ई॰औ ई॰क ई॰ख ई॰ग ई॰घ ई॰ङ ई॰च ई॰छ ई॰ज ई॰झ ई॰ञ ई॰ट ई॰ठ ई॰ड ई॰ढ ई॰ण ई॰त ई॰थ ई॰द ई॰ध ई॰न ई॰प ई॰फ ई॰ब ई॰भ ई॰म ई॰य ई॰र ई॰ल ई॰व ई॰श ई॰ष ई॰स ई॰ह उ॰अ उ॰आ उ॰इ उ॰ई उ॰उ उ॰ऊ उ॰ए उ॰ऐ उ॰ओ उ॰औ उ॰क उ॰ख उ॰ग उ॰घ उ॰ङ उ॰च उ॰छ उ॰ज उ॰झ उ॰ञ उ॰ट उ॰ठ उ॰ड उ॰ढ उ॰ण उ॰त उ॰थ उ॰द उ॰ध उ॰न उ॰प उ॰फ उ॰ब उ॰भ उ॰म उ॰य उ॰र उ॰ल उ॰व उ॰श उ॰ष उ॰स उ॰ह ऊ॰अ ऊ॰आ ऊ॰इ ऊ॰ई ऊ॰उ ऊ॰ऊ ऊ॰ए ऊ॰ऐ ऊ॰ओ ऊ॰औ ऊ॰क ऊ॰ख ऊ॰ग ऊ॰घ ऊ॰ङ ऊ॰च ऊ॰छ ऊ॰ज ऊ॰झ ऊ॰ञ ऊ॰ट ऊ॰ठ ऊ॰ड ऊ॰ढ ऊ॰ण ऊ॰त ऊ॰थ ऊ॰द ऊ॰ध ऊ॰न ऊ॰प ऊ॰फ ऊ॰ब ऊ॰भ ऊ॰म ऊ॰य ऊ॰र ऊ॰ल ऊ॰व ऊ॰श ऊ॰ष ऊ॰स ऊ॰ह ए॰अ ए॰आ ए॰इ ए॰ई ए॰उ ए॰ऊ ए॰ए ए॰ऐ ए॰ओ ए॰औ ए॰क ए॰ख ए॰ग ए॰घ ए॰ङ ए॰च ए॰छ ए॰ज ए॰झ ए॰ञ ए॰ट ए॰ठ ए॰ड ए॰ढ ए॰ण ए॰त ए॰थ ए॰द ए॰ध ए॰न ए॰प ए॰फ ए॰ब ए॰भ ए॰म ए॰य ए॰र ए॰ल ए॰व ए॰श ए॰ष ए॰स ए॰ह ऐ॰अ ऐ॰आ ऐ॰इ ऐ॰ई ऐ॰उ ऐ॰ऊ ऐ॰ए ऐ॰ऐ ऐ॰ओ ऐ॰औ ऐ॰क ऐ॰ख ऐ॰ग ऐ॰घ ऐ॰ङ ऐ॰च ऐ॰छ ऐ॰ज ऐ॰झ ऐ॰ञ ऐ॰ट ऐ॰ठ ऐ॰ड ऐ॰ढ ऐ॰ण ऐ॰त ऐ॰थ ऐ॰द ऐ॰ध ऐ॰न ऐ॰प ऐ॰फ ऐ॰ब ऐ॰भ ऐ॰म ऐ॰य ऐ॰र ऐ॰ल ऐ॰व ऐ॰श ऐ॰ष ऐ॰स ऐ॰ह ओ॰अ ओ॰आ ओ॰इ ओ॰ई ओ॰उ ओ॰ऊ ओ॰ए ओ॰ऐ ओ॰ओ ओ॰औ ओ॰क ओ॰ख ओ॰ग ओ॰घ ओ॰ङ ओ॰च ओ॰छ ओ॰ज ओ॰झ ओ॰ञ ओ॰ट ओ॰ठ ओ॰ड ओ॰ढ ओ॰ण ओ॰त ओ॰थ ओ॰द ओ॰ध ओ॰न ओ॰प ओ॰फ ओ॰ब ओ॰भ ओ॰म ओ॰य ओ॰र ओ॰ल ओ॰व ओ॰श ओ॰ष ओ॰स ओ॰ह औ॰अ औ॰आ औ॰इ औ॰ई औ॰उ औ॰ऊ औ॰ए औ॰ऐ औ॰ओ औ॰औ औ॰क औ॰ख औ॰ग औ॰घ औ॰ङ औ॰च औ॰छ औ॰ज औ॰झ औ॰ञ औ॰ट औ॰ठ औ॰ड औ॰ढ औ॰ण औ॰त औ॰थ औ॰द औ॰ध औ॰न औ॰प औ॰फ औ॰ब औ॰भ औ॰म औ॰य औ॰र औ॰ल औ॰व औ॰श औ॰ष औ॰स औ॰ह क॰अ क॰आ क॰इ क॰ई क॰उ क॰ऊ क॰ए क॰ऐ क॰ओ क॰औ क॰क क॰ख क॰ग क॰घ क॰ङ क॰च क॰छ क॰ज क॰झ क॰ञ क॰ट क॰ठ क॰ड क॰ढ क॰ण क॰त क॰थ क॰द क॰ध क॰न क॰प क॰फ क॰ब क॰भ क॰म क॰य क॰र क॰ल क॰व क॰श क॰ष क॰स क॰ह ख॰अ ख॰आ ख॰इ ख॰ई ख॰उ ख॰ऊ ख॰ए ख॰ऐ ख॰ओ ख॰औ ख॰क ख॰ख ख॰ग ख॰घ ख॰ङ ख॰च ख॰छ ख॰ज ख॰झ ख॰ञ ख॰ट ख॰ठ ख॰ड ख॰ढ ख॰ण ख॰त ख॰थ ख॰द ख॰ध ख॰न ख॰प ख॰फ ख॰ब ख॰भ ख॰म ख॰य ख॰र ख॰ल ख॰व ख॰श ख॰ष ख॰स ख॰ह ग॰अ ग॰आ ग॰इ ग॰ई ग॰उ ग॰ऊ ग॰ए ग॰ऐ ग॰ओ ग॰औ ग॰क ग॰ख ग॰ग ग॰घ ग॰ङ ग॰च ग॰छ ग॰ज ग॰झ ग॰ञ ग॰ट ग॰ठ ग॰ड ग॰ढ ग॰ण ग॰त ग॰थ ग॰द ग॰ध ग॰न ग॰प ग॰फ ग॰ब ग॰भ ग॰म ग॰य ग॰र ग॰ल ग॰व ग॰श ग॰ष ग॰स ग॰ह घ॰अ घ॰आ घ॰इ घ॰ई घ॰उ घ॰ऊ घ॰ए घ॰ऐ घ॰ओ घ॰औ घ॰क घ॰ख घ॰ग घ॰घ घ॰ङ घ॰च घ॰छ घ॰ज घ॰झ घ॰ञ घ॰ट घ॰ठ घ॰ड घ॰ढ घ॰ण घ॰त घ॰थ घ॰द घ॰ध घ॰न घ॰प घ॰फ घ॰ब घ॰भ घ॰म घ॰य घ॰र घ॰ल घ॰व घ॰श घ॰ष घ॰स घ॰ह ङ॰अ ङ॰आ ङ॰इ ङ॰ई ङ॰उ ङ॰ऊ ङ॰ए ङ॰ऐ ङ॰ओ ङ॰औ ङ॰क ङ॰ख ङ॰ग ङ॰घ ङ॰ङ ङ॰च ङ॰छ ङ॰ज ङ॰झ ङ॰ञ ङ॰ट ङ॰ठ ङ॰ड ङ॰ढ ङ॰ण ङ॰त ङ॰थ ङ॰द ङ॰ध ङ॰न ङ॰प ङ॰फ ङ॰ब ङ॰भ ङ॰म ङ॰य ङ॰र ङ॰ल ङ॰व ङ॰श ङ॰ष ङ॰स ङ॰ह', - 'cite_references_link_accessibility_label' => 'ऊपर जायें', - 'cite_references_link_many_accessibility_label' => 'इस तक ऊपर जायें:', + 'cite_references_link_accessibility_label' => 'वापिस ऊपर जायें', + 'cite_references_link_many_accessibility_label' => 'इस तक वापिस ऊपर जायें:', ); /** Croatian (hrvatski) @@ -1595,14 +1579,12 @@ Definuj dalše w zdźělence [[MediaWiki:$2]].', 'cite_error_references_no_text' => 'Njepłaćiwa referenca formy <ref>; žadyn tekst za referency z mjenom $1 podaty.', 'cite_error_included_ref' => 'Kónčny </ref> za tafličku <ref> faluje', 'cite_error_refs_without_references' => 'Taflički <ref> ekistuja, ale žana taflička code><references/> je so namakała', - 'cite_error_group_refs_without_references' => 'Taflički <ref> eksistuja za skupinu z mjenom "$1", ale njeje so wotpowědowaca taflička <references group="$1"/> namakała abo začinjacy </ref> faluje', + 'cite_error_group_refs_without_references' => 'Taflički <ref> eksistuja za skupinu z mjenom "$1", ale njeje so wotpowědowaca taflička <references group="$1"/> namakała', # Fuzzy 'cite_error_references_group_mismatch' => 'Taflička <ref> w <references> je ze skupinskim atributom "$1" w konflikće.', 'cite_error_references_missing_group' => 'Taflička <ref>, kotraž je w <references> definowana, ma skupinski atribut "$1", kotryž so w prjedawšim teksće njejewi.', 'cite_error_references_missing_key' => 'Taflička <ref> z mjenom "$1", kotraž je w <references> definowana, so w prjedawšim teksće njewužiwa.', 'cite_error_references_no_key' => 'Taflička <ref>, kotraž je w <references> definowana, mjenowy atribut nima.', 'cite_error_empty_references_define' => 'Taflička <ref>, kotraž je w <references> z mjenom "$1" definowana, wobsah nima.', - 'cite_references_link_accessibility_label' => 'Horje skočić', - 'cite_references_link_many_accessibility_label' => 'Horje skočić do:', ); /** Haitian (Kreyòl ayisyen) @@ -1752,38 +1734,38 @@ $messages['ig'] = array( * @author Lam-ang */ $messages['ilo'] = array( - 'cite-desc' => 'Aginayon kadagiti etiketa ti ken , para kadagiti panagdakamat', + 'cite-desc' => 'Agnayon ti ken nga etiketa, para kadagiti pagdakamat', 'cite_error' => 'Biddut ti dakamat: $1', - 'cite_error_ref_numeric_key' => 'Imbalido ti etiketa ti <ref>; -ti nagan ket saan a mabalin a nalaka a sibubukel. Agusar ti makaipalawag a titulo', - 'cite_error_ref_no_key' => 'Imbalido nga etiketa ti <ref> ; -dagita ref nga awan nagyanna ket masapul nga adda naganna', - 'cite_error_ref_too_many_keys' => 'Imbalido nga etiketa ti <ref> ; + 'cite_error_ref_numeric_key' => 'Imbalido a <ref> nga etiketa; +ti nagan ket saan a mabalin a nalaka a sibubukel. Agusar ti agipalpalawag a titulo', + 'cite_error_ref_no_key' => 'Imbalido a <ref> nga etiketa; +dagita ref nga awan nagyanna ket masapul a managanan', + 'cite_error_ref_too_many_keys' => 'Imbalido a <ref> nga etiketa; imbalido a nag-nagan, a kas adu unay', - 'cite_error_ref_no_input' => 'Imbalido nga etiketa ti <ref> ; + 'cite_error_ref_no_input' => 'Imbalido a <ref> nga etiketa; dagiti ref nga awan ti naganna ket masapul nga addaan ti nagyan', - 'cite_error_references_invalid_parameters' => 'Imbalido nga etiketa ti <references>; -saan a maipalubos dagiti parametro. + 'cite_error_references_invalid_parameters' => 'Imbalido a <references> nga etiketa +awan dagiti parametro a maipalubos. Usaren ti <references />', - 'cite_error_references_invalid_parameters_group' => 'Imbalido nga etiketa ti <references> ; -maipalubos laeng ti parametro ti "grupo" . + 'cite_error_references_invalid_parameters_group' => 'Imbalido a <references> nga etiketa; +parametro a "grupo" ket ti maipalubos laeng. Usaren ti <references /> , wenno<references group="..." />', - 'cite_error_references_no_backlink_label' => 'Naibusan kadagiti etiketa ti naisangayan a silpo ti likud. -Ipalawag pay ti adu idiay mensahe ti [[MediaWiki:Cite references link many format backlink labels]]', - 'cite_error_no_link_label_group' => 'Naibusan kadagiti etiketa ti nangruna a silpo para iti grupo ti "$1". -Ipalawag pay ti adu idiay mensahe ti [[MediaWiki:$2]] .', - 'cite_error_references_no_text' => 'Imbalido nga etiketa ti <ref> ; -awan ti testo a naited para kadagiti ref a nanaganan $1', - 'cite_error_included_ref' => 'Irikepen ti </ref> napukaw para iti etiketa ti <ref>', - 'cite_error_refs_without_references' => 'Ti etiketa ti <ref> ket addan, ngem awan ti etiketa ti <references/> a nabirukan', - 'cite_error_group_refs_without_references' => 'Adda dagiti etiketa ti <ref> para iti grupo a nanaganan ti "$1", ngem awan ti kapada nga etiketa ti <references group="$1"/> a nabirukan, wenno awan ti pangrikep ti </ref>', - 'cite_error_references_group_mismatch' => 'Ti etiketa ti <ref> iday <references> ket addan ti kasinnungat a gupit ti grupo ti "$1".', - 'cite_error_references_missing_group' => 'Ti etiketa ti <ref> a naipalawag idiay <references> ket addaan ti gupit ti grupo ti "$1" a saan nga agparang iti napalabas a testo.', - 'cite_error_references_missing_key' => 'Ti etiketa ti <ref> nga addaan ti nagan ti "$1" a naipalawag idiay <references> ket saan a nausar iti napalabas a testo.', - 'cite_error_references_no_key' => 'Ti etiketa ti <ref> a naipalawag idiay <references> ket awan ti nainagan a gupit.', - 'cite_error_empty_references_define' => 'Ti etiketa ti <ref> a naipalawag idiay <references> nga addaan ti nagan a "$1" ket awan ti nagyanna.', - 'cite_references_link_accessibility_label' => 'Mapan iti ngato', - 'cite_references_link_many_accessibility_label' => 'Mapan aginggana iti:', + 'cite_error_references_no_backlink_label' => 'Naibusan kadagiti nagrunaan a likud ti silpo nga etiketa. +Ipalawag pay ti adu idiay [[MediaWiki:Cite references link many format backlink labels]] a mensahe', + 'cite_error_no_link_label_group' => 'Naibusan ti nangruna a silpo nga etiketa para iti grupo ti "$1". +Ipalawag pay ti adu idiay [[MediaWiki:$2]] a mensahe.', + 'cite_error_references_no_text' => 'Imbalido a <ref> nga etiketa; +awan ti testo a naited para dagiti ref a nanaganan $1', + 'cite_error_included_ref' => 'Irikrikep ti </ref> napukaw para iti <ref> nga etiketa', + 'cite_error_refs_without_references' => 'Ti <ref> nga etiketa ket addan, ngem awan ti <references/> nga etiketa a nabirukan', + 'cite_error_group_refs_without_references' => 'Adda dagiti <ref> para iti grupo a nanaganan ti "$1", ngem awan ti kapada a <references group="$1"/> nga etiketa ti nabirukan, wenno pangrikep a </ref> ket awan', + 'cite_error_references_group_mismatch' => 'Ti <ref> nga etiketa iday <references> ket addan ti nagsungat a gupit ti grupo "$1".', + 'cite_error_references_missing_group' => 'Ti <ref> nga etiketa a naipalawag idiay <references> ket addaan ti gupit ti grupo ti "$1" a saan nga agparang iti napalabas a testo.', + 'cite_error_references_missing_key' => 'Ti <ref> nga etiketa nga addaan ti nagan ti "$1" a naipalawag idiay <references> ket saan a nausar iti napalabas a testo.', + 'cite_error_references_no_key' => 'Ti <ref> nga etiketa a naipalawag idiay <references> ket awan ti nainagan a gupit.', + 'cite_error_empty_references_define' => 'Ti <ref> nga etiketa a naipalawag idiay <references> nga addaan ti nagan a "$1" ket awan ti nagyanna.', + 'cite_references_link_accessibility_label' => 'Lumagto ti ngato', + 'cite_references_link_many_accessibility_label' => 'Lumagto ti ngato iti:', ); /** Ido (Ido) @@ -1896,8 +1878,6 @@ $messages['ja'] = array( 'cite_error_references_missing_key' => '<references> で定義されている <ref> タグ (name="$1") は、先行するテキスト内で使用されていません。', 'cite_error_references_no_key' => '<references> で定義されている <ref> タグに name 属性がありません。', 'cite_error_empty_references_define' => '<references> で定義されている <ref> タグ (name="$1") に内容がありません。', - 'cite_references_link_accessibility_label' => '元の位置に戻る', - 'cite_references_link_many_accessibility_label' => '以下の位置に戻る:', ); /** Jutish (jysk) @@ -1915,7 +1895,6 @@ $messages['jut'] = array( ); /** Javanese (Basa Jawa) - * @author Bennylin * @author Iwan Novirion * @author Meursault2004 * @author NoiX180 @@ -1946,12 +1925,10 @@ Tambahaké katemton nèng layang [[MediaWiki:$2]].', ora ditemokaké tèks kanggo ref mawa jeneng $1', 'cite_error_included_ref' => 'Panutupan </ref> kélangan tag <ref>', 'cite_error_refs_without_references' => 'Tag <ref> ditemokaké, nanging tag <references/> ora ditemokaké', - 'cite_error_group_refs_without_references' => 'Tag <ref> ditemokaké kanggo paguyuban ajeneng "$1", nanging tag <references group="$1"/> sing ana kaitané ora ditemokaké, utawa tag panutup </ref> ora diwénéhi', + 'cite_error_group_refs_without_references' => 'Tag <ref> ditemokaké kanggo paguyuban ajeneng "$1", nanging tag <references group="$1"/> sing ana kaitané ora ditemokaké', # Fuzzy 'cite_error_references_group_mismatch' => '<ref> tandha <references> nduwèni atribut klompok sing marai konflik "$1".', 'cite_error_references_missing_group' => '<ref> tag sing didhèfinisikaké <references> nduwèni atribut klompok "$1" sing ora njedhul sing tèks sakdurungé.', 'cite_error_references_missing_key' => '<ref> tag sing didhefinisikaké mawa jeneng "$1" <references> ora dianggo nèng tèks sakdurungé.', - 'cite_error_references_no_key' => 'Tag <ref> yang didefinisikan di di <references> tidak memiliki nama atribut.', - 'cite_error_empty_references_define' => 'Tag <ref> yang didefinisikan di di <references> dengan nama "$1" tidak memiliki isi.', 'cite_reference_link_key_with_num' => '$1_$2', 'cite_reference_link_prefix' => 'cite_ref-', 'cite_references_link_prefix' => 'cite_note-', @@ -1962,8 +1939,6 @@ ora ditemokaké tèks kanggo ref mawa jeneng $1', 'cite_references_link_many_format_backlink_labels' => 'a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej ek el em en eo ep eq er es et eu ev ew ex ey ez fa fb fc fd fe ff fg fh fi fj fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gf gg gh gi gj gk gl gm gn go gp gq gr gs gt gu gv gw gx gy gz ha hb hc hd he hf hg hh hi hj hk hl hm hn ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il im in io ip iq ir is it iu iv iw ix iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn ko kp kq kr ks kt ku kv kw kx ky kz la lb lc ld le lf lg lh li lj lk ll lm ln lo lp lq lr ls lt lu lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo op oq or os ot ou ov ow ox oy oz pa pb pc pd pe pf pg ph pi pj pk pl pm pn po pp pq pr ps pt pu pv pw px py pz qa qb qc qd qe qf qg qh qi qj qk ql qm qn qo qp qq qr qs qt qu qv qw qx qy qz ra rb rc rd re rf rg rh ri rj rk rl rm rn ro rp rq rr rs rt ru rv rw rx ry rz sa sb sc sd se sf sg sh si sj sk sl sm sn so sp sq sr ss st su sv sw sx sy sz ta tb tc td te tf tg th ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty tz ua ub uc ud ue uf ug uh ui uj uk ul um un uo up uq ur us ut uu uv uw ux uy uz va vb vc vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz wa wb wc wd we wf wg wh wi wj wk wl wm wn wo wp wq wr ws wt wu wv ww wx wy wz xa xb xc xd xe xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk yl ym yn yo yp yq yr ys yt yu yv yw yx yy yz za zb zc zd ze zf zg zh zi zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz', 'cite_references_link_many_sep' => ' ', 'cite_references_link_many_and' => ' ', - 'cite_references_link_accessibility_label' => 'Mencolot munggah', - 'cite_references_link_many_accessibility_label' => 'Mencolot munggah menyang:', ); /** Georgian (ქართული) @@ -1996,7 +1971,7 @@ $messages['ka'] = array( სქოლიოსათვის $1 არ არის მითითებული ტექსტი', 'cite_error_included_ref' => 'დამხურავი ტეგი </ref> დაკარგულია', 'cite_error_refs_without_references' => 'არსებული ტეგისათვის <ref> ვერ მოიძებნა შესაბამისი ტეგი <references/>', - 'cite_error_group_refs_without_references' => 'ჯგუფი „$1“ არსებული ტეგებისათვის <ref> ვერ მოიძებნა შესაბამისი ტეგი <references group="$1"/>, ან გამოტოვებულია დამხურავი ტეგი </ref>', + 'cite_error_group_refs_without_references' => 'ჯგუფი „$1“ არსებული ტეგებისათვის <ref> ვერ მოიძებნა შესაბამისი ტეგი <references group="$1"/>', # Fuzzy 'cite_error_references_group_mismatch' => 'ტეგს <ref> <references>-ში გააჩნია ატრიბუტთა კონფლიქტური ჯგუფები „$1“.', 'cite_error_references_missing_group' => 'ტეგს <ref>, განმარტებულს <references>-ში, გააჩნია ჯგუფის ატრიბუტი „$1“, რომელიც ადრეულ ტექსტში არ მოიხსენიება.', 'cite_error_references_missing_key' => 'ტეგი <ref> სახელად „$1“, გარკვეული <references>-ში, არ გამოიყენება წინა ტექსტში.', @@ -2024,38 +1999,18 @@ $messages['kk-arab'] = array( ); /** Kazakh (Cyrillic script) (қазақша (кирил)‎) - * @author Arystanbek * @author Kaztrans */ $messages['kk-cyrl'] = array( - 'cite-desc' => 'Сілтемелер үшін және белгішелерін қолданыңыз', - 'cite_error' => 'Дереккөз алу қатесі: $1', - 'cite_error_ref_numeric_key' => 'Жарамсыз <ref> белгішесі; -атау кәдімгі бүтін сан болуы мүмкін емес. Сипатауыш атау қолданыңыз', - 'cite_error_ref_no_key' => 'Жарамсыз <ref> белгішесі; -мағлұматсыз дерекөздерде атау болуы қажет', - 'cite_error_ref_too_many_keys' => 'Жарамсыз <ref> белгіше; -жарамсыз атаулар, мысалы, тым көп', - 'cite_error_ref_no_input' => 'Жарамсыз <ref> белгіше; -атаусыз дереккөздерде мағлұматы болуы қажет', - 'cite_error_references_invalid_parameters' => 'Жарамсыз <references> белгіше; -еш параметр рұқсат етілмейді, -былай <references /> қолданыңыз', - 'cite_error_references_invalid_parameters_group' => 'Жарамсыз <references> тегі; -тек "group" параметрін рұқсат етеді. -Келесідей қолданыңыз: <references />, or <references group="..." />', - 'cite_error_references_no_backlink_label' => 'Өзгертпелі белгілердің саны бітті, одан әрі көбірек [[MediaWiki:Cite references link many format backlink labels]] жүйе хабарында белгілеңіз', - 'cite_error_no_link_label_group' => '"$1" тобы үшін өзгертпелі сілтеме белгілері бітті. -Define more in the [[MediaWiki:$2]] message.', - 'cite_error_references_no_text' => 'Жарамсыз <ref> тегі; -no text was provided for refs named $1', - 'cite_error_included_ref' => '<ref> тегін </ref> тегімен жабуды қажет етеді', - 'cite_error_refs_without_references' => '<ref> тегі бар, бірақ <references/> тегі табылмады', - 'cite_error_group_refs_without_references' => '"$1" деп аталған дереккөз тобында <ref> тегі бар, бірақ тиісті <references group="$1"/> тегі табылмады, немесе </ref> жабу тегін қажет етеді', + 'cite_error' => 'Дәйексөз алу $1 қатесі', + 'cite_error_ref_numeric_key' => 'Жарамсыз <ref> белгішесі; атау кәдімгі бүтін сан болуы мүмкін емес, сиппатауыш атау қолданыңыз', + 'cite_error_ref_no_key' => 'Жарамсыз <ref> белгішесі; мағлұматсыз түсініктемелерде атау болуы қажет', + 'cite_error_ref_too_many_keys' => 'Жарамсыз <ref> белгіше; жарамсыз атаулар, мысалы, тым көп', + 'cite_error_ref_no_input' => 'Жарамсыз <ref> белгіше; атаусыз түсініктемелерде мағлұматы болуы қажет', + 'cite_error_references_invalid_parameters' => 'Жарамсыз <references> белгіше; еш баптар рұқсат етілмейді, былай <references /> қолданыңыз', + 'cite_error_references_no_backlink_label' => 'Қосымша белгілердің саны бітті, одан әрі көбірек [[MediaWiki:Cite_references_link_many_format_backlink_labels]] жүйе хабарында белгілеңіз', # Fuzzy 'cite_references_link_one' => '
    6. [[#$2|↑]] $3
    7. ', 'cite_references_link_many' => '
    8. ↑ $2 $3
    9. ', - 'cite_references_link_accessibility_label' => 'Жоғарыға көтеріліңіз', - 'cite_references_link_many_accessibility_label' => 'Мынаған өту:', ); /** Kazakh (Latin script) (qazaqşa (latın)‎) @@ -2155,7 +2110,7 @@ Et wohr keine Tex aanjejovve för de <ref>s met dämm Name „$1“.', 'cite_error_included_ref' => 'Hee för dat <ref> ham_mer kei zopaß </ref>', 'cite_error_refs_without_references' => 'Et sinn_er <ref>-Befähle en dä Sigg, ävver mer han keine <references/>-Befähl jefunge.', - 'cite_error_group_refs_without_references' => 'Et sinn_er <ref>-Befähle för de Jrop „$1“ en heh dä Sigg, ävver mer han keine <references group="$1"/>-Befähl jefonge, udder dä Befähl </ref> zom zohmaache es nit doh.', + 'cite_error_group_refs_without_references' => 'Et sinn_er <ref>-Befähle för de jrop „$1“ en hee dä Sigg, ävver mer han keine <references group="$1"/>-Befähl jefunge.', # Fuzzy 'cite_error_references_group_mismatch' => 'Dä <ref> Befähl en <references> hät en widerschpröschlesche Jroppe-Eijeschaff „$1“.', 'cite_error_references_missing_group' => 'Dä <ref> Befähl, aanjejoove em Befähl <references>, hät en Jroppe-Eijeschaff „$1“, di ävver em Täx doför nit vörjekumme es.', 'cite_error_references_missing_key' => 'Dä <ref> Befähl mem Naame „$1“, aanjejoove em Befähl <references>, es em Täx doför nit vörjekumme.', @@ -2165,8 +2120,6 @@ Et wohr keine Tex aanjejovve för de 'cite_reference_link_prefix' => 'fohss_noht_betreck_', 'cite_references_link_prefix' => 'fohss_noht_nommer_', 'cite_references_link_many_and' => ' ', - 'cite_references_link_accessibility_label' => 'Jangk noh bovve', - 'cite_references_link_many_accessibility_label' => 'Jangk noh bovve op:', ); /** Cornish (kernowek) @@ -2242,17 +2195,6 @@ Doe kans d\'r mier insjtelle in \'t sysyeemberich [[MediaWiki:$2]] 'De tag <ref> dae is gedefinieerd in <references> mit de naam "$1" haet geinen inhawd.', ); -/** لوری (لوری) - * @author Bonevarluri - * @author Mogoeilor - */ -$messages['lrc'] = array( - 'cite-desc' => ' و <سرچشمه یا/> tags,و تگیا نه د گوتنیا اضاف بکید', - 'cite_error' => 'خطا جاگه:$1', - 'cite_references_link_accessibility_label' => 'بالا پرسن', - 'cite_references_link_many_accessibility_label' => 'پرستن د', -); - /** Lithuanian (lietuvių) * @author Garas * @author Homo @@ -2372,7 +2314,6 @@ $messages['mk'] = array( 'cite_error_references_missing_key' => 'Ознаката <ref> со име „$1“ определена во <references> не се користи во претходен текст.', 'cite_error_references_no_key' => 'Ознаката <ref> определена во <referencesgt; нема именски атрибут.', 'cite_error_empty_references_define' => 'Ознаката <ref> определена во <references> со име „$1“ нема содржина.', - 'cite_references_link_many_format_backlink_labels' => 'а б в г д ѓ е ж з ѕ и ј к л љ м н њ о п р с т ќ у ф х ц ч џ ш аа аб ав аг ад аѓ ае аж аз аѕ аи ај ак ал аљ ам ан ањ ао ап ар ас ат аќ ау аф ах ац ач аџ аш ба бб бв бг бд бѓ бе бж бз бѕ би бј бк бл бљ бм бн бњ бо бп бр бс бт бќ бу бф бх бц бч бџ бш ва вб вв вг вд вѓ ве вж вз бѕ ви вј вк вл вљ вм вн вњ во вп вр вс вт вќ ву вф вх вц вч вџ вш га гб гв гг гд гѓ ге гж гз гѕ ги гј гк гл гљ гм гн гњ го гп гр гс гт гќ гу гф гх гц гч гџ гш да дб дв дг дд дѓ де дж дз дѕ ди дј дк дл дљ дм дн дњ до дп др дс дт дќ ду дф дх дц дч дџ дш ѓа ѓб ѓв ѓг ѓд ѓе ѓж ѓз ѓѕ ѓи ѓј ѓк ѓл ѓљ ѓм ѓн ѓњ ѓо ѓп ѓр ѓс ѓт ѓќ ѓу ѓф ѓх ѓц ѓч ѓџ ѓш еа еб ев ег ед еѓ ее еж ез еѕ еи еј ек ел ељ ем ен ењ ео еп ер ес ет еќ еу еф ех ец еч еџ еш жа жб жв жг жд жѓ же жж жз жѕ жи жј жк жл жљ жм жн жњ жо жп жр жс жт жќ жу жф жх жц жч жџ жш за зб зв зг зд зѓ зе зж зз зѕ зи зј зк зл зљ зм зн зњ зо зп зр зс зт зќ зу зф зх зц зч зџ зш ѕа ѕб ѕв ѕг ѕд ѕѓ ѕе ѕж ѕз ѕѕ ѕи ѕј ѕк ѕл ѕљ ѕм ѕн ѕњ ѕо ѕп ѕр ѕс ѕт ѕќ ѕу ѕф ѕх ѕц ѕч ѕџ ѕш иа иб ив иг ид иѓ ие иж из иѕ ии иј ик ил иљ им ин ињ ио ип ир ис ит иќ иу иф их иц ич иџ иш ја јб јв јг јд јѓ је јж јз јѕ ји јј јк јл јљ јм јн јњ јо јп јр јс јт јќ ју јф јх јц јч јџ јш ка кб кв кг кд кѓ ке кж кз кѕ ки кј кк кл кљ км кн књ ко кп кр кс кт кќ ку кф кх кц кч кџ кш ла лб лв лг лд лѓ ле лж лз лѕ ли лј лк лл лљ лм лн лњ ло лп лр лс лт лќ лу лф лх лц лч лџ лш ља љб љв љг љд љѓ ље љж љз љѕ љи љј љк љл љљ љм љн љњ љо љп љр љс љт љќ љу љф љх љц љч љџ љш ма мб мв мг мд мѓ ме мж мз мѕ ми мј мк мл мљ мм мн мњ мо мп мр мс мт мќ му мф мх мц мч мџ мш на нб нв нг нд нѓ не нж нз нѕ ни нј нк нл нљ нм нн нњ но нп нр нс нт нќ ну нф нх нц нч нџ нш ња њб њв њг њд њѓ ње њж њз њѕ њи њј њк њл њљ њм њн њњ њо њп њр њс њт њќ њу њф њх њц њч њџ њш оа об ов ог од оѓ ое ож оз оѕ ои ој ок ол ољ ом он оњ оо оп ор ос от оќ оу оф ох оц оч оџ ош па пб пв пг пд пѓ пе пж пз пѕ пи пј пк пл пљ пм пн пњ по пп пр пс пт пќ пу пф пх пц пч пџ пш ра рб рв рг рд рѓ ре рж рз рѕ ри рј рк рл рљ рм рн рњ ро рп рр рс рт рќ ру рф рх рц рч рџ рш са сб св сг сд сѓ се сж сз сѕ си сј ск сл сљ см сн сњ со сп ср сс ст сќ су сф сх сц сч сџ сш та тб тв тг тд тѓ те тж тз тѕ ти тј тк тл тљ тм тн тњ то тп тр тс тт тќ ту тф тх тц тч тџ тш ќа ќб ќв ќг ќд ќѓ ќе ќж ќз ќѕ ќи ќј ќк ќл ќљ ќм ќн ќњ ќо ќп ќр ќс ќт ќќ ќу ќф ќх ќц ќч ќџ ќш уа уб ув уг уд уѓ уе уж уз уѕ уи уј ук ул уљ ум ун уњ уо уп ур ус ут уќ уу уф ух уц уч уџ уш фа фб фв фг фд фѓ фе фж фз фѕ фи фј фк фл фљ фм фн фњ фо фп фр фс фт фќ фу фф фх фц фч фџ фш ха хб хв хг хд хѓ хе хж хз хѕ хи хј хк хл хљ хм хн хњ хо хп хр хс хт хќ ху хф хх хц хч хџ хш ца цб цв цг цд цѓ це цж цз цѕ ци цј цк цл цљ цм цн цњ цо цп цр цс цт цќ цу цф цх цц цч цџ цш ча чб чв чг чд чѓ че чж чз чѕ чи чј чк чл чљ чм чн чњ чо чп чр чс чт чќ чу чф чх чц чч чџ чш џа џб џв џг џд џѓ џе џж џз џѕ џи џј џк џл џљ џм џн џњ џо џп џр џс џт џќ џу џф џх џц џч џџ џш ша шб шв шг шд шѓ ше шж шз шѕ ши шј шк шл шљ шм шн шњ шо шп шр шс шт шќ шу шф шх шц шч шџ шш', 'cite_references_link_accessibility_label' => 'Следно', 'cite_references_link_many_accessibility_label' => 'Отиди кај:', ); @@ -2412,8 +2353,6 @@ $messages['ml'] = array( 'cite_error_empty_references_define' => ' <references> ആവശ്യത്തിനായി "$1" എന്ന പേരിൽ നിർ‌വചിക്കപ്പെട്ട <ref> റ്റാഗിന് ഉള്ളടക്കമൊന്നുമില്ല.', 'cite_reference_link_prefix' => 'ഉദ്ധരിണി_അവലംബം-', 'cite_references_link_prefix' => 'ഉദ്ധരിണി_കുറിപ്പ്-', - 'cite_references_link_accessibility_label' => 'മുകളിലേയ്ക്ക്', - 'cite_references_link_many_accessibility_label' => 'മുകളിൽ ഇവിടേയ്ക്ക്:', ); /** Mongolian (монгол) @@ -2431,7 +2370,7 @@ $messages['mn'] = array( * @author V.narsikar */ $messages['mr'] = array( - 'cite-desc' => ' हे दोन संदर्भ देण्यासाठी वापरण्यात येणारे शब्द जोडल्या जातील.', + 'cite-desc' => ' हे दोन संदर्भ देण्यासाठी वापरण्यात येणारे शब्द वाढविले जातील.', 'cite_error' => 'त्रूटी उधृत करा: $1', 'cite_error_ref_numeric_key' => '<ref> चुकीचा कोड; नाव हे पूर्णांकी संख्या असू शकत नाही, कृपया माहितीपूर्ण शीर्षक द्या', 'cite_error_ref_no_key' => '<ref> चुकीचा कोड; रिकाम्या संदर्भांना नाव असणे गरजेचे आहे', @@ -2444,17 +2383,14 @@ $messages['mr'] = array( 'cite_error_no_link_label_group' => '"$1" करिता नमूदकेलेल्या कस्टम लिंक खूणा संपल्या . [[MediaWiki:$2]] संदेशात अधिक खूणा नमूद करा', 'cite_error_references_no_text' => '<ref> चुकीचा कोड; $1 नावाने दिलेल्या संदर्भांमध्ये काहीही माहिती नाही', - 'cite_error_included_ref' => '<ref> ला बंद करणारी </ref> ही खूणपताका गायब आहे.', - 'cite_error_refs_without_references' => "या पानामधे \"<ref>\" ही खूणपताका(संदर्भटॅग) आहे, परंतु <references/> अथवा {{ -संदर्भयादी}}या पैकी एकही लावण्यात आलेले नाही.''' या पानात \"{{संदर्भयादी}}\" हा साचा कॉपीपेस्ट करावा''' ''कारण,त्याशिवाय पानाच्या तळाशी संदर्भांचे तपशील दिसणार नाहीत.''", + 'cite_error_included_ref' => '<ref> ला बंद करणारी </ref> ही खूण गायब आहे.', + 'cite_error_refs_without_references' => 'पानामधे <ref> (संदर्भ) आहे, परंतु <references/> ({{संदर्भयादी}}) सापडले नाही. {{संदर्भयादी}} असल्याशिवाय पानाच्या तळाशी संदर्भांचे तपशील दिसणार नाहीत.', 'cite_error_group_refs_without_references' => '"$1" नावाच्या गटाकरिता <ref>खूणपताका उपलब्ध आहेत, पण संबंधीत <references group="$1"/> खूण मिळाली नाही.', - 'cite_error_references_group_mismatch' => '<references>मधील खूणपताकेस<ref> खूणांशी विसंवाद असणारे group attribute "$1" आहे.', - 'cite_error_references_missing_group' => 'गट "$1" मधील <ref> खूणपताका <references> ह्या पूर्वी वापल्या गेलेल्या नाहीत.', - 'cite_error_references_missing_key' => '<references> ह्या मध्ये टाकलेला <ref> "$1" ह्या नावाची खूणपताका ह्या पूर्वी वापरण्यात आलेली नाही.', - 'cite_error_references_no_key' => '<ref>खूणपताकेत नमूद गोष्टींना <references> ला नाम-गुणधर्म नाहीत.', - 'cite_error_empty_references_define' => '<ref>खूणपताकेत नमूद गोष्टींना, <references> ज्या "$1" ह्या नावाने संबोधल्या आहेत, त्यात माहिती नाही.', - 'cite_references_link_accessibility_label' => 'वर उडी मारा', - 'cite_references_link_many_accessibility_label' => 'ला वर उडी मारा:', + 'cite_error_references_group_mismatch' => 'tag in <references>मधील <ref> खूणांना खटका उडणारे group attribute "$1" आहे.', + 'cite_error_references_missing_group' => 'गट "$1" मधील <ref> ट्याग <references> ह्या पूर्वी वापल्या गेलेले नाही', + 'cite_error_references_missing_key' => '<references> ह्या मध्ये सांगितलेला <ref> "$1" ह्या नावाचा ट्याग ह्या पूर्वी वापरण्यात आलेला नाही.', + 'cite_error_references_no_key' => '<ref> ट्याग मध्ये विशारद गोष्टींना <references> ला नाम गुणधर्म नाहीत', + 'cite_error_empty_references_define' => '<ref> ट्याग मध्ये विशारद गोष्टीं <references> ज्या "$1" ह्या नावाने संबोधल्या आहेत त्यात माहिती नाही', ); /** Malay (Bahasa Melayu) @@ -2572,7 +2508,6 @@ $messages['nds-nl'] = array( ); /** Dutch (Nederlands) - * @author Flightmare * @author Niels * @author Romaine * @author Siebrand @@ -2609,8 +2544,6 @@ er is geen tekst opgegeven voor refs met de naam $1', 'cite_error_references_missing_key' => 'De tag <ref> met de naam "$1" gedefinieerd in <references> wordt niet eerder in de tekst gebruikt.', 'cite_error_references_no_key' => 'De tag <ref> die is gedefinieerd in <references> heeft geen eigenschapsnaam.', 'cite_error_empty_references_define' => 'De tag <ref> die is gedefinieerd in <references> met de naam "$1" heeft geen inhoud.', - 'cite_references_link_accessibility_label' => 'Omhoog', - 'cite_references_link_many_accessibility_label' => 'Omhoog naar:', ); /** Norwegian Nynorsk (norsk nynorsk) @@ -2663,8 +2596,6 @@ pas de tèxte per las referéncias nomenadas $1.', 'cite_error_references_missing_key' => 'La balisa <ref> amb lo nom « $1 » definida dins <references> es pas utilizada dins lo tèxte precedent.', 'cite_error_references_no_key' => 'La balisa <ref> definida dins <references> a pas de nom d’atribut.', 'cite_error_empty_references_define' => 'La balisa <ref> definida dins <references> amb lo nom « $1 » a pas de contengut.', - 'cite_references_link_accessibility_label' => 'Anar', - 'cite_references_link_many_accessibility_label' => 'Anar a :', ); /** Oriya (ଓଡ଼ିଆ) @@ -2853,14 +2784,12 @@ Defina mais na mensagem [[MediaWiki:$2]].', 'cite_error_references_no_text' => 'Tag <ref> inválida; não foi fornecido texto para as refs chamadas $1', 'cite_error_included_ref' => '</ref> de fecho em falta, para o elemento <ref>', 'cite_error_refs_without_references' => 'existem tags <ref>, mas nenhuma tag <references/> foi encontrada', - 'cite_error_group_refs_without_references' => 'existem marcas <ref> para um grupo chamado "$1", mas nenhuma marca <references group="$1"/> correspondente foi encontrada (ou uma marca de fechamento </ref> está faltando)', + 'cite_error_group_refs_without_references' => 'existem tags <ref> para um grupo chamado "$1", mas nenhuma tag <references group="$1"/> correspondente foi encontrada', # Fuzzy 'cite_error_references_group_mismatch' => 'O elemento <ref> em <references> tem o atributo de grupo "$1", que está em conflito com o de <references>.', 'cite_error_references_missing_group' => 'O elemento <ref> definido em <references> tem o atributo de grupo "$1", que não aparece no texto anterior.', 'cite_error_references_missing_key' => 'A etiqueta <ref> com nome "$1" definida em <references> não é utilizada no texto acima.', 'cite_error_references_no_key' => 'O elemento <ref> definido em <references> não tem um atributo de nome.', 'cite_error_empty_references_define' => 'O elemento <ref> definido em <references> com o nome "$1" não tem conteúdo.', - 'cite_references_link_accessibility_label' => 'Ir para cima', - 'cite_references_link_many_accessibility_label' => 'Ir para:', ); /** Brazilian Portuguese (português do Brasil) @@ -3185,13 +3114,6 @@ Usari <references /> oppuru <references group="..." 'cite_references_link_many_format_backlink_labels' => 'a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej ek el em en eo ep eq er es et eu ev ew ex ey ez fa fb fc fd fe ff fg fh fi fj fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gf gg gh gi gj gk gl gm gn go gp gq gr gs gt gu gv gw gx gy gz ha hb hc hd he hf hg hh hi hj hk hl hm hn ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il im in io ip iq ir is it iu iv iw ix iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn ko kp kq kr ks kt ku kv kw kx ky kz la lb lc ld le lf lg lh li lj lk ll lm ln lo lp lq lr ls lt lu lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo op oq or os ot ou ov ow ox oy oz pa pb pc pd pe pf pg ph pi pj pk pl pm pn po pp pq pr ps pt pu pv pw px py pz qa qb qc qd qe qf qg qh qi qj qk ql qm qn qo qp qq qr qs qt qu qv qw qx qy qz ra rb rc rd re rf rg rh ri rj rk rl rm rn ro rp rq rr rs rt ru rv rw rx ry rz sa sb sc sd se sf sg sh si sj sk sl sm sn so sp sq sr ss st su sv sw sx sy sz ta tb tc td te tf tg th ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty tz ua ub uc ud ue uf ug uh ui uj uk ul um un uo up uq ur us ut uu uv uw ux uy uz va vb vc vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz wa wb wc wd we wf wg wh wi wj wk wl wm wn wo wp wq wr ws wt wu wv ww wx wy wz xa xb xc xd xe xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk yl ym yn yo yp yq yr ys yt yu yv yw yx yy yz za zb zc zd ze zf zg zh zi zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz', ); -/** Serbo-Croatian (srpskohrvatski / српскохрватски) - * @author Kolega2357 - */ -$messages['sh'] = array( - 'cite_error' => 'Greška citiranja $1; $2', # Fuzzy -); - /** Sinhala (සිංහල) * @author Budhajeewa * @author Thameera123 @@ -3339,7 +3261,6 @@ asnjë tekst nuk u dha për refs e quajtura $1', ); /** Serbian (Cyrillic script) (српски (ћирилица)‎) - * @author Milicevic01 * @author Millosh * @author Rancher * @author Михајло Анђелковић @@ -3365,14 +3286,13 @@ $messages['sr-ec'] = array( 'cite_references_link_one' => '
    10. [[#$2|↑]] $3
    11. ', 'cite_references_link_many' => '
    12. ↑ $2 $3
    13. ', 'cite_references_link_many_format' => '[[#$1|$2]]', - 'cite_references_link_many_format_backlink_labels' => 'а б в г д ђ е ж з и ј к л љ м н њ о п р с т ћ у ф х ц ч џ ш аа аб ав аг ад ађ ае аж аз аи ај ак ал аљ ам ан ањ ао ап ар ас ат аћ ау аф ах ац ач аџ аш ба бб бв бг бд бђ бе бж бз би бј бк бл бљ бм бн бњ бо бп бр бс бт бћ бу бф бх бц бч бџ бш ва вб вв вг вд вђ ве вж вз ви вј вк вл вљ вм вн вњ во вп вр вс вт вћ ву вф вх вц вч вџ вш га гб гв гг гд гђ ге гж гз ги гј гк гл гљ гм гн гњ го гп гр гс гт гћ гу гф гх гц гч гџ гш да дб дв дг дд дђ де дж дз ди дј дк дл дљ дм дн дњ до дп др дс дт дћ ду дф дх дц дч дџ дш ђа ђб ђв ђг ђд ]] ђе ђж ђз ђи ђј ђк ђл ђљ ђм ђн ђњ ђо ђп ђр ђс ђт ђћ ђу ђф ђх ђц ђч ђџ ђш еа еб ев ег ед еђ ее еж ез еи еј ек ел ељ ем ен ењ ео еп ер ес ет ећ еу еф ех ец еч еџ еш жа жб жв жг жд жђ же жж жз жи жј жк жл жљ жм жн жњ жо жп жр жс жт жћ жу жф жх жц жч жџ жш за зб зв зг зд зђ зе зж зз зи зј зк зл зљ зм зн зњ зо зп зр зс зт зћ зу зф зх зц зч зџ зш иа иб ив иг ид иђ ие иж из ии иј ик ил иљ им ин ињ ио ип ир ис ит ић иу иф их иц ич иџ иш ја јб јв јг јд јђ је јж јз ји јј јк јл јљ јм јн јњ јо јп јр јс јт јћ ју јф јх јц јч јџ јш ка кб кв кг кд кђ ке кж кз ки кј кк кл кљ км кн књ ко кп кр кс кт кћ ку кф кх кц кч кџ кш ла лб лв лг лд лђ ле лж лз ли лј лк лл лљ лм лн лњ ло лп лр лс лт лћ лу лф лх лц лч лџ лш ља љб љв љг љд љђ ље љж љз љи љј љк љл љљ љм љн љњ љо љп љр љс љт љћ љу љф љх љц љч љџ љш ма мб мв мг мд мђ ме мж мз ми мј мк мл мљ мм мн мњ мо мп мр мс мт мћ му мф мх мц мч мџ мш на нб нв нг нд нђ не нж нз ни нј нк нл нљ нм нн нњ но нп нр нс нт нћ ну нф нх нц нч нџ нш ња њб њв њг њд њђ ње њж њз њи њј њк њл њљ њм њн њњ њо њп њр њс њт њћ њу њф њх њц њч њџ њш оа об ов ог од ођ ое ож оз ои ој ок ол ољ ом он оњ оо оп ор ос от оћ оу оф ох оц оч оџ ош па пб пв пг пд пђ пе пж пз пи пј пк пл пљ пм пн пњ по пп пр пс пт пћ пу пф пх пц пч пџ пш ра рб рв рг рд рђ ре рж рз ри рј рк рл рљ рм рн рњ ро рп рр рс рт рћ ру рф рх рц рч рџ рш са сб св сг сд сђ се сж сз си сј ск сл сљ см сн сњ со сп ср сс ст сћ су сф сх сц сч сџ сш та тб тв тг тд тђ те тж тз ти тј тк тл тљ тм тн тњ то тп тр тс тт тћ ту тф тх тц тч тџ тш ћа ћб ћв ћг ћд ћђ ће ћж ћз ћи ћј ћк ћл ћљ ћм ћн ћњ ћо ћп ћр ћс ћт ћћ ћу ћф ћх ћц ћч ћџ ћш уа уб ув уг уд уђ уе уж уз уи уј ук ул уљ ум ун уњ уо уп ур ус ут ућ уу уф ух уц уч уџ уш фа фб фв фг фд фђ фе фж фз фи фј фк фл фљ фм фн фњ фо фп фр фс фт фћ фу фф фх фц фч фџ фш ха хб хв хг хд хђ хе хж хз хи хј хк хл хљ хм хн хњ хо хп хр хс хт хћ ху хф хх хц хч хџ хш ца цб цв цг цд цђ це цж цз ци цј цк цл цљ цм цн цњ цо цп цр цс цт цћ цу цф цх цц цч цџ цш ча чб чв чг чд чђ че чж чз чи чј чк чл чљ чм чн чњ чо чп чр чс чт чћ чу чф чх чц чч чџ чш џа џб џв џг џд џђ џе џж џз џи џј џк џл џљ џм џн џњ џо џп џр џс џт џћ џу џф џх џц џч џџ џш ша шб шв шг шд шђ ше шж шз ши шј шк шл шљ шм шн шњ шо шп шр шс шт шћ шу шф шх шц шч шџ шш', # Fuzzy + 'cite_references_link_many_format_backlink_labels' => 'a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej ek el em en eo ep eq er es et eu ev ew ex ey ez fa fb fc fd fe ff fg fh fi fj fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gf gg gh gi gj gk gl gm gn go gp gq gr gs gt gu gv gw gx gy gz ha hb hc hd he hf hg hh hi hj hk hl hm hn ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il im in io ip iq ir is it iu iv iw ix iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn ko kp kq kr ks kt ku kv kw kx ky kz la lb lc ld le lf lg lh li lj lk ll lm ln lo lp lq lr ls lt lu lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo op oq or os ot ou ov ow ox oy oz pa pb pc pd pe pf pg ph pi pj pk pl pm pn po pp pq pr ps pt pu pv pw px py pz qa qb qc qd qe qf qg qh qi qj qk ql qm qn qo qp qq qr qs qt qu qv qw qx qy qz ra rb rc rd re rf rg rh ri rj rk rl rm rn ro rp rq rr rs rt ru rv rw rx ry rz sa sb sc sd se sf sg sh si sj sk sl sm sn so sp sq sr ss st su sv sw sx sy sz ta tb tc td te tf tg th ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty tz ua ub uc ud ue uf ug uh ui uj uk ul um un uo up uq ur us ut uu uv uw ux uy uz va vb vc vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz wa wb wc wd we wf wg wh wi wj wk wl wm wn wo wp wq wr ws wt wu wv ww wx wy wz xa xb xc xd xe xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk yl ym yn yo yp yq yr ys yt yu yv yw yx yy yz za zb zc zd ze zf zg zh zi zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz', 'cite_references_link_many_sep' => ' ', 'cite_references_link_many_and' => ' ', ); /** Serbian (Latin script) (srpski (latinica)‎) * @author Michaello - * @author Milicevic01 */ $messages['sr-el'] = array( 'cite-desc' => 'Dodaje i oznake za citiranje.', @@ -3395,7 +3315,7 @@ $messages['sr-el'] = array( 'cite_references_link_one' => '
    14. [[#$2|↑]] $3
    15. ', 'cite_references_link_many' => '
    16. ↑ $2 $3
    17. ', 'cite_references_link_many_format' => '[[#$1|$2]]', - 'cite_references_link_many_format_backlink_labels' => 'a b v g d đ e ž z i j k l lj m n nj o p r s t ć u f h c č dž š aa ab av ag ad ađ ae až az ai aj ak al alj am an anj ao ap ar as at ać au af ah ac ač adž aš ba bb bv bg bd bđ be bž bz bi bj bk bl blj bm bn bnj bo bp br bs bt bć bu bf bh bc bč bdž bš va vb vv vg vd vđ ve vž vz vi vj vk vl vlj vm vn vnj vo vp vr vs vt vć vu vf vh vc vč vdž vš ga gb gv gg gd gđ ge gž gz gi gj gk gl glj gm gn gnj go gp gr gs gt gć gu gf gh gc gč gdž gš da db dv dg dd dđ de dž dz di dj dk dl dlj dm dn dnj do dp dr ds dt dć du df dh dc dč ddž dš đa đb đv đg đd ]] đe đž đz đi đj đk đl đlj đm đn đnj đo đp đr đs đt đć đu đf đh đc đč đdž đš ea eb ev eg ed eđ ee ež ez ei ej ek el elj em en enj eo ep er es et eć eu ef eh ec eč edž eš ža žb žv žg žd žđ že žž žz ži žj žk žl žlj žm žn žnj žo žp žr žs žt žć žu žf žh žc žč ždž žš za zb zv zg zd zđ ze zž zz zi zj zk zl zlj zm zn znj zo zp zr zs zt zć zu zf zh zc zč zdž zš ia ib iv ig id iđ ie iž iz ii ij ik il ilj im in inj io ip ir is it ić iu if ih ic ič idž iš ja jb jv jg jd jđ je jž jz ji jj jk jl jlj jm jn jnj jo jp jr js jt jć ju jf jh jc jč jdž jš ka kb kv kg kd kđ ke kž kz ki kj kk kl klj km kn knj ko kp kr ks kt kć ku kf kh kc kč kdž kš la lb lv lg ld lđ le lž lz li lj lk ll llj lm ln lnj lo lp lr ls lt lć lu lf lh lc lč ldž lš lja ljb ljv ljg ljd ljđ lje ljž ljz lji ljj ljk ljl ljlj ljm ljn ljnj ljo ljp ljr ljs ljt ljć lju ljf ljh ljc ljč ljdž ljš ma mb mv mg md mđ me mž mz mi mj mk ml mlj mm mn mnj mo mp mr ms mt mć mu mf mh mc mč mdž mš na nb nv ng nd nđ ne nž nz ni nj nk nl nlj nm nn nnj no np nr ns nt nć nu nf nh nc nč ndž nš nja njb njv njg njd njđ nje njž njz nji njj njk njl njlj njm njn njnj njo njp njr njs njt njć nju njf njh njc njč njdž njš oa ob ov og od ođ oe ož oz oi oj ok ol olj om on onj oo op or os ot oć ou of oh oc oč odž oš pa pb pv pg pd pđ pe pž pz pi pj pk pl plj pm pn pnj po pp pr ps pt pć pu pf ph pc pč pdž pš ra rb rv rg rd rđ re rž rz ri rj rk rl rlj rm rn rnj ro rp rr rs rt rć ru rf rh rc rč rdž rš sa sb sv sg sd sđ se sž sz si sj sk sl slj sm sn snj so sp sr ss st sć su sf sh sc sč sdž sš ta tb tv tg td tđ te tž tz ti tj tk tl tlj tm tn tnj to tp tr ts tt tć tu tf th tc tč tdž tš ća ćb ćv ćg ćd ćđ će ćž ćz ći ćj ćk ćl ćlj ćm ćn ćnj ćo ćp ćr ćs ćt ćć ću ćf ćh ćc ćč ćdž ćš ua ub uv ug ud uđ ue už uz ui uj uk ul ulj um un unj uo up ur us ut uć uu uf uh uc uč udž uš fa fb fv fg fd fđ fe fž fz fi fj fk fl flj fm fn fnj fo fp fr fs ft fć fu ff fh fc fč fdž fš ha hb hv hg hd hđ he hž hz hi hj hk hl hlj hm hn hnj ho hp hr hs ht hć hu hf hh hc hč hdž hš ca cb cv cg cd cđ ce cž cz ci cj ck cl clj cm cn cnj co cp cr cs ct cć cu cf ch cc cč cdž cš ča čb čv čg čd čđ če čž čz či čj čk čl člj čm čn čnj čo čp čr čs čt čć ču čf čh čc čč čdž čš dža džb džv džg džd džđ dže džž džz dži džj džk džl džlj džm džn džnj džo džp džr džs džt džć džu džf džh džc džč dždž džš ša šb šv šg šd šđ še šž šz ši šj šk šl šlj šm šn šnj šo šp šr šs št šć šu šf šh šc šč šdž šš', # Fuzzy + 'cite_references_link_many_format_backlink_labels' => 'a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej ek el em en eo ep eq er es et eu ev ew ex ey ez fa fb fc fd fe ff fg fh fi fj fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gf gg gh gi gj gk gl gm gn go gp gq gr gs gt gu gv gw gx gy gz ha hb hc hd he hf hg hh hi hj hk hl hm hn ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il im in io ip iq ir is it iu iv iw ix iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn ko kp kq kr ks kt ku kv kw kx ky kz la lb lc ld le lf lg lh li lj lk ll lm ln lo lp lq lr ls lt lu lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo op oq or os ot ou ov ow ox oy oz pa pb pc pd pe pf pg ph pi pj pk pl pm pn po pp pq pr ps pt pu pv pw px py pz qa qb qc qd qe qf qg qh qi qj qk ql qm qn qo qp qq qr qs qt qu qv qw qx qy qz ra rb rc rd re rf rg rh ri rj rk rl rm rn ro rp rq rr rs rt ru rv rw rx ry rz sa sb sc sd se sf sg sh si sj sk sl sm sn so sp sq sr ss st su sv sw sx sy sz ta tb tc td te tf tg th ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty tz ua ub uc ud ue uf ug uh ui uj uk ul um un uo up uq ur us ut uu uv uw ux uy uz va vb vc vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz wa wb wc wd we wf wg wh wi wj wk wl wm wn wo wp wq wr ws wt wu wv ww wx wy wz xa xb xc xd xe xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk yl ym yn yo yp yq yr ys yt yu yv yw yx yy yz za zb zc zd ze zf zg zh zi zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz', 'cite_references_link_many_sep' => ' ', 'cite_references_link_many_and' => ' ', ); @@ -3469,21 +3389,16 @@ Definera fler i [[MediaWiki:$2]]-meddelandet.', ); /** Tamil (தமிழ்) - * @author Jayarathina * @author Shanmugamp7 * @author செல்வா */ $messages['ta'] = array( 'cite-desc' => 'சேர்க்கிறது மற்றும் குறிச்சொற்கள், மேற்கோள்களுக்காக', 'cite_error' => 'பிழை காட்டு: $1', - 'cite_error_references_no_text' => 'செல்லாத <ref> குறிச்சொல்; -$1 என்னும் பெயரில் உள்ள ref குறிச்சொல்லுக்கு உரையேதும் வழங்கப்படவில்லை', - 'cite_error_refs_without_references' => '<ref> குறிச்சொல் உள்ளது, ஆனால் <references/> குறிச்சொல் காணப்படவில்லை', ); /** Telugu (తెలుగు) * @author Chaduvari - * @author Ravichandra * @author Veeven */ $messages['te'] = array( @@ -3496,7 +3411,6 @@ $messages['te'] = array( 'cite_error_references_invalid_parameters' => 'సరైన <references> ట్యాగు కాదు; పారామీటర్లకు కు అనుమతి లేదు, ఈ లోపాన్ని కలుగజేసే ఒక ఉదాహరణ: ', 'cite_error_references_no_backlink_label' => 'మీ స్వంత బ్యాక్‌లింకు లేబుళ్ళు అయిపోయాయి. [[MediaWiki:Cite references link many format backlink labels]] సందేశంలో మరిన్ని లేబుళ్ళను నిర్వచించుకోండి.', 'cite_error_references_no_text' => 'సరైన <ref> కాదు; $1 అనే పేరుగల ref లకు పాఠ్యమేమీ ఇవ్వలేదు', - 'cite_references_link_accessibility_label' => 'పైకి దూకు', ); /** Tajik (Cyrillic script) (тоҷикӣ) @@ -3685,8 +3599,6 @@ sadece "group" parametresine izin verilir. 'cite_error_references_no_key' => "<references>'da tanımlanan <ref> etiketinin hiçbir ad özniteliği yok.", 'cite_error_empty_references_define' => '<references>\'da tanımlanan "$1" adlı <ref> etiketinin içeriği yok.', 'cite_references_link_many_format_backlink_labels' => 'a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej ek el em en eo ep eq er es et eu ev ew ex ey ez fa fb fc fd fe ff fg fh fi fj fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gf gg gh gi gj gk gl gm gn go gp gq gr gs gt gu gv gw gx gy gz ha hb hc hd he hf hg hh hi hj hk hl hm hn ho hp hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il im in io ip iq ir is it iu iv iw ix iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn jo jp jq jr js jt ju jv jw jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn ko kp kq kr ks kt ku kv kw kx ky kz la lb lc ld le lf lg lh li lj lk ll lm ln lo lp lq lr ls lt lu lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt mu mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo op oq or os ot ou ov ow ox oy oz pa pb pc pd pe pf pg ph pi pj pk pl pm pn po pp pq pr ps pt pu pv pw px py pz qa qb qc qd qe qf qg qh qi qj qk ql qm qn qo qp qq qr qs qt qu qv qw qx qy qz ra rb rc rd re rf rg rh ri rj rk rl rm rn ro rp rq rr rs rt ru rv rw rx ry rz sa sb sc sd se sf sg sh si sj sk sl sm sn so sp sq sr ss st su sv sw sx sy sz ta tb tc td te tf tg th ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty tz ua ub uc ud ue uf ug uh ui uj uk ul um un uo up uq ur us ut uu uv uw ux uy uz va vb vc vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz wa wb wc wd we wf wg wh wi wj wk wl wm wn wo wp wq wr ws wt wu wv ww wx wy wz xa xb xc xd xe xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz ya yb yc yd ye yf yg yh yi yj yk yl ym yn yo yp yq yr ys yt yu yv yw yx yy yz za zb zc zd ze zf zg zh zi zj zk zl zm zn zo zp zq zr zs zt zu zv zw zx zy zz', - 'cite_references_link_accessibility_label' => 'Yukarı git', - 'cite_references_link_many_accessibility_label' => 'Şuraya git:', ); /** Tatar (Cyrillic script) (татарча) diff --git a/extensions/Cite/Cite.php b/extensions/Cite/Cite.php index 045bb8cc..4b2f70ff 100644 --- a/extensions/Cite/Cite.php +++ b/extensions/Cite/Cite.php @@ -18,6 +18,8 @@ if ( ! defined( 'MEDIAWIKI' ) ) */ $wgHooks['ParserFirstCallInit'][] = 'wfCite'; +$wgHooks['BeforePageDisplay'][] = 'wfCiteBeforePageDisplay'; + $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, @@ -96,4 +98,22 @@ $wgResourceModules['ext.rtlcite'] = $citeResourceTemplate + array( 'position' => 'top', ); +/** + * @param $out OutputPage + * @param $sk Skin + * @return bool + */ +function wfCiteBeforePageDisplay( $out, &$sk ) { + global $wgCiteEnablePopups; + + $out->addModules( 'ext.cite' ); + if ( $wgCiteEnablePopups ) { + $out->addModules( 'ext.cite.popups' ); + } + + /* RTL support quick-fix module */ + $out->addModuleStyles( 'ext.rtlcite' ); + return true; +} + /**#@-*/ diff --git a/extensions/Cite/Cite_body.php b/extensions/Cite/Cite_body.php index 08c60722..27432f47 100644 --- a/extensions/Cite/Cite_body.php +++ b/extensions/Cite/Cite_body.php @@ -155,7 +155,6 @@ class Cite { * @return string */ function ref( $str, $argv, $parser ) { - global $wgCiteEnablePopups; if ( $this->mInCite ) { return htmlspecialchars( "$str" ); } else { @@ -163,12 +162,6 @@ class Cite { $this->mInCite = true; $ret = $this->guardedRef( $str, $argv, $parser ); $this->mInCite = false; - $parserOutput = $parser->getOutput(); - $parserOutput->addModules( 'ext.cite' ); - if ( $wgCiteEnablePopups ) { - $parserOutput->addModules( 'ext.cite.popups' ); - } - $parserOutput->addModuleStyles( 'ext.rtlcite' ); return $ret; } } diff --git a/extensions/Cite/SpecialCite.alias.php b/extensions/Cite/SpecialCite.alias.php index cbcdafbb..8061afcc 100644 --- a/extensions/Cite/SpecialCite.alias.php +++ b/extensions/Cite/SpecialCite.alias.php @@ -74,7 +74,7 @@ $specialPageAliases['ce'] = array( 'Cite' => array( 'Дош' ), ); -/** Czech (čeština) */ +/** Czech (česky) */ $specialPageAliases['cs'] = array( 'Cite' => array( 'Citovat' ), ); diff --git a/extensions/Cite/SpecialCite.i18n.php b/extensions/Cite/SpecialCite.i18n.php index 79665633..635025d4 100644 --- a/extensions/Cite/SpecialCite.i18n.php +++ b/extensions/Cite/SpecialCite.i18n.php @@ -395,7 +395,7 @@ $messages['arz'] = array( * @author Gitartha.bordoloi */ $messages['as'] = array( - 'cite_article_desc' => 'এটা [[Special:Cite|উদ্ধৃতি]] পৃষ্ঠা আৰু এটা সা-সৰঞ্জাম লিংক যোগ কৰে', + 'cite_article_desc' => 'এখন [[Special:Cite|উদ্ধৃতি]] পৃষ্ঠা আৰু এটা টুলবক্স লিংক যোগ কৰে', 'cite_article_link' => 'এই পৃষ্ঠাৰ উদ্ধৃতি দিয়ক', 'tooltip-cite-article' => 'এই পৃষ্ঠাখনৰ উদ্ধৃতি দিয়াৰ বিষয়ে তথ্য', 'cite' => '↓উদ্ধৃত', @@ -1014,7 +1014,6 @@ $messages['cdo'] = array( * @author Умар */ $messages['ce'] = array( - 'cite_article_desc' => 'ГӀирсан тӀе туху [[Special:Cite|дешнаш дало]] белхан агӀо а хьажораг а', 'cite_article_link' => 'АгӀонах лаьцна дешнаш дало', 'tooltip-cite-article' => 'ХӀара бу хаам агӀонах лаьцна дешнаш муха дало деза гойтуш', 'cite' => 'Далийнадош', @@ -1049,7 +1048,7 @@ $messages['co'] = array( 'cite_page' => 'Pagina:', ); -/** Czech (čeština) +/** Czech (česky) * @author Beren * @author Li-sung * @author Martin Kozák @@ -1131,7 +1130,7 @@ Při použití [[LaTeX]]ového balíčku url (někde na začátku dokumentu je u
      ", ); -/** Church Slavic (словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) +/** Church Slavic (словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) * @author ОйЛ */ $messages['cu'] = array( @@ -1286,10 +1285,9 @@ Når du bruger [[LaTeX]] pakkens URL-adressen (\\usepackage{url} et /** German (Deutsch) * @author Kghbln - * @author Purodha */ $messages['de'] = array( - 'cite_article_desc' => 'Erweitert das Wiki um eine [[Special:Cite|Spezialseite]] als Zitierhilfe sowie einen Link darauf im Bereich Werkzeuge', + 'cite_article_desc' => 'Ergänzt eine [[Special:Cite|Spezialseite]] als Zitierhilfe sowie einen zugehörigen Link im Bereich Werkzeuge', 'cite_article_link' => 'Seite zitieren', 'tooltip-cite-article' => 'Hinweis, wie diese Seite zitiert werden kann', 'cite' => 'Zitierhilfe', @@ -1957,77 +1955,6 @@ $messages['frp'] = array( 'cite_submit' => 'Citar', ); -/** Northern Frisian (Nordfriisk) - * @author Murma174 - */ -$messages['frr'] = array( - 'cite_article_desc' => 'Diar komt en nei [[Special:Cite|spezial-sidj]] tu, am sitiarin ianfacher tu maagin, an uk en ferwisang bi a werktjüügen', - 'cite_article_link' => 'Detdiar sidj sitiare', - 'tooltip-cite-article' => 'Hü detdiar sidj sitiaret wurd koon', - 'cite' => 'Sitiare', - 'cite_page' => 'Sidj:', - 'cite_submit' => 'Sitiare', - 'cite_text' => "__NOTOC__ -
      - -== Bibliograafisk dooten för {{FULLPAGENAME}} == - -* Sidj: {{FULLPAGENAME}} -* Skriiwer: {{SITENAME}} contributors -* Ütjden faan: ''{{SITENAME}}, {{int:sitesubtitle}}''. -* Leetst feranrang: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} {{CURRENTTIME}} UTC -* Ufrepen: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} {{CURRENTTIME}} UTC -* Permanent URL: {{canonicalurl:{{FULLPAGENAME}}|oldid={{REVISIONID}}}} -* Sidjenwerjuun ID: {{REVISIONID}} - -
      - ", -); - /** Friulian (furlan) * @author Klenje * @author MF-Warburg @@ -2062,13 +1989,6 @@ $messages['ga'] = array( 'cite_submit' => 'Luaigh', ); -/** Scottish Gaelic (Gàidhlig) - * @author Akerbeltz - */ -$messages['gd'] = array( - 'cite_article_link' => 'Thoir iomradh air an duilleag seo', -); - /** Galician (galego) * @author Toliño * @author Xosé @@ -3665,7 +3585,6 @@ $messages['kw'] = array( ); /** Latin (Latina) - * @author Autokrator * @author MissPetticoats * @author SPQRobin * @author UV @@ -3673,26 +3592,17 @@ $messages['kw'] = array( $messages['la'] = array( 'cite_article_desc' => ' Addet [[Special:Cite|citation]] specialem paginam et arcam instrumenti', # Fuzzy 'cite_article_link' => 'Hanc paginam citare', - 'tooltip-cite-article' => 'Institutiones de hanc pagina citanda', 'cite' => 'Paginam citare', 'cite_page' => 'Pagina:', 'cite_submit' => 'Citare', ); -/** Ladino (Ladino) - * @author Menachem.Moreira - */ -$messages['lad'] = array( - 'cite_page' => 'Pajina:', -); - /** Luxembourgish (Lëtzebuergesch) * @author Kaffi * @author Robby - * @author Soued031 */ $messages['lb'] = array( - 'cite_article_desc' => "Setzt eng [[Special:Cite|Zitatioun op dëser Spezialsäit]] bei an e Link an d'Geschiirkëscht", + 'cite_article_desc' => "Setzt eng [[Special:Cite|Zitatioun op dëser Spezialsäit]] bäi an e Link an d'Geschiirkëscht", 'cite_article_link' => 'Dës Säit zitéieren', 'tooltip-cite-article' => 'Informatioune wéi een dës Säit zitéiere kann', 'cite' => 'Zitéierhëllef', @@ -3816,15 +3726,10 @@ $messages['lo'] = array( ); /** لوری (لوری) - * @author Bonevarluri * @author Mogoeilor */ $messages['lrc'] = array( - 'cite_article_link' => 'جاگه ای بلگه', - 'tooltip-cite-article' => 'دونسمنیا چه جور دای بلگه جاگر بوئه', - 'cite' => 'جاگه', 'cite_page' => 'بلگه', - 'cite_submit' => 'جاگه', ); /** Lithuanian (lietuvių) @@ -4181,7 +4086,7 @@ $messages['mn'] = array( * @author V.narsikar */ $messages['mr'] = array( - 'cite_article_desc' => 'एक [[Special:Cite|बाह्यदुवे]] देणारे विशेषपान व साधनपेटीचा दुवा जोडते', + 'cite_article_desc' => 'एक विशेष [[Special:Cite|बाह्यदुवे]] देणारे पान व टूलबॉक्सची लिंक तयार करा', 'cite_article_link' => 'हे पान उधृत करा', 'tooltip-cite-article' => 'हे पृष्ठ बघण्यासाठीची माहिती', 'cite' => 'उधृत करा', @@ -5506,16 +5411,6 @@ $messages['sgs'] = array( 'cite_page' => 'Poslapis:', ); -/** Serbo-Croatian (srpskohrvatski / српскохрватски) - * @author Kolega2357 - */ -$messages['sh'] = array( - 'cite_article_link' => 'Citiraj ovaj članak', - 'cite' => 'Citiraj', - 'cite_page' => 'Stranica:', - 'cite_submit' => 'Citiraj - Цитирај', -); - /** Sinhala (සිංහල) * @author Budhajeewa * @author නන්දිමිතුරු @@ -5685,7 +5580,6 @@ When using the [[LaTeX]] package url (\\usepackage{url} somewhere i ); /** Serbian (Cyrillic script) (српски (ћирилица)‎) - * @author Milicevic01 * @author Millosh * @author Rancher * @author Sasa Stefanovic @@ -5694,144 +5588,25 @@ When using the [[LaTeX]] package url (\\usepackage{url} somewhere i */ $messages['sr-ec'] = array( 'cite_article_desc' => 'Додаје посебну страницу за [[Special:Cite|цитирање]] и везу с алаткама', - 'cite_article_link' => 'Цитирај ову страницу', + 'cite_article_link' => 'Библиографски подаци', 'tooltip-cite-article' => 'Информације о томе како цитирати ову страну', - 'cite' => 'Цитирање', + 'cite' => 'цитат', 'cite_page' => 'Страница:', - 'cite_submit' => 'Цитирај', - 'cite_text' => "__NOTOC__ -
      - -== Библиографски детаљи за страну {{FULLPAGENAME}} == - -* Назив стране: {{FULLPAGENAME}} -* Аутор: {{SITENAME}} сарадници -* Издавач: ''{{SITENAME}}, {{int:sitesubtitle}}''. -* Датум последње ревизије: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} {{CURRENTTIME}} UTC -* Датум узимања: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} {{CURRENTTIME}} UTC -* Стални URL: {{fullurl:{{FULLPAGENAME}}|oldid={{REVISIONID}}}} -* ID верзије стране: {{REVISIONID}} - -
      -", + 'cite_submit' => 'цитат', ); /** Serbian (Latin script) (srpski (latinica)‎) * @author Liangent * @author Michaello - * @author Milicevic01 * @author Жељко Тодоровић */ $messages['sr-el'] = array( 'cite_article_desc' => 'Dodaje specijalnu stranu za [[Special:Cite|citiranje]] i vezu ka oruđima.', - 'cite_article_link' => 'Citiraj ovu stranicu', + 'cite_article_link' => 'citiranje ove strane', 'tooltip-cite-article' => 'Informacije o tome kako citirati ovu stranu', - 'cite' => 'Citiranje', + 'cite' => 'citat', 'cite_page' => 'Stranica:', - 'cite_submit' => 'Citiraj', - 'cite_text' => "__NOTOC__ -
      - -== Bibliografski detalji za stranu {{FULLPAGENAME}} == - -* Naziv strane: {{FULLPAGENAME}} -* Autor: {{SITENAME}} saradnici -* Izdavač: ''{{SITENAME}}, {{int:sitesubtitle}}''. -* Datum poslednje revizije: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} {{CURRENTTIME}} UTC -* Datum uzimanja: {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}} {{CURRENTTIME}} UTC -* Stalni URL: {{fullurl:{{FULLPAGENAME}}|oldid={{REVISIONID}}}} -* ID verzije strane: {{REVISIONID}} - -
      -", + 'cite_submit' => 'citat', ); /** Seeltersk (Seeltersk) diff --git a/extensions/Cite/citeParserTests.txt b/extensions/Cite/citeParserTests.txt index 052cd56a..3076eeb6 100644 --- a/extensions/Cite/citeParserTests.txt +++ b/extensions/Cite/citeParserTests.txt @@ -311,20 +311,16 @@ AAAref aBBBnote bCCC[参 1]BBB[注 1]CCC[参 2]

      -
      -
      refs -
      -
      +
      refs +
      1. ref a
      2. ref c
      -
      -
      notes -
      -
      +
      notes +
      1. note b
      2. diff --git a/extensions/ConfirmEdit/.gitreview b/extensions/ConfirmEdit/.gitreview deleted file mode 100644 index 780d35df..00000000 --- a/extensions/ConfirmEdit/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/ConfirmEdit.git -defaultbranch=master diff --git a/extensions/ConfirmEdit/Asirra.i18n.php b/extensions/ConfirmEdit/Asirra.i18n.php index 451107bb..23190c29 100644 --- a/extensions/ConfirmEdit/Asirra.i18n.php +++ b/extensions/ConfirmEdit/Asirra.i18n.php @@ -76,28 +76,10 @@ $messages['be-tarask'] = array( * @author Fohanno */ $messages['br'] = array( - 'asirra-desc' => 'Modulenn Asirra evit ConfirmEdit', - 'asirra-edit' => 'Evit sikour da wareziñ ar wiki diouzh ar stroboù emgefre, diuzit ar skeudennoù kizhier er voest dindan :', 'asirra-nojs' => "'''Gweredekait JavaScript, mar plij, hag adkasit ar bajenn.'''", - 'asirra-failed' => 'Diuzit an holl skeudennoù kizhier, mar plij', ); -/** Catalan (català) - * @author Toniher - */ -$messages['ca'] = array( - 'asirra-desc' => 'Mòdul Asirra de ConfirmEdit', - 'asirra-edit' => 'Per tal de protegir el wiki contra les edicions brosses, us demanem que seleccioneu només les fotos de gats del requadre a continuació:', - 'asirra-addurl' => "La modificació inclou nous enllaços externs. Per tal de protegir el wiki davant d'edicions brossa, us demanem que seleccioneu només les fotos de gots del requadre a continuació:", - 'asirra-badlogin' => 'Per tal de protegir el wiki contra els intents de trencament de contrasenyes, us demanem que seleccioneu només les fotos de gats del requadre a continuació:', - 'asirra-createaccount' => 'Per tal de protegir el wiki contra la creació automatitzada de comptes, us demanem que seleccioneu només les fotos de gats del requadre a continuació:', - 'asirra-createaccount-fail' => 'Identifiqueu correctament els gats.', - 'asirra-create' => 'Per tal de protegir el wiki contra la creació automàtica de pàgines, us demanem que seleccioneu només les fotos de gats del requadre a continuació:', - 'asirra-nojs' => "'''Habilitieu el JavaScript i torneu a enviar la pàgina.'''", - 'asirra-failed' => 'Identifiqueu totes les imatges de gats', -); - -/** Czech (čeština) +/** Czech (česky) * @author Vks */ $messages['cs'] = array( @@ -141,35 +123,19 @@ $messages['diq'] = array( /** Spanish (español) * @author Armando-Martin - * @author Ciencia Al Poder */ $messages['es'] = array( 'asirra-desc' => 'Módulo de Asirra para ConfirmEdit', 'asirra-edit' => 'Para ayudar a protegernos contra el spam de edición automática, seleccione sólo las fotos de gatos en el cuadro siguiente:', # Fuzzy - 'asirra-addurl' => 'Tu edición incluye nuevos enlaces externos. Para proteger el wiki contra el spam automatizado, por favor, te pedimos que selecciones solo las fotos de gatos en el cuadro siguiente:', - 'asirra-badlogin' => 'Para proteger el wiki contra el robo automatizado de contraseñas, te pedimos por favor que selecciones únicamente las fotos de gatos en el cuadro siguiente:', - 'asirra-createaccount' => 'Para proteger el wiki contra la creación automatizada de cuentas de usuario, te pedimos por favor que selecciones únicamente las fotos de gatos en el cuadro siguiente:', + 'asirra-addurl' => 'Su edición incluye nuevos enlaces externos. Para ayudar a protegernos contra el spam automatizado, por favor, seleccione solo las fotos de gato en el cuadro siguiente:', # Fuzzy + 'asirra-badlogin' => 'Para ayudar a protegernos del robo automatizado de contraseñas, seleccione sólo las fotos de gatos en el cuadro siguiente:', # Fuzzy + 'asirra-createaccount' => 'Para ayudar a protegernos contra la creación automatizada de cuentas, seleccione sólo las fotos de gato en el cuadro siguiente:', # Fuzzy 'asirra-createaccount-fail' => 'Identifique correctamente los gatos.', - 'asirra-create' => 'Para proteger el wiki contra la creación automatizada de páginas, te pedimos por favor que selecciones únicamente las fotos de gatos en el cuadro siguiente:', + 'asirra-create' => 'Para ayudar a protegernos contra la creación automática de páginas, seleccione sólo las fotos de gato en el cuadro siguiente:', # Fuzzy 'asirra-nojs' => "'''Por favor active JavaScript y vuelva a la página.'''", 'asirra-failed' => 'Identifique todas las imágenes de gatos', ); -/** Persian (فارسی) - * @author Armin1392 - */ -$messages['fa'] = array( - 'asirra-desc' => 'بخش آسیرا برای تایید ویرایش', - 'asirra-edit' => ' برای محافظت ویکی دربرابر ویرایش خودکار اسپم، ما دوستانه از شما درخواست می‌کنیم که تنها عکس‌های گربه را در جعبهٔ زیر انتخاب کنید:', - 'asirra-addurl' => 'ویرایش شما شامل لینک‌های خارجی جدید است.برای محافظت ویکی دربرابر ویرایش خودکار اسپم، ما دوستانه از شما درخواست می‌کنیم که تنها عکس‌های گربه را در جعبهٔ زیر انتخاب کنید:', - 'asirra-badlogin' => 'برای محافظت ویکی دربرابر رخنه به رمز‌ عبور به طور خودکار، ما دوستانه از شما درخواست می‌کنیم که تنها عکس‌های گربه را در جعبهٔ زیر انتخاب کنید:', - 'asirra-createaccount' => 'برای محافظت ویکی دربرابر ایجاد حساب به طور خودکار، ما دوستانه از شما درخواست می‌کنیم که تنها عکس‌های گربه را در جعبهٔ زیر انتخاب کنید:', - 'asirra-createaccount-fail' => 'لطفاً این گربه‌ها را به درستی شناسایی کنید.', - 'asirra-create' => 'برای محافظت ویکی دربرابر ایجاد صفحه به طور خودکار، ما دوستانه از شما درخواست می‌کنیم که تنها عکس‌های گربه را در جعبهٔ زیر انتخاب کنید:', - 'asirra-nojs' => "'''لطفاً جاوااسکریپت را فعال کنید و صفحه را دوباره ارائه کنید.'''", - 'asirra-failed' => 'لطفاً همهٔ عکس‌های گربه را شناسایی کنید', -); - /** Finnish (suomi) * @author VezonThunder */ @@ -217,33 +183,17 @@ $messages['gl'] = array( 'asirra-failed' => 'Identifique todas as fotos de gatos', ); -/** Hebrew (עברית) - * @author Yona b - * @author ערן - */ -$messages['he'] = array( - 'asirra-desc' => 'מודול Asirra לאישור עריכה (ConfirmEdit)', - 'asirra-edit' => 'כדי להגן על הוויקי מעריכות ספאם אוטומטיות, נבקשך לבחור רק את תמונות החתולים בתיבה שלהלן:', - 'asirra-addurl' => 'העריכה שלך כוללת קישורים חיצוניים חדשים. כדי להגן על הויקי מעריכות ספאם אוטומטיות, נבקשך לבחור רק את תמונות החתולים בתיבה שלהלן:', - 'asirra-badlogin' => 'כדי להגן על הוויקי מפיצוח אוטומטי של סיסמאות, נבקשך לבחור רק את תמונות החתולים בתיבה שלהלן:', - 'asirra-createaccount' => 'כדי להגן על הוויקי מפני יצירה אוטומטית של חשבונות, נבקשך לבחור רק את תמונות החתולים בתיבה שלהלן:', - 'asirra-createaccount-fail' => 'יש לזהות כראוי את החתולים.', - 'asirra-create' => 'כדי להגן על הוויקי מפני יצירה אוטומטית של דפים, נבקשך לבחור רק את תמונות החתולים בתיבה שלהלן:', - 'asirra-nojs' => "'''יש לאפשר JavaScript ולשלוח מחדש את הדף.'''", - 'asirra-failed' => 'יש לזהות את כל תמונות החתולים', -); - /** Upper Sorbian (hornjoserbsce) * @author Michawiki */ $messages['hsb'] = array( 'asirra-desc' => 'Modul Asirra za ConfirmEdit', - 'asirra-edit' => 'Za škit přećiwo awtomatizowanemu spamej, prošu wubjer jenož fota kóčkow w slědowacym polu:', - 'asirra-addurl' => 'Twoja změna wobsahuje nowe eksterne wotkazy. Za škit přećiwo awtomatizowanemu spamej, prošu wubjer jenož fota kóčkow w slědowacym polu:', - 'asirra-badlogin' => 'Za škit přećiwo awtomatizowanemu złamanju hesłow, prošu wubjer jenož fota kóčkow w slědowacym polu:', - 'asirra-createaccount' => 'Za škit přećiwo awtomatiskemu wutworjenju konta, prošu wubjer jenož fota kóčkow w slědowacym polu:', + 'asirra-edit' => 'Za škit přećiwo awtomatizowanemu spamej, prošu wubjer jenož fota kóčkow w slědowacym polu:', # Fuzzy + 'asirra-addurl' => 'Twoja změna wobsahuje nowe eksterne wotkazy. Za škit přećiwo awtomatizowanemu spamej, prošu wubjer jenož fota kóčkow w slědowacym polu:', # Fuzzy + 'asirra-badlogin' => 'Za škit přećiwo awtomatizowanemu złamanju hesłow, prošu wubjer jenož fota kóčkow w slědowacym polu:', # Fuzzy + 'asirra-createaccount' => 'Za škit přećiwo awtomatiskemu wutworjenju konta, prošu wubjer jenož fota kóčkow w slědowacym polu:', # Fuzzy 'asirra-createaccount-fail' => 'Prošu identifikuj kóčki.', - 'asirra-create' => 'Za škit přećiwo awtomatiskemu wutworjenju strony, prošu wubjer jenož fota kóčkow w slědowacym polu:', + 'asirra-create' => 'Za škit přećiwo awtomatiskemu wutworjenju strony, prošu wubjer jenož fota kóčkow w slědowacym polu:', # Fuzzy 'asirra-nojs' => "'''Prošu zmóžń JavaScript a składuj stronu hišće raz.'''", 'asirra-failed' => 'Prošu identifikuj wšě wobrazy z kóčkami', ); @@ -295,17 +245,16 @@ $messages['ja'] = array( ); /** Korean (한국어) - * @author Hym411 * @author 아라 */ $messages['ko'] = array( 'asirra-desc' => 'ConfirmEdit에 대한 Asirra 모듈', - 'asirra-edit' => '자동화된 편집 스팸으로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', - 'asirra-addurl' => '편집에 새로운 바깥 링크가 포함되어 있습니다. 자동화된 스팸으로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', - 'asirra-badlogin' => '자동화된 비밀번호 크래킹으로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', - 'asirra-createaccount' => '자동화된 계정 만들기로부터 위키를 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', + 'asirra-edit' => '자동화된 편집 스팸으로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', # Fuzzy + 'asirra-addurl' => '편집에 새로운 바깥 링크가 포함되어 있습니다. 자동화된 스팸으로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', # Fuzzy + 'asirra-badlogin' => '비밀번호 깨기로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', # Fuzzy + 'asirra-createaccount' => '자동화된 계정 만들기로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', # Fuzzy 'asirra-createaccount-fail' => '고양이를 올바르게 선택하세요.', - 'asirra-create' => '자동화된 문서 만들기로부터 위키를 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', + 'asirra-create' => '자동화된 문서 만들기로부터 보호하기 위해, 아래 상자에 있는 고양이 사진을 선택하세요:', # Fuzzy 'asirra-nojs' => "'''자바스크립트를 활성화하고 문서를 다시 제출하세요.'''", 'asirra-failed' => '고양이 그림을 모두 선택하세요', ); @@ -472,12 +421,12 @@ $messages['pt'] = array( */ $messages['roa-tara'] = array( 'asirra-desc' => 'Module Asirra pe confermà le cangiaminde', - 'asirra-edit' => "Pe proteggere condre le cangiaminde automatece de le rummate, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:", - 'asirra-addurl' => "Le cangiaminde tune 'ngludone collegaminde de fore nuève. Pe proteggere condre le cangiaminde automatece de le rummate, pe piacere scacchie 'a categorije d'a fote 'ndruche jndr'à buatte aqquà sotte:", - 'asirra-badlogin' => "Pe proteggere condre le futteminde automatece de le passuord, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:", - 'asirra-createaccount' => "Pe proteggere condre le ccrejaziune automatece de le cunde, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:", + 'asirra-edit' => "Pe darne 'na màne a proteggere condre le cangiaminde automatece de le rummate, pe piacere scacchie ìa categorije de le fote jndr'à buatte aqquà sotte:", # Fuzzy + 'asirra-addurl' => "Le cangiaminde tune 'ngludone collegaminde de fore nuève. Pe darne 'na màne a proteggere condre le cangiaminde automatece de le rummate, pe piacere scacchie 'a categorije d'a fote 'ndruche jndr'à buatte aqquà sotte:", # Fuzzy + 'asirra-badlogin' => "Pe darne 'na màne a proteggere condre le futteminde automatece de le passuord, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:", # Fuzzy + 'asirra-createaccount' => "Pe darne 'na màne a proteggere condre le ccrejaziune automatece de le cunde, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:", # Fuzzy 'asirra-createaccount-fail' => 'Pe piacere idendifiche correttamende le categorije.', - 'asirra-create' => "Pe proteggere condre le ccrejaziune automatece de le pàggene, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:", + 'asirra-create' => "Pe darne 'na màne a proteggere condre le ccrejaziune automatece de le pàggene, pe piacere scacchie 'a categorije de le fote jndr'à buatte aqquà sotte:", # Fuzzy 'asirra-nojs' => "'''Pe piacere abbilite JavaScript e conferme arrete 'a pàgene.'''", 'asirra-failed' => 'Pe piacere idendifiche tutte le categorije de le immaggine', ); @@ -510,7 +459,6 @@ $messages['si'] = array( /** Swedish (svenska) * @author Jopparn * @author Rotsee - * @author Tobulos1 * @author WikiPhoenix */ $messages['sv'] = array( @@ -518,7 +466,6 @@ $messages['sv'] = array( 'asirra-addurl' => 'Din redigering innehåller nya externa länkar. För att skydda wikin mot automatiserat redigerings-spam ber vi dig att endast markera fotografierna på katter i rutan nedan:', 'asirra-badlogin' => 'För att skydda wikin mot automatiserade försök att knäcka lösenord ber vi dig att endast markera fotografierna på katter i rutan nedan:', 'asirra-createaccount' => 'För att skydda wikin mot automatiserat kontoskapande ber vi dig att endast markera fotografierna på katter i rutan nedan:', - 'asirra-createaccount-fail' => 'Vänligen identifiera katterna korrekt.', 'asirra-create' => 'För att skydda wikin mot automatiserat sidskapande ber vi dig att endast markera fotografierna på katter i rutan nedan:', 'asirra-nojs' => "'''Var god aktivera JavaScript och hämta sidan igen.'''", 'asirra-failed' => 'Var god identifiera alla kattbilder', diff --git a/extensions/ConfirmEdit/Captcha.php b/extensions/ConfirmEdit/Captcha.php index 20b2dfd4..3be6d917 100644 --- a/extensions/ConfirmEdit/Captcha.php +++ b/extensions/ConfirmEdit/Captcha.php @@ -355,38 +355,26 @@ class SimpleCaptcha { */ function filterLink( $url ) { global $wgCaptchaWhitelist; - static $regexes = null; + $source = wfMessage( 'captcha-addurl-whitelist' )->inContentLanguage()->text(); - if ( $regexes === null ) { - $source = wfMessage( 'captcha-addurl-whitelist' )->inContentLanguage(); + $whitelist = wfMessage( 'captcha-addurl-whitelist', $source )->isDisabled() + ? false + : $this->buildRegexes( explode( "\n", $source ) ); - $regexes = $source->isDisabled() - ? array() - : $this->buildRegexes( explode( "\n", $source->plain() ) ); + $cwl = $wgCaptchaWhitelist !== false ? preg_match( $wgCaptchaWhitelist, $url ) : false; + $wl = $whitelist !== false ? preg_match( $whitelist, $url ) : false; - if ( $wgCaptchaWhitelist !== false ) { - array_unshift( $regexes, $wgCaptchaWhitelist ); - } - } - - foreach ( $regexes as $regex ) { - if ( preg_match( $regex, $url ) ) { - return false; - } - } - - return true; + return !( $cwl || $wl ); } /** * Build regex from whitelist * @param $lines string from [[MediaWiki:Captcha-addurl-whitelist]] - * @return array Regexes + * @return string Regex or bool false if whitelist is empty * @access private */ function buildRegexes( $lines ) { # Code duplicated from the SpamBlacklist extension (r19197) - # and later modified. # Strip comments and whitespace, then remove blanks $lines = array_filter( array_map( 'trim', preg_replace( '/#.*$/', '', $lines ) ) ); @@ -394,59 +382,34 @@ class SimpleCaptcha { # No lines, don't make a regex which will match everything if ( count( $lines ) == 0 ) { wfDebug( "No lines\n" ); - return array(); + return false; } else { # Make regex # It's faster using the S modifier even though it will usually only be run once // $regex = 'http://+[a-z0-9_\-.]*(' . implode( '|', $lines ) . ')'; // return '/' . str_replace( '/', '\/', preg_replace('|\\\*/|', '/', $regex) ) . '/Si'; - $regexes = array(); - $regexStart = array( - 'normal' => '/^https?:\/\/+[a-z0-9_\-.]*(?:', - 'noprotocol' => '/^(?:', - ); - $regexEnd = array( - 'normal' => ')/Si', - 'noprotocol' => ')/Si', - ); + $regexes = ''; + $regexStart = '/^https?:\/\/+[a-z0-9_\-.]*('; + $regexEnd = ')/Si'; $regexMax = 4096; - $build = array(); + $build = false; foreach ( $lines as $line ) { - # Extract flags from the line - $options = array(); - if ( preg_match( '/^(.*?)\s*<([^<>]*)>$/', $line, $matches ) ) { - if ( $matches[1] === '' ) { - wfDebug( "Line with empty regex\n" ); - continue; - } - $line = $matches[1]; - $opts = preg_split( '/\s*\|\s*/', trim( $matches[2] ) ); - foreach ( $opts as $opt ) { - $opt = strtolower( $opt ); - if ( $opt == 'noprotocol' ) { - $options['noprotocol'] = true; - } - } - } - - $key = isset( $options['noprotocol'] ) ? 'noprotocol' : 'normal'; - // FIXME: not very robust size check, but should work. :) - if ( !isset( $build[$key] ) ) { - $build[$key] = $line; - } elseif ( strlen( $build[$key] ) + strlen( $line ) > $regexMax ) { - $regexes[] = $regexStart[$key] . - str_replace( '/', '\/', preg_replace( '|\\\*/|', '/', $build[$key] ) ) . - $regexEnd[$key]; - $build[$key] = $line; + if ( $build === false ) { + $build = $line; + } elseif ( strlen( $build ) + strlen( $line ) > $regexMax ) { + $regexes .= $regexStart . + str_replace( '/', '\/', preg_replace( '|\\\*/|', '/', $build ) ) . + $regexEnd; + $build = $line; } else { - $build[$key] .= '|' . $line; + $build .= '|' . $line; } } - foreach ( $build as $key => $value ) { - $regexes[] = $regexStart[$key] . - str_replace( '/', '\/', preg_replace( '|\\\*/|', '/', $build[$key] ) ) . - $regexEnd[$key]; + if ( $build !== false ) { + $regexes .= $regexStart . + str_replace( '/', '\/', preg_replace( '|\\\*/|', '/', $build ) ) . + $regexEnd; } return $regexes; } @@ -537,42 +500,25 @@ class SimpleCaptcha { * Hook for user creation form submissions. * @param User $u * @param string $message - * @param Status $status * @return bool true to continue, false to abort user creation */ - function confirmUserCreate( $u, &$message, &$status = null ) { - if ( $this->needCreateAccountCaptcha() ) { - $this->trigger = "new account '" . $u->getName() . "'"; - if ( !$this->passCaptcha() ) { - // For older MediaWiki - $message = wfMessage( 'captcha-createaccount-fail' )->text(); - // For MediaWiki 1.23+ - $status = Status::newFatal( 'captcha-createaccount-fail' ); - return false; - } - } - return true; - } - - /** - * Logic to check if we need to pass a captcha for the current user - * to create a new account, or not - * - * @return bool true to show captcha, false to skip captcha - */ - function needCreateAccountCaptcha() { + function confirmUserCreate( $u, &$message ) { global $wgCaptchaTriggers, $wgUser; if ( $wgCaptchaTriggers['createaccount'] ) { if ( $wgUser->isAllowed( 'skipcaptcha' ) ) { wfDebug( "ConfirmEdit: user group allows skipping captcha on account creation\n" ); - return false; + return true; } - if ( $this->isIPWhitelisted() ) { + if ( $this->isIPWhitelisted() ) + return true; + + $this->trigger = "new account '" . $u->getName() . "'"; + if ( !$this->passCaptcha() ) { + $message = wfMessage( 'captcha-createaccount-fail' )->text(); return false; } - return true; } - return false; + return true; } /** @@ -636,7 +582,7 @@ class SimpleCaptcha { * @return bool */ protected function isAPICaptchaModule( $module ) { - return $module instanceof ApiEditPage || $module instanceof ApiCreateAccount; + return $module instanceof ApiEditPage; } /** @@ -787,50 +733,4 @@ class SimpleCaptcha { $wgOut->addWikiMsg( 'captchahelp-cookies-needed' ); } } - - /** - * Pass API captcha parameters on to the login form when using - * API account creation. - * - * @param ApiCreateAccount $apiModule - * @param LoginForm $loginForm - * @return hook return value - */ - function addNewAccountApiForm( $apiModule, $loginForm ) { - global $wgRequest; - $main = $apiModule->getMain(); - - $id = $main->getVal( 'captchaid' ); - if ( $id ) { - $wgRequest->setVal( 'wpCaptchaId', $id ); - - // Suppress "unrecognized parameter" warning: - $main->getVal( 'wpCaptchaId' ); - } - - $word = $main->getVal( 'captchaword' ); - if ( $word ) { - $wgRequest->setVal( 'wpCaptchaWord', $word ); - - // Suppress "unrecognized parameter" warning: - $main->getVal( 'wpCaptchaWord' ); - } - - return true; - } - - /** - * Pass extra data back in API results for account creation. - * - * @param ApiCreateAccount $apiModule - * @param LoginForm &loginForm - * @param array &$params - * @return hook return value - */ - function addNewAccountApiResult( $apiModule, $loginPage, &$result ) { - if ( $result['result'] !== 'Success' && $this->needCreateAccountCaptcha() ) { - $this->addCaptchaAPI( $result ); - } - return true; - } } diff --git a/extensions/ConfirmEdit/ConfirmEdit.i18n.php b/extensions/ConfirmEdit/ConfirmEdit.i18n.php index 21a451e1..e5e4c6bf 100644 --- a/extensions/ConfirmEdit/ConfirmEdit.i18n.php +++ b/extensions/ConfirmEdit/ConfirmEdit.i18n.php @@ -16,11 +16,11 @@ $messages['en'] = array( To protect the wiki against automated spam, we kindly ask you to solve the simple sum below and enter the answer in the box in order to save your edit ([[Special:Captcha/help|more info]]):', 'captcha-badlogin' => 'To protect the wiki against automated password cracking, we kindly ask you to solve the simple sum below and enter the answer in the box ([[Special:Captcha/help|more info]]):', 'captcha-createaccount' => 'To protect the wiki against automated account creation, we kindly ask you to solve the simple sum below and enter the answer in the box ([[Special:Captcha/help|more info]]):', - 'captcha-createaccount-fail' => 'Incorrect or missing CAPTCHA.', + 'captcha-createaccount-fail' => 'Incorrect or missing confirmation code.', 'captcha-create' => 'To create the page, please solve the simple sum below and enter the answer in the box ([[Special:Captcha/help|more info]]):', 'captcha-sendemail' => 'To protect the wiki against automated spamming, we kindly ask you to solve the simple sum below and enter the answer in the box ([[Special:Captcha/help|more info]]):', - 'captcha-sendemail-fail' => 'Incorrect or missing CAPTCHA.', - 'captcha-disabledinapi' => 'This action requires a CAPTCHA, so it cannot be performed through the API.', + 'captcha-sendemail-fail' => 'Incorrect or missing confirmation code.', + 'captcha-disabledinapi' => 'This action requires a captcha, so it cannot be performed through the API.', 'captchahelp-title' => 'CAPTCHA help', 'captchahelp-cookies-needed' => 'You will need to have cookies enabled in your browser for this to work.', 'captchahelp-text' => "Web sites that accept postings from the public, like this wiki, are often abused by spammers who use automated tools to post their links to many sites. @@ -31,7 +31,7 @@ Since this is a task that's hard to automate, it will allow most real humans to Unfortunately this may inconvenience users with limited vision or using text-based or speech-based browsers. At the moment we do not have an audio alternative available. -Please contact the [[Special:ListAdmins|site administrators]] for assistance if this is unexpectedly preventing you from making legitimate actions. +Please contact the [[Special:ListAdmins|site administrators]] for assistance if this is unexpectedly preventing you from making legitimate actions. Hit the \"back\" button in your browser to return to the page editor.", 'captcha-addurl-whitelist' => ' #
        @@ -213,11 +213,11 @@ $messages['ar'] = array(
         للمساعدة في الحماية من السبام الأوتوماتيكي، من فضلك حل عملية الجمع بالأسفل وأدخل الإجابة في الصندوق لكي يتم حفظ تعديلك ([[Special:Captcha/help|مزيد من المعلومات]]):',
         	'captcha-badlogin' => 'للمساعدة في الحماية ضد سرقة كلمات السر، من فضلك حل عملية الجمع البسيطة بالأسفل وأدخل الحل في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):',
         	'captcha-createaccount' => 'كحماية ضد إنشاء الحسابات الأوتوماتيكي، من فضلك حل عملية الجمع البسيطة بالأسفل وأدخل الإجابة في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):',
        -	'captcha-createaccount-fail' => 'كابتشا غير صحيحة أو مفقودة.',
        +	'captcha-createaccount-fail' => 'كود تأكيد غير صحيح أو مفقود.',
         	'captcha-create' => 'لإنشاء هذه الصفحة، من فضلك حل المسألة الرياضية التالية وأدخل
         الإجابة في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):',
         	'captcha-sendemail' => 'للمساعدة في الحماية ضد السخام الأتوماتيكي، من فضلك حل عملية الجمع البسيطة بالأسفل وأدخل الإجابة في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):',
        -	'captcha-sendemail-fail' => 'كابتشا غير صحيحة أو مفقودة.',
        +	'captcha-sendemail-fail' => 'كود تأكيد غير صحيح أو مفقود',
         	'captcha-disabledinapi' => 'هذا الإجراء يتطلب تحقيق , لذلك لايمكن أعتمادها من API.',
         	'captchahelp-title' => 'مساعدة الكابتشا',
         	'captchahelp-cookies-needed' => 'ستحتاج إلى أن تكون الكوكيز مفعلة في متصفحك لكي يعمل هذا',
        @@ -330,10 +330,10 @@ $messages['ast'] = array(
         	'captcha-addurl' => "La to edición inclúi nuevos enllaces esternos. Pa protexer la wiki escontra'l spam automatizáu, pidimoste por favor que resuelvas la suma simple d'embaxo y pongas la rempuesta na caxella pa guardar la edición ([[Special:Captcha/help|más información]]):",
         	'captcha-badlogin' => "Pa protexer la wiki escontra'l descifráu automáticu de claves, pidimoste por favor que resuelvas la suma simple d'embaxo y pongas la rempuesta na caxella ([[Special:Captcha/help|más información]]):",
         	'captcha-createaccount' => "Pa protexer la wiki escontra la creación automática de cuentes, pidimoste por favor que resuelvas la suma simple d'embaxo y pongas la rempuesta na caxella ([[Special:Captcha/help|más información]]):",
        -	'captcha-createaccount-fail' => 'CAPTCHA incorreutu o ausente.',
        +	'captcha-createaccount-fail' => 'Códigu de confirmación incorreutu o ausente.',
         	'captcha-create' => "Pa crear la páxina, por favor resuelvi la suma simple d'embaxo y pon la rempuesta nel caxellu ([[Special:Captcha/help|más información]]):",
         	'captcha-sendemail' => "Pa protexer la wiki escontra la puxarra automatizada, pidimoste por favor que resuelvas la suma cenciella d'embaxo y pongas la rempuesta na caxella ([[Special:Captcha/help|más información]]):",
        -	'captcha-sendemail-fail' => 'CAPTCHA incorreutu o ausente.',
        +	'captcha-sendemail-fail' => 'Códigu de confirmación incorreutu o ausente.',
         	'captcha-disabledinapi' => 'Esta aición requier un captcha y, poro, nun pue facese pel API',
         	'captchahelp-title' => 'Ayuda tocante al CAPTCHA',
         	'captchahelp-cookies-needed' => "Has tener les cookies habilitaes nel to navegador pa que'l sistema funcione.",
        @@ -600,7 +600,6 @@ $messages['bn'] = array(
         
         /** Breton (brezhoneg)
          * @author BrokenArrow
        - * @author Fohanno
          * @author Fulup
          * @author VIGNERON
          * @author Y-M D
        @@ -609,13 +608,13 @@ $messages['br'] = array(
         	'captcha-edit' => "A-raok gellout kemmañ ar bajenn-mañ e c'houlenner ouzhoc'h respont d'ar jedadenn eeun a-is ha lakaat an disoc'h er vaezienn ([[Special:Captcha/help|Petra eo se?]])",
         	'captcha-desc' => 'Pourchas a ra teknikoù CAPTCHA evit en em wareziñ diouzh ar strob hag an diskuliañ gerioù-tremen',
         	'captcha-label' => 'CAPTCHA',
        -	'captcha-addurl' => "Liammoù diavaez nevez zo bet ouzhpennet ganeoc'h. A-benn talañ ouzh ar strob emgefre skrivit disoc'h ar jedadennig eeun-mañ er stern : 
        ([[Special:Captcha/help|Petra eo se?]])", - 'captcha-badlogin' => "A-benn talañ ouzh preizhadur emgefre ar gerioù-tremen e c'houlenner ouzhoc'h jediñ an tamm oberiadenn ha skrivañ an disoc'h anezhi er vaezienn a-is ([[Special:Captcha/help|Petra eo se ?]]):", - 'captcha-createaccount' => "A-benn hor sikour da dalañ ouzh ar c'hrouiñ kontoù emgefre, jedit an tamm oberiadenn ha skrivañ an disoc'h anezhi er vaezienn a-is ([[Special:Captcha/help|gouzout hiroc'h]]) :", - 'captcha-createaccount-fail' => "Pe e vank ar c'hod CAPTCHA pe ez eo fall.", + 'captcha-addurl' => "Liammoù diavaez nevez zo bet ouzhpennet ganeoc'h. A-benn talañ ouzh ar strob emgefre skrivit disoc'h ar jedadennig eeun-mañ er stern :
        ([[Special:Captcha/help|Petra eo se?]])", # Fuzzy + 'captcha-badlogin' => "A-benn talañ ouzh preizhadur emgefre ar gerioù-tremen gant ar botoù e c'houlenner ouzhoc'h jediñ an tamm oberiadenn ha skrivañ an disoc'h anezhi er vaezienn a-is ([[Special:Captcha/help|Petra eo se ?]]):", # Fuzzy + 'captcha-createaccount' => "A-benn hor skoazellañ da dalañ ouzh ar c'hrouiñ kontoù emgefre, jediñ an tamm oberiadenn ha skrivañ an disoc'h anezhi er vaezienn a-is ([[Special:Captcha/help|gouzout hiroc'h]]) :", # Fuzzy + 'captcha-createaccount-fail' => "Pe e vank ar c'hod kadarnaat pe eo fall anezhañ.", 'captcha-create' => "A-benn krouiñ ar bajenn, skrivit disoc'h ar jedadennig eeun-mañ er vaezienn :
        ([[Special:Captcha/help|Petra eo se?]])", - 'captcha-sendemail' => "Evit hor sikourda zizarbenn ar strob emgefre, sammit ar sifroù a-is ha skrivit an disoc'h er voest ([[Special:Captcha/help|gouzout hiroc'h]]) :", - 'captcha-sendemail-fail' => "Pe e vank ar c'hod CAPTCHA pe ez eo fall.", + 'captcha-sendemail' => "Evit hor skoazellañ da zizarbenn ar strob emgefre, sammit ar sifroù a-is ha skrivit an disoc'h er voest ([[Special:Captcha/help|gouzout hiroc'h]]) :", # Fuzzy + 'captcha-sendemail-fail' => "Pe e vank ar c'hod kadarnaat pe eo fall anezhañ.", 'captcha-disabledinapi' => "Evit an obererezh-mañ ez eus ezhomm ur captcha, dre-se ne c'hell ket bezañ graet dre an API.", 'captchahelp-title' => 'Skoazell Capcha', 'captchahelp-cookies-needed' => "Ret eo deoc'h gweredekaet an toupinoù war ho merdeer Web evit ma'z afe en-dro.", @@ -688,14 +687,13 @@ $messages['ca'] = array( 'captcha-edit' => 'Per a poder modificar aquesta pàgina cal que resolgueu aquesta simple suma i introduïu el resultat en el quadre ([[Special:Captcha/help|més informació]]):', 'captcha-desc' => "Proporciona tècniques CAPTCHA per a protegir contra la publicitat no desitjada i l'obtenció de contrasenyes", 'captcha-label' => 'CAPTCHA', - 'captcha-addurl' => 'La vostra modificació conté enllaços externs nous. -Com a protecció contra la brossa de propaganda automàtica, cal que resolgueu aquesta simple suma i introduïu el resultat en el quadre a continuació ([[Special:Captcha/help|més informació]]):', - 'captcha-badlogin' => "Com a protecció contra l'obtenció automatitzada de contrasenyes, cal que resolgueu aquesta simple suma i introduïu el resultat en el quadre a continuació ([[Special:Captcha/help|més informació]]):", - 'captcha-createaccount' => "Com a protecció contra la creació automàtica de comptes d'usuari, cal que resolgueu aquesta simple suma i introduïu el resultat en el quadre a continuació ([[Special:Captcha/help|més informació]]):", - 'captcha-createaccount-fail' => 'Hi manca el CAPTCHA o bé eś incorrecte.', + 'captcha-addurl' => 'La vostra modificació conté enllaços externs nous. Com a protecció contra la brossa de propaganda automàtica, cal que resolgueu aquesta simple suma i introduïu el resultat en el quadre a continuació ([[Special:Captcha/help|més informació]]):', # Fuzzy + 'captcha-badlogin' => "Per a ajudar en la protecció contra l'obtenció automatitzada de contrasenyes haureu de resoldre la suma que apareix a continuació ([[Special:Captcha/help|més informació]]):", # Fuzzy + 'captcha-createaccount' => "Com a protecció contra la creació automàtica de comptes d'usuari necessitem que resolgueu aquesta simple suma i introduïu el resultat en el quadre a continuació ([[Special:Captcha/help|més informació]]):", # Fuzzy + 'captcha-createaccount-fail' => 'Manca el codi de confirmació, o bé és incorrecte.', 'captcha-create' => 'La vostra modificació conté enllaços externs nous. Com a protecció contra la brossa de propaganda automàtica, cal que resolgueu aquesta simple suma i introduïu el resultat en el quadre a continuació ([[Special:Captcha/help|més informació]]):', - 'captcha-sendemail' => 'Com a protecció contra la brossa de propaganda automàtica, cal que resolgueu aquesta simple suma i introduïu el resultat en el quadre a continuació ([[Special:Captcha/help|més informació]]):', - 'captcha-sendemail-fail' => 'Hi manca el CAPTCHA o bé és incorrecte.', + 'captcha-sendemail' => "Per tal d'ajudar-nos en la lluita contra la publicitat automatitzada, cal que solucioneu la senzilla suma que apareix a continuació, i escrigueu el resultat a la casella ([[Special:Captcha/help|més informació]]):", # Fuzzy + 'captcha-sendemail-fail' => 'Manca el codi de confirmació, o bé és incorrecte.', 'captcha-disabledinapi' => "Aquesta acció requereix un captcha (codi d'imatge), per la qual cosa no es pot realitzar a través de l'API.", 'captchahelp-title' => 'Ajuda amb el sistema captcha', 'captchahelp-cookies-needed' => "Heu d'activar les galetes al vostre navegador per a que funcioni.", @@ -737,7 +735,6 @@ Buóh diōng kó̤ piĕng-cĭk hiĕk-miêng, áik \"diōng kó̤ sèng 1 hiĕk\" * @author Умар */ $messages['ce'] = array( - 'captcha-desc' => 'Спамах ларо а пароль харжа а CAPTCHA таронаш хуьлуьйту', 'right-skipcaptcha' => 'CAPTCHA-хьажар кхочушдар, CAPTCHA чекхдалар доцуш', ); @@ -748,7 +745,7 @@ $messages['ckb'] = array( 'right-skipcaptcha' => 'جێبەجێکردنی کردەوەکانی پێویست بە کاپچا بەبێ بەکارھێنانی کاپچا', ); -/** Czech (čeština) +/** Czech (česky) * @author Danny B. * @author Li-sung * @author Matěj Grabovský @@ -795,10 +792,10 @@ $messages['cy'] = array( Er mwyn gwarchod y wici rhag peiriant sbam, byddwch gystal â theipio cyfanswm y swm canlynol yn y blwch isod i roi eich golygiad ar gadw ([[Special:Captcha/help|mwy o wybodaeth]]):', 'captcha-badlogin' => 'Er mwyn arbed y wici rhag peiriannau datrys cyfrineiriau, byddwch gystal â gwneud y swm syml isod a gosod yr ateb yn y blwch ([[Special:Captcha/help|rhagor o wybodaeth]]):', 'captcha-createaccount' => 'Er mwyn arbed y wici rhag peiriannau dechrau cyfrifon, byddwch gystal â gwneud y swm syml isod a gosod yr ateb yn y blwch ([[Special:Captcha/help|mwy o wybodaeth]]):', - 'captcha-createaccount-fail' => "CAPTCHA ar goll neu'n anghywir.", + 'captcha-createaccount-fail' => "Côd cadarnhau ar goll neu'n anghywir.", 'captcha-create' => "Er mwyn gallu creu'r dudalen, gwnewch y swm isod a gosodwch y canlyniad yn y blwch ([[Special:Captcha/help|rhagor o wybodaeth]]):", 'captcha-sendemail' => "Er mwyn arbed y wici rhag sbamio awtomatig, byddwch gystal â gwneud y swm syml isod ac ysgrifennu'r ateb yn y blwch ([[Special:Captcha/help|rhagor o wybodaeth]]):", - 'captcha-sendemail-fail' => 'CAPTCHA yn anghywir neu yn eisiau.', + 'captcha-sendemail-fail' => 'Y cod cadarnhau yn anghywir neu yn eisiau.', 'captcha-disabledinapi' => 'Mae angen "captcha" i gyflawni\'r weithred hon, felly nid oes modd ei gyflawni trwy\'r API.', 'captchahelp-title' => 'Cymorth "captcha"', 'captchahelp-cookies-needed' => "Er mwyn i hyn weithio mae'n rhaid bod cookies wedi eu galluogi ar eich gwe-lywiwr.", @@ -825,7 +822,6 @@ Gwasgwch botwm 'nôl' eich porwr er mwyn dychwelyd at y dudalen golygu.", /** Danish (dansk) * @author Aputtu * @author Byrial - * @author Christian List * @author Hylle * @author Kaare * @author Peter Alberti @@ -838,13 +834,13 @@ $messages['da'] = array( Som beskyttelse af wikien mod automatiseret spam, skal du løse det enkle regnestykke nedenfor og skrive resultatet i boksen, for at kunne gemme din redigering ([[Special:Captcha/help|flere oplysninger]]):', 'captcha-badlogin' => 'For at beskytte wikien mod automatiseret adgangskodegætning, skal du løse det enkle regnestykke nedenfor og skrive resultatet i boksen ([[Special:Captcha/help|flere oplysninger]]):', 'captcha-createaccount' => 'For at beskytte wikien mod automatisk oprettelse af brugernavne, skal du løse det enkle regnestykke nedenfor og skrive resultatet i boksen ([[Special:Captcha/help|flere oplysninger]]):', - 'captcha-createaccount-fail' => 'Forkert eller manglende CAPTCHA.', + 'captcha-createaccount-fail' => 'Forkert eller manglende kodeord.', 'captcha-create' => 'For at oprette en ny side, skal du give svaret på regnestyket nedenfor, og angive resultatet i feltet under det. ([[Special:Captcha/help|mere information]]):', 'captcha-sendemail' => 'For at beskytte wikien mod automatisk spamning, skal du løse det enkle regnestykke nedenfor og skrive resultatet i boksen ([[Special:Captcha/help|flere oplysninger]]):', - 'captcha-sendemail-fail' => 'Forkert eller manglende CAPTCHA.', + 'captcha-sendemail-fail' => 'Forkert eller manglende bekræftelseskode.', 'captcha-disabledinapi' => "Denne handling kræver en captcha, så det ikke kan udføres via API'en.", 'captchahelp-title' => 'Captcha-hjælp', - 'captchahelp-cookies-needed' => 'Din browser skal have cookies slået til, før dette kan virke.', + 'captchahelp-cookies-needed' => 'Din browser skal understøtte cookies, før dette kan gennemføres.', 'captchahelp-text' => "Websites der accepterer indhold fra offentligheden, bliver ofte udsat for angreb fra spammere. Disse angreb sker med automatiske værktøjer, der anbringer de samme links på et stort antal websites på kort tid. Selvom disse links kan fjernes, er de en vedligeholdelsesmæssig byrde. I visse tilfælde, specielt når der tilføjes nye links til denne wiki, vil softwaren vise dig et billede af et stykke forvredet og sløret tekst. Du skal indtaste det ord, der vises, før du kan gennemføre handlingen. Formålet er at skelne mellem mennesker og automatiserede værktøjer, da de sidste har meget svært ved at genkende ordene. @@ -877,10 +873,10 @@ $messages['de'] = array( Um das Wiki vor automatisiertem Spam zu schützen, bitten wir dich die untenstehende einfache Rechenaufgabe zu lösen und deine Antwort in das Feld einzugeben, damit deine Bearbeitung gespeichert werden kann ([[Special:Captcha/help|mehr Informationen …]]):', 'captcha-badlogin' => 'Um das Wiki vor der automatisierten Kompromittierung der Benutzerkonten zu schützen, bitten wir dich die untenstehende einfache Rechenaufgabe zu lösen und deine Antwort in das Feld einzugeben ([[Special:Captcha/help|mehr Informationen …]]):', 'captcha-createaccount' => 'Um das Wiki vor der automatisierten Erstellung von Benutzerkonten zu schützen, bitten wir dich die untenstehende einfache Rechenaufgabe zu lösen und deine Antwort in das Feld einzugeben ([[Special:Captcha/help|mehr Informationen …]]):', - 'captcha-createaccount-fail' => 'Falsches oder fehlendes CAPTCHA.', + 'captcha-createaccount-fail' => 'Falscher oder fehlender Bestätigungscode.', 'captcha-create' => 'Zur Erstellung der Seite löse die nachfolgende Rechenaufgabe und trage das Ergebnis in das Feld unten ein [[Special:Captcha/help|(Fragen oder Probleme?)]].', 'captcha-sendemail' => 'Um das Wiki vor automatisiertem Spam zu schützen, bitten wir dich die untenstehende einfache Rechenaufgabe zu lösen und deine Antwort in das Feld einzugeben ([[Special:Captcha/help|mehr Informationen …]]):', - 'captcha-sendemail-fail' => 'Falsches oder fehlendes CAPTCHA.', + 'captcha-sendemail-fail' => 'Falscher oder fehlender Bestätigungscode.', 'captcha-disabledinapi' => 'Diese Aktion benötigt ein CAPTCHA. Sie kann nicht über die API ausgeführt werden.', 'captchahelp-title' => 'CAPTCHA-Hilfe', 'captchahelp-cookies-needed' => "'''Wichtiger Hinweis:''' Es müssen Cookies im Browser erlaubt sein.", @@ -929,10 +925,8 @@ Der „Zurück“-Knopf des Browsers führt zurück zum Bearbeitungsfenster.', ); /** Zazaki (Zazaki) - * @author Asmen * @author Aspar * @author Erdemaslancan - * @author Marmase * @author Xoser */ $messages['diq'] = array( @@ -945,11 +939,11 @@ Otomatik spamî ra pawitîş, ma rica keno cewabê problemî qutiyê ke cor de z ([[Special:Captcha/help|malumato detayın]]):', 'captcha-createaccount' => 'Otomatik spam ra pawıtışi, ma rica keno cewabê problemî qutiyê ke cor de zerre ey ra binuse ([[Special:Captcha/help|malumato detayın]]):', - 'captcha-createaccount-fail' => 'CAPTCHA ğeleto ya ki kemio', + 'captcha-createaccount-fail' => 'Kodê testiqî vin biyo ya zi raşt niyo.', 'captcha-create' => 'Qe pel viraştîşî, ma rica keno cewabê problemî qutiyê ke cor de zerre ey ra binuse ([[Special:Captcha/help|enformasyonê bînî]]):', 'captcha-sendemail' => 'Otomatik spam ra pawıtışi, ma rica keno cewabê problemî qutiyê ke cor de zerre ey ra binuse ([[Special:Captcha/help|malumato detayın]]):', - 'captcha-sendemail-fail' => 'CAPTCHA ğeleto ya ki kemio', + 'captcha-sendemail-fail' => 'Kodê testiqî vin biyo ya zi raşt niyo.', 'captcha-disabledinapi' => 'Ena hereket de captcha lazim o, aye ra ser API ra ena hereket nibena.', 'captchahelp-title' => 'Yardimê captchayî', 'captchahelp-cookies-needed' => 'Eka şıma wazeno bıkewê pela Wikipedia, programê internetê şıma de cookiesi gani aktiv bê.', @@ -983,10 +977,10 @@ $messages['dsb'] = array( Za šćit pśeśiwo zawtomatizěrowanemu spamoju, pšosymy śi slědujucy jadnory liceński nadawk rozwězaś a zapódaj wuslědk do kašćika, aby swóju změnu składował ([[Special:Captcha/help|dalšne info]]):', 'captcha-badlogin' => 'Aby wiki pśeśiwo zawtomatizěrowanemu wuzgónjowanjeju gronidła šćitał, pšosymy śi slědujucy jadnory liceński nadawk rozwězaś a zapódaj wuslědk do kašćika ([[Special:Captcha/help|dalšne info]]):', 'captcha-createaccount' => 'Aby wiki pśeśiwo zawtomatizěrowanemu załoženjeju kontow šćitał, pšosymy śi slědujucy jadnory liceński nadawk rozwězaś a zapódaj wuslědk do kašćika ([[Special:Captcha/help|dalšne info]]):', - 'captcha-createaccount-fail' => 'Wopacny abo felujucy wobkšuśeński kod CAPTCHA.', + 'captcha-createaccount-fail' => 'Wopacny abo felujucy wobkšuśeński kod.', 'captcha-create' => 'Aby napórał bok, rozwěž pšosym slědujucy jadnory liceński nadawk a zapódaj wuslědk do kašćika ([[Special:Captcha/help|dalšne info]]):', 'captcha-sendemail' => 'Aby wiki pśeśiwo awtomatiskemu spamowanjeju šćitał, pšosymy śi jadnory liceński nadawk rozwězaś a zapódaj wótegrono do kašćika ([[Special:Captcha/help|dalšne informacije]]):', - 'captcha-sendemail-fail' => 'Wopacny abo felujucy wobkšuśeński kod CAPTCHA.', + 'captcha-sendemail-fail' => 'Wopacny abo felujucy wobkšuśeński kod.', 'captcha-disabledinapi' => 'Toś ta akcija pomina se captcha, togodla njedajo se pśez API wuwjasć.', 'captchahelp-title' => 'Pomoc wó captcha', 'captchahelp-cookies-needed' => 'Aby to funkcioněrowało, muse cookieje dowólone byś.', @@ -1133,7 +1127,6 @@ Klaku la 'reiru' butonon en via retumilo por reiri al la paĝo-redaktilo.", /** Spanish (español) * @author Armando-Martin - * @author Ciencia Al Poder * @author Crazymadlover * @author Drini * @author Icvav @@ -1152,10 +1145,10 @@ $messages['es'] = array( Para proteger el wiki contra el spam automatizado, por favor resuelve la sencilla suma de abajo e introduce la respuesta en la caja para guardar tu edición ([[Special:Captcha/help|más información]]):', 'captcha-badlogin' => 'Para proteger el wiki del descifrado de contraseñas automatizado, por favor resuelve la simple suma de abajo e introduce la respuesta en la caja ([[Special:Captcha/help|más información]]):', 'captcha-createaccount' => 'Para proteger el wiki de la creación automática de cuentas, resuelve por favor la simple suma de abajo e introduce la respuesta en la caja ([[Special:Captcha/help|más información]]):', - 'captcha-createaccount-fail' => 'Falta el código CAPTCHA, o éste es incorrecto.', + 'captcha-createaccount-fail' => 'Falta el código de confirmación, o éste es incorrecto.', 'captcha-create' => 'Para crear la página, por favor resuelve la simple suma de abajo e introduce la respuesta en la caja ([[Special:Captcha/help|más información]]):', 'captcha-sendemail' => 'Para proteger el wiki contra el spam automatizado, por favor resuelve la simple suma que se presenta a continuación e introduce la respuesta en el cuadro de texto ([[Special:Captcha/help|más información]]):', - 'captcha-sendemail-fail' => 'Falta el código CAPTCHA, o éste es incorrecto.', + 'captcha-sendemail-fail' => 'El código de confirmación falta o es incorrecto.', 'captcha-disabledinapi' => 'Esta acción requiere un captcha, así que no puede ser ejecutada a través de un API.', 'captchahelp-title' => 'Ayuda sobre el captcha', 'captchahelp-cookies-needed' => 'Debe tener las cookies activadas en el navegador para que el sistema funcione.', @@ -1189,11 +1182,11 @@ $messages['et'] = array( Palun lahenda allpool lihtne tehe ja sisesta vastus kasti, et saaksid muudatuse salvestada. Abinõu on viki kaitseks automaadistatud rämpsmuudatuste eest ([[Special:Captcha/help|lisateave]]):', 'captcha-badlogin' => 'Palun lahenda allpool lihtne tehe ja sisesta vastus kasti. Abinõu on viki kaitseks automaatsete parooliäraarvajate eest ([[Special:Captcha/help|lisateave]]):', 'captcha-createaccount' => 'Palun lahenda lihtne tehe ja sisesta vastus kasti. Abinõu on viki kaitseks kontode automaatse loomise eest ([[Special:Captcha/help|lisateave]]):', - 'captcha-createaccount-fail' => 'Puuduv või valesti sisestatud robotilõksu tekst.', + 'captcha-createaccount-fail' => 'Puuduv või valesti sisestatud kinnituskood.', 'captcha-create' => 'Lehekülje loomiseks lahenda palun lihtne tehe ja sisesta vastus kasti ([[Special:Captcha/help|lisateave]]):', 'captcha-sendemail' => 'Palun lahenda allpool lihtne tehe ja sisesta vastus kasti. Abinõu on viki kaitseks automaadistatud rämpsmuudatuste eest ([[Special:Captcha/help|lisateave]]):', - 'captcha-sendemail-fail' => 'Vigane või puuduv robotilõksu tekst.', + 'captcha-sendemail-fail' => 'Vigane või puuduv kinnituskood.', 'captcha-disabledinapi' => 'Ühes selle toiminguga tuleb läbida robotilõks ja seetõttu ei saa seda API kaudu sooritada.', 'captchahelp-title' => 'Mis on robotilõks?', 'captchahelp-cookies-needed' => 'Selle toimimiseks peab veebilehitseja lubama küpsiseid.', @@ -1253,10 +1246,10 @@ $messages['fa'] = array( برای کمک به جلوگیری از ارسال خودکار هرزنامه‌ها، لطفاً حاصل جمع زیر را حساب کنید و نتیجه را در جعبه وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', 'captcha-badlogin' => 'برای کمک به جلوگیری از شکستن خودکار گذرواژه، لطفاً حاصل جمع زیر را حساب کنید و نتیجه را وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', 'captcha-createaccount' => 'برای جلوگیری از ایجاد خودکار حساب کاربری، لطفاً حاصل جمع زیر را حساب کنید و نتیجه را در جعبه وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', - 'captcha-createaccount-fail' => 'کد تأییدی وجود ندارد یا نادرست است.', + 'captcha-createaccount-fail' => 'کد تأییدی وجود ندارد یا نادرست است.', 'captcha-create' => 'برای ایجاد صفحه لطفاً حاصل جمع زیر را حساب کنید و نتیجه را در جعبه وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', 'captcha-sendemail' => 'برای کمک به حفاظت ویکی در برابر هرزنامه‌های خودکار، لطفاً جمع سادهٔ زیر را حل کنید و جواب را در جعبه وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', - 'captcha-sendemail-fail' => 'کد تأییدی وجود ندارد یا نادرست است.', + 'captcha-sendemail-fail' => 'کد تأییدی وجود ندارد یا نادرست است.', 'captcha-disabledinapi' => 'این اقدام به کپچا نیاز دارد، بنابراین نمی‌تواند از طریق API انجام شود.', 'captchahelp-title' => 'راهنمای Captcha', 'captchahelp-cookies-needed' => 'برای کار کردن آن، شما باید کوکی‌های مرورگرتان را فعال کنید.', @@ -1341,7 +1334,6 @@ $messages['fo'] = array( /** French (français) * @author Crochet.david - * @author Gomoko * @author Grondin * @author IAlex * @author Meithal @@ -1363,10 +1355,10 @@ $messages['fr'] = array( Pour nous aider dans la protection contre le pourriel automatisé, veuillez calculer l’opération simple ci-dessous et en inscrire le résultat dans le champ ([[Special:Captcha/help|plus d’informations]]) :', 'captcha-badlogin' => 'Afin de nous aider à prévenir le cassage automatisé des mots de passe, veuillez calculer l’opération simple ci-dessous et en inscrire le résultat dans le champ ([[Special:Captcha/help|plus d’informations]]) :', 'captcha-createaccount' => 'Afin de nous aider à lutter contre les créations automatiques de comptes, veuillez calculer l’opération simple ci-dessous et en inscrire le résultat dans le champ ([[Special:Captcha/help|plus d’informations]]) :', - 'captcha-createaccount-fail' => 'CAPTCHA erroné ou manquant.', + 'captcha-createaccount-fail' => 'Code de confirmation erroné ou manquant.', 'captcha-create' => 'Pour créer la page, veuillez calculer l’opération simple ci-dessous et en inscrire le résultat dans le champ ([[Special:Captcha/help|plus d’informations]]) :', 'captcha-sendemail' => 'Afin de nous aider à prévenir le pollupostage automatisé, veuillez calculer l’opération simple ci-dessous et en inscrire le résultat dans le champ ([[Special:Captcha/help|plus d’informations]]) :', - 'captcha-sendemail-fail' => 'CAPTCHA incorrect ou absent.', + 'captcha-sendemail-fail' => 'Code de confirmation incorrect ou manquant.', 'captcha-disabledinapi' => 'Cette action requiert un captcha, donc elle ne peut pas être effectuée via l’IPA.', 'captchahelp-title' => 'Aide sur le captcha', 'captchahelp-cookies-needed' => "Il vous faudra autoriser les témoins (''cookies'') de votre navigateur pour que cela fonctionne.", @@ -1469,7 +1461,6 @@ $messages['ga'] = array( /** Galician (galego) * @author Alma - * @author Elisardojm * @author Toliño * @author Xosé */ @@ -1481,10 +1472,10 @@ $messages['gl'] = array( Para protexer o wiki contra o spam automático, resolva a suma que aparece a continuación e introduza a resposta na caixa ([[Special:Captcha/help|máis información]]):', 'captcha-badlogin' => 'Para protexer o wiki contra o roubo de contrasinais, resolva a suma que aparece a continuación e introduza a resposta na caixa ([[Special:Captcha/help|máis información]]):', 'captcha-createaccount' => 'Para protexer o wiki contra a creación automática de contas, resolva a suma que aparece a continuación e introduza a resposta na caixa ([[Special:Captcha/help|máis información]]):', - 'captcha-createaccount-fail' => 'Falta o código de confirmación (CAPTCHA) ou é incorrecto.', + 'captcha-createaccount-fail' => 'Falta o código de confirmación ou é incorrecto.', 'captcha-create' => 'Para crear a páxina, resolva a suma que aparece a continuación e introduza a resposta na caixa ([[Special:Captcha/help|máis información]]):', 'captcha-sendemail' => 'Para protexer o wiki contra o spam automático, resolva a suma que aparece a continuación e introduza a resposta na caixa ([[Special:Captcha/help|máis información]]):', - 'captcha-sendemail-fail' => 'Falta o código de confirmación (CAPTCHA) ou é incorrecto.', + 'captcha-sendemail-fail' => 'Falta o código de confirmación ou é incorrecto.', 'captcha-disabledinapi' => 'Esta acción necesita o captcha, polo que non se pode realizar a través da API.', 'captchahelp-title' => 'Axuda acerca do CAPTCHA', 'captchahelp-cookies-needed' => 'Necesita ter as cookies habilitadas no seu navegador para que funcione.', @@ -1588,20 +1579,19 @@ $messages['gu'] = array( /** Hebrew (עברית) * @author Amire80 - * @author Guycn2 * @author Rotem Liss * @author Rotemliss * @author YaronSh */ $messages['he'] = array( 'captcha-edit' => 'כדי לערוך את הדף, אנא פתרו את תרגיל החיבור הפשוט שלהלן והקלידו את התשובה בתיבה ([[Special:Captcha/help|מידע נוסף]]):', - 'captcha-desc' => 'מתן טכניקות CAPTCHA להגנה נגד ספאם וניחוש סיסמאות', + 'captcha-desc' => 'מתן טכניקות CAPTCHA להגנה נגד זיבול וניחוש ססמאות', 'captcha-label' => 'CAPTCHA', 'captcha-addurl' => 'עריכתכם כוללת קישורים חיצוניים חדשים. לשם הגנה מפני ספאם אוטומטי, אנא פתרו את תרגיל החיבור הפשוט שלהלן והקלידו את התשובה בתיבה כדי לשמור את עריכתכם ([[Special:Captcha/help|מידע נוסף]]):', 'captcha-badlogin' => 'לשם הגנה מפני פריצת סיסמאות אוטומטית, אנא פתרו את תרגיל החיבור הפשוט שלהלן והקלידו את התשובה בתיבה ([[Special:Captcha/help|מידע נוסף]]):', 'captcha-createaccount' => 'לשם הגנה מפני יצירת חשבונות אוטומטית, אנא פתרו את תרגיל החיבור הפשוט שלהלן והקלידו את התשובה בתיבה ([[Special:Captcha/help|מידע נוסף]]):', - 'captcha-createaccount-fail' => 'קוד אישור שגוי או חסר.', + 'captcha-createaccount-fail' => 'לא הקלדתם קוד אישור, או שהוא שגוי.', 'captcha-create' => 'כדי ליצור את הדף, אנא פתרו את תרגיל החיבור הפשוט שלהלן והקלידו את התשובה בתיבה ([[Special:Captcha/help|מידע נוסף]]):', 'captcha-sendemail' => 'כדי לעזור להילחם במציפי זבל אוטומטיים, עליך לחשב את הסכום הפשוט שלהלן ולהזין את התוצאה בתיבה ([[Special:Captcha/help|מידע נוסף]]):', 'captcha-sendemail-fail' => 'קוד האישור שגוי או חסר.', @@ -1717,10 +1707,10 @@ $messages['hsb'] = array( 'captcha-addurl' => 'W twojej změnje su nowe eksterne wotkazy. Zo by wiki přećiwo awtomatizowanemu spamej škitał, prosymy će slědowacy nadawk wuličić a wuslědk do kašćika zapisować, zo by so twoja změna składowała ([[Special:Captcha/help|dalše informacije]]).', 'captcha-badlogin' => 'Zo by wiki přećiwo awtomatiskemu zadobywanju do hesłow škitał, prosymy će slědowacy nadawk wuličeć a wuslědk do kašćika zapisować ([[Special:Captcha/help|dalše informacije]]):', 'captcha-createaccount' => 'Zo by wiki přećiwo awtomatiskemu wutworjenju wužiwarskich kontow škitał, prosymy će slědowacy nadawk nadawk rozrisać a wuslědk do kašćika zapisować ([[Special:Captcha/help|dalše informacije]]):', - 'captcha-createaccount-fail' => 'Wopačny abo falowacy wobkrućenski kod CAPTCHA.', + 'captcha-createaccount-fail' => 'Wopačny abo pobrachowacy wobkrućenski kod.', 'captcha-create' => 'Zo by stronu wutworił, rozrisaj prošu slědowacy ličenski nadawk a zapodaj wuslědk do kašćika ([[Special:Captcha/help|Dalše informacije]]):', 'captcha-sendemail' => 'Za škit přećiwo awtomatiskemu spamowanju, rozrisaj prošu slědowacy jednory ličenski nadawk a zapodaj wotmołwu do kašćika ([[Special:Captcha/help|dalše informacije]]):', - 'captcha-sendemail-fail' => 'Wopačny abo falowacy wobkrućenski kod CAPTCHA.', + 'captcha-sendemail-fail' => 'Wopačny abo falowacy wobkrućenski kod.', 'captcha-disabledinapi' => 'Tuta akcija wužaduje sej captcha, tohodla njeda so přez API wuwjesć.', 'captchahelp-title' => 'Pomoc za CAPTCHA', 'captchahelp-cookies-needed' => 'Dyrbiš placki (cookies) w swojim wobhladowaku zmóžnić.', @@ -1808,10 +1798,10 @@ $messages['ia'] = array( Pro proteger le wiki contra le spam automatisate, per favor resolve le simple summa hic infra e entra le resultato in le quadro a fin de salveguardar tu modification ([[Special:Captcha/help|plus info]]):', 'captcha-badlogin' => 'Pro proteger le wiki contra le furto automatisate de contrasignos, per favor resolve le simple summa hic infra e entra le resultato in le quadro ([[Special:Captcha/help|plus info]]):', 'captcha-createaccount' => 'Pro proteger le wiki contra le creation automatisate de contos, per favor resolve le simple summa hic infra e entra le resultato in le quadro ([[Special:Captcha/help|plus info]]):', - 'captcha-createaccount-fail' => 'Codice de confirmation (CAPTCHA) incorrecte o mancante.', + 'captcha-createaccount-fail' => 'Codice de confirmation incorrecte o mancante.', 'captcha-create' => 'Pro crear le pagina, per favor resolve le simple summa hic infra e entra le resultato in le quadro ([[Special:Captcha/help|plus info]]):', 'captcha-sendemail' => 'Pro proteger le wiki contra le spam automatisate, per favor resolve le simple summa hic infra e entra le resultato in le quadro ([[Special:Captcha/help|plus info]]):', - 'captcha-sendemail-fail' => 'Codice de confirmation (CAPTCHA) incorrecte o mancante.', + 'captcha-sendemail-fail' => 'Codice de confirmation incorrecte o mancante.', 'captcha-disabledinapi' => 'Iste action require un captcha, dunque illo non pote esser exequite per medio del API.', 'captchahelp-title' => 'Adjuta super le captcha', 'captchahelp-cookies-needed' => 'Tu debe haber le cookies activate in tu navigator a fin que isto pote functionar.', @@ -1840,22 +1830,20 @@ Clicca le button 'retro' in tu navigator pro retornar al pagina de modification. * @author Ilham151096 * @author IvanLanin * @author Iwan Novirion - * @author Kenrick95 * @author Rex */ $messages['id'] = array( 'captcha-edit' => 'Untuk menyunting halaman ini, harap pecahkan penjumlahan sederhana di bawah ini dan masukkan jawaban di kotak yang tersedia ([[Special:Captcha/help|info lengkap]]):', 'captcha-desc' => 'Menyediakan teknik captcha untuk melindungi terhadap spam dan penebakan sandi', 'captcha-label' => 'CAPTCHA', - 'captcha-addurl' => "Suntingan Anda menyertakan pranala luar baru. -Sebagai pelindungan terhadap ''spam'' otomatis, Anda harus mengetikkan hasil perhitungan sederhana berikut ini -([[Special:Captcha/help|info lengkap]]):", - 'captcha-badlogin' => 'Untuk melindungi wiki ini dari perengkahan kunci sandi otomatis, harap masukkan hasil perhitungan sederhana berikut dalam kotak yang tersedia ([[Special:Captcha/help|info lengkap]]):', - 'captcha-createaccount' => 'Untuk melindungi wiki ini dari pembuatan akun otomatis, kami meminta Anda untuk mengetikkan hasil perhitungan sederhana di bawah ini dalam kotak yang tersedia -([[Special:Captcha/help|info lengkap]]):', + 'captcha-addurl' => "Suntingan Anda menyertakan pranala luar baru. Sebagai pelindungan terhadap ''spam'' otomatis, Anda harus mengetikkan kata atau hasil perhitungan yang tertera berikut ini:
        +([[Special:Captcha/help|info lengkap]])", # Fuzzy + 'captcha-badlogin' => 'Untuk membantu pelindungan terhadap perengkahan kunci sandi otomatis, tolong masukkan kata atau hasil perhitungan sederhana berikut dalam kotak yang tersedia ([[Special:Captcha/help|info lengkap]]):', # Fuzzy + 'captcha-createaccount' => 'Sebagai pelindungan terhadap spam, Anda diharuskan untuk mengetikkan kata atau hasil perhitungan di bawah ini di kotak yang tersedia untuk dapat mendaftarkan pengguna baru:
        +([[Special:Captcha/help|info lengkap]])', # Fuzzy 'captcha-createaccount-fail' => 'Kode konfirmasi salah atau belum diisi.', 'captcha-create' => 'Untuk menyunting halaman ini, silakan pecahkan penjumlahan sederhana di bawah ini dan masukkan jawaban di kotak yang tersedia ([[Special:Captcha/help|info lengkap]]):', - 'captcha-sendemail' => 'Untuk melindungi wiki ini dari spam otomatis, kami meminta Anda untuk memecahkan penjumlahan sederhana di bawah ini dan masukkan jawaban di kotak yang tersedia ([[Special:Captcha/help|more info]]):', + 'captcha-sendemail' => 'Sebagai pelindungan terhadap spam, silakan pecahkan penjumlahan sederhana di bawah ini dan masukkan jawaban di kotak yang tersedia ([[Special:Captcha/help|more info]]):', # Fuzzy 'captcha-sendemail-fail' => 'Kode konfirmasi salah atau belum diisi.', 'captcha-disabledinapi' => 'Tindakan ini membutuhkan captcha, sehingga tidak dapat dilakukan melalui API.', 'captchahelp-title' => 'Mengenai Captcha', @@ -1998,10 +1986,10 @@ $messages['ja'] = array( 自動でのスパム攻撃を防ぐため、お手数ですが下記の簡単な数式を計算してその答えを欄に入力してください ([[Special:Captcha/help|ヘルプ]]):', 'captcha-badlogin' => '自動でのパスワードクラック攻撃からウィキを保護するため、お手数ですが下記の簡単な数式を計算してその答えを欄に入力してください ([[Special:Captcha/help|詳細]]):', 'captcha-createaccount' => 'アカウントの自動登録からウィキを保護するため、お手数ですが下記の簡単な数式を計算してその答えを欄に入力してください ([[Special:Captcha/help|ヘルプ]]):', - 'captcha-createaccount-fail' => 'CAPTCHA が正しくない、または入力されていません。', + 'captcha-createaccount-fail' => '確認コードが正しくない、または入力されていません。', 'captcha-create' => 'ページを新規作成するには、下記の簡単な数式を計算してその答えを欄に入力してください ([[Special:Captcha/help|ヘルプ]]):', 'captcha-sendemail' => '自動でのスパム攻撃からウィキを保護するため、お手数ですが下記の簡単な数式を計算してその答えを欄に入力してください ([[Special:Captcha/help|詳細]]):', - 'captcha-sendemail-fail' => 'CAPTCHA が正しくない、または入力されていません。', + 'captcha-sendemail-fail' => '確認コードが正しくない、または入力されていません。', 'captcha-disabledinapi' => 'この操作には CAPTCHA 認証が必要なため、API では実行できません。', 'captchahelp-title' => 'CAPTCHA (画像認証) ヘルプ', 'captchahelp-cookies-needed' => 'ブラウザーの Cookie を有効にする必要があります。', @@ -2025,7 +2013,6 @@ $messages['ja'] = array( ); /** Jutish (jysk) - * @author Christian List * @author Huslåke * @author Ælsån */ @@ -2033,9 +2020,9 @@ $messages['jut'] = array( 'captcha-edit' => 'For at redigere denne side, skal du give svaret på regnestyket nedenfor, og angive resultatet i feltet under det. ([[Special:Captcha/help|mere information]]):', 'captcha-desc' => 'Semple captcha implementåsje', # Fuzzy 'captcha-addurl' => 'Din redigering tilføjer nye eksterne henvisninger til artiklen. Som beskyttelse mod automatiseret spam, skal du give svaret på regnestyket nedenfor, og angive resultatet i feltet under det. ([[Special:Captcha/help|mere information]]):', # Fuzzy - 'captcha-badlogin' => 'For at beskytte mod automatiske forsøg på at gætte adgangskoden, skal du give svaret på regnestykket nedenfor, og angive resultatet i feltet under det. ([[Special:Captcha/help|mere information]]):', + 'captcha-badlogin' => 'For at beskytte mod automatiserede gæt på kodeord, skal du give svaret på regnestyket nedenfor, og angive resultatet i feltet under det. ([[Special:Captcha/help|mere information]]):', # Fuzzy 'captcha-createaccount' => 'For at beskytte mod automatisk oprettelse af brugernavne, skal du give svaret på regnestyket nedenfor, og angive resultatet i feltet under det. ([[Special:Captcha/help|mere information]]):', # Fuzzy - 'captcha-createaccount-fail' => 'Forkert eller manglende bekræftelseskode.', + 'captcha-createaccount-fail' => 'Forkert eller manglende kodeord.', 'captcha-create' => 'For at oprette en ny side, skal du give svaret på regnestyket nedenfor, og angive resultatet i feltet under det. ([[Special:Captcha/help|mere information]]):', 'captchahelp-title' => 'Captcha-hjælp', 'captchahelp-cookies-needed' => 'Din browser skal understøtte cookies, før dette kan gennemføres.', @@ -2054,7 +2041,6 @@ Tryk på 'tilbage'-knappen i din browser for at returnere til redigeringssiden." ); /** Javanese (Basa Jawa) - * @author Bennylin * @author Meursault2004 * @author NoiX180 * @author Pras @@ -2064,14 +2050,12 @@ $messages['jv'] = array( 'captcha-desc' => 'Nyadhiyakaké tèhnik CAPTCHA kanggo njaga saka spam lan pambedhèk sandhi', 'captcha-label' => 'CAPTCHA', 'captcha-addurl' => "Suntingan panjenengan iku nyertakaké pranala jaba anyar. -Kanggo ngéwangi ngreksa lawan ''spam'' otomatis, tulung pecahna itung-itungan ing ngisor iki lan lebokna kasilna sajroning kothak ([[Special:Captcha/help|info sabanjuré]]):", - 'captcha-badlogin' => 'Kanggo ngreksa lawan parengkahan tembung sandhi otomatis, tulung lebokna tembung utawa kasil itung-itungan gampang ing ngisor sajroning kothak sing wis sumedya ([[Special:Captcha/help|info sabanjuré]]):', - 'captcha-createaccount' => 'Kanggo ngreksa lawan panggawéyan rékening (akun) otomatis, tulung pecahna itung-itungan ing ngisor iki lan lebokna kasilna sajroning kothak ([[Special:Captcha/help|info sabanjuré]]):', - 'captcha-createaccount-fail' => 'Kode CAPTCHA salah utawa durung diisi.', +Kanggo ngéwangi ngreksa lawan ''spam'' otomatis, tulung pecahna itung-itungan ing ngisor iki lan lebokna kasilna sajroning kothak ([[Special:Captcha/help|info sabanjuré]]):", # Fuzzy + 'captcha-badlogin' => 'Kanggo ngreksa lawan parengkahan kunci sandhi otomatis, tulung lebokna tembung utawa kasil itung-itungan gampang ing ngisor sajroning kothak sing wis sumedya ([[Special:Captcha/help|info sabanjuré]]):', # Fuzzy + 'captcha-createaccount' => 'Kanggo ngreksa lawan panggawéyan rékening (akun) otomatis, tulung pecahna itung-itungan ing ngisor iki lan lebokna kasilna sajroning kothak ([[Special:Captcha/help|info sabanjuré]]):', # Fuzzy + 'captcha-createaccount-fail' => 'Kode pandhedhesan (konfirmasi) salah utawa durung diisi.', 'captcha-create' => 'Kanggo nggawé kaca iki, mangga itung-itungan ing ngisor iki diwangsuli sajroning kothak ([[Special:Captcha/help|info sabanjuré]]):', - 'captcha-sendemail' => 'Kanggo ngreksa lawan spam otomatis, tulung lebokna tembung utawa kasil itung-itungan gampang ing ngisor sajroning kothak sing wis sumedya ([[Special:Captcha/help|info sabanjuré]]):', - 'captcha-sendemail-fail' => 'Kode CAPTCHA salah utawa durung diisi.', - 'captcha-disabledinapi' => 'Tindakan ini membutuhkan CAPTCHA, sehingga tidak dapat dilakukan melalui API.', + 'captcha-sendemail-fail' => 'Kodhe pepesthèn salah utawa durung diisi.', 'captchahelp-title' => 'Pitulung Captcha', 'captchahelp-cookies-needed' => 'Panjenengan perlu ngaktifaké cookie ing panjlajah wèb panjenengan kanggo nganggo fitur iki.', 'captchahelp-text' => "Situs-situs wèb sing nampa data saka umum, kaya ta wiki iki, kerep disalahgunakaké déning panganggo-panganggo sing ora bertanggungjawab kanggo ngirimaké ''spam'' mawa program-program otomatis. Senadyan spam-spam iku bisa dibuang kabèh, nanging waé tetep ngrusuhi lan dianggep gawé masalah. @@ -2224,9 +2208,9 @@ Bet öñdewine qaýtw barw üşin «Artqa» degen tüýmesin basıñız.', # Fuz $messages['km'] = array( 'captcha-edit' => 'ដើម្បីកែប្រែ​ទំព័រនេះ សូមដោះស្រាយ​ប្រមាណវិធីបូក​ខាងក្រោម​នេះរួច​បញ្ជូលចម្លើយ​ទៅក្នុង​ប្រអប់សិន([[Special:Captcha/help|ព័ត៌មាន​បន្ថែម]])៖', 'captcha-desc' => 'ផ្ដល់បច្ចេកទេស CAPTCHA ដើម្បីការពារពីស្ប៉ាមនិងការការទាយពាក្យសំងាត់', - 'captcha-addurl' => 'កំណែ​របស់អ្នក​មាន​តំណភ្ជាប់ក្រៅ​ថ្មី។ ដើម្បី​ជួយបង្ការ​ស្ប៉ាម​ស្វ័យប្រវត្តិ សូមដោះស្រាយ​ប្រមាណវិធីបូក​ខាងក្រោម​នេះរួច​បញ្ជូលចម្លើយ​ទៅក្នុង​ប្រអប់សិនមុនពេលរក្សាទុកកំណែរបស់អ្នក([[Special:Captcha/help|ព័ត៌មាន​បន្ថែម]])៖', - 'captcha-badlogin' => 'ដើម្បីការពារការបំបែកពាក្យសម្ងាត់ដោយស្វ័យប្រវត្តិ សូមដោះស្រាយផលបូកខាងក្រោមរួចបញ្ជូលចម្លើយទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', - 'captcha-createaccount' => 'ដើម្បី​បង្ការការបង្កើត​គណនី​ស្វ័យប្រវត្តិ សូមដោះស្រាយ​ប្រមាណវិធីបូក​ខាងក្រោម​នេះរួច​បញ្ជូលចម្លើយ​ទៅក្នុង​ប្រអប់សិន([[Special:Captcha/help|ព័ត៌មាន​បន្ថែម]])៖', + 'captcha-addurl' => 'កំណែ​របស់អ្នក​មាន​តំណភ្ជាប់ក្រៅ​ថ្មី។ ដើម្បី​ជួយបង្ការ​ស្ប៉ាម​ស្វ័យប្រវត្តិ សូមដោះស្រាយ​ប្រមាណវិធីបូក​ខាងក្រោម​នេះរួច​បញ្ជូលចម្លើយ​ទៅក្នុង​ប្រអប់សិន([[Special:Captcha/help|ព័ត៌មាន​បន្ថែម]])៖', # Fuzzy + 'captcha-badlogin' => 'ដើម្បីការពារការបំបែកពាក្យសំងាត់ដោយស្វ័យប្រវត្តិ សូមដោះស្រាយផលបូកខាងក្រោមរួចបញ្ជូលចម្លើយទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', # Fuzzy + 'captcha-createaccount' => 'ដើម្បី​បង្ការការបង្កើត​គណនី​ស្វ័យប្រវត្តិ សូមដោះស្រាយ​ប្រមាណវិធីបូក​ខាងក្រោម​នេះរួច​បញ្ជូលចម្លើយ​ទៅក្នុង​ប្រអប់សិន([[Special:Captcha/help|ព័ត៌មាន​បន្ថែម]])៖', # Fuzzy 'captcha-createaccount-fail' => 'កូដផ្ទៀងផ្ទាត់បាត់បង់ឬមិនត្រឹមត្រូវ។', 'captcha-create' => 'ដើម្បី​បង្កើត​ទំព័រ សូមដោះស្រាយ​ប្រមាណវិធីបូក​ខាងក្រោម​នេះរួច​បញ្ជូលចម្លើយ​ទៅក្នុង​ប្រអប់សិន([[Special:Captcha/help|ព័ត៌មាន​បន្ថែម]])៖', 'captchahelp-title' => 'ជំនួយអំពី Captcha', @@ -2236,7 +2220,6 @@ $messages['km'] = array( * @author IRTC1015 * @author Klutzy * @author Kwj2772 - * @author Priviet * @author ToePeu * @author 아라 */ @@ -2248,10 +2231,10 @@ $messages['ko'] = array( 자동화된 스팸으로부터 위키를 보호하기 위해, 편집을 저장하려면 아래의 간단한 계산 값을 입력 상자에 적어 주세요 ([[Special:Captcha/help|자세한 정보]]):', 'captcha-badlogin' => '자동화된 비밀번호 깨기로부터 위키를 보호하기 위해, 아래의 간단한 계산 값을 입력 상자에 입력해주세요 ([[Special:Captcha/help|자세한 정보]]):', 'captcha-createaccount' => '자동화된 계정 만들기로부터 위키를 보호하기 위해, 아래의 간단한 계산 값을 입력 상자에 적어 주세요 ([[Special:Captcha/help|자세한 정보]]):', - 'captcha-createaccount-fail' => '캡챠가 올바르지 않거나 입력되지 않았습니다.', + 'captcha-createaccount-fail' => '입력값이 잘못되었거나 없습니다.', 'captcha-create' => '문서를 만드려면 아래의 간단한 계산 값을 입력 상자에 적어 주세요 ([[Special:Captcha/help|자세한 정보]]):', 'captcha-sendemail' => '자동화된 스팸으로부터 위키를 보호하기 위해, 아래의 간단한 계산 값을 입력 상자에 적어 주세요 ([[Special:Captcha/help|자세한 정보]]):', - 'captcha-sendemail-fail' => '캡챠가 올바르지 않거나 입력되지 않았습니다.', + 'captcha-sendemail-fail' => '입력값이 잘못되었거나 없습니다.', 'captcha-disabledinapi' => '이 동작은 캡차를 거쳐야 하기 때문에 API로 이 작업을 수행할 수 없습니다.', 'captchahelp-title' => 'CAPTCHA(캡차) 도움말', 'captchahelp-cookies-needed' => '정상적으로 작동하려면 웹 브라우저의 쿠키 사용이 활성화되어 있어야 합니다.', @@ -2355,14 +2338,6 @@ $messages['la'] = array( 'captchahelp-title' => 'Captcha auxilium', ); -/** Ladino (Ladino) - * @author Menachem.Moreira - */ -$messages['lad'] = array( - 'captcha-label' => 'CAPTCHA', - 'captchahelp-title' => 'Ayudo de CAPTCHA', -); - /** Luxembourgish (Lëtzebuergesch) * @author Les Meloures * @author Robby @@ -2376,18 +2351,18 @@ $messages['lb'] = array( Fir dës Wiki virun automatiséiertem Spam ze schütze froe mir Iech fir déi folgend einfach Additioun ze léisen an d'Resultat an d'Feld ënnen anzedroen fir Är Ännerung ze späicheren ([[Special:Captcha/help|méi Informatiounen]]):", 'captcha-badlogin' => "Fir dës Wiki géint automatescht Hacke vu Passwierder ze schützen, léist w.e.g. déi einfach Additioun hei ënnendrënner an tippt d'Äntwert an d'Këscht ([[Special:Captcha/help|méi Informatiounen]]):", 'captcha-createaccount' => "Fir dës Wiki géint d'automatescht Uleeë vu Benotzerkonten ze schützen, léist w.e.g. déi einfach Additioun hei ënnendrënner, an tippt d'Äntwert an d'Këscht ([[Special:Captcha/help|méi Informatiounen]]):", - 'captcha-createaccount-fail' => 'Falschen oder kee CAPTCHA.', + 'captcha-createaccount-fail' => 'Falschen oder kee Confirmatiouns-Code.', 'captcha-create' => "Fir eng Nei Säit unzeleeën, léist w.e.g. déi einfach Additioun hei ënnendrënner an tippt d'Äntwert an d'Këscht ([[Special:Captcha/help|méi Informatiounen]]):", 'captcha-sendemail' => "Fir dës Wiki géint automatescht Spammen ze schützen, léist w.e.g. déi einfach Additioun hei ënnendrënner an tippt d'Äntwert an d'Këscht ([[Special:Captcha/help|méi Informatiounen]]):", - 'captcha-sendemail-fail' => 'Falschen oder kee CAPTCHA.', + 'captcha-sendemail-fail' => 'Falschen oder kee Confirmatiouns-Code.', 'captcha-disabledinapi' => 'Dës Aktioun brauch e Captcha, dofir ka se net mat enger API gemaach ginn.', 'captchahelp-title' => 'Captcha-Hëllef', 'captchahelp-cookies-needed' => 'Dir musst Cookien an Ärem Browser erlabe fir dat dëst funktionéiert.', - 'captchahelp-text' => "Websäiten, déi et jiddwerengem erlaben Ännerunge virzehuelen, sou wéi op dëser Wiki, ginn dacks vu sougenannte Spammer mëssbraucht, déi automatiséiert hir Linken op vill Internetsäite setzen. Sou Spam-Linke kënne wuel geläscht ginn, mä se sinn trotzdem eng grouss Plo. + 'captchahelp-text' => "Websäiten, déi et jiddwerengem erlaben Ännerunge virzehuelen, sou wéi op dëser Wiki, ginn dacks vu sougenannte Spammer mëssbraucht, déi automatiséiert hir Linken op vill Internetsäite setzen. Esou Spam-Linke kënne wuel geläscht ginn, mä se sinn trotzdem eng grouss Plo. Heiansdo, besonnesch wann nei Internet-Linken op eng Säit derbäigesat ginn, weist dës Wiki Iech e Bild mat faarwegem oder verzerrtem Text a freet Iech fir déi gewise Wierder anzetipppen. Well dëst eng Aufgab ass déi schwéier ze automatiséieren ass, erlaabt dëst, datt Mënschen hir Ännerunge kënnen agi während déi meescht Spammer an aner Roboter-Attacke kënnen ofgewiert ginn. -Leider kann dat zu Schwierigkeete féiere fir Persounen déi net sou gutt gesinn oder déi text-baséiert oder sprooch-baséiert Browser benotzen. +Leider kann dat zu Schwierigkeete féiere fir Persounen déi net esou gutt gesinn oder déi text-baséiert oder sprooch-baséiert Browser benotzen. Zu dësem Zäitpunkt hu mir leider keng audio-Alternativ zu eiser Verfügung. Kontaktéiert w.e.g. [[Special:ListAdmins|een Administrateur]] fir Hëllef wann dëst iech onerwaarter Weis vu legitimen Editen ofhält. @@ -2448,10 +2423,7 @@ $messages['lo'] = array( */ $messages['lrc'] = array( 'captcha-label' => 'كپچا', - 'captcha-createaccount-fail' => 'کد کپچا غلط یا گم بیه.', - 'captcha-sendemail-fail' => 'کد کپچا غلط یا گم بیه.', 'captchahelp-title' => 'هومياری كپچا', - 'captchahelp-cookies-needed' => 'شما با کوکیانه د جاگرد تو فعال بکید سی یه وه کار بکه.', ); /** Lithuanian (lietuvių) @@ -2470,17 +2442,15 @@ $messages['lt'] = array( /** Latvian (latviešu) * @author BrokenArrow - * @author Edgars2007 * @author Marozols * @author Yyy */ $messages['lv'] = array( 'captcha-edit' => 'Lai izmainītu šo lapu, atrisini šo vienādojumu un iegūto skaitli ieraksti šajā lodziņā:
        ([[Special:Captcha/help|Kāpēc tā?]])', - 'captcha-addurl' => 'Tavas izmaiņas ietver jaunu URL saiti. -Lai pasargātos no automātiskas mēstuļošanas, Tev ir jāieraksta te redzamā vienādojuma rezultāts:
        ([[Special:Captcha/help|vairāk informācijas]])', + 'captcha-addurl' => 'Tavas izmaiņas ietver jaunu URL saiti. Lai pasargātos no automātiskas mēstuļošanas, Tev ir jāieraksta te redzamā vienādojuma rezultāts:
        ([[Special:Captcha/help|Kāpēc tā?]])', # Fuzzy 'captcha-badlogin' => 'Lai pasargātos no automātiskiem paroļu lauzējiem, lūdzu aprēķini šīs izteiksmes vērtību un rezultātu ieraksti apakšā esošajā lodziņā ([[Special:Captcha/help|papildus informācija]]):', # Fuzzy 'captcha-createaccount' => 'Lai pasargātos no automātiskas mēstuļošanas, Tev reģistrējoties ir jāieraksta šī vienādojuma rezultāts:
        ([[Special:Captcha/help|Kāpēc tā?]])', # Fuzzy - 'captcha-createaccount-fail' => 'Nepareizs apstiprinājuma kods vai arī tas nav ievadīts.', # Fuzzy + 'captcha-createaccount-fail' => 'Nepareizs apstiprinājuma kods vai arī tas nav ievadīts.', 'captcha-create' => 'Lai izveidotu šo lapu, atrisini šo vienādojumu un rezulātu ieraksti šajā lodziņā:
        ([[Special:Captcha/help|Kāpēc tā?]])', 'captchahelp-cookies-needed' => "Lai šis darbotos, pārlūkprogrammā jābūt iespējotām (''enabled'') sīkdatnēm (''cookies'').", 'captchahelp-text' => "Interneta lapas, kurās iespējams pievienot tekstu, kā šajā wiki, bieži cieš no mēstuļotājiem, kuri izmanto automatizētus līdzekļus, lai pievienotu savus saites daudzās jo daudzās interneta lapās. @@ -2530,10 +2500,10 @@ $messages['mk'] = array( За да ни помогнете да се заштитиме од автоматизиран спам, би ве замолиле да ја решите простата задача подолу и да го внесете резултатот во полето за да можете да го зачувате уредувањето ([[Special:Captcha/help|повеќе инфо]]):', 'captcha-badlogin' => 'За да ни помогнете да се заштитиме од автоматизирано пробивање на лозинки, би ве замолиле да ја решите простата задача подолу и внесете резултатот во полето ([[Special:Captcha/help|повеќе информации]]):', 'captcha-createaccount' => 'За да ни помогнете да се заштитиме од автоматизирано создавање на сметки, би ве замолиле да ја решите простата задача подолу и да го внесете резултатот во полето ([[Special:Captcha/help|повеќе инфо]]):', - 'captcha-createaccount-fail' => 'CAPTCHA е неточен или недостасува.', + 'captcha-createaccount-fail' => 'Потврдниот код е неточен или недостасува.', 'captcha-create' => 'За да ја создадете страницата, прво решете ја простата задача подолу и впишете го решението во полето ([[Special:Captcha/help|повеќе инфо]]):', 'captcha-sendemail' => 'За да се заштитиме од автоматизирано спамирање, би сакале да ве замолиме да ја решите простата задача подолу и да го внесете резултатот во полето ([[Special:Captcha/help|повеќе информации]]):', - 'captcha-sendemail-fail' => 'CAPTCHA е неточен или недостасува.', + 'captcha-sendemail-fail' => 'Потврдниот код е неточен или недостасува.', 'captcha-disabledinapi' => 'Ова дејство бара captcha, така што не може да се изврши преку API.', 'captchahelp-title' => 'Помош со Captcha', 'captchahelp-cookies-needed' => 'Треба да имате овозможено колачиња за да може ова да работи.', @@ -2546,7 +2516,7 @@ $messages['mk'] = array( Во моментов немаме аудио-алтернатива за ова. Контактирајте ги [[Special:ListAdmins|администраторите на страната]] за помош доколку ова неочекувано ве спречува во правењето на искрени придонеси. -Стиснете на копчето „назад“ во вашиот прелисувач за да се вратите на уредувањето на страницата.', +Кликнете на копчето „назад“ во вашиот прелисувач за да се вратите на уредувањето на страницата.', 'captcha-addurl-whitelist' => ' #
         # Опис на синтаксата:
         #  * Сето она што стои по знакот „#“, па до крајот на редот е коментар
        @@ -2567,10 +2537,10 @@ $messages['ml'] = array(
         യാന്ത്രികമായി പാഴെഴുത്തുൾപ്പെടുത്തുന്നതിൽ നിന്നും വിക്കി സം‌രക്ഷിക്കുന്നതിന്റെ ഭാഗമായി, ദയവായി താഴെ കൊടുത്തിരിക്കുന്ന ലഘു ഗണിത ക്രിയ ചെയ്ത് അതിന്റെ ഉത്തരം താഴെയുള്ള പെട്ടിയിൽ ടൈപ്പു ചെയ്യുക ([[Special:Captcha/help|കൂടുതൽ വിവരങ്ങൾ]]):',
         	'captcha-badlogin' => 'യാന്ത്രികമായി രഹസ്യവാക്ക് പൊളിക്കുന്നതിൽ നിന്നും വിക്കി സംരക്ഷിക്കുന്നതിന്റെ ഭാഗമായി, ദയവായി താഴെ കൊടുത്തിരിക്കുന്ന ലഘു ഗണിത ക്രിയ ചെയ്ത്, ഉത്തരം താഴെയുള്ള പെട്ടിയിൽ ടൈപ്പു ചെയ്യുക ([[Special:Captcha/help|കൂടുതൽ വിവരങ്ങൾ]]):',
         	'captcha-createaccount' => 'യാന്ത്രികമായി അംഗത്വം സൃഷ്ടിക്കുന്നതിൽ നിന്നും വിക്കി സം‌രക്ഷിക്കുന്നതിന്റെ ഭാഗമായി, ദയവായി താഴെ കൊടുത്തിരിക്കുന്ന ലഘു ഗണിത ക്രിയ ചെയ്ത് അതിന്റെ ഉത്തരം താഴെയുള്ള പെട്ടിയിൽ ടൈപ്പു ചെയ്യുക ([[Special:Captcha/help|കൂടുതൽ വിവരങ്ങൾ]]):',
        -	'captcha-createaccount-fail' => 'തെറ്റായതോ ലഭ്യമല്ലാത്തതോ ആയ കാപ്ച്ച.',
        +	'captcha-createaccount-fail' => 'തെറ്റായതോ ലഭ്യമല്ലാത്തതോ ആയ സ്ഥിരീകരണ കോഡ്.',
         	'captcha-create' => 'ഈ താൾ സൃഷ്ടിക്കുവാൻ, ദയവായി താഴെ കൊടുത്തിരിക്കുന്ന കൂട്ടൽ ക്രിയയുടെ ഉത്തരം താഴെയുള്ള പെട്ടിയിൽ എഴുതുക  ([[Special:Captcha/help|കൂടുതൽ വിവരങ്ങൾ]]):',
         	'captcha-sendemail' => 'യാന്ത്രികമായ പാഴെഴുത്ത് ഉൾപ്പെടുത്തുന്നതിൽ നിന്നും വിക്കി സംരക്ഷിക്കുന്നതിന്റെ  ഭാഗമായി, ദയവായി താഴെ കൊടുത്തിരിക്കുന്ന ലഘു ഗണിത ക്രിയ ചെയ്ത്, ഉത്തരം പെട്ടിയിൽ എഴുതുക ([[Special:Captcha/help|കൂടുതൽ വിവരങ്ങൾ]]):',
        -	'captcha-sendemail-fail' => 'തെറ്റായതോ ലഭ്യമല്ലാത്തതോ ആയ കാപ്ച്ച.',
        +	'captcha-sendemail-fail' => 'തെറ്റായതോ ലഭ്യമല്ലാത്തതോ ആയ സ്ഥിരീകരണ കോഡ്.',
         	'captcha-disabledinapi' => 'ഈ പ്രവൃത്തി പൂർണ്ണമാകാൻ കാപ്ച ആവശ്യമാണ്, അതുകൊണ്ടിത് എ.പി.ഐ. ഉപയോഗിച്ച് ചെയ്യാൻ കഴിയില്ല.',
         	'captchahelp-title' => 'കാപ്ച്ച സഹായം',
         	'captchahelp-cookies-needed' => 'ഇതു പ്രവർത്തിക്കണമെങ്കിൽ താങ്കളുടെ ബ്രൗസറിൽ കുക്കികൾ സജ്ജീകരിച്ചിരിക്കണം.',
        @@ -2735,7 +2705,6 @@ $messages['nan'] = array(
         /** Norwegian Bokmål (norsk bokmål)
          * @author Audun
          * @author Danmichaelo
        - * @author Event
          * @author Laaknor
          * @author Nghtwlkr
          */
        @@ -2743,14 +2712,13 @@ $messages['nb'] = array(
         	'captcha-edit' => 'Skriv inn summen nedenfor i boksen for å kunne redigere denne siden ([[Special:Captcha/help|mer informasjon]]):',
         	'captcha-desc' => 'Gir tilgang til CAPTCHA-teknikker for å beskytte mot søppl og passordgjetting',
         	'captcha-label' => 'CAPTCHA',
        -	'captcha-addurl' => 'Din redigering inneholder nye eksterne lenker.
        -Løs den enkle summeringen i boksen nedenfor for å beskytte mot automatisk spam ([[Special:Captcha/help|Mer informasjon]]):',
        -	'captcha-badlogin' => 'Løs den enkle summeringen i boksen nedenfor for å beskytte mot automatisk passordtyveri ([[Special:Captcha/help|Mer informasjon]]):',
        -	'captcha-createaccount' => 'Løs den enkle summeringen i boksen nedenfor for å beskytte mot automatisk kontoopprettelse ([[Special:Captcha/help|Mer informasjon]]):',
        -	'captcha-createaccount-fail' => 'Feil eller manglende CAPTCHA-svar.',
        +	'captcha-addurl' => 'Din redigering inneholder nye eksterne lenker. Løs det enkle regnestykket i boksen nedenfor for å hjelpe oss å beskytte oss mot automatisk spam ([[Special:Captcha/help|mer informasjon]]):', # Fuzzy
        +	'captcha-badlogin' => 'Løs det enkle regnestykket i boksen nedenfor for å hjelpe oss å beskytte oss mot automatisk passordtyveri ([[Special:Captcha/help|mer informasjon]]):', # Fuzzy
        +	'captcha-createaccount' => 'Løs det enkle regnestykket i boksen nedenfor for å hjelpe oss å beskytte oss mot automatisk kontoopprettelse ([[Special:Captcha/help|mer informasjon]]):', # Fuzzy
        +	'captcha-createaccount-fail' => 'Feil eller manglende bekreftelseskode.',
         	'captcha-create' => 'Løs det enkle regnestykket i boksen nedenfor for å opprette siden ([[Special:Captcha/help|mer informasjon]]):',
        -	'captcha-sendemail' => 'Løs den enkle summeringen i boksen nedenfor for å beskytte mot automatisk spamming ([[Special:Captcha/help|m\\Mer informasjon]]):',
        -	'captcha-sendemail-fail' => 'Feil eller manglende CAPTCHA-svar.',
        +	'captcha-sendemail' => 'Løs det enkle regnestykket i boksen nedenfor for å hjelpe oss å beskytte oss mot automatisk spamming ([[Special:Captcha/help|mer informasjon]]):', # Fuzzy
        +	'captcha-sendemail-fail' => 'Ukorrekt eller manglende bekreftelseskode.',
         	'captcha-disabledinapi' => 'Denne handlinger krever en captcha, så den kan ikke bli gjort gjennom APIet.',
         	'captchahelp-title' => 'Hjelp med Captcha',
         	'captchahelp-cookies-needed' => 'Du må slå på informasjonskapsler for at dette skal fungere.',
        @@ -2812,9 +2780,9 @@ Mit den „Trüch“-Knopp vun dien Browser kummst du trüch na dat Ännerfinste
          */
         $messages['nds-nl'] = array(
         	'captcha-edit' => "Um disse zied te bewarken, mu'j eerst t antwoord op disse eenvoudige somme invullen ([[Special:Captcha/help|meer informasie]]):",
        -	'captcha-desc' => 'Biedt CAPTCHA-technieken um bescharming te biejen tegen spam en t raojen van wachtwoorden',
        +	'captcha-desc' => 'Biejt CAPTCHA-technieken um bescharming te biejen tegen moekpost en t raojen van wachtwoorden',
         	'captcha-addurl' => 'In joew bewarking staon nieje uutgaonde verwiezingen.
        -Vul ter de bescharming van disse wiki tegen automatiese moekbiedragen t antwoord op de somme in, in t invoerveld dat hieronder steet, um joew bewarking op te slaon:
        +Vul ter de bescharming van disse wiki tegen automatiese moekpost t antwoord op de somme in, in t invoerveld dat hieronder steet, um joew bewarking op te slaon:
        ([[Special:Captcha/help|meer informasie]])', 'captcha-badlogin' => 'Vul ter de bescharming van disse wiki tegen t automaties kraken van wachtwoorden t antwoord op de somme in, in t invoerveld ([[Special:Captcha/help|meer informasie]]):', 'captcha-createaccount' => 'Vul ter bescharming van disse wiki tegen t automaties anmaken van gebrukers t antwoord op de somme in, in t invoerveld ([[Special:Captcha/help|meer informasie]]):', @@ -2853,11 +2821,11 @@ Voer het antwoord op de onderstaande eenvoudige som in het invoervenster in ([[S Voer ter bescherming tegen geautomatiseerde spam het antwoord op de onderstaande eenvoudige som in in het invoerveld om uw bewerking op te slaan ([[Special:Captcha/help|meer informatie]]):", 'captcha-badlogin' => 'Los de onderstaande eenvoudige som op en voer het antwoord in het invoervenster in ter bescherming tegen het automatisch kraken van wachtwoorden ([[Special:Captcha/help|meer informatie]]):', 'captcha-createaccount' => 'Voer ter bescherming tegen het geautomatiseerd gebruikers aanmaken, het antwoord op de onderstaande eenvoudige som in in het invoervenster ([[Special:Captcha/help|meer informatie]]):', - 'captcha-createaccount-fail' => 'De CAPTCHA ontbreekt of is onjuist.', + 'captcha-createaccount-fail' => 'De bevestigingscode ontbreekt of is onjuist.', 'captcha-create' => 'U wilt een nieuwe pagina aanmaken. Voer het antwoord op de onderstaande eenvoudige som in het invoervenster in ([[Special:Captcha/help|meer informatie]]):', 'captcha-sendemail' => 'Voer ter bescherming tegen geautomatiseerde spam het antwoord op de onderstaande eenvoudige som in het invoervenster in ([[Special:Captcha/help|meer informatie]]):', - 'captcha-sendemail-fail' => 'De CAPTCHA ontbreekt of is onjuist.', + 'captcha-sendemail-fail' => 'De bevestigingscode ontbreekt of is onjuist.', 'captcha-disabledinapi' => 'Voor deze handeling is een captcha nodig die niet afgehandeld kan worden via de API.', 'captchahelp-title' => 'Captcha-hulppagina', 'captchahelp-cookies-needed' => 'U dient in uw browser cookies ingeschakeld te hebben om dit te laten werken.', @@ -2942,10 +2910,9 @@ Trykk på «attende»-knappen for å kome tilbake til endringssida.', */ $messages['oc'] = array( 'captcha-edit' => "Per modificar aquesta pagina, vos cal efectuar lo calcul çaijós e n'inscriure lo resultat dins lo camp ([[Special:Captcha/help|Mai d’entresenhas]]) :", - 'captcha-desc' => 'Ofèrta de tecnicas CAPTCHA per protegir contra lo spam e la descobèrta dels senhals per ensages multiples', + 'captcha-desc' => 'Implementacion captcha simpla', # Fuzzy 'captcha-label' => 'CAPTCHA', - 'captcha-addurl' => "Vòstra modificacion inclutz de ligams extèrnes. -Per nos ajudar dins la proteccion contra lo corrièr indesirable automatizat, calculatz l'operacion simpla çaijós e inscrivissètz-ne lo resultat dins lo camp ([[Special:Captcha/help|mai d'informacions]]) :", + 'captcha-addurl' => "Vòstra modificacion inclutz de ligams URL novèla ; per empachar las connexions automatizadas, vos cal picar los mots que s’afichan dins l’imatge que seguís :
        ([[Special:Captcha/help|Qu'es aquò?]])", # Fuzzy 'captcha-badlogin' => "Per ensajar de contornar las temptativas de cracatge de senhals automatizadas per de robòts, recopiatz lo tèxte çaijós dins la bóstia de tèxte plaçada al dejós d'aqueste. ([[Special:Captcha/help|Mai d’entresenhas]])", # Fuzzy 'captcha-createaccount' => 'Coma proteccion contra las creacions de compte abusivas, entratz lo resultat de l’addicion dins la bóstia çaijós:
        ([[Special:Captcha/help|mai d’entresenhas]])', # Fuzzy @@ -3085,11 +3052,11 @@ e ch'a buta l'arzulta ant ël quadrèt ([[Special:Captcha/help|për savejne dë 'captcha-badlogin' => "Për goerné la wiki da ij programa ch'a fan ciav fàusse n'automàtich, i-j ciamoma për piasì ch'a fasa ël total ambelessì-sota e ch'a buta l'arzultà ant ël quadrèt ([[Special:Captcha/help|për savejne dë pì]]):", 'captcha-createaccount' => "Për goerné la wiki da ij programa ch'a deurbo dij cont n'automàtich, i-j ciamoma për piasì ch'a fasa ël total ambelessì-sota e ch'a buta l'arzultà ant ël quadrèt ([[Special:Captcha/help|për savejne dë pì]]):", - 'captcha-createaccount-fail' => "Ël còde tërbol ò ch'a manca d'autut ò ch'a l'é pa bon.", + 'captcha-createaccount-fail' => "Ël còdes ëd verìfica ò ch'a manca d'autut ò ch'a l'é pa bon.", 'captcha-create' => "Për creé d'amblé sta pàgina-sì, për piasì ch'a fasa ël total ambelessì sota e ch'a buta l'arzultà
        ant ël quadrèt ([[Special:Captcha/help|për savejne dë pì]]):", 'captcha-sendemail' => "Për protegi la wiki contra la rumenta automàtica, i-j ciamoma për piasì ch'a fasa l'adission sempia sì-sota e ch'a buta l'arspòsta ant la casela ([[Special:Captcha/help|për savèjne ëd pi]]):", - 'captcha-sendemail-fail' => "Ël còdes tërbol ò ch'a manca d'autut ò ch'a l'é pa bon.", + 'captcha-sendemail-fail' => "Ël còdes ëd verìfica ò ch'a manca d'autut ò ch'a l'é pa bon.", 'captcha-disabledinapi' => "St'assion-sì a ciama na captcha, parèj a peul pa esse fàita con na API.", 'captchahelp-title' => 'Còs é-lo mai ës captcha?', 'captchahelp-cookies-needed' => "Për podej dovré sossì a l'ha da manca che sò navigator (browser) a pija ij cookies.", @@ -3219,10 +3186,10 @@ $messages['pt-br'] = array( Como prevenção contra sistemas automatizados que inserem spam, será necessário resolver a simples soma abaixo e inserir sua resposta no respectivo campo ([[Special:Captcha/help|detalhes]])', 'captcha-badlogin' => 'Como prevenção contra sistemas automatizados de pesquisa e descoberta de senhas, será necessário resolver a simples soma abaixo e inserir sua resposta no respectivo campo ([[Special:Captcha/help|detalhes]])', 'captcha-createaccount' => 'Para proteger a wiki contra sistemas automatizados de criação de contas, solicitamos que resolva a soma simples apresentada abaixo e introduza a resposta no respectivo campo ([[Special:Captcha/help|mais informações]]):', - 'captcha-createaccount-fail' => 'Código de confirmação incorreto ou não preenchido.', # Fuzzy + 'captcha-createaccount-fail' => 'Código de confirmação incorreto ou não preenchido.', 'captcha-create' => 'Para criar a página, por favor resolva a simples soma abaixo e entre com a resposta no respectivo campo ([[Special:Captcha/help|o que é isto?]])', 'captcha-sendemail' => 'Como proteção ao wiki contra spam automatizado, será necessário resolver a simples soma abaixo e inserir sua resposta no respectivo campo ([[Special:Captcha/help|detalhes]]):', - 'captcha-sendemail-fail' => 'Código CAPTCHA incorreto ou não preenchido.', + 'captcha-sendemail-fail' => 'Código de confirmação incorreto ou não preenchido.', 'captcha-disabledinapi' => 'Esta operação necessita de captcha, por isso não pode ser realizada através da API.', 'captchahelp-title' => 'Ajuda com o Captcha', 'captchahelp-cookies-needed' => 'Você precisa ter cookies habilitados em seu navegador para que possa funcionar', @@ -3249,7 +3216,6 @@ Pressione o botão 'voltar' de seu navegador para retornar à página de ediçã * @author AlimanRuna */ $messages['qu'] = array( - 'captcha-badlogin' => 'Wikita kikinmanta millay ruraq yaykuna rima chamqaymanta amachanapaqqa, kay qatiq yapayta ruraspa yapasqata kahachapi yaykuchiy ([[Special:Captcha/help|astawan yachay]]):', 'captchahelp-title' => 'Captcha nisqamanta yanapay', ); @@ -3513,48 +3479,10 @@ Fari clic supra ô buttuni 'back' dû browser pi turnari a la pàggina di mudìf ); /** Scots (Scots) - * @author John Reid * @author OchAyeTheNoo */ $messages['sco'] = array( - 'captcha-edit' => 'Tae edit this page, please solve the simple sum ablow an enter the answer in the box ([[Special:Captcha/help|more info]]):', - 'captcha-desc' => 'Provides CAPTCHA techniques fer tae protect again spam an passwaird-guessin', - 'captcha-label' => 'CAPTCHA.', - 'captcha-addurl' => 'Yer eidit inclædes new external airtins. -Tae protect the wiki again autæmated spam, we kindly ask ye tae solve the symple sum ablow an enter the answer in the box in order tae save yer eidit ([[Special:Captcha/help|mair info]]):', - 'captcha-badlogin' => 'Tae protect the wiki fae autaemated passwaird cracking, we kindly ask ye tae solve the symple sum ablow an enter the answer in the box ([[Special:Captcha/help|mair info]]):', - 'captcha-createaccount' => 'Tae protect the wiki fae autæmated accoont creation, we kindly ask ye tae solve the symple sum ablow an enter the answer in the box ([[Special:Captcha/help|mair info]]):', - 'captcha-createaccount-fail' => 'Oncorrect or missing CAPTCHA.', - 'captcha-create' => 'Tae mak the page, please solve the symple sum ablow an enter the answer in the box ([[Special:Captcha/help|mair info]]):', - 'captcha-sendemail' => 'Tae protect the wiki fae autæmated spamming, we kindly ask ye tae solve the symple sum ablow an enter the answer in the box ([[Special:Captcha/help|mair info]]):', - 'captcha-sendemail-fail' => 'Oncorrect or missing CAPTCHA.', - 'captcha-disabledinapi' => 'This action needs ae CAPTCHA, sae it canna be performed through the API.', - 'captchahelp-title' => 'CAPTCHA heelp', - 'captchahelp-cookies-needed' => "Ye'll need tae haee cookies enabled in yer brouser fer this tae wairk.", - 'captchahelp-text' => 'Wab sites that accept postings fae the public, like this wiki, ar aften abused bi spammers wha uise autaemated tuils tae post their links til moni sites. -While these spam links can be remuived, they ar ae signeeficant nuisance. - -Sometimes, especially whan adding new wab links til ae page, the wiki micht shaw ye aen eimage o coloured or distorted tex an ask ye tae type the wairds shawn. -Syne this is ae task that\'s hard tae autæmate, it will allou maist real bodies tae mak their posts while stapping maist spammers an ither robotic attackers. - -Onfortunately this can inconvenience uisers with limited vision or uising tex-based or speech-based brousers. -At the moment we dinna hae aen audio alternative available. -Please contact the [[Special:ListAdmins|site admeenistraters]] fer assistance gif this is onexpectedly preventin ye fae makin legeetimate actions. - -Hit the "back" button in yer brouser tae return til the page eiditer.', - 'captcha-addurl-whitelist' => ' #
        -# Syntax is aes follows:
        -#   * Awthin fae ae "#" chairacter til the end o the line is ae comment
        -#   * Ilka no-blank line is ae regex fragment that will yinly match hosts inside URLs
        - #
        ', - 'right-skipcaptcha' => 'Perform CAPTCHA-triggering actions wiout haein tae gae through the CAPTCHA', -); - -/** Serbo-Croatian (srpskohrvatski / српскохрватски) - * @author Kolega2357 - */ -$messages['sh'] = array( - 'captcha-createaccount-fail' => 'Netačan unos ili nedostatak koda za potvrđivanje.', + 'captcha-edit' => 'Tae edit this airticle, please dae the eisy sum ablo an put the answer in the box ([[Special:Captcha/help|mair info]])', # Fuzzy ); /** Sinhala (සිංහල) @@ -3704,7 +3632,6 @@ Shtypni butonin "prapa" ("back") të shfletuesit tuaj për tu kthyer tek faqja e ); /** Serbian (Cyrillic script) (српски (ћирилица)‎) - * @author Milicevic01 * @author Millosh * @author Rancher */ @@ -3714,46 +3641,31 @@ $messages['sr-ec'] = array( 'captcha-addurl' => 'Ваша измена садржи нове спољашње везе. У циљу заштите од непожељних порука, решите просту рачуницу испод и унесите одговор у поље ([[Special:Captcha/help|више информација]]):', # Fuzzy 'captcha-badlogin' => 'У циљу заштите од пробијања лозинки, решите просту рачуницу испод и унесите одговор у поље ([[Special:Captcha/help|више информација]]):', # Fuzzy - 'captcha-createaccount' => 'У циљу заштите од аутоматизованог вандализма, решите просту рачуницу испод и унесите одговор у поље ([[Special:Captcha/help|више информација]]):', - 'captcha-createaccount-fail' => 'Неправилан или непостојећи код за потврду.', # Fuzzy + 'captcha-createaccount' => 'У циљу заштите од самоотварања налога, решите просту рачуницу испод и унесите одговор у поље ([[Special:Captcha/help|више информација]]):', # Fuzzy + 'captcha-createaccount-fail' => 'Неправилан или непостојећи код за потврду.', 'captcha-create' => 'Да бисте направили страницу, решите просту рачуницу испод и унесите одговор у поље ([[Special:Captcha/help|више информација]]):', 'captcha-sendemail' => 'У циљу заштите од слања непожељних порука, решите просту рачуницу испод и унесите одговор у поље ([[Special:Captcha/help|више информација]]):', # Fuzzy - 'captcha-sendemail-fail' => 'Неправилан или непостојећи код за потврду.', # Fuzzy - 'captchahelp-title' => 'Помоћ око потврдног кoда', + 'captcha-sendemail-fail' => 'Неправилан или непостојећи код за потврду.', + 'captchahelp-title' => 'Помоћ око потврдног кôда', 'captchahelp-cookies-needed' => 'Потребно је да омогућите колачиће да би ово радило.', - 'captchahelp-text' => 'Веб-сајтове који подржавају слање садржаја из јавности, као што је овај вики, често злоупотребљавају вандали који користе аутоматизоване алате да шаљу своје повезнице ка многим сајтовима. Иако се ове нежељене повезнице могу уклонити, оне задају велику муку. - -Понекад, поготово када се додају нове интернет повезнице на страну, вики софтвер вам може показати слику обојеног и изврнутог текста и тражити да укуцате тражену реч. Пошто је тешко аутоматизовати овакав задатак, он омогућује свим правим људима да врше своје измене, али ће зато спречити вандале и остале роботске нападаче. - -Нажалост, ово може да буде неповољно за кориснике са ограниченим видом и за оне који користе прегледаче базиране на тексту или говору. У овом тренутку, аудио алтернатива није доступна. Молимо контактирајте администраторе сајта ради помоћи ако вас ово неочекивано омета у прављењу добрих измена. - -Кликните на дугме „назад“ вашег прегледача да се вратите на поље за унос текста.', # Fuzzy 'right-skipcaptcha' => 'прескакање радњи које захтевају унос потврдног кода', ); /** Serbian (Latin script) (srpski (latinica)‎) * @author Michaello - * @author Milicevic01 */ $messages['sr-el'] = array( 'captcha-edit' => 'Za izmenu ove strane, reši jednostavan zbri ispod i unesi odgovor u kutiju ([[Special:Captcha/help|detaljnije]]):', 'captcha-desc' => 'Pruža zaštitu protiv nepoželjnih poruka u vidu potvrdnog koda', 'captcha-addurl' => 'Tvoja izmena uključuje nove spoljašnje veze. U cilju zaštite protiv automatskog spama, reši jednostavan zbir ispod i upiši odgovor u kutiju ([[Special:Captcha/help|detaljnije]]):', # Fuzzy 'captcha-badlogin' => 'U cilju zaštite od automatske provale u lozinku, reši jednostavan zbir ispod i unesi odgovor u kutiju ([[Special:Captcha/help|detaljnije]]):', # Fuzzy - 'captcha-createaccount' => 'U cilju zaštite od automatizovanog vandalizma, rešite prostu računicu ispod i unesite odgovor u polje ([[Special:Captcha/help|više informacija]]):', - 'captcha-createaccount-fail' => 'Nepravilan ili nepostojeći kod za potvrdu.', # Fuzzy + 'captcha-createaccount' => 'U cilju zaštite od automatskog stvaranja naloga, reši jednostavan zbir dole i unesi ga u kutiju ([[Special:Captcha/help|detaljnije]]):', # Fuzzy + 'captcha-createaccount-fail' => 'Nepravilan ili nepostojeći kod za potvrdu.', 'captcha-create' => 'Za stvaranje strane reši jednostavan zbir dole i unesi ga u kutiju ([[Special:Captcha/help|detaljnije]]):', - 'captcha-sendemail-fail' => 'Nepravilan ili nepostojeći kod za potvrdu.', # Fuzzy - 'captchahelp-title' => 'Pomoć oko potvrdnog koda', + 'captcha-sendemail-fail' => 'Nepravilan ili nepostojeći kod za potvrdu.', + 'captchahelp-title' => 'pomoć za kapču', 'captchahelp-cookies-needed' => 'Da bi ovo uradio, neophodno je da su ti kolačići omogućeni u brauzeru.', - 'captchahelp-text' => 'Veb-sajtove koji podržavaju slanje sadržaja iz javnosti, kao što je ovaj viki, često zloupotrebljavaju vandali koji koriste automatizovane alate da šalju svoje poveznice ka mnogim sajtovima. Iako se ove neželjene poveznice mogu ukloniti, one zadaju veliku muku. - -Ponekad, pogotovo kada se dodaju nove internet poveznice na stranu, viki softver vam može pokazati sliku obojenog i izvrnutog teksta i tražiti da ukucate traženu reč. Pošto je teško automatizovati ovakav zadatak, on omogućuje svim pravim ljudima da vrše svoje izmene, ali će zato sprečiti vandale i ostale robotske napadače. - -Nažalost, ovo može da bude nepovoljno za korisnike sa ograničenim vidom i za one koji koriste pregledače bazirane na tekstu ili govoru. U ovom trenutku, audio alternativa nije dostupna. Molimo kontaktirajte administratore sajta radi pomoći ako vas ovo neočekivano ometa u pravljenju dobrih izmena. - -Kliknite na dugme „nazad“ vašeg pregledača da se vratite na polje za unos teksta.', # Fuzzy - 'right-skipcaptcha' => 'preskakanje radnji koje zahtevaju unos potvrdnog koda', + 'right-skipcaptcha' => 'Izvedi akcije kapče bez potrebe da se prođe kroz kapču.', ); /** Seeltersk (Seeltersk) @@ -3822,7 +3734,6 @@ Hit the 'back' button in your browser to return to the page editor.", # Fuzzy * @author Martinwiss * @author Per * @author Rotsee - * @author WikiPhoenix */ $messages['sv'] = array( 'captcha-edit' => 'För att redigera den här sidan måste du först skriva svaret på följande @@ -3832,11 +3743,11 @@ räkneuppgift i rutan ([[Special:Captcha/help|mer information]]):', 'captcha-addurl' => 'Din ändring innebär nya externa länkar i texten. För att skydda wikin mot automatisk spam måste du skriva svaret på följande räkneuppgift i rutan ([[Special:Captcha/help|mer information]]):', 'captcha-badlogin' => 'För att skydda mot wikin mot försök att knäcka lösenord på automatisk väg, måste du skriva svaret på följande räkneuppgift i rutan ([[Special:Captcha/help|mer information]]):', 'captcha-createaccount' => 'För att skydda wikin mot automatiskt skapade användarkonton, måste du skriva svaret på följande räkneuppgift i rutan ([[Special:Captcha/help|mer information]]):', - 'captcha-createaccount-fail' => 'Felaktig eller saknad CAPTCHA.', + 'captcha-createaccount-fail' => 'Bekräftelsekoden är felaktig eller saknas.', 'captcha-create' => 'För att skapa den här sidan måste du skriva svaret på följande räkneuppgift i rutan ([[Special:Captcha/help|mer information]]):', 'captcha-sendemail' => 'För att skydda wikin mot spam, ber vi dig att lösa den här enkla räkneuppgiften, och skriva in svaret i rutan ([[Special:Captcha/help|mer information]]):', - 'captcha-sendemail-fail' => 'Felaktig eller saknad CAPTCHA.', + 'captcha-sendemail-fail' => 'Felaktig eller saknad bekräftelsekod.', 'captcha-disabledinapi' => 'Denna åtgärd kräver en captcha, så den kan inte utföras genom APIet.', 'captchahelp-title' => 'Captchahjälp', 'captchahelp-cookies-needed' => 'Du måste ha cookies aktiverade i din webbläsare för att det här ska fungera.', @@ -4066,13 +3977,13 @@ $messages['tr'] = array( 'captcha-desc' => 'Spam ve parola tahminine karşı korunmak için "Güvenlik Kodu" (CAPTCHA) tekniği sağlar.', 'captcha-label' => 'Güvenlik Kodu', 'captcha-addurl' => 'Değişikliğiniz yeni dış bağlantılar içeriyor. -Vikiyi otomatik spamdan korumak ve değişikliğinizi kaydetmek için, aşağıdaki basit toplamı çözmenizi ve yanıtı kutunun içine yazmanızı rica ediyoruz ([[Special:Captcha/help|ayrıntılı bilgi]]):', - 'captcha-badlogin' => 'Vikiyi otomatik parola çözülmesine karşı korumak için, aşağıdaki basit toplamı çözmenizi ve yanıtı kutunun içine yazmanızı rica ediyoruz ([[Special:Captcha/help|ayrıntılı bilgi]]):', - 'captcha-createaccount' => 'Vikiyi otomatik hesap oluşturmaya karşı korumak için, aşağıdaki basit toplamı çözmenizi ve yanıtı kutunun içine yazmanızı rica ediyoruz ([[Special:Captcha/help|ayrıntılı bilgi]]):', - 'captcha-createaccount-fail' => 'Hatalı ya da eksik CAPTCHA.', +Otomatik spamdan korunmak için lütfen aşağıdaki basit soruyu yanıtlayın ve yanıtı kutunun içine yazın ([[Special:Captcha/help|ayrıntılı bilgi]]):', # Fuzzy + 'captcha-badlogin' => 'Otomatik parola çözülmesine karşı korunmak için, lütfen aşağıdaki basit soruyu yanıtlayın ve kutunın içinde yanıtı yazın ([[Special:Captcha/help|ayrıntılı bilgi]]):', # Fuzzy + 'captcha-createaccount' => 'Otomatik hesap oluşturmaya karşı korunmak için, lütfen aşağıdaki basit soruyu yanıtlayın ve kutunın içinde yanıtı yazın ([[Special:Captcha/help|ayrıntılı bilgi]]):', # Fuzzy + 'captcha-createaccount-fail' => 'Hatalı ya da eksik onay kodu.', 'captcha-create' => 'Bu sayfayı oluşturmak için, lütfen aşağıdaki basit soruyu yanıtlayın ve kutunun içinde yanıtı yazın ([[Special:Captcha/help|ayrıntılı bilgi]]):', - 'captcha-sendemail' => 'Vikiyi otomatik spamlara karşı korumaya yardımcı olmak için, aşağıdaki basit toplamı çözmenizi ve yanıtı kutunun içine yazmanızı rica ediyoruz ([[Special:Captcha/help|ayrıntılı bilgi]]):', - 'captcha-sendemail-fail' => 'Hatalı ya da eksik CAPTCHA.', + 'captcha-sendemail' => 'Otomatik spamlara karşı korunmaya yardımcı olmak için, lütfen aşağıdaki basit işlemi çözün ve yanıtı kutuya yazın ([[Special:Captcha/help|ayrıntılı bilgi]]):', # Fuzzy + 'captcha-sendemail-fail' => 'Hatalı ya da eksik onay kodu.', 'captcha-disabledinapi' => 'Bu eylem güvenlik kodu gerektiriyor, dolayısıyla API aracılığıyla yapılamaz.', 'captchahelp-title' => 'Güvenlik kodu yardımı', 'captchahelp-cookies-needed' => 'Bunun çalışabilmesi için tarayıcınızın çerezleri etkinleştirilmelidir.', @@ -4101,7 +4012,6 @@ $messages['tru'] = array( /** Ukrainian (українська) * @author Ahonc * @author Alex Khimich - * @author Andriykopanytsia * @author NickK * @author Olvin * @author Riwnodennyk @@ -4116,10 +4026,10 @@ $messages['uk'] = array( Із метою захисту від автоматичного спаму, будь ласка, виконайте просту арифметичну дію і введіть відповідь у текстове поле, щоб редагування було збережене ([[Special:Captcha/help|докладніше]]):', 'captcha-badlogin' => 'Із метою захисту від автоматичного злому пароля, будь ласка, виконайте просту арифметичну дію і введіть відповідь у текстове поле ([[Special:Captcha/help|докладніше]]):', 'captcha-createaccount' => 'Із метою захисту від автоматичного створення облікового запису просимо виконати просту арифметичну дію і ввести відповідь у текстове поле ([[Special:Captcha/help|докладніше]]):', - 'captcha-createaccount-fail' => 'Неправильна або відсутня капча.', + 'captcha-createaccount-fail' => 'Неправильний або відсутній код підтвердження.', 'captcha-create' => 'Щоб створити сторінку, будь ласка, виконайте просту арифметичну дію і введіть відповідь у текстове поле ([[Special:Captcha/help|докладніше]]):', 'captcha-sendemail' => "Із метою захисту вікі від автоматичного спаму просимо розв'язати простий математичний приклад і ввести відповідь ([[Special:Captcha/help|деталі]]):", - 'captcha-sendemail-fail' => 'Неправильна або відсутня капча.', + 'captcha-sendemail-fail' => 'Неправильний або відсутній код підтвердження.', 'captcha-disabledinapi' => 'Ця дія потребує перевірки CAPTCHA, тому не може бути здійснена за допомогою API.', 'captchahelp-title' => 'Довідка про CAPTCHA', 'captchahelp-cookies-needed' => 'Вам потрібно ввімкнути куки у браузері, щоб ця функція запрацювала.', @@ -4185,11 +4095,11 @@ $messages['vi'] = array( 'captcha-addurl' => 'Sửa đổi của bạn có chứa các liên kết ra bên ngoài. Để tránh spam tự động trong wiki, xin bạn vui lòng giải phép toán đơn giản ở dưới và nhập kết quả vào ô để lưu giữ các sửa đổi của bạn ([[Special:Captcha/help|thông tin thêm]]):', 'captcha-badlogin' => 'Để tránh vụ tự động bẻ mật khẩu của người dùng wiki, xin bạn vui lòng giải phép cộng đơn giản ở dưới và nhập kết quả vào ô ([[Special:Captcha/help|thông tin thêm]]):', 'captcha-createaccount' => 'Để tránh vụ tự động mở tài khoản trong wiki, xin bạn vui lòng giải phép cộng đơn giản ở dưới và nhập kết quả vào ô ([[Special:Captcha/help|thông tin thêm]]):', - 'captcha-createaccount-fail' => 'CAPTCHA bị thiếu hoặc không chính xác.', + 'captcha-createaccount-fail' => 'Thiếu mã xác nhận hoặc mã xác nhận sai.', 'captcha-create' => 'Để tạo mới trang, xin hãy giải phép cộng đơn giản ở dưới và gõ câu trả lời vào ô ([[Special:Captcha/help|thông tin thêm]]):', 'captcha-sendemail' => 'Để xác nhận rằng bạn không phải là tay spam, xin bạn vui lòng giải phép cộng đơn giản ở dưới và nhập kết quả vào ô ([[Special:Captcha/help|thông tin thêm]]):', - 'captcha-sendemail-fail' => 'CAPTCHA bị thiếu hoặc không chính xác.', + 'captcha-sendemail-fail' => 'Mã xác nhận không chính xác hoặc chưa được cung cấp.', 'captcha-disabledinapi' => 'Tác vụ này đòi người dùng giải CAPTCHA trước tiên, nên không thể thực hiện nó qua API.', 'captchahelp-title' => 'Trợ giúp Captcha', 'captchahelp-cookies-needed' => 'Bạn cần phải bật cookie trong trình duyệt để chức năng này hoạt động được.', @@ -4218,8 +4128,7 @@ Nhấn chuột vào nút “Back” của trình duyệt để trở lại trang */ $messages['vo'] = array( 'captcha-edit' => 'Ad redakön yegedi at, dunolös, begö! saedami dono e penolös saedoti in bokil ([[Special:Captcha/help|nüns pluik]]):', - 'captcha-addurl' => 'Redakam olik keninükon yümis plödik nulik. -Ad jelön siti ta peneds badik itjäfidik, dunolös, begö! saedami balugik sököl, e penolös saedoti in bokil ad dakipön redakam ola ([[Special:Captcha/help|nüns pluik]]):', + 'captcha-addurl' => 'Redakam olik keninükon yümis plödik nulik. Ad jelön siti ta peneds itjäfidik, dunolös, begö! saedami sököl, e penolös saedoti in bokil ([[Special:Captcha/help|nüns pluik]]):', # Fuzzy 'captcha-badlogin' => 'Ad jelön siti ta daget itjäfidik letavödas, dunolös, begö! saedami sököl e penolös saedoti in bokil ([[Special:Captcha/help|nüns pluik]]):', # Fuzzy 'captcha-createaccount' => 'Ad jelön siti ta kalijafam itjäfidik, dunolös, begö! saedami sököl e penolös saedoti in bokil ([[Special:Captcha/help|nüns pluik]]):', # Fuzzy 'captcha-createaccount-fail' => 'Kot fümükama paneveräton u paseleton.', diff --git a/extensions/ConfirmEdit/ConfirmEdit.php b/extensions/ConfirmEdit/ConfirmEdit.php index f0836973..d861a04a 100644 --- a/extensions/ConfirmEdit/ConfirmEdit.php +++ b/extensions/ConfirmEdit/ConfirmEdit.php @@ -189,8 +189,6 @@ $wgHooks['EmailUser'][] = 'ConfirmEditHooks::confirmEmailUser'; $wgHooks['APIEditBeforeSave'][] = 'ConfirmEditHooks::confirmEditAPI'; $wgHooks['APIGetAllowedParams'][] = 'ConfirmEditHooks::APIGetAllowedParams'; $wgHooks['APIGetParamDescription'][] = 'ConfirmEditHooks::APIGetParamDescription'; -$wgHooks['AddNewAccountApiForm'][] = 'ConfirmEditHooks::addNewAccountApiForm'; -$wgHooks['AddNewAccountApiResult'][] = 'ConfirmEditHooks::addNewAccountApiResult'; $wgAutoloadClasses['ConfirmEditHooks'] = "$wgConfirmEditIP/ConfirmEditHooks.php"; $wgAutoloadClasses['SimpleCaptcha'] = "$wgConfirmEditIP/Captcha.php"; @@ -198,6 +196,7 @@ $wgAutoloadClasses['CaptchaStore'] = "$wgConfirmEditIP/CaptchaStore.php"; $wgAutoloadClasses['CaptchaSessionStore'] = "$wgConfirmEditIP/CaptchaStore.php"; $wgAutoloadClasses['CaptchaCacheStore'] = "$wgConfirmEditIP/CaptchaStore.php"; $wgAutoloadClasses['CaptchaSpecialPage'] = "$wgConfirmEditIP/ConfirmEditHooks.php"; +$wgAutoloadClasses['HTMLCaptchaField'] = "$wgConfirmEditIP/HTMLCaptchaField.php"; /** * Set up $wgWhitelistRead diff --git a/extensions/ConfirmEdit/ConfirmEditHooks.php b/extensions/ConfirmEdit/ConfirmEditHooks.php index af8b9c44..bc85138d 100644 --- a/extensions/ConfirmEdit/ConfirmEditHooks.php +++ b/extensions/ConfirmEdit/ConfirmEditHooks.php @@ -4,7 +4,7 @@ class ConfirmEditHooks { /** * Get the global Captcha instance * - * @return SimpleCaptcha + * @return Captcha|SimpleCaptcha */ static function getInstance() { global $wgCaptcha, $wgCaptchaClass; @@ -26,21 +26,13 @@ class ConfirmEditHooks { static function confirmEditAPI( $editPage, $newtext, &$resultArr ) { return self::getInstance()->confirmEditAPI( $editPage, $newtext, $resultArr ); } - - static function addNewAccountApiForm( $apiModule, $loginForm ) { - return self::getInstance()->addNewAccountApiForm( $apiModule, $loginForm ); - } - - static function addNewAccountApiResult( $apiModule, $loginPage, &$result ) { - return self::getInstance()->addNewAccountApiResult( $apiModule, $loginPage, $result ); - } static function injectUserCreate( &$template ) { return self::getInstance()->injectUserCreate( $template ); } - static function confirmUserCreate( $u, &$message, &$status = null ) { - return self::getInstance()->confirmUserCreate( $u, $message, $status ); + static function confirmUserCreate( $u, &$message ) { + return self::getInstance()->confirmUserCreate( $u, $message ); } static function triggerUserLogin( $user, $password, $retval ) { diff --git a/extensions/ConfirmEdit/FancyCaptcha.class.php b/extensions/ConfirmEdit/FancyCaptcha.class.php index e2dbb82b..d1c6a41f 100644 --- a/extensions/ConfirmEdit/FancyCaptcha.class.php +++ b/extensions/ConfirmEdit/FancyCaptcha.class.php @@ -14,8 +14,7 @@ class FancyCaptcha extends SimpleCaptcha { if ( !$backend ) { $backend = new FSFileBackend( array( 'name' => 'captcha-backend', - 'wikiId' => wfWikiId(), - 'lockManager' => new NullLockManager( array() ), + 'lockManager' => 'nullLockManager', 'containerPaths' => array( 'captcha-render' => $wgCaptchaDirectory ), 'fileMode' => 777 ) ); diff --git a/extensions/ConfirmEdit/FancyCaptcha.i18n.php b/extensions/ConfirmEdit/FancyCaptcha.i18n.php index b5a262c8..7f28d048 100644 --- a/extensions/ConfirmEdit/FancyCaptcha.i18n.php +++ b/extensions/ConfirmEdit/FancyCaptcha.i18n.php @@ -37,8 +37,7 @@ $messages['qqq'] = array( 'fancycaptcha-create' => '{{Related|ConfirmEdit-create}}', 'fancycaptcha-edit' => '{{Related|ConfirmEdit-edit}}', 'fancycaptcha-sendemail' => '{{Related|ConfirmEdit-sendemail}}', - 'fancycaptcha-reload-text' => 'Prompts a click to get a new FancyCaptcha image. -{{Identical|Refresh}}', + 'fancycaptcha-reload-text' => 'Prompts a click to get a new FancyCaptcha image.', ); /** Gheg Albanian (Gegë) @@ -77,21 +76,19 @@ $messages['an'] = array( /** Arabic (العربية) * @author Aiman titi - * @author Asaifm * @author Meno25 */ $messages['ar'] = array( 'fancycaptcha-desc' => 'مولد فانسي كابتشا لConfirm Edit', 'fancycaptcha-addurl' => 'تعديلك يتضمن وصلات خارجية جديدة. -للحماية من السخام الأوتوماتيكي، من فضلك أدخل الكلمات التي تظهر بالأسفل في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', - 'fancycaptcha-badlogin' => 'للمساعدة في الحماية ضد سرقة كلمات السر، من فضلك أدخل الكلمات التي تظهر أدناه في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', - 'fancycaptcha-createaccount' => 'للمساعدة في منع إنشاء حسابات بطريقة أوتوماتيكية، قم من فضلك بإدخال الكلمات التي تظهر أدناه في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', +للحماية من السبام الأوتوماتيكي، من فضلك أدخل الكلمات التي تظهر بالأسفل في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', # Fuzzy + 'fancycaptcha-badlogin' => 'للمساعدة في الحماية ضد سرقة كلمات السر، من فضلك أدخل الكلمات التي تظهر بالأسفل في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', # Fuzzy + 'fancycaptcha-createaccount' => 'للمساعدة في منع إنشاء حسابات بطريقة أوتوماتيكية، قم من فضلك بإدخال الكلمات التي تظهر أدناه في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', # Fuzzy 'fancycaptcha-create' => 'لإنشاء الصفحة، من فضلك أدخل الكلمات التي تظهر بالأسفل في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', 'fancycaptcha-edit' => 'لتعديل هذه الصفحة، من فضلك أدخل الكلمات التي تظهر بالأسفل في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', - 'fancycaptcha-sendemail' => 'للمساعدة في منع إنشاء حسابات بطريقة أوتوماتيكية، قم من فضلك بإدخال الكلمات التي تظهر أدناه في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', - 'fancycaptcha-reload-text' => 'تحديث', + 'fancycaptcha-sendemail' => 'للمساعدة في منع إنشاء حسابات بطريقة أوتوماتيكية، قم من فضلك بإدخال الكلمات التي تظهر أدناه في الصندوق ([[Special:Captcha/help|مزيد من المعلومات]]):', # Fuzzy ); /** Egyptian Spoken Arabic (مصرى) @@ -275,7 +272,7 @@ $messages['cdo'] = array( * @author Умар */ $messages['ce'] = array( - 'fancycaptcha-addurl' => 'Хьан нисдар чохь керла арахьара хьажорагаш ю. Спамах лардала дехар до лахахь гура чохь гайтан дешнаш язъе ([[Special:Captcha/help|ма-дарра…]]):', + 'fancycaptcha-addurl' => 'Хьан нисдар чохь керла арахьара хьажоригаш ю. Спамах лардала дерхар до лахахь гура чохь гайтан дешнаш язъе ([[Special:Captcha/help|ма-дарра…]]):', # Fuzzy ); /** Sorani Kurdish (کوردی) @@ -285,23 +282,21 @@ $messages['ckb'] = array( 'fancycaptcha-createaccount' => 'بۆ یارمەتیدانی بەرگری لە دروستکردنی خۆکاری ھەژمار، تکایە ئەو وشانە لە خوارەوەدا دیارن لە بۆکسەکەدا بنووسە ([[Special:Captcha/help|زانیاریی زۆرتر]]):', # Fuzzy ); -/** Czech (čeština) +/** Czech (česky) * @author Mormegil - * @author Tchoř */ $messages['cs'] = array( 'fancycaptcha-desc' => 'Pokročilý generátor captcha pro rozšíření „Confirm Edit“', - 'fancycaptcha-addurl' => 'Vaše editace obsahuje nové odkazy formou URL. -Abychom wiki ochránili před automatizovaným spamováním, žádáme vás o opsání textu z následujícího obrázku ([[Special:Captcha/help|více informací]]):', - 'fancycaptcha-badlogin' => 'Abychom wiki ochránili proti automatizovaným pokusům uhodnout heslo, žádáme vás o opsání textu z následujícího obrázku ([[Special:Captcha/help|více informací]]):', - 'fancycaptcha-createaccount' => 'Abychom wiki ochránili proti automatizovanému zakládání účtů, žádáme vás o opsání textu z následujícího obrázku ([[Special:Captcha/help|více informací]]):', + 'fancycaptcha-addurl' => 'Vaše editace obsahuje nové odkazy formou URL; v zájmu ochrany před automatickým spamováním musíte opsat text z následujícího obrázku: ([[Special:Captcha/help|Co tohle znamená?]])', # Fuzzy + 'fancycaptcha-badlogin' => 'V rámci ochrany proti automatickým pokusům uhodnout heslo musíte opsat text z následujícího obrázku. ([[Special:Captcha/help|Co tohle znamená?]])', # Fuzzy + 'fancycaptcha-createaccount' => 'V rámci ochrany před automatickým zakládáním účtů musíte pro provedení registrace opsat text z následujícího obrázku: ([[Special:Captcha/help|Co tohle znamená?]])', # Fuzzy 'fancycaptcha-create' => 'Abyste mohli založit stránku, musíte opsat text z následujícího obrázku: ([[Special:Captcha/help|Co tohle znamená?]])', 'fancycaptcha-edit' => 'Abyste mohli editovat tuto stránku, musíte opsat text z následujícího obrázku: ([[Special:Captcha/help|Co tohle znamená?]])', - 'fancycaptcha-sendemail' => 'Abychom wiki ochránili proti automatizovanému spamování, žádáme vás o opsání textu z následujícího obrázku ([[Special:Captcha/help|více informací]]):', + 'fancycaptcha-sendemail' => 'V rámci ochrany proti automatickému spamování musíte opsat níže zobrazená slova ([[Special:Captcha/help|více informací]]):', # Fuzzy 'fancycaptcha-reload-text' => 'Vygenerovat nový kód', ); -/** Church Slavic (словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) +/** Church Slavic (словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) * @author ОйЛ */ $messages['cu'] = array( @@ -331,7 +326,7 @@ Er mwyn arbed y wici rhag peiriannau sbam, byddwch gystal â theipio'r geiriau a $messages['da'] = array( 'fancycaptcha-addurl' => 'Din ændring tilføjer nye eksterne henvisninger. For at beskytte mod automatiseret spam, skal du indtaste ordene som vises i feltet nedenfor. ([[Special:Captcha/help|mere information]]):', - 'fancycaptcha-badlogin' => 'For at beskytte mod automatiske forsøg på at gætte adgangskoden, skal du indtaste ordene som vises i feltet nedenfor. ([[Special:Captcha/help|mere information]]):', + 'fancycaptcha-badlogin' => 'For at beskytte mod automatiske forsøg på at gætte kodeord, skal du indtaste ordene som vises i feltet nedenfor. ([[Special:Captcha/help|mere information]]):', 'fancycaptcha-createaccount' => 'For at beskytte mod automatisk oprettelse af brugerkonti, der bruges til spam, skal du indtaste ordet som vises i feltet nedenfor. ([[Special:Captcha/help|mere information]]):', 'fancycaptcha-create' => 'For at oprette en ny side, skal du indtaste ordet som vises nedenfor i feltet under det. ([[Special:Captcha/help|mere information]]):', 'fancycaptcha-edit' => 'For at redigere denne side, indtast da venligst ordene, der står i feltet nedenfor ([[Special:Captcha/help|mere information]]):', @@ -373,18 +368,17 @@ Zum Schutz vor automatisiertem Spamming geben Sie das folgende Wort in das Feld /** Zazaki (Zazaki) * @author Gorizon - * @author Mirzali * @author Xoser */ $messages['diq'] = array( - 'fancycaptcha-addurl' => 'Vurnayışanê to de gıreyê teberiê newey estê. -Seba pawıtışê spamê otomatiki ra, ma reca kenime ke çekuyanê cêrênan zerreyê qutiye de bınusê ([[Special:Captcha/help|zêde melumat]]):', - 'fancycaptcha-badlogin' => 'Qe otomatik parola crack kerdişî ra pawitîş, ma rica keno çekuyanê ke qutiya cor de înan binuse ([[Special:Captcha/help|enformasyonê bînî]]):', - 'fancycaptcha-createaccount' => 'Qe otomatik hesab viraştişî ra pawitîş, ma rica keno çekuyanê ke qutiya cor de înan binuse ([[Special:Captcha/help|enformasyonê bînî]]):', + 'fancycaptcha-addurl' => 'Vırnayışané tod linkané hariciyé newe esto. +Qe otomatik spami ra pawıtış, ma rica keno çekuyané ke qutiya cor de inan binuse ([[Special:Captcha/help|enformasyoné bini]]):', + 'fancycaptcha-badlogin' => 'Qe otomatik parola crack kerdişî ra pawitîş, ma rica keno çekuyanê ke qutiya cor de înan binuse ([[Special:Captcha/help|enformasyonê bînî]]):', # Fuzzy + 'fancycaptcha-createaccount' => 'Qe otomatik hesab viraştişî ra pawitîş, ma rica keno çekuyanê ke qutiya cor de înan binuse ([[Special:Captcha/help|enformasyonê bînî]]):', # Fuzzy 'fancycaptcha-create' => 'Qe pel viraştîşî, ma rica keno çekuyanê ke qutiya cor de înan binuse ([[Special:Captcha/help|enformasyonê bînî]]):', 'fancycaptcha-edit' => 'Qe pel vurnayîşî, ma rica keno çekuyanê ke qutiya cor de înan binuse ([[Special:Captcha/help|enformasyonê bînî]]):', 'fancycaptcha-sendemail' => 'Qe spamê otomayoni ra pawitîşi, ma rica keno çekuyanê ke qutiya cor de înan binuse -([[Special:Captcha/help|enformasyonê bînî]]):', +([[Special:Captcha/help|enformasyonê bînî]]):', # Fuzzy 'fancycaptcha-reload-text' => 'Newe ke', ); @@ -393,13 +387,12 @@ Seba pawıtışê spamê otomatiki ra, ma reca kenime ke çekuyanê cêrênan ze */ $messages['dsb'] = array( 'fancycaptcha-addurl' => 'Twója změna wopśimujo nowe eksterne wótkaze. -Aby wiki pśeśiwo awtomatiskemu spamowanjeju šćitał, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', - 'fancycaptcha-badlogin' => 'Aby wiki pśeśiwo awtomatiskemu wugódanjeju gronidła šćitał, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', - 'fancycaptcha-createaccount' => 'Aby wiki pśeśiwo awtomatiskemu załoženjeju kontow šćitał, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', +Za šćit pśeśiwo awtomatiskemu spamowanjeju, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', # Fuzzy + 'fancycaptcha-badlogin' => 'Za šćit pśeśiwo awtomatiskemu wugódanjeju gronidła, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', # Fuzzy + 'fancycaptcha-createaccount' => 'Za šćit pśeśiwo awtomatiskemu załoženjeju kontow, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', # Fuzzy 'fancycaptcha-create' => 'Aby bok napórał, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', 'fancycaptcha-edit' => 'Aby toś ten bok wobźěłał, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', - 'fancycaptcha-sendemail' => 'Aby wiki pśeśiwo awtomatiskemu spamowanjeju šćitał, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', - 'fancycaptcha-reload-text' => 'Aktualizěrowaś', + 'fancycaptcha-sendemail' => 'Za šćit pśeśiwo awtomatiskemu spamowanjeju, zapódaj pšosym słowa, kótarež pokazuju se dołojce w kašćiku ([[Special:Captcha/help|dalšne informacije]]):', # Fuzzy ); /** Greek (Ελληνικά) @@ -468,13 +461,12 @@ Palun sisesta allpool olevas kastis kuvatud sõnad. Abinõu on kaitseks automaad /** Basque (euskara) * @author An13sa - * @author Xabier Armendaritz */ $messages['eu'] = array( 'fancycaptcha-addurl' => 'Zure aldaketak kanpo lotura berriak ditu. Spam automatikoa saihestu ahal izateko, beheko koadroan ageri diren hitzak idatzi ([[Special:Captcha/help|informazio gehigarria]]):', # Fuzzy 'fancycaptcha-badlogin' => 'Pasahitzen cracking automatikoa saihestu asmoz, beheko koadroan ageri diren hitzak idazteko eskatzen dizugu ([[Special:Captcha/help|informazio gehigarria]]):', # Fuzzy 'fancycaptcha-createaccount' => 'Erabiltzaile kontuak automatikoki sortzea saihestu asmoz, beheko koadroan ageri diren hitzak idazteko eskatzen dizugu ([[Special:Captcha/help|informazio gehigarria]]):', # Fuzzy - 'fancycaptcha-create' => 'Orri sortu ahal izateko, idatz itzazu beheko koadroan ageri diren hitzak ([[Special:Captcha/help|informazio gehigarria]]):', + 'fancycaptcha-create' => 'Orrialde sortu ahal izateko, beheko koadroan ageri hitzak idatzi ([[Special:Captcha/help|informazio gehigarria]]):', 'fancycaptcha-edit' => 'Orrialde hau aldatu ahal izateko, beheko koadroan ageri diren hitzak idatzi ([[Special:Captcha/help|informazio gehigarria]]):', 'fancycaptcha-sendemail' => 'Zabor-posta automatizatuaz babesteko, idatzi azpiko kutxako hitzak ([[Special:Captcha/help|informazio gehiago]]):', # Fuzzy ); @@ -489,13 +481,13 @@ $messages['eu'] = array( */ $messages['fa'] = array( 'fancycaptcha-addurl' => 'ویرایش شما حاوی پیوند به بیرون جدیدی است. -برای جلوگیری از هرزنگاری خودکار ویکی، ما با احترام از شما می‌خواهیم واژه‌ای را که در تصویر می‌بینید در جعبهٔ زیر وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', +برای کمک به جلوگیری از هرزنگاری خودکار، لطفاً واژه‌ای را که در تصویر می‌بینید در جعبه وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', # Fuzzy 'fancycaptcha-badlogin' => 'برای کمک به جلوگیری از شکستن خودکار گذرواژه، لطفاً واژه‌ای را که در تصویر می‌بینید را وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', - 'fancycaptcha-createaccount' => 'برای کمک به جلوگیری از ایجاد خودکار حساب کاربری، ما با احترام از شما می‌خواهید واژه‌ای را که در تصویر می‌بینید را در جعبهٔ زیر وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', + 'fancycaptcha-createaccount' => 'برای کمک به جلوگیری از ایجاد خودکار حساب کاربری، لطفاً واژه‌ای را که در تصویر می‌بینید وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', # Fuzzy 'fancycaptcha-create' => 'برای ایجاد این صفحه، لطفاً واژه‌ای را که در تصویر می‌بینید وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', 'fancycaptcha-edit' => 'برای ویرایش این صفحه، لطفاً واژه‌ای را که در تصویر می‌بینید وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', - 'fancycaptcha-sendemail' => 'برای کمک به محافظت در برابر هرزه‌نگاری خودکار، ما با احترام از شما می‌خواهیم واژه‌هایی را که در جعبهٔ زیر نمایش داده می‌شوند وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', - 'fancycaptcha-reload-text' => 'تازه‌کردن', + 'fancycaptcha-sendemail' => 'برای کمک به محافظت در برابر هرزه‌نگاری خودکار، لطفاً واژه‌هایی را که در جعبهٔ زیر نمایش داده می‌شوند وارد کنید ([[Special:Captcha/help|اطلاعات بیشتر]]):', # Fuzzy + 'fancycaptcha-reload-text' => 'تازه کردن', ); /** Finnish (suomi) @@ -602,19 +594,18 @@ Zum Schutz vor automatisiertem Spamming gib des Wort in s Fäld unten yy. Druck ); /** Gujarati (ગુજરાતી) - * @author Ashok modhvadia * @author Dsvyas * @author Sushant savla */ $messages['gu'] = array( - 'fancycaptcha-addurl' => 'તમે કરેલા ફેરફારોમાં નવી બાહ્ય કડીઓ સામેલ છે. -વિકિને સ્વચાલિત સ્પેમ/સ્પામ(spam)થી બચાવવા માટે અમે તમને જણાવીએ છીએ કે કૃપયા નીચે આપેલા સરળ દાખલાનો જવાબ તેની બાજુના ખાનામાં લખો. -([[Special:Captcha/help|વધુ વિગત]]):', - 'fancycaptcha-badlogin' => 'આપોઆપ થતી ગુપ્તસંજ્ઞાની ચોરી (password cracking)થી વિકિને બચાવવા માટે અમે તમને જણાવીએ છીએ કે કૃપયા નીચે આપેલા શબ્દ તેની બાજુના ખાનામાં લખો. ([[Special:Captcha/help|વધુ વિગત]]):', - 'fancycaptcha-createaccount' => 'આપોઆપ નવા ખાતા ખુલતા રોકવા અને વિકીને તેનાથી બચાવવા માટે. અમે તમને જણાવીએ છીએ કે કૃપયા નીચે દેખાતા શબ્દો ખાનામાં લખો. ([[Special:Captcha/help|વધુ માહિતી]]):', + 'fancycaptcha-addurl' => 'તમારા ફેરફારમાં નવી બાહ્ય કડીઓ શામિલ છે. +તમે કરેલા ફેરફારોમાં નવી બાહ્ય કડીઓ સામેલ છે. સ્વચાલિત સ્પેમ/સ્પામ(spam) થી બચવા માટે નીચે આપેલા સરળ દાખલાનો જવાબ તેની બાજુના ખાનામાં લખો +([[Special:Captcha/help|more info]]):', # Fuzzy + 'fancycaptcha-badlogin' => 'આપોઆપ થતી ગુપ્તસંજ્ઞાની ચોરી (password cracking)થી બચાવવા માટે નીચે આપેલા શબ્દ તેની બાજુના ખાનામાં લખો ([[Special:Captcha/help|more info]]):', # Fuzzy + 'fancycaptcha-createaccount' => 'આપોઆપ નવા ખાતા ખુલતા રોકવા માટે નીચે દેખાતા શબ્દો ખાનામાં લખો ([[Special:Captcha/help|વધુ માહિતી]]):', # Fuzzy 'fancycaptcha-create' => 'પાનું બનાવવા માટે નીચે દેખાતા શબ્દો ખાનામાં ટાઈપ કરો ([[Special:Captcha/help|વધુ માહિતી]]):', 'fancycaptcha-edit' => 'આ પાનામાં ફેરફાર કરવા માટે નીચે દેખાતા શબ્દો ખાનામાં ટાઈપ કરો ([[Special:Captcha/help|વધુ માહિતી]]):', - 'fancycaptcha-sendemail' => 'વિકિને આપોઆપ થતી સ્પૅમીંગથી બચાવવા માટે. અમે તમને જણાવીએ છીએ કે કૃપયા નીચે આપેલા શબ્દ તેની બાજુના ખાનામાં લખો ([[Special:Captcha/help|વધુ માહિતી]]):', + 'fancycaptcha-sendemail' => 'આપોઆપ થતી સ્પૅમીંગથી બચાવવા માટે નીચે આપેલા શબ્દ તેની બાજુના ખાનામાં લખો ([[Special:Captcha/help|more info]]):', # Fuzzy ); /** Hebrew (עברית) @@ -666,13 +657,12 @@ slova koja vidite na slici dolje:
        ([[Special:Captcha/help|Pomoć]])', * @author Michawiki */ $messages['hsb'] = array( - 'fancycaptcha-addurl' => 'W twojej změnje su nowe eksterne wotkazy. Jako škitnu naprawu přećiwo awtomatiskemu spamej zapodaj prošu slědowace znamješka do kašćika ([[Special:Captcha/help|dalše informacije]]):', - 'fancycaptcha-badlogin' => 'Zo by wiki přećiwo awtomatiskemu kradnjenju hesłow škitał, prosymy će, slědowace słowa do kašćika zapisować ([[Special:Captcha/help|dalše informacije]]):', - 'fancycaptcha-createaccount' => 'Jako škitna naprawa přećiwo awtomatiskemu wutworjenju wužiwarskich kontow, zapodaj prošu slědowace słowa do kašćika ([[Special:Captcha/help|dalše informacije]]):', + 'fancycaptcha-addurl' => 'W twojej změnje su nowe eksterne wotkazy. Jako škitna naprawa přećiwo awtomatiskemu spamej zapodaj prošu sćěhowace znamješka do kašćika ([[Special:Captcha/help|čehodla?]]).', # Fuzzy + 'fancycaptcha-badlogin' => 'Jako škitna naprawa přećiwo awtomatiskemu zadobywanju do wužiwarskich kontow zapodaj prošu sćěhowace znamješka do kašćika ([[Special:Captcha/help|čehodla?]]):', # Fuzzy + 'fancycaptcha-createaccount' => 'Jako škitna naprawa přećiwo awtomatiskemu wutworjenju wužiwarskich kontow zapodaj prošu sćěhowace znamješka do kašćika ([[Special:Captcha/help|čehodla?]]):', # Fuzzy 'fancycaptcha-create' => 'Zo by stronu wutworić móhł zapodaj prošu sćěhowace znamješka do kašćika ([[Special:Captcha/help|čehodla?]]):', 'fancycaptcha-edit' => 'Zo by stronu wobdźěłować móhł zapodaj prošu sćěhowace znamješka do kašćika ([[Special:Captcha/help|čehodla?]]):', - 'fancycaptcha-sendemail' => 'Za škit přećiwo awtomatiskemu spamowanju, zapodaj prošu słowa, kotrež so deleka w kašćiku jewja ([[Special:Captcha/help|dalše informacije]]):', - 'fancycaptcha-reload-text' => 'Aktualizować', + 'fancycaptcha-sendemail' => 'Za škit přećiwo awtomatiskemu spamowanju, zapodaj prošu słowa, kotrež so deleka w kašćiku jewi ([[Special:Captcha/help|dalše informacije]]):', # Fuzzy ); /** Hungarian (magyar) @@ -721,13 +711,13 @@ $messages['id'] = array( * @author Lam-ang */ $messages['ilo'] = array( - 'fancycaptcha-addurl' => 'Dagiti inurnosmo ket aglaon kadagiti baro a silpo ti ruar. -Tapno masalakniban ti wiki kadagiti automatiko nga spam, naemmakami nga agdawat nga ikabilmo dagiti balikas nga agparang dita baba iti kahon ([[Special:Captcha/help|adu pay a pakaammo]]):', - 'fancycaptcha-badlogin' => 'Tapno masalakniban kadagiti automatiko a panagsulbar ti kontrasenias, naemmakami nga agdawat nga ikabilmo dagiti balikas nga agparang dita baba iti kahon ([[Special:Captcha/help|adu pay a pakaammo]]):', - 'fancycaptcha-createaccount' => 'Tapno makasalakniban ti wiki kadagiti automatiko a panagpartuat ti pakabilangan, naemmakami nga agdawat nga ikabilmo dagiti balikas nga agparang dita baba iti kahon ([[Special:Captcha/help|adu pay a pakaammo]]):', + 'fancycaptcha-addurl' => 'Ti inurnos mo ket adda nagyan na a baro a panilpo ti ruar. +Tapno masalakniban kadagiti automatiko a spam, pangaasim nga ikabil ti balikas nga agparang dita baba a kahon. ([[Special:Captcha/help|adu pay a pakaammo]]):', # Fuzzy + 'fancycaptcha-badlogin' => 'Tapno masalakniban kadagiti automatiko a pinagsulbar ti kontrasenias, pangaasim nga ikabil ti balikas nga agparang dita baba a kahon. ([[Special:Captcha/help|adu pay a pakaammo]]):', # Fuzzy + 'fancycaptcha-createaccount' => 'Tapno makasalaknib kadagiti automatiko a pinagaramid ti pakabilangan, pangaasim nga ikabil ti balikas nga agparang dita baba a kahon. ([[Special:Captcha/help|adu pay a pakaammo]]):', # Fuzzy 'fancycaptcha-create' => 'Tapno makaaramid ti panid, pangaasim nga ikabil ti balikas nga agparang dita baba a kahon. ([[Special:Captcha/help|adu pay a pakaammo]]):', 'fancycaptcha-edit' => 'Tapno makaurnos daytoy a panid, pangaasim nga ikabil ti balikas nga agparang dita baba a kahon. ([[Special:Captcha/help|adu pay a pakaammo]]):', - 'fancycaptcha-sendemail' => 'Tapno makasalakniban ti wiki kadagiti automatiko a panag-spam, naemmakami nga agdawat nga ikabilmo dagiti balikas nga agparang dita baba iti kahon ([[Special:Captcha/help|adu pay a pakaammo]]):', + 'fancycaptcha-sendemail' => 'Tapno makasalaknib kadagiti automatiko a pinagspam, pangaasim nga ikabil ti balikas nga agparang dita baba a kahon. ([[Special:Captcha/help|adu pay a pakaammo]]):', # Fuzzy 'fancycaptcha-reload-text' => 'Pasadiwaen', ); @@ -780,12 +770,11 @@ $messages['ja'] = array( ); /** Jutish (jysk) - * @author Christian List * @author Huslåke */ $messages['jut'] = array( 'fancycaptcha-addurl' => 'Din ændring tilføjer nye eksterne henvisninger. For at beskytte mod automatiseret spam, skal du indtaste ordet som vises nedenfor i feltet under det. ([[Special:Captcha/help|mere information]]):', # Fuzzy - 'fancycaptcha-badlogin' => 'For at beskytte mod automatiske forsøg på at gætte adgangskoden, skal du indtaste ordet som vises i feltet nedenfor. ([[Special:Captcha/help|mere information]]):', + 'fancycaptcha-badlogin' => 'For at beskytte mod automatiske forsøg på at gætte kodeord, skal du indtaste ordet som vises nedenfor i feltet under det. ([[Special:Captcha/help|mere information]]):', # Fuzzy 'fancycaptcha-createaccount' => 'For at beskytte mod automatisk oprettelse af brugernavne, der bruges til spam, skal du indtaste ordet som vises nedenfor i feltet under det. ([[Special:Captcha/help|mere information]]):', # Fuzzy 'fancycaptcha-create' => 'For at oprette en ny side, skal du indtaste ordet som vises nedenfor i feltet under det. ([[Special:Captcha/help|mere information]]):', 'fancycaptcha-edit' => 'or at redigere denne side @@ -793,33 +782,28 @@ $messages['jut'] = array( ); /** Javanese (Basa Jawa) - * @author Bennylin * @author Meursault2004 */ $messages['jv'] = array( - 'fancycaptcha-addurl' => 'Suntingan panjenengan iku ngandhut pranala jaba anyar. Kanggo pangreksan marang spam otomatis, mangga lebokna tembung sing kapacak ing ngisor iki ing kothak sing wis cumepak ([[Special:Captcha/help|info jangkep]]):', - 'fancycaptcha-badlogin' => 'Kanggo ngreksa lawan parengkahan tembung sandhi otomatis, tulung lebokna ukara ing ngisor iki menyang sajroning kothak sing wis sumedya ([[Special:Captcha/help|info sabanjuré]]):', - 'fancycaptcha-createaccount' => 'Kanggo ngreksa lawan panggawéyan rékening (akun) otomatis, tulung lebokna ukara ing ngisor iki menyang sajroning kothak ([[Special:Captcha/help|info sabanjuré]]):', + 'fancycaptcha-addurl' => 'Suntingan panjenengan iku ngandhut pranala jaba anyar. Kanggo pangreksan marang spam otomatis, mangga lebokna tembung sing kapacak ing ngisor iki ing kothak sing wis cumepak ([[Special:Captcha/help|info jangkep]]):', # Fuzzy + 'fancycaptcha-badlogin' => 'Kanggo ngréwangi pangreksan marang parengkahan kunci sandhi otomatis, mangga lebokna tembung sing kapacak ing ngisor iki ing kothak sing wis cumepak ([[Special:Captcha/help|info jangkep]]):', # Fuzzy + 'fancycaptcha-createaccount' => 'Minangka pangreksan marang rékening (akun) sing digawé otomatis, tulung lebokna tembung sing kapacak ing ngisor iki ing kothak sing wis cumepak ([[Special:Captcha/help|info jangkep]]):', # Fuzzy 'fancycaptcha-create' => 'Suntingan panjenengan ngandhut pranala jaba anyar. Kanggo nggawé kaca iki, mangga isèkna tembung-tembung sing ana ing kothak iki ([[Special:Captcha/help|info jangkep]]):', 'fancycaptcha-edit' => 'Suntingan panjenengan ngandhut pranala jaba anyar. Kanggo nyunting kaca iki, mangga isèkna tembung-tembung sing ana ing kothak iki ([[Special:Captcha/help|info jangkep]]):', - 'fancycaptcha-sendemail' => 'Kanggo ngreksa lawan spam otomatis, tulung lebokna ukara ing ngisor iki menyang sajroning kothak sing wis sumedya ([[Special:Captcha/help|info sabanjuré]]):', - 'fancycaptcha-reload-text' => 'Anyarana', ); /** Georgian (ქართული) * @author David1010 * @author ITshnik - * @author Tokoko */ $messages['ka'] = array( 'fancycaptcha-addurl' => 'თქვენი ცვლილება შეიცავს ახალ გარე ბმულებს. -ვიკის ავტომატური სპამინგისგან თავდაცვის მიზნით, ჩვენ მოგიწოდებთ, შეიყვანოთ ქვემოთ მოცემული სიტყვები ყუთში ([[Special:Captcha/help|მეტი ინფორმაცია]]):', - 'fancycaptcha-badlogin' => 'ვიკის პაროლების ავტომატური გატეხვისგან თავდაცვის მიზნით, ჩვენ მოგიწოდებთ, შეიყვანოთ ქვემოთ მოცემული სიტყვები ყუთში ([[Special:Captcha/help|მეტი ინფორმაცია]]):', - 'fancycaptcha-createaccount' => 'ვიკის ანგარიშების ავტომატური რეგისტრაციისაგან თავდაცვის მიზნით, ჩვენ მოგიწოდებთ, შეიყვანოთ ნაჩვენები სიმბოლოები ტექსტურ ველში ([[Special:Captcha/help|დეტალურად]]):', +ავტომატური სპამინგისგან თავდაცვის მიზნით, გთხოვთ, შეიყვანოთ ქვემოთ მოცემული სიტყვები ყუთში ([[Special:Captcha/help|მეტი ინფორმაცია]]):', # Fuzzy + 'fancycaptcha-badlogin' => 'პაროლების ავტომატური გატეხვისგან თავდაცვის მიზნით, გთხოვთ, შეიყვანოთ ქვემოთ მოცემული სიტყვები ყუთში ([[Special:Captcha/help|მეტი ინფორმაცია]]):', # Fuzzy + 'fancycaptcha-createaccount' => 'ანგარიშების ავტომატური რეგისტრაციისაგან თავდაცვის მიზნით, გთხოვთ, შეიყვანოთ ნაჩვენები სიმბოლოები ტექსტურ ველში ([[Special:Captcha/help|დეტალურად]]):', # Fuzzy 'fancycaptcha-create' => 'გვერდის შესაქმნელად, გთხოვთ, შეიყვანეთ ასოები, რომლებიც ნაჩვენებია ქვედა სურათზე ([[Special:Captcha/help|დეტალურად…]]):', 'fancycaptcha-edit' => 'გვერდის რედაქტირებისათვის, გთხოვთ, შეიყვანეთ ასოები, რომლებიც ნაჩვენებია ქვედა სურათზე ([[Special:Captcha/help|დეტალურად…]]):', - 'fancycaptcha-sendemail' => 'ვიკის ავტომატური სპამისაგან თავდაცვის მიზნით, ჩვენ მოგიწოდებთ, შეიყვანოთ ქვევით ნაჩვენები სიტყვა ტექსტურ ველში ([[Special:Captcha/help|მეტი ინფორმაცია]]):', - 'fancycaptcha-reload-text' => 'განახლება', + 'fancycaptcha-sendemail' => 'ავტომატური სპამისაგან თავდაცვის მიზნით, გთხოვთ, შეიყვანოთ ქვევით ნაჩვენები სიტყვა ტექსტურ ველში ([[Special:Captcha/help|მეტი ინფორმაცია]]):', # Fuzzy ); /** Kara-Kalpak (Qaraqalpaqsha) @@ -884,9 +868,9 @@ tömendegi körsetilgen sözderdi awmaqqa engiziñiz ([[{{ns:special}}:Captcha/h $messages['km'] = array( 'fancycaptcha-addurl' => 'កំណែប្រែរបស់អ្នកមានតំណភ្ជាប់ខាងក្រៅ។ -ដើម្បីការពារពីស្ប៉ាមស្វ័យប្រវត្តិ សូមបញ្ជូលពាក្យខាងក្រោមទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', - 'fancycaptcha-badlogin' => 'ដើម្បីការពារការបំបែកពាក្យសម្ងាត់ដោយស្វ័យប្រវត្តិ សូមបញ្ជូលពាក្យខាងក្រោមទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', - 'fancycaptcha-createaccount' => 'ដើម្បីការពារការបង្កើតគណនីដោយស្វ័យប្រវត្តិ សូមបញ្ជូលពាក្យខាងក្រោមទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', +ដើម្បីការពារពីស្ប៉ាម(spam)ស្វ័យប្រវត្តិ សូមបញ្ជូលពាក្យខាងក្រោមទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', # Fuzzy + 'fancycaptcha-badlogin' => 'ដើម្បីការពារការបំបែកពាក្យសំងាត់ដោយស្វ័យប្រវត្តិ សូមបញ្ជូលពាក្យខាងក្រោមទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', # Fuzzy + 'fancycaptcha-createaccount' => 'ដើម្បីការពារការបង្កើតគណនីដោយស្វ័យប្រវត្តិ សូមបញ្ជូលពាក្យខាងក្រោមទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', # Fuzzy 'fancycaptcha-create' => 'ដើម្បីបង្កើតទំព័រនេះ សូមបញ្ជូលពាក្យខាងក្រោមទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', 'fancycaptcha-edit' => 'ដើម្បីកែប្រែទំព័រនេះ សូមបញ្ជូលពាក្យខាងក្រោមទៅក្នុងប្រអប់ ([[Special:Captcha/help|ព័ត៌មានបន្ថែម]])៖', ); @@ -920,21 +904,20 @@ $messages['krc'] = array( */ $messages['ksh'] = array( 'fancycaptcha-desc' => 'Määt e nett Käptsche för dä Confirm Edit Projramm-Zohsatz', - 'fancycaptcha-addurl' => 'Do häß neuje Lengks op frembde Websigge dobei jedonn. -Mer schöze ons Wiki jäje automattesche SPAM, dröm -don di Wööter en dat Käßje endraare. ([[Special:Captcha/help|Verklierung]])', + 'fancycaptcha-addurl' => 'Do häß neu Lingks op frembde Websigge dobei jedonn. +Mer schöze uns Wiki jäje automatesche SPAM, dröm +don di Wööter en dat Käßje endraare. (Verklierung)', # Fuzzy 'fancycaptcha-badlogin' => 'Mer schöze Metmaacher en unsem Wiki jäje automatesche Paßwoot-Knackerei, dröm don di Wööt onge en dat Käßje -endraare. ([[Special:Captcha/help|Verklierung]])', +endraare. (Verklierung)', # Fuzzy 'fancycaptcha-createaccount' => 'Mer schöze uns Wiki dojäje, dat mer en Masse automatesch -Metmaacher aanmeldt. -Dröm beß esu joot un -don di Wööt onge en dat Käßje endraare. ([[Special:Captcha/help|Verklierung]])', +Metmaacher aanmeldt. Dröm beß esu joot un +don di Wööt onge en dat Käßje endraare. (Verklierung)', # Fuzzy 'fancycaptcha-create' => 'Öm di Sigg neu aanzelääje, don di Wööt onge en dat Käßje endraare. (Verklierung)', 'fancycaptcha-edit' => 'Öm de Sigg ze ändere, don di Wööt onge en dat Käßje endraare. ([[Special:Captcha/help|Verklierung]])', - 'fancycaptcha-sendemail' => 'Öm et Wiki jääje automattesch enjedraare SPAM ze schötze, + 'fancycaptcha-sendemail' => 'Öm et Wiki jääje automattesch enjedraare SPAM ze schötze, bes esu joot, donn di Wööter enjävve, di en däm Käßje heh dronger shtonn. -([[Special:Captcha/help|Mieh Enfommazjuhne]])', +([[Special:Captcha/help|Mieh Enfommazjuhne]])', # Fuzzy 'fancycaptcha-reload-text' => 'Nöü Aanzeije!', ); @@ -1140,12 +1123,12 @@ As Schutz gegen automaatsch Spam, geev disse Bookstavenreeg in dat Feld ünnen i */ $messages['nds-nl'] = array( 'fancycaptcha-addurl' => "Joew bewarking bevat uutgaonde verwiezingen. -Um dit projekt te bescharmen tegen automatiese spam, mu'j t woord dat hieronder steet invullen ([[Special:Captcha/help|hulpe]]):", +Um dit projekt te bescharmen tegen ongewunste reklame, mu'j t woord dat hieronder steet invullen ([[Special:Captcha/help|hulpe]]):", 'fancycaptcha-badlogin' => "Um disse webstee te beveiligen tegen t kraken van wachtwoorden, mu'j de woorden die'j hieronder zien effen invullen ([[Special:Captcha/help|hulpe]]):", 'fancycaptcha-createaccount' => "Um disse wiki te bescharmen tegen t automaties anmaken van gebrukersprofielen mu'j t woord hieronder invullen ([[Special:Captcha/help|hulpe]]):", 'fancycaptcha-create' => "Um n pagina an te maken, mö'j t woord dat hieronder steet invullen ([[Special:Captcha/help|hulpe]]):", - 'fancycaptcha-edit' => 'Vul de woorden die hieronder staon in um disse zied te bewarken ([[Special:Captcha/help|hulpe]]):', + 'fancycaptcha-edit' => "Joew bewarking bevat nieje uutgaonde verwiezingen. Um disse wiki te bescharmen tegen ongewunste reklame mö'j de woorden hieronder invullen ([[Special:Captcha/help|hulpe]]):", 'fancycaptcha-sendemail' => 'Voer de woorden die hieronder staon in t invoerveld in as bescharming tegen automatiese ongewunste reklame ([[Special:Captcha/help|hulpe]]):', 'fancycaptcha-reload-text' => 'Verniejen', @@ -1164,7 +1147,7 @@ Voer de woorden die hieronder verschijnen in het invoerveld in als bescherming t 'fancycaptcha-create' => 'Voer de woorden die hieronder verschijnen in het invoerveld in om de pagina aan te maken ([[Special:Captcha/help|meer informatie]]):', 'fancycaptcha-edit' => 'Voer de woorden die hieronder verschijnen in het invoerveld in om deze pagina te bewerken ([[Special:Captcha/help|meer informatie]]):', 'fancycaptcha-sendemail' => 'Voer de woorden die hieronder getoond worden in het invoerveld in als bescherming tegen spam ([[Special:Captcha/help|meer informatie]]):', - 'fancycaptcha-reload-text' => 'Vernieuwen', + 'fancycaptcha-reload-text' => 'Verversen', ); /** Nederlands (informeel)‎ (Nederlands (informeel)‎) @@ -1224,12 +1207,12 @@ $messages['or'] = array( */ $messages['pl'] = array( 'fancycaptcha-desc' => 'Generator obrazka, którego odczytanie jest wymagane dla zatwierdzenia edycji.', - 'fancycaptcha-addurl' => 'Twoja edycja zawiera nowe linki zewnętrzne. Ze względu na ochronę przed zautomatyzowanym spamem prosimy o wpisanie słów, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|więcej informacji]]):', - 'fancycaptcha-badlogin' => 'Ze względu na ochronę przed automatycznym łamaniem haseł prosimy o wpisanie słów, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|więcej informacji]]):', - 'fancycaptcha-createaccount' => 'Ze względu na ochronę przed automatycznym tworzeniem kont prosimy o wpisanie słów, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|więcej informacji]])', + 'fancycaptcha-addurl' => 'Twoja edycja zawiera nowe linki zewnętrzne. Ze względu na ochronę przed zautomatyzowanym spamem prosimy o wpisanie słów, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|pomoc]]):', # Fuzzy + 'fancycaptcha-badlogin' => 'Ze względu na zabezpieczenie przed automatycznym łamaniem haseł prosimy o wpisanie słów, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|pomoc]]):', # Fuzzy + 'fancycaptcha-createaccount' => 'Ze względu na ochronę przed automatycznym spamem, aby się zarejestrować musisz wpisać słowo, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|pomoc]])', # Fuzzy 'fancycaptcha-create' => 'Aby utworzyć tę stronę, przepisz słowa, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|pomoc]]):', 'fancycaptcha-edit' => 'Aby edytować tę stronę, przepisz słowa, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|pomoc]]):', - 'fancycaptcha-sendemail' => 'Ze względu na ochronę przed zautomatyzowanym spamem prosimy o wpisanie słów, które widzisz poniżej, do pola tekstowego ([[Special:Captcha/help|więcej informacji]]).', + 'fancycaptcha-sendemail' => 'Zabezpieczenie przed automatycznie dodawanym spamem. Wprowadzić słowa widoczne w poniższym prostokącie ([[Special:Captcha/help|więcej informacji]]).', # Fuzzy 'fancycaptcha-reload-text' => 'Odśwież', ); @@ -1299,14 +1282,6 @@ $messages['pt-br'] = array( 'fancycaptcha-reload-text' => 'Atualizar', ); -/** Quechua (Runa Simi) - * @author AlimanRuna - */ -$messages['qu'] = array( - 'fancycaptcha-create' => "P'anqata kamarinaykipaqqa kay qatiq kahachapi kaq rimakunata yaykuchiy ([[Special:Captcha/help|astawan yachay]]):", - 'fancycaptcha-edit' => "Kay p'anqata llamk'anaykipaqqa kay qatiq kahachapi kaq rimakunata yaykuchiy ([[Special:Captcha/help|astawan yachay]]):", -); - /** Romansh (rumantsch) * @author Kazu89 */ @@ -1334,13 +1309,13 @@ Pentru a împiedica roboții de spam, vă rugăm să introduceți cuvintele care * @author Joetaras */ $messages['roa-tara'] = array( - 'fancycaptcha-addurl' => "'U cangiamende tune 'nglude de le collegaminde de fore. -Pe proteggere condre a 'u spam automateche, pe piacere mitte le parole ca iessene sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", - 'fancycaptcha-badlogin' => "Pe proteggere condre a futteminde automatece de passuord, pe piacere mitte le parole ca iessene aqquà sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", - 'fancycaptcha-createaccount' => "Pe proteggere condre a ccreazione automateche de cunde utinde, pe piacere mitte le parole ca iessene aqquà sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", + 'fancycaptcha-addurl' => "'U cangiamende tue inglude de le collegaminde esterne. +Pe aiutà a proteggere condre a 'u spam automateche, pe piacere mitte le parole ca combare sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", # Fuzzy + 'fancycaptcha-badlogin' => 'Pe aiutà a proteggere condre a futteminde automatece de password, pe piacere mitte le parole ca combare aqquà sotte ([[Special:Captcha/help|more info]]):', # Fuzzy + 'fancycaptcha-createaccount' => 'Pe aiutà a proteggere condre a ccreazione automateche de cunde utinde, pe piacere mitte le parole ca combare aqquà sotte ([[Special:Captcha/help|more info]]):', # Fuzzy 'fancycaptcha-create' => 'Pe ccrejà sta pàgene, pe piacere mitte le parole ca combare aqquà sotte ([[Special:Captcha/help|more info]]):', 'fancycaptcha-edit' => 'Pe cangià sta pàgene, pe piacere mitte le parole combare aqquà sotte ([[Special:Captcha/help|more info]]):', - 'fancycaptcha-sendemail' => "Pe proteggere condre a spam automatece, pe piacere mitte le parole ca iessene aqquà sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", + 'fancycaptcha-sendemail' => "Pe aiutà a proteggere condre a spam automatece, pe piacere mitte le parole ca combare aqquà sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", # Fuzzy 'fancycaptcha-reload-text' => 'Aggiorne', ); @@ -1630,12 +1605,12 @@ Upang makatulong sa pagsasanggalang laban sa kusang pinapadalang mga \"manluluso */ $messages['tr'] = array( 'fancycaptcha-addurl' => 'Değişikliğiniz yeni dış bağlantılar içeriyor. -Vikiyi otomatik spamdan korumak için, aşağıdaki sözcükleri kutunun içine yazmanızı rica ediyoruz ([[Special:Captcha/help|ayrıntılı bilgi]]):', - 'fancycaptcha-badlogin' => 'Vikiyi otomatik parola kırma yöntemine karşı korumak için, aşağıdaki sözcükleri kutunun içine yazmanızı rica ediyoruz ([[Special:Captcha/help|ayrıntılı bilgi]]):', - 'fancycaptcha-createaccount' => 'Vikiyi otomatik hesap oluşturmaya karşı korumaya yardım etmek için, aşağıdaki sözcükleri kutunun içine yazmanızı rica ediyoruz ([[Special:Captcha/help|ayrıntılı bilgi]]):', +Otomatik spamdan korunmak için, lütfen aşağıdaki sözcükleri kutunun içine yazın ([[Special:Captcha/help|ayrıntılı bilgiler]]):', # Fuzzy + 'fancycaptcha-badlogin' => 'Otomatik parola kırma yöntemine karşı korunmak için lütfen aşağıdaki sözcükleri kutunun içine yazınız ([[Special:Captcha/help|ayrıntılı bilgi]]):', # Fuzzy + 'fancycaptcha-createaccount' => 'Otomatik hesap oluşturmaya karşı korumaya yardım etmek için, lütfen aşağıdaki kutuda görünen kelimeleri girin ([[Special:Captcha/help|daha fazla bilgi]]):', # Fuzzy 'fancycaptcha-create' => 'Sayfayı oluşturmak için, lütfen aşağıdaki kutuda görünen kelimeleri girin ([[Special:Captcha/help|daha fazla bilgi]]):', 'fancycaptcha-edit' => 'Bu sayfayı değiştirmek için, lütfen aşağıdaki kutuda görünen kelimeleri girin ([[Special:Captcha/help|daha fazla bilgi]]):', - 'fancycaptcha-sendemail' => 'Vikiyi otomatik spamlerden korumak için, aşağıdaki sözcükleri kutunun içine yazmanızı rica ediyoruz ([[Special:Captcha/help|ayrıntılı bilgi]]):', + 'fancycaptcha-sendemail' => 'Otomatik spamlerden korunmaya yardımcı olmak için, lütfen aşağıda görünen sözcükleri kutuya yazın ([[Special:Captcha/help|daha fazla bilgi]]):', # Fuzzy 'fancycaptcha-reload-text' => 'Yenile', ); @@ -1769,10 +1744,10 @@ $messages['zh-hans'] = array( $messages['zh-hant'] = array( 'fancycaptcha-addurl' => '您的編輯內容中含有本網站以外的連結。 為防止不當程式大量破壞,請輸入以下的文字([[Special:Captcha/help|相關資訊]]):', - 'fancycaptcha-badlogin' => '為幫助wiki防範可自動破解密碼之不當程式,我們請您鍵入下面資訊框中的單詞([[Special:Captcha/help|相關資訊]]):', - 'fancycaptcha-createaccount' => '為幫助wiki防範可自動創建賬戶之不當程式,我們請您鍵入下面資訊框中的單詞([[Special:Captcha/help|相關資訊]]):', + 'fancycaptcha-badlogin' => '為防止不當程式破解密碼,請輸入以下的文字([[Special:Captcha/help|相關資訊]]):', # Fuzzy + 'fancycaptcha-createaccount' => '為防止不當程式大量建立帳戶,請輸入以下的文字([[Special:Captcha/help|相關資訊]]):', # Fuzzy 'fancycaptcha-create' => '為防止不當程式大量建立頁面,請輸入以下的文字([[Special:Captcha/help|相關資訊]]):', 'fancycaptcha-edit' => '如您想要編輯此頁面,請輸入以下的文字([[Special:Captcha/help|相關資訊]]):', - 'fancycaptcha-sendemail' => '為幫助wiki防範垃圾電郵,我們請您鍵入下面資訊框中的單詞([[Special:Captcha/help|相關資訊]]):', + 'fancycaptcha-sendemail' => '為防止不當程式進行破壞,請輸入以下的文字([[Special:Captcha/help|相關資訊]]):', # Fuzzy 'fancycaptcha-reload-text' => '重新整理', ); diff --git a/extensions/ConfirmEdit/FancyCaptcha.php b/extensions/ConfirmEdit/FancyCaptcha.php index cbabb4a0..46002e22 100644 --- a/extensions/ConfirmEdit/FancyCaptcha.php +++ b/extensions/ConfirmEdit/FancyCaptcha.php @@ -62,7 +62,6 @@ $wgAutoloadClasses['FancyCaptcha'] = $dir . '/FancyCaptcha.class.php'; $wgResourceModules['ext.confirmEdit.fancyCaptcha.styles'] = array( 'localBasePath' => $dir . '/resources', 'remoteExtPath' => 'ConfirmEdit/resources', - 'targets' => array( 'mobile', 'desktop' ), 'styles' => 'ext.confirmEdit.fancyCaptcha.css', ); @@ -73,15 +72,5 @@ $wgResourceModules['ext.confirmEdit.fancyCaptcha'] = array( 'dependencies' => 'mediawiki.api', ); -// FIXME: remove, add mobile target to ext.confirmEdit.fancyCaptcha and update -// MobileFrontend accordingly when bug 57629 is resolved -$wgResourceModules['ext.confirmEdit.fancyCaptchaMobile'] = array( - 'localBasePath' => $dir . '/resources', - 'remoteExtPath' => 'ConfirmEdit/resources', - 'scripts' => 'ext.confirmEdit.fancyCaptcha.js', - 'targets' => array( 'mobile', 'desktop' ), - 'dependencies' => 'mobile.startup', -); - $wgAutoloadClasses['ApiFancyCaptchaReload'] = $dir . '/ApiFancyCaptchaReload.php'; $wgAPIModules['fancycaptchareload'] = 'ApiFancyCaptchaReload'; diff --git a/extensions/ConfirmEdit/HTMLCaptchaField.php b/extensions/ConfirmEdit/HTMLCaptchaField.php new file mode 100644 index 00000000..c069ce9e --- /dev/null +++ b/extensions/ConfirmEdit/HTMLCaptchaField.php @@ -0,0 +1,81 @@ +prefix = $params['prefix']; + } + } + + /** + * Get the captcha body. Don't include any of the surrounding table cells/rows + * + * @param $value String + * @return String + */ + public function getInputHTML( $value ) { + # TODO + } + + public function validate( $data, $alldata ) { + // We sent back the exists status of the captcha before. If it *doesn't* exist + // we actually want to validate this as true, because we don't want an angry red + // error message, just for the user to put the captcha in again + if ( $data === false ) { + return true; + } + } + + /** + * @param $request WebRequest + * @return void + */ + public function loadDataFromRequest( $request ) { + $this->captcha = Captcha::factory(); + $this->captcha->loadFromRequest( $request, $this ); + if ( !$this->captcha->exists() ) { + // The captcha doesn't exist; probably because it's already been used and + // then deleted for security. Load the field up with a new captcha which + // will be shown to the user when the validation of said new object fails + $this->captcha = Captcha::newRandom(); + } + + // This will be useful as the difference between "the captcha doesn't exist" and + // "you answered the captcha wrongly" + return $this->captcha->exists(); + } +} diff --git a/extensions/ConfirmEdit/QuestyCaptcha.i18n.php b/extensions/ConfirmEdit/QuestyCaptcha.i18n.php index 12d372a3..ddf2ab6a 100644 --- a/extensions/ConfirmEdit/QuestyCaptcha.i18n.php +++ b/extensions/ConfirmEdit/QuestyCaptcha.i18n.php @@ -208,17 +208,17 @@ Per ajudar a protegir-se contra la brossa automàtica, responeu la pregunta que 'questycaptcha-create' => 'Per crear la pàgina, per favor responeu la pregunta que apareix a continuació ([[Special:Captcha/help|més informació]]):', ); -/** Czech (čeština) +/** Czech (česky) * @author Mormegil */ $messages['cs'] = array( 'questycaptcha-addurl' => 'Vaše editace obsahuje nové externí odkazy. -V zájmu ochrany této wiki před automatickým spamováním vás prosíme o zodpovězení níže uvedené otázky ([[Special:Captcha/help|další informace]]):', - 'questycaptcha-badlogin' => 'V zájmu ochrany této wiki proti automatickým pokusům uhodnout heslo vás prosíme o zodpovězení níže uvedené otázky ([[Special:Captcha/help|další informace]]):', - 'questycaptcha-createaccount' => 'V zájmu ochrany této wiki před automatickým vytvářením účtů vás prosíme o zodpovězení níže uvedené otázky ([[Special:Captcha/help|další informace]]):', +V zájmu ochrany před automatickým spamováním musíte zodpovědět níže uvedenou otázku ([[Special:Captcha/help|další informace]]):', # Fuzzy + 'questycaptcha-badlogin' => 'V rámci ochrany proti automatickým pokusům uhodnout heslo musíte zodpovědět níže uvedenou otázku ([[Special:Captcha/help|další informace]]):', # Fuzzy + 'questycaptcha-createaccount' => 'V rámci ochrany před automatickým vytvářením účtů musíte pro provedení registrace zodpovědět níže uvedenou otázku ([[Special:Captcha/help|další informace]]):', # Fuzzy 'questycaptcha-create' => 'Abyste mohli založit stránku, musíte zodpovědět níže uvedenou otázku ([[Special:Captcha/help|další informace]]):', 'questycaptcha-edit' => 'Abyste mohli editovat tuto stránku, musíte zodpovědět níže uvedenou otázku ([[Special:Captcha/help|další informace]]):', - 'questycaptcha-sendemail' => 'V zájmu ochrany této wiki před automatickým spamováním vás prosíme o zodpovězení níže uvedené otázky ([[Special:Captcha/help|další informace]]):', + 'questycaptcha-sendemail' => 'V rámci ochrany proti automatickému spamování musíte zodpovědět níže zobrazenou otázku ([[Special:Captcha/help|více informací]]):', # Fuzzy 'questycaptchahelp-text' => 'Webové stránky, do kterých mohou přispívat jejich návštěvníci (jako například tato wiki), jsou často terčem spammerů, kteří pomocí automatických nástrojů vkládají své odkazy na velké množství stránek. Přestože lze tento spam odstranit, představuje nepříjemné obtěžování. Někdy, zvláště při přidávání nových webových odkazů, vás wiki může požádat o zodpovězení otázky. @@ -303,12 +303,12 @@ Der „Zurück“-Knopf des Browsers führt zurück zum Bearbeitungsfenster.', # */ $messages['dsb'] = array( 'questycaptcha-addurl' => 'Twója změna wopśimujo nowe eksterne wótkaze. -Aby wiki pśeśiwo zawtomatizěrowanemu spamoju šćitał, wótegroń pšosym na pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', - 'questycaptcha-badlogin' => 'Aby wiki pśeśiwo zawtomatizěrowanemu wusnuchlenjeju gronidła šćitał, wótegroń pšosym na pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', - 'questycaptcha-createaccount' => 'Aby wiki pśeśiwo zawtomatizěrowanemu napóranjeju kontow šćitał, wótegroń pšosym na pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', +Za šćit pśeśiwo zawtomatizěrowanemu spamoju, wótegroń pšosym na pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', # Fuzzy + 'questycaptcha-badlogin' => 'Za šćit pśeśiwo zawtomatizěrowanemu wusnuchlenjeju gronidła, wótegroń pšosym na pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', # Fuzzy + 'questycaptcha-createaccount' => 'Za šćit pśeśiwo zawtomatizěrowanemu napóranjeju kontow, wótegroń pšosym na pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', # Fuzzy 'questycaptcha-create' => 'Aby napórał bok, wótegroń pšosym na pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', 'questycaptcha-edit' => 'Aby wobźěłał toś ten bok, wótegroń pšosym na pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', - 'questycaptcha-sendemail' => 'Aby wiki pśeśiwo awtomatiskemu spamowanjeju šćitał, wótegroń pšosym pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', + 'questycaptcha-sendemail' => 'Za šćit pśeśiwo awtomatiskemu spamowanjeju, wótegroń pšosym pšašanje, kótarež pokazujo se dołojce ([[Special:Captcha/help|dalšne informacije]]):', # Fuzzy 'questycaptchahelp-text' => 'Websedła, kótarež akceptěruju zjawne pśinoski, ako toś ten wiki, znjewužywaju se cesto wót spamowarjow, kótarež wužywaju zawtomatizěrowane rědy, aby pśidali swóje wótkaze na wjele sedłow. Lěcrownož toś te spamowe wótkaze daju se wótpóraś, su wóne bejna pógóršota. Wótergi, wósebnje, gaž se nowe wótkaze pśidawaju bokoju, jo móžno, až se śi wiki něco pšaša. @@ -557,12 +557,12 @@ $messages['he'] = array( */ $messages['hsb'] = array( 'questycaptcha-addurl' => 'Twoja změna wobsahuje nowe eksterne wotkazy. -Za škit přećiwo awtomatizowanemu spamej, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', - 'questycaptcha-badlogin' => 'Za škit přećiwo awtomatiskemu kradnjenju hesła, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', - 'questycaptcha-createaccount' => 'Za škit přećiwo awtomatizowanemu tworjenju kontow, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', +Za škit přećiwo awtomatizowanemu spamej, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', # Fuzzy + 'questycaptcha-badlogin' => 'Za škit přećiwo awtomatiskemu kradnjenju hesła, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', # Fuzzy + 'questycaptcha-createaccount' => 'Za škit přećiwo awtomatizowanemu tworjenju kontow, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalš informacije]]):', # Fuzzy 'questycaptcha-create' => 'Zo by stronu wutworił, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', 'questycaptcha-edit' => 'Zo by tutu stronu změnił, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', - 'questycaptcha-sendemail' => 'Za škit přećiwo awtomatiskemu spamowanju, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', + 'questycaptcha-sendemail' => 'Za škit přećiwo awtomatiskemu spamowanju, wotmołw prošu na prašenje, kotrež so deleka jewi ([[Special:Captcha/help|dalše informacije]]):', # Fuzzy 'questycaptchahelp-text' => 'Websydła, kotrež přinoški ze zjawnosće akceptuja, kaž tutón wiki, so často wot spamarjow znjewužiwaja, kotřiž awtomatizowane nastroje wužiwaja, zo bychu swoje wotkazy wjele sydłam přidali. Hačrunjež so tute spamowe wotkazy hodźa wotstronić, su wone njesnadne mjerzanje. Druhdy, wosebje, hdyž so nowe webwotkazy stronje přidawaja, wiki so ći něčeho praša. @@ -715,18 +715,17 @@ $messages['ja'] = array( /** Korean (한국어) * @author Kwj2772 - * @author Priviet * @author 아라 */ $messages['ko'] = array( 'questycaptcha-desc' => '편집 확인에 대한 탐구적인 CAPCHA(캡차) 생성기', - 'questycaptcha-addurl' => '편집에 새로운 바깥 고리가 포함되어 있습니다. -자동 편집 스팸으로부터 보호하기 위해, 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', - 'questycaptcha-badlogin' => '자동 비밀번호 크래킹으로부터 보호하기 위해, 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', - 'questycaptcha-createaccount' => '자동 계정 만들기로부터 보호하기 위해, 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', + 'questycaptcha-addurl' => '편집에 새로운 바깥 링크가 포함되어 있습니다. +자동화된 스팸으로부터 보호하기 위해, 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', # Fuzzy + 'questycaptcha-badlogin' => '자동화된 비밀번호 깨기로부터 보호하기 위해, 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', # Fuzzy + 'questycaptcha-createaccount' => '자동화된 계정 만들기로부터 보호하기 위해, 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', # Fuzzy 'questycaptcha-create' => '문서를 만드려면 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', 'questycaptcha-edit' => '이 문서를 편집하려면 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', - 'questycaptcha-sendemail' => '자동 스팸으로부터 보호하기 위해, 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', + 'questycaptcha-sendemail' => '자동화된 스팸으로부터 보호하기 위해, 아래에 보이는 질문에 답해주세요 ([[Special:Captcha/help|자세한 정보]]):', # Fuzzy 'questycaptchahelp-text' => '이 위키와 같이 사람의 공개적인 참여가 가능한 웹 사이트에서는 자동 프로그램이 스팸을 뿌리는 경우가 있습니다. 물론 이러한 스팸은 제거할 수는 있지만 번거로운 작업이 늘어납니다. @@ -794,7 +793,7 @@ Fir d'Wiki géint automatesche Spam-Ännerungen ze schützen, froe mir Iech d'Fr 'questycaptcha-edit' => "Fir dës Säit z'änneren, beäntwert w.e.g. déi Fro hei ënnedrënner ([[Special:Captcha/help|méi Informatiounen]]):", 'questycaptcha-sendemail' => 'Fir ze hëllefe dës Wiki géint automatiséierte Spam ze schütze, beäntwert w.e.g. déi Fro hei ënnendrënner ([[Special:Captcha/help|méi Informatiounen]]):', 'questycaptchahelp-text' => "Websäiten, déi et jiddwerengem erlaben Ännerunge virzehuelen, sou wéi dës Wiki, ginn dacks vu sougenannte Spammer mëssbraucht, déi automatiséiert hir Linken op vill Internetsäite setzen. -Sou Spam-Linke kënne wuel geläscht ginn, mä si sinn trotzdeem eng grouss Plo. +Esou Spam-Linke kënne wuel geläscht ginn, mä si sinn trotzdem eng grouss Plo. Heiansdo, besonnesch wann nei Internet-Linken op eng Säit derbäigesat ginn, freet dës Wiki Iech eng Fro ze beäntwerten. Well dëst eng Aufgab ass déi schwéier z'automatiséieren ass, erlaabt dëst datt Mënschen hir Ännerunge kënnen agi während déi meescht Spammer an aner Roboter-Attacke kënnen ofgewiert ginn. @@ -838,7 +837,7 @@ $messages['mk'] = array( Контактирајте ги [[Special:ListAdmins|администраторите на страната]] за помош доколку ова неочекувано ве спречува во правењето на искрени придонеси. -Стиснете на копчето „назад“ во вашиот прелисувач за да се вратите на уредувањето на страницата.', +Кликнете на копчето „назад“ во вашиот прелисувач за да се вратите на уредувањето на страницата.', ); /** Malayalam (മലയാളം) @@ -1109,13 +1108,13 @@ Apăsați butonul „Înapoi” al navigatorului pentru a vă reîntoarce la pag * @author Joetaras */ $messages['roa-tara'] = array( - 'questycaptcha-addurl' => "'U cangiamende tune 'nglude de le collegaminde de fore. -Peproteggere condre a 'u spam automateche, pe piacere respunne a 'a domande ca iesse sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", - 'questycaptcha-badlogin' => "Pe proteggere condre a futteminde automatece de password, pe piacere respunne a 'a domande ca iesse aqquà sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", - 'questycaptcha-createaccount' => "Pe proteggere condre a ccreazione automateche de cunde utinde, pe piacere respunne a 'a domande ca iesse aqquà sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", + 'questycaptcha-addurl' => "'U cangiamende tue inglude de le collegaminde esterne. +Pe aiutà a proteggere condre a 'u spam automateche, pe piacere respunne a 'a domande ca combare sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", # Fuzzy + 'questycaptcha-badlogin' => "Pe aiutà a proteggere condre a futteminde automatece de password, pe piacere respunne a 'a domande ca combare aqquà sotte ([[Special:Captcha/help|more info]]):", # Fuzzy + 'questycaptcha-createaccount' => "Pe aiutà a proteggere condre a ccreazione automateche de cunde utinde, pe piacere respunne a 'a domande ca combare aqquà sotte ([[Special:Captcha/help|more info]]):", # Fuzzy 'questycaptcha-create' => "Pe ccrejà sta pàgene, pe piacere respunne a 'a domande ca combare aqquà sotte ([[Special:Captcha/help|more info]]):", 'questycaptcha-edit' => "Pe cangià sta pàgene, pe piacere respunne a 'a domande ca combare aqquà sotte ([[Special:Captcha/help|more info]]):", - 'questycaptcha-sendemail' => "Pe proteggere condre a spam automatece, pe piacere respunne a 'a domande ca iesse aqquà sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", + 'questycaptcha-sendemail' => "Pe aiutà a proteggere condre a spam automatece, pe piacere respunne a 'a domande ca combare aqquà sotte ([[Special:Captcha/help|cchiù 'mbormaziune]]):", # Fuzzy 'questycaptchahelp-text' => "Le site web ca accettane condrebbute da 'u pubbleche, cumme sta Uicchi, sonde spesse abusate da le ''spammer'' ca ausane struminde automatece e aggiungene le lore collegaminde a 'nu sacche de site.
        Pure ca chiste collegaminde de spam ponne essere luate, lore sò sembre 'nu scassamende de palle.

        diff --git a/extensions/ConfirmEdit/ReCaptcha.i18n.php b/extensions/ConfirmEdit/ReCaptcha.i18n.php index 5572656a..9e2c4781 100644 --- a/extensions/ConfirmEdit/ReCaptcha.i18n.php +++ b/extensions/ConfirmEdit/ReCaptcha.i18n.php @@ -81,10 +81,10 @@ $messages['be-tarask'] = array( $messages['br'] = array( 'recaptcha-edit' => "Evit sikour en em wareziñ diouzh ar stroboù emgefre, merkit an daou c'her a welit er voest dindan :", 'recaptcha-addurl' => "Liamm diavaez nevez zo bet degaset ganeoc'h. Evit sikour en em wareziñ diouzh ar stroboù, merkit an daou c'her a welit er voest dindan :", - 'recaptcha-badlogin' => "Evit sikour da wareziñ ar wiki diouzh an diskuliañ gerioù-tremen emgefre dre daolioù-esae, merkit an daou c'her a welit er voest dindan :", - 'recaptcha-createaccount' => "Evit sikour d'en em wareziñ diouzh ar c'hrouiñ kontoù emgefre, merkit an daou c'her a welit er voest dindan :", + 'recaptcha-badlogin' => "Da sikour en em wareziñ diouzh an diskuliañ gerioù-tremen emgefre dre daolioù-esae, merkit an daou c'her a welit er voest dindan :", # Fuzzy + 'recaptcha-createaccount' => "Da sikour en em wareziñ diouzh ar c'hrouiñ kontoù emgefre, merkit an daou c'her a welit er voest dindan :", # Fuzzy 'recaptcha-createaccount-fail' => 'Respont reCAPTHCA faziek pe ezvezant.', - 'recaptcha-create' => "Evit sikour d'en em wareziñ diouzh ar c'hrouiñ pajennoù emgefre, merkit an daou c'her a welit er voest dindan :", + 'recaptcha-create' => "Da sikour en em wareziñ diouzh ar c'hrouiñ pajennoù emgefre, merkit an daou c'her a welit er voest dindan :", # Fuzzy ); /** Bosnian (bosanski) @@ -99,18 +99,18 @@ $messages['bs'] = array( 'recaptcha-create' => 'Da bismo pomogli protiv automatiziranog pravljenja stranica, molimo upišite dvije riječi koje vidite u kutiju ispod:', # Fuzzy ); -/** Czech (čeština) +/** Czech (česky) * @author Jkjk * @author Mormegil */ $messages['cs'] = array( 'recaptcha-desc' => 'Podpora reCAPTCHA pro rozšíření Confirm Edit', - 'recaptcha-edit' => 'V zájmu ochrany této wiki před automatickým spamováním vás prosíme o opsání dvou slov, která vidíte v rámečku níže:', - 'recaptcha-addurl' => 'Vaše editace obsahuje nové externí odkazy. V zájmu ochrany této wiki před automatickým spamováním vás prosíme o opsání dvou slov, která vidíte v rámečku níže:', - 'recaptcha-badlogin' => 'V zájmu ochrany této wiki proti automatickým pokusům uhodnout heslo vás prosíme o opsání dvou slov, která vidíte v rámečku níže:', - 'recaptcha-createaccount' => 'V zájmu ochrany této wiki před automatickým vytvářením účtů vás prosíme o opsání dvou slov, která vidíte v rámečku níže:', + 'recaptcha-edit' => 'V zájmu ochrany před automatickým spamováním opište dvě slova, která vidíte na obrázku:', # Fuzzy + 'recaptcha-addurl' => 'Vaše editace obsahuje nové externí odkazy. V zájmu ochrany před automatickým spamováním opište dvě slova, která vidíte na obrázku:', # Fuzzy + 'recaptcha-badlogin' => 'V zájmu ochrany proti automatickým pokusům uhodnout heslo opište dvě slova, která vidíte na obrázku:', # Fuzzy + 'recaptcha-createaccount' => 'V rámci ochrany před automatickým vytvářením účtů opište dvě slova, která vidíte na obrázku:', # Fuzzy 'recaptcha-createaccount-fail' => 'Nesprávná nebo chybějící odpověď na reCAPTCHA.', - 'recaptcha-create' => 'V zájmu ochrany před automatickým zakládáním stránek vás prosíme o opsání dvou slov, která vidíte v rámečku níže:', + 'recaptcha-create' => 'V zájmu ochrany před automatickým zakládáním stránek opište dvě slova, která vidíte na obrázku:', # Fuzzy ); /** Welsh (Cymraeg) @@ -166,18 +166,6 @@ $messages['es'] = array( 'recaptcha-create' => 'Para protegernos de la creación automática de páginas, escribe las dos palabras que ves en el cuadro de abajo:', # Fuzzy ); -/** Persian (فارسی) - * @author Armin1392 - */ -$messages['fa'] = array( - 'recaptcha-edit' => 'برای محافظت ویکی دربرابر ویرایش خودکار اسپم، ما دوستانه از شما درخواست می‌کنیم که دو کلمه‌ای را که در جعبهٔ زیر می‌بینید را بنویسید:', - 'recaptcha-addurl' => 'ویرایش شما شامل لینک‌های خارجی جدید است.برای محافظت ویکی دربرابر اسپم خودکار، ما دوستانه از شما درخواست می‌کنیم که دو کلمه‌ای را که در جعبهٔ زیر می‌بینید را بنویسید:', - 'recaptcha-badlogin' => 'برای محافظت ویکی دربرابر رخنهٔ رمز عبور به طور خودکار، ما دوستانه از شما درخواست می‌کنیم که دو کلمه‌ای را که در جعبهٔ زیر می‌بینید را بنویسید:', - 'recaptcha-createaccount' => 'برای محافظت ویکی دربرابر ایجاد حساب به طور خودکار، ما دوستانه از شما درخواست می‌کنیم که دو کلمه‌ای را که در جعبهٔ زیر می‌بینید را بنویسید:', - 'recaptcha-createaccount-fail' => 'پاسخ نادرست یا عدم وجود ری‌سی‌اِی‌پی‌تی‌سی‌اچ‌اِی.', - 'recaptcha-create' => 'برای محافظت ویکی دربرابر ایجاد صفحه به طور خودکار، ما دوستانه از شما درخواست می‌کنیم که دو کلمه‌ای را که در جعبهٔ زیر می‌بینید را بنویسید:', -); - /** Finnish (suomi) * @author Nedergard * @author VezonThunder @@ -194,10 +182,8 @@ $messages['fi'] = array( /** French (français) * @author Gomoko * @author Urhixidur - * @author Verdy p */ $messages['fr'] = array( - 'recaptcha-desc' => 'module reCAPTCHA pour Confirmer Modifier', 'recaptcha-edit' => 'Afin de protéger le wiki du spam des modifications automatisées, nous vous demandons de bien vouloir écrire les deux mots visibles dans le cadre ci-dessous :', 'recaptcha-addurl' => 'Votre contribution contient des liens vers un site externe. Pour protéger le wiki contre le spam automatisé, nous vous demandons de bien vouloir écrire les deux mots visibles dans le cadre qui suit :', 'recaptcha-badlogin' => 'Pour protéger le wiki des essais automatiques de cassage de mot de passe, nous vous demandons de bien vouloir écrire les deux mots visibles dans le cadre qui suit:', @@ -232,27 +218,26 @@ $messages['gsw'] = array( ); /** Hebrew (עברית) - * @author Yona b */ $messages['he'] = array( - 'recaptcha-edit' => 'אינכם משתמש רשום. כהגנה מפני ספאם אוטומטי, אנא הקלידו את שתי המילים שלהלן. תודה.', - 'recaptcha-addurl' => 'עריכתכם כוללת קישורים חיצוניים חדשים. כהגנה מפני ספאם אוטומטי, אנא הקלידו את שתי המילים שלהלן. תודה.', - 'recaptcha-badlogin' => 'כהגנה מפני מפצחי סיסמאות אוטומטיים, אנא הקלידו את שתי המילים שלהלן:', - 'recaptcha-createaccount' => 'כהגנה מפני יצירה אוטומטית של חשבונות, נא הקלידו את שתי המילים שלהלן:', + 'recaptcha-edit' => 'אינכם משתמש רשום.כהגנה מפני ספאם אוטומטי, אנא הקלידו את שתי המילים שלהלן. תודה.', # Fuzzy + 'recaptcha-addurl' => 'אינכם משתמש רשום.כהגנה מפני ספאם אוטומטי, אנא הקלידו את שתי המילים שלהלן. תודה.', # Fuzzy + 'recaptcha-badlogin' => 'כהגנה מפני מפצחי סיסמאות אוטומטיים אנא הקלידו את שתי המילים שלהלן:', # Fuzzy + 'recaptcha-createaccount' => 'כהגנה מפני יצירת חשבונות פיקטיביים ע"י אוטומטים אנא הקלידו את שתי המילים שלהלן:', # Fuzzy 'recaptcha-createaccount-fail' => 'לא הוקלדו מילות האישור, או שהוקלדו מילים לא נכונות. נסו שנית.', - 'recaptcha-create' => 'אינכם משתמש רשום. כהגנה מפני ספאם אוטומטי, אנא הקלידו את שתי המילים שלהלן. תודה.', + 'recaptcha-create' => 'אינכם משתמש רשום.כהגנה מפני ספאם אוטומטי, אנא הקלידו את שתי המילים שלהלן. תודה.', # Fuzzy ); /** Upper Sorbian (hornjoserbsce) * @author Michawiki */ $messages['hsb'] = array( - 'recaptcha-edit' => 'Zo by wiki přećiwo awtomatizowanemu spamej škitał, zapisaj prošu dwě słowje, kotrejž w slědowacym polu widźiš:', - 'recaptcha-addurl' => 'Twoja změna wobsahuje nowe eksterne wotkazy. Zo by wiki přećiwo awtomatizowanemu spamej škitał, zapisaj prošu dwě słowje, kotrejž w slědowacym polu widźiš:', - 'recaptcha-badlogin' => 'Zo by wiki přećiwo awtomatizowanemu złamanju hesłow škitał, zapisaj prošu dwě słowje, kotrejž widźiš, do slědowaceho pola:', - 'recaptcha-createaccount' => 'Zo by wiki přećiwo awtomatiskemu wutworjenju konta škitał, zapisaj prošu dwě słowje, kotrejž w slědowacym polu widźiš:', + 'recaptcha-edit' => 'Za škit přećiwo awtomatizowanemu spamej, prošu zapisaj dwě słowje, kotrejž w slědowacym polu widźiš:', # Fuzzy + 'recaptcha-addurl' => 'Twoja změna wobsahuje nowe eksterne wotkazy. Za škit přećiwo awtomatizowanemu spamej, prošu zapisaj dwě słowje, kotrerjž w slědowacym polu widźiš:', # Fuzzy + 'recaptcha-badlogin' => 'Za škit přećiwo awtomatizowanemu złamanju hesłow, zapisaj prošu wobě słowje, kotrejž widźiš, do slědowaceho pola:', # Fuzzy + 'recaptcha-createaccount' => 'Za škit přećiwo awtomatiskemu wutworjenju konta, prošu zapisaj tej wobě słowje, kotrejž w slědowacym polu widźiš:', # Fuzzy 'recaptcha-createaccount-fail' => 'Wopačna abo falowaca wotmołwa reCAPTCHA.', - 'recaptcha-create' => 'Zo by wiki přećiwo awtomatiskemu wutworjenju strony škitał, zapisaj prošu dwě słowje, kotrejž w slědowacym polu widźiš:', + 'recaptcha-create' => 'Za škit přećiwo awtomatiskemu wutworjenju strony, prošu zapisaj tej wobě słowje, kotrejž w slědowacym polu widźiš:', # Fuzzy ); /** Interlingua (interlingua) @@ -306,17 +291,16 @@ $messages['ja'] = array( ); /** Korean (한국어) - * @author Priviet * @author 아라 */ $messages['ko'] = array( 'recaptcha-desc' => '편집 확인에 대한 reCAPCHA 모듈', - 'recaptcha-edit' => '자동 편집 스팸으로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', - 'recaptcha-addurl' => '편집에 새로운 바깥 고리가 포함되어 있습니다. 자동 스팸으로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', - 'recaptcha-badlogin' => '자동 비밀번호 크래킹으로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', - 'recaptcha-createaccount' => '자동화된 계정 만들기로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', + 'recaptcha-edit' => '자동화된 편집 스팸으로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', # Fuzzy + 'recaptcha-addurl' => '편집에 새로운 바깥 링크가 포함되어 있습니다. 자동화된 스팸으로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', # Fuzzy + 'recaptcha-badlogin' => '자동화된 비밀번호 깨기로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', # Fuzzy + 'recaptcha-createaccount' => '자동화된 계정 만들기로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', # Fuzzy 'recaptcha-createaccount-fail' => 'reCAPTCHA 답이 올바르지 않거나 없습니다.', - 'recaptcha-create' => '자동 문서 생성을 막기 위해 아래 상자에 보이는 두 낱말을 입력하세요:', + 'recaptcha-create' => '자동화된 문서 만들기로부터 보호하기 위해, 아래 상자에 보이는 두 낱말을 입력하세요:', # Fuzzy ); /** Colognian (Ripoarisch) @@ -480,12 +464,12 @@ $messages['pt-br'] = array( * @author Joetaras */ $messages['roa-tara'] = array( - 'recaptcha-edit' => "Pe proteggere condre le cangiaminde automatece de le rummate, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", - 'recaptcha-addurl' => "Le cangiaminde tune 'ngludone collegaminde de fore nuève. Pe proteggere condre le cangiaminde automatece de le rummate, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", - 'recaptcha-badlogin' => "Pe proteggere condre le futteminde automatece de le passuord, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", - 'recaptcha-createaccount' => "Pe proteggere condre le ccrejaziune automatece de le cunde, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", + 'recaptcha-edit' => "Pe darne 'na màne a proteggere condre le cangiaminde automatece de le rummate, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", # Fuzzy + 'recaptcha-addurl' => "Le cangiaminde tune 'ngludone collegaminde de fore nuève. Pe darne 'na màne a proteggere condre le cangiaminde automatece de le rummate, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", # Fuzzy + 'recaptcha-badlogin' => "Pe darne 'na màne a proteggere condre le futteminde automatece de le passuord, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", # Fuzzy + 'recaptcha-createaccount' => "Pe darne 'na màne a proteggere condre le ccrejaziune automatece de le cunde, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", # Fuzzy 'recaptcha-createaccount-fail' => 'Resposte reCAPTCHA ingorrette o mangande.', - 'recaptcha-create' => "Pe proteggere condre le ccrejaziune automatece de le pàggene, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", + 'recaptcha-create' => "Pe darne 'na màne a proteggere condre le ccrejaziune automatece de le pàggene, pe piacere scrive le doje parole ca 'ndruche jndr'à buatte aqquà sotte:", # Fuzzy ); /** Russian (русский) diff --git a/extensions/Gadgets/.gitreview b/extensions/Gadgets/.gitreview deleted file mode 100644 index a1a8ead4..00000000 --- a/extensions/Gadgets/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/Gadgets.git -defaultbranch=master diff --git a/extensions/Gadgets/ApiQueryGadgets.php b/extensions/Gadgets/ApiQueryGadgets.php index 94c4f04d..a529daf0 100644 --- a/extensions/Gadgets/ApiQueryGadgets.php +++ b/extensions/Gadgets/ApiQueryGadgets.php @@ -214,7 +214,7 @@ class ApiQueryGadgets extends ApiQueryBase { ' api.php?action=query&list=gadgets&gaprop=id|desc', 'Get a list of gadgets with all possible properties:', " api.php?action=query&list=gadgets&gaprop=$allProps", - 'Get a list of gadgets belonging to category "foo":', + 'Get a list of gadgets belonging to caregory "foo":', ' api.php?action=query&list=gadgets&gacategories=foo', 'Get information about gadgets "foo" and "bar":', ' api.php?action=query&list=gadgets&gaids=foo|bar&gaprop=id|desc|metadata', diff --git a/extensions/Gadgets/COPYING b/extensions/Gadgets/COPYING deleted file mode 100644 index d159169d..00000000 --- a/extensions/Gadgets/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/extensions/Gadgets/Gadgets.alias.php b/extensions/Gadgets/Gadgets.alias.php index 5ec050c9..7f3307a5 100644 --- a/extensions/Gadgets/Gadgets.alias.php +++ b/extensions/Gadgets/Gadgets.alias.php @@ -59,7 +59,7 @@ $specialPageAliases['ce'] = array( 'Gadgets' => array( 'Гаджеташ' ), ); -/** Czech (čeština) */ +/** Czech (česky) */ $specialPageAliases['cs'] = array( 'Gadgets' => array( 'Udělátka' ), ); @@ -136,7 +136,7 @@ $specialPageAliases['haw'] = array( /** Hebrew (עברית) */ $specialPageAliases['he'] = array( - 'Gadgets' => array( 'גאדג\'טים', 'סקריפטים' ), + 'Gadgets' => array( 'סקריפטים' ), ); /** Hindi (हिन्दी) */ diff --git a/extensions/Gadgets/Gadgets.i18n.php b/extensions/Gadgets/Gadgets.i18n.php index b5cbc28a..2cef466a 100644 --- a/extensions/Gadgets/Gadgets.i18n.php +++ b/extensions/Gadgets/Gadgets.i18n.php @@ -379,9 +379,9 @@ $messages['ba'] = array( 'gadgets' => 'Гаджеттар', 'gadgets-title' => 'Гаджеттар', 'gadgets-uses' => 'Ҡулланыла', - 'gadgets-required-rights' => '{{PLURAL:$2|1=Хоҡуҡ талап ителә|Хоҡутар талап ителә}}: + 'gadgets-required-rights' => '{{PLURAL:$2|Хоҡуҡ талап ителә|Хоҡутар талап ителә}}: -$1', # Fuzzy +$1', 'gadgets-export' => 'Сығарырға', 'gadgets-not-found' => '"$1" гаджеты табылманы.', 'gadgets-export-download' => 'Күсереп алырға', @@ -459,10 +459,10 @@ $messages['be-tarask'] = array( 'gadgets-pagetext' => 'Ніжэй знаходзіцца сьпіс гаджэтаў, якія ўдзельнікі могуць уключыць у [[Special:Preferences#mw-prefsection-gadgets|сваіх наладах]], у адпаведнасьці са сьпісам на старонцы [[MediaWiki:Gadgets-definition|вызначэньняў]]. Гэты сьпіс дазваляе лёгка атрымаць доступ да старонак сыстэмных паведамленьняў, якія вызначаюць апісаньні і крынічныя коды гаджэтаў.', 'gadgets-uses' => 'Выкарыстоўвае', - 'gadgets-required-rights' => '{{PLURAL:$2|1=Патрабуецца права|Патрабуюцца наступныя правы}}: + 'gadgets-required-rights' => '{{PLURAL:$2|Патрабуецца права|Патрабуюцца наступныя правы}}: -$1', # Fuzzy - 'gadgets-required-skins' => 'Даступны ў {{PLURAL:$2|1=тэме $1|наступных тэмах: $1}}.', # Fuzzy +$1', + 'gadgets-required-skins' => 'Даступны ў {{PLURAL:$2|тэме $1|наступных тэмах: $1}}.', 'gadgets-default' => 'Дазволеныя для ўсіх па змоўчваньні.', 'gadgets-export' => 'Экспартаваць', 'gadgets-export-title' => 'Экспарт гаджэта', @@ -634,29 +634,19 @@ Heu de tenir els permisos adequats en el wiki de destinació (incloent-hi els pe */ $messages['ce'] = array( 'gadgets-desc' => 'Атто бо декъашхошна харжам ба [[Special:Preferences#mw-prefsection-gadgets|гIирс нисбарца]] CSS- а JavaScript-хIоттончаш, лато лууш йерш', # Fuzzy - 'prefs-gadgets' => 'Гаджеташ', - 'gadgets-prefstext' => 'Лаххьа балийна леррина гаджеташ могӀам, шуьга шайга латалур йолуш хьай долахь долучу дакъан. -ХӀара гаджеташ дуккхачу хьолехь болх беш ю оцу JavaScript тӀехь, цундела аша латоеза JavaScript шай браузер чохь, цаьрга болх байта. -Диц маделаш, хӀара гаджеташ болх бяш яц хӀо гӀирс нисбо агӀон чохь. + 'prefs-gadgets' => 'Хlоттончаш', + 'gadgets-prefstext' => 'Лаххьа балийна леррина хlоттончаш могlам, шуьга шайга латалур йолуш хьай долахь долучу дакъан. +Хlара хlоттончаш дукхачу хьоляхь болх беш ю оцу JavaScript тlяхь, цундела аша латоеза JavaScript шай дуьнена машан гlирса чохь, цаьрга болх байта. +Диц маделаш, хlара хlоттончаш болх бяш яз хlо гlирс нисбо агlон чохь. -Ишта диц маде, хӀара гаджеташ юкъа йогуш яц кху MediaWiki гlирсашна, мадарра аьльча шу санна декъашхоша шаьш йеш ю. +Ишта диц маде, хlара хlоттончаш юкъа йогуш яз кху MediaWiki гlирсашна, мадарра аьльча шу санна декъашхоша шаьш йеш ю. Адманкуьйгалхошка шайг хийцало и хlоттончи могlам, хlокх могlам гlонца [[MediaWiki:Gadgets-definition|къастам бало]] а [[Special:Gadgets|церах лаьцна]].', - 'gadgets' => 'Гаджеташ', - 'gadgets-title' => 'Гаджеташ', + 'gadgets' => 'Хlоттончаш', + 'gadgets-title' => 'Хlоттончаш', 'gadgets-pagetext' => 'Гlирса хааман могlамаш, къастош йолу хlоттончи цlераш, хуьлаш йолу хIокху [[MediaWiki:Gadgets-definition|къастамца]]]]. ХIокху могIамо атто бо гIирсан хаамаш атта тIе кхочуш барца, цуьнах лаьцна хIоттош а йолш йолучу хIоттончи ишарца.', # Fuzzy - 'gadgets-uses' => 'Лелош ю', - 'gadgets-required-rights' => '{{PLURAL:$2|1=Оьшуш ю бакъо|Оьшуш ю бакъонаш}}: - -$1', # Fuzzy - 'gadgets-default' => 'Латае массарна Iад йитарца.', + 'gadgets-uses' => 'Лелош йу', 'gadgets-export' => 'Экспорт ян', - 'gadgets-export-title' => 'Гаджет экспорт яр', - 'gadgets-export-text' => 'Гаджет $1 экспорт ян тӀетаӀае кнопка «{{int:gadgets-export-download}}», тӀакха чуяьккхина файл Ӏалаше, -Special:Import агӀона дехьа гӀой чуяккха файл. ТӀакха MediaWiki:Gadgets-definition агӀона чу билла лахара могӀа: -
        $2
        -И болх бан хьан бакъо хила еза (кхин системин хаамаш та ян бакъо а хила еза), кхи серверан чохь файлаш импорт йо гӀирс латина хила беза.', - 'gadgets-export-download' => 'Чуяккха', ); /** Sorani Kurdish (کوردی) @@ -689,7 +679,7 @@ $1', 'gadgets-export-download' => 'دایبگرە', ); -/** Czech (čeština) +/** Czech (česky) * @author Danny B. * @author Li-sung * @author Mormegil @@ -722,7 +712,7 @@ Na cílové wiki musíte mít příslušná oprávnění (včetně práva editov 'gadgets-export-download' => 'Stáhnout', ); -/** Church Slavic (словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) +/** Church Slavic (словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) * @author ОйЛ */ $messages['cu'] = array( @@ -859,7 +849,6 @@ Sie müssen über die notwendigen Berechtigungen auf dem für den Import vorgese /** Zazaki (Zazaki) * @author Erdemaslancan * @author Gorizon - * @author Mirzali * @author Neribij * @author Olvörg * @author Xoser @@ -867,12 +856,12 @@ Sie müssen über die notwendigen Berechtigungen auf dem für den Import vorgese $messages['diq'] = array( 'gadgets-desc' => "Karberan ré destur bidek [[Special:Preferences#mw-prefsection-gadgets|hesıbyayan]]'ra [[Special:Gadgets|Hacetanê CSS u JavaScriptî]] bışé weçiné", 'prefs-gadgets' => 'Haleti', - 'gadgets-prefstext' => 'Cêr de yew lista hacetanê xasan esta ke tı şenay xesabê xo de a kerê. -Enê haceti JavaScript sero gureyenê, aye ra tı gani ageyrayoğê xo de JavaScript a kerê. -Ena pela opsiyoni de haceti tesir nêkenê. + 'gadgets-prefstext' => 'Cor de yew listeya hacetanê xasî esta ke ti eşkenî xesabê xo de a bikî. +Enê hacatî JavaScript ser o gurêyenê, aya ra ti ganî browserê xo de JavaScript a bikî. +Ena pela opsiyonî de hacetî tesîr nêkenê. -Enê hacetê xasi parçê sofwarê Mediyawiki niyê, aye ra karberê locali enê haceti vırazenê. -İdarekarê meheli şenê be [[MediaWiki:Gadgets-definition|kıfşkerdeyan]] û [[Special:Gadgets|arezekerdışan]] ra hacetanê mınasıban bıvurnê.', +Enê hacatanê xasî parçê sofwarê Mediyawîkî nîyê, aye ra karberê localî enê hacetî virazenê. +Îdarekarê mehelî eşkenê hacetan [[MediaWiki:Gadgets-definition|definitions]] û [[Special:Gadgets|descriptions]] ra bivurnê.', 'gadgets' => 'Haleti', 'gadgets-title' => 'Haleti', 'gadgets-pagetext' => 'Cêr de yew listeya hacetanê xasan esta ke ti eşkenî [[Special:Preferences#mw-prefsection-gadgets|xesabê xo]] de a bikî, seke [[MediaWiki:Gadgets-definition|definitions]] nîşan dîyayo. @@ -1127,7 +1116,7 @@ $1', 'gadgets-export-text' => 'برای برون‌بری ابزار $1، بر دکمهٔ «{{int:gadgets-export-download}}» کلیک کنید، پروندهٔ بارگیری‌شده را ذخیره کنید، به ویژه:درون‌ریزی در ویکی مقصد بروید و بارگذاری‌اش کنید. سپس این را به صفحهٔ مدیاویکی:Gadgets-definition بیفزایید:
        $2
        لازم است تا در ویکی مقصد دسترسی‌های مناسب (شامل حق ویرایش پیغام‌های سامانه) را داشته باشید و درون‌ریزی از بارگذاری‌های پرونده باید فعال شده باشد.', - 'gadgets-export-download' => 'دریافت', + 'gadgets-export-download' => 'بارگیری', ); /** Finnish (suomi) @@ -1391,7 +1380,6 @@ Special:Import નિયોજીત વિકિ પર Special:Import પર /** Hebrew (עברית) * @author Amire80 * @author Guycn1 - * @author Guycn2 * @author Rotem Liss * @author YaronSh */ @@ -1413,7 +1401,7 @@ $messages['he'] = array( $1', 'gadgets-required-skins' => 'זמין {{PLURAL:$2|בערכות העיצוב הבאות: $1|בערכת העיצוב $1}}', - 'gadgets-default' => 'מופעל לכולם כברירת מחדל.', + 'gadgets-default' => 'מופעל לכולם לפי בררת מחדל.', 'gadgets-export' => 'יצוא', 'gadgets-export-title' => "יצוא גאדג'טים", 'gadgets-not-found' => 'הגאדג׳ט "$1" לא נמצא.', @@ -1649,32 +1637,32 @@ Anda harus memeroleh izin pada wiki tujuan (termasuk hak menyunting pesan sistem * @author Lam-ang */ $messages['ilo'] = array( - 'gadgets-desc' => 'Agpalubos kadagiti agar-aramat nga agpili kadagiti naiduma a [[Special:Gadgets|CSS ken JavaScript a gadget]] iti [[Special:Preferences#mw-prefsection-gadgets|kakaykayatanda]]', - 'prefs-gadgets' => 'Dagiti gadget', - 'gadgets-prefstext' => 'Dita baba ket listaan kadagiti naipangruna a gadget a mabalinmo a pakabaelan iti pakabilangam. -Dagitoy a gadget ket naibatay iti JavaScript, isunga masapul a pakabaelan ti JavaScript idiay "pagbasabasam" tapno agbalin dagitoy. -Laglagipen a dagitoy a gadget ket awan ti pagbanaganna iti daytoy panid ti kakaykayatan. - -Laglagipen pay a dagitoy a naipangruna a gadget ket saan a paset ti sopwer ti MediaWiki, ken kadawyan a pinarang-ay ken tinartaripato babaen dagiti agar-aramat iti lokal a wiki. -Dagiti lokal nga administrador ket mabalinda nga urnosen dagiti [[MediaWiki:Gadgets-definition|panangipalplawag]] ken dagiti [[Special:Gadgets|deskripsion]] dagiti magun-od a gadget.', - 'gadgets' => 'Dagiti gadget', - 'gadgets-title' => 'Dagiti gadget', - 'gadgets-pagetext' => 'Dita baba ket listaan dagiti naipangruna a gadget a mabalin a pakabaelan dagiti agar-aramat iti bukodda a [[Special:Preferences#mw-prefsection-gadgets|panid ti kakaykayatan]], a kas naipalawag babaen dagiti [[MediaWiki:Gadgets-definition|pannakaipalawag]]. -Daytoy a nakabuklan ket mangted ti nalaka a panagserrek kadagiti panid ti mensahe ti sistema a mangipalawag ti tungngal maysa a deskripsion ken kodigo ti gadget.', + 'gadgets-desc' => 'Mabalin dagiti agar-aramat nga agpili iti [[Special:Gadgets|CSS ken JavaScript gadgets]] idiay [[Special:Preferences#mw-prefsection-gadgets|kaykayat da]]', + 'prefs-gadgets' => 'Gadgets', + 'gadgets-prefstext' => 'Adda dita baba ti listaan ti naipangruna a gadgets nga usaren idiay pakabilangam. +Dagitoy a gadgets ket naibasta iti JavaScript, masapul a pakabaelan ti JavaScript idiay "pagbasabasam" tapno agbalin da. +Saan a mabalin nga usaren dagitoy a gadgets ditoy kaykayat a panid. + +Dagitoy a gadgets ket saan a paset ti MediaWiki software, inaramid ken inayaywanan dagiti agar-aramat ti lokal a wiki. +Mabaliwan dagita administrador nga urnosen ti [[MediaWiki:Gadgets-definition|pinakailawag]] ken [[Special:Gadgets|deskripsion]] ti gadgets.', + 'gadgets' => 'Gadgets', + 'gadgets-title' => 'Gadgets', + 'gadgets-pagetext' => 'Dita baba ket adda listaan dagiti naipangruna a gadgets a dagiti agar-aramat ket mapagbalin da idiay [[Special:Preferences#mw-prefsection-gadgets|kaykayat da a panid]], a naipalawag iti [[MediaWiki:Gadgets-definition|dagiti pinakailawag]]. +Daytoy a pinakabuklan ket mangted ti nalaka a pinagserrek kadagit mensahe ti sistema a panid a nagpailawag iti deskripsion ti gadget ken kodigo.', 'gadgets-uses' => 'Usar', - 'gadgets-required-rights' => 'Masapul ti sumaganad a {{PLURAL:$2|karbengan|karkarbengan}}: + 'gadgets-required-rights' => 'Masapul dagiti sumaganad {{PLURAL:$2|a karbengan|dagiti karbengan}}: $1', - 'gadgets-required-skins' => 'Mabalin a magun-od {{PLURAL:$2|iti $1 a kudil|kadagiti sumaganad a kudil: $1}}.', - 'gadgets-default' => 'Pakabaelan a kasisigud para kadagiti amin.', + 'gadgets-required-skins' => 'Adda mabalin idiay {{PLURAL:$2|$1 a kudil|dagiti sumaganad a kudil: $1}}.', + 'gadgets-default' => 'Pakabaelan a kinasigud iti amin nga agar-aramat.', 'gadgets-export' => 'Agipan', 'gadgets-export-title' => 'Agipan ti gadget', 'gadgets-not-found' => 'Saan a nabirukan ti "$1" a gadget.', - 'gadgets-export-text' => 'Ti panag-ipan ti $1 a gadget, pinduten ti buton ti "{{int:gadgets-export-download}}", idulin ti naikarga a papeles, -mapan idiay Special:Import iti papanan a wiki ken ikarganto. Kalpasanna inayon dagiti sumaganad idiay panid ti MediaWiki:Gadgets-definition: + 'gadgets-export-text' => 'Ti pinag-ipan ti $1 a gadget, agtakla idiay "{{int:gadgets-export-download}}" a buton, idulin ti inkarga nga agpababa a papeles, +mapan idiay Special:Import ti papanan a wiki ken ikarga nga agpangato. Ken inayon dagiti sumaganad idiay MediaWiki:Gadgets-definition page:
        $2
        -Nasken nga addaanka ti maitunos a pammalubos iti papanan a wiki (mairaman ti karbengan a panag-urnos kadagiti mensahe ti sistema) ken nasken a napakabaelan ti panagikarga kadagiti papeles.', - 'gadgets-export-download' => 'Agikaraga', +Masapul nga addaan ka ti husto a pammalubos iti papanan a wiki (nairaman ti karbegnan a pinagbaliw dagiti mensahe ti sistema) ken naipabalin ti pinagala kadagiti naggapu a papeles a naikarga nga agpangato.', + 'gadgets-export-download' => 'Ikarga nga agpababa', ); /** Ido (Ido) @@ -1801,7 +1789,6 @@ Bemærk også at disse specielle gadgets ikke er en del af MediaWiki-softwaren o ); /** Javanese (Basa Jawa) - * @author Bennylin * @author Meursault2004 * @author NoiX180 * @author Pras @@ -1826,10 +1813,6 @@ $1', 'gadgets-export' => 'Èkspor', 'gadgets-export-title' => 'Èkspor perkakas', 'gadgets-not-found' => 'Perkasas "$1" ora ditemokaké.', - 'gadgets-export-text' => 'Untuk mengekspor perkakas $1, klik tombol "{{int:gadgets-export-download}}", simpan berkas yang diunduh, -tuju ke Special:Import pada wiki tujuan dan unggah berkas itu. Kemudian tambahkan berkas tersebut ke halaman MediaWiki:Gadgets-definition: -
        $2
        -Anda harus memeroleh izin pada wiki tujuan (termasuk hak menyunting pesan sistem) dan mengimpor dari unggahan berkas yang harus diaktifkan.', 'gadgets-export-download' => 'Undhuh', ); @@ -1889,23 +1872,18 @@ $messages['kk-arab'] = array( */ $messages['kk-cyrl'] = array( 'prefs-gadgets' => 'Қажет құралдар', - 'gadgets-prefstext' => 'Төменде өз тіркелгіңізде қоса алатын арнаулы қажет құралдар тізімі берілген. -Осы қажет құралдар көбінесе JavaScript әмірлеріне негізделеді, сондықтан бұлар жұмыс істеуі үшін шолғышыңызда JavaScript қосылған болуы керек. -Бұл баптау бетіне осы қажет құралдар әсер етпейтінін ескеріңіз. + 'gadgets-prefstext' => 'Төменде өз тіркелгіңізде қоса алатын арнаулы қажет құралдар тізімі беріледі. +Осы қажет құралдар көбінесе JavaScript әмірлеріне негізделінеді, сондықтан бұлар жұмыс істеуі үшін шолғышыңызда JavaScript қосылған болуы керек. +Бұл баптау бетіне осы қажет құралдар әсер етпейтінің ескеріңіз. -Тағы да ескеріңіз: осы қажет құралдар MediaWiki бағдарламасының бөлігі емес және бұларды әдетте сіздің жергілікті уикиіңіздің қатысушылары дамытады және қоштайды. -Жергілікті әкімшілер жетімді гаджеттерді [[MediaWiki:Gadgets-definition]] және [[Special:Gadgets|сипаттама]] беттері арқылы +Тағы да ескеріңіз: осы қажет құралдар MediaWiki бағдарламасының бөлігі емес, және де бұларды жайшылықта жергілікті уикидің қатысушылары дамытады және қоштайды. +Жергілікті әкімшілер жетімді қажет нәрсе тізімін [[{{ns:mediawiki}}:Gadgets-definition]] және [[{{ns:special}}:Gadgets]] беттері арқылы өңдей алады.', # Fuzzy 'gadgets' => 'Қажет құралдар', 'gadgets-title' => 'Қажет құралдар', - 'gadgets-pagetext' => 'Төменде қатысушылар өзінің [[Special:Preferences#mw-prefsection-gadgets|баптауларынан]] қоса алатын арнаулы қажет құралдар тізімі берілген. [[MediaWiki:Gadgets-definition]] шолу беті арқылы әрбір қажет құралдың сипаттамасы мен әмірін анықтайтын жүйе хабар беттеріне жеңіл қатынай аласыз.', + 'gadgets-pagetext' => 'Төменде арнаулы қажет құралдар тізімі беріледі. [[{{ns:mediawiki}}:Gadgets-definition]] бетінде анықталған қажет құралдарды қатысушылар өзінің баптауында қоса алады. +Бұл шолу беті арқылы әрбір қажет құралдың сипаттамасы мен әмірін анықтайтын жүйе хабар беттеріне жеңіл қатынай аласыз.', # Fuzzy 'gadgets-uses' => 'Қолданыстағылар', - 'gadgets-required-rights' => 'Келесі {{PLURAL:$2|құқықты|құқықтарды}} қажет етеді: $1', - 'gadgets-default' => 'Әркімге автоматты түрде қосылады.', - 'gadgets-export' => 'Экспорттау', - 'gadgets-export-title' => 'Гаджетті экспорттау', - 'gadgets-not-found' => '"$1" гаджеті табылмады.', - 'gadgets-export-download' => 'Түсіру', ); /** Kazakh (Latin script) (qazaqşa (latın)‎) @@ -2073,7 +2051,7 @@ Ausserdeem sollt Dir wëssen, datt dës Gadgete generell net Deel vu MediaWiki s Lokal Wiki-Administrateure kënnen d'Lëscht von den disponibele Gadgeten op de Säiten [[MediaWiki:Gadgets-definition|Definitioune vun Gadgeten]] a [[Special:Gadgets|Beschreiwunge vu Gadgeten]] änneren.", 'gadgets' => 'Gadgeten', 'gadgets-title' => 'Gadgeten', - 'gadgets-pagetext' => "Ënnendrënner ass eng Lëscht vun de spezielle Gadgeten déi d'Benotzer op hire [[Special:Preferences#mw-prefsection-gadgets|Benotzer-Astellungen]] aschalte kënnen, sou wéi dat op [[MediaWiki:Gadgets-definition|definéiert]] ass. + 'gadgets-pagetext' => "Ënnendrënner ass eng Lëscht vun de spezielle Gadgeten déi d'Benotzer op hire [[Special:Preferences#mw-prefsection-gadgets|Benotzer-Astellungen]] aschalte kënnen, esou wéi dat op [[MediaWiki:Gadgets-definition|definéiert]] ass. Dës Iwwersiicht gëtt einfachen Zougang zu de Systemmessage-Säiten, déi all Gadget beschreiwen an zum Programméiercode vun dem Gadget.", 'gadgets-uses' => 'Benotzt', 'gadgets-required-rights' => "Erfuerdert {{PLURAL:$2|d'Recht|dës Rechter}}: $1.", @@ -2082,8 +2060,8 @@ Dës Iwwersiicht gëtt einfachen Zougang zu de Systemmessage-Säiten, déi all G 'gadgets-export' => 'Export', 'gadgets-export-title' => 'Export vu Gadgeten', 'gadgets-not-found' => 'Gadget "$1" net fonnt.', - 'gadgets-export-text' => 'Fir de Gadget $1 z\'exportéieren klickt w.e.g. op de(n) "{{int:gadgets-export-download}}"-Knäppchen, späichert den erofgelueden Fichier, gitt op Spezial:Import op der Zil-Wiki a luet en do erop. Duerno setzt der op d\'MediaWiki:Gadgets-Definitiouns Säit dëst derbäi:
        $2
        -Dir musst déi erfuerdert Rechter(inklusiv d\'Recht fir Systemmessagen z\'änneren) op der Zil-Wiki hunn an den Import vun eropgelueden Fichiere muss ageschalt sinn.', + 'gadgets-export-text' => 'Fir de Gadget $1 z\'exportéieren klickt w.e.g. op de(n) "{{int:gadgets-export-download}}"-Knäppchen, späichert den erofgelueden Fichier, gitt op Spezial:Import op der Zil-Wiki a lued en do erop. Duerno setzt der op d\'MediaWiki:Gadgets-Definitiouns Säit dëst derbäi:
        $2
        +Dir musst déi erfuerdert Rechter(inklusiv d\'Recht fir System-Messagen z\'änneren) op der Zil-Wiki hunn an den Import vun eropgelueden Fichiere muss ageschalt sinn.', 'gadgets-export-download' => 'Eroflueden', ); @@ -2092,7 +2070,6 @@ Dir musst déi erfuerdert Rechter(inklusiv d\'Recht fir Systemmessagen z\'änner * @author Soul Train */ $messages['lez'] = array( - 'prefs-gadgets' => 'Гажетар', 'gadgets' => 'Гаджетар', 'gadgets-title' => 'Гажетар', ); @@ -2132,16 +2109,11 @@ Doe mós de juuste rèchte höbben óppe doelwie, ouch óm bewirkinge aan systee ); /** لوری (لوری) - * @author Bonevarluri * @author Mogoeilor */ $messages['lrc'] = array( 'prefs-gadgets' => 'چيا هنی', - 'gadgets' => 'گجت یا', - 'gadgets-title' => 'گجت یا', - 'gadgets-uses' => 'کاروردیا', 'gadgets-export' => 'وه صحرا ديئن', - 'gadgets-not-found' => 'گجت "$1" پیدا نبی.', 'gadgets-export-download' => 'گرتن', ); @@ -2272,7 +2244,7 @@ $1', 'gadgets-export' => 'Извези', 'gadgets-export-title' => 'Извоз на алатка', 'gadgets-not-found' => 'Алатката „$1“ не е пронајдена.', - 'gadgets-export-text' => 'За да ја извезете алатката $1, стиснете на копчето „{{int:gadgets-export-download}}“, зачувајте ја преземената податотека, + 'gadgets-export-text' => 'За да ја извезете алатката $1, кликнете на копчето „{{int:gadgets-export-download}}“, зачувајте ја преземената податотека, одете на Special:Import на целното вики и подигнете ја. Потоа на страницата MediaWiki:Gadgets-definition внесете го следново:
        $2
        Мора да имате соодветни дозволи на целното вики (вклучувајќи го правото за уредување на системски пораки), и мора да биде овозможен увозот од подигања.', @@ -2329,7 +2301,7 @@ $messages['mr'] = array( 'gadgets-title' => 'गॅजेट', 'gadgets-pagetext' => 'खाली तुम्ही तुमच्या सदस्यत्वासाठी [[Special:Preferences#mw-prefsection-gadgets|माझ्या पसंती]] पानावर वापरू शकत असलेल्या [[MediaWiki:Gadgets-definition|व्याख्या]]ने सांगितलेल्या गॅजेट्सची यादी दिलेली आहे. हे पान तुम्हाला प्रत्येक गॅजेट्सचा कोड व व्याख्या देणार्‍या पानासाठी सोपी संपर्क सुविधा पुरविते.', 'gadgets-uses' => 'उपयोग', - 'gadgets-required-rights' => 'खालील {{PLURAL:$2|अधिकार}} हवेच : + 'gadgets-required-rights' => 'खलील गोष्ठी साठी विनंती {{PLURAL:$2|right|rights}}: $1', 'gadgets-required-skins' => '{{PLURAL:$2|$1 skin|खालील देखाव्यांवर : $1}} उपलब्ध आहेत', @@ -2337,11 +2309,11 @@ $1', 'gadgets-export' => 'निर्यात करा', 'gadgets-export-title' => 'उपकरण निर्यात', 'gadgets-not-found' => 'उपकरण "$1" सापडत नाही.', - 'gadgets-export-text' => '$1 उपकरण-सुविधा निर्यात करण्याकरिता, "{{int:gadgets-export-download}}" कळीवर टिचकी मारा, उतरवलेली संचिका-फाईल जतन करा + 'gadgets-export-text' => '$1 उपकरण-सुविधा निर्यातकरण्या करिता, "{{int:gadgets-export-download}}" कलीवर टिचकी मारा, उतरवलेली संचिका-फाईल जतन करा डेस्टिनेशन विकिच्या विशेष:आयात पानावर जाऊन संचिका-फाईल चढवावी.नंतर खालील MediaWiki:Gadgets-definition पान चढवावे :
        $2
        तुमच्याकडे डेस्टिनेशन विकिवर (सिस्टीम मेसेजेस सुद्धा संपादीत करण्यासहीत ) सुयोग्य परवानग्या उपलब्ध असणे अत्यावश्यक आहे आणि चढवलेल्या संचिकाकरिता आयात सुविधा सक्षम असणे आवश्यक आहे.', - 'gadgets-export-download' => 'अधिभारण करा', + 'gadgets-export-download' => 'उतरवा', ); /** Malay (Bahasa Melayu) @@ -2485,17 +2457,16 @@ Dit overzichte biejt eenvoudige toegang tot de systeemtekstzied waor de beschrie /** Nepali (नेपाली) * @author Bhawani Gautam - * @author Nirmal Dulal */ $messages['ne'] = array( - 'gadgets-desc' => 'प्रयोगकर्ताको [[Special:Preferences#mw-prefsection-gadgets|अभिरुचि अनुसार]] [[Special:Gadgets|CSS र जाभास्क्रीप्ट उपकरणहरू]] छान्न दिनुहोस', - 'prefs-gadgets' => 'उपकरणहरू', - 'gadgets-prefstext' => 'विशेष उपकरणहरूको सूची तल दिइएकोछ तपाईंले आफ्नो खातामा सक्रिय पार्न सक्नुहुन्छ। -प्राय सबै उपकरणहरू जाभास्क्रीप्टमा आधारित छन्, यस कारण ब्राउजरमा काम गराउनको लागि जाभास्क्रीप्टलाई सक्रिय गर्नु पर्छ। -याद राख्नुहोस् ती उपकरणहरूले अभिरुचि पृष्ठमा असर गर्दैनन्। -यो पनि याद राखुहोस् यी विशेष उपकरणहरू मीडिया विकि सफ्टवेयरभित्र पर्दैनन् र प्राय स्थानीय विकि प्रयोगकर्ताहरुले विकास यसको विकास र सञ्चालन गर्दछन्। स्थानीय प्रबन्धकहरूले उपलब्ध उपकरणहरूका [[MediaWiki:Gadgets-definition|परिभाषाहरू]] र [[Special:Gadgets|विवरणहरू]] सम्पादन गर्दछन्।', - 'gadgets' => 'उपकरणहरू', - 'gadgets-title' => 'उपकरणहरू', + 'gadgets-desc' => 'प्रयोगकर्ताको [[Special:Preferences#mw-prefsection-gadgets|अभिरुचि अनुसार]] [[Special:Gadgets|CSS र जाभास्क्रीप्ट उपकरणहरु]] छान्न दिनुहोस्', + 'prefs-gadgets' => 'उपकरणहरु', + 'gadgets-prefstext' => 'विशेष उपकरणहरुको सूची तल दिइएकोछ तपाईंले आफ्नो खातामा सक्रिय पार्न सक्नुहुन्छ। +प्राय सबै उपकरणहरु जाभास्क्रीप्टमा आधारित छन्, यस कारण ब्राउजरमा काम गराउनको लागि जाभास्क्रीप्टलाई सक्रिय गर्नु पर्छ। +याद राख्नुहोस् ती उपकरणहरुले अभिरुचि पृष्ठमा असर गर्दैनन्। +यो पनि याद राखुहोस् यी विशेष उपकरणहरु मीडिया विकि सफ्टवेयरभित्र पर्दैनन् र प्राय स्थानीय विकि प्रयोगकर्ताहरुले विकास यसको विकास र सञ्चालन गर्दछन्। स्थानीय प्रबन्धकहरुले उपलब्ध उपकरणहरुका [[MediaWiki:Gadgets-definition|परिभाषाहरु]] र [[Special:Gadgets|विवरणहरु]] सम्पादन गर्दछन्।', + 'gadgets' => 'उपकरणहरु', + 'gadgets-title' => 'उपकरणहरु', 'gadgets-pagetext' => 'विशेष उपकरणहरुको सूची तल दिइएकोछ प्रयोगकर्ताहरुले [[MediaWiki:Gadgets-definition|परिभाषाहरु]]मा जनाए अनुसार आफ्नो [[Special:Preferences#mw-prefsection-gadgets|अभिरुचि पृष्ठमा]], सक्रिय पार्न सक्नेछन्।। यस सिंहावलोकनले प्रणाली सन्देश पृष्ठ सजिलै प्राप्त गर्न सकिनेछ जसले प्रत्येक उपकरणको विवरण र कोडलाई परिभाषित गरेको छ।', 'gadgets-uses' => 'प्रयोगहरु', @@ -2942,7 +2913,6 @@ Tu a ave le permesse appropriate sus 'a Uicchi de destinazione (ingludenne le de * @author Eleferen * @author Ignatus * @author Illusion - * @author Kaganer * @author MaxSem * @author VasilievVV * @author Александр Сигачёв @@ -2961,10 +2931,10 @@ $messages['ru'] = array( 'gadgets-pagetext' => 'Ниже приведён список гаджетов, которые участники могут включить на своей странице настроек, в соответствии со списком на странице [[MediaWiki:Gadgets-definition|определений]]. Этот список позволяет легко получить доступ к страницам системных сообщений, определяющих описания и исходные коды гаджетов.', 'gadgets-uses' => 'Использует', - 'gadgets-required-rights' => '{{PLURAL:$2|1=Требуется право|Требуются права}}: + 'gadgets-required-rights' => '{{PLURAL:$2|Требуется право|Требуются права}}: $1', - 'gadgets-required-skins' => 'Доступен в {{PLURAL:$2|1=теме оформления «$1»|следующих темах оформления: $1}}.', + 'gadgets-required-skins' => 'Доступен при {{PLURAL:$2|теме оформления $1|следующих темах оформления: $1}}.', 'gadgets-default' => 'Включён для всех по умолчанию.', 'gadgets-export' => 'Экспортировать', 'gadgets-export-title' => 'Экспорт гаджета', @@ -3072,15 +3042,6 @@ $messages['sgs'] = array( 'gadgets' => 'Rakondā', ); -/** Serbo-Croatian (srpskohrvatski / српскохрватски) - * @author Kolega2357 - */ -$messages['sh'] = array( - 'gadgets' => 'Alatke / Алатке', - 'gadgets-title' => 'Alatke / Алатке', - 'gadgets-uses' => 'Upotrebe / Употребе', -); - /** Sinhala (සිංහල) * @author Budhajeewa * @author නන්දිමිතුරු @@ -3218,7 +3179,6 @@ Ju duhet të keni leje të përshtatshme në wiki-n e destinuar (duke përfshir ); /** Serbian (Cyrillic script) (српски (ћирилица)‎) - * @author Milicevic01 * @author Millosh * @author Nikola Smolenski * @author Rancher @@ -3226,12 +3186,12 @@ Ju duhet të keni leje të përshtatshme në wiki-n e destinuar (duke përfshir */ $messages['sr-ec'] = array( 'gadgets-desc' => 'Омогућава корисницима да изаберу прилагођене [[Special:Gadgets|CSS и јаваскрипт гаџете]] у својим [[Special:Preferences#mw-prefsection-gadgets|подешавањима]]', - 'prefs-gadgets' => 'Геџети', + 'prefs-gadgets' => 'Гаџети', 'gadgets-prefstext' => 'Испод се налази списак посебних гаџета које можете да омогућите на свом налогу. Ове справице су углавном засноване на јаваскрипти, тако да она мора бити омогућена. Гаџети неће утицати на страницу за подешавање. -Они нису део софтвера Медијавики, већ се развијају и одржавају од стране корисника на вашем локалном викију. +Они нису део софтвера Медијавики, већ се развијају и одржавају од стране корисника ваше викије. Администратори могу да измене [[MediaWiki:Gadgets-definition|значења]] и [[Special:Gadgets|описе]] доступних гаџета.', 'gadgets' => 'Гаџети', 'gadgets-title' => 'Гаџети', @@ -3255,7 +3215,6 @@ $1', /** Serbian (Latin script) (srpski (latinica)‎) * @author Michaello - * @author Milicevic01 * @author Жељко Тодоровић */ $messages['sr-el'] = array( @@ -3265,7 +3224,7 @@ $messages['sr-el'] = array( Ove spravice su uglavnom zasnovane na javaskripti, tako da ona mora biti omogućena. Gadžeti neće uticati na stranicu za podešavanje. -Oni nisu deo softvera Medijaviki, već se razvijaju i održavaju od strane korisnika na vašem lokalnom vikiju. +Oni nisu deo softvera Medijaviki, već se razvijaju i održavaju od strane korisnika vaše vikije. Administratori mogu da izmene [[MediaWiki:Gadgets-definition|značenja]] i [[Special:Gadgets|opise]] dostupnih gadžeta.', 'gadgets' => 'gedžeti', 'gadgets-title' => 'gedžeti', @@ -3320,7 +3279,6 @@ $messages['su'] = array( * @author Diupwijk * @author Lejonel * @author M.M.S. - * @author Skalman */ $messages['sv'] = array( 'gadgets-desc' => 'Låter användare aktivera personliga [[Special:Gadgets|CSS- och JavaScript-finesser]] genom sina [[Special:Preferences#mw-prefsection-gadgets|inställningar]]', @@ -3333,7 +3291,7 @@ Notera också att dessa finesser inte är en del av MediaWiki-programvaran, och Lokala administratörer kan redigera [[MediaWiki:Gadgets-definition|definitionerna]] och [[Special:Gadgets|beskrivningarna]] av de tillgängliga finesserna.', 'gadgets' => 'Finesser', 'gadgets-title' => 'Finesser', - 'gadgets-pagetext' => 'Härunder finns en lista över finesser som användare kan aktivera i sina [[Special:Preferences#mw-prefsection-gadgets|inställningar]], definierad av [[MediaWiki:Gadgets-definition|definitionerna]]. + 'gadgets-pagetext' => 'Härunder finns en lista över finesser som användare kan aktivera i sina [[Special:Preferences#mw-prefsection-gadgets|inställningar]], definierad av [[MediaWiki:Gadgets-definition|definieringarna]]. Den här översikten ger enkel åtkomst till de systemmeddelanden som definierar beskrivningarna och koden för varje finess.', 'gadgets-uses' => 'Använder', 'gadgets-required-rights' => 'Kräver följande {{PLURAL:$2|rättighet|rättigheter}}: @@ -3555,7 +3513,6 @@ $messages['ug-arab'] = array( /** Ukrainian (українська) * @author AS * @author Ahonc - * @author Andriykopanytsia * @author Dim Grits * @author Olvin * @author Prima klasy4na @@ -3578,10 +3535,10 @@ $messages['uk'] = array( 'gadgets-pagetext' => 'Нижче наведено перелік додатків, які можна ввімкнути на [[Special:Preferences#mw-prefsection-gadgets|сторінці налаштувань]]. Цей перелік задано на [[MediaWiki:Gadgets-definition|сторінці визначень]]. Таким чином, можна отримати простий доступ до системних сторінок, де задається опис кожного додатку та його код.', 'gadgets-uses' => 'Використовує', - 'gadgets-required-rights' => '{{PLURAL:$2|1=Потрібне право|Потрібні такі права}}: + 'gadgets-required-rights' => '{{PLURAL:$2|Потрібне право|Потрібні такі права}}: $1', - 'gadgets-required-skins' => 'Доступний на {{PLURAL:$2|1=$1 skin|наступних темах оформлення: $1}}.', + 'gadgets-required-skins' => 'Доступний на {{PLURAL:$2|$1 skin|наступних темах оформлення: $1}}.', 'gadgets-default' => 'Увімкнено для всіх за замовчуванням.', 'gadgets-export' => 'Експортувати', 'gadgets-export-title' => 'Експорт додатка', diff --git a/extensions/Gadgets/SpecialGadgets.php b/extensions/Gadgets/SpecialGadgets.php index f6c3d74c..888ba6e2 100644 --- a/extensions/Gadgets/SpecialGadgets.php +++ b/extensions/Gadgets/SpecialGadgets.php @@ -95,7 +95,7 @@ class SpecialGadgets extends SpecialPage { array( 'action' => 'edit' ) ); $links[] = Linker::link( - $this->getPageTitle( "export/{$gadget->getName()}" ), + $this->getTitle( "export/{$gadget->getName()}" ), $this->msg( 'gadgets-export' )->escaped() ); diff --git a/extensions/Gadgets/tests/GadgetTest.php b/extensions/Gadgets/tests/GadgetTest.php deleted file mode 100644 index c9332a6c..00000000 --- a/extensions/Gadgets/tests/GadgetTest.php +++ /dev/null @@ -1,81 +0,0 @@ -assertEquals( 'Gadget', get_class( $g ) ); - - return $g; - } - - function testInvalidLines() { - $this->assertFalse( Gadget::newFromDefinition( '' ) ); - $this->assertFalse( Gadget::newFromDefinition( '' ) ); - } - - function testSimpleCases() { - $g = $this->create( '* foo bar| foo.css|foo.js|foo.bar' ); - $this->assertEquals( 'foo_bar', $g->getName() ); - $this->assertEquals( 'ext.gadget.foo_bar', $g->getModuleName() ); - $this->assertEquals( array( 'Gadget-foo.js' ), $g->getScripts() ); - $this->assertEquals( array( 'Gadget-foo.css' ), $g->getStyles() ); - $this->assertEquals( array( 'Gadget-foo.js', 'Gadget-foo.css' ), - $g->getScriptsAndStyles() ); - $this->assertEquals( array( 'Gadget-foo.js' ), $g->getLegacyScripts() ); - $this->assertFalse( $g->supportsResourceLoader() ); - $this->assertTrue( $g->hasModule() ); - } - - function testRLtag() { - $g = $this->create( '*foo [ResourceLoader]|foo.js|foo.css' ); - $this->assertEquals( 'foo', $g->getName() ); - $this->assertTrue( $g->supportsResourceLoader() ); - $this->assertEquals( 0, count( $g->getLegacyScripts() ) ); - } - - function testDependencies() { - $g = $this->create( '* foo[ResourceLoader|dependencies=jquery.ui]|bar.js' ); - $this->assertEquals( array( 'Gadget-bar.js' ), $g->getScripts() ); - $this->assertTrue( $g->supportsResourceLoader() ); - $this->assertEquals( array( 'jquery.ui' ), $g->getDependencies() ); - } - - function testPreferences() { - global $wgUser, $wgOut, $wgTitle; - - // This test makes call to the parser which requires valids Outputpage - // and Title objects. Set them up there, they will be released at the - // end of the test. - $old_wgOut = $wgOut; - $old_wgTitle = $wgTitle; - $wgTitle = Title::newFromText( 'Parser test for Gadgets extension' ); - - // Proceed with test setup: - $prefs = array(); - $context = new RequestContext(); - $wgOut = $context->getOutput(); - $wgOut->setTitle( Title::newFromText( 'test' ) ); - - Gadget::loadStructuredList( '* foo | foo.js -==keep-section1== -* bar| bar.js -==remove-section== -* baz [rights=embezzle] |baz.js -==keep-section2== -* quux [rights=read] | quux.js' ); - $this->assertTrue( GadgetHooks::getPreferences( $wgUser, $prefs ), 'GetPrefences hook should return true' ); - - $options = $prefs['gadgets']['options']; - $this->assertFalse( isset( $options['<gadget-section-remove-section>'] ), 'Must not show empty sections' ); - $this->assertTrue( isset( $options['<gadget-section-keep-section1>'] ) ); - $this->assertTrue( isset( $options['<gadget-section-keep-section2>'] ) ); - - // Restore globals - $wgOut = $old_wgOut; - $wgTitle = $old_wgTitle; - } -} diff --git a/extensions/ImageMap/.gitreview b/extensions/ImageMap/.gitreview deleted file mode 100644 index 2629c9d9..00000000 --- a/extensions/ImageMap/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/ImageMap.git -defaultbranch=master diff --git a/extensions/ImageMap/COPYING b/extensions/ImageMap/COPYING deleted file mode 100644 index d159169d..00000000 --- a/extensions/ImageMap/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/extensions/ImageMap/ImageMap.i18n.php b/extensions/ImageMap/ImageMap.i18n.php index 3e7e9f76..1e07d69c 100644 --- a/extensions/ImageMap/ImageMap.i18n.php +++ b/extensions/ImageMap/ImageMap.i18n.php @@ -1,6 +1,6 @@ '<imagemap> টেগ্‌ ব্যৱহাৰ কৰি ক্লায়েণ্ট-চাইড ক্লিকেবল্‌ ইমেজ্‌ মেপৰ অনুমতি দিয়ে', 'imagemap_no_image' => 'ত্ৰুটী: প্ৰথম শাৰীত এখন ছবি নিৰ্দিষ্ট কৰিবই লাগিব', 'imagemap_invalid_image' => 'ত্ৰুটী: ছবিখন অবৈধ বা ছবিখন নাই', - 'imagemap_bad_image' => 'ত্ৰুটী: এই পৃষ্ঠাত ছবিখন ব্লেকলিষ্টেড কৰা হৈছে।', + 'imagemap_bad_image' => 'ত্ৰুটী: এই পৃষ্ঠাত ছবিখন ব্লেকলিষ্টেড কৰা হৈছে', 'imagemap_no_link' => "ত্ৰুটী: $1 শাৰীৰ শেষত কোনো বৈধ লিংক পোৱা নগ'ল", 'imagemap_invalid_title' => 'ত্ৰুটী: $1 শাৰীত থকা লিংকৰ শিৰোনাম অবৈধ', 'imagemap_missing_coord' => 'ত্ৰুটী: $1 শাৰীত আকৃতিৰ বাবে যথেষ্ট স্থানাংক নাই', @@ -365,9 +365,7 @@ $messages['ca'] = array( * @author Умар */ $messages['ce'] = array( - 'imagemap_desc' => 'Таро хуьлуьйту картан суьрта таӀийча латораш билгалдан <imagemap> теган гӀуьнца', 'imagemap_invalid_image' => 'ГӀалат: нийса дац я ишта сурт дац кху чохь', - 'imagemap_no_link' => 'ГӀалат: $1 могӀанан чаккхехь нийса йоцу хьажораг ю', 'imagemap_invalid_title' => 'ГӀалат: могӀана $1 хьажориган корта нийса яц', 'imagemap_description' => 'Суьртах лаьцна', ); @@ -378,7 +376,7 @@ $messages['co'] = array( 'imagemap_description' => "À prupositu d'issa imagine", ); -/** Czech (čeština) +/** Czech (česky) * @author Li-sung * @author Mormegil */ diff --git a/extensions/ImageMap/ImageMap.php b/extensions/ImageMap/ImageMap.php index b263bbb5..aa4cfa0d 100644 --- a/extensions/ImageMap/ImageMap.php +++ b/extensions/ImageMap/ImageMap.php @@ -1,20 +1,4 @@ diff --git a/extensions/InputBox/.gitreview b/extensions/InputBox/.gitreview deleted file mode 100644 index 9d0c704d..00000000 --- a/extensions/InputBox/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/InputBox.git -defaultbranch=master diff --git a/extensions/InputBox/InputBox.classes.php b/extensions/InputBox/InputBox.classes.php index 314bc6c8..380015cc 100644 --- a/extensions/InputBox/InputBox.classes.php +++ b/extensions/InputBox/InputBox.classes.php @@ -84,10 +84,10 @@ class InputBox { // Use button label fallbacks if ( !$this->mButtonLabel ) { - $this->mButtonLabel = wfMessage( 'tryexact' )->text(); + $this->mButtonLabel = wfMessage( 'tryexact' )->escaped(); } if ( !$this->mSearchButtonLabel ) { - $this->mSearchButtonLabel = wfMessage( 'searchfulltext' )->text(); + $this->mSearchButtonLabel = wfMessage( 'searchfulltext' )->escaped(); } // Build HTML @@ -101,7 +101,7 @@ class InputBox { 'name' => 'searchbox', 'id' => 'searchbox', 'class' => 'searchbox', - 'action' => SpecialPage::getTitleFor( 'Search' )->getLocalUrl(), + 'action' => SpecialPage::getTitleFor( 'Search' )->escapeLocalUrl(), ) ); $htmlOut .= Xml::element( 'input', @@ -239,7 +239,7 @@ class InputBox { public function getSearchForm2() { // Use button label fallbacks if ( !$this->mButtonLabel ) { - $this->mButtonLabel = wfMessage( 'tryexact' )->text(); + $this->mButtonLabel = wfMessage( 'tryexact' )->escaped(); } $id = Sanitizer::escapeId( $this->mID, 'noninitial' ); @@ -255,7 +255,7 @@ class InputBox { 'name' => 'bodySearch' . $id, 'id' => 'bodySearch' . $id, 'class' => 'bodySearch', - 'action' => SpecialPage::getTitleFor( 'Search' )->getLocalUrl(), + 'action' => SpecialPage::getTitleFor( 'Search' )->escapeLocalUrl(), 'style' => $this->mInline ? 'display: inline;' : '' ) ); @@ -312,11 +312,11 @@ class InputBox { if ( $this->mType == "comment" ) { if ( !$this->mButtonLabel ) { - $this->mButtonLabel = wfMessage( 'postcomment' )->text(); + $this->mButtonLabel = wfMessage( "postcomment" )->escaped(); } } else { if ( !$this->mButtonLabel ) { - $this->mButtonLabel = wfMessage( 'createarticle' )->text(); + $this->mButtonLabel = wfMessage( 'createarticle' )->escaped(); } } @@ -427,7 +427,7 @@ class InputBox { global $wgScript; if ( !$this->mButtonLabel ) { - $this->mButtonLabel = wfMessage( 'postcomment' )->text(); + $this->mButtonLabel = wfMessage( "postcomment" )->escaped(); } $htmlOut = Xml::openElement( 'div', diff --git a/extensions/InputBox/InputBox.i18n.php b/extensions/InputBox/InputBox.i18n.php index 972aea54..1c8519f0 100644 --- a/extensions/InputBox/InputBox.i18n.php +++ b/extensions/InputBox/InputBox.i18n.php @@ -142,7 +142,7 @@ $messages['as'] = array( অনুগ্ৰহ কৰি "create", "comment", "search", "search2" বা "fulltext" নিৰ্ধাৰণ কৰক', 'tryexact' => 'কেবল দিয়া শব্দহে বিচাৰিব', 'searchfulltext' => 'সম্পূৰ্ণ পাঠ্য বিচাৰিব', - 'createarticle' => 'পৃষ্ঠা সৃষ্টি কৰক', + 'createarticle' => 'পৃষ্ঠা বনাওক', 'inputbox-ns-main' => 'মূখ্য', ); @@ -355,11 +355,9 @@ $messages['cdo'] = array( * @author Умар */ $messages['ce'] = array( - 'inputbox-desc' => 'Аьтту хуьлуьйту хьалхе билгалйина HTML-формаш лато', - 'inputbox-error-no-type' => 'Ахьа язъечу меттиган тайп билгала йина яц.', 'tryexact' => 'Леррина лахар', 'searchfulltext' => 'Дуьззина йозанца лахар', - 'createarticle' => 'АгӀо кхолла', + 'createarticle' => 'Яззам кхоллар', ); /** Sorani Kurdish (کوردی) @@ -793,12 +791,11 @@ $messages['hak'] = array( /** Hebrew (עברית) * @author Amire80 - * @author Guycn2 * @author Rotem Liss */ $messages['he'] = array( 'inputbox-desc' => 'אפשרות להכללת טופסי HTML שהוגדרו מראש', - 'inputbox-error-no-type' => 'לא ציינת את סוג תיבת הקלט ליצירה.', + 'inputbox-error-no-type' => 'לא ציינתם את סוג תיבת הקלט ליצירה.', 'inputbox-error-bad-type' => 'סוג תיבת הקלט "$1" אינו ידוע. אנא ציינו "create", "comment", "search", "search2" או "fulltext".', 'tryexact' => 'לדף בשם זה', @@ -952,14 +949,14 @@ $messages['ig'] = array( * @author Lam-ang */ $messages['ilo'] = array( - 'inputbox-desc' => 'Mangipalubos ti panangiraman kadagiti nasakbayan a naipalawag a porma ti HTML', - 'inputbox-error-no-type' => 'Saanmo pay a nainaganan no ania a kita ti partuaten a kahon ti pagikabilan.', - 'inputbox-error-bad-type' => 'Ti kita ti kahon a pigikabilan ti "$1" ket saan a mabigbigan. -Pangngaasi nga inaganam ti "agpartuat", "komento", "biruken", "biruken2", "wenno sibubukel a testo".', + 'inputbox-desc' => 'Pakabaelan na nga agikabil kadagiti napalasin a kinabuklan ti HTML', + 'inputbox-error-no-type' => 'Saan mo pay nga imbaga no ania a kita ti pagikabilan a kahon ti aramiden.', + 'inputbox-error-bad-type' => 'Ti kita ti pigikabilan a kahon "$1" ket saan a ma-ammoan. +Pangaasi ta ibagam nga "agaramid", "komentario", "biruken", "biruken2", "wenno sibubukel a testo".', 'tryexact' => 'Padasem to pudno a kapada', - 'searchfulltext' => 'Agbiruk ti napno a testo', - 'createarticle' => 'Agpartuat ti panid', - 'inputbox-ns-main' => 'Nangruna', + 'searchfulltext' => 'Agbiruk ti sibubukel a testo', + 'createarticle' => 'Agaramid ti panid', + 'inputbox-ns-main' => 'Dati', ); /** Ido (Ido) @@ -1066,12 +1063,11 @@ $messages['kaa'] = array( /** Kabyle (Taqbaylit) * @author Agurzil - * @author Mmistmurt */ $messages['kab'] = array( 'tryexact' => 'Nadi ɣef uzwel kif-kif', 'searchfulltext' => 'Nadi aḍris ettmam', - 'createarticle' => 'Xleq amagrad', + 'createarticle' => 'Xleq amagrad', # Fuzzy ); /** Kazakh (Arabic script) (قازاقشا (تٴوتە)‏) @@ -1128,7 +1124,7 @@ $messages['ko'] = array( 'inputbox-error-bad-type' => '"$1" 입력 상자 종류는 정의되어 있지 않습니다. "create", "comment", "search", "search2"나 "fulltext" 중 하나를 지정하세요.', 'tryexact' => '일치하는 항목 찾기', - 'searchfulltext' => '전체 글 검색', + 'searchfulltext' => '전체 글 찾기', 'createarticle' => '문서 만들기', 'inputbox-ns-main' => '문서', ); @@ -1167,13 +1163,6 @@ $messages['la'] = array( 'createarticle' => 'Paginam creare', ); -/** Ladino (Ladino) - * @author Menachem.Moreira - */ -$messages['lad'] = array( - 'createarticle' => 'Krear pajina', -); - /** Luxembourgish (Lëtzebuergesch) * @author Robby */ @@ -1242,11 +1231,9 @@ $messages['lo'] = array( ); /** لوری (لوری) - * @author Bonevarluri * @author Mogoeilor */ $messages['lrc'] = array( - 'searchfulltext' => 'پی جوری متنی', 'createarticle' => 'راس كردن بلگه', 'inputbox-ns-main' => 'اصلی', ); @@ -1361,7 +1348,7 @@ $messages['mn'] = array( */ $messages['mr'] = array( 'inputbox-desc' => 'पूर्वी लिहिलेले HTML अर्ज वापरण्याची परवानगी द्या', - 'inputbox-error-no-type' => 'कुठल्या प्रकारची पृष्ठपेटी तयार करायची ते तुम्ही स्पष्ट केलेले नाही.', + 'inputbox-error-no-type' => 'तुम्ही कुठल्या प्रकारची पृष्ठपेटी तयार करायची ते स्पष्ट केलेले नाही.', 'inputbox-error-bad-type' => 'तुम्ही दिलेला पृष्ठपेटीचा "$1" हा प्रकार ओळखीचा नाही. कृपया "create", "comment", "search" किंवा "search2" किंवा "fulltext".यातील एक निवडा.', 'tryexact' => 'दिलेलेच शब्द शोधा', @@ -1667,7 +1654,6 @@ Por favor, especifique "create", "comment", "search", "search2" ou "fulltext".', * @author Brunoy Anastasiya Seryozhenko * @author Eduardo.mps * @author MetalBrasil - * @author Opraco */ $messages['pt-br'] = array( 'inputbox-desc' => 'Permite a inclusão de formulários definidos de HTML', @@ -1676,7 +1662,7 @@ $messages['pt-br'] = array( Por favor, especifique "create", "comment", "search", "search2" ou "fulltext".', 'tryexact' => 'Tentar a expressão exata', 'searchfulltext' => 'Pesquisar em todo o texto.', - 'createarticle' => 'Criar página', + 'createarticle' => 'Criar página.', 'inputbox-ns-main' => 'Principal', ); @@ -1824,13 +1810,6 @@ $messages['sgs'] = array( 'searchfulltext' => 'Ėiškuotė pėlna teksta', ); -/** Serbo-Croatian (srpskohrvatski / српскохрватски) - * @author Kolega2357 - */ -$messages['sh'] = array( - 'searchfulltext' => 'Pretraži cijeli tekst - Претражи цео текст', -); - /** Sinhala (සිංහල) * @author Asiri wiki * @author Budhajeewa diff --git a/extensions/Interwiki/.gitreview b/extensions/Interwiki/.gitreview deleted file mode 100644 index fcc03f61..00000000 --- a/extensions/Interwiki/.gitreview +++ /dev/null @@ -1,6 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/Interwiki.git -defaultbranch=master -defaultrebase=0 \ No newline at end of file diff --git a/extensions/Interwiki/COPYING b/extensions/Interwiki/COPYING deleted file mode 100644 index d159169d..00000000 --- a/extensions/Interwiki/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/extensions/Interwiki/Interwiki.alias.php b/extensions/Interwiki/Interwiki.alias.php index 3e49249e..30098f05 100644 --- a/extensions/Interwiki/Interwiki.alias.php +++ b/extensions/Interwiki/Interwiki.alias.php @@ -251,5 +251,5 @@ $specialPageAliases['zh-hans'] = array( /** Traditional Chinese (中文(繁體)‎) */ $specialPageAliases['zh-hant'] = array( - 'Interwiki' => array( '跨wiki', '跨維基' ), + 'Interwiki' => array( '跨維基連結' ), ); \ No newline at end of file diff --git a/extensions/Interwiki/Interwiki.i18n.php b/extensions/Interwiki/Interwiki.i18n.php index cebc7dc4..a2619ff3 100644 --- a/extensions/Interwiki/Interwiki.i18n.php +++ b/extensions/Interwiki/Interwiki.i18n.php @@ -435,11 +435,8 @@ $messages['arz'] = array( /** Assamese (অসমীয়া) * @author Bishnu Saikia - * @author Gitartha.bordoloi */ $messages['as'] = array( - 'interwiki' => 'আন্তঃৱিকি তথ্য চাওক আৰু সম্পাদনা কৰক', - 'interwiki-title-norights' => 'আন্তঃৱিকি তথ্য চাওক', 'interwiki_1' => 'হয়', 'interwiki_0' => 'নহয়', 'interwiki_edit' => 'সম্পাদনা কৰক', @@ -801,7 +798,6 @@ Ho pezet soñj e c'hall an dra-se terriñ liammoù zo anezho dija.", Marteze n\'eus ket anezhañ.', 'interwiki-badprefix' => 'Arouezennoù direizh zo er rakger etrewiki spisaet "$1', 'interwiki-submit-empty' => "N'hall ket ar rakger hag an URL bezañ goullo.", - 'interwiki-submit-invalidurl' => 'Direizh eo protokol an URL.', 'log-name-interwiki' => 'Deizlevr taolenn an etrewiki', 'logentry-interwiki-iw_add' => '$1 {{GENDER:$2|en deus|he deus}} ouzhpennet ar rakger "$4" ($5) (treuz: $6; lec\'hel: $7) d\'an daolenn etrewiki', 'logentry-interwiki-iw_edit' => '$1 {{GENDER:$2|en deus|he deus}} kemmet ar rakger "$4" ($5) (treuz: $6; lec\'hel: $7) en daolenn etrewiki', @@ -935,7 +931,6 @@ Possiblement no existeix.', */ $messages['ce'] = array( 'interwiki-title-norights' => 'Юкъарвикишан хаамаш хьажар', - 'interwiki-desc' => 'ТӀетуху [[Special:Interwiki|белхан агӀо]] юкъаравикин дешхьалхенашка хьажа а уьш тая а.', 'interwiki_intro' => 'ХӀара ду юкъарвикишан таблице хьажар.', 'interwiki-legend-show' => 'Гайта хьехар', 'interwiki-legend-hide' => 'Къайладаккха хьехар', @@ -956,9 +951,7 @@ $messages['ce'] = array( 'interwiki_0' => 'яц', 'interwiki_edit' => 'Нисйé', 'interwiki_reasonfield' => 'Бахьан:', - 'interwiki_delquestion' => '«$1» дӀаяккхар', - 'interwiki_addbutton' => 'ТӀетоха', - 'logentry-interwiki-iw_edit' => '$1 {{GENDER:$2|хийцина}} префикс «$4» ($5) (trans: $6; local: $7) юкъарвики-таблицехь', + 'interwiki_addbutton' => 'Тlетоха', ); /** Sorani Kurdish (کوردی) @@ -975,7 +968,7 @@ $messages['co'] = array( 'interwiki_reasonfield' => 'Mutivu:', ); -/** Czech (čeština) +/** Czech (česky) * @author Danny B. * @author Mormegil */ @@ -1037,7 +1030,7 @@ Pravděpodobně neexistuje.', 'action-interwiki' => 'změnit tento záznam interwiki', ); -/** Church Slavic (словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) +/** Church Slavic (словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) * @author ОйЛ */ $messages['cu'] = array( @@ -1093,8 +1086,8 @@ $messages['da'] = array( 'interwiki-legend-hide' => 'Skjul forklaring', 'interwiki_prefix' => 'Præfiks', 'interwiki-prefix-label' => 'Præfiks:', - 'interwiki_prefix_intro' => 'Interwiki præfiks som skal anvendes i [[præfiks:sidenavn]] wikitekst syntaks.', - 'interwiki_url_intro' => 'Skabelon til URL-adresser. Pladsholderen $1 vil blive erstattet af sidenavn af wikitekst, når den ovennævnte wikitekst syntaks bruges.', + 'interwiki_prefix_intro' => 'Interwiki præfiks som skal anvendes i [[præfiks:sidenavn]] wikitext syntaks.', + 'interwiki_url_intro' => 'Skabelon til URL-adresser. Pladsholderen $1 vil blive erstattet af sidenavn af wikitext, når den ovennævnte wikitext syntaks bruges.', 'interwiki_local' => 'Videresend', 'interwiki-local-label' => 'Videresend:', 'interwiki_local_intro' => 'En HTTP-forespørgsel til den lokale wiki med denne interwiki præfiks i URL-adressen er:', @@ -1102,7 +1095,7 @@ $messages['da'] = array( 'interwiki_local_1_intro' => 'Omdirigeret til target URL i interwiki link definitioner (dvs. behandles som referencer i lokale sider).', 'interwiki_trans' => 'Transkluder', 'interwiki-trans-label' => 'Transkluder:', - 'interwiki_trans_intro' => 'Hvis wikitekst syntaksen [[præfiks:sidenavn]] bruges, så:', + 'interwiki_trans_intro' => 'Hvis wikitext syntaksen [[præfiks:sidenavn]] bruges, så:', 'interwiki_1' => 'ja', 'interwiki_0' => 'nej', 'interwiki_error' => 'Fejl: Interwikitabellen er tom eller noget andet gik galt.', @@ -1128,7 +1121,7 @@ Husk, at dette kan bryde eksisterende hyperlinks.', Det findes muligvis ikke.', 'interwiki-badprefix' => 'Det angivne interwikipræfiks "$1" indeholder ugyldige tegn.', 'right-interwiki' => 'Redigere interwikidata', - 'action-interwiki' => 'redigere interwikidata', + 'action-interwiki' => 'ændre dette interwiki-element', ); /** German (Deutsch) @@ -1409,7 +1402,6 @@ Verŝajne ĝi ne ekzistas.', /** Spanish (español) * @author Armando-Martin - * @author Ciencia Al Poder * @author Crazymadlover * @author Imre * @author Invadinado @@ -1429,18 +1421,18 @@ $messages['es'] = array( 'interwiki-legend-hide' => 'Ocultar la leyenda', 'interwiki_prefix' => 'Prefijo', 'interwiki-prefix-label' => 'Prefijo:', - 'interwiki_prefix_intro' => 'Prefijo interwiki que se utilizará en sintaxis wikitexto [[prefijo:nombre de página]].', - 'interwiki_url_intro' => 'Plantilla para URLs. El marcador $1 será reemplazado por el nombre de página del wikitexto cuando se use la sintaxis de wikitexto mostrada arriba.', - 'interwiki_local' => 'Remitir', - 'interwiki-local-label' => 'Remitir:', - 'interwiki_local_intro' => 'Una solicitud HTTP a la wiki local con este prefijo interwiki en la URL:', - 'interwiki_local_0_intro' => 'no será satisfecha, normalmente mostrando una página de error "título incorrecto" en su lugar.', - 'interwiki_local_1_intro' => 'será remitida a la URL objetivo definida en los enlaces de interwiki.', + 'interwiki_prefix_intro' => 'Prefijo interwiki que se utilizará en sintaxis wikitexto [[prefix:pagename]] wikitext syntax.', + 'interwiki_url_intro' => 'Plantilla para URLs. El marcador $1 será reemplazado por el nombre de página del wikitexto cuando se use la sintaxis de wikitexto arriba mostrada.', + 'interwiki_local' => 'Adelante', + 'interwiki-local-label' => 'Adelante:', + 'interwiki_local_intro' => 'Una solicitud HTTP a la wiki local con este prefijo interwiki en la URL es:', + 'interwiki_local_0_intro' => 'no se satisfizo, normalmente bloqueado por "página no encontrada",', + 'interwiki_local_1_intro' => 'redirigido a la URL objetivo en las definiciones de enlaces interwiki (es decir, se la trata como a las referencias en páginas locales)', 'interwiki_trans' => 'transcluir', 'interwiki-trans-label' => 'Transcluir:', - 'interwiki_trans_intro' => 'Si se utiliza la sintaxis de wikitexto {{prefijo:nombre de la página}}, entonces:', - 'interwiki_trans_1_intro' => 'se permitirá la transclusión desde la wiki foránea, si las transclusiones de interwiki son por lo general permitidas en este wiki.', - 'interwiki_trans_0_intro' => 'no se permitirá, y en su lugar, buscará una página en el espacio de nombres de plantilla.', + 'interwiki_trans_intro' => 'Si se utiliza la sintaxis de wikitexto {{prefix:pagename}}, entonces:', + 'interwiki_trans_1_intro' => 'permitir la transclusión desde la wiki foránea, si las transclusiones de interwiki son por lo general permitidas en esta wiki,', + 'interwiki_trans_0_intro' => 'no permitirlo. En su lugar, buscar una página en el espacio de nombre de la plantilla.', 'interwiki_intro_footer' => 'Para más información consulte [//www.mediawiki.org/wiki/Manual:Interwiki_table MediaWiki.org] acerca de la tabla de interwiki. Hay un [[Special:Log/interwiki|registro de cambios]] a esta tabla de interwiki.', 'interwiki_1' => 'sí', @@ -1543,23 +1535,10 @@ Võimalik, et seda pole olemas.', /** Basque (euskara) * @author An13sa * @author Kobazulo - * @author Theklan - * @author Xabier Armendaritz */ $messages['eu'] = array( - 'interwiki' => 'Ikusi eta aldatu interwikiak', - 'interwiki-title-norights' => 'Ikusi interwikiak', - 'interwiki-desc' => 'Interwiki taula ikusi eta aldatzeko [[Special:Interwiki|orrialde berezi]] bat gehitzen du', - 'interwiki_intro' => 'Hau interwiki taularen ikuspegi orokor bat da.', - 'interwiki-legend-show' => 'Erakutsi azalpenak', - 'interwiki-legend-hide' => 'Ezkutatu azalpenak', 'interwiki_prefix' => 'Aurrizkia', 'interwiki-prefix-label' => 'Aurrizkia:', - 'interwiki_local' => 'Aurrera', - 'interwiki-local-label' => 'Aurrera:', - 'interwiki_trans' => 'Txertatu', - 'interwiki-trans-label' => 'Txertatu:', - 'interwiki_trans_intro' => '{{prefix:pagename}} wikitestu erako sintaxia erabiltzen bada, orduan:', 'interwiki_1' => 'bai', 'interwiki_0' => 'ez', 'interwiki_edit' => 'Aldatu', @@ -1568,48 +1547,30 @@ $messages['eu'] = array( 'interwiki_deleting' => '"$1" aurrizkia ezabatzen ari zara.', 'interwiki_addbutton' => 'Gehitu', 'interwiki_edittext' => 'Interwiki aurrizkia editatzen', - 'right-interwiki' => 'Interwiki datuak aldatu', - 'action-interwiki' => 'aldatu interwiki sarrera hau', ); /** Persian (فارسی) - * @author Armin1392 * @author Ebraminio * @author Hamid rostami * @author Huji * @author Mjbmr - * @author Omidh - * @author Reza1615 */ $messages['fa'] = array( 'interwiki' => 'نمایش و ویرایش اطلاعات میان‌ویکی', 'interwiki-title-norights' => 'مشاهدهٔ اطلاعات میان‌ویکی', 'interwiki-desc' => 'یک [[Special:Interwiki|صفحهٔ ویژه]] برای مشاهده و ویرایش جدول میان‌ویکی می‌افزاید.', - 'interwiki_intro' => 'این یک نمای کلی از جدول interwiki است.', - 'interwiki-legend-show' => 'نمایش افسانه', - 'interwiki-legend-hide' => 'پنهان کردن افسانه', + 'interwiki_intro' => 'قمستی از افزونهٔ میان‌ویکی. به صورت یک مرور کلی در Special:Interwiki نمایش داده شده.', # Fuzzy 'interwiki_prefix' => 'پیشوند', 'interwiki-prefix-label' => 'پیشوند:', - 'interwiki_prefix_intro' => 'پیشوند ویکی داخلی در [[prefix:pagename]] نحو متن ویکی استفاده شده‌است.', - 'interwiki_url' => 'نشانی اینترنتی', - 'interwiki-url-label' => 'نشانی اینترنتی:', - 'interwiki_url_intro' => 'الگو برای یو‌ار‌ال‌ها. هنگامی که نحو متن ویکی فوق‌الذکر استفاده شده‌است، نگه‌دارندهٔ جا $1 توسط pagename متن ویکی جایگزین خواهد شد.', - 'interwiki_local' => 'جلو', - 'interwiki-local-label' => 'جلو:', - 'interwiki_local_intro' => 'درخواست اچ‌تی‌تی‌پی برای ویکی داخلی با این پیشوند ویکی داخلی در یوآر‌ال هست:', - 'interwiki_local_0_intro' => 'بدون افتخار، اغلب توسط "صفحه پیدا نشد" مسدود شده.', - 'interwiki_local_1_intro' => 'هدایت به یوآر‌ال مورد نظر داده‌ شده در تعاریف لینک ویکی داخلی (یعنی مانند منابع در صفحات داخلی مطرح می‌شود).', - 'interwiki_trans' => 'تراگنجایش', - 'interwiki-trans-label' => 'تراگنجایش:', - 'interwiki_trans_intro' => 'اگر نحو متن ویکی {{prefix:pagename}} استفاده شده‌است، سپس:', - 'interwiki_trans_1_intro' => 'اجازه دادن ترنس‌کلوژن از ویکی خارجی، اگر ترنس‌کلوژن‌های ویکی داخلی در این ویکی به طور کلی اجازه داده خواهد شد.', - 'interwiki_trans_0_intro' => 'اجازه به این ندهید، بلکه به دنبال یک صفحه در فضای نام الگو باشید.', + 'interwiki_local' => 'مشخص کردن به عنوان یک ویکی محلی', # Fuzzy + 'interwiki-local-label' => 'مشخص کردن به عنوان یک ویکی محلی:', # Fuzzy + 'interwiki_trans' => 'اجازهٔ گنجاندن میان‌ویکی را بده', # Fuzzy + 'interwiki-trans-label' => 'اجازهٔ گنجاندن میان‌ویکی را بده:', # Fuzzy 'interwiki_intro_footer' => 'برای اطلاعات بیشتر در مورد Interwiki به [//www.mediawiki.org/wiki/Manual:Interwiki_table MediaWiki.org] مراحعه نمائید. همچنین می‌توانید [[Special:Log/interwiki|تاریخچهٔ تغییرات]] چدول Interwiki را مشاهده کنید.', 'interwiki_1' => 'بله', 'interwiki_0' => 'خیر', 'interwiki_error' => 'خطا: جدول میان‌ویکی خالی است، یا چیز دیگری مشکل دارد.', - 'interwiki-cached' => 'اطلاعات ویکی داخلی ذخیره شده‌است. اصلاح ذخیره ممکن نیست.', 'interwiki_edit' => 'ویرایش', 'interwiki_reasonfield' => 'دلیل:', 'interwiki_delquestion' => 'حذف «$1»', @@ -1631,11 +1592,7 @@ $messages['fa'] = array( احتمالاً این پیشوند وجود ندارد.', 'interwiki-badprefix' => 'پیشوند میان‌ویکی «$1» حاوی نویسه‌های نامجاز است', 'interwiki-submit-empty' => 'پیشوند و آدرس URL نمی‌توانند خالی باشند.', - 'interwiki-submit-invalidurl' => 'تفاهم‌نامهٔ یوآر‌ال نامعتبر است.', 'log-name-interwiki' => 'سیاههٔ جدول میان‌ویکی', - 'logentry-interwiki-iw_add' => '$1 {{GENDER:$2|اضافه شده}} پیشوند "$4" ($5) (ترانس: $6; local: $7) به جدول ویکی داخلی', - 'logentry-interwiki-iw_edit' => '$1 {{GENDER:$2|اصلاح شده}} پیشوند "$4" ($5) (tترنس: $6; داخلی: $7) در جدول ویکی داخلی', - 'logentry-interwiki-iw_delete' => '$1 {{GENDER:$2|حذف شده}} پیشوند "$4" از جدول ویکی داخلی', 'log-description-interwiki' => 'این یک تاریخچه از تغییرات [[Special:Interwiki|interwiki table]] است.', 'right-interwiki' => 'ویرایش اطلاعات میان‌ویکی', 'action-interwiki' => 'تغییر این مدخل میان‌ویکی', @@ -1788,13 +1745,6 @@ $messages['frp'] = array( 'action-interwiki' => 'changiér ceta entrâ entèrvouiqui', ); -/** Northern Frisian (Nordfriisk) - * @author Murma174 - */ -$messages['frr'] = array( - 'interwiki-title-norights' => 'Interwiki-dooten uunluke', -); - /** Friulian (furlan) * @author Klenje */ @@ -2019,7 +1969,6 @@ $messages['haw'] = array( /** Hebrew (עברית) * @author Agbad * @author Amire80 - * @author Guycn2 * @author Rotemliss * @author YaronSh * @author דניאל ב. @@ -2038,12 +1987,12 @@ $messages['he'] = array( 'interwiki_local' => 'העברה', 'interwiki-local-label' => 'העברה:', 'interwiki_local_intro' => 'בקשת HTTP לאתר הוויקי המקומי עם קידומת בינוויקי זו בכתובת:', - 'interwiki_local_0_intro' => 'לא מכובדת, לרוב נחסמת עם הודעת "הדף לא נמצא".', + 'interwiki_local_0_intro' => 'לא מכובדת, לרוב נחסמת עם הודעת "הדף לא נמצא",', 'interwiki_local_1_intro' => 'מופנית אל כתובת היעד שניתנה בהגדרות קישור הבינוויקי (כלומר מטופלת כמו הפניה בדפים מקומיים)', 'interwiki_trans' => 'הכללה', 'interwiki-trans-label' => 'הכללה:', 'interwiki_trans_intro' => 'אם נעשה שימוש בתחביר {{prefix:pagename}}, אז:', - 'interwiki_trans_1_intro' => 'תינתן האפשרות להכללת מקטעים חיצוניים מאתר ויקי חיצוני, אם הכללות מקטעי ויקי חיצוניים מורשים באופן כללי באתר ויקי זה.', + 'interwiki_trans_1_intro' => 'תינתן האפשרות להכללת מקטעים חיצוניים מאתר ויקי חיצוני, אם הכללות מקטעי ויקי חיצוניים מורשים באופן כללי באתר ויקי זה,', 'interwiki_trans_0_intro' => 'אין לאפשר זאת, במקום זאת יש לחפש דף במרחב השם תבנית.', 'interwiki_intro_footer' => 'עיינו ב־[//www.mediawiki.org/wiki/Manual:Interwiki_table MediaWiki.org] למידע נוסף על טבלת הבינוויקי. ישנו [[Special:Log/interwiki|יומן שינויים]] לטבלת הבינוויקי.', @@ -2414,7 +2363,6 @@ Memora que isto pote rumper ligamines existente.', Es possibile que illo non existe.', 'interwiki-badprefix' => 'Le prefixo interwiki specificate "$1" contine characteres invalide', 'interwiki-submit-empty' => 'Le prefixo e le URL non pote esser vacue.', - 'interwiki-submit-invalidurl' => 'Le protocollo del URL es invalide.', 'log-name-interwiki' => 'Registro del tabella interwiki', 'logentry-interwiki-iw_add' => '$1 {{GENDER:$2|addeva}} le prefixo "$4" ($5) (trans: $6; local: $7) al tabella interwiki', 'logentry-interwiki-iw_edit' => '$1 {{GENDER:$2|modificava}} le prefixo "$4" ($5) (trans: $6; local: $7) in le tabella interwiki', @@ -2880,7 +2828,7 @@ $messages['ko'] = array( 'logentry-interwiki-iw_add' => '$1 사용자가 "$4" ($5) (틀 포함: $6, 로컬: $7) 접두어를 인터위키 테이블에 {{GENDER:$2|추가}}했습니다.', 'logentry-interwiki-iw_edit' => '$1 사용자가 인터위키 테이블의 "$4" ($5) (틀 포함: $6, 로컬: $7) 접두어를 {{GENDER:$2|수정}}했습니다.', 'logentry-interwiki-iw_delete' => '$1 사용자가 인터위키 테이블의 "$4" 접두어를 {{GENDER:$2|삭제}}했습니다.', - 'log-description-interwiki' => '[[Special:Interwiki|인터위키 테이블]]이 바뀐 기록입니다.', + 'log-description-interwiki' => '[[Special:Interwiki|인터위키]] 목록의 바뀐 내역입니다.', 'right-interwiki' => '인터위키 목록 고치기', 'action-interwiki' => '이 인터위키 접두어 바꾸기', ); @@ -3031,11 +2979,11 @@ $messages['lb'] = array( 'interwiki_delfailed' => 'Prefix "$1" konnt net aus der Interwiki-Tabell erausgeholl ginn.', 'interwiki_addtext' => 'En Interwiki-prefix derbäisetzen', 'interwiki_addintro' => 'Dir setzt en neien Interwiki-Prefix derbäi. -Denkt drun datt keng Espacen ( ), Et-commerciale (&), Gläichzeechen (=) a keng Doppelpunkten (:) däerfen dra sinn.', +Denkt drunn datt keng Espacen ( ), Et-commerciale (&), Gläichzeechen (=) a keng Doppelpunkten (:) däerfen dra sinn.', 'interwiki_addbutton' => 'Derbäisetzen', 'interwiki_added' => 'De Prefix "$1" gou an d\'Interwiki-Tabell derbäigesat.', 'interwiki_addfailed' => 'De Prefix "$1" konnt net an d\'Interwiki-Tabell derbäigesat ginn. -Méiglecherweis gëtt et e schonn an der Interwiki-Tabell.', +Méiglecherweis gëtt et e schn an der Interwiki-Tabell.', 'interwiki_edittext' => 'En interwiki Prefix änneren', 'interwiki_editintro' => 'Dir ännert en Interwiki Prefix. Denkt drun, datt dat kann dozou féieren datt Linken déi et scho gëtt net méi funktionéieren.', @@ -3209,7 +3157,7 @@ $messages['mk'] = array( 'interwiki_1' => 'да', 'interwiki_0' => 'не', 'interwiki_error' => 'Грешка: Mеѓувики-табелата е празна, или нешто друго не е во ред.', - 'interwiki-cached' => 'Податоците за меѓувики се меѓускладирани. Меѓускладот не може да се измени.', + 'interwiki-cached' => 'Податоците за меѓувики се кеширани. Кешот не може да се измени.', 'interwiki_edit' => 'Уреди', 'interwiki_reasonfield' => 'Причина:', 'interwiki_delquestion' => 'Бришење на „$1“', @@ -3313,12 +3261,11 @@ $messages['mn'] = array( /** Marathi (मराठी) * @author Kaustubh - * @author V.narsikar */ $messages['mr'] = array( 'interwiki' => 'आंतरविकि डाटा पहा व संपादा', 'interwiki-title-norights' => 'अंतरविकि डाटा पहा', - 'interwiki-desc' => 'आंतरविकि सारणी पाहण्यासाठी व संपादण्यासाठी एक [[Special:Interwiki|विशेष पान]] वाढविते', + 'interwiki-desc' => 'आंतरविकि सारणी पाहण्यासाठी व संपादन्यासाठी एक [[Special:Interwiki|विशेष पान]] वाढविते', 'interwiki_intro' => 'आंतरविकि सारणी बद्दल अधिक माहीतीसाठी [http://www.mediawiki.org/wiki/Interwiki_table MediaWiki.org] पहा.', # Fuzzy 'interwiki_prefix' => 'उपपद (पूर्वप्रत्यय)', 'interwiki-prefix-label' => 'उपपद (पूर्वप्रत्यय):', # Fuzzy @@ -3333,11 +3280,11 @@ $messages['mr'] = array( 'interwiki_addbutton' => 'वाढवा', 'interwiki_added' => '"$1" उपपद आंतरविकि सारणी मध्ये वाढविण्यात आलेले आहे.', 'interwiki_addfailed' => '"$1" उपपद आंतरविकि सारणी मध्ये वाढवू शकलेलो नाही. कदाचित ते अगोदरच अस्तित्वात असण्याची शक्यता आहे.', - 'interwiki_edittext' => 'एक आंतरविकि उपपद संपादित आहे', - 'interwiki_editintro' => 'तुम्ही एक आंतरविकि उपपद संपादित आहात. + 'interwiki_edittext' => 'एक अंतरविकि उपपद संपादित आहे', + 'interwiki_editintro' => 'तुम्ही एक अंतरविकि उपपद संपादित आहात. लक्षात ठेवा की यामुळे अगोदर दिलेले दुवे तुटू शकतात.', - 'interwiki_edited' => 'आंतरविकि सारणीमध्ये "$1" उपपद यशस्वीरित्या बदलण्यात आलेले आहे.', - 'interwiki_editerror' => 'आंतरविकि सारणीमध्ये "$1" उपपद बदलू शकत नाही. + 'interwiki_edited' => 'अंतरविकि सारणीमध्ये "$1" उपपद यशस्वीरित्या बदलण्यात आलेले आहे.', + 'interwiki_editerror' => 'अंतरविकि सारणीमध्ये "$1" उपपद बदलू शकत नाही. कदाचित ते अस्तित्वात नसेल.', 'log-name-interwiki' => 'आंतरविकि सारणी नोंद', 'log-description-interwiki' => '[[Special:Interwiki|आंतरविकि सारणीत]] झालेल्या बदलांची ही सूची आहे.', @@ -3836,7 +3783,6 @@ Vielaischd hods des a ned.", /** Polish (polski) * @author BeginaFelicysym - * @author Chrumps * @author Leinad * @author Matma Rex * @author McMonster @@ -3862,7 +3808,7 @@ $messages['pl'] = array( 'interwiki_trans' => 'Transkluzja', 'interwiki-trans-label' => 'Transkluzja:', 'interwiki_trans_intro' => 'Jeśli składnia wiki {{przedrostek:nazwastrony}} została użyta, to:', - 'interwiki_trans_1_intro' => 'pozwala na transkluzję z innych wiki, jeśli transkluzja interwiki jest w ogóle dozwolona na tej wiki.', + 'interwiki_trans_1_intro' => 'pozwala na transkluzję z innych wiki, jeśli transkluzja interwiki jest w ogóle dozwolona na tej wiki,', 'interwiki_trans_0_intro' => 'nie pozwalaj na nią, raczej szukaj strony w przestrzeni szablonów.', 'interwiki_intro_footer' => 'Na [//www.mediawiki.org/wiki/Manual:Interwiki_table MediaWiki.org] odnajdziesz więcej informacji na temat tabeli interwiki. Tutaj znajduje się [[Special:Log/interwiki|rejestr zmian]] tabeli interwiki.', @@ -4108,9 +4054,6 @@ Existe um [[Special:Log/interwiki|registro de modificações]] à tabela de inte 'interwiki-submit-empty' => 'O prefixo e o URL não podem estar vazios.', 'interwiki-submit-invalidurl' => 'O protocolo do URL é inválido.', 'log-name-interwiki' => 'Registro da tabela de interwikis', - 'logentry-interwiki-iw_add' => '$1 {{GENDER:$2|adicionou}} o prefixo "$4" ($5) (trans: $6; local: $7) à tabela de interwikis', - 'logentry-interwiki-iw_edit' => '$1 {{GENDER:$2|modificou}} o prefixo "$4" ($5) (trans: $6; local: $7) na tabela de interwikis', - 'logentry-interwiki-iw_delete' => '$1 {{GENDER:$2|removeu}} o prefixo "$4" da tabela de interwikis', 'log-description-interwiki' => 'Este é um registro das alterações à [[Special:Interwiki|tabela de interwikis]].', 'right-interwiki' => 'Editar dados de interwiki', 'action-interwiki' => 'alterar esta entrada interwiki', @@ -4164,16 +4107,12 @@ $messages['roa-tara'] = array( 'interwiki_prefix_intro' => "'U prefisse inderuicchi avène ausate jndr'à [[prefix:pagename]] sindasse uicchiteste.", 'interwiki_local' => 'Inoltre', 'interwiki-local-label' => 'Inoltre:', - 'interwiki_local_intro' => "'Na richieste HTTP sus a sta uicchi locale cu ste prefisse inderuicchi jndr'à URL jè:", - 'interwiki_local_0_intro' => 'none onorate, normalmende bloccate da "pàgene none acchiate".', 'interwiki_1' => 'sine', 'interwiki_0' => 'none', 'interwiki_edit' => 'Cange', 'interwiki_reasonfield' => 'Mutive:', 'interwiki_delquestion' => 'Scangellamende de "$1"', 'interwiki_deleting' => 'Tu ste scangille \'u prefisse "$1".', - 'interwiki_deleted' => '\'U prefisse "$1" ha state luate da \'a tabbelle de inderuicchi.', - 'interwiki_delfailed' => '\'U prefisse "$1" non ge pò essere luate da \'a tabbelle de inderuicchi.', 'interwiki_addtext' => "Aggiunge 'nu prefisse inderuicchi", 'interwiki_addbutton' => 'Aggiunge', 'right-interwiki' => 'Cange le date de inderuicchi', @@ -4328,21 +4267,16 @@ Lu prifissu putissi èssiri ca non c\'è.', /** Sassaresu (Sassaresu) * @author Felis - * @author Jun Misugi */ $messages['sdc'] = array( - 'interwiki' => 'Vidè e mudifiggà li dati interwiki', - 'interwiki-title-norights' => 'Vidé li dati interwiki', + 'interwiki' => 'Vidè e mudìfiggà li dati interwiki', 'interwiki_prefix' => 'Prefissu', - 'interwiki-prefix-label' => 'Prefissu:', - 'interwiki_1' => 'si', - 'interwiki_0' => 'no', - 'interwiki_edit' => 'Mudifiggà', - 'interwiki_reasonfield' => 'Rasgioni', - 'interwiki_delquestion' => 'Canzillendhi "$1"', - 'interwiki_deleting' => 'Sei canzillendhi lu prefissu "$1".', + 'interwiki-prefix-label' => 'Prefissu:', # Fuzzy + 'interwiki_reasonfield' => 'Rasgioni', # Fuzzy + 'interwiki_delquestion' => 'Canzillendi "$1"', + 'interwiki_deleting' => 'Sei canzillendi lu prefissu "$1".', 'interwiki_addtext' => 'Aggiungi un prefissu interwiki', - 'interwiki_addbutton' => 'Aggiungì', + 'interwiki_addbutton' => 'Aggiungi', 'log-name-interwiki' => 'Rigisthru di la table interwiki', ); @@ -4477,7 +4411,6 @@ Morda ne obstaja.', ); /** Serbian (Cyrillic script) (српски (ћирилица)‎) - * @author Milicevic01 * @author Rancher * @author Sasa Stefanovic * @author Жељко Тодоровић @@ -4519,14 +4452,13 @@ $messages['sr-ec'] = array( 'interwiki_editerror' => 'Префикс "$1" не може бити измењен у табели међувикија. Вероватно затшо што не постоји.', 'interwiki-badprefix' => 'Задати међувики префикс "$1" садржи недозвољене знакове', - 'log-name-interwiki' => 'Дневник табеле међувикија', + 'log-name-interwiki' => 'Историја табеле међувикија', 'log-description-interwiki' => 'Ово је историја измена [[Special:Interwiki|табеле међувикија]].', 'right-interwiki' => 'уређивање међувикија', ); /** Serbian (Latin script) (srpski (latinica)‎) * @author Michaello - * @author Milicevic01 * @author Жељко Тодоровић */ $messages['sr-el'] = array( @@ -4565,9 +4497,9 @@ Imajte na umu da može da ošteti postojeće međuviki veze.', 'interwiki_editerror' => 'Prefiks "$1" ne može biti izmenjen u tabeli međuvikija. Verovatno zatšo što ne postoji.', 'interwiki-badprefix' => 'Zadati međuviki prefiks "$1" sadrži nedozvoljene znakove', - 'log-name-interwiki' => 'Dnevnik tabele međuvikija', + 'log-name-interwiki' => 'Istorija tabele međuvikija', 'log-description-interwiki' => 'Ovo je istorija izmena [[Special:Interwiki|tabele međuvikija]].', - 'right-interwiki' => 'uređivanje međuvikija', + 'right-interwiki' => 'Izmeni međuviki', ); /** Seeltersk (Seeltersk) @@ -4624,16 +4556,13 @@ $messages['sv'] = array( 'interwiki_prefix' => 'Prefix', 'interwiki-prefix-label' => 'Prefix:', 'interwiki_prefix_intro' => 'Interwiki-prefix avsedda att användas i [[prefix:pagename]]-wikisyntax.', - 'interwiki_url_intro' => 'Mall för webbadresser. Platshållaren $1 kommer att ersättas av sidnamnet i wikitexten, när den ovannämnda wikitextsyntaxen används.', 'interwiki_local' => 'Vidarebefordra', 'interwiki-local-label' => 'Vidarebefordra:', 'interwiki_local_intro' => 'En HTTP-förfrågan till den lokala wikin med denna interwiki-prefix i webbadressen är:', 'interwiki_local_0_intro' => 'inte accepterad, vanligtvis blockerad av "sidan kunde inte hittas".', - 'interwiki_local_1_intro' => 'omdirigeras till måladressen som anges i definitionerna av interwiki-länken (d.v.s. behandlas som referenser i lokala sidor).', 'interwiki_trans' => 'Transkludera', 'interwiki-trans-label' => 'Transkludera:', 'interwiki_trans_intro' => 'Om wikitextsyntax {{prefix:pagename}} används så:', - 'interwiki_trans_1_intro' => 'tillåt inkludering från utländska wikin, om interwiki-inkluderingar är allmänt tillåten på denna wiki.', 'interwiki_trans_0_intro' => 'tillåt inte det, leta istället efter en sida i mall-namnrymden.', 'interwiki_intro_footer' => 'Se [//www.mediawiki.org/wiki/Manual:Interwiki_table MediaWiki.org] för mer information om interwikitabellen. Det finns en [[Special:Log/interwiki|logg över ändringar]] i interwikitabellen.', @@ -4719,7 +4648,6 @@ $messages['tcy'] = array( ); /** Telugu (తెలుగు) - * @author Chaduvari * @author Kiranmayee * @author Veeven */ @@ -4735,7 +4663,7 @@ $messages['te'] = array( అంతర్వికీ పట్టికకి జరిగిన [[Special:Log/interwiki|మార్పుల యొక్క చిట్టా]] కూడా ఉంది.', 'interwiki_1' => 'అవును', 'interwiki_0' => 'కాదు', - 'interwiki_error' => 'లోపం: అంతర్వికీ పట్టిక ఖాళీగా ఉంది, లేదా మరేదో తప్పు జరిగింది.', + 'interwiki_error' => 'పొరపాటు: అంతర్వికీ పట్టిక ఖాళీగా ఉంది, లేదా ఏదో తప్పు జరిగింది.', 'interwiki_edit' => 'మార్చు', 'interwiki_reasonfield' => 'కారణం:', 'interwiki_delquestion' => '"$1"ని తొలగిస్తున్నారు', @@ -5225,7 +5153,6 @@ $messages['yi'] = array( ); /** Cantonese (粵語) - * @author Antonytse */ $messages['yue'] = array( 'interwiki' => '去睇同編輯跨維基資料', @@ -5238,7 +5165,7 @@ $messages['yue'] = array( 'interwiki_trans' => '容許跨維基包含', # Fuzzy 'interwiki-trans-label' => '容許跨維基包含:', # Fuzzy 'interwiki_error' => '錯誤: 跨維基表係空、又或者有其它嘢出錯。', - 'interwiki_reasonfield' => '原因:', + 'interwiki_reasonfield' => '原因', # Fuzzy 'interwiki_delquestion' => '刪緊 "$1"', 'interwiki_deleting' => '你而家拎走緊前綴 "$1"。', 'interwiki_deleted' => '前綴 "$1" 已經成功噉響個跨維基表度拎走咗。', @@ -5274,7 +5201,7 @@ $messages['yue'] = array( */ $messages['zh-hans'] = array( 'interwiki' => '查看和编辑跨wiki数据', - 'interwiki-title-norights' => '查看跨wiki数据', + 'interwiki-title-norights' => '查看跨维基数据', 'interwiki-desc' => '新增[[Special:Interwiki|特殊页面]]以查看和编辑跨wiki表', 'interwiki_intro' => '这是跨wiki表的概览。', 'interwiki-legend-show' => '显示说明', @@ -5297,7 +5224,7 @@ $messages['zh-hans'] = array( 'interwiki_1' => '是', 'interwiki_0' => '否', 'interwiki_error' => '错误: 跨wiki表为空,或是发生其它错误。', - 'interwiki-cached' => '跨维基数据是缓存的。缓存不能被修改。', + 'interwiki-cached' => '跨wiki数据已缓存。缓存不能编辑。', 'interwiki_edit' => '编辑', 'interwiki_reasonfield' => '理由:', 'interwiki_delquestion' => '正在删除“$1”', @@ -5325,7 +5252,7 @@ $messages['zh-hans'] = array( 'logentry-interwiki-iw_edit' => '$1{{GENDER:$2|已修改}}跨wiki表中的前缀“$4”($5) (包含:$6;本地:$7)', 'logentry-interwiki-iw_delete' => '$1已从跨wiki表中{{GENDER:$2|删除}}前缀“$4”', 'log-description-interwiki' => '这是一个[[Special:Interwiki|跨wiki表]]的更改日志。', - 'right-interwiki' => '编辑跨wiki数据', + 'right-interwiki' => '编辑跨维基数据', 'action-interwiki' => '更改该跨维基条目', ); diff --git a/extensions/Interwiki/Interwiki_body.php b/extensions/Interwiki/Interwiki_body.php index fd982811..ec104968 100644 --- a/extensions/Interwiki/Interwiki_body.php +++ b/extensions/Interwiki/Interwiki_body.php @@ -36,7 +36,7 @@ class SpecialInterwiki extends SpecialPage { $out->addModules( 'ext.interwiki.specialpage' ); $action = $par ? $par : $request->getVal( 'action', $par ); - $return = $this->getPageTitle(); + $return = $this->getTitle(); switch( $action ) { case 'delete': @@ -186,7 +186,7 @@ class SpecialInterwiki extends SpecialPage { array( 'id' => "mw-interwiki-{$action}form", 'method' => 'post', - 'action' => $this->getPageTitle()->getLocalUrl( array( + 'action' => $this->getTitle()->getLocalUrl( array( 'action' => 'submit', 'prefix' => $prefix ) ) @@ -229,7 +229,7 @@ class SpecialInterwiki extends SpecialPage { return; } $reason = $request->getText( 'wpInterwikiReason' ); - $selfTitle = $this->getPageTitle(); + $selfTitle = $this->getTitle(); $dbw = wfGetDB( DB_MASTER ); switch( $do ) { case 'delete': @@ -325,7 +325,7 @@ class SpecialInterwiki extends SpecialPage { if ( $canModify ) { $this->getOutput()->addHTML( "
        " . $this->msg( 'interwiki_intro_footer' )->parse() ); $addtext = $this->msg( 'interwiki_addtext' )->escaped(); - $addlink = Linker::linkKnown( $this->getPageTitle( 'add' ), $addtext ); + $addlink = Linker::linkKnown( $this->getTitle( 'add' ), $addtext ); $this->getOutput()->addHTML( '' ); } @@ -363,7 +363,7 @@ class SpecialInterwiki extends SpecialPage { ); $out .= Html::closeElement( 'tr' ) . "\n"; - $selfTitle = $this->getPageTitle(); + $selfTitle = $this->getTitle(); # Output the existing Interwiki prefixes table rows foreach ( $iwPrefixes as $iwPrefix ) { diff --git a/extensions/LocalisationUpdate/.gitreview b/extensions/LocalisationUpdate/.gitreview deleted file mode 100644 index da37d04d..00000000 --- a/extensions/LocalisationUpdate/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/LocalisationUpdate.git -defaultbranch=master diff --git a/extensions/LocalisationUpdate/KNOWN_ISSUES.txt b/extensions/LocalisationUpdate/KNOWN_ISSUES.txt new file mode 100644 index 00000000..7ce14cd0 --- /dev/null +++ b/extensions/LocalisationUpdate/KNOWN_ISSUES.txt @@ -0,0 +1,11 @@ +- Only works with SVN revision 50605 or later of the + MediaWiki core + + + +Key issues at the moment: +* Seems to want to store a copy of the localization updates in each local database. +We've got hundreds of wikis run from the same installation set; we don't want to multiply our effort by 1000. + +* It doesn't seem to be using available memcached stuff; unsure yet whether this is taken care of +by the general message caching or if we're going to end up making extra hits we don't need. diff --git a/extensions/LocalisationUpdate/LocalisationUpdate.class.php b/extensions/LocalisationUpdate/LocalisationUpdate.class.php index 24620545..66b63232 100644 --- a/extensions/LocalisationUpdate/LocalisationUpdate.class.php +++ b/extensions/LocalisationUpdate/LocalisationUpdate.class.php @@ -3,7 +3,7 @@ /** * Class for localization updates. * - * @todo Refactor code to remove duplication + * TODO: refactor code to remove duplication */ class LocalisationUpdate { @@ -60,7 +60,7 @@ class LocalisationUpdate { $skipCore = isset( $options['skip-core'] ); $skipExtensions = isset( $options['skip-extensions'] ); - if ( isset( $options['outdir'] ) ) { + if( isset( $options['outdir'] ) ) { $wgLocalisationUpdateDirectory = $options['outdir']; } @@ -82,25 +82,25 @@ class LocalisationUpdate { $result = 0; // Update all MW core messages. - if ( !$skipCore ) { + if( !$skipCore ) { $result = self::updateMediawikiMessages( $verbose, $coreUrl ); } // Update all Extension messages. - if ( !$skipExtensions ) { - if ( $all ) { + if( !$skipExtensions ) { + if( $all ) { global $IP; $extFiles = array(); // Look in extensions/ for all available items... - // @todo Add support for $wgExtensionAssetsPath + // TODO: add support for $wgExtensionAssetsPath $dirs = new RecursiveDirectoryIterator( "$IP/extensions/" ); // I ain't kidding... RecursiveIteratorIterator. - foreach ( new RecursiveIteratorIterator( $dirs ) as $pathname => $item ) { + foreach( new RecursiveIteratorIterator( $dirs ) as $pathname => $item ) { $filename = basename( $pathname ); $matches = array(); - if ( preg_match( '/^(.*)\.i18n\.php$/', $filename, $matches ) ) { + if( preg_match( '/^(.*)\.i18n\.php$/', $filename, $matches ) ) { $group = $matches[1]; $extFiles[$group] = $pathname; } @@ -187,14 +187,7 @@ class LocalisationUpdate { ); // Compare the files. - $changedCount += self::compareFiles( - $repoUrl, - $localUrl, - $verbose, - $changedEnglishStrings, - false, - true - ); + $changedCount += self::compareFiles( $repoUrl, $localUrl, $verbose, $changedEnglishStrings, false, true ); } // Log some nice info. @@ -225,7 +218,7 @@ class LocalisationUpdate { preg_match_all( '/\$messages(.*\s)*?\);/', $contents, $results ); // But we want them all in one string. - if ( !empty( $results[0] ) && is_array( $results[0] ) ) { + if( !empty( $results[0] ) && is_array( $results[0] ) ) { $contents = implode( "\n\n", $results[0] ); } else { $contents = ''; @@ -252,8 +245,8 @@ class LocalisationUpdate { // Use cURL to get the SVN contents. if ( preg_match( "/^http/", $file ) ) { - while ( !$filecontents && $attempts <= $wgLocalisationUpdateRetryAttempts ) { - if ( $attempts > 0 ) { + while( !$filecontents && $attempts <= $wgLocalisationUpdateRetryAttempts ) { + if( $attempts > 0 ) { $delay = 1; self::myLog( 'Failed to download ' . $file . "; retrying in ${delay}s..." ); sleep( $delay ); @@ -264,13 +257,11 @@ class LocalisationUpdate { } if ( !$filecontents ) { self::myLog( 'Cannot get the contents of ' . $file . ' (curl)' ); - return false; } - } else { // otherwise try file_get_contents + } else {// otherwise try file_get_contents if ( !( $filecontents = file_get_contents( $file ) ) ) { self::myLog( 'Cannot get the contents of ' . $file ); - return false; } } @@ -290,20 +281,16 @@ class LocalisationUpdate { * * @return array */ - public static function loadFilesToCompare( $tag, $file1, $file2, $verbose, - $alwaysGetResult = true - ) { + public static function loadFilesToCompare( $tag, $file1, $file2, $verbose, $alwaysGetResult = true ) { $file1contents = self::getFileContents( $file1 ); if ( $file1contents === false || $file1contents === '' ) { self::myLog( "Failed to read $file1" ); - return array( null, null ); } $file2contents = self::getFileContents( $file2 ); if ( $file2contents === false || $file2contents === '' ) { self::myLog( "Failed to read $file2" ); - return array( null, null ); } @@ -317,11 +304,7 @@ class LocalisationUpdate { // Check if the file has changed since our last update. if ( !$alwaysGetResult ) { if ( !self::checkHash( $file1, $file1hash ) && !self::checkHash( $file2, $file2hash ) ) { - self::myLog( - "Skipping {$tag} since the files haven't changed since our last update", - $verbose - ); - + self::myLog( "Skipping {$tag} since the files haven't changed since our last update", $verbose ); return array( null, null ); } } @@ -335,7 +318,6 @@ class LocalisationUpdate { } else { // Broken file? Report and bail self::myLog( "Failed to parse $file1" ); - return array( null, null ); } } @@ -348,7 +330,6 @@ class LocalisationUpdate { $messages2 = array(); } else { self::myLog( "Failed to parse $file2" ); - return array( null, null ); } } @@ -372,9 +353,7 @@ class LocalisationUpdate { * * @return array|int */ - private static function compareLanguageArrays( $langcode, $old_messages, - $new_messages, $verbose, $forbiddenKeys, $saveResults - ) { + private static function compareLanguageArrays( $langcode, $old_messages, $new_messages, $verbose, $forbiddenKeys, $saveResults ) { // Get the currently-cached messages, if any $cur_messages = self::readFile( $langcode ); @@ -390,6 +369,7 @@ class LocalisationUpdate { ); } + if ( $saveResults ) { // If anything has changed from the saved version, save the new version if ( $new_messages != $cur_messages ) { @@ -404,12 +384,10 @@ class LocalisationUpdate { } else { $updates = 0; } - return $updates; } else { // Find all deleted or changed messages $changedStrings = array_diff_assoc( $old_messages, $new_messages ); - return $changedStrings; } } @@ -426,9 +404,7 @@ class LocalisationUpdate { * * @return array|int */ - public static function compareFiles( $newfile, $oldfile, $verbose, - array $forbiddenKeys = array(), $alwaysGetResult = true, $saveResults = false - ) { + public static function compareFiles( $newfile, $oldfile, $verbose, array $forbiddenKeys = array(), $alwaysGetResult = true, $saveResults = false ) { // Get the languagecode. $langcode = Language::getCodeFromFileName( $newfile, 'Messages' ); @@ -439,14 +415,7 @@ class LocalisationUpdate { return $saveResults ? 0 : array(); } - return self::compareLanguageArrays( - $langcode, - $old_messages, - $new_messages, - $verbose, - $forbiddenKeys, - $saveResults - ); + return self::compareLanguageArrays( $langcode, $old_messages, $new_messages, $verbose, $forbiddenKeys, $saveResults ); } /** @@ -480,14 +449,7 @@ class LocalisationUpdate { } // Find the changed english strings. - $forbiddenKeys = self::compareLanguageArrays( - 'en', - $old_messages['en'], - $new_messages['en'], - $verbose, - array(), - false - ); + $forbiddenKeys = self::compareLanguageArrays( 'en', $old_messages['en'], $new_messages['en'], $verbose, array(), false ); // Do an update for each language. foreach ( $new_messages as $language => $messages ) { @@ -499,14 +461,7 @@ class LocalisationUpdate { $old_messages[$language] = array(); } - $updates += self::compareLanguageArrays( - $language, - $old_messages[$language], - $messages, - $verbose, - $forbiddenKeys, - true - ); + $updates += self::compareLanguageArrays( $language, $old_messages[$language], $messages, $verbose, $forbiddenKeys, true ); } // And log some stuff. @@ -518,7 +473,7 @@ class LocalisationUpdate { /** * Checks whether a messages file has a certain hash. * - * @todo Swap return values, this is insane + * TODO: Swap return values, this is insane * * @param $file string Filename * @param $hash string Hash @@ -527,12 +482,7 @@ class LocalisationUpdate { */ public static function checkHash( $file, $hash ) { $hashes = self::readFile( 'hashes' ); - - wfSuppressWarnings(); - $return = $hashes[$file] !== $hash; - wfRestoreWarnings(); - - return $return; + return @$hashes[$file] !== $hash; } /** @@ -564,7 +514,7 @@ class LocalisationUpdate { if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) { wfDebug( $log . "\n" ); } else { - print "$log\n"; + print( $log . "\n" ); } } @@ -575,12 +525,10 @@ class LocalisationUpdate { */ public static function parsePHP( $php, $varname ) { try { - $reader = new QuickArrayReader( "getVar( $varname ); - } catch ( Exception $e ) { + } catch( Exception $e ) { self::myLog( "Failed to read file: " . $e ); - return false; } } @@ -611,9 +559,7 @@ class LocalisationUpdate { public static function readFile( $lang ) { if ( !isset( self::$filecache[$lang] ) ) { $file = self::filename( $lang ); - wfSuppressWarnings(); - $contents = file_get_contents( $file ); - wfRestoreWarnings(); + $contents = @file_get_contents( $file ); if ( $contents === false ) { wfDebug( "Failed to read file '$file'\n" ); @@ -640,12 +586,11 @@ class LocalisationUpdate { public static function writeFile( $lang, $var ) { $file = self::filename( $lang ); - wfSuppressWarnings(); - if ( !file_put_contents( $file, serialize( $var ) ) ) { + if ( !@file_put_contents( $file, serialize( $var ) ) ) { throw new MWException( "Failed to write to file '$file'" ); } - wfRestoreWarnings(); self::$filecache[$lang] = $var; } + } diff --git a/extensions/LocalisationUpdate/LocalisationUpdate.i18n.php b/extensions/LocalisationUpdate/LocalisationUpdate.i18n.php index 0e73e3bc..c45af9e2 100644 --- a/extensions/LocalisationUpdate/LocalisationUpdate.i18n.php +++ b/extensions/LocalisationUpdate/LocalisationUpdate.i18n.php @@ -5,7 +5,7 @@ * @file * @ingroup Extensions */ - + $messages = array(); /** English @@ -102,14 +102,7 @@ $messages['ca'] = array( 'localisationupdate-desc' => 'Manté els missatges localitzats tan actualitzats com sigui possible', ); -/** Chechen (нохчийн) - * @author Умар - */ -$messages['ce'] = array( - 'localisationupdate-desc' => 'Таро ма хуьйла хаамашан болх бан гӀо до', -); - -/** Czech (čeština) +/** Czech (česky) * @author Mormegil */ $messages['cs'] = array( @@ -311,10 +304,9 @@ $messages['ksh'] = array( /** Luxembourgish (Lëtzebuergesch) * @author Robby - * @author Soued031 */ $messages['lb'] = array( - 'localisationupdate-desc' => 'hält déi lokaliséiert Messagen sou aktuell wéi méiglech.', + 'localisationupdate-desc' => 'hält déi lokaliséiert Messagen esou aktuell wéi méiglech.', ); /** Macedonian (македонски) diff --git a/extensions/LocalisationUpdate/LocalisationUpdate.php b/extensions/LocalisationUpdate/LocalisationUpdate.php index f73304cd..abec5406 100644 --- a/extensions/LocalisationUpdate/LocalisationUpdate.php +++ b/extensions/LocalisationUpdate/LocalisationUpdate.php @@ -11,6 +11,7 @@ */ $wgLocalisationUpdateDirectory = false; + /** * These should point to either an HTTP-accessible file or local file system. * $1 is the name of the repo (for extensions) and $2 is the name of file in the repo. @@ -18,8 +19,7 @@ $wgLocalisationUpdateDirectory = false; */ $wgLocalisationUpdateCoreURL = "https://git.wikimedia.org/raw/mediawiki%2Fcore.git/HEAD/$4"; -$wgLocalisationUpdateExtensionURL = - "https://git.wikimedia.org/raw/mediawiki%2Fextensions%2F$3.git/HEAD/$4"; +$wgLocalisationUpdateExtensionURL = "https://git.wikimedia.org/raw/mediawiki%2Fextensions%2F$3.git/HEAD/$4"; /// Deprecated $wgLocalisationUpdateSVNURL = false; @@ -28,11 +28,11 @@ $wgLocalisationUpdateRetryAttempts = 5; // Info about me! $wgExtensionCredits['other'][] = array( - 'path' => __FILE__, - 'name' => 'LocalisationUpdate', - 'author' => array( 'Tom Maaswinkel', 'Niklas Laxström', 'Roan Kattouw' ), - 'version' => '1.0', - 'url' => 'https://www.mediawiki.org/wiki/Extension:LocalisationUpdate', + 'path' => __FILE__, + 'name' => 'LocalisationUpdate', + 'author' => array( 'Tom Maaswinkel', 'Niklas Laxström', 'Roan Kattouw' ), + 'version' => '1.0', + 'url' => 'https://www.mediawiki.org/wiki/Extension:LocalisationUpdate', 'descriptionmsg' => 'localisationupdate-desc', ); diff --git a/extensions/LocalisationUpdate/QuickArrayReader.php b/extensions/LocalisationUpdate/QuickArrayReader.php index 453032f2..214d5a61 100644 --- a/extensions/LocalisationUpdate/QuickArrayReader.php +++ b/extensions/LocalisationUpdate/QuickArrayReader.php @@ -8,7 +8,7 @@ * order of magnitude slower than eval(). */ class QuickArrayReader { - private $vars = array(); + var $vars = array(); /** * @param $string string @@ -27,100 +27,96 @@ class QuickArrayReader { ); $tokens = token_get_all( $string ); $count = count( $tokens ); - for ( $i = 0; $i < $count; ) { - while ( isset( $skipTypes[$tokens[$i][0]] ) ) { + for( $i = 0; $i < $count; ) { + while( isset($skipTypes[$tokens[$i][0]] ) ) { $i++; } - switch ( $tokens[$i][0] ) { - case T_OPEN_TAG: - $i++; - continue; - case T_VARIABLE: - // '$messages' -> 'messages' - $varname = trim( substr( $tokens[$i][1], 1 ) ); - $varindex = null; - - while ( isset( $skipTypes[$tokens[++$i][0]] ) ); - - if ( $tokens[$i] === '[' ) { - while ( isset( $skipTypes[$tokens[++$i][0]] ) ); - - if ( isset( $scalarTypes[$tokens[$i][0]] ) ) { - $varindex = $this->parseScalar( $tokens[$i] ); - } else { - throw $this->except( $tokens[$i], 'scalar index' ); - } - while ( isset( $skipTypes[$tokens[++$i][0]] ) ); + switch( $tokens[$i][0] ) { + case T_OPEN_TAG: + $i++; + continue; + case T_VARIABLE: + // '$messages' -> 'messages' + $varname = trim( substr( $tokens[$i][1], 1 ) ); + $varindex = null; - if ( $tokens[$i] !== ']' ) { - throw $this->except( $tokens[$i], ']' ); - } - while ( isset( $skipTypes[$tokens[++$i][0]] ) ); - } + while( isset($skipTypes[$tokens[++$i][0]] ) ); - if ( $tokens[$i] !== '=' ) { - throw $this->except( $tokens[$i], '=' ); - } - while ( isset( $skipTypes[$tokens[++$i][0]] ) ); - - if ( isset( $scalarTypes[$tokens[$i][0]] ) ) { - $buildval = $this->parseScalar( $tokens[$i] ); - } elseif ( $tokens[$i][0] === T_ARRAY ) { - while ( isset( $skipTypes[$tokens[++$i][0]] ) ); - if ( $tokens[$i] !== '(' ) { - throw $this->except( $tokens[$i], '(' ); - } - $buildval = array(); - do { - while ( isset( $skipTypes[$tokens[++$i][0]] ) ); - - if ( $tokens[$i] === ')' ) { - break; - } - if ( isset( $scalarTypes[$tokens[$i][0]] ) ) { - $key = $this->parseScalar( $tokens[$i] ); - } - while ( isset( $skipTypes[$tokens[++$i][0]] ) ); - - if ( $tokens[$i][0] !== T_DOUBLE_ARROW ) { - throw $this->except( $tokens[$i], '=>' ); - } - while ( isset( $skipTypes[$tokens[++$i][0]] ) ); - - if ( isset( $scalarTypes[$tokens[$i][0]] ) ) { - $val = $this->parseScalar( $tokens[$i] ); - } - wfSuppressWarnings(); - $buildval[$key] = $val; - wfRestoreWarnings(); - while ( isset( $skipTypes[$tokens[++$i][0]] ) ); - - if ( $tokens[$i] === ',' ) { - continue; - } elseif ( $tokens[$i] === ')' ) { - break; - } else { - throw $this->except( $tokens[$i], ', or )' ); - } - } while ( true ); + if( $tokens[$i] === '[' ) { + while( isset($skipTypes[$tokens[++$i][0]] ) ); + + if( isset($scalarTypes[$tokens[$i][0]] ) ) { + $varindex = $this->parseScalar( $tokens[$i] ); } else { - throw $this->except( $tokens[$i], 'scalar or array' ); + throw $this->except( $tokens[$i], 'scalar index' ); } - if ( is_null( $varindex ) ) { - $this->vars[$varname] = $buildval; - } else { - wfSuppressWarnings(); - $this->vars[$varname][$varindex] = $buildval; - wfRestoreWarnings(); + while( isset($skipTypes[$tokens[++$i][0]] ) ); + + if( $tokens[$i] !== ']' ) { + throw $this->except( $tokens[$i], ']' ); } - while ( isset( $skipTypes[$tokens[++$i][0]] ) ); - if ( $tokens[$i] !== ';' ) { - throw $this->except( $tokens[$i], ';' ); + while( isset($skipTypes[$tokens[++$i][0]] ) ); + } + + if( $tokens[$i] !== '=' ) { + throw $this->except( $tokens[$i], '=' ); + } + while( isset($skipTypes[$tokens[++$i][0]] ) ); + + if( isset($scalarTypes[$tokens[$i][0]] ) ) { + $buildval = $this->parseScalar( $tokens[$i] ); + } elseif( $tokens[$i][0] === T_ARRAY ) { + while( isset($skipTypes[$tokens[++$i][0]] ) ); + if( $tokens[$i] !== '(' ) { + throw $this->except( $tokens[$i], '(' ); } - $i++; - break; - default: - throw $this->except( $tokens[$i], 'open tag, whitespace, or variable.' ); + $buildval = array(); + do { + while( isset($skipTypes[$tokens[++$i][0]] ) ); + + if( $tokens[$i] === ')' ) { + break; + } + if( isset($scalarTypes[$tokens[$i][0]] ) ) { + $key = $this->parseScalar( $tokens[$i] ); + } + while( isset($skipTypes[$tokens[++$i][0]] ) ); + + if( $tokens[$i][0] !== T_DOUBLE_ARROW ) { + throw $this->except( $tokens[$i], '=>' ); + } + while( isset($skipTypes[$tokens[++$i][0]] ) ); + + if( isset($scalarTypes[$tokens[$i][0]] ) ) { + $val = $this->parseScalar( $tokens[$i] ); + } + @$buildval[$key] = $val; + while( isset($skipTypes[$tokens[++$i][0]] ) ); + + if( $tokens[$i] === ',' ) { + continue; + } elseif( $tokens[$i] === ')' ) { + break; + } else { + throw $this->except( $tokens[$i], ', or )' ); + } + } while(true); + } else { + throw $this->except( $tokens[$i], 'scalar or array' ); + } + if( is_null( $varindex ) ) { + $this->vars[$varname] = $buildval; + } else { + @$this->vars[$varname][$varindex] = $buildval; + } + while( isset($skipTypes[$tokens[++$i][0]] ) ); + if( $tokens[$i] !== ';' ) { + throw $this->except($tokens[$i], ';'); + } + $i++; + break; + default: + throw $this->except($tokens[$i], 'open tag, whitespace, or variable.'); } } } @@ -131,12 +127,11 @@ class QuickArrayReader { * @return Exception */ private function except( $got, $expected ) { - if ( is_array( $got ) ) { + if( is_array( $got ) ) { $got = token_name( $got[0] ) . " ('" . $got[1] . "')"; } else { $got = "'" . $got . "'"; } - return new Exception( "Expected $expected, got $got" ); } @@ -148,42 +143,30 @@ class QuickArrayReader { * @return mixed Parsed value */ function parseScalar( $token ) { - if ( is_array( $token ) ) { + if( is_array( $token ) ) { $str = $token[1]; } else { $str = $token; } - if ( $str !== '' && $str[0] == '\'' ) { + if ( $str !== '' && $str[0] == '\'' ) // Single-quoted string // @fixme trim() call is due to mystery bug where whitespace gets // appended to the token; without it we ended up reading in the // extra quote on the end! return strtr( substr( trim( $str ), 1, -1 ), array( '\\\'' => '\'', '\\\\' => '\\' ) ); - } - - wfSuppressWarnings(); - if ( $str !== '' && $str[0] == '"' ) { + if ( $str !== '' && @$str[0] == '"' ) // Double-quoted string // @fixme trim() call is due to mystery bug where whitespace gets // appended to the token; without it we ended up reading in the // extra quote on the end! return stripcslashes( substr( trim( $str ), 1, -1 ) ); - } - wfRestoreWarnings(); - - if ( substr( $str, 0, 4 ) === 'true' ) { + if ( substr( $str, 0, 4 ) === 'true' ) return true; - } - - if ( substr( $str, 0, 5 ) === 'false' ) { + if ( substr( $str, 0, 5 ) === 'false' ) return false; - } - - if ( substr( $str, 0, 4 ) === 'null' ) { + if ( substr( $str, 0, 4 ) === 'null' ) return null; - } - // Must be some kind of numeric value, so let PHP's weak typing // be useful for a change return $str; @@ -194,7 +177,7 @@ class QuickArrayReader { * @return null|string */ function getVar( $varname ) { - if ( isset( $this->vars[$varname] ) ) { + if( isset( $this->vars[$varname] ) ) { return $this->vars[$varname]; } else { return null; diff --git a/extensions/LocalisationUpdate/README b/extensions/LocalisationUpdate/README deleted file mode 100644 index 3df784b5..00000000 --- a/extensions/LocalisationUpdate/README +++ /dev/null @@ -1,34 +0,0 @@ -== Localisation Update == -Localisation Update extension can update the MediaWiki messages at any time, -without needing to upgrade the MediaWiki software. - -For more information see: - https://www.mediawiki.org/wiki/Extension:LocalisationUpdate - -== Installation == -1. Add the following to LocalSettings.php of your MediaWiki setup: - - require_once "$IP/extensions/LocalisationUpdate/LocalisationUpdate.php"; - $wgLocalisationUpdateDirectory = "$IP/cache"; - -2. Create a cache folder in the installation directory, and be sure the server -has permissions to write on it. - -If localization updates don't seem to come through, you may need to run, - - php maintenance/rebuildLocalisationCache.php --force. - -3. Whenever you want to run an update, run, - - php extensions/LocalisationUpdate/update.php - -For detailed help, see: - - php extensions/LocalisationUpdate/update.php --help - -4. If you are on Unix like system, you should add LocalisationUpdate to -crontab: - - crontab -e - # Add the following line - @daily php /path/to/your/wiki/extensions/LocalisationUpdate/update.php --quiet diff --git a/extensions/LocalisationUpdate/README_FIRST.txt b/extensions/LocalisationUpdate/README_FIRST.txt new file mode 100644 index 00000000..3973c435 --- /dev/null +++ b/extensions/LocalisationUpdate/README_FIRST.txt @@ -0,0 +1,8 @@ +To install this extension first include +LocalisationUpdate/LocalisationUpdate.php in your LocalSettings.php + +Then add the required new tables to your database by running +php maintenance/update.php on the command line. + +Whenever you want to run an update, run +php extensions/LocalisationUpdate/update.php on the command line. diff --git a/extensions/LocalisationUpdate/tests/tokenTest.php b/extensions/LocalisationUpdate/tests/tokenTest.php deleted file mode 100644 index 2b71cc46..00000000 --- a/extensions/LocalisationUpdate/tests/tokenTest.php +++ /dev/null @@ -1,100 +0,0 @@ -getVars(); - wfSuppressWarnings(); - $retval = $vars[$varname]; - wfRestoreWarnings(); - } catch ( Exception $e ) { - print $e . "\n"; - $retval = null; - } - - return $retval; -} - -function quickTokenExtractArray( $php, $varname ) { - $reader = new QuickArrayReader( "getVar( $varname ); -} - -if ( count( $args ) ) { - $sources = $args; -} else { - $sources = - array_merge( - glob( "$IP/extensions/*/*.i18n.php" ), - glob( "$IP/languages/messages/Messages*.php" ) ); -} - -foreach ( $sources as $sourceFile ) { - $rel = basename( $sourceFile ); - $out = str_replace( '/', '-', $rel ); - - $sourceData = file_get_contents( $sourceFile ); - - if ( preg_match( '!extensions/!', $sourceFile ) ) { - $sourceData = LocalisationUpdate::cleanupExtensionFile( $sourceData ); - $items = 'langs'; - } else { - $sourceData = LocalisationUpdate::cleanupFile( $sourceData ); - $items = 'messages'; - } - - file_put_contents( "$out.txt", $sourceData ); - - $start = microtime( true ); - $eval = evalExtractArray( $sourceData, 'messages' ); - $deltaEval = microtime( true ) - $start; - - $start = microtime( true ); - $quick = quickTokenExtractArray( $sourceData, 'messages' ); - $deltaQuick = microtime( true ) - $start; - - $start = microtime( true ); - $token = confExtractArray( $sourceData, 'messages' ); - $deltaToken = microtime( true ) - $start; - - $hashEval = md5( serialize( $eval ) ); - $hashToken = md5( serialize( $token ) ); - $hashQuick = md5( serialize( $quick ) ); - $countEval = count( (array)$eval ); - $countToken = count( (array)$token ); - $countQuick = count( (array)$quick ); - - printf( "%s %s %d $items - %0.1fms - eval\n", - $rel, $hashEval, $countEval, $deltaEval * 1000 ); - printf( "%s %s %d $items - %0.1fms - QuickArrayReader\n", - $rel, $hashQuick, $countQuick, $deltaQuick * 1000 ); - printf( "%s %s %d $items - %0.1fms - ConfEditor\n", - $rel, $hashToken, $countToken, $deltaToken * 1000 ); - - if ( $hashEval !== $hashToken || $hashEval !== $hashQuick ) { - echo "FAILED on $rel\n"; - file_put_contents( "$out-eval.txt", var_export( $eval, true ) ); - file_put_contents( "$out-token.txt", var_export( $token, true ) ); - file_put_contents( "$out-quick.txt", var_export( $quick, true ) ); - #die("check eval.txt and token.txt\n"); - } - echo "\n"; -} - -echo "ok\n"; - diff --git a/extensions/LocalisationUpdate/update.php b/extensions/LocalisationUpdate/update.php index 04ea64c7..750fc4f2 100644 --- a/extensions/LocalisationUpdate/update.php +++ b/extensions/LocalisationUpdate/update.php @@ -5,9 +5,9 @@ $IP = strval( getenv( 'MW_INSTALL_PATH' ) ) !== '' : realpath( dirname( __FILE__ ) . "/../../" ); // TODO: migrate to maintenance class -require_once "$IP/maintenance/commandLine.inc"; +require_once( "$IP/maintenance/commandLine.inc" ); -if ( isset( $options['help'] ) ) { +if( isset( $options['help'] ) ) { print "Fetches updated localisation files from MediaWiki development SVN\n"; print "and saves into local database to merge with release defaults.\n"; print "\n"; @@ -23,6 +23,7 @@ if ( isset( $options['help'] ) ) { exit( 0 ); } + $starttime = microtime( true ); // Prevent the script from timing out diff --git a/extensions/Nuke/.gitreview b/extensions/Nuke/.gitreview deleted file mode 100644 index c623aede..00000000 --- a/extensions/Nuke/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/Nuke.git -defaultbranch=master diff --git a/extensions/Nuke/COPYING b/extensions/Nuke/COPYING index d159169d..f1537d13 100644 --- a/extensions/Nuke/COPYING +++ b/extensions/Nuke/COPYING @@ -1,3 +1,11 @@ +The license text below "----" applies to all files within this distribution, other +than those that are in a directory which contains files named "LICENSE" or +"COPYING", or a subdirectory thereof. For those files, the license text contained in +said file overrides any license information contained in directories of smaller depth. +Alternative licenses are typically used for software that is provided by external +parties, and merely packaged with the Semantic MediaWiki release for convenience. +---- + GNU GENERAL PUBLIC LICENSE Version 2, June 1991 diff --git a/extensions/Nuke/Nuke.alias.php b/extensions/Nuke/Nuke.alias.php index be9f3450..0b27b4a5 100644 --- a/extensions/Nuke/Nuke.alias.php +++ b/extensions/Nuke/Nuke.alias.php @@ -61,7 +61,7 @@ $specialPageAliases['dsb'] = array( /** Spanish (español) */ $specialPageAliases['es'] = array( - 'Nuke' => array( 'BorradoMasivo', 'Borrado_en_masa', 'Borrado_masivo' ), + 'Nuke' => array( 'BorradoMasivo', 'Borrado_en_masa' ), ); /** Estonian (eesti) */ @@ -201,7 +201,7 @@ $specialPageAliases['nl'] = array( /** Norwegian Nynorsk (norsk nynorsk) */ $specialPageAliases['nn'] = array( - 'Nuke' => array( 'Massesletting', 'Masseslett' ), + 'Nuke' => array( 'Massesletting' ), ); /** Polish (polski) */ diff --git a/extensions/Nuke/Nuke.hooks.php b/extensions/Nuke/Nuke.hooks.php deleted file mode 100644 index fddcf51a..00000000 --- a/extensions/Nuke/Nuke.hooks.php +++ /dev/null @@ -1,27 +0,0 @@ -isAllowed( 'nuke' ) ) { - $toolLinks[] = Linker::link( - SpecialPage::getTitleFor( 'Nuke' ), - wfMessage( 'nuke-linkoncontribs' )->escaped(), - array( 'title' => wfMessage( 'nuke-linkoncontribs-text' )->text() ), - array( 'target' => $userPageTitle->getText() ) - ); - } - return true; - } -} diff --git a/extensions/Nuke/Nuke.i18n.php b/extensions/Nuke/Nuke.i18n.php index 2b4a9abb..f72d208d 100644 --- a/extensions/Nuke/Nuke.i18n.php +++ b/extensions/Nuke/Nuke.i18n.php @@ -40,8 +40,6 @@ Input the username or IP address to get a list of pages to delete, or leave blan 'nuke-nopages-global' => 'There are no new pages in [[Special:RecentChanges|recent changes]].', 'nuke-viewchanges' => 'view changes', 'nuke-namespace' => 'Limit to namespace:', - 'nuke-linkoncontribs' => 'mass delete', - 'nuke-linkoncontribs-text' => "Mass delete pages where this user is the only author", ); /** Message documentation (Message documentation) @@ -58,9 +56,8 @@ Input the username or IP address to get a list of pages to delete, or leave blan */ $messages['qqq'] = array( 'nuke' => '{{doc-special|Nuke}} -The Nuke extension allows for sysops to delete a large number of pages ("Mass delete"). -For more information, see http://www.mediawiki.org/wiki/Extension:Nuke -{{Identical|Mass delete}}', +The Nuke extension allows for sysops to delete a large number of pages ("Mass delete"). +For more information, see http://www.mediawiki.org/wiki/Extension:Nuke', 'action-nuke' => '{{doc-action|nuke}}', 'nuke-desc' => '{{desc|name=Nuke|url=http://www.mediawiki.org/wiki/Extension:Nuke}} The Nuke extension allows for sysops to delete a large number of pages ("Mass delete").', @@ -95,7 +92,7 @@ Parameters: 'nuke-submit-delete' => 'Submit button to delete the selected pages.', 'right-nuke' => '{{doc-right|nuke}}', 'nuke-select' => 'Parameters: -* $1 - two links: {{msg-mw|Powersearch-toggleall}} and {{msg-mw|Powersearch-togglenone}} which respectively selects all pages and de-selects all +* $1 - two links: {{msg-mw|Powersearch-toggleall}} and {{msg-mw|Powersearch-togglenone}} which respectively selects all pages and de-selects all pages {{Identical|Select}}', 'nuke-userorip' => 'Used as label for "target" input box.', @@ -124,16 +121,8 @@ The link points to History page of the page. This message follows: * {{msg-mw|nuke-editby}} and {{msg-mw|comma-separator}} -* or empty string (if username is empty). -{{Identical|View changes}}', +* or empty string (if username is empty).', 'nuke-namespace' => 'Label shown on [[Special:Nuke]] in front of the namespace input that allows choosing a namespace to filter the search by', - 'nuke-linkoncontribs' => 'Used as link text which is used on [[Special:Contributions]] and [[Special:DeletedContributions]]. - -Only added if a user has rights to nuke pages. - -The link has the tooltip {{msg-mw|Nuke-linkoncontribs-text}}. -{{Identical|Mass delete}}', - 'nuke-linkoncontribs-text' => 'Tooltip for the link which is labeled {{msg-mw|Nuke-linkoncontribs}}.', ); /** Afrikaans (Afrikaans) @@ -239,10 +228,8 @@ $messages['arz'] = array( /** Assamese (অসমীয়া) * @author Bishnu Saikia - * @author Gitartha.bordoloi */ $messages['as'] = array( - 'nuke' => 'সমূহীয়া বিলোপন', 'nuke-submit-user' => 'যাওক', ); @@ -275,8 +262,6 @@ un comentariu y calca nel botón pa desaniciales.', 'nuke-nopages-global' => 'Nun hai páxines nueves nos [[Special:RecentChanges|cambios recientes]].', 'nuke-viewchanges' => 'ver los cambios', 'nuke-namespace' => 'Llendar al espaciu de nomes:', - 'nuke-linkoncontribs' => 'desaniciar en masa', - 'nuke-linkoncontribs-text' => "Desaniciar en masa les páxines nes qu'esti usuariu ye l'únicu autor", ); /** Azerbaijani (azərbaycanca) @@ -428,7 +413,7 @@ Merkañ un tamm notenn ha klikañ war ar bouton d'o diverkañ.", # Fuzzy Lakait un notenn ha klikit war ar bouton evit o diverkañ.', 'nuke-defaultreason' => 'Diverkañ a-vras ar pajennoù bet ouzhpennet gant $1', # Fuzzy 'nuke-multiplepeople' => 'Diverkañ a-vras ar pajennoù nevez-ouzhpennet', - 'nuke-tools' => "Talvezout a ra an ostilh-mañ da ziverkañ a-vras pajennoù bet ouzhpennet nevez zo gant un implijer enrollet pe gant ur chomlec'h IP. + 'nuke-tools' => "Talvezout a ra an ostilh-mañ da ziverkañ a-vras pajennoù bet ouzhpennet nevez zo gant un implijer enrollet pe gant ur chomlec'h IP. Merkañ ar c'homlec'h IP pe anv an implijer evit kaout roll ar pajennoù da ziverkañ, pe lezel gwenn evit an holl implijerien.", 'nuke-submit-user' => 'Mont', 'nuke-submit-delete' => 'Dilemel ar re diuzet', @@ -458,7 +443,7 @@ navedite razloge i komentare te kliknite na dugme da bi ste ih obrisali.', # Fuz stavite ih u komentar i pritisnite dugme za njihovo brisanje.', 'nuke-defaultreason' => 'Masovno uklanjanje stranica koje je dodao $1', # Fuzzy 'nuke-multiplepeople' => 'više korisnika', # Fuzzy - 'nuke-tools' => 'Ovaj alat omogućuje masovno brisanje stranica koje je nedavno dodao određeni korisnik ili IP adresa. + 'nuke-tools' => 'Ovaj alat omogućuje masovno brisanje stranica koje je nedavno dodao određeni korisnik ili IP adresa. Unesite korisničko ime ili IP adresu za izlistavanje stranica koje se brišu ili ostavite prazno za prikaz svih korisnika.', 'nuke-submit-user' => 'Idi', 'nuke-submit-delete' => 'Obriši označeno', @@ -471,41 +456,22 @@ Unesite korisničko ime ili IP adresu za izlistavanje stranica koje se brišu il /** Catalan (català) * @author Aleator - * @author Alvaro Vidal-Abarca * @author Paucabot * @author SMP * @author Toniher - * @author Vriullop */ $messages['ca'] = array( 'nuke' => 'Eliminació massiva', - 'action-nuke' => 'eliminació massiva', 'nuke-desc' => "Dóna als administradors l'habilitat d'[[Special:Nuke|esborrar pàgines massivament]]", - 'nuke-nopages' => 'No hi ha pàgines noves de [[Special:Contributions/$1|{{GENDER:$1|$1}}]] als canvis recents.', - 'nuke-list' => 'Les següents pàgines han estat creades recentment per [[Special:Contributions/$1|{{GENDER:$1|$1}}]]; -afegiu un comentari i cliqueu el botó per a esborrar-les.', - 'nuke-list-multiple' => 'Les següents pàgines han estat creades recentment; -afegiu un comentari i cliqueu el botó per a esborrar-les.', - 'nuke-defaultreason' => 'Esborrat massiu de pàgines creades per [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', - 'nuke-multiplepeople' => 'Esborrat massiu de pàgines creades recentment', + 'nuke-nopages' => 'No hi ha pàgines noves de [[Special:Contributions/$1|$1]] als canvis recents.', # Fuzzy + 'nuke-list' => 'Les següents pàgines han estat creades recentment per [[Special:Contributions/$1|$1]]; +feu un comentari i cliqueu el botó per a esborrar-les.', # Fuzzy + 'nuke-defaultreason' => 'Esborrat massiu de pàgines creades per $1', # Fuzzy 'nuke-tools' => "Aquesta eina permet l'eliminació massiva de pàgines creades recentment per un usuari o IP. -Indiqueu el nom d'usuari o adreça IP per obtenir la llista de pàgines a esborrar, o deixeu-ho en blanc per tots els usuaris.", +Per obtenir la llista de pàgines per esborrar podeu introduir el nom d'un usuari o una IP.", 'nuke-submit-user' => 'Vés-hi', - 'nuke-submit-delete' => 'Esborra els seleccionats', + 'nuke-submit-delete' => 'Esborra la selecció', 'right-nuke' => 'Esborrar pàgines de forma massiva', - 'nuke-select' => 'Selecciona: $1', - 'nuke-userorip' => "Nom d'usuari, adreça IP o en blanc:", - 'nuke-maxpages' => 'Nombre màxim de pàgines:', - 'nuke-editby' => 'Creada per [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', - 'nuke-deleted' => "La pàgina '''$1''' ha estat esborrada.", - 'nuke-not-deleted' => "La pàgina [[:$1]] '''no s'ha pogut''' esborrar.", - 'nuke-delete-more' => '[[Special:Nuke|Esborra més pàgines]]', - 'nuke-pattern' => 'Patró pel nom de pàgina:', - 'nuke-nopages-global' => 'No hi ha cap pàgina nova als [[Special:RecentChanges|canvis recents]].', - 'nuke-viewchanges' => 'mostra els canvis', - 'nuke-namespace' => "Limitat a l'espai de noms:", - 'nuke-linkoncontribs' => 'eliminació massiva', - 'nuke-linkoncontribs-text' => "Eliminació massiva de pàgines on aquest usuari és l'únic autor", ); /** Chechen (нохчийн) @@ -513,9 +479,8 @@ Indiqueu el nom d'usuari o adreça IP per obtenir la llista de pàgines a esborr * @author Умар */ $messages['ce'] = array( - 'nuke' => 'Дуккха дӀаяккхар', + 'nuke' => 'Дуккха дӀяккхар', 'action-nuke' => 'дуккха агIонаш дӀаяхар', - 'nuke-desc' => 'Куьйгалхошна таро хуьлуьйту [[Special:Nuke|дуккха агӀонаш]] дӀаяха', 'nuke-list-multiple' => 'Лахахь гайтина агӀонаш дукху хан йоцуш кхолийна. Уьш дӀаяха билгалонаш Ӏадйите тӀетаӀе кнопка.', 'nuke-defaultreason' => 'Декъашхочо $1 кхоьллина агIонаш, дуккха дӀаяхар', # Fuzzy @@ -527,12 +492,9 @@ $messages['ce'] = array( 'nuke-userorip' => 'Декъашхочун цӀе, IP-адрес (еса йита мега):', 'nuke-maxpages' => 'АгӀонашан максимальни дукхалла:', 'nuke-editby' => 'Кхолийна {{GENDER:$1|декъашхочо}} [[Special:Contributions/$1|$1]]', - 'nuke-delete-more' => '[[Special:Nuke|Дуккха агӀонаш дӀаяхар]]', 'nuke-pattern' => 'Кеп агӀона цӀеран:', 'nuke-viewchanges' => 'ХӀоттина болу хийцам', 'nuke-namespace' => 'Къастае ана цӀераш:', - 'nuke-linkoncontribs' => 'дуккха дӀаяккхар', - 'nuke-linkoncontribs-text' => 'ХӀокху декъашхочо кхоьллина агӀонаш массо дӀаяха', ); /** Chamorro (Chamoru) @@ -549,11 +511,10 @@ $messages['ckb'] = array( 'right-nuke' => 'سڕینەوەی پەڕەکان بەکۆمەڵ', ); -/** Czech (čeština) +/** Czech (česky) * @author Danny B. * @author Jkjk * @author Li-sung - * @author Littledogboy * @author Matěj Grabovský * @author Mormegil */ @@ -566,8 +527,8 @@ $messages['cs'] = array( vyplňte komentář a všechny smažte kliknutím na tlačítko.', 'nuke-list-multiple' => 'Nedávno byly vytvořeny následující stránky; zadáním komentáře a stisknutím tlačítka je smažete.', - 'nuke-defaultreason' => 'Hromadné smazání stránek, které {{GENDER:$1|vytvořil|vytvořila}} [[Special:Contributions/$1|$1]]', - 'nuke-multiplepeople' => 'Hromadné smazání nedávno založených stránek', + 'nuke-defaultreason' => 'Hromadné odstranění stránek, které {{GENDER:$1|vytvořil|vytvořila}} [[Special:Contributions/$1|$1]]', + 'nuke-multiplepeople' => 'Hromadné odstranění nedávno založených stránek', 'nuke-tools' => 'Tento nástroj umožňuje hromadné smazání stránek nedávno vytvořených zadaným uživatelem nebo IP adresou. Zadejte uživatelské jméno nebo IP adresu, zobrazí se seznam stránek ke smazání; případně ponechte prázdné pro všechny uživatele.', 'nuke-submit-user' => 'Provést', @@ -584,8 +545,6 @@ Zadejte uživatelské jméno nebo IP adresu, zobrazí se seznam stránek ke smaz 'nuke-nopages-global' => 'V [[Special:RecentChanges|posledních změnách]] nejsou žádné nové stránky.', 'nuke-viewchanges' => 'ukázat změny', 'nuke-namespace' => 'Omezit na jmenný prostor:', - 'nuke-linkoncontribs' => 'hromadné mazání', - 'nuke-linkoncontribs-text' => 'Hromadně smazat stránky, jichž je tento uživatel jediným autorem', ); /** Danish (dansk) @@ -626,7 +585,6 @@ Skriv et brugernavn eller en IP-adresse for at få en liste over sider at slette * @author Geitost * @author Kghbln * @author Metalhead64 - * @author Purodha * @author Raimond Spekking * @author SVG */ @@ -657,8 +615,6 @@ Gib die IP-Adresse oder den Benutzernamen ein, um eine Liste der zu löschenden 'nuke-nopages-global' => 'Es gibt keine neuen Seiten unter den [[Special:RecentChanges|letzten Änderungen]].', 'nuke-viewchanges' => 'Änderungen ansehen', 'nuke-namespace' => 'Auf den folgenden Namensraum begrenzen:', - 'nuke-linkoncontribs' => 'Massenlöschungen', - 'nuke-linkoncontribs-text' => 'Massengelöschte Seiten, bei denen dieser Benutzer der einzige Autor ist.', ); /** German (formal address) (Deutsch (Sie-Form)‎) @@ -694,7 +650,7 @@ Listanê peleyê ke besternaya vinayışi rê namey karberi yana ip adresi deker 'right-nuke' => 'pelan yew hew de hewnaker', 'nuke-select' => 'Weçinaye: $1', 'nuke-delete-more' => '[[Special:Nuke|Zewbi pera besterne]]', - 'nuke-viewchanges' => 'vurnayışan bıvêne', + 'nuke-viewchanges' => 'Vurnayışa bıvin', ); /** Lower Sorbian (dolnoserbski) @@ -726,8 +682,6 @@ zapódaj komentar a klikni na tłocašk, aby je wulašował.', 'nuke-nopages-global' => 'Njejsu žedne nowe boki w [[Special:RecentChanges|aktualnych změnach]].', 'nuke-viewchanges' => 'změny pokazaś', 'nuke-namespace' => 'Na slědujucy mjenjowy rum wobgranicowaś:', - 'nuke-linkoncontribs' => 'masowe wulašowanje', - 'nuke-linkoncontribs-text' => 'Bok masowego wulašowanja, źož toś ten wužywaŕ jo jadnučki awtor', ); /** Ewe (eʋegbe) @@ -866,8 +820,6 @@ Kustutatavate lehekülgede nimekirja näitamiseks sisesta kasutajanimi või IP-a 'nuke-nopages-global' => '[[Special:RecentChanges|Viimaste muudatuste]] all pole uusi lehekülgi.', 'nuke-viewchanges' => 'vaata muudatusi', 'nuke-namespace' => 'Nimeruumipiirang:', - 'nuke-linkoncontribs' => 'lauskustutamine', - 'nuke-linkoncontribs-text' => 'Lauskustuta leheküljed, mille ainus autor on see kasutaja', ); /** Basque (euskara) @@ -887,7 +839,6 @@ idatz ezazu ohar bat, eta sakatu botoia orri horiek ezabatzeko.', ); /** Persian (فارسی) - * @author Armin1392 * @author Ebraminio * @author Huji * @author Mjbmr @@ -914,25 +865,21 @@ $messages['fa'] = array( 'nuke-userorip' => 'نام کاربری، نشانی آی‌پی یا خالی:', 'nuke-maxpages' => 'حداکثر تعداد صفحه‌ها:', 'nuke-editby' => 'ایجاد شده توسط [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', - 'nuke-deleted' => "صفحهٔ '''$1''' حذف شده‌است.", + 'nuke-deleted' => "صفحهٔ '''$1''' حذف شده است.", 'nuke-not-deleted' => "صفحهٔ [[:$1]] را '''نمی‌توان''' حذف کرد.", 'nuke-delete-more' => '[[Special:Nuke|حذف صفحه‌های بیشتر]]', 'nuke-pattern' => 'الگو برای نام صفحه:', 'nuke-nopages-global' => 'هیچ صفحهٔ جدیدی در [[Special:RecentChanges|فهرست تغییرات اخیر]] نیست.', 'nuke-viewchanges' => 'نمایش تغییرات', 'nuke-namespace' => 'محدودیت به فضای نام:', - 'nuke-linkoncontribs' => 'حذف گروه', - 'nuke-linkoncontribs-text' => 'حذف دستهٔ صفحات جایی که این کاربر تنها نویسنده است', ); /** Finnish (suomi) * @author Beluga * @author Crt * @author Jaakonam - * @author Mies * @author Nike * @author Olli - * @author Pxos * @author Stryn */ $messages['fi'] = array( @@ -941,15 +888,15 @@ $messages['fi'] = array( 'nuke-desc' => 'Mahdollistaa ylläpitäjille sivujen [[Special:Nuke|massapoistamisen]].', 'nuke-nopages' => 'Ei käyttäjän [[Special:Contributions/$1|{{GENDER:$1|$1}}]] lisäämiä uusia sivuja tuoreissa muutoksissa.', 'nuke-list' => 'Käyttäjä [[Special:Contributions/$1|{{GENDER:$1|$1}}]] on äskettäin luonut seuraavat sivut. -Lisää kommentti ja poista sivut napsauttamalla painiketta.', - 'nuke-list-multiple' => 'Seuraavat sivut on luotu äskettäin. -Lisää kommentti ja poista sivut napsauttamalla painiketta.', +Lisää kommentti ja poista napsauttamalla painiketta.', + 'nuke-list-multiple' => 'Seuraavat sivut tehtiin äskettäin. +Lisää kommentti ja poista napsauttamalla painiketta.', 'nuke-defaultreason' => 'Käyttäjän [[Special:Contributions/$1|{{GENDER:$1|$1}}]] lisäämien sivujen massapoistaminen', 'nuke-multiplepeople' => 'Äskettäin lisättyjen sivujen massapoistaminen', 'nuke-tools' => 'Tämä työkalu mahdollistaa äskettäin lisättyjen sivujen massapoistamisen käyttäjänimen tai IP-osoitteen perusteella. Kirjoita käyttäjänimi tai IP-osoite, niin saat listan poistettavista sivuista, tai jätä kenttä tyhjäksi niin saat kaikkien käyttäjien tekemät sivut.', 'nuke-submit-user' => 'Siirry', - 'nuke-submit-delete' => 'Poista valitut sivut', + 'nuke-submit-delete' => 'Poista valitut', 'right-nuke' => 'Massapoistaa sivuja', 'nuke-select' => 'Valinta: $1', 'nuke-userorip' => 'Käyttäjänimi tai IP-osoite (voi jättää myös tyhjäksi):', @@ -957,13 +904,11 @@ Kirjoita käyttäjänimi tai IP-osoite, niin saat listan poistettavista sivuista 'nuke-editby' => 'Luonut [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', 'nuke-deleted' => "Sivu '''$1''' on poistettu.", 'nuke-not-deleted' => "Sivua [[:$1]] '''ei voitu''' poistaa.", - 'nuke-delete-more' => '[[Special:Nuke|Poista enemmän sivuja]]', - 'nuke-pattern' => 'Malli sivun nimelle:', + 'nuke-delete-more' => '[[Special:Nuke|Poista lisää sivuja]]', + 'nuke-pattern' => 'Sivun nimien etuliite', 'nuke-nopages-global' => '[[Special:RecentChanges|Tuoreissa muutoksissa]] ei ole uusia sivuja.', 'nuke-viewchanges' => 'näytä muutokset', 'nuke-namespace' => 'Rajoita nimiavaruuteen:', - 'nuke-linkoncontribs' => 'massapoisto', - 'nuke-linkoncontribs-text' => 'Massapoista ne sivut, joissa tämä käyttäjä on ainoa sivuja muokannut', ); /** French (français) @@ -985,7 +930,7 @@ $messages['fr'] = array( 'nuke-desc' => 'Donne la possibilité aux administrateurs de [[Special:Nuke|supprimer en masse]] des pages', 'nuke-nopages' => 'Aucune nouvelle page créée par [[Special:Contributions/$1|{{GENDER:$1|$1}}]] dans la liste des changements récents.', 'nuke-list' => 'Les pages suivantes ont été créées récemment par [[Special:Contributions/$1|{{GENDER:$1|$1}}]]; saisissez un commentaire et cliquez sur le bouton pour les supprimer.', - 'nuke-list-multiple' => 'Les pages suivantes ont été récemment créées ; + 'nuke-list-multiple' => 'Les pages suivantes ont été récemment créées ; entrez un commentaire et cliquez sur le bouton pour les supprimer.', 'nuke-defaultreason' => 'Suppression en masse des pages ajoutées par [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', 'nuke-multiplepeople' => 'Suppression de masse de pages récemment ajoutées', @@ -1004,8 +949,6 @@ entrez un commentaire et cliquez sur le bouton pour les supprimer.', 'nuke-nopages-global' => "Il n'y a pas de nouvelle page dans [[Special:RecentChanges|changements récents]].", 'nuke-viewchanges' => 'voir les modifications', 'nuke-namespace' => "Se limiter à l'espace de nommage:", - 'nuke-linkoncontribs' => 'suppression de masse', - 'nuke-linkoncontribs-text' => 'Supprimer des pages en masse quand cet utilisateur est l’unique auteur', ); /** Franco-Provençal (arpetan) @@ -1040,41 +983,6 @@ Buchiér lo nom d’usanciér ou ben l’adrèce IP por avêr la lista de les p 'nuke-namespace' => 'Sè limitar a cet’èspâço de noms :', ); -/** Northern Frisian (Nordfriisk) - * @author Murma174 - */ -$messages['frr'] = array( - 'nuke' => 'Sidjen bonkerwiis strik', - 'action-nuke' => 'sidjen bonkerwiis tu striken', - 'nuke-desc' => 'Administratooren kön diarmä sidjen [[Special:Nuke|bonkerwiis strik]]', - 'nuke-nopages' => 'Bi a „leetst feranrangen“ san nian nei sidjen faan [[Special:Contributions/$1|{{GENDER:$1|$1}}]].', - 'nuke-list' => 'Jodiar sidjen san faan [[Special:Contributions/$1|{{GENDER:$1|$1}}]] skrewen wurden. -Skriiw ap, huaram dü jo strikst, an do trak üüb di knoop tu striken.', - 'nuke-list-multiple' => 'Jodiar sidjen san jüst skrewen wurden. -Skriiw ap, huaram dü jo strikst, an do trak üüb di knoop tu striken.', - 'nuke-defaultreason' => 'Sidjen faan [[Special:Contributions/$1|{{GENDER:$1|$1}}]] bonkerwiis strik', - 'nuke-multiplepeople' => 'Jüst skrewen sidjen bonkerwiis strik', - 'nuke-tools' => 'Diarmä kön sidjen, diar faan en was IP of en wasen brüker skrewen wurden san, bonkerwiis stregen wurd. -Skriiw diar det IP-adres of di brükernööm iin, an do könst dü det list faan sidjen sä, diar stregen wurd kön. -Wan dü diar niks henskrafst, wurd aal a brükern uunwiset.', - 'nuke-submit-user' => 'Widjer', - 'nuke-submit-delete' => 'Enkelten strik', - 'right-nuke' => 'Sidjen bonkerwiis strik', - 'nuke-select' => 'Schük ütj: $1', - 'nuke-userorip' => 'Brükernööm, IP-adres of niks:', - 'nuke-maxpages' => 'Ei muar sidjen üs:', - 'nuke-editby' => 'Skrewen faan [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', - 'nuke-deleted' => "Sidj '''„$1“''' as stregen wurden.", - 'nuke-not-deleted' => "Sidj [[:$1]] '''küd ei''' stregen wurd.", - 'nuke-delete-more' => '[[Special:Nuke|Muar sidjen strik]]', - 'nuke-pattern' => 'Münster för di sidjnööm:', - 'nuke-nopages-global' => 'Diar san nian sidjen uun a [[Special:RecentChanges|leetst feranrangen]].', - 'nuke-viewchanges' => 'Feranrangen wise', - 'nuke-namespace' => 'Bluas uun di nöömrüm:', - 'nuke-linkoncontribs' => 'Bonkerwiis strik', - 'nuke-linkoncontribs-text' => 'Bonkerwiis stregen sidjen, huar di brüker di iansagst skriiwer as.', -); - /** Friulian (furlan) * @author Klenje */ @@ -1114,8 +1022,6 @@ Introduza o nome do usuario ou enderezo IP para obter unha lista das páxinas pa 'nuke-nopages-global' => 'Non hai páxinas novas nos [[Special:RecentChanges|cambios recentes]].', 'nuke-viewchanges' => 'ollar os cambios', 'nuke-namespace' => 'Limitar ao espazo de nomes:', - 'nuke-linkoncontribs' => 'eliminar en masa', - 'nuke-linkoncontribs-text' => 'Eliminar en masa as páxinas das que este usuario é o único autor', ); /** Ancient Greek (Ἀρχαία ἑλληνικὴ) @@ -1176,10 +1082,8 @@ $messages['gv'] = array( /** Hebrew (עברית) * @author Amire80 * @author Guycn1 - * @author Guycn2 * @author Rotem Liss * @author YaronSh - * @author Yona b */ $messages['he'] = array( 'nuke' => 'מחיקה מרובה', @@ -1192,8 +1096,8 @@ $messages['he'] = array( אנא כתבו נימוק למחיקה ולחצו על הכפתור כדי למחוק אותם.', 'nuke-defaultreason' => 'הסרה מרובה של דפים שנוצרו על־ידי [[Special:Contributions/$1|$1]]', 'nuke-multiplepeople' => 'מחיקה מרובה של דפים שנוספו לאחרונה', - 'nuke-tools' => 'כלי זה מאפשר מחיקות המוניות של דפים שנוספו לאחרונה על־ידי משתמש או כתובת IP מסוימים. -כתבו את שם המשתמש או כתובת ה־IP כדי לקבל את רשימת הדפים למחיקה, או השאירו את השדה ריק עבור כל המשתמשים.', + 'nuke-tools' => 'כלי זה מאפשר מחיקות המוניות של דפים שנוספו לאחרונה על ידי משתמש או כתובת IP מסוימים. +כתבו את שם המשתמש או כתובת ה־IP כדי לקבל את רשימת הדפים למחיקה או השאירו את השדה הזה ריק עבור כל המשתמשים.', 'nuke-submit-user' => 'הצגה', 'nuke-submit-delete' => 'מחיקת הדפים שנבחרו', 'right-nuke' => 'מחיקה מרובה של דפים', @@ -1208,8 +1112,6 @@ $messages['he'] = array( 'nuke-nopages-global' => 'אין דפים חדשים ב[[Special:RecentChanges|שינויים אחרונים]].', 'nuke-viewchanges' => 'הצגת שינויים', 'nuke-namespace' => 'להגביל למרחב השמות הבא:', - 'nuke-linkoncontribs' => 'מחיקה מרובה', - 'nuke-linkoncontribs-text' => 'מחיקת דפים רבים בהם משתמש זה הוא הכותב היחיד', ); /** Hindi (हिन्दी) @@ -1257,7 +1159,6 @@ $messages['hil'] = array( /** Croatian (hrvatski) * @author Dalibor Bosits * @author Dnik - * @author MaGa * @author Roberta F. * @author SpeedyGonsales */ @@ -1272,9 +1173,6 @@ $messages['hr'] = array( 'nuke-submit-delete' => 'Obriši označeno', 'right-nuke' => 'Skupno brisanje stranica', 'nuke-select' => 'Odaberite: $1', - 'nuke-viewchanges' => 'prikaži promjene', - 'nuke-linkoncontribs' => 'skupno brisanje', - 'nuke-linkoncontribs-text' => 'Skupno brisanje stranica kojima je ovaj suradnik jedini autor', ); /** Upper Sorbian (hornjoserbsce) @@ -1305,8 +1203,6 @@ napisaj komentar a klikń na tłóčatko, zo by je wušmórnył.', 'nuke-nopages-global' => 'Njejsu žane nowe strony w [[Special:RecentChanges|aktualnych změnach]].', 'nuke-viewchanges' => 'změny pokazać', 'nuke-namespace' => 'Na slědowacy mjenowy rum wobmjezować:', - 'nuke-linkoncontribs' => 'masowe zhašenje', - 'nuke-linkoncontribs-text' => 'Strony masoweho zhašenja, hdźež tutón wužiwar je jenički awtor', ); /** Hungarian (magyar) @@ -1384,7 +1280,7 @@ $messages['id'] = array( 'nuke-desc' => 'Memberikan kemampuan bagi pengurus untuk [[Special:Nuke|menghapus halaman secara massal]]', 'nuke-nopages' => 'Tak ditemukan halaman baru dari [[Special:Contributions/$1|{{GENDER:$1|$1}}]] di perubahan terbaru.', 'nuke-list' => 'Halaman berikut baru saja dibuat oleh [[Special:Contributions/$1|{{GENDER:$1|$1}}]]; berikan komentar dan tekan tombol untuk menghapus halaman-halaman tersebut.', - 'nuke-list-multiple' => 'Halaman berikut baru dibuat; + 'nuke-list-multiple' => 'Halaman berikut baru dibuat; berikan komentar dan tekan tombol untuk menghapus.', 'nuke-defaultreason' => 'Penghapusan masal halaman-halaman yang dibuat oleh [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', 'nuke-multiplepeople' => 'Penghapusan masal halaman yang baru saja ditambahkan', @@ -1417,9 +1313,9 @@ $messages['ig'] = array( * @author Lam-ang */ $messages['ilo'] = array( - 'nuke' => 'Paga-adduan nga panagikkat', + 'nuke' => 'Paga-adduan nga pinag-ikkat', 'action-nuke' => 'ikkaten dagiti panid', - 'nuke-desc' => 'Ikkanna ti administrador ti abilidad iti [[Special:Nuke|adu a panagikkat]] kadagiti panid', + 'nuke-desc' => 'Ikkan na ti administrador ti abilidad nga [[Special:Nuke| paga-adduan nga pang-ikkat]] kadagit panid', 'nuke-nopages' => 'Awan dagiti baro a panid babaen ni [[Special:Contributions/$1|{{GENDER:$1|$1}}]] idiay kaudian abalbaliw.', 'nuke-list' => 'Dagiti sumaganad a panid ket kadamdamaan a pinartuat babaen ni [[Special:Contributions/$1|{{GENDER:$1|$1}}]]; ikkam ti komentario ken pindutem ti buton tapno maikkatda.', @@ -1443,8 +1339,6 @@ Ikabil ti nagan ti agar-aramat wenno IP address tapno maalam dagiti listaan dagi 'nuke-nopages-global' => 'Awan dagiti baro a panid idiay [[Special:RecentChanges|kinaudian a pinagbaliw]].', 'nuke-viewchanges' => 'kitaen dagiti sinukatan', 'nuke-namespace' => 'Patingga iti nagan a lugar:', - 'nuke-linkoncontribs' => 'agikkat ti adu', - 'nuke-linkoncontribs-text' => 'Agikkat ti adu a pampanid a ti agar-aramat ket isu laeng ti nagsurat', ); /** Ido (Ido) @@ -1521,8 +1415,6 @@ Inserisci il nome utente o l'indirizzo IP per la lista delle pagine da cancellar 'nuke-nopages-global' => 'Non ci sono nuove pagine negli [[Special:RecentChanges|ultimi cambiamenti]].', 'nuke-viewchanges' => 'vedi modifiche', 'nuke-namespace' => 'Limita al namespace:', - 'nuke-linkoncontribs' => 'cancella massivamente', - 'nuke-linkoncontribs-text' => "Cancella massivamente le pagine dove questo utente è l'unico contributore", ); /** Japanese (日本語) @@ -1565,7 +1457,6 @@ $messages['ja'] = array( 'nuke-nopages-global' => '[[Special:RecentChanges|最近の更新]]には新しいページはありません。', 'nuke-viewchanges' => '履歴を表示', 'nuke-namespace' => '名前空間:', - 'nuke-linkoncontribs' => '一括削除', ); /** Jutish (jysk) @@ -1637,9 +1528,7 @@ $messages['ka'] = array( 'nuke-deleted' => "გვერდი '''$1''' წაიშალა.", 'nuke-not-deleted' => "გვერდი [[:$1]] წაშლა '''შეუძლებელია'''.", 'nuke-delete-more' => '[[Special:Nuke|მრავალრიცხოვანი გვერდების წაშლა]]', - 'nuke-pattern' => 'გვერდის სახელის თარგი:', 'nuke-viewchanges' => 'ცვლილებების ჩვენება', - 'nuke-namespace' => 'სახელთა სივრცის შეზღუდვა:', ); /** Kazakh (Cyrillic script) (қазақша (кирил)‎) @@ -1698,7 +1587,6 @@ $messages['kn'] = array( * @author Albamhandae * @author Klutzy * @author Kwj2772 - * @author Priviet * @author ToePeu * @author 아라 */ @@ -1729,17 +1617,13 @@ $messages['ko'] = array( 'nuke-nopages-global' => '[[Special:RecentChanges|최근 바뀜]]에 새 문서가 없습니다.', 'nuke-viewchanges' => '차이 보기', 'nuke-namespace' => '이름공간 제한:', - 'nuke-linkoncontribs' => '문서 대량 삭제', - 'nuke-linkoncontribs-text' => '이 사용자가 유일한 기여자인 문서를 대량 삭제', ); /** Krio (Krio) * @author Jose77 - * @author Protostar */ $messages['kri'] = array( 'nuke-submit-user' => 'Go to am', - 'nuke-linkoncontribs' => 'mass delet', ); /** Kinaray-a (Kinaray-a) @@ -1797,7 +1681,6 @@ $messages['ku-latn'] = array( /** Luxembourgish (Lëtzebuergesch) * @author Les Meloures * @author Robby - * @author Soued031 */ $messages['lb'] = array( 'nuke' => 'Masseläschung', @@ -1808,7 +1691,7 @@ $messages['lb'] = array( 'nuke-list-multiple' => 'Dës Säite goufe rezent gemaach; setzt eng Bemierkung derbäi a klickt op de Knäppche fir se ze läschen.', 'nuke-defaultreason' => 'Masseläschung vu Säiten, déi vum [[Special:Contributions/$1|{{GENDER:$1|$1}}]] ugefaang goufen', - 'nuke-multiplepeople' => 'Masse-Läschung vu Säiten déi rezent derbäigesat goufen', + 'nuke-multiplepeople' => 'Masse-Läschung vu Säiten déi rezent derbäi gesat goufen', 'nuke-tools' => "Dësen Tool erlaabt vill Säite mateneen ze läschen, déi vun engem Benotzer oder vun enger IP-Adress ugeluecht goufen. Gitt w.e.g. d'IP-Adress respektiv de Benotzer u fir eng Lëscht vun de Säiten ze kréien déi geläscht solle ginn, oder loosst et eidel fir all Benotzer.", 'nuke-submit-user' => 'Lass', @@ -1825,8 +1708,6 @@ Gitt w.e.g. d'IP-Adress respektiv de Benotzer u fir eng Lëscht vun de Säiten z 'nuke-nopages-global' => 'Et si keng nei Säiten an de [[Special:RecentChanges|rezenten Ännerungen]].', 'nuke-viewchanges' => 'Ännerunge weisen', 'nuke-namespace' => 'Op dësen Nummraum limitéieren:', - 'nuke-linkoncontribs' => 'Masseläschungen', - 'nuke-linkoncontribs-text' => 'Massegeläschte Säite wou dëse Benotzer den eenzegen Auteur ass', ); /** Limburgish (Limburgs) @@ -1904,7 +1785,7 @@ $messages['mg'] = array( */ $messages['min'] = array( 'nuke' => 'Pangapuihan masal', - 'nuke-list-multiple' => 'Laman ko baru sajo dibuek; + 'nuke-list-multiple' => 'Laman ko baru sajo dibuek; agiah komentar dan takan tombol untuak mangapuih.', 'nuke-defaultreason' => 'Pangapuihan masal laman-laman nan dibuek dek [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', 'nuke-tools' => 'Pakakeh ko mamungkinkan pangapuihan masal laman-laman nan baru sajo dibuek jo sorang pangguno atau alamaik IP. @@ -1951,8 +1832,6 @@ $messages['mk'] = array( 'nuke-nopages-global' => 'Нема нови страници во [[Special:RecentChanges|скорешните промени]].', 'nuke-viewchanges' => 'прикажи промени', 'nuke-namespace' => 'Само во имен. простор:', - 'nuke-linkoncontribs' => 'масовно бришење', - 'nuke-linkoncontribs-text' => 'Масовното бришење на страници чиј единствен автор е овој корисник', ); /** Malayalam (മലയാളം) @@ -1985,26 +1864,21 @@ $messages['ml'] = array( 'nuke-nopages-global' => '[[Special:RecentChanges|സമീപകാലമാറ്റങ്ങളിൽ]] പുതിയ താളുകളൊന്നുമില്ല.', 'nuke-viewchanges' => 'മാറ്റങ്ങൾ കാണുക', 'nuke-namespace' => 'ഈ നാമമേഖലയിൽ ഒതുക്കുക:', - 'nuke-linkoncontribs' => 'കൂട്ട മായ്ക്കൽ', - 'nuke-linkoncontribs-text' => 'ഈ ഉപയോക്താവ് കൂട്ടത്തോടെ മായ്ച്ച താളുകൾ', ); /** Marathi (मराठी) * @author Kaustubh - * @author V.narsikar */ $messages['mr'] = array( 'nuke' => 'एकदम खूप पाने वगळा', - 'nuke-desc' => 'प्रबंधकांना [[Special:Nuke|गठ्ठ्याने वगळण्याची(मास डिलीट)]] क्षमता देते', + 'nuke-desc' => 'प्रबंधकांना एकाचवेळी [[Special:Nuke|अनेक पाने वगळण्याची]] परवानगी देते', 'nuke-nopages' => '[[Special:Contributions/$1|$1]] कडून अलीकडील बदलांमध्ये नवीन पाने नाहीत.', # Fuzzy 'nuke-list' => 'खालील पाने ही [[Special:Contributions/$1|$1]] ने अलिकडे वाढविलेली आहेत; शेरा द्या व वगळण्यासाठी कळीवर टिचकी द्या.', # Fuzzy 'nuke-defaultreason' => '$1 ने नवीन वाढविलेली अनेक पाने एकावेळी वगळा', # Fuzzy 'nuke-tools' => 'हे उपकरण एखाद्या विशिष्ट सदस्य अथवा अंकपत्त्याद्वारे नवीन तयार करण्यात आलेल्या पानांना एकाचवेळी वगळण्याची संधी देते. सदस्य नाव अथवा अंकपत्ता दिल्यास वगळण्यासाठी पानांची यादी मिळेल:', # Fuzzy 'nuke-submit-user' => 'जा', 'nuke-submit-delete' => 'निवडलेले वगळा', - 'right-nuke' => 'गठ्ठ्याने पाने वगळा', - 'nuke-linkoncontribs' => 'एकगठ्ठा वगळा', - 'nuke-linkoncontribs-text' => 'ती पाने एकगठ्ठा वगळा, ज्यांचा हा सदस्य एकमेव लेखक आहे', + 'right-nuke' => 'खूप पाने एकत्र वगळा', ); /** Malay (Bahasa Melayu) @@ -2037,8 +1911,6 @@ Isikan nama pengguna atau alamat IP untuk mendapat senarai laman yang hendak dik 'nuke-nopages-global' => 'Tiada laman baru dalam [[Special:RecentChanges|perubahan terkini]].', 'nuke-viewchanges' => 'lihat perubahan', 'nuke-namespace' => 'Had ruang nama:', - 'nuke-linkoncontribs' => 'hapus pukal', - 'nuke-linkoncontribs-text' => 'Hapus pukal halaman-halaman di mana pengguna ini satu-satunya pengarangnya', ); /** Maltese (Malti) @@ -2116,8 +1988,6 @@ Skriv et brukernavn eller en IP-adresse for å få en liste over sider som kan s 'nuke-delete-more' => '[[Special:Nuke|Slett flere sider]]', 'nuke-pattern' => 'Mønster for sidenavnet:', 'nuke-nopages-global' => 'Det er ingen sider i [[Special:RecentChanges|siste endringer]].', - 'nuke-linkoncontribs' => 'masseslett', - 'nuke-linkoncontribs-text' => 'Masseslett sider der denne brukeren er den eneste oppretteren', ); /** Low German (Plattdüütsch) @@ -2174,7 +2044,6 @@ $messages['niu'] = array( /** Dutch (Nederlands) * @author SPQRobin * @author Siebrand - * @author Sjoerddebruin * @author Wiki13 */ $messages['nl'] = array( @@ -2203,7 +2072,6 @@ Voer de gebruikersnaam of het IP-adres in voor een lijst van te verwijderen pagi 'nuke-nopages-global' => "Er zijn geen nieuwe pagina's in de [[Special:RecentChanges|recente wijzigingen]].", 'nuke-viewchanges' => 'wijzigingen bekijken', 'nuke-namespace' => 'Beperk tot naamruimte:', - 'nuke-linkoncontribs' => 'massaal verwijderen', ); /** Norwegian Nynorsk (norsk nynorsk) @@ -2221,7 +2089,7 @@ skriv inn ei sletteårsak og trykk på knappen for å sletta dei.', skriv inn ein kommentar og trykk på knappen for å sletta dei.', 'nuke-defaultreason' => 'Massesletting av sider lagde inn av [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', 'nuke-multiplepeople' => 'Massesletting av nyleg oppretta sider', - 'nuke-tools' => 'Dette verktøyet mogeleggjer massesletting av sider som nyleg er lagde inn av ein viss brukar eller ei viss IP-adresse. + 'nuke-tools' => 'Dette verktøyet mogeleggjer massesletting av sider som nyleg er lagde inn av ein viss brukar eller ei viss IP-adresse. Skriv inn eit brukarnamn eller ei IP-adresse for å få ei liste over sider som kan verta sletta, eller lat feltet stå tomt for alle brukarar.', 'nuke-submit-user' => 'Gå', 'nuke-submit-delete' => 'Slett valde', @@ -2252,9 +2120,9 @@ $messages['nso'] = array( $messages['oc'] = array( 'nuke' => 'Supression en massa', 'nuke-desc' => 'Balha la possiblitat als administrators de [[Special:Nuke|suprimir en massa]] de paginas.', - 'nuke-nopages' => 'Cap de pagina novèla pas creada per [[Special:Contributions/$1|{{GENDER:$1|$1}}]] dins la lista dels darrièrs cambiaments.', - 'nuke-list' => 'Las paginas seguentas son estadas creadas recentament per [[Special:Contributions/$1|{{GENDER:$1|$1}}]]; picatz un comentari e clicatz sul boton per los suprimir.', - 'nuke-defaultreason' => 'Supression en massa de las paginas apondudas per [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', + 'nuke-nopages' => 'Cap de pagina novèla creada per [[Special:Contributions/$1|$1]] dins la lista dels darrièrs cambiaments.', # Fuzzy + 'nuke-list' => 'Las paginas seguentas son estadas creadas recentament per [[Special:Contributions/$1|$1]]; Indicatz un comentari e clicatz sul boton per los suprimir.', # Fuzzy + 'nuke-defaultreason' => 'Supression en massa de las paginas apondudas per $1', # Fuzzy 'nuke-tools' => 'Aquesta aisina autoriza las supressions en massa de las paginas apondudas recentament per un utilizaire enregistrat o per una adreça IP. Indicatz l’adreça IP per obténer la lista de las paginas de suprimir, o daissar blanc per totes los utilizaires.', 'nuke-submit-user' => 'Validar', 'nuke-submit-delete' => 'Supression seleccionada', @@ -2306,7 +2174,6 @@ $messages['pdc'] = array( * @author Olgak85 * @author Rezonansowy * @author Sp5uhe - * @author WTM * @author Woytecr */ $messages['pl'] = array( @@ -2335,8 +2202,6 @@ Wpisz nazwę użytkownika lub adres IP, by otrzymać listę stron do usunięcia. 'nuke-nopages-global' => 'Brak nowych stron w [[Special:RecentChanges|ostatnich zmianach]].', 'nuke-viewchanges' => 'widok zmian', 'nuke-namespace' => 'Tylko w przestrzeni nazw:', - 'nuke-linkoncontribs' => 'masowe usuwanie', - 'nuke-linkoncontribs-text' => 'Masowe usuwanie stron, których jedynym autorem jest ten użytkownik', ); /** Piedmontese (Piemontèis) @@ -2380,7 +2245,7 @@ $messages['ps'] = array( 'nuke-multiplepeople' => 'د تازه راگډ شويو مخونو ټول ړنگېدنه', 'nuke-submit-user' => 'ورځه', 'nuke-submit-delete' => 'ټاکل شوی ړنگول', - 'right-nuke' => 'د ډله ايز ړنگون مخونه', + 'right-nuke' => 'د ډله ايز ړنګون مخونه', 'nuke-select' => 'ټاکل: $1', 'nuke-userorip' => 'کارن-نوم، آي پي پته يا تش:', 'nuke-maxpages' => 'د حد اکثر شمېر مخونه:', @@ -2392,7 +2257,6 @@ $messages['ps'] = array( /** Portuguese (português) * @author Hamilton Abreu - * @author Imperadeiro98 * @author Luckas * @author Malafaya * @author 555 @@ -2416,8 +2280,6 @@ introduza um comentário e clique o botão para eliminá-las.', 'nuke-editby' => 'Criada por [[Special:Contributions/$1|$1]]', # Fuzzy 'nuke-deleted' => "A página '''$1''' foi eliminada.", 'nuke-not-deleted' => 'Não foi possível eliminar a página [[:$1]].', - 'nuke-linkoncontribs' => 'eliminação em massa', - 'nuke-linkoncontribs-text' => 'Eliminar em massa páginas em que este utilizador é o único autor', ); /** Brazilian Portuguese (português do Brasil) @@ -2559,7 +2421,6 @@ Mitte 'u nome de l'utende o l'indirizze IP pe avè 'n'elenghe de le pàggene de 'nuke-nopages-global' => "Non ge stonne pàggene nove jndr'à le [[Special:RecentChanges|cangiaminde recende]].", 'nuke-viewchanges' => 'vide le cangiaminde', 'nuke-namespace' => 'Limite a namespace:', - 'nuke-linkoncontribs' => 'scangellazione de masse', ); /** Russian (русский) @@ -2568,7 +2429,6 @@ Mitte 'u nome de l'utende o l'indirizze IP pe avè 'n'elenghe de le pàggene de * @author HalanTul * @author KPu3uC B Poccuu * @author Kaganer - * @author Okras * @author VasilievVV * @author Александр Сигачёв */ @@ -2598,8 +2458,6 @@ $messages['ru'] = array( 'nuke-nopages-global' => 'В [[Special:RecentChanges|недавних изменениях]] нет новых страниц.', 'nuke-viewchanges' => 'Внесённые изменения', 'nuke-namespace' => 'Ограничить пространством имён:', - 'nuke-linkoncontribs' => 'множественное удаление', - 'nuke-linkoncontribs-text' => 'Массово удалить страницы, где этот участник является единственным автором', ); /** Rusyn (русиньскый) @@ -2639,7 +2497,7 @@ $messages['sah'] = array( Соторго быһаарыыта суруйан баран тимэҕи баттаа.', 'nuke-defaultreason' => '$1 кыттааччы айбыт сирэйдэрин бүтүннүү суох оҥоруу', # Fuzzy 'nuke-multiplepeople' => 'элбэх кыттааччы', # Fuzzy - 'nuke-tools' => 'Бу сирэй көмөтүнэн ханнык эмэ кыттааччы оҥорбут көннөрүүлэрин эбэтэр биир IP-ттан оҥоһуллубут көннөрүүлэри бүтүннүү суох гынахха сөп. + 'nuke-tools' => 'Бу сирэй көмөтүнэн ханнык эмэ кыттааччы оҥорбут көннөрүүлэрин эбэтэр биир IP-ттан оҥоһуллубут көннөрүүлэри бүтүннүү суох гынахха сөп. Кыттааччы аатын эбэтэр IP-тын киллэрдэххинэ оҥорбут көннөрүүлэрин тиһигэ тахсыа, кураанах хааллардаххына бары кыттааччылар көннөрүүлэрэ көстүө.', 'nuke-submit-user' => 'Толор', 'nuke-submit-delete' => 'Талыллыбыты сот', @@ -2665,45 +2523,6 @@ $messages['scn'] = array( 'right-nuke' => "Scancella pàggini 'n massa", ); -/** Scots (Scots) - * @author John Reid - */ -$messages['sco'] = array( - 'nuke-linkoncontribs' => 'nuke-delete', - 'nuke-linkoncontribs-text' => 'nuke-delete pages whaur this uiser is the yinly author', -); - -/** Serbo-Croatian (srpskohrvatski / српскохрватски) - * @author Kolega2357 - */ -$messages['sh'] = array( - 'nuke' => 'Masovno brisanje', - 'action-nuke' => 'masovno brisanje stranica', - 'nuke-desc' => 'Daje administratoru mogućnost da [[Special:Nuke|masovno briše]] stranice.', - 'nuke-nopages' => 'Nema novih stranica od strane korisnika [[Special:Contributions/$1|$1]] u skorašnjim izmenama.', - 'nuke-list' => 'Sledeće stranice je skoro napravio korisnik [[Special:Contributions/$1|{{GENDER:$1|$1}}]]; ostavite komentar i pritisnite dugme za njihovo brisanje.', - 'nuke-list-multiple' => 'Sledeće stranice su nedavno napravljenje, ostavite komentar i pritisnite dugme da biste ih obrisali.', - 'nuke-defaultreason' => 'Masovno brisanje stranica koje je napravio korisnik [[Special:Contributions/$1|{{GENDER:$1|$1}}]]', - 'nuke-multiplepeople' => 'Masovno brisanje nedavno dodatih stranica', - 'nuke-tools' => 'Ova alatka omogućava zbirno brisanje stranica koje je nedavno dodao određeni korisnik (sa nalogom ili bez njega). -Unesite korisničko ime ili IP adresu da biste dobili spisak stranica za brisanje, ili ostavite prazno ako želite da se navedu svi korisnici.', - 'nuke-submit-user' => 'Idi', - 'nuke-submit-delete' => 'Obriši izabrano', - 'right-nuke' => 'masovno brisanje stranica', - 'nuke-select' => 'Izaberi: $1', - 'nuke-userorip' => 'Korisničko ime, IP adresa ili prazno:', - 'nuke-maxpages' => 'Najveći broj stranica:', - 'nuke-editby' => 'Napravio [[Special:Contributions/$1|$1]]', - 'nuke-deleted' => "Stranica '''$1''' je obrisana.", - 'nuke-not-deleted' => "'''Ne mogu''' da obrišem stranicu [[:$1]].", - 'nuke-delete-more' => '[[Special:Nuke|Obriši još stranica]]', - 'nuke-pattern' => 'Obrazac za naziv stranice:', - 'nuke-nopages-global' => 'Nema novih stranica u [[Special:RecentChanges|skorašnjim izmenama]].', - 'nuke-viewchanges' => 'pogledaj izmene', - 'nuke-namespace' => 'Ograničenja na imenskim prostorima:', - 'nuke-linkoncontribs' => 'masovno brisanje', -); - /** Sinhala (සිංහල) * @author නන්දිමිතුරු * @author පසිඳු කාවින්ද @@ -2812,9 +2631,6 @@ $messages['sr-ec'] = array( 'nuke-not-deleted' => "'''Не могу''' да обришем страницу [[:$1]].", 'nuke-delete-more' => '[[Special:Nuke|Обриши још страница]]', 'nuke-pattern' => 'Образац за назив странице:', - 'nuke-viewchanges' => 'прикажи измене', - 'nuke-linkoncontribs' => 'масовно брисање', - 'nuke-linkoncontribs-text' => 'Скупно брисање страница чије једини аутор овај корисник', ); /** Serbian (Latin script) (srpski (latinica)‎) @@ -2834,7 +2650,7 @@ $messages['sr-el'] = array( Unesite korisničko ime ili IP adresu da biste dobili spisak stranica za brisanje, ili ostavite prazno ako želite da se navedu svi korisnici.', 'nuke-submit-user' => 'Idi', 'nuke-submit-delete' => 'Obriši obeleženo', - 'right-nuke' => 'masovno brisanje strana', + 'right-nuke' => 'Masovno brisanje strana.', 'nuke-select' => 'Izaberi: $1', 'nuke-userorip' => 'Korisničko ime, IP adresa ili prazno:', 'nuke-maxpages' => 'Najveći broj stranica:', @@ -2843,9 +2659,6 @@ Unesite korisničko ime ili IP adresu da biste dobili spisak stranica za brisanj 'nuke-not-deleted' => "'''Ne mogu''' da obrišem stranicu [[:$1]].", 'nuke-delete-more' => '[[Special:Nuke|Obriši još stranica]]', 'nuke-pattern' => 'Obrazac za naziv stranice:', - 'nuke-viewchanges' => 'prikaži izmene', - 'nuke-linkoncontribs' => 'masovno brisanje', - 'nuke-linkoncontribs-text' => 'Skupno brisanje stranica čije jedini autor ovaj korisnik', ); /** Seeltersk (Seeltersk) @@ -2882,7 +2695,6 @@ tuliskeun pamanggih anjeun, terus pencét tombolna pikeun ngahapus.', # Fuzzy /** Swedish (svenska) * @author Cybjit - * @author Hangsna * @author Lejonel * @author Martinwiss * @author Tobulos1 @@ -2914,8 +2726,6 @@ Ange användarnamnet eller IP-adressen för att se en lista över sidor som kan 'nuke-nopages-global' => 'Det finns inga nya sidor i [[Special:RecentChanges|senaste ändringar]].', 'nuke-viewchanges' => 'visa ändringar', 'nuke-namespace' => 'Begränsa till namnrymd:', - 'nuke-linkoncontribs' => 'massradering', - 'nuke-linkoncontribs-text' => 'Radera alla sidor där användaren är ensam bidragsgivare', ); /** Swahili (Kiswahili) @@ -2945,7 +2755,6 @@ $messages['ta'] = array( ); /** Telugu (తెలుగు) - * @author Ravichandra * @author Veeven */ $messages['te'] = array( @@ -2965,7 +2774,6 @@ $messages['te'] = array( 'nuke-delete-more' => '[[Special:Nuke|మరిన్ని పేజీలను తొలగించండి]]', 'nuke-nopages-global' => '[[Special:RecentChanges|ఇటీవలి మార్పుల]]లో కొత్త పేజీలు ఏమీ లేవు.', 'nuke-viewchanges' => 'మార్పులను చూడండి', - 'nuke-linkoncontribs' => 'మూకుమ్మడి తొలగింపు', ); /** Tetum (tetun) @@ -3102,9 +2910,7 @@ $messages['ug-latn'] = array( /** Ukrainian (українська) * @author AS - * @author Aced * @author Ahonc - * @author Andriykopanytsia * @author Base * @author Dim Grits * @author Microcell @@ -3127,7 +2933,7 @@ $messages['uk'] = array( 'nuke-submit-delete' => 'Вилучити обрані', 'right-nuke' => 'Масове вилучення сторінок', 'nuke-select' => 'Вибір: $1', - 'nuke-userorip' => "Ім'я користувача, IP-адреса (необов'язковий параметр):", + 'nuke-userorip' => "Ім'я користувача, IP-адреса (за бажанням):", 'nuke-maxpages' => 'Максимальна кількість сторінок:', 'nuke-editby' => 'Створено {{GENDER:$1|користувачем|користувачкою}} [[Special:Contributions/$1|$1]]', 'nuke-deleted' => "Сторінка '''$1''' була вилучена.", @@ -3137,8 +2943,6 @@ $messages['uk'] = array( 'nuke-nopages-global' => 'У [[Special:RecentChanges|нових редагуваннях]] немає нових сторінок.', 'nuke-viewchanges' => 'переглянути зміни', 'nuke-namespace' => 'Обмежити за простором назв:', - 'nuke-linkoncontribs' => 'масове вилучення', - 'nuke-linkoncontribs-text' => 'Масове вилучення сторінок, де цей користувач є єдиним автором', ); /** Urdu (اردو) @@ -3207,20 +3011,17 @@ Hãy nhập tên thành viên hoặc địa chỉ IP để lấy danh sách các 'nuke-nopages-global' => 'Không có trang mới trong các [[Special:RecentChanges|thay đổi gần đây]].', 'nuke-viewchanges' => 'xem thay đổi', 'nuke-namespace' => 'Giới hạn theo không gian tên:', - 'nuke-linkoncontribs' => 'xóa hàng loạt', - 'nuke-linkoncontribs-text' => 'Xóa hàng loạt các trang có người dùng này là tác giả duy nhất', ); /** Volapük (Volapük) - * @author Malafaya * @author Smeira */ $messages['vo'] = array( 'nuke' => 'Moükön pademi', 'nuke-desc' => 'Gevon guvanes fägi ad moükön padamödotis', - 'nuke-nopages' => 'Pads nonik fa geban: [[Special:Contributions/$1|{{GENDER:$1|$1}}]] pejaföls binons su lised votükamas nulik.', - 'nuke-list' => 'Pads sököl pejafons brefabüo fa geban: [[Special:Contributions/$1|{{GENDER:$1|$1}}]]; penolös küpeti e klikolös gnobi ad moükön onis.', - 'nuke-defaultreason' => 'Moükam masifik padas fa [[Special:Contributions/$1|{{GENDER:$1|$1}}]] pejafölas', + 'nuke-nopages' => 'Pads nonik fa geban: [[Special:Contributions/$1|$1]] pejaföls binons su lised votükamas nulik.', # Fuzzy + 'nuke-list' => 'Pads sököl pejafons brefabüo fa geban: [[Special:Contributions/$1|$1]]; penolös küpeti e klikolös gnobi ad moükön onis.', # Fuzzy + 'nuke-defaultreason' => 'Moükam padas fa geban: $1 pejafölas', # Fuzzy 'nuke-tools' => 'Stum at kanon moükön mödoti padas fa geban u ladet-IP semik brefabüo pejafölas. Penolös gebananemi u ladeti-IP ad dagetön lisedi padas moükovik:', # Fuzzy 'nuke-submit-user' => 'Ledunolöd', 'nuke-submit-delete' => 'Pevalöl ad pamoükön', @@ -3267,8 +3068,8 @@ $messages['zh-hans'] = array( 'action-nuke' => '删除大量页面', 'nuke-desc' => '让管理员可以[[Special:Nuke|批量删除]]页面', 'nuke-nopages' => '在最近更改中没有[[Special:Contributions/$1|{{GENDER:$1|$1}}]]创建的新页面。', - 'nuke-list' => '以下为[[Special:Contributions/$1|{{GENDER:$1|$1}}]]最近创建的页面,请填写注释再点击按钮删除它们。', - 'nuke-list-multiple' => '以下为最近创建的页面,请填写注释再点击按钮删除它们。', + 'nuke-list' => '以下为[[Special:Contributions/$1|{{GENDER:$1|$1}}]]最近创建的页面,请填写注释并点击按钮删除它们。', + 'nuke-list-multiple' => '以下为最近创建的页面,请填写注释并点击按钮删除它们。', 'nuke-defaultreason' => '大量删除[[Special:Contributions/$1|{{GENDER:$1|$1}}]]创建的页面', 'nuke-multiplepeople' => '大量删除最近添加的页面', 'nuke-tools' => '此工具允许大量删除指定用户或IP地址在最近创建的页面。输入用户名或IP地址可获取可删除页面列表,留白则检索所有用户。', @@ -3277,7 +3078,7 @@ $messages['zh-hans'] = array( 'right-nuke' => '删除大量页面', 'nuke-select' => '选择:$1', 'nuke-userorip' => '用户名、IP地址或空白:', - 'nuke-maxpages' => '最大页面数:', + 'nuke-maxpages' => '最多页面数:', 'nuke-editby' => '由[[Special:Contributions/$1|{{GENDER:$1|$1}}]]创建', 'nuke-deleted' => "已删除页面'''$1'''。", 'nuke-not-deleted' => "'''无法'''删除[[:$1]]页面。", @@ -3286,8 +3087,6 @@ $messages['zh-hans'] = array( 'nuke-nopages-global' => '[[Special:RecentChanges|最近更改]]中没有新的页面。', 'nuke-viewchanges' => '查看变更', 'nuke-namespace' => '限制名字空间为:', - 'nuke-linkoncontribs' => '大量删除', - 'nuke-linkoncontribs-text' => '大量删除仅此用户为作者的页面', ); /** Traditional Chinese (中文(繁體)‎) @@ -3295,7 +3094,6 @@ $messages['zh-hans'] = array( * @author Cwlin0416 * @author Justincheng12345 * @author Liangent - * @author Liuxinyu970226 * @author Mark85296341 * @author Shinjiman */ @@ -3323,6 +3121,4 @@ $messages['zh-hant'] = array( 'nuke-nopages-global' => '[[Special:RecentChanges|最近更改]]中沒有新的頁面。', 'nuke-viewchanges' => '查看變更', 'nuke-namespace' => '限制名字空間為:', - 'nuke-linkoncontribs' => '大量刪除', - 'nuke-linkoncontribs-text' => '大量刪除僅此用戶創建之頁面', ); diff --git a/extensions/Nuke/Nuke.php b/extensions/Nuke/Nuke.php index e10ce422..80a41631 100644 --- a/extensions/Nuke/Nuke.php +++ b/extensions/Nuke/Nuke.php @@ -4,7 +4,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { die( 'Not an entry point.' ); } -define( 'Nuke_VERSION', '1.1.8' ); +define( 'Nuke_VERSION', '1.1.7' ); $dir = dirname( __FILE__ ) . '/'; @@ -24,12 +24,9 @@ $wgGroupPermissions['sysop']['nuke'] = true; $wgAvailableRights[] = 'nuke'; $wgAutoloadClasses['SpecialNuke'] = $dir . 'Nuke_body.php'; -$wgAutoloadClasses['NukeHooks'] = $dir . 'Nuke.hooks.php'; $wgSpecialPages['Nuke'] = 'SpecialNuke'; $wgSpecialPageGroups['Nuke'] = 'pagetools'; -$wgHooks['ContributionsToolLinks'][] = 'NukeHooks::nukeContributionsLinks'; - // Resource loader modules $moduleTemplate = array( 'localBasePath' => dirname( __FILE__ ) . '/', diff --git a/extensions/ParserFunctions/.gitreview b/extensions/ParserFunctions/.gitreview deleted file mode 100644 index decb9867..00000000 --- a/extensions/ParserFunctions/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/ParserFunctions.git -defaultbranch=master diff --git a/extensions/ParserFunctions/ParserFunctions.i18n.magic.php b/extensions/ParserFunctions/ParserFunctions.i18n.magic.php index e92ffe12..5d26cb71 100644 --- a/extensions/ParserFunctions/ParserFunctions.i18n.magic.php +++ b/extensions/ParserFunctions/ParserFunctions.i18n.magic.php @@ -58,26 +58,25 @@ $magicWords['ar'] = array( /** Egyptian Spoken Arabic (مصرى) */ $magicWords['arz'] = array( - 'expr' => array( 0, 'تعبير' ), - 'if' => array( 0, 'لو' ), - 'ifeq' => array( 0, 'لومعادلة' ), - 'ifexpr' => array( 0, 'لوتعبير' ), - 'iferror' => array( 0, 'لوخطأ' ), - 'switch' => array( 0, 'تبديل' ), - 'default' => array( 0, '#افتراضي' ), - 'ifexist' => array( 0, 'لوموجود' ), - 'time' => array( 0, 'وقت' ), - 'timel' => array( 0, 'تيمل' ), - 'rel2abs' => array( 0, 'ريلتوآبس' ), - 'titleparts' => array( 0, 'أجزاء_العنوان' ), - 'len' => array( 0, 'لين' ), - 'pos' => array( 0, 'بوس' ), - 'rpos' => array( 0, 'آربوس' ), - 'sub' => array( 0, 'متفرع' ), - 'count' => array( 0, 'عدد' ), - 'replace' => array( 0, 'استبدال' ), - 'explode' => array( 0, 'انفجار' ), - 'urldecode' => array( 0, 'فك_مسار' ), + 'expr' => array( 0, 'تعبير', 'expr' ), + 'if' => array( 0, 'لو', 'if' ), + 'ifeq' => array( 0, 'لومعادلة', 'ifeq' ), + 'ifexpr' => array( 0, 'لوتعبير', 'ifexpr' ), + 'iferror' => array( 0, 'لوخطأ', 'iferror' ), + 'switch' => array( 0, 'تبديل', 'switch' ), + 'default' => array( 0, '#افتراضي', '#default' ), + 'ifexist' => array( 0, 'لوموجود', 'ifexist' ), + 'time' => array( 0, 'وقت', 'time' ), + 'timel' => array( 0, 'تيمل', 'timel' ), + 'rel2abs' => array( 0, 'ريلتوآبس', 'rel2abs' ), + 'titleparts' => array( 0, 'أجزاء_العنوان', 'titleparts' ), + 'len' => array( 0, 'لين', 'len' ), + 'pos' => array( 0, 'بوس', 'pos' ), + 'rpos' => array( 0, 'آربوس', 'rpos' ), + 'sub' => array( 0, 'متفرع', 'sub' ), + 'count' => array( 0, 'عدد', 'count' ), + 'replace' => array( 0, 'استبدال', 'replace' ), + 'explode' => array( 0, 'انفجار', 'explode' ), ); /** South Azerbaijani (تورکجه) */ @@ -101,7 +100,7 @@ $magicWords['ce'] = array( 'replace' => array( 0, 'хийцарна', 'замена' ), ); -/** Czech (čeština) */ +/** Czech (česky) */ $magicWords['cs'] = array( 'expr' => array( 0, 'výraz' ), 'if' => array( 0, 'když' ), @@ -123,15 +122,8 @@ $magicWords['de'] = array( /** Zazaki (Zazaki) */ $magicWords['diq'] = array( - 'expr' => array( 0, 'ifade' ), 'if' => array( 0, 'se' ), 'ifeq' => array( 0, 'sek' ), - 'ifexpr' => array( 0, 'ifadeyose' ), - 'iferror' => array( 0, 'çınyose' ), - 'time' => array( 0, 'zeman' ), - 'sub' => array( 0, 'bın' ), - 'count' => array( 0, 'hesabk' ), - 'replace' => array( 0, 'vırnayen' ), ); /** Esperanto (Esperanto) */ @@ -153,14 +145,12 @@ $magicWords['eo'] = array( /** Spanish (español) */ $magicWords['es'] = array( 'if' => array( 0, 'si' ), - 'ifeq' => array( 0, 'siigual' ), 'ifexpr' => array( 0, 'siexpr' ), 'iferror' => array( 0, 'sierror' ), 'switch' => array( 0, 'según' ), 'default' => array( 0, '#predeterminado' ), 'ifexist' => array( 0, 'siexiste' ), 'time' => array( 0, 'tiempo' ), - 'timel' => array( 0, 'tiempol' ), 'len' => array( 0, 'long', 'longitud' ), 'replace' => array( 0, 'reemplazar' ), 'explode' => array( 0, 'separar' ), @@ -303,7 +293,7 @@ $magicWords['ja'] = array( 'count' => array( 0, '回数' ), 'replace' => array( 0, '置き換え' ), 'explode' => array( 0, '分割' ), - 'urldecode' => array( 0, 'URLデコード', 'URLデコード' ), + 'urldecode' => array( 0, 'URLデコード' ), ); /** Korean (한국어) */ @@ -385,7 +375,7 @@ $magicWords['mk'] = array( $magicWords['ml'] = array( 'expr' => array( 0, 'ദ്യോതകം' ), 'if' => array( 0, 'എങ്കിൽ' ), - 'ifeq' => array( 0, 'സമമെങ്കിൽ' ), + 'ifeq' => array( 0, 'സമെമെങ്കിൽ' ), 'ifexpr' => array( 0, 'എക്സ്പ്രെഷനെങ്കിൽ' ), 'iferror' => array( 0, 'പിഴവെങ്കിൽ' ), 'switch' => array( 0, 'മാറ്റുക' ), @@ -590,22 +580,22 @@ $magicWords['uz'] = array( /** Vietnamese (Tiếng Việt) */ $magicWords['vi'] = array( - 'expr' => array( 0, 'công_thức', 'côngthức' ), + 'expr' => array( 0, 'côngthức' ), 'if' => array( 0, 'nếu' ), - 'ifeq' => array( 0, 'nếu_bằng', 'nếubằng' ), - 'ifexpr' => array( 0, 'nếu_công_thức', 'nếucôngthức' ), - 'iferror' => array( 0, 'nếu_lỗi', 'nếulỗi' ), - 'default' => array( 0, '#mặc_định', '#mặcđịnh' ), - 'ifexist' => array( 0, 'nếu_tồn_tại', 'nếutồntại' ), + 'ifeq' => array( 0, 'nếubằng' ), + 'ifexpr' => array( 0, 'nếucôngthức' ), + 'iferror' => array( 0, 'nếulỗi' ), + 'default' => array( 0, '#mặcđịnh' ), + 'ifexist' => array( 0, 'nếutồntại' ), 'time' => array( 0, 'giờ' ), - 'timel' => array( 0, 'giờ_địa_phương', 'giờđịaphương' ), - 'len' => array( 0, 'số_chữ', 'sốchữ', 'số_ký_tự', 'sốkýtự', 'số_kí_tự', 'sốkítự' ), - 'pos' => array( 0, 'vị_trí', 'vịtrí' ), - 'rpos' => array( 0, 'vị_trí_phải', 'vịtríphải' ), - 'sub' => array( 0, 'chuỗi_con', 'chuỗicon' ), + 'timel' => array( 0, 'giờđịaphương' ), + 'len' => array( 0, 'sốchữ', 'sốkýtự', 'sốkítự' ), + 'pos' => array( 0, 'vịtrí' ), + 'rpos' => array( 0, 'vịtríphải' ), + 'sub' => array( 0, 'chuỗicon' ), 'count' => array( 0, 'số' ), - 'replace' => array( 0, 'thay_thế', 'thaythế' ), - 'urldecode' => array( 0, 'giải_mã_url', 'giảimãurl' ), + 'replace' => array( 0, 'thaythế' ), + 'urldecode' => array( 0, 'giảimãurl' ), ); /** Yiddish (ייִדיש) */ @@ -642,22 +632,7 @@ $magicWords['zh'] = array( /** Simplified Chinese (中文(简体)‎) */ $magicWords['zh-hans'] = array( - 'if' => array( 0, '若' ), 'ifeq' => array( 0, '若相等', '如果相等' ), - 'iferror' => array( 0, '如果错误' ), - 'switch' => array( 0, '开关' ), 'default' => array( 0, '#默认' ), 'ifexist' => array( 0, '若有', '如果存在' ), - 'time' => array( 0, '时间' ), - 'pos' => array( 0, '终端' ), - 'rpos' => array( 0, '反终端' ), - 'sub' => array( 0, 'PF子' ), - 'count' => array( 0, '计数' ), -); - -/** Traditional Chinese (中文(繁體)‎) */ -$magicWords['zh-hant'] = array( - 'if' => array( 0, '若' ), - 'time' => array( 0, '時間' ), - 'timel' => array( 0, '時間L' ), ); \ No newline at end of file diff --git a/extensions/ParserFunctions/ParserFunctions.i18n.php b/extensions/ParserFunctions/ParserFunctions.i18n.php index f61310b2..e026b693 100644 --- a/extensions/ParserFunctions/ParserFunctions.i18n.php +++ b/extensions/ParserFunctions/ParserFunctions.i18n.php @@ -177,7 +177,6 @@ $messages['an'] = array( /** Arabic (العربية) * @author Aiman titi - * @author Asaifm * @author Meno25 */ $messages['ar'] = array( @@ -185,7 +184,6 @@ $messages['ar'] = array( 'pfunc_time_error' => 'خطأ: زمن غير صحيح', 'pfunc_time_too_long' => 'خطأ: استدعاءات #time كثيرة جدا', 'pfunc_time_too_big' => 'خطأ : # الوقت يدعم فقط حتى 9999 سنة', - 'pfunc_time_too_small' => 'خطأ: #time تدعم الأعوام بدءاً من 0.', 'pfunc_rel2abs_invalid_depth' => 'خطأ: عمق غير صحيح في المسار: "$1" (حاول دخول عقدة فوق العقدة الجذرية)', 'pfunc_expr_stack_exhausted' => 'خطأ في التعبير: ستاك مجهد', 'pfunc_expr_unexpected_number' => 'خطأ في التعبير: رقم غير متوقع', @@ -239,7 +237,6 @@ $messages['arz'] = array( /** Assamese (অসমীয়া) * @author Bishnu Saikia - * @author Gitartha.bordoloi * @author Rajuonline */ $messages['as'] = array( @@ -257,7 +254,7 @@ $messages['as'] = array( 'pfunc_expr_unexpected_closing_bracket' => 'এক্সপ্ৰেছন ত্ৰুটী: অবাঞ্চিত সমাপ্তকাৰী বন্ধনী', 'pfunc_expr_unrecognised_punctuation' => 'এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "$1"', 'pfunc_expr_unclosed_bracket' => 'এক্সপ্ৰেছন ত্ৰুটী: উন্মুক্ত বন্ধনী', - 'pfunc_expr_division_by_zero' => 'শূন্যৰে হৰণ কৰা হৈছে।', + 'pfunc_expr_division_by_zero' => 'শূন্যৰ দ্বাৰা হৰণ কৰা হৈছে', 'pfunc_expr_invalid_argument' => '$1 ৰ বাবে ভুল চৰ্ত: < -1 অথবা > 1', 'pfunc_expr_invalid_argument_ln' => 'ln ৰ বাবে অমান্য চৰ্ত: <= 0', 'pfunc_expr_unknown_error' => 'এক্সপ্ৰেছন ত্ৰুটী: : অজ্ঞাত ত্ৰুটী ($1)', @@ -548,16 +545,14 @@ $messages['ca'] = array( * @author Умар */ $messages['ce'] = array( - 'pfunc_desc' => 'Дика тайина маьӀнийн функцешца анализатор', 'pfunc_time_error' => 'Гlалато: хан нийса яц', 'pfunc_expr_stack_exhausted' => 'Яздарехь гlалат ду: хьаладуьззина татол', 'pfunc_expr_unrecognised_word' => 'Яздарехь гlалат ду: дойзуш доцу дош «$1»', - 'pfunc_expr_unexpected_operator' => 'Дешнийн гӀалат: ца хаа оператор $1', + 'pfunc_expr_unexpected_operator' => 'Дешнийн гӀалам : ца хаа оператор $1', 'pfunc_expr_unrecognised_punctuation' => 'Дешнашан гӀалат: евзина йоцу пунктуацин символ «$1»', - 'pfunc_expr_unknown_error' => 'Дешнийн гӀалат: ца хаа гӀалат ($1)', ); -/** Czech (čeština) +/** Czech (česky) * @author Danny B. * @author Li-sung * @author Matěj Grabovský @@ -569,7 +564,6 @@ $messages['cs'] = array( 'pfunc_time_error' => 'Chyba: neplatný čas', 'pfunc_time_too_long' => 'Chyba: příliš mnoho volání #time', 'pfunc_time_too_big' => 'Chyba: #time nepodporuje roky nad 9999', - 'pfunc_time_too_small' => 'Chyba: #time nepodporuje roky menší než 0.', 'pfunc_rel2abs_invalid_depth' => 'Chyba: Neplatná hloubka v cestě: "$1" (pokus o přístup do uzlu vyššího než kořen)', 'pfunc_expr_stack_exhausted' => 'Chyba ve výrazu: Zásobník plně obsazen', 'pfunc_expr_unexpected_number' => 'Chyba ve výrazu: Očekáváno číslo', @@ -637,13 +631,12 @@ $messages['da'] = array( * @author Kghbln * @author LWChris * @author Metalhead64 - * @author Purodha * @author Raimond Spekking * @author Rentenirer * @author Rillke */ $messages['de'] = array( - 'pfunc_desc' => 'Erweitert den Parser um logische Funktionen', + 'pfunc_desc' => 'Ergänzt den Parser um logische Funktionen', 'pfunc_time_error' => 'Fehler: Ungültige Zeitangabe', 'pfunc_time_too_long' => 'Fehler: Zu viele #time-Aufrufe', 'pfunc_time_too_big' => 'Fehler: #time unterstützt nur Jahre bis 9999', @@ -709,8 +702,6 @@ $messages['dsb'] = array( 'pfunc_desc' => 'Rozšyrja parser wó logiske funkcije', 'pfunc_time_error' => 'Zmólka: njepłaśiwy cas', 'pfunc_time_too_long' => 'Zmólka: pśewjele zawołanjow #time', - 'pfunc_time_too_big' => 'Zmólka: #time pódpěra jano lěta až do 9999.', - 'pfunc_time_too_small' => 'Zmólka: #time pódpěra jano lěta wót 0.', 'pfunc_rel2abs_invalid_depth' => 'Zmólka: Njepłaśiwy dłym w sćažce: "$1" (wopyt na suk pśistup měś, kótaryž jo wušej kórjenjowego suka)', 'pfunc_expr_stack_exhausted' => 'Wurazowa zmólka: Stack wupócerany', 'pfunc_expr_unexpected_number' => 'Wurazowa zmólka: Njewócakana licba', @@ -832,10 +823,7 @@ $messages['et'] = array( 'pfunc_time_error' => 'Tõrge: Vigane aeg', 'pfunc_time_too_long' => 'Tõrge: Liiga palju #time-kutseid.', 'pfunc_time_too_big' => 'Tõrge: #time toetab vaid aastaid kuni väärtuseni 9999.', - 'pfunc_time_too_small' => 'Tõrge: #time toetab aastaid alates 0-st.', - 'pfunc_rel2abs_invalid_depth' => 'Tõrge: Vigane tee pikkus: "$1" (üritati pöörduda juursõlmest kõrgema sõlme poole).', 'pfunc_expr_unexpected_number' => 'Avaldistõrge: Ootamatu number', - 'pfunc_expr_preg_match_failure' => 'Avaldistõrge: preg_match nurjus ootamatult.', 'pfunc_expr_unrecognised_word' => 'Avaldistõrge: Tundmatu sõna "$1"', 'pfunc_expr_unexpected_operator' => 'Avaldistõrge: Ootamatu $1-tehtemärk', 'pfunc_expr_missing_operand' => 'Avaldistõrge: Puudub $1-tehte operand', @@ -1147,7 +1135,6 @@ $messages['hsb'] = array( 'pfunc_time_error' => 'Zmylk: njepłaćiwe časowe podaće', 'pfunc_time_too_long' => 'Zmylk: přewjele zawołanjow #time', 'pfunc_time_too_big' => 'Zmylk: #time jenož lěta hač do 9999 podpěruje.', - 'pfunc_time_too_small' => 'Zmylk: #time jenož lěta wot 0 podpěruje.', 'pfunc_rel2abs_invalid_depth' => 'Zmylk: Njepłaćiwa hłubokosć w pućiku: "$1" (Pospyt, zo by na suk wyše hłowneho suka dohrabnyło)', 'pfunc_expr_stack_exhausted' => 'Wurazowy zmylk: Staplowy skład wučerpany', 'pfunc_expr_unexpected_number' => 'Wurazowy zmylk: Njewočakowana ličba', @@ -1200,7 +1187,6 @@ $messages['ia'] = array( 'pfunc_time_error' => 'Error: tempore invalide', 'pfunc_time_too_long' => 'Error: troppo de appellos a #time', 'pfunc_time_too_big' => 'Error: #time supporta solmente annos usque a 9999', - 'pfunc_time_too_small' => 'Error: #time supporta solmente annos desde 0.', 'pfunc_rel2abs_invalid_depth' => 'Error: Profunditate invalide in cammino: "$1" (essayava acceder a un nodo superior al radice)', 'pfunc_expr_stack_exhausted' => 'Error in expression: Pila exhaurite', 'pfunc_expr_unexpected_number' => 'Error in expression: Numero non expectate', @@ -1247,33 +1233,6 @@ $messages['id'] = array( 'pfunc_string_too_long' => 'Kesalahan: String melebihi limit $1 karakter', ); -/** Iloko (Ilokano) - * @author Lam-ang - */ -$messages['ilo'] = array( - 'pfunc_desc' => 'Napasayaat a parser nga adda kadagiti lohikal nga annong', - 'pfunc_time_error' => 'Biddut: Imbalido nga oras.', - 'pfunc_time_too_long' => 'Biddut: Adu unay dagiti panagtawag ti #time.', - 'pfunc_time_too_big' => 'Biddut: Ti #time ket suportaranna laeng dagiti tawen aginggana iti 9999.', - 'pfunc_time_too_small' => 'Biddut: ti #time ket suportaranna laeng dagiti tawen manipud ti 0.', - 'pfunc_rel2abs_invalid_depth' => 'Biddut: Imbalido a kauneg iti dalan: "$1" (nagpadas a nangserrek ti nodo iti ngato ti ramut a nodo).', - 'pfunc_expr_stack_exhausted' => 'Biddut a panangiyebkas: Naibusen ti tuon.', - 'pfunc_expr_unexpected_number' => 'Biddut a panangiyebkas:Di nanamnama a bilang.', - 'pfunc_expr_preg_match_failure' => 'Biddut a panangiyebkas: Di nanamnama a pannakapaay ti preg_match.', - 'pfunc_expr_unrecognised_word' => 'Biddut a panangiyebkas: Di mabigbigan a balikas ti "$1".', - 'pfunc_expr_unexpected_operator' => 'Biddut a panangiyebkas: Di nanamnama nga operator ti $1.', - 'pfunc_expr_missing_operand' => 'Biddut a panangiyebkas: Napukaw nga operand para iti $1.', - 'pfunc_expr_unexpected_closing_bracket' => 'Biddut a panangiyebkas: Di nanamnama a pangrikep a braket.', - 'pfunc_expr_unrecognised_punctuation' => 'Biddut a panangiyebkas: Di nanamnama a karakter ti tuldek ti "$1".', - 'pfunc_expr_unclosed_bracket' => 'Biddut a panangiyebkas: Di narikpan a braket.', - 'pfunc_expr_division_by_zero' => 'Panagbingbingay babaen ti sero.', - 'pfunc_expr_invalid_argument' => 'Imbalido nga argumento para iti $1: < -1 wenno > 1.', - 'pfunc_expr_invalid_argument_ln' => 'Imbalido nga argumento para iti ln: <= 0.', - 'pfunc_expr_unknown_error' => 'Biddut a panangiyebkas: Di ammo a biddut ($1).', - 'pfunc_expr_not_a_number' => 'Iti $1: Ti resulta ket saan a bilang.', - 'pfunc_string_too_long' => 'Biddut: Ti kuerdas ket nasurokanna ti limitado ti karakter iti $1.', -); - /** Ido (Ido) * @author Malafaya */ @@ -1282,28 +1241,6 @@ $messages['io'] = array( 'pfunc_expr_division_by_zero' => 'Divido per zero', ); -/** Icelandic (íslenska) - * @author Snævar - */ -$messages['is'] = array( - 'pfunc_time_error' => 'Villa: Ógildur tími.', - 'pfunc_time_too_long' => 'Villa: Of mörg köll til #time.', - 'pfunc_time_too_big' => 'Villa: #time styður aðeins ár upp til 9999.', - 'pfunc_time_too_small' => 'Villa: #time styður aðeins ár frá 0.', - 'pfunc_expr_unexpected_number' => 'Villa í segð: Óvænt tala.', - 'pfunc_expr_unrecognised_word' => 'Villa í segð: Óþekkt orð „$1”.', - 'pfunc_expr_unexpected_operator' => 'Villa í segð: Óvæntur $1 virki.', - 'pfunc_expr_missing_operand' => 'Villa í segð: Vantar þolanda fyrir $1.', - 'pfunc_expr_unrecognised_punctuation' => 'Villa í segð: Óþekkt greinarmerki „$1”.', - 'pfunc_expr_unclosed_bracket' => 'Villa í segð: Ólokaður svigi.', - 'pfunc_expr_division_by_zero' => 'Deiling með núlli.', - 'pfunc_expr_invalid_argument' => 'Ógilt frumgildi fyrir $1: < -1 eða > 1.', - 'pfunc_expr_invalid_argument_ln' => 'Ógilt frumgildi fyrir ln: <= 0.', - 'pfunc_expr_unknown_error' => 'Villa í segð: Óþekkt villa ($1).', - 'pfunc_expr_not_a_number' => 'Niðurstaðan úr $1 er ekki tala.', - 'pfunc_string_too_long' => 'Villa: Strengurinn er lengri en hámarkslengdin $1 segir til um.', -); - /** Italian (italiano) * @author Beta16 * @author BrokenArrow @@ -1557,7 +1494,6 @@ $messages['lb'] = array( 'pfunc_time_error' => 'Feeler: ongëlteg Zäit', 'pfunc_time_too_long' => 'Feeler: ze dacks #time opgeruff', 'pfunc_time_too_big' => 'Feeler: #time ënnerstëtzt nëmme Jore bis 9999', - 'pfunc_time_too_small' => 'Feeler: #time ënnerstëtzt nëmme Jore vun 0 un.', 'pfunc_expr_stack_exhausted' => 'Expressiouns-Feeler: Stack iwwergelaf', 'pfunc_expr_unexpected_number' => 'Expressiouns-Feeler: Onerwarten Zuel', 'pfunc_expr_unrecognised_word' => 'Expressiouns-Feeler: Onerkantent Wuert "$1"', @@ -1600,13 +1536,6 @@ $messages['li'] = array( 'pfunc_string_too_long' => 'Fout: De teks is lenger es de limiet van $1 {{PLURAL:$1|teike|teikes}}', ); -/** لوری (لوری) - * @author Bonevarluri - */ -$messages['lrc'] = array( - 'pfunc_time_error' => 'خطا:وخت نامعتور.', -); - /** Lithuanian (lietuvių) * @author Hugo.arg */ @@ -1635,7 +1564,7 @@ $messages['min'] = array( * @author Brest */ $messages['mk'] = array( - 'pfunc_desc' => 'Проширување на можностите на расчленувачот со логички функции', + 'pfunc_desc' => 'Проширување на можностите на парсерот со логички функции', 'pfunc_time_error' => 'Грешка: погрешен формат за време', 'pfunc_time_too_long' => 'Грешка: премногу повикувања на функцијата #time', 'pfunc_time_too_big' => 'Грешка: #time поддржува само години до 9999', @@ -1834,7 +1763,7 @@ $messages['nl'] = array( 'pfunc_expr_preg_match_failure' => 'Fout in uitdrukking: onverwacht falen van preg_match.', 'pfunc_expr_unrecognised_word' => 'Fout in uitdrukking: woord "$1" niet herkend.', 'pfunc_expr_unexpected_operator' => 'Fout in uitdrukking: niet verwachte operator $1.', - 'pfunc_expr_missing_operand' => 'Fout in uitdrukking: operand voor $1 ontbreekt.', + 'pfunc_expr_missing_operand' => 'Fout in uitdrukking: operand voor $1 mist.', 'pfunc_expr_unexpected_closing_bracket' => 'Fout in uitdrukking: haakje sluiten op onverwachte plaats.', 'pfunc_expr_unrecognised_punctuation' => 'Fout in uitdrukking: niet herkend leesteken "$1".', 'pfunc_expr_unclosed_bracket' => 'Fout in uitdrukking: niet gesloten haakje openen.', @@ -1969,7 +1898,6 @@ $messages['pms'] = array( 'pfunc_time_error' => 'Eror: temp nen bon', 'pfunc_time_too_long' => 'Eror: #time a ven ciamà tròpe vire', 'pfunc_time_too_big' => "Eror: #time a përmët mach j'agn fin al 9999.", - 'pfunc_time_too_small' => "Eror: #time a përmet j'agn mach da 0.", 'pfunc_rel2abs_invalid_depth' => 'Eror: profondità nen bon-a ant ël përcors: "$1" (a l\'é provasse a ciamé un grop dzora a la rèis)', 'pfunc_expr_stack_exhausted' => "Eror ëd l'espression: stach esaurìa", 'pfunc_expr_unexpected_number' => "Eror ëd l'espression: nùmer pa spetà", @@ -2013,8 +1941,7 @@ $messages['pt'] = array( 'pfunc_desc' => 'Melhora o analisador sintático com funções lógicas', 'pfunc_time_error' => 'Erro: tempo inválido', 'pfunc_time_too_long' => 'Erro: demasiadas chamadas a #time', - 'pfunc_time_too_big' => 'Erro: #time só permite anos até 9999', - 'pfunc_time_too_small' => 'Erro: #time só permite anos a partir de 0.', + 'pfunc_time_too_big' => 'Erro: #time só lida com anos até 9999', 'pfunc_rel2abs_invalid_depth' => 'Erro: Profundidade inválida no caminho: "$1" (foi tentado o acesso a um nó acima do nó raiz)', 'pfunc_expr_stack_exhausted' => 'Erro de expressão: Pilha esgotada', 'pfunc_expr_unexpected_number' => 'Erro de expressão: Número inesperado', @@ -2249,15 +2176,6 @@ $messages['scn'] = array( 'pfunc_string_too_long' => 'Erruri: la stringa supira lu limiti di $1 carattiri', ); -/** Serbo-Croatian (srpskohrvatski / српскохрватски) - * @author Kolega2357 - */ -$messages['sh'] = array( - 'pfunc_time_error' => 'Greška: pogrešno vreme', - 'pfunc_time_too_long' => 'Greška: previše pozivanja funkcije #time', - 'pfunc_rel2abs_invalid_depth' => 'Greška: Nepravilna dubina u putanji: "$1"', -); - /** Sinhala (සිංහල) * @author Budhajeewa * @author නන්දිමිතුරු @@ -2461,7 +2379,6 @@ $messages['sv'] = array( 'pfunc_time_error' => 'Fel: ogiltig tid', 'pfunc_time_too_long' => 'Fel: för många anrop av #time', 'pfunc_time_too_big' => 'Fel: # tid stöder endast år fram till 9999', - 'pfunc_time_too_small' => 'Fel: #tid stödjer enbart år från 0.', 'pfunc_rel2abs_invalid_depth' => 'Fel: felaktig djup i sökväg: "$1" (försöker nå en nod ovanför rotnoden)', 'pfunc_expr_stack_exhausted' => 'Fel i uttryck: Stackutrymmet tog slut', 'pfunc_expr_unexpected_number' => 'Fel i uttryck: Oväntat tal', diff --git a/extensions/ParserFunctions/ParserFunctions.php b/extensions/ParserFunctions/ParserFunctions.php index 99c8444c..4ef62047 100644 --- a/extensions/ParserFunctions/ParserFunctions.php +++ b/extensions/ParserFunctions/ParserFunctions.php @@ -25,20 +25,10 @@ $wgPFStringLengthLimit = 1000; * * WARNING: enabling this may have an adverse impact on the sanity of your users. * An alternative, saner solution for embedding complex text processing in - * MediaWiki templates can be found at: http://www.mediawiki.org/wiki/Extension:Scribunto + * MediaWiki templates can be found at: http://www.mediawiki.org/wiki/Extension:Lua */ $wgPFEnableStringFunctions = false; -/** - * Enable string functions, when running Wikimedia Jenkins unit tests. - * - * Running Jenkins unit tests without setting $wgPFEnableStringFunctions = true; - * will cause all the parser tests for string functions to be skipped. - */ -if ( isset( $wgWikimediaJenkinsCI ) && ( $wgWikimediaJenkinsCI === true ) ) { - $wgPFEnableStringFunctions = true ; -} - /** REGISTRATION */ $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, diff --git a/extensions/ParserFunctions/ParserFunctions_body.php b/extensions/ParserFunctions/ParserFunctions_body.php index e4ede065..3567cc58 100644 --- a/extensions/ParserFunctions/ParserFunctions_body.php +++ b/extensions/ParserFunctions/ParserFunctions_body.php @@ -669,7 +669,7 @@ class ExtParserFunctions { } if ( intval( $inLength ) == 0 ) { - $result = mb_substr( $inStr, intval( $inStart ) ); + $result = mb_substr( $inStr, $inStart ); } else { $result = mb_substr( $inStr, intval( $inStart ), intval( $inLength ) ); } diff --git a/extensions/ParserFunctions/tests/ExpressionTest.php b/extensions/ParserFunctions/tests/ExpressionTest.php deleted file mode 100644 index 169a9cb4..00000000 --- a/extensions/ParserFunctions/tests/ExpressionTest.php +++ /dev/null @@ -1,76 +0,0 @@ -parser = new ExprParser(); - } - - /** - * @dataProvider provideExpressions - */ - function testExpression( $input, $expected ) { - $this->assertEquals( - $expected, - $this->parser->doExpression( $input ) - ); - } - - function provideExpressions() { - return array( - array( '1 or 0', '1' ), - array( 'not (1 and 0)', '1' ), - array( 'not 0', '1' ), - array( '4 < 5', '1' ), - array( '-5 < 2', '1' ), - array( '-2 <= -2', '1' ), - array( '4 > 3', '1' ), - array( '4 > -3', '1' ), - array( '5 >= 2', '1' ), - array( '2 >= 2', '1' ), - array( '1 != 2', '1' ), - array( '-4 * -4 = 4 * 4', '1' ), - array( 'not (1 != 1)', '1' ), - array( '1 + 1', '2' ), - array( '-1 + 1', '0' ), - array( '+1 + 1', '2' ), - array( '4 * 4', '16' ), - array( '(1/3) * 3', '1' ), - array( '3 / 1.5', '2' ), - array( '3 / 0.2', '15' ), - array( '3 / ( 2.0 * 0.1 )', '15' ), - array( '3 / ( 2.0 / 10 )', '15' ), - array( '3 / (- 0.2 )', '-15' ), - array( '3 / abs( 0.2 )', '15' ), - array( '3 mod 2', '1' ), - array( '1e4', '10000' ), - array( '1e-2', '0.01' ), - array( '4.0 round 0', '4' ), - array( 'ceil 4', '4' ), - array( 'floor 4', '4' ), - array( '4.5 round 0', '5' ), - array( '4.2 round 0', '4' ), - array( '-4.2 round 0', '-4' ), - array( '-4.5 round 0', '-5' ), - array( '-2.0 round 0', '-2' ), - array( 'ceil -3', '-3' ), - array( 'floor -6.0', '-6' ), - array( 'ceil 4.2', '5' ), - array( 'ceil -4.5', '-4' ), - array( 'floor -4.5', '-5' ), - array( 'abs(-2)', '2' ), - array( 'ln(exp(1))', '1' ), - array( 'trunc(4.5)', '4' ), - array( 'trunc(-4.5)', '-4' ), - array( '123 fmod (2^64-1)', '123' ), - array( '5.7 mod 1.3', '0' ), - array( '5.7 fmod 1.3', '0.5' ), - ); - } -} - diff --git a/extensions/PdfHandler/.gitreview b/extensions/PdfHandler/.gitreview deleted file mode 100644 index f5eca40e..00000000 --- a/extensions/PdfHandler/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/PdfHandler.git -defaultbranch=master diff --git a/extensions/PdfHandler/COPYING b/extensions/PdfHandler/COPYING deleted file mode 100644 index d159169d..00000000 --- a/extensions/PdfHandler/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/extensions/PdfHandler/PdfHandler.i18n.php b/extensions/PdfHandler/PdfHandler.i18n.php index 213f4462..06143e7b 100644 --- a/extensions/PdfHandler/PdfHandler.i18n.php +++ b/extensions/PdfHandler/PdfHandler.i18n.php @@ -226,7 +226,7 @@ $messages['ckb'] = array( 'exif-pdf-pagesize' => 'قەبارەی پەڕە', ); -/** Czech (čeština) +/** Czech (česky) * @author Matěj Grabovský * @author Mormegil */ @@ -542,10 +542,6 @@ $messages['ia'] = array( 'pdf-desc' => 'Gestor pro visualisar files PDF in modo de imagine', 'pdf_no_metadata' => 'Non pote obtener metadatos ab PDF', 'pdf_page_error' => 'Numero de pagina foras del intervallo', - 'exif-pdf-producer' => 'Programma de conversion', - 'exif-pdf-version' => 'Version del formato PDF', - 'exif-pdf-encrypted' => 'Cryptate', - 'exif-pdf-pagesize' => 'Dimension del pagina', ); /** Indonesian (Bahasa Indonesia) @@ -676,7 +672,6 @@ $messages['lb'] = array( 'pdf-desc' => '"Programm" den et erméiglecht PDF-Fichieren als Bild ze kucken', 'pdf_no_metadata' => 'Meta-Informatiounen aus dem PDF Dokument kënnen net gelies ginn', 'pdf_page_error' => "D'Säitenzuel ass net an dem Beräich.", - 'exif-pdf-producer' => 'Ëmwandlungsprogramm', 'exif-pdf-version' => 'Versioun vum PDF-Format', 'exif-pdf-encrypted' => 'Verschlësselt', 'exif-pdf-pagesize' => 'Gréisst vun der Säit', @@ -691,13 +686,6 @@ $messages['li'] = array( 'pdf_page_error' => 'paginanómmer besteit neet', ); -/** لوری (لوری) - * @author Mogoeilor - */ -$messages['lrc'] = array( - 'exif-pdf-pagesize' => 'انازه بلگه', -); - /** Lithuanian (lietuvių) * @author Matasg */ @@ -738,12 +726,11 @@ $messages['ml'] = array( /** Marathi (मराठी) * @author Kaustubh * @author Sankalpdravid - * @author V.narsikar */ $messages['mr'] = array( 'pdf-desc' => 'चित्र मोडमध्ये पीडीएफ संचिका पाहण्यासाठी आवश्यक प्रणाली', 'pdf_no_metadata' => 'पीडीएफमधून मेटाडाटा घेऊ शकत नाही', - 'pdf_page_error' => 'पान क्रमांक आवाक्यात नाही', + 'pdf_page_error' => 'पान क्रमांक सीमेमध्ये नाही', ); /** Malay (Bahasa Melayu) diff --git a/extensions/PdfHandler/PdfHandler_body.php b/extensions/PdfHandler/PdfHandler_body.php index 495f3bb8..d9ed4884 100644 --- a/extensions/PdfHandler/PdfHandler_body.php +++ b/extensions/PdfHandler/PdfHandler_body.php @@ -188,12 +188,12 @@ class PdfHandler extends ImageHandler { "-", $dstPath ); - $cmd .= ")"; + $cmd .= ") 2>&1"; wfProfileIn( 'PdfHandler' ); wfDebug( __METHOD__ . ": $cmd\n" ); $retval = ''; - $err = wfShellExecWithStderr( $cmd, $retval ); + $err = wfShellExec( $cmd, $retval ); wfProfileOut( 'PdfHandler' ); $removed = $this->removeBadFile( $dstPath, $retval ); diff --git a/extensions/Poem/.gitreview b/extensions/Poem/.gitreview deleted file mode 100644 index aac78b2b..00000000 --- a/extensions/Poem/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/Poem.git -defaultbranch=master diff --git a/extensions/Poem/Poem.i18n.php b/extensions/Poem/Poem.i18n.php index 29740252..c58ce78d 100644 --- a/extensions/Poem/Poem.i18n.php +++ b/extensions/Poem/Poem.i18n.php @@ -124,13 +124,6 @@ $messages['ca'] = array( 'poem-desc' => "Afegeix l'etiqueta <poem> per al formatatge de poemes", ); -/** Chechen (нохчийн) - * @author Умар - */ -$messages['ce'] = array( - 'poem-desc' => 'ТӀетуху тег <poem> дешнаш дӀадаха', -); - /** Sorani Kurdish (کوردی) * @author Asoxor */ @@ -138,7 +131,7 @@ $messages['ckb'] = array( 'poem-desc' => 'تاگی <poem> زێدەدەکات بۆ ڕێکخستنی ھۆنراوەکان', ); -/** Czech (čeština) +/** Czech (česky) * @author Matěj Grabovský */ $messages['cs'] = array( @@ -154,7 +147,6 @@ $messages['da'] = array( /** German (Deutsch) * @author Kghbln - * @author Purodha * @author Raimond Spekking */ $messages['de'] = array( @@ -318,7 +310,7 @@ $messages['id'] = array( * @author Lam-ang */ $messages['ilo'] = array( - 'poem-desc' => 'Agnayon ti etiketa ti <poem> para iti panagporma ti daniw', + 'poem-desc' => 'Ikkan na iti<poem> nga tag para ti pagporma ti daniw', ); /** Italian (italiano) @@ -566,13 +558,6 @@ $messages['scn'] = array( 'poem-desc' => 'Iunci lu tag <poem> pi la furmattazioni di li testa puetici', ); -/** Scots (Scots) - * @author John Reid - */ -$messages['sco'] = array( - 'poem-desc' => 'Adds <poem> tag fr poem formattin', -); - /** Slovak (slovenčina) * @author Helix84 */ diff --git a/extensions/Renameuser/.gitreview b/extensions/Renameuser/.gitreview deleted file mode 100644 index 0d757141..00000000 --- a/extensions/Renameuser/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/Renameuser.git -defaultbranch=master diff --git a/extensions/Renameuser/COPYING b/extensions/Renameuser/COPYING deleted file mode 100644 index d159169d..00000000 --- a/extensions/Renameuser/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/extensions/Renameuser/README b/extensions/Renameuser/README index a344ebf6..e44aaafe 100644 --- a/extensions/Renameuser/README +++ b/extensions/Renameuser/README @@ -1,4 +1,4 @@ -This is the readme file for the MediaWiki Renameuser extension. +These is the readme file for the MediaWiki Renameuser extension. Extension page on mediawiki.org: https://www.mediawiki.org/wiki/Extension:Renameuser Latest version of the readme file: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Renameuser.git;a=blob;f=README diff --git a/extensions/Renameuser/Renameuser.alias.php b/extensions/Renameuser/Renameuser.alias.php index 13997709..0523c045 100644 --- a/extensions/Renameuser/Renameuser.alias.php +++ b/extensions/Renameuser/Renameuser.alias.php @@ -64,7 +64,7 @@ $specialPageAliases['ce'] = array( 'Renameuser' => array( 'Декъашхочун_цӀе_хийца' ), ); -/** Czech (čeština) */ +/** Czech (česky) */ $specialPageAliases['cs'] = array( 'Renameuser' => array( 'Přejmenovat_uživatele' ), ); @@ -131,7 +131,7 @@ $specialPageAliases['frp'] = array( /** Galician (galego) */ $specialPageAliases['gl'] = array( - 'Renameuser' => array( 'Renomear_o_usuario', 'Renomear_usuario', 'Renomear_a_usuaria', 'Renomear_usuaria' ), + 'Renameuser' => array( 'Renomear_o_usuario' ), ); /** Swiss German (Alemannisch) */ diff --git a/extensions/Renameuser/Renameuser.hooks.php b/extensions/Renameuser/Renameuser.hooks.php index e5271735..41dcc43e 100644 --- a/extensions/Renameuser/Renameuser.hooks.php +++ b/extensions/Renameuser/Renameuser.hooks.php @@ -9,14 +9,14 @@ class RenameuserHooks { * @return bool */ public static function onShowMissingArticle( $article ) { + global $wgOut; $title = $article->getTitle(); $oldUser = User::newFromName( $title->getBaseText() ); if ( ($title->getNamespace() == NS_USER || $title->getNamespace() == NS_USER_TALK ) && ($oldUser && $oldUser->isAnon() )) { // Get the title for the base userpage $page = Title::makeTitle( NS_USER, str_replace( ' ', '_', $title->getBaseText() ) )->getPrefixedDBkey(); - $out = $article->getContext()->getOutput(); LogEventsList::showLogExtract( - $out, + $wgOut, 'renameuser', $page, '', @@ -53,14 +53,4 @@ class RenameuserHooks { } return true; } - - /** - * So users can just type in a username for target and it'll work - * @param array $types - * @return bool - */ - public static function onGetLogTypesOnUser( array &$types ) { - $types[] = 'renameuser'; - return true; - } } diff --git a/extensions/Renameuser/Renameuser.i18n.php b/extensions/Renameuser/Renameuser.i18n.php index 3cf2cfa7..c1411037 100644 --- a/extensions/Renameuser/Renameuser.i18n.php +++ b/extensions/Renameuser/Renameuser.i18n.php @@ -328,7 +328,7 @@ $messages['as'] = array( 'renameuser' => 'ব্যৱহাৰকাৰীৰ নাম সলাওক', 'renameuser-linkoncontribs' => 'ব্যৱহাৰীৰ নাম সলাওক', 'renameuser-linkoncontribs-text' => 'এই ব্যৱহাৰকাৰীৰ পুনৰ্নামাকৰণ কৰক', - 'renameuser-desc' => "এজন ব্যৱহাৰকাৰীৰ পুনৰ্নামাকৰণ কৰিবলৈ এটা [[Special:Renameuser|বিশেষ পৃষ্ঠা]] যোগ দিয়ে (''renameuser'' অধিকাৰৰ প্ৰয়োজন)", + 'renameuser-desc' => "এজন ব্যৱহাৰকাৰীৰ পুনৰ্নামাকৰণ কৰিবলৈ এখন [[Special:Renameuser|বিশেষ পৃষ্ঠা]] যোগ দিয়ে (''renameuser'' অধিকাৰৰ প্ৰয়োজন)", 'renameuserold' => 'বৰ্তমানৰ সদস্যনাম:', 'renameusernew' => 'নতুন সদস্যনাম:', 'renameuserreason' => 'কাৰণ:', @@ -346,9 +346,9 @@ $messages['as'] = array( অনুগ্ৰহ কৰি ঘূৰি গৈ পুনৰ চেষ্টা কৰক।', 'renameuser-error-same-user' => 'আপুনি এজন সদস্যক আগৰ নামটোলৈকে নামান্তৰ কৰিব নোৱাৰে।', 'renameusersuccess' => '"$1" সদস্যজনক "$2"লৈ নামান্তৰিত কৰা হৈছে।', - 'renameuser-page-exists' => '$1 পৃষ্ঠাটো ইতিমধ্যেই আছে আৰু তাৰ ওপৰত স্বয়ংক্ৰিয়ভাৱে লিখিব নোৱাৰি।', - 'renameuser-page-moved' => "$1 পৃষ্ঠাটো $2-লৈ স্থানান্তৰ কৰা হ'ল।", - 'renameuser-page-unmoved' => '$1 পৃষ্ঠাটো $2-লৈ স্থানান্তৰ কৰা সম্ভৱ নহয়।', + 'renameuser-page-exists' => '$1 পৃষ্ঠাখন ইতিমধ্যেই আছে আৰু তাৰ ওপৰত স্বয়ংক্ৰিয়ভাৱে লিখিব নোৱাৰি।', + 'renameuser-page-moved' => "$1 পৃষ্ঠাখন $2-লৈ স্থানান্তৰ কৰা হ'ল।", + 'renameuser-page-unmoved' => '$1 পৃষ্ঠাখন $2-লৈ স্থানান্তৰ কৰা সম্ভৱ নহয়।', 'log-name-renameuser' => 'সদস্যৰ পুনৰ্নামাকৰণ অভিলেখ', 'log-description-renameuser' => 'সদস্যনাম পৰিৱৰ্তনৰ অভিলেখ', 'logentry-renameuser-renameuser-legacier' => 'সদস্য $4ৰ পৰা $5লৈ, $1’য়ে পুনৰ নামাকৰণ কৰিলে', @@ -790,15 +790,12 @@ A continuació es proporciona el registre de reanomenaments per a més informaci $messages['ce'] = array( 'renameuser' => 'Декъашхочун цӀе хийца', 'renameuser-linkoncontribs' => 'декъашхочун цӀе хийца', - 'renameuser-desc' => 'ТӀетуху декъашхойн цӀераш хийца [[Special:Renameuser|аьтту]] (оьшу бакъо renameuser)', 'renameuserreason' => 'Бахьан:', 'renameusersubmit' => 'Кхочушдé', 'renameuser-page-exists' => 'Агӏо $1 йолуш ю цундела и ша юху дӏаязъян йиш яц.', - 'renameuser-page-moved' => 'АгӀона $1 цӀе хийцина → $2.', + 'renameuser-page-moved' => 'АгӀона $1 цӀе хийцина оцу $2.', 'log-name-renameuser' => 'Декъашхойн цӀераш хийцар долу тептар', - 'log-description-renameuser' => 'ХӀокху тептар чохь гойту дӀабазбелла декъашхойн цӀераш хийцар.', - 'logentry-renameuser-renameuser-legacier' => '$1 $4 декъашхочун цӀе хийцина → $5', - 'renameuser-move-log' => 'Автоматически декъашхочун цӀе хийцина дела «[[User:$1|$1]]» → «[[User:$2|$2]]»', + 'renameuser-move-log' => 'Автоматически декъашхочун цӀе хийцина дела «[[User:$1|$1]]» оцу «[[User:$2|$2]]»', 'action-renameuser' => 'декъашхойн цӀераш хийцар', 'right-renameuser' => 'декъашхойн цӀераш хийцар', ); @@ -827,7 +824,7 @@ $messages['crh-latn'] = array( 'log-name-renameuser' => 'Qullanıcı adı deñişikligi jurnalı', ); -/** Czech (čeština) +/** Czech (česky) * @author Danny B. * @author Li-sung * @author Martin Kozák @@ -869,7 +866,7 @@ $messages['cs'] = array( Pro přehled je níže zobrazen výpis z knihy přejmenování uživatelů.', ); -/** Church Slavic (словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) +/** Church Slavic (словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) * @author Svetko * @author ОйЛ */ @@ -981,7 +978,6 @@ Til information er omdøbningsloggen vist nedenfor.', /** German (Deutsch) * @author Kghbln * @author Metalhead64 - * @author Purodha * @author Raimond Spekking * @author Spacebirdy * @author The Evil IP address @@ -1026,7 +1022,6 @@ Zur Information folgt das Benutzernamenänderungs-Logbuch.', /** Zazaki (Zazaki) * @author Aspar * @author Erdemaslancan - * @author Gorizon * @author Mirzali * @author Xoser */ @@ -1041,7 +1036,7 @@ $messages['diq'] = array( 'renameusermove' => 'nameyê karberan u pelê werêaameyişan bıkırışi nameyo newe', 'renameusersuppress' => 'Name de newi re hetenayışo newe vıraştış', 'renameuserreserve' => 'nameyê karberi yo verini bloke bıker.', - 'renameuserwarnings' => 'İğtari:', + 'renameuserwarnings' => 'hişyariyi', 'renameuserconfirm' => 'bele karberi newe ra name bıker', 'renameusersubmit' => 'bierşawê/biruşnê', 'renameuser-submit-blocklog' => 'Rocekanê bloqandê karbari bıvin', @@ -1727,7 +1722,6 @@ $messages['gu'] = array( /** Hebrew (עברית) * @author Amire80 - * @author Guycn2 * @author Ofekalef * @author Rotem Liss * @author Rotemliss @@ -1753,7 +1747,7 @@ $messages['he'] = array( 'renameusererrorexists' => 'המשתמש "$1" כבר קיים.', 'renameusererrorinvalid' => 'שם המשתמש "$1" אינו תקין.', 'renameuser-error-request' => 'הייתה בעיה בקבלת הבקשה. אנא חזרו לדף הקודם ונסו שנית.', - 'renameuser-error-same-user' => 'לא ניתן לשנות את שם המשתמש לשם זהה לשמו הישן.', + 'renameuser-error-same-user' => 'אינכם יכולים לשנות את שם המשתמש לשם זהה לשמו הישן.', 'renameusersuccess' => 'שם המשתמש של "$1" שונה ל"$2".', 'renameuser-page-exists' => 'הדף $1 כבר קיים ולא ניתן לדרוס אותו אוטומטית.', 'renameuser-page-moved' => 'הדף $1 הועבר לשם $2.', @@ -1764,7 +1758,7 @@ $messages['he'] = array( 'logentry-renameuser-renameuser-legacier' => '$1 {{GENDER:$2|שינה|שינתה}} את שם המשתמש $4 ל{{GRAMMAR:תחילית|$5}}', 'renameuser-move-log' => 'העברה אוטומטית בעקבות שינוי שם המשתמש "[[User:$1|$1]]" ל־"[[User:$2|$2]]"', 'action-renameuser' => 'לשנות שמות משתמש', - 'right-renameuser' => 'שינוי שמות משתמשים', + 'right-renameuser' => 'שינוי שמות משתמש', 'renameuser-renamed-notice' => 'שם המשתמש הזה שונה. יומן שינויי שמות המשתמש מוצג להלן.', ); @@ -1987,9 +1981,6 @@ Per favor retorna e reproba.', 'renameuser-page-moved' => 'Le pagina $1 ha essite renominate a $2.', 'renameuser-page-unmoved' => 'Le pagina $1 non poteva esser renominate a $2.', 'log-name-renameuser' => 'Registro de renominationes de usatores', - 'log-description-renameuser' => 'Isto es un registro de cambiamentos de nomines de usator.', - 'logentry-renameuser-renameuser' => '$1 {{GENDER:$2|renominava}} le usator $4 ({{PLURAL:$6|$6 modification|$6 modificationes}}) a $5', - 'logentry-renameuser-renameuser-legacier' => '$1 renominava le usator $4 a $5', 'renameuser-move-log' => 'Le pagina ha essite automaticamente renominate con le renomination del usator "[[User:$1|$1]]" a "[[User:$2|$2]]"', 'action-renameuser' => 'renominar usatores', 'right-renameuser' => 'Renominar usatores', @@ -2513,7 +2504,7 @@ $messages['ksh'] = array( 'renameusernew' => 'Dä neue Metmaacher-Name', 'renameuserreason' => 'Jrund för et Ömdäufe:', # Fuzzy 'renameusermove' => 'De Metmaachersigg met Klaaf- un Ungersigge op dä neue Metmaacher-Name ömstelle', - 'renameusersuppress' => 'Donn kein Ömleidong op dä neue Name aanlääje', + 'renameusersuppress' => 'Donn kein Ömleidung op dä neue Name aanlääje', 'renameuserreserve' => 'Donn dä Name fun dämm Metmaacher dobei sperre, dat_e nit norrens neu aanjemelldt weed.', 'renameuserwarnings' => 'Warnunge:', 'renameuserconfirm' => 'Jo, dunn dä Metmaacher ömbenenne un em singe Name ändere', @@ -2611,16 +2602,6 @@ $messages['la'] = array( Commodule notatio renominationum usoris subter datur.', ); -/** Ladino (Ladino) - * @author Menachem.Moreira - * @author Universal Life - */ -$messages['lad'] = array( - 'renameusernew' => 'Nombre de kullaneador muevo:', - 'renameuserreason' => 'Razon:', - 'renameuserwarnings' => 'Avisos:', -); - /** Luxembourgish (Lëtzebuergesch) * @author Les Meloures * @author Robby @@ -2700,22 +2681,6 @@ $messages['li'] = array( Relevante regels oet 't logbook staon hieónger.", ); -/** لوری (لوری) - * @author Bonevarluri - * @author Mogoeilor - */ -$messages['lrc'] = array( - 'renameusernew' => 'نوم کاروری تازه:', - 'renameuserreason' => 'دلیل:', - 'renameuser-submit-blocklog' => 'قلف پهرستنومه سی کارور نشو بیه', - 'renameuser-page-moved' => 'بلگه $1 د $2 جا وه جا بیه', - 'renameuser-page-unmoved' => 'نبوئه بلگه $1 د $2 جا وه جا بوئه', - 'log-name-renameuser' => 'پهرستنومه دواره نوم دئن د کارور', - 'log-description-renameuser' => 'یه پهرستنومه آلشت دئن نوم کاروریا هئ.', - 'renameuser-renamed-notice' => 'ای کارور یه گل نوم هنی وش دئه بیه. -پهرستنومه نوم هنی دئن وا سرچشمه زیر دروس بیه.', -); - /** Lithuanian (lietuvių) * @author Eitvys200 * @author Homo @@ -2855,7 +2820,7 @@ $messages['ml'] = array( 'renameuserold' => 'ഇപ്പോഴത്തെ ഉപയോക്തൃനാമം:', 'renameusernew' => 'പുതിയ ഉപയോക്തൃനാമം:', 'renameuserreason' => 'കാരണം:', - 'renameusermove' => 'നിലവിലുള്ള ഉപയോക്തൃതാളും, ഉപയോക്താവിന്റെ സം‌വാദത്താളും (ഉപതാളുകൾ അടക്കം) പുതിയ നാമത്തിലേക്കു മാറ്റുക.', + 'renameusermove' => 'നിലവിലുള്ള ഉപയോക്തൃതാളും, ഉപയോക്താവിന്റെ സം‌വാദം താളും (ഉപതാളുകൾ അടക്കം) പുതിയ നാമത്തിലേക്കു മാറ്റുക.', 'renameusersuppress' => 'പുതിയ നാമത്തിലേയ്ക്ക് തിരിച്ചുവിടലുകളൊന്നും സൃഷ്ടിക്കരുത്', 'renameuserreserve' => 'പഴയ ഉപയോക്തൃനാമം ഭാവിയിൽ ഉപയോഗിക്കുന്നതു തടയുക', 'renameuserwarnings' => 'മുന്നറിയിപ്പുകൾ:', @@ -2908,7 +2873,7 @@ $messages['mr'] = array( 'renameuserreserve' => 'जुने सदस्य खाते पुढील वापरासाठी अवरुद्ध करा', 'renameuserwarnings' => 'ताकीद:', 'renameuserconfirm' => 'होय, सदस्याचे नाव बदला', - 'renameusersubmit' => 'सादर करा', + 'renameusersubmit' => 'पाठवा', 'renameusererrordoesnotexist' => '"$1" नावाचा सदस्य अस्तित्वात नाही.', 'renameusererrorexists' => '"$1" नावाचा सदस्य अगोदरच अस्तित्वात आहे', 'renameusererrorinvalid' => '"$1" हे नाव चुकीचे आहे.', @@ -3494,12 +3459,9 @@ $messages['ps'] = array( 'renameuserold' => 'اوسنی کارن-نوم:', 'renameusernew' => 'نوی کارن-نوم:', 'renameuserreason' => 'سبب:', - 'renameusermove' => 'د کارن او د خبرو اترو مخونه (او د هغوی څېرمه مخونه) نوي نوم ته ورلېږدول', - 'renameusersuppress' => 'نوي نوم ته مخ گرځونی مه جوړوه', 'renameuserwarnings' => 'ګواښنې:', 'renameuserconfirm' => 'هو، کارن-نوم بدلوم', 'renameusersubmit' => 'سپارل', - 'renameuser-submit-blocklog' => 'د کارن بنديز يادښت ښکاره کول', 'renameusererrordoesnotexist' => 'د "$1" په نامه کوم کارن نه شته.', 'renameusererrorexists' => 'د "$1" په نامه يو کارن له پخوا نه شته.', 'renameusererrorinvalid' => 'د "$1" کارن نوم سم نه دی.', @@ -3631,13 +3593,6 @@ $messages['qu'] = array( Kay qatiqpiqa hukchay hallch'atam rikunki.", ); -/** Romansh (rumantsch) - * @author Kazu89 - */ -$messages['rm'] = array( - 'log-name-renameuser' => "Protocol da midadas da num d'utilisader", -); - /** Romani (Romani) * @author Desiphral */ @@ -3729,7 +3684,6 @@ L'archivije de le renomenaziune 'u iacchie aqquà sotte cumme referimende.", /** Russian (русский) * @author Ahonc - * @author Amire80 * @author Anonim.one * @author DCamer * @author DR @@ -3765,7 +3719,7 @@ $messages['ru'] = array( 'renameuser-page-unmoved' => 'Страница $1 не может быть переименована в $2.', 'log-name-renameuser' => 'Журнал переименований участников', 'log-description-renameuser' => 'Это журнал произведённых переименований зарегистрированных участников.', - 'logentry-renameuser-renameuser' => '$1 {{GENDER:$2|переименовал}} участника $4 ({{PLURAL:$6|$6 правка|$6 правок|$6 правки}}) в $5', + 'logentry-renameuser-renameuser' => '$1 {{GENDER:$2|переименовал}} участника $4 ({{PLURAL:$6|$6 правка|$6 правки|$6 правок}}) в $5', 'logentry-renameuser-renameuser-legacier' => '$1 переименовал пользователя $4 в $5', 'renameuser-move-log' => 'Автоматически в связи с переименованием учётной записи «[[User:$1|$1]]» в «[[User:$2|$2]]»', 'action-renameuser' => 'переименование участников', @@ -3935,43 +3889,10 @@ $messages['sgs'] = array( ); /** Serbo-Croatian (srpskohrvatski / српскохрватски) - * @author Kolega2357 * @author OC Ripper */ $messages['sh'] = array( - 'renameuser' => 'Promijeni ime korisnika', - 'renameuser-linkoncontribs' => 'preimenuj korisnika', - 'renameuser-linkoncontribs-text' => 'Preimenuj ovog korisnika', - 'renameuser-desc' => 'Preimenuj korisnika', # Fuzzy - 'renameuserold' => 'Trenutno korisničko ime:', - 'renameusernew' => 'Novo korisničko ime:', - 'renameuserreason' => 'Razlog:', - 'renameusermove' => 'Premjesti korisnikove stranice (glavnu, stranicu za razgovor i podstranice, ako postoje) na novo ime', - 'renameusersuppress' => 'Ne pravi preusmerenja na novo korisničko ime', - 'renameuserreserve' => 'Blokiraj staro korisničko ime za dalju upotrebu', - 'renameuserwarnings' => 'Upozorenja:', - 'renameuserconfirm' => 'Da, preimenuj korisnika', 'renameusersubmit' => 'Unesi', - 'renameuser-submit-blocklog' => 'Evidencija blokiranja za korisnika', - 'renameusererrordoesnotexist' => 'Korisničko ime "$1" ne postoji', - 'renameusererrorexists' => 'Korisničko ime "$1" već postoji', - 'renameusererrorinvalid' => 'Korisničko ime "$1" ne valja', - 'renameuser-error-request' => 'Nastao je problem prilikom primanja zahteva. -Molimo vas pokušajte ponovo.', - 'renameuser-error-same-user' => 'Ne možete preimenovati korisnika u isto ime kao i pre.', - 'renameusersuccess' => 'Korisnik "$1" je preimenovan u "$2"', - 'renameuser-page-exists' => 'Stranica $1 već postoji i ne može se automatski presnimiti.', - 'renameuser-page-moved' => 'Stranica $1 je premeštena na $2.', - 'renameuser-page-unmoved' => 'Strana $1 se ne može premestiti na $2.', - 'log-name-renameuser' => 'Evidencija preimenovanja', - 'log-description-renameuser' => 'Ovo je evidencija izmjena preimenovanja korisnika.', - 'logentry-renameuser-renameuser' => '$1 {{GENDER:$2|preimenovao}} korisnika $4 ({{PLURAL:$6|$6 edit|$6 edits}}) na $5', - 'logentry-renameuser-renameuser-legacier' => '$1 preimenovao korisnika $4 na $5', - 'renameuser-move-log' => 'Automatski premeštena stranica dok je korisnik "[[User:$1|$1]]" preimenovan u "[[User:$2|$2]]"', - 'action-renameuser' => 'preimenovanje korisnika', - 'right-renameuser' => 'preimenovanje korisničkih imena', - 'renameuser-renamed-notice' => 'Ovom korisniku je promenjeno ime. -Evidencija promena imena je priložena ispod, kao informacija.', ); /** Sinhala (සිංහල) @@ -4168,17 +4089,15 @@ $messages['sr-ec'] = array( 'renameuser-submit-blocklog' => 'Дневник блокирања за корисника', 'renameusererrordoesnotexist' => 'Корисник „$1“ не постоји.', 'renameusererrorexists' => 'Корисник „$1“ већ постоји.', - 'renameusererrorinvalid' => 'Погрешно корисничко име: „$1“', + 'renameusererrorinvalid' => 'Погрешно корисничко име: "$1"', 'renameuser-error-request' => 'Дошло је до проблема при примању захтева. Вратите се назад и покушајте поново.', 'renameuser-error-same-user' => 'Не можете преименовати корисника у исто име.', - 'renameusersuccess' => 'Корисник „$1“ је преименован на „$2“', + 'renameusersuccess' => 'Корисник "$1" је преименован на "$2"', 'renameuser-page-exists' => 'Страница $1 већ постоји и не може се заменити.', - 'renameuser-page-moved' => 'Страница $1 је премештена на $2.', + 'renameuser-page-moved' => 'Страница $1 је премештена у $2.', 'renameuser-page-unmoved' => 'Страница $1 не може да се премести на $2.', 'log-name-renameuser' => 'Дневник преименовања корисника', - 'log-description-renameuser' => 'Испод је списак преименованих корисника.', - 'logentry-renameuser-renameuser' => '$1 је {{GENDER:$2|преименовао|преименовала}} корисника $4 ({{PLURAL:$6|$6 измену|$6 измена}}) у $5', 'renameuser-move-log' => 'Премештене странице приликом преименовања корисника: „[[User:$1|$1]]“ у „[[User:$2|$2]]“.', 'action-renameuser' => 'преименовање корисника', 'right-renameuser' => 'преименовање корисничких имена', @@ -4213,14 +4132,12 @@ $messages['sr-el'] = array( 'renameusererrorinvalid' => 'Pogrešno korisničko ime: "$1"', 'renameuser-error-request' => 'Javio se problem prilikom prihvatanja zahteva. Idi nazad i pokušaj ponovo.', 'renameuser-error-same-user' => 'Ne možeš preimenovati korisničko ime u isto kao i prethodno.', - 'renameusersuccess' => 'Korisnik „$1“ je preimenovan na „$2“', + 'renameusersuccess' => 'Korisnik "$1" je preimenovan na "$2"', 'renameuser-page-exists' => 'Stranica $1 već postoji i ne može biti automatski presnimljena.', 'renameuser-page-moved' => 'Stranica $1 je premeštena na $2.', 'renameuser-page-unmoved' => 'Stranica $1 ne može biti premeštena na $2.', 'log-name-renameuser' => 'Dnevnik preimenovanja korisnika', - 'log-description-renameuser' => 'Ispod je spisak preimenovanih korisnika.', - 'logentry-renameuser-renameuser' => '$1 je {{GENDER:$2|preimenovao|preimenovala}} korisnika $4 ({{PLURAL:$6|$6 izmenu|$6 izmena}}) u $5', - 'renameuser-move-log' => 'Premeštene stranice prilikom preimenovanja korisnika: „[[User:$1|$1]]“ u „[[User:$2|$2]]“.', + 'renameuser-move-log' => 'Automatski pomerene stranice prilikom preimenovanja korisničkog imena: „[[User:$1|$1]]“ u „[[User:$2|$2]]“.', 'action-renameuser' => 'preimenovanje korisnika', 'right-renameuser' => 'preimenovanje korisničkih imena', 'renameuser-renamed-notice' => 'Ovom korisniku je promenjeno ime. @@ -4401,7 +4318,7 @@ $messages['te'] = array( 'renameuser-desc' => "వాడుకరి పేరు మార్చండి (''renameuser'' అన్న అధికారం కావాలి)", 'renameuserold' => 'ప్రస్తుత వాడుకరి పేరు:', 'renameusernew' => 'కొత్త వాడుకరి పేరు:', - 'renameuserreason' => 'కారణం:', + 'renameuserreason' => 'పేరు మార్చడానికి కారణం:', # Fuzzy 'renameusermove' => 'వాడుకరి పేజీ, చర్చాపేజీలను (వాటి ఉపపేజీలతో సహా) కొత్త పేరుకు తరలించండి', 'renameusersuppress' => 'కొత్త పేరుకి దారిమార్పులు సృష్టించకు', 'renameuserreserve' => 'పాత వాడుకరిపేరుని భవిష్యత్తులో వాడకుండా నిరోధించు', @@ -4617,7 +4534,6 @@ $messages['to'] = array( /** Turkish (Türkçe) * @author Joseph * @author Karduelis - * @author Marmase * @author Runningfridgesrule * @author Uğur Başak * @author Vito Genovese @@ -4629,7 +4545,7 @@ $messages['tr'] = array( 'renameuser-desc' => "Kullanıcıyı yeniden adlandırmak için bir [[Special:Renameuser|özel sayfa]] ekler (''kullanıcıyıyenidenadlandır'' hakkı gerekir)", 'renameuserold' => 'Şu anda ki kullanıcı adı:', 'renameusernew' => 'Yeni kullanıcı adı:', - 'renameuserreason' => 'Neden:', + 'renameuserreason' => 'Neden:', # Fuzzy 'renameusermove' => 'Kullanıcı ve tartışma sayfalarını (ve alt sayfalarını) yeni isme taşı', 'renameusersuppress' => 'Yeni ada yönlendirmeler oluşturma', 'renameuserreserve' => 'Eski kullanıcı adını ilerdeki kullanımlar için engelle', @@ -4723,10 +4639,9 @@ $messages['ur'] = array( /** Uzbek (oʻzbekcha) * @author CoderSI - * @author Sociologist */ $messages['uz'] = array( - 'log-name-renameuser' => 'Foydalanuvchilarni qayta nomlash qaydlari', + 'log-name-renameuser' => 'Ishtirokchilarni qayta nomlash qaydlari', ); /** vèneto (vèneto) @@ -4830,7 +4745,7 @@ $messages['vo'] = array( 'renameuser-desc' => "Votanemön gebani (gität: ''renameuser'' zesüdon)", 'renameuserold' => 'Gebananem anuik:', 'renameusernew' => 'Gebananem nulik:', - 'renameuserreason' => 'Kod:', + 'renameuserreason' => 'Kod votanemama:', # Fuzzy 'renameusermove' => 'Topätükön padi e bespikapadi gebana (e donapadis onsik) ad nem nulik', 'renameuserreserve' => 'Neletön gebananemi rigik (pos votanemam) ad pagebön ün fütür', 'renameuserwarnings' => 'Nuneds:', @@ -4921,15 +4836,13 @@ $messages['yo'] = array( ); /** Cantonese (粵語) - * @author Antonytse - * @author Liuxinyu970226 */ $messages['yue'] = array( 'renameuser' => '改用戶名', 'renameuser-desc' => "幫用戶改名 (需要 ''renameuser'' 權限)", 'renameuserold' => '現時嘅用戶名:', 'renameusernew' => '新嘅用戶名:', - 'renameuserreason' => '原因:', + 'renameuserreason' => '改名嘅原因:', # Fuzzy 'renameusermove' => '搬用戶頁同埋佢嘅對話頁(同埋佢哋嘅細頁)到新名', 'renameuserwarnings' => '警告:', 'renameuserconfirm' => '係,改呢個用戶名', diff --git a/extensions/Renameuser/Renameuser.php b/extensions/Renameuser/Renameuser.php index 40636b54..e9e83143 100644 --- a/extensions/Renameuser/Renameuser.php +++ b/extensions/Renameuser/Renameuser.php @@ -48,5 +48,4 @@ $wgJobClasses['renameUser'] = 'RenameUserJob'; $wgHooks['ShowMissingArticle'][] = 'RenameuserHooks::onShowMissingArticle'; $wgHooks['ContributionsToolLinks'][] = 'RenameuserHooks::onContributionsToolLinks'; -$wgHooks['GetLogTypesOnUser'][] = 'RenameuserHooks::onGetLogTypesOnUser'; diff --git a/extensions/Renameuser/RenameuserSQL.php b/extensions/Renameuser/RenameuserSQL.php index 153cac88..eeb879a0 100644 --- a/extensions/Renameuser/RenameuserSQL.php +++ b/extensions/Renameuser/RenameuserSQL.php @@ -112,7 +112,6 @@ class RenameuserSQL { if ( !$dbw->affectedRows() && $this->checkIfUserExists ) { $dbw->rollback(); - wfProfileOut( __METHOD__ ); return false; } @@ -222,7 +221,7 @@ class RenameuserSQL { } if ( count( $jobs ) > 0 ) { - JobQueueGroup::singleton()->push( $jobs, JobQueue::QOS_ATOMIC ); // don't commit yet + Job::safeBatchInsert( $jobs ); // don't commit yet } // Commit the transaction diff --git a/extensions/Renameuser/specials/SpecialRenameuser.php b/extensions/Renameuser/specials/SpecialRenameuser.php index f6b9bac1..d869e2a8 100644 --- a/extensions/Renameuser/specials/SpecialRenameuser.php +++ b/extensions/Renameuser/specials/SpecialRenameuser.php @@ -58,7 +58,7 @@ class SpecialRenameuser extends SpecialPage { } $out->addHTML( - Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getPageTitle()->getLocalUrl(), 'id' => 'renameuser' ) ) . + Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalUrl(), 'id' => 'renameuser' ) ) . Xml::openElement( 'fieldset' ) . Xml::element( 'legend', null, $this->msg( 'renameuser' )->text() ) . Xml::openElement( 'table', array( 'id' => 'mw-renameuser-table' ) ) . diff --git a/extensions/SimpleAntiSpam/.gitreview b/extensions/SimpleAntiSpam/.gitreview deleted file mode 100644 index 7fdecfa5..00000000 --- a/extensions/SimpleAntiSpam/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/SimpleAntiSpam.git -defaultbranch=master diff --git a/extensions/SimpleAntiSpam/SimpleAntiSpam.i18n.php b/extensions/SimpleAntiSpam/SimpleAntiSpam.i18n.php deleted file mode 100644 index 2e92679d..00000000 --- a/extensions/SimpleAntiSpam/SimpleAntiSpam.i18n.php +++ /dev/null @@ -1,997 +0,0 @@ - 'Your edit triggered the anti-spam mechanism', - 'simpleantispam-label' => "Anti-spam check. -Do '''NOT''' fill this in!", - 'simpleantispam-desc' => 'Adds a simple spam/bot check to forms', -); - -/** Message documentation (Message documentation) - * @author Purodha - * @author Shirayuki - * @author The Evil IP address - */ -$messages['qqq'] = array( - 'simpleantispam' => 'Unused at this time.', - 'simpleantispam-label' => 'Used as label for the input box in "Edit" page. - -The label and the input box are always hidden.', - 'simpleantispam-desc' => '{{desc|name=Simple Anti Spam|url=http://www.mediawiki.org/wiki/Extension:SimpleAntiSpam}}', -); - -/** Afrikaans (Afrikaans) - * @author Naudefj - */ -$messages['af'] = array( - 'simpleantispam' => 'U wysiging het die anti-spam meganisme geaktiveer', - 'simpleantispam-label' => "Anti-spam kontrole. -'''Moenie''' die veld invul nie!", - 'simpleantispam-desc' => "Voeg 'n eenvoudige spam/robot-kontrole op vorms by", -); - -/** Gheg Albanian (Gegë) - * @author Mdupont - */ -$messages['aln'] = array( - 'simpleantispam' => 'Your redakto shkaktoi mekanizmi anti-spam', - 'simpleantispam-label' => "Anti-spam kontrolloni. A'''''NUK' plotësoni këtë!", - 'simpleantispam-desc' => 'Shton një spam i thjeshtë / kontrolloni bot me format e', -); - -/** Aragonese (aragonés) - * @author Juanpabl - */ -$messages['an'] = array( - 'simpleantispam' => 'Ista edición suya ha activato o mecanismo anti-spam', - 'simpleantispam-label' => "Preba anti-spam. -'''NO''' replene esto!", - 'simpleantispam-desc' => 'Adibe una preba de spam/bot ta os formularios', -); - -/** Arabic (العربية) - * @author Meno25 - */ -$messages['ar'] = array( - 'simpleantispam' => 'تعديلك نشط أداة منع السبام', - 'simpleantispam-label' => "اختبار ضد السبام. -'''لا''' تملأ هذا!", - 'simpleantispam-desc' => 'يضيف اختبار سبام/بوت بسيط للاستمارات', -); - -/** Egyptian Spoken Arabic (مصرى) - * @author Ramsis II - */ -$messages['arz'] = array( - 'simpleantispam' => 'تعديلك نشط خاصية الانتي-سبام', - 'simpleantispam-label' => "اختبار انتي-سبام. -'''ماتعبيش''' دا!", - 'simpleantispam-desc' => 'بيضيف اختبار سبام/بوت بسيط للاستمارات', -); - -/** Assamese (অসমীয়া) - * @author Gitartha.bordoloi - */ -$messages['as'] = array( - 'simpleantispam' => 'আপোনাৰ সম্পাদনাই এণ্টি-স্পাম কৌশল সক্ৰিয় কৰিলে।', - 'simpleantispam-label' => "এণ্টি-স্পাম পৰীক্ষা। -এইখন পূৰণ '''নকৰিব'''!", - 'simpleantispam-desc' => "প্ৰপত্ৰত এটা সৰল স্পাম/ব'ট পৰীক্ষণ যোগ কৰে", -); - -/** Asturian (asturianu) - * @author Esbardu - */ -$messages['ast'] = array( - 'simpleantispam' => "La to edición activó'l mecanismu anti-spam", - 'simpleantispam-label' => "Control anti-spam. -¡'''NUN''' rellenes esto!", - 'simpleantispam-desc' => 'Amiesta al formulariu la comprobación de spam con un bot', -); - -/** Bashkir (башҡортса) - * @author Assele - */ -$messages['ba'] = array( - 'simpleantispam' => 'Һеҙҙең үҙгәртеүегеҙ спамға ҡаршы ҡоролманы тоҡандырҙы', - 'simpleantispam-label' => "Спамға ҡаршы тикшереү. -Быны '''ТУЛТЫРМАҒЫҘ'''!", - 'simpleantispam-desc' => 'Формаларға ябай спамға/ботҡа ҡаршы тикшереү өҫтәй.', -); - -/** Southern Balochi (بلوچی مکرانی) - * @author Mostafadaneshvar - */ -$messages['bcc'] = array( - 'simpleantispam' => 'شمی اصلاح یک ماکانیزم ضد اسپمی بنگیج کت', - 'simpleantispam-label' => "کنترل ضد اسپم. -ای شیء پر ''مکن''", - 'simpleantispam-desc' => 'اضافه کنت یم ساده اسپم/روبوت چک په کنترل فرم آن', -); - -/** Bikol Central (Bikol Central) - * @author Geopoet - */ -$messages['bcl'] = array( - 'simpleantispam' => 'An saimong pagliwat nakapagkiblit kan anti-espam na mekanismo', - 'simpleantispam-label' => 'Narikisa kan anti-espam. -"Dae" ka magkaag nin laman digde!', - 'simpleantispam-desc' => 'Minadugang nin simplihong rikisa kan espam/panalnga sa mga porma', -); - -/** Belarusian (Taraškievica orthography) (беларуская (тарашкевіца)‎) - * @author EugeneZelenko - */ -$messages['be-tarask'] = array( - 'simpleantispam' => 'Ваша рэдагаваньне ўключыла мэханізм анты-спаму', - 'simpleantispam-label' => "Праверка анты-спаму. -'''НЕ''' запаўняйце тут нічога!", - 'simpleantispam-desc' => 'Дадае ў формы простую праверку на спам/робата', -); - -/** Bulgarian (български) - * @author DCLXVI - * @author Spiritia - */ -$messages['bg'] = array( - 'simpleantispam' => 'Вашата редакция задейства механизма против спам', - 'simpleantispam-label' => "Проверка за спам. -Необходимо е да '''НЕ''' попълвате това поле!", - 'simpleantispam-desc' => 'Добавя прост формуляр за проверка за спам/роботи', -); - -/** Bengali (বাংলা) - * @author Bellayet - */ -$messages['bn'] = array( - 'simpleantispam-label' => "এন্টি-স্প্যাম যাচাই। -এটা পূরণ করবেন '''না'''!", - 'simpleantispam-desc' => 'ফরমগুলো যাচাই করার জন্য একটি স্প্যাম/বট যোগ করুন', -); - -/** Breton (brezhoneg) - * @author Fulup - */ -$messages['br'] = array( - 'simpleantispam' => "Gweredekaet eo bet ar wikefre eneb-strob gant ar c'hemmoù hoc'h eus degaset", - 'simpleantispam-label' => "Taol gwiriañ eneb-strob. -'''Arabat''' merkañ tra pe dra amañ !", - 'simpleantispam-desc' => "Ouzhpennañ a ra taol gwiriañ ur bot strober d'ar furmskridoù", -); - -/** Bosnian (bosanski) - * @author CERminator - */ -$messages['bs'] = array( - 'simpleantispam' => 'Vaša izmjena je uključila mehanizam protiv spama', - 'simpleantispam-label' => "Provjera protiv spama. -'''NE''' popunjavaj ovo!", - 'simpleantispam-desc' => 'Dodaje jednostavnu provjeru od spama/botova u obrasce', -); - -/** Catalan (català) - * @author Jordi Roqué - * @author Paucabot - * @author Ssola - */ -$messages['ca'] = array( - 'simpleantispam' => 'La vostra modificació ha activat un mecanisme anti-spam', - 'simpleantispam-label' => "Comprovació anti-spam. -'''NO''' ho ompliu!", - 'simpleantispam-desc' => 'Inclou un detector simple de spam o bots als formularis', -); - -/** Czech (česky) - * @author Danny B. - */ -$messages['cs'] = array( - 'simpleantispam' => 'Vaše úprava spustila antispamový mechanismus', - 'simpleantispam-label' => "Antispamová kontrola. -'''NEVYPLŇUJTE''' následující!", - 'simpleantispam-desc' => 'Přidává do formulářů jednoduchou kontrolu botů/spamu.', -); - -/** Welsh (Cymraeg) - * @author Lloffiwr - */ -$messages['cy'] = array( - 'simpleantispam' => "Achosodd eich golygiad i'r teclyn gwrth-sbam ddechrau", - 'simpleantispam-label' => "Prawf gwrth-sbam. -'''Peidiwch''' â llenwi hwn!", - 'simpleantispam-desc' => 'Yn ychwanegu prawf sbam/bot syml i ffurflenni', -); - -/** Danish (dansk) - * @author HenrikKbh - */ -$messages['da'] = array( - 'simpleantispam' => 'Din redigering udløste anti-spam mekanismen', - 'simpleantispam-label' => "Anti-spam tjek. -Udfyld ''' ikke ''' dette!", - 'simpleantispam-desc' => 'Tilføjer en simpel spam/bot kontrol til formularer', -); - -/** German (Deutsch) - * @author Kghbln - * @author Raimond Spekking - */ -$messages['de'] = array( - 'simpleantispam' => 'Deine Bearbeitung hat die Spamschutzprüfung ausgelöst.', - 'simpleantispam-label' => "Spamschutzprüfung. -Hier '''NICHTS''' eintragen!", - 'simpleantispam-desc' => 'Ergänzt eine Prüfung zum Schutz vor Spambots', -); - -/** German (formal address) (Deutsch (Sie-Form)‎) - * @author Kghbln - * @author MichaelFrey - */ -$messages['de-formal'] = array( - 'simpleantispam' => 'Ihre Bearbeitung hat die Spamschutzprüfung ausgelöst.', -); - -/** Zazaki (Zazaki) - * @author Aspar - */ -$messages['diq'] = array( - 'simpleantispam' => 'vuriyayişê şıma mekanizmaya anti-spami herikna', - 'simpleantispam-label' => "tehqiqatê Anti-spami. -no '''de mekerê'''!", - 'simpleantispam-desc' => 'Forman re tehqiqatê spami/bot dano', -); - -/** Lower Sorbian (dolnoserbski) - * @author Michawiki - */ -$messages['dsb'] = array( - 'simpleantispam' => 'Twója změna jo zapušćiła antispamowy mechanizm.', - 'simpleantispam-label' => "Antispamowa kontrola. -How '''NIC''' zapisaś!", - 'simpleantispam-desc' => 'Pśidawa formularam jadnoru antispamowu kontrolu pśez bośik', -); - -/** Greek (Ελληνικά) - * @author Dead3y3 - */ -$messages['el'] = array( - 'simpleantispam' => 'Η επεξεργασία σας ενεργοποίησε τον μηχανισμό anti-spam', - 'simpleantispam-label' => "Έλεγχος anti-spam. -'''ΜΗΝ''' το συμπληρώσετε αυτό!", - 'simpleantispam-desc' => 'Προσθέτει έναν απλό έλεγχο spam/bot σε φόρμες', -); - -/** Esperanto (Esperanto) - * @author Yekrats - */ -$messages['eo'] = array( - 'simpleantispam' => 'Via redakto spronis la kontraŭspamilon.', - 'simpleantispam-label' => 'Kontrolo kontraŭ spamo. -NE ENIGU ion ajn!', - 'simpleantispam-desc' => 'Aldonas simplan kontraŭspamilon/kontraŭrobotilon al paĝoj', -); - -/** Spanish (español) - * @author Crazymadlover - * @author Sanbec - */ -$messages['es'] = array( - 'simpleantispam' => 'Su edición encendió el mecanismo anti-spam', - 'simpleantispam-label' => 'Comprobación anti-spam -¡NO rellenes esto!', - 'simpleantispam-desc' => 'Añade un control simple de spam y bots a los formularios', -); - -/** Estonian (eesti) - * @author Pikne - */ -$messages['et'] = array( - 'simpleantispam' => 'Sinu muudatus päästis valla rämpspostivastase seadeldise.', - 'simpleantispam-label' => "Rämpspostikontroll. -'''ÄRA''' täida seda välja!", - 'simpleantispam-desc' => 'Lisab lihtsa rämpsposti- ja robotikontrolli vormiväljade jaoks.', -); - -/** Basque (euskara) - * @author Kobazulo - */ -$messages['eu'] = array( - 'simpleantispam' => 'Zure aldaketak anti-spam mekanismoa abiarazi du', - 'simpleantispam-label' => "Anti-spam egiaztapena. -Atal hau '''EZ''' bete!", - 'simpleantispam-desc' => 'Spam/bot baten egiaztapen sinple bat eransten du', -); - -/** Persian (فارسی) - * @author Huji - * @author Meisam - */ -$messages['fa'] = array( - 'simpleantispam' => 'ویرایش شما مکانیسم ضدهرزنگاری را فعال کرد', - 'simpleantispam-label' => "بررسی ضدهرزنگاری. -این قسمت را پر '''نکنید'''!", - 'simpleantispam-desc' => 'یک بررسی ساده برای هرزنگاری/ربات به فرم‌ها اضافه می‌کند', -); - -/** Finnish (suomi) - * @author Jack Phoenix - * @author Nike - */ -$messages['fi'] = array( - 'simpleantispam' => 'Muokkauksesi laukaisi mainostentorjujamekanismin', - 'simpleantispam-label' => "Mainostenvastainen tarkistus. '''ÄLÄ''' täytä tätä!", - 'simpleantispam-desc' => 'Lisää yksinkertaisen mainos- ja bottitarkistuksen lomakkeisiin.', -); - -/** French (français) - * @author Grondin - * @author Verdy p - */ -$messages['fr'] = array( - 'simpleantispam' => 'Votre modification a déclenché le mécanisme anti-spam', - 'simpleantispam-label' => "Vérification anti-spam. -Ne '''RIEN''' inscrire ici !", - 'simpleantispam-desc' => 'Ajoute au formulaire la vérification d’un bot spammeur', -); - -/** Franco-Provençal (arpetan) - * @author ChrisPtDe - */ -$messages['frp'] = array( - 'simpleantispam' => 'Voutron changement at dècllenchiê lo mècanismo anti-spame', - 'simpleantispam-label' => "Contrôlo anti-spame. -Enscrîde '''REN''' ique !", - 'simpleantispam-desc' => 'Apond u formulèro lo contrôlo d’un bot spamor.', -); - -/** Galician (galego) - * @author Toliño - */ -$messages['gl'] = array( - 'simpleantispam' => 'A súa edición activou o mecanismo antispam', - 'simpleantispam-label' => "Comprobación antispam. -'''NON''' encha isto!", - 'simpleantispam-desc' => 'Engade unha verificación simple de spam por parte de bots nos formularios', -); - -/** Swiss German (Alemannisch) - * @author Als-Holder - */ -$messages['gsw'] = array( - 'simpleantispam' => 'Dyyni Bearbeitig het dr Spamschutz usglest.', - 'simpleantispam-label' => "Spamschutz-Priefig. Do '''nyt''' yytrage!", - 'simpleantispam-desc' => 'Ergänzt Formular um e eifache Bot-Spamschutz', -); - -/** Gujarati (ગુજરાતી) - * @author Sushant savla - */ -$messages['gu'] = array( - 'simpleantispam' => 'તમારા ફેરફારને કારણે ઍન્ટી-સ્પૅમ કાર્યપ્રણાલી જાગ્રત થઈ', - 'simpleantispam-label' => "સ્પૅમ વિરોધી તપાસ. -આને '''ન''' ભરશો!", - 'simpleantispam-desc' => 'અરજી પત્ર પર સરળ સ્પૅમ / બૉટ ઉમેરે છે', -); - -/** Hebrew (עברית) - * @author Rotem Liss - */ -$messages['he'] = array( - 'simpleantispam' => 'עריכתכם הפעילה את מנוע האנטי־ספאם', - 'simpleantispam-label' => "בדיקת אנטי־ספאם. -'''אל''' תמלאו שדה זה!", - 'simpleantispam-desc' => 'הוספת בדיקה פשוטה של ספאם/בוט לטפסים', -); - -/** Hindi (हिन्दी) - * @author Kaustubh - */ -$messages['hi'] = array( - 'simpleantispam' => 'आपके बदलावोंसे ऍंटी-स्पॅम मेकेनिझम शुरू हो गया हैं', - 'simpleantispam-label' => "ऍन्टी-स्पैम जाँच. -इसे भरें '''नहीं'''!", - 'simpleantispam-desc' => 'फ़ार्ममें सादी स्पैम/बोट जाँच बढाता हैं', -); - -/** Croatian (hrvatski) - * @author Dalibor Bosits - */ -$messages['hr'] = array( - 'simpleantispam' => 'Vaše uređivanje je pokrenulo anti-spam mehanizam', - 'simpleantispam-label' => "Anti-spam provjera. -'''Ne''' ispunjavajte ovo!", - 'simpleantispam-desc' => 'Dodaje jednostavnu provjeru za spam/bot', -); - -/** Upper Sorbian (hornjoserbsce) - * @author Michawiki - */ -$messages['hsb'] = array( - 'simpleantispam' => 'Twoja změna je mechanizm přećiwo spamej zahibała', - 'simpleantispam-label' => "Kontrola přećiwo spamej. -Tu '''ničo''' njezapisać!", - 'simpleantispam-desc' => 'Přidawa formularam jednoru spamowu kontrolu přez boćik', -); - -/** Hungarian (magyar) - * @author Bdamokos - * @author Dani - * @author Glanthor Reviol - */ -$messages['hu'] = array( - 'simpleantispam' => 'A szerkesztésed egy spamellenes mechanizmust aktivált.', - 'simpleantispam-label' => "Spam elleni ellenőrzés. -'''NE''' töltsd ezt ki!", - 'simpleantispam-desc' => 'Egyszerű spam és bot elleni ellenőrzés hozzáadása űrlapokhoz', -); - -/** Interlingua (interlingua) - * @author McDutchie - */ -$messages['ia'] = array( - 'simpleantispam' => 'Tu modification ha activate le mechanismo antispam', - 'simpleantispam-label' => "Verification antispam. -'''NON''' completa isto!", - 'simpleantispam-desc' => 'Adde un verification antispam/antibot simple al formularios', -); - -/** Indonesian (Bahasa Indonesia) - * @author Rex - */ -$messages['id'] = array( - 'simpleantispam' => 'Suntingan Anda memicu mekanisme anti-spam', - 'simpleantispam-label' => "Pemeriksaan anti-spam. -Masukan ini '''DILARANG'''!", - 'simpleantispam-desc' => 'Tambahkan pemeriksaan spam/bot sederhana ke formulir-formulir', -); - -/** Iloko (Ilokano) - * @author Lam-ang - */ -$messages['ilo'] = array( - 'simpleantispam' => 'Ti inurnos mo ket kinalbit na ti kontra-spam a mekanismo', - 'simpleantispam-label' => "Kontra-spam a panagkita. - '''Saan''' mo a suratan daytoy!", - 'simpleantispam-desc' => 'Agnayon ti nalaka a spam/bot panagkita iti nakabuklan', -); - -/** Icelandic (íslenska) - * @author Snævar - */ -$messages['is'] = array( - 'simpleantispam' => 'Breytingin þín setti af stað kæfuvörn.', - 'simpleantispam-label' => 'Kæfuvörn. -Ekki fylla þetta út!', -); - -/** Italian (italiano) - * @author Darth Kule - */ -$messages['it'] = array( - 'simpleantispam' => 'Il tuo edit ha attivato il meccanismo anti-spam', - 'simpleantispam-label' => "Controllo anti-spam. -'''NON''' riempire!", - 'simpleantispam-desc' => 'Aggiunge un semplice controllo spam/bot ai moduli', -); - -/** Japanese (日本語) - * @author Aotake - * @author Muttley - * @author Shirayuki - */ -$messages['ja'] = array( - 'simpleantispam' => '編集内容が原因でスパム防止機能が発動しました', - 'simpleantispam-label' => "SPAM防止チェックです。 -決してここに値を入力'''しない'''でください。", - 'simpleantispam-desc' => 'フォームに簡単なスパム/ボット チェックを追加', -); - -/** Javanese (Basa Jawa) - * @author Pras - */ -$messages['jv'] = array( - 'simpleantispam' => 'Suntingan panjenengan nggugah mékanisme anti-spam', - 'simpleantispam-label' => "Pamariksan anti-spam. -'''Aja''' diisèkaké!", - 'simpleantispam-desc' => 'Tambahaké pamriksan spam/bot prasaja menyang formulir', -); - -/** Georgian (ქართული) - * @author BRUTE - * @author David1010 - */ -$messages['ka'] = array( - 'simpleantispam' => 'თქვენმა რედაქტირებამ ჩართო ანტი-სპამის მექანიზმი', - 'simpleantispam-label' => "ანტი-სპამის შემოწმება. -'''არ''' შეავსოთ ის!", - 'simpleantispam-desc' => 'ფორმაზე ამატებს სპამისა და ბოტების მარტივ შემოწმებას', -); - -/** Korean (한국어) - * @author Klutzy - * @author Kwj2772 - * @author Yknok29 - * @author 아라 - */ -$messages['ko'] = array( - 'simpleantispam' => '현재 편집이 스팸 방지 장치에 탐지되었습니다', - 'simpleantispam-label' => "스팸 방지 검사입니다. -이것을 입력하지 '''마세요'''!", - 'simpleantispam-desc' => '양식에 간단한 스팸/봇 확인 장치를 추가합니다', -); - -/** Colognian (Ripoarisch) - * @author Purodha - */ -$messages['ksh'] = array( - 'simpleantispam' => 'Deine Änderung hät unsere SPAMschotz op der Plan jeroofe', - 'simpleantispam-label' => 'SPAMschotz — donn hee nix endraare!', - 'simpleantispam-desc' => 'Deit enne ëijfache Schoz jäje Bots un SPAM bëij de Formolare dobëij.', -); - -/** Luxembourgish (Lëtzebuergesch) - * @author Robby - */ -$messages['lb'] = array( - 'simpleantispam' => 'Är Ännerung huet den anti-spam Mekanismus ausgeléist', - 'simpleantispam-label' => "Anti-Spam Kontroll. -Fëllt '''näischt''' hei ënnendrënner aus!", - 'simpleantispam-desc' => 'Setzt eng einfach Spam/Bot Kontroll a Formulairen derbäi', -); - -/** Limburgish (Limburgs) - * @author Matthias - */ -$messages['li'] = array( - 'simpleantispam' => "Oew bewerking heet 't antispammechanisme in werking gesteld", - 'simpleantispam-label' => "Antispemcontrole. -Vol dit veld '''NEET''' in!", - 'simpleantispam-desc' => 'Veug ein einvaawdife spem/botcontrole aan formulere', -); - -/** Lithuanian (lietuvių) - * @author Homo - * @author Matasg - */ -$messages['lt'] = array( - 'simpleantispam' => 'Jūsų redagavimas paleido anti-spam mechanizmą', - 'simpleantispam-label' => "Anti-spam patikra. -'''NE'''pildykite!", - 'simpleantispam-desc' => 'Prideda paprastą reklaminių šiukšlių botą formoms tikrinti', -); - -/** Latvian (latviešu) - * @author Xil - */ -$messages['lv'] = array( - 'simpleantispam' => 'Tevis veiktās izmaiņas ir iedarbināja pretspama mehānismu', - 'simpleantispam-label' => "Pretspama pārbaude. - '''NEAIZPILDĪT!'''", - 'simpleantispam-desc' => 'Pievieno vienkāršu spama/botu pārbaudi veidlapas', -); - -/** Minangkabau (Baso Minangkabau) - * @author Iwan Novirion - */ -$messages['min'] = array( - 'simpleantispam' => 'Suntiangan Sanak mamicu mekanisme anti-spam', - 'simpleantispam-label' => "Pamarisoan anti-spam. -Masukan ko '''DILARANG'''!", - 'simpleantispam-desc' => 'Tambahkan pamarisoan spam/bot sadarano ka formulir', -); - -/** Macedonian (македонски) - * @author Bjankuloski06 - */ -$messages['mk'] = array( - 'simpleantispam' => 'Вашето уредување го предизвика анти-спам механизмот', - 'simpleantispam-label' => "Антиспам проверка. -'''НЕ''' го пополнувајте ова!", - 'simpleantispam-desc' => 'Додава едноставна проверка за спам/ботови на обрасците', -); - -/** Malayalam (മലയാളം) - * @author Praveenp - */ -$messages['ml'] = array( - 'simpleantispam' => 'താങ്കളുടെ തിരുത്തൽ സ്പാം വിരുദ്ധ തന്ത്രത്തെ ഉണർത്തിയിരിക്കുന്നു', - 'simpleantispam-label' => "സ്പാം വിരുദ്ധ പരിശോധന. -ഇത് '''പൂരിപ്പിക്കരുത്'''", - 'simpleantispam-desc' => 'ഫോമുകൾക്കായുള്ള ലളിതമായ പാഴെഴുത്ത്/ബോട്ട് പരിശോധന കൂട്ടിച്ചേർക്കുന്നു', -); - -/** Marathi (मराठी) - * @author Kaustubh - */ -$messages['mr'] = array( - 'simpleantispam' => 'तुमच्या संपादनामुळे चिखलणी विरोधक चाळणी सुरु झालेली आहे', - 'simpleantispam-label' => "चिखलणी विरोधक तपासणी. -हे भरू '''नका'''!", - 'simpleantispam-desc' => 'अर्जांमध्ये एक साधी स्पॅम/सांगकाम्या तपासणी वाढवितो', -); - -/** Malay (Bahasa Melayu) - * @author Aviator - */ -$messages['ms'] = array( - 'simpleantispam' => 'Suntingan anda ditahan oleh pemeriksa anti-spam', - 'simpleantispam-label' => "Pemeriksaan anti-spam. '''JANGAN''' isi ruangan ini!", - 'simpleantispam-desc' => 'Menambah pemeriksaan spam/bot ringkas di borang sunting', -); - -/** Norwegian Bokmål (norsk bokmål) - */ -$messages['nb'] = array( - 'simpleantispam' => 'Redigeringen din utløste antispammekanismen', - 'simpleantispam-label' => "Antispamsjekk. -'''IKKE''' fyll inn dette feltet!", - 'simpleantispam-desc' => 'Legger til en enkel spam-/robot-sjekk på skjemaer', -); - -/** Low German (Plattdüütsch) - * @author Slomox - */ -$messages['nds'] = array( - 'simpleantispam' => 'Dien Ännern hett den Spamschutz utlööst.', - 'simpleantispam-label' => "Antispam-Kuntrull. Hier '''nix''' indragen!", - 'simpleantispam-desc' => 'Föögt en eenfachen Bot-Spamschutz to Formularen to', -); - -/** Dutch (Nederlands) - * @author Siebrand - */ -$messages['nl'] = array( - 'simpleantispam' => 'Uw bewerking heeft het antispammechanisme in werking gesteld', - 'simpleantispam-label' => "Antispamcontrole. -Vul dit veld '''NIET''' in!", - 'simpleantispam-desc' => 'Voegt een eenvoudige spam/botcontrole toe aan formuleren', -); - -/** Nederlands (informeel)‎ (Nederlands (informeel)‎) - * @author Siebrand - */ -$messages['nl-informal'] = array( - 'simpleantispam' => 'Je bewerking heeft het antispammechanisme in werking gesteld', -); - -/** Norwegian Nynorsk (norsk nynorsk) - * @author Harald Khan - * @author Njardarlogar - */ -$messages['nn'] = array( - 'simpleantispam' => 'Endringa di utløyste antispam-mekanismen.', - 'simpleantispam-label' => "Antispam-kontroll. -'''IKKJE''' fyll ut dette feltet!", - 'simpleantispam-desc' => 'Legg til ein enkel spam-/robotsjekk på skjema', -); - -/** Occitan (occitan) - * @author Cedric31 - */ -$messages['oc'] = array( - 'simpleantispam' => 'Vòstre cambiament a desenclavat lo mecanisme antispam', - 'simpleantispam-label' => "Verificacion antispam. -Inscrigatz '''PAS RES''' dedins !", - 'simpleantispam-desc' => 'Apond al formulari la verificacion d’un bòt tarabastejaire', -); - -/** Oriya (ଓଡ଼ିଆ) - * @author Psubhashish - */ -$messages['or'] = array( - 'simpleantispam' => 'ଆପଣଙ୍କ ସମ୍ପାଦନ ସ୍ପାମ-ବିରୋଧି ତନ୍ତ୍ରକୁ ସଚଳ କରିଦେଲା', - 'simpleantispam-label' => "ସ୍ପାମ-ବିରୋଧି ପରଖ । -ଏହାକୁ ଭରନ୍ତୁ '''ନାହିଁ''' !", - 'simpleantispam-desc' => 'ଏକ ସରଳ ସ୍ପାମ/ଆପେଆପେ ଚାଳିତ ସଭ୍ୟ ଦେଇ ଫର୍ମ ପରଖିବେ', -); - -/** Polish (polski) - * @author Sp5uhe - */ -$messages['pl'] = array( - 'simpleantispam' => 'Twoja edycja zostanie sprawdzona mechanizmem antyspamowym', - 'simpleantispam-label' => "Filtr antyspamowy. -'''NIE''' wpisuj tu nic!", - 'simpleantispam-desc' => 'Dodaje do formularzy proste zabezpieczenie przed spamem i automatami', -); - -/** Piedmontese (Piemontèis) - * @author Dragonòt - */ -$messages['pms'] = array( - 'simpleantispam' => "Toa modìfica a l'ha ativà ël mecànism anti-spam", - 'simpleantispam-label' => "Control anti-spam. -Vemp '''PA''' sòn-sì!", - 'simpleantispam-desc' => 'A gionta un sempi control spam/bot a le forme', -); - -/** Western Punjabi (پنجابی) - * @author Khalid Mahmood - */ -$messages['pnb'] = array( - 'simpleantispam' => 'تھواڈی تبدیلی نیں سپام روک پربندھ چلادتا اے', - 'simpleantispam-label' => 'سپام روک پھاٹک -ایدے تے ناں لکھو۔', - 'simpleantispam-desc' => 'اک سادہ سپام/بوٹ روک رلاؤ۔', -); - -/** Portuguese (português) - * @author 555 - */ -$messages['pt'] = array( - 'simpleantispam' => 'A sua edição activou o mecanismo anti-spam', - 'simpleantispam-label' => "Verificação de spam -'''NÃO''' preencha isto!", - 'simpleantispam-desc' => 'Adiciona em formulários um verificador de spam simples', -); - -/** Brazilian Portuguese (português do Brasil) - * @author Eduardo.mps - */ -$messages['pt-br'] = array( - 'simpleantispam' => 'A sua edição ativou o mecanismo anti-spam', - 'simpleantispam-label' => "Verificação de spam -'''NÃO''' preencha isto!", - 'simpleantispam-desc' => 'Adiciona um verificador simples de spam/robôs em formulários', -); - -/** Romanian (română) - * @author Stelistcristi - */ -$messages['ro'] = array( - 'simpleantispam' => 'Editarea dvs a declanșat mecanismul antispam', - 'simpleantispam-label' => "Verificare antispam. -'''NU''' completați !", -); - -/** tarandíne (tarandíne) - * @author Joetaras - */ -$messages['roa-tara'] = array( - 'simpleantispam' => "Le cangiaminde tune sonde tracciate da 'nu meccanisme andi-spam", - 'simpleantispam-label' => "Verifiche andi-spam. -'''NO''' anghiè quiste!", - 'simpleantispam-desc' => "Aggiunge 'na verifiche semblice de spam/bot jndr'à le module", -); - -/** Russian (русский) - * @author Александр Сигачёв - */ -$messages['ru'] = array( - 'simpleantispam' => 'Ваша правка включила механизм анти-спама', - 'simpleantispam-label' => 'Анти-спам проверка. -НЕ заполняйте это!', - 'simpleantispam-desc' => 'Добавляет на форму простую проверку на спам и ботов', -); - -/** Rusyn (русиньскый) - * @author Gazeb - */ -$messages['rue'] = array( - 'simpleantispam' => 'Ваша управа спустила антіспамовый механізм', - 'simpleantispam-label' => "Перевірка на спам. -'''НЕ''' заповнюйте тото!", - 'simpleantispam-desc' => 'Придасть до формуларїв просте овірїня ботів/спаму', -); - -/** Sanskrit (संस्कृतम्) - * @author Shubha - */ -$messages['sa'] = array( - 'simpleantispam' => 'भवतः सम्पादनेन एण्टि-स्पाम्-तन्त्रं सक्रियं जातम्', - 'simpleantispam-label' => "अनिष्टसन्देशविरोधपरीक्षणम् । -अस्मिन् '''नहि''' पूर्यताम् !", - 'simpleantispam-desc' => 'प्रपत्रे सरलानिष्टसन्देशः / बाट्-परीक्षणं योज्यते', -); - -/** Sakha (саха тыла) - * @author HalanTul - */ -$messages['sah'] = array( - 'simpleantispam' => 'Эн көннөрүүҥ анти-спамы холбоото', - 'simpleantispam-label' => "Анти-спам бэрэбиэркэтэ. -Маны '''толорумаҥ'''!", - 'simpleantispam-desc' => 'Спам уонна робот туттулларын билэр судургу бэрэбиэркэни эбэр', -); - -/** Sinhala (සිංහල) - * @author Budhajeewa - */ -$messages['si'] = array( - 'simpleantispam' => 'ඔබේ සංස්කරණය ප්‍රති-ස්පෑම ක්‍රියා පිළිවෙල සක්‍රීය කළේය', - 'simpleantispam-label' => "ප්‍රති-ස්පෑම පරීක්‍ෂාව. -කරුණාකර මෙය පුරවන්න '''එපා'''!", - 'simpleantispam-desc' => 'ෆෝරමයන් වෙත සරල ස්පෑම/බොට් පරීක්‍ෂාවක් එක් කරයි', -); - -/** Slovak (slovenčina) - * @author Helix84 - */ -$messages['sk'] = array( - 'simpleantispam' => 'Vaša úprava spustila antispamový mechanizmus', - 'simpleantispam-label' => "Antispamová kontrola. -'''NEVYPĹŇAJTE''' nasledovné!", - 'simpleantispam-desc' => 'Pridáva k formulárom jednoduchú ochranu prosti botom/spamu.', -); - -/** Slovenian (slovenščina) - * @author Dbc334 - */ -$messages['sl'] = array( - 'simpleantispam' => 'Vaše urejanje je sprožilo mehanizem proti smetju', - 'simpleantispam-label' => "Preverjanje proti smetju. -'''NE''' izpolnite tega!", - 'simpleantispam-desc' => 'Doda preprosto preverjanje smetja/botov v obrazce', -); - -/** Albanian (shqip) - * @author Olsi - */ -$messages['sq'] = array( - 'simpleantispam' => 'Redaktimi juaj shkaktoi mekanizmin anti-spam', - 'simpleantispam-label' => "Kontroll anti-spam. -'''MOS''' e plotësoni këtë!", - 'simpleantispam-desc' => 'Shton një kontroll spam/bot të thjeshtë tek format', -); - -/** Serbian (Cyrillic script) (српски (ћирилица)‎) - * @author Millosh - */ -$messages['sr-ec'] = array( - 'simpleantispam' => 'Твоја измена је покренула антиспам механизам.', - 'simpleantispam-label' => "Провера спама. '''НЕ''' попуњавај ово унутра!", - 'simpleantispam-desc' => 'Додаје једноставну спам/бот проверу у форме.', -); - -/** Serbian (Latin script) (srpski (latinica)‎) - * @author Michaello - */ -$messages['sr-el'] = array( - 'simpleantispam' => 'Tvoja izmena je pokrenula antispam mehanizam.', - 'simpleantispam-label' => "Provera spama. '''NE''' popunjavaj ovo unutra!", - 'simpleantispam-desc' => 'Dodaje jednostavnu spam/bot proveru u forme.', -); - -/** Seeltersk (Seeltersk) - * @author Pyt - */ -$messages['stq'] = array( - 'simpleantispam' => 'Dien Beoarbaidenge häd dän Spamskuts uutlöösd.', - 'simpleantispam-label' => "Spamskuts-Wröige. Hier '''niks''' iendreege!", - 'simpleantispam-desc' => 'Föiget do Formulare n eenfachen Bot-Spamskuts bietou', -); - -/** Swedish (svenska) - * @author M.M.S. - * @author Skalman - */ -$messages['sv'] = array( - 'simpleantispam' => 'Din redigering utlöste anti-spam mekanismen', - 'simpleantispam-label' => "Anti-spam koll. -Fyll '''INTE''' i det här!", - 'simpleantispam-desc' => 'Lägger till en enkel spam-/robot-koll till formulär', -); - -/** Tamil (தமிழ்) - * @author மதனாஹரன் - */ -$messages['ta'] = array( - 'simpleantispam-desc' => 'படிவங்களில் ஓர் எளிய எரித/தானியங்கிச் சரிபார்ப்பை இணைக்கும்', -); - -/** Turkmen (Türkmençe) - * @author Hanberke - */ -$messages['tk'] = array( - 'simpleantispam' => 'Özgerdişiňiz anti-spam mehanizmini işletdi', - 'simpleantispam-label' => "Anti-spam barlagy. -Muny '''DOLDURMAŇ'''!", - 'simpleantispam-desc' => 'Formlara ýönekeý spam/bot barlagyny goşýar', -); - -/** Tagalog (Tagalog) - * @author AnakngAraw - */ -$messages['tl'] = array( - 'simpleantispam' => "Nakapagpagalaw sa mekanismong panlaban ng \"manlulusob\" (''spam'') ang pagbabagong ginawa mo", - 'simpleantispam-label' => "Pagsusuring panlaban sa \"manlulusob\" (''spam''). -'''HUWAG''' itong lagyan ng laman!", - 'simpleantispam-desc' => "Nagdaragdag ng isang payak na pansuri ng \"manlulusob\" (''spam'') o ''bot'' sa mga pormularyo", -); - -/** Turkish (Türkçe) - * @author Joseph - */ -$messages['tr'] = array( - 'simpleantispam' => 'Değişikliğiniz anti-spam mekanizmasını harekete geçirdi', - 'simpleantispam-label' => "Anti-spam denetimi. -Bunu '''doldurmayın'''!", - 'simpleantispam-desc' => 'Formlara basit bir spam/bot denetimi ekler', -); - -/** Ukrainian (українська) - * @author AS - */ -$messages['uk'] = array( - 'simpleantispam' => 'Ваше редагування запустило механізм захисту перед спамом', - 'simpleantispam-label' => "Перевірка на спам. -'''НЕ''' заповнюйте це!", - 'simpleantispam-desc' => 'Додає на форму простий механізм перевірки на спам/бота', -); - -/** Urdu (اردو) - * @author පසිඳු කාවින්ද - */ -$messages['ur'] = array( - 'simpleantispam-desc' => 'فارم کے لئے ایک سادہ سپیم/بیوٹی چیک کہتے ہیں', -); - -/** vèneto (vèneto) - * @author Candalua - */ -$messages['vec'] = array( - 'simpleantispam' => 'La to modifica la ga fato scatar el mecanismo de controlo anti spam.', - 'simpleantispam-label' => "Controlo anti spam. -'''NO STA''' scrivar gnente qua de soto!", - 'simpleantispam-desc' => 'Zonta ai moduli un senplice controlo de spam/bot.', -); - -/** Vietnamese (Tiếng Việt) - * @author Vinhtantran - */ -$messages['vi'] = array( - 'simpleantispam' => 'Sửa đổi của bạn đã kích hoạt cơ chế chống spam', - 'simpleantispam-label' => "Kiểm tra chống spam. -Xin '''ĐỪNG''' điền gì vào!", - 'simpleantispam-desc' => 'Thêm một kiểm tra spam/bot vào mẫu', -); - -/** Volapük (Volapük) - * @author Smeira - */ -$messages['vo'] = array( - 'simpleantispam' => 'Redakam olik ekodon blokami fa sul taspamik', -); - -/** Cantonese (粵語) - * @author Shinjiman - */ -$messages['yue'] = array( - 'simpleantispam' => '你嘅編輯已經觸發咗防垃圾裝置', - 'simpleantispam-label' => "反垃圾檢查。 -'''唔好'''加入呢個!", - 'simpleantispam-desc' => '加一個簡單嘅垃圾/機械人檢查表格', -); - -/** Simplified Chinese (中文(简体)‎) - * @author Hzy980512 - * @author PhiLiP - * @author Shinjiman - */ -$messages['zh-hans'] = array( - 'simpleantispam' => '您的编辑已经触发了反垃圾装置', - 'simpleantispam-label' => "反垃圾检查。 -'''不要'''加入这个!", - 'simpleantispam-desc' => '对表格添加一个简单的垃圾邮件或自动程序检查机制', -); - -/** Traditional Chinese (中文(繁體)‎) - * @author Mark85296341 - * @author Shinjiman - */ -$messages['zh-hant'] = array( - 'simpleantispam' => '您的編輯已經觸發了防垃圾裝置', - 'simpleantispam-label' => "反垃圾檢查。 -'''不要'''加入這個!", - 'simpleantispam-desc' => '加一個簡單的垃圾/機器人檢查表格', -); diff --git a/extensions/SimpleAntiSpam/SimpleAntiSpam.php b/extensions/SimpleAntiSpam/SimpleAntiSpam.php deleted file mode 100644 index 82fff7bc..00000000 --- a/extensions/SimpleAntiSpam/SimpleAntiSpam.php +++ /dev/null @@ -1,69 +0,0 @@ -require_once( "\$IP/extensions/SimpleAntiSpam/SimpleAntiSpam.php" );\n - To verify the installation, browse to the Special:Version page on your wiki.\n -EOM; - die( 1 ); -} - -$wgExtensionCredits['antispam'][] = array( - 'path' => __FILE__, - 'name' => 'SimpleAntiSpam', - 'descriptionmsg' => 'simpleantispam-desc', - 'author' => 'Ryan Schmidt', - 'url' => 'https://www.mediawiki.org/wiki/Extension:SimpleAntiSpam', - 'version' => '1.1.0', -); - -$wgExtensionMessagesFiles['SimpleAntiSpam'] = __DIR__ . '/SimpleAntiSpam.i18n.php'; -$wgHooks['EditPage::showEditForm:fields'][] = 'efSimpleAntiSpamField'; -$wgHooks['EditPage::attemptSave'][] = 'efSimpleAntiSpamCheck'; - -/** - * Add the form field - * @param $editpage EditPage - * @param $out OutputPage - * @return bool - */ -function efSimpleAntiSpamField( &$editpage, &$out ) { - $out->addHTML( "
        - -
        \n" ); - return true; -} - -/** - * Check for the field and if it isn't empty, negate the save - * - * @param $editpage EditPage - * @return bool - */ -function efSimpleAntiSpamCheck( $editpage ) { - global $wgRequest, $wgUser; - $spam = $wgRequest->getText( 'wpAntispam' ); - if ( $spam !== '' ) { - wfDebugLog( - 'SimpleAntiSpam', - $wgUser->getName() . - ' editing "' . - $editpage->mTitle->getPrefixedText() . - '" submitted bogus field "' . - $spam . - '"' - ); - $editpage->spamPageWithContent(); - return false; - } - return true; -} diff --git a/extensions/SpamBlacklist/.gitreview b/extensions/SpamBlacklist/.gitreview deleted file mode 100644 index d74ae8f9..00000000 --- a/extensions/SpamBlacklist/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/SpamBlacklist.git -defaultbranch=master diff --git a/extensions/SpamBlacklist/SpamBlacklist.i18n.php b/extensions/SpamBlacklist/SpamBlacklist.i18n.php index 3dd1a487..af397dba 100644 --- a/extensions/SpamBlacklist/SpamBlacklist.i18n.php +++ b/extensions/SpamBlacklist/SpamBlacklist.i18n.php @@ -56,7 +56,7 @@ $messages['en'] = array( 'spam-blacklist-desc' => 'Regex-based anti-spam tool allowing to blacklist URLs in pages and email addresses for registered users', 'log-name-spamblacklist' => 'Spam blacklist log', 'log-description-spamblacklist' => 'These events track spam blacklist hits.', - 'logentry-spamblacklist-hit' => '{{GENDER:$2|$1}} caused a spam blacklist hit on $3 by attempting to add $4.', + 'logentry-spamblacklist-hit' => '$1 caused a spam blacklist hit on $3 by attempting to add $4.', 'right-spamblacklistlog' => 'View spam blacklist log', 'action-spamblacklistlog' => 'view the spam blacklist log', ); @@ -88,8 +88,10 @@ Parameters: 'log-description-spamblacklist' => 'Description of spam blacklist log', 'logentry-spamblacklist-hit' => 'Log entry that is created when a user adds a link that is blacklisted on the spam blacklist. -{{logentry}} -Additional parameters: +Parameters: +* $1 - a user link, for example "Jane Doe (Talk | contribs)" +* $2 - (Optional) a username. Can be used for GENDER +* $3 - the page the user attempted to edit * $4 - the URL the user tried to add', 'right-spamblacklistlog' => '{{doc-right|spamblacklistlog}}', 'action-spamblacklistlog' => '{{doc-action|spamblacklistlog}}', @@ -142,7 +144,6 @@ $messages['an'] = array( ); /** Arabic (العربية) - * @author Asaifm * @author Meno25 * @author OsamaK */ @@ -166,15 +167,8 @@ $messages['ar'] = array( # * كل سطر غير فارغ هو تعبير منتظم يطابق فقط المضيفين داخل الوصلات الخارجية #
        ', - 'spam-blacklisted-email' => 'هذا البريد الإلكتروني مدرج في القائمة السوداء', - 'spam-blacklisted-email-text' => 'بريدك الإلكتروني مدرج في القائمة السوداء وبناءً على ذلك لا يمكنك استخدامه لإرسال رسائل للمستخدمين الأخرين.', - 'spam-blacklisted-email-signup' => 'هذا البريد الإلكتروني مدرج في القائمة السوداء وممنوع من الإستخدام.', 'spam-invalid-lines' => '{{PLURAL:$1||السطر التالي|السطران التاليان|السطور التالية}} في قائمة السبام السوداء {{PLURAL:$1|ليس تعبيرًا منتظمًا صحيحًا|ليسا تعبيرين منتظمين صحيحين|ليست تعبيرات منتظمة صحيحة}} و{{PLURAL:$1||يحتاج|يحتاجان|تحتاج}} إلى أن {{PLURAL:$1||يصحح|يصححان|تصحح}} قبل حفظ الصفحة:', - 'spam-blacklist-desc' => 'أداة ضد السخام تعتمد على التعبيرات النمطية وتسمح بمنع روابط في الصفحات وعنواين البريد الإلكتروني للمستخدمين المسجلين', - 'log-name-spamblacklist' => 'سجل السخام المدرج على القائمة السوداء', - 'log-description-spamblacklist' => 'هذا الأحداث توثق مشاهدات القائمة السوداء للسخام.', - 'right-spamblacklistlog' => 'اعرض سجل السخام المدرج على القائمة السوداء', - 'action-spamblacklistlog' => 'اعرض سجل السخام المدرج على القائمة السوداء', + 'spam-blacklist-desc' => 'أداة ضد السبام تعتمد على التعبيرات المنتظمة: [[MediaWiki:Spam-blacklist]] و [[MediaWiki:Spam-whitelist]]', # Fuzzy ); /** Egyptian Spoken Arabic (مصرى) @@ -254,16 +248,16 @@ $messages['as'] = array( * @author Xuacu */ $messages['ast'] = array( - 'spam-blacklist' => '#
        -# Les URLs esternes que casen con esta llista bloquiaránse cuando s\'amiesten a una páxina.
        -# Esta llista afeuta namái a esta wiki; mire tamién la llista negra global.
        -# Pa ver la documentación vea https://www.mediawiki.org/wiki/Extension:SpamBlacklist
        +	'spam-blacklist' => ' # Les URLs que casen con esta llista se bloquiarán cuando s\'añadan a una páxina.
        + # Esta llista afeuta namái a esta wiki; mira tamién la llista negra global.
        + # Pa ver la documentación visita https://www.mediawiki.org/wiki/Extension:SpamBlacklist
        + # 
         #
         # La sintaxis ye ésta:
         #  * Tol testu dende un caráuter "#" hasta lo cabero la llinia ye un comentariu
         #  * Toa llinia non balera ye un fragmentu regex qu\'afeuta namái a los sirvidores de les URLs
         
        -#
        ', + #
        ', 'spam-whitelist' => ' #
         # Les URLs esternes d\'esta llista *nun* se bloquiarán inda si quedaríen bloquiaes
         # por una entrada na llista negra.
        @@ -323,7 +317,7 @@ $messages['ba'] = array(
         # * # хәрефенән башлап юл аҙағына тиклем барыһы ла иҫкәрмә тип иҫәпләнә
         # * Һәр буш булмаған юл URL эсендәге төйөнгә генә ҡулланылған регуляр аңлатманың өлөшө булып тора
         #
        ', - 'spam-invalid-lines' => 'Түбәндәге ҡара исемлек {{PLURAL:$1|1=юлында|юлдарында}} хаталы регуляр {{PLURAL:$1|1=аңлатма|аңлатмалар}} бар һәм {{PLURAL:$1|1=ул|улар}} битте һаҡлар алдынан төҙәтелергә тейеш:', # Fuzzy + 'spam-invalid-lines' => 'Түбәндәге ҡара исемлек {{PLURAL:$1|юлында|юлдарында}} хаталы регуляр {{PLURAL:$1|аңлатма|аңлатмалар}} бар һәм {{PLURAL:$1|ул|улар}} битте һаҡлар алдынан төҙәтелергә тейеш:', 'spam-blacklist-desc' => 'Регуляр аңлатмаларға нигеҙләнгән спамға ҡаршы ҡорал: [[MediaWiki:Spam-blacklist]] һәм [[MediaWiki:Spam-whitelist]]', # Fuzzy ); @@ -433,7 +427,7 @@ $messages['be-tarask'] = array( 'spam-blacklisted-email' => 'Адрасы электроннай пошты з чорнага сьпісу', 'spam-blacklisted-email-text' => 'З Вашага адрасу электроннай пошты ў цяперашні момант забаронена дасылаць электронныя лісты іншым удзельнікам.', 'spam-blacklisted-email-signup' => 'Пададзены Вамі адрас электроннай пошты ў цяперашні момант знаходзіцца ў чорным сьпісе.', - 'spam-invalid-lines' => '{{PLURAL:$1|1=Наступны радок чорнага сьпісу ўтрымлівае няслушны рэгулярны выраз|Наступныя радкі чорнага сьпісу ўтрымліваюць няслушныя рэгулярныя выразы}} і {{PLURAL:$1|1=павінен быць|павінныя быць}} выпраўлены перад захаваньнем старонкі:', # Fuzzy + 'spam-invalid-lines' => '{{PLURAL:$1|Наступны радок чорнага сьпісу ўтрымлівае няслушны рэгулярны выраз|Наступныя радкі чорнага сьпісу ўтрымліваюць няслушныя рэгулярныя выразы}} і {{PLURAL:$1|павінен быць|павінныя быць}} выпраўлены перад захаваньнем старонкі:', 'spam-blacklist-desc' => 'Антыспамавы інструмэнт, які базуецца на рэгулярных выразах: [[MediaWiki:Spam-blacklist]] і [[MediaWiki:Spam-whitelist]]', # Fuzzy ); @@ -453,7 +447,6 @@ $messages['bjn'] = array( ); /** Bengali (বাংলা) - * @author Aftab1995 * @author Bellayet * @author Nasir8891 * @author Zaheen @@ -484,10 +477,6 @@ $messages['bn'] = array( 'spam-blacklisted-email-signup' => 'আপনার লেখা ইমেইল ঠিকানাটি কালোতালিকাভুক্ত।', 'spam-invalid-lines' => 'নিচের স্প্যাম কালোতালিকার {{PLURAL:$1|লাইন|লাইনগুলি}} অবৈধ রেগুলার {{PLURAL:$1|এক্সপ্রেশন|এক্সপ্রেশন}} ধারণ করছে এবং পাতাটি সংরক্ষণের আগে এগুলি ঠিক করা {{PLURAL:$1|প্রয়োজন|প্রয়োজন}}:', 'spam-blacklist-desc' => 'রেজেক্স-ভিত্তিক স্প্যামরোধী সরঞ্জাম: [[MediaWiki:Spam-blacklist]] এবং [[MediaWiki:Spam-whitelist]]', # Fuzzy - 'log-name-spamblacklist' => 'স্প্যাম কালোতালিকা লগ', - 'log-description-spamblacklist' => 'এই ঘটনাগুলি স্প্যাম কালোতালিকার হিট অনুসরণ।', - 'right-spamblacklistlog' => 'স্প্যাম কালোতালিকা লগ দেখুন', - 'action-spamblacklistlog' => 'স্প্যাম কালোতালিকা লগ দেখুন', ); /** Breton (brezhoneg) @@ -599,15 +588,6 @@ $messages['ca'] = array( 'spam-blacklist-desc' => 'Eina anti-spam basada en regexp: [[MediaWiki:Spam-blacklist]] i [[MediaWiki:Spam-whitelist]]', # Fuzzy ); -/** Chechen (нохчийн) - * @author Умар - */ -$messages['ce'] = array( - 'spam-blacklist-desc' => 'Анти-спам гӀирс URL дӀакъовла таро хуьлуьйту агӀонашкахь а электронан почтехь а дӀабазбелачу декъашхошна', - 'log-name-spamblacklist' => 'Спам-кехатан тептар', - 'log-description-spamblacklist' => 'Спам-кехато зулам долоре хьожу тептар.', -); - /** Sorani Kurdish (کوردی) * @author Calak */ @@ -615,7 +595,7 @@ $messages['ckb'] = array( 'right-spamblacklistlog' => 'دیتنی لۆگی پێرستی ڕەشی ڕیکلام', ); -/** Czech (čeština) +/** Czech (česky) * @author Li-sung * @author Matěj Grabovský * @author Mormegil @@ -662,12 +642,7 @@ $messages['cs'] = array( 'spam-blacklisted-email-text' => 'Vaše e-mailová adresa je momentálně uvedena na černé listině, takže ostatním uživatelům nemůžete posílat e-maily.', 'spam-blacklisted-email-signup' => 'Uvedená e-mailová adresa je v současné době na černé listině.', 'spam-invalid-lines' => 'Na černé listině spamu {{PLURAL:$1|je následující řádka neplatný regulární výraz|jsou následující řádky neplatné regulární výrazy|jsou následující řádky regulární výrazy}} a je nutné {{PLURAL:$1|ji|je|je}} před uložením stránky opravit :', - 'spam-blacklist-desc' => 'Antispamový nástroj na základě regulárních výrazů umožňující zakázat URL ve stránkách a e-mailových adresách registrovaných uživatelů', - 'log-name-spamblacklist' => 'Kniha protispamové černé listiny', - 'log-description-spamblacklist' => 'Tyto události sledují zásahy protispamové černé listiny.', - 'logentry-spamblacklist-hit' => '{{GENDER:$2|Uživateli|Uživatelce}} $1 zabránila protispamová černá listina přidat $4 na stránku $3.', - 'right-spamblacklistlog' => 'Prohlížení knihy protispamové černé listiny', - 'action-spamblacklistlog' => 'prohlížet knihu protispamové černé listiny', + 'spam-blacklist-desc' => 'Antispamový nástroj na základě regulárních výrazů: [[MediaWiki:Spam-blacklist]] a [[MediaWiki:Spam-whitelist]]', # Fuzzy ); /** Welsh (Cymraeg) @@ -725,7 +700,6 @@ $messages['cy'] = array( 'log-description-spamblacklist' => "Mae'r digwyddiadau hyn yn cofnodi trawiadau ar y rhestr sbam waharddedig.", 'logentry-spamblacklist-hit' => 'Fe geisiodd $1 ychwanegu $4 sydd ar y rhestr waharddedig $3.', 'right-spamblacklistlog' => 'Gallu gweld lòg y rhestr sbam waharddedig', - 'action-spamblacklistlog' => 'gweld lòg rhestr y sbam gwaharddedig', ); /** Danish (dansk) @@ -768,7 +742,7 @@ $messages['da'] = array( # * hver ikke-tomme linjer anvendes som regulære udtryk for at matcha domænenavne i webadresser #
        ', 'spam-blacklisted-email' => 'Sortlistet e-mailadresse', - 'spam-blacklisted-email-text' => 'Din e-mailadresse er i øjeblikket blokeret fra at sende e-mails til andre brugere.', + 'spam-blacklisted-email-text' => 'Din e-mailadresse er i øjeblikket blokeret for at sende e-mails til andre brugere.', 'spam-blacklisted-email-signup' => 'Den angivne e-mailadresse er i øjeblikket blokeret for brug.', 'spam-invalid-lines' => 'Følgende {{PLURAL:$1|linje|linjer}} i spamsortelisten er {{PLURAL:$1|et ugyldigt regulært udtryk|ugyldige regulære udtryk}} og må rettes før lagring af siden:', 'spam-blacklist-desc' => 'Antispamværktøj baseret på regulære udtryk der giver mulighed for at sortliste URLs i sider og e-mailadresser for registrerede brugere', @@ -828,7 +802,7 @@ $messages['de'] = array( 'spam-blacklisted-email-text' => 'Deine E-Mail-Adresse ist derzeit für das Senden von E-Mail-Nachrichten an andere Benutzer blockiert.', 'spam-blacklisted-email-signup' => 'Die angegebene E-Mail-Adresse ist derzeit für das Senden von E-Mail-Nachrichten an andere Benutzer blockiert.', 'spam-invalid-lines' => 'Die {{PLURAL:$1|folgende Zeile|folgenden Zeilen}} in der Blockierliste {{PLURAL:$1|ist ein ungültiger regulärer Ausdruck|sind ungültige reguläre Ausdrücke}}. Sie {{PLURAL:$1|muss|müssen}} vor dem Speichern der Seite korrigiert werden:', - 'spam-blacklist-desc' => 'Ergänzt ein auf reguläre Ausdrücke gestütztes Anti-Spam-Werkzeug zum Sperren von URLs und E-Mail-Adressen für das Einfügen durch registrierte Benutzer', + 'spam-blacklist-desc' => 'Ein auf regulären Ausdrücken basiertes Anti-Spam-Werkzeug, um URLs in Seiten und E-Mail-Adressen für registrierte Benutzer auf die schwarze Liste zu setzen', 'log-name-spamblacklist' => 'Spam-Blacklist-Logbuch', 'log-description-spamblacklist' => 'Es folgt ein Logbuch von Spam-Blacklist-Treffern.', 'logentry-spamblacklist-hit' => '$1 verursachte einen Spam-Blacklist-Treffer auf „$3“ durch das versuchte Hinzufügen von $4.', @@ -862,7 +836,6 @@ $messages['de-formal'] = array( /** Zazaki (Zazaki) * @author Aspar * @author Erdemaslancan - * @author Marmase * @author Olvörg */ $messages['diq'] = array( @@ -904,7 +877,7 @@ $messages['diq'] = array( 'spam-blacklisted-email-text' => 'Nıka adresa e-postayê to qande karberê bini ra mesac riştene listeyê siya dero.', 'spam-blacklisted-email-signup' => 'E-posta adresiyo ke deyayo karkerdışe cı newke groto siyaliste.', 'spam-invalid-lines' => 'na qerelisteya spami {{PLURAL:$1|satır|satıran}} {{PLURAL:$1|nemeqbulo|nemeqbuli}};', - 'spam-blacklist-desc' => "Regex-tabanın haleta anti-spami URL'ya perer u adresa e-posta qande karberande qeydınan geriyayo", + 'spam-blacklist-desc' => 'Regex-tabanlı anti-spam aracı: [[MediaWiki:Spam-blacklist]] ve [[MediaWiki:Spam-whitelist]]', # Fuzzy ); /** Lower Sorbian (dolnoserbski) @@ -932,7 +905,7 @@ $messages['dsb'] = array( #
      ', 'spam-blacklisted-email' => 'Blokěrowana e-mailowa adresa', 'spam-invalid-lines' => '{{PLURAL:$1|Slědujuca smužka|Slědujucej smužce|Slědujuce smužki|Slědujuce smužki}} corneje lisćiny spama {{PLURAL:$1|jo njepłaśiwy regularny wuraz|stej njepłaśiwej regularnej wuraza|su njepłaśiwe regularne wuraze|su njepłaśiwe regularne wuraze}} a {{PLURAL:$1|musy|musytej|muse|muse}} se korigěrowaś, pjerwjej až składujoš bok:', - 'spam-blacklist-desc' => 'Pśeśiwospamowy rěd na zakłaźe Regex, kótaryž zmóznja URL na bokach a e-mailowe adresy za zregistrěrowanych wužywarjow do carneje lisćiny stajiś', + 'spam-blacklist-desc' => 'Antispamowy rěd na zakłaźe regularnych wurazow: [[MediaWiki:Spam-blacklist]] a [[MediaWiki:Spam-whitelist]]', # Fuzzy ); /** Greek (Ελληνικά) @@ -1106,14 +1079,9 @@ $messages['et'] = array( # * Iga rida, mis ei ole tühi, on regulaaravaldise osa, mis vastab ainult e-posti aadressides sisalduvatele hostinimedele.', 'spam-blacklisted-email' => 'Musta nimekirja kantud e-posti aadress', 'spam-blacklisted-email-text' => 'Musta nimekirja sissekande tõttu on sinu e-posti aadressilt teistele kasutajatele e-kirjade saatmine praegu keelatud.', - 'spam-blacklisted-email-signup' => 'Selle e-posti aadressi kasutamine on praegu musta nimekirja sissekandega keelatud.', + 'spam-blacklisted-email-signup' => 'Selle e-posti aadressi kasutamine praegu musta nimekirja sissekandega keelatud.', 'spam-invalid-lines' => '{{PLURAL:$1|Järgmine rida|Järgmised read}} rämpspostituste mustas nimekirjas on {{PLURAL:$1|vigane regulaaravaldis|vigased regulaaravaldised}} ja {{PLURAL:$1|see|need}} tuleb enne lehekülje salvestamist parandada:', 'spam-blacklist-desc' => 'Regulaaravaldisel põhinev tööriist, mis võimaldab lisada musta nimekirja lehekülgedel toodud internetiaadresse ning registreeritud kasutajate e-posti aadresse.', - 'log-name-spamblacklist' => 'Rämpsu musta nimekirja logi', - 'log-description-spamblacklist' => 'Siin on loetletud rämpspostituse musta nimekirja tabamused.', - 'logentry-spamblacklist-hit' => '$1 püüdis lisada leheküljele $3 rämpspostituse mustas nimekirjas olevat linki $4.', - 'right-spamblacklistlog' => 'Vaadata rämpsu musta nimekirja', - 'action-spamblacklistlog' => 'vaadata rämpsu musta nimekirja', ); /** Persian (فارسی) @@ -1136,35 +1104,28 @@ $messages['fa'] = array( # در فهرست سیاه قرار داشته باشند. # # ', - 'email-blacklist' => ' # از ثبت نام یا ارسال نامه توسط نشانی‌های رایانامه‌ای که با این فهرست مطابقت کنند جلوگیری می‌شود. + 'email-blacklist' => ' # از ثبت نام یا ارسال نامه توسط نشانی‌های پست الکترونیکی که با این فهرست مطابقت کنند جلوگیری می‌شود. # این فهرست فقط روی همین ویکی اثر دارد؛ به فهرست سیاه سراسری نیز مراجعه کنید. # برای مستندات به https://www.mediawiki.org/wiki/Extension:SpamBlacklist مراجعه کنید #
       # دستورات به این شکل هستند:
       #  * همه چیز از «#» تا پایان سطر به عنوان توضیح در نظر گرفته می‌شود
      -#  * هر سطر از متن به عنوان یک دستور از نوع عبارت باقاعده در نظر گرفته می‌شود که فقط با نام میزبان در نشانی رایانامه مطابقت داده می‌شود
      +#  * هر سطر از متن به عنوان یک دستور از نوع عبارت باقاعده در نظر گرفته می‌شود که فقط با نام میزبان در نشانی پست الکترونیکی مطابقت داده می‌شود
       
        #
      ', 'email-whitelist' => ' #
      -# نشانی‌های رایانامه که با این فهرست مطابقت کنند محدود *نمی‌شوند* حتی اگر
      +# نشانی‌های پست الکترونیکی که با این فهرست مطابقت کنند محدود *نمی‌شوند* حتی اگر
       # با فهرست سیاه مطابقت داشته باشند.
       #
        #
      # دستورات به این شکل هستند: # * همه چیز از «#» تا پایان سطر به عنوان توضیح در نظر گرفته می‌شود -# * هر سطر از متن به عنوان یک دستور از نوع عبارت باقاعده در نظر گرفته می‌شود که فقط با نام میزبان در نشانی رایانامه مطابقت داده می‌شود', - 'spam-blacklisted-email' => 'نشانی رایانامه موجود در فهرست سیاه', - 'spam-blacklisted-email-text' => 'نشانی رایانامهٔ شما در حال حاضر در فهرست سیاه قرار دارد و نمی‌توانید به دیگر کاربران نامه بفرستید.', - 'spam-blacklisted-email-signup' => 'نشانی رایانامه داده‌شده در حال حاضر در فهرست سیاه است.', +# * هر سطر از متن به عنوان یک دستور از نوع عبارت باقاعده در نظر گرفته می‌شود که فقط با نام میزبان در نشانی پست الکترونیکی مطابقت داده می‌شود', + 'spam-blacklisted-email' => 'نشانی پست الکترونیکی موجود در لیست سیاه', + 'spam-blacklisted-email-text' => 'نشانی پست الکترونیکی شما در حال حاضر در فهرست سیاه قرار دارد و نمی‌توانید به دیگر کاربران نامه بفرستید.', + 'spam-blacklisted-email-signup' => 'نشانی پست الکترونیکی داده شده در حال حاضر در فهرست سیاه است و قابل استفاده نیست.', 'spam-invalid-lines' => '{{PLURAL:$1|سطر|سطرهای}} زیر در فهرست سیاه هرزنگاری، عبارات باقاعدهٔ نامجاز {{PLURAL:$1|است|هستند}} و قبل از ذخیره کردن صفحه باید اصلاح {{PLURAL:$1|شود|شوند}}:', - 'spam-blacklist-desc' => 'Regex-based anti-spam tool allowing to blacklist URLs in pages and email addresses for registered users - -ابزار بر پایهٔ عبارت باقاعده ضدهرزنگاری اجازهٔ فهرست سیاه‌کردن نشانی‌های اینترنتی در صفحه‌ها و نشانی‌های رایانامه برای کاربران ثبت نام کرده', - 'log-name-spamblacklist' => 'سیاههٔ فهرست سیاه هرزنگاری', - 'log-description-spamblacklist' => 'این رویدادها وقوع فهرست سیاه هزنگاری را دنبال می‌کند.', - 'logentry-spamblacklist-hit' => '$1 در $3 با تلاش در افزودن $4 باعث برخورد به فهرست سیاه هرزنامه شده‌است.', - 'right-spamblacklistlog' => 'دیدن یک سیاههٔ فهرست سیاه هرزنامه', - 'action-spamblacklistlog' => 'دیدن سیاههٔ فهرست سیاه هرزنامه', + 'spam-blacklist-desc' => 'ابزار ضد هرزنویسی مبتنی بر regular expressions: [[MediaWiki:Spam-blacklist]] و [[MediaWiki:Spam-whitelist]]', # Fuzzy ); /** Finnish (suomi) @@ -1268,7 +1229,7 @@ $messages['fr'] = array( 'spam-blacklist-desc' => 'Outil anti-pourriel basé sur des expressions rationnelles permettant de mettre en liste noire des URLs dans les pages et des adresses de courriel pour les utilisateurs enregistrés', 'log-name-spamblacklist' => 'Journal de liste noire des pourriels', 'log-description-spamblacklist' => 'Ces événements tracent les correspondances avec la liste noire des pourriels.', - 'logentry-spamblacklist-hit' => '{{GENDER:$2|$1}} a provoqué une correspondance avec la liste noire des pourriels sur $3 en essayant d’ajouter $4.', + 'logentry-spamblacklist-hit' => '$1 a provoqué un correspondance avec la liste noire des pourriels sur $3 en essayant d’ajouter $4.', 'right-spamblacklistlog' => 'Afficher le journal de la liste noire des pourriels', 'action-spamblacklistlog' => 'afficher le journal de la liste noir des pourriels', ); @@ -1606,7 +1567,7 @@ $messages['hsb'] = array( 'spam-blacklisted-email-text' => 'Twoja e-mejlowa adresa je tuchwilu w čornej lisćinje a tohodla za słanje e-mejlow do druhich wužiwarjow zablokowana.', 'spam-blacklisted-email-signup' => 'Podata e-mejlowa adresa je tuchwilu přećiwo wužiwanju zablokowana.', 'spam-invalid-lines' => '{{PLURAL:$1|slědowaca linka je njepłaćiwy regularny wuraz|slědowacych linkow je regularny wuraz|slědowace linki su regularne wurazy|slědowacej lince stej regularnej wurazaj}} a {{PLURAL:$1|dyrbi|dyrbi|dyrbja|dyrbjetej}} so korigować, prjedy hač so strona składuje:', - 'spam-blacklist-desc' => 'Přećiwospamowy nastroj na zakładźe Regex, kotryž zmóznja URL na stronach a e-mejlowe adresy za zregistrowanych wužiwarjow do čorneje lisćiny stajić', + 'spam-blacklist-desc' => 'Přećiwospamowy nastroj na zakładźe Regex: [[MediaWiki:Spam-blacklist]] a [[MediaWiki:Spam-whitelist]]', # Fuzzy ); /** Hungarian (magyar) @@ -1683,12 +1644,7 @@ $messages['ia'] = array( 'spam-blacklisted-email-text' => 'Tu adresse de e-mail es actualmente blocate de inviar messages a altere usatores.', 'spam-blacklisted-email-signup' => 'Le adresse de e-mail specificate es actualmente blocate per le lista nigre.', 'spam-invalid-lines' => 'Le sequente {{PLURAL:$1|linea|lineas}} del lista nigre antispam es {{PLURAL:$1|un expression|expressiones}} regular invalide e debe esser corrigite ante que tu immagazina le pagina:', - 'spam-blacklist-desc' => 'Instrumento antispam a base de regex que permitte blocar URLs in paginas e adresses de e-mail pro usatores registrate', - 'log-name-spamblacklist' => 'Registro del lista nigre de spam', - 'log-description-spamblacklist' => 'Iste eventos tracia le activationes del lista nigre de spam.', - 'logentry-spamblacklist-hit' => '{{GENDER:$2|$1}} ha provocate un activation del lista nigre de spam sur $3 con su tentativa de inserer $4.', - 'right-spamblacklistlog' => 'Vider le registro del lista nigre de spam', - 'action-spamblacklistlog' => 'vider le registro del lista nigre de spam', + 'spam-blacklist-desc' => 'Instrumento antispam a base de regex: [[MediaWiki:Spam-blacklist]] e [[MediaWiki:Spam-whitelist]]', # Fuzzy ); /** Indonesian (Bahasa Indonesia) @@ -1763,12 +1719,7 @@ $messages['ilo'] = array( 'spam-blacklisted-email-text' => 'Ti e-suratmo a pagtaengan ket agdama a naiparit manipud ti panagipatulod kadagiti e-surat kadagiti sabsabali nga agar-aramat.', 'spam-blacklisted-email-signup' => 'Ti naited nga e-surat a pagatengan ket agdama a naiparit manipud ti panagusar.', 'spam-invalid-lines' => 'Ti sumaganad a spam blacklist {{PLURAL:$1| a linia ket|kadagiti linia ket}} imbalido a kadawyan {{PLURAL:$1|a nangisao|kadagiti panangisao}} ken {{PLURAL:$1|masapsapol|masapol}} a mapudnuan sakbay nga idulin ti panid:', - 'spam-blacklist-desc' => 'Naibatay ti regex a ramit ti kontra-spam a mangpalubos a mangiparit kadagiti URL kadagiti panid ken dagiti esurat a pagtaengan para kadagiti nakarehistro nga agar-aramat', - 'log-name-spamblacklist' => 'Listaan ti naiparit para iti spam', - 'log-description-spamblacklist' => 'Dagitoy a pasamak ket surotenna dagiti naiparit a listaan a napuntaan ti spam.', - 'logentry-spamblacklist-hit' => 'Ti $1 ket gapuanan ti pannakapunta ti naiparit a listaan ti spam iti $3 babaen ti panagpadas nga aginayon iti $4.', - 'right-spamblacklistlog' => 'Kitaen ti naiparit a listaan ti spam', - 'action-spamblacklistlog' => 'kitaen ti naiparit a listaan ti spam', + 'spam-blacklist-desc' => 'Naibantay ti regex kontra-spam a ramit: [[MediaWiki:Spam-blacklist]] ken [[MediaWiki:Spam-whitelist]]', # Fuzzy ); /** Icelandic (íslenska) @@ -1922,7 +1873,7 @@ $messages['ja'] = array( 'spam-blacklist-desc' => 'ページ内の URL や登録利用者のメールアドレスをブラックリスト化できるようにする、正規表現に基づいたスパム対策ツール', 'log-name-spamblacklist' => 'スパムブラックリスト記録', 'log-description-spamblacklist' => 'これらのイベントはスパムブラックリストとの一致を追跡します。', - 'logentry-spamblacklist-hit' => '{{GENDER:$2|$1}} が $3 に $4 を追加しようとした際にスパムブラックリストが発動しました。', + 'logentry-spamblacklist-hit' => '$1 が $3 に $4 を追加しようとした際にスパムブラックリストが発動しました。', 'right-spamblacklistlog' => 'スパムブラックリストを閲覧', 'action-spamblacklistlog' => 'スパムブラックリスト記録の閲覧', ); @@ -2256,15 +2207,6 @@ $messages['li'] = array( 'spam-blacklist-desc' => 'Antispamfunctionaliteit via reguliere expressies: [[MediaWiki:Spam-blacklist]] en [[MediaWiki:Spam-whitelist]]', # Fuzzy ); -/** لوری (لوری) - * @author Bonevarluri - */ -$messages['lrc'] = array( - 'log-name-spamblacklist' => 'پهرستنومه نوم گه سئ اسپم', - 'right-spamblacklistlog' => 'دیئن پهرستنومه نوم گه سئ اسپم', - 'action-spamblacklistlog' => 'دیئن پهرستنومه نوم گه سئ اسپم', -); - /** Minangkabau (Baso Minangkabau) * @author Iwan Novirion */ @@ -2370,12 +2312,7 @@ $messages['ml'] = array( 'spam-blacklisted-email-text' => 'താങ്കളുടെ ഇമെയിൽ വിലാസം ഇപ്പോൾ മറ്റുള്ളവർക്ക് എഴുത്തയക്കാനാവാത്ത കരിമ്പട്ടികയിൽ ഉൾപ്പെട്ടിരിക്കുന്നു.', 'spam-blacklisted-email-signup' => 'നൽകിയ ഇമെയിൽ വിലാസം ഇപ്പോൾ കരിമ്പട്ടികയിൽ പെട്ടിരിക്കുന്ന ഒന്നാണ്.', 'spam-invalid-lines' => 'താഴെ കൊടുത്തിരിക്കുന്ന പാഴെഴുത്ത് കരിമ്പട്ടികയിലെ {{PLURAL:$1|വരി ഒരു|വരികൾ}} അസാധുവായ റെഗുലർ {{PLURAL:$1|എക്സ്‌‌പ്രെഷൻ|എക്സ്‌‌പ്രെഷനുകൾ}} ആണ്, താൾ സേവ് ചെയ്യുന്നതിനു മുമ്പ് {{PLURAL:$1|അത്|അവ}} ശരിയാക്കേണ്ടതുണ്ട്:', - 'spam-blacklist-desc' => 'അംഗത്വമെടുത്ത ഉപയോക്താക്കൾ യു.ആർ.എല്ലുകളും ഇമെയിൽ വിലാസങ്ങളും, താളുകളിൽ ചേർക്കുന്നത് കരിമ്പട്ടികയിൽ പെടുത്താനുള്ള റെജെക്സ്-അധിഷ്ഠിത പാഴെഴുത്ത് തടയൽ ഉപകരണം', - 'log-name-spamblacklist' => 'പാഴെഴുത്ത് കരിമ്പട്ടിക രേഖ', - 'log-description-spamblacklist' => 'പാഴെഴുത്ത് കരിമ്പട്ടികയെ ഉണർത്തിയ പ്രവൃത്തികളുടെ രേഖ.', - 'logentry-spamblacklist-hit' => '$3 എന്ന താളിൽ $4 എന്നത് ചേർക്കാൻ $1 നടത്തിയ ശ്രമം പാഴെഴുത്ത് കരിമ്പട്ടികയിൽ കുടുങ്ങിയിരിക്കുന്നു.', - 'right-spamblacklistlog' => 'പാഴെഴുത്ത് കരിമ്പട്ടിക രേഖ കാണുക', - 'action-spamblacklistlog' => 'പാഴെഴുത്ത് കരിമ്പട്ടിക രേഖ കാണുക', + 'spam-blacklist-desc' => 'റെജെക്സ്-അധിഷ്ഠിത പാഴെഴുത്ത് തടയൽ ഉപകരണം: [[MediaWiki:Spam-blacklist]] ഒപ്പം [[MediaWiki:Spam-whitelist]]', # Fuzzy ); /** Marathi (मराठी) @@ -2587,11 +2524,6 @@ $messages['nl'] = array( 'spam-blacklisted-email-signup' => 'Het opgegeven e-mailadres staat momenteel op de zwarte lijst.', 'spam-invalid-lines' => 'De volgende {{PLURAL:$1|regel|regels}} van de zwarte lijst {{PLURAL:$1|is een|zijn}} onjuiste reguliere {{PLURAL:$1|expressie|expressies}} en {{PLURAL:$1|moet|moeten}} verbeterd worden alvorens de pagina kan worden opgeslagen:', 'spam-blacklist-desc' => "Op reguliere expressies gebaseed antispamhulpprogramma dat het mogelijk maakt URL's in pagina's te blokkeren en e-mailadressen voor geblokkeerde gebruikers", - 'log-name-spamblacklist' => 'Logboek zwarte lijst', - 'log-description-spamblacklist' => 'Deze lijst bevat gebeurtenissen met betrekking tot de zwarte lijst.', - 'logentry-spamblacklist-hit' => '{{GENDER:$2|$1}} heeft geprobeerd $4 van de zwarte lijst toe te voegen op $3', - 'right-spamblacklistlog' => 'Logboek zwarte lijst bekijken', - 'action-spamblacklistlog' => 'logboek zwarte lijst te bekijken', ); /** Nederlands (informeel)‎ (Nederlands (informeel)‎) @@ -2699,7 +2631,6 @@ $messages['or'] = array( /** Polish (polski) * @author BeginaFelicysym - * @author Chrumps * @author Derbeth * @author Sp5uhe */ @@ -2746,8 +2677,6 @@ $messages['pl'] = array( 'spam-blacklisted-email-signup' => 'Podany adres e-mail jest obecnie na czarnej liście blokującej przed użyciem.', 'spam-invalid-lines' => '{{PLURAL:$1|Następująca linia jest niepoprawnym wyrażeniem regularnym i musi być poprawiona przed zapisaniem strony:|Następujące linie są niepoprawnymi wyrażeniami regularnymi i muszą być poprawione przed zapisaniem strony:}}', 'spam-blacklist-desc' => 'Narzędzie antyspamowe oparte o wyrażenia regularne: [[MediaWiki:Spam-blacklist|spam – lista zabronionych]] oraz [[MediaWiki:Spam-whitelist|spam – lista dozwolonych]]', # Fuzzy - 'logentry-spamblacklist-hit' => '$1 {{GENDER:$2|uruchomił|uruchomiła}} filtr antyspamowy na stronie $3 próbując dodać $4.', - 'right-spamblacklistlog' => 'Podgląd rejestru czarnej listy spamu', ); /** Piedmontese (Piemontèis) @@ -2780,12 +2709,7 @@ $messages['pms'] = array( 'spam-blacklisted-email-text' => "Soa adrëssa ëd pòsta eletrònica a l'é al moment an na lista nèira për mandé dij mëssagi a j'àutri utent.", 'spam-blacklisted-email-signup' => "L'adrëssa ëd pòsta eletrònica dàita a l'é al moment an na lista nèira për l'utilisassion.", 'spam-invalid-lines' => "{{PLURAL:$1|St'|Sti}} element dla lista nèira dla rumenta ëd reclam a {{PLURAL:$1|l'é|son}} {{PLURAL:$1|n'|dj'}}espression regolar nen {{PLURAL:$1|bon-a|bon-e}} e a l'{{PLURAL:$1|ha|han}} da manca d'esse coregiùe anans che salvé la pàgina:", - 'spam-blacklist-desc' => "Utiss contra la rumenta basà su dj'espression regolar ch'a permëtto ëd buté an sla lista nèira dj'adrësse an sl'Aragnà ant le pàgine e dj'adrësse ëd pòsta eletrònica për j'utent argistrà.", - 'log-name-spamblacklist' => 'Argistr dla lista nèira dla rumenta', - 'log-description-spamblacklist' => 'Costi eveniment a marco le rëspondense con la lista nèira dla rumenta.', - 'logentry-spamblacklist-hit' => "$1 a l'ha causà na rëspondensa con la lista nèira dla rumenta su $3 an sërcand ëd gionté $4.", - 'right-spamblacklistlog' => "Smon-e l'argistr dla lista nèira dla rumenta", - 'action-spamblacklistlog' => "vëdde l'argistr dla lista nèira dla rumenta", + 'spam-blacklist-desc' => 'Strument anti-spam basà an dzora a Regex: [[MediaWiki:Spam-blacklist]] e [[MediaWiki:Spam-whitelist]]', # Fuzzy ); /** Western Punjabi (پنجابی) @@ -2926,13 +2850,6 @@ $messages['pt-br'] = array( 'action-spamblacklistlog' => 'ver os registros da lista negra de spam', ); -/** Romansh (rumantsch) - * @author Kazu89 - */ -$messages['rm'] = array( - 'log-name-spamblacklist' => 'Protocol da la glista naira da spam', -); - /** Romanian (română) * @author Firilacroco * @author Minisarm @@ -3007,11 +2924,9 @@ $messages['roa-tara'] = array( /** Russian (русский) * @author Ahonc - * @author Amire80 * @author Express2000 * @author HalanTul * @author Kaganer - * @author NBS * @author Okras * @author Александр Сигачёв */ @@ -3055,13 +2970,8 @@ $messages['ru'] = array( 'spam-blacklisted-email' => 'Адреса электронной почты, занесённые в чёрный список', 'spam-blacklisted-email-text' => 'Ваш адрес электронной почты в настоящее время находится в чёрном списке, поэтому вы не можете отправлять сообщения другим пользователям.', 'spam-blacklisted-email-signup' => 'Указанный адрес электронной почты в настоящее время занесён в чёрный список и не может быть использован.', - 'spam-invalid-lines' => '{{PLURAL:$1|1=Следующая строка чёрного списка ссылок содержит ошибочное регулярное выражение и должна быть исправлена|Следующие строки чёрного списка ссылок содержат ошибочные регулярные выражения и должны быть исправлены}} перед сохранением:', + 'spam-invalid-lines' => '{{PLURAL:$1|Следующая строка чёрного списка ссылок содержит ошибочное регулярное выражение и должна быть исправлена|Следующие строки чёрного списка ссылок содержат ошибочные регулярные выражения и должны быть исправлены}} перед сохранением:', 'spam-blacklist-desc' => 'Основанный на регулярных выражениях анти-спам инструмент позволяет добавлять в чёрный список URL на страницах и адреса электронной почты для зарегистрированных пользователей', - 'log-name-spamblacklist' => 'Журнал спам-листа', - 'log-description-spamblacklist' => 'Это журнал, отслеживающий срабатывание спам-листа.', - 'logentry-spamblacklist-hit' => '$1 вызвал срабатывание спам-листа на странице $3 из-за попытки добавить $4.', - 'right-spamblacklistlog' => 'Просмотр журнала чёрного списка по спаму', - 'action-spamblacklistlog' => 'просмотр журнала чёрного списка по спаму', ); /** Rusyn (русиньскый) @@ -3391,9 +3301,7 @@ $messages['stq'] = array( ); /** Swedish (svenska) - * @author Ainali * @author Lejonel - * @author Lokal Profil * @author Skalman * @author WikiPhoenix */ @@ -3417,34 +3325,10 @@ $messages['sv'] = array( # * All text från ett #-tecken till radens slut är en kommentar # * Alla icke-tomma rader används som reguljära uttryck för att matcha domännamn i URL:er - # ', - 'email-blacklist' => ' #
      -# E-postadresser som matchar den här listan kommer att hindras att registrera och skicka e-post
      -# Denna lista gäller endast denna wiki; se även den globala svartlistan.
      -# För dokumentation se https://www.mediawiki.org/wiki/Extension:SpamBlacklist
      -#
      -# Syntaxen är följande:
      -#   * Allt från ett "#"-tecken till slutet av raden är en kommentar
      -#   * Varje icke-tom rad är ett regex-fragment som endast kommer att matcha värdnamn i e-postadresser
      - #
      ', - 'email-whitelist' => ' #
      -# E-postadresser som matchar den här listan kommer *inte* att blockeras, även om de skulle ha blivit blockerade av svartlistan.
      -#
      -# Syntaxen är följande:
      -#   * Allt från ett "#"-tecken till slutet av raden är en kommentar
      -#   * Varje icke-tom rad är ett regex-fragment som endast kommer att matcha värdnamn i e-postadresser
      -
        #
      ', 'spam-blacklisted-email' => 'Svartlistad e-postadress', - 'spam-blacklisted-email-text' => 'Din e-postadress är för närvarande svartlistad från att skicka e-post till andra användare.', - 'spam-blacklisted-email-signup' => 'Den angivna e-postadressen är förnärvarande svartlistad från användning.', 'spam-invalid-lines' => 'Följande {{PLURAL:$1|rad|rader}} i svarta listan för spam innehåller inte något giltigt reguljärt uttryck och måste rättas innan sidan sparas:', 'spam-blacklist-desc' => 'Antispamverktyg baserat på reguljära uttryck som gör det möjligt att svartlista webbadresser på sidor och e-postadresser för registrerade användare', - 'log-name-spamblacklist' => 'Svartlistningslogg för spam', - 'log-description-spamblacklist' => 'Dessa händelser spårar träffar is svartlistningsloggen för spam.', - 'logentry-spamblacklist-hit' => '$1 orsakade en träff i svartlistningsloggen för spam på $3 genom att försöka lägga till $4.', - 'right-spamblacklistlog' => 'Visa svartlistningslogg för spam', - 'action-spamblacklistlog' => 'visa svartlistningsloggen för spam', ); /** Tamil (தமிழ்) @@ -3675,7 +3559,7 @@ $messages['uk'] = array( 'spam-blacklisted-email' => 'Адреса електронної пошти з чорного списку', 'spam-blacklisted-email-text' => 'Ваша адреса електронної пошти в даний час знаходиться в чорному списку, тому ви не можете надсилати повідомлення іншим користувачам.', 'spam-blacklisted-email-signup' => 'Вказана Вами адреса електронної пошти наразі занесена до чорного списку і не може бути використаною.', - 'spam-invalid-lines' => '{{PLURAL:$1|1=Наступний рядок із чорного списку посилань містить помилковий регулярний вираз і його треба виправити|Наступні рядки із чорного списку посилань містять помилкові регулярні вирази і їх треба виправити}} перед збереженням:', + 'spam-invalid-lines' => '{{PLURAL:$1|Наступний рядок із чорного списку посилань містить помилковий регулярний вираз і його треба виправити|Наступні рядки із чорного списку посилань містять помилкові регулярні вирази і їх треба виправити}} перед збереженням:', 'spam-blacklist-desc' => 'Засновану на регулярних виразах антиспам інструмент, який дозволяє кидати у чорний список URL сторінки і адреси електронної пошти для зареєстрованих користувачів', 'log-name-spamblacklist' => 'Журнал чорного списку спамерів', 'log-description-spamblacklist' => 'Ці події відстежують потрапляння у чорний список спамерів.', @@ -3919,10 +3803,8 @@ $messages['zh-hant'] = array( 'spam-blacklisted-email-text' => '您的電郵地址目前已列入黑名單以防止您發送電郵予其他用戶。', 'spam-blacklisted-email-signup' => '此電郵地址目前被禁止使用。', 'spam-invalid-lines' => '以下在灌水黑名單的{{PLURAL:$1|一行|多行}}有無效的表示式,請在儲存這頁前先將{{PLURAL:$1|它|它們}}修正:', - 'spam-blacklist-desc' => '基於正則表達式的反垃圾電郵工具,允許加入濫發電郵的URL和/或註冊用戶於此頁面', + 'spam-blacklist-desc' => '以正則表達式為本的防灌水工具:[[MediaWiki:Spam-blacklist]] 與 [[MediaWiki:Spam-whitelist]]', # Fuzzy 'log-name-spamblacklist' => '垃圾連結黑名單日誌', - 'log-description-spamblacklist' => '這些事件已被垃圾郵件黑名單觸發。', - 'logentry-spamblacklist-hit' => '$1於$3嘗試加入$4而觸發垃圾電郵黑名單。', 'right-spamblacklistlog' => '查閱垃圾電郵黑名單日誌', 'action-spamblacklistlog' => '查閱垃圾電郵黑名單日誌', ); diff --git a/extensions/SpamBlacklist/SpamBlacklist.php b/extensions/SpamBlacklist/SpamBlacklist.php index 45e5237c..2fd7855d 100644 --- a/extensions/SpamBlacklist/SpamBlacklist.php +++ b/extensions/SpamBlacklist/SpamBlacklist.php @@ -18,10 +18,6 @@ $wgExtensionCredits['antispam'][] = array( $dir = __DIR__ . '/'; $wgExtensionMessagesFiles['SpamBlackList'] = $dir . 'SpamBlacklist.i18n.php'; -// Register the API method -$wgAutoloadClasses['ApiSpamBlacklist'] = "$dir/api/ApiSpamBlacklist.php"; -$wgAPIModules['spamblacklist'] = 'ApiSpamBlacklist'; - /** * Array of settings for blacklist classes */ diff --git a/extensions/SpamBlacklist/SpamBlacklist_body.php b/extensions/SpamBlacklist/SpamBlacklist_body.php index 15fbc72f..bf5c9aab 100644 --- a/extensions/SpamBlacklist/SpamBlacklist_body.php +++ b/extensions/SpamBlacklist/SpamBlacklist_body.php @@ -34,13 +34,10 @@ class SpamBlacklist extends BaseBlacklist { * This is used to load the old links already on the page, so * the filter is only applied to links that got added. If not given, * the filter is applied to all $links. - * @param boolean $preventLog Whether to prevent logging of hits. Set to true when - * the action is testing the links rather than attempting to save them - * (e.g. the API spamblacklist action) * * @return Array Matched text(s) if the edit should not be allowed, false otherwise */ - function filter( array $links, Title $title = null, $preventLog = false ) { + function filter( array $links, Title $title = null ) { $fname = 'wfSpamBlacklistFilter'; wfProfileIn( $fname ); @@ -96,9 +93,7 @@ class SpamBlacklist extends BaseBlacklist { $ip = $wgRequest->getIP(); $imploded = implode( ' ', $matches[0] ); wfDebugLog( 'SpamBlacklistHit', "$ip caught submitting spam: $imploded\n" ); - if( !$preventLog ) { - $this->logFilterHit( $title, $imploded ); // Log it - } + $this->logFilterHit( $title, $imploded ); // Log it if( $retVal === false ){ $retVal = array(); } diff --git a/extensions/SpamBlacklist/api/ApiSpamBlacklist.php b/extensions/SpamBlacklist/api/ApiSpamBlacklist.php deleted file mode 100644 index dad9e8e0..00000000 --- a/extensions/SpamBlacklist/api/ApiSpamBlacklist.php +++ /dev/null @@ -1,78 +0,0 @@ -extractRequestParams(); - $matches = BaseBlacklist::getInstance( 'spam' )->filter( $params['url'], NULL, true ); - $res = $this->getResult(); - - if ( $matches !== false ) { - // this url is blacklisted. - $res->addValue( 'spamblacklist', 'result', 'blacklisted' ); - $res->setIndexedTagName( $matches, 'match' ); - $res->addValue( 'spamblacklist', 'matches', $matches ); - } else { - // not blacklisted - $res->addValue( 'spamblacklist', 'result', 'ok' ); - } - } - - public function getAllowedParams() { - return array( - 'url' => array( - ApiBase::PARAM_REQUIRED => true, - ApiBase::PARAM_ISMULTI => true, - ) - ); - } - - public function getParamDescription() { - return array( - 'url' => 'A pipe-separated list of URLs to validate against the blacklist', - ); - } - - public function getDescription() { - return 'Validate one or more URLs against the SpamBlacklist.'; - } - - public function getExamples() { - return array( - 'api.php?action=spamblacklist&url=http%3A%2F%2Fwww.example.com%2F%7Chttp%3A%2F%2Fwww.example.org%2F', - 'api.php?action=spamblacklist&url=https%3A%2F%2Fwww.example.net%2Findex.php', - ); - } - - public function getHelpUrls() { - return array( 'https://www.mediawiki.org/wiki/Extension:SpamBlacklist/API' ); - } -} diff --git a/extensions/SyntaxHighlight_GeSHi/.gitreview b/extensions/SyntaxHighlight_GeSHi/.gitreview deleted file mode 100644 index cb9e4b44..00000000 --- a/extensions/SyntaxHighlight_GeSHi/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/SyntaxHighlight_GeSHi.git -defaultbranch=master diff --git a/extensions/SyntaxHighlight_GeSHi/COPYING b/extensions/SyntaxHighlight_GeSHi/COPYING deleted file mode 100644 index d159169d..00000000 --- a/extensions/SyntaxHighlight_GeSHi/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php b/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php index b1c9851d..7318574d 100644 --- a/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php +++ b/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php @@ -28,6 +28,12 @@ class SyntaxHighlight_GeSHi { // Don't trim leading spaces away, just the linefeeds $text = preg_replace( '/^\n+/', '', $text ); + if( $wgUseTidy ) { + // HTML Tidy will convert tabs to spaces incorrectly (bug 30930). + // Preemptively replace the spaces in a more controlled fashion. + $text = self::tabsToSpaces( $text ); + } + // Validate language if( isset( $args['lang'] ) && $args['lang'] ) { $lang = $args['lang']; @@ -95,12 +101,6 @@ class SyntaxHighlight_GeSHi { if( $enclose === GESHI_HEADER_DIV ) { $out = str_replace( "\n", '', $out ); } - // HTML Tidy will convert tabs to spaces incorrectly (bug 30930). - // But the conversion from tab to space occurs while reading the input, - // before the conversion from to tab, so we can armor it that way. - if( $wgUseTidy ) { - $out = str_replace( "\t", ' ', $out ); - } // Register CSS $parser->getOutput()->addHeadItem( self::buildHeadItem( $geshi ), "source-{$lang}" ); @@ -488,4 +488,35 @@ class SyntaxHighlight_GeSHi { public static function hOldSpecialVersion_GeSHi( &$sp, &$extensionTypes ) { return self::hSpecialVersion_GeSHi( $extensionTypes ); } + + /** + * Convert tabs to spaces + * + * @param string $text + * @return string + */ + private static function tabsToSpaces( $text ) { + $lines = explode( "\n", $text ); + $lines = array_map( array( __CLASS__, 'tabsToSpacesLine' ), $lines ); + return implode( "\n", $lines ); + } + + /** + * Convert tabs to spaces for a single line + * + * @param $line + * @internal param string $text + * @return string + */ + private static function tabsToSpacesLine( $line ) { + $parts = explode( "\t", $line ); + $width = 8; // To match tidy's config & typical browser defaults + $out = $parts[0]; + foreach( array_slice( $parts, 1 ) as $chunk ) { + $spaces = $width - (strlen( $out ) % $width); + $out .= str_repeat( ' ', $spaces ); + $out .= $chunk; + } + return $out; + } } diff --git a/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.i18n.php b/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.i18n.php index d385b01c..8555c4f9 100644 --- a/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.i18n.php +++ b/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.i18n.php @@ -202,12 +202,11 @@ $messages['ca'] = array( * @author Умар */ $messages['ce'] = array( - 'syntaxhighlight-desc' => 'Таро хуьлуьйту тег <syntaxhighlight> лело [http://qbnz.com/highlighter/ GeSHi Highlighter] гӀоьнца синтаксисан бос хилийта', 'syntaxhighlight-supported' => 'Ловш долу меттанаш:', 'geshi.css' => '/* CSS-код, кху чу хlоттайахь, оцо болх бийра бу сизашдо беснашна хlокхуньца GeSHI */', ); -/** Czech (čeština) +/** Czech (česky) * @author Li-sung * @author Matěj Grabovský */ @@ -321,7 +320,7 @@ $messages['es'] = array( $messages['et'] = array( 'syntaxhighlight-desc' => 'Võimaldab [http://qbnz.com/highlighter/ GeSHi] abil <syntaxhighlight>-silti kasutades süntaksit esile tõsta.', 'syntaxhighlight-specify' => 'Sa pead täpsustama keelt nõnda:', - 'syntaxhighlight-supported' => 'Süntaksi esiletõstu toetavad keeled:', + 'syntaxhighlight-supported' => 'Süntaksi esiletoomise on toetatud järgnevates keeltes:', 'syntaxhighlight-err-loading' => '(toetatud keelte loetelu laadimisel esines viga)', 'syntaxhighlight-err-language' => 'Vigane keel.', 'geshi.css' => '/* CSS mis on asetatud siia, määrab GeSHi süntaksi esiletoomise stiili */', @@ -443,12 +442,11 @@ $messages['gu'] = array( ); /** Hebrew (עברית) - * @author Guycn2 * @author Rotem Liss */ $messages['he'] = array( 'syntaxhighlight-desc' => 'אפשרות לסימון קוד מקור בצבעים עם התגית <syntaxhighlight> באמצעות [http://qbnz.com/highlighter/ GeSHi Highlighter]', - 'syntaxhighlight-specify' => 'יש לציין שפה באופן הבא:', + 'syntaxhighlight-specify' => 'עליכם לציין שפה באופן הבא:', 'syntaxhighlight-supported' => 'שפות נתמכות:', 'syntaxhighlight-err-loading' => '(שגיאה בטעינת הרשימה של השפות הנתמכות)', 'syntaxhighlight-err-language' => 'שפה שגויה.', @@ -547,18 +545,6 @@ $messages['ig'] = array( 'syntaxhighlight-err-language' => 'Asụsụ ámághị.', ); -/** Iloko (Ilokano) - * @author Lam-ang - */ -$messages['ilo'] = array( - 'syntaxhighlight-desc' => 'Mangited ti panangimaris ti eskritu <syntaxhighlight> nga agus-usar iti [http://qbnz.com/highlighter/ GeSHi - Generic Syntax Highlighter]', - 'syntaxhighlight-specify' => 'Nasken nga inaganan ti pagsasao a kasla daytoy:', - 'syntaxhighlight-supported' => 'Dagiti nasuportaran a pagsasao para iti panangimaris ti eskritu:', - 'syntaxhighlight-err-loading' => '(biddut ti panangikarga ti listaan ti nasuportaran a pagsasao)', - 'syntaxhighlight-err-language' => 'Imbalido a pagsasao.', - 'geshi.css' => '/* Ti CSS a maikabil ditoy ket maipakatto iti panangimaris ti eskritu ti GeSHi */', -); - /** Ido (Ido) * @author Malafaya */ @@ -702,11 +688,10 @@ $messages['ksh'] = array( /** Luxembourgish (Lëtzebuergesch) * @author Les Meloures * @author Robby - * @author Soued031 */ $messages['lb'] = array( 'syntaxhighlight-desc' => "Syntax-Ervirhiewung <syntaxhighlight> mat Hëllef vu [http://qbnz.com/highlighter/ 'GeSHi Highlighter']", - 'syntaxhighlight-specify' => 'Déi gewënscht Sprooch muss sou definéiert ginn:', + 'syntaxhighlight-specify' => 'Déi gewënscht Sprooch muss esou definéiert ginn:', 'syntaxhighlight-supported' => "Ënnerstëtzte Sprooche fir d'Syntax faarweg ze markéieren", 'syntaxhighlight-err-loading' => '(Feeler beim Luede vun der Lëscht vun den ënnerstëtzte Sproochen)', 'syntaxhighlight-err-language' => 'Net valabel Sprooch.', @@ -951,6 +936,7 @@ $messages['pt'] = array( /** Brazilian Portuguese (português do Brasil) * @author Helder.wiki + * @author Heldergeovane */ $messages['pt-br'] = array( 'syntaxhighlight-desc' => 'Providencia realce de sintaxe <syntaxhighlight> através do [http://qbnz.com/highlighter/ GeSHi Highlighter]', @@ -1138,13 +1124,12 @@ $messages['ta'] = array( ); /** Telugu (తెలుగు) - * @author Chaduvari * @author Veeven */ $messages['te'] = array( 'syntaxhighlight-specify' => 'భాషని ఈ విధంగా ఇవ్వాలి:', 'syntaxhighlight-supported' => 'ఛందస్సు ఉద్దీపనకి తోడ్పాటు ఉన్న భాషలు:', - 'syntaxhighlight-err-loading' => '(తోడ్పాటున్న భాషల జాబితా లోడింగులో లోపం జరిగింది)', + 'syntaxhighlight-err-loading' => '(తోడ్పాటున్న భాషల జాబితా లోడింగులో పొరపాటు జరిగింది)', 'syntaxhighlight-err-language' => 'చెల్లని భాష.', ); diff --git a/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php b/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php index 4323d05c..60741577 100644 --- a/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php +++ b/extensions/SyntaxHighlight_GeSHi/geshi/geshi.php @@ -41,7 +41,7 @@ // /** The version of this GeSHi file */ -define('GESHI_VERSION', '1.0.8.11-wmf1'); // WMF fix for Haskell (bug 52509) +define('GESHI_VERSION', '1.0.8.11'); // Define the root directory for the GeSHi code tree if (!defined('GESHI_ROOT')) { diff --git a/extensions/SyntaxHighlight_GeSHi/geshi/geshi/haskell.php b/extensions/SyntaxHighlight_GeSHi/geshi/geshi/haskell.php index d3b494ed..adae1116 100644 --- a/extensions/SyntaxHighlight_GeSHi/geshi/geshi/haskell.php +++ b/extensions/SyntaxHighlight_GeSHi/geshi/geshi/haskell.php @@ -13,14 +13,6 @@ * ------- * 2005/08/27 (1.0.0) * - First Release - * 2013/09/28 - * - Single quotes dropped from QUOTEMARKS to resolve . - * Change is local to SyntaxHighlight_GeSHi, made by Ori Livneh (ori@wikimedia.org), based - * on a proposed upstream patch. - * Upstream bug report: - * - * Upstream patch (stalled since 2012): - * * * TODO (updated 2005/08/27) * ------------------------- @@ -54,7 +46,7 @@ $language_data = array ( 3 => "/{-(?:(?R)|.)-}/s", //Nested Comments ), 'CASE_KEYWORDS' => 0, - 'QUOTEMARKS' => array('"'), // SyntaxHighlight_GeSHi modification; see CHANGES above. + 'QUOTEMARKS' => array('"',"'"), 'ESCAPE_CHAR' => '\\', 'KEYWORDS' => array( /* main haskell keywords */ diff --git a/extensions/TitleBlacklist/.gitreview b/extensions/TitleBlacklist/.gitreview deleted file mode 100644 index 964229c3..00000000 --- a/extensions/TitleBlacklist/.gitreview +++ /dev/null @@ -1,5 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/TitleBlacklist.git -defaultbranch=master diff --git a/extensions/TitleBlacklist/COPYING b/extensions/TitleBlacklist/COPYING deleted file mode 100644 index d159169d..00000000 --- a/extensions/TitleBlacklist/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/extensions/TitleBlacklist/TitleBlacklist.i18n.php b/extensions/TitleBlacklist/TitleBlacklist.i18n.php index 39ce9d24..ca05a33d 100644 --- a/extensions/TitleBlacklist/TitleBlacklist.i18n.php +++ b/extensions/TitleBlacklist/TitleBlacklist.i18n.php @@ -127,7 +127,7 @@ $messages['ar'] = array( هو يطابق مدخلة القائمة السوداء التالية: $1', 'titleblacklist-invalid' => '{{PLURAL:$1||السطر التالي|السطران التاليان|السطور التالية}} في قائمة العناوين السوداء {{PLURAL:$1||غير صحيح|غير صحيحان|غير صحيحة}}؛ من فضلك {{PLURAL:$1||صححه|صححهما|صححهم}} قبل الحفظ:', 'titleblacklist-override' => 'تجاهل القائمة السوداء', - 'right-tboverride' => 'تجاوز قائمتي العناوين أو أسماء المستخدمين السوداوين', + 'right-tboverride' => 'تجاوز قائمة العناوين السوداء', # Fuzzy 'right-tboverride-account' => 'تجاوز قائمة اسم المستخدم السوداء.', ); @@ -227,8 +227,8 @@ $messages['ba'] = array( Ул түбәндәге ҡара исемлек яҙмаһы менән тап килә: $1', 'titleblacklist-forbidden-new-account' => '"$2" исемле ҡатнашыусы булдырыла алмай. Ул түбәндәге ҡара исемлек яҙмаһы менән тап килә: $1', - 'titleblacklist-invalid' => 'Ҡара исемлектә түбәндәге {{PLURAL:$1|1=юл|юлдар}} дөрөҫ түгел; -зинһар, һаҡлар алдынан {{PLURAL:$1|1=уны|уларҙы}} төҙәтегеҙ:', # Fuzzy + 'titleblacklist-invalid' => 'Ҡара исемлектә түбәндәге {{PLURAL:$1|юл|юлдар}} дөрөҫ түгел; +зинһар, һаҡлар алдынан {{PLURAL:$1|уны|уларҙы}} төҙәтегеҙ:', 'titleblacklist-override' => 'Ҡара исемлекте иғтибарға алмаҫҡа', 'right-tboverride' => 'Исемдәр ҡара исемлеген иғтибарға алмау', # Fuzzy 'right-tboverride-account' => 'Ҡатнашыусы исемдәре ҡара исемлеген иғтибарға алмау', @@ -296,8 +296,8 @@ $messages['be-tarask'] = array( Яна адпавядае наступнаму элемэнту чорнага сьпісу: $1', 'titleblacklist-forbidden-new-account' => 'Імя ўдзельніка «$2» было забаронена для стварэньня. Яно адпавядае наступнаму элемэнту чорнага сьпісу: $1', - 'titleblacklist-invalid' => '{{PLURAL:$1|1=Наступны радок у|Наступныя радкі ў}} сьпісе забароненых назваў — {{PLURAL:$1|1=няслушны|няслушныя}}; -калі ласка, выпраўце {{PLURAL:$1|1=яго|іх}} перад захаваньнем:', # Fuzzy + 'titleblacklist-invalid' => '{{PLURAL:$1|Наступны радок у|Наступныя радкі ў}} сьпісе забароненых назваў — {{PLURAL:$1|няслушны|няслушныя}}; +калі ласка, выпраўце {{PLURAL:$1|яго|іх}} перад захаваньнем:', 'titleblacklist-override' => 'Ігнараваць чорны сьпіс', 'right-tboverride' => 'Ігнараваньне чорнага сьпісу назваў і імёнаў удзельнікаў', 'right-tboverride-account' => 'ігнараваньне чорнага сьпісу ўдзельнікаў', @@ -404,7 +404,6 @@ molimo da {{PLURAL:$1|ga|ih}} ispravite prije spremanja:', * @author Aleator * @author El libre * @author Jordi Roqué - * @author Papapep * @author Pitort * @author SMP * @author Vriullop @@ -418,7 +417,7 @@ $messages['ca'] = array( # Per defecte, no distingeix majúscules de minúscules', 'titleblacklist-forbidden-edit' => 'El títol «$2» està prohibit i no es pot crear. Concorda amb la següent entrada de la llista negra: $1', 'titleblacklist-forbidden-move' => "No es pot moure «$2» a «$3», perquè el títol «$3» està prohibit. Concorda amb l'entrada de la llista negra següent: $1", - 'titleblacklist-forbidden-upload' => "S'ha prohibit el nom de fitxer «$2» i se n'impedeix la creació. Concorda amb la següent línia de la llista negra: $1", + 'titleblacklist-forbidden-upload' => "El nom de fitxer «$2» ha estat prohibit i se n'impedeix la creació. Concorda amb la següent línia de la llista negra: $1", 'titleblacklist-forbidden-new-account' => "No es pot crear el nom d'usuari «$2». Coincideix amb la següent entrada de la llista negra: $1", 'titleblacklist-invalid' => '{{PLURAL:$1|La línia següent|Les línies següents}} de la llista negra no {{PLURAL:$1|és vàlida|són vàlides}}; heu de corregir-{{PLURAL:$1|la|les}} abans de guardar:', 'titleblacklist-override' => 'Ignora la llista negra', @@ -430,7 +429,6 @@ $messages['ca'] = array( * @author Умар */ $messages['ce'] = array( - 'titleblacklist-desc' => '[[MediaWiki:Titleblacklist|Ӏаьржа]] а [[MediaWiki:Titlewhitelist|къайн]] а могӀанийн гӀоьнца куьйгалхошна таро хуьлуьйту декъашхойн дӀаяздарш ца кхоллийта.', 'right-tboverride' => 'Ӏаьржачу могӀанийн чура агӀонийн цӀераш тергалцаяр я декъашхой тергалцабар', 'right-tboverride-account' => 'Ӏаьржачу могӀанийн чура декъашхойн цӀераш тергалцаяр', ); @@ -443,7 +441,7 @@ $messages['ckb'] = array( 'right-tboverride' => 'تێپەڕاندنی تاوتوێی پێرستی ڕەشی سەردێڕ یان ناوی بەکارھێنەری', ); -/** Czech (čeština) +/** Czech (česky) * @author Danny B. * @author Li-sung * @author Matěj Grabovský @@ -559,7 +557,6 @@ $messages['de-formal'] = array( /** Zazaki (Zazaki) * @author Aspar * @author Erdemaslancan - * @author Marmase */ $messages['diq'] = array( 'titleblacklist-desc' => 'serkaran re desturê vıraştışê pel u hesabê karberan dano, qey qedexekerdışi re yew [[MediaWiki:Titleblacklist|listeya risiyayan]] u [[MediaWiki:Titlewhitelist|listeya risıpiyan]] dano.', @@ -576,8 +573,8 @@ malumatê ey na listeyasiya de zepê ya: $1', malumatê ey na listeyasiya de zêpê ya: $1', 'titleblacklist-forbidden-new-account' => 'vıraştışê nameyê karberê"$2" i qedexe bı. malumatê ey na listeyasiya de zêpê ya: $1', - 'titleblacklist-invalid' => 'Na ğırab lista dı {{PLURAL:$1|en asatır|ené satıri}} néravérené; -Verdé qeyd kerdışi timar keré:', + 'titleblacklist-invalid' => 'nê {{PLURAL:$1|satır o ke|satır ê ke}} listeyasiyayi de qedexe yê; +kerem kerê verqeydkerdışi de raşt kerê:', 'titleblacklist-override' => 'Tenilisti mehesebne', 'right-tboverride' => 'Siya listeya sernuşti nêravêrde ke', 'right-tboverride-account' => 'Tenilisteya naman dê karberan mehesebnê', @@ -699,14 +696,14 @@ $messages['et'] = array( 'titlewhitelist' => '# See pealkiri on valges nimekirjas. Kommentaariks kasuta märki "#". # Vaikimisi on see tõstutundetu', 'titleblacklist-forbidden-edit' => 'Lehekülje pealkirjaga "$2" loomine on keelatud. -See vastab järgmisele musta nimekirja sissekandele: $1', - 'titleblacklist-forbidden-move' => 'Lehekülge "$2" ei saa teisaldada pealkirja "$3" alla, sest lehekülje loomine pealkirjaga "$3" on keelatud. -See vastab järgmisele musta nimekirja sissekandele: $1', - 'titleblacklist-forbidden-upload' => 'Faili pealkirjaga "$2" on keelatud üles laadida. -See vastab järgmisele musta nimekirja sissekandele: $1', - 'titleblacklist-forbidden-new-account' => 'Kasutajat nimega "$2" on keelatud luua. -See vastab järgmisele musta nimekirja sissekandele: $1', - 'titleblacklist-invalid' => '{{PLURAL:$1|Järgmine|Järgmised}} musta nimekirja {{PLURAL:$1|rida on vigane|read on vigased}}. +See vastab järgnevale musta nimekirja sissekandele: $1', + 'titleblacklist-forbidden-move' => 'Lehekülge "$2" ei saa teisaldada pealkirja "$3" alla, sest lehekülgede pealkirjaga "$3" loomine on keelatud. +See vastab järgnevale musta nimekirja sissekandele: $1', + 'titleblacklist-forbidden-upload' => 'Pealkirjaga "$2" on keelatud faili üles laadida. +See vastab järgnevale musta nimekirja sissekandele: $1', + 'titleblacklist-forbidden-new-account' => 'Kasutaja nimega "$2" loomine on keelatud. +See vastab järgnevale musta nimekirja sissekandele: $1', + 'titleblacklist-invalid' => '{{PLURAL:$1|Järgnev|Järgnevad}} musta nimekirja {{PLURAL:$1|rida on vigane|read on vigased}}. Palun paranda {{PLURAL:$1|see|need}} enne salvestamist:', 'titleblacklist-override' => 'Eira musta nimekirja', 'right-tboverride' => 'Eirata pealkirjade või kasutajanimede musta nimekirja', @@ -918,12 +915,10 @@ $messages['gu'] = array( /** Hebrew (עברית) * @author Amire80 - * @author Guycn2 * @author Rotem Liss - * @author Rotemliss */ $messages['he'] = array( - 'titleblacklist-desc' => 'אפשרות למפעילי המערכת לאסור יצירת דפים וחשבונות משתמש לפי [[MediaWiki:Titleblacklist|רשימה שחורה]] ו[[MediaWiki:Titlewhitelist|רשימה לבנה]]', + 'titleblacklist-desc' => 'אפשרות למנהלים לאסור על יצירת דפים וחשבונות משתמש לפי [[MediaWiki:Titleblacklist|רשימה שחורה]] ו[[MediaWiki:Titlewhitelist|רשימה לבנה]]', 'titleblacklist' => '# זוהי רשימת הכותרות האסורות. לא ניתן ליצור כותרות וחשבונות משתמש שמתאימים לביטוי רגולרי המופיע כאן. # השתמשו בסימן "#" להערות. #רשימה זו אינה תלויה ברישיות כברירת מחדל.', @@ -941,7 +936,7 @@ $messages['he'] = array( אנא תקנו {{PLURAL:$1|אותה|אותן}} לפני השמירה:', 'titleblacklist-override' => 'התעלם מהרשימה השחורה', 'right-tboverride' => 'עקיפת רשימת שמות המשתמשים האסורים', - 'right-tboverride-account' => 'עקיפת הרשימה השחורה של שמות המשתמשים', + 'right-tboverride-account' => 'לעקוף את הרשימה השחורה של שמות המשתמשים', ); /** Hindi (हिन्दी) @@ -1379,15 +1374,14 @@ Hic titulus congruit cum expressione regulari: $1', /** Luxembourgish (Lëtzebuergesch) * @author Robby - * @author Soued031 */ $messages['lb'] = array( 'titleblacklist-desc' => "Erlaabt den Administrateuren et d'Uleeë vu Säiten a Benotzerkonte mat spezifeschen Titelen iwwer eng [[MediaWiki:Titleblacklist|schwaarz Lëscht]] an eng [[MediaWiki:Titlewhitelist|wäiss Lëscht]] ze verbidden", 'titleblacklist' => '# Dëst ass een Titel deen op enger schwaarzer Lëscht steet. Titelen a Benotzernimm op déi dës Ausdréck passe kann net ugeluecht ginn # Benotzt "#" fir Bemierkungen -# Et gëtt tëscht groussen a klenge Buchstawen ënnerscheet', +# Et gëtt tëschent groussen a klenge Buchstawen ënnerscheed', 'titlewhitelist' => "# Dëst ass d'''Whitelist'' vun den Titelen. Benotzt \"#\" fir Bemierkungen. -# Et gëtt een Ënnerscheed tëscht groussen a klenge Buchstawe gemaach", +# Et gëtt een Ënnerscheed tëschent groussen a klenge Buchstawe gemaach", 'titleblacklist-forbidden-edit' => 'Den Titel "$2" dàerf net ugeluecht ginn. En ass op der schwaarzer Lëscht wéint folgendem Begrëff: $1', 'titleblacklist-forbidden-move' => '"$2" kann net op "$3" geréckelt ginn, well den Titel "$3" net däerf ugeluecht ginn. @@ -1395,7 +1389,7 @@ En entsprécht dëser Rubrik vun der schwaarzr Lëscht: $1', 'titleblacklist-forbidden-upload' => 'De Fichiersnumm "$2" kann net benotzt ginn. Hien ass identesch mat dësem Numm vun der schwaarzer Lëscht (black list): $1', 'titleblacklist-forbidden-new-account' => 'De Benotzermumm "$2" gouf gespaart fir benotzt ze ginn. -En ass sou op der \'\'schwaarzer Lëscht\'\': $1', +En ass esou op der \'\'schwaarzer Lëscht\'\': $1', 'titleblacklist-invalid' => 'Dës {{PLURAL:$1|Linn|Linnen}} op der schwaarzer Lëscht vun den {{PLURAL:$1|Titelen ass|Titele sinn}} net valabel; verbessert se virum späicheren:', 'titleblacklist-override' => 'Schwaarz Lëscht ignoréieren', @@ -1504,10 +1498,9 @@ $messages['ml'] = array( * @author Kaustubh * @author Mahitgar * @author Rahuldeshmukh101 - * @author V.narsikar */ $messages['mr'] = array( - 'titleblacklist-desc' => '[[MediaWiki:Titleblacklist|ब्लॅकलीस्ट]] व [[MediaWiki:Titlewhitelist|व्हाईट लीस्ट]] ला अनुसरून पाने आणि सदस्य खात्यांना प्रतिबंधित करण्याची प्रचालकांना परवानगी द्या', + 'titleblacklist-desc' => '[[MediaWiki:Titleblacklist|ब्लॅकलीस्ट]] व [[MediaWiki:Titlewhitelist|व्हाईट लीस्ट]] ला अनुसरून पाने आणि सदस्य खात्यांना प्रतिबंधतीअ करण्याची प्रचालकांना परवानगी द्या', 'titleblacklist' => '# ही ब्लॉक केलेल्या शीर्षकांची यादी आहे. या यादीत असलेल्या शीर्षकांचे लेख लिहिता येणार नाहीत. # शेरा देण्यासाठी "#" वापरा.', 'titlewhitelist' => '# ही वापरू शकत असलेल्या शीर्षकांची यादी आहे. शेरा देण्यासाठी "#" वापरा', @@ -1705,17 +1698,15 @@ $messages['or'] = array( /** Polish (polski) * @author Beau * @author BeginaFelicysym - * @author Chrumps * @author Derbeth - * @author Peter Bowman * @author Sp5uhe */ $messages['pl'] = array( 'titleblacklist-desc' => 'Pozwala na blokowanie tworzenia stron i kont użytkowników o określonych nazwach wykorzystując [[MediaWiki:Titleblacklist|czarną]] oraz [[MediaWiki:Titlewhitelist|białą]] listę', - 'titleblacklist' => '# Lista zabronionych nazw. Strony i konta o nazwach odpowiadających poniższym wyrażeniom regularnym nie będą mogły zostać utworzone. -# Użyj znaku „#”, aby utworzyć komentarz. + 'titleblacklist' => '# Lista zabronionych nazw. Strony i konta o nazwach odpowiadających poniższym wyrażeniom regularnym, nie będą mogły zostać utworzone. +# Użyj znaku „#”, by utworzyć komentarz. # Domyślnie we wpisach ma znaczenie wielkość znaków.', - 'titlewhitelist' => '# To jest lista dopuszczalnych nazw artykułów. Użyj znaku „#”, aby utworzyć komentarz. + 'titlewhitelist' => '# To jest lista dopuszczalnych nazw artykułów. Użyj znaku „#” by utworzyć komentarz. # Domyślnie we wpisach ma znaczenie wielkość znaków.', 'titleblacklist-forbidden-edit' => 'Utworzenie strony o nazwie „$2” nie jest możliwe. Nazwa ta pasuje do wpisu z czarnej listy: $1', @@ -1727,7 +1718,7 @@ Nazwa ta pasuje do wpisu z czarnej listy: $1', Nazwa ta pasuje do wpisu z czarnej listy: $1', 'titleblacklist-invalid' => '{{PLURAL:$1|Następująca linia|Następujące linie}} na liście zabronionych tytułów stron {{PLURAL:$1|jest nieprawidłowa|są nieprawidłowe}}. Popraw {{PLURAL:$1|ją|je}} przed zapisaniem:', 'titleblacklist-override' => 'Ignoruj czarną listę', - 'right-tboverride' => 'Ignorowanie czarnej listy tytułów lub nazw użytkowników', + 'right-tboverride' => 'Zastąp czarną listę zabronionych tytułów stron lub nazw użytkowników', 'right-tboverride-account' => 'Ignorowanie czarnej listy użytkowników', ); @@ -1929,7 +1920,7 @@ $messages['ru'] = array( 'titleblacklist-forbidden-upload' => 'Файл с названием «$2» был запрещён к созданию. Он попадает под следующую запись списка запрещенных названий: $1', 'titleblacklist-forbidden-new-account' => 'Запрещено использовать имя участника «$2». Имя соответствует следующей записи из чёрного списка: $1', - 'titleblacklist-invalid' => '{{PLURAL:$1|1=Следующая строка|Следующие строки}} в списке запрещённых названий {{PLURAL:$1|1=не является правильным регулярным выражением|не являются правильными регулярными выражениями}}. Пожалуйста, исправьте {{PLURAL:$1|1=её|их}} перед сохранением:', + 'titleblacklist-invalid' => '{{PLURAL:$1|Следующая строка|Следующие строки}} в списке запрещённых названий {{PLURAL:$1|не является правильным регулярным выражением|не являются правильными регулярными выражениями}}. Пожалуйста, исправьте {{PLURAL:$1|её|их}} перед сохранением:', 'titleblacklist-override' => 'Игнорировать чёрный список', 'right-tboverride' => 'игнорирование чёрного списка имён страниц или участников', 'right-tboverride-account' => 'игнорирование чёрного списка имён участников', @@ -2007,14 +1998,6 @@ $messages['sah'] = array( 'right-tboverride-account' => 'кыттааччылар ааттарын "хара тиһигин" туттума', ); -/** Serbo-Croatian (srpskohrvatski / српскохрватски) - * @author Kolega2357 - */ -$messages['sh'] = array( - 'right-tboverride' => 'Zaobilaženje spiska zabranjenih naslova', - 'right-tboverride-account' => 'Zaobilaženje spiska zabranjenih korisničkih imena', -); - /** Sinhala (සිංහල) * @author Budhajeewa * @author පසිඳු කාවින්ද @@ -2341,7 +2324,6 @@ lütfen kaydetmeden önce düzeltin:', /** Ukrainian (українська) * @author AS * @author Ahonc - * @author Andriykopanytsia * @author Base * @author JenVan * @author Prima klasy4na @@ -2360,8 +2342,8 @@ $messages['uk'] = array( Вона підпадає під наступний запис із списку заборонених назв: $1', 'titleblacklist-forbidden-new-account' => "Заборонено використовувати ім'я користувача «$2». Ім'я відповідає наступному запису з чорного списку: $1", - 'titleblacklist-invalid' => '{{PLURAL:$1|1=Наступний рядок|Наступні рядки}} списку заборонених назв є {{PLURAL:$1|1=помилковим|помилковими}}; -будь ласка, виправте {{PLURAL:$1|1=його|їх}} перед збереженням:', + 'titleblacklist-invalid' => '{{PLURAL:$1|Наступнинй рядок|Наступні рядки}} списку заборонених назв є {{PLURAL:$1|помилковим|помилковими}}; +будь ласка, виправіть {{PLURAL:$1|його|їх}} перед збереженням:', 'titleblacklist-override' => 'Ігнорувати чорний список', 'right-tboverride' => 'ігнорування чорного списку назв сторінок або користувачів', 'right-tboverride-account' => 'ігнорування чорного списку імен користувачів', diff --git a/extensions/TitleBlacklist/TitleBlacklist.library.php b/extensions/TitleBlacklist/TitleBlacklist.library.php deleted file mode 100644 index 0c2a599c..00000000 --- a/extensions/TitleBlacklist/TitleBlacklist.library.php +++ /dev/null @@ -1,33 +0,0 @@ - array( $this, 'test' ), - ); - - $this->getEngine()->registerInterface( __DIR__ . '/mw.ext.TitleBlacklist.lua', $lib, array() ); - } - - public function test( $action = null, $title = null ) { - $this->checkType( 'mw.ext.TitleBlacklist.test', 1, $action, 'string' ); - $this->checkTypeOptional( 'mw.ext.TitleBlacklist.test', 2, $title, 'string', '' ); - $this->incrementExpensiveFunctionCount(); - if ( $title == '' ) { - $title = $this->getParser()->mTitle->getPrefixedText(); - } - $entry = TitleBlacklist::singleton()->isBlacklisted( $title, $action ); - if ( $entry ) { - return array( array( - 'params' => $entry->getParams(), - 'regex' => $entry->getRegex(), - 'raw' => $entry->getRaw(), - 'version' => $entry->getFormatVersion(), - 'message' => $entry->getErrorMessage( $action ), - 'custommessage' => $entry->getCustomMessage() - ) ); - } - return array( null ); - } - -} diff --git a/extensions/TitleBlacklist/TitleBlacklist.list.php b/extensions/TitleBlacklist/TitleBlacklist.list.php index 3947e8ae..d197a9c5 100644 --- a/extensions/TitleBlacklist/TitleBlacklist.list.php +++ b/extensions/TitleBlacklist/TitleBlacklist.list.php @@ -156,12 +156,7 @@ class TitleBlacklist { if ( $override && self::userCanOverride( $user, $action ) ) { return false; } else { - $entry = $this->isBlacklisted( $title, $action ); - if ( !$entry ) { - return false; - } - $params = $entry->getParams(); - return isset( $params['autoconfirmed'] ) && $user->isAllowed( 'autoconfirmed' ) ? false : $entry; + return $this->isBlacklisted( $title, $action ); } } @@ -177,29 +172,17 @@ class TitleBlacklist { public function isBlacklisted( $title, $action = 'edit' ) { if ( !( $title instanceof Title ) ) { $title = Title::newFromText( $title ); - if ( !( $title instanceof Title ) ) { - // The fact that the page name is invalid will stop whatever - // action is going through. No sense in doing more work here. - return false; - } } $blacklist = $this->getBlacklist(); - $autoconfirmedItem = false; foreach ( $blacklist as $item ) { - if ( $item->matches( $title->getFullText(), $action ) ) { + if ( $item->matches( $title, $action ) ) { if ( $this->isWhitelisted( $title, $action ) ) { return false; } - $params = $item->getParams(); - if ( !isset( $params['autoconfirmed'] ) ) { - return $item; - } - if ( !$autoconfirmedItem ) { - $autoconfirmedItem = $item; - } + return $item; // "returning true" } } - return $autoconfirmedItem; + return false; } /** @@ -216,7 +199,7 @@ class TitleBlacklist { } $whitelist = $this->getWhitelist(); foreach ( $whitelist as $item ) { - if ( $item->matches( $title->getFullText(), $action ) ) { + if ( $item->matches( $title, $action ) ) { return true; } } @@ -360,7 +343,7 @@ class TitleBlacklistEntry { * Check whether a user can perform the specified action * on the specified Title * - * @param $title string to check + * @param $title Title to check * @param $action %Action to check * @return bool TRUE if the the regex matches the title, and is not overridden * else false if it doesn't match (or was overridden) @@ -374,20 +357,15 @@ class TitleBlacklistEntry { return false; } - if ( isset( $this->mParams['antispoof'] ) && is_callable( 'AntiSpoof::checkUnicodeString' ) ) { - list( $ok, $norm ) = AntiSpoof::checkUnicodeString( $title ); - if ( $ok == "OK" ) { - list( $ver, $title ) = explode( ':', $norm, 2 ); - } else { - wfDebugLog( 'TitleBlacklist', 'AntiSpoof could not normalize "' . $title . '".' ); - } - } - wfSuppressWarnings(); - $match = preg_match( "/^(?:{$this->mRegex})$/us" . ( isset( $this->mParams['casesensitive'] ) ? '' : 'i' ), $title ); + $match = preg_match( "/^(?:{$this->mRegex})$/us" . ( isset( $this->mParams['casesensitive'] ) ? '' : 'i' ), $title->getFullText() ); wfRestoreWarnings(); + global $wgUser; if ( $match ) { + if ( isset( $this->mParams['autoconfirmed'] ) && $wgUser->isAllowed( 'autoconfirmed' ) ) { + return false; + } if ( isset( $this->mParams['moveonly'] ) && $action != 'move' ) { return false; } @@ -449,9 +427,6 @@ class TitleBlacklistEntry { if ( preg_match( '/errmsg\s*=\s*(.+)/i', $opt, $matches ) ) { $options['errmsg'] = $matches[1]; } - if ( $opt2 == 'antispoof' ) { - $options['antispoof'] = true; - } } // Process magic words preg_match_all( '/{{\s*([a-z]+)\s*:\s*(.+?)\s*}}/', $regex, $magicwords, PREG_SET_ORDER ); @@ -494,10 +469,10 @@ class TitleBlacklistEntry { } /** - * @return array This entry's parameters + * @return array This entry's options */ - public function getParams() { - return $this->mParams; + public function getOptions() { + return $this->mOptions; } /** diff --git a/extensions/TitleBlacklist/TitleBlacklist.php b/extensions/TitleBlacklist/TitleBlacklist.php index acd946d6..68fb6778 100644 --- a/extensions/TitleBlacklist/TitleBlacklist.php +++ b/extensions/TitleBlacklist/TitleBlacklist.php @@ -22,7 +22,6 @@ $dir = __DIR__; $wgExtensionMessagesFiles['TitleBlacklist'] = $dir . '/TitleBlacklist.i18n.php'; $wgAutoloadClasses['TitleBlacklist'] = $dir . '/TitleBlacklist.list.php'; $wgAutoloadClasses['TitleBlacklistHooks'] = $dir . '/TitleBlacklist.hooks.php'; -$wgAutoloadClasses['Scribunto_LuaTitleBlacklistLibrary'] = $dir . '/TitleBlacklist.library.php'; /** @defgroup Title blacklist source types * @{ @@ -77,16 +76,6 @@ $wgHooks['CentralAuthAutoCreate'][] = 'TitleBlacklistHooks::centralAuthAutoCreat $wgHooks['EditFilter'][] = 'TitleBlacklistHooks::validateBlacklist'; $wgHooks['ArticleSaveComplete'][] = 'TitleBlacklistHooks::clearBlacklist'; $wgHooks['UserCreateForm'][] = 'TitleBlacklistHooks::addOverrideCheckbox'; -$wgHooks['UnitTestsList'][] = function( &$files ) { - $files += glob( __DIR__ . '/tests/*Test.php' ); - return true; -}; -$wgHooks['ScribuntoExternalLibraries'][] = function( $engine, array &$extraLibraries ) { - if( $engine == 'lua' ) { - $extraLibraries['mw.ext.TitleBlacklist'] = 'Scribunto_LuaTitleBlacklistLibrary'; - } - return true; -}; $wgResourceModules['mediawiki.api.titleblacklist'] = array( 'scripts' => 'mediawiki.api.titleblacklist.js', diff --git a/extensions/TitleBlacklist/mw.ext.TitleBlacklist.lua b/extensions/TitleBlacklist/mw.ext.TitleBlacklist.lua deleted file mode 100644 index 1b48eed1..00000000 --- a/extensions/TitleBlacklist/mw.ext.TitleBlacklist.lua +++ /dev/null @@ -1,22 +0,0 @@ -local TitleBlacklist = {} -local php - -function TitleBlacklist.test( action, title ) - return php.test( action, title ) -end - -function TitleBlacklist.setupInterface( options ) - -- Boilerplate - TitleBlacklist.setupInterface = nil - php = mw_interface - mw_interface = nil - - -- Register this library in the "mw" global - mw = mw or {} - mw.ext = mw.ext or {} - mw.ext.TitleBlacklist = TitleBlacklist - - package.loaded['mw.ext.TitleBlacklist'] = TitleBlacklist -end - -return TitleBlacklist diff --git a/extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php b/extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php deleted file mode 100644 index 344e9996..00000000 --- a/extensions/TitleBlacklist/tests/ApiQueryTitleBlacklistTest.php +++ /dev/null @@ -1,132 +0,0 @@ - - */ - -ini_set( 'include_path', ini_get( 'include_path' ) . ':' . __DIR__ . '/../../../tests/phpunit/includes/api' ); - -/** - * @group medium - **/ -class ApiQueryTitleBlacklistTest extends ApiTestCase { - - function setUp() { - global $wgTitleBlacklistSources; - parent::setUp(); - $this->doLogin(); - - $wgTitleBlacklistSources = array( - array( - 'type' => TBLSRC_FILE, - 'src' => __DIR__ . '/testSource', - ), - ); - } - - /** - * Verify we allow a title which is not blacklisted - */ - function testCheckingUnlistedTitle() { - $unlisted = $this->doApiRequest( array( - 'action' => 'titleblacklist', - // evil_acc is blacklisted as - 'tbtitle' => 'evil_acc', - 'tbaction' => 'create', - 'tbnooverride' => true, - ) ); - - $this->assertEquals( - 'ok', - $unlisted[0]['titleblacklist']['result'], - 'Not blacklisted title returns ok' - ); - } - - /** - * Verify tboverride works - */ - function testTboverride() { - global $wgGroupPermissions; - - // Allow all users to override the titleblacklist - $wgGroupPermissions['*']['tboverride'] = true; - - $unlisted = $this->doApiRequest( array( - 'action' => 'titleblacklist', - 'tbtitle' => 'bar', - 'tbaction' => 'create', - ) ); - - $this->assertEquals( - 'ok', - $unlisted[0]['titleblacklist']['result'], - 'Blacklisted title returns ok if the user is allowd to tboverride' - ); - } - - /** - * Verify a blacklisted title gives out an error. - */ - function testCheckingBlackListedTitle() { - $listed = $this->doApiRequest( array( - 'action' => 'titleblacklist', - 'tbtitle' => 'bar', - 'tbaction' => 'create', - 'tbnooverride' => true, - ) ); - - $this->assertEquals( - 'blacklisted', - $listed[0]['titleblacklist']['result'], - 'Listed title returns error' - ); - $this->assertEquals( - "The title \"bar\" has been banned from creation.\nIt matches the following blacklist entry: [Bb]ar #example blacklist entry", - $listed[0]['titleblacklist']['reason'], - 'Listed title error text is as expected' - ); - - $this->assertEquals( - "titleblacklist-forbidden-edit", - $listed[0]['titleblacklist']['message'], - 'Correct blacklist message name is returned' - ); - - $this->assertEquals( - "[Bb]ar #example blacklist entry", - $listed[0]['titleblacklist']['line'], - 'Correct blacklist line is returned' - ); - } - - /** - * Tests integration with the AntiSpoof extension - */ - function testAntiSpoofIntegration() { - if ( !class_exists( 'AntiSpoof') ) { - $this->markTestSkipped( "This test requires the AntiSpoof extension" ); - } - - $listed = $this->doApiRequest( array( - 'action' => 'titleblacklist', - 'tbtitle' => 'AVVVV', - 'tbaction' => 'create', - 'tbnooverride' => true, - ) ); - - $this->assertEquals( - 'blacklisted', - $listed[0]['titleblacklist']['result'], - 'Spoofed title is blacklisted' - ); - - } -} diff --git a/extensions/TitleBlacklist/tests/testSource b/extensions/TitleBlacklist/tests/testSource deleted file mode 100644 index 235cc671..00000000 --- a/extensions/TitleBlacklist/tests/testSource +++ /dev/null @@ -1,5 +0,0 @@ -[Bb]ar #example blacklist entry -.*[Ff]ail.* -.*[Nn]yancat.* -.*evil_acc.* -AW{1,10} diff --git a/extensions/WikiEditor/.gitreview b/extensions/WikiEditor/.gitreview deleted file mode 100644 index 622413f0..00000000 --- a/extensions/WikiEditor/.gitreview +++ /dev/null @@ -1,6 +0,0 @@ -[gerrit] -host=gerrit.wikimedia.org -port=29418 -project=mediawiki/extensions/WikiEditor.git -defaultbranch=master -defaultrebase=0 diff --git a/extensions/WikiEditor/.jshintignore b/extensions/WikiEditor/.jshintignore deleted file mode 100644 index b97a47d3..00000000 --- a/extensions/WikiEditor/.jshintignore +++ /dev/null @@ -1,4 +0,0 @@ -# upstream lib from Google -modules/contentCollector.js -# messy -modules/jquery.wikiEditor.iframe.js diff --git a/extensions/WikiEditor/.jshintrc b/extensions/WikiEditor/.jshintrc deleted file mode 100644 index 5d335e32..00000000 --- a/extensions/WikiEditor/.jshintrc +++ /dev/null @@ -1,33 +0,0 @@ -{ - /* Common */ - - // Enforcing - "camelcase": true, - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": true, - "newcap": true, - "noarg": true, - "noempty": true, - "nonew": true, - "quotmark": "single", - "trailing": true, - "undef": true, - "unused": true, - // Legacy - "onevar": true, - - /* Local */ - - // Relaxing - "loopfunc": true, - "multistr": true, - // Environment - "browser": true, - - "predef": [ - "mediaWiki", - "jQuery" - ] -} diff --git a/extensions/WikiEditor/COPYING b/extensions/WikiEditor/COPYING deleted file mode 100644 index d159169d..00000000 --- a/extensions/WikiEditor/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/extensions/WikiEditor/WikiEditor.i18n.php b/extensions/WikiEditor/WikiEditor.i18n.php index fa3c1b0b..26f1e2ca 100644 --- a/extensions/WikiEditor/WikiEditor.i18n.php +++ b/extensions/WikiEditor/WikiEditor.i18n.php @@ -334,7 +334,6 @@ I guess that "feature-providing modules" means the same as "modules providing fe {{Identical|Publish}}", 'wikieditor-publish-dialog-goback' => 'Button that closes the dialog that opens when the user clicks the Publish button. {{Identical|Go back}}', - 'wikieditor-template-editor-dialog-title' => '{{Identical|Edit template}}', 'wikieditor-template-editor-dialog-submit' => '{{Identical|Update}}', 'wikieditor-template-editor-dialog-cancel' => '{{Identical|Cancel}}', 'wikieditor-toc-preference' => "Option at [[Special:Preferences]], tab ''{{int:prefs-editing}}''", @@ -1282,7 +1281,6 @@ $1:Eixemplo.jpg|Piet_de_foto_2', /** Old English (Ænglisc) * @author Gott wisst - * @author Shirayuki * @author Wōdenhelm */ $messages['ang'] = array( @@ -4034,7 +4032,6 @@ $1:Cuntuh.jpg|Judul2', ); /** Bengali (বাংলা) - * @author Aftab1995 * @author Bellayet * @author Leemon2010 * @author Nasir8891 @@ -4152,8 +4149,8 @@ $messages['bn'] = array( 'wikieditor-toolbar-tool-subscript-example' => 'সাবস্ক্রিপ্ট লেখা', 'wikieditor-toolbar-group-insert' => 'যোগ করো', 'wikieditor-toolbar-tool-gallery' => 'ছবির গ্যালারী', - 'wikieditor-toolbar-tool-gallery-example' => '$1:উদাহরণ.jpg|ক্যাপশন১ -$1:উদাহরণ.jpg|ক্যাপশন২', + 'wikieditor-toolbar-tool-gallery-example' => '$1:Example.jpg|ক্যাপশন১ +$1:Example.jpg|ক্যাপশন২', 'wikieditor-toolbar-tool-newline' => 'নতুন লাইন', 'wikieditor-toolbar-tool-table' => 'ছক', 'wikieditor-toolbar-tool-table-example-old' => '- @@ -5072,7 +5069,7 @@ Voleu convertir-lo en un enllaç intern?", 'wikieditor-toolbar-tool-link-empty' => 'No heu entrat res per enllaçar.', 'wikieditor-toolbar-tool-file' => 'Fitxer incrustat', 'wikieditor-toolbar-tool-file-example' => 'Exemple.png', - 'wikieditor-toolbar-tool-file-title' => 'Inserir un fitxer', + 'wikieditor-toolbar-tool-file-title' => 'Insereix arxiu', 'wikieditor-toolbar-file-target' => 'Nom del fitxer:', 'wikieditor-toolbar-file-caption' => 'Títol:', 'wikieditor-toolbar-file-size' => 'Mida:', @@ -5080,7 +5077,7 @@ Voleu convertir-lo en un enllaç intern?", 'wikieditor-toolbar-file-default' => '(per defecte)', 'wikieditor-toolbar-file-format' => 'Format:', 'wikieditor-toolbar-file-format-none' => 'cap', - 'wikieditor-toolbar-tool-file-insert' => 'Insereix', + 'wikieditor-toolbar-tool-file-insert' => 'Inserta', 'wikieditor-toolbar-tool-file-cancel' => 'Cancel·la', 'wikieditor-toolbar-tool-reference' => 'Referència', 'wikieditor-toolbar-tool-reference-example' => 'Inseriu la nota al peu aquí', @@ -5254,8 +5251,8 @@ $1:Example.jpg|Peu2', * @author Умар */ $messages['ce'] = array( - 'wikieditor' => 'Викийоза тадаран шоьйра интерфейс', - 'wikieditor-desc' => 'Тадарш даран шоьйра интерфейс латайо кхин дукху фукцеш а', + 'wikieditor' => 'Викийозан рéдоккхучечохь аллсам чулоцург', + 'wikieditor-desc' => 'Аьтто бо тlе хуттучо, викийозан аъ ишта кхечу харжамна рéдоккхучечохь аллсам чулоцучо', 'wikieditor-wikitext-tab' => 'Викийоза', 'wikieditor-loading' => 'Чуйолуш', 'wikieditor-preview-preference' => 'Латайé хьалха муха ю хьажар дуьхь дуьхьал', @@ -5268,7 +5265,7 @@ $messages['ce'] = array( 'wikieditor-publish-preference' => 'Латайé цхьац ког бокхуш чутохар', 'wikieditor-publish-button-publish' => 'Нахангайта', 'wikieditor-publish-button-cancel' => 'Цаоьшу', - 'wikieditor-publish-dialog-title' => '{{SITENAME}} проектехь арахецар', + 'wikieditor-publish-dialog-title' => 'Нахангайта оцу кхолламехь {{SITENAME}}', 'wikieditor-publish-dialog-summary' => 'Хийцамах лаьцна (доц язде хlу хийцам бина ахьа):', 'wikieditor-publish-dialog-minor' => 'Жим хийцам', 'wikieditor-publish-dialog-watch' => 'Тергам бé хlокху агlон', @@ -5282,42 +5279,41 @@ $messages['ce'] = array( 'wikieditor-toc-preference' => 'Латедé коьрта дерг шавигарна аттонца', 'wikieditor-toc-show' => 'Гайта коьртехь дерг', 'wikieditor-toc-hide' => 'Къайлахьо коьртехь дерг', - 'wikieditor-toolbar' => 'Тадаран меттиг', - 'wikieditor-toolbar-desc' => 'Тадаран меттиг гӀоле лелорца', + 'wikieditor-toolbar' => 'Рéдоккху меттиг', + 'wikieditor-toolbar-desc' => 'Рéдоккху меттиг гlоле лелорца', 'wikieditor-toolbar-preference' => 'Латайé гlоле йолу тадар', - 'wikieditor-toolbar-dialogs-preference' => 'Латайé йозан хьажораг йуьллург, таблицан а кхин хӀумнашна а', + 'wikieditor-toolbar-dialogs-preference' => 'Латайé йозан хьажориг йуьллург, таблийцан аъ кхин хlумнашна', # Fuzzy 'wikieditor-toolbar-loading' => 'Чуйолуш…', 'wikieditor-toolbar-tool-bold' => 'Дерстино', 'wikieditor-toolbar-tool-bold-example' => 'Дерстино до йоза', 'wikieditor-toolbar-tool-italic' => 'Сетта', 'wikieditor-toolbar-tool-italic-example' => 'Сеттан до йоза', - 'wikieditor-toolbar-tool-ilink' => 'Чоьхьа хьажораг', + 'wikieditor-toolbar-tool-ilink' => 'Чоьхьа хьажориг', 'wikieditor-toolbar-tool-ilink-example' => 'Хьажориган коьрта могlа', 'wikieditor-toolbar-tool-xlink' => 'Арахьара хьажораг (йиц ма йе хӀотталушерг http://)', - 'wikieditor-toolbar-tool-xlink-example' => 'http://www.example.com хьажораг корта', - 'wikieditor-toolbar-tool-link' => 'Хьажораг', - 'wikieditor-toolbar-tool-link-title' => 'Чуйилла хьажораг', - 'wikieditor-toolbar-tool-link-int' => 'Вики агӀоне', - 'wikieditor-toolbar-tool-link-int-target' => 'Хьажийна агӀо я URL:', - 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'АгӀон цӀе я URL', + 'wikieditor-toolbar-tool-xlink-example' => 'http://www.example.com хьажориг корта', + 'wikieditor-toolbar-tool-link' => 'Хьажориг', + 'wikieditor-toolbar-tool-link-title' => 'Чуйилла хьажориг', + 'wikieditor-toolbar-tool-link-int' => 'Оцу вики агlон', + 'wikieditor-toolbar-tool-link-int-target' => 'Хьажийна агlо йа URL:', + 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'Агlон цlе йа URL', 'wikieditor-toolbar-tool-link-int-text' => 'Гойтуш долу йоза:', 'wikieditor-toolbar-tool-link-int-text-tooltip' => 'Чудилла схьагайта дезаш долу йоза', 'wikieditor-toolbar-tool-link-ext' => 'Хьалхара агlон чохь', - 'wikieditor-toolbar-tool-link-ext-target' => 'URL хьажорагаш:', - 'wikieditor-toolbar-tool-link-ext-text' => 'Хьажораган йоза:', - 'wikieditor-toolbar-tool-link-insert' => 'Чуйилла хьажораг', + 'wikieditor-toolbar-tool-link-ext-target' => 'URL хьажоригаш:', + 'wikieditor-toolbar-tool-link-ext-text' => 'Хьажориган йоза:', + 'wikieditor-toolbar-tool-link-insert' => 'Чуйилла хьажориг', 'wikieditor-toolbar-tool-link-cancel' => 'Цаоьшу', 'wikieditor-toolbar-tool-link-int-target-status-exists' => 'Ишта агlо йолш ю', 'wikieditor-toolbar-tool-link-int-target-status-notexists' => 'Ишта агlо яц', 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Ца магайо цlе', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Арахьара хьажораг', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'Агlо ю яц хьоьжуш…', - 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'Дуккха маьӀнаш долу агӀонаш', 'wikieditor-toolbar-tool-link-int-invalid' => 'Гойтуш йолу цlе ца магайо.', - 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'Ахьа хоттийна URL кхечу вики-агӀонан хьажорагах тера ю. Лаьий хьуна и хьажораг чоьхьарчех я?', - 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Чоьхьа хьажораг', + 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'Ахьа хоттийна URL кхечу вики-агlонан хьажоригах тера ю. Лаьий хьуна и хьажориг чоьхьарчех я?', + 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Чоьхьа хьажориг', 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' => 'Арахьара хьажораг', - 'wikieditor-toolbar-tool-link-empty' => 'Ахьа ца гайтин мичхьа хьажойеза хьажораг.', + 'wikieditor-toolbar-tool-link-empty' => 'Ахьа ца гайтин мичхьа хьажойеза хьажориг.', 'wikieditor-toolbar-tool-file' => 'Чохь йолу файл', 'wikieditor-toolbar-tool-file-example' => 'Example.jpg', 'wikieditor-toolbar-tool-file-title' => 'Файл чуйиллар', @@ -5326,7 +5322,6 @@ $messages['ce'] = array( 'wikieditor-toolbar-file-size' => 'Барам:', 'wikieditor-toolbar-file-float' => 'Нисдар:', 'wikieditor-toolbar-file-default' => '(Iад йитарца)', - 'wikieditor-toolbar-file-format-none' => 'цхьаа', 'wikieditor-toolbar-tool-file-insert' => 'Чудилла', 'wikieditor-toolbar-tool-file-cancel' => 'Цаоьшу', 'wikieditor-toolbar-tool-reference' => 'ТIетовжар', @@ -5336,7 +5331,7 @@ $messages['ce'] = array( 'wikieditor-toolbar-tool-reference-insert' => 'Чудилла', 'wikieditor-toolbar-tool-reference-text' => 'ТIетовжаран йоза', 'wikieditor-toolbar-tool-signature' => 'Куьгтаlор хан хlоттош', - 'wikieditor-toolbar-section-advanced' => 'Кхин тӀе', + 'wikieditor-toolbar-section-advanced' => 'Кхин тlе дукха', 'wikieditor-toolbar-tool-heading' => 'Корта', 'wikieditor-toolbar-tool-heading-1' => 'Локхалла 1', 'wikieditor-toolbar-tool-heading-2' => 'Локхалла 2', @@ -5367,26 +5362,26 @@ $messages['ce'] = array( 'wikieditor-toolbar-tool-gallery' => 'Дуккха суьрташ', 'wikieditor-toolbar-tool-gallery-example' => '$1:Example.jpg|Цуьнах лаце1 $1:Example.jpg|Цуьнах лаце2', - 'wikieditor-toolbar-tool-newline' => 'Керла могӀа', + 'wikieditor-toolbar-tool-newline' => 'Керла могlа', 'wikieditor-toolbar-tool-table' => 'Таблица', 'wikieditor-toolbar-tool-table-example-old' => '- -! коьрта могӀа 1 -! коьрта могӀа 2 -! коьрта могӀа 3 +! коьрта могlа 1 +! коьрта могlа 2 +! коьрта могlа 3 |- -| могӀа 1, чоь 1 -| могӀа 1, чоь 2 -| могӀа 1, чоь 3 +| могlа 1, чоь 1 +| могlа 1, чоь 2 +| могlа 1, чоь 3 |- -| могӀа 2, чоь 1 -| могӀа 2, чоь 2 -| могӀа 2, чоь 3', +| могlа 2, чоь 1 +| могlа 2, чоь 2 +| могlа 2, чоь 3', 'wikieditor-toolbar-tool-table-example-cell-text' => 'Чоьнан йоза', 'wikieditor-toolbar-tool-table-example-header' => 'Коьрта йоза', 'wikieditor-toolbar-tool-table-title' => 'Чуйилла таблица', 'wikieditor-toolbar-tool-table-dimensions-rows' => 'МогӀанаш', 'wikieditor-toolbar-tool-table-dimensions-columns' => 'Бlогlамаш', - 'wikieditor-toolbar-tool-table-dimensions-header' => 'ТӀетоха коьрта могӀанан могӀа', + 'wikieditor-toolbar-tool-table-dimensions-header' => 'Тlетоха коьрта могlан могlа', 'wikieditor-toolbar-tool-table-wikitable' => 'Кечйеш дозанашца', 'wikieditor-toolbar-tool-table-sortable' => 'Листалуш йе таблица', 'wikieditor-toolbar-tool-table-example' => 'Чоьнан йоза', @@ -5410,12 +5405,12 @@ $1:Example.jpg|Цуьнах лаце2', 'wikieditor-toolbar-tool-replace-success' => 'Балийна хийцам: $1.', # Fuzzy 'wikieditor-toolbar-tool-replace-emptysearch' => 'Ахьа ца гайтна хlу лаха деза.', 'wikieditor-toolbar-tool-replace-invalidregex' => 'Ахьа язйина цlе юх-юха нийса яц: $1', - 'wikieditor-toolbar-section-characters' => 'Леррина символаш', + 'wikieditor-toolbar-section-characters' => 'Саболу куьцаш', 'wikieditor-toolbar-characters-page-latin' => 'Латинан', 'wikieditor-toolbar-characters-page-latinextended' => 'Латинан алсам', 'wikieditor-toolbar-characters-page-ipa' => 'ДАЭ (IPA)', - 'wikieditor-toolbar-characters-page-symbols' => 'Символаш', - 'wikieditor-toolbar-characters-page-greek' => 'Грекийн', + 'wikieditor-toolbar-characters-page-symbols' => 'Саболурш', + 'wikieditor-toolbar-characters-page-greek' => 'Гlайрхойн', 'wikieditor-toolbar-characters-page-cyrillic' => 'Кирилан', 'wikieditor-toolbar-characters-page-arabic' => 'Ӏарбийн', 'wikieditor-toolbar-characters-page-arabicextended' => 'Iаьрбийн шординарш', @@ -5434,7 +5429,7 @@ $1:Example.jpg|Цуьнах лаце2', 'wikieditor-toolbar-help-heading-syntax' => 'Хlу йуьллу ахьа', 'wikieditor-toolbar-help-heading-result' => 'Хlу хуьлу хьуна', 'wikieditor-toolbar-help-page-format' => 'Бáрамхlоттор', - 'wikieditor-toolbar-help-page-link' => 'Хьажорагаш', + 'wikieditor-toolbar-help-page-link' => 'Хьажоригаш', 'wikieditor-toolbar-help-page-heading' => 'Коьрта могlнаш', 'wikieditor-toolbar-help-page-list' => 'Могlамаш', 'wikieditor-toolbar-help-page-file' => 'Файлаш', @@ -5449,7 +5444,7 @@ $1:Example.jpg|Цуьнах лаце2', 'wikieditor-toolbar-help-content-bolditalic-description' => 'Дерстино курсеттан', 'wikieditor-toolbar-help-content-bolditalic-syntax' => "'''''Дерстино курсеттан'''''", 'wikieditor-toolbar-help-content-bolditalic-result' => 'Дерстино курсеттан', - 'wikieditor-toolbar-help-content-ilink-description' => 'Чоьхьа хьажораг', + 'wikieditor-toolbar-help-content-ilink-description' => 'Чоьхьа хьажориг', 'wikieditor-toolbar-help-content-ilink-syntax' => '[[Агlонан коьрта могlа|Хьажориган йоза]]
      [[Агlонан коьрта могlа]]', 'wikieditor-toolbar-help-content-ilink-result' => "Хьажориган йоза
      Агlонан коьрта могlа", 'wikieditor-toolbar-help-content-xlink-description' => 'Арахьара хьажораг', @@ -5481,7 +5476,7 @@ $1:Example.jpg|Цуьнах лаце2', 'wikieditor-toolbar-help-content-reference-description' => 'Билгалдаккхар', 'wikieditor-toolbar-help-content-reference-syntax' => 'Агlонан йоза.<ref name="test">[http://www.example.org Хьажориган йоза], кхин тlе дузуш йоза.</ref>', 'wikieditor-toolbar-help-content-reference-result' => "Агlонан йоза.[1]", - 'wikieditor-toolbar-help-content-rereference-description' => 'Кхин тӀе лело изза хьажораг', + 'wikieditor-toolbar-help-content-rereference-description' => 'Кхин тlе лело изза хьажориг', 'wikieditor-toolbar-help-content-rereference-result' => "Агlонан йоза[1].", 'wikieditor-toolbar-help-content-showreferences-description' => 'Гайта билгалдаккхар', 'wikieditor-toolbar-help-content-showreferences-result' => "
      1. ^ Хьажориган йоза, кхин тlе дузуш йоза.
      ", @@ -5744,7 +5739,7 @@ $messages['co'] = array( 'wikieditor-toolbar-tool-heading-5' => 'Livellu 5', ); -/** Czech (čeština) +/** Czech (česky) * @author Jkjk * @author Kuvaly * @author Littledogboy @@ -5782,7 +5777,7 @@ $messages['cs'] = array( 'wikieditor-toolbar' => 'Editační panel nástrojů', 'wikieditor-toolbar-desc' => 'Editační panel nástrojů s vylepšenou použitelností', 'wikieditor-toolbar-preference' => 'Zapnout vylepšený panel nástrojů', - 'wikieditor-toolbar-dialogs-preference' => 'Používat průvodce pro vkládání odkazů a tabulek i pro funkci hledání a nahrazování.', + 'wikieditor-toolbar-dialogs-preference' => 'Používat dialogy pro vkládání odkazů, tabulek atd.', # Fuzzy 'wikieditor-toolbar-hidesig' => 'Skrýt tlačítko podpisu na stránkách v hlavním jmenném prostoru', 'wikieditor-toolbar-loading' => 'Načítá se…', 'wikieditor-toolbar-tool-bold' => 'Tučně', @@ -6053,7 +6048,7 @@ $messages['csb'] = array( 'wikieditor-toolbar-help-content-xlink-description' => 'Bùtnowé lënczi', ); -/** Church Slavic (словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) +/** Church Slavic (словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ) * @author ОйЛ */ $messages['cu'] = array( @@ -6136,7 +6131,7 @@ $messages['cy'] = array( 'wikieditor-toolbar' => 'Bar offer golygu', 'wikieditor-toolbar-desc' => 'Bar offer y dudalen olygu gyda gwelliannau defnyddioldeb', 'wikieditor-toolbar-preference' => "Defnyddio'r bar offer golygu estynedig", - 'wikieditor-toolbar-dialogs-preference' => "Galluogi'r dewin sy'n mewnosod cysylltau a thablau, ac sy'n gallu chwilio a disodli", + 'wikieditor-toolbar-dialogs-preference' => "Galluoger y dewin sy'n mewnosod cysylltau a thablau, ac sy'n gallu chwilio a disodli", 'wikieditor-toolbar-hidesig' => "Cuddio'r botwm llofnodi rhag y tudalennau yn y prif barth", 'wikieditor-toolbar-loading' => "Wrthi'n llwytho...", 'wikieditor-toolbar-tool-bold' => 'Praff', @@ -6866,11 +6861,9 @@ $1:Beispiel.jpg|Beschreibung2', ); /** Swiss High German (Schweizer Hochdeutsch) - * @author Filzstift * @author Geitost */ $messages['de-ch'] = array( - 'wikieditor-toolbar-dialogs-preference' => 'Assistenten zum Einfügen von Links und Tabellen sowie die Funktion «Suchen und Ersetzen» aktivieren', 'wikieditor-toolbar-tool-reference-example' => 'Fussnotentext hier einfügen', 'wikieditor-toolbar-tool-big' => 'Gross', 'wikieditor-toolbar-tool-big-example' => 'Grosser Text', @@ -6899,7 +6892,6 @@ Möchten Sie daraus einen internen Link machen?', /** Zazaki (Zazaki) * @author Erdemaslancan * @author Gorizon - * @author Marmase * @author Mirzali * @author Xoser */ @@ -6917,7 +6909,7 @@ $messages['diq'] = array( 'wikieditor-previewDialog-loading' => 'Ho bar keno...', 'wikieditor-publish-preference' => 'Game be game çap kerdişi a bike', 'wikieditor-publish-button-publish' => 'Vıla ke', - 'wikieditor-publish-button-cancel' => 'Bıtexelne', + 'wikieditor-publish-button-cancel' => 'Bıterkne', 'wikieditor-publish-dialog-title' => '{{SITENAME}} rê çap ke', 'wikieditor-publish-dialog-summary' => 'Xulasayê vurnayişi (ser vurnayişê xo xulasa binuse):', 'wikieditor-publish-dialog-minor' => 'Vurnayişo qickek', @@ -6951,13 +6943,13 @@ $messages['diq'] = array( 'wikieditor-toolbar-tool-link-int' => 'yew pelê wiki re', 'wikieditor-toolbar-tool-link-int-target' => 'sernameyê peli', 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'Sernamey ya zi URL', - 'wikieditor-toolbar-tool-link-int-text' => 'Metnê asnayışi:', + 'wikieditor-toolbar-tool-link-int-text' => 'metnê gıreyi', 'wikieditor-toolbar-tool-link-int-text-tooltip' => 'Nuştewo ke gani bımocniyo ey bınuse', 'wikieditor-toolbar-tool-link-ext' => 'yew keyepelê teberi re', 'wikieditor-toolbar-tool-link-ext-target' => "Greyê URL'i:", 'wikieditor-toolbar-tool-link-ext-text' => 'Metnê gri:', 'wikieditor-toolbar-tool-link-insert' => 'Gıre bıerz', - 'wikieditor-toolbar-tool-link-cancel' => 'Bıtexelne', + 'wikieditor-toolbar-tool-link-cancel' => 'Bıterkne', 'wikieditor-toolbar-tool-link-int-target-status-exists' => 'pel esto', 'wikieditor-toolbar-tool-link-int-target-status-notexists' => 'pel çino', 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Sernameyo xırab.', @@ -6982,10 +6974,10 @@ $messages['diq'] = array( 'wikieditor-toolbar-file-format-none' => 'çıniyo', 'wikieditor-toolbar-tool-file-insert' => 'Têare ker', 'wikieditor-toolbar-tool-file-cancel' => 'Bıterkne', - 'wikieditor-toolbar-tool-reference' => 'Referans', + 'wikieditor-toolbar-tool-reference' => 'çıme', 'wikieditor-toolbar-tool-reference-example' => 'metnê notê bınini tiya kerê', 'wikieditor-toolbar-tool-reference-cancel' => 'Bıtexelne', - 'wikieditor-toolbar-tool-reference-title' => 'Referans dek', + 'wikieditor-toolbar-tool-reference-title' => 'Referance de bike', 'wikieditor-toolbar-tool-reference-insert' => 'de bike', 'wikieditor-toolbar-tool-reference-text' => 'Nusteyê Referansi', 'wikieditor-toolbar-tool-signature' => 'tamğayê imza ve zamani', @@ -7000,13 +6992,13 @@ $messages['diq'] = array( 'wikieditor-toolbar-group-format' => 'Format', 'wikieditor-toolbar-tool-ulist' => 'listeya maddeya işaretıni', 'wikieditor-toolbar-tool-ulist-example' => 'unsuro listeya maddeya işaretıni', - 'wikieditor-toolbar-tool-olist' => 'Listeya nımreyın', + 'wikieditor-toolbar-tool-olist' => 'listeya numreyıni', 'wikieditor-toolbar-tool-olist-example' => 'unsuro listeya numreyıni', 'wikieditor-toolbar-tool-indent' => 'Paragraf', 'wikieditor-toolbar-tool-indent-example' => 'Rêza paragrafi', 'wikieditor-toolbar-tool-nowiki' => 'Formetê wiki çıniyo', 'wikieditor-toolbar-tool-nowiki-example' => 'Ne-format nuşte itiya ra bıerz', - 'wikieditor-toolbar-tool-redirect' => 'Serçarnayış', + 'wikieditor-toolbar-tool-redirect' => 'Hetenayış', 'wikieditor-toolbar-tool-redirect-example' => 'Nameyê pele ke hedef biyo', 'wikieditor-toolbar-tool-big' => 'gırd', 'wikieditor-toolbar-tool-big-example' => 'metno gırd', @@ -7045,7 +7037,7 @@ $1:misal.jpg|nuşteyê resmi2', 'wikieditor-toolbar-tool-table-example' => 'metnê hucreyi', 'wikieditor-toolbar-tool-table-preview' => 'Verqayt', 'wikieditor-toolbar-tool-table-insert' => 'têare ker', - 'wikieditor-toolbar-tool-table-cancel' => 'Bıtexelne', + 'wikieditor-toolbar-tool-table-cancel' => 'Bıterkne', 'wikieditor-toolbar-tool-table-toomany' => '1000 hucrara ziyed tablo eştış pê no mesaj mumkın niyo', 'wikieditor-toolbar-tool-table-invalidnumber' => 'şıma pê yew amaro meqbul o satır u estun cı nêkewti', 'wikieditor-toolbar-tool-table-zero' => 'tablo ya ke tede satır u estun çinibo şıma nêşkeni têare bıkeri', @@ -7063,7 +7055,7 @@ $1:misal.jpg|nuşteyê resmi2', 'wikieditor-toolbar-tool-replace-success' => '$1 {{PLURAL:$1|yedeg|yedegi}} vıraziya.', 'wikieditor-toolbar-tool-replace-emptysearch' => 'şıma qey cıgêrayiş taway/çiyek nênuşt', 'wikieditor-toolbar-tool-replace-invalidregex' => 'ifadeya normal a ke şıma kwene cı meqbul niya: $1', - 'wikieditor-toolbar-section-characters' => 'Karakterê xısusiy', + 'wikieditor-toolbar-section-characters' => 'karakterê xususiyî', 'wikieditor-toolbar-characters-page-latin' => 'Latin', 'wikieditor-toolbar-characters-page-latinextended' => 'latinkiya hêrabiyaye', 'wikieditor-toolbar-characters-page-ipa' => 'IPA', @@ -7091,12 +7083,12 @@ $1:misal.jpg|nuşteyê resmi2', 'wikieditor-toolbar-help-heading-syntax' => 'o yo ke şıma nuşt', 'wikieditor-toolbar-help-heading-result' => 'o yo ke şıma gırewt', 'wikieditor-toolbar-help-page-format' => 'fesal dayiş/format', - 'wikieditor-toolbar-help-page-link' => 'Gırey', + 'wikieditor-toolbar-help-page-link' => 'gıreyi', 'wikieditor-toolbar-help-page-heading' => 'sernameyi', 'wikieditor-toolbar-help-page-list' => 'Listey', 'wikieditor-toolbar-help-page-file' => 'dosyayi', 'wikieditor-toolbar-help-page-reference' => 'Çımey', - 'wikieditor-toolbar-help-page-discussion' => 'Werênayış', + 'wikieditor-toolbar-help-page-discussion' => 'werê-ameyiş/munaqeşa', 'wikieditor-toolbar-help-content-italic-description' => 'italik', 'wikieditor-toolbar-help-content-italic-syntax' => "''metno italik''", 'wikieditor-toolbar-help-content-italic-result' => 'metno italik', @@ -7127,19 +7119,19 @@ $1:misal.jpg|nuşteyê resmi2', 'wikieditor-toolbar-help-content-ulist-description' => 'listeya işareti ya maddeyın', 'wikieditor-toolbar-help-content-ulist-syntax' => '* unsurê listeyi
      * unsurê listeyi', 'wikieditor-toolbar-help-content-ulist-result' => '
      • unsurê listeyi
      • unsurê listeyi
      ', - 'wikieditor-toolbar-help-content-olist-description' => 'Listeya nımreyın', + 'wikieditor-toolbar-help-content-olist-description' => 'listeya numreyın', 'wikieditor-toolbar-help-content-olist-syntax' => '# unsurê listeyi
      # unsurê listeyi', 'wikieditor-toolbar-help-content-olist-result' => '
      1. unsurê listeyi
      2. unsurê listeyi
      ', 'wikieditor-toolbar-help-content-file-description' => 'dosyaya weradaye/nımıte', 'wikieditor-toolbar-help-content-file-syntax' => '[[$1:Example.png|thumb|Nuşteyê resîmî]]', 'wikieditor-toolbar-help-content-file-result' => "
      metnê resmi
      ", - 'wikieditor-toolbar-help-content-reference-description' => 'Referans', + 'wikieditor-toolbar-help-content-reference-description' => 'çıme/referans', 'wikieditor-toolbar-help-content-reference-syntax' => 'metnê peli.<ref name="tesel kerdış/cerebnayiş">[http://www.misal.org metnê gıreyi], zeylê metni.</ref>', 'wikieditor-toolbar-help-content-reference-result' => "metnê peli.[1]", 'wikieditor-toolbar-help-content-rereference-description' => 'şuxulnayişê zeylê o çımeyi', 'wikieditor-toolbar-help-content-rereference-result' => "metnê peli.[1]", 'wikieditor-toolbar-help-content-showreferences-description' => 'çımeyi ramocın', - 'wikieditor-toolbar-help-content-showreferences-result' => "
      1. ^ metnê gırey, metno ilawe.
      ", + 'wikieditor-toolbar-help-content-showreferences-result' => "
      1. ^ metnê gıreyi, zeylê metni.
      ", 'wikieditor-toolbar-help-content-signaturetimestamp-description' => 'pê tamğayê zemani imza eştış', 'wikieditor-toolbar-help-content-signaturetimestamp-result' => "nameyê karberi (mesaj) 15:54, 10 Heziran 2009 (UTC)", 'wikieditor-toolbar-help-content-signature-description' => 'imza', @@ -7184,7 +7176,7 @@ $messages['dsb'] = array( 'wikieditor-toolbar' => 'Wobźěłowańska rědowa kšoma', 'wikieditor-toolbar-desc' => 'Rědowa kšoma za wobźěłowanje bokow z pólěpšoneju wužywajobnosću', 'wikieditor-toolbar-preference' => 'Pólěpšonu wobźěłowańsku rědowu kšomu aktiwěrowaś', - 'wikieditor-toolbar-dialogs-preference' => 'Asistenty za zasajźenje wótkazow, tabelow a funkciju pytanja a wuměnjenja zmóžniś', + 'wikieditor-toolbar-dialogs-preference' => 'Dialogi za zasajźenje wótkazow, tabelow a hynakšego zmóžniś', # Fuzzy 'wikieditor-toolbar-hidesig' => 'Pódpisowy tłočašk w bokach w głownem mjenjowem rumje schowaś', 'wikieditor-toolbar-loading' => 'Zacytujo se...', 'wikieditor-toolbar-tool-bold' => 'Tucny', @@ -7212,7 +7204,6 @@ $messages['dsb'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Njepłaśiwy titel', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Eksterny wótkaz', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'Eksistenca boka se pśekontrolěrujo...', - 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'Bok wěcejzmysłowosći', 'wikieditor-toolbar-tool-link-int-invalid' => 'Titel, kótaryž sy pódał, jo njepłaśiwy.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'URL, kótaryž sy pódał, wuglěda, ako by był za wótkaz k drugemu wikibokoju. Coš jen do internego wótkaza psétwóriś?', @@ -8472,7 +8463,7 @@ $messages['eu'] = array( 'wikieditor-toolbar-tool-xlink-example' => 'http://www.adibidea.com loturaren izenburua', 'wikieditor-toolbar-tool-link' => 'Lotura', 'wikieditor-toolbar-tool-link-title' => 'Sartu lotura', - 'wikieditor-toolbar-tool-link-int' => 'Wiki orri batera', + 'wikieditor-toolbar-tool-link-int' => 'Wiki orrialde batera', 'wikieditor-toolbar-tool-link-int-target' => 'Orrialdearen izenburua:', 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'Orriaren izenburua edo URL', 'wikieditor-toolbar-tool-link-int-text' => 'Lotutako testua:', @@ -8674,7 +8665,7 @@ $messages['fa'] = array( 'wikieditor' => 'رابط ویرایش پیشرفته ویکی‌متن', 'wikieditor-desc' => 'یک رابط ویرایش پیشرفته ویکی‌متن و چندین پودمان دارای قابلیت فراهم می‌کند', 'wikieditor-wikitext-tab' => 'ویکی‌متن', - 'wikieditor-loading' => 'در حال بارگیری...', + 'wikieditor-loading' => 'در حال بارگیری', 'wikieditor-preview-preference' => 'فعال‌سازی پیش‌نمایش کنار یک دیگر', 'wikieditor-preview-tab' => 'پیش‌نمایش', 'wikieditor-preview-changes-tab' => 'تغییرها', @@ -8730,7 +8721,7 @@ $messages['fa'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'عنوان نادرست', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'پیوند به بیرون', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'بررسی وجود داشتن صفحه...', - 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'صفحهٔ ابهام‌زدایی', + 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'صفحهٔ ابهام‌زدائی', 'wikieditor-toolbar-tool-link-int-invalid' => 'عنوان تعیین‌شده نامعتبر است.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'نشانی اینترنتی که وارد کردید به شکلی است که نمایانگر یک پیوند به صفحه‌ای داخل ویکی است. آیا می‌خواهید آن را به یک پیوند داخلی تبدیل کنید؟', 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'پیوند داخلی', @@ -8923,7 +8914,6 @@ $1:مثال.jpg|عنوان ۲', * @author Nedergard * @author Nike * @author Olli - * @author Pxos * @author Silvonen * @author Str4nd * @author Stryn @@ -8990,7 +8980,6 @@ $messages['fi'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Virheellinen otsikko', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Ulkoinen linkki', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'Tarkastetaan sivun olemassaolo…', - 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'Täsmennyssivu', 'wikieditor-toolbar-tool-link-int-invalid' => 'Antamasi otsikko on virheellinen.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'URL-osoite, jonka annoit näyttää siltä kuin se olisi linkki toiselle wikisivulle. Haluatko tehdä siitä sisäisen linkin?', @@ -9709,75 +9698,9 @@ $messages['fur'] = array( ); /** Western Frisian (Frysk) - * @author Kening Aldgilles */ $messages['fy'] = array( - 'wikieditor-publish-button-cancel' => 'Ofbrekke', - 'wikieditor-template-editor-dialog-cancel' => 'Ofbrekke', - 'wikieditor-toc-show' => 'Ynhâld sjen litte', - 'wikieditor-toc-hide' => 'Ynhâld ferbergje', - 'wikieditor-toolbar' => 'Bewurkingsbalke', - 'wikieditor-toolbar-tool-link-title' => 'Keppeling ynfoegje', - 'wikieditor-toolbar-tool-link-insert' => 'Keppeling ynfoegje', 'wikieditor-toolbar-tool-link-cancel' => 'Ofbrekke', - 'wikieditor-toolbar-tool-file-example' => 'Eksimpel.jpg', - 'wikieditor-toolbar-tool-file-title' => 'Bestân ynfoegje', - 'wikieditor-toolbar-file-size' => 'Grutte:', - 'wikieditor-toolbar-file-default' => '(standert)', - 'wikieditor-toolbar-file-format-none' => 'gjin', - 'wikieditor-toolbar-tool-file-insert' => 'Ynfoegje', - 'wikieditor-toolbar-tool-file-cancel' => 'Ofbrekke', - 'wikieditor-toolbar-tool-reference' => 'Referinsje', - 'wikieditor-toolbar-tool-reference-example' => 'Foettekst hjir ynfoegje', - 'wikieditor-toolbar-tool-reference-cancel' => 'Ofbrekke', - 'wikieditor-toolbar-tool-reference-title' => 'Referinsje ynfoegje', - 'wikieditor-toolbar-tool-reference-insert' => 'Ynfoegje', - 'wikieditor-toolbar-tool-reference-text' => 'Referinsjetekst', - 'wikieditor-toolbar-tool-heading-1' => 'Nivo 1', - 'wikieditor-toolbar-tool-heading-2' => 'Nivo 2', - 'wikieditor-toolbar-tool-heading-3' => 'Nivo 3', - 'wikieditor-toolbar-tool-heading-4' => 'Nivo 4', - 'wikieditor-toolbar-tool-heading-5' => 'Nivo 5', - 'wikieditor-toolbar-tool-heading-example' => 'Koptekst', - 'wikieditor-toolbar-tool-ulist' => 'List sûnder nûmers', - 'wikieditor-toolbar-tool-olist' => 'List mei nûmers', - 'wikieditor-toolbar-group-insert' => 'Ynfoegje', - 'wikieditor-toolbar-tool-table-title' => 'Tabel ynfoegje', - 'wikieditor-toolbar-tool-table-dimensions-rows' => 'Rigen', - 'wikieditor-toolbar-tool-table-dimensions-columns' => 'Kolommen', - 'wikieditor-toolbar-tool-table-dimensions-header' => 'Koprigel ynfoegje', - 'wikieditor-toolbar-tool-table-example' => 'Eksimpel', - 'wikieditor-toolbar-tool-table-insert' => 'Ynfoegje', - 'wikieditor-toolbar-tool-table-cancel' => 'Ofbrekke', - 'wikieditor-toolbar-tool-replace-search' => 'Sykje op:', - 'wikieditor-toolbar-tool-replace-replace' => 'Ferfange mei:', - 'wikieditor-toolbar-section-characters' => 'Spesjale tekens', - 'wikieditor-toolbar-characters-page-latin' => 'Latyn', - 'wikieditor-toolbar-help-page-reference' => 'Referinsjes', - 'wikieditor-toolbar-help-page-discussion' => 'Oerlis', - 'wikieditor-toolbar-help-content-italic-description' => 'Kursyf', - 'wikieditor-toolbar-help-content-italic-syntax' => "''Kursive tekst''", - 'wikieditor-toolbar-help-content-italic-result' => 'Kursive tekst', - 'wikieditor-toolbar-help-content-bold-description' => 'Fet', - 'wikieditor-toolbar-help-content-bold-syntax' => "'''Fette tekst'''", - 'wikieditor-toolbar-help-content-bold-result' => 'Fette tekst', - 'wikieditor-toolbar-help-content-bolditalic-description' => 'Fet & kursyf', - 'wikieditor-toolbar-help-content-bolditalic-syntax' => "'''''Fette & kursive tekst'''''", - 'wikieditor-toolbar-help-content-bolditalic-result' => 'Fette & kursive tekst', - 'wikieditor-toolbar-help-content-ilink-description' => 'Ynterne ferwizing', - 'wikieditor-toolbar-help-content-xlink-description' => 'Eksterne ferwizing', - 'wikieditor-toolbar-help-content-heading2-syntax' => '== Koptekst ==', - 'wikieditor-toolbar-help-content-heading2-result' => '

      Koptekst

      ', - 'wikieditor-toolbar-help-content-heading3-description' => 'Lytse kop tredde nivo', - 'wikieditor-toolbar-help-content-heading3-syntax' => '== Koptekst ==', - 'wikieditor-toolbar-help-content-heading3-result' => '

      Koptekst

      ', - 'wikieditor-toolbar-help-content-heading4-description' => 'Lytse kop fjirde nivo', - 'wikieditor-toolbar-help-content-heading4-syntax' => '== Koptekst ==', - 'wikieditor-toolbar-help-content-heading4-result' => '

      Koptekst

      ', - 'wikieditor-toolbar-help-content-heading5-description' => 'Lytse kop fyfte nivo', - 'wikieditor-toolbar-help-content-heading5-syntax' => '== Koptekst ==', - 'wikieditor-toolbar-help-content-heading5-result' => '
      Koptekst
      ', - 'wikieditor-toolbar-help-content-ulist-description' => 'List sûnder nûmers', ); /** Irish (Gaeilge) @@ -9808,7 +9731,6 @@ $messages['ga'] = array( /** Scottish Gaelic (Gàidhlig) * @author Akerbeltz - * @author Shirayuki */ $messages['gd'] = array( 'wikieditor' => 'Eadar-aghaidh deasachadh wikitext adhartach', @@ -9842,7 +9764,7 @@ $messages['gd'] = array( 'wikieditor-toolbar' => 'Am bàr-inneil deasachaidh', 'wikieditor-toolbar-desc' => 'Am bàr-inneil deasachaidh le comasan a bharrachd', 'wikieditor-toolbar-preference' => 'Cuir am bàr-inneil le comasan a bharrachd an comas', - 'wikieditor-toolbar-dialogs-preference' => 'Cuir an comas na draoidhean airson ceanglaichean, clàran agus am foincsean airson lorg a dhèanamh no rudan a chur an àite rudan eile', + 'wikieditor-toolbar-dialogs-preference' => 'Cuir an comas na còmhraidhean airson ceanglaichean, clàir is rudan eile a chur a-steach', # Fuzzy 'wikieditor-toolbar-loading' => "'Ga luchdadh...", 'wikieditor-toolbar-tool-bold' => 'Trom', 'wikieditor-toolbar-tool-bold-example' => 'Teacs trom', @@ -11502,7 +11424,7 @@ $1:उदाहरण.jpg|चित्रशीर्षक२', 'wikieditor-toolbar-tool-replace-close' => 'बंद करें', 'wikieditor-toolbar-tool-replace-nomatch' => 'आपके खोज कुछ मिला नहीं', 'wikieditor-toolbar-tool-replace-success' => '$1 प्रतिस्थापन बनें ।', # Fuzzy - 'wikieditor-toolbar-section-characters' => 'विशेष अक्षर', + 'wikieditor-toolbar-section-characters' => 'विशेष वर्ण', 'wikieditor-toolbar-characters-page-latin' => 'लाटिन', 'wikieditor-toolbar-characters-page-latinextended' => 'लाटिन विस्तारित', 'wikieditor-toolbar-characters-page-ipa' => 'आइपीए', @@ -11595,7 +11517,6 @@ $messages['hif-latn'] = array( /** Croatian (hrvatski) * @author Bugoslav - * @author Eleassar * @author Ex13 * @author Excaliboor * @author MaGa @@ -11617,7 +11538,7 @@ $messages['hr'] = array( 'wikieditor-publish-preference' => 'Omogućiti korak-po-korak izdavanje', 'wikieditor-publish-button-publish' => 'Objaviti', 'wikieditor-publish-button-cancel' => 'Odustani', - 'wikieditor-publish-dialog-title' => 'Objavi na {{GRAMMAR:dajalnik|{{SITENAME}}}}', + 'wikieditor-publish-dialog-title' => 'Objavi na {{SITENAME}}', 'wikieditor-publish-dialog-summary' => 'Uredi sažetak (kratko opišite promjene koje ste učinili):', 'wikieditor-publish-dialog-minor' => 'Manja promjena', 'wikieditor-publish-dialog-watch' => 'Prati ovu stranicu', @@ -11865,7 +11786,7 @@ $messages['hsb'] = array( 'wikieditor-toolbar' => 'Gratowa lajsta za wobdźěłowanje', 'wikieditor-toolbar-desc' => 'Gratowa lajsta za wobdźěłowanje stronow z polěpšenej wužiwajomnosću', 'wikieditor-toolbar-preference' => 'Polěpšenu gratowu lajstu za wobdźěłowanje aktiwizować', - 'wikieditor-toolbar-dialogs-preference' => 'Asistenty za zasadźenje wotkazow, tabelow a funkciju pytanja a wuměnjenja zmóžnić', + 'wikieditor-toolbar-dialogs-preference' => 'Dialogi za zasunjenje wotkazow, tabelow a hinašeho zmóžnić', # Fuzzy 'wikieditor-toolbar-hidesig' => 'Podpisowe tłóčatko w stronach we hłownym mjenowym rumje schować', 'wikieditor-toolbar-loading' => 'Čita so...', 'wikieditor-toolbar-tool-bold' => 'Tučny', @@ -11893,7 +11814,6 @@ $messages['hsb'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Njepłaćiwy titul', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Eksterny wotkaz', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'Eksistenca strony so přepruwuje...', - 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'Strona wjacewoznamowosće', 'wikieditor-toolbar-tool-link-int-invalid' => 'Titul, kotryž sy podał, je njepłaćiwy.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'URL, kotryž sy podał, wupada kaž by jako wotkaz k druhej wikistronje měrjeny był. Chceš jón do interneho wotkaza přetworić?', @@ -12607,7 +12527,7 @@ $messages['ia'] = array( 'wikieditor-toolbar' => 'Instrumentario de modification', 'wikieditor-toolbar-desc' => 'Barra con instrumentos de modification con augmento de usabilitate', 'wikieditor-toolbar-preference' => 'Activar le instrumentario de modification meliorate', - 'wikieditor-toolbar-dialogs-preference' => 'Activar dialogos pro inserer ligamines, tabellas e le function de cercar e reimplaciar', + 'wikieditor-toolbar-dialogs-preference' => 'Activar dialogos pro inserer ligamines, tabulas e plus', # Fuzzy 'wikieditor-toolbar-hidesig' => 'Celar le button de signatura in paginas in le spatio de nomines principal', 'wikieditor-toolbar-loading' => 'Cargamento in curso…', 'wikieditor-toolbar-tool-bold' => 'Grasse', @@ -12635,7 +12555,6 @@ $messages['ia'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Titulo invalide', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Ligamine externe', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'Verifica existentia del pagina...', - 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'Pagina de disambiguation', 'wikieditor-toolbar-tool-link-int-invalid' => 'Le titulo que tu specificava es invalide.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'Le URL que tu specificava pare esser intendite como ligamine a un altere pagina wiki. Vole tu facer lo un ligamine interne?', @@ -12651,7 +12570,6 @@ Vole tu facer lo un ligamine interne?', 'wikieditor-toolbar-file-float' => 'Alineamento:', 'wikieditor-toolbar-file-default' => '(predefinition)', 'wikieditor-toolbar-file-format' => 'Formato:', - 'wikieditor-toolbar-file-format-none' => 'nulle', 'wikieditor-toolbar-tool-file-insert' => 'Inserer', 'wikieditor-toolbar-tool-file-cancel' => 'Cancellar', 'wikieditor-toolbar-tool-reference' => 'Referentia', @@ -12718,9 +12636,9 @@ $1:Exemplo.jpg|Legenda2', 'wikieditor-toolbar-tool-table-preview' => 'Previsualisation', 'wikieditor-toolbar-tool-table-insert' => 'Inserer', 'wikieditor-toolbar-tool-table-cancel' => 'Cancellar', - 'wikieditor-toolbar-tool-table-toomany' => 'Inserer un tabella con plus de 1000 cellulas non es possibile con iste dialogo.', + 'wikieditor-toolbar-tool-table-toomany' => 'Inserer un tabula con plus de $1 cellulas non es possibile con iste dialogo.', # Fuzzy 'wikieditor-toolbar-tool-table-invalidnumber' => 'Tu non ha entrate un numero valide de lineas o columnas.', - 'wikieditor-toolbar-tool-table-zero' => 'Tu non pote inserer un tabella con zero lineas o columnas.', + 'wikieditor-toolbar-tool-table-zero' => 'Tu non pote inserer un tabula con zero lineas o columnas.', 'wikieditor-toolbar-tool-replace' => 'Cercar e reimplaciar', 'wikieditor-toolbar-tool-replace-title' => 'Cercar e reimplaciar', 'wikieditor-toolbar-tool-replace-search' => 'Cercar:', @@ -12732,7 +12650,7 @@ $1:Exemplo.jpg|Legenda2', 'wikieditor-toolbar-tool-replace-button-replaceall' => 'Reimplaciar toto', 'wikieditor-toolbar-tool-replace-close' => 'Clauder', 'wikieditor-toolbar-tool-replace-nomatch' => 'Tu recerca non ha producite resultatos.', - 'wikieditor-toolbar-tool-replace-success' => '$1 {{PLURAL:$1|reimplaciamento|reimplaciamentos}} facite.', + 'wikieditor-toolbar-tool-replace-success' => '$1 reimplaciamentos facite.', # Fuzzy 'wikieditor-toolbar-tool-replace-emptysearch' => 'Tu non entrava texto a cercar.', 'wikieditor-toolbar-tool-replace-invalidregex' => 'Le expression regular que tu entrava es invalide: $1', 'wikieditor-toolbar-section-characters' => 'Characteres special', @@ -12755,7 +12673,6 @@ $1:Exemplo.jpg|Legenda2', 'wikieditor-toolbar-characters-page-thai' => 'Thailandese', 'wikieditor-toolbar-characters-page-lao' => 'Laotiano', 'wikieditor-toolbar-characters-page-khmer' => 'Cambodgiano', - 'wikieditor-toolbar-characters-minus' => 'signo minus', 'wikieditor-toolbar-section-help' => 'Adjuta', 'wikieditor-toolbar-help-heading-description' => 'Description', 'wikieditor-toolbar-help-heading-syntax' => 'Entrata', @@ -13738,7 +13655,6 @@ $1:Example.jpg|Myndlýsing2', * @author Beta16 * @author Darth Kule * @author F. Cosoleto - * @author FRacco * @author Gianfranco * @author Gliu * @author McDutchie @@ -13778,7 +13694,7 @@ $messages['it'] = array( 'wikieditor-toc-hide' => 'Nascondi i contenuti', 'wikieditor-toolbar' => 'Barra degli strumenti di modifica', 'wikieditor-toolbar-desc' => 'Barra degli strumenti di modifica della pagina con migliorata usabilità', - 'wikieditor-toolbar-preference' => 'Abilita la barra degli strumenti di modifica avanzata', + 'wikieditor-toolbar-preference' => 'Abilita barra degli strumenti di modifica avanzata', 'wikieditor-toolbar-dialogs-preference' => "Abilita le finestre per l'inserimento di collegamenti, tabelle e la funzione di cerca e sostituisci", 'wikieditor-toolbar-hidesig' => 'Nasconde il pulsante della firma dalle pagine nel namespace principale', 'wikieditor-toolbar-loading' => 'Caricamento in corso...', @@ -15246,7 +15162,6 @@ $messages['kn'] = array( * @author Kwj2772 * @author LFM * @author Mintz0223 - * @author Priviet * @author 관인생략 * @author 아라 */ @@ -15298,8 +15213,8 @@ $messages['ko'] = array( 'wikieditor-toolbar-tool-link-int' => '위키 문서로 연결', 'wikieditor-toolbar-tool-link-int-target' => '대상 문서 또는 URL:', 'wikieditor-toolbar-tool-link-int-target-tooltip' => '문서 제목 또는 URL', - 'wikieditor-toolbar-tool-link-int-text' => '링크에 보이는 글:', - 'wikieditor-toolbar-tool-link-int-text-tooltip' => '문서에 보이는 글', + 'wikieditor-toolbar-tool-link-int-text' => '링크에 보여지는 글:', + 'wikieditor-toolbar-tool-link-int-text-tooltip' => '문서에 보여지는 글', 'wikieditor-toolbar-tool-link-ext' => '바깥 웹 페이지로 연결', 'wikieditor-toolbar-tool-link-ext-target' => '링크 URL:', 'wikieditor-toolbar-tool-link-ext-text' => '링크 텍스트:', @@ -15324,7 +15239,7 @@ $messages['ko'] = array( 'wikieditor-toolbar-file-caption' => '설명:', 'wikieditor-toolbar-file-size' => '크기:', 'wikieditor-toolbar-file-float' => '정렬:', - 'wikieditor-toolbar-file-default' => '(기본 값)', + 'wikieditor-toolbar-file-default' => '(기본값)', 'wikieditor-toolbar-file-format' => '형식:', 'wikieditor-toolbar-file-format-none' => '없음', 'wikieditor-toolbar-tool-file-insert' => '넣기', @@ -15398,7 +15313,7 @@ $1:Example.jpg|설명2', 'wikieditor-toolbar-tool-table-zero' => '행이나 열의 개수가 0인 표를 넣을 수 없습니다.', 'wikieditor-toolbar-tool-replace' => '찾아 바꾸기', 'wikieditor-toolbar-tool-replace-title' => '찾아 바꾸기', - 'wikieditor-toolbar-tool-replace-search' => '찾을 대상:', + 'wikieditor-toolbar-tool-replace-search' => '찾기:', 'wikieditor-toolbar-tool-replace-replace' => '바꾸기:', 'wikieditor-toolbar-tool-replace-case' => '대소문자를 구별', 'wikieditor-toolbar-tool-replace-regex' => '찾을 문자열에 정규 표현식을 적용', @@ -16553,8 +16468,6 @@ $1:Exemplum.jpg|Descriptio 2', 'wikieditor-toolbar-characters-page-telugu' => 'Telugu', 'wikieditor-toolbar-section-help' => 'Adiutatum', 'wikieditor-toolbar-help-heading-description' => 'Descriptio', - 'wikieditor-toolbar-help-heading-syntax' => 'Quod scribis', - 'wikieditor-toolbar-help-heading-result' => 'Quod accipies', 'wikieditor-toolbar-help-page-format' => 'Formatio', 'wikieditor-toolbar-help-page-link' => 'Nexus', 'wikieditor-toolbar-help-page-heading' => 'Tituli', @@ -16577,47 +16490,17 @@ $1:Exemplum.jpg|Descriptio 2', 'wikieditor-toolbar-help-content-xlink-description' => 'Nexus externus', 'wikieditor-toolbar-help-content-xlink-syntax' => '[http://www.example.org Titulus nexus]
      [http://www.example.org]
      http://www.example.org', 'wikieditor-toolbar-help-content-xlink-result' => "Titulus nexus
      [1]
      http://www.example.org", - 'wikieditor-toolbar-help-content-heading2-description' => 'Secundi ordinis titulus', - 'wikieditor-toolbar-help-content-heading2-syntax' => '== Textus tituli ==', - 'wikieditor-toolbar-help-content-heading2-result' => '

      Textus tituli

      ', - 'wikieditor-toolbar-help-content-heading3-description' => 'Tertii ordinis titulus', - 'wikieditor-toolbar-help-content-heading3-syntax' => '=== Textus tituli ===', - 'wikieditor-toolbar-help-content-heading3-result' => '

      Textus tituli

      ', - 'wikieditor-toolbar-help-content-heading4-description' => 'Quarti ordinis titulus', - 'wikieditor-toolbar-help-content-heading4-syntax' => '==== Textus tituli ====', - 'wikieditor-toolbar-help-content-heading4-result' => '

      Textus tituli

      ', - 'wikieditor-toolbar-help-content-heading5-description' => 'Quinti ordinis titulus', - 'wikieditor-toolbar-help-content-heading5-syntax' => '===== Textus tituli =====', - 'wikieditor-toolbar-help-content-heading5-result' => '
      Textus tituli
      ', - 'wikieditor-toolbar-help-content-ulist-description' => 'Index globosus', - 'wikieditor-toolbar-help-content-ulist-syntax' => '* Res indicata
      * Res indicata', - 'wikieditor-toolbar-help-content-ulist-result' => '
      • Res indicata
      • Res indicata
      ', 'wikieditor-toolbar-help-content-file-description' => 'Fasciculus in pagina impositus', 'wikieditor-toolbar-help-content-file-syntax' => '[[$1:Exemplum.png|thumb|Descriptio fasciculi]]', # Fuzzy 'wikieditor-toolbar-help-content-file-result' => "
      Descriptio fasciculi
      ", 'wikieditor-toolbar-help-content-reference-description' => 'Referentia bibliographica', - 'wikieditor-toolbar-help-content-reference-syntax' => 'Textus paginae.<ref name="test">[http://www.example.org Textus nexus], textus additus.</ref>', - 'wikieditor-toolbar-help-content-reference-result' => "Textus paginae.[1]", - 'wikieditor-toolbar-help-content-rereference-description' => 'Eiusdem referentiae usus additus', - 'wikieditor-toolbar-help-content-rereference-result' => "Textus paginae.[1]", 'wikieditor-toolbar-help-content-showreferences-description' => 'Referentias bibliographicas monstrare', - 'wikieditor-toolbar-help-content-showreferences-result' => "
      1. ^ Textus nexus, textus additus.
      ", 'wikieditor-toolbar-help-content-signaturetimestamp-description' => 'Subscriptio tua cum indicatione temporis', 'wikieditor-toolbar-help-content-signaturetimestamp-result' => "Nomen usoris (disputatio) 15:54, 10 Iunii 2009 (UTC)", 'wikieditor-toolbar-help-content-signature-description' => 'Subscriptio', 'wikieditor-toolbar-help-content-signature-result' => "Nomen usoris (disputatio)", ); -/** Ladino (Ladino) - * @author Menachem.Moreira - */ -$messages['lad'] = array( - 'wikieditor-wikitext-tab' => 'Vikiteksto', - 'wikieditor-publish-button-publish' => 'Publikar', - 'wikieditor-publish-dialog-title' => 'Publikar a {{SITENAME}}', - 'wikieditor-publish-dialog-publish' => 'Publikar', -); - /** Luxembourgish (Lëtzebuergesch) * @author Robby * @author Soued031 @@ -16654,7 +16537,7 @@ $messages['lb'] = array( 'wikieditor-toolbar' => 'Toolbar änneren', 'wikieditor-toolbar-desc' => 'Toolbar vun de Säitenännerunge mat erweiderter Benotzerfrëndlechkeet', 'wikieditor-toolbar-preference' => 'Déi erweidert Ännerungs-Toolbar aktivéieren', - 'wikieditor-toolbar-dialogs-preference' => "Assistente fir d'Drasetze vu Linken, Tabellen genee sou wéi d'Funktioun 'sichen an ersetzen' aschalten", + 'wikieditor-toolbar-dialogs-preference' => "Assistene fir d'Drasetze vu Linken, Tabellen genee esou wéi d'Funktioun 'sichen an ersetzen' aschalten", 'wikieditor-toolbar-hidesig' => 'Den Ënnerschrëftsknäppchen op Säiten am Haaptnummraum verstoppen', 'wikieditor-toolbar-loading' => 'Lueden...', 'wikieditor-toolbar-tool-bold' => 'Fettgedréckt', @@ -17121,7 +17004,6 @@ $1:Veurbeildj2|Biesjrif2', ); /** لوری (لوری) - * @author Bonevarluri * @author Mogoeilor */ $messages['lrc'] = array( @@ -17158,8 +17040,6 @@ $messages['lrc'] = array( 'wikieditor-toolbar-tool-link' => 'ديس ون', 'wikieditor-toolbar-tool-link-int' => 'سی ويكی بلگه', 'wikieditor-toolbar-tool-link-cancel' => 'رد كردن', - 'wikieditor-toolbar-tool-link-int-target-status-notexists' => 'بلگه نیئش', - 'wikieditor-toolbar-tool-file-title' => 'نیائن جانیا', 'wikieditor-toolbar-file-size' => 'انازه', 'wikieditor-toolbar-file-float' => 'د راست چيين', 'wikieditor-toolbar-file-default' => 'پيش فرض', @@ -17171,27 +17051,14 @@ $messages['lrc'] = array( 'wikieditor-toolbar-tool-reference-cancel' => 'رد كردن', 'wikieditor-toolbar-tool-reference-title' => 'دائن سرچشمه', 'wikieditor-toolbar-tool-reference-insert' => 'دائن', - 'wikieditor-toolbar-tool-signature' => 'امضا و دیسمن وخت', 'wikieditor-toolbar-section-advanced' => 'پيشرفته', 'wikieditor-toolbar-tool-heading' => 'سربلگه', - 'wikieditor-toolbar-tool-heading-1' => 'ریتراز1', - 'wikieditor-toolbar-tool-heading-3' => 'ریتراز3', - 'wikieditor-toolbar-tool-heading-5' => 'ریتراز5', - 'wikieditor-toolbar-tool-ulist' => 'نوم گه توپر بیه', - 'wikieditor-toolbar-tool-olist' => 'نوم گه شماره دار', - 'wikieditor-toolbar-tool-redirect-example' => 'نوم بلگه حاستنی', 'wikieditor-toolbar-tool-small' => 'كؤچك', 'wikieditor-toolbar-tool-small-example' => 'متن كؤچك', 'wikieditor-toolbar-group-insert' => 'دائن', - 'wikieditor-toolbar-tool-gallery' => 'عسگدونی', 'wikieditor-toolbar-tool-newline' => 'خط تازه', 'wikieditor-toolbar-tool-table' => 'جعوه', - 'wikieditor-toolbar-tool-replace' => 'بگرد و جاگزین کو', - 'wikieditor-toolbar-tool-replace-title' => 'بگرد و جاگزین کو', - 'wikieditor-toolbar-tool-replace-search' => 'پی جوری سی', - 'wikieditor-toolbar-tool-replace-button-findnext' => 'نهایی نه پیدا کو', 'wikieditor-toolbar-tool-replace-close' => 'بسن', - 'wikieditor-toolbar-tool-replace-emptysearch' => 'شما سی پی جوری هیچی وارد نکردیته.', 'wikieditor-toolbar-characters-page-latin' => 'لاتين', 'wikieditor-toolbar-characters-page-symbols' => 'نماديا', 'wikieditor-toolbar-characters-page-greek' => 'هلنی', @@ -17209,20 +17076,7 @@ $messages['lrc'] = array( 'wikieditor-toolbar-characters-page-lao' => 'لائو', 'wikieditor-toolbar-characters-page-khmer' => 'خمر', 'wikieditor-toolbar-section-help' => 'هومياری', - 'wikieditor-toolbar-help-page-list' => 'نوم گه یا', - 'wikieditor-toolbar-help-page-file' => 'جانیایا', 'wikieditor-toolbar-help-page-discussion' => 'گپ', - 'wikieditor-toolbar-help-content-heading2-description' => 'دوئمی ریتراز سرون', - 'wikieditor-toolbar-help-content-heading3-description' => 'سئمین ریتراز سرون', - 'wikieditor-toolbar-help-content-heading4-description' => 'چئارمی ریتراز سرون', - 'wikieditor-toolbar-help-content-heading5-description' => 'پنجمین ریتراز سرون', - 'wikieditor-toolbar-help-content-ulist-description' => 'نوم گه توپر بیه', - 'wikieditor-toolbar-help-content-ulist-syntax' => '* قلم نوم گه
      * قلم نوم گه', - 'wikieditor-toolbar-help-content-ulist-result' => '
      • قلم نوم گه
      • قلم نوم گه
      ', - 'wikieditor-toolbar-help-content-olist-syntax' => '# قلم نوم گه
      * قلم نوم گه', - 'wikieditor-toolbar-help-content-olist-result' => '
      • قلم نوم گه
      • قلم نوم گه
      ', - 'wikieditor-toolbar-help-content-signaturetimestamp-description' => 'امضا و دیسمن وخت', - 'wikieditor-toolbar-help-content-signature-description' => 'امضا', 'wikieditor-toolbar-help-content-indent-description' => 'مئن رئته', ); @@ -18749,22 +18603,22 @@ $messages['mr'] = array( 'wikieditor' => 'विकिमजकूर संपादनाची विकसित सुविधा', 'wikieditor-desc' => 'विस्तारणीय विकिमजकुर संपादन आंतरपृष्ठ (इंटरफेस) आणि बर्‍याच वैशिष्ट्यपूर्ण निश्चयिका (मॊड्यूल्स) पुरवते', 'wikieditor-wikitext-tab' => 'विकिमजकूर', - 'wikieditor-loading' => 'प्रभारण करीत आहे', + 'wikieditor-loading' => 'चढवत आहे…', 'wikieditor-preview-preference' => 'सोबतच आजु-बाजूस दिसणारी झलक शक्य करा.', 'wikieditor-preview-tab' => 'झलक', 'wikieditor-preview-changes-tab' => 'बदल', - 'wikieditor-preview-loading' => 'प्रभारण करीत आहे', + 'wikieditor-preview-loading' => 'चढवत आहे…', 'wikieditor-previewDialog-preference' => '"झलक पहा" चौकट सक्षम करा', 'wikieditor-previewDialog-tab' => 'झलक पहा', - 'wikieditor-previewDialog-loading' => 'प्रभारण करीत आहे', + 'wikieditor-previewDialog-loading' => 'चढवत आहे…', 'wikieditor-publish-preference' => 'टप्प्या-टप्प्याने प्रकाशन शक्य करा', 'wikieditor-publish-button-publish' => 'प्रकाशित करा दाखवा', 'wikieditor-publish-button-cancel' => 'रद्द करा', 'wikieditor-publish-dialog-title' => '{{संकेतस्थळनाव}} येथे प्रदर्शित करा', - 'wikieditor-publish-dialog-summary' => 'बदलांचा सारांश :(आपण केलेल्या बदलांचे थोडक्यात वर्णन करा):', + 'wikieditor-publish-dialog-summary' => 'बदलांचा आढावा :(आपण केलेल्या बदलांचे थोडक्यात वर्णन करा.)', 'wikieditor-publish-dialog-minor' => 'छोटा बदल', - 'wikieditor-publish-dialog-watch' => 'पान निरीक्षणांतर्गत ठेवा', + 'wikieditor-publish-dialog-watch' => 'या पानावर बदलांसाठी लक्ष ठेवा', 'wikieditor-publish-dialog-publish' => 'प्रकाशित करा', 'wikieditor-publish-dialog-goback' => 'मागे जा', 'wikieditor-template-editor-preference' => 'विकि साच्यांची नमुना संपादन सक्षम करा', @@ -18781,11 +18635,11 @@ $messages['mr'] = array( 'wikieditor-toolbar-preference' => 'वर्धित संपादन साधनपट्टी सक्षम करा', 'wikieditor-toolbar-dialogs-preference' => 'दुवे, सारण्या (टेबल) आणि इतर भरण्याकरिता dialogs सक्षम करा', # Fuzzy 'wikieditor-toolbar-hidesig' => 'मुख्य नामविश्वातील पानांपासून स्वाक्षरीची कळ लपवा', - 'wikieditor-toolbar-loading' => 'प्रभारण करीत आहे', + 'wikieditor-toolbar-loading' => 'चढवत आहे…', 'wikieditor-toolbar-tool-bold' => 'ठळक', 'wikieditor-toolbar-tool-bold-example' => 'ठळक मजकूर', 'wikieditor-toolbar-tool-italic' => 'तिरपी मुद्राक्षरे', - 'wikieditor-toolbar-tool-italic-example' => 'तिरप्या मुद्राक्षरातील मजकूर', + 'wikieditor-toolbar-tool-italic-example' => 'तिरपी मुद्राक्षरे', 'wikieditor-toolbar-tool-ilink' => 'अंतर्गत दुवा', 'wikieditor-toolbar-tool-ilink-example' => 'शीर्षकास दुवा द्या', 'wikieditor-toolbar-tool-xlink' => 'बाह्य दुव्यात (http:// हा उपसर्ग विसरू नका)', @@ -18806,8 +18660,7 @@ $messages['mr'] = array( 'wikieditor-toolbar-tool-link-int-target-status-notexists' => 'पान अस्तित्वात नाही', 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'अग्राह्य शीर्षक', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'बाह्य दुवा', - 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'पान अस्तित्व आहे काय ते तपासत आहे...', - 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'निःसंदिग्धिकरण पान', + 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'पानाचे अस्तित्व तपासत आहे...', 'wikieditor-toolbar-tool-link-int-invalid' => 'तुम्ही नमूद केलेले शीर्षक अग्राह्य आहे.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'तुम्ही नमूद केलेली यूआरएल इतर विकिपानास जोडावयाची आहे असे दिसते. तुम्हाला अंतर्गत दुवा बनवायचा आहे काय ?', 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'अंतर्गत दुवा', @@ -18817,14 +18670,13 @@ $messages['mr'] = array( 'wikieditor-toolbar-tool-file-example' => 'उदाहरण.jpg', 'wikieditor-toolbar-tool-file-title' => 'चित्र टाका', 'wikieditor-toolbar-file-target' => 'संचिकेचे नाव:', - 'wikieditor-toolbar-file-caption' => 'मथळा:', + 'wikieditor-toolbar-file-caption' => 'वर्णन:', 'wikieditor-toolbar-file-size' => 'आकार:', 'wikieditor-toolbar-file-float' => 'समास:', - 'wikieditor-toolbar-file-default' => '(अविचल)', - 'wikieditor-toolbar-file-format' => 'प्रारुप:', + 'wikieditor-toolbar-file-format' => 'प्रकार', 'wikieditor-toolbar-file-format-none' => 'काहीही नाही', 'wikieditor-toolbar-tool-file-insert' => 'समाविष्ट करा', - 'wikieditor-toolbar-tool-file-cancel' => 'रद्द करा', + 'wikieditor-toolbar-tool-file-cancel' => 'रद्द', 'wikieditor-toolbar-tool-reference' => 'संदर्भ', 'wikieditor-toolbar-tool-reference-example' => 'तळटीप मजकूर येथे भरा', 'wikieditor-toolbar-tool-reference-cancel' => 'रद्द करा', @@ -18840,10 +18692,10 @@ $messages['mr'] = array( 'wikieditor-toolbar-tool-heading-4' => 'स्तर ४', 'wikieditor-toolbar-tool-heading-5' => 'स्तर ५', 'wikieditor-toolbar-tool-heading-example' => 'अग्रशीर्ष मजकूर', - 'wikieditor-toolbar-group-format' => 'प्रारुप', + 'wikieditor-toolbar-group-format' => 'आराखडा', 'wikieditor-toolbar-tool-ulist' => 'बिंदी क्रमांकन', 'wikieditor-toolbar-tool-ulist-example' => 'बिंदी क्रमांकन घटक', - 'wikieditor-toolbar-tool-olist' => 'अनुक्रमित यादी', + 'wikieditor-toolbar-tool-olist' => 'अनुक्रम यादी', 'wikieditor-toolbar-tool-olist-example' => 'अनुक्रम यादी घटक', 'wikieditor-toolbar-tool-indent' => 'समासांतर', 'wikieditor-toolbar-tool-indent-example' => 'समासांतर ओळ', @@ -18881,7 +18733,7 @@ $1:Example.jpg|चित्रपरिचय २', 'wikieditor-toolbar-tool-table-title' => 'सारणी समाविष्ट करा', 'wikieditor-toolbar-tool-table-dimensions-rows' => 'ओळी', 'wikieditor-toolbar-tool-table-dimensions-columns' => 'रकाना', - 'wikieditor-toolbar-tool-table-dimensions-header' => 'शीर्ष ओळ जोडा', + 'wikieditor-toolbar-tool-table-dimensions-header' => 'मथळा ओळ जोडा', 'wikieditor-toolbar-tool-table-wikitable' => 'काठासहीत शैली', 'wikieditor-toolbar-tool-table-sortable' => 'सारणी क्रमानुसारी करण्याजोगी करा', 'wikieditor-toolbar-tool-table-example' => 'उदाहरण', @@ -18924,7 +18776,7 @@ $1:Example.jpg|चित्रपरिचय २', 'wikieditor-toolbar-characters-page-devanagari' => 'देवनागरी', 'wikieditor-toolbar-characters-page-thai' => 'थाई भाषा', 'wikieditor-toolbar-characters-page-lao' => 'लाऒ भाषा', - 'wikieditor-toolbar-characters-page-khmer' => 'ख्मेर', + 'wikieditor-toolbar-characters-page-khmer' => 'खमेर', 'wikieditor-toolbar-characters-minus' => 'ॠण चिन्ह', 'wikieditor-toolbar-section-help' => 'साहाय्य', 'wikieditor-toolbar-help-heading-description' => 'वर्णन', @@ -18967,7 +18819,7 @@ $1:Example.jpg|चित्रपरिचय २', 'wikieditor-toolbar-help-content-ulist-description' => 'बिंदीक्रमांकीत यादी', 'wikieditor-toolbar-help-content-ulist-syntax' => '* यादी कलम
      * यादी कलम', 'wikieditor-toolbar-help-content-ulist-result' => '
      • यादी घटक
      • यादी घटक
      ', - 'wikieditor-toolbar-help-content-olist-description' => 'अनुक्रमित यादी', + 'wikieditor-toolbar-help-content-olist-description' => 'अनुक्रम यादी', 'wikieditor-toolbar-help-content-olist-syntax' => '# यादी घटक
      # यादी घटक', 'wikieditor-toolbar-help-content-olist-result' => '
      1. यादी घटक
      2. यादी घटक
      ', 'wikieditor-toolbar-help-content-file-description' => 'संलग्न संचिका', @@ -18981,7 +18833,8 @@ $1:Example.jpg|चित्रपरिचय २', 'wikieditor-toolbar-help-content-rereference-result' => "पान मजकूर.[1]", 'wikieditor-toolbar-help-content-showreferences-description' => 'संदर्भ दर्शवा', 'wikieditor-toolbar-help-content-showreferences-result' => "
      1. ^ Link text, additional text.
      ", - 'wikieditor-toolbar-help-content-signaturetimestamp-description' => 'सही आणि वेळठसा', + 'wikieditor-toolbar-help-content-signaturetimestamp-description' => 'वेळेसह तुमची सही +तुमची सही व वेळ', 'wikieditor-toolbar-help-content-signaturetimestamp-result' => "सदस्यनाव (चर्चा) 15:54, 10 June 2009 (UTC)", 'wikieditor-toolbar-help-content-signature-description' => 'सही', 'wikieditor-toolbar-help-content-signature-result' => "सदस्यनाव (चर्चा)", @@ -20524,7 +20377,7 @@ $messages['nn'] = array( 'wikieditor-toolbar' => 'Verktøyline for redigering', 'wikieditor-toolbar-desc' => 'Ei meir brukarvenleg verktøylinje for redigering', 'wikieditor-toolbar-preference' => 'Ta i bruk utvida verktøylinje for redigering', - 'wikieditor-toolbar-dialogs-preference' => 'Aktiver dialogar for insetjing av lenkjer, tabellar og søk og byt ut-funksjonen', + 'wikieditor-toolbar-dialogs-preference' => 'Aktiver dialogar for insetjing av lenkjer, tabellar og meir', # Fuzzy 'wikieditor-toolbar-loading' => 'Lastar …', 'wikieditor-toolbar-tool-bold' => 'Feit', 'wikieditor-toolbar-tool-bold-example' => 'Feit tekst', @@ -20759,7 +20612,6 @@ $messages['nso'] = array( ); /** Occitan (occitan) - * @author Beta16 * @author Boulaur * @author Cedric31 * @author Jfblanc @@ -20794,7 +20646,7 @@ $messages['oc'] = array( 'wikieditor-toc-preference' => "Activar l'ensenhador navigable", 'wikieditor-toc-show' => 'Afichar lo contengut', 'wikieditor-toc-hide' => 'Amagar lo contengut', - 'wikieditor-toolbar' => 'Barra d’aisinas de modificacion', + 'wikieditor-toolbar' => 'Modificacion de la barra d’espleches', 'wikieditor-toolbar-desc' => "Modificacion de la barra d'aisinas amb l'utilizabilitat melhorada", 'wikieditor-toolbar-preference' => "Activar la barra d'aisinas melhorada", 'wikieditor-toolbar-dialogs-preference' => 'Activar las bóstias de dialòg per apondre de ligams, de tablèus e mai encara', # Fuzzy @@ -20834,7 +20686,7 @@ $messages['oc'] = array( 'wikieditor-toolbar-tool-file-example' => 'Exemple.jpg', 'wikieditor-toolbar-tool-file-title' => 'Importar un fichièr', 'wikieditor-toolbar-file-target' => 'Nom de fichièr :', - 'wikieditor-toolbar-file-caption' => 'Legenda:', + 'wikieditor-toolbar-file-caption' => 'Legenda :', 'wikieditor-toolbar-file-size' => 'Talha :', 'wikieditor-toolbar-file-float' => 'Alinhament :', 'wikieditor-toolbar-file-default' => '(per defaut)', @@ -22105,7 +21957,7 @@ $messages['pms'] = array( 'wikieditor-toolbar' => "Bara d'utiss ëd modìfica", 'wikieditor-toolbar-desc' => "Bara d'utiss ëd modìfica con dovrabilità ameliorà", 'wikieditor-toolbar-preference' => "Ativé la bara d'utiss ameliorà", - 'wikieditor-toolbar-dialogs-preference' => "Ativé j'assistent për gionté dle anliure, dle tàule e ëdcò la fonsion d'arserca e rampiass", + 'wikieditor-toolbar-dialogs-preference' => "Ativé ij quàder ëd diàlogh për anserì anliure, tàule e d'àutr", # Fuzzy 'wikieditor-toolbar-hidesig' => 'Stërmé ël boton ëd firma ant le pàgine ëd lë spassi nominal prinsipal', 'wikieditor-toolbar-loading' => 'Cariament...', 'wikieditor-toolbar-tool-bold' => 'Grassèt', @@ -22133,7 +21985,6 @@ $messages['pms'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Tìtol nen vàlid', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Anliura esterna', 'wikieditor-toolbar-tool-link-int-target-status-loading' => "Verìfica ëd l'esistensa dla pàgina...", - 'wikieditor-toolbar-tool-link-int-target-status-disambig' => "Pàgina d'omonimìa", 'wikieditor-toolbar-tool-link-int-invalid' => "Ël tìtol ch'a l'ha spessificà a va pa bin.", 'wikieditor-toolbar-tool-link-lookslikeinternal' => "L'URL ch'a l'ha spessificà a smijërìa n'anliura a n'àutra pàgina wiki. Veul-lo fene n'anliura anterna?", 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Anliura anterna', @@ -22675,8 +22526,8 @@ $messages['ps'] = array( 'wikieditor-toolbar-tool-table-dimensions-rows' => 'ليکې', 'wikieditor-toolbar-tool-table-dimensions-columns' => 'ستنې', 'wikieditor-toolbar-tool-table-wikitable' => 'ډول او پولې', - 'wikieditor-toolbar-tool-table-sortable' => 'لښتيال اوډون وړ گرځول', - 'wikieditor-toolbar-tool-table-example' => 'بېلگه', + 'wikieditor-toolbar-tool-table-sortable' => 'لښتيال د اوډون وړ گرځول', + 'wikieditor-toolbar-tool-table-example' => 'بېلګه', 'wikieditor-toolbar-tool-table-preview' => 'مخليدنه', 'wikieditor-toolbar-tool-table-insert' => 'ورټومبل', 'wikieditor-toolbar-tool-table-cancel' => 'ناگارل', @@ -23550,7 +23401,7 @@ $messages['ro'] = array( 'wikieditor-publish-dialog-title' => 'Publică pe {{SITENAME}}', 'wikieditor-publish-dialog-summary' => 'Descrierea modificărilor (descrieți pe scurt modificările făcute):', 'wikieditor-publish-dialog-minor' => 'Modificare minoră', - 'wikieditor-publish-dialog-watch' => 'Urmărește această pagină', + 'wikieditor-publish-dialog-watch' => 'Monitorizează această pagină', 'wikieditor-publish-dialog-publish' => 'Salvează pagina', 'wikieditor-publish-dialog-goback' => 'Înapoi', 'wikieditor-template-editor-preference' => 'Activează modificarea formatelor wiki prin formulare', @@ -23564,7 +23415,7 @@ $messages['ro'] = array( 'wikieditor-toolbar' => 'Modificarea barei de instrumente', 'wikieditor-toolbar-desc' => 'Modificarea barei de instrumente cu utilizare ridicată', 'wikieditor-toolbar-preference' => 'Activează varianta îmbunătățită a barei de unelte', - 'wikieditor-toolbar-dialogs-preference' => 'Activează asistență pentru inserarea legăturilor, tabelelor, precum și pentru funcțiile de căutare și înlocuire', + 'wikieditor-toolbar-dialogs-preference' => 'Activează casetele de dialog pentru inserarea legăturilor, tabelelor și a altor funcționalități', # Fuzzy 'wikieditor-toolbar-hidesig' => 'Ascunde butonul de semnătură în cazul paginilor din spațiul de nume principal', 'wikieditor-toolbar-loading' => 'Se încarcă...', 'wikieditor-toolbar-tool-bold' => 'Aldin', @@ -23592,7 +23443,6 @@ $messages['ro'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Titlu incorect', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Legătură externă', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'Verific existența paginii...', - 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'Pagină de dezambiguizare', 'wikieditor-toolbar-tool-link-int-invalid' => 'Titlul specificat nu este corect.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'URL-ul specificat pare a fi o legătură către o altă pagină wiki. Doriți să o transformați într-o legătură internă?', 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Legătură internă', @@ -24034,7 +23884,6 @@ $1:Example.jpg|Titele2', * @author Dim Grits * @author Eleferen * @author G0rn - * @author Iluvatar * @author KPu3uC B Poccuu * @author Kaganer * @author Lockal @@ -24057,7 +23906,7 @@ $messages['ru'] = array( 'wikieditor-publish-preference' => 'Включить пошаговую публикацию', 'wikieditor-publish-button-publish' => 'Опубликовать', 'wikieditor-publish-button-cancel' => 'Отмена', - 'wikieditor-publish-dialog-title' => 'Публикация в проекте {{SITENAME}}', + 'wikieditor-publish-dialog-title' => 'Опубликование в проекте {{SITENAME}}', 'wikieditor-publish-dialog-summary' => 'Описание изменений (кратко укажите какие изменения были произведены):', 'wikieditor-publish-dialog-minor' => 'Малое изменение', 'wikieditor-publish-dialog-watch' => 'Наблюдать за этой страницей', @@ -24102,7 +23951,6 @@ $messages['ru'] = array( 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Недопустимое название', 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Внешняя ссылка', 'wikieditor-toolbar-tool-link-int-target-status-loading' => 'Проверка существования страницы…', - 'wikieditor-toolbar-tool-link-int-target-status-disambig' => 'Страницы разрешения неоднозначностей', 'wikieditor-toolbar-tool-link-int-invalid' => 'Указанное название недопустимо.', 'wikieditor-toolbar-tool-link-lookslikeinternal' => 'Указанный вами URL похож на ссылку на другую вики-страницу. Вы хотите сделать данную ссылку внутренней?', 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Внутренняя ссылка', @@ -24199,7 +24047,7 @@ $1:Example.jpg|Описание2', 'wikieditor-toolbar-tool-replace-button-replaceall' => 'Заменить все', 'wikieditor-toolbar-tool-replace-close' => 'Закрыть', 'wikieditor-toolbar-tool-replace-nomatch' => 'По вашему запросу ничего не найдено.', - 'wikieditor-toolbar-tool-replace-success' => '$1 {{PLURAL:$1|замена произведена|замен произведено|замены произведены}}.', + 'wikieditor-toolbar-tool-replace-success' => '$1 {{PLURAL:$1|замена произведена|замены произведены|замен произведено}}.', 'wikieditor-toolbar-tool-replace-emptysearch' => 'Вы не указали что следует искать.', 'wikieditor-toolbar-tool-replace-invalidregex' => 'Введённое вами регулярное выражение ошибочно: $1', 'wikieditor-toolbar-section-characters' => 'Спецсимволы', @@ -24222,7 +24070,6 @@ $1:Example.jpg|Описание2', 'wikieditor-toolbar-characters-page-thai' => 'Тайские', 'wikieditor-toolbar-characters-page-lao' => 'Лаосские', 'wikieditor-toolbar-characters-page-khmer' => 'Кхмерские', - 'wikieditor-toolbar-characters-endash' => 'среднее тире', 'wikieditor-toolbar-characters-emdash' => 'длинное тире', 'wikieditor-toolbar-characters-minus' => 'знак минус', 'wikieditor-toolbar-section-help' => 'Справка', @@ -25970,7 +25817,7 @@ $messages['sl'] = array( 'wikieditor-publish-preference' => 'Omogoči objavljanje korak-po-koraku', 'wikieditor-publish-button-publish' => 'Objavi', 'wikieditor-publish-button-cancel' => 'Prekliči', - 'wikieditor-publish-dialog-title' => 'Objavi na {{GRAMMAR:dajalnik|{{SITENAME}}}}', + 'wikieditor-publish-dialog-title' => 'Objavi na {{SITENAME}}', 'wikieditor-publish-dialog-summary' => 'Povzetek urejanja (na kratko opišite narejene spremembe):', 'wikieditor-publish-dialog-minor' => 'Manjše urejanje', 'wikieditor-publish-dialog-watch' => 'Opazuj stran', @@ -27165,7 +27012,7 @@ $messages['sv'] = array( 'wikieditor-previewDialog-preference' => 'Aktivera förhandsgranska', 'wikieditor-previewDialog-tab' => 'Förhandsgranska', 'wikieditor-previewDialog-loading' => 'Laddar...', - 'wikieditor-publish-preference' => 'Aktivera steg-för-steg-publicering', + 'wikieditor-publish-preference' => 'Aktivera steg-efter-steg-publicering', 'wikieditor-publish-button-publish' => 'Publicera', 'wikieditor-publish-button-cancel' => 'Avbryt', 'wikieditor-publish-dialog-title' => 'Publicera i {{SITENAME}}', @@ -27466,15 +27313,15 @@ $messages['sw'] = array( 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Kiungo cha ndani', 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' => 'Kiungo cha nje', 'wikieditor-toolbar-tool-link-empty' => 'Hukuandika kitu cha kuunganisha naye.', - 'wikieditor-toolbar-tool-file' => 'Ingiza faili', + 'wikieditor-toolbar-tool-file' => 'Faili futike', 'wikieditor-toolbar-tool-file-example' => 'Mfano.jpg', 'wikieditor-toolbar-tool-file-title' => 'Ingiza faili', 'wikieditor-toolbar-file-target' => 'Jina la faili:', 'wikieditor-toolbar-file-size' => 'Ukubwa:', 'wikieditor-toolbar-tool-file-insert' => 'Ingiza', 'wikieditor-toolbar-tool-file-cancel' => 'Ghairi', - 'wikieditor-toolbar-tool-reference' => 'Marejeo', - 'wikieditor-toolbar-tool-reference-example' => 'Weka maneno ya marejeo hapa', + 'wikieditor-toolbar-tool-reference' => 'Tiniwayo', + 'wikieditor-toolbar-tool-reference-example' => 'Weka maneno ya tiniwayo hapa', 'wikieditor-toolbar-tool-reference-cancel' => 'Batilisha', 'wikieditor-toolbar-tool-reference-title' => 'Ingiza marejeo', 'wikieditor-toolbar-tool-reference-insert' => 'Ingiza', @@ -27582,7 +27429,7 @@ Idadi ya mistari au ya safu si halali.', 'wikieditor-toolbar-help-page-heading' => 'Vichwa', 'wikieditor-toolbar-help-page-list' => 'Orodha', 'wikieditor-toolbar-help-page-file' => 'Mafaili', - 'wikieditor-toolbar-help-page-reference' => 'Marejeo', + 'wikieditor-toolbar-help-page-reference' => 'Tiniwayo', 'wikieditor-toolbar-help-page-discussion' => 'Majadiliano', 'wikieditor-toolbar-help-content-italic-description' => 'Italiki', 'wikieditor-toolbar-help-content-italic-syntax' => "''Maandishi ya italiki''", @@ -27617,15 +27464,15 @@ Idadi ya mistari au ya safu si halali.', 'wikieditor-toolbar-help-content-olist-description' => 'Orodha zenye namba', 'wikieditor-toolbar-help-content-olist-syntax' => '# Aya
      # Aya', 'wikieditor-toolbar-help-content-olist-result' => '
      1. Aya
      2. Aya
      ', - 'wikieditor-toolbar-help-content-file-description' => 'Ingiza faili', + 'wikieditor-toolbar-help-content-file-description' => 'Faili futike', 'wikieditor-toolbar-help-content-file-syntax' => '[[$1:Example.png|thumb|Maelezo mafupi]]', 'wikieditor-toolbar-help-content-file-result' => "
      Maelezo mafupi
      ", - 'wikieditor-toolbar-help-content-reference-description' => 'Marejeo', + 'wikieditor-toolbar-help-content-reference-description' => 'Tiniwayo', 'wikieditor-toolbar-help-content-reference-syntax' => 'Maandishi ya ukurasa.<ref name="mfano">[http://www.example.org Maandishi ya kiungo], maandishi mengine.</ref>', 'wikieditor-toolbar-help-content-reference-result' => "Maandiko.[1]", - 'wikieditor-toolbar-help-content-rereference-description' => 'Kutumia marejeo fulani kwa mara nyingine', + 'wikieditor-toolbar-help-content-rereference-description' => 'Kutumia tiniwayo fulani kwa mara nyingine', 'wikieditor-toolbar-help-content-rereference-result' => "Maandiko.[1]", - 'wikieditor-toolbar-help-content-showreferences-description' => 'Onyesha marejeo', + 'wikieditor-toolbar-help-content-showreferences-description' => 'Onyesha tiniwayo', 'wikieditor-toolbar-help-content-showreferences-result' => "
      1. ^ Maandishi ya kiungo, maandishi mengine.
      ", 'wikieditor-toolbar-help-content-signaturetimestamp-description' => 'Sahihi pamoja na stempu ya saa', 'wikieditor-toolbar-help-content-signaturetimestamp-result' => "Jina la mtumiaji (majadiliano) 15:54, 10 June 2009 (UTC)", @@ -27636,16 +27483,6 @@ Idadi ya mistari au ya safu si halali.', 'wikieditor-toolbar-help-content-indent-result' => 'Maandiko ya kawaida
      Yaliyojongezwa ndani
      Yaliyojongezwa ndani
      ', ); -/** Silesian (ślůnski) - * @author Krol111 - */ -$messages['szl'] = array( - 'wikieditor' => 'Zaawansowano tajla edycyji wikitekstu', - 'wikieditor-desc' => 'Dowo poszyrzalno tajla edycyji wikitekstu a wjela funkcyji uofyrowane bez moduły', - 'wikieditor-wikitext-tab' => 'Wikitext', - 'wikieditor-loading' => 'Trwo ładowańy…', -); - /** Tamil (தமிழ்) * @author Balajijagadesh * @author Karthi.dr @@ -28844,7 +28681,6 @@ $messages['tpi'] = array( * @author Joseph * @author Koc61 * @author Manco Capac - * @author Meelo * @author Rapsar * @author Sadrettin * @author Srhat @@ -28919,7 +28755,6 @@ $messages['tr'] = array( 'wikieditor-toolbar-tool-file' => 'Gömülü dosya', 'wikieditor-toolbar-tool-file-example' => 'Örnek.jpg', 'wikieditor-toolbar-file-float' => 'Hizalama:', - 'wikieditor-toolbar-tool-file-insert' => 'Ekle', 'wikieditor-toolbar-tool-reference' => 'Kaynakça', 'wikieditor-toolbar-tool-reference-example' => 'Dipnot metnini buraya ekleyin', 'wikieditor-toolbar-tool-reference-cancel' => 'İptal', @@ -29630,7 +29465,7 @@ $1:Example.jpg|Опис2', 'wikieditor-toolbar-tool-replace-button-replaceall' => 'Замінити всі', 'wikieditor-toolbar-tool-replace-close' => 'Закрити', 'wikieditor-toolbar-tool-replace-nomatch' => 'За Вашим запитом нічого не знайдено.', - 'wikieditor-toolbar-tool-replace-success' => '$1 {{PLURAL:$1|1=заміну|заміни|замін}} зроблено.', + 'wikieditor-toolbar-tool-replace-success' => '$1 {{PLURAL:$1|заміну|замін}} зроблено.', 'wikieditor-toolbar-tool-replace-emptysearch' => 'Ви не зазначили, що треба шукати.', 'wikieditor-toolbar-tool-replace-invalidregex' => 'Введений вами регулярний вираз помилковий: $1', 'wikieditor-toolbar-section-characters' => 'Спеціальні символи', @@ -30013,7 +29848,7 @@ $messages['uz'] = array( 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Ichki havola', 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' => 'Tashqi havola', 'wikieditor-toolbar-tool-link-empty' => 'Nimaga ishorat qilishni koʻrsatmadingiz', - 'wikieditor-toolbar-tool-file' => 'Fayl oʻrnatish', + 'wikieditor-toolbar-tool-file' => 'Oʻrnatilgan fayl', 'wikieditor-toolbar-tool-file-example' => 'Example.jpg', 'wikieditor-toolbar-tool-file-title' => 'Fayl qoʻyish', 'wikieditor-toolbar-file-target' => 'Fayl nomi:', @@ -30172,7 +30007,7 @@ $1:Example.jpg|Izoh2', 'wikieditor-toolbar-help-content-olist-description' => 'Raqamlangan roʻyxat', 'wikieditor-toolbar-help-content-olist-syntax' => '# Roʻyxat qismi
      # Roʻyxat qismi', 'wikieditor-toolbar-help-content-olist-result' => '
      1. Roʻyxat qismi
      2. Roʻyxat qismi
      ', - 'wikieditor-toolbar-help-content-file-description' => 'Fayl oʻrnatish', + 'wikieditor-toolbar-help-content-file-description' => 'Oʻrnatilgan fayl', 'wikieditor-toolbar-help-content-file-syntax' => '[[$1:Example.png|thumb|Izohlovchi matn]]', 'wikieditor-toolbar-help-content-file-result' => "
      @@ -30454,51 +30289,17 @@ $messages['vep'] = array( 'wikieditor-publish-dialog-minor' => 'Penikaine redakcii', 'wikieditor-publish-dialog-publish' => 'Publikuida', 'wikieditor-publish-dialog-goback' => 'Tagaze', - 'wikieditor-template-editor-dialog-submit' => 'Udištada', - 'wikieditor-template-editor-dialog-cancel' => 'Tühjitada tego', 'wikieditor-toc-show' => 'Ozutada südäiolend', - 'wikieditor-toc-hide' => 'Peitta südäiolend', - 'wikieditor-toolbar' => "Redaktiruindan panel'", - 'wikieditor-toolbar-loading' => 'Ozutase…', 'wikieditor-toolbar-tool-bold' => 'Lihavoitud', 'wikieditor-toolbar-tool-bold-example' => 'Lihavoitud tekst', - 'wikieditor-toolbar-tool-italic' => 'Kursiv', - 'wikieditor-toolbar-tool-italic-example' => 'Kursivtekst', - 'wikieditor-toolbar-tool-ilink' => 'Südäikosketuz', - 'wikieditor-toolbar-tool-ilink-example' => 'Kosketusen pälkirjutez', - 'wikieditor-toolbar-tool-xlink' => 'Irdkosketuz (muštkat prefiksas http://)', - 'wikieditor-toolbar-tool-xlink-example' => 'http://www.example.com kosketusen pälkirjutez', 'wikieditor-toolbar-tool-link' => 'Kosketuz', 'wikieditor-toolbar-tool-link-title' => 'Ližada kosketuz', - 'wikieditor-toolbar-tool-link-int' => 'Wiki-lehtpolele', - 'wikieditor-toolbar-tool-link-int-target' => "Metlehtpol' vai URL:", - 'wikieditor-toolbar-tool-link-int-target-tooltip' => 'Lehtpolen nimi vai URL:', - 'wikieditor-toolbar-tool-link-int-text' => 'Ozutadud tekst:', - 'wikieditor-toolbar-tool-link-int-text-tooltip' => 'Ozutadud tekst:', - 'wikieditor-toolbar-tool-link-ext' => 'Irdaližele saitale', 'wikieditor-toolbar-tool-link-ext-target' => 'Kosketusen URL:', 'wikieditor-toolbar-tool-link-ext-text' => 'Kosketusen tekst:', - 'wikieditor-toolbar-tool-link-insert' => 'Ližada kosketuz', 'wikieditor-toolbar-tool-link-cancel' => 'Heitta', - 'wikieditor-toolbar-tool-link-int-target-status-exists' => "Lehtpol' om jo olmas", - 'wikieditor-toolbar-tool-link-int-target-status-notexists' => "Ei ole mugošt lehtpol't", 'wikieditor-toolbar-tool-link-int-target-status-invalid' => 'Vär nimi', - 'wikieditor-toolbar-tool-link-int-target-status-external' => 'Irdkosketuz', - 'wikieditor-toolbar-tool-link-int-invalid' => 'Nece pälkirjutez om vär.', - 'wikieditor-toolbar-tool-link-lookslikeinternal-int' => 'Südäikosketuz', - 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' => 'Irdkosketuz', 'wikieditor-toolbar-tool-file' => 'Mülütadud fail', 'wikieditor-toolbar-tool-file-example' => 'Ozutez.jpg', - 'wikieditor-toolbar-tool-file-title' => 'Ližada fail', - 'wikieditor-toolbar-file-target' => 'Failannimi:', - 'wikieditor-toolbar-file-caption' => 'Allekirjutez:', - 'wikieditor-toolbar-file-size' => 'Suruz', - 'wikieditor-toolbar-file-float' => 'Tazostamine:', - 'wikieditor-toolbar-file-default' => '(augotižjärgendusen mödhe)', - 'wikieditor-toolbar-file-format' => 'Format:', - 'wikieditor-toolbar-file-format-none' => 'Ei ole', - 'wikieditor-toolbar-tool-file-insert' => 'Ližata', - 'wikieditor-toolbar-tool-file-cancel' => 'Tühjištada', 'wikieditor-toolbar-tool-reference-insert' => 'Ližata', 'wikieditor-toolbar-tool-heading' => 'Pälkirjutez', 'wikieditor-toolbar-tool-heading-1' => 'Tazopind 1', @@ -30680,7 +30481,7 @@ $messages['vi'] = array( 'wikieditor-toolbar-tool-subscript' => 'Viết xuống dưới', 'wikieditor-toolbar-tool-subscript-example' => 'Chữ được viết xuống dưới', 'wikieditor-toolbar-group-insert' => 'Chèn', - 'wikieditor-toolbar-tool-gallery' => 'Tập ảnh', + 'wikieditor-toolbar-tool-gallery' => 'Album hình ảnh', 'wikieditor-toolbar-tool-gallery-example' => '$1:Ví dụ.jpg|Chú thích 1 $1:Ví dụ.jpg|Chú thích 2', 'wikieditor-toolbar-tool-newline' => 'Dòng mới', @@ -30824,7 +30625,7 @@ $messages['vo'] = array( 'wikieditor-toolbar-tool-link-int-target' => 'Tiäd pada:', 'wikieditor-toolbar-tool-link-int-text' => 'Vödem yüma', 'wikieditor-toolbar-tool-link-cancel' => 'Nosükön', - 'wikieditor-toolbar-group-format' => 'Fomät', + 'wikieditor-toolbar-group-format' => 'Lised', # Fuzzy 'wikieditor-toolbar-tool-big' => 'Gretik', 'wikieditor-toolbar-tool-big-example' => 'Vödem gretik', 'wikieditor-toolbar-tool-table' => 'Taib', @@ -31435,7 +31236,6 @@ $1:Example.jpg|Àkọlé2', * @author Horacewai2 * @author Simon Shek * @author Waihorace - * @author Xiaomingyan */ $messages['yue'] = array( 'wikieditor' => '進階維基文字編輯界面', @@ -31568,8 +31368,8 @@ $1:Example.jpg|標題2', | 行 2, 格 3', 'wikieditor-toolbar-tool-table-example-header' => '標題', 'wikieditor-toolbar-tool-table-title' => '插入表格', - 'wikieditor-toolbar-tool-table-dimensions-rows' => '行数', - 'wikieditor-toolbar-tool-table-dimensions-columns' => '列數', + 'wikieditor-toolbar-tool-table-dimensions-rows' => '行', + 'wikieditor-toolbar-tool-table-dimensions-columns' => '行', 'wikieditor-toolbar-tool-table-dimensions-header' => '新增標題行', 'wikieditor-toolbar-tool-table-wikitable' => '連埋外框同格式', 'wikieditor-toolbar-tool-table-sortable' => '整一個可以排序嘅表格', @@ -31726,9 +31526,9 @@ $messages['zh-hans'] = array( 'wikieditor-toc-show' => '显示内容', 'wikieditor-toc-hide' => '隐藏内容', 'wikieditor-toolbar' => '编辑工具栏', - 'wikieditor-toolbar-desc' => '有增强的使用性能的页面编辑工具栏', - 'wikieditor-toolbar-preference' => '启用增强的编辑工具栏', - 'wikieditor-toolbar-dialogs-preference' => '启用插入链接表格向导及查找和替换功能', + 'wikieditor-toolbar-desc' => '具有增强可用性的页面编辑工具', + 'wikieditor-toolbar-preference' => '启用增强编辑工具栏', + 'wikieditor-toolbar-dialogs-preference' => '启用对话框插入链接、表格以及搜索和替换功能', 'wikieditor-toolbar-hidesig' => '在主名字空间中隐藏签名按钮', 'wikieditor-toolbar-loading' => '正在载入', 'wikieditor-toolbar-tool-bold' => '粗体', @@ -31767,7 +31567,7 @@ $messages['zh-hans'] = array( 'wikieditor-toolbar-tool-file-title' => '插入文件', 'wikieditor-toolbar-file-target' => '文件名:', 'wikieditor-toolbar-file-caption' => '标题:', - 'wikieditor-toolbar-file-size' => '尺寸:', + 'wikieditor-toolbar-file-size' => '大小:', 'wikieditor-toolbar-file-float' => '对齐:', 'wikieditor-toolbar-file-default' => '(默认)', 'wikieditor-toolbar-file-format' => '格式:', @@ -31775,7 +31575,7 @@ $messages['zh-hans'] = array( 'wikieditor-toolbar-tool-file-insert' => '插入', 'wikieditor-toolbar-tool-file-cancel' => '取消', 'wikieditor-toolbar-tool-reference' => '参考', - 'wikieditor-toolbar-tool-reference-example' => '请在这里插入注释文字', + 'wikieditor-toolbar-tool-reference-example' => '在此处插入注释文字', 'wikieditor-toolbar-tool-reference-cancel' => '取消', 'wikieditor-toolbar-tool-reference-title' => '插入注释内容', 'wikieditor-toolbar-tool-reference-insert' => '插入', @@ -31797,7 +31597,7 @@ $messages['zh-hans'] = array( 'wikieditor-toolbar-tool-indent' => '缩进', 'wikieditor-toolbar-tool-indent-example' => '已缩进行', 'wikieditor-toolbar-tool-nowiki' => '非维基格式文字', - 'wikieditor-toolbar-tool-nowiki-example' => '请在这里插入非格式化文字', + 'wikieditor-toolbar-tool-nowiki-example' => '在此处插入非维基格式文字', 'wikieditor-toolbar-tool-redirect' => '重定向', 'wikieditor-toolbar-tool-redirect-example' => '目标页名称', 'wikieditor-toolbar-tool-big' => '大号', @@ -31829,8 +31629,8 @@ $1:Example.jpg|标题2', 'wikieditor-toolbar-tool-table-example-cell-text' => '单元格文字', 'wikieditor-toolbar-tool-table-example-header' => '标题文字', 'wikieditor-toolbar-tool-table-title' => '插入表格', - 'wikieditor-toolbar-tool-table-dimensions-rows' => '行数', - 'wikieditor-toolbar-tool-table-dimensions-columns' => '列数', + 'wikieditor-toolbar-tool-table-dimensions-rows' => '行', + 'wikieditor-toolbar-tool-table-dimensions-columns' => '列', 'wikieditor-toolbar-tool-table-dimensions-header' => '添加标题行', 'wikieditor-toolbar-tool-table-wikitable' => '显示边框', 'wikieditor-toolbar-tool-table-sortable' => '使表格内容可排序', @@ -31959,7 +31759,6 @@ $1:Example.jpg|标题2', * @author Waihorace * @author Wong128hk * @author Wrightbus - * @author Xiaomingyan */ $messages['zh-hant'] = array( 'wikieditor' => '進階維基文字編輯介面', @@ -32105,8 +31904,8 @@ $1:Example.jpg|標題2', | 行 2, 格 3', 'wikieditor-toolbar-tool-table-example-header' => '標題', 'wikieditor-toolbar-tool-table-title' => '插入表格', - 'wikieditor-toolbar-tool-table-dimensions-rows' => '行數', - 'wikieditor-toolbar-tool-table-dimensions-columns' => '列數', + 'wikieditor-toolbar-tool-table-dimensions-rows' => '行', + 'wikieditor-toolbar-tool-table-dimensions-columns' => '列', 'wikieditor-toolbar-tool-table-dimensions-header' => '新增標題行', 'wikieditor-toolbar-tool-table-wikitable' => '設定邊框格式', 'wikieditor-toolbar-tool-table-sortable' => '使表格內容可排序', diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.dialogs.js b/extensions/WikiEditor/modules/ext.wikiEditor.dialogs.js index c6d327f8..0e0dd090 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.dialogs.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.dialogs.js @@ -1,14 +1,15 @@ /* * JavaScript for WikiEditor Dialogs */ -jQuery( document ).ready( function ( $ ) { + +$( document ).ready( function() { if ( !$.wikiEditor.isSupported( $.wikiEditor.modules.dialogs ) ) { return; } - + // Replace icons $.wikiEditor.modules.dialogs.config.replaceIcons( $( '#wpTextbox1' ) ); - + // Add dialogs module $( '#wpTextbox1' ).wikiEditor( 'addModule', $.wikiEditor.modules.dialogs.config.getDefaultConfig() ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.highlight.js b/extensions/WikiEditor/modules/ext.wikiEditor.highlight.js index 92515cfd..a6b43851 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.highlight.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.highlight.js @@ -1,7 +1,8 @@ /* * JavaScript for WikiEditor Highlighting */ -jQuery( document ).ready( function ( $ ) { + +$( document ).ready( function() { // Add highlight module $( '#wpTextbox1' ).wikiEditor( 'addModule', 'highlight' ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.js b/extensions/WikiEditor/modules/ext.wikiEditor.js index 46087989..6056e63b 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.js @@ -1,7 +1,8 @@ /* * JavaScript for WikiEditor */ -jQuery( document ).ready( function ( $ ) { + +$( document ).ready( function() { // Initialize wikiEditor $( '#wpTextbox1' ).wikiEditor(); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.preview.js b/extensions/WikiEditor/modules/ext.wikiEditor.preview.js index cdc00f7b..3fbca82d 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.preview.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.preview.js @@ -1,7 +1,8 @@ /* * JavaScript for WikiEditor Preview module */ -jQuery( document ).ready( function ( $ ) { + +$( document ).ready( function() { // Add preview module $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'preview' ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.previewDialog.js b/extensions/WikiEditor/modules/ext.wikiEditor.previewDialog.js index 3b1acd7c..67f97e00 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.previewDialog.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.previewDialog.js @@ -1,7 +1,8 @@ /* * JavaScript for WikiEditor Preview Dialog */ -jQuery( document ).ready( function ( $ ) { + +$( document ).ready( function() { // Add preview module $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'previewDialog' ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.publish.js b/extensions/WikiEditor/modules/ext.wikiEditor.publish.js index 423766d2..d874478c 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.publish.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.publish.js @@ -1,7 +1,8 @@ /* * JavaScript for WikiEditor Publish module */ -jQuery( document ).ready( function ( $ ) { + +$( document ).ready( function() { // Add publish module $( '#wpTextbox1' ).wikiEditor( 'addModule', 'publish' ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.templateEditor.js b/extensions/WikiEditor/modules/ext.wikiEditor.templateEditor.js index 660a14fb..8879d10d 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.templateEditor.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.templateEditor.js @@ -1,13 +1,12 @@ /* * JavaScript for WikiEditor Template Editor */ -( function ( mw, $ ) { - $( document ).ready( function () { - // Disable in template namespace - if ( mw.config.get( 'wgNamespaceNumber' ) === 10 ) { - return true; - } - // Add template editor module - $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'templateEditor' ); - } ); -}( mediaWiki, jQuery ) ); + +$( document ).ready( function () { + // Disable in template namespace + if ( mw.config.get( 'wgNamespaceNumber' ) === 10 ) { + return true; + } + // Add template editor module + $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'templateEditor' ); +}); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.templates.js b/extensions/WikiEditor/modules/ext.wikiEditor.templates.js index fec51866..6eae6de5 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.templates.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.templates.js @@ -1,13 +1,12 @@ /* * JavaScript for WikiEditor Templates */ -( function ( mw, $ ) { - $( document ).ready( function () { - // Disable for template namespace - if ( mw.config.get( 'wgNamespaceNumber' ) === 10 ) { - return true; - } - // Add templates module - $( '#wpTextbox1' ).wikiEditor( 'addModule', 'templates' ); - } ); -}( mediaWiki, jQuery ) ); + +$( document ).ready( function () { + // Disable for template namespace + if ( mw.config.get( 'wgNamespaceNumber' ) === 10 ) { + return true; + } + // Add templates module + $( '#wpTextbox1' ).wikiEditor( 'addModule', 'templates' ); +} ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js b/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js index 7ed765e9..d4ffe5ae 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.tests.toolbar.js @@ -4,7 +4,7 @@ var textareaId = '#wpTextbox1'; var wikiEditorTests = { // Add emoticons section - 'add_sections_toolbar': { + add_sections_toolbar: { call: 'addToToolbar', data: { 'sections': { @@ -159,8 +159,8 @@ var wikiEditorTests = { data: { section: 'info', page: 'removeme' - }, - test: '*[rel=info].section *[rel=removeme].page', + }, + test: '*[rel=info].section *[rel=removeme].page', pre: 1, post: 0 }, @@ -171,8 +171,8 @@ var wikiEditorTests = { section: 'info', page: 'emoticons', 'character': ':))' - }, - test: '*[rel=info].section *[rel=emoticons].page *[rel=":))"]', + }, + test: '*[rel=info].section *[rel=emoticons].page *[rel=":))"]', pre: 1, post: 0 }, @@ -211,7 +211,7 @@ jQuery(document).ready( function ( $ ) { return false; } - var test, pre, post, i, + var test, pre, post, messages = [ 'Running tests for wikiEditor API' ], $target = $( textareaId ), $ui = $target.data( 'wikiEditor-context' ).$ui, @@ -234,13 +234,13 @@ jQuery(document).ready( function ( $ ) { } if ( window.console ) { - for ( i = 0; i < messages.length; i++ ) { + for ( var i = 0; i < messages.length; i++ ) { window.console.log( messages[i] ); } } $(this) - .attr( 'title', messages.join( ' | ' ) ) + .attr( 'title', messages.join( " | " ) ) .text( passes + ' / ' + tests + ' were successful' ) .css( 'backgroundColor', passes < tests ? 'red' : 'green' ) .data( 'testDone', 'true' ) diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.toc.js b/extensions/WikiEditor/modules/ext.wikiEditor.toc.js index 1fc542c5..264e9f86 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.toc.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.toc.js @@ -1,7 +1,8 @@ /* * JavaScript for WikiEditor Table of Contents */ -jQuery( document ).ready( function ( $ ) { + +$( document ).ready( function() { // Add table of contents module $( '#wpTextbox1' ).wikiEditor( 'addModule', 'toc' ); } ); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.hideSig.js b/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.hideSig.js index 48d30274..3bc0f0b4 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.hideSig.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.hideSig.js @@ -1,7 +1,7 @@ /* * Remove the signature button if the main namespace is edited. */ -jQuery( document ).ready( function ( $ ) { +$( document ).ready( function() { // This module is designed not to depend on ext.wikiEditor or jquery.wikiEditor. // Removing this dependency fixed various bugs, but it does mean that we have to // account for the situation where $.wikiEditor is not present @@ -11,4 +11,4 @@ jQuery( document ).ready( function ( $ ) { if ( $( 'body' ).hasClass( 'ns-0' ) ) { $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'signature' } ); } -} ); +}); diff --git a/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js b/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js index 3f30c0c4..5cdeae57 100644 --- a/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js +++ b/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js @@ -1,7 +1,8 @@ /* * JavaScript for WikiEditor Toolbar */ -jQuery( document ).ready( function ( $ ) { + +$( document ).ready( function() { if ( !$.wikiEditor.isSupported( $.wikiEditor.modules.toolbar ) ) { $( '.wikiEditor-oldToolbar' ).show(); return; diff --git a/extensions/WikiEditor/modules/images/toolbar/format-bold-hy.png b/extensions/WikiEditor/modules/images/toolbar/format-bold-hy.png deleted file mode 100644 index 453a9580..00000000 Binary files a/extensions/WikiEditor/modules/images/toolbar/format-bold-hy.png and /dev/null differ diff --git a/extensions/WikiEditor/modules/images/toolbar/format-italic-hy.png b/extensions/WikiEditor/modules/images/toolbar/format-italic-hy.png deleted file mode 100644 index 108bae64..00000000 Binary files a/extensions/WikiEditor/modules/images/toolbar/format-italic-hy.png and /dev/null differ diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.css b/extensions/WikiEditor/modules/jquery.wikiEditor.css index 6e05ff03..d8e331cc 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.css +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.css @@ -18,6 +18,9 @@ } .wikiEditor-ui textarea:focus { outline: none; +} +.wikiEditor-ui .wikiEditor-ui-bottom { + } .wikiEditor-ui .wikiEditor-ui-text { line-height: 0; diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js b/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js index f37d004e..0d769164 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.config.js @@ -1,8 +1,6 @@ /** * Configuration of Dialog module for wikiEditor */ -/*jshint curly:false, noarg:false, quotmark:false, onevar:false */ -/*global alert */ ( function ( $, mw ) { $.wikiEditor.modules.dialogs.config = { @@ -228,7 +226,7 @@ $.wikiEditor.modules.dialogs.config = { ); } $( '#wikieditor-toolbar-link-type-int, #wikieditor-toolbar-link-type-ext' ).click( function () { - if ( $( '#wikieditor-toolbar-link-type-ext' ).prop( 'checked' ) ) { + if ( $( '#wikieditor-toolbar-link-type-ext' ).is( ':checked' ) ) { // Abort previous request var request = $( '#wikieditor-toolbar-link-int-target-status' ).data( 'request' ); if ( request ) { @@ -236,9 +234,8 @@ $.wikiEditor.modules.dialogs.config = { } updateWidget( 'external' ); } - if ( $( '#wikieditor-toolbar-link-type-int' ).prop( 'checked' ) ) { + if ( $( '#wikieditor-toolbar-link-type-int' ).is( ':checked' ) ) updateExistence( true ); - } }); // Set labels of tabs based on rel values $(this).find( '[rel]' ).each( function () { @@ -253,12 +250,12 @@ $.wikiEditor.modules.dialogs.config = { .data( 'tooltip', mw.msg( 'wikieditor-toolbar-tool-link-int-text-tooltip' ) ); $( '#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text' ) .each( function () { - if ( $( this ).val() === '' ) { + var tooltip = mw.msg( $( this ).attr( 'id' ) + '-tooltip' ); + if ( $( this ).val() === '' ) $( this ) .addClass( 'wikieditor-toolbar-dialog-hint' ) .val( $( this ).data( 'tooltip' ) ) .data( 'tooltip-mode', true ); - } } ) .focus( function () { if ( $( this ).val() === $( this ).data( 'tooltip' ) ) { @@ -298,30 +295,26 @@ $.wikiEditor.modules.dialogs.config = { $( '#wikieditor-toolbar-link-type-int' ).prop( 'checked', true ); updateExistence(); } - /*jshint eqeqeq:false */ - if ( $( '#wikieditor-toolbar-link-int-text' ).data( 'untouched' ) ) { + if ( $( '#wikieditor-toolbar-link-int-text' ).data( 'untouched' ) ) if ( $( '#wikieditor-toolbar-link-int-target' ).val() == - $( '#wikieditor-toolbar-link-int-target' ).data( 'tooltip' ) - ) { - $( '#wikieditor-toolbar-link-int-text' ) - .addClass( 'wikieditor-toolbar-dialog-hint' ) - .val( $( '#wikieditor-toolbar-link-int-text' ).data( 'tooltip' ) ) - .change(); - } else { - $( '#wikieditor-toolbar-link-int-text' ) - .val( $( '#wikieditor-toolbar-link-int-target' ).val() ) - .change(); - } - } + $( '#wikieditor-toolbar-link-int-target' ).data( 'tooltip' ) ) { + $( '#wikieditor-toolbar-link-int-text' ) + .addClass( 'wikieditor-toolbar-dialog-hint' ) + .val( $( '#wikieditor-toolbar-link-int-text' ).data( 'tooltip' ) ) + .change(); + } else { + $( '#wikieditor-toolbar-link-int-text' ) + .val( $( '#wikieditor-toolbar-link-int-target' ).val() ) + .change(); + } }, 0 ); }); $( '#wikieditor-toolbar-link-int-text' ).bind( 'change keydown paste cut', function () { var oldVal = $(this).val(); var that = this; setTimeout( function () { - if ( $(that).val() !== oldVal ) { + if ( $(that).val() !== oldVal ) $(that).data( 'untouched', false ); - } }, 0 ); }); // Add images to the page existence widget, which will be shown mutually exclusively to communicate if @@ -386,7 +379,7 @@ $.wikiEditor.modules.dialogs.config = { // Title suggestions $( '#wikieditor-toolbar-link-int-target' ).data( 'suggcache', {} ).suggestions( { - fetch: function () { + fetch: function ( query ) { var that = this; var title = $(this).val(); @@ -615,7 +608,7 @@ $.wikiEditor.modules.dialogs.config = { // Execute the action associated with the first button // when the user presses Enter $(this).closest( '.ui-dialog' ).keypress( function ( e ) { - if ( ( e.keyCode || e.which ) === 13 ) { + if ( ( e.keyCode || e.which ) == 13 ) { var button = $(this).data( 'dialogaction' ) || $(this).find( 'button:first' ); button.click(); e.preventDefault(); @@ -713,7 +706,7 @@ $.wikiEditor.modules.dialogs.config = { // Execute the action associated with the first button // when the user presses Enter $( this ).closest( '.ui-dialog' ).keypress( function ( e ) { - if ( ( e.keyCode || e.which ) === 13 ) { + if ( ( e.keyCode || e.which ) == 13 ) { var button = $( this ).data( 'dialogaction' ) || $( this ).find( 'button:first' ); button.click(); e.preventDefault(); @@ -985,7 +978,7 @@ $.wikiEditor.modules.dialogs.config = { var hiddenHTML = $( '.wikieditor-toolbar-table-preview-hidden' ).html(); $( '.wikieditor-toolbar-table-preview-header' ).html( hiddenHTML ); $( '.wikieditor-toolbar-table-preview-hidden' ).html( headerHTML ); - if ( typeof jQuery.fn.tablesorter === 'function' ) { + if ( typeof jQuery.fn.tablesorter == 'function' ) { $( '#wikieditor-toolbar-table-preview, #wikieditor-toolbar-table-preview2' ) .filter( '.sortable' ) .tablesorter(); @@ -1077,7 +1070,7 @@ $.wikiEditor.modules.dialogs.config = { // Execute the action associated with the first button // when the user presses Enter $(this).closest( '.ui-dialog' ).keypress( function ( e ) { - if ( ( e.keyCode || e.which ) === 13 ) { + if ( ( e.keyCode || e.which ) == 13 ) { var button = $(this).data( 'dialogaction' ) || $(this).find( 'button:first' ); button.click(); e.preventDefault(); @@ -1209,7 +1202,7 @@ $.wikiEditor.modules.dialogs.config = { if ( !match ) { $( '#wikieditor-toolbar-replace-nomatch' ).show(); - } else if ( mode === 'replaceAll' ) { + } else if ( mode == 'replaceAll' ) { // Instead of using repetitive .match() calls, we use one .match() call with /g // and indexOf() followed by substr() to find the offsets. This is actually // faster because our indexOf+substr loop is faster than a match loop, and the @@ -1244,7 +1237,7 @@ $.wikiEditor.modules.dialogs.config = { $(this).data( 'offset', 0 ); } else { - if ( mode === 'replace' ) { + if ( mode == 'replace' ) { var actualReplacement; if (isRegex) { @@ -1337,7 +1330,7 @@ $.wikiEditor.modules.dialogs.config = { // Execute the action associated with the first button // when the user presses Enter $(this).closest( '.ui-dialog' ).keypress( function ( e ) { - if ( ( e.keyCode || e.which ) === 13 ) { + if ( ( e.keyCode || e.which ) == 13 ) { var button = $(this).data( 'dialogaction' ) || $(this).find( 'button:first' ); button.click(); e.preventDefault(); @@ -1357,12 +1350,12 @@ $.wikiEditor.modules.dialogs.config = { $( textbox ) .bind( 'keypress.srdialog', function ( e ) { - if ( e.which === 13 ) { + if ( e.which == 13 ) { // Enter var button = dialog.data( 'dialogaction' ) || dialog.find( 'button:first' ); button.click(); e.preventDefault(); - } else if ( e.which === 27 ) { + } else if ( e.which == 27 ) { // Escape $(that).dialog( 'close' ); } diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js b/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js index 6d92966f..f6d86d78 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js @@ -42,8 +42,8 @@ $.wikiEditor.modules.dialogs = { }, openDialog: function ( context, module ) { if ( module in $.wikiEditor.modules.dialogs.modules ) { - var mod = $.wikiEditor.modules.dialogs.modules[module], - $dialog = $( '#' + mod.id ); + var mod = $.wikiEditor.modules.dialogs.modules[module]; + var $dialog = $( '#' + mod.id ); if ( $dialog.length === 0 ) { $.wikiEditor.modules.dialogs.fn.reallyCreate( context, mod, module ); $dialog = $( '#' + mod.id ); @@ -82,7 +82,7 @@ $.wikiEditor.modules.dialogs = { module = config[mod]; // Only create the dialog if it's supported, isn't filtered and doesn't exist yet filtered = false; - if ( typeof module.filters !== 'undefined' ) { + if ( typeof module.filters != 'undefined' ) { for ( i = 0; i < module.filters.length; i++ ) { if ( $( module.filters[i] ).length === 0 ) { filtered = true; @@ -92,7 +92,7 @@ $.wikiEditor.modules.dialogs = { } // If the dialog already exists, but for another textarea, simply remove it $existingDialog = $( '#' + module.id ); - if ( $existingDialog.length > 0 && $existingDialog.data( 'context' ).$textarea !== context.$textarea ) { + if ( $existingDialog.length > 0 && $existingDialog.data( 'context' ).$textarea != context.$textarea ) { $existingDialog.remove(); } // Re-select from the DOM, we might have removed the dialog just now @@ -119,13 +119,13 @@ $.wikiEditor.modules.dialogs = { * @param {String} name Dialog name (key in $.wikiEditor.modules.dialogs.modules) */ reallyCreate: function ( context, module, name ) { - var msg, dialogDiv, + var msg, configuration = module.dialog; // Add some stuff to configuration configuration.bgiframe = true; configuration.autoOpen = false; // By default our dialogs are modal, unless explicitely defined in their specific configuration. - if( typeof configuration.modal === 'undefined' ) { + if( typeof configuration.modal == "undefined" ) { configuration.modal = true; } configuration.title = $.wikiEditor.autoMsg( module, 'title' ); @@ -138,7 +138,7 @@ $.wikiEditor.modules.dialogs = { } configuration.buttons = configuration.newButtons; // Create the dialog
      - dialogDiv = $( '
      ' ) + var dialogDiv = $( '
      ' ) .attr( 'id', module.id ) .html( module.html ) .data( 'context', context ) @@ -171,28 +171,26 @@ $.wikiEditor.modules.dialogs = { * NOTE: This function assumes $.ui.dialog has already been loaded */ resize: function () { - var oldWS, thisWidth, wrapperWidth, - wrapper = $(this).closest( '.ui-dialog' ), - oldWidth = wrapper.width(), - // Make sure elements don't wrapped so we get an accurate idea of whether they really fit. Also temporarily show - // hidden elements. Work around jQuery bug where
      inside a dialog is both - // :visible and :hidden - oldHidden = $(this).find( '*' ).not( ':visible' ); - + var wrapper = $(this).closest( '.ui-dialog' ); + var oldWidth = wrapper.width(); + // Make sure elements don't wrapped so we get an accurate idea of whether they really fit. Also temporarily show + // hidden elements. Work around jQuery bug where
      inside a dialog is both + // :visible and :hidden + var oldHidden = $(this).find( '*' ).not( ':visible' ); // Save the style attributes of the hidden elements to restore them later. Calling hide() after show() messes up // for elements hidden with a class oldHidden.each( function () { $(this).data( 'oldstyle', $(this).attr( 'style' ) ); }); oldHidden.show(); - oldWS = $(this).css( 'white-space' ); + var oldWS = $(this).css( 'white-space' ); $(this).css( 'white-space', 'nowrap' ); if ( wrapper.width() <= $(this).get(0).scrollWidth ) { - thisWidth = $(this).data( 'thisWidth' ) ? $(this).data( 'thisWidth' ) : 0; + var thisWidth = $(this).data( 'thisWidth' ) ? $(this).data( 'thisWidth' ) : 0; thisWidth = Math.max( $(this).get(0).width, thisWidth ); $(this).width( thisWidth ); $(this).data( 'thisWidth', thisWidth ); - wrapperWidth = $(this).data( 'wrapperWidth' ) ? $(this).data( 'wrapperWidth' ) : 0; + var wrapperWidth = $(this).data( 'wrapperWidth' ) ? $(this).data( 'wrapperWidth' ) : 0; wrapperWidth = Math.max( wrapper.get(0).scrollWidth, wrapperWidth ); wrapper.width( wrapperWidth ); $(this).data( 'wrapperWidth', wrapperWidth ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.highlight.js b/extensions/WikiEditor/modules/jquery.wikiEditor.highlight.js index f646e456..9d964fa7 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.highlight.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.highlight.js @@ -20,21 +20,13 @@ $.wikiEditor.modules.highlight = { * Internally used event handlers */ evt: { - /** - * @param context - * @param event - */ delayedChange: function ( context, event ) { - if ( event.data.scope === 'realchange' ) { + if ( event.data.scope == 'realchange' ) { $.wikiEditor.modules.highlight.fn.scan( context ); $.wikiEditor.modules.highlight.fn.mark( context, event.data.scope ); } }, - /** - * @param context - * @param event - */ - ready: function ( context ) { + ready: function ( context, event ) { $.wikiEditor.modules.highlight.fn.scan( context ); $.wikiEditor.modules.highlight.fn.mark( context, 'ready' ); } @@ -47,22 +39,19 @@ $.wikiEditor.modules.highlight = { /** * Creates a highlight module within a wikiEditor * - * @param context * @param config Configuration object to create module from */ - create: function ( context ) { + create: function ( context, config ) { context.modules.highlight.markersStr = ''; }, /** * Scans text division for tokens * - * @param context * @param division */ - scan: function ( context ) { + scan: function ( context, division ) { var tokenArray, text, module, exp, - left, right, match, - regex, label, markAfter, offset; + left, right, match; /*jshint eqnull: true */ // Remove all existing tokens @@ -76,11 +65,11 @@ $.wikiEditor.modules.highlight = { if ( module in $.wikiEditor.modules && 'exp' in $.wikiEditor.modules[module] ) { for ( exp in $.wikiEditor.modules[module].exp ) { // Prepare configuration - regex = $.wikiEditor.modules[module].exp[exp].regex; - label = $.wikiEditor.modules[module].exp[exp].label; - markAfter = $.wikiEditor.modules[module].exp[exp].markAfter || false; + var regex = $.wikiEditor.modules[module].exp[exp].regex; + var label = $.wikiEditor.modules[module].exp[exp].label; + var markAfter = $.wikiEditor.modules[module].exp[exp].markAfter || false; // Search for tokens - offset = 0; + var offset = 0; while ( ( match = text.substr( offset ).match( regex ) ) != null ) { right = ( left = offset + match.index ) + match[0].length; tokenArray[tokenArray.length] = { @@ -106,19 +95,16 @@ $.wikiEditor.modules.highlight = { /** * Marks up text with HTML * - * @param context * @param division * @param tokens */ // FIXME: What do division and tokens do? // TODO: Document the scan() and mark() APIs somewhere - mark: function ( context, division ) { - /*jshint eqeqeq:false, onevar:false */ - var i, subtracted, oldLength, j, o, - markers; + mark: function ( context, division, tokens ) { + var i, subtracted, oldLength, j, o; // Reset markers - markers = []; + var markers = []; // Recycle markers that will be skipped in this run if ( context.modules.highlight.markers && division !== '' ) { @@ -367,9 +353,8 @@ $.wikiEditor.modules.highlight = { // Don't remove these either return true; } - if ( marker && typeof marker.beforeUnwrap === 'function' ) { + if ( marker && typeof marker.beforeUnwrap === 'function' ) marker.beforeUnwrap( this ); - } if ( ( marker && marker.anchor === 'tag' ) || $(this).is( 'p' ) ) { // Remove all classes $(this).removeAttr( 'class' ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.iframe.js b/extensions/WikiEditor/modules/jquery.wikiEditor.iframe.js index 538fcb18..4d425012 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.iframe.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.iframe.js @@ -1,6 +1,6 @@ /* IFrame extension for wikiEditor */ -/*jshint onevar:false, boss:true */ -( function ( $ ) { $.wikiEditor.extensions.iframe = function ( context ) { + +( function( $ ) { $.wikiEditor.extensions.iframe = function( context ) { /* * Event Handlers @@ -14,18 +14,18 @@ context.evt = $.extend( context.evt, { * function is to both classify the scope of changes as 'division' or 'character' and to prevent further * processing of events which did not actually change the content of the iframe. */ - keydown: function ( event ) { + 'keydown': function( event ) { switch ( event.which ) { case 90: // z case 89: // y - if ( event.which === 89 && !$.browser.msie ) { + if ( event.which == 89 && !$.browser.msie ) { // only handle y events for IE return true; } else if ( ( event.ctrlKey || event.metaKey ) && context.history.length ) { // HistoryPosition is a negative number between -1 and -context.history.length, in other words // it's the number of steps backwards from the latest state. var newPosition; - if ( event.shiftKey || event.which === 89 ) { + if ( event.shiftKey || event.which == 89 ) { // Redo newPosition = context.historyPosition + 1; } else { @@ -35,7 +35,7 @@ context.evt = $.extend( context.evt, { // Only act if we are switching to a valid state if ( newPosition >= ( context.history.length * -1 ) && newPosition < 0 ) { // Make sure we run the history storing code before we make this change - context.fn.updateHistory( context.oldDelayedHTML !== context.$content.html() ); + context.fn.updateHistory( context.oldDelayedHTML != context.$content.html() ); context.oldDelayedHistoryPosition = context.historyPosition; context.historyPosition = newPosition; // Change state @@ -65,8 +65,8 @@ context.evt = $.extend( context.evt, { var $tabindexList = $( '[tabindex]:visible' ).sort( function( a, b ) { return a.tabIndex - b.tabIndex; } ); - for ( var i=0; i < $tabindexList.length; i++ ) { - if ( $tabindexList.eq( i ).attr( 'id' ) === context.$iframe.attr( 'id' ) ) { + for( var i=0; i < $tabindexList.length; i++ ) { + if( $tabindexList.eq( i ).attr( 'id' ) == context.$iframe.attr( 'id' ) ) { $tabindexList.get( i + 1 ).focus(); break; } @@ -74,48 +74,48 @@ context.evt = $.extend( context.evt, { return false; } break; - case 86: //v - if ( event.ctrlKey && $.browser.msie && 'paste' in context.evt ) { - //paste, intercepted for IE - context.evt.paste( event ); - } - break; + case 86: //v + if ( event.ctrlKey && $.browser.msie && 'paste' in context.evt ) { + //paste, intercepted for IE + context.evt.paste( event ); + } + break; } return true; }, - change: function ( event ) { + 'change': function( event ) { event.data.scope = 'division'; var newHTML = context.$content.html(); - if ( context.oldHTML !== newHTML ) { + if ( context.oldHTML != newHTML ) { context.fn.purgeOffsets(); context.oldHTML = newHTML; event.data.scope = 'realchange'; } // Never let the body be totally empty - if ( context.$content.children().length === 0 ) { + if ( context.$content.children().length == 0 ) { context.$content.append( '

      ' ); } return true; }, - delayedChange: function ( event ) { + 'delayedChange': function( event ) { event.data.scope = 'division'; var newHTML = context.$content.html(); - if ( context.oldDelayedHTML !== newHTML ) { + if ( context.oldDelayedHTML != newHTML ) { context.oldDelayedHTML = newHTML; event.data.scope = 'realchange'; // Surround by

      if it does not already have it var cursorPos = context.fn.getCaretPosition(); var t = context.fn.getOffset( cursorPos[0] ); - if ( ! $.browser.msie && t && t.node.nodeName === '#text' && t.node.parentNode.nodeName.toLowerCase() === 'body' ) { - $( t.node ).wrap( '

      ' ); + if ( ! $.browser.msie && t && t.node.nodeName == '#text' && t.node.parentNode.nodeName.toLowerCase() == 'body' ) { + $( t.node ).wrap( "

      " ); context.fn.purgeOffsets(); context.fn.setSelection( { start: cursorPos[0], end: cursorPos[1] } ); } } - context.fn.updateHistory( event.data.scope === 'realchange' ); + context.fn.updateHistory( event.data.scope == 'realchange' ); return true; }, - cut: function ( event ) { + 'cut': function( event ) { setTimeout( function() { context.$content.find( 'br' ).each( function() { if ( $(this).parent().is( 'body' ) ) { @@ -125,7 +125,7 @@ context.evt = $.extend( context.evt, { }, 100 ); return true; }, - paste: function ( event ) { + 'paste': function( event ) { // Save the cursor position to restore it after all this voodoo var cursorPos = context.fn.getCaretPosition(); var oldLength = context.fn.getContents().length; @@ -138,7 +138,6 @@ context.evt = $.extend( context.evt, { } setTimeout( function() { - /*jshint eqnull:true */ // Kill stuff we know we don't want context.$content.find( 'script,style,img,input,select,textarea,hr,button,link,meta' ).remove(); var nodeToDelete = []; @@ -153,31 +152,30 @@ context.evt = $.extend( context.evt, { } if ( elementAtCursor == null || elementAtCursor.node == null ) { context.$content.prepend( '

      ' ); - firstDirtyNode = context.$content.children()[0]; + firstDirtyNode = context.$content.children()[0]; } else { firstDirtyNode = elementAtCursor.node; } - // This is ugly but seems like the best way to handle the case where we select and replace all editor contents + //this is ugly but seems like the best way to handle the case where we select and replace all editor contents try { - /*jshint expr:true */ firstDirtyNode.parentNode; } catch ( err ) { context.$content.prepend( '

      ' ); - firstDirtyNode = context.$content.children()[0]; + firstDirtyNode = context.$content.children()[0]; } while ( firstDirtyNode != null ) { //we're going to replace the contents of the entire parent node. - while ( firstDirtyNode.parentNode && firstDirtyNode.parentNode.nodeName !== 'BODY' && - !$( firstDirtyNode ).hasClass( 'wikiEditor' ) - ) { + while ( firstDirtyNode.parentNode && firstDirtyNode.parentNode.nodeName != 'BODY' + && ! $( firstDirtyNode ).hasClass( 'wikiEditor' ) + ) { firstDirtyNode = firstDirtyNode.parentNode; } //go back till we find the first pasted node - while ( firstDirtyNode.previousSibling != null && - !$( firstDirtyNode.previousSibling ).hasClass( 'wikiEditor' ) - ) { + while ( firstDirtyNode.previousSibling != null + && ! $( firstDirtyNode.previousSibling ).hasClass( 'wikiEditor' ) + ) { if ( $( firstDirtyNode.previousSibling ).hasClass( '#comment' ) ) { $( firstDirtyNode ).remove(); @@ -187,9 +185,9 @@ context.evt = $.extend( context.evt, { } if ( firstDirtyNode.previousSibling != null ) { - $lastDirtyNode = $( firstDirtyNode.previousSibling ); + $lastDirtyNode = $( firstDirtyNode.previousSibling ); } else { - $lastDirtyNode = $( firstDirtyNode ); + $lastDirtyNode = $( firstDirtyNode ); } var cc = makeContentCollector( $.browser, null ); @@ -220,7 +218,7 @@ context.evt = $.extend( context.evt, { } - if ( !pastedPretty && $.browser.msie && i === 0 ) { + if( !pastedPretty && $.browser.msie && i == 0 ) { continue; } $newElement = $( '

      ' ); @@ -243,7 +241,7 @@ context.evt = $.extend( context.evt, { //anything without wikiEditor class was pasted. $selection = context.$content.find( ':not(.wikiEditor)' ); - if ( $selection.length === 0 ) { + if ( $selection.length == 0 ) { break; } else { firstDirtyNode = $selection.eq( 0 )[0]; @@ -262,7 +260,7 @@ context.evt = $.extend( context.evt, { }, 0 ); return true; }, - ready: function ( event ) { + 'ready': function( event ) { // Initialize our history queue if ( context.$content ) { context.history.push( { 'html': context.$content.html(), 'sel': context.fn.getCaretPosition() } ); @@ -277,11 +275,7 @@ context.evt = $.extend( context.evt, { * Internally used functions */ context.fn = $.extend( context.fn, { - /** - * @param {jQuery} $element - * @param mode - */ - highlightLine: function ( $element ) { + 'highlightLine': function( $element, mode ) { if ( !$element.is( 'p' ) ) { $element = $element.closest( 'p' ); } @@ -289,7 +283,7 @@ context.fn = $.extend( context.fn, { setTimeout( function() { $element.animate( { 'backgroundColor': 'white' }, 'slow' ); }, 100 ); setTimeout( function() { $element.css( 'backgroundColor', 'white' ); }, 1000 ); }, - htmlToText: function ( html ) { + 'htmlToText': function( html ) { // This function is slow for large inputs, so aggressively cache input/output pairs if ( html in context.htmlToTextMap ) { return context.htmlToTextMap[html]; @@ -300,15 +294,15 @@ context.fn = $.extend( context.fn, { // IE does overzealous whitespace collapsing for $( '
      ' ).html( html );
       		// We also do 
      and easy cases for

      conversion here, complicated cases are handled later html = html - .replace( /\r?\n/g, '' ) // IE7 inserts newlines before block elements - .replace( / /g, ' ' ) // We inserted these to prevent IE from collapsing spaces - .replace( /]*\><\/p\>/gi, '

      ' ) // Remove trailing
      from

      - .replace( /<\/p\>\s*]*\>/gi, '\n' ) // Easy case for

      conversion - .replace( /]*\>/gi, '\n' ) //
      conversion - .replace( /<\/p\>(\n*)]*\>/gi, '$1\n' ) + .replace( /\r?\n/g, "" ) // IE7 inserts newlines before block elements + .replace( / /g, " " ) // We inserted these to prevent IE from collapsing spaces + .replace( /\]*\>\<\/p\>/gi, '

      ' ) // Remove trailing
      from

      + .replace( /\<\/p\>\s*\]*\>/gi, "\n" ) // Easy case for

      conversion + .replace( /\]*\>/gi, "\n" ) //
      conversion + .replace( /\<\/p\>(\n*)\]*\>/gi, "$1\n" ) // Un-nest

      tags - .replace( /]*\>]*\>/gi, '

      ' ) - .replace( /<\/p\><\/p\>/gi, '

      ' ); + .replace( /\]*\>]*\>/gi, '

      ' ) + .replace( /\<\/p\><\/p\>/gi, '

      ' ); // Save leading and trailing whitespace now and restore it later. IE eats it all, and even Firefox // won't leave everything alone var leading = html.match( /^\s*/ )[0]; @@ -317,8 +311,8 @@ context.fn = $.extend( context.fn, { var $pre = $( '
      ' + html + '
      ' ); $pre.find( '.wikiEditor-noinclude' ).each( function() { $( this ).remove(); } ); // Convert tabs,

      s and
      s back - $pre.find( '.wikiEditor-tab' ).each( function() { $( this ).text( '\t' ); } ); - $pre.find( 'br' ).each( function() { $( this ).replaceWith( '\n' ); } ); + $pre.find( '.wikiEditor-tab' ).each( function() { $( this ).text( "\t" ); } ); + $pre.find( 'br' ).each( function() { $( this ).replaceWith( "\n" ); } ); // Converting

      s is wrong if there's nothing before them, so check that. // .find( '* + p' ) isn't good enough because textnodes aren't considered $pre.find( 'p' ).each( function() { @@ -329,21 +323,21 @@ context.fn = $.extend( context.fn, { // Check for preceding text var t = new context.fn.rawTraverser( this.firstChild, this, $pre.get( 0 ), true ).prev(); - while ( t && t.node.nodeName !== '#text' && t.node.nodeName !== 'BR' && t.node.nodeName !== 'P' ) { + while ( t && t.node.nodeName != '#text' && t.node.nodeName != 'BR' && t.node.nodeName != 'P' ) { t = t.prev(); } if ( t ) { - text = '\n' + text; + text = "\n" + text; } // Check for following text t = new context.fn.rawTraverser( this.lastChild, this, $pre.get( 0 ), true ).next(); - while ( t && t.node.nodeName !== '#text' && t.node.nodeName !== 'BR' && t.node.nodeName !== 'P' ) { + while ( t && t.node.nodeName != '#text' && t.node.nodeName != 'BR' && t.node.nodeName != 'P' ) { t = t.next(); } - if ( t && !t.inP && t.node.nodeName === '#text' && t.node.nodeValue.charAt( 0 ) !== '\n' && - t.node.nodeValue.charAt( 0 ) !== '\r' ) { - text += '\n'; + if ( t && !t.inP && t.node.nodeName == '#text' && t.node.nodeValue.charAt( 0 ) != '\n' + && t.node.nodeValue.charAt( 0 ) != '\r' ) { + text += "\n"; } $( this ).text( text ); } ); @@ -363,8 +357,8 @@ context.fn = $.extend( context.fn, { * @param strict If true, the element the selection starts in cannot match (default: false) * @return jQuery object or null if unknown */ - beforeSelection: function ( classname, strict ) { - if ( typeof classname === 'undefined' ) { + 'beforeSelection': function( classname, strict ) { + if ( typeof classname == 'undefined' ) { classname = ''; } var e = null, offset = null; @@ -387,7 +381,7 @@ context.fn = $.extend( context.fn, { // When the cursor is on an empty line, Opera gives us a bogus range object with // startContainer=endContainer=body and startOffset=endOffset=1 var body = context.$iframe[0].contentWindow.document.body; - if ( $.browser.opera && e === body && offset === 1 ) { + if ( $.browser.opera && e == body && offset == 1 ) { return null; } } @@ -406,14 +400,14 @@ context.fn = $.extend( context.fn, { return null; } var seekPos = context.fn.htmlToText( range2.htmlText ).length; - offset = context.fn.getOffset( seekPos ); + var offset = context.fn.getOffset( seekPos ); e = offset ? offset.node : null; offset = offset ? offset.offset : null; if ( !e ) { return null; } } - if ( e.nodeName !== '#text' ) { + if ( e.nodeName != '#text' ) { // The selection is not in a textnode, but between two non-text nodes // (usually inside the between two
      s). Go to the rightmost // child of the node just before the selection @@ -431,7 +425,7 @@ context.fn = $.extend( context.fn, { // constructor thousands of times is very inefficient var classStr = ' ' + classname + ' '; while ( e ) { - if ( !strict && ( !classname || ( ' ' + e.className + ' ' ).indexOf( classStr ) !== -1 ) ) { + if ( !strict && ( !classname || ( ' ' + e.className + ' ' ).indexOf( classStr ) != -1 ) ) { return $( e ); } var next = e.previousSibling; @@ -446,7 +440,7 @@ context.fn = $.extend( context.fn, { /** * Object used by traverser(). Don't use this unless you know what you're doing */ - rawTraverser: function ( node, inP, ancestor, skipNoinclude ) { + 'rawTraverser': function( node, inP, ancestor, skipNoinclude ) { this.node = node; this.inP = inP; this.ancestor = ancestor; @@ -456,16 +450,16 @@ context.fn = $.extend( context.fn, { var nextInP = this.inP; while ( p && !p.nextSibling ) { p = p.parentNode; - if ( p === this.ancestor ) { + if ( p == this.ancestor ) { // We're back at the ancestor, stop here p = null; } - if ( p && p.nodeName === 'P' ) { + if ( p && p.nodeName == "P" ) { nextInP = null; } } p = p ? p.nextSibling : null; - if ( p && p.nodeName === 'P' ) { + if ( p && p.nodeName == "P" ) { nextInP = p; } do { @@ -473,13 +467,13 @@ context.fn = $.extend( context.fn, { // Don't use $( p ).hasClass( 'wikiEditor-noinclude' ) because // $() is slow in a tight loop if ( this.skipNoinclude ) { - while ( p && ( ' ' + p.className + ' ' ).indexOf( ' wikiEditor-noinclude ' ) !== -1 ) { + while ( p && ( ' ' + p.className + ' ' ).indexOf( ' wikiEditor-noinclude ' ) != -1 ) { p = p.nextSibling; } } if ( p && p.firstChild ) { p = p.firstChild; - if ( p.nodeName === 'P' ) { + if ( p.nodeName == "P" ) { nextInP = p; } } @@ -493,16 +487,16 @@ context.fn = $.extend( context.fn, { var prevInP = this.inP; while ( p && !p.previousSibling ) { p = p.parentNode; - if ( p === this.ancestor ) { + if ( p == this.ancestor ) { // We're back at the ancestor, stop here p = null; } - if ( p && p.nodeName === 'P' ) { + if ( p && p.nodeName == "P" ) { prevInP = null; } } p = p ? p.previousSibling : null; - if ( p && p.nodeName === 'P' ) { + if ( p && p.nodeName == "P" ) { prevInP = p; } do { @@ -516,7 +510,7 @@ context.fn = $.extend( context.fn, { } if ( p && p.lastChild ) { p = p.lastChild; - if ( p.nodeName == 'P' ) { + if ( p.nodeName == "P" ) { prevInP = p; } } @@ -534,28 +528,28 @@ context.fn = $.extend( context.fn, { * @return Traverser object, use .next() or .prev() to get a traverser object referring to the * previous/next node */ - traverser: function ( start ) { + 'traverser': function( start ) { // Find the leftmost leaf node in the tree var startNode = start.jquery ? start.get( 0 ) : start; var node = startNode; - var inP = node.nodeName === 'P' ? node : null; + var inP = node.nodeName == "P" ? node : null; do { // Filter nodes with the wikiEditor-noinclude class // Don't use $( p ).hasClass( 'wikiEditor-noinclude' ) because // $() is slow in a tight loop - while ( node && ( ' ' + node.className + ' ' ).indexOf( ' wikiEditor-noinclude ' ) !== -1 ) { + while ( node && ( ' ' + node.className + ' ' ).indexOf( ' wikiEditor-noinclude ' ) != -1 ) { node = node.nextSibling; } if ( node && node.firstChild ) { node = node.firstChild; - if ( node.nodeName === 'P' ) { + if ( node.nodeName == "P" ) { inP = node; } } } while ( node && node.firstChild ); return new context.fn.rawTraverser( node, inP, startNode, true ); }, - getOffset: function ( offset ) { + 'getOffset': function( offset ) { if ( !context.offsets ) { context.fn.refreshOffsets(); } @@ -584,21 +578,21 @@ context.fn = $.extend( context.fn, { 'lastTextNode': base.lastTextNode }; }, - purgeOffsets: function () { + 'purgeOffsets': function() { context.offsets = null; }, - refreshOffsets: function () { + 'refreshOffsets': function() { context.offsets = [ ]; var t = context.fn.traverser( context.$content ); var pos = 0, lastTextNode = null; while ( t ) { - if ( t.node.nodeName !== '#text' && t.node.nodeName !== 'BR' ) { + if ( t.node.nodeName != '#text' && t.node.nodeName != 'BR' ) { t = t.next(); continue; } - var nextPos = t.node.nodeName === '#text' ? pos + t.node.nodeValue.length : pos + 1; + var nextPos = t.node.nodeName == '#text' ? pos + t.node.nodeValue.length : pos + 1; var nextT = t.next(); - var leavingP = t.node.nodeName === '#text' && t.inP && nextT && ( !nextT.inP || nextT.inP !== t.inP ); + var leavingP = t.node.nodeName == '#text' && t.inP && nextT && ( !nextT.inP || nextT.inP != t.inP ); context.offsets[pos] = { 'node': t.node, 'offset': 0, @@ -616,27 +610,27 @@ context.fn = $.extend( context.fn, { }; } pos = nextPos + ( leavingP ? 1 : 0 ); - if ( t.node.nodeName === '#text' ) { + if ( t.node.nodeName == '#text' ) { lastTextNode = t.node; } t = nextT; } }, - saveCursorAndScrollTop: function () { + 'saveCursorAndScrollTop': function() { // Stub out textarea behavior return; }, - restoreCursorAndScrollTop: function () { + 'restoreCursorAndScrollTop': function() { // Stub out textarea behavior return; }, - saveSelection: function () { + 'saveSelection': function() { if ( $.client.profile().name === 'msie' ) { context.$iframe[0].contentWindow.focus(); context.savedSelection = context.$iframe[0].contentWindow.document.selection.createRange(); } }, - restoreSelection: function () { + 'restoreSelection': function() { if ( $.client.profile().name === 'msie' && context.savedSelection !== null ) { context.$iframe[0].contentWindow.focus(); context.savedSelection.select(); @@ -646,10 +640,10 @@ context.fn = $.extend( context.fn, { /** * Update the history queue * - * @param htmlChange Pass true or false to inidicate if there was a text change that should potentially + * @param htmlChange pass true or false to inidicate if there was a text change that should potentially * be given a new history state. */ - updateHistory: function ( htmlChange ) { + 'updateHistory': function( htmlChange ) { var newHTML = context.$content.html(); var newSel = context.fn.getCaretPosition(); // Was text changed? Was it because of a REDO or UNDO action? @@ -681,7 +675,7 @@ context.fn = $.extend( context.fn, { /** * Sets up the iframe in place of the textarea to allow more advanced operations */ - setupIframe: function () { + 'setupIframe': function() { context.$iframe = $( '' ) .attr( { 'frameBorder': 0, @@ -840,7 +834,7 @@ context.fn = $.extend( context.fn, { * equivilant functionality to the otherwise textarea-based functionality. */ - getElementAtCursor: function () { + 'getElementAtCursor': function() { if ( context.$iframe[0].contentWindow.getSelection ) { // Firefox and Opera var selection = context.$iframe[0].contentWindow.getSelection(); @@ -861,7 +855,7 @@ context.fn = $.extend( context.fn, { /** * Gets the complete contents of the iframe (in plain text, not HTML) */ - getContents: function () { + 'getContents': function() { // For

      , .html() returns

       

      in IE // This seems to convince IE while not affecting display if ( !context.$content ) { @@ -886,7 +880,7 @@ context.fn = $.extend( context.fn, { * Gets the currently selected text in the content * DO NOT CALL THIS DIRECTLY, use $.textSelection( 'functionname', options ) instead */ - getSelection: function () { + 'getSelection': function() { var retval; if ( context.$iframe[0].contentWindow.getSelection ) { // Firefox and Opera @@ -921,7 +915,7 @@ context.fn = $.extend( context.fn, { * selection is empty. * DO NOT CALL THIS DIRECTLY, use $.textSelection( 'functionname', options ) instead */ - encapsulateSelection: function ( options ) { + 'encapsulateSelection': function( options ) { var selText = $(this).textSelection( 'getSelection' ); var selTextArr; var collapseToEnd = false; @@ -1133,7 +1127,7 @@ context.fn = $.extend( context.fn, { * Gets the position (in resolution of bytes not nessecarily characters) in a textarea * DO NOT CALL THIS DIRECTLY, use $.textSelection( 'functionname', options ) instead */ - getCaretPosition: function ( options ) { + 'getCaretPosition': function( options ) { var startPos = null, endPos = null; if ( context.$iframe[0].contentWindow.getSelection ) { var selection = context.$iframe[0].contentWindow.getSelection(); @@ -1270,7 +1264,7 @@ context.fn = $.extend( context.fn, { * @param startContainer Element in iframe to start selection in. If not set, start is a character offset * @param endContainer Element in iframe to end selection in. If not set, end is a character offset */ - setSelection: function ( options ) { + 'setSelection': function( options ) { var sc = options.startContainer, ec = options.endContainer; sc = sc && sc.jquery ? sc[0] : sc; ec = ec && ec.jquery ? ec[0] : ec; @@ -1357,7 +1351,7 @@ context.fn = $.extend( context.fn, { * Scroll a textarea to the current cursor position. You can set the cursor position with setSelection() * DO NOT CALL THIS DIRECTLY, use $.textSelection( 'functionname', options ) instead */ - scrollToCaretPosition: function ( options ) { + 'scrollToCaretPosition': function( options ) { context.fn.scrollToTop( context.fn.getElementAtCursor(), true ); }, /** @@ -1367,7 +1361,7 @@ context.fn = $.extend( context.fn, { * @param $element jQuery object containing an element in the iframe * @param force If true, scroll the element even if it's already visible */ - scrollToTop: function ( $element, force ) { + 'scrollToTop': function( $element, force ) { var html = context.$content.closest( 'html' ), body = context.$content.closest( 'body' ), parentHtml = $( 'html' ), diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.js b/extensions/WikiEditor/modules/jquery.wikiEditor.js index 85030b66..def8b69e 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.js @@ -8,8 +8,7 @@ * $( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'toolbar', { ... config ... } ); * */ -/*jshint onevar:false, boss:true */ -( function ( $, mw ) { +( function ( $ ) { /** * Global static object for wikiEditor that provides generally useful functionality to all modules and contexts. @@ -114,7 +113,7 @@ $.wikiEditor = { isRequired: function ( module, requirement ) { if ( typeof module.req !== 'undefined' ) { for ( var req in module.req ) { - if ( module.req[req] === requirement ) { + if ( module.req[req] == requirement ) { return true; } } @@ -133,10 +132,9 @@ $.wikiEditor = { * with the key 'bar'. */ autoMsg: function ( object, property ) { - var i, p; // Accept array of possible properties, of which the first one found will be used - if ( typeof property === 'object' ) { - for ( i in property ) { + if ( typeof property == 'object' ) { + for ( var i in property ) { if ( property[i] in object || property[i] + 'Msg' in object ) { property = property[i]; break; @@ -146,11 +144,11 @@ $.wikiEditor = { if ( property in object ) { return object[property]; } else if ( property + 'Msg' in object ) { - p = object[property + 'Msg']; + var p = object[property + 'Msg']; if ( $.isArray( p ) && p.length >= 2 ) { - return mw.message.apply( mw.message, p ).plain(); + return mediaWiki.message.apply( mediaWiki.message, p ).plain(); } else { - return mw.message( p ).plain(); + return mediaWiki.message( p ).plain(); } } else { return ''; @@ -183,10 +181,10 @@ $.wikiEditor = { var src = $.wikiEditor.autoLang( icon, lang ); path = path || $.wikiEditor.imgPath; // Prepend path if src is not absolute - if ( src.substr( 0, 7 ) !== 'http://' && src.substr( 0, 8 ) !== 'https://' && src[0] !== '/' ) { + if ( src.substr( 0, 7 ) != 'http://' && src.substr( 0, 8 ) != 'https://' && src[0] != '/' ) { src = path + src; } - return src + '?' + mw.loader.getVersion( 'jquery.wikiEditor' ); + return src + '?' + mw.loader.version( 'jquery.wikiEditor' ); }, /** @@ -199,9 +197,9 @@ $.wikiEditor = { */ autoIconOrOffset: function ( icon, offset, path, lang ) { lang = lang || mw.config.get( 'wgUserLanguage' ); - if ( typeof offset === 'object' && lang in offset ) { + if ( typeof offset == 'object' && lang in offset ) { return offset[lang]; - } else if ( typeof icon === 'object' && lang in icon ) { + } else if ( typeof icon == 'object' && lang in icon ) { return $.wikiEditor.autoIcon( icon, undefined, lang ); } else { return $.wikiEditor.autoLang( offset, lang ); @@ -225,7 +223,7 @@ if ( !$.wikiEditor.isSupported() ) { // where we left off var context = $(this).data( 'wikiEditor-context' ); // On first call, we need to set things up, but on all following calls we can skip right to the API handling -if ( !context || typeof context === 'undefined' ) { +if ( !context || typeof context == 'undefined' ) { // Star filling the context with useful data - any jQuery selections, as usual should be named with a preceding $ context = { @@ -249,7 +247,7 @@ if ( !context || typeof context === 'undefined' ) { 'oldDelayedHTML': null, // The previous selection of the iframe, stored to detect whether the selection has changed 'oldDelayedSel': null, - // Saved selection state for old IE (<=10) + // Saved selection state for IE 'savedSelection': null, // Stack of states in { html: [string] } form 'history': [], @@ -278,14 +276,14 @@ if ( !context || typeof context === 'undefined' ) { 'addModule': function ( context, data ) { var module, call, modules = {}; - if ( typeof data === 'string' ) { + if ( typeof data == 'string' ) { modules[data] = {}; - } else if ( typeof data === 'object' ) { + } else if ( typeof data == 'object' ) { modules = data; } for ( module in modules ) { // Check for the existance of an available / supported module with a matching name and a create function - if ( typeof module === 'string' && typeof $.wikiEditor.modules[module] !== 'undefined' && + if ( typeof module == 'string' && typeof $.wikiEditor.modules[module] !== 'undefined' && $.wikiEditor.isSupported( $.wikiEditor.modules[module] ) ) { // Extend the context's core API with this module's own API calls @@ -328,11 +326,11 @@ if ( !context || typeof context === 'undefined' ) { */ trigger: function ( name, event ) { // Event is an optional argument, but from here on out, at least the type field should be dependable - if ( typeof event === 'undefined' ) { + if ( typeof event == 'undefined' ) { event = { 'type': 'custom' }; } // Ensure there's a place for extra information to live - if ( typeof event.data === 'undefined' ) { + if ( typeof event.data == 'undefined' ) { event.data = {}; } @@ -395,7 +393,7 @@ if ( !context || typeof context === 'undefined' ) { // Return the newly appended tab return $( '
      ' ) .attr( 'rel', 'wikiEditor-ui-view-' + options.name ) - .addClass( context.view === options.name ? 'current' : null ) + .addClass( context.view == options.name ? 'current' : null ) .append( $( '' ) .attr( 'href', '#' ) .mousedown( function () { @@ -408,7 +406,7 @@ if ( !context || typeof context === 'undefined' ) { context.$tabs.find( 'div' ).removeClass( 'current' ); $(this).parent().addClass( 'current' ); $(this).blur(); - if ( 'init' in options && typeof options.init === 'function' ) { + if ( 'init' in options && typeof options.init == 'function' ) { options.init( context ); } event.preventDefault(); @@ -459,17 +457,17 @@ if ( !context || typeof context === 'undefined' ) { }, /** - * Save text selection for old IE (<=10) + * Save text selection for IE */ saveSelection: function () { - if ( $.client.profile().name === 'msie' && document.selection && document.selection.createRange ) { + if ( $.client.profile().name === 'msie' ) { context.$textarea.focus(); context.savedSelection = document.selection.createRange(); } }, /** - * Restore text selection for old IE (<=10) + * Restore text selection for IE */ restoreSelection: function () { if ( $.client.profile().name === 'msie' && context.savedSelection !== null ) { @@ -480,13 +478,6 @@ if ( !context || typeof context === 'undefined' ) { } }; - /** - * Workaround for a scrolling bug in IE8 (bug 61908) - */ - if ( $.client.profile().name === 'msie' ) { - context.$textarea.css( 'height', context.$textarea.height() ); - } - /** * Base UI Construction * @@ -548,9 +539,9 @@ if ( !context || typeof context === 'undefined' ) { var args = $.makeArray( arguments ); // Dynamically setup core extensions for modules that are required -if ( args[0] === 'addModule' && typeof args[1] !== 'undefined' ) { +if ( args[0] == 'addModule' && typeof args[1] !== 'undefined' ) { var modules = args[1]; - if ( typeof modules !== 'object' ) { + if ( typeof modules !== "object" ) { modules = {}; modules[args[1]] = ''; } @@ -586,4 +577,4 @@ return $(this).data( 'wikiEditor-context', context ); }; -}( jQuery, mediaWiki ) ); +}( jQuery ) ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.preview.js b/extensions/WikiEditor/modules/jquery.wikiEditor.preview.js index 372d2e8e..39907364 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.preview.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.preview.js @@ -1,6 +1,6 @@ /* Preview module for wikiEditor */ ( function ( $, mw ) { -/*jshint onevar:false */ + $.wikiEditor.modules.preview = { /** @@ -32,7 +32,7 @@ fn: { * @param context Context object of editor to create module in * @param config Configuration object to create module from */ - create: function ( context ) { + create: function ( context, config ) { if ( 'initialized' in context.modules.preview ) { return; } @@ -65,9 +65,9 @@ fn: { }, function ( data ) { if ( - typeof data.parse === 'undefined' || - typeof data.parse.text === 'undefined' || - typeof data.parse.text['*'] === 'undefined' + typeof data.parse == 'undefined' || + typeof data.parse.text == 'undefined' || + typeof data.parse.text['*'] == 'undefined' ) { return; } @@ -89,7 +89,7 @@ fn: { // Gets the latest copy of the wikitext var wikitext = context.$textarea.textSelection( 'getContents' ); // Aborts when nothing has changed since the last time - if ( context.modules.preview.changesText === wikitext ) { + if ( context.modules.preview.changesText == wikitext ) { return; } context.$changesTab.find( 'table.diff tbody' ).empty(); @@ -115,9 +115,8 @@ fn: { rvprop: '' }; var section = $( '[name="wpSection"]' ).val(); - if ( section !== '' ) { + if ( section !== '' ) postdata2.rvsection = section; - } $.post( mw.util.wikiScript( 'api' ), postdata2, function ( data ) { // Add diff CSS diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js b/extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js index 5381e605..ca88c79a 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.previewDialog.js @@ -1,6 +1,5 @@ /* Publish module for wikiEditor */ -/*jshint onevar:false */ -( function ( $, mw ) { $.wikiEditor.modules.previewDialog = { +( function( $ ) { $.wikiEditor.modules.previewDialog = { /** * Compatability map @@ -30,7 +29,7 @@ fn: { * @param context Context object of editor to create module in * @param config Configuration object to create module from */ - create: function( context ) { + create: function( context, config ) { // Build the dialog behind the Publish button var dialogID = 'wikiEditor-' + context.instance + '-preview-dialog'; $.wikiEditor.modules.dialogs.fn.create( @@ -79,7 +78,7 @@ fn: { .css( 'top', '25px' ); // $dialog.dialog( 'option', 'width', $( 'body' ).width() - 300 ); // Aborts when nothing has changed since the last preview - if ( context.modules.preview.previewText === wikitext ) { + if ( context.modules.preview.previewText == wikitext ) { return; } @@ -97,9 +96,9 @@ fn: { }, function( data ) { if ( - typeof data.parse === 'undefined' || - typeof data.parse.text === 'undefined' || - typeof data.parse.text['*'] === 'undefined' + typeof data.parse == 'undefined' || + typeof data.parse.text == 'undefined' || + typeof data.parse.text['*'] == 'undefined' ) { return; } @@ -129,4 +128,4 @@ fn: { } } -}; } )( jQuery, mediaWiki ); +}; } )( jQuery ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js b/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js index 058fa1b3..b61140dc 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.publish.js @@ -1,5 +1,4 @@ /* Publish module for wikiEditor */ -/*jshint onevar:false */ ( function ( $ ) { $.wikiEditor.modules.publish = { @@ -32,7 +31,7 @@ fn: { * @param context Context object of editor to create module in * @param config Configuration object to create module from */ - create: function ( context ) { + create: function ( context, config ) { // Build the dialog behind the Publish button var dialogID = 'wikiEditor-' + context.instance + '-dialog'; $.wikiEditor.modules.dialogs.fn.create( @@ -90,18 +89,16 @@ fn: { ); /* END OF REALLY DIRTY HACK */ - if ( $( '#wpMinoredit' ).length === 0 ) { + if ( $( '#wpMinoredit' ).length === 0 ) $( '#wikiEditor-' + context.instance + '-dialog-minor' ).hide(); - } else if ( $( '#wpMinoredit' ).prop( 'checked' ) ) { + else if ( $( '#wpMinoredit' ).is( ':checked' ) ) $( '#wikiEditor-' + context.instance + '-dialog-minor' ) .prop( 'checked', true ); - } - if ( $( '#wpWatchthis' ).length === 0 ) { + if ( $( '#wpWatchthis' ).length === 0 ) $( '#wikiEditor-' + context.instance + '-dialog-watch' ).hide(); - } else if ( $( '#wpWatchthis' ).prop( 'checked' ) ) { + else if ( $( '#wpWatchthis' ).is( ':checked' ) ) $( '#wikiEditor-' + context.instance + '-dialog-watch' ) .prop( 'checked', true ); - } $(this).find( 'form' ).submit( function ( e ) { $(this).closest( '.ui-dialog' ).find( 'button:first' ).click(); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.templateEditor.js b/extensions/WikiEditor/modules/jquery.wikiEditor.templateEditor.js index 3cbd5ba5..bd00325f 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.templateEditor.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.templateEditor.js @@ -1,6 +1,5 @@ /* TemplateEditor module for wikiEditor */ -/*jshint quotmark:false, onevar:false */ -( function ( $ ) { $.wikiEditor.modules.templateEditor = { +( function( $ ) { $.wikiEditor.modules.templateEditor = { /** * Name mappings, dirty hack which will be removed once "TemplateInfo" extension is more fully supported */ @@ -38,13 +37,9 @@ */ evt: { - /** - * @param context - * @param event - */ - mark: function( context ) { + mark: function( context, event ) { // The markers returned by this function are skipped on realchange, so don't regenerate them in that case - if ( context.modules.highlight.currentScope === 'realchange' ) { + if ( context.modules.highlight.currentScope == 'realchange' ) { return; } @@ -52,9 +47,10 @@ evt: { var markers = context.modules.highlight.markers; var tokenArray = context.modules.highlight.tokenArray; // Collect matching level 0 template call boundaries from the tokenArray + var level = 0; var tokenIndex = 0; while ( tokenIndex < tokenArray.length ){ - while ( tokenIndex < tokenArray.length && tokenArray[tokenIndex].label !== 'TEMPLATE_BEGIN' ) { + while ( tokenIndex < tokenArray.length && tokenArray[tokenIndex].label != 'TEMPLATE_BEGIN' ) { tokenIndex++; } //open template @@ -62,18 +58,19 @@ evt: { var beginIndex = tokenIndex; var endIndex = -1; //no match found var openTemplates = 1; - while ( tokenIndex < tokenArray.length - 1 && endIndex === -1 ) { + var templatesMatched = false; + while ( tokenIndex < tokenArray.length - 1 && endIndex == -1 ) { tokenIndex++; - if ( tokenArray[tokenIndex].label === 'TEMPLATE_BEGIN' ) { + if ( tokenArray[tokenIndex].label == 'TEMPLATE_BEGIN' ) { openTemplates++; - } else if ( tokenArray[tokenIndex].label === 'TEMPLATE_END' ) { + } else if ( tokenArray[tokenIndex].label == 'TEMPLATE_END' ) { openTemplates--; - if ( openTemplates === 0 ) { + if ( openTemplates == 0 ) { endIndex = tokenIndex; } //we can stop looping } }//while finding template ending - if ( endIndex !== -1 ) { + if ( endIndex != -1 ) { markers.push( { start: tokenArray[beginIndex].offset, end: tokenArray[endIndex].offset, @@ -95,7 +92,7 @@ evt: { } }, onSkip: function( node ) { - if ( $( node ).html() === $( node ).data( 'oldHTML' ) ) { + if ( $( node ).html() == $( node ).data( 'oldHTML' ) ) { // No change return; } @@ -107,7 +104,7 @@ evt: { if ( $( node ).parent().hasClass( 'wikiEditor-template' ) ) { var $label = $( node ).parent().find( '.wikiEditor-template-label' ); var displayName = $.wikiEditor.modules.templateEditor.fn.getTemplateDisplayName( model ); - if ( $label.text() !== displayName ) { + if ( $label.text() != displayName ) { $label.text( displayName ); } } @@ -122,7 +119,7 @@ evt: { $.wikiEditor.modules.templateEditor.fn.bindTemplateEvents( $( node ) ); } }, - getAnchor: function( ca1 ) { + getAnchor: function( ca1, ca2 ) { return $( ca1.parentNode ).is( 'span.wikiEditor-template-text' ) ? ca1.parentNode : null; }, @@ -145,9 +142,7 @@ evt: { var $evtElem = event.jQueryNode; if ( $evtElem.hasClass( 'wikiEditor-template-label' ) ) { // Allow anything if the command or control key are depressed - if ( event.ctrlKey || event.metaKey ) { - return true; - } + if ( event.ctrlKey || event.metaKey ) return true; switch ( event.which ) { case 13: // Enter $evtElem.click(); @@ -182,22 +177,14 @@ evt: { } } }, - /** - * @param context - * @param event - */ - keyup: function( context ) { + keyup: function( context, event ) { // Rest our ignoreKeypress variable if it's set to true if ( context.$iframe.data( 'ignoreKeypress' ) ) { context.$iframe.data( 'ignoreKeypress', false ); } return true; }, - /** - * @param context - * @param event - */ - keypress: function( context ) { + keypress: function( context, event ) { // If this event is from a keydown event which we want to block, ignore it return ( context.$iframe.data( 'ignoreKeypress' ) ? false : true ); } @@ -223,7 +210,7 @@ fn: { * @param context Context object of editor to create module in * @param config Configuration object to create module from */ - create: function( context ) { + create: function( context, config ) { // Initialize module within the context context.modules.templateEditor = {}; }, @@ -233,7 +220,8 @@ fn: { */ wrapTemplate: function( $wrapper ) { var model = $wrapper.data( 'model' ); - $wrapper + var context = $wrapper.data( 'marker' ).context; + var $template = $wrapper .wrap( '' ) .addClass( 'wikiEditor-template-text wikiEditor-template-text-shrunken' ) .parent() @@ -261,7 +249,7 @@ fn: { bindTemplateEvents: function( $wrapper ) { var $template = $wrapper.parent( '.wikiEditor-template' ); - if ( typeof opera === 'undefined' ) { + if ( typeof ( opera ) == "undefined" ) { $template.parent().attr('contentEditable', 'false'); } @@ -286,7 +274,7 @@ fn: { * Toggle the visisbilty of the wikitext for a given template * @param $wrapper The origianl wrapper we want expand/collapse */ - toggleWikiTextEditor: function( $wrapper ) { + toggleWikiTextEditor: function( $wrapper ) { var context = $wrapper.data( 'marker' ).context; var $template = $wrapper.parent( '.wikiEditor-template' ); context.fn.purgeOffsets(); @@ -297,11 +285,11 @@ fn: { var $templateText = $template.find( '.wikiEditor-template-text' ); $templateText.toggleClass( 'wikiEditor-template-text-shrunken' ); $templateText.toggleClass( 'wikiEditor-template-text-visible' ); - if ( $templateText.hasClass('wikiEditor-template-text-shrunken') ){ + if( $templateText.hasClass('wikiEditor-template-text-shrunken') ){ //we just closed the template // Update the model if we need to - if ( $templateText.html() !== $templateText.data( 'oldHTML' ) ) { + if ( $templateText.html() != $templateText.data( 'oldHTML' ) ) { var templateModel = $.wikiEditor.modules.templateEditor.fn.updateModel( $templateText ); //this is the only place the template name can be changed; keep the template name in sync @@ -362,7 +350,7 @@ fn: { var $templateText = $templateDiv.children( '.wikiEditor-template-text' ); var templateModel = $templateText.data( 'model' ); // Update the model if we need to - if ( $templateText.html() !== $templateText.data( 'oldHTML' ) ) { + if ( $templateText.html() != $templateText.data( 'oldHTML' ) ) { templateModel = $.wikiEditor.modules.templateEditor.fn.updateModel( $templateText ); } @@ -374,11 +362,11 @@ fn: { var $rows = $fields.find( '.wikiEditor-template-dialog-field-wrapper' ); for ( var paramIndex in params ) { var param = params[paramIndex]; - if ( typeof param.name === 'undefined' ) { + if ( typeof param.name == 'undefined' ) { // param is the template name, skip it continue; } - var paramText = typeof param === 'string' ? + var paramText = typeof param == 'string' ? param.name.replace( /[\_\-]/g, ' ' ) : param.name; var paramVal = templateModel.getValue( param.name ); @@ -409,13 +397,11 @@ fn: { .data( 'expanded', false ) .bind( 'cut paste keypress click change', function( e ) { // If this was fired by a tab keypress, let it go - if ( e.keyCode === 9 || e.keyCode === '9' ) { - return true; - } + if ( e.keyCode == '9' ) return true; var $this = $( this ); setTimeout( function() { var expanded = $this.data( 'expanded' ); - if ( $this.val().indexOf( '\n' ) !== -1 || $this.val().length > 24 ) { + if ( $this.val().indexOf( '\n' ) != -1 || $this.val().length > 24 ) { if ( !expanded ) { $this.animate( { 'height': '4.5em' }, 'fast' ); $this.data( 'expanded', true ); @@ -469,7 +455,7 @@ fn: { updateModel: function( $templateText, model ) { var context = $templateText.data( 'marker' ).context; var text; - if ( typeof model === 'undefined' ) { + if ( typeof model == 'undefined' ) { text = context.fn.htmlToText( $templateText.html() ); } else { text = model.getText(); @@ -478,7 +464,7 @@ fn: { $templateText.text( text ); $templateText.html( $templateText.html().replace( /\n/g, '
      ' ) ); $templateText.data( 'oldHTML', $templateText.html() ); - if ( typeof model === 'undefined' ) { + if ( typeof model == 'undefined' ) { model = new $.wikiEditor.modules.templateEditor.fn.model( text ); $templateText.data( 'model', model ); } @@ -490,9 +476,9 @@ fn: { */ getTemplateDisplayName: function ( model ) { var tName = model.getName(); - if( model.getValue( 'name' ) !== '' ) { + if( model.getValue( 'name' ) != '' ) { return tName + ': ' + model.getValue( 'name' ); - } else if( model.getValue( 'Name' ) !== '' ) { + } else if( model.getValue( 'Name' ) != '' ) { return tName + ': ' + model.getValue( 'Name' ); } else if( tName.toLowerCase() in $.wikiEditor.modules.templateEditor.nameMappings ) { return tName + ': ' + model.getValue( $.wikiEditor.modules.templateEditor.nameMappings[tName.toLowerCase()] ); @@ -555,28 +541,27 @@ fn: { var retVal; if ( isNaN( name ) ) { // It's a string! - if ( typeof paramsByName[name] === 'undefined' ) { + if ( typeof paramsByName[name] == 'undefined' ) { // Does not exist - return ''; + return ""; } rangeIndex = paramsByName[name]; } else { // It's a number! - rangeIndex = parseInt( name, 10 ); + rangeIndex = parseInt( name ); } - if ( typeof params[rangeIndex] === 'undefined' ) { + if ( typeof params[rangeIndex] == 'undefined' ) { // Does not exist - return ''; + return ""; } valueRange = ranges[params[rangeIndex].valueIndex]; - if ( typeof valueRange.newVal === 'undefined' || original ) { + if ( typeof valueRange.newVal == 'undefined' || original ) { // Value unchanged, return original wikitext retVal = wikitext.substring( valueRange.begin, valueRange.end ); } else { // New value exists, return new value retVal = valueRange.newVal; } - /*jshint eqnull:true */ if ( value != null ) { ranges[params[rangeIndex].valueIndex].newVal = value; } @@ -589,7 +574,7 @@ fn: { * Get template name */ this.getName = function() { - if( typeof ranges[templateNameIndex].newVal === 'undefined' ) { + if( typeof ranges[templateNameIndex].newVal == 'undefined' ) { return wikitext.substring( ranges[templateNameIndex].begin, ranges[templateNameIndex].end ); } else { return ranges[templateNameIndex].newVal; @@ -650,9 +635,9 @@ fn: { * Get modified template text */ this.getText = function() { - var newText = ""; - for ( var i = 0 ; i < ranges.length; i++ ) { - if( typeof ranges[i].newVal === 'undefined' ) { + newText = ""; + for ( i = 0 ; i < ranges.length; i++ ) { + if( typeof ranges[i].newVal == 'undefined' ) { newText += wikitext.substring( ranges[i].begin, ranges[i].end ); } else { newText += ranges[i].newVal; @@ -674,7 +659,7 @@ fn: { var adjustment = 0; for (var i = 0 ; i < ranges.length; i++ ) { ranges[i].begin += adjustment; - if ( typeof ranges[i].adjust !== 'undefined' ) { + if( typeof ranges[i].adjust != 'undefined' ) { adjustment += ranges[i].adjust(); // NOTE: adjust should be a function that has the information necessary to calculate the length of // this 'segment' @@ -695,16 +680,15 @@ fn: { // Get rid of first {{ with whitespace var sanatizedStr = wikitext.replace( /{{/, " " ); // Replace end - var endBraces = sanatizedStr.match( /}}\s*$/ ); + endBraces = sanatizedStr.match( /}}\s*$/ ); if ( endBraces ) { sanatizedStr = sanatizedStr.substring( 0, endBraces.index ) + " " + sanatizedStr.substring( endBraces.index + 2 ); } - var startIndex, endIndex, sanatizedSegment, openBraces, brace; //treat HTML comments like whitespace - while ( sanatizedStr.indexOf( '') + 3; if( endIndex < 3 ){ @@ -716,26 +700,26 @@ fn: { } // Match the open braces we just found with equivalent closing braces note, works for any level of braces - while ( sanatizedStr.indexOf( '{{' ) !== -1 ) { + while ( sanatizedStr.indexOf( '{{' ) != -1 ) { startIndex = sanatizedStr.indexOf( '{{' ) + 1; openBraces = 2; endIndex = startIndex; while ( (openBraces > 0) && (endIndex < sanatizedStr.length) ) { - brace = sanatizedStr[++endIndex]; - openBraces += brace === '}' ? -1 : brace === '{' ? 1 : 0; + var brace = sanatizedStr[++endIndex]; + openBraces += brace == '}' ? -1 : brace == '{' ? 1 : 0; } sanatizedSegment = sanatizedStr.substring( startIndex,endIndex ).replace( /[{}|=]/g , 'X' ); sanatizedStr = sanatizedStr.substring( 0, startIndex ) + sanatizedSegment + sanatizedStr.substring( endIndex ); } //links, images, etc, which also can nest - while ( sanatizedStr.indexOf( '[[' ) !== -1 ) { + while ( sanatizedStr.indexOf( '[[' ) != -1 ) { startIndex = sanatizedStr.indexOf( '[[' ) + 1; openBraces = 2; endIndex = startIndex; while ( (openBraces > 0) && (endIndex < sanatizedStr.length) ) { - brace = sanatizedStr[++endIndex]; - openBraces += brace === ']' ? -1 : brace === '[' ? 1 : 0; + var brace = sanatizedStr[++endIndex]; + openBraces += brace == ']' ? -1 : brace == '[' ? 1 : 0; } sanatizedSegment = sanatizedStr.substring( startIndex,endIndex ).replace( /[\[\]|=]/g , 'X' ); sanatizedStr = @@ -749,16 +733,14 @@ fn: { var params = []; var templateNameIndex = 0; var doneParsing = false; - var oldDivider = 0; - var divider = sanatizedStr.indexOf( '|', oldDivider ); - if ( divider === -1 ) { + oldDivider = 0; + divider = sanatizedStr.indexOf( '|', oldDivider ); + if ( divider == -1 ) { divider = sanatizedStr.length; doneParsing = true; collapsible = false; //zero params } - var nameMatch = sanatizedStr.substring( 0, divider ).match( /[^\s]/ ); - var nameEndMatch; - /*jshint eqnull:true */ + nameMatch = sanatizedStr.substring( 0, divider ).match( /[^\s]/ ); if ( nameMatch != null ) { ranges.push( new Range( 0 ,nameMatch.index ) ); //whitespace and squiggles upto the name nameEndMatch = sanatizedStr.substring( 0 , divider ).match( /[^\s]\s*$/ ); //last nonwhitespace character @@ -776,21 +758,18 @@ fn: { * Start looping over params */ var currentParamNumber = 0; - var currentField, currentValue, valueBeginIndex, valueBegin, valueEnd; - var nameIndex, equalsIndex, valueIndex; - var currentName, nameBegin, nameBeginIndex, nameEnd, nameEndIndex; var valueEndIndex = ranges[templateNameIndex].end; var paramsByName = []; while ( !doneParsing ) { currentParamNumber++; oldDivider = divider; divider = sanatizedStr.indexOf( '|', oldDivider + 1 ); - if ( divider === -1 ) { + if ( divider == -1 ) { divider = sanatizedStr.length; doneParsing = true; } currentField = sanatizedStr.substring( oldDivider+1, divider ); - if ( currentField.indexOf( '=' ) === -1 ) { + if ( currentField.indexOf( '=' ) == -1 ) { // anonymous field, gets a number //default values, since we'll allow empty values diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.templates.js b/extensions/WikiEditor/modules/jquery.wikiEditor.templates.js index b0462563..b303e3fa 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.templates.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.templates.js @@ -1,23 +1,22 @@ /* Templates Module for wikiEditor */ -/*jshint onevar:false */ -( function ( $ ) { $.wikiEditor.modules.templates = { +( function( $ ) { $.wikiEditor.modules.templates = { /** * Core Requirements */ -req: [ 'iframe' ], +'req': [ 'iframe' ], /** * Object Templates */ -tpl: { - marker: { - type: 'template', - anchor: 'wrap', - skipDivision: 'realchange', - afterWrap: function ( node ) { +'tpl': { + 'marker': { + 'type': 'template', + 'anchor': 'wrap', + 'skipDivision': 'realchange', + 'afterWrap': function( node ) { $( node ).addClass( 'wikiEditor-template' ); }, - getAnchor: function ( ca1 ) { + 'getAnchor': function( ca1, ca2 ) { return $( ca1.parentNode ).is( '.wikiEditor-template' ) ? ca1.parentNode : null; } } @@ -25,14 +24,10 @@ tpl: { /** * Event handlers */ -evt: { - /** - * @param context - * @param event - */ - mark: function ( context ) { +'evt': { + 'mark': function( context, event ) { // The markers returned by this function are skipped on realchange, so don't regenerate them in that case - if ( context.modules.highlight.currentScope === 'realchange' ) { + if ( context.modules.highlight.currentScope == 'realchange' ) { return; } // Get references to the markers and tokens from the current context @@ -41,14 +36,14 @@ evt: { // Use depth-tracking to extract top-level templates from tokens var depth = 0, bias, start; for ( var i in tokens ) { - depth += ( bias = tokens[i].label === 'TEMPLATE_BEGIN' ? 1 : ( tokens[i].label === 'TEMPLATE_END' ? -1 : 0 ) ); - if ( bias > 0 && depth === 1 ) { + depth += ( bias = tokens[i].label == 'TEMPLATE_BEGIN' ? 1 : ( tokens[i].label == 'TEMPLATE_END' ? -1 : 0 ) ); + if ( bias > 0 && depth == 1 ) { // Top-level opening - use offset as start start = tokens[i].offset; - } else if ( bias < 0 && depth === 0 ) { + } else if ( bias < 0 && depth == 0 ) { // Top-level closing - use offset as end markers[markers.length] = $.extend( - { context: context, start: start, end: tokens[i].offset }, + { 'context': context, 'start': start, 'end': tokens[i].offset }, $.wikiEditor.modules.templates.tpl.marker ); } @@ -58,19 +53,15 @@ evt: { } } }, -exp: [ - { regex: /{{/, label: 'TEMPLATE_BEGIN' }, - { regex: /}}/, label: 'TEMPLATE_END', markAfter: true } +'exp': [ + { 'regex': /{{/, 'label': "TEMPLATE_BEGIN" }, + { 'regex': /}}/, 'label': "TEMPLATE_END", 'markAfter': true } ], /** * Internally used functions */ -fn: { - /** - * @param context - * @param config - */ - create: function () { +'fn': { + 'create': function( context, config ) { // Do some stuff here... } } diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.toc.js b/extensions/WikiEditor/modules/jquery.wikiEditor.toc.js index 3f186db6..54b8a863 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.toc.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.toc.js @@ -1,32 +1,31 @@ /* TOC Module for wikiEditor */ -/*jshint onevar:false */ -( function ( $, mw ) { $.wikiEditor.modules.toc = { +( function( $ ) { $.wikiEditor.modules.toc = { /** * Compatability map */ -browsers: { +'browsers': { // Left-to-right languages - ltr: { - msie: [['>=', 7]], - firefox: [['>=', 3]], - opera: [['>=', 10]], - safari: [['>=', 4]], - chrome: [['>=', 4]] + 'ltr': { + 'msie': [['>=', 7]], + 'firefox': [['>=', 3]], + 'opera': [['>=', 10]], + 'safari': [['>=', 4]], + 'chrome': [['>=', 4]] }, // Right-to-left languages - rtl: { - msie: [['>=', 8]], - firefox: [['>=', 3]], - opera: [['>=', 10]], - safari: [['>=', 4]], - chrome: [['>=', 4]] + 'rtl': { + 'msie': [['>=', 8]], + 'firefox': [['>=', 3]], + 'opera': [['>=', 10]], + 'safari': [['>=', 4]], + 'chrome': [['>=', 4]] } }, /** * Core Requirements */ -req: [ 'iframe' ], +'req': [ 'iframe' ], /** * Configuration */ @@ -52,18 +51,10 @@ api: { * Event handlers */ evt: { - /** - * @param context - * @param event - */ - change: function( context ) { + change: function( context, event ) { $.wikiEditor.modules.toc.fn.update( context ); }, - /** - * @param context - * @param event - */ - ready: function( context ) { + ready: function( context, event ) { // Add the TOC to the document $.wikiEditor.modules.toc.fn.build( context ); if ( !context.$content ) { @@ -77,32 +68,28 @@ evt: { $.wikiEditor.modules.toc.fn.improveUI(); $.wikiEditor.modules.toc.evt.resize( context ); }, - /** - * @param context - * @param event - */ - resize: function( context ) { + resize: function( context, event ) { var availableWidth = context.$wikitext.width() - parseFloat( $.wikiEditor.modules.toc.cfg.textMinimumWidth ), totalMinWidth = parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ) + parseFloat( $.wikiEditor.modules.toc.cfg.textMinimumWidth ); context.$ui.find( '.wikiEditor-ui-right' ) .resizable( 'option', 'maxWidth', availableWidth ); - if ( context.modules.toc.$toc.data( 'positionMode' ) !== 'disabled' && + if ( context.modules.toc.$toc.data( 'positionMode' ) != 'disabled' && context.$wikitext.width() < totalMinWidth ) { $.wikiEditor.modules.toc.fn.disable( context ); - } else if ( context.modules.toc.$toc.data( 'positionMode' ) === 'disabled' && + } else if ( context.modules.toc.$toc.data( 'positionMode' ) == 'disabled' && context.$wikitext.width() > totalMinWidth ) { $.wikiEditor.modules.toc.fn.enable( context ); - } else if ( context.modules.toc.$toc.data( 'positionMode' ) === 'regular' && + } else if ( context.modules.toc.$toc.data( 'positionMode' ) == 'regular' && context.$ui.find( '.wikiEditor-ui-right' ).width() > availableWidth ) { //switch mode $.wikiEditor.modules.toc.fn.switchLayout( context ); - } else if ( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' && + } else if ( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' && context.modules.toc.$toc.data( 'previousWidth' ) < context.$wikitext.width() ) { //switch mode $.wikiEditor.modules.toc.fn.switchLayout( context ); } - if ( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { + if ( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { context.modules.toc.$toc.find( 'div' ).autoEllipsis( { 'position': 'right', 'tooltip': true, 'restoreText': true } ); @@ -118,18 +105,14 @@ evt: { // store the width of the view for comparison on next resize context.modules.toc.$toc.data( 'previousWidth', context.$wikitext.width() ); }, - /** - * @param context - * @param event - */ - mark: function( context ) { + mark: function( context, event ) { var hash = ''; var markers = context.modules.highlight.markers; var tokenArray = context.modules.highlight.tokenArray; var outline = context.data.outline = []; var h = 0; for ( var i = 0; i < tokenArray.length; i++ ) { - if ( tokenArray[i].label !== 'TOC_HEADER' ) { + if ( tokenArray[i].label != 'TOC_HEADER' ) { continue; } h++; @@ -151,14 +134,14 @@ evt: { }, onSkip: function( node ) { var marker = $( node ).data( 'marker' ); - if ( $( node ).data( 'section' ) !== marker.index ) { + if ( $( node ).data( 'section' ) != marker.index ) { $( node ) .removeClass( 'wikiEditor-toc-section-' + $( node ).data( 'section' ) ) .addClass( 'wikiEditor-toc-section-' + marker.index ) .data( 'section', marker.index ); } }, - getAnchor: function( ca1 ) { + getAnchor: function( ca1, ca2 ) { return $( ca1.parentNode ).is( '.wikiEditor-toc-header' ) ? ca1.parentNode : null; } @@ -171,7 +154,7 @@ evt: { } ); } // Only update the TOC if it's been changed - we do this by comparing a hash of the headings this time to last - if ( typeof context.modules.toc.lastHash === 'undefined' || context.modules.toc.lastHash !== hash ) { + if ( typeof context.modules.toc.lastHash == 'undefined' || context.modules.toc.lastHash !== hash ) { $.wikiEditor.modules.toc.fn.build( context ); $.wikiEditor.modules.toc.fn.update( context ); // Remember the changed version @@ -192,13 +175,13 @@ fn: { * @param {Object} context Context object of editor to create module in * @param {Object} config Configuration object to create module from */ - create: function( context ) { + create: function( context, config ) { if ( '$toc' in context.modules.toc ) { return; } $.wikiEditor.modules.toc.cfg.rtl = $( 'body' ).is( '.rtl' ); $.wikiEditor.modules.toc.cfg.flexProperty = $.wikiEditor.modules.toc.cfg.rtl ? 'marginLeft' : 'marginRight'; - context.$ui.find( '.wikiEditor-ui-left' ).height(); + var height = context.$ui.find( '.wikiEditor-ui-left' ).height(); context.modules.toc.$toc = $( '
      ' ) .addClass( 'wikiEditor-ui-toc' ) .data( 'context', context ) @@ -213,14 +196,14 @@ fn: { }, redraw: function( context, fixedWidth ) { fixedWidth = parseFloat( fixedWidth ); - if ( context.modules.toc.$toc.data( 'positionMode' ) === 'regular' ) { + if( context.modules.toc.$toc.data( 'positionMode' ) == 'regular' ) { context.$ui.find( '.wikiEditor-ui-right' ) .css( 'width', fixedWidth + 'px' ); context.$ui.find( '.wikiEditor-ui-left' ) .css( $.wikiEditor.modules.toc.cfg.flexProperty, ( -1 * fixedWidth ) + 'px' ) .children() .css( $.wikiEditor.modules.toc.cfg.flexProperty, fixedWidth + 'px' ); - } else if( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { + } else if( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { context.$ui.find( '.wikiEditor-ui-left' ) .css( 'width', fixedWidth ); context.$ui.find( '.wikiEditor-ui-right' ) @@ -229,10 +212,10 @@ fn: { } }, switchLayout: function( context ) { - var width; - context.$ui.find( '.wikiEditor-ui-right' ).height(); - if ( context.modules.toc.$toc.data( 'positionMode' ) === 'regular' && - !context.modules.toc.$toc.data( 'collapsed' ) + var width, + height = context.$ui.find( '.wikiEditor-ui-right' ).height(); + if ( context.modules.toc.$toc.data( 'positionMode' ) == 'regular' + && !context.modules.toc.$toc.data( 'collapsed' ) ) { // store position mode context.modules.toc.$toc.data( 'positionMode', 'goofy' ); @@ -254,7 +237,7 @@ fn: { 'left' : $.wikiEditor.modules.toc.cfg.rtl ? 0 : 'auto' } ); context.$wikitext .css( 'position', 'relative' ); - } else if ( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { + } else if ( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { // store position mode context.modules.toc.$toc.data( 'positionMode', 'regular' ); // set width @@ -277,7 +260,7 @@ fn: { if ( context.modules.toc.$toc.data( 'collapsed' ) ) { context.$ui.find( '.wikiEditor-ui-toc-expandControl' ).hide(); } else { - if( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { + if( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { $.wikiEditor.modules.toc.fn.switchLayout( context ); } context.$ui.find( '.wikiEditor-ui-right' ).hide(); @@ -313,7 +296,7 @@ fn: { * * @param {Object} context */ - update: function () { + update: function( context ) { //temporarily commenting this out because it is causing all kinds of cursor //and text jumping issues in IE. WIll get back to this --pdhanda /* @@ -350,10 +333,10 @@ fn: { * * @param {Object} event Event object with context as data */ - collapse: function () { + collapse: function( event ) { var $this = $( this ), context = $this.data( 'context' ); - if ( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { + if( context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { $.wikiEditor.modules.toc.fn.switchLayout( context ); } var pT = $this.parent().position().top - 1; @@ -383,7 +366,7 @@ fn: { // Let the UI know things have moved around context.fn.trigger( 'tocCollapse' ); context.fn.trigger( 'resize' ); - } ); + } ); $.cookie( 'wikiEditor-' + context.instance + '-toc-width', 0 ); return false; @@ -394,19 +377,15 @@ fn: { * * @param {Object} event Event object with context as data */ - expand: function () { + expand: function( event ) { var $this = $( this ), context = $this.data( 'context' ), openWidth = parseFloat( context.modules.toc.$toc.data( 'openWidth' ) ), availableSpace = context.$wikitext.width() - parseFloat( $.wikiEditor.modules.toc.cfg.textMinimumWidth ); - if ( availableSpace < $.wikiEditor.modules.toc.cfg.textMinmumWidth ) { - return false; - } + if ( availableSpace < $.wikiEditor.modules.toc.cfg.textMinmumWidth ) return false; context.modules.toc.$toc.data( 'collapsed', false ); // check if we've got enough room to open to our stored width - if ( availableSpace < openWidth ) { - openWidth = availableSpace; - } + if ( availableSpace < openWidth ) openWidth = availableSpace; context.$ui.find( '.wikiEditor-ui-toc-expandControl' ).hide(); var leftParam = {}, leftChildParam = {}; leftParam[ $.wikiEditor.modules.toc.cfg.flexProperty ] = parseFloat( openWidth ) * -1; @@ -428,7 +407,7 @@ fn: { 'top': 'auto' } ); context.fn.trigger( 'tocExpand' ); context.fn.trigger( 'resize' ); - } ); + } ); $.cookie( 'wikiEditor-' + context.instance + '-toc-width', context.modules.toc.$toc.data( 'openWidth' ) ); return false; @@ -453,7 +432,7 @@ fn: { } var sections = []; for ( var i = offset; i < outline.length; i++ ) { - if ( outline[i].nLevel === level ) { + if ( outline[i].nLevel == level ) { var sub = buildStructure( outline, i + 1, level + 1 ); if ( sub.length ) { outline[i].sections = sub; @@ -483,9 +462,8 @@ fn: { .click( function( event ) { var wrapper = context.$content.find( '.wikiEditor-toc-section-' + $( this ).data( 'index' ) ); - if ( wrapper.length === 0 ) { + if ( wrapper.length === 0 ) wrapper = context.$content; - } context.fn.scrollToTop( wrapper, true ); context.$textarea.textSelection( 'setSelection', { 'start': 0, @@ -503,9 +481,8 @@ fn: { event.preventDefault(); } ) .text( structure[i].text ); - if ( structure[i].text === '' ) { + if ( structure[i].text === '' ) div.html( ' ' ); - } var item = $( '
    18. ' ).append( div ); if ( structure[i].sections !== undefined ) { item.append( buildList( structure[i].sections ) ); @@ -569,7 +546,7 @@ fn: { .data( 'wikiEditor-ui-left', context.$ui.find( '.wikiEditor-ui-left' ) ) .resizable( { handles: 'w,e', preventPositionLeftChange: true, minWidth: parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ), - start: function () { + start: function( e, ui ) { var $this = $( this ); // Toss a transparent cover over our iframe $( '
      ' ) @@ -585,7 +562,7 @@ fn: { .appendTo( context.$ui.find( '.wikiEditor-ui-left' ) ); $this.resizable( 'option', 'maxWidth', $this.parent().width() - parseFloat( $.wikiEditor.modules.toc.cfg.textMinimumWidth ) ); - if ( context.modules.toc.$toc.data( 'positionMode' ) === 'goofy' ) { + if(context.modules.toc.$toc.data( 'positionMode' ) == 'goofy' ) { $.wikiEditor.modules.toc.fn.switchLayout( context ); } }, @@ -619,7 +596,7 @@ fn: { var handle = $.wikiEditor.modules.toc.cfg.rtl ? 'w' : 'e'; context.$ui.find( '.ui-resizable-' + handle ) .removeClass( 'ui-resizable-' + handle ) - .addClass( 'ui-resizable-' + ( handle === 'w' ? 'e' : 'w' ) ) + .addClass( 'ui-resizable-' + ( handle == 'w' ? 'e' : 'w' ) ) .addClass( 'wikiEditor-ui-toc-resize-grip' ); // Bind collapse and expand event handlers to the TOC context.modules.toc.$toc @@ -627,13 +604,12 @@ fn: { .bind( 'expand.wikiEditor-toc', $.wikiEditor.modules.toc.fn.expand ); context.modules.toc.$toc.data( 'openWidth', $.wikiEditor.modules.toc.cfg.defaultWidth ); // If the toc-width cookie is set, reset the widths based upon that - if ( $.cookie( 'wikiEditor-' + context.instance + '-toc-width' ) === 0 ) { + if ( $.cookie( 'wikiEditor-' + context.instance + '-toc-width' ) == 0 ) { context.modules.toc.$toc.trigger( 'collapse.wikiEditor-toc', { data: context } ); } else if ( $.cookie( 'wikiEditor-' + context.instance + '-toc-width' ) > 0 ) { var initialWidth = $.cookie( 'wikiEditor-' + context.instance + '-toc-width' ); - if ( initialWidth < parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ) ) { + if( initialWidth < parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ) ) initialWidth = parseFloat( $.wikiEditor.modules.toc.cfg.minimumWidth ) + 1; - } context.modules.toc.$toc.data( 'openWidth', initialWidth + 'px' ); $.wikiEditor.modules.toc.fn.redraw( context, initialWidth ); } @@ -688,7 +664,7 @@ fn: { * Extending resizable to allow west resizing without altering the left position attribute */ $.ui.plugin.add( 'resizable', 'preventPositionLeftChange', { - resize: function () { + resize: function( event, ui ) { $( this ).data( 'resizable' ).position.left = 0; } } ); @@ -697,4 +673,4 @@ fn: { }; -} )( jQuery, mediaWiki ); +} ) ( jQuery ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js b/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js index cb24bfd5..d3f7a9d5 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js @@ -1,8 +1,7 @@ /** * Configuration of Toolbar module for wikiEditor */ -/*jshint camelcase:false, quotmark:false */ -( function ( $, mw ) { $.wikiEditor.modules.toolbar.config = { +( function( $ ) { $.wikiEditor.modules.toolbar.config = { getDefaultConfig: function() { var fileNamespace = mw.config.get( 'wgFormattedNamespaces' )[6]; @@ -44,7 +43,6 @@ getDefaultConfig: function() { 'eu': 'format-bold-L.png', 'he': 'format-bold-B.png', 'hu': 'format-bold-F.png', - 'hy': 'format-bold-hy.png', 'it': 'format-bold-G.png', 'ka': 'format-bold-ka.png', 'ky': 'format-bold-ru.png', @@ -100,7 +98,6 @@ getDefaultConfig: function() { 'eu': 'format-italic-E.png', 'he': 'format-italic-I.png', 'hu': 'format-italic-D.png', - 'hy': 'format-italic-hy.png', 'it': 'format-italic-C.png', 'ka': 'format-italic-ka.png', 'ky': 'format-italic-K.png', @@ -1455,4 +1452,4 @@ getDefaultConfig: function() { } }; } -}; } ) ( jQuery, mediaWiki ); +}; } ) ( jQuery ); diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js b/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js index 71592b53..e1bc6f15 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.js @@ -1,7 +1,6 @@ /** * Toolbar module for wikiEditor */ -/*jshint onevar:false */ ( function ( mw, $ ) { $.wikiEditor.modules.toolbar = { /** @@ -18,7 +17,7 @@ api : { var $sections = context.modules.toolbar.$toolbar.find( 'div.sections' ), $tabs = context.modules.toolbar.$toolbar.find( 'div.tabs' ); for ( var section in data[type] ) { - if ( section === 'main' ) { + if ( section == 'main' ) { // Section context.modules.toolbar.$toolbar.prepend( $.wikiEditor.modules.toolbar.fn.buildSection( @@ -146,28 +145,28 @@ api : { } }, removeFromToolbar : function( context, data ) { - if ( typeof data.section === 'string' ) { + if ( typeof data.section == 'string' ) { // Section var tab = 'div.tabs span[rel="' + data.section + '"].tab'; var target = 'div[rel="' + data.section + '"].section'; var group = null; - if ( typeof data.group === 'string' ) { + if ( typeof data.group == 'string' ) { // Toolbar group target += ' div[rel="' + data.group + '"].group'; - if ( typeof data.tool === 'string' ) { + if ( typeof data.tool == 'string' ) { // Save for later checking if empty group = target; // Tool target += ' a[rel="' + data.tool + '"].tool'; } - } else if ( typeof data.page === 'string' ) { + } else if ( typeof data.page == 'string' ) { // Booklet page var index = target + ' div.index div[rel="' + data.page + '"]'; target += ' div.pages div[rel="' + data.page + '"].page'; - if ( typeof data.character === 'string' ) { + if ( typeof data.character == 'string' ) { // Character target += ' span[rel="' + data.character + '"]'; - } else if ( typeof data.row === 'number' ) { + } else if ( typeof data.row == 'number' ) { // Table row target += ' table tr:not(:has(th)):eq(' + data.row + ')'; } else { @@ -199,11 +198,7 @@ api : { * Event handlers */ evt: { - /** - * @param context - * @param event - */ - resize: function( context ) { + resize: function( context, event ) { context.$ui.find( '.sections' ).height( context.$ui.find( '.sections .section-visible' ).outerHeight() ); }, tocCollapse: function( context, event ) { @@ -240,7 +235,7 @@ fn: { * @param {Object} action * @param {Object} source */ - doAction : function( context, action ) { + doAction : function( context, action, source ) { switch ( action.type ) { case 'replace': case 'encapsulate': @@ -249,7 +244,7 @@ fn: { 'peri' : $.wikiEditor.autoMsg( action.options, 'peri' ), 'post' : $.wikiEditor.autoMsg( action.options, 'post' ) }; - var replace = action.type === 'replace'; + var replace = action.type == 'replace'; if ( 'regex' in action.options && 'regexReplace' in action.options ) { var selection = context.$textarea.textSelection( 'getSelection' ); if ( selection !== '' && selection.match( action.options.regex ) ) { @@ -268,7 +263,7 @@ fn: { } break; case 'callback': - if ( typeof action.execute === 'function' ) { + if ( typeof action.execute == 'function' ) { action.execute( context ); } break; @@ -292,7 +287,7 @@ fn: { if ( tool ) { // Consider a group with only hidden tools empty as well // .is( ':visible' ) always returns false because tool is not attached to the DOM yet - empty = empty && tool.css( 'display' ) === 'none'; + empty = empty && tool.css( 'display' ) == 'none'; $group.append( tool ); } } @@ -452,7 +447,7 @@ fn: { } ); }, buildPage : function( context, id, page ) { - var html, i; + var html; var $page = $( '
      ' ).attr( { 'class' : 'page page-' + id, 'rel' : id @@ -466,7 +461,7 @@ fn: { html += $.wikiEditor.modules.toolbar.fn.buildHeading( context, page.headings ); } if ( 'rows' in page ) { - for ( i = 0; i < page.rows.length; i++ ) { + for ( var i = 0; i < page.rows.length; i++ ) { html += $.wikiEditor.modules.toolbar.fn.buildRow( context, page.rows[i] ); } } @@ -489,7 +484,7 @@ fn: { } if ( 'characters' in page ) { html = ''; - for ( i = 0; i < page.characters.length; i++ ) { + for ( var i = 0; i < page.characters.length; i++ ) { html += $.wikiEditor.modules.toolbar.fn.buildCharacter( page.characters[i], actions ); } $characters @@ -532,7 +527,7 @@ fn: { return html + ''; }, buildCharacter : function( character, actions ) { - if ( typeof character === 'string' ) { + if ( typeof character == 'string' ) { character = { 'label' : character, 'action' : { @@ -569,9 +564,8 @@ fn: { return mw.html.element( 'span', { 'rel': character.label }, character.label ); } } - mw.log( 'A character for the toolbar was undefined. This is not supposed to happen. Double check the config.' ); - // bug 31673; also an additional fix for bug 24208... - return ''; + mw.log( "A character for the toolbar was undefined. This is not supposed to happen. Double check the config." ); + return ""; // bug 31673; also an additional fix for bug 24208... }, buildTab : function( context, id, section ) { var selected = $.cookie( 'wikiEditor-' + context.instance + '-toolbar-section' ); @@ -581,7 +575,7 @@ fn: { } var $link = $( '' ) - .addClass( selected === id ? 'current' : null ) + .addClass( selected == id ? 'current' : null ) .attr( { href: '#', role: 'button', @@ -590,7 +584,7 @@ fn: { } ) .text( $.wikiEditor.autoMsg( section, 'label' ) ) .data( 'context', context ) - .mouseup( function () { + .mouseup( function( e ) { $(this).blur(); } ) .mousedown( function( e ) { @@ -610,7 +604,7 @@ fn: { var $sections = $(this).data( 'context' ).$ui.find( '.sections' ); var $section = $(this).data( 'context' ).$ui.find( '.section-' + $(this).parent().attr( 'rel' ) ); - var show = $section.css( 'display' ) === 'none'; + var show = $section.css( 'display' ) == 'none'; $section.parent().find( '.section-visible' ) .css( 'position', 'absolute' ) .attr( 'aria-expanded', 'false' ) @@ -674,7 +668,7 @@ fn: { id: 'wikiEditor-section-' + id } ); var selected = $.cookie( 'wikiEditor-' + context.instance + '-toolbar-section' ); - var show = selected === id; + var show = selected == id; if ( section.deferLoad !== undefined && section.deferLoad && id !== 'main' && !show ) { // This class shows the spinner and serves as a marker for the click handler in buildTab() @@ -730,7 +724,6 @@ fn: { } }, updateBookletSelection : function( context, id, $pages, $index ) { - /*jshint eqnull:true */ var cookie = 'wikiEditor-' + context.instance + '-booklet-' + id + '-page'; var selected = $.cookie( cookie ); // Re-save cookie @@ -754,7 +747,7 @@ fn: { context.modules.toolbar.$toolbar.append( $( '
      ' ).css( 'clear', 'both' ) ); var sectionQueue = []; for ( var section in config ) { - if ( section === 'main' ) { + if ( section == 'main' ) { context.modules.toolbar.$toolbar.prepend( $.wikiEditor.modules.toolbar.fn.buildSection( context, section, config[section] ) ); diff --git a/extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php b/extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php deleted file mode 100644 index 7153f49f..00000000 --- a/extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php +++ /dev/null @@ -1,67 +0,0 @@ -createNewPage(); - parent::verifyInternalLink(); - } - - // Add a internal link with different display text and verify - function testInternalLinkWithDisplayText() { - $this->createNewPage(); - parent::verifyInternalLinkWithDisplayText(); - } - - // Add a internal link with blank display text and verify - function testInternalLinkWithBlankDisplayText() { - $this->createNewPage(); - parent::verifyInternalLinkWithBlankDisplayText(); - } - - // Add external link and verify - function testExternalLink() { - $this->createNewPage(); - parent::verifyExternalLink(); - } - - // Add external link with different display text and verify - function testExternalLinkWithDisplayText( ) { - $this->createNewPage(); - parent::verifyExternalLinkWithDisplayText(); - } - - // Add external link with Blank display text and verify - function testExternalLinkWithBlankDisplayText() { - $this->createNewPage(); - parent::verifyExternalLinkWithBlankDisplayText(); - } - -} diff --git a/extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php b/extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php deleted file mode 100644 index 352ebec0..00000000 --- a/extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php +++ /dev/null @@ -1,295 +0,0 @@ -open( $this->getUrl() . '/index.php' ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - } - - // Expand advance tool bar section if its not - function doExpandAdvanceSection() { - if ( !$this->isTextPresent( TEXT_HEADING ) ) { - $this->click( LINK_ADVANCED ); - } - } - - // Log out from the application - function doLogout() { - $this->open( $this->getUrl() . '/index.php' ); - if ( $this->isTextPresent( TEXT_LOGOUT ) ) { - $this->click( LINK_LOGOUT ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( TEXT_LOGOUT_CONFIRM, $this->getText( LINK_LOGIN ) ); - $this->open( $this->getUrl() . '/index.php' ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - } - } - - // Create a temporary fixture page - function doCreateInternalTestPageIfMissing() { - $this->type( INPUT_SEARCH_BOX, WIKI_INTERNAL_LINK ); - $this->click( BUTTON_SEARCH ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->click( LINK_START . WIKI_INTERNAL_LINK ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $location = $this->getLocation() . "\n"; - if ( strpos( $location, '&redlink=1' ) !== false ) { - $this->type( TEXT_EDITOR, "Test fixture page. No real content here" ); - $this->click( BUTTON_SAVE_WATCH ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ), - $this->getText( TEXT_PAGE_HEADING ) ); - } - } - - // Create a temporary new page - function doCreateNewPageTemporary() { - $this->type( INPUT_SEARCH_BOX, WIKI_TEMP_NEWPAGE ); - $this->click( BUTTON_SEARCH ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->click( LINK_START . WIKI_TEMP_NEWPAGE ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - } - - // Add a internal link and verify - function verifyInternalLink() { - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDLINK ); - $this->waitForPopup( 'addLink', WIKI_TEST_WAIT_TIME ); - $this->type( TEXT_LINKNAME, ( WIKI_INTERNAL_LINK ) ); - $this->assertTrue( $this->isElementPresent( ICON_PAGEEXISTS ), 'Element ' . ICON_PAGEEXISTS . 'Not found' ); - $this->assertEquals( "on", $this->getValue( OPT_INTERNAL ) ); - $this->click( BUTTON_INSERTLINK ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( ( WIKI_INTERNAL_LINK ), $this->getText( LINK_START . WIKI_INTERNAL_LINK ) ); - $this->click( LINK_START . WIKI_INTERNAL_LINK ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ), $this->getText( TEXT_PAGE_HEADING ) ); - } - - // Add a internal link with different display text and verify - function verifyInternalLinkWithDisplayText() { - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDLINK ); - $this->waitForPopup( 'addLink', WIKI_TEST_WAIT_TIME ); - $this->type( TEXT_LINKNAME, WIKI_INTERNAL_LINK ); - $this->type ( TEXT_LINKDISPLAYNAME, WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT ); - $this->assertTrue( $this->isElementPresent( ICON_PAGEEXISTS ) ); - $this->assertEquals( "on", $this->getValue( OPT_INTERNAL ) ); - $this->click( BUTTON_INSERTLINK ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT, - $this->getText( LINK_START . WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT ) ); - $this->click( LINK_START . WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ), $this->getText( TEXT_PAGE_HEADING ) ); - - } - - // Add a internal link with blank display text and verify - function verifyInternalLinkWithBlankDisplayText() { - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDLINK ); - $this->waitForPopup( 'addLink', WIKI_TEST_WAIT_TIME ); - $this->type( TEXT_LINKNAME, WIKI_INTERNAL_LINK ); - $this->type( TEXT_LINKDISPLAYNAME, "" ); - $this->assertTrue( $this->isElementPresent( ICON_PAGEEXISTS ) ); - $this->assertEquals( "on", $this->getValue( OPT_INTERNAL ) ); - $this->click( BUTTON_INSERTLINK ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_INTERNAL_LINK, $this->getText( LINK_START . WIKI_INTERNAL_LINK ) ); - $this->click( LINK_START . WIKI_INTERNAL_LINK ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_INTERNAL_LINK, $this->getText( TEXT_PAGE_HEADING ) ); - - } - - // Add external link and verify - function verifyExternalLink() { - $this->type( LINK_PREVIEW, "" ); - $this->click( LINK_ADDLINK ); - $this->type( TEXT_LINKNAME, WIKI_EXTERNAL_LINK ); - $this->assertTrue( $this->isElementPresent( ICON_PAGEEXTERNAL ) ); - $this->assertEquals( "on", $this->getValue( OPT_EXTERNAL ) ); - $this->click( BUTTON_INSERTLINK ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_EXTERNAL_LINK, $this->getText( LINK_START . WIKI_EXTERNAL_LINK ) ); - - $this->click( LINK_START . WIKI_EXTERNAL_LINK ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE, $this->getTitle() ); - } - - // Add external link with different display text and verify - function verifyExternalLinkWithDisplayText() { - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDLINK ); - $this->type( TEXT_LINKNAME, WIKI_EXTERNAL_LINK ); - $this->type( TEXT_LINKDISPLAYNAME, WIKI_EXTERNAL_LINK_TITLE ); - $this->assertTrue( $this->isElementPresent( ICON_PAGEEXTERNAL ) ); - $this->assertEquals( "on", $this->getValue( OPT_EXTERNAL ) ); - $this->click( BUTTON_INSERTLINK ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE, $this->getText( LINK_START . WIKI_EXTERNAL_LINK_TITLE ) ); - $this->click( LINK_START . ( WIKI_EXTERNAL_LINK_TITLE ) ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE , $this->getTitle() ); - } - - // Add external link with Blank display text and verify - function verifyExternalLinkWithBlankDisplayText() { - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDLINK ); - $this->type( TEXT_LINKNAME, WIKI_EXTERNAL_LINK ); - $this->type( TEXT_LINKDISPLAYNAME, "" ); - $this->assertTrue( $this->isElementPresent( ICON_PAGEEXTERNAL ) ); - $this->assertEquals( "on", $this->getValue( OPT_EXTERNAL ) ); - $this->click( BUTTON_INSERTLINK ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( "[1]", $this->getText( LINK_START . "[1]" ) ); - $this->click( LINK_START . "[1]" ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE, $this->getTitle() ); - } - - // Add a table and verify - function verifyCreateTable() { - $WIKI_TABLE_ROW = 2; - $WIKI_TABLE_COL = "5"; - $this->doExpandAdvanceSection(); - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDTABLE ); - $this->click( CHK_SORT ); - $this->type( TEXT_ROW, $WIKI_TABLE_ROW ); - $this->type( TEXT_COL, $WIKI_TABLE_COL ); - $this->click( BUTTON_INSERTABLE ); - $this->click( CHK_SORT ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $WIKI_TABLE_ROW = $WIKI_TABLE_ROW + 1; - $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_OTHER . - TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW . - TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL . - TEXT_VALIDATE_TABLE_PART3 ) ); - } - - // Add a table and verify only with head row - function verifyCreateTableWithHeadRow() { - $WIKI_TABLE_ROW = 3; - $WIKI_TABLE_COL = "4"; - $this->doExpandAdvanceSection(); - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDTABLE ); - $this->click( CHK_BOARDER ); - $this->type( TEXT_ROW, $WIKI_TABLE_ROW ); - $this->type( TEXT_COL, $WIKI_TABLE_COL ); - $this->click( BUTTON_INSERTABLE ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $WIKI_TABLE_ROW = $WIKI_TABLE_ROW + 1; - $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_OTHER . - TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW . - TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL . - TEXT_VALIDATE_TABLE_PART3 ) ); - } - - // Add a table and verify only with borders - function verifyCreateTableWithBorders() { - $WIKI_TABLE_ROW = "4"; - $WIKI_TABLE_COL = "6"; - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDTABLE ); - $this->click( CHK_HEADER ); - $this->type( TEXT_ROW, $WIKI_TABLE_ROW ); - $this->type( TEXT_COL, $WIKI_TABLE_COL ); - $this->click( BUTTON_INSERTABLE ); - $this->click( CHK_HEADER ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_OTHER . - TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW . - TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL . - TEXT_VALIDATE_TABLE_PART3 ) ); - } - - // Add a table and verify only with sort row - function verifyCreateTableWithSortRow() { - $WIKI_TABLE_ROW = "2"; - $WIKI_TABLE_COL = "5"; - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDTABLE ); - $this->click( CHK_HEADER ); - $this->click( CHK_BOARDER ); - $this->click( CHK_SORT ); - $this->type( TEXT_ROW, $WIKI_TABLE_ROW ); - $this->type( TEXT_COL, $WIKI_TABLE_COL ); - $this->click( BUTTON_INSERTABLE ); - $this->click( CHK_HEADER ); - $this->click( CHK_BOARDER ); - $this->click( CHK_SORT ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_WITHALLFEATURES . - TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW . - TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL . - TEXT_VALIDATE_TABLE_PART3 ) ); - } - - // Add a table without headers,borders and sort rows - function verifyCreateTableWithNoSpecialEffects() { - $WIKI_TABLE_ROW = "6"; - $WIKI_TABLE_COL = "2"; - $this-> - $this->doExpandAdvanceSection(); - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDTABLE ); - $this->click( CHK_BOARDER ); - $this->click( CHK_HEADER ); - $this->type( TEXT_ROW, $WIKI_TABLE_ROW ); - $this->type( TEXT_COL, $WIKI_TABLE_COL ); - $this->click( BUTTON_INSERTABLE ); - $this->click( CHK_BOARDER ); - $this->click( CHK_HEADER ); - $this->click( INK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_OTHER . - TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW . - TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL . - TEXT_VALIDATE_TABLE_PART3 ) ); - } - - // Add a table with headers,borders and sort rows - function verifyCreateTableWithAllSpecialEffects() { - $WIKI_TABLE_ROW = 6; - $WIKI_TABLE_COL = "2"; - $this->doExpandAdvanceSection(); - $this->type( TEXT_EDITOR, "" ); - $this->click( LINK_ADDTABLE ); - $this->click( CHK_SORT ); - $this->type( TEXT_ROW, $WIKI_TABLE_ROW ); - $this->type( TEXT_COL, $WIKI_TABLE_COL ); - $this->click( BUTTON_INSERTABLE ); - $this->click( CHK_SORT ); - $this->click( LINK_PREVIEW ); - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $WIKI_TABLE_ROW = $WIKI_TABLE_ROW + 1; - $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_WITHALLFEATURES . - TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW . - TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL . - TEXT_VALIDATE_TABLE_PART3 ) ); - } - -} diff --git a/extensions/WikiEditor/tests/selenium/WikiEditorConstants.php b/extensions/WikiEditor/tests/selenium/WikiEditorConstants.php deleted file mode 100644 index 090f96bf..00000000 --- a/extensions/WikiEditor/tests/selenium/WikiEditorConstants.php +++ /dev/null @@ -1,84 +0,0 @@ - 'vector', - 'wgWikiEditorFeatures' => array( - 'toolbar' => array( 'global' => true, 'user' => true ), - 'toc' => array( 'global' => false, 'user' => false ), - 'highlight' => array( 'global' => false, 'user' => false ), - 'templateEditor' => array( 'global' => false, 'user' => false ), - 'dialogs' => array( 'global' => true, 'user' => true ) - ), - 'wgVectorFeatures' => array( - 'editwarning' => array( 'global' => false, 'user' => false ) - ) - ); - $includeFiles = array_merge( $includeFiles, $includes ); - $globalConfigs = array_merge( $globalConfigs, $configs ); - return true; - } -} \ No newline at end of file diff --git a/extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php b/extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php deleted file mode 100644 index b4029d3a..00000000 --- a/extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php +++ /dev/null @@ -1,35 +0,0 @@ - false, 'user' => false ); - * $wgWikiEditorFeatures['templateEditor'] = array( 'global' => false, 'user' => false ); - * $wgWikiEditorFeatures['toolbar'] = array( 'global' => true, 'user' => true ); - * $wgWikiEditorFeatures['toc'] = array( 'global' => false, 'user' => false ); - * $wgWikiEditorFeatures['highlight'] = array( 'global' => false, 'user' => false ); - * $wgWikiEditorFeatures['dialogs'] = array( 'global' => true, 'user' => true ); - * - */ -class WikiEditorTestSuite extends SeleniumTestSuite -{ - public function setUp() { - $this->setLoginBeforeTests( false ); - parent::setUp(); - } - public function addTests() { - $testFiles = array( - 'extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php' - ); - parent::addTestFiles( $testFiles ); - } - - -} diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 820d6093..2aa5b09f 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -63,7 +63,7 @@ $wgConf = new SiteConfiguration; * MediaWiki version number * @since 1.2 */ -$wgVersion = '1.22.3'; +$wgVersion = '1.22.4'; /** * Name of the site. It must be changed in LocalSettings.php diff --git a/skins/common/images/icons/fileicon-djvu.xcf b/skins/common/images/icons/fileicon-djvu.xcf deleted file mode 100644 index 8043dcdb..00000000 Binary files a/skins/common/images/icons/fileicon-djvu.xcf and /dev/null differ diff --git a/skins/common/images/icons/fileicon-ogg.xcf b/skins/common/images/icons/fileicon-ogg.xcf deleted file mode 100644 index a91024bf..00000000 Binary files a/skins/common/images/icons/fileicon-ogg.xcf and /dev/null differ diff --git a/tests/.htaccess b/tests/.htaccess deleted file mode 100644 index 3a428827..00000000 --- a/tests/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/tests/TestsAutoLoader.php b/tests/TestsAutoLoader.php deleted file mode 100644 index 00ce13c8..00000000 --- a/tests/TestsAutoLoader.php +++ /dev/null @@ -1,104 +0,0 @@ - "$testDir/testHelpers.inc", - 'DbTestRecorder' => "$testDir/testHelpers.inc", - 'DelayedParserTest' => "$testDir/testHelpers.inc", - 'ParserTestResult' => "$testDir/parser/ParserTestResult.php", - 'TestFileIterator' => "$testDir/testHelpers.inc", - 'TestRecorder' => "$testDir/testHelpers.inc", - 'ITestRecorder' => "$testDir/testHelpers.inc", - - # tests/phpunit - 'MediaWikiTestCase' => "$testDir/phpunit/MediaWikiTestCase.php", - 'MediaWikiPHPUnitCommand' => "$testDir/phpunit/MediaWikiPHPUnitCommand.php", - 'MediaWikiPHPUnitTestListener' => "$testDir/phpunit/MediaWikiPHPUnitTestListener.php", - 'MediaWikiLangTestCase' => "$testDir/phpunit/MediaWikiLangTestCase.php", - 'TestUser' => "$testDir/phpunit/includes/TestUser.php", - - # tests/phpunit/includes - 'BlockTest' => "$testDir/phpunit/includes/BlockTest.php", - 'RevisionStorageTest' => "$testDir/phpunit/includes/RevisionStorageTest.php", - 'WikiPageTest' => "$testDir/phpunit/includes/WikiPageTest.php", - - //db - 'ORMTableTest' => "$testDir/phpunit/includes/db/ORMTableTest.php", - 'PageORMTableForTesting' => "$testDir/phpunit/includes/db/ORMTableTest.php", - 'DatabaseTestHelper' => "$testDir/phpunit/includes/db/DatabaseTestHelper.php", - - # tests/phpunit/includes/api - 'ApiFormatTestBase' => "$testDir/phpunit/includes/api/format/ApiFormatTestBase.php", - 'ApiTestCase' => "$testDir/phpunit/includes/api/ApiTestCase.php", - 'ApiTestContext' => "$testDir/phpunit/includes/api/ApiTestCase.php", - 'MockApi' => "$testDir/phpunit/includes/api/ApiTestCase.php", - 'RandomImageGenerator' => "$testDir/phpunit/includes/api/RandomImageGenerator.php", - 'UserWrapper' => "$testDir/phpunit/includes/api/ApiTestCase.php", - - # tests/phpunit/includes/content - 'DummyContentHandlerForTesting' => "$testDir/phpunit/includes/content/ContentHandlerTest.php", - 'DummyContentForTesting' => "$testDir/phpunit/includes/content/ContentHandlerTest.php", - 'ContentHandlerTest' => "$testDir/phpunit/includes/content/ContentHandlerTest.php", - 'JavaScriptContentTest' => "$testDir/phpunit/includes/content/JavaScriptContentTest.php", - 'TextContentTest' => "$testDir/phpunit/includes/content/TextContentTest.php", - 'WikitextContentTest' => "$testDir/phpunit/includes/content/WikitextContentTest.php", - - # tests/phpunit/includes/db - 'ORMRowTest' => "$testDir/phpunit/includes/db/ORMRowTest.php", - - # tests/phpunit/includes/parser - 'NewParserTest' => "$testDir/phpunit/includes/parser/NewParserTest.php", - 'MediaWikiParserTest' => "$testDir/phpunit/includes/parser/MediaWikiParserTest.php", - - # tests/phpunit/includes/libs - 'GenericArrayObjectTest' => "$testDir/phpunit/includes/libs/GenericArrayObjectTest.php", - - # tests/phpunit/media - 'FakeDimensionFile' => "$testDir/phpunit/includes/media/FakeDimensionFile.php", - - # tests/phpunit/includes/site - 'SiteTest' => "$testDir/phpunit/includes/site/SiteTest.php", - 'TestSites' => "$testDir/phpunit/includes/site/TestSites.php", - - # tests/phpunit/mocks - 'MockFSFile' => "$testDir/phpunit/mocks/filebackend/MockFSFile.php", - 'MockFileBackend' => "$testDir/phpunit/mocks/filebackend/MockFileBackend.php", - 'MockBitmapHandler' => "$testDir/phpunit/mocks/media/MockBitmapHandler.php", - 'MockImageHandler' => "$testDir/phpunit/mocks/media/MockBitmapHandler.php", - 'MockSvgHandler' => "$testDir/phpunit/mocks/media/MockBitmapHandler.php", - - # tests/phpunit/languages - 'LanguageClassesTestCase' => "$testDir/phpunit/languages/LanguageClassesTestCase.php", - - # tests/phpunit/maintenance - 'DumpTestCase' => "$testDir/phpunit/maintenance/DumpTestCase.php", - - # tests/parser - 'ParserTest' => "$testDir/parser/parserTest.inc", - 'ParserTestParserHook' => "$testDir/parser/parserTestsParserHook.php", -); diff --git a/tests/parser/ParserTestResult.php b/tests/parser/ParserTestResult.php deleted file mode 100644 index d9ad773d..00000000 --- a/tests/parser/ParserTestResult.php +++ /dev/null @@ -1,42 +0,0 @@ -description = $description; - } - - /** Whether the test passed */ - public function isSuccess() { - return $this->expected === $this->actual; - } -} diff --git a/tests/parser/README b/tests/parser/README deleted file mode 100644 index 8b413376..00000000 --- a/tests/parser/README +++ /dev/null @@ -1,8 +0,0 @@ -Parser tests are run using our PHPUnit test suite in tests/phpunit: - - $ cd tests/phpunit - ./phpunit.php --group Parser - -You can optionally filter by title using --regex. I.e. : - - ./phpunit.php --group Parser --regex="Bug 6200" diff --git a/tests/parser/extraParserTests.txt b/tests/parser/extraParserTests.txt deleted file mode 100644 index bef8f506..00000000 Binary files a/tests/parser/extraParserTests.txt and /dev/null differ diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc deleted file mode 100644 index 58ea1ed0..00000000 --- a/tests/parser/parserTest.inc +++ /dev/null @@ -1,1465 +0,0 @@ - - * http://www.mediawiki.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @todo Make this more independent of the configuration (and if possible the database) - * @todo document - * @file - * @ingroup Testing - */ - -/** - * @ingroup Testing - */ -class ParserTest { - /** - * @var bool $color whereas output should be colorized - */ - private $color; - - /** - * @var bool $showOutput Show test output - */ - private $showOutput; - - /** - * @var bool $useTemporaryTables Use temporary tables for the temporary database - */ - private $useTemporaryTables = true; - - /** - * @var bool $databaseSetupDone True if the database has been set up - */ - private $databaseSetupDone = false; - - /** - * Our connection to the database - * @var DatabaseBase - */ - private $db; - - /** - * Database clone helper - * @var CloneDatabase - */ - private $dbClone; - - /** - * @var string $oldTablePrefix Original table prefix - */ - private $oldTablePrefix; - - private $maxFuzzTestLength = 300; - private $fuzzSeed = 0; - private $memoryLimit = 50; - private $uploadDir = null; - - public $regex = ""; - private $savedGlobals = array(); - - /** - * Sets terminal colorization and diff/quick modes depending on OS and - * command-line options (--color and --quick). - */ - public function __construct( $options = array() ) { - # Only colorize output if stdout is a terminal. - $this->color = !wfIsWindows() && Maintenance::posix_isatty( 1 ); - - if ( isset( $options['color'] ) ) { - switch ( $options['color'] ) { - case 'no': - $this->color = false; - break; - case 'yes': - default: - $this->color = true; - break; - } - } - - $this->term = $this->color - ? new AnsiTermColorer() - : new DummyTermColorer(); - - $this->showDiffs = !isset( $options['quick'] ); - $this->showProgress = !isset( $options['quiet'] ); - $this->showFailure = !( - isset( $options['quiet'] ) - && ( isset( $options['record'] ) - || isset( $options['compare'] ) ) ); // redundant output - - $this->showOutput = isset( $options['show-output'] ); - - if ( isset( $options['filter'] ) ) { - $options['regex'] = $options['filter']; - } - - if ( isset( $options['regex'] ) ) { - if ( isset( $options['record'] ) ) { - echo "Warning: --record cannot be used with --regex, disabling --record\n"; - unset( $options['record'] ); - } - $this->regex = $options['regex']; - } else { - # Matches anything - $this->regex = ''; - } - - $this->setupRecorder( $options ); - $this->keepUploads = isset( $options['keep-uploads'] ); - - if ( isset( $options['seed'] ) ) { - $this->fuzzSeed = intval( $options['seed'] ) - 1; - } - - $this->runDisabled = isset( $options['run-disabled'] ); - $this->runParsoid = isset( $options['run-parsoid'] ); - - $this->hooks = array(); - $this->functionHooks = array(); - self::setUp(); - } - - static function setUp() { - global $wgParser, $wgParserConf, $IP, $messageMemc, $wgMemc, - $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgEnableParserCache, - $wgExtraNamespaces, $wgNamespaceAliases, $wgNamespaceProtection, $wgLocalFileRepo, - $parserMemc, $wgThumbnailScriptPath, $wgScriptPath, - $wgArticlePath, $wgScript, $wgStylePath, $wgExtensionAssetsPath, - $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgLockManagers; - - $wgScript = '/index.php'; - $wgScriptPath = '/'; - $wgArticlePath = '/wiki/$1'; - $wgStylePath = '/skins'; - $wgExtensionAssetsPath = '/extensions'; - $wgThumbnailScriptPath = false; - $wgLockManagers = array( array( - 'name' => 'fsLockManager', - 'class' => 'FSLockManager', - 'lockDirectory' => wfTempDir() . '/test-repo/lockdir', - ), array( - 'name' => 'nullLockManager', - 'class' => 'NullLockManager', - ) ); - $wgLocalFileRepo = array( - 'class' => 'LocalRepo', - 'name' => 'local', - 'url' => 'http://example.com/images', - 'hashLevels' => 2, - 'transformVia404' => false, - 'backend' => new FSFileBackend( array( - 'name' => 'local-backend', - 'lockManager' => 'fsLockManager', - 'containerPaths' => array( - 'local-public' => wfTempDir() . '/test-repo/public', - 'local-thumb' => wfTempDir() . '/test-repo/thumb', - 'local-temp' => wfTempDir() . '/test-repo/temp', - 'local-deleted' => wfTempDir() . '/test-repo/deleted', - ) - ) ) - ); - $wgNamespaceProtection[NS_MEDIAWIKI] = 'editinterface'; - $wgNamespaceAliases['Image'] = NS_FILE; - $wgNamespaceAliases['Image_talk'] = NS_FILE_TALK; - # add a namespace shadowing a interwiki link, to test - # proper precedence when resolving links. (bug 51680) - $wgExtraNamespaces[100] = 'MemoryAlpha'; - - // XXX: tests won't run without this (for CACHE_DB) - if ( $wgMainCacheType === CACHE_DB ) { - $wgMainCacheType = CACHE_NONE; - } - if ( $wgMessageCacheType === CACHE_DB ) { - $wgMessageCacheType = CACHE_NONE; - } - if ( $wgParserCacheType === CACHE_DB ) { - $wgParserCacheType = CACHE_NONE; - } - - $wgEnableParserCache = false; - DeferredUpdates::clearPendingUpdates(); - $wgMemc = wfGetMainCache(); // checks $wgMainCacheType - $messageMemc = wfGetMessageCacheStorage(); - $parserMemc = wfGetParserCacheStorage(); - - // $wgContLang = new StubContLang; - $wgUser = new User; - $context = new RequestContext; - $wgLang = $context->getLanguage(); - $wgOut = $context->getOutput(); - $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) ); - $wgRequest = $context->getRequest(); - - if ( $wgStyleDirectory === false ) { - $wgStyleDirectory = "$IP/skins"; - } - - self::setupInterwikis(); - } - - /** - * Insert hardcoded interwiki in the lookup table. - * - * This function insert a set of well known interwikis that are used in - * the parser tests. They can be considered has fixtures are injected in - * the interwiki cache by using the 'InterwikiLoadPrefix' hook. - * Since we are not interested in looking up interwikis in the database, - * the hook completely replace the existing mechanism (hook returns false). - */ - public static function setupInterwikis() { - # Hack: insert a few Wikipedia in-project interwiki prefixes, - # for testing inter-language links - Hooks::register( 'InterwikiLoadPrefix', function ( $prefix, &$iwData ) { - static $testInterwikis = array( - 'wikipedia' => array( - 'iw_url' => 'http://en.wikipedia.org/wiki/$1', - 'iw_api' => '', - 'iw_wikiid' => '', - 'iw_local' => 0 ), - 'meatball' => array( - 'iw_url' => 'http://www.usemod.com/cgi-bin/mb.pl?$1', - 'iw_api' => '', - 'iw_wikiid' => '', - 'iw_local' => 0 ), - 'memoryalpha' => array( - 'iw_url' => 'http://www.memory-alpha.org/en/index.php/$1', - 'iw_api' => '', - 'iw_wikiid' => '', - 'iw_local' => 0 ), - 'zh' => array( - 'iw_url' => 'http://zh.wikipedia.org/wiki/$1', - 'iw_api' => '', - 'iw_wikiid' => '', - 'iw_local' => 1 ), - 'es' => array( - 'iw_url' => 'http://es.wikipedia.org/wiki/$1', - 'iw_api' => '', - 'iw_wikiid' => '', - 'iw_local' => 1 ), - 'fr' => array( - 'iw_url' => 'http://fr.wikipedia.org/wiki/$1', - 'iw_api' => '', - 'iw_wikiid' => '', - 'iw_local' => 1 ), - 'ru' => array( - 'iw_url' => 'http://ru.wikipedia.org/wiki/$1', - 'iw_api' => '', - 'iw_wikiid' => '', - 'iw_local' => 1 ), - ); - if ( array_key_exists( $prefix, $testInterwikis ) ) { - $iwData = $testInterwikis[$prefix]; - } - - // We only want to rely on the above fixtures - return false; - } );// hooks::register - } - - /** - * Remove the hardcoded interwiki lookup table. - */ - public static function tearDownInterwikis() { - Hooks::clear( 'InterwikiLoadPrefix' ); - } - - public function setupRecorder( $options ) { - if ( isset( $options['record'] ) ) { - $this->recorder = new DbTestRecorder( $this ); - $this->recorder->version = isset( $options['setversion'] ) ? - $options['setversion'] : SpecialVersion::getVersion(); - } elseif ( isset( $options['compare'] ) ) { - $this->recorder = new DbTestPreviewer( $this ); - } else { - $this->recorder = new TestRecorder( $this ); - } - } - - /** - * Remove last character if it is a newline - * @group utility - */ - public static function chomp( $s ) { - if ( substr( $s, -1 ) === "\n" ) { - return substr( $s, 0, -1 ); - } else { - return $s; - } - } - - /** - * Run a fuzz test series - * Draw input from a set of test files - */ - function fuzzTest( $filenames ) { - $GLOBALS['wgContLang'] = Language::factory( 'en' ); - $dict = $this->getFuzzInput( $filenames ); - $dictSize = strlen( $dict ); - $logMaxLength = log( $this->maxFuzzTestLength ); - $this->setupDatabase(); - ini_set( 'memory_limit', $this->memoryLimit * 1048576 ); - - $numTotal = 0; - $numSuccess = 0; - $user = new User; - $opts = ParserOptions::newFromUser( $user ); - $title = Title::makeTitle( NS_MAIN, 'Parser_test' ); - - while ( true ) { - // Generate test input - mt_srand( ++$this->fuzzSeed ); - $totalLength = mt_rand( 1, $this->maxFuzzTestLength ); - $input = ''; - - while ( strlen( $input ) < $totalLength ) { - $logHairLength = mt_rand( 0, 1000000 ) / 1000000 * $logMaxLength; - $hairLength = min( intval( exp( $logHairLength ) ), $dictSize ); - $offset = mt_rand( 0, $dictSize - $hairLength ); - $input .= substr( $dict, $offset, $hairLength ); - } - - $this->setupGlobals(); - $parser = $this->getParser(); - - // Run the test - try { - $parser->parse( $input, $title, $opts ); - $fail = false; - } catch ( Exception $exception ) { - $fail = true; - } - - if ( $fail ) { - echo "Test failed with seed {$this->fuzzSeed}\n"; - echo "Input:\n"; - printf( "string(%d) \"%s\"\n\n", strlen( $input ), $input ); - echo "$exception\n"; - } else { - $numSuccess++; - } - - $numTotal++; - $this->teardownGlobals(); - $parser->__destruct(); - - if ( $numTotal % 100 == 0 ) { - $usage = intval( memory_get_usage( true ) / $this->memoryLimit / 1048576 * 100 ); - echo "{$this->fuzzSeed}: $numSuccess/$numTotal (mem: $usage%)\n"; - if ( $usage > 90 ) { - echo "Out of memory:\n"; - $memStats = $this->getMemoryBreakdown(); - - foreach ( $memStats as $name => $usage ) { - echo "$name: $usage\n"; - } - $this->abort(); - } - } - } - } - - /** - * Get an input dictionary from a set of parser test files - */ - function getFuzzInput( $filenames ) { - $dict = ''; - - foreach ( $filenames as $filename ) { - $contents = file_get_contents( $filename ); - preg_match_all( '/!!\s*input\n(.*?)\n!!\s*result/s', $contents, $matches ); - - foreach ( $matches[1] as $match ) { - $dict .= $match . "\n"; - } - } - - return $dict; - } - - /** - * Get a memory usage breakdown - */ - function getMemoryBreakdown() { - $memStats = array(); - - foreach ( $GLOBALS as $name => $value ) { - $memStats['$' . $name] = strlen( serialize( $value ) ); - } - - $classes = get_declared_classes(); - - foreach ( $classes as $class ) { - $rc = new ReflectionClass( $class ); - $props = $rc->getStaticProperties(); - $memStats[$class] = strlen( serialize( $props ) ); - $methods = $rc->getMethods(); - - foreach ( $methods as $method ) { - $memStats[$class] += strlen( serialize( $method->getStaticVariables() ) ); - } - } - - $functions = get_defined_functions(); - - foreach ( $functions['user'] as $function ) { - $rf = new ReflectionFunction( $function ); - $memStats["$function()"] = strlen( serialize( $rf->getStaticVariables() ) ); - } - - asort( $memStats ); - - return $memStats; - } - - function abort() { - $this->abort(); - } - - /** - * Run a series of tests listed in the given text files. - * Each test consists of a brief description, wikitext input, - * and the expected HTML output. - * - * Prints status updates on stdout and counts up the total - * number and percentage of passed tests. - * - * @param $filenames Array of strings - * @return Boolean: true if passed all tests, false if any tests failed. - */ - public function runTestsFromFiles( $filenames ) { - $ok = false; - - // be sure, ParserTest::addArticle has correct language set, - // so that system messages gets into the right language cache - $GLOBALS['wgLanguageCode'] = 'en'; - $GLOBALS['wgContLang'] = Language::factory( 'en' ); - - $this->recorder->start(); - try { - $this->setupDatabase(); - $ok = true; - - foreach ( $filenames as $filename ) { - $tests = new TestFileIterator( $filename, $this ); - $ok = $this->runTests( $tests ) && $ok; - } - - $this->teardownDatabase(); - $this->recorder->report(); - } catch ( DBError $e ) { - echo $e->getMessage(); - } - $this->recorder->end(); - - return $ok; - } - - function runTests( $tests ) { - $ok = true; - - foreach ( $tests as $t ) { - $result = - $this->runTest( $t['test'], $t['input'], $t['result'], $t['options'], $t['config'] ); - $ok = $ok && $result; - $this->recorder->record( $t['test'], $result ); - } - - if ( $this->showProgress ) { - print "\n"; - } - - return $ok; - } - - /** - * Get a Parser object - * - * @param string $preprocessor - * @return Parser - */ - function getParser( $preprocessor = null ) { - global $wgParserConf; - - $class = $wgParserConf['class']; - $parser = new $class( array( 'preprocessorClass' => $preprocessor ) + $wgParserConf ); - - foreach ( $this->hooks as $tag => $callback ) { - $parser->setHook( $tag, $callback ); - } - - foreach ( $this->functionHooks as $tag => $bits ) { - list( $callback, $flags ) = $bits; - $parser->setFunctionHook( $tag, $callback, $flags ); - } - - wfRunHooks( 'ParserTestParser', array( &$parser ) ); - - return $parser; - } - - /** - * Run a given wikitext input through a freshly-constructed wiki parser, - * and compare the output against the expected results. - * Prints status and explanatory messages to stdout. - * - * @param $desc String: test's description - * @param $input String: wikitext to try rendering - * @param $result String: result to output - * @param $opts Array: test's options - * @param $config String: overrides for global variables, one per line - * @return Boolean - */ - public function runTest( $desc, $input, $result, $opts, $config ) { - if ( $this->showProgress ) { - $this->showTesting( $desc ); - } - - $opts = $this->parseOptions( $opts ); - $context = $this->setupGlobals( $opts, $config ); - - $user = $context->getUser(); - $options = ParserOptions::newFromContext( $context ); - - if ( isset( $opts['title'] ) ) { - $titleText = $opts['title']; - } else { - $titleText = 'Parser test'; - } - - $local = isset( $opts['local'] ); - $preprocessor = isset( $opts['preprocessor'] ) ? $opts['preprocessor'] : null; - $parser = $this->getParser( $preprocessor ); - $title = Title::newFromText( $titleText ); - - if ( isset( $opts['pst'] ) ) { - $out = $parser->preSaveTransform( $input, $title, $user, $options ); - } elseif ( isset( $opts['msg'] ) ) { - $out = $parser->transformMsg( $input, $options, $title ); - } elseif ( isset( $opts['section'] ) ) { - $section = $opts['section']; - $out = $parser->getSection( $input, $section ); - } elseif ( isset( $opts['replace'] ) ) { - $section = $opts['replace'][0]; - $replace = $opts['replace'][1]; - $out = $parser->replaceSection( $input, $section, $replace ); - } elseif ( isset( $opts['comment'] ) ) { - $out = Linker::formatComment( $input, $title, $local ); - } elseif ( isset( $opts['preload'] ) ) { - $out = $parser->getPreloadText( $input, $title, $options ); - } else { - $output = $parser->parse( $input, $title, $options, true, true, 1337 ); - $output->setTOCEnabled( !isset( $opts['notoc'] ) ); - $out = $output->getText(); - - if ( isset( $opts['showtitle'] ) ) { - if ( $output->getTitleText() ) { - $title = $output->getTitleText(); - } - - $out = "$title\n$out"; - } - - if ( isset( $opts['ill'] ) ) { - $out = $this->tidy( implode( ' ', $output->getLanguageLinks() ) ); - } elseif ( isset( $opts['cat'] ) ) { - $outputPage = $context->getOutput(); - $outputPage->addCategoryLinks( $output->getCategories() ); - $cats = $outputPage->getCategoryLinks(); - - if ( isset( $cats['normal'] ) ) { - $out = $this->tidy( implode( ' ', $cats['normal'] ) ); - } else { - $out = ''; - } - } - - $result = $this->tidy( $result ); - } - - $this->teardownGlobals(); - - $testResult = new ParserTestResult( $desc ); - $testResult->expected = $result; - $testResult->actual = $out; - - return $this->showTestResult( $testResult ); - } - - /** - * Refactored in 1.22 to use ParserTestResult - */ - function showTestResult( ParserTestResult $testResult ) { - if ( $testResult->isSuccess() ) { - $this->showSuccess( $testResult ); - return true; - } else { - $this->showFailure( $testResult ); - return false; - } - } - - /** - * Use a regex to find out the value of an option - * @param $key String: name of option val to retrieve - * @param $opts array: Options array to look in - * @param $default Mixed: default value returned if not found - */ - private static function getOptionValue( $key, $opts, $default ) { - $key = strtolower( $key ); - - if ( isset( $opts[$key] ) ) { - return $opts[$key]; - } else { - return $default; - } - } - - private function parseOptions( $instring ) { - $opts = array(); - // foo - // foo=bar - // foo="bar baz" - // foo=[[bar baz]] - // foo=bar,"baz quux" - $regex = '/\b - ([\w-]+) # Key - \b - (?:\s* - = # First sub-value - \s* - ( - " - [^"]* # Quoted val - " - | - \[\[ - [^]]* # Link target - \]\] - | - [\w-]+ # Plain word - ) - (?:\s* - , # Sub-vals 1..N - \s* - ( - "[^"]*" # Quoted val - | - \[\[[^]]*\]\] # Link target - | - [\w-]+ # Plain word - ) - )* - )? - /x'; - - if ( preg_match_all( $regex, $instring, $matches, PREG_SET_ORDER ) ) { - foreach ( $matches as $bits ) { - array_shift( $bits ); - $key = strtolower( array_shift( $bits ) ); - if ( count( $bits ) == 0 ) { - $opts[$key] = true; - } elseif ( count( $bits ) == 1 ) { - $opts[$key] = $this->cleanupOption( array_shift( $bits ) ); - } else { - // Array! - $opts[$key] = array_map( array( $this, 'cleanupOption' ), $bits ); - } - } - } - return $opts; - } - - private function cleanupOption( $opt ) { - if ( substr( $opt, 0, 1 ) == '"' ) { - return substr( $opt, 1, -1 ); - } - - if ( substr( $opt, 0, 2 ) == '[[' ) { - return substr( $opt, 2, -2 ); - } - return $opt; - } - - /** - * Set up the global variables for a consistent environment for each test. - * Ideally this should replace the global configuration entirely. - */ - private function setupGlobals( $opts = '', $config = '' ) { - # Find out values for some special options. - $lang = - self::getOptionValue( 'language', $opts, 'en' ); - $variant = - self::getOptionValue( 'variant', $opts, false ); - $maxtoclevel = - self::getOptionValue( 'wgMaxTocLevel', $opts, 999 ); - $linkHolderBatchSize = - self::getOptionValue( 'wgLinkHolderBatchSize', $opts, 1000 ); - - $settings = array( - 'wgServer' => 'http://example.org', - 'wgScript' => '/index.php', - 'wgScriptPath' => '/', - 'wgArticlePath' => '/wiki/$1', - 'wgActionPaths' => array(), - 'wgLockManagers' => array( array( - 'name' => 'fsLockManager', - 'class' => 'FSLockManager', - 'lockDirectory' => $this->uploadDir . '/lockdir', - ), array( - 'name' => 'nullLockManager', - 'class' => 'NullLockManager', - ) ), - 'wgLocalFileRepo' => array( - 'class' => 'LocalRepo', - 'name' => 'local', - 'url' => 'http://example.com/images', - 'hashLevels' => 2, - 'transformVia404' => false, - 'backend' => new FSFileBackend( array( - 'name' => 'local-backend', - 'lockManager' => 'fsLockManager', - 'containerPaths' => array( - 'local-public' => $this->uploadDir, - 'local-thumb' => $this->uploadDir . '/thumb', - 'local-temp' => $this->uploadDir . '/temp', - 'local-deleted' => $this->uploadDir . '/delete', - ) - ) ) - ), - 'wgEnableUploads' => self::getOptionValue( 'wgEnableUploads', $opts, true ), - 'wgStylePath' => '/skins', - 'wgSitename' => 'MediaWiki', - 'wgLanguageCode' => $lang, - 'wgDBprefix' => $this->db->getType() != 'oracle' ? 'parsertest_' : 'pt_', - 'wgRawHtml' => self::getOptionValue( 'wgRawHtml', $opts, false ), - 'wgLang' => null, - 'wgContLang' => null, - 'wgNamespacesWithSubpages' => array( 0 => isset( $opts['subpage'] ) ), - 'wgMaxTocLevel' => $maxtoclevel, - 'wgCapitalLinks' => true, - 'wgNoFollowLinks' => true, - 'wgNoFollowDomainExceptions' => array(), - 'wgThumbnailScriptPath' => false, - 'wgUseImageResize' => true, - 'wgSVGConverter' => 'null', - 'wgSVGConverters' => array( 'null' => 'echo "1">$output' ), - 'wgLocaltimezone' => 'UTC', - 'wgAllowExternalImages' => self::getOptionValue( 'wgAllowExternalImages', $opts, true ), - 'wgUseTidy' => false, - 'wgDefaultLanguageVariant' => $variant, - 'wgVariantArticlePath' => false, - 'wgGroupPermissions' => array( '*' => array( - 'createaccount' => true, - 'read' => true, - 'edit' => true, - 'createpage' => true, - 'createtalk' => true, - ) ), - 'wgNamespaceProtection' => array( NS_MEDIAWIKI => 'editinterface' ), - 'wgDefaultExternalStore' => array(), - 'wgForeignFileRepos' => array(), - 'wgLinkHolderBatchSize' => $linkHolderBatchSize, - 'wgExperimentalHtmlIds' => false, - 'wgExternalLinkTarget' => false, - 'wgAlwaysUseTidy' => false, - 'wgHtml5' => true, - 'wgWellFormedXml' => true, - 'wgAllowMicrodataAttributes' => true, - 'wgAdaptiveMessageCache' => true, - 'wgDisableLangConversion' => false, - 'wgDisableTitleConversion' => false, - ); - - if ( $config ) { - $configLines = explode( "\n", $config ); - - foreach ( $configLines as $line ) { - list( $var, $value ) = explode( '=', $line, 2 ); - - $settings[$var] = eval( "return $value;" ); - } - } - - $this->savedGlobals = array(); - - /** @since 1.20 */ - wfRunHooks( 'ParserTestGlobals', array( &$settings ) ); - - foreach ( $settings as $var => $val ) { - if ( array_key_exists( $var, $GLOBALS ) ) { - $this->savedGlobals[$var] = $GLOBALS[$var]; - } - - $GLOBALS[$var] = $val; - } - - $GLOBALS['wgContLang'] = Language::factory( $lang ); - $GLOBALS['wgMemc'] = new EmptyBagOStuff; - - $context = new RequestContext(); - $GLOBALS['wgLang'] = $context->getLanguage(); - $GLOBALS['wgOut'] = $context->getOutput(); - - $GLOBALS['wgUser'] = new User(); - - global $wgHooks; - - $wgHooks['ParserTestParser'][] = 'ParserTestParserHook::setup'; - $wgHooks['ParserGetVariableValueTs'][] = 'ParserTest::getFakeTimestamp'; - - MagicWord::clearCache(); - - return $context; - } - - /** - * List of temporary tables to create, without prefix. - * Some of these probably aren't necessary. - */ - private function listTables() { - $tables = array( 'user', 'user_properties', 'user_former_groups', 'page', 'page_restrictions', - 'protected_titles', 'revision', 'text', 'pagelinks', 'imagelinks', - 'categorylinks', 'templatelinks', 'externallinks', 'langlinks', 'iwlinks', - 'site_stats', 'hitcounter', 'ipblocks', 'image', 'oldimage', - 'recentchanges', 'watchlist', 'interwiki', 'logging', - 'querycache', 'objectcache', 'job', 'l10n_cache', 'redirect', 'querycachetwo', - 'archive', 'user_groups', 'page_props', 'category', 'msg_resource', 'msg_resource_links' - ); - - if ( in_array( $this->db->getType(), array( 'mysql', 'sqlite', 'oracle' ) ) ) { - array_push( $tables, 'searchindex' ); - } - - // Allow extensions to add to the list of tables to duplicate; - // may be necessary if they hook into page save or other code - // which will require them while running tests. - wfRunHooks( 'ParserTestTables', array( &$tables ) ); - - return $tables; - } - - /** - * Set up a temporary set of wiki tables to work with for the tests. - * Currently this will only be done once per run, and any changes to - * the db will be visible to later tests in the run. - */ - public function setupDatabase() { - global $wgDBprefix; - - if ( $this->databaseSetupDone ) { - return; - } - - $this->db = wfGetDB( DB_MASTER ); - $dbType = $this->db->getType(); - - if ( $wgDBprefix === 'parsertest_' || ( $dbType == 'oracle' && $wgDBprefix === 'pt_' ) ) { - throw new MWException( 'setupDatabase should be called before setupGlobals' ); - } - - $this->databaseSetupDone = true; - $this->oldTablePrefix = $wgDBprefix; - - # SqlBagOStuff broke when using temporary tables on r40209 (bug 15892). - # It seems to have been fixed since (r55079?), but regressed at some point before r85701. - # This works around it for now... - ObjectCache::$instances[CACHE_DB] = new HashBagOStuff; - - # CREATE TEMPORARY TABLE breaks if there is more than one server - if ( wfGetLB()->getServerCount() != 1 ) { - $this->useTemporaryTables = false; - } - - $temporary = $this->useTemporaryTables || $dbType == 'postgres'; - $prefix = $dbType != 'oracle' ? 'parsertest_' : 'pt_'; - - $this->dbClone = new CloneDatabase( $this->db, $this->listTables(), $prefix ); - $this->dbClone->useTemporaryTables( $temporary ); - $this->dbClone->cloneTableStructure(); - - if ( $dbType == 'oracle' ) { - $this->db->query( 'BEGIN FILL_WIKI_INFO; END;' ); - # Insert 0 user to prevent FK violations - - # Anonymous user - $this->db->insert( 'user', array( - 'user_id' => 0, - 'user_name' => 'Anonymous' ) ); - } - - # Update certain things in site_stats - $this->db->insert( 'site_stats', - array( 'ss_row_id' => 1, 'ss_images' => 2, 'ss_good_articles' => 1 ) ); - - # Reinitialise the LocalisationCache to match the database state - Language::getLocalisationCache()->unloadAll(); - - # Clear the message cache - MessageCache::singleton()->clear(); - - // Remember to update newParserTests.php after changing the below - // (and it uses a slightly different syntax just for teh lulz) - $this->uploadDir = $this->setupUploadDir(); - $user = User::createNew( 'WikiSysop' ); - $image = wfLocalFile( Title::makeTitle( NS_FILE, 'Foobar.jpg' ) ); - # note that the size/width/height/bits/etc of the file - # are actually set by inspecting the file itself; the arguments - # to recordUpload2 have no effect. That said, we try to make things - # match up so it is less confusing to readers of the code & tests. - $image->recordUpload2( '', 'Upload of some lame file', 'Some lame file', array( - 'size' => 7881, - 'width' => 1941, - 'height' => 220, - 'bits' => 8, - 'media_type' => MEDIATYPE_BITMAP, - 'mime' => 'image/jpeg', - 'metadata' => serialize( array() ), - 'sha1' => wfBaseConvert( '1', 16, 36, 31 ), - 'fileExists' => true - ), $this->db->timestamp( '20010115123500' ), $user ); - - $image = wfLocalFile( Title::makeTitle( NS_FILE, 'Thumb.png' ) ); - # again, note that size/width/height below are ignored; see above. - $image->recordUpload2( '', 'Upload of some lame thumbnail', 'Some lame thumbnail', array( - 'size' => 22589, - 'width' => 135, - 'height' => 135, - 'bits' => 8, - 'media_type' => MEDIATYPE_BITMAP, - 'mime' => 'image/png', - 'metadata' => serialize( array() ), - 'sha1' => wfBaseConvert( '2', 16, 36, 31 ), - 'fileExists' => true - ), $this->db->timestamp( '20130225203040' ), $user ); - - $image = wfLocalFile( Title::makeTitle( NS_FILE, 'Foobar.svg' ) ); - $image->recordUpload2( '', 'Upload of some lame SVG', 'Some lame SVG', array( - 'size' => 12345, - 'width' => 240, - 'height' => 180, - 'bits' => 24, - 'media_type' => MEDIATYPE_DRAWING, - 'mime' => 'image/svg+xml', - 'metadata' => serialize( array() ), - 'sha1' => wfBaseConvert( '', 16, 36, 31 ), - 'fileExists' => true - ), $this->db->timestamp( '20010115123500' ), $user ); - - # This image will be blacklisted in [[MediaWiki:Bad image list]] - $image = wfLocalFile( Title::makeTitle( NS_FILE, 'Bad.jpg' ) ); - $image->recordUpload2( '', 'zomgnotcensored', 'Borderline image', array( - 'size' => 12345, - 'width' => 320, - 'height' => 240, - 'bits' => 24, - 'media_type' => MEDIATYPE_BITMAP, - 'mime' => 'image/jpeg', - 'metadata' => serialize( array() ), - 'sha1' => wfBaseConvert( '3', 16, 36, 31 ), - 'fileExists' => true - ), $this->db->timestamp( '20010115123500' ), $user ); - } - - public function teardownDatabase() { - if ( !$this->databaseSetupDone ) { - $this->teardownGlobals(); - return; - } - $this->teardownUploadDir( $this->uploadDir ); - - $this->dbClone->destroy(); - $this->databaseSetupDone = false; - - if ( $this->useTemporaryTables ) { - if ( $this->db->getType() == 'sqlite' ) { - # Under SQLite the searchindex table is virtual and need - # to be explicitly destroyed. See bug 29912 - # See also MediaWikiTestCase::destroyDB() - wfDebug( __METHOD__ . " explicitly destroying sqlite virtual table parsertest_searchindex\n" ); - $this->db->query( "DROP TABLE `parsertest_searchindex`" ); - } - # Don't need to do anything - $this->teardownGlobals(); - return; - } - - $tables = $this->listTables(); - - foreach ( $tables as $table ) { - if ( $this->db->getType() == 'oracle' ) { - $this->db->query( "DROP TABLE pt_$table DROP CONSTRAINTS" ); - } else { - $this->db->query( "DROP TABLE `parsertest_$table`" ); - } - } - - if ( $this->db->getType() == 'oracle' ) { - $this->db->query( 'BEGIN FILL_WIKI_INFO; END;' ); - } - - $this->teardownGlobals(); - } - - /** - * Create a dummy uploads directory which will contain a couple - * of files in order to pass existence tests. - * - * @return String: the directory - */ - private function setupUploadDir() { - global $IP; - - if ( $this->keepUploads ) { - $dir = wfTempDir() . '/mwParser-images'; - - if ( is_dir( $dir ) ) { - return $dir; - } - } else { - $dir = wfTempDir() . "/mwParser-" . mt_rand() . "-images"; - } - - // wfDebug( "Creating upload directory $dir\n" ); - if ( file_exists( $dir ) ) { - wfDebug( "Already exists!\n" ); - return $dir; - } - - wfMkdirParents( $dir . '/3/3a', null, __METHOD__ ); - copy( "$IP/skins/monobook/headbg.jpg", "$dir/3/3a/Foobar.jpg" ); - wfMkdirParents( $dir . '/e/ea', null, __METHOD__ ); - copy( "$IP/skins/monobook/wiki.png", "$dir/e/ea/Thumb.png" ); - wfMkdirParents( $dir . '/0/09', null, __METHOD__ ); - copy( "$IP/skins/monobook/headbg.jpg", "$dir/0/09/Bad.jpg" ); - wfMkdirParents( $dir . '/f/ff', null, __METHOD__ ); - copy( "$IP/skins/monobook/headbg.jpg", "$dir/f/ff/Foobar.svg" ); - file_put_contents( "$dir/f/ff/Foobar.svg", - '' . - '' ); - return $dir; - } - - /** - * Restore default values and perform any necessary clean-up - * after each test runs. - */ - private function teardownGlobals() { - RepoGroup::destroySingleton(); - FileBackendGroup::destroySingleton(); - LockManagerGroup::destroySingletons(); - LinkCache::singleton()->clear(); - - foreach ( $this->savedGlobals as $var => $val ) { - $GLOBALS[$var] = $val; - } - } - - /** - * Remove the dummy uploads directory - */ - private function teardownUploadDir( $dir ) { - if ( $this->keepUploads ) { - return; - } - - // delete the files first, then the dirs. - self::deleteFiles( - array( - "$dir/3/3a/Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/20px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/30px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/40px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/960px-Foobar.jpg", - - "$dir/e/ea/Thumb.png", - - "$dir/0/09/Bad.jpg", - - "$dir/f/ff/Foobar.svg", - "$dir/thumb/f/ff/Foobar.svg/180px-Foobar.svg.png", - "$dir/thumb/f/ff/Foobar.svg/360px-Foobar.svg.png", - "$dir/thumb/f/ff/Foobar.svg/langde-270px-Foobar.svg.png", - "$dir/thumb/f/ff/Foobar.svg/270px-Foobar.svg.png", - "$dir/thumb/f/ff/Foobar.svg/langde-180px-Foobar.svg.png", - "$dir/thumb/f/ff/Foobar.svg/langde-360px-Foobar.svg.png", - - "$dir/math/f/a/5/fa50b8b616463173474302ca3e63586b.png", - ) - ); - - self::deleteDirs( - array( - "$dir/3/3a", - "$dir/3", - "$dir/thumb/6/65", - "$dir/thumb/6", - "$dir/thumb/3/3a/Foobar.jpg", - "$dir/thumb/3/3a", - "$dir/thumb/3", - "$dir/e/ea", - "$dir/e", - "$dir/f/ff/", - "$dir/f/", - "$dir/thumb/f/ff/Foobar.svg", - "$dir/thumb/f/ff/", - "$dir/thumb/f/", - "$dir/0/09/", - "$dir/0/", - "$dir/thumb", - "$dir/math/f/a/5", - "$dir/math/f/a", - "$dir/math/f", - "$dir/math", - "$dir", - ) - ); - } - - /** - * Delete the specified files, if they exist. - * @param $files Array: full paths to files to delete. - */ - private static function deleteFiles( $files ) { - foreach ( $files as $file ) { - if ( file_exists( $file ) ) { - unlink( $file ); - } - } - } - - /** - * Delete the specified directories, if they exist. Must be empty. - * @param $dirs Array: full paths to directories to delete. - */ - private static function deleteDirs( $dirs ) { - foreach ( $dirs as $dir ) { - if ( is_dir( $dir ) ) { - rmdir( $dir ); - } - } - } - - /** - * "Running test $desc..." - */ - protected function showTesting( $desc ) { - print "Running test $desc... "; - } - - /** - * Print a happy success message. - * - * Refactored in 1.22 to use ParserTestResult - * - * @param $testResult ParserTestResult - * @return Boolean - */ - protected function showSuccess( ParserTestResult $testResult ) { - if ( $this->showProgress ) { - print $this->term->color( '1;32' ) . 'PASSED' . $this->term->reset() . "\n"; - } - - return true; - } - - /** - * Print a failure message and provide some explanatory output - * about what went wrong if so configured. - * - * Refactored in 1.22 to use ParserTestResult - * - * @param $testResult ParserTestResult - * @return Boolean - */ - protected function showFailure( ParserTestResult $testResult ) { - if ( $this->showFailure ) { - if ( !$this->showProgress ) { - # In quiet mode we didn't show the 'Testing' message before the - # test, in case it succeeded. Show it now: - $this->showTesting( $testResult->description ); - } - - print $this->term->color( '31' ) . 'FAILED!' . $this->term->reset() . "\n"; - - if ( $this->showOutput ) { - print "--- Expected ---\n{$testResult->expected}\n"; - print "--- Actual ---\n{$testResult->actual}\n"; - } - - if ( $this->showDiffs ) { - print $this->quickDiff( $testResult->expected, $testResult->actual ); - if ( !$this->wellFormed( $testResult->actual ) ) { - print "XML error: $this->mXmlError\n"; - } - } - } - - return false; - } - - /** - * Run given strings through a diff and return the (colorized) output. - * Requires writable /tmp directory and a 'diff' command in the PATH. - * - * @param $input String - * @param $output String - * @param $inFileTail String: tailing for the input file name - * @param $outFileTail String: tailing for the output file name - * @return String - */ - protected function quickDiff( $input, $output, - $inFileTail = 'expected', $outFileTail = 'actual' - ) { - # Windows, or at least the fc utility, is retarded - $slash = wfIsWindows() ? '\\' : '/'; - $prefix = wfTempDir() . "{$slash}mwParser-" . mt_rand(); - - $infile = "$prefix-$inFileTail"; - $this->dumpToFile( $input, $infile ); - - $outfile = "$prefix-$outFileTail"; - $this->dumpToFile( $output, $outfile ); - - $shellInfile = wfEscapeShellArg( $infile ); - $shellOutfile = wfEscapeShellArg( $outfile ); - - global $wgDiff3; - // we assume that people with diff3 also have usual diff - $shellCommand = ( wfIsWindows() && !$wgDiff3 ) ? 'fc' : 'diff -au'; - - $diff = wfShellExec( "$shellCommand $shellInfile $shellOutfile" ); - - unlink( $infile ); - unlink( $outfile ); - - return $this->colorDiff( $diff ); - } - - /** - * Write the given string to a file, adding a final newline. - * - * @param $data String - * @param $filename String - */ - private function dumpToFile( $data, $filename ) { - $file = fopen( $filename, "wt" ); - fwrite( $file, $data . "\n" ); - fclose( $file ); - } - - /** - * Colorize unified diff output if set for ANSI color output. - * Subtractions are colored blue, additions red. - * - * @param $text String - * @return String - */ - protected function colorDiff( $text ) { - return preg_replace( - array( '/^(-.*)$/m', '/^(\+.*)$/m' ), - array( $this->term->color( 34 ) . '$1' . $this->term->reset(), - $this->term->color( 31 ) . '$1' . $this->term->reset() ), - $text ); - } - - /** - * Show "Reading tests from ..." - * - * @param $path String - */ - public function showRunFile( $path ) { - print $this->term->color( 1 ) . - "Reading tests from \"$path\"..." . - $this->term->reset() . - "\n"; - } - - /** - * Insert a temporary test article - * @param $name String: the title, including any prefix - * @param $text String: the article text - * @param $line Integer: the input line number, for reporting errors - * @param $ignoreDuplicate Boolean: whether to silently ignore duplicate pages - */ - public static function addArticle( $name, $text, $line = 'unknown', $ignoreDuplicate = '' ) { - global $wgCapitalLinks; - - $oldCapitalLinks = $wgCapitalLinks; - $wgCapitalLinks = true; // We only need this from SetupGlobals() See r70917#c8637 - - $text = self::chomp( $text ); - $name = self::chomp( $name ); - - $title = Title::newFromText( $name ); - - if ( is_null( $title ) ) { - throw new MWException( "invalid title '$name' at line $line\n" ); - } - - $page = WikiPage::factory( $title ); - $page->loadPageData( 'fromdbmaster' ); - - if ( $page->exists() ) { - if ( $ignoreDuplicate == 'ignoreduplicate' ) { - return; - } else { - throw new MWException( "duplicate article '$name' at line $line\n" ); - } - } - - $page->doEditContent( ContentHandler::makeContent( $text, $title ), '', EDIT_NEW ); - - $wgCapitalLinks = $oldCapitalLinks; - } - - /** - * Steal a callback function from the primary parser, save it for - * application to our scary parser. If the hook is not installed, - * abort processing of this file. - * - * @param $name String - * @return Bool true if tag hook is present - */ - public function requireHook( $name ) { - global $wgParser; - - $wgParser->firstCallInit(); // make sure hooks are loaded. - - if ( isset( $wgParser->mTagHooks[$name] ) ) { - $this->hooks[$name] = $wgParser->mTagHooks[$name]; - } else { - echo " This test suite requires the '$name' hook extension, skipping.\n"; - return false; - } - - return true; - } - - /** - * Steal a callback function from the primary parser, save it for - * application to our scary parser. If the hook is not installed, - * abort processing of this file. - * - * @param $name String - * @return Bool true if function hook is present - */ - public function requireFunctionHook( $name ) { - global $wgParser; - - $wgParser->firstCallInit(); // make sure hooks are loaded. - - if ( isset( $wgParser->mFunctionHooks[$name] ) ) { - $this->functionHooks[$name] = $wgParser->mFunctionHooks[$name]; - } else { - echo " This test suite requires the '$name' function hook extension, skipping.\n"; - return false; - } - - return true; - } - - /** - * Run the "tidy" command on text if the $wgUseTidy - * global is true - * - * @param $text String: the text to tidy - * @return String - */ - private function tidy( $text ) { - global $wgUseTidy; - - if ( $wgUseTidy ) { - $text = MWTidy::tidy( $text ); - } - - return $text; - } - - private function wellFormed( $text ) { - $html = - Sanitizer::hackDocType() . - '' . - $text . - ''; - - $parser = xml_parser_create( "UTF-8" ); - - # case folding violates XML standard, turn it off - xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, false ); - - if ( !xml_parse( $parser, $html, true ) ) { - $err = xml_error_string( xml_get_error_code( $parser ) ); - $position = xml_get_current_byte_index( $parser ); - $fragment = $this->extractFragment( $html, $position ); - $this->mXmlError = "$err at byte $position:\n$fragment"; - xml_parser_free( $parser ); - - return false; - } - - xml_parser_free( $parser ); - - return true; - } - - private function extractFragment( $text, $position ) { - $start = max( 0, $position - 10 ); - $before = $position - $start; - $fragment = '...' . - $this->term->color( 34 ) . - substr( $text, $start, $before ) . - $this->term->color( 0 ) . - $this->term->color( 31 ) . - $this->term->color( 1 ) . - substr( $text, $position, 1 ) . - $this->term->color( 0 ) . - $this->term->color( 34 ) . - substr( $text, $position + 1, 9 ) . - $this->term->color( 0 ) . - '...'; - $display = str_replace( "\n", ' ', $fragment ); - $caret = ' ' . - str_repeat( ' ', $before ) . - $this->term->color( 31 ) . - '^' . - $this->term->color( 0 ); - - return "$display\n$caret"; - } - - static function getFakeTimestamp( &$parser, &$ts ) { - $ts = 123; //parsed as '1970-01-01T00:02:03Z' - return true; - } -} diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt deleted file mode 100644 index 9658e8f8..00000000 --- a/tests/parser/parserTests.txt +++ /dev/null @@ -1,18591 +0,0 @@ -# MediaWiki Parser test cases -# Some taken from http://meta.wikimedia.org/wiki/Parser_testing -# All (C) their respective authors and released under the GPL -# -# The syntax should be fairly self-explanatory. -# -# Currently supported test options: -# One of the following three: -# -# (default) generate HTML output -# pst apply pre-save transform -# msg apply message transform -# -# Plus any combination of these: -# -# cat add category links -# ill add inter-language links -# subpage enable subpages (disabled by default) -# noxml don't check for XML well formdness -# title=[[XXX]] run test using article title XXX -# language=XXX set content language to XXX for this test -# variant=XXX set the variant of language for this test (eg zh-tw) -# disabled do not run test -# parsoid parsoid-only test (not run by PHP parser) -# php php-only test (not run by the parsoid parser) -# showtitle make the first line the title -# comment run through Linker::formatComment() instead of main parser -# local format section links in edit comment text as local links -# notoc disable table of contents -# -# You can also set the following parser properties via test options: -# wgEnableUploads, wgAllowExternalImages, wgMaxTocLevel, -# wgLinkHolderBatchSize, wgRawHtml -# -# For testing purposes, temporary articles can created: -# !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle -# where '/' denotes a newline. - -# This is the standard article assumed to exist. -!! article -Main Page -!! text -blah blah -!! endarticle - -!!article -Template:Foo -!!text -FOO -!!endarticle - -!! article -Template:Blank -!! text -!! endarticle - -!! article -Template:pipe -!! text -| -!! endarticle - -!!article -MediaWiki:bad image list -!!text -* [[File:Bad.jpg]] except [[Nasty page]] -!!endarticle - -!! article -Template:inner list -!! text -* item 1 -!! endarticle - -!! article -Template:tbl-start -!! text -{| -!! endarticle - -!! article -Template:tbl-end -!! text -|} -!! endarticle - -!! article -Template:! -!! text -| -!! endarticle - -!! article -Template:echo -!! text -{{{1}}} -!! endarticle - -!! article -Template:echo_with_span -!! text -{{{1}}} -!! endarticle - -!! article -Template:echo_with_div -!! text -
      {{{1}}}
      -!! endarticle - -!! article -Template:attr_str -!! text -{{{1}}}="{{{2}}}" -!! endarticle - -!! article -Template:table_attribs -!! text - -|style="color: red"| Foo -!! endarticle - -!! article -Template:table_cells -!! text -{{table_attribs}} || Bar || Baz -!! endarticle - -!! article -Template:image_attribs -!! text - -[[File:foobar.jpg|right|Caption text]] -!! endarticle - -!! article -A?b -!! text -Weirdo titles! -!! endarticle - -!!article -Template:Bullet -!!text -* Bar -!!endarticle - -### -### Basic tests -### -!! test -Blank input -!! input -!! result -!! end - - -!! test -Simple paragraph -!! input -This is a simple paragraph. -!! result -

      This is a simple paragraph. -

      -!! end - -!! test -Paragraphs with extra newline spacing -!! input -foo - -bar - - -baz - - - -booz -!! result -

      foo -

      bar -


      -baz -


      -

      booz -

      -!! end - -!! test -Paragraphs with newline spacing with comment lines in between -!! input ----- -a - -b ----- -a - -b ----- -a - -b ----- -a - - -b ----- -a - - -b ----- -a - - - -b ----- -a - - - -b ----- -!! result -
      -

      a -b -

      -
      -

      a -b -

      -
      -

      a -b -

      -
      -

      a -

      b -

      -
      -

      a -

      b -

      -
      -

      a -


      -b -

      -
      -

      a -


      -b -

      -
      - -!! end - -!! test -Paragraphs with newline spacing with non-empty white-space lines in between -!! input ----- -a - -b ----- -a - - -b ----- -!! result -
      -

      a -

      b -

      -
      -

      a -


      -b -

      -
      - -!! end - -!! test -Paragraphs with newline spacing with non-empty mixed comment and white-space lines in between -!! input ----- -a - -b ----- -a - -b ----- -a - - - -b ----- -a - - - - -b ----- -!! result -
      -

      a -b -

      -
      -

      a -b -

      -
      -

      a -

      b -

      -
      -

      a -


      -b -

      -
      - -!! end - -!! test -Extra newlines: More paragraphs with indented comment -!! input -a - - - -b -!!result -

      a -


      -b -

      -!!end - -!! test -Extra newlines followed by heading -!! input -a - - - -=b= -[[a]] - - -=b= -!! result -

      a -


      -

      -

      b[edit]

      -

      a -


      -

      -

      b[edit]

      - -!! end - -!! test -Extra newlines between heading and content are swallowed -!! input -=b= - - - -[[a]] -!! result -

      b[edit]

      -

      a -

      -!! end - -!! test -Parsing an URL -!! input -http://fr.wikipedia.org/wiki/🍺 - -!! result -

      http://fr.wikipedia.org/wiki/🍺 -

      -!! end - -!! test -Simple list -!! input -* Item 1 -* Item 2 -!! result -
        -
      • Item 1 -
      • -
      • Item 2 -
      • -
      - -!! end - -!! test -Italics and bold -!! input -* plain -* plain''italic''plain -* plain''italic''plain''italic''plain -* plain'''bold'''plain -* plain'''bold'''plain'''bold'''plain -* plain''italic''plain'''bold'''plain -* plain'''bold'''plain''italic''plain -* plain''italic'''bold-italic'''italic''plain -* plain'''bold''bold-italic''bold'''plain -* plain'''''bold-italic'''italic''plain -* plain'''''bold-italic''bold'''plain -* plain''italic'''bold-italic'''''plain -* plain'''bold''bold-italic'''''plain -* plain l'''italic''plain -* plain l''''bold''' plain -!! result -
        -
      • plain -
      • -
      • plainitalicplain -
      • -
      • plainitalicplainitalicplain -
      • -
      • plainboldplain -
      • -
      • plainboldplainboldplain -
      • -
      • plainitalicplainboldplain -
      • -
      • plainboldplainitalicplain -
      • -
      • plainitalicbold-italicitalicplain -
      • -
      • plainboldbold-italicboldplain -
      • -
      • plainbold-italicitalicplain -
      • -
      • plainbold-italicboldplain -
      • -
      • plainitalicbold-italicplain -
      • -
      • plainboldbold-italicplain -
      • -
      • plain l'italicplain -
      • -
      • plain l'bold plain -
      • -
      - -!! end - -# this example taken from the [[simple:Moon]] article (bug 47326) -!! test -Italics and possessives (1) -!! input -obtained by ''[[Lunar Prospector]]'''s gamma-ray spectrometer -!! result -

      obtained by Lunar Prospector's gamma-ray spectrometer -

      -!! end - -# this example taken from [[en:Flaming Pie]] (bug 49926) -!! test -Italics and possessives (2) -!! input -'''''Flaming Pie''''' is ... released in 1997. In ''Flaming Pie'''s liner notes -!! result -

      Flaming Pie is ... released in 1997. In Flaming Pie's liner notes -

      -!! end - -# this example taken from [[en:Dictionary]] (bug 49926) -!! test -Italics and possessives (3) -!! input -The first monolingual dictionary written in a Romance language was ''Sebastián Covarrubias''' ''Tesoro de la lengua castellana o española'', published in 1611 in Madrid. In 1612 the first edition of the ''Vocabolario dell'[[Accademia della Crusca]]'', for Italian, was published. In 1690 in Rotterdam was published, posthumously, the ''Dictionnaire Universel''. -!! result -

      The first monolingual dictionary written in a Romance language was Sebastián Covarrubias' Tesoro de la lengua castellana o española, published in 1611 in Madrid. In 1612 the first edition of the Vocabolario dell'Accademia della Crusca, for Italian, was published. In 1690 in Rotterdam was published, posthumously, the Dictionnaire Universel. -

      -!! end - - -### -### 2-quote opening sequence tests -### -!! test -Italics and bold: 2-quote opening sequence: (2,2) -!! input -''foo'' -!! result -

      foo -

      -!!end - - -!! test -Italics and bold: 2-quote opening sequence: (2,3) -!! input -''foo''' -!! result -

      foo' -

      -!!end - - -!! test -Italics and bold: 2-quote opening sequence: (2,4) -!! input -''foo'''' -!! result -

      foo'' -

      -!!end - - -!! test -Italics and bold: 2-quote opening sequence: (2,5) (php) -!! options -php -!! input -''foo''''' -!! result -

      foo -

      -!!end -# The PHP parser strips the empty tags out for giggles; parsoid doesn't. -!! test -Italics and bold: 2-quote opening sequence: (2,5) (parsoid) -!! options -parsoid -!! input -''foo''''' -!! result -

      foo -

      -!!end - - -### -### 3-quote opening sequence tests -### - -!! test -Italics and bold: 3-quote opening sequence: (3,2) -!! input -'''foo'' -!! result -

      'foo -

      -!!end - - -!! test -Italics and bold: 3-quote opening sequence: (3,3) -!! input -'''foo''' -!! result -

      foo -

      -!!end - - -!! test -Italics and bold: 3-quote opening sequence: (3,4) -!! input -'''foo'''' -!! result -

      foo' -

      -!!end - - -!! test -Italics and bold: 3-quote opening sequence: (3,5) (php) -!! options -php -!! input -'''foo''''' -!! result -

      foo -

      -!!end -# The PHP parser strips the empty tags out for giggles; parsoid doesn't. -!! test -Italics and bold: 3-quote opening sequence: (3,5) (parsoid) -!! options -parsoid -!! input -'''foo''''' -!! result -

      foo -

      -!!end - - -### -### 4-quote opening sequence tests -### - -!! test -Italics and bold: 4-quote opening sequence: (4,2) -!! input -''''foo'' -!! result -

      ''foo -

      -!!end - - -!! test -Italics and bold: 4-quote opening sequence: (4,3) -!! input -''''foo''' -!! result -

      'foo -

      -!!end - - -!! test -Italics and bold: 4-quote opening sequence: (4,4) -!! input -''''foo'''' -!! result -

      'foo' -

      -!!end - - -!! test -Italics and bold: 4-quote opening sequence: (4,5) (php) -!! options -php -!! input -''''foo''''' -!! result -

      'foo -

      -!!end -# The PHP parser strips the empty tags out for giggles; parsoid doesn't. -!! test -Italics and bold: 4-quote opening sequence: (4,5) (parsoid) -!! options -parsoid -!! input -''''foo''''' -!! result -

      'foo -

      -!!end - - -### -### 5-quote opening sequence tests -### - -!! test -Italics and bold: 5-quote opening sequence: (5,2) -!! options -!! input -'''''foo'' -!! result -

      foo -

      -!!end - - -!! test -Italics and bold: 5-quote opening sequence: (5,3) -!! input -'''''foo''' -!! result -

      foo -

      -!!end - - -!! test -Italics and bold: 5-quote opening sequence: (5,4) -!! input -'''''foo'''' -!! result -

      foo' -

      -!!end - - -!! test -Italics and bold: 5-quote opening sequence: (5,5) -!! input -'''''foo''''' -!! result -

      foo -

      -!!end - -### -### multiple quote sequences in a line -### -!! test -Italics and bold: multiple quote sequences: (2,4,2) -!! input -''foo''''bar'' -!! result -

      foo'bar -

      -!!end - - -!! test -Italics and bold: multiple quote sequences: (2,4,3) -!! input -''foo''''bar''' -!! result -

      foo'bar -

      -!!end - - -!! test -Italics and bold: multiple quote sequences: (2,4,4) -!! input -''foo''''bar'''' -!! result -

      foo'bar' -

      -!!end - - -!! test -Italics and bold: multiple quote sequences: (3,4,2) (php) -!! options -php -!! input -'''foo''''bar'' -!! result -

      foo'bar -

      -!!end -# The PHP parser strips the empty tags out for giggles; parsoid doesn't. -!! test -Italics and bold: multiple quote sequences: (3,4,2) (parsoid) -!! options -parsoid -!! input -'''foo''''bar'' -!! result -

      foo'bar -

      -!!end - - -!! test -Italics and bold: multiple quote sequences: (3,4,3) (php) -!! options -php -!! input -'''foo''''bar''' -!! result -

      foo'bar -

      -!!end -# The PHP parser strips the empty tags out for giggles; parsoid doesn't. -!! test -Italics and bold: multiple quote sequences: (3,4,3) (parsoid) -!! options -parsoid -!! input -'''foo''''bar''' -!! result -

      foo'bar -

      -!!end - -### -### other quote tests -### -!! test -Italics and bold: other quote tests: (2,3,5) -!! input -''this is about '''foo's family''''' -!! result -

      this is about foo's family -

      -!!end - - -!! test -Italics and bold: other quote tests: (2,(3,3),2) -!! input -''this is about '''foo's''' family'' -!! result -

      this is about foo's family -

      -!!end - - -!! test -Italics and bold: other quote tests: (3,2,3,2) -!! input -'''this is about ''foo'''s family'' -!! result -

      this is about foos family -

      -!!end - - -!! test -Italics and bold: other quote tests: (3,2,3,3) -!! options -!! input -'''this is about ''foo'''s family''' -!! result -

      'this is about foos family -

      -!!end - - -!! test -Italics and bold: other quote tests: (3,(2,2),3) -!! input -'''this is about ''foo's'' family''' -!! result -

      this is about foo's family -

      -!!end - - -!! test -Italicized possessive -!! input -The ''[[Main Page]]'''s talk page. -!! result -

      The Main Page's talk page. -

      -!! end - -!! test -Parsoid only: Quote balancing context should be restricted to td/th cells on the same wikitext line -(Requires tidy for PHP parser output to be fixed up) -!! options -parsoid=wt2html,wt2wt -!! input -{| -!''a!!''b -|''a||''b -|} -!! result - - - -
      abab
      -!! end - -### -### Non-html5 tags -### - -!! test -Non-html5 tags should be accepted -!! input -
      ''foo''
      -''foo'' -''foo'' -''foo'' -''foo'' -!! result -
      foo
      -

      foo -foo -foo -foo -

      -!! end - -!! test - is valid wikitext (bug 52468) -!! input - -!! result -

      -

      -!! end - -# is HTML4, is HTML4/5. -!! test - or for strikethrough -!! input -strike - -s -!! result -

      strike -

      s -

      -!! end - -!! test -Non-word characters don't terminate tag names (bug 17663, 40670, 52022) -!! input - doesn't work! - - doesn't work! - - works fine - -foo
      - -s.foo - - -!! result -

      <b→> doesn't work! </b> -

      <bä> doesn't work! </b> -

      <boo> works fine </b> -

      <s.foo>foo</s> -

      <s.foo>s.foo</s.foo> -

      <sub-ID#1> -

      -!! end - -### -### Special characters -### - -!! test -Bare pipe character (bug 52363) -!! input -| -!! result -

      | -

      -!! end - -!! test -Bare pipe character from a template (bug 52363) -!! input -{{pipe}} -!! result -

      | -

      -!! end - -### -### test cases -### - -!! test - unordered list -!! input -* This is not an unordered list item. -!! result -

      * This is not an unordered list item. -

      -!! end - -!! test - spacing -!! input -Lorem ipsum dolor - -sed abit. - sed nullum. - -:and a colon - -!! result -

      Lorem ipsum dolor - -sed abit. - sed nullum. - -:and a colon - -

      -!! end - -!! test -nowiki 3 -!! input -:There is not nowiki. -:There is nowiki. - -#There is not nowiki. -#There is nowiki. - -*There is not nowiki. -*There is nowiki. -!! result -
      -
      There is not nowiki. -
      -
      There is nowiki. -
      -
      -
        -
      1. There is not nowiki. -
      2. -
      3. There is nowiki. -
      4. -
      -
        -
      • There is not nowiki. -
      • -
      • There is nowiki. -
      • -
      - -!! end - -!! test -Entities inside -!! input -< -!! result -

      < -

      -!! end - -!! test -Entities inside template parameters -!! options -parsoid -!! input -{{echo|–}} -!! result -

      -

      -!! end - -### -### Comments -### -!! test -Comments and Indent-Pre -!! input - asdf - - asdf - - - asdf -xyz - - asdf - xyz -!! result -
      asdf
      -
      -
      asdf
      -
      -
      asdf
      -
      -

      xyz -

      -
      asdf
      -xyz
      -
      -!! end - -!! test -Comment test 2a -!! input -asdf - -jkl -!! result -

      asdf -jkl -

      -!! end - -!! test -Comment test 2b -!! input -asdf - - -jkl -!! result -

      asdf -

      jkl -

      -!! end - -!! test -Comment test 3 -!! input -asdf - - -jkl -!! result -

      asdf -jkl -

      -!! end - -!! test -Comment test 4 -!! input -asdfjkl -!! result -

      asdfjkl -

      -!! end - -!! test -Comment spacing -!! input -a - b -c -!! result -

      a -

      -
       b 
      -
      -

      c -

      -!! end - -!! test -Comment whitespace -!! input - -!! result - -!! end - -!! test -Comment semantics and delimiters -!! input - -!! result - -!! end - -!! test -Comment semantics and delimiters, redux -!! input - -!! result - -!! end - -!! test -Comment semantics and delimiters: directors cut -!! input ---> -!! result -

      --> -

      -!! end - -!! test -Comment semantics: nesting -!! input ---> -!! result -

      --> -

      -!! end - -!! test -Comment semantics: unclosed comment at end -!! input -oo}} -!! result -

      FOO -

      -!! end - -!! test -Comment on its own line post-expand -!! input -a -{{blank}} -b -!! result -

      a -

      b -

      -!! end - -!! test -Comment on its own line post-expand with non-significant whitespace -!! input -a - {{blank}} -b -!! result -

      a -

      b -

      -!! end - -### -### paragraph wrapping tests -### -!! test -No block tags -!! input -a - -b -!! result -

      a -

      b -

      -!! end - -!! test -Block tag on one line (
      ) -!! input -a
      foo
      - -b -!! result -a
      foo
      -

      b -

      -!! end - -!! test -Block tag on one line (
      ) -!! input -a
      foo
      - -b -!! result -a
      foo
      -

      b -

      -!! end - -!! test -Block tag on both lines (
      ) -!! input -a
      foo
      - -b
      foo
      -!! result -a
      foo
      -b
      foo
      - -!! end - -!! test -Block tag on both lines (
      ) -!! input -a
      foo
      - -b
      foo
      -!! result -a
      foo
      -b
      foo
      - -!! end - -!! test -Multiple lines without block tags -!! input -
      foo
      a -b -c -d e -x
      foo
      z -!! result -
      foo
      a -

      b -c -d e -

      -x
      foo
      z - -!! end - -!! test -Empty lines between lines with block tags -!! input -
      - - -
      a - -b -
      a
      b - -
      b
      d - - -
      e
      -!! result -
      -


      -

      -
      a -

      b -

      -
      a
      b -
      b
      d -


      -

      -
      e
      - -!! end - -### -### Preformatted text -### -!! test -Preformatted text -!! input - This is some - Preformatted text - With ''italic'' - And '''bold''' - And a [[Main Page|link]] -!! result -
      This is some
      -Preformatted text
      -With italic
      -And bold
      -And a link
      -
      -!! end - -!! test -Tabs don't trigger preformatted text -!! input - This is not - preformatted text. - This is preformatted text. - So is this. -!! result -

      This is not - preformatted text. -

      -
      This is preformatted text.
      -	So is this.
      -
      -!! end - -!! test -Ident preformatting with inline content -!! input - a - ''b'' -!! result -
      a
      -b
      -
      -!! end - -!! test -
       with  inside (compatibility with 1.6 and earlier)
      -!! input
      -
      
      -
      -
      -
      -
      -!! result -
      -<b>
      -<cite>
      -<em>
      -
      - -!! end - -!! test -Regression with preformatted in
      -!! input -
      - Blah -
      -!! result -
      -
      Blah
      -
      -
      - -!! end - -!! test -Bug 52763: Preformatted in
      -!! input -
      - Blah -
      -!! result -
      -

      Blah -

      -
      - -!! end - -!! test -Bug 51086: Double newlines in blockquotes should be turned into paragraphs -!! input -
      -Foo - -Bar -
      -!! result -
      -

      Foo -

      Bar -

      -
      - -!! end - -!! test -Bug 15491: / in blockquote -!! input -
      -Foo bar baz quux -
      -!! result -
      -

      Foo bar baz quux -

      -
      - -!! end - -# Note that the p-wrapping is newline sensitive, which could be -# considered a bug: tidy will wrap only the 'Foo' in the example -# below in a

      tag. (see comment 23-25 of bug #6200) -!! test -Bug 15491: / in blockquote (2) -!! input -

      Foo bar baz quux -
      -!! result -
      Foo bar baz quux -
      - -!! end - -!! test -
       with attributes (bug 3202)
      -!! input
      -
      Bluescreen of WikiDeath
      -!! result -
      Bluescreen of WikiDeath
      - -!! end - -!! test -
       with width attribute (bug 3202)
      -!! input
      -
      Narrow screen goodies
      -!! result -
      Narrow screen goodies
      - -!! end - -!! test -
       with forbidden attribute (bug 3202)
      -!! input
      -
      Narrow screen goodies
      -!! result -
      Narrow screen goodies
      - -!! end - -!! test -Entities inside
      -!! input
      -
      <
      -!! result -
      <
      - -!! end - -!! test -
       with forbidden attribute values (bug 3202)
      -!! input
      -
      Narrow screen goodies
      -!! result -
      Narrow screen goodies
      - -!! end - -!! test - inside
       (bug 13238)
      -!! input
      -
      -
      -
      -
      -
      -
      -
      Foo
      -!! result -
      -<nowiki>
      -
      -
      -
      -
      -
      <nowiki>Foo</nowiki>
      - -!! end - -!! test - and
       preference (first one wins)
      -!! input
      -
      -
      -
      - -
      - - -
      -
      -
      -
      -
      - -!! result -
      -<nowiki>
      -
      -

      </nowiki> -</pre> -

      -<pre> -<nowiki> -</pre> - -</pre> -

      -!! end - -!! test -
      inside nowiki -!! input -
      -!! result -

      </pre> -

      -!! end - -!!test -Templates: Indent-Pre: 1a. Templates that break a line should suppress
      -!!input
      - {{echo|}}
      -!!result
      -
      -!!end
      -
      -!!test
      -Templates: Indent-Pre: 1b. Templates that break a line should suppress 
      -!!input
      - {{echo|
      -foo}}
      -!!result
      -

      foo -

      -!!end - -!! test -Templates: Indent-Pre: 1c: Wrapping should be based on expanded content -!! input - {{echo|a -b}} -!!result -
      a
      -
      -

      b -

      -!!end - -!! test -Templates: Indent-Pre: 1d: Wrapping should be based on expanded content -!! input - {{echo|a -b -c - d -e -}} -!!result -
      a
      -
      -

      b -c -

      -
      d
      -
      -

      e -

      -!!end - -!!test -Templates: Indent-Pre: 1e. Wrapping should be based on expanded content -!!input -{{echo| foo}} - -{{echo| foo}}{{echo| bar}} - -{{echo| foo}} -{{echo| bar}} - -{{echo| foo}} - -{{echo| foo}} - -{{echo|{{echo| }}bar}} -!!result -
      foo
      -
      -
      foo bar
      -
      -
      foo
      -bar
      -
      -
      foo
      -
      -
      foo
      -
      -
      bar
      -
      -!!end - -!! test -Templates: Indent-Pre: 1f: Wrapping should be based on expanded content -!! input -{{echo| }}a - -{{echo| - }}a - -{{echo| - b}} - -{{echo|a - }}b - -{{echo|a -}} b -!!result -
      a
      -
      -


      -

      -
      a
      -
      -


      -

      -
      b
      -
      -

      a -

      -
      b
      -
      -

      a -

      -
      b
      -
      -!!end - -# TODO / maybe: fix wt2wt for this -!! test -Parsoid: Don't paragraph-wrap fosterable content -!! options -parsoid=wt2html -!! input -{| - - - - - -|} -!! result - - - - - - - - - - -
      -!! end - -!! test -Parsoid: Don't paragraph-wrap fosterable content even if table syntax is unbalanced -!! options -parsoid=wt2html -!! input -{| - - - - - - -|} -!! result - - - - - - - - - - -
      -
      -!! end - - -#-------------------------------------------------------------------- -# Transclusion parameter whitespace stripping tests -# Behavior is different for positional and named parameters -#-------------------------------------------------------------------- -!! test -Templates: Strip leading and trailing whitespace from named-param values -!! input -{{echo|1= a }} - -{{echo|1= {{echo|b}} }} - -{{echo| 1 = - c }} - -{{echo| 1 = -* d -}} -!! result -

      a -

      b -

      c -

      -
        -
      • d -
      • -
      - -!! end - -!! test -Templates: Don't strip whitespace from positional-param values -!! input -{{echo|a }} - -{{echo|{{echo|b}} }} - -{{echo| c -}} - -{{echo| {{echo|d}} -}} - -{{echo| - e}} - -{{echo| -* f}} - -{{echo| - }}g -!! result -

      a -

      b -

      -
      c 
      -
      -


      -

      -
      d
      -
      -


      -

      -
      e
      -
      -


      -

      -
        -
      • f -
      • -
      -


      -

      -
      g
      -
      -!! end - -!! test -Templates: Handle empty comment-and-ws-only lines correctly -!! input -{{echo|foo - - -bar}} -!! result -

      foo -bar -

      -!! end - -#-------------------------------------------------------------------- -# Transclusion parameter escaping tests -#-------------------------------------------------------------------- -!! test -Templates: Parsoid parameter escaping test 1 -!! options -parsoid -!! input -{{echo|[foo]|{{echo|[bar]}}}} -!! result -

      [foo]

      -!! end - -!! test -Parsoid: Pipes in external links in template parameter -!! options -parsoid -!! input -{{echo|[{{echo|http://example.com}} link]}} -!! result -

      link

      -!! end - -!! test -Parsoid: pipe in transclusion parameter -!! options -parsoid -!! input -{{echo|http://foo.com/a|b}} -!! result -

      http://foo.com/a|b

      -!! end - -!! test -Parsoid: Pipe in external link target and content in template parameter -!! options -parsoid=html2wt,wt2wt -!! input -{{echo|[http://foo.com/a|b a|b]}} -!! result -

      a|b

      -!! end - -!! test -Templates: Dont escape already nowiki-escaped text in template parameters -!! options -parsoid=html2wt,wt2wt -!! input -{{echo|foo|bar}} -{{echo|<div>}} -{{echo|}} -!! result -

      foo|bar -<div> - -

      -!! end - -## Bug 52824 -!! test -Templates: '=' char in nested transclusions should not trigger nowiki escapes or conversion to named param -!! options -parsoid=html2wt,wt2wt -!! input -{{echo|{{echo|1=bar}}}} -!! result -

      bar

      -!! end - -### -### Parsoid-centric tests for testing RT edge cases for pre -### - -!!test -1a. Indent-Pre and Comments -!!input - a - -c -!!result -
      a
      -
      -

      c -

      -!!end - -!!test -1b. Indent-Pre and Comments -!!input - a - -c -!!result -
      a
      -
      -

      c -

      -!!end - -!!test -1c. Indent-Pre and Comments -!!input - a - - a -!!result -
       a
      -
      -
       a
      -
      -!!end - -!!test -1d. Indent-Pre and Comments -(Pre-handler currently cannot distinguish between comment/ws order and normalizes them to [comment,ws] order) -!!input - a - - b -!!result -
      a
      -
      -
      b
      -
      -!!end - -!!test -2a. Indent-Pre and tables -!!input - {| - |- - !h1!!h2 - |foo||bar - |} -!!result - - - - - - -
      h1h2 -foobar -
      - -!!end - -!!test -2b. Indent-Pre and tables -!!input - {| - |- -|foo -|} -!!result - - - -
      foo -
      - -!!end - -!!test -2c. Indent-Pre and tables (bug 42252) -!!input -{| - |+ foo - ! | bar -|} -!!result - - - -
      foo -
      bar -
      - -!!end - -!!test -3a. Indent-Pre and block tags (single-line html) -!!input -

      foo

      -
      foo
      -
      foo
      - foo -!!result -

      foo

      -
      foo
      -
      foo
      -
       foo 
      -
      -!!end - -!!test -3b. Indent-Pre and block tags (pre-content on separate line) -!!input -

      - foo -

      - -
      - foo -
      - -
      - foo -
      - -
      - foo -
      - -
      -
      -foo
      -
      -
      - -
      - foo -
      - -
      • - foo -
      - -!!result -

      - foo -

      -
      -
      foo
      -
      -
      -
      -
      foo
      -
      -
      -
      -

      foo -

      -
      -
      -
      -foo
      -
      -
      -
      -
      foo
      -
      -
      -
      • - foo -
      - -!!end - -!!test -4. Multiple spaces at start-of-line -!!input -

      foo

      - foo - {| -|foo -|} -!!result -

      foo

      -
         foo
      -
      - - -
      foo -
      - -!!end - -!! test -5. White-space in indent-pre -NOTE: the white-space char on 2nd line is significant -!! input - a
      - - b -!! result -
      a
      - -b -
      -!! end - -!! test -6. Pre-blocks should extend across lines with leading WS even when there is no wrappable content -!! input - a - - - b - - c - -d -!! result -
      a
      -
      -b
      -
      -
      c
      -
      -
      -

      d -

      -!! end - -!! test -7a. Indent-pre and category links -!! options -parsoid=wt2html,wt2wt -!! input - [[Category:foo]] -{{echo| [[Category:foo]]}} -!! result - - - -!! end - -!! test -7b. Indent-pre and category links -!! options -parsoid=wt2html,wt2wt -!! input - [[Category:foo]] a - [[Category:foo]] {{echo|b}} -!! result -
      - a
      -
      - b
      -!! end - -### -### HTML-pre (some to spec PHP parser behavior and some Parsoid-RT-centric) -### - -!!test -HTML-pre: 1. embedded newlines -!!input -
      foo
      - -
      -foo
      -
      - -
      -
      -foo
      -
      - -
      -
      -
      -foo
      -
      -!!result -
      foo
      -
      -foo
      -
      -
      -
      -foo
      -
      -
      -
      -
      -foo
      -
      - -!!end - -!!test -HTML-pre: 2: indented text -!!input -
      - foo
      -
      -!!result -
      - foo
      -
      - -!!end - -!!test -HTML-pre: 3: other wikitext -!!input -
      -* foo
      -# bar
      -= no-h =
      -'' no-italic ''
      -[[ NoLink ]]
      -
      -!!result -
      -* foo
      -# bar
      -= no-h =
      -'' no-italic ''
      -[[ NoLink ]]
      -
      - -!!end - -### -### Definition lists -### -!! test -Simple definition -!! input -; name : Definition -!! result -
      -
      name 
      -
      Definition -
      -
      - -!! end - -!! test -Definition list for indentation only -!! input -: Indented text -!! result -
      -
      Indented text -
      -
      - -!! end - -!! test -Definition list with no space -!! input -;name:Definition -!! result -
      -
      name
      -
      Definition -
      -
      - -!!end - -!! test -Definition list with URL link -!! input -; http://example.com/ : definition -!! result -
      -
      http://example.com/ 
      -
      definition -
      -
      - -!! end - -!! test -Definition list with bracketed URL link -!! input -;[http://www.example.com/ Example]:Something about it -!! result -
      -
      Example
      -
      Something about it -
      -
      - -!! end - -!! test -Definition list with wikilink containing colon -!! input -; [[Help:FAQ]]: The least-read page on Wikipedia -!! result -
      -
      Help:FAQ
      -
      The least-read page on Wikipedia -
      -
      - -!! end - -# At Brion's and JeLuF's insistence... :) -!! test -Definition list with news link containing colon -!! input -; news:alt.wikipedia.rox: This isn't even a real newsgroup! -!! result -
      -
      news:alt.wikipedia.rox
      -
      This isn't even a real newsgroup! -
      -
      - -!! end - -!! test -Malformed definition list with colon -!! input -; news:alt.wikipedia.rox -- don't crash or enter an infinite loop -!! result -
      -
      news:alt.wikipedia.rox -- don't crash or enter an infinite loop -
      -
      - -!! end - -!! test -Definition lists: colon in external link text -!! input -; [http://www.wikipedia2.org/ Wikipedia : The Next Generation]: OK, I made that up -!! result -
      -
      Wikipedia : The Next Generation
      -
      OK, I made that up -
      -
      - -!! end - -!! test -Definition lists: colon in HTML attribute -!! input -;bold -!! result -
      -
      bold -
      -
      - -!! end - -!! test -Definition lists: self-closed tag -!! input -;one
      two : two-line fun -!! result -
      -
      one
      two 
      -
      two-line fun -
      -
      - -!! end - -!! test -Bug 11748: Literal closing tags -!! input -
      -
      test 1
      -
      test test test test test
      -
      test 2
      -
      test test test test test
      -
      -!! result -
      -
      test 1
      -
      test test test test test
      -
      test 2
      -
      test test test test test
      -
      - -!! end - -!! test -Definition and unordered list using wiki syntax nested in unordered list using html tags. -!! input -
      • -; term : description -* unordered -
      -!! result -
      • -
        -
        term 
        -
        description -
        -
        -
          -
        • unordered -
        • -
        -
      - -!! end - -!! test - -Definition list with empty definition and following paragraph -!! input -; term: -Paragraph text -!! result -
      -
      term
      -
      -
      -
      -

      Paragraph text -

      -!! end - -!! test -Nested definition lists using html syntax -!! input -
      -
      -
      Foo
      -
      -
      -!! result -
      -
      -
      Foo
      -
      -
      - -!! end - -!! test -Definition Lists: No nesting: Multiple dd's -!! input -;x -:a -:b -!! result -
      -
      x -
      -
      a -
      -
      b -
      -
      - -!! end - -!! test -Definition Lists: Indentation: Regular -!! input -:i1 -::i2 -:::i3 -!! result -
      -
      i1 -
      -
      i2 -
      -
      i3 -
      -
      -
      -
      -
      -
      - -!! end - -!! test -Definition Lists: Indentation: Missing 1st level -!! input -::i2 -:::i3 -!! result -
      -
      -
      i2 -
      -
      i3 -
      -
      -
      -
      -
      -
      - -!! end - -!! test -Definition Lists: Indentation: Multi-level indent -!! input -:::i3 -!! result -
      -
      -
      -
      i3 -
      -
      -
      -
      -
      -
      - -!! end - -!! test -Definition Lists: Hacky use to indent tables -!! input -::{| -|foo -|bar -|} -this text -should be left alone -!! result -
      - - -
      foo -bar -
      -

      this text -should be left alone -

      -!! end - -# Bug 52473 -!! test -Definition Lists: Hacky use to indent tables (WS-insensitive) -!! options -parsoid -!! input -: {| -|a -|} -!! result -
      -
      a
      -
      -!! end -## The PHP parser treats : items (dd) without a corresponding ; item (dt) -## as an empty dt item. It also ignores all but the last ";" when followed -## by ":" later on. So, ";" are not ignored in ";;;t3" but are ignored in -## ";;;t3 :d1". So, PHP parser behavior is a little inconsistent wrt multiple -## ";"s. -## -## Ex: ";;t2 ::d2" is transformed into: -## -##
      -##
      t2
      -##
      -##
      -##
      -##
      d2
      -##
      -##
      -##
      -## -## But, Parsoid treats "; :" as a tight atomic unit and excess ":" as plain text -## So, the same wikitext above (;;t2 ::d2) is transformed into: -## -##
      -##
      -##
      -##
      t2
      -##
      :d2
      -##
      -##
      -##
      -## -## All Parsoid only definition list tests have this difference. -## -## See also: https://bugzilla.wikimedia.org/show_bug.cgi?id=6569 -## and http://lists.wikimedia.org/pipermail/wikitext-l/2011-November/000483.html - -!! test -Table / list interaction: indented table with lists in table contents -!! input -:{| -|- -| a -* b -|- -| c -* d -|} -!! result -
      - - - - -
      a -
        -
      • b -
      • -
      -
      c -
        -
      • d -
      • -
      -
      - -!! end - -!!test -Table / list interaction: lists nested in tables nested in indented lists -!!input -:{| -| -:a -:b -| -*c -*d -|} - -*e -*f -!!result -
      - - -
      -
      -
      a -
      -
      b -
      -
      -
      -
        -
      • c -
      • -
      • d -
      • -
      -
      -
        -
      • e -
      • -
      • f -
      • -
      - -!!end - -!! test -Definition Lists: Nesting: Multi-level (Parsoid only) -!! options -parsoid -!! input -;t1 :d1 -;;t2 ::d2 -;;;t3 :::d3 -!! result -
      -
      t1
      -
      d1
      -
      -
      -
      t2
      -
      :d2
      -
      -
      -
      t3
      -
      ::d3
      -
      -
      -
      -
      -
      - - -!! end - - -!! test -Definition Lists: Nesting: Test 2 (Parsoid only) -!! options -parsoid -!! input -;t1 -::d2 -!! result -
      -
      t1
      -
      -
      -
      d2
      -
      -
      -
      - -!! end - - -!! test -Definition Lists: Nesting: Test 3 (Parsoid only) -!! options -parsoid -!! input -:;t1 -::::d2 -!! result -
      -
      -
      -
      t1
      -
      -
      -
      -
      -
      d2
      -
      -
      -
      -
      -
      -
      -
      - -!! end - - -!! test -Definition Lists: Nesting: Test 4 -!! input -::;t3 -:::d3 -!! result -
      -
      -
      -
      t3 -
      -
      d3 -
      -
      -
      -
      -
      -
      - -!! end - - -## The Parsoid team believes the following three test exposes a -## bug in the PHP parser. (Parsoid team thinks the PHP parser is -## wrong to close the
      after the
      containing the
        .) -!! test -Definition Lists: Mixed Lists: Test 1 (php) -!! options -php -!! input -:;* foo -::* bar -:; baz -!! result -
        -
        -
          -
        • foo -
        • -
        • bar -
        • -
        -
        -
        -
        -
        baz -
        -
        -
        -
        - -!! end -!! test -Definition Lists: Mixed Lists: Test 1 (parsoid) -!! options -parsoid -!! input -:;* foo -::* bar -:; baz -!! result -
        -
        -
          -
        • foo -
        • -
        -
          -
        • bar -
        • -
        -
        baz
        -
        -
        -!! end - -!! test -Definition Lists: Mixed Lists: Test 2 -!! input -*: d1 -*: d2 -!! result -
          -
        • -
          d1 -
          -
          d2 -
          -
          -
        • -
        - -!! end - - -!! test -Definition Lists: Mixed Lists: Test 3 -!! input -*::: d1 -*::: d2 -!! result -
          -
        • -
          -
          -
          d1 -
          -
          d2 -
          -
          -
          -
          -
          -
          -
        • -
        - -!! end - - -!! test -Definition Lists: Mixed Lists: Test 4 -!! input -*;d1 :d2 -*;d3 :d4 -!! result -
          -
        • -
          d1 
          -
          d2 -
          -
          d3 
          -
          d4 -
          -
          -
        • -
        - -!! end - - -!! test -Definition Lists: Mixed Lists: Test 5 -!! input -*:d1 -*:: d2 -!! result -
          -
        • -
          d1 -
          -
          d2 -
          -
          -
          -
          -
        • -
        - -!! end - - -!! test -Definition Lists: Mixed Lists: Test 6 -!! input -#*:d1 -#*::: d3 -!! result -
          -
          • -
          • -
            d1 -
            -
            -
            d3 -
            -
            -
            -
            -
            -
            -
          • -
          -
        1. -
        - -!! end - - -!! test -Definition Lists: Mixed Lists: Test 7 -!! input -:* d1 -:* d2 -!! result -
        -
          -
        • d1 -
        • -
        • d2 -
        • -
        -
        -
        - -!! end - - -!! test -Definition Lists: Mixed Lists: Test 8 -!! input -:* d1 -::* d2 -!! result -
        -
          -
        • d1 -
        • -
        -
        -
          -
        • d2 -
        • -
        -
        -
        -
        -
        - -!! end - - -!! test -Definition Lists: Mixed Lists: Test 9 -!! input -*;foo :bar -!! result -
          -
        • -
          foo 
          -
          bar -
          -
          -
        • -
        - -!! end - - -!! test -Definition Lists: Mixed Lists: Test 10 -!! input -*#;foo :bar -!! result -
          -
          1. -
          2. -
            foo 
            -
            bar -
            -
            -
          3. -
          -
        • -
        - -!! end - -# The Parsoid team disagrees with the PHP parser's seemingly-random -# rules regarding dd/dt on the next two tests. Parsoid is more -# consistent, and recognizes the shared nesting and keeps the -# still-open tags around until the nesting is complete. - -!! test -Definition Lists: Mixed Lists: Test 11 (php) -!! options -php -!! input -*#*#;*;;foo :bar -*#*#;boo :baz -!! result -
          -
          1. -
            • -
              1. -
              2. -
                foo 
                -
                  -
                • -
                  -
                  bar -
                  -
                  -
                -
                -
              3. -
            - -
      -
      -
      boo 
      -
      baz -
      -
      -
    19. -
    - - - - - - - -!! end -!! test -Definition Lists: Mixed Lists: Test 11 (parsoid) -!! options -parsoid -!! input -*#*#;*;;foo :bar -*#*#;boo :baz -!! result -
      -
    • -
        -
      1. -
          -
        • -
            -
          1. -
            -
            -
              -
            • -
              -
              -
              -
              foo 
              -
              bar
              -
              -
            • -
            -
            boo 
            -
            baz
            -
          2. -
        • -
      2. -
    • -
    -!! end - - -!! test -Definition Lists: Weird Ones: Test 1 (php) -!! options -php -!! input -*#;*::;; foo : bar (who uses this?) -!! result -
      -
      1. -
      2. -
        foo 
        -
          -
        • -
          -
          -
          -
          bar (who uses this?) -
          -
          -
          -
          -
          -
          -
        -
        -
      3. -
    - - - - - - - -!! end -!! test -Definition Lists: Weird Ones: Test 1 (parsoid) -!! options -parsoid -!! input -*#;*::;; foo : bar (who uses this?) -!! result -
      -
    • -
        -
      1. -
        -
        -
          -
        • -
          -
          -
          -
          -
          -
          -
          -
          foo 
          -
          bar (who uses this?)
          -
          -
          -
          -
        • -
        -
      2. -
    • -
    -!! end - -### -### External links -### -!! test -External links: non-bracketed -!! input -Non-bracketed: http://example.com -!! result -

    Non-bracketed: http://example.com -

    -!! end - -!! test -External links: numbered -!! input -Numbered: [http://example.com] -Numbered: [http://example.net] -Numbered: [http://example.com] -!! result -

    Numbered: [1] -Numbered: [2] -Numbered: [3] -

    -!!end - -!! test -External links: specified text -!! input -Specified text: [http://example.com link] -!! result -

    Specified text: link -

    -!!end - -!! test -External links: trail -!! input -Linktrails should not work for external links: [http://example.com link]s -!! result -

    Linktrails should not work for external links: links -

    -!! end - -!! test -External links: dollar sign in URL -!! input -http://example.com/1$2345 -!! result -

    http://example.com/1$2345 -

    -!! end - -!! test -External links: dollar sign in URL (named) -!! input -[http://example.com/1$2345] -!! result -

    [1] -

    -!!end - -!! test -External links: open square bracket forbidden in URL (bug 4377) -!! input -http://example.com/1[2345 -!! result -

    http://example.com/1[2345 -

    -!! end - -!! test -External links: open square bracket forbidden in URL (named) (bug 4377) -!! input -[http://example.com/1[2345] -!! result -

    [2345 -

    -!!end - -!! test -External links: nowiki in URL link text (bug 6230) -!!input -[http://example.com/ ''example site''] -!! result -

    ''example site'' -

    -!! end - -!! test -External links: newline forbidden in text (bug 6230 regression check) -!! input -[http://example.com/ first -second] -!! result -

    [http://example.com/ first -second] -

    -!!end - -!! test -External links: Pipe char between url and text -!! input -[http://example.com | link] -!! result -

    | link -

    -!!end - -!! test -External links: protocol-relative URL in brackets -!! input -[//example.com/ Test] -!! result -

    Test -

    -!! end - -!! test -External links: protocol-relative URL in brackets without text -!! input -[//example.com] -!! result -

    [1] -

    -!! end - -!! test -External links: protocol-relative URL in free text is left alone -!! input -//example.com/Foo -!! result -

    //example.com/Foo -

    -!!end - -!! test -External links: protocol-relative URL in the middle of a word is left alone (bug 30269) -!! input -foo//example.com/Foo -!! result -

    foo//example.com/Foo -

    -!! end - -!! test -External image -!! input -External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png -!! result -

    External image: Ncwikicol.png -

    -!! end - -!! test -External image from https -!! input -External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png -!! result -

    External image from https: Ncwikicol.png -

    -!! end - -!! test -External image (when not allowed) -!! options -wgAllowExternalImages=0 -!! input -External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png -!! result -

    External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png -

    -!! end - -!! test -Link to non-http image, no img tag -!! input -Link to non-http image, no img tag: ftp://example.com/test.jpg -!! result -

    Link to non-http image, no img tag: ftp://example.com/test.jpg -

    -!! end - -!! test -External links: terminating separator -!! input -Terminating separator: http://example.com/thing, -!! result -

    Terminating separator: http://example.com/thing, -

    -!! end - -!! test -External links: intervening separator -!! input -Intervening separator: http://example.com/1,2,3 -!! result -

    Intervening separator: http://example.com/1,2,3 -

    -!! end - -!! test -External links: old bug with URL in query -!! input -Old bug with URL in query: [http://example.com/thing?url=http://example.com link] -!! result -

    Old bug with URL in query: link -

    -!! end - -!! test -External links: old URL-in-URL bug, mixed protocols -!! input -And again with mixed protocols: [ftp://example.com?url=http://example.com link] -!! result -

    And again with mixed protocols: link -

    -!!end - -!! test -External links: URL in text -!! input -URL in text: [http://example.com http://example.com] -!! result -

    URL in text: http://example.com -

    -!! end - -!! test -External links: Clickable images -!! input -ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png] -!! result -

    ja-style clickable images: Ncwikicol.png -

    -!!end - -!! test -External links: raw ampersand -!! input -Old & use: http://x&y -!! result -

    Old & use: http://x&y -

    -!! end - -!! test -External links: encoded ampersand -!! input -Old & use: http://x&y -!! result -

    Old & use: http://x&y -

    -!! end - -!! test -External links: encoded equals (bug 6102) -!! input -http://example.com/?foo=bar -!! result -

    http://example.com/?foo=bar -

    -!! end - -!! test -External links: [raw ampersand] -!! input -Old & use: [http://x&y] -!! result -

    Old & use: [1] -

    -!! end - -!! test -External links: [encoded ampersand] -!! input -Old & use: [http://x&y] -!! result -

    Old & use: [1] -

    -!! end - -!! test -External links: [encoded equals] (bug 6102) -!! input -[http://example.com/?foo=bar] -!! result -

    [1] -

    -!! end - -!! test -External links: [IDN ignored character reference in hostname; strip it right off] -!! input -[http://e‌xample.com/] -!! result -

    [1] -

    -!! end - -# FIXME: This test (the IDN characters in the text of a link) is an inconsistency. -# Where an external link could easily circumvent the sanitization of the text of -# a link like this (where an IDN-ignore character is in the URL somewhere), this -# test demands a higher standard. That's a bit strange. -# -# Example: -# -# http://e‌xample.com -> [http://example.com|http://example.com] -# [http://example.com|http://e‌xample.com] -> [http://example.com|http://e‌xample.com] -# -# The first example is sanitized, but the second is not. Any security benefits -# from this production are trivial to circumvent. Either remove this test and -# let the parser(s) do their thing unaccosted, or fix the inconsistency and change -# the test accordingly. -# -# All our love, -# The Parsoid team. -!! test -External links: IDN ignored character reference in hostname; strip it right off -!! input -http://e‌xample.com/ -!! result -

    http://example.com/ -

    -!! end - -!! test -External links: www.jpeg.org (bug 554) -!! input -http://www.jpeg.org -!!result -

    http://www.jpeg.org -

    -!! end - -!! test -External links: URL within URL (original bug 2) -!! input -[http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp] -!! result -

    [1] -

    -!! end - -!! test -BUG 361: URL inside bracketed URL -!! input -[http://www.example.com/foo http://www.example.com/bar] -!! result -

    http://www.example.com/bar -

    -!! end - -!! test -BUG 361: URL within URL, not bracketed -!! input -http://www.example.com/foo?=http://www.example.com/bar -!! result -

    http://www.example.com/foo?=http://www.example.com/bar -

    -!! end - -!! test -BUG 289: ">"-token in URL-tail -!! input -http://www.example.com/ -!! result -

    http://www.example.com/<hello> -

    -!!end - -!! test -BUG 289: literal ">"-token in URL-tail -!! input -http://www.example.com/html -!! result -

    http://www.example.com/html -

    -!!end - -!! test -BUG 289: ">"-token in bracketed URL -!! input -[http://www.example.com/ stuff] -!! result -

    <hello> stuff -

    -!!end - -!! test -BUG 289: literal ">"-token in bracketed URL -!! input -[http://www.example.com/html stuff] -!! result -

    html stuff -

    -!!end - -!! test -BUG 289: literal double quote at end of URL -!! input -http://www.example.com/"hello" -!! result -

    http://www.example.com/"hello" -

    -!!end - -!! test -BUG 289: literal double quote in bracketed URL -!! input -[http://www.example.com/"hello" stuff] -!! result -

    "hello" stuff -

    -!!end - -!! test -External links: multiple legal whitespace is fine, Magnus. Don't break it please. (bug 5081) -!! input -[http://www.example.com test] -!! result -

    test -

    -!! end - -!! test -External links: link text with spaces -!! input -[http://www.example.com a b c] -[http://www.example.com ''a'' ''b''] -!! result -

    a b c -a b -

    -!! end - -!! test -External links: wiki links within external link (Bug 3695) -!! input -[http://example.com [[wikilink]] embedded in ext link] -!! result -

    wikilink embedded in ext link -

    -!! end - -!! test -BUG 787: Links with one slash after the url protocol are invalid -!! input -http:/example.com - -[http:/example.com title] -!! result -

    http:/example.com -

    [http:/example.com title] -

    -!! end - -!! test -Bracketed external links with template-generated invalid target -!! input -[{{echo|http:/example.com}} title] -!! result -

    [http:/example.com title] -

    -!! end - -!! test -Bug 2702: Mismatched , and tags are invalid -!! input -''[http://example.com text''] -[http://example.com '''text]''' -''Something [http://example.com in italic''] -''Something [http://example.com mixed''''', even bold]''' -'''''Now [http://example.com both'''''] -!! result -

    text -text -Something in italic -Something mixed, even bold -Now both -

    -!! end - - -!! test -Bug 4781: %26 in URL -!! input -http://www.example.com/?title=AT%26T -!! result -

    http://www.example.com/?title=AT%26T -

    -!! end - -# According to http://dev.w3.org/html5/spec/Overview.html#parsing-urls a plain -# % is actually legal in HTML5. Any change in output would need testing though. -!! test -Bug 4781, 5267: %25 in URL -!! input -http://www.example.com/?title=100%25_Bran -!! result -

    http://www.example.com/?title=100%25_Bran -

    -!! end - -!! test -Bug 4781, 5267: %28, %29 in URL -!! input -http://www.example.com/?title=Ben-Hur_%281959_film%29 -!! result -

    http://www.example.com/?title=Ben-Hur_%281959_film%29 -

    -!! end - - -!! test -Bug 4781: %26 in autonumber URL -!! input -[http://www.example.com/?title=AT%26T] -!! result -

    [1] -

    -!! end - -!! test -Bug 4781, 5267: %26 in autonumber URL -!! input -[http://www.example.com/?title=100%25_Bran] -!! result -

    [1] -

    -!! end - -!! test -Bug 4781, 5267: %28, %29 in autonumber URL -!! input -[http://www.example.com/?title=Ben-Hur_%281959_film%29] -!! result -

    [1] -

    -!! end - - -!! test -Bug 4781: %26 in bracketed URL -!! input -[http://www.example.com/?title=AT%26T link] -!! result -

    link -

    -!! end - -!! test -Bug 4781, 5267: %26 in bracketed URL -!! input -[http://www.example.com/?title=100%25_Bran link] -!! result -

    link -

    -!! end - -!! test -Bug 4781, 5267: %28, %29 in bracketed URL -!! input -[http://www.example.com/?title=Ben-Hur_%281959_film%29 link] -!! result -

    link -

    -!! end - -!! test -External link containing double-single-quotes in text '' (bug 4598 sanity check) -!! input -Some [http://example.com/ pretty ''italics'' and stuff]! -!! result -

    Some pretty italics and stuff! -

    -!! end - -!! test -External link containing double-single-quotes in text embedded in italics (bug 4598 sanity check) -!! input -''Some [http://example.com/ pretty ''italics'' and stuff]!'' -!! result -

    Some pretty italics and stuff! -

    -!! end - -!! test -External link containing double-single-quotes with no space separating the url from text in italics -!! input -[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].] -!! result -

    La muerte de Casagemas (1901) en el sitio de Museo Picasso. -

    -!! end - -!! test -External link with comments in link text -!! input -[http://www.google.com Google ] -!! result -

    Google -

    -!! end - -!! test -URL-encoding in URL functions (single parameter) -!! input -{{localurl:Some page|amp=&}} -!! result -

    /index.php?title=Some_page&amp=& -

    -!! end - -!! test -URL-encoding in URL functions (multiple parameters) -!! input -{{localurl:Some page|q=?&=&}} -!! result -

    /index.php?title=Some_page&q=?&amp=& -

    -!! end - -!! test -Brackets in urls -!! input -http://example.com/index.php?foozoid%5B%5D=bar - -http://example.com/index.php?foozoid[]=bar -!! result -

    http://example.com/index.php?foozoid%5B%5D=bar -

    http://example.com/index.php?foozoid%5B%5D=bar -

    -!! end - -!! test -IPv6 urls (bug 21261) -!! options -disabled -!! input -http://[2404:130:0:1000::187:2]/index.php -!! result -

    http://[2404:130:0:1000::187:2]/index.php -

    -!! end - -!! test -Non-extlinks in brackets -!! input -[foo] -[foo bar] -[foo ''bar''] -[fool's] errand -[fool's errand] -[{{echo|foo}}] -[{{echo|foo}} bar] -[{{echo|foo}} ''bar''] -[{{echo|foo}}l's] errand -[{{echo|foo}}l's errand] -[url={{echo|foo}}] -[url=http://example.com] -!! result -

    [foo] -[foo bar] -[foo bar] -[fool's] errand -[fool's errand] -[foo] -[foo bar] -[foo bar] -[fool's] errand -[fool's errand] -[url=foo] -[url=http://example.com] -

    -!! end - -!! test -Parsoid: Percent encoding in external links -!! options -parsoid -!! input -[https://github.com/search?l=&q=ResourceLoader+%40wikimedia Search] -!! result -

    Search

    -!! end - -!! test -Parsoid: use url link syntax for links where the content is equal the link -target -!! options -parsoid -!! input -http://example.com -!! result -

    http://example.com

    -!! end - -### -### Quotes -### - -!! test -Quotes -!! input -Normal text. '''Bold text.''' Normal text. ''Italic text.'' - -Normal text. '''''Bold italic text.''''' Normal text. -!!result -

    Normal text. Bold text. Normal text. Italic text. -

    Normal text. Bold italic text. Normal text. -

    -!! end - - -!! test -Unclosed and unmatched quotes (php) -!! options -php -!! input -'''''Bold italic text '''with bold deactivated''' in between.''''' - -'''''Bold italic text ''with italic deactivated'' in between.''''' - -'''Bold text.. - -..spanning two paragraphs (should not work).''' - -'''Bold tag left open - -''Italic tag left open - -Normal text. - - -'''This year''''s election ''should'' beat '''last year''''s. - -''Tom'''s car is bigger than ''Susan'''s. - -Plain ''italic'''s plain -!! result -

    Bold italic text with bold deactivated in between. -

    Bold italic text with italic deactivated in between. -

    Bold text.. -

    ..spanning two paragraphs (should not work). -

    Bold tag left open -

    Italic tag left open -

    Normal text. -

    This year's election should beat last year's. -

    Toms car is bigger than Susans. -

    Plain italic's plain -

    -!! end -# Parsoid inserts an empty bold tag pair at the end of the line, that the PHP -# parser strips. The wikitext contains just the first half of the bold -# quote pair. -!! test -Unclosed and unmatched quotes (parsoid) -!! options -parsoid -!! input -'''''Bold italic text '''with bold deactivated''' in between.''''' - -'''''Bold italic text ''with italic deactivated'' in between.''''' - -'''Bold text.. - -..spanning two paragraphs (should not work).''' - -'''Bold tag left open - -''Italic tag left open - -Normal text. - - -'''This year''''s election ''should'' beat '''last year''''s. - -''Tom'''s car is bigger than ''Susan'''s. - -Plain ''italic'''s plain -!! result -

    Bold italic text with bold deactivated in between. -

    Bold italic text with italic deactivated in between. -

    Bold text.. -

    ..spanning two paragraphs (should not work). -

    Bold tag left open -

    Italic tag left open -

    Normal text. -

    This year's election should beat last year's. -

    Toms car is bigger than Susans. -

    Plain italic's plain -

    -!! end - -### -### Tables -### -### some content taken from http://meta.wikimedia.org/wiki/MediaWiki_User%27s_Guide:_Using_tables -### - -# This should not produce
    as
    -# is the bare minimum required by the spec, see: -# http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html#a_module_Basic_Tables -!! test -A table with no data. (php) -!! options -php -!! input -{||} -!! result -!! end -# Parsoid team replies: empty table tags are legal in HTML5 -!! test -A table with no data. (parsoid) -!! options -parsoid -!! input -{||} -!! result -
    -!! end - -# A table with nothing but a caption is invalid XHTML, we might want to render -# this as

    caption

    -!! test -A table with nothing but a caption (php) -!! options -php -!! input -{| -|+ caption -|} -!! result - -
    caption -
    - -!! end -# Parsoid team replies: table with only a caption is legal in HTML5 -!! test -A table with nothing but a caption (parsoid) -!! options -parsoid -!! input -{| -|+ caption -|} -!! result -
    caption
    -!! end - -!! test -A table with caption with default-spaced attributes and a table row -!! input -{| -|+ style="color: red;" | caption1 -|- -| foo -|} -!! result - - - -
    caption1 -
    foo -
    - -!! end - -!! test -A table with captions with non-default spaced attributes and a table row -!! input -{| -|+style="color: red;"|caption2 -|+ style="color: red;"| caption3 -|- -| foo -|} -!! result - - - - -
    caption2 - caption3 -
    foo -
    - -!! end - -!! test -Table td-cell syntax variations -!! input -{| -| foo bar foo | baz -| foo bar foo || baz -| style='color:red;' | baz -| style='color:red;' || baz -|} -!! result - - - - - - - -
    baz - foo bar foo baz - baz - style='color:red;' baz -
    - -!! end - -!! test -Simple table -!! input -{| -| 1 || 2 -|- -| 3 || 4 -|} -!! result - - - - - - -
    1 2 -
    3 4 -
    - -!! end - -!! test -Simple table but with multiple dashes for row wikitext -!! input -{| -| foo -|----- -| bar -|} -!! result - - - - -
    foo -
    bar -
    - -!! end -!! test -Multiplication table -!! input -{| border="1" cellpadding="2" -|+Multiplication table -|- -! × !! 1 !! 2 !! 3 -|- -! 1 -| 1 || 2 || 3 -|- -! 2 -| 2 || 4 || 6 -|- -! 3 -| 3 || 6 || 9 -|- -! 4 -| 4 || 8 || 12 -|- -! 5 -| 5 || 10 || 15 -|} -!! result - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Multiplication table -
    × 1 2 3 -
    1 - 1 2 3 -
    2 - 2 4 6 -
    3 - 3 6 9 -
    4 - 4 8 12 -
    5 - 5 10 15 -
    - -!! end - -!! test -Accept "||" in table headings -!! input -{| -!h1 || h2 -|} -!! result - - - -
    h1 h2 -
    - -!! end - -!! test -Accept "||" in indented table headings -!! input -:{| -!h1 || h2 -|} -!! result -
    - - -
    h1 h2 -
    - -!! end - -!! test -Accept empty attributes in td/th cells (td/th cells starting with leading ||) -!! input -{| -!| h1 -|| a -|} -!! result - - - -
    h1 - a -
    - -!! end - -!!test -Accept "| !" at start of line in tables (ignore !-attribute) -!!input -{| -|- -| !style="color:red" | bar -|} -!!result - - - -
    bar -
    - -!!end - -!!test -Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between "|" and +/- -!!input -{| -|- -|style='color:red;'|+1 -|style='color:blue;'|-1 -|- -| 1 || 2 || 3 -| 1 ||+2 ||-3 -|- -| +1 -| -1 -|} -!!result - - - - - - - - - - - - - - -
    +1 --1 -
    1 2 3 - 1 +2 -3 -
    +1 - -1 -
    - -!!end - -!! test -Table rowspan -!! input -{| border=1 -| Cell 1, row 1 -|rowspan=2| Cell 2, row 1 (and 2) -| Cell 3, row 1 -|- -| Cell 1, row 2 -| Cell 3, row 2 -|} -!! result - - - - - - - -
    Cell 1, row 1 - Cell 2, row 1 (and 2) - Cell 3, row 1 -
    Cell 1, row 2 - Cell 3, row 2 -
    - -!! end - -!! test -Nested table -!! input -{| border=1 -| α -| -{| bgcolor=#ABCDEF border=2 -|nested -|- -|table -|} -|the original table again -|} -!! result - - - - -
    α - - - - - -
    nested -
    table -
    -
    the original table again -
    - -!! end - -!! test -Invalid attributes in table cell (bug 1830) -!! input -{| -|Cell:|broken -|} -!! result - - -
    broken -
    - -!! end - - -!! test -Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html) -!! input -{| -| |[ftp://|x||]" onmouseover="alert(document.cookie)">test -!! result - - - - - -
    [ftp://%7Cx]" onmouseover="alert(document.cookie)">test -
    - -!! end - - -!! test -Indented table markup mixed with indented pre content (proposed in bug 6200) -!! input - - - - -
    - Text that should be rendered preformatted -
    -!! result - - - - -
    -
    Text that should be rendered preformatted
    -
    -
    - -!! end - -!! test -Template-generated table cell attributes and cell content -!! input -{| -|{{table_attribs}} -| {{table_attribs}} -|} -!! result - - - -
    Foo - Foo -
    - -!! end - -!! test -Template-generated table cell attributes and cell content (2) -!! input -{| -|align=center {{table_attribs}} -|} -!! result - - -
    Foo -
    - -!! end - -!! test -Template-generated table cell attributes and cell content (3) -!! input -{| -|align=center {{table_cells}} -|} -!! result - - - - -
    Foo Bar Baz -
    - -!! end - -!! test -Table with row followed by newlines and table heading -!! input -{| -|- - -! foo -|} -!! result - - - - -
    foo -
    - -!! end - -!! test -Table with empty line following the start tag -!! input -{| - -|- -| foo -|} -!! result - - - - -
    foo -
    - -!! end - -# FIXME: Preserve the attribute properly (with an empty string as value) in -# the PHP parser. Parsoid implements the behavior below. -!! test -Table attributes with empty value -!! options -parsoid -!! input -{| -| style=| hello -|} -!! result - - - -
    hello -
    - -!! end - -!! test -Wikitext table with a lot of comments -!! input -{| - -| foo - -|- - -| - -|} -!! result - - - - -
    foo -
    -
    - -!! end - -!! test -Wikitext table with double-line table cell -!! input -{| -|a -b -|} -!! result - - -
    a -

    b -

    -
    - -!! end - -!! test -Table cell with a single comment -!! input -{| -| -| a -|} -!! result - - - -
    - a -
    - -!! end - -# The expected HTML structure in this test is debatable. The PHP parser does -# not parse this kind of table at all. The main focus for Parsoid is on -# round-tripping, so this output is ok for now. TODO: revisit! -!! test -Wikitext table with html-syntax row (Parsoid) -!! options -parsoid -!! input -{| -|- -foo -|} -!! result - - - -
    foo
    -!! end - -!! test -Implicit after a |- -(PHP parser relies on Tidy to add the missing tags) -!! options -parsoid=wt2html,wt2wt -!! input -{| -|- -a -|} -!! result - - -
    a
    -!! end - -!! test -Pres should be recognized in an explicit context, but not in an implicit context -(PHP parser relies on Tidy to add the missing tags) -!! options -parsoid=wt2html,wt2wt -!! input -{| -|- -| - a -|- - b -|} -!! result - - - - - -
    a
    b
    -!! end - -!! test -Lists should be recognized in an implicit context -(PHP parser relies on Tidy to add the missing tags) -!! options -parsoid=wt2html,wt2wt -!! input -{| -|- -*a -|} -!! result - - - - -
      -
    • a
    • -
    -!! end - -!! test -Parsoid: Round-trip tables directly followed by content (bug 51219) -!! options -parsoid=wt2html,wt2wt -!! input -{| -|foo -|} bar - -{| -|baz -|}quux -!! result - - -
    foo
    bar - - - -
    baz
    quux -!! end - -!! test -Parsoid: Default to a newline after tables in new content (bug 51219) -!! options -parsoid=html2wt -!! input -{| -|foo -|} - bar -{| -|baz -|} -'''quux''' -!! result - -
    foo
    bar - -
    baz
    quux -!! end - -### -### Internal links -### -!! test -Plain link, capitalized -!! input -[[Main Page]] -!! result -

    Main Page -

    -!! end - -!! test -Plain link, uncapitalized -!! input -[[main Page]] -!! result -

    main Page -

    -!! end - -!! test -Piped link -!! input -[[Main Page|The Main Page]] -!! result -

    The Main Page -

    -!! end - -!! test -Piped link with comment in link text -!! input -[[Main Page|The Main Page]] -!! result -

    The Main Page -

    -!! end - -!! test -Broken link -!! input -[[Zigzagzogzagzig]] -!! result -

    Zigzagzogzagzig -

    -!! end - -!! test -Broken link with fragment -!! input -[[Zigzagzogzagzig#zug]] -!! result -

    Zigzagzogzagzig#zug -

    -!! end - -!! test -Special page link with fragment -!! input -[[Special:Version#anchor]] -!! result -

    Special:Version#anchor -

    -!! end - -!! test -Nonexistent special page link with fragment -!! input -[[Special:ThisNameWillHopefullyNeverBeUsed#anchor]] -!! result -

    Special:ThisNameWillHopefullyNeverBeUsed#anchor -

    -!! end - -!! test -Link with prefix -!! input -xxx[[main Page]], xxx[[Main Page]], Xxx[[main Page]] XXX[[main Page]], XXX[[Main Page]] -!! result -

    xxxmain Page, xxxMain Page, Xxxmain Page XXXmain Page, XXXMain Page -

    -!! end - -!! test -Link with suffix -!! input -[[Main Page]]xxx, [[Main Page]]XXX, [[Main Page]]!!! -!! result -

    Main Pagexxx, Main PageXXX, Main Page!!! -

    -!! end - -!! article -prefixed article -!! text -Some text -!! endarticle - -!! test -Bug 43661: Piped links with identical prefixes -!! input -[[prefixed article|prefixed articles with spaces]] - -[[prefixed article|prefixed articlesaoeu]] - -[[Main Page|Main Page test]] -!! result -

    prefixed articles with spaces -

    prefixed articlesaoeu -

    Main Page test -

    -!! end - - -!! test -Link with HTML entity in suffix / tail -!! input -[[Main Page]]", [[Main Page]]a -!! result -

    Main Page", Main Pagea -

    -!! end - -!! test -Link with 3 brackets -!! input -[[[main page]]] -!! result -

    [[[main page]]] -

    -!! end - -!! test -Piped link with 3 brackets -!! input -[[[main page|the main page]]] -!! result -

    [[[main page|the main page]]] -

    -!! end - -!! test -Link with multiple pipes -!! input -[[Main Page|The|Main|Page]] -!! result -

    The|Main|Page -

    -!! end - -!! test -Link to namespaces -!! input -[[Talk:Parser testing]], [[Meta:Disclaimers]] -!! result -

    Talk:Parser testing, Meta:Disclaimers -

    -!! end - -!! article -MemoryAlpha:AlphaTest -!! text -This is an article in the MemoryAlpha namespace -(which shadows the memoryalpha interwiki link). -!! endarticle - -!! test -Namespace takes precedence over interwiki link (bug 51680) -!! input -[[MemoryAlpha:AlphaTest]] -!! result -

    MemoryAlpha:AlphaTest -

    -!! end - -!! test -Piped link to namespace -!! input -[[Meta:Disclaimers|The disclaimers]] -!! result -

    The disclaimers -

    -!! end - -!! test -Link containing } -!! input -[[Usually caused by a typo (oops}]] -!! result -

    [[Usually caused by a typo (oops}]] -

    -!! end - -!! test -Link containing % (not as a hex sequence) -!! input -[[7% Solution]] -!! result -

    7% Solution -

    -!! end - -!! test -Link containing % as a single hex sequence interpreted to char -!! input -[[7%25 Solution]] -!! result -

    7% Solution -

    -!!end - -!! test -Link containing % as a double hex sequence interpreted to hex sequence -!! input -[[7%2525 Solution]] -!! result -

    [[7%2525 Solution]] -

    -!!end - -!! test -Link containing "#<" and "#>" % as a hex sequences- these are valid section anchors -Example for such a section: == < == -!! input -[[%23%3c]][[%23%3e]] -!! result -

    #<#> -

    -!! end - -!! test -Link containing "<#" and ">#" as a hex sequences -!! input -[[%3c%23]][[%3e%23]] -!! result -

    [[%3c%23]][[%3e%23]] -

    -!! end - -!! test -Link containing an equals sign -!! input -[[Special:BookSources/isbn=4-00-026157-6]] -!! result -

    Special:BookSources/isbn=4-00-026157-6 -

    -!! end - -!! article -Foo~bar -!! text -Just a test of an article title containing a tilde. -!! endarticle - -# note that links containing signatures, like [[Foo~~~~]], are -# massaged by the pre-save transform (PST) and so the tildes are never -# seen by the parser. -!! test -Link containing a tilde -!! input -[[Foo~bar]] -!! result -

    Foo~bar -

    -!! end - -!! test -Link containing double-single-quotes '' (bug 4598) -!! input -[[Lista d''e paise d''o munno]] -!! result -

    Lista d''e paise d''o munno -

    -!! end - -!! test -Link containing double-single-quotes '' in text (bug 4598 sanity check) -!! input -Some [[Link|pretty ''italics'' and stuff]]! -!! result -

    Some pretty italics and stuff! -

    -!! end - -!! test -Link containing double-single-quotes '' in text embedded in italics (bug 4598 sanity check) -!! input -''Some [[Link|pretty ''italics'' and stuff]]! -!! result -

    Some pretty italics and stuff! -

    -!! end - -!! test -Link with double quotes in title part (literal) and alternate part (interpreted) -!! input -[[File:Denys Savchenko ''Pentecoste''.jpg]] - -[[''Pentecoste'']] - -[[''Pentecoste''|Pentecoste]] - -[[''Pentecoste''|''Pentecoste'']] -!! result -

    File:Denys Savchenko Pentecoste.jpg -

    ''Pentecoste'' -

    Pentecoste -

    Pentecoste -

    -!! end - -!! test -Broken image links with HTML captions (bug 39700) -!! input -[[File:Nonexistent|]] -[[File:Nonexistent|100px|]] -[[File:Nonexistent|<]] -[[File:Nonexistent|abc]] -!! result -

    <script></script> -<script></script> -< -abc -

    -!! end - -!! test -Plain link to URL -!! input -[[http://www.example.com]] -!! result -

    [[1]] -

    -!! end - -!! test -Plain link to URL with link text -!! input -[[http://www.example.com Link text]] -!! result -

    [Link text] -

    -!! end - -!! test -Plain link to protocol-relative URL -!! input -[[//www.example.com]] -!! result -

    [[1]] -

    -!! end - -!! test -Plain link to protocol-relative URL with link text -!! input -[[//www.example.com Link text]] -!! result -

    [Link text] -

    -!! end - -!! test -Plain link to page with question mark in title -!! input -[[A?b]] - -[[A?b|Baz]] -!! result -

    A?b -

    Baz -

    -!! end - - -# I'm fairly sure the expected result here is wrong. -# We want these to be URL links, not pseudo-pages with URLs for titles.... -# However the current output is also pretty screwy. -# -# ---- -# I'm changing it to match the current output--it arguably makes more -# sense in the light of the test above. Old expected result was: -#

    Piped link to URL: an example URL -#

    -# But I think this test is bordering on "garbage in, garbage out" anyway. -# -- wtm -!! test -Piped link to URL -!! input -Piped link to URL: [[http://www.example.com|an example URL]] -!! result -

    Piped link to URL: [example URL] -

    -!! end - -!! test -BUG 2: [[page|http://url/]] should link to page, not http://url/ -!! input -[[Main Page|http://url/]] -!! result -

    http://url/ -

    -!! end - -!! test -BUG 337: Escaped self-links should be bold -!! options -title=[[Bug462]] -!! input -[[Bug462]] [[Bug462]] -!! result -

    Bug462 Bug462 -

    -!! end - -!! test -Self-link to section should not be bold -!! options -title=[[Main Page]] -!! input -[[Main Page#section]] -!! result -

    Main Page#section -

    -!! end - -!! article -00 -!! text -This is 00. -!! endarticle - -!!test -Self-link to numeric title -!!options -title=[[0]] -!!input -[[0]] -!!result -

    0 -

    -!!end - -!!test -Link to numeric-equivalent title -!!options -title=[[0]] -!!input -[[00]] -!!result -

    00 -

    -!!end - -!! test - inside a link -!! input -[[Main Page]] [[Main Page|the main page [it's not very good]]] -!! result -

    [[Main Page]] the main page [it's not very good] -

    -!! end - -!! test -Non-breaking spaces in title -!! input -[[  Main   Page  ]] -!! result -

      Main   Page   -

    -!!end - -!! test -Internal link with ca linktrail, surrounded by bold apostrophes (bug 27473 primary issue) -!! options -language=ca -!! input -'''[[Main Page]]''' -!! result -

    Main Page -

    -!! end - -!! test -Internal link with ca linktrail, surrounded by italic apostrophes (bug 27473 primary issue) -!! options -language=ca -!! input -''[[Main Page]]'' -!! result -

    Main Page -

    -!! end - -!! test -Internal link with en linktrail: no apostrophes (bug 27473) -!! options -language=en -!! input -[[Something]]'nice -!! result -

    Something'nice -

    -!! end - -!! test -Internal link with ca linktrail with apostrophes (bug 27473) -!! options -language=ca -!! input -[[Something]]'nice -!! result -

    Something'nice -

    -!! end - -!! test -Internal link with kaa linktrail with apostrophes (bug 27473) -!! options -language=kaa -!! input -[[Something]]'nice -!! result -

    Something'nice -

    -!! end - -!! article -Söfnuður -!! text -Test. -!! endarticle - -!! test -Internal link with is link prefix -!! options -language=is -!! input -Aðrir mótmælenda[[söfnuður|söfnuðir]] og -!! result -

    Aðrir mótmælendasöfnuðir og -

    -!! end - -!! article -Mótmælendatrú -!! text -Test. -!! endarticle - -!! test -Internal link with is link trail and link prefix -!! options -language=is -!! input -[[mótmælendatrú|xxx]]ar -[[mótmælendatrú]]ar -mótmælenda[[söfnuður]] -mótmælenda[[söfnuður|söfnuðir]] -mótmælenda[[söfnuður|söfnuðir]]xxx -!! result -

    xxxar -mótmælendatrúar -mótmælendasöfnuður -mótmælendasöfnuðir -mótmælendasöfnuðirxxx -

    -!! end - -!! test -Parsoid link trail escaping -!! options -parsoid=html2wt,html2html -!! input -[[apple]]s -!! result -

    apples

    -!! end - -!! test -Parsoid link prefix escaping -!! options -language=is -parsoid=html2wt,html2html -!! input -Aðrir mótmælenda[[söfnuður]] -!! result -

    Aðrir mótmælendasöfnuður

    -!! end - -!! test -Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved -!! input -[[Foo| bar]] - -[[Foo| ''bar'']] - -[http://wp.org foo] - -[http://wp.org ''foo''] -!! result -

    bar -

    bar -

    foo -

    foo -

    -!! end - -### -### Interwiki links (see maintenance/interwiki.sql) -### - -!! test -Inline interwiki link -!! input -[[MeatBall:SoftSecurity]] -!! result -

    MeatBall:SoftSecurity -

    -!! end - -!! test -Inline interwiki link with empty title (bug 2372) -!! input -[[MeatBall:]] -!! result -

    MeatBall: -

    -!! end - -!! test -Interwiki link encoding conversion (bug 1636) -!! input -*[[Wikipedia:ro:Olteniţa]] -*[[Wikipedia:ro:Olteniţa]] -!! result - - -!! end - -!! test -Interwiki link with fragment (bug 2130) -!! input -[[MeatBall:SoftSecurity#foo]] -!! result -

    MeatBall:SoftSecurity#foo -

    -!! end - - -### -### Interlanguage links -### Language links (so that searching for '### language' matches..) -### - -!! test -Interlanguage link -!! input -Blah blah blah -[[zh:Chinese]] -!!result -

    Blah blah blah -

    -!! end - -!! test -Double interlanguage link -!! input -Blah blah blah -[[es:Spanish]] -[[zh:Chinese]] -!!result -

    Blah blah blah -

    -!! end - -!! test -Interlanguage link, with prefix links -!! options -language=ln -!! input -Blah blah blah -[[zh:Chinese]] -!!result -

    Blah blah blah -

    -!! end - -!! test -Double interlanguage link, with prefix links (bug 8897) -!! options -language=ln -!! input -Blah blah blah -[[es:Spanish]] -[[zh:Chinese]] -!!result -

    Blah blah blah -

    -!! end - -!! test -Parsoid-specific test: Wikilinks with   should RT properly -!! options -language=ln -!! input -[[WW II]] -!!result -

    WW II -

    -!! end - -!! test -Parsoid bug 53221: Wikilinks should be properly entity-escaped -!! options -parsoid=html2wt -!! input -He&nbsp;llo [[Foo|He&nbsp;llo]] - -He&nbsp;llo [[He&nbsp;llo]] -!!result -

    He&nbsp;llo He&nbsp;llo

    -

    He&nbsp;llo He&nbsp;llo

    -!! end - -!! test -Parsoid: handle constructor well -!! options -parsoid -!! input -[[constructor]] - -[[constructor:foo]] -!! result -

    constructor

    - - -

    constructor:foo

    -!! end - -!! test -Parsoid: recognize interlanguage links without a target page -!! options -parsoid -!! input -[[ko:]] -!! result -

    -

    -!! end - -!! test -Parsoid: recognize interwiki links without a target page -!! options -parsoid -!! input -[[:ko:]] -!! result -

    ko:

    -!! end - -### -### Redirects, Parsoid-only -### -!! test -Simple redirect to page -!! options -parsoid -!! input -#REDIRECT [[Main Page]] -!! result - -!! end - -!! test -Optional colon in #REDIRECT -!! options -# the colon is archaic syntax. we support it for wt2html, but we -# don't care that it roundtrips back to the modern syntax. -parsoid=wt2html,html2html -!! input -#REDIRECT:[[Main Page]] -!! result - -!! end - -!! test -Whitespace in #REDIRECT with optional colon -!! options -# the colon and gratuitous whitespace is archaic syntax. we support -# it for wt2html, but we don't care that it roundtrips back to the -# modern syntax (without extra whitespace) -parsoid=wt2html,html2html -!! input - - #REDIRECT -: -[[Main Page]] -!! result - -!! end - -!! test -Piped link in #REDIRECT -!! options -# content after piped link is ignored. we support this syntax, -# but don't care that the piped link is lost when we roundtrip this. -parsoid=wt2html -!! input -#REDIRECT [[Main Page|bar]] -!! result - -!! end - -!! test -Redirect to category -!! options -parsoid=wt2html -!! input -#REDIRECT [[Category:Foo]] -!! result - -!! end - -!! test -Redirect to category with URL encoding -!! options -parsoid=wt2html -!! input -#REDIRECT [[Category%3AFoo]] -!! result - -!! end - -!! test -Redirect to category page -!! options -parsoid=wt2html,html2html -!! input -#REDIRECT [[:Category:Foo]] -!! result -

    Category:Foo

    -!! end - -!! test -Redirect to image page (1) -!! options -parsoid -!! input -#REDIRECT [[File:Wiki.png]] -!! result - -!! end - -!! test -Redirect to image page (2) -!! options -parsoid -!! input -#REDIRECT [[Image:Wiki.png]] -!! result - -!! end - -!! test -Redirect to language -!! options -parsoid -!! input -#REDIRECT [[en:File:Wiki.png]] -!! result - -!! end - -!! test -Redirect to interwiki -!! options -parsoid -!! input -#REDIRECT [[meatball:File:Wiki.png]] -!! result - -!! end - -!! test -Non-English #REDIRECT -!! options -parsoid -language=is -!! input -#TILVÍSUN [[Main Page]] -!! result - -!! end - -## -## XHTML tidiness -### - -!! test -
    to
    -!! input -1
    2
    3 -!! result -

    1
    2
    3 -

    -!! end - -!! test -Broken br tag sanitization -!! options -php -!! input -
    -!! result -

    </br> -

    -!! end - -# TODO: Fix html2html mode (bug 51055)! -!! test -Parsoid: Broken br tag recognition -!! options -parsoid=wt2html -!! input -
    -!! result -


    -!! end - -!! test -Incorrecly removing closing slashes from correctly formed XHTML -!! input -
    -!! result -


    -

    -!! end - -!! test -Failing to transform badly formed HTML into correct XHTML -!! input -
    -
    -
    -!! result -


    -
    -
    -

    -!!end - -!! test -Handling html with a div self-closing tag -!! input -
    -
    -
    -
    -
    -
    -!! result -

    <div title /> -<div title/> -

    -
    -

    <div title=bar /> -<div title=bar/> -

    -
    -
    - -!! end - -!! test -Handling html with a br self-closing tag -!! input -
    -
    -
    -
    -
    -
    -!! result -


    -
    -
    -
    -
    -
    -

    -!! end - -!! test -Horizontal ruler (should it add that extra space?) -!! input -
    -
    -foo
    bar -!! result -
    -
    -foo
    bar - -!! end - -!! test -Horizontal ruler -- 4+ dashes render hr -!! input ----- -!! result -
    - -!! end - -!! test -Horizontal ruler -- eats additional dashes on the same line -!! input ---------- -!! result -
    - -!! end - -!! test -Horizontal ruler -- does not collapse dashes on consecutive lines -!! input ----- ----- -!! result -
    -
    - -!! end - -!! test -Horizontal ruler -- <4 dashes render as plain text -!! input ---- -!! result -

    --- -

    -!! end - -!! test -Horizontal ruler -- Supports content following dashes on same line -!! input ----- Foo -!! result -
    Foo - -!! end - -### -### Block-level elements -### -!! test -Common list -!! input -*Common list -* item 2 -*item 3 -!! result -
      -
    • Common list -
    • -
    • item 2 -
    • -
    • item 3 -
    • -
    - -!! end - -!! test -Numbered list -!! input -#Numbered list -#item 2 -# item 3 -!! result -
      -
    1. Numbered list -
    2. -
    3. item 2 -
    4. -
    5. item 3 -
    6. -
    - -!! end - -!! test -Mixed list -!! input -*Mixed list -*# with numbers -** and bullets -*# and numbers -*bullets again -**bullet level 2 -***bullet level 3 -***#Number on level 4 -**bullet level 2 -**#Number on level 3 -**#Number on level 3 -*#number level 2 -*Level 1 -*** Level 3 -#** Level 3, but ordered -!! result -
      -
    • Mixed list -
        -
      1. with numbers -
      2. -
      -
        -
      • and bullets -
      • -
      -
        -
      1. and numbers -
      2. -
      -
    • -
    • bullets again -
        -
      • bullet level 2 -
          -
        • bullet level 3 -
            -
          1. Number on level 4 -
          2. -
          -
        • -
        -
      • -
      • bullet level 2 -
          -
        1. Number on level 3 -
        2. -
        3. Number on level 3 -
        4. -
        -
      • -
      -
        -
      1. number level 2 -
      2. -
      -
    • -
    • Level 1 -
        -
        • -
        • Level 3 -
        • -
        -
      • -
      -
    • -
    -
      -
      • -
        • -
        • Level 3, but ordered -
        • -
        -
      • -
      -
    1. -
    - -!! end - -!! test -Nested lists 1 -!! input -*foo -**bar -!! result -
      -
    • foo -
        -
      • bar -
      • -
      -
    • -
    - -!! end - -!! test -Nested lists 2 -!! input -**foo -*bar -!! result -
      -
      • -
      • foo -
      • -
      -
    • -
    • bar -
    • -
    - -!! end - -!! test -Nested lists 3 (first element empty) -!! input -* -**bar -!! result -
      -
    • -
        -
      • bar -
      • -
      -
    • -
    - -!! end - -!! test -Nested lists 4 (first element empty) -!! input -** -*bar -!! result -
      -
      • -
      • -
      • -
      -
    • -
    • bar -
    • -
    - -!! end - -!! test -Nested lists 5 (both elements empty) -!! input -** -* -!! result -
      -
      • -
      • -
      • -
      -
    • -
    • -
    • -
    - -!! end - -!! test -Nested lists 6 (both elements empty) -!! input -* -** -!! result -
      -
    • -
        -
      • -
      • -
      -
    • -
    - -!! end - -!! test -Nested lists 7 (skip initial nesting levels) -!! input -*** foo -!! result -
      -
      • -
        • -
        • foo -
        • -
        -
      • -
      -
    • -
    - -!! end - -!! test -Nested lists 8 (multiple nesting transitions) -!! input -* foo -*** bar -** baz -* boo -!! result -
      -
    • foo -
        -
        • -
        • bar -
        • -
        -
      • -
      • baz -
      • -
      -
    • -
    • boo -
    • -
    - -!! end - -!! test -1. Lists with start-of-line-transparent tokens before bullets: Comments -!! input -*foo -*bar -*baz -!! result -
      -
    • foo -
    • -
    • bar -
    • -
    • baz -
    • -
    - -!! end - -!! test -2. Lists with start-of-line-transparent tokens before bullets: Template close -!! input -*foo {{echo|bar -}}*baz -!! result -
      -
    • foo bar -
    • -
    • baz -
    • -
    - -!! end - -!! test -List items are not parsed correctly following a
     block (bug 785)
    -!! input
    -* 
    foo
    -*
    bar
    -* zar -!! result -
      -
    • foo
      -
    • -
    • bar
      -
    • -
    • zar -
    • -
    - -!! end - -!! test -List items from template -!! input - -{{inner list}} -* item 2 - -* item 0 -{{inner list}} -* item 2 - -* item 0 -* notSOL{{inner list}} -* item 2 -!! result -
      -
    • item 1 -
    • -
    • item 2 -
    • -
    -
      -
    • item 0 -
    • -
    • item 1 -
    • -
    • item 2 -
    • -
    -
      -
    • item 0 -
    • -
    • notSOL -
    • -
    • item 1 -
    • -
    • item 2 -
    • -
    - -!! end - -!! test -List interrupted by empty line or heading -!! input -* foo - -** bar -== A heading == -* Another list item -!! result -
      -
    • foo -
    • -
    -
      -
      • -
      • bar -
      • -
      -
    • -
    -

    A heading[edit]

    -
      -
    • Another list item -
    • -
    - -!!end - -!!test -Multiple list tags generated by templates -!!input -{{echo|
  • }}a -{{echo|
  • }}b -{{echo|
  • }}c -!!result -
  • a -
  • b -
  • c
  • - - - -!!end - -!!test -Single-comment whitespace lines dont break lists, and neither do multi-comment whitespace lines -!!input -*a - -*b - -*c - -*d -!!result -
      -
    • a -
    • -
    • b -
    • -
    • c -
    • -
    • d -
    • -
    - -!!end - -!!test -Replacing whitespace with tabs still doesn't break the list (gerrit 78327) -!!input -*a - -*b - -*c - -*d -!!result -
      -
    • a -
    • -
    • b -
    • -
    • c -
    • -
    • d -
    • -
    - -!!end - -!!test -Test the li-hack -(Cannot test this with PHP parser since it relies on Tidy for the hack) -!!options -parsoid=wt2html,wt2wt -!!input -* foo -*
  • li-hack -* {{echo|
  • templated li-hack}} -*
  • unsupported li-hack with preceding comments - -
      -
    • not a li-hack -
    • -
    -!!result -
      -
    • foo
    • -
    • li-hack
    • -
    • templated li-hack
    • -
    • -
    • li-hack with preceding comments
    • -
    - -
      -
    • -
    • not a li-hack -
    • -
    -!!end - -!! test -Parsoid: Make sure nested lists are serialized on their own line even if HTML contains no newlines -!! options -parsoid -!! input -# foo -## bar -* foo -** bar -: foo -:: bar -!! result -
      -
    1. foo
        -
      1. bar
      2. -
    2. -
      -
    • foo
        -
      • bar
      • -
    • -
    -
    foo
    -
    bar
    -
    -
    -!! end - -!! test -Parsoid: Test of whitespace serialization with Templated bullets -!! options -parsoid -!! input -* {{bullet}} -!! result -
      -
    • Bar
    • -
    -!! end - -# ------------------------------------------------------------------------ -# The next set of tests are about Parsoid's ability to handle badly nested -# tags (parse, minimize scope of fixup, and roundtrip back) -# ------------------------------------------------------------------------ - -!! test -Unbalanced closing block tags break a list -(Parsoid-only since php parser generates broken html -- relies on Tidy to fix up) -!! options -parsoid -!! input -
    -*a
    -*b
    -!! result -
    -
      -
    • a -
    • -
    -
      -
    • b -
    • -
    -!! end - -!! test -Unbalanced closing non-block tags don't break a list -(Parsoid-only since php parser generates broken html -- relies on Tidy to fix up) -!! options -parsoid -!! input - -*a -*b -!! result -

    -

    -
      -
    • a -
    • -
    • b -
    • -
    -!! end - -!! test -Unclosed formatting tags that straddle lists are closed and reopened -(Parsoid-only since php parser generates broken html -- relies on Tidy to fix up) -!! options -parsoid -!! input -# a -# b -!! result -
      -
    1. a -
    2. -
    3. b -
    4. -
    -!! end - -!!test -List embedded in a non-block tag -(Ugly Parsoid output -- worth fixing; Disabled for PHP parser since it relies on Tidy) -!! options -parsoid -!!input - -* foo - -!!result -

    - -
      -
    • foo
    • -
    -
    -

    -!!end - -!! test -Table with missing opening tag -!! options -parsoid=wt2html,wt2wt -!! input - - - -
    foo
    -!! result - - - - -
    foo
    -!! end - -### -### Magic Words -### - -# Note that the current date is hard-coded as -# 1970-01-01T00:02:03Z (a Thursday) -# when running parser tests. The timezone is also fixed to GMT, so -# local date will be identical to current date. - -!! test -Magic Word: {{CURRENTDAY}} -!! input -{{CURRENTDAY}} -!! result -

    1 -

    -!! end - -!! test -Magic Word: {{CURRENTDAY2}} -!! input -{{CURRENTDAY2}} -!! result -

    01 -

    -!! end - -!! test -Magic Word: {{CURRENTDAYNAME}} -!! input -{{CURRENTDAYNAME}} -!! result -

    Thursday -

    -!! end - -!! test -Magic Word: {{CURRENTDOW}} -!! input -{{CURRENTDOW}} -!! result -

    4 -

    -!! end - -!! test -Magic Word: {{CURRENTMONTH}} -!! input -{{CURRENTMONTH}} -!! result -

    01 -

    -!! end - -!! test -Magic Word: {{CURRENTMONTH1}} -!! input -{{CURRENTMONTH1}} -!! result -

    1 -

    -!! end - -!! test -Magic Word: {{CURRENTMONTHABBREV}} -!! input -{{CURRENTMONTHABBREV}} -!! result -

    Jan -

    -!! end - -!! test -Magic Word: {{CURRENTMONTHNAME}} -!! input -{{CURRENTMONTHNAME}} -!! result -

    January -

    -!! end - -!! test -Magic Word: {{CURRENTMONTHNAMEGEN}} -!! input -{{CURRENTMONTHNAMEGEN}} -!! result -

    January -

    -!! end - -!! test -Magic Word: {{CURRENTTIME}} -!! input -{{CURRENTTIME}} -!! result -

    00:02 -

    -!! end - -!! test -Magic Word: {{CURRENTHOUR}} -!! input -{{CURRENTHOUR}} -!! result -

    00 -

    -!! end - -!! test -Magic Word: {{CURRENTWEEK}} (@bug 4594) -!! input -{{CURRENTWEEK}} -!! result -

    1 -

    -!! end - -!! test -Magic Word: {{CURRENTYEAR}} -!! input -{{CURRENTYEAR}} -!! result -

    1970 -

    -!! end - -!! test -Magic Word: {{CURRENTTIMESTAMP}} -!! input -{{CURRENTTIMESTAMP}} -!! result -

    19700101000203 -

    -!! end - -!! test -Magic Words LOCAL (UTC) -!! input -* {{LOCALMONTH}} -* {{LOCALMONTH1}} -* {{LOCALMONTHNAME}} -* {{LOCALMONTHNAMEGEN}} -* {{LOCALMONTHABBREV}} -* {{LOCALDAY}} -* {{LOCALDAY2}} -* {{LOCALDAYNAME}} -* {{LOCALYEAR}} -* {{LOCALTIME}} -* {{LOCALHOUR}} -* {{LOCALWEEK}} -* {{LOCALDOW}} -* {{LOCALTIMESTAMP}} -!! result -
      -
    • 01 -
    • -
    • 1 -
    • -
    • January -
    • -
    • January -
    • -
    • Jan -
    • -
    • 1 -
    • -
    • 01 -
    • -
    • Thursday -
    • -
    • 1970 -
    • -
    • 00:02 -
    • -
    • 00 -
    • -
    • 1 -
    • -
    • 4 -
    • -
    • 19700101000203 -
    • -
    - -!! end - -!! test -Magic Word: {{FULLPAGENAME}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{FULLPAGENAME}} -!! result -

    User:Ævar Arnfjörð Bjarmason -

    -!! end - -!! test -Magic Word: {{FULLPAGENAMEE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{FULLPAGENAMEE}} -!! result -

    User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason -

    -!! end - -!! test -Magic Word: {{TALKSPACE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{TALKSPACE}} -!! result -

    User talk -

    -!! end - -!! test -Magic Word: {{TALKSPACE}}, same namespace -!! options -title=[[User talk:Ævar Arnfjörð Bjarmason]] -!! input -{{TALKSPACE}} -!! result -

    User talk -

    -!! end - -!! test -Magic Word: {{TALKSPACE}}, main namespace -!! options -title=[[Parser Test]] -!! input -{{TALKSPACE}} -!! result -

    Talk -

    -!! end - -!! test -Magic Word: {{TALKSPACEE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{TALKSPACEE}} -!! result -

    User_talk -

    -!! end - -!! test -Magic Word: {{SUBJECTSPACE}} -!! options -title=[[User talk:Ævar Arnfjörð Bjarmason]] -!! input -{{SUBJECTSPACE}} -!! result -

    User -

    -!! end - -!! test -Magic Word: {{SUBJECTSPACE}}, same namespace -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{SUBJECTSPACE}} -!! result -

    User -

    -!! end - -!! test -Magic Word: {{SUBJECTSPACE}}, main namespace -!! options -title=[[Parser Test]] -!! input -{{SUBJECTSPACE}} -!! result - -!! end - -!! test -Magic Word: {{SUBJECTSPACEE}} -!! options -title=[[User talk:Ævar Arnfjörð Bjarmason]] -!! input -{{SUBJECTSPACEE}} -!! result -

    User -

    -!! end - -!! test -Magic Word: {{NAMESPACE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{NAMESPACE}} -!! result -

    User -

    -!! end - -!! test -Magic Word: {{NAMESPACEE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{NAMESPACEE}} -!! result -

    User -

    -!! end - -!! test -Magic Word: {{NAMESPACENUMBER}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{NAMESPACENUMBER}} -!! result -

    2 -

    -!! end - -!! test -Magic Word: {{SUBPAGENAME}} -!! options -title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage -!! input -{{SUBPAGENAME}} -!! result -

    sub ö -

    -!! end - -!! test -Magic Word: {{SUBPAGENAMEE}} -!! options -title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage -!! input -{{SUBPAGENAMEE}} -!! result -

    sub_%C3%B6 -

    -!! end - -!! test -Magic Word: {{ROOTPAGENAME}} -!! options -title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage -!! input -{{ROOTPAGENAME}} -!! result -

    Ævar Arnfjörð Bjarmason -

    -!! end - -!! test -Magic Word: {{ROOTPAGENAMEE}} -!! options -title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage -!! input -{{ROOTPAGENAMEE}} -!! result -

    %C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason -

    -!! end - -!! test -Magic Word: {{BASEPAGENAME}} -!! options -title=[[Ævar Arnfjörð Bjarmason/sub]] subpage -!! input -{{BASEPAGENAME}} -!! result -

    Ævar Arnfjörð Bjarmason -

    -!! end - -!! test -Magic Word: {{BASEPAGENAMEE}} -!! options -title=[[Ævar Arnfjörð Bjarmason/sub]] subpage -!! input -{{BASEPAGENAMEE}} -!! result -

    %C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason -

    -!! end - -!! test -Magic Word: {{TALKPAGENAME}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{TALKPAGENAME}} -!! result -

    User talk:Ævar Arnfjörð Bjarmason -

    -!! end - -!! test -Magic Word: {{TALKPAGENAMEE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{TALKPAGENAMEE}} -!! result -

    User_talk:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason -

    -!! end - -!! test -Magic Word: {{SUBJECTPAGENAME}} -!! options -title=[[User talk:Ævar Arnfjörð Bjarmason]] -!! input -{{SUBJECTPAGENAME}} -!! result -

    User:Ævar Arnfjörð Bjarmason -

    -!! end - -!! test -Magic Word: {{SUBJECTPAGENAMEE}} -!! options -title=[[User talk:Ævar Arnfjörð Bjarmason]] -!! input -{{SUBJECTPAGENAMEE}} -!! result -

    User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason -

    -!! end - -!! test -Magic Word: {{NUMBEROFFILES}} -!! input -{{NUMBEROFFILES}} -!! result -

    4 -

    -!! end - -!! test -Magic Word: {{PAGENAME}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{PAGENAME}} -!! result -

    Ævar Arnfjörð Bjarmason -

    -!! end - -!! test -Magic Word: {{PAGENAME}} with metacharacters -!! options -title=[['foo & bar = baz']] -!! input -''{{PAGENAME}}'' -!! result -

    'foo & bar = baz' -

    -!! end - -!! test -Magic Word: {{PAGENAME}} with metacharacters (bug 26781) -!! options -title=[[*RFC 1234 http://example.com/]] -!! input -{{PAGENAME}} -!! result -

    *RFC 1234 http://example.com/ -

    -!! end - -!! test -Magic Word: {{PAGENAMEE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{PAGENAMEE}} -!! result -

    %C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason -

    -!! end - -!! test -Magic Word: {{PAGENAMEE}} with metacharacters (bug 26781) -!! options -title=[[*RFC 1234 http://example.com/]] -!! input -{{PAGENAMEE}} -!! result -

    *RFC_1234_http://example.com/ -

    -!! end - -!! test -Magic Word: {{REVISIONID}} -!! input -{{REVISIONID}} -!! result -

    1337 -

    -!! end - -!! test -Magic Word: {{SCRIPTPATH}} -!! input -{{SCRIPTPATH}} -!! result -

    / -

    -!! end - -!! test -Magic Word: {{STYLEPATH}} -!! input -{{STYLEPATH}} -!! result -

    /skins -

    -!! end - -!! test -Magic Word: {{SERVER}} -!! input -{{SERVER}} -!! result -

    http://example.org -

    -!! end - -!! test -Magic Word: {{SERVERNAME}} -!! input -{{SERVERNAME}} -!! result -

    example.org -

    -!! end - -!! test -Magic Word: {{SITENAME}} -!! input -{{SITENAME}} -!! result -

    MediaWiki -

    -!! end - -!! test -Case-sensitive magic words, when cased differently, should just be template transclusions -!! input -{{CurrentMonth}} -{{currentday}} -{{cURreNTweEK}} -{{currentHour}} -!! result -

    Template:CurrentMonth -Template:Currentday -Template:CURreNTweEK -Template:CurrentHour -

    -!! end - -!! test -Case-insensitive magic words should still work with weird casing. -!! input -{{sErVeRNaMe}} -{{LCFirst:AOEU}} -{{ucFIRST:aoeu}} -{{SERver}} -!! result -

    example.org -aOEU -Aoeu -http://example.org -

    -!! end - -!! test -Namespace 1 {{ns:1}} -!! input -{{ns:1}} -!! result -

    Talk -

    -!! end - -!! test -Namespace 1 {{ns:01}} -!! input -{{ns:01}} -!! result -

    Talk -

    -!! end - -!! test -Namespace 0 {{ns:0}} (bug 4783) -!! input -{{ns:0}} -!! result - -!! end - -!! test -Namespace 0 {{ns:00}} (bug 4783) -!! input -{{ns:00}} -!! result - -!! end - -!! test -Namespace -1 {{ns:-1}} -!! input -{{ns:-1}} -!! result -

    Special -

    -!! end - -!! test -Namespace User {{ns:User}} -!! input -{{ns:User}} -!! result -

    User -

    -!! end - -!! test -Namespace User talk {{ns:User_talk}} -!! input -{{ns:User_talk}} -!! result -

    User talk -

    -!! end - -!! test -Namespace User talk {{ns:uSeR tAlK}} -!! input -{{ns:uSeR tAlK}} -!! result -

    User talk -

    -!! end - -!! test -Namespace File {{ns:File}} -!! input -{{ns:File}} -!! result -

    File -

    -!! end - -!! test -Namespace File {{ns:Image}} -!! input -{{ns:Image}} -!! result -

    File -

    -!! end - -!! test -Namespace (lang=de) Benutzer {{ns:User}} -!! options -language=de -!! input -{{ns:User}} -!! result -

    Benutzer -

    -!! end - -!! test -Namespace (lang=de) Benutzer Diskussion {{ns:3}} -!! options -language=de -!! input -{{ns:3}} -!! result -

    Benutzer Diskussion -

    -!! end - - -!! test -Urlencode -!! input -{{urlencode:hi world?!}} -{{urlencode:hi world?!|WIKI}} -{{urlencode:hi world?!|PATH}} -{{urlencode:hi world?!|QUERY}} -!! result -

    hi+world%3F%21 -hi_world%3F! -hi%20world%3F%21 -hi+world%3F%21 -

    -!! end - -### -### Magic links -### -!! test -Magic links: internal link to RFC (bug 479) -!! input -[[RFC 123]] -!! result -

    RFC 123 -

    -!! end - -!! test -Magic links: RFC (bug 479) -!! input -RFC 822 -!! result -

    RFC 822 -

    -!! end - -!! test -Magic links: ISBN (bug 1937) -!! input -ISBN 0-306-40615-2 -!! result -

    ISBN 0-306-40615-2 -

    -!! end - -!! test -Magic links: PMID incorrectly converts space to underscore -!! input -PMID 1234 -!! result -

    PMID 1234 -

    -!! end - -### -### Templates -#### - -!! test -Nonexistent template -!! input -{{thistemplatedoesnotexist}} -!! result -

    Template:Thistemplatedoesnotexist -

    -!! end - -!! test -Template with invalid target containing tags -!! input -{{ab|{{echo|foo}}|{{echo|a}}={{echo|b}}|a = b}} -!! result -

    {{ab|foo|a=b|a = b}} -

    -!! end - -!! test -Template with invalid target containing unclosed tag -!! input -{{a|{{echo|foo}}|{{echo|a}}={{echo|b}}|a = b}} -!! result -

    {{a|foo|a=b|a = b}} -

    -!! end - -!! article -Template:test -!! text -This is a test template -!! endarticle - -!! test -Simple template -!! input -{{test}} -!! result -

    This is a test template -

    -!! end - -!! test -Template with explicit namespace -!! input -{{Template:test}} -!! result -

    This is a test template -

    -!! end - - -!! article -Template:paramtest -!! text -This is a test template with parameter {{{param}}} -!! endarticle - -!! test -Template parameter -!! input -{{paramtest|param=foo}} -!! result -

    This is a test template with parameter foo -

    -!! end - -!! article -Template:paramtestnum -!! text -[[{{{1}}}|{{{2}}}]] -!! endarticle - -!! test -Template unnamed parameter -!! input -{{paramtestnum|Main Page|the main page}} -!! result -

    the main page -

    -!! end - -!! article -Template:templatesimple -!! text -(test) -!! endarticle - -!! article -Template:templateredirect -!! text -#redirect [[Template:templatesimple]] -!! endarticle - -!! article -Template:templateasargtestnum -!! text -{{{{{1}}}}} -!! endarticle - -!! article -Template:templateasargtest -!! text -{{template{{{templ}}}}} -!! endarticle - -!! article -Template:templateasargtest2 -!! text -{{{{{templ}}}}} -!! endarticle - -!! test -Template with template name as unnamed argument -!! input -{{templateasargtestnum|templatesimple}} -!! result -

    (test) -

    -!! end - -!! test -Template with template name as argument -!! input -{{templateasargtest|templ=simple}} -!! result -

    (test) -

    -!! end - -!! test -Template with template name as argument (2) -!! input -{{templateasargtest2|templ=templatesimple}} -!! result -

    (test) -

    -!! end - -!! article -Template:templateasargtestdefault -!! text -{{{{{templ|templatesimple}}}}} -!! endarticle - -!! article -Template:templa -!! text -'''templ''' -!! endarticle - -!! test -Template with default value -!! input -{{templateasargtestdefault}} -!! result -

    (test) -

    -!! end - -!! test -Template with default value (value set) -!! input -{{templateasargtestdefault|templ=templa}} -!! result -

    templ -

    -!! end - -!! test -Template redirect -!! input -{{templateredirect}} -!! result -

    (test) -

    -!! end - -!! test -Template with argument in separate line -!! input -{{ templateasargtest | - templ = simple }} -!! result -

    (test) -

    -!! end - -!! test -Template with complex template as argument -!! input -{{paramtest| - param ={{ templateasargtest | - templ = simple }}}} -!! result -

    This is a test template with parameter (test) -

    -!! end - -!! test -Template with thumb image (with link in description) -!! input -{{paramtest| - param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}} -!! result -This is a test template with parameter - -!! end - -!! article -Template:complextemplate -!! text -{{{1}}} {{paramtest| - param ={{{param}}}}} -!! endarticle - -!! test -Template with complex arguments -!! input -{{complextemplate| - param ={{ templateasargtest | - templ = simple }}|[[Template:complextemplate|link]]}} -!! result -

    link This is a test template with parameter (test) -

    -!! end - -!! test -BUG 553: link with two variables in a piped link -!! input -{| -|[[{{{1}}}|{{{2}}}]] -|} -!! result - - -
    [[{{{1}}}|{{{2}}}]] -
    - -!! end - -!! test -Magic variable as template parameter -!! input -{{paramtest|param={{SITENAME}}}} -!! result -

    This is a test template with parameter MediaWiki -

    -!! end - -!! article -Template:linktest -!! text -[[{{{param}}}|link]] -!! endarticle - -!! test -Template parameter as link source -!! input -{{linktest|param=Main Page}} -!! result -

    link -

    -!! end - -!!test -Template-generated attribute string (k='v') -!!input -bar -!!result -

    bar -

    -!!end - -!!article -Template:paramtest2 -!! text -including another template, {{paramtest|param={{{arg}}}}} -!! endarticle - -!! test -Template passing argument to another template -!! input -{{paramtest2|arg='hmm'}} -!! result -

    including another template, This is a test template with parameter 'hmm' -

    -!! end - -!! article -Template:Linktest2 -!! text -Main Page -!! endarticle - -!! test -Template as link source -!! input -[[{{linktest2}}]] - -[[{{linktest2}}|Main Page]] - -[[{{linktest2}}]]Page -!! result -

    Main Page -

    Main Page -

    Main PagePage -

    -!! end - - -!! article -Template:loop1 -!! text -{{loop2}} -!! endarticle - -!! article -Template:loop2 -!! text -{{loop1}} -!! endarticle - -!! test -Template infinite loop -!! input -{{loop1}} -!! result -

    Template loop detected: Template:Loop1 -

    -!! end - -!! test -Template from main namespace -!! input -{{:Main Page}} -!! result -

    blah blah -

    -!! end - -!! article -Template:table -!! text -{| -| 1 || 2 -|- -| 3 || 4 -|} -!! endarticle - -!! test -BUG 529: Template with table, not included at beginning of line -!! input -foo {{table}} -!! result -

    foo -

    - - - - - - -
    1 2 -
    3 4 -
    - -!! end - -!! test -BUG 523: Template shouldn't eat newline (or add an extra one before table) -!! input -foo -{{table}} -!! result -

    foo -

    - - - - - - -
    1 2 -
    3 4 -
    - -!! end - -!! test -BUG 41: Template parameters shown as broken links -!! input -{{{parameter}}} -!! result -

    {{{parameter}}} -

    -!! end - -!! test -Template with targets containing wikilinks -!! input -{{[[foo]]}} - -{{[[{{echo|foo}}]]}} - -{{{{echo|[[foo}}]]}} -!! result -

    {{foo}} -

    {{foo}} -

    {{[[foo}}]] -

    -!! end - -!! article -Template:MSGNW test -!! text -''None'' of '''this''' should be -* interpreted - but rather passed unmodified -{{test}} -!! endarticle - -# hmm, fix this or just deprecate msgnw and document its behavior? -!! test -msgnw keyword -!! options -disabled -!! input -{{msgnw:MSGNW test}} -!! result -

    ''None'' of '''this''' should be -* interpreted - but rather passed unmodified -{{test}} -

    -!! end - -!! test -int keyword -!! input -{{int:youhavenewmessages|lots of money|not!}} -!! result -

    You have lots of money (not!). -

    -!! end - -!! article -Template:Includes -!! text -Foozarbar -!! endarticle - -!! test - and being included -!! input -{{Includes}} -!! result -

    Foobar -

    -!! end - -!! article -Template:Includes2 -!! text -Foobar -!! endarticle - -!! test - being included -!! input -{{Includes2}} -!! result -

    Foo -

    -!! end - - -!! article -Template:Includes3 -!! text -Foobarzar -!! endarticle - -!! test - and being included -!! input -{{Includes3}} -!! result -

    Foo -

    -!! end - -!! test - and on a page -!! input -Foozarbar -!! result -

    Foozar -

    -!! end - -!! test -Un-closed -!! input - -!! result -!! end - -!! test - on a page -!! input -Foobar -!! result -

    Foobar -

    -!! end - -!! test -Un-closed -!! input - -!! result -!! end - -!!test -Self-closed noinclude, includeonly, onlyinclude tags -!!input - - - -!!result -


    -

    -!!end - -!!test -Unbalanced includeonly and noinclude tags -!!input -{| -|a
    -|b
    -|c
    -|d
    -|} -!!result - - - - - -
    a -b -c</includeonly> -d</includeonly></includeonly> -
    - -!!end - -!! article -Template:Includeonly section -!! text - -==Includeonly section== - -==Section T-1== -!!endarticle - -!! test -Bug 6563: Edit link generation for section shown by -!! input -{{includeonly section}} -!! result -

    Includeonly section[edit]

    -

    Section T-1[edit]

    - -!! end - -# Uses same input as the contents of [[Template:Includeonly section]] -!! test -Bug 6563: Section extraction for section shown by -!! options -section=T-2 -!! input - -==Includeonly section== - -==Section T-2== -!! result -==Section T-2== -!! end - -!! test -Bug 6563: Edit link generation for section suppressed by -!! input - -==Includeonly section== - -==Section 1== -!! result -

    Section 1[edit]

    - -!! end - -!! test -Bug 6563: Section extraction for section suppressed by -!! options -section=1 -!! input - -==Includeonly section== - -==Section 1== -!! result -==Section 1== -!! end - -!! test -Un-closed -!! input - -!! result -!! end - -# TODO: test with DOM fragment reuse! -!! test -Parsoid: DOM fragment reuse -!! options -parsoid=wt2wt,wt2html -!! input -a{{echo|b
    c}}d - -a{{echo|b -
    -c}}d - -{{echo|a - -
    - -b}} -!! result -ab -
    cd - - -

    ab

    - -
    - -

    cd

    - - -

    a

    - - -
    - - -

    b

    -!! end - -!! test -Parsoid: Merge double tds (bug 50603) -!! options -parsoid -!! input -{| -|{{echo|{{!}} foo}} -|} -!! result - - -
    foo
    -!! end - -!! test -Parsoid: Merge double tds in nested transclusion content (bug 50603) -!! options -parsoid -!! input -{{echo|
    }} -{| -|{{echo|{{!}} foo}} -|} -{{echo|
    }} -!! result -
    - - -
    foo
    -
    -!! end - -### -### and in attributes -### -!!test -0. includeonly around the entire attribute -!!input -id="v1"id="v2">bar -!!result -

    bar -

    -!!end - -!!test -1. includeonly in html attr key -!!input -idabout="foo">bar -!!result -

    bar -

    -!!end - -!!test -2. includeonly in html attr value -!!input -bar -"v1""v2">bar -!!result -

    bar -bar -

    -!!end - -!!test -3. includeonly in part of an attr value -!!input -bar -!!result -

    bar -

    -!!end - -### -### Testing parsing of templates where a template arg -### has the same name as the template itself. -### - -!! article -Template:quote -!! text -{{{quote|{{{1}}}}}} -!! endarticle - -!!test -Templates: Template Name/Arg clash: 1. Use of positional param -!!input -{{quote|foo}} -!!result -

    foo -

    -!!end - -!!test -Templates: Template Name/Arg clash: 2. Use of named param -!!input -{{quote|quote=foo}} -!!result -

    foo -

    -!!end - -!!test -Templates: Template Name/Arg clash: 3. Use of named param with empty input -!!input -{{quote|quote}} -!!result -

    quote -

    -!!end - -### -### Parsoid-centric tests to stress Parsoid's ability to RT them unchanged -### - -!!test -Templates: 1. Simple use -!!input -{{echo|Foo}} -!!result -

    Foo -

    -!!end - -!!test -Templates: 2. Inside a block tag -!!input -
    {{echo|Foo}}
    -
    {{echo|Foo}}
    -!!result -
    Foo
    -
    Foo
    - -!!end - -!!test -Templates: P-wrapping: 1a. Templates on consecutive lines -!!input -{{echo|Foo}} -{{echo|bar}} -!!result -

    Foo -bar -

    -!!end - -!!test -Templates: P-wrapping: 1b. Templates on consecutive lines -!!input -Foo - -{{echo|bar}} -{{echo|baz}} -!!result -

    Foo -

    bar -baz -

    -!!end - -!!test -Templates: P-wrapping: 1c. Templates on consecutive lines -!!input -{{echo|Foo}} -{{echo|bar}}
    baz
    -!!result -

    Foo -

    -bar
    baz
    - -!!end - -!!test -Templates: P-wrapping: 1d. Template preceded by comment-only line -!!options -parsoid -!!input - -{{echo|Bar}} -!!result - - -

    Bar

    -!!end - -!!test -Templates: Inline Text: 1. Multiple tmeplate uses -!!input -{{echo|Foo}}bar{{echo|baz}} -!!result -

    Foobarbaz -

    -!!end - -!!test -Templates: Inline Text: 2. Back-to-back template uses -!!input -{{echo|Foo}}{{echo|bar}} -!!result -

    Foobar -

    -!!end - -!!test -Templates: Block Tags: 1. Multiple template uses -!!input -{{echo|
    Foo
    }}
    bar
    {{echo|
    baz
    }} -!!result -
    Foo
    bar
    baz
    - -!!end - -!!test -Templates: Block Tags: 2. Back-to-back template uses -!!input -{{echo|
    Foo
    }}{{echo|
    bar
    }} -!!result -
    Foo
    bar
    - -!!end - -!!test -Templates: Links: 1. Simple example -!!input -{{echo|[[Foo|bar]]}} -!!result -

    bar -

    -!!end - -!!test -Templates: Links: 2. Generation of link href -!!input -[[{{echo|Foo}}|bar]] -!!result -

    bar -

    -!!end - -!!test -Templates: Links: 3. Generation of part of a link href -!!input -[[Fo{{echo|o}}|bar]] - -[[Foo{{echo|bar}}]] - -[[Foo{{echo|bar}}baz]] - -[[Foo{{echo|bar}}|bar]] - -[[:Foo{{echo|bar}}]] - -[[:Foo{{echo|bar}}|bar]] -!!result -

    bar -

    Foobar -

    Foobarbaz -

    bar -

    Foobar -

    bar -

    -!!end - -!!test -Templates: Links: 4. Multiple templates generating link href -!!input -[[{{echo|F}}{{echo|o}}ob{{echo|ar}}]] -!!result -

    Foobar -

    -!!end - -!!test -Templates: Links: 5. Generation of link text -!!input -[[Foo|{{echo|bar}}]] -!!result -

    bar -

    -!!end - -!!test -Templates: Links: 5. Nested templates (only outermost template should be marked) -!!input -{{echo|[[{{echo|Foo}}|bar]]}} -!!result -

    bar -

    -!!end - -!!test -Templates: HTML Tag: 1. Generation of HTML attr. key -!!input -
    foo
    -!!result -
    foo
    - -!!end - -!!test -Templates: HTML Tag: 2. Generation of HTML attr. value -!!input -
    foo
    -!!result -
    foo
    - -!!end - -!!test -Templates: HTML Tag: 3. Generation of HTML attr key and value -!!input -
    foo
    -!!result -
    foo
    - -!!end - -!!test -Templates: HTML Tag: 4. Generation of starting piece of HTML attr value -!!input -
    foo
    -!!result -
    foo
    - -!!end - -!!test -Templates: HTML Tag: 5. Generation of middle piece of HTML attr value -!!input -
    foo
    -!!result -
    foo
    - -!!end - -!!test -Templates: HTML Tag: 6. Generation of end piece of HTML attr value -!!input -
    foo
    -!!result -
    foo
    - -!!end - -!!test -Templates: HTML Tag: 7. Generation of partial attribute key string -!!input -
    foo
    -!!result -
    foo
    - -!!end - -!!test -Templates: HTML Tables: 1. Generating start of a HTML table -!!input -{{echo|}}
    foo
    -!!result -
    foo
    - -!!end - -!!test -Templates: HTML Tables: 2a. Generating middle of a HTML table -!!input -{{echo|}}
    foo
    -!!result -
    foo
    - -!!end - -!!test -Templates: HTML Tables: 2b. Generating middle of a HTML table -!!input -{{echo|}}
    foo
    -!!result -
    foo
    - -!!end - -!!test -Templates: HTML Tables: 3. Generating end of a HTML table -!!input -{{echo|
    foo
    }} -!!result -
    foo
    - -!!end - -!!test -Templates: HTML Tables: 4a. Generating a single tag of a HTML table -!!input -{{echo|}}
    foo
    -!!result -
    foo
    - -!!end - -!!test -Templates: HTML Tables: 4b. Generating a single tag of a HTML table -!!input -{{echo|}}
    foo
    -!!result -
    foo
    - -!!end - -!!test -Templates: HTML Tables: 4c. Generating a single tag of a HTML table -!!input -{{echo|
    }}foo
    -!!result -
    foo
    - -!!end - -!!test -Templates: HTML Tables: 4d. Generating a single tag of a HTML table -!!input -}}
    foo{{echo|
    -!!result -
    foo
    - -!!end - -!!test -Templates: HTML Tables: 4e. Generating a single tag of a HTML table -!!input -{{echo|}}
    foo
    -!!result -
    foo
    - -!!end - -!!test -Templates: HTML Tables: 4f. Generating a single tag of a HTML table -!!input -{{echo|
    foo
    }} -!!result -
    foo
    - -!!end - -!!test -Templates: HTML Tables: 5. Proper fostering of categories from inside -!!options -parsoid=wt2html,wt2wt -!!input -[[Category:foo1]]
    foo
    - -[[Category:bar1]][[Category:bar2]]
    foo
    -!!result -
    foo
    - -
    foo
    -!!end - -!!test -Templates: Wiki Tables: 1a. Fostering of entire template content -!!input -{| -{{echo|a}} -|} -!!result - -a -
    - -!!end - -!!test -Templates: Wiki Tables: 1b. Fostering of entire template content -!!input -{| -{{echo|
    }} -foo -{{echo|
    }} -|} -!!result - -
    -

    foo -

    -
    -
    - -!!end - -!!test -Templates: Wiki Tables: 2. Fostering of partial template content -!!input -{| -{{echo|a -
    b
    }} -|} -!!result - -a -
    b
    -
    - -!!end - -!!test -Templates: Wiki Tables: 3. td-content via multiple templates -!!input -{| -{{echo|{{pipe}}a}}{{echo|b}} -|} -!!result - - -
    ab -
    - -!!end - -!!test -Templates: Wiki Tables: 4. Templated tags, no content -!!input -{{tbl-start}} -{{tbl-end}} -!!result - -
    - -!!end - -!!test -Templates: Wiki Tables: 5. Templated tags, regular td-tags -!!input -{{tbl-start}} -|foo -{{tbl-end}} -!!result - - -
    foo -
    - -!!end - -!!test -Templates: Wiki Tables: 6. Templated tags, templated td-tags -!!input -{{tbl-start}} -{{!}}foo -{{tbl-end}} -!!result - - -
    foo -
    - -!!end - -!!test -Templates: Lists: Multi-line list-items via templates -!!input -*{{echo|a {{nonexistent| -unused}}}} -*{{echo|b {{nonexistent| -unused}}}} -!!result - - -!!end - -!!test -Templates: Ugly nesting: 1. Quotes opened/closed across templates (echo) -!!input -{{echo|''a}}{{echo|b''c''d}}{{echo|''e}} -!!result -

    abcde -

    -!!end - -!!test -Templates: Ugly nesting: 2. Quotes opened/closed across templates (echo_with_span) -(PHP parser generates misnested html) -!! options -parsoid -!!input -{{echo_with_span|''a}}{{echo_with_span|b''c''d}}{{echo_with_span|''e}} -!!result -

    abcde

    -!!end - -!!test -Templates: Ugly nesting: 3. Quotes opened/closed across templates (echo_with_div) -(PHP parser generates misnested html; Parsoid html2wt mode adds newlines between {{echo}}s) -!! options -parsoid=wt2html,wt2wt -!!input -{{echo_with_div|''a}}{{echo_with_div|b''c''d}}{{echo_with_div|''e}} -!!result -
    a
    -
    bcd
    -
    e
    -!!end - -!!test -Templates: Ugly nesting: 4. Divs opened/closed across templates -!!input -a
    b{{echo|c
    d}}e -!!result -a
    bc
    de - -!!end - -!!test -Templates: Ugly templates: 1. Navbox template parses badly leading to table misnesting -(Parsoid-centric) -!! options -parsoid -!!input -{| -|{{echo|foo}} -|bar -|} -!!result - - - - -
    foo
    -bar - -!!end - -!!test -Templates: Ugly templates: 2. Navbox template parses badly leading to table misnesting -(Parsoid-centric) -!! options -parsoid -!!input - - - - -
    - - -
    1. {{echo|foo
    }}
    bar 2. {{echo|baz
    }} - - - abc - - - - - - xyz - - -!!result - - - - -
    - - -
    1. foo
    bar 2. baz
    - - - abc - - - - - - xyz - - -!!end - -!! test -Templates: Ugly templates: 3. newline-only template parameter -!! input -foo {{echo| -}} -!! result -

    foo -

    -!! end - -# This looks like a bug: a single newline triggers p/br for some reason. -!! test -Templates: Ugly templates: 4. newline-only template parameter inconsistency -!! input -{{echo| -}} -!! result -


    -

    -!! end - - -!!test -Parser Functions: 1. Simple example -!!input -{{uc:foo}} -!!result -

    FOO -

    -!!end - -!!test -Parser Functions: 2. Nested use (only outermost should be marked up) -!!input -{{uc:{{lc:FOO}}}} -!!result -

    FOO -

    -!!end - -### -### Pre-save transform tests -### -!! test -pre-save transform: subst: -!! options -PST -!! input -{{subst:test}} -!! result -This is a test template -!! end - -!! test -pre-save transform: normal template -!! options -PST -!! input -{{test}} -!! result -{{test}} -!! end - -!! test -pre-save transform: nonexistent template -!! options -PST -!! input -{{thistemplatedoesnotexist}} -!! result -{{thistemplatedoesnotexist}} -!! end - - -!! test -pre-save transform: subst magic variables -!! options -PST -!! input -{{subst:SITENAME}} -!! result -MediaWiki -!! end - -# This is bug 89, which I fixed. -- wtm -!! test -pre-save transform: subst: templates with parameters -!! options -pst -!! input -{{subst:paramtest|param="something else"}} -!! result -This is a test template with parameter "something else" -!! end - -!! article -Template:nowikitest -!! text -'''not wiki''' -!! endarticle - -!! test -pre-save transform: nowiki in subst (bug 1188) -!! options -pst -!! input -{{subst:nowikitest}} -!! result -'''not wiki''' -!! end - - -!! article -Template:commenttest -!! text -This template has in it. -!! endarticle - -!! test -pre-save transform: comment in subst (bug 1936) -!! options -pst -!! input -{{subst:commenttest}} -!! result -This template has in it. -!! end - -!! test -pre-save transform: unclosed tag -!! options -pst noxml -!! input -'''not wiki''' -!! result -'''not wiki''' -!! end - -!! test -pre-save transform: mixed tag case -!! options -pst noxml -!! input -'''not wiki''' -!! result -'''not wiki''' -!! end - -!! test -pre-save transform: unclosed comment in -!! options -pst noxml -!! input -wikinowiki -!!result - -!!end - -!! test -pre-save transform: comment containing extension -!! options -pst -!! input - -!!result - -!!end - -!! test -pre-save transform: comment containing nowiki -!! options -pst -!! input - -!!result - -!!end - -!! test -pre-save transform: in subst (bug 3298) -!! options -pst -!! input -{{subst:Includes}} -!! result -Foobar -!! end - -!! test -pre-save transform: in subst (bug 3298) -!! options -pst -!! input -{{subst:Includes2}} -!! result -Foo -!! end - -!! article -Template:SubstTest -!!text -{{subst:Includes}} -!! endarticle - -!! article -Template:SafeSubstTest -!! text -{{safesubst:Includes}} -!! endarticle - -!! test -bug 22297: safesubst: works during PST -!! options -pst -!! input -{{subst:SafeSubstTest}}{{safesubst:SubstTest}} -!! result -FoobarFoobar -!! end - -!! test -bug 22297: safesubst: works during normal parse -!! input -{{SafeSubstTest}} -!! result -

    Foobar -

    -!! end - -!! test: -subst: does not work during normal parse -!! input -{{SubstTest}} -!! result -

    {{subst:Includes}} -

    -!! end - -!! test -pre-save transform: context links ("pipe trick") -!! options -pst -!! input -[[Article (context)|]] -[[Bar:Article|]] -[[:Bar:Article|]] -[[Bar:Article (context)|]] -[[:Bar:Article (context)|]] -[[|Article]] -[[|Article (context)]] -[[Bar:X (Y) Z|]] -[[:Bar:X (Y) Z|]] -!! result -[[Article (context)|Article]] -[[Bar:Article|Article]] -[[:Bar:Article|Article]] -[[Bar:Article (context)|Article]] -[[:Bar:Article (context)|Article]] -[[Article]] -[[Article (context)]] -[[Bar:X (Y) Z|X (Y) Z]] -[[:Bar:X (Y) Z|X (Y) Z]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with interwiki prefix -!! options -pst -!! input -[[interwiki:Article|]] -[[:interwiki:Article|]] -[[interwiki:Bar:Article|]] -[[:interwiki:Bar:Article|]] -!! result -[[interwiki:Article|Article]] -[[:interwiki:Article|Article]] -[[interwiki:Bar:Article|Bar:Article]] -[[:interwiki:Bar:Article|Bar:Article]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with parens in title -!! options -pst title=[[Somearticle (context)]] -!! input -[[|Article]] -!! result -[[Article (context)|Article]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with comma in title -!! options -pst title=[[Someplace, Somewhere]] -!! input -[[|Otherplace]] -[[Otherplace, Elsewhere|]] -[[Otherplace, Elsewhere, Anywhere|]] -!! result -[[Otherplace, Somewhere|Otherplace]] -[[Otherplace, Elsewhere|Otherplace]] -[[Otherplace, Elsewhere, Anywhere|Otherplace]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with parens and comma -!! options -pst title=[[Someplace (IGNORED), Somewhere]] -!! input -[[|Otherplace]] -[[Otherplace (place), Elsewhere|]] -!! result -[[Otherplace, Somewhere|Otherplace]] -[[Otherplace (place), Elsewhere|Otherplace]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with comma and parens -!! options -pst title=[[Who, me? (context)]] -!! input -[[|Yes, you.]] -[[Me, Myself, and I (1937 song)|]] -!! result -[[Yes, you. (context)|Yes, you.]] -[[Me, Myself, and I (1937 song)|Me, Myself, and I]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with namespace -!! options -pst title=[[Ns:Somearticle]] -!! input -[[|Article]] -!! result -[[Ns:Article|Article]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with namespace and parens -!! options -pst title=[[Ns:Somearticle (context)]] -!! input -[[|Article]] -!! result -[[Ns:Article (context)|Article]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with namespace and comma -!! options -pst title=[[Ns:Somearticle, Context, Whatever]] -!! input -[[|Article]] -!! result -[[Ns:Article, Context, Whatever|Article]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with namespace, comma and parens -!! options -pst title=[[Ns:Somearticle, Context (context)]] -!! input -[[|Article]] -!! result -[[Ns:Article (context)|Article]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with namespace, parens and comma -!! options -pst title=[[Ns:Somearticle (IGNORED), Context]] -!! input -[[|Article]] -!! result -[[Ns:Article, Context|Article]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with full-width parens and no space (Japanese and Chinese style, bug 30149) -!! options -pst -!! input -[[Article(context)|]] -[[Bar:Article(context)|]] -[[:Bar:Article(context)|]] -[[|Article(context)]] -[[Bar:X(Y)Z|]] -[[:Bar:X(Y)Z|]] -!! result -[[Article(context)|Article]] -[[Bar:Article(context)|Article]] -[[:Bar:Article(context)|Article]] -[[Article(context)]] -[[Bar:X(Y)Z|X(Y)Z]] -[[:Bar:X(Y)Z|X(Y)Z]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with full-width parens and space (Japanese and Chinese style, bug 30149) -!! options -pst -!! input -[[Article (context)|]] -[[Bar:Article (context)|]] -[[:Bar:Article (context)|]] -[[|Article (context)]] -[[Bar:X (Y) Z|]] -[[:Bar:X (Y) Z|]] -!! result -[[Article (context)|Article]] -[[Bar:Article (context)|Article]] -[[:Bar:Article (context)|Article]] -[[Article (context)]] -[[Bar:X (Y) Z|X (Y) Z]] -[[:Bar:X (Y) Z|X (Y) Z]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with parens and no space (Korean style, bug 30149) -!! options -pst -!! input -[[Article(context)|]] -[[Bar:Article(context)|]] -[[:Bar:Article(context)|]] -[[|Article(context)]] -[[Bar:X(Y)Z|]] -[[:Bar:X(Y)Z|]] -!! result -[[Article(context)|Article]] -[[Bar:Article(context)|Article]] -[[:Bar:Article(context)|Article]] -[[Article(context)]] -[[Bar:X(Y)Z|X(Y)Z]] -[[:Bar:X(Y)Z|X(Y)Z]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with commas (bug 21660) -!! options -pst -!! input -[[Article (context), context|]] -[[Article (context),context|]] -[[Bar:Article (context), context|]] -[[Bar:Article (context),context|]] -[[:Bar:Article (context), context|]] -[[:Bar:Article (context),context|]] -!! result -[[Article (context), context|Article]] -[[Article (context),context|Article]] -[[Bar:Article (context), context|Article]] -[[Bar:Article (context),context|Article]] -[[:Bar:Article (context), context|Article]] -[[:Bar:Article (context),context|Article]] -!! end - -!! test -pre-save transform: trim trailing empty lines -!! options -pst -!! input -Empty lines are trimmed - - - - -!! result -Empty lines are trimmed -!! end - -!! test -pre-save transform: Signature expansion -!! options -pst -!! input -* ~~~ -* ~~~ -* ~~~ -* ~~~ -!! result -* [[Special:Contributions/127.0.0.1|127.0.0.1]] -* [[Special:Contributions/127.0.0.1|127.0.0.1]] -* [[Special:Contributions/127.0.0.1|127.0.0.1]] -* [[Special:Contributions/127.0.0.1|127.0.0.1]] -!! end - - -!! test -pre-save transform: Signature expansion in nowiki tags (bug 93) -!! options -pst disabled -!! input -Shall not expand: - -~~~~ - -~~~~ - -~~~~ - -~~~~ - -{{subst:Foo}} shall be converted to FOO - -As well as inside noinclude/onlyinclude -{{subst:Foo}} -{{subst:Foo}} - -But not inside includeonly -{{subst:Foo}} -!! result -Shall not expand: - -~~~~ - -~~~~ - -~~~~ - -~~~~ - -FOO shall be converted to FOO - -As well as inside noinclude/onlyinclude -FOO -FOO - -But not inside includeonly -{{subst:Foo}} -!! end - -!! test -Parsoid: Recognize nowiki with trailing space in tags -!! options -parsoid=wt2html -!! input -
    [[foo]] - -ab - -cd - -ef -!! result -

    <div>[[foo]]

    -

    ab

    -

    cd

    -

    ef

    -!! end - -!! test -Parsoid: Recognize nowiki with odd capitalization -!! options -parsoid=wt2html -!! input -
    [[foo]] -!! result -

    <div>[[foo]]

    -!! end - - -!! test -Parsoid: Escape nowiki with trailing space in tags -!! options -parsoid=html2wt -!! input -<nowiki > foo </nowiki > - -a<nowiki />b - -c<nowiki/ >d -!! result -

    <nowiki > foo </nowiki >

    -

    a<nowiki />b

    -

    c<nowiki/ >d

    -!! end - -!! test -Parsoid: Escape weird noWikI capitalizations -!! options -parsoid=html2wt -!! input -<noWikI > foo </NoWikI > -!! result -

    <noWikI > foo </NoWikI >

    -!! end - -### -### Message transform tests -### -!! test -message transform: magic variables -!! options -msg -!! input -{{SITENAME}} -!! result -MediaWiki -!! end - -!! test -message transform: should not transform wiki markup -!! options -msg -!! input -''test'' -!! result -''test'' -!! end - -!! test -message transform: in transcluded template (bug 4926) -!! options -msg -!! input -{{Includes}} -!! result -Foobar -!! end - -!! test -message transform: in transcluded template (bug 4926) -!! options -msg -!! input -{{Includes2}} -!! result -Foo -!! end - -!! test -{{#special:}} page name, known -!! options -msg -!! input -{{#special:Recentchanges}} -!! result -Special:RecentChanges -!! end - -!! test -{{#special:}} page name with subpage, known -!! options -msg -!! input -{{#special:Recentchanges/param}} -!! result -Special:RecentChanges/param -!! end - -!! test -{{#special:}} page name, unknown -!! options -msg -!! input -{{#special:foobar nonexistent}} -!! result -Special:Foobar nonexistent -!! end - -!! test -{{#speciale:}} page name, known -!! options -msg -!! input -{{#speciale:Recentchanges}} -!! result -Special:RecentChanges -!! end - -!! test -{{#speciale:}} page name with subpage, known -!! options -msg -!! input -{{#speciale:Recentchanges/param}} -!! result -Special:RecentChanges/param -!! end - -!! test -{{#speciale:}} page name, unknown -!! options -msg -!! input -{{#speciale:foobar nonexistent}} -!! result -Special:Foobar_nonexistent -!! end - -### -### Images -### -### For Parsoid-specific tests, see -#### http://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Images - -!! test -Simple image (php) -!! options -php -!! input -[[Image:foobar.jpg]] -!! result -

    Foobar.jpg -

    -!! end - -!! test -Simple image (parsoid) -!! options -parsoid=wt2html -!! input -[[Image:foobar.jpg]] -!! result -

    -

    -!! end - -!! test -Simple image (using File: namespace, now canonical) (php) -!! options -php -!! input -[[File:foobar.jpg]] -!! result -

    Foobar.jpg -

    -!! end - -!! test -Simple image (using File: namespace, now canonical) (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg]] -!! result -

    -

    -!! end - -!! test -Right-aligned image (php) -!! options -php -!! input -[[Image:foobar.jpg|right]] -!! result -
    Foobar.jpg
    - -!! end - -!! test -Right-aligned image (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|right]] -!! result -
    -!! end - -!! test -Image with caption (php) -!! options -php -!! input -[[File:Foobar.jpg|right|Caption text]] -!! result -
    Caption text
    - -!! end - -!! test -Image with caption (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|right|Caption text]] -!! result -
    Caption text
    -!! end - -!! test -Image with empty attribute (php) -!! options -php -!! input -[[File:Foobar.jpg|right||Caption text]] -!! result -
    Caption text
    - -!! end - -!! test -Image with empty attribute (parsoid) -!! options -parsoid=wt2html -!! input -[[File:Foobar.jpg|right||Caption text]] -!! result -
    Caption text
    -!! end - -!! test -Image with attributes from template (php) -!! options -php -!! input -[[File:Foobar.jpg|{{image_attribs}}]] -!! result -
    Caption text
    - -!! end - -!! test -Image with attributes from template (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|{{image_attribs}}]] -!! result -
    Caption text
    -!! end - -!! test -Image with link tails (php) -!! options -php -!! input -123[[File:Foobar.jpg]]456 -123[[File:Foobar.jpg|right]]456 -123[[File:Foobar.jpg|thumb]]456 -!! result -

    123Foobar.jpg456 -

    -123
    Foobar.jpg
    456 -123
    Foobar.jpg
    456 - -!! end - -!! test -Image with link tails (parsoid) -!! options -parsoid -!! input -123[[File:Foobar.jpg]]456 -123[[File:Foobar.jpg|right]]456 -123[[File:Foobar.jpg|thumb]]456 -!! result -

    123456

    -123
    456 -123
    456 -!! end - -!! test -Image with multiple captions -- only last one is accepted (php) -!! options -php -!! input -[[File:Foobar.jpg|right|Caption1 - ignored|[[Caption2]] - ignored|Caption3 - accepted]] -!! result -
    Caption3 - accepted
    - -!! end - -!! test -Image with multiple captions -- only last one is accepted (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|right|Caption1 - ignored|[[Caption2]] - ignored|Caption3 - accepted]] -!! result -
    Caption3 - accepted
    -!! end - -!! test -Image with width attribute at different positions (php) -!! options -php -!! input -[[File:Foobar.jpg|200px|right|Caption]] -[[File:Foobar.jpg|right|200px|Caption]] -[[File:Foobar.jpg|right|Caption|200px]] -!! result -
    Caption
    -
    Caption
    -
    Caption
    - -!! end - -!! test -Image with width attribute at different positions (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|200px|right|Caption]] -[[File:Foobar.jpg|right|200px|Caption]] -[[File:Foobar.jpg|right|Caption|200px]] -!! result -
    Caption
    -
    Caption
    -
    Caption
    -!! end - -!! test -Image with link parameter, wiki target (php) -!! options -php -!! input -[[File:Foobar.jpg|link=Main Page]] -!! result -

    Foobar.jpg -

    -!! end - -!! test -Image with link parameter, wiki target (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|link=Main Page]] -!! result -

    -!! end - -!! test -Image with link parameter, URL target (php) -!! options -php -!! input -[[File:Foobar.jpg|link=http://example.com/]] -!! result -

    Foobar.jpg -

    -!! end - -# parsoid bug 49293 (part 1) -!! test -Image with link parameter, URL target (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|link=http://example.com/]] -!! result -

    -!! end - -!! test -Image with link parameter, protocol-less URL target (php) -!! options -php -!! input -[[File:Foobar.jpg|link=//example.com/]] -!! result -

    Foobar.jpg -

    -!! end - -# parsoid bug 49293 (part 2) -!! test -Image with link parameter, protocol-less URL target (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|link=//example.com/]] -!! result -

    -!! end - -!! test -Image with link parameter, wgExternalLinkTarget -!! input -[[Image:foobar.jpg|link=http://example.com/]] -!! config -wgExternalLinkTarget='foobar' -!! result -

    Foobar.jpg -

    -!! end - -!! test -Image with link parameter, wgNoFollowLinks set to false -!! input -[[Image:foobar.jpg|link=http://example.com/]] -!! config -wgNoFollowLinks=false -!! result -

    Foobar.jpg -

    -!! end - -!! test -Image with link parameter, wgNoFollowDomainExceptions -!! input -[[Image:foobar.jpg|link=http://example.com/]] -!! config -wgNoFollowDomainExceptions='example.com' -!! result -

    Foobar.jpg -

    -!! end - -!! test -Image with link parameter, wgExternalLinkTarget, unnamed parameter -!! input -[[Image:foobar.jpg|link=http://example.com/|Title]] -!! config -wgExternalLinkTarget='foobar' -!! result -

    Title -

    -!! end - -!! test -Image with empty link parameter (php) -!! options -php -!! input -[[File:Foobar.jpg|link=]] -!! result -

    Foobar.jpg -

    -!! end - -!! test -Image with empty link parameter (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|link=]] -!! result -

    -!! end - -!! test -Image with link parameter (wiki target) and unnamed parameter (php) -!! options -php -!! input -[[File:Foobar.jpg|link=Main Page|Title]] -!! result -

    Title -

    -!! end - -!! test -Image with link parameter (wiki target) and unnamed parameter (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|link=Main Page|Title]] -!! result -

    -!! end - -!! test -Image with link parameter (URL target) and unnamed parameter (php) -!! options -php -!! input -[[File:Foobar.jpg|link=http://example.com/|Title]] -!! result -

    Title -

    -!! end - -!! test -Image with link parameter (URL target) and unnamed parameter (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|link=http://example.com/|Title]] -!! result -

    -!! end - -!! test -Thumbnail image with link parameter -!! options -php -!! input -[[Image:foobar.jpg|thumb|link=http://example.com/|Title]] -!! result -
    Title
    - -!! end - -!! test -Manually-specified thumbnail image -!! options -php -!! input -[[Image:Foobar.jpg|thumb=Thumb.png|Title]] -!! result -
    Title
    - -!! end - -!! test -Manually-specified thumbnail image with explicit link to wiki page -!! options -php -!! input -[[Image:Foobar.jpg|thumb=Thumb.png|link=Main Page|Title]] -!! result -
    Title
    - -!! end - -!! test -Manually-specified thumbnail image with explicit link to url -!! options -php -!! input -[[Image:Foobar.jpg|thumb=Thumb.png|link=http://example.com|Title]] -!! result -
    Title
    - -!! end - -!! test -Manually-specified thumbnail image with explicit no link -!! options -php -!! input -[[Image:Foobar.jpg|thumb=Thumb.png|link=|Title]] -!! result -
    Title
    - -!! end - -!! test -Manually-specified thumbnail image with explicit link and alt text -!! options -php -!! input -[[Image:Foobar.jpg|thumb=Thumb.png|link=Main Page|alt=alttext|Title]] -!! result -
    alttext
    Title
    - -!! end - -!! test -Image with frame and link -!! input -[[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]] -!! result -
    This is a test image Main Page
    - -!! end - -!! test -Image with frame and link and explicit alt -!! input -[[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]|alt=Altitude]] -!! result -
    Altitude
    This is a test image Main Page
    - -!! end - -!! test -Image with wiki markup in implicit alt -!! input -[[Image:Foobar.jpg|testing '''bold''' in alt]] -!! result -

    testing bold in alt -

    -!! end - -!! test -Image with wiki markup in explicit alt -!! input -[[Image:Foobar.jpg|alt=testing '''bold''' in alt]] -!! result -

    testing bold in alt -

    -!! end - -!! test -Link to image page- image page normally doesn't exists, hence edit link -Add test with existing image page -#

    Image:test -!! input -[[:Image:test]] -!! result -

    Image:test -

    -!! end - -!! test -bug 18784 Link to non-existent image page with caption should use caption as link text -!! input -[[:Image:test|caption]] -!! result -

    caption -

    -!! end - -!! test -Frameless image caption with a free URL -!! input -[[Image:foobar.jpg|http://example.com]] -!! result -

    http://example.com -

    -!! end - -!! test -Thumbnail image caption with a free URL -!! input -[[Image:foobar.jpg|thumb|http://example.com]] -!! result - - -!! end - -!! test -Thumbnail image caption with a free URL and explicit alt -!! input -[[Image:foobar.jpg|thumb|http://example.com|alt=Alteration]] -!! result - - -!! end - -!! test -SVG thumbnails with no language set -!! options -!! input -[[File:Foobar.svg|thumb|width=200]] -!! result -
    width=200
    - -!! end - -!! test -SVG thumbnails with language de -!! options -!! input -[[File:Foobar.svg|thumb|width=200|lang=de]] -!! result -
    width=200
    - -!! end - -!! test -SVG thumbnails with invalid language code -!! options -!! input -[[File:Foobar.svg|thumb|width=200|lang=invalid.language.code]] -!! result -
    lang=invalid.language.code
    - -!! end - -!! test -BUG 1887: A ISBN with a thumbnail -!! input -[[Image:foobar.jpg|thumb|ISBN 1235467890]] -!! result - - -!! end - -!! test -BUG 1887: A RFC with a thumbnail -!! input -[[Image:foobar.jpg|thumb|This is RFC 12354]] -!! result -
    This is RFC 12354
    - -!! end - -!! test -BUG 1887: A mailto link with a thumbnail -!! input -[[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]] -!! result - - -!! end - -# Pending resolution to bug 368 -!! test -BUG 648: Frameless image caption with a link -!! input -[[Image:foobar.jpg|text with a [[link]] in it]] -!! result -

    text with a link in it -

    -!! end - -!! test -BUG 648: Frameless image caption with a link (suffix) -!! input -[[Image:foobar.jpg|text with a [[link]]foo in it]] -!! result -

    text with a linkfoo in it -

    -!! end - -!! test -BUG 648: Frameless image caption with an interwiki link -!! input -[[Image:foobar.jpg|text with a [[MeatBall:Link]] in it]] -!! result -

    text with a MeatBall:Link in it -

    -!! end - -!! test -BUG 648: Frameless image caption with a piped interwiki link -!! input -[[Image:foobar.jpg|text with a [[MeatBall:Link|link]] in it]] -!! result -

    text with a link in it -

    -!! end - -!! test -Escape HTML special chars in image alt text -!! input -[[Image:foobar.jpg|& < > "]] -!! result -

    & < > " -

    -!! end - -!! test -BUG 499: Alt text should have Ӓ, not &1234; -!! input -[[Image:foobar.jpg|♀]] -!! result -

    ♀ -

    -!! end - -!! test -Broken image caption with link -!! input -[[Image:Foobar.jpg|thumb|This is a broken caption. But [[Main Page|this]] is just an ordinary link. -!! result -

    [[Image:Foobar.jpg|thumb|This is a broken caption. But this is just an ordinary link. -

    -!! end - -!! test -Image caption containing another image -!! input -[[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]] -!! result -
    This is a caption with another image inside it!
    - -!! end - -!! test -Image caption containing a newline -!! input -[[Image:Foobar.jpg|This -*is some text]] -!! result -

    This *is some text -

    -!!end - -!!test -Parsoid: Image caption containing leading space -(The leading space should not trigger nowiki escaping in wt2wt mode) -!! input -[[Image:Foobar.jpg|thumb| bar]] -!! result -
    bar
    - -!!end - -!! test -Bug 3090: External links other than http: in image captions -!! input -[[Image:Foobar.jpg|thumb|200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]] -!! result -
    This caption has irc and Secure ext links in it.
    - -!! end - -!! test -Custom class -!! input -[[Image:foobar.jpg|a|class=b]] -!! result -

    a -

    -!! end - -!! test -Localized image handling (1). -!! options -language=es -!! input -[[Archivo:Foobar.jpg|izquierda|enlace=foo|caption]] -!! result -
    caption
    - -!! end - -!! test -Localized image handling (2). -!! options -language=es -!! input -[[Archivo:Foobar.jpg|miniatura|izquierda|enlace=foo|caption]] -!! result -
    caption
    - -!! end - -!! test -"border", "frameless" and "class" attributes on an image. -!! input -[[File:Foobar.jpg|frameless|border|class=extra|caption]] -!! result -

    caption -

    -!! end - -!! article -File:Barfoo.jpg -!! text -#REDIRECT [[File:Barfoo.jpg]] -!! endarticle - -!! test -Redirected image -!! input -[[Image:Barfoo.jpg]] -!! result -

    File:Barfoo.jpg -

    -!! end - -!! test -Missing image with uploads disabled -!! options -wgEnableUploads=0 -!! input -[[Image:Foobaz.jpg]] -!! result -

    File:Foobaz.jpg -

    -!! end - -# Parsoid-specific testing for images -# http://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Images -# Currently imperfect due to a flaw in the Parsoid testrunner -# Work in progress -# THESE TESTS SHOULD BE MOVED UP and merged with the php-specific -# image tests. - -!! test -Parsoid-specific image handling - simple image with size and middle alignment -!! options -parsoid -!! input -[[Image:Foobar.jpg|50px|middle]] -!! result -

    - - - - - -

    -!! end - -!! test -Parsoid-specific image handling - simple image with both sizes, a baseline alignment, and a caption -!! options -parsoid -!! input -[[Image:Foobar.jpg|500x10px|baseline|caption]] -!! result -

    - - - - - -

    -!! end - -!! test -Parsoid-specific image handling - simple image with border and size spec -!! options -parsoid -!! input -[[Image:Foobar.jpg|50px|border|caption]] -!! result -

    - - - - - -

    -!! end - -!! test -Parsoid-specific image handling - thumbnail with halign, valign, and caption -!! options -parsoid -!! input -[[Image:Foobar.jpg|thumb|left|baseline|caption content]] -!! result -
    - - - -
    caption content
    -
    -!! end - -!! test -Parsoid-specific image handling - thumbnail with specific size, halign, valign, and caption -!! options -parsoid -!! input -[[Image:Foobar.jpg|thumb|50x50px|right|middle|caption]] -!! result -
    - - - -
    caption
    -
    -!! end - -!! test -Parsoid-specific image handling - framed image with specific size and caption -!! options -parsoid -!! input -[[Image:Foobar.jpg|500x50px|frame|caption]] -!! result -
    - - - -
    caption
    -
    -!! end - -!! test -Parsoid-specific image handling - framed image with specific size, halign, valign, and caption -!! options -parsoid -!! input -[[Image:Foobar.jpg|500x50px|frame|left|baseline|caption]] -!! result -
    - - - -
    caption
    -
    -!! end - -!! test -Parsoid-specific image handling - frameless image with specific size, border, and caption -!! options -parsoid -!! input -[[Image:Foobar.jpg|frameless|500x50px|border|caption]] -!! result -

    - - - - -

    -!! end - -#!! test -#Parsoid-specific image handling - simple image with a formatted caption -#!! options -#parsoid -#!! input -#[[Image:Foobar.jpg|
    ab
    c
    ]] -#!! result -#

    -# -# -#Foobar.jpg -# -#abc -# -#

    - - -### -### Subpages -### -!! article -Subpage test/subpage -!! text -foo -!! endarticle - -!! test -Subpage link -!! options -subpage title=[[Subpage test]] -!! input -[[/subpage]] -!! result -

    /subpage -

    -!! end - -!! test -Subpage noslash link -!! options -subpage title=[[Subpage test]] -!!input -[[/subpage/]] -!! result -

    subpage -

    -!! end - -# TODO: make this PHP-parser compatible! -!! test -Relative subpage noslash link -!! options -parsoid=wt2wt,wt2html,html2html -subpage title=[[Subpage test/1/2/3/4]] -!!input -[[../../subpage/]] - -[[../../subpage]] -!! result -

    subpage

    -

    Subpage_test/1/2/subpage

    -!! end - -# TODO: make this PHP-parser compatible! -!! test -Parsoid: dot-slash prefixed wikilinks -!! options -parsoid=wt2wt,wt2html,html2html -!!input -[[./foo]] - -[[././bar]] - -[[././baz/]] -!! result -

    foo

    -

    bar

    -

    baz/

    -!! end - -!! test -Disabled subpages -!! input -[[/subpage]] -!! result -

    /subpage -

    -!! end - -!! test -BUG 561: {{/Subpage}} -!! options -subpage title=[[Page]] -!! input -{{/Subpage}} -!! result -

    Page/Subpage -

    -!! end - -### -### Categories -### -!! article -Category:MediaWiki User's Guide -!! text -blah -!! endarticle - -!! test -Link to category -!! input -[[:Category:MediaWiki User's Guide]] -!! result -

    Category:MediaWiki User's Guide -

    -!! end - -!! test -Simple category -!! options -cat -!! input -[[Category:MediaWiki User's Guide]] -!! result -MediaWiki User's Guide -!! end - -!! test -PAGESINCATEGORY invalid title fatal (r33546 fix) -!! input -{{PAGESINCATEGORY:}} -!! result -

    0 -

    -!! end - -!! test -Category with different sort key -!! options -cat -!! input -[[Category:MediaWiki User's Guide|Foo]] -!! result -MediaWiki User's Guide -!! end - -!! test -Category with identical sort key -!! options -cat -!! input -[[Category:MediaWiki User's Guide|MediaWiki User's Guide]] -!! result -MediaWiki User's Guide -!! end - -!! test -Category with empty sort key -!! options -cat -pst -!! input -[[Category:MediaWiki User's Guide|]] -!! result -[[Category:MediaWiki User's Guide|MediaWiki User's Guide]] -!! end - -!! test -Category with empty sort key and parentheses -!! options -cat -pst -!! input -[[Category:Foo (bar)|]] -!! result -[[Category:Foo (bar)|Foo]] -!! end - -!! test -Category with link tail -!! options -cat -pst -!! input -123[[Category:Foo]]456 -!! result -123[[Category:Foo]]456 -!! end - -!! test -Category with template -!! options -cat -pst -!! input -[[Category:{{echo|Foo}}]] -!! result -[[Category:{{echo|Foo}}]] -!! end - -!! test -Category with template in sort key -!! options -cat -pst -!! input -[[Category:Foo|{{echo|Bar}}]] -!! result -[[Category:Foo|{{echo|Bar}}]] -!! end - -!! test -Category with template in sort key and title -!! options -cat -pst -!! input -[[Category:{{echo|Foo}}|{{echo|Bar}}]] -!! result -[[Category:{{echo|Foo}}|{{echo|Bar}}]] -!! end - -!! test -Category / paragraph interactions -!! input -Foo [[Category:Baz]] Bar - -Foo [[Category:Baz]] -Bar - -Foo -[[Category:Baz]] -Bar - -Foo -[[Category:Baz]] Bar - -Foo -[[Category:Baz]] - [[Category:Baz]] -[[Category:Baz]] -Bar - -[[Category:Baz]] - [[Category:Baz]] -[[Category:Baz]] - -[[Category:Baz]] - {{echo|[[Category:Baz]]}} -[[Category:Baz]] -!! result -

    Foo Bar -

    Foo -Bar -

    Foo -Bar -

    Foo Bar -

    Foo -Bar -

    -!! end - -!! test -Parsoid: Serialize link to category page with colon escape -!! options -parsoid -!! input - -[[:Category:Foo]] -[[:Category:Foo|Bar]] -!! result -

    -Category:Foo -Bar -

    -!! end - -!! test -Parsoid: Link prefix/suffixes aren't applied to category links -!! options -parsoid=wt2html,wt2wt,html2html -language=is -!! input -x[[Category:Foo]]y -!! result -

    xy

    -!! end - -!! test -Parsoid: Serialize link to file page with colon escape -!! options -parsoid -!! input - -[[:File:Foo.png]] -[[:File:Foo.png|Bar]] -!! result -

    -File:Foo.png -Bar -

    -!! end - -!! test -Parsoid: Serialize a genuine category link without colon escape -!! options -parsoid -!! input -[[Category:Foo]] -[[Category:Foo|Bar]] -!! result - - -!! end - -### -### Inter-language links -### -!! test -Inter-language links -!! options -ill -!! input -[[es:Alimento]] -[[fr:Nourriture]] -[[zh:食品]] -!! result -es:Alimento fr:Nourriture zh:食品 -!! end - -!! test -Duplicate interlanguage links (bug 24502) -!! options -ill -!! input -[[es:1]] -[[es:2]] -[[fr:1]] -[[fr:2]] -!! result -es:1 fr:1 -!! end - -### -### Sections -### -!! test -Basic section headings -!! input -== Headline 1 == -Some text - -==Headline 2== -More -===Smaller headline=== -Blah blah -!! result -

    Headline 1[edit]

    -

    Some text -

    -

    Headline 2[edit]

    -

    More -

    -

    Smaller headline[edit]

    -

    Blah blah -

    -!! end - -!! test -Section headings with TOC -!! input -== Headline 1 == -=== Subheadline 1 === -===== Skipping a level ===== -====== Skipping a level ====== - -== Headline 2 == -Some text -===Another headline=== -!! result - - -

    Headline 1[edit]

    -

    Subheadline 1[edit]

    -
    Skipping a level[edit]
    -
    Skipping a level[edit]
    -

    Headline 2[edit]

    -

    Some text -

    -

    Another headline[edit]

    - -!! end - -# perl -e 'print "="x$_," Level $_ heading","="x$_,"\n" for 1..10' -!! test -Handling of sections up to level 6 and beyond -!! input -= Level 1 Heading= -== Level 2 Heading== -=== Level 3 Heading=== -==== Level 4 Heading==== -===== Level 5 Heading===== -====== Level 6 Heading====== -======= Level 7 Heading======= -======== Level 8 Heading======== -========= Level 9 Heading========= -========== Level 10 Heading========== -!! result - - -

    Level 1 Heading[edit]

    -

    Level 2 Heading[edit]

    -

    Level 3 Heading[edit]

    -

    Level 4 Heading[edit]

    -
    Level 5 Heading[edit]
    -
    Level 6 Heading[edit]
    -
    = Level 7 Heading=[edit]
    -
    == Level 8 Heading==[edit]
    -
    === Level 9 Heading===[edit]
    -
    ==== Level 10 Heading====[edit]
    - -!! end - -!! test -TOC regression (bug 9764) -!! input -== title 1 == -=== title 1.1 === -==== title 1.1.1 ==== -=== title 1.2 === -== title 2 == -=== title 2.1 === -!! result - - -

    title 1[edit]

    -

    title 1.1[edit]

    -

    title 1.1.1[edit]

    -

    title 1.2[edit]

    -

    title 2[edit]

    -

    title 2.1[edit]

    - -!! end - -!! test -TOC with wgMaxTocLevel=3 (bug 6204) -!! options -wgMaxTocLevel=3 -!! input -== title 1 == -=== title 1.1 === -==== title 1.1.1 ==== -=== title 1.2 === -== title 2 == -=== title 2.1 === -!! result - - -

    title 1[edit]

    -

    title 1.1[edit]

    -

    title 1.1.1[edit]

    -

    title 1.2[edit]

    -

    title 2[edit]

    -

    title 2.1[edit]

    - -!! end - -!! test -TOC with wgMaxTocLevel=3 and two level four headings (bug 6204) -!! options -wgMaxTocLevel=3 -!! input -==Section 1== -===Section 1.1=== -====Section 1.1.1==== -====Section 1.1.1.1==== -==Section 2== -!! result -

    Contents

    - -
    - -

    Section 1[edit]

    -

    Section 1.1[edit]

    -

    Section 1.1.1[edit]

    -

    Section 1.1.1.1[edit]

    -

    Section 2[edit]

    - -!! end - - -!! test -Resolving duplicate section names -!! input -== Foo bar == -== Foo bar == -!! result -

    Foo bar[edit]

    -

    Foo bar[edit]

    - -!! end - -!! test -Resolving duplicate section names with differing case (bug 10721) -!! input -== Foo bar == -== Foo Bar == -!! result -

    Foo bar[edit]

    -

    Foo Bar[edit]

    - -!! end - -!! article -Template:sections -!! text -===Section 1=== -==Section 2== -!! endarticle - -!! test -Template with sections, __NOTOC__ -!! input -__NOTOC__ -==Section 0== -{{sections}} -==Section 4== -!! result -

    Section 0[edit]

    -

    Section 1[edit]

    -

    Section 2[edit]

    -

    Section 4[edit]

    - -!! end - -!! test -__NOEDITSECTION__ keyword -!! input -__NOEDITSECTION__ -==Section 1== -==Section 2== -!! result -

    Section 1

    -

    Section 2

    - -!! end - -!! test -Link inside a section heading -!! input -==Section with a [[Main Page|link]] in it== -!! result -

    Section with a link in it[edit]

    - -!! end - -!! test -TOC regression (bug 12077) -!! input -__TOC__ -== title 1 == -=== title 1.1 === -== title 2 == -!! result -

    Contents

    - -
    - -

    title 1[edit]

    -

    title 1.1[edit]

    -

    title 2[edit]

    - -!! end - -!! test -BUG 1219 URL next to image (good) -!! input -http://example.com [[Image:foobar.jpg]] -!! result -

    http://example.com Foobar.jpg -

    -!!end - -!! test -Short headings with trailing space should match behavior of Parser::doHeadings (bug 19910) -!! input -=== -The line above must have a trailing space! -=== -But just in case it doesn't... -!! result -

    =[edit]

    -

    The line above must have a trailing space! -

    -

    =[edit]

    -

    But just in case it doesn't... -

    -!! end - -!! test -Header with special characters (bug 25462) -!! input -The tooltips shall not show entities to the user (ie. be double escaped) - -== text > text == -section 1 - -== text < text == -section 2 - -== text & text == -section 3 - -== text ' text == -section 4 - -== text " text == -section 5 -!! result -

    The tooltips shall not show entities to the user (ie. be double escaped) -

    - - -

    text > text[edit]

    -

    section 1 -

    -

    text < text[edit]

    -

    section 2 -

    -

    text & text[edit]

    -

    section 3 -

    -

    text ' text[edit]

    -

    section 4 -

    -

    text " text[edit]

    -

    section 5 -

    -!! end - -!! test -Headers with excess '=' characters -(Are similar tests necessary beyond the 1st level?) -!! input -=foo== -==foo= -=''italic'' heading== -==''italic'' heading= -!! result - - -

    foo=[edit]

    -

    =foo[edit]

    -

    italic heading=[edit]

    -

    =italic heading[edit]

    - -!! end - -!! test -HTML headers vs TOC (bug 23393) -(__NOEDITSECTION__ for clearer output, doesn't matter here) -!! input -

    Header 1

    -== Header 1.1 == -== Header 1.2 == - -

    Header 2 -

    -== Header 2.1 == -== Header 2.2 == -__NOEDITSECTION__ -!! result - - -

    Header 1

    -

    Header 1.1

    -

    Header 1.2

    -

    Header 2

    -

    Header 2.1

    -

    Header 2.2

    - -!! end - -!! test -BUG 1219 URL next to image (broken) -!! input -http://example.com[[Image:foobar.jpg]] -!! result -

    http://example.comFoobar.jpg -

    -!!end - -!! test -Bug 1186 news: in the middle of text -!! input -http://en.wikinews.org/wiki/Wikinews:Workplace -!! result -

    http://en.wikinews.org/wiki/Wikinews:Workplace -

    -!!end - - -!! test -Namespaced link must have a title -!! input -[[Project:]] -!! result -

    [[Project:]] -

    -!!end - -!! test -Namespaced link must have a title (bad fragment version) -!! input -[[Project:#fragment]] -!! result -

    [[Project:#fragment]] -

    -!!end - - -### -### HTML tags and HTML attributes -### - -!! test -div with no attributes -!! input -
    HTML rocks
    -!! result -
    HTML rocks
    - -!! end - -!! test -div with double-quoted attribute -!! input -
    HTML rocks
    -!! result -
    HTML rocks
    - -!! end - -!! test -div with single-quoted attribute -!! input -
    HTML rocks
    -!! result -
    HTML rocks
    - -!! end - -!! test -div with unquoted attribute -!! input -
    HTML rocks
    -!! result -
    HTML rocks
    - -!! end - -!! test -div with illegal double attributes -!! input -
    HTML rocks
    -!! result -
    HTML rocks
    - -!!end - -# FIXME: produce empty string instead of "class" in the PHP parser, following -# the HTML5 spec. -!! test -div with empty attribute value, space before equals -!! options -parsoid -!! input -
    HTML rocks
    -!! result -
    HTML rocks
    - -!! end - -# The PHP parser escapes the opening brace to { for some reason, so -# disabled this test for it. -!! test -div with braces in attribute value -!! options -parsoid -!! input -
    Foo
    -!! result -
    Foo
    -!! end - -# This it very inconsistent in the PHP parser: it returns -# class="class" if there is a space between the name and the equal sign (see -# 'div with empty attribute value, space before equals'), but strips the -# attribute completely if the space is missing. We hope that not much content -# depends on this, so are implementing the behavior below in Parsoid for -# consistencies' sake. Disabled for the PHP parser. -# FIXME: fix this behavior in the PHP parser? -!! test -div with empty attribute value, no space before equals -!! options -parsoid -!! input -
    HTML rocks
    -!! result -
    HTML rocks
    - -!! end - -!! test -HTML multiple attributes correction -!! input -

    Awesome!

    -!! result -

    Awesome!

    - -!!end - -!! test -Table multiple attributes correction -!! input -{| -!+ class="error" class="awesome"| status -|} -!! result - - -
    status -
    - -!!end - -!! test -DIV IN UPPERCASE -!! input -
    HTML ROCKS
    -!! result -
    HTML ROCKS
    - -!!end - -!! test -Non-ASCII pseudo-tags are rendered as text -!! input - -!! result -

    <khyô> -

    -!! end - -!! test -Pseudo-tag with URL 'name' renders as url link -!! input - -!! result -

    <http://example.com/> -

    -!! end - -!! test -text with amp in the middle of nowhere -!! input -Remember AT&T? -!!result -

    Remember AT&T? -

    -!! end - -!! test -text with character entity: eacute -!! input -I always thought é was a cute letter. -!! result -

    I always thought é was a cute letter. -

    -!! end - -!! test -text with entity-escaped character entity-like string: eacute -!! input -I always thought &eacute; was a cute letter. -!! result -

    I always thought &eacute; was a cute letter. -

    -!! end - -!! test -text with undefined character entity: xacute -!! input -I always thought &xacute; was a cute letter. -!! result -

    I always thought &xacute; was a cute letter. -

    -!! end - - -### -### Nesting tests (see bug 41545, 50604, 51081) -### - -# This test case is fixed in Parsoid by domino 1.0.12. (bug 50604) -# Note that html2wt is considerably more difficult if we use in -# the test case, instead of -!! test -Ensure that HTML adoption agency algorithm is properly implemented. -!! input -XYZ -!! result -

    XYZ -

    -!! end - -# This was bug 41545 in the PHP parser. -!! test -Nesting of -!! input -XYZ -!! result -

    XYZ -

    -!! end - -# The following cases were bug 51081 in the PHP parser. -# Note that there are some other nestable tags (b, i, etc) which are -# not covered; see bug 51081 for discussion. -!! test -Nesting of -!! input -XYZ -!! result -

    XYZ -

    -!! end - -!! test -Nesting of -!! input -XYZ -!! result -

    XYZ -

    -!! end - -!! test -Nesting of -!! input -XYZ -!! result -

    XYZ -

    -!! end - -!! test -Nesting of -!! input -XYZ -!! result -

    XYZ -

    -!! end - -!! test -Nesting of -!! input -XYZ -!! result -

    XYZ -

    -!! end - - -### -### Media links -### - -!! test -Media link -!! input -[[Media:Foobar.jpg]] -!! result -

    Media:Foobar.jpg -

    -!! end - -!! test -Media link with text -!! input -[[Media:Foobar.jpg|A neat file to look at]] -!! result -

    A neat file to look at -

    -!! end - -# FIXME: this is still bad HTML tag nesting -!! test -Media link with nasty text -fixme: doBlockLevels won't wrap this in a paragraph because it contains a div -!! input -[[Media:Foobar.jpg|Safe Link
    " onmouseover="alert(document.cookie)" onfoo="
    ]] -!! result -Safe Link<div style="display:none">" onmouseover="alert(document.cookie)" onfoo="</div> - -!! end - -!! test -Media link to nonexistent file (bug 1702) -!! input -[[Media:No such.jpg]] -!! result -

    Media:No such.jpg -

    -!! end - -!! test -Image link to nonexistent file (bug 1850 - good) -!! input -[[Image:No such.jpg]] -!! result -

    File:No such.jpg -

    -!! end - -!! test -:Image link to nonexistent file (bug 1850 - bad) -!! input -[[:Image:No such.jpg]] -!! result -

    Image:No such.jpg -

    -!! end - - - -!! test -Character reference normalization in link text (bug 1938) -!! input -[[Main Page|this&that]] -!! result -

    this&that -

    -!!end - -!! article -אַ -!! text -Test for unicode normalization - -The page's name is U+05d0 U+05b7, with non-canonical form U+FB2E -!! endarticle - -!! test -(bug 19451) Links should refer to the normalized form. -!! input -[[אַ]] -[[אַ]] -[[אַ]] -[[אַ]] -[[אַ]] -!! result -

    -אַ -אַ -אַ -אַ -

    -!! end - -!! test -Empty attribute crash test (bug 2067) -!! input -foo -!! result -

    foo -

    -!! end - -!! test -Empty attribute crash test single-quotes (bug 2067) -!! input -foo -!! result -

    foo -

    -!! end - -!! test -Attribute test: equals, then nothing -!! input -foo -!! result -

    foo -

    -!! end - -!! test -Attribute test: unquoted value -!! input -foo -!! result -

    foo -

    -!! end - -!! test -Attribute test: unquoted but illegal value (hash) -!! input -foo -!! result -

    foo -

    -!! end - -!! test -Attribute test: no value -!! input -foo -!! result -

    foo -

    -!! end - -!! test -Bug 2095: link with three closing brackets -!! input -[[Main Page]]] -!! result -

    Main Page] -

    -!! end - -!! test -Bug 2095: link with pipe and three closing brackets -!! input -[[Main Page|link]]] -!! result -

    link] -

    -!! end - -!! test -Bug 2095: link with pipe and three closing brackets, version 2 -!! input -[[Main Page|[http://example.com/]]] -!! result -

    [http://example.com/] -

    -!! end - - -### -### Safety -### - -!! article -Template:Dangerous attribute -!! text -" onmouseover="alert(document.cookie) -!! endarticle - -!! article -Template:Dangerous style attribute -!! text -border-size: expression(alert(document.cookie)) -!! endarticle - -!! article -Template:Div style -!! text -
    Magic div
    -!! endarticle - -!! test -Bug 2304: HTML attribute safety (safe template; regression bug 2309) -!! input -
    -!! result -
    - -!! end - -!! test -Bug 2304: HTML attribute safety (dangerous template; 2309) -!! input -
    -!! result -
    - -!! end - -!! test -Bug 2304: HTML attribute safety (dangerous style template; 2309) -!! input -
    -!! result -
    - -!! end - -!! test -Bug 2304: HTML attribute safety (safe parameter; 2309) -!! input -{{div style|width: 200px}} -!! result -
    Magic div
    - -!! end - -!! test -Bug 2304: HTML attribute safety (unsafe parameter; 2309) -!! input -{{div style|width: expression(alert(document.cookie))}} -!! result -
    Magic div
    - -!! end - -!! test -Bug 2304: HTML attribute safety (unsafe breakout parameter; 2309) -!! input -{{div style|">}} -!! result -
    <script>alert(document.cookie)</script>">Magic div
    - -!! end - -!! test -Bug 2304: HTML attribute safety (unsafe breakout parameter 2; 2309) -!! input -{{div style|" >}} -!! result -
    <script>alert(document.cookie)</script>">Magic div
    - -!! end - -!! test -Bug 2304: HTML attribute safety (link) -!! input -
    -!! result -
    - -!! end - -!! test -Bug 2304: HTML attribute safety (italics) -!! input -
    -!! result -
    - -!! end - -!! test -Bug 2304: HTML attribute safety (bold) -!! input -
    -!! result -
    - -!! end - - -!! test -Bug 2304: HTML attribute safety (ISBN) -!! input -
    -!! result -
    - -!! end - -!! test -Bug 2304: HTML attribute safety (RFC) -!! input -
    -!! result -
    - -!! end - -!! test -Bug 2304: HTML attribute safety (PMID) -!! input -
    -!! result -
    - -!! end - -!! test -Bug 2304: HTML attribute safety (web link) -!! input -
    -!! result -
    - -!! end - -!! test -Bug 2304: HTML attribute safety (named web link) -!! input -
    -!! result -
    - -!! end - -!! test -Bug 3244: HTML attribute safety (extension; safe) -!! input -
    -!! result -
    - -!! end - -!! test -Bug 3244: HTML attribute safety (extension; unsafe) -!! input -
    -!! result -
    - -!! end - -!! test -Opera -o-link CSS -!! input -
    X
    -!! result -
    X
    - -!! end - -# More MSIE fun discovered by Tom Gilder - -!! test -MSIE CSS safety test: spurious slash -!! input -
    evil
    -!! result -
    evil
    - -!! end - -!! test -MSIE CSS safety test: hex code -!! input -
    evil
    -!! result -
    evil
    - -!! end - -!! test -MSIE CSS safety test: comment in url -!! input -
    evil
    -!! result -
    evil
    - -!! end - -!! test -MSIE CSS safety test: comment in expression -!! input -
    evil4
    -!! result -
    evil4
    - -!! end - -!! test -CSS safety test: vertical tab -!! input -

    A

    -!! result -

    A

    - -!! end - -!! test -MSIE CSS safety test: Fullwidth -!! input -

    A

    -
    B
    -!! result -

    A

    -
    B
    - -!! end - -!! test -MSIE CSS safety test: IPA extensions -!! input -
    A
    -

    B

    -!! result -
    A
    -

    B

    - -!! end - -!! test -MSIE CSS safety test: sup/sub script -!! input -
    A
    -
    B
    -

    C

    -!! result -
    A
    -
    B
    -

    C

    - -!! end - -!! test -MSIE CSS safety test: Repetition markers -!! input -

    A

    -

    B

    -

    C

    -

    D

    -

    E

    -

    F

    -

    G

    -!! result -

    A

    -

    B

    -

    C

    -

    D

    -

    E

    -

    F

    -

    G

    - -!! end - -!! test -Table attribute legitimate extension -!! input -{| -!+ style="color:blue"| status -|} -!! result - - -
    status -
    - -!!end - -!! test -Table attribute safety -!! input -{| -!+ style="border-width:expression(0+alert(document.cookie))"| status -|} -!! result - - -
    status -
    - -!! end - -!! test -CSS line continuation 1 -!! input -
    -!! result -
    - -!! end - -!! test -CSS line continuation 2 -!! input -
    -!! result -
    - -!! end - -!! article -Template:Identity -!! text -{{{1}}} -!! endarticle - -!! test -Expansion of multi-line templates in attribute values (bug 6255) -!! input -
    -
    -!! result -
    -
    - -!! end - - -!! test -Expansion of multi-line templates in attribute values (bug 6255 sanity check) -!! input -
    -
    -!! result -
    -
    - -!! end - -!! test -Expansion of multi-line templates in attribute values (bug 6255 sanity check 2) -!! input -
    -
    -!! result -
    -
    - -!! end - -### -### Parser hooks (see tests/parser/parserTestsParserHook.php for the extension) -### -!! test -Parser hook: empty input -!! input - -!! result -
    -''
    -array (
    -)
    -
    - -!! end - -!! test -Parser hook: empty input using terminated empty elements -!! input - -!! result -
    -NULL
    -array (
    -)
    -
    - -!! end - -!! test -Parser hook: empty input using terminated empty elements (space before) -!! input - -!! result -
    -NULL
    -array (
    -)
    -
    - -!! end - -!! test -Parser hook: basic input -!! input -input -!! result -
    -'input'
    -array (
    -)
    -
    - -!! end - - -!! test -Parser hook: case insensitive -!! input -input -!! result -
    -'input'
    -array (
    -)
    -
    - -!! end - - -!! test -Parser hook: case insensitive, redux -!! input -input -!! result -
    -'input'
    -array (
    -)
    -
    - -!! end - -!! test -Parser hook: nested tags -!! options -noxml -!! input - -!! result -
    -''
    -array (
    -)
    -
    </tag> - -!! end - -!! test -Parser hook: basic arguments -!! input - -!! result -
    -''
    -array (
    -  'width' => '200',
    -  'height' => '100',
    -  'depth' => '50',
    -  'square' => 'square',
    -)
    -
    - -!! end - -!! test -Parser hook: argument containing a forward slash (bug 5344) -!! input - -!! result -
    -''
    -array (
    -  'filename' => '/tmp/bla',
    -)
    -
    - -!! end - -!! test -Parser hook: empty input using terminated empty elements (bug 2374) -!! input -text -!! result -
    -NULL
    -array (
    -  'foo' => 'bar',
    -)
    -
    text - -!! end - -#
    should be output literally since there is no matching tag that begins it -!! test -Parser hook: basic arguments using terminated empty elements (bug 2374) -!! input - -other stuff - -!! result -
    -NULL
    -array (
    -  'width' => '200',
    -  'height' => '100',
    -  'depth' => '50',
    -  'square' => 'square',
    -)
    -
    -

    other stuff -</tag> -

    -!! end - -### -### (see tests/parser/parserTestsParserHook.php for the extension) -### - -!! test -Parser hook: static parser hook not inside a comment -!! input -hello, world - -!! result -

    hello, world -

    -!! end - - -!! test -Parser hook: static parser hook inside a comment -!! input - - -!! result -


    -

    -!! end - -# Nested template calls; this case was broken by Parser.php rev 1.506, -# since reverted. - -!! article -Template:One-parameter -!! text -(My parameter is: {{{1}}}) -!! endarticle - -!! article -Template:Map-one-parameter -!! text -{{{{{1}}}|{{{2}}}}} -!! endarticle - -!! test -Nested template calls -!! input -{{Map-one-parameter|One-parameter|param}} -!! result -

    (My parameter is: param) -

    -!! end - - -### -### Sanitizer -### -!! test -Sanitizer: Closing of open tags -!! input -
    -!! result -
    - -!! end - -!! test -Sanitizer: Closing of open but not closed tags -!! input -foo -!! result -

    foo -

    -!! end - -!! test -Sanitizer: Closing of closed but not open tags -!! input -
    -!! result -

    </s> -

    -!! end - -!! test -Sanitizer: Closing of closed but not open table tags -!! input -Table not started -!! result -

    Table not started</td></tr></table> -

    -!! end - -!! test -Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id="" -!! input -byte[[#æ: v|backlink]] -!! result -

    bytebacklink -

    -!! end - -!! test -Sanitizer: Validating the contents of the id attribute (bug 4515) -!! options -disabled -!! input -
    -!! result -Something, but definitely not
    ... -!! end - -!! test -Sanitizer: Validating id attribute uniqueness (bug 4515, bug 6301) -!! options -disabled -!! input -

    -!! result -Something need to be done. foo-2 ? -!! end - -!! test -Sanitizer: Validating that and work, but only for Microdata -!! input -
    - - - - - - -
    -!! result -
    -

    - <meta http-equiv="refresh" content="5"> - -

    - - <link rel="stylesheet" href="http://example.org"> - -
    - -!! end - -!! test -Language converter: output gets cut off unexpectedly (bug 5757) -!! options -language=zh -!! input -this bit is safe: }- - -but if we add a conversion instance: -{zh-cn:xxx;zh-tw:yyy}- - -then we get cut off here: }- - -all additional text is vanished -!! result -

    this bit is safe: }- -

    but if we add a conversion instance: xxx -

    then we get cut off here: }- -

    all additional text is vanished -

    -!! end - -!! test -Self closed html pairs (bug 5487) -!! options -!! input -
    Centered text
    -
    In div text
    -!! result -
    <font id="bug" />Centered text
    -
    <font id="bug2" />In div text
    - -!! end - -# -# -# - -!! test -Punctuation: nbsp before exclamation -!! input -C'est grave ! -!! result -

    C'est grave ! -

    -!! end - -!! test -Punctuation: CSS !important (bug 11874) -!! input -
    important
    -!! result -
    important
    - -!!end - -!! test -Punctuation: CSS ! important (bug 11874; with space after) -!! input -
    important
    -!! result -
    important
    - -!!end - - -!! test -HTML bullet list, closed tags (bug 5497) -!! input -
      -
    • One
    • -
    • Two
    • -
    -!! result -
      -
    • One
    • -
    • Two
    • -
    - -!! end - -!! test -HTML bullet list, unclosed tags (bug 5497) -!! options -disabled -!! input -
      -
    • One -
    • Two -
    -!! result -
      -
    • One -
    • -
    • Two -
    • -
    - -!! end - -!! test -HTML ordered list, closed tags (bug 5497) -!! input -
      -
    1. One
    2. -
    3. Two
    4. -
    -!! result -
      -
    1. One
    2. -
    3. Two
    4. -
    - -!! end - -!! test -HTML ordered list, unclosed tags (bug 5497) -!! options -disabled -!! input -
      -
    1. One -
    2. Two -
    -!! result -
      -
    1. One -
    2. -
    3. Two -
    4. -
    - -!! end - -!! test -HTML nested bullet list, closed tags (bug 5497) -!! input -
      -
    • One
    • -
    • Two: -
        -
      • Sub-one
      • -
      • Sub-two
      • -
      -
    • -
    -!! result -
      -
    • One
    • -
    • Two: -
        -
      • Sub-one
      • -
      • Sub-two
      • -
      -
    • -
    - -!! end - -!! test -HTML nested bullet list, open tags (bug 5497) -!! options -disabled -!! input -
      -
    • One -
    • Two: -
        -
      • Sub-one -
      • Sub-two -
      -
    -!! result -
      -
    • One -
    • -
    • Two: -
        -
      • Sub-one -
      • -
      • Sub-two -
      • -
      -
    • -
    - -!! end - -!! test -HTML nested ordered list, closed tags (bug 5497) -!! input -
      -
    1. One
    2. -
    3. Two: -
        -
      1. Sub-one
      2. -
      3. Sub-two
      4. -
      -
    4. -
    -!! result -
      -
    1. One
    2. -
    3. Two: -
        -
      1. Sub-one
      2. -
      3. Sub-two
      4. -
      -
    4. -
    - -!! end - -!! test -HTML nested ordered list, open tags (bug 5497) -!! options -disabled -!! input -
      -
    1. One -
    2. Two: -
        -
      1. Sub-one -
      2. Sub-two -
      -
    -!! result -
      -
    1. One -
    2. -
    3. Two: -
        -
      1. Sub-one -
      2. -
      3. Sub-two -
      4. -
      -
    4. -
    - -!! end - -!! test -HTML ordered list item with parameters oddity -!! input -
    1. One
    2. -
    -!! result -
    1. One
    2. -
    - -!! end - -!!test -bug 5918: autonumbering -!! input -[http://first/] [http://second] [ftp://ftp] - -ftp://inlineftp - -[mailto:enclosed@mail.tld With target] - -[mailto:enclosed@mail.tld] - -mailto:inline@mail.tld -!! result -

    [1] [2] [3] -

    ftp://inlineftp -

    With target -

    [4] -

    mailto:inline@mail.tld -

    -!! end - - -# -# Security and HTML correctness -# From Nick Jenkins' fuzz testing -# - -!! test -Fuzz testing: Parser13 -!! input -{| -| http://a| -!! result - - - - -
    -
    - -!! end - -!! test -Fuzz testing: Parser14 -!! input -== onmouseover= == -http://__TOC__ -!! result -

    onmouseover=[edit]

    -http://

    Contents

    - -
    - - -!! end - -!! test -Fuzz testing: Parser14-table -!! input -==a== -{| STYLE=__TOC__ -!! result -

    a[edit]

    - - -
    - -!! end - -# Known to produce bogus xml (extra ) -!! test -Fuzz testing: Parser16 -!! options -noxml -!! input -{| -!https://|||||| -!! result - - - - - - -
    https:// - -
    - -!! end - -!! test -Fuzz testing: Parser21 -!! input -{| -! irc://{{ftp://a" onmouseover="alert('hello world');" -| -!! result - - - - - -
    irc://{{ftp://a" onmouseover="alert('hello world');" - -
    - -!! end - -!! test -Fuzz testing: Parser22 -!! input -http://===r:::https://b - -{| -!!result -

    http://===r:::https://b -

    - - -
    - -!! end - -# Known to produce bad XML for now -!! test -Fuzz testing: Parser24 -!! options -noxml -!! input -{| -{{{| -}}}} > -
    - -MOVE YOUR MOUSE CURSOR OVER THIS TEXT -| -!! result - -{{{| -}}}} > -
    - -MOVE YOUR MOUSE CURSOR OVER THIS TEXT -
    - - -
    -
    - -!! end - -# Note: the current result listed for this is not what the original one was, -# but the original bug was JavaScript injection, which is fixed in any case. -# It's not clear that the original result listed was any more correct than the -# current one. Original result: -#

    {{{| -#

    -#
  • -# }}}blah" onmouseover="alert('hello world');" align="left"MOVE MOUSE CURSOR OVER HERE -!!test -Fuzz testing: Parser25 (bug 6055) -!! input -{{{ -| -
  • -}}}blah" onmouseover="alert('hello world');" align="left"'''MOVE MOUSE CURSOR OVER HERE -!! result -

    <LI CLASS=blah" onmouseover="alert('hello world');" align="left"MOVE MOUSE CURSOR OVER HERE -

    -!! end - -!!test -Fuzz testing: URL adjacent extension (with space, clean) -!! options -!! input -http://example.com junk -!! result -

    http://example.com junk -

    -!!end - -!!test -Fuzz testing: URL adjacent extension (no space, dirty; nowiki) -!! options -!! input -http://example.comjunk -!! result -

    http://example.comjunk -

    -!!end - -!!test -Fuzz testing: URL adjacent extension (no space, dirty; pre) -!! options -!! input -http://example.com
    junk
    -!! result -http://example.com
    junk
    - -!!end - -!!test -Fuzz testing: image with bogus manual thumbnail -!!input -[[Image:foobar.jpg|thumbnail= ]] -!!result -
    Error creating thumbnail:
    - -!!end - -!! test -Fuzz testing: encoded newline in generated HTML replacements (bug 6577) -!! input -
    
    -!! result
    -
    
    -
    -!! end
    -
    -!! test
    -Parsing optional HTML elements (Bug 6171)
    -!! options
    -!! input
    -
    -  
    -    
    -    
    -  
    -
    Some tabular data More tabular data ... - And yet som tabular data
    -!! result - - - - - -
    Some tabular data More tabular data ... - And yet som tabular data
    - -!! end - -!! test -Correct handling of , (Bug 6171) -!! options -!! input - - - - - - -
    Some tabular data More tabular data ... And yet som tabular data
    -!! result - - - - - - -
    Some tabular data More tabular data ... And yet som tabular data
    - -!! end - - -!! test -Parsing crashing regression (fr:JavaScript) -!! input - -!! result -

    </body></x> -

    -!! end - -!! test -Inline wiki vs wiki block nesting -!! input -'''Bold paragraph - -New wiki paragraph -!! result -

    Bold paragraph -

    New wiki paragraph -

    -!! end - -!! test -Inline HTML vs wiki block nesting -!! options -disabled -!! input -Bold paragraph - -New wiki paragraph -!! result -

    Bold paragraph -

    New wiki paragraph -

    -!! end - -# Original result was this: -#

    boldboldbolditalics -#

    -# While that might be marginally more intuitive, maybe, the six-apostrophe -# construct is clearly pathological and the result stated here (which is what -# the parser actually does) is about as reasonable as anything. -!!test -Mixing markup for italics and bold -!! options -!! input -'''bold''''''bold''bolditalics''''' -!! result -

    'bold'boldbolditalics -

    -!! end - - -!! article -Xyzzyx -!! text -Article for special page transclusion test -!! endarticle - -!! test -Special page transclusion -!! options -!! input -{{Special:Prefixindex/Xyzzyx}} -!! result -
    Xyzzyx
    - -!! end - -!! test -Special page transclusion twice (bug 5021) -!! options -!! input -{{Special:Prefixindex/Xyzzyx}} -{{Special:Prefixindex/Xyzzyx}} -!! result -
    Xyzzyx
    -
    Xyzzyx
    - -!! end - -!! test -Transclusion of default MediaWiki message -!! input -{{MediaWiki:Mainpage}} -!!result -

    Main Page -

    -!! end - -!! test -Transclusion of nonexistent MediaWiki message -!! input -{{MediaWiki:Mainpagexxx}} -!!result -

    MediaWiki:Mainpagexxx -

    -!! end - -!! test -Transclusion of MediaWiki message with underscore -!! input -{{MediaWiki:history_short}} -!! result -

    History -

    -!! end - -!! test -Transclusion of MediaWiki message with space -!! input -{{MediaWiki:history short}} -!! result -

    History -

    -!! end - -!! test -Invalid header with following text -!! input -= x = y -!! result -

    = x = y -

    -!! end - - -!! test -Section extraction test (section 0) -!! options -section=0 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -!! end - -!! test -Section extraction test (section 1) -!! options -section=1 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -==a== -===aa=== -====aaa==== -!! end - -!! test -Section extraction test (section 2) -!! options -section=2 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -===aa=== -====aaa==== -!! end - -!! test -Section extraction test (section 3) -!! options -section=3 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -====aaa==== -!! end - -!! test -Section extraction test (section 4) -!! options -section=4 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -==b== -===ba=== -===bb=== -====bba==== -===bc=== -!! end - -!! test -Section extraction test (section 5) -!! options -section=5 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -===ba=== -!! end - -!! test -Section extraction test (section 6) -!! options -section=6 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -===bb=== -====bba==== -!! end - -!! test -Section extraction test (section 7) -!! options -section=7 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -====bba==== -!! end - -!! test -Section extraction test (section 8) -!! options -section=8 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -===bc=== -!! end - -!! test -Section extraction test (section 9) -!! options -section=9 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -==c== -===ca=== -!! end - -!! test -Section extraction test (section 10) -!! options -section=10 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -===ca=== -!! end - -!! test -Section extraction test (nonexistent section 11) -!! options -section=11 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -!! end - -!! test -Section extraction test with bogus heading (section 1) -!! options -section=1 -!! input -==a== -==bogus== not a legal section -==b== -!! result -==a== -==bogus== not a legal section -!! end - -!! test -Section extraction test with bogus heading (section 2) -!! options -section=2 -!! input -==a== -==bogus== not a legal section -==b== -!! result -==b== -!! end - -!! test -Section extraction test with comment after heading (section 1) -!! options -section=1 -!! input -==a== -==b== -==c== -!! result -==a== -!! end - -!! test -Section extraction test with comment after heading (section 2) -!! options -section=2 -!! input -==a== -==b== -==c== -!! result -==b== -!! end - -!! test -Section extraction test with bogus heading (section 1) -!! options -section=1 -!! input -==a== -==bogus== not a legal section -==b== -!! result -==a== -==bogus== not a legal section -!! end - -!! test -Section extraction test with bogus heading (section 2) -!! options -section=2 -!! input -==a== -==bogus== not a legal section -==b== -!! result -==b== -!! end - - -# Formerly testing for bug 2587, now resolved by the use of unmarked sections -# instead of respecting commented sections -!! test -Section extraction prefixed by comment (section 1) -!! options -section=1 -!! input -==sec1== -==sec2== -!!result -==sec2== -!!end - -!! test -Section extraction prefixed by comment (section 2) -!! options -section=2 -!! input -==sec1== -==sec2== -!!result - -!!end - - -# Formerly testing for bug 2607, now resolved by the use of unmarked sections -# instead of respecting HTML-style headings -!! test -Section extraction, mixed wiki and html (section 1) -!! options -section=1 -!! input -

    unmarked

    -unmarked -==1== -one -==2== -two -!! result -==1== -one -!! end - -!! test -Section extraction, mixed wiki and html (section 2) -!! options -section=2 -!! input -

    unmarked

    -unmarked -==1== -one -==2== -two -!! result -==2== -two -!! end - - -# Formerly testing for bug 3342 -!! test -Section extraction, heading surrounded by -!! options -section=1 -!! input -==unmarked== -==marked== -!! result -==marked== -!!end - -# Test behavior of bug 19910 -!! test -Sectiion with all-equals -!! options -section=2 -!! input -=== -The line above must have a trailing space -=== -But just in case it doesn't... -!! result -=== -But just in case it doesn't... -!! end - -!! test -Section replacement test (section 0) -!! options -replace=0,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -xxx - -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! end - -!! test -Section replacement test (section 1) -!! options -replace=1,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -xxx - -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! end - -!! test -Section replacement test (section 2) -!! options -replace=2,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -xxx - -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! end - -!! test -Section replacement test (section 3) -!! options -replace=3,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -===aa=== -xxx - -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! end - -!! test -Section replacement test (section 4) -!! options -replace=4,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -===aa=== -====aaa==== -xxx - -==c== -===ca=== -!! end - -!! test -Section replacement test (section 5) -!! options -replace=5,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -===aa=== -====aaa==== -==b== -xxx - -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! end - -!! test -Section replacement test (section 6) -!! options -replace=6,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -xxx - -===bc=== -==c== -===ca=== -!! end - -!! test -Section replacement test (section 7) -!! options -replace=7,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -xxx - -===bc=== -==c== -===ca=== -!! end - -!! test -Section replacement test (section 8) -!! options -replace=8,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -xxx - -==c== -===ca=== -!!end - -!! test -Section replacement test (section 9) -!! options -replace=9,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -xxx -!! end - -!! test -Section replacement test (section 10) -!! options -replace=10,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -xxx -!! end - -!! test -Section replacement test with initial whitespace (bug 13728) -!! options -replace=2,"xxx" -!! input - Preformatted initial line -==a== -===a=== -!! result - Preformatted initial line -==a== -xxx -!! end - - -!! test -Section extraction, heading followed by pre with 20 spaces (bug 6398) -!! options -section=1 -!! input -==a== - a -!! result -==a== - a -!! end - -!! test -Section extraction, heading followed by pre with 19 spaces (bug 6398 sanity check) -!! options -section=1 -!! input -==a== - a -!! result -==a== - a -!! end - - -!! test -Section extraction,
     around bogus header (bug 10309)
    -!! options
    -noxml section=2
    -!! input
    -== Section One ==
    -
    -=======
    -
    - -== Section Two == -stuff -!! result -== Section Two == -stuff -!! end - -!! test -Section replacement,
     around bogus header (bug 10309)
    -!! options
    -noxml replace=2,"xxx"
    -!! input
    -== Section One ==
    -
    -=======
    -
    - -== Section Two == -stuff -!! result -== Section One == -
    -=======
    -
    - -xxx -!! end - - - -!! test -Handling of in URLs -!! input -**irc:// a -!! result - - -!!end - -!! test -5 quotes, code coverage +1 line (php) -!! options -php -!! input -''''' -!! result -!! end -# The PHP parser strips the empty tags out for giggles; parsoid doesn't. -!! test -5 quotes, code coverage +1 line (parsoid) -!! options -parsoid -!! input -''''' -!! result -

    -!! end - -!! test -Special:Search page linking. -!! input -{{Special:search}} -!! result -

    Special:Search -

    -!! end - -!! test -Say the magic word -!! options -title=[[Parser test]] -!! input -* {{PAGENAME}} -* {{PAGENAMEE}} -* {{FULLPAGENAME}} -* {{FULLPAGENAMEE}} -* {{BASEPAGENAME}} -* {{BASEPAGENAMEE}} -* {{SUBPAGENAME}} -* {{SUBPAGENAMEE}} -* {{ROOTPAGENAME}} -* {{ROOTPAGENAMEE}} -* {{TALKPAGENAME}} -* {{TALKPAGENAMEE}} -* {{SUBJECTPAGENAME}} -* {{SUBJECTPAGENAMEE}} -* {{NAMESPACEE}} -* {{NAMESPACE}} -* {{NAMESPACENUMBER}} -* {{TALKSPACE}} -* {{TALKSPACEE}} -* {{SUBJECTSPACE}} -* {{SUBJECTSPACEE}} -* {{Dynamic|{{NUMBEROFUSERS}}|{{NUMBEROFPAGES}}|{{CURRENTVERSION}}|{{CONTENTLANGUAGE}}|{{DIRECTIONMARK}}|{{CURRENTTIMESTAMP}}|{{NUMBEROFARTICLES}}}} -!! result -
      -
    • Parser test -
    • -
    • Parser_test -
    • -
    • Parser test -
    • -
    • Parser_test -
    • -
    • Parser test -
    • -
    • Parser_test -
    • -
    • Parser test -
    • -
    • Parser_test -
    • -
    • Parser test -
    • -
    • Parser_test -
    • -
    • Talk:Parser test -
    • -
    • Talk:Parser_test -
    • -
    • Parser test -
    • -
    • Parser_test -
    • -
    • -
    • -
    • -
    • -
    • 0 -
    • -
    • Talk -
    • -
    • Talk -
    • -
    • -
    • -
    • -
    • -
    • Template:Dynamic -
    • -
    - -!! end -### Note: Above tests excludes the "{{NUMBEROFADMINS}}" magic word because it generates a MySQL error when included. - -!! test -Gallery -!! input - -image1.png | -image2.gif||||| - -image3| -image4 |300px| centre - image5.svg| http:///////// -[[x|xx]]]] -* image6 - -!! result - - -!! end - -!! test -Gallery (with options) -!! input - -File:Nonexistant.jpg|caption -File:Nonexistant.jpg -image:foobar.jpg|some '''caption''' [[Main Page]] -image:foobar.jpg -image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla. - -!! result - - -!! end - -!! test -Gallery with wikitext inside caption -!! input - -File:foobar.jpg|[[File:foobar.jpg|20px|desc|alt=inneralt]]|alt=galleryalt -File:foobar.jpg|{{Test|unamedParam|alt=param}}|alt=galleryalt - -!! result - - -!! end - -!! test -gallery (with showfilename option) -!! input - -File:Nonexistant.jpg|caption -File:Nonexistant.jpg -image:foobar.jpg|some '''caption''' [[Main Page]] -File:Foobar.jpg - -!! result - - -!! end - -!! test -Gallery (with namespace-less filenames) -!! input - -File:Nonexistant.jpg -Nonexistant.jpg -image:foobar.jpg -foobar.jpg - -!! result - - -!! end - -!! test -HTML Hex character encoding (spells the word "JavaScript") -!! input -JavaScript -!! result -

    JavaScript -

    -!! end - -!! test -HTML Hex character encoding bogus encoding (bug 26437 regression check) -!! input -&#xsee;&#XSEE; -!! result -

    &#xsee;&#XSEE; -

    -!! end - -!! test -HTML Hex character encoding mixed case -!! input -îî -!! result -

    îî -

    -!! end - -!! test -__FORCETOC__ override -!! input -__NEWSECTIONLINK__ -__FORCETOC__ -!! result -


    -

    -!! end - -!! test -ISBN code coverage -!! input -ISBN 978-0-1234-56 789 -!! result -

    ISBN 978-0-1234-56 789 -

    -!! end - -!! test -ISBN followed by 5 spaces -!! input -ISBN -!! result -

    ISBN -

    -!! end - -!! test -Double ISBN -!! input -ISBN ISBN 1234567890 -!! result -

    ISBN ISBN 1234567890 -

    -!! end - -!! test -Bug 22905: followed by ISBN followed by -!! input -(fr) ISBN 2753300917 [http://www.example.com example.com] -!! result -

    (fr) ISBN 2753300917 example.com -

    -!! end - -!! test -Double RFC -!! input -RFC RFC 1234 -!! result -

    RFC RFC 1234 -

    -!! end - -!! test -Double RFC with a wiki link -!! input -RFC [[RFC 1234]] -!! result -

    RFC RFC 1234 -

    -!! end - -!! test -RFC code coverage -!! input -RFC 983 987 -!! result -

    RFC 983 987 -

    -!! end - -!! test -Centre-aligned image -!! input -[[Image:foobar.jpg|centre]] -!! result -
    Foobar.jpg
    - -!!end - -!! test -None-aligned image -!! input -[[Image:foobar.jpg|none]] -!! result -
    Foobar.jpg
    - -!!end - -!! test -Width + Height sized image (using px) (height is ignored) -!! input -[[Image:foobar.jpg|640x480px]] -!! result -

    Foobar.jpg -

    -!!end - -!! test -Width-sized image (using px, no following whitespace) -!! input -[[Image:foobar.jpg|640px]] -!! result -

    Foobar.jpg -

    -!!end - -!! test -Width-sized image (using px, with following whitespace - test regression from r39467) -!! input -[[Image:foobar.jpg|640px ]] -!! result -

    Foobar.jpg -

    -!!end - -!! test -Width-sized image (using px, with preceding whitespace - test regression from r39467) -!! input -[[Image:foobar.jpg| 640px]] -!! result -

    Foobar.jpg -

    -!!end - -!! test -Another italics / bold test -!! input - ''' ''x' -!! result -
    ' x'
    -
    -!!end - -# Note the results may be incorrect, as parserTest output included this: -# XML error: Mismatched tag at byte 6120: -# ...
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - -!!end - - -# Images with the "|" character in external URLs in comment tags; Eats half the comment, leaves unmatched "" tag. -!! test -Images with the "|" character in the comment -!! input -[[image:Foobar.jpg|thumb|An [http://test/?param1=|left|¶m2=|x external] URL]] -!! result -
    An external URL
    - -!!end - -!! test -[Before] HTML without raw HTML enabled ($wgRawHtml==false) -!! input - -!! result -

    <html><script>alert(1);</script></html> -

    -!! end - -!! test -HTML with raw HTML ($wgRawHtml==true) -!! options -wgRawHtml=1 -!! input - -!! result -

    -

    -!! end - -!! test -Parents of subpages, one level up -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -[[../|L2]] -!! result -

    L2 -

    -!! end - - -!! test -Parents of subpages, one level up, not named -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -[[../]] -!! result -

    Subpage test/L1/L2 -

    -!! end - - - -!! test -Parents of subpages, two levels up -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -[[../../|L1]]2 - -[[../../|L1]]l -!! result -

    L12 -

    L1l -

    -!! end - -!! test -Parents of subpages, two levels up, without trailing slash or name. -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -[[../..]] -!! result -

    [[../..]] -

    -!! end - -!! test -Parents of subpages, two levels up, with lots of extra trailing slashes. -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -[[../../////]] -!! result -

    /// -

    -!! end - -!! article -Subpage test/L1/L2/L3Sibling -!! text -Sibling article -!! endarticle - -!! test -Transclusion of a sibling page (one level up) -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -{{../L3Sibling}} -!! result -

    Sibling article -

    -!! end - -!! test -Transclusion of a child page -!! options -subpage title=[[Subpage test/L1/L2]] -!! input -{{/L3Sibling}} -!! result -

    Sibling article -

    -!! end - -!! test -Non-transclusion because of too many up levels -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -{{../../../../More than parent}} -!! result -

    {{../../../../More than parent}} -

    -!! end - -!! test -Definition list code coverage -!! input -; title : def -; title : def -;title: def -!! result -
    -
    title  
    -
    def -
    -
    title 
    -
    def -
    -
    title
    -
    def -
    -
    - -!! end - -!! test -Don't fall for the self-closing div -!! input -
    hello world
    -!! result -
    hello world
    - -!! end - -!! test -MSGNW magic word -!! input -{{MSGNW:msg}} -!! result -

    [[:Template:Msg]] -

    -!! end - -!! test -RAW magic word -!! input -{{RAW:QUERTY}} -!! result -

    Template:QUERTY -

    -!! end - -# This isn't needed for XHTML conformance, but would be handy as a fallback security measure -!! test -Always escape literal '>' in output, not just after '<' -!! input -><> -!! result -

    ><> -

    -!! end - -!! test -Template caching -!! input -{{Test}} -{{Test}} -!! result -

    This is a test template -This is a test template -

    -!! end - - -!! article -MediaWiki:Fake -!! text -==header== -!! endarticle - -!! test -Inclusion of !userCanEdit() content -!! input -{{MediaWiki:Fake}} -!! result -

    header[edit]

    - -!! end - - -!! test -Out-of-order TOC heading levels -!! input -==2== -======6====== -===3=== -=1= -=====5===== -==2== -!! result -

    Contents

    - -
    - -

    2[edit]

    -
    6[edit]
    -

    3[edit]

    -

    1[edit]

    -
    5[edit]
    -

    2[edit]

    - -!! end - - -!! test -ISBN with a dummy number -!! input -ISBN --- -!! result -

    ISBN --- -

    -!! end - - -!! test -ISBN with space-delimited number -!! input -ISBN 92 9017 032 8 -!! result -

    ISBN 92 9017 032 8 -

    -!! end - - -!! test -ISBN with multiple spaces, no number -!! input -ISBN foo -!! result -

    ISBN foo -

    -!! end - - -!! test -ISBN length -!! input -ISBN 123456789 - -ISBN 1234567890 - -ISBN 12345678901 -!! result -

    ISBN 123456789 -

    ISBN 1234567890 -

    ISBN 12345678901 -

    -!! end - - -!! test -ISBN with trailing year (bug 8110) -!! input -ISBN 1-234-56789-0 - 2006 - -ISBN 1 234 56789 0 - 2006 -!! result -

    ISBN 1-234-56789-0 - 2006 -

    ISBN 1 234 56789 0 - 2006 -

    -!! end - - -!! test -anchorencode -!! input -{{anchorencode:foo bar©#%n}} -!! result -

    foo_bar.C2.A9.23.25n -

    -!! end - -!! test -anchorencode trims spaces -!! input -{{anchorencode: __pretty__please__}} -!! result -

    pretty_please -

    -!! end - -!! test -anchorencode deals with links -!! input -{{anchorencode: [[hello|world]] [[hi]]}} -!! result -

    world_hi -

    -!! end - -!! test -anchorencode deals with templates -!! input -{{anchorencode: {{Foo}} }} -!! result -

    FOO -

    -!! end - -!! test -anchorencode encodes like the TOC generator: (bug 18431) -!! input -=== _ +:.3A%3A&&]] === -{{anchorencode: _ +:.3A%3A&&]] }} -__NOEDITSECTION__ -!! result -

    _ +:.3A%3A&&]]

    -

    .2B:.3A.253A.26.26.5D.5D -

    -!! end - -!! test -Bug 6200: blockquotes and paragraph formatting -!! input -
    -foo -
    - -bar - - baz -!! result -
    -

    foo -

    -
    -

    bar -

    -
    baz
    -
    -!! end - -!! test -Bug 8293: Use of center tag ruins paragraph formatting -!! input -
    -foo -
    - -bar - - baz -!! result -
    -

    foo -

    -
    -

    bar -

    -
    baz
    -
    -!! end - -!!test -Parsing of overlapping (improperly nested) inline html tags (PHP parser) -!!options -php -!!input -x -!!result -

    x</span> -

    -!!end - -!!test -Parsing of overlapping (improperly nested) inline html tags (Parsoid) -!!options -parsoid -!!input -x -!!result -

    x -

    -!!end - -### -### Language variants related tests -### -!! test -Self-link in language variants -!! options -title=[[Dunav]] language=sr -!! input -Both [[Dunav]] and [[Дунав]] are names for this river. -!! result -

    Both Dunav and Дунав are names for this river. -

    -!!end - -!! article -Дуна -!! text -content -!! endarticle - -!! test -Link to another existing title shouldn't be parsed as self-link even if it's a variant of this title -!! options -title=[[Duna]] language=sr -!! input -[[Дуна]] is not a self-link while [[Duna]] and [[Dуна]] are still self-links. -!! result -

    Дуна is not a self-link while Duna and Dуна are still self-links. -

    -!! end - -!! test -Link to a section of a variant of this title shouldn't be parsed as self-link -!! options -title=[[Duna]] language=sr -!! input -[[Dуна]] is a self-link while [[Dunа#Foo]] and [[Dуна#Foo]] are not self-links. -!! result -

    Dуна is a self-link while Dunа#Foo and Dуна#Foo are not self-links. -

    -!! end - -!! test -Link to pages in language variants -!! options -language=sr -!! input -Main Page can be written as [[Маин Паге]] -!! result -

    Main Page can be written as Маин Паге -

    -!!end - - -!! test -Multiple links to pages in language variants -!! options -language=sr -!! input -[[Main Page]] can be written as [[Маин Паге]] same as [[Маин Паге]]. -!! result -

    Main Page can be written as Маин Паге same as Маин Паге. -

    -!!end - - -!! test -Simple template in language variants -!! options -language=sr -!! input -{{тест}} -!! result -

    This is a test template -

    -!! end - - -!! test -Template with explicit namespace in language variants -!! options -language=sr -!! input -{{Template:тест}} -!! result -

    This is a test template -

    -!! end - - -!! test -Basic test for template parameter in language variants -!! options -language=sr -!! input -{{парамтест|param=foo}} -!! result -

    This is a test template with parameter foo -

    -!! end - - -!! test -Simple category in language variants -!! options -language=sr cat -!! input -[[Category:МедиаWики Усер'с Гуиде]] -!! result -MediaWiki User's Guide -!! end - - -!! article -Category:分类 -!! text -blah -!! endarticle - -!! article -Category:分類 -!! text -blah -!! endarticle - -!! test -Don't convert blue categorylinks to another variant (bug 33210) -!! options -language=zh cat -!! input -[[A]][[Category:分类]] -!! result -分类 -!! end - - -!! test -Stripping -{}- tags (language variants) -!! options -language=sr -!! input -Latin proverb: -{Ne nuntium necare}- -!! result -

    Latin proverb: Ne nuntium necare -

    -!! end - - -!! test -Prevent conversion with -{}- tags (language variants) -!! options -language=sr variant=sr-ec -!! input -Latinski: -{Ne nuntium necare}- -!! result -

    Латински: Ne nuntium necare -

    -!! end - - -!! test -Prevent conversion of text with -{}- tags (language variants) -!! options -language=sr variant=sr-ec -!! input -Latinski: -{Ne nuntium necare}- -!! result -

    Латински: Ne nuntium necare -

    -!! end - - -!! test -Prevent conversion of links with -{}- tags (language variants) -!! options -language=sr variant=sr-ec -!! input --{[[Main Page]]}- -!! result -

    Main Page -

    -!! end - - -!! test --{}- tags within headlines (within html for parserConvert()) -!! options -language=sr variant=sr-ec -!! input -== -{Naslov}- == -!! result -

    Naslov[уреди]

    - -!! end - - -!! test -Explicit definition of language variant alternatives -!! options -language=zh variant=zh-tw -!! input --{zh:China;zh-tw:Taiwan}-, not China -!! result -

    Taiwan, not China -

    -!! end - - -!! test -Conversion around HTML tags -!! options -language=sr variant=sr-ec -!! input --{H|span=>sr-ec:script;title=>sr-ec:src;}- -ski -!! result -

    -ски -

    -!! end - - -!! test -Explicit session-wise language variant mapping (A flag and - flag) -!! options -language=zh variant=zh-tw -!! input -Taiwan is not China. -But -{A|zh:China;zh-tw:Taiwan}- is China, -(This-{-|zh:China;zh-tw:Taiwan}- should be stripped!) -and -{China}- is China. -!! result -

    Taiwan is not China. -But Taiwan is Taiwan, -(This should be stripped!) -and China is China. -

    -!! end - -!! test -Explicit session-wise language variant mapping (H flag for hide) -!! options -language=zh variant=zh-tw -!! input -(This-{H|zh:China;zh-tw:Taiwan}- should be stripped!) -Taiwan is China. -!! result -

    (This should be stripped!) -Taiwan is Taiwan. -

    -!! end - -!! test -Adding explicit conversion rule for title (T flag) -!! options -language=zh variant=zh-tw showtitle -!! input -Should be stripped-{T|zh:China;zh-tw:Taiwan}-! -!! result -Taiwan -

    Should be stripped! -

    -!! end - -!! test -Testing that changing the language variant here in the tests actually works -!! options -language=zh variant=zh showtitle -!! input -Should be stripped-{T|zh:China;zh-tw:Taiwan}-! -!! result -China -

    Should be stripped! -

    -!! end - -!! test -Recursive conversion of alt and title attrs shouldn't clear converter state -!! options -language=zh variant=zh-cn showtitle -!! input --{H|zh-cn:Exclamation;zh-tw:exclamation;}- -Should be stripped-{T|zh-cn:China;zh-tw:Taiwan}-! -!! result -China -

    -Should be stripped! -

    -!! end - -!! test -Bug 24072: more test on conversion rule for title -!! options -language=zh variant=zh-tw showtitle -!! input -This should be stripped-{T|zh:China;zh-tw:Taiwan}-! -This won't take interferes with the title rule-{H|zh:Beijing;zh-tw:Taipei}-. -!! result -Taiwan -

    This should be stripped! -This won't take interferes with the title rule. -

    -!! end - -!! test -Partly disable title conversion if variant == main language code -!! options -language=zh variant=zh title=[[ZH]] showtitle -!! input --{T|zh-cn:CN;zh-tw:TW}- -!! result -ZH -

    -

    -!! end - -!! test -Partly disable title conversion if variant == main language code, more -!! options -language=zh variant=zh title=[[ZH]] showtitle -!! input --{T|TW}- -!! result -ZH -

    -

    -!! end - -!! test -Raw output of variant escape tags (R flag) -!! options -language=zh variant=zh-tw -!! input -Raw: -{R|zh:China;zh-tw:Taiwan}- -!! result -

    Raw: zh:China;zh-tw:Taiwan -

    -!! end - -!! test -Nested using of manual convert syntax -!! options -language=zh variant=zh-hk -!! input -Nested: -{zh-hans:Hi -{zh-cn:China;zh-sg:Singapore;}-;zh-hant:Hello -{zh-tw:Taiwan;zh-hk:H-{ong}- K-{}-ong;}-;}-! -!! result -

    Nested: Hello Hong Kong! -

    -!! end - -!! test -Proper conversion of text in external links -!! options -language=sr variant=sr-ec -!! input -http://www.google.com -gopher://www.google.com -[http://www.google.com http://www.google.com] -[gopher://www.google.com gopher://www.google.com] -[https://www.google.com irc://www.google.com] -[ftp://www.google.com www.google.com/ftp://dir] -[//www.google.com www.google.com] -!! result -

    http://www.google.com -gopher://www.google.com -http://www.google.com -gopher://www.google.com -irc://www.google.com -www.гоогле.цом/фтп://дир -www.гоогле.цом -

    -!! end - -!! test -Do not convert roman numbers to language variants -!! options -language=sr variant=sr-ec -!! input -Fridrih IV je car. -!! result -

    Фридрих IV је цар. -

    -!! end - -!! test -Unclosed language converter markup "-{" -!! options -language=sr -!! input --{T|hello -!! result -

    -{T|hello -

    -!! end - -!! test -Don't convert raw rule "-{R|=>}-" to "=>" -!! options -language=sr -!! input --{R|=>}- -!! result -

    => -

    -!!end - -!! test -Bug 529: Uncovered bullet -!! input -* Foo {{bullet}} -!! result -
      -
    • Foo -
    • -
    • Bar -
    • -
    - -!! end - -# Plain MediaWiki does not remove empty lists, but tidy actually does. -# Templates in Wikipedia rely on this behavior, as tidy has always been -# enabled there. These tests are normally run *without* tidy, so specify the -# full output here. -# To test realistic parsing behavior, apply a tidy-like transformation to both -# the expected output and your parser's output. -!! test -Bug 529: Uncovered bullet leaving empty list, normally removed by tidy -!! input -******* Foo {{bullet}} -!! result -
      -
      • -
        • -
          • -
            • -
              • -
                • -
                • Foo -
                • -
                -
              • -
              -
            • -
            -
          • -
          -
        • -
        -
      • -
      -
    • -
    • Bar -
    • -
    - -!! end - -!! test -Bug 529: Uncovered table already at line-start -!! input -x - -{{table}} -y -!! result -

    x -

    - - - - - - -
    1 2 -
    3 4 -
    -

    y -

    -!! end - -!! test -Bug 529: Uncovered bullet in parser function result -!! input -* Foo {{lc:{{bullet}} }} -!! result -
      -
    • Foo -
    • -
    • bar -
    • -
    - -!! end - -!! test -Bug 5678: Double-parsed template argument -!! input -{{lc:{{{1}}}|hello}} -!! result -

    {{{1}}} -

    -!! end - -!! test -Bug 5678: Double-parsed template invocation -!! input -{{lc:{{paramtest {{!}} param = hello }} }} -!! result -

    {{paramtest | param = hello }} -

    -!! end - -!! test -Case insensitivity of parser functions for non-ASCII characters (bug 8143) -!! options -language=cs -title=[[Main Page]] -!! input -{{PRVNÍVELKÉ:ěščř}} -{{prvnívelké:ěščř}} -{{PRVNÍMALÉ:ěščř}} -{{prvnímalé:ěščř}} -{{MALÁ:ěščř}} -{{malá:ěščř}} -{{VELKÁ:ěščř}} -{{velká:ěščř}} -!! result -

    Ěščř -Ěščř -ěščř -ěščř -ěščř -ěščř -ĚŠČŘ -ĚŠČŘ -

    -!! end - -!! test -Morwen/13: Unclosed link followed by heading -!! input -[[link -==heading== -!! result -

    [[link -

    -

    heading[edit]

    - -!! end - -!! test -HHP2.1: Heuristics for headings in preprocessor parenthetical structures -!! input -{{foo| -=heading= -!! result -

    {{foo| -

    -

    heading

    - -!! end - -!! test -HHP2.2: Heuristics for headings in preprocessor parenthetical structures -!! input -{{foo| -==heading== -!! result -

    {{foo| -

    -

    heading[edit]

    - -!! end - -!! test -Tildes in comments -!! options -pst -!! input - -!! result - -!! end - -!! test -Paragraphs inside divs (no extra line breaks) -!! input -
    Line one - -Line two
    -!! result -
    Line one -Line two
    - -!! end - -!! test -Paragraphs inside divs (extra line break on open) -!! input -
    -Line one - -Line two
    -!! result -
    -

    Line one -

    -Line two
    - -!! end - -!! test -Paragraphs inside divs (extra line break on close) -!! input -
    Line one - -Line two -
    -!! result -
    Line one -

    Line two -

    -
    - -!! end - -!! test -Paragraphs inside divs (extra line break on open and close) -!! input -
    -Line one - -Line two -
    -!! result -
    -

    Line one -

    Line two -

    -
    - -!! end - -!! test -Nesting tags, paragraphs on lines which begin with
    -!! options -disabled -!! input -
    A -B -!! result -
    -

    A -B -

    -!! end - -# Bug 6200:
    should behave like
    with respect to line breaks -!! test -Bug 6200: paragraphs inside blockquotes (no extra line breaks) -!! input -
    Line one - -Line two
    -!! result -
    Line one -Line two
    - -!! end - -!! test -Bug 6200: paragraphs inside blockquotes (extra line break on open) -!! input -
    -Line one - -Line two
    -!! result -
    -

    Line one -

    -Line two
    - -!! end - -!! test -Bug 6200: paragraphs inside blockquotes (extra line break on close) -!! input -
    Line one - -Line two -
    -!! result -
    Line one -

    Line two -

    -
    - -!! end - -!! test -Bug 6200: paragraphs inside blockquotes (extra line break on open and close) -!! input -
    -Line one - -Line two -
    -!! result -
    -

    Line one -

    Line two -

    -
    - -!! end - -!! test -Paragraphs inside blockquotes/divs (no extra line breaks) -!! input -
    Line one - -Line two
    -!! result -
    Line one -Line two
    - -!! end - -!! test -Paragraphs inside blockquotes/divs (extra line break on open) -!! input -
    -Line one - -Line two
    -!! result -
    -

    Line one -

    -Line two
    - -!! end - -!! test -Paragraphs inside blockquotes/divs (extra line break on close) -!! input -
    Line one - -Line two -
    -!! result -
    Line one -

    Line two -

    -
    - -!! end - -!! test -Paragraphs inside blockquotes/divs (extra line break on open and close) -!! input -
    -Line one - -Line two -
    -!! result -
    -

    Line one -

    Line two -

    -
    - -!! end - -!! test -Interwiki links trounced by replaceExternalLinks after early LinkHolderArray expansion -!! options -wgLinkHolderBatchSize=0 -!! input -[[meatball:1]] -[[meatball:2]] -[[meatball:3]] -!! result -

    meatball:1 -meatball:2 -meatball:3 -

    -!! end - -!! test -Free external link invading image caption -!! input -[[Image:Foobar.jpg|thumb|http://x|hello]] -!! result -
    hello
    - -!! end - -!! test -Bug 15196: localised external link numbers -!! options -language=fa -!! input -[http://en.wikipedia.org/] -!! result -

    [۱] -

    -!! end - -!! test -Multibyte character in padleft -!! input -{{padleft:-Hello|7|Æ}} -!! result -

    Æ-Hello -

    -!! end - -!! test -Multibyte character in padright -!! input -{{padright:Hello-|7|Æ}} -!! result -

    Hello-Æ -

    -!! end - -!!test -formatdate parser function -!!input -{{#formatdate:2009-03-24}} -!! result -

    2009-03-24 -

    -!! end - -!!test -formatdate parser function, with default format -!!input -{{#formatdate:2009-03-24|mdy}} -!! result -

    March 24, 2009 -

    -!! end - -!! test -Spacing of numbers in formatted dates -!! input -{{#formatdate:January 15}} -!! result -

    January 15 -

    -!! end - -!! test -formatdate parser function, with default format and on a page of which the content language is always English and different from the wiki content language -!! options -language=nl title=[[MediaWiki:Common.css]] -!! input -{{#formatdate:2009-03-24|dmy}} -!! result -

    24 March 2009 -

    -!! end - -# -# -# - -# -# Edit comments -# - -!! test -Edit comment with link -!! options -comment -!! input -I like the [[Main Page]] a lot -!! result -I like the Main Page a lot -!!end - -!! test -Edit comment with link and link text -!! options -comment -!! input -I like the [[Main Page|best pages]] a lot -!! result -I like the best pages a lot -!!end - -!! test -Edit comment with link and link text with suffix -!! options -comment -!! input -I like the [[Main Page|best page]]s a lot -!! result -I like the best pages a lot -!!end - -!! test -Edit comment with section link (non-local, eg in history list) -!! options -comment title=[[Main Page]] -!! input -/* External links */ removed bogus entries -!! result -External links: removed bogus entries -!!end - -!! test -Edit comment with section link and text before it (non-local, eg in history list) -!! options -comment title=[[Main Page]] -!! input -pre-comment text /* External links */ removed bogus entries -!! result -pre-comment text External links: removed bogus entries -!!end - -!! test -Edit comment with section link (local, eg in diff view) -!! options -comment local title=[[Main Page]] -!! input -/* External links */ removed bogus entries -!! result -External links: removed bogus entries -!!end - -!! test -Edit comment with subpage link (bug 14080) -!! options -comment -subpage -title=[[Subpage test]] -!! input -Poked at a [[/subpage]] here... -!! result -Poked at a /subpage here... -!!end - -!! test -Edit comment with subpage link and link text (bug 14080) -!! options -comment -subpage -title=[[Subpage test]] -!! input -Poked at a [[/subpage|neat little page]] here... -!! result -Poked at a neat little page here... -!!end - -!! test -Edit comment with bogus subpage link in non-subpage NS (bug 14080) -!! options -comment -title=[[Subpage test]] -!! input -Poked at a [[/subpage]] here... -!! result -Poked at a /subpage here... -!!end - -!! test -Edit comment with bare anchor link (local, as on diff) -!! options -comment -local -title=[[Main Page]] -!!input -[[#section]] -!! result -#section -!! end - -!! test -Edit comment with bare anchor link (non-local, as on history) -!! options -comment -title=[[Main Page]] -!!input -[[#section]] -!! result -#section -!! end - -!! test -Anchor starting with underscore -!!input -[[#_ref|One]] -!! result -

    One -

    -!! end - -!! test -Id starting with underscore -!!input -
    -!! result -
    - -!! end - -!! test -Space normalisation on autocomment (bug 22784) -!! options -comment -title=[[Main Page]] -!!input -/* __hello__world__ */ -!! result -__hello__world__ -!! end - -!! test -percent-encoding and + signs in comments (Bug 26410) -!! options -comment -!!input -[[ABC%33D% ++]] [[ABC%33D% ++|+%20]] -!! result -ABC3D% ++ +%20 -!! end - -!! test -Bad images - basic functionality -!! options -disabled -!! input -[[File:Bad.jpg]] -!! result -!! end - -!! test -Bad images - bug 16039: text after bad image disappears -!! options -disabled -!! input -Foo bar -[[File:Bad.jpg]] -Bar foo -!! result -

    Foo bar -

    Bar foo -

    -!! end - -!! test -Verify that displaytitle works (bug #22501) no displaytitle -!! options -showtitle -!! config -wgAllowDisplayTitle=true -wgRestrictDisplayTitle=false -!! input -this is not the the title -!! result -Parser test -

    this is not the the title -

    -!! end - -!! test -Verify that displaytitle works (bug #22501) RestrictDisplayTitle=false -!! options -showtitle -title=[[Screen]] -!! config -wgAllowDisplayTitle=true -wgRestrictDisplayTitle=false -!! input -this is not the the title -{{DISPLAYTITLE:whatever}} -!! result -whatever -

    this is not the the title -

    -!! end - -!! test -Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true mismatch -!! options -showtitle -title=[[Screen]] -!! config -wgAllowDisplayTitle=true -wgRestrictDisplayTitle=true -!! input -this is not the the title -{{DISPLAYTITLE:whatever}} -!! result -Screen -

    this is not the the title -

    -!! end - -!! test -Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true matching -!! options -showtitle -title=[[Screen]] -!! config -wgAllowDisplayTitle=true -wgRestrictDisplayTitle=true -!! input -this is not the the title -{{DISPLAYTITLE:screen}} -!! result -screen -

    this is not the the title -

    -!! end - -!! test -Verify that displaytitle works (bug #22501) AllowDisplayTitle=false -!! options -showtitle -title=[[Screen]] -!! config -wgAllowDisplayTitle=false -!! input -this is not the the title -{{DISPLAYTITLE:screen}} -!! result -Screen -

    this is not the the title -Template:DISPLAYTITLE:screen -

    -!! end - -!! test -Verify that displaytitle works (bug #22501) AllowDisplayTitle=false no DISPLAYTITLE -!! options -showtitle -title=[[Screen]] -!! config -wgAllowDisplayTitle=false -!! input -this is not the the title -!! result -Screen -

    this is not the the title -

    -!! end - -!! test -Verify that displaytitle handles inline CSS styles (bug 26547) - rejected value -!! options -showtitle -title=[[Screen]] -!! config -wgAllowDisplayTitle=true -wgRestrictDisplayTitle=true -!! input -this is not the the title -{{DISPLAYTITLE:screen}} -!! result -screen -

    this is not the the title -

    -!! end - -!! test -Verify that displaytitle handles inline CSS styles (bug 26547) - accepted value -!! options -showtitle -title=[[Screen]] -!! config -wgAllowDisplayTitle=true -wgRestrictDisplayTitle=true -!! input -this is not the the title -{{DISPLAYTITLE:screen}} -!! result -screen -

    this is not the the title -

    -!! end - -!! test -preload: check and -!! options -preload -!! input -Hello cruelkind world. -!! result -Hello kind world. -!! end - -!! test -preload: check -!! options -preload -!! input -Goodbye Hello world -!! result -Hello world -!! end - -!! test -preload: can pass tags through if we want to -!! options -preload -!! input -<includeonly>Hello world</includeonly> -!! result -Hello world -!! end - -!! test -preload: check that it doesn't try to do tricks -!! options -preload -!! input -* ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}} -!! result -* ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}} -!! end - -!! test -Play a bit with r67090 and bug 3158 -!! options -disabled -!! input -
     
    -
     
    -
     
    -
     
    -!! result -
     
    -
     
    -
     
    -
     
    - -!! end - -!! test -HTML5 data attributes -!! input -Baz -

    Quuz

    -!! result -

    Baz -

    -

    Quuz

    - -!! end - -!! test -percent-encoding and + signs in internal links (Bug 26410) -!! input -[[User:+%]] [[Page+title%]] -[[%+]] [[%+|%20]] [[%+ ]] [[%+r]] -[[%]] [[+]] [[image:%+abc%39|foo|[[bar]]]] -[[%33%45]] [[%33%45+]] -!! result -

    User:+% Page+title% -%+ %20 %+ %+r -% + bar -3E 3E+ -

    -!! end - -!! test -Special characters in embedded file links (bug 27679) -!! input -[[File:Contains & ampersand.jpg]] -[[File:Does not exist.jpg|Title with & ampersand]] -!! result -

    File:Contains & ampersand.jpg -Title with & ampersand -

    -!! end - - -!! test -Confirm that 'apos' named character reference doesn't make it to output (not legal in HTML 4) -!! input -Text's been normalized? -!! result -

    Text's been normalized? -

    -!! end - -!! test -Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate free external links -!! input -http://www.example.org/ <-- U+3000 (vim: ^Vu3000) -!! result -

    http://www.example.org/ <-- U+3000 (vim: ^Vu3000) -

    -!! end - -!! test -Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate bracketed external links -!! input -[http://www.example.org/ ideograms] -!! result -

    ideograms -

    -!! end - -!! test -Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate external images links -!! input -http://www.example.org/pic.png <-- U+3000 (vim: ^Vu3000) -!! result -

    pic.png <-- U+3000 (vim: ^Vu3000) -

    -!! end - -!! article -Mediawiki:loop1 -!! text -{{Identical|A}} -!! endarticle - -!! article -Mediawiki:loop2 -!! text -{{Identical|B}} -!! endarticle - -!! article -Template:Identical -!! text -{{int:loop1}} -{{int:loop2}} -!! endarticle - -!! test -Bug 31098 Template which includes system messages which includes the template -!! input -{{Identical}} -!! result -

    Template loop detected: Template:Identical -Template loop detected: Template:Identical -

    -!! end - -!! test -Bug31490 Turkish: ucfirst 'blah' -!! options -language=tr -!! input -{{ucfirst:blah}} -!! result -

    Blah -

    -!! end - -!! test -Bug31490 Turkish: ucfirst 'ix' -!! options -language=tr -!! input -{{ucfirst:ix}} -!! result -

    İx -

    -!! end - -!! test -Bug31490 Turkish: lcfirst 'BLAH' -!! options -language=tr -!! input -{{lcfirst:BLAH}} -!! result -

    bLAH -

    -!! end - -!! test -Bug31490 Turkish: ucfırst (with a dotless i) -!! options -language=tr -!! input -{{ucfırst:blah}} -!! result -

    Şablon:Ucfırst:blah -

    -!! end - -!! test -Bug31490 ucfırst (with a dotless i) with English language -!! options -language=en -!! input -{{ucfırst:blah}} -!! result -

    Template:Ucfırst:blah -

    -!! end - -!! test -Bug 26375: TOC with italics -!! options -title=[[Main Page]] -!! input -__TOC__ -== ''Lost'' episodes == -!! result -

    Contents

    - -
    - -

    Lost episodes[edit]

    - -!! end - -!! test -Bug 26375: TOC with bold -!! options -title=[[Main Page]] -!! input -__TOC__ -== '''should be bold''' then normal text == -!! result - - -

    should be bold then normal text[edit]

    - -!! end - -!! test -Bug 33845: Headings become cursive in TOC when they contain an image -!! options -title=[[Main Page]] -!! input -__TOC__ -== Image [[Image:foobar.jpg]] == -!! result -

    Contents

    - -
    - -

    Image Foobar.jpg[edit]

    - -!! end - -!! test -Bug 33845 (2): Headings become bold in TOC when they contain a blockquote -!! options -title=[[Main Page]] -!! input -__TOC__ -==
    Quote
    == -!! result -

    Contents

    - -
    - -

    Quote
    [edit]

    - -!! end - -!! test -Unclosed tags in TOC -!! options -title=[[Main Page]] -!! input -__TOC__ -== Proof: 2 < 3 == -Hanc marginis exiguitas non caperet. -QED -!! result -

    Contents

    - -
    - -

    Proof: 2 < 3[edit]

    -

    Hanc marginis exiguitas non caperet. -QED -

    -!! end - -!! test -Multiple tags in TOC -!! input -__TOC__ -== Foo Bar == - -== Foo
    Bar
    == -!! result -

    Contents

    - -
    - -

    Foo Bar[edit]

    -

    Foo
    Bar
    [edit]

    - -!! end - -!! test -Tags with parameters in TOC -!! input -__TOC__ -== Hello == - -== Evilbye == -!! result -

    Contents

    - -
    - -

    Hello[edit]

    -

    b">Evilbye[edit]

    - -!! end - -!! test -span tags with directionality in TOC -!! input -__TOC__ -== C++ == - -== זבנג! == - -== The attributes on these span tags must be deleted from the TOC == - -== All attributes on these span tags must be deleted from the TOC == - -== Attributes after dir on these span tags must be deleted from the TOC == -!! result - - -

    C++[edit]

    -

    זבנג![edit]

    -

    The attributes on these span tags must be deleted from the TOC[edit]

    -

    All attributes on these span tags must be deleted from the TOC[edit]

    -

    Attributes after dir on these span tags must be deleted from the TOC[edit]

    - -!! end - -!! article -MediaWiki:Bug32057 -!! text -== {{int:headline_sample}} == -!! endarticle - -!! test -Bug 32057: Title needed when expanding nodes. -!! options -title=[[Main Page]] -!! input -{{int:Bug32057}} -!! result -

    Headline text[edit]

    - -!! end - -!! test -Strip marker in urlencode -!! input -{{urlencode:xy}} -{{urlencode:xy|wiki}} -{{urlencode:xy|path}} -!! result -

    xy -xy -xy -

    -!! end - -!! test -Strip marker in lc -!! input -{{lc:xy}} -!! result -

    xy -

    -!! end - -!! test -Strip marker in uc -!! input -{{uc:xy}} -!! result -

    XY -

    -!! end - -!! test -Strip marker in formatNum -!! input -{{formatnum:12}} -{{formatnum:12|R}} -!! result -

    12 -12 -

    -!! end - -!! test -Check noCommafy in formatNum -!! options -language=be-tarask -!! input -{{formatnum:123456.78}} -{{formatnum:123456.78|NOSEP}} -!! result -

    123 456,78 -123456.78 -

    -!! end - -!! test -Strip marker in grammar -!! options -language=fi -!! input -{{grammar:elative|foobar}} -!! result -

    foobarista -

    -!! end - -!! test -Strip marker in padleft -!! input -{{padleft:|2|xy}} -!! result -

    xy -

    -!! end - -!! test -Strip marker in padright -!! input -{{padright:|2|xy}} -!! result -

    xy -

    -!! end - -!! test -Strip marker in anchorencode -!! input -{{anchorencode:xy}} -!! result -

    xy -

    -!! end - -!! test -nowiki inside link inside heading (bug 18295) -!! input -==[[foo|xyz]]== -!! result -

    xyz[edit]

    - -!! end - -!! test -new support for bdi element (bug 31817) -!! input -

    ולדימיר לנין (ברוסית: Владимир Ленин, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.

    -!! result -

    ולדימיר לנין (ברוסית: Владимир Ленин, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.

    - -!!end - -!! test -Ignore pipe between table row attributes -!! input -{| -| quux -|- id=foo | style='color: red' -| bar -|} -!! result - - - - -
    quux -
    bar -
    - -!! end - -!!test -Gallery override link with WikiLink (bug 34852) -!! input - -File:foobar.jpg|caption|alt=galleryalt|link=InterWikiLink - -!! result - - -!! end - -!!test -Gallery override link with absolute external link (bug 34852) -!! input - -File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org - -!! result - - -!! end - -!!test -Gallery override link with malicious javascript (bug 34852) -!! input - -File:foobar.jpg|caption|alt=galleryalt|link=" onclick="alert('malicious javascript code!'); - -!! result - - -!! end - -!!test -Gallery with invalid title as link (bug 43964) -!! input - -File:foobar.jpg|link=< - -!! result - - -!! end - -!!test -Language parser function -!! input -{{#language:ar}} -!! result -

    العربية -

    -!! end - -!!test -Padleft and padright as substr -!! input -{{padleft:|3|abcde}} -{{padright:|3|abcde}} -!! result -

    abc -abc -

    -!! end - -!!test -Special parser function -!! input -{{#special:RandomPage}} -{{#special:BaDtItLe}} -{{#special:Foobar}} -!! result -

    Special:Random -Special:Badtitle -Special:Foobar -

    -!! end - -!!test -Bug 34939 - Case insensitive link parsing ([HttP://]) -!! input -[HttP://MediaWiki.Org/] -!! result -

    [1] -

    -!! end - -!!test -Bug 34939 - Case insensitive link parsing ([HttP:// title]) -!! input -[HttP://MediaWiki.Org/ MediaWiki] -!! result -

    MediaWiki -

    -!! end - -!!test -Bug 34939 - Case insensitive link parsing (HttP://) -!! input -HttP://MediaWiki.Org/ -!! result -

    HttP://MediaWiki.Org/ -

    -!! end - -!!test -Disable TOC -!! options -notoc -!! input -Lead -== Section 1 == -== Section 2 == -== Section 3 == -== Section 4 == -== Section 5 == -!! result -

    Lead -

    - -

    Section 1[edit]

    -

    Section 2[edit]

    -

    Section 3[edit]

    -

    Section 4[edit]

    -

    Section 5[edit]

    - -!! end - - -### -### Parsoids-specific tests -### Parsoid-PHP parser incompatibilities -### -!!test -1. SOL-sensitive wikitext tokens as template-args -!!options -parsoid=wt2html,wt2wt -!!input -{{echo|*a}} -{{echo|#a}} -{{echo|:a}} -!!result - -
    • a
    • -
    - -
    1. a
    2. -
    - -
    a
    -
    -!!end - -#### ---------------------------------------------------------------- -#### Parsoid-only testing of Parsoid's impl of and -#### tags. Parsoid's output for these tags differs from that of the -#### PHP parser. -#### ---------------------------------------------------------------- - -!!test -Ref: 1. ref-location should be replaced with an index span -!!options -parsoid -!!input -A foo -B foo -C -!!result -

    A [1] -B [2] -C [3]

    -!!end - -!!test -Ref: 2. ref-tags with identical names should all get the same index -!!options -parsoid -!!input -A foo -B -!!result -

    A [1] -B [1]

    -!!end - -!!test -Ref: 3. spaces in ref-names should be ignored -!!options -parsoid -!!input -A foo -B -C -!!result -

    A [1] -B [1] -C [1]

    -!!end - -!!test -Ref: 4. 'constructor' should be accepted as a valid ref-name -(NOTE: constructor is a predefined property in JS and constructor as a ref-name can clash with it if not handled properly) -!!options -parsoid -!!input -A foo -!!result -

    A [1]

    -!!end - -!!test -Ref: 5. body should accept generic wikitext -!!options -parsoid -!!input -A - This is a '''[[bolded link]]''' and this is a {{echo|transclusion}} - - - -!!result -

    A [1]

    - -
      -
    1. This is a bolded link and this is a transclusion -
    2. -
    -!!end - -!!test -Ref: 6. indent-pres should not be output in ref-body -!!options -parsoid -!!input -A - foo - bar - baz - - - -!!result -

    A [1]

    - -
      -
    1. foo - bar - baz -
    2. -
    -!!end - -!!test -Ref: 7. No p-wrapping in ref-body -!!options -parsoid -!!input -A -foo - -bar - - -baz - - - -booz - - - -!!result -

    A [1]

    - -
      -
    1. foo - -bar - - -baz - - - -booz -
    2. -
    -!!end - -!!test -Ref: 8. transclusion wikitext has lower precedence -!!options -parsoid -!!input -A foo {{echo| B C}} - - -!!result -

    A [1] B C}}

    - -
      -
    1. foo {{echo|
    2. -
    -!!end - -!!test -Ref: 9. unclosed comments should not leak out of ref-body -!!options -parsoid -!!input -A foo "},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref">[1] B C

    - -
      -
    1. foo
    2. -
    -!!end - -!!test -Ref: 10. Unclosed HTML tags should not leak out of ref-body -!!options -parsoid -!!input -A foo B C - - -!!result -

    A [1] B C

    - -
      -
    1. foo
    2. -
    -!!end - -!!test -Ref: 11. ref-tags acts like an inline element wrt P-wrapping -!!options -parsoid -!!input -A foo B -C bar D -!!result -

    A [1] B -C [2] D

    -!!end - -!!test -Ref: 12. ref-tags act as trailing newline migration barrier -!!options -parsoid -!!input -a - -b - - -c -!!result -

    a

    - - -

    b [1] -[2]

    - - -

    c

    -!!end - -!!test -Ref: 13. ref-tags are not SOL-transparent and block indent-pres -!!options -parsoid -!!input -foo A -bar - B -!!result -

    [1] A -[2] B

    -!!end - -!!test -Ref: 14. A nested ref-tag should be emitted as plain text -!!options -parsoid -!!input -foo bar baz - - -!!result -

    [1]

    - -
      -
    1. foo <ref>bar</ref> baz
    2. -
    -!!end - -!!test -Ref: 15. ref-tags with identical names should get identical indexes -!!options -parsoid -!!input -A1 foo A2 -B1 B2 bar - - -!!result -

    A1 [1] A2 [1] -B1 [2] B2 [2]

    - -
    1. 1.0 1.1 foo
    2. 2.0 2.1 bar
    3. -
    -!!end - -!!test -References: 1. references tag without any refs should be handled properly -!!options -parsoid -!!input - -!!result -
      -!!end - -!!test -References: 2. references tag with group only outputs references from that group -!!options -parsoid -!!input -A foo -B bar - - -!!result -

      A [a 1] -B [b 1]

      - -
      1. foo
      2. -
      -!!end - -!!test -References: 3. ref list should be cleared after processing references -!!options -parsoid -!!input -A foo - - - -B bar - - -!!result -

      A [1]

      - -
      1. foo
      2. -
      - -

      B [1]

      - -
      1. bar
      2. -
      -!!end - -!!test -References: 4. only referenced group should be cleared after processing references -!!options -parsoid -!!input -A afoo -B bfoo - - - -C cfoo - - -!!result -

      A [a 1] -B [1]

      - -
      1. afoo
      2. -
      - -

      C [2]

      - -
      1. bfoo
      2. cfoo
      3. -
      -!!end - -!!test -References: 5. ref tags in references should be processed while ignoring all other content -!!options -parsoid -!!input -A -B bar - - -foo -This should just get lost. - -!!result -

      A [1] -B [2]

      - -
      1. foo
      2. bar
      3. -
      -!!end - -!!test -References: 6. from a transclusion -!!options -parsoid -!!input -{{echo|}} -!!result -
        -!!end - -!! test -References: 7. Multiple references tags (one without and one with nested refs) should be correctly handled -!! options -parsoid -!! input -A foo bar for a -B - - - - -foo - -!! result -

        A [1] -B [2]

        - -
          -
        1. foo bar for a
        2. -
        3. -
        - -
          -
        1. foo
        2. -
        -!! end - -#### ---------------------------------------------------------------- -#### The following section of tests are primarily to test -#### wikitext escaping capabilities of Parsoid. Given that -#### escaping can be done any number of ways, the wikitext (input) -#### is always adjusted to reflect how Parsoid adds nowiki -#### escape tags. -#### -#### We are marking several tests as parsoid-only since the -#### HTML in the result section is different from what the -#### PHP parser generates for it. -#### ---------------------------------------------------------------- - - -#### --------------- Headings --------------- -#### 0. Unnested -#### 1. Nested inside html

        =foo=

        -#### 2. Outside heading nest on a single line

        foo

        *bar -#### 3. Nested inside html with wikitext split by html tags -#### 4. No escape needed -#### 5. Empty headings

        -#### 6. Heading chars in SOL context -#### ---------------------------------------- -!! test -Headings: 0. Unnested -!! options -parsoid -!! input -=foo= - - =foo= - -=foo= - -=foo''a''= -!! result -

        =foo=

        - -

        =foo= - -=foo=

        - -

        =fooa=

        -!!end - -!! test -Headings: 1. Nested inside html -!! options -parsoid -!! input -==foo== - -===foo=== - -====foo==== - -=====foo===== - -======foo====== - -=======foo======= -!! result -

        =foo=

        -

        =foo=

        -

        =foo=

        -

        =foo=

        -
        =foo=
        -
        =foo=
        -!!end - -!! test -Headings: 2. Outside heading nest on a single line

        foo

        *bar -!! options -parsoid -!! input -=foo= -*bar - -=foo= -=bar - -=foo= -=bar= -!! result -

        foo

        *bar -

        foo

        =bar -

        foo

        =bar= -!!end - -!! test -Headings: 3. Nested inside html with wikitext split by html tags -!! options -parsoid -!! input -=='''bold'''foo== -!! result -

        =boldfoo=

        -!!end - -!! test -Headings: 4a. No escaping needed (testing just h1 and h2) -!! options -parsoid -!! input -==foo= - -=foo== - -= =foo= = - -==foo= bar= - -===foo== - -==foo=== - -=''=''foo== - -=== -!! result -

        =foo

        -

        foo=

        -

        =foo=

        -

        =foo= bar

        -

        =foo

        -

        foo=

        -

        =foo=

        -

        =

        -!!end - -!! test -Headings: 4b. No escaping needed (inside p-tags) -!! options -parsoid -!! input -=== -=foo= x -=foo= -!! result -

        === -=foo= x -=foo= -

        -!!end - -!! test -Headings: 5. Empty headings -!! options -parsoid -!! input -== - -==== - -====== - -======== - -========== - -============ -!! result -

        -

        -

        -

        -
        -
        -!!end - -!! test -Headings: 6a. Heading chars in SOL context (with trailing spaces) -!! options -parsoid -!! input -=a= - -=a= - -=a= - -=a= -!! result -

        =a=

        -

        =a=

        -

        =a=

        -

        =a=

        -!!end - -!! test -Headings: 6b. Heading chars in SOL context (with trailing newlines) -!! options -parsoid -!! input -=a= -b - -=a= -b - -=a= -b - -=a= -b -!! result -

        =a= -b

        -

        =a= -b

        -

        =a= -b

        -

        =a= -b

        -

        -!!end - -!! test -Headings: 6c. Heading chars in SOL context (leading newline break) -!! options -parsoid -!! input -a -=b= -!! result -

        a -=b=

        -!!end - -!! test -Headings: 6d. Heading chars in SOL context (with interspersed comments) -!! options -parsoid -!! input -=a= - -=a= -!! result -

        =a=

        -

        =a=

        -!!end - -!! test -Headings: 6d. Heading chars in SOL context (No escaping needed) -!! options -parsoid=html2wt -!! input -=a=
        b
        -!! result -=a=
        b
        -!!end - -#### --------------- Lists --------------- -#### 0. Outside nests (*foo, etc.) -#### 1. Nested inside html
        • *foo
        -#### 2. Inside definition lists -#### 3. Only bullets at start should be escaped -#### 4. No escapes needed -#### 5. No unnecessary escapes -#### 6. Escape bullets in SOL position -#### 7. Escape bullets in a multi-line context -#### ---------------------------------------- - -!! test -Lists: 0. Outside nests -!! input -*foo - -#foo -!! result -

        *foo -

        #foo -

        -!!end - -!! test -Lists: 1. Nested inside html -!! input -**foo - -*#foo - -*:foo - -*;foo - -#*foo - -##foo - -#:foo - -#;foo -!! result -
          -
        • *foo -
        • -
        -
          -
        • #foo -
        • -
        -
          -
        • :foo -
        • -
        -
          -
        • ;foo -
        • -
        -
          -
        1. *foo -
        2. -
        -
          -
        1. #foo -
        2. -
        -
          -
        1. :foo -
        2. -
        -
          -
        1. ;foo -
        2. -
        - -!!end - -!! test -Lists: 2. Inside definition lists -!! input -;;foo - -;:foo - -;:foo -:bar - -::foo -!! result -
        -
        ;foo -
        -
        -
        -
        :foo -
        -
        -
        -
        :foo -
        -
        bar -
        -
        -
        -
        :foo -
        -
        - -!!end - -!! test -Lists: 3. Only bullets at start of text should be escaped -!! input -**foo*bar - -**foo''it''*bar -!! result -
          -
        • *foo*bar -
        • -
        -
          -
        • *fooit*bar -
        • -
        - -!!end - -!! test -Lists: 4. No escapes needed -!! options -parsoid -!! input -*foo*bar - -*''foo''*bar - -*[[Foo]]: bar -!! result -
          -
        • foo*bar -
        • -
        -
          -
        • foo*bar -
        • -
        - -!!end - -!! test -Lists: 5. No unnecessary escapes -!! input -* bar [[foo]] - -*=bar [[foo]] - -*[[bar [[foo]] - -*]]bar [[foo]] - -*=bar foo]]= - -* : a -!! result -
          -
        • bar [[foo]] -
        • -
        -
          -
        • =bar [[foo]] -
        • -
        -
          -
        • [[bar [[foo]] -
        • -
        -
          -
        • ]]bar [[foo]] -
        • -
        -
          -
        • =bar foo]]= -
        • -
        -
          -
        • : a -
        • -
        - -!!end - -!! test -Lists: 6. Escape bullets in SOL position -!! options -parsoid -!! input -*foo -!! result -

        *foo

        -!!end - -!! test -Lists: 7. Escape bullets in a multi-line context -!! input -a -*b -!! result -

        a -*b -

        -!!end - -#### --------------- HRs --------------- -#### 1. Single line -#### ----------------------------------- - -!! test -HRs: 1. Single line -!! options -parsoid -!! input --------- -----=foo= -----*foo -!! result -
        ---- -
        =foo= -
        *foo -!! end - -#### --------------- Tables --------------- -#### 1a. Simple example -#### 1b. No escaping needed (!foo) -#### 1c. No escaping needed (|foo) -#### 1d. No escaping needed (|}foo) -#### -#### 2a. Nested in td (foo|bar) -#### 2b. Nested in td (foo||bar) -#### 2c. Nested in td -- no escaping needed(foo!!bar) -#### -#### 3a. Nested in th (foo!bar) -#### 3b. Nested in th (foo!!bar) -#### 3c. Nested in th -- no escaping needed(foo||bar) -#### -#### 4a. Escape - -#### 4b. Escape + -#### 4c. No escaping needed -#### -------------------------------------- - -!! test -Tables: 1a. Simple example -!! input -{| -|} -!! result -

        {| -|} -

        -!! end - -!! test -Tables: 1b. No escaping needed -!! input -!foo -!! result -

        !foo -

        -!! end - -!! test -Tables: 1c. No escaping needed -!! input -|foo -!! result -

        |foo -

        -!! end - -!! test -Tables: 1d. No escaping needed -!! input -|}foo -!! result -

        |}foo -

        -!! end - -!! test -Tables: 2a. Nested in td -!! options -parsoid -!! input -{| -|foo|bar -|} -!! result - -
        foo|bar
        -!! end - -!! test -Tables: 2b. Nested in td -!! options -parsoid -!! input -{| -|foo||bar -|''it''foo||bar -|} -!! result - - -
        foo||baritfoo||bar
        -!! end - -!! test -Tables: 2c. Nested in td -- no escaping needed -!! options -parsoid -!! input -{| -|foo!!bar -|} -!! result -
        foo!!bar -
        - -!! end - -!! test -Tables: 3a. Nested in th -!! options -parsoid -!! input -{| -!foo!bar -|} -!! result -
        foo!bar -
        - -!! end - -!! test -Tables: 3b. Nested in th -!! options -parsoid -!! input -{| -!foo!!bar -|} -!! result - - -
        foo!!bar
        -!! end - -!! test -Tables: 3c. Nested in th -- no escaping needed -!! options -parsoid -!! input -{| -!foo||bar -|} -!! result - -
        foo||bar
        -!! end - -!! test -Tables: 4a. Escape - -!! options -parsoid -!! input -{| -!-bar -|- -|-bar -|} -!! result - - - -
        -bar
        -bar
        -!! end - -!! test -Tables: 4b. Escape + -!! options -parsoid -!! input -{| -!+bar -|- -|+bar -|} -!! result - - - -
        +bar
        +bar
        -!! end - -!! test -Tables: 4c. No escaping needed -!! options -parsoid -!! input -{| -|foo-bar -|foo+bar -|- -|''foo''-bar -|''foo''+bar -|- -|foo -bar|baz -+bar --bar -|} -!! result - - - - -
        foo-barfoo+bar
        foo-barfoo+bar
        foo -

        bar|baz -+bar --bar

        -!! end - -### SSS FIXME: Disabled right now because accurate html2wt -### on this snippet requires data-parsoid flags that we've -### stripped out of these tests. We should scheme how we -### we want to handle these kind of tests that require -### data-parsoid flags for accurate html2wt serialization - -!! test -Tables: 4d. No escaping needed -!! options -disabled -!! input -{| -||+1 -||-2 -|} -!! result - - - -
        +1 --2 -
        - -!! end - -#### --------------- Links ---------------- -#### 1. Quote marks in link text -#### 2. Wikilinks: Escapes needed -#### 3. Wikilinks: No escapes needed -#### 4. Extlinks: Escapes needed -#### 5. Extlinks: No escapes needed -#### -------------------------------------- -!! test -Links 1. Quote marks in link text -!! options -parsoid -!! input -[[Foo|Foo''boo'']] -!! result -Foo''boo'' -!! end - -!! test -Links 2. WikiLinks: Escapes needed -!! options -parsoid -!! input -[[Foo|[Foobar]]] -[[Foo|Foobar]]] -[[Foo|x [Foobar] x]] -[[Foo|x [http://google.com g] x]] -[[Foo|[[Bar]]]] -[[Foo|x [[Bar]] x]] -[[Foo||Bar]] -[[Foo|]]bar]] -[[Foo|[[bar]] -[[Foo|x ]] y [[ z]] -!! result -[Foobar] -Foobar] -x [Foobar] x -x [http://google.com g] x -[[Bar]] -x [[Bar]] x -|Bar -]]bar -[[bar -x ]] y [[ z -!! end - -!! test -Links 3. WikiLinks: No escapes needed -!! options -parsoid -!! input -[[Foo|[Foobar]] -[[Foo|foo|bar]] -!! result -[Foobar -foo|bar -!! end - -!! test -Links 4. ExtLinks: Escapes needed -!! options -parsoid -!! input -[http://google.com [google]] -[http://google.com google]] -!! result -[google] -google] -!! end - -!! test -Links 5. ExtLinks: No escapes needed -!! options -parsoid -!! input -[http://google.com [google] -!! result -[google -!! end - -#### --------------- Quotes --------------- -#### 1. Quotes inside and -#### 2. Link fragments separated by and tags -#### 3. Link fragments inside and -#### 4. No escaping needed -#### -------------------------------------- -!! test -1. Quotes inside and -!! options -parsoid=html2wt,wt2wt -!! input -'''foo''' -''''foo'''' -'''''foo''''' -''foo'''s -''''foo'''' -'''''foo''''' -''''''foo'''''' -'''foo'''bar'''baz''' -'''foo''''s -'''foo'' -''foo''' -'''foo''' -''''foo''' -'''foo'''' -''''foo'''' -!! result -

        'foo' -''foo'' -'''foo''' -foo's -'foo' -''foo'' -'''foo''' -foo'bar'baz -foo's -'foo -foo' -'foo' -'foo -foo' -'foo'

        -!! end - -!! test -2. Link fragments separated by and tags -!! input -[[''foo''hello]] - -[['''foo'''hello]] -!! result -

        [[foohello]] -

        [[foohello]] -

        -!! end - -!! test -3. Link fragments inside and -(FIXME: Escaping one or both of [[ and ]] is also acceptable -- - this is one of the shortcomings of this format) -!! input -''[[foo'']] - -'''[[foo''']] -!! result -

        [[foo]] -

        [[foo]] -

        -!! end - -!! test -4. No escaping needed -!! input -'''bar''' -''''bar'''' -!! result -

        'bar' -'bar' -

        -!! end - -#### ----------- Paragraphs --------------- -#### 1. No unnecessary escapes -#### -------------------------------------- - -!! test -1. No unnecessary escapes -!! input -bar [[foo]] - -=bar [[foo]] - -[[bar [[foo]] - -]]bar [[foo]] - -=bar foo]]= -!! result -

        bar [[foo]] -

        =bar [[foo]] -

        [[bar [[foo]] -

        ]]bar [[foo]] -

        =bar foo]]= -

        -!!end - -#### ----------------------- PRE -------------------------- -#### 1. Leading whitespace in SOL context should be escaped -#### ------------------------------------------------------ -!! test -1. Leading whitespace in SOL context should be escaped -!! options -parsoid -!! input - a - - a - - a(tab) - - a - - a - -a - b - -a - b - -a - b -!! result -

        a

        -

        a

        -

        a(tab)

        -

        a

        -

        a

        -

        a - b

        -

        a - b

        -

        a - b

        -!! end - -#### --------------- Behavior Switches -------------------- -!! test -1. Valid behavior switches should be escaped -!! options -parsoid=html2wt -!! input -__TOC__ -!! result -__TOC__ -!! end - -!! test -2. Invalid behavior switches should not be escaped -!! options -parsoid=html2wt -!! input -__TOO__ -__|__ -!! result -__TOO__ -__|__ -!! end - -#### --------------- HTML tags --------------- -#### 1. a tags -#### 2. other tags -#### 3. multi-line html tag -#### ----------------------------------------- -!! test -1. a tags -!! options -parsoid -!! input -google -!! result -<a href="http://google.com">google</a> -!! end - -!! test -2. other tags -!! input -
        foo
        -
        foo
        -!! result -

        <div>foo</div> -<div style="color:red">foo</div> -

        -!! end - -!! test -3. multi-line html tag -!! input -
        foo
        -!! result -

        <div ->foo</div -> -

        -!! end - -!! test -4. extension tags -!! input -foo -!! result -

        <ref>foo</ref> -

        -!! end - -#### --------------- Others --------------- -!! test -Escaping nowikis -!! input -<nowiki>foo</nowiki> -!! result -

        <nowiki>foo</nowiki> -

        -!! end - -## The quote-char in the input is necessary for triggering the bug -!! test -(Bug 52035) Nowiki-escaping should not get tripped by " :" in text -!! options -parsoid=wt2wt,html2wt -!! input -foo's bar : -!! result -

        foo's bar :

        -!! end - -!! test - -Tag-like HTML structures are passed through as text -!! input - - - - - - -1>2 - -xb - -1f -!! result -

        <x y> -

        <x.y> -

        <x-y> -

        1>2 -

        x<y -

        a>b -

        1<d e>f -

        -!! end - - -# This was a bug in the PHP parser (see bug 17663 and its dups, -# https://bugzilla.wikimedia.org/show_bug.cgi?id=17663) -!! test -Tag names followed by punctuation should not be recognized as tags -!! input - text -!! result -

        <s.ome> text -

        -!! end - -!! test -HTML tag with necessary entities in attributes -!! input -foo -!! result -

        foo -

        -!! end - -!! test -HTML tag with 'unnecessary' entity encoding in attributes -!! input -foo -!! result -

        foo -

        -!! end - -!! test -HTML tag with broken attribute value quoting -!! input -Foo -!! result -

        Foo -

        -!! end - -!! test -Table with broken attribute value quoting -!! input -{| -| title="Hello world|Foo -|} -!! result - - -
        Foo -
        - -!! end - -!! test -Table with broken attribute value quoting on consecutive lines -!! input -{| -| title="Hello world|Foo -| style="color:red|Bar -|} -!! result - - - -
        Foo -Bar -
        - -!! end - -!! test -Parsoid-only: Table with broken attribute value quoting on consecutive lines -!! options -parsoid -!! input -{| -| title="Hello world|Foo -| style="color:red|Bar -|} -!! result - - -
        Foo -Bar -
        - -!! end - -!! test -Parsoid-only: Don't wrap broken template tags in on wt2wt (Bug 42353) -!! options -parsoid -!! input -{{}} -!! result -{{}} -!! end - -!! test -Parsoid-only: Don't wrap broken template tags in on wt2wt (Bug 42353) -!! options -parsoid -!! input -}}{{ -!! result -}}{{ -!! end - -!!test -Accept empty td cell attribute -!!input -{| -| align="center" | foo || | -|} -!!result - - - -
        foo -
        - -!!end - -!!test -Non-empty attributes in th-cells -!!input -{| -! Foo !! style="color: red" | Bar -|} -!!result - - - -
        Foo Bar -
        - -!!end - -!!test -Accept empty attributes in th-cells -!!input -{| -!| foo !!| bar -|} -!!result - - - -
        foo bar -
        - -!!end - -!!test -Empty table rows go away -!!input -{| -| Hello -| there -|- class="foo" -|- -|} -!! result - - - - - -
        Hello - there -
        - -!! end - -### -### Parsoid-centric tests for testing RTing of inter-element separators -### Edge cases not tested by existing parser tests and specific to -### Parsoid-specific serialization strategies. -### - -!!test -RT-ed inter-element separators should be valid separators -!!input -{| -|- [[foo]] -|} -!!result - - -
        - -!!end - -!!test -Trailing newlines in a deep dom-subtree that ends a wikitext line should be migrated out -(Parsoid-only since PHP parser relies on Tidy for correct output) -!!options -parsoid -!!input -{| -|foo -bar -|} - -{| -|foo -|} -!!result -!!end - -!!test -Empty TD followed by TD with tpl-generated attribute -!!input -{| -|- -| -|{{echo|style='color:red'}}|foo -|} -!!result - - - - -
        -foo -
        - -!!end - -!!test -Indented table with an empty td -!!input - {| - |- - | - |foo - |} -!!result - - - - -
        -foo -
        - -!!end - -!!test -Empty TR followed by a template-generated TR -(Parsoid-specific since PHP parser doesn't handle this mixed tbl-wikitext) -!!options -parsoid -!!input -{| -|- -{{echo|foo}} -|} -!!result - - - - - -
        foo
        -!!end - -## PHP and parsoid output differ for this, and since this is primarily -## for testing Parsoid's serializer, marking this Parsoid only -!!test -Empty TR followed by mixed-ws-comment line should RT correctly -!!options -parsoid -!!input -{| -|- - -|- - -|} -!!result - - - - - - -
        - -!!end - -!!test -Multi-line image caption generated by templates with/without trailing newlines -!!options -parsoid -!!input -[[File:foo.jpg|thumb|300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}]] -[[File:foo.jpg|thumb|300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}\n\n]] -!!result -
        File:Foo.jpg
        foo\nA\nB\nC
        -
        File:Foo.jpg
        foo\nA\nB\nC\n\n
        - -!!end - -## PHP emits broken html for this, and since this is primarily -## a Parsoid serializer test, marking this Parsoid only -!!test -Improperly nested inline or quotes tags with whitespace in between -!!options -parsoid -!!input - x -''' ''x''' '' -!!result -

        x - x -

        -!!end - -!!test -Encapsulate protected attributes from wt -!!options -parsoid -!!input -
        foo
        -!!result -
        foo
        - -!!end - -## Currently the p-wrapper is fragile in how adds / removes transformations. -## Having nested or stray pre tags results in the attempt to add duplicates, -## causing an assertion fail. This test tries to prevent that situation. -!!test -Ensure ParagraphWrapper can deal with stray closing pre tags -!!options -parsoid=wt2html -!!input -plain text
        -!!result -plain text -!!end - -!!test -Ensure fostered text content is wrapped in spans -!!options -parsoid=wt2html -!!input -hi
        ho
        -!!result -hi -
        -ho -
        -!!end - -!!test -Encapsulation properly handles null DSR information from foster box -!!options -parsoid=wt2html,wt2wt -!!input -{{echo|foo
        bar
        }} -!!result -foo - - - -
        bar
        -!!end - -!!test -1. Encapsulate foster-parented transclusion content -!!options -parsoid=wt2wt,wt2html -!!input -{{echo|foo}}
        bar
        -!!result -foo - - - -
        bar
        -!!end - -!!test -2. Encapsulate foster-parented transclusion content -!!options -parsoid=wt2wt,wt2html -!!input -
        {{echo|foo}}
        bar
        -!!result -
        foo
        - - - -
        bar
        -!!end - -!!test -3. Encapsulate foster-parented transclusion content -!!options -parsoid=wt2wt,wt2html -!!input -

        {{echo|foo

        }}bar
        -!!result -
        -

        foo

        - - - -
        bar
        -!!end - -!!test -4. Encapsulate foster-parented transclusion content -!!options -parsoid=wt2wt,wt2html -!!input -

        {{echo|foo

        }}bar
        -!!result -
        -

        foo

        - - - -
        bar
        -!!end - -!!test -5. Encapsulate foster-parented transclusion content -!!options -parsoid=wt2wt,wt2html -!!input -foo}}

        {{echo|foo

        -!!result -foo - - - -
        -
        -

        foo

        -!!end - -!!test -6. Encapsulate foster-parented transclusion content -!!options -parsoid=wt2wt,wt2html -!!input -foo

        {{echo|foo

        }}

        ok

        -!!result -foo - - - -
        -
        -

        foo

        -

        ok

        -!!end - -!!test -7. Encapsulate foster-parented transclusion content -!!options -parsoid=wt2wt,wt2html -!!input -{{echo|

        foo

        }}
        bar
        -!!result -

        foo

        - - - -
        bar
        -!!end - -!!test -8. Encapsulate foster-parented transclusion content -!!options -parsoid=wt2wt,wt2html -!!input -{{echo|a -}}{|{{echo|style='color:red'}} -|- -|b -|} -!!result -

        a

        {{{1}}} - - - -
        b
        -!!end - -# ----------------------------------------------------------------- -# The following section of tests are primarily to spec requirements -# around serialization of new/edited content. -# -# All these tests are marked Parsoid html2wt and html2html only -# ---------------------------------------------------------------- - -!! test -Image: Modifying size of an image -!! options -parsoid=html2wt -!! input -[[Image:Wiki.png|230x230px]] -!! result -

        -!!end - -!! test -Image: New block level image should have \n before and after -!! options -parsoid=html2wt -!! input -123 -[[File:Wiki.png|right|thumb|150x150px]] -456 -!! result -

        123

        456

        -!!end - -# Wacky -- the leading newline in input is required because -# that is what the serializer emits. To be fixed. Not fixing -# the test because this test is required to test serialization of -# new content and preferred whitespace style. -!! test -Lists: Serialize correctly even when list content is wrapped in p-tags (like VE does) -!! options -parsoid=html2wt -!! input - -* foo -!! result -
          -
        • foo

        • -
        -!! end - -# Wacky -- the leading newline in input is required because -# that is what the serializer emits. To be fixed. Not fixing -# the test because this test is required to test serialization of -# new content and preferred whitespace style. -!! test -Lists: Add space after bullets -!! options -parsoid=html2wt -!! input - -* foo -* bar -* baz -!! result -
          -
        • foo
        • -
        • bar
        • -
        • baz
        • -
        -!! end - -!! test -Parsoid: Serialize positional parameters with = in them as named parameter -!! options -parsoid=html2wt -!! input -{{echo|1 = f=oo}} - -{{echo|1 = f=oo|2 = bar}} - - - -{{echo|f=oo|bar}} -!! result -

        foo

        - -

        foo

        - - - -

        foo

        -!! end - -!! test -Parsoid: Correctly serialize block-node children when they are a combination of text and p-nodes -!! options -parsoid=html2wt -!! input -
        a -b -
        -
        a -b -
        -
        -a - -b -
        -!! result -
        a

        b

        -
        a -

        b

        -
        -a -

        b

        -!! end - -#----------------------------- -# I/B quote minimization tests -#----------------------------- - -!! test -1. I/B quote minimization: wikitext-only tags should be combined -!! options -parsoid=html2wt -!! input -''AB'' - -'''AB''' - -''A'''B''''' - -'''A''B''''' - -'''A''BC''D''' - -'''''AB''''' - -'''''AB''''' - -'''''AB''''' -!! result -

        AB

        -

        AB

        -

        AB

        -

        AB

        -

        ABCD

        -

        AB

        -

        AB

        -

        AB

        -!! end - -!! test -2. I/B quote minimization: wikitext and html tags should not be combined -!! options -parsoid=html2wt -!! input -''A''B - -''A'''''B''' -!! result -

        AB

        -

        AB

        -!! end - -!! test -3. I/B quote minimization: templated content stops minimization -!! options -parsoid=html2wt -!! input -''A''{{echo|''B''}} - -''A''{{echo|'''''B'''''}} -!! result -

        AB -

        AB -!! end - -!! test -4. I/B quote minimization: new content should be mimimized with adjacent old content -!! options -parsoid=html2wt -!! input -''AB'' - -'''AB''' - -''A'''B''''' -!! result -

        AB

        -

        AB

        -

        AB

        -!! end - -# ----------------------------------------------------------------- -# End of section for Parsoid-only html2wt tests for serialization -# of new content -# ----------------------------------------------------------------- - -TODO: -more images -more tables -character entities -and much more -Try for 100% code coverage diff --git a/tests/parser/parserTestsParserHook.php b/tests/parser/parserTestsParserHook.php deleted file mode 100644 index c8b3e897..00000000 --- a/tests/parser/parserTestsParserHook.php +++ /dev/null @@ -1,66 +0,0 @@ - - */ - -class ParserTestParserHook { - - static function setup( &$parser ) { - $parser->setHook( 'tag', array( __CLASS__, 'dumpHook' ) ); - $parser->setHook( 'statictag', array( __CLASS__, 'staticTagHook' ) ); - return true; - } - - static function dumpHook( $in, $argv ) { - return "
        \n" .
        -			var_export( $in, true ) . "\n" .
        -			var_export( $argv, true ) . "\n" .
        -			"
        "; - } - - static function staticTagHook( $in, $argv, $parser ) { - if ( !count( $argv ) ) { - $parser->static_tag_buf = $in; - return ''; - } elseif ( count( $argv ) === 1 && isset( $argv['action'] ) - && $argv['action'] === 'flush' && $in === null - ) { - // Clear the buffer, we probably don't need to - if ( isset( $parser->static_tag_buf ) ) { - $tmp = $parser->static_tag_buf; - } else { - $tmp = ''; - } - $parser->static_tag_buf = null; - return $tmp; - } else { // wtf? - return - "\nCall this extension as string or as" . - " , not in any other way.\n" . - "text: " . var_export( $in, true ) . "\n" . - "argv: " . var_export( $argv, true ) . "\n"; - } - } -} diff --git a/tests/parser/preprocess/All_system_messages.expected b/tests/parser/preprocess/All_system_messages.expected deleted file mode 100644 index 078d8f0d..00000000 --- a/tests/parser/preprocess/All_system_messages.expected +++ /dev/null @@ -1,5625 +0,0 @@ - - -<table border=1 width=100%><tr><td> -'''Name''' -</td><td> -'''Default text''' -</td><td> -'''Current text''' -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:1movedto2&action=edit 1movedto2]<br> -[[MediaWiki_talk:1movedto2|Talk]] -</td><td> -$1 moved to $2 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Monobook.css&action=edit Monobook.css]<br> -[[MediaWiki_talk:Monobook.css|Talk]] -</td><td> -/* edit this file to customize the monobook skin for the entire site */ -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:About&action=edit about]<br> -[[MediaWiki_talk:About|Talk]] -</td><td> -About -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Aboutpage&action=edit aboutpage]<br> -[[MediaWiki_talk:Aboutpage|Talk]] -</td><td> -Wiktionary:About -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Aboutwikipedia&action=edit aboutwikipedia]<br> -[[MediaWiki_talk:Aboutwikipedia|Talk]] -</td><td> -About Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-addsection&action=edit accesskey-addsection]<br> -[[MediaWiki_talk:Accesskey-addsection|Talk]] -</td><td> -+ -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-anontalk&action=edit accesskey-anontalk]<br> -[[MediaWiki_talk:Accesskey-anontalk|Talk]] -</td><td> -n -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-anonuserpage&action=edit accesskey-anonuserpage]<br> -[[MediaWiki_talk:Accesskey-anonuserpage|Talk]] -</td><td> -. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-article&action=edit accesskey-article]<br> -[[MediaWiki_talk:Accesskey-article|Talk]] -</td><td> -a -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-compareselectedversions&action=edit accesskey-compareselectedversions]<br> -[[MediaWiki_talk:Accesskey-compareselectedversions|Talk]] -</td><td> -v -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-contributions&action=edit accesskey-contributions]<br> -[[MediaWiki_talk:Accesskey-contributions|Talk]] -</td><td> -&amp;lt;accesskey-contributions&amp;gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-currentevents&action=edit accesskey-currentevents]<br> -[[MediaWiki_talk:Accesskey-currentevents|Talk]] -</td><td> -&amp;lt;accesskey-currentevents&amp;gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-delete&action=edit accesskey-delete]<br> -[[MediaWiki_talk:Accesskey-delete|Talk]] -</td><td> -d -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-edit&action=edit accesskey-edit]<br> -[[MediaWiki_talk:Accesskey-edit|Talk]] -</td><td> -e -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-emailuser&action=edit accesskey-emailuser]<br> -[[MediaWiki_talk:Accesskey-emailuser|Talk]] -</td><td> -&amp;lt;accesskey-emailuser&amp;gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-help&action=edit accesskey-help]<br> -[[MediaWiki_talk:Accesskey-help|Talk]] -</td><td> -&amp;lt;accesskey-help&amp;gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-history&action=edit accesskey-history]<br> -[[MediaWiki_talk:Accesskey-history|Talk]] -</td><td> -h -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-login&action=edit accesskey-login]<br> -[[MediaWiki_talk:Accesskey-login|Talk]] -</td><td> -o -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-logout&action=edit accesskey-logout]<br> -[[MediaWiki_talk:Accesskey-logout|Talk]] -</td><td> -o -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-mainpage&action=edit accesskey-mainpage]<br> -[[MediaWiki_talk:Accesskey-mainpage|Talk]] -</td><td> -z -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-minoredit&action=edit accesskey-minoredit]<br> -[[MediaWiki_talk:Accesskey-minoredit|Talk]] -</td><td> -i -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-move&action=edit accesskey-move]<br> -[[MediaWiki_talk:Accesskey-move|Talk]] -</td><td> -m -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-mycontris&action=edit accesskey-mycontris]<br> -[[MediaWiki_talk:Accesskey-mycontris|Talk]] -</td><td> -y -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-mytalk&action=edit accesskey-mytalk]<br> -[[MediaWiki_talk:Accesskey-mytalk|Talk]] -</td><td> -n -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-portal&action=edit accesskey-portal]<br> -[[MediaWiki_talk:Accesskey-portal|Talk]] -</td><td> -&amp;lt;accesskey-portal&amp;gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-preferences&action=edit accesskey-preferences]<br> -[[MediaWiki_talk:Accesskey-preferences|Talk]] -</td><td> -&amp;lt;accesskey-preferences&amp;gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-preview&action=edit accesskey-preview]<br> -[[MediaWiki_talk:Accesskey-preview|Talk]] -</td><td> -p -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-protect&action=edit accesskey-protect]<br> -[[MediaWiki_talk:Accesskey-protect|Talk]] -</td><td> -= -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-randompage&action=edit accesskey-randompage]<br> -[[MediaWiki_talk:Accesskey-randompage|Talk]] -</td><td> -x -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-recentchanges&action=edit accesskey-recentchanges]<br> -[[MediaWiki_talk:Accesskey-recentchanges|Talk]] -</td><td> -r -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-recentchangeslinked&action=edit accesskey-recentchangeslinked]<br> -[[MediaWiki_talk:Accesskey-recentchangeslinked|Talk]] -</td><td> -c -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-save&action=edit accesskey-save]<br> -[[MediaWiki_talk:Accesskey-save|Talk]] -</td><td> -s -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-search&action=edit accesskey-search]<br> -[[MediaWiki_talk:Accesskey-search|Talk]] -</td><td> -f -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-sitesupport&action=edit accesskey-sitesupport]<br> -[[MediaWiki_talk:Accesskey-sitesupport|Talk]] -</td><td> -&amp;lt;accesskey-sitesupport&amp;gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-specialpage&action=edit accesskey-specialpage]<br> -[[MediaWiki_talk:Accesskey-specialpage|Talk]] -</td><td> -&amp;lt;accesskey-specialpage&amp;gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-specialpages&action=edit accesskey-specialpages]<br> -[[MediaWiki_talk:Accesskey-specialpages|Talk]] -</td><td> -q -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-talk&action=edit accesskey-talk]<br> -[[MediaWiki_talk:Accesskey-talk|Talk]] -</td><td> -t -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-undelete&action=edit accesskey-undelete]<br> -[[MediaWiki_talk:Accesskey-undelete|Talk]] -</td><td> -d -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-unwatch&action=edit accesskey-unwatch]<br> -[[MediaWiki_talk:Accesskey-unwatch|Talk]] -</td><td> -w -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-upload&action=edit accesskey-upload]<br> -[[MediaWiki_talk:Accesskey-upload|Talk]] -</td><td> -u -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-userpage&action=edit accesskey-userpage]<br> -[[MediaWiki_talk:Accesskey-userpage|Talk]] -</td><td> -. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-viewsource&action=edit accesskey-viewsource]<br> -[[MediaWiki_talk:Accesskey-viewsource|Talk]] -</td><td> -e -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-watch&action=edit accesskey-watch]<br> -[[MediaWiki_talk:Accesskey-watch|Talk]] -</td><td> -w -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-watchlist&action=edit accesskey-watchlist]<br> -[[MediaWiki_talk:Accesskey-watchlist|Talk]] -</td><td> -l -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-whatlinkshere&action=edit accesskey-whatlinkshere]<br> -[[MediaWiki_talk:Accesskey-whatlinkshere|Talk]] -</td><td> -b -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accmailtext&action=edit accmailtext]<br> -[[MediaWiki_talk:Accmailtext|Talk]] -</td><td> -The Password for &#39;$1&#39; has been sent to $2. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accmailtitle&action=edit accmailtitle]<br> -[[MediaWiki_talk:Accmailtitle|Talk]] -</td><td> -Password sent. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Actioncomplete&action=edit actioncomplete]<br> -[[MediaWiki_talk:Actioncomplete|Talk]] -</td><td> -Action complete -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Addedwatch&action=edit addedwatch]<br> -[[MediaWiki_talk:Addedwatch|Talk]] -</td><td> -Added to watchlist -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Addedwatchtext&action=edit addedwatchtext]<br> -[[MediaWiki_talk:Addedwatchtext|Talk]] -</td><td> -The page &quot;$1&quot; has been added to your &#91;&#91;Special:Watchlist&#124;watchlist]]. -Future changes to this page and its associated Talk page will be listed there, -and the page will appear &#39;&#39;&#39;bolded&#39;&#39;&#39; in the &#91;&#91;Special:Recentchanges&#124;list of recent changes]] to -make it easier to pick out. - -&lt;p&gt;If you want to remove the page from your watchlist later, click &quot;Stop watching&quot; in the sidebar. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Addsection&action=edit addsection]<br> -[[MediaWiki_talk:Addsection|Talk]] -</td><td> -+ -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Administrators&action=edit administrators]<br> -[[MediaWiki_talk:Administrators|Talk]] -</td><td> -Wiktionary:Administrators -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Affirmation&action=edit affirmation]<br> -[[MediaWiki_talk:Affirmation|Talk]] -</td><td> -I affirm that the copyright holder of this file -agrees to license it under the terms of the $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:All&action=edit all]<br> -[[MediaWiki_talk:All|Talk]] -</td><td> -all -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Allmessages&action=edit allmessages]<br> -[[MediaWiki_talk:Allmessages|Talk]] -</td><td> -All system messages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Allmessagestext&action=edit allmessagestext]<br> -[[MediaWiki_talk:Allmessagestext|Talk]] -</td><td> -This is a list of all system messages available in the MediaWiki: namespace. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Allpages&action=edit allpages]<br> -[[MediaWiki_talk:Allpages|Talk]] -</td><td> -All pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Alphaindexline&action=edit alphaindexline]<br> -[[MediaWiki_talk:Alphaindexline|Talk]] -</td><td> -$1 to $2 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Alreadyloggedin&action=edit alreadyloggedin]<br> -[[MediaWiki_talk:Alreadyloggedin|Talk]] -</td><td> -&lt;font color=red&gt;&lt;b&gt;User $1, you are already logged in!&lt;/b&gt;&lt;/font&gt;&lt;br /&gt; - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Alreadyrolled&action=edit alreadyrolled]<br> -[[MediaWiki_talk:Alreadyrolled|Talk]] -</td><td> -Cannot rollback last edit of &#91;&#91;$1]] -by &#91;&#91;User:$2&#124;$2]] (&#91;&#91;User talk:$2&#124;Talk]]); someone else has edited or rolled back the page already. - -Last edit was by &#91;&#91;User:$3&#124;$3]] (&#91;&#91;User talk:$3&#124;Talk]]). -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ancientpages&action=edit ancientpages]<br> -[[MediaWiki_talk:Ancientpages|Talk]] -</td><td> -Oldest pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:And&action=edit and]<br> -[[MediaWiki_talk:And|Talk]] -</td><td> -and -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Anontalk&action=edit anontalk]<br> -[[MediaWiki_talk:Anontalk|Talk]] -</td><td> -Talk for this IP -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Anontalkpagetext&action=edit anontalkpagetext]<br> -[[MediaWiki_talk:Anontalkpagetext|Talk]] -</td><td> -----&#39;&#39;This is the discussion page for an anonymous user who has not created an account yet or who does not use it. We therefore have to use the numerical &#91;&#91;IP address]] to identify him/her. Such an IP address can be shared by several users. If you are an anonymous user and feel that irrelevant comments have been directed at you, please &#91;&#91;Special:Userlogin&#124;create an account or log in]] to avoid future confusion with other anonymous users.&#39;&#39; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Anonymous&action=edit anonymous]<br> -[[MediaWiki_talk:Anonymous|Talk]] -</td><td> -Anonymous user(s) of Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Article&action=edit article]<br> -[[MediaWiki_talk:Article|Talk]] -</td><td> -Content page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Articleexists&action=edit articleexists]<br> -[[MediaWiki_talk:Articleexists|Talk]] -</td><td> -A page of that name already exists, or the -name you have chosen is not valid. -Please choose another name. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Articlepage&action=edit articlepage]<br> -[[MediaWiki_talk:Articlepage|Talk]] -</td><td> -View content page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Asksql&action=edit asksql]<br> -[[MediaWiki_talk:Asksql|Talk]] -</td><td> -SQL query -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Asksqltext&action=edit asksqltext]<br> -[[MediaWiki_talk:Asksqltext|Talk]] -</td><td> -Use the form below to make a direct query of the -database. -Use single quotes (&#39;like this&#39;) to delimit string literals. -This can often add considerable load to the server, so please use -this function sparingly. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Autoblocker&action=edit autoblocker]<br> -[[MediaWiki_talk:Autoblocker|Talk]] -</td><td> -Autoblocked because you share an IP address with &quot;$1&quot;. Reason &quot;$2&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badarticleerror&action=edit badarticleerror]<br> -[[MediaWiki_talk:Badarticleerror|Talk]] -</td><td> -This action cannot be performed on this page. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badfilename&action=edit badfilename]<br> -[[MediaWiki_talk:Badfilename|Talk]] -</td><td> -Image name has been changed to &quot;$1&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badfiletype&action=edit badfiletype]<br> -[[MediaWiki_talk:Badfiletype|Talk]] -</td><td> -&quot;.$1&quot; is not a recommended image file format. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badipaddress&action=edit badipaddress]<br> -[[MediaWiki_talk:Badipaddress|Talk]] -</td><td> -Invalid IP address -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badquery&action=edit badquery]<br> -[[MediaWiki_talk:Badquery|Talk]] -</td><td> -Badly formed search query -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badquerytext&action=edit badquerytext]<br> -[[MediaWiki_talk:Badquerytext|Talk]] -</td><td> -We could not process your query. -This is probably because you have attempted to search for a -word fewer than three letters long, which is not yet supported. -It could also be that you have mistyped the expression, for -example &quot;fish and and scales&quot;. -Please try another query. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badretype&action=edit badretype]<br> -[[MediaWiki_talk:Badretype|Talk]] -</td><td> -The passwords you entered do not match. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badtitle&action=edit badtitle]<br> -[[MediaWiki_talk:Badtitle|Talk]] -</td><td> -Bad title -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badtitletext&action=edit badtitletext]<br> -[[MediaWiki_talk:Badtitletext|Talk]] -</td><td> -The requested page title was invalid, empty, or -an incorrectly linked inter-language or inter-wiki title. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blanknamespace&action=edit blanknamespace]<br> -[[MediaWiki_talk:Blanknamespace|Talk]] -</td><td> -(Main) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockedtext&action=edit blockedtext]<br> -[[MediaWiki_talk:Blockedtext|Talk]] -</td><td> -Your user name or IP address has been blocked by $1. -The reason given is this:&lt;br /&gt;&#39;&#39;$2&#39;&#39;&lt;p&gt;You may contact $1 or one of the other -&#91;&#91;Wiktionary:Administrators&#124;administrators]] to discuss the block. - -Note that you may not use the &quot;email this user&quot; feature unless you have a valid email address registered in your &#91;&#91;Special:Preferences&#124;user preferences]]. - -Your IP address is $3. Please include this address in any queries you make. - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockedtitle&action=edit blockedtitle]<br> -[[MediaWiki_talk:Blockedtitle|Talk]] -</td><td> -User is blocked -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockip&action=edit blockip]<br> -[[MediaWiki_talk:Blockip|Talk]] -</td><td> -Block user -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockipsuccesssub&action=edit blockipsuccesssub]<br> -[[MediaWiki_talk:Blockipsuccesssub|Talk]] -</td><td> -Block succeeded -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockipsuccesstext&action=edit blockipsuccesstext]<br> -[[MediaWiki_talk:Blockipsuccesstext|Talk]] -</td><td> -&quot;$1&quot; has been blocked. -&lt;br /&gt;See &#91;&#91;Special:Ipblocklist&#124;IP block list]] to review blocks. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockiptext&action=edit blockiptext]<br> -[[MediaWiki_talk:Blockiptext|Talk]] -</td><td> -Use the form below to block write access -from a specific IP address or username. -This should be done only only to prevent vandalism, and in -accordance with &#91;&#91;Wiktionary:Policy&#124;policy]]. -Fill in a specific reason below (for example, citing particular -pages that were vandalized). -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklink&action=edit blocklink]<br> -[[MediaWiki_talk:Blocklink|Talk]] -</td><td> -block -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklistline&action=edit blocklistline]<br> -[[MediaWiki_talk:Blocklistline|Talk]] -</td><td> -$1, $2 blocked $3 (expires $4) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklogentry&action=edit blocklogentry]<br> -[[MediaWiki_talk:Blocklogentry|Talk]] -</td><td> -blocked &quot;$1&quot; with an expiry time of $2 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklogpage&action=edit blocklogpage]<br> -[[MediaWiki_talk:Blocklogpage|Talk]] -</td><td> -Block_log -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklogtext&action=edit blocklogtext]<br> -[[MediaWiki_talk:Blocklogtext|Talk]] -</td><td> -This is a log of user blocking and unblocking actions. Automatically -blocked IP addresses are not be listed. See the &#91;&#91;Special:Ipblocklist&#124;IP block list]] for -the list of currently operational bans and blocks. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bold_sample&action=edit bold_sample]<br> -[[MediaWiki_talk:Bold_sample|Talk]] -</td><td> -Bold text -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bold_tip&action=edit bold_tip]<br> -[[MediaWiki_talk:Bold_tip|Talk]] -</td><td> -Bold text -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Booksources&action=edit booksources]<br> -[[MediaWiki_talk:Booksources|Talk]] -</td><td> -Book sources -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Booksourcetext&action=edit booksourcetext]<br> -[[MediaWiki_talk:Booksourcetext|Talk]] -</td><td> -Below is a list of links to other sites that -sell new and used books, and may also have further information -about books you are looking for.Wiktionary is not affiliated with any of these businesses, and -this list should not be construed as an endorsement. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Brokenredirects&action=edit brokenredirects]<br> -[[MediaWiki_talk:Brokenredirects|Talk]] -</td><td> -Broken Redirects -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Brokenredirectstext&action=edit brokenredirectstext]<br> -[[MediaWiki_talk:Brokenredirectstext|Talk]] -</td><td> -The following redirects link to a non-existing pages. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bugreports&action=edit bugreports]<br> -[[MediaWiki_talk:Bugreports|Talk]] -</td><td> -Bug reports -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bugreportspage&action=edit bugreportspage]<br> -[[MediaWiki_talk:Bugreportspage|Talk]] -</td><td> -Wiktionary:Bug_reports -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bureaucratlog&action=edit bureaucratlog]<br> -[[MediaWiki_talk:Bureaucratlog|Talk]] -</td><td> -Bureaucrat_log -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bureaucratlogentry&action=edit bureaucratlogentry]<br> -[[MediaWiki_talk:Bureaucratlogentry|Talk]] -</td><td> -Rights for user &quot;$1&quot; set &quot;$2&quot; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bureaucrattext&action=edit bureaucrattext]<br> -[[MediaWiki_talk:Bureaucrattext|Talk]] -</td><td> -The action you have requested can only be -performed by sysops with &quot;bureaucrat&quot; status. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bureaucrattitle&action=edit bureaucrattitle]<br> -[[MediaWiki_talk:Bureaucrattitle|Talk]] -</td><td> -Bureaucrat access required -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bydate&action=edit bydate]<br> -[[MediaWiki_talk:Bydate|Talk]] -</td><td> -by date -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Byname&action=edit byname]<br> -[[MediaWiki_talk:Byname|Talk]] -</td><td> -by name -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bysize&action=edit bysize]<br> -[[MediaWiki_talk:Bysize|Talk]] -</td><td> -by size -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cachederror&action=edit cachederror]<br> -[[MediaWiki_talk:Cachederror|Talk]] -</td><td> -The following is a cached copy of the requested page, and may not be up to date. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cancel&action=edit cancel]<br> -[[MediaWiki_talk:Cancel|Talk]] -</td><td> -Cancel -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cannotdelete&action=edit cannotdelete]<br> -[[MediaWiki_talk:Cannotdelete|Talk]] -</td><td> -Could not delete the page or image specified. (It may have already been deleted by someone else.) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cantrollback&action=edit cantrollback]<br> -[[MediaWiki_talk:Cantrollback|Talk]] -</td><td> -Cannot revert edit; last contributor is only author of this page. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Categories&action=edit categories]<br> -[[MediaWiki_talk:Categories|Talk]] -</td><td> -Categories -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Category&action=edit category]<br> -[[MediaWiki_talk:Category|Talk]] -</td><td> -category -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Category_header&action=edit category_header]<br> -[[MediaWiki_talk:Category_header|Talk]] -</td><td> -Articles in category &quot;$1&quot; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Changepassword&action=edit changepassword]<br> -[[MediaWiki_talk:Changepassword|Talk]] -</td><td> -Change password -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Changes&action=edit changes]<br> -[[MediaWiki_talk:Changes|Talk]] -</td><td> -changes -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Columns&action=edit columns]<br> -[[MediaWiki_talk:Columns|Talk]] -</td><td> -Columns -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Commentedit&action=edit commentedit]<br> -[[MediaWiki_talk:Commentedit|Talk]] -</td><td> - (comment) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Compareselectedversions&action=edit compareselectedversions]<br> -[[MediaWiki_talk:Compareselectedversions|Talk]] -</td><td> -Compare selected versions -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirm&action=edit confirm]<br> -[[MediaWiki_talk:Confirm|Talk]] -</td><td> -Confirm -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmcheck&action=edit confirmcheck]<br> -[[MediaWiki_talk:Confirmcheck|Talk]] -</td><td> -Yes, I really want to delete this. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmdelete&action=edit confirmdelete]<br> -[[MediaWiki_talk:Confirmdelete|Talk]] -</td><td> -Confirm delete -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmdeletetext&action=edit confirmdeletetext]<br> -[[MediaWiki_talk:Confirmdeletetext|Talk]] -</td><td> -You are about to permanently delete a page -or image along with all of its history from the database. -Please confirm that you intend to do this, that you understand the -consequences, and that you are doing this in accordance with -&#91;&#91;Wiktionary:Policy]]. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmprotect&action=edit confirmprotect]<br> -[[MediaWiki_talk:Confirmprotect|Talk]] -</td><td> -Confirm protection -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmprotecttext&action=edit confirmprotecttext]<br> -[[MediaWiki_talk:Confirmprotecttext|Talk]] -</td><td> -Do you really want to protect this page? -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmunprotect&action=edit confirmunprotect]<br> -[[MediaWiki_talk:Confirmunprotect|Talk]] -</td><td> -Confirm unprotection -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmunprotecttext&action=edit confirmunprotecttext]<br> -[[MediaWiki_talk:Confirmunprotecttext|Talk]] -</td><td> -Do you really want to unprotect this page? -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contextchars&action=edit contextchars]<br> -[[MediaWiki_talk:Contextchars|Talk]] -</td><td> -Characters of context per line -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contextlines&action=edit contextlines]<br> -[[MediaWiki_talk:Contextlines|Talk]] -</td><td> -Lines to show per hit -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contribslink&action=edit contribslink]<br> -[[MediaWiki_talk:Contribslink|Talk]] -</td><td> -contribs -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contribsub&action=edit contribsub]<br> -[[MediaWiki_talk:Contribsub|Talk]] -</td><td> -For $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contributions&action=edit contributions]<br> -[[MediaWiki_talk:Contributions|Talk]] -</td><td> -User contributions -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Copyright&action=edit copyright]<br> -[[MediaWiki_talk:Copyright|Talk]] -</td><td> -Content is available under $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Copyrightpage&action=edit copyrightpage]<br> -[[MediaWiki_talk:Copyrightpage|Talk]] -</td><td> -Wiktionary:Copyrights -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Copyrightpagename&action=edit copyrightpagename]<br> -[[MediaWiki_talk:Copyrightpagename|Talk]] -</td><td> -Wiktionary copyright -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Copyrightwarning&action=edit copyrightwarning]<br> -[[MediaWiki_talk:Copyrightwarning|Talk]] -</td><td> -Please note that all contributions to Wiktionary are -considered to be released under the GNU Free Documentation License -(see $1 for details). -If you don&#39;t want your writing to be edited mercilessly and redistributed -at will, then don&#39;t submit it here.&lt;br /&gt; -You are also promising us that you wrote this yourself, or copied it from a -public domain or similar free resource. -&lt;strong&gt;DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!&lt;/strong&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Couldntremove&action=edit couldntremove]<br> -[[MediaWiki_talk:Couldntremove|Talk]] -</td><td> -Couldn&#39;t remove item &#39;$1&#39;... -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Createaccount&action=edit createaccount]<br> -[[MediaWiki_talk:Createaccount|Talk]] -</td><td> -Create new account -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Createaccountmail&action=edit createaccountmail]<br> -[[MediaWiki_talk:Createaccountmail|Talk]] -</td><td> -by email -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cur&action=edit cur]<br> -[[MediaWiki_talk:Cur|Talk]] -</td><td> -cur -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Currentevents&action=edit currentevents]<br> -[[MediaWiki_talk:Currentevents|Talk]] -</td><td> -Current events -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Currentrev&action=edit currentrev]<br> -[[MediaWiki_talk:Currentrev|Talk]] -</td><td> -Current revision -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Databaseerror&action=edit databaseerror]<br> -[[MediaWiki_talk:Databaseerror|Talk]] -</td><td> -Database error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dateformat&action=edit dateformat]<br> -[[MediaWiki_talk:Dateformat|Talk]] -</td><td> -Date format -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dberrortext&action=edit dberrortext]<br> -[[MediaWiki_talk:Dberrortext|Talk]] -</td><td> -A database query syntax error has occurred. -This could be because of an illegal search query (see $5), -or it may indicate a bug in the software. -The last attempted database query was: -&lt;blockquote&gt;&lt;tt&gt;$1&lt;/tt&gt;&lt;/blockquote&gt; -from within function &quot;&lt;tt&gt;$2&lt;/tt&gt;&quot;. -MySQL returned error &quot;&lt;tt&gt;$3: $4&lt;/tt&gt;&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dberrortextcl&action=edit dberrortextcl]<br> -[[MediaWiki_talk:Dberrortextcl|Talk]] -</td><td> -A database query syntax error has occurred. -The last attempted database query was: -&quot;$1&quot; -from within function &quot;$2&quot;. -MySQL returned error &quot;$3: $4&quot;. - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deadendpages&action=edit deadendpages]<br> -[[MediaWiki_talk:Deadendpages|Talk]] -</td><td> -Dead-end pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Debug&action=edit debug]<br> -[[MediaWiki_talk:Debug|Talk]] -</td><td> -Debug -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Defaultns&action=edit defaultns]<br> -[[MediaWiki_talk:Defaultns|Talk]] -</td><td> -Search in these namespaces by default: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Defemailsubject&action=edit defemailsubject]<br> -[[MediaWiki_talk:Defemailsubject|Talk]] -</td><td> -Wiktionary e-mail -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Delete&action=edit delete]<br> -[[MediaWiki_talk:Delete|Talk]] -</td><td> -Delete -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletecomment&action=edit deletecomment]<br> -[[MediaWiki_talk:Deletecomment|Talk]] -</td><td> -Reason for deletion -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletedarticle&action=edit deletedarticle]<br> -[[MediaWiki_talk:Deletedarticle|Talk]] -</td><td> -deleted &quot;$1&quot; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletedtext&action=edit deletedtext]<br> -[[MediaWiki_talk:Deletedtext|Talk]] -</td><td> -&quot;$1&quot; has been deleted. -See $2 for a record of recent deletions. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deleteimg&action=edit deleteimg]<br> -[[MediaWiki_talk:Deleteimg|Talk]] -</td><td> -del -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletepage&action=edit deletepage]<br> -[[MediaWiki_talk:Deletepage|Talk]] -</td><td> -Delete page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletesub&action=edit deletesub]<br> -[[MediaWiki_talk:Deletesub|Talk]] -</td><td> -(Deleting &quot;$1&quot;) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletethispage&action=edit deletethispage]<br> -[[MediaWiki_talk:Deletethispage|Talk]] -</td><td> -Delete this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletionlog&action=edit deletionlog]<br> -[[MediaWiki_talk:Deletionlog|Talk]] -</td><td> -deletion log -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dellogpage&action=edit dellogpage]<br> -[[MediaWiki_talk:Dellogpage|Talk]] -</td><td> -Deletion_log -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dellogpagetext&action=edit dellogpagetext]<br> -[[MediaWiki_talk:Dellogpagetext|Talk]] -</td><td> -Below is a list of the most recent deletions. -All times shown are server time (UTC). -&lt;ul&gt; -&lt;/ul&gt; - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Developerspheading&action=edit developerspheading]<br> -[[MediaWiki_talk:Developerspheading|Talk]] -</td><td> -For developer use only -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Developertext&action=edit developertext]<br> -[[MediaWiki_talk:Developertext|Talk]] -</td><td> -The action you have requested can only be -performed by users with &quot;developer&quot; status. -See $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Developertitle&action=edit developertitle]<br> -[[MediaWiki_talk:Developertitle|Talk]] -</td><td> -Developer access required -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Diff&action=edit diff]<br> -[[MediaWiki_talk:Diff|Talk]] -</td><td> -diff -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Difference&action=edit difference]<br> -[[MediaWiki_talk:Difference|Talk]] -</td><td> -(Difference between revisions) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Disclaimerpage&action=edit disclaimerpage]<br> -[[MediaWiki_talk:Disclaimerpage|Talk]] -</td><td> -Wiktionary:General_disclaimer -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Disclaimers&action=edit disclaimers]<br> -[[MediaWiki_talk:Disclaimers|Talk]] -</td><td> -Disclaimers -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Doubleredirects&action=edit doubleredirects]<br> -[[MediaWiki_talk:Doubleredirects|Talk]] -</td><td> -Double Redirects -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Doubleredirectstext&action=edit doubleredirectstext]<br> -[[MediaWiki_talk:Doubleredirectstext|Talk]] -</td><td> -&lt;b&gt;Attention:&lt;/b&gt; This list may contain false positives. That usually means there is additional text with links below the first #REDIRECT.&lt;br /&gt; -Each row contains links to the first and second redirect, as well as the first line of the second redirect text, usually giving the &quot;real&quot; target page, which the first redirect should point to. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Edit&action=edit edit]<br> -[[MediaWiki_talk:Edit|Talk]] -</td><td> -Edit -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editcomment&action=edit editcomment]<br> -[[MediaWiki_talk:Editcomment|Talk]] -</td><td> -The edit comment was: &quot;&lt;i&gt;$1&lt;/i&gt;&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editconflict&action=edit editconflict]<br> -[[MediaWiki_talk:Editconflict|Talk]] -</td><td> -Edit conflict: $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editcurrent&action=edit editcurrent]<br> -[[MediaWiki_talk:Editcurrent|Talk]] -</td><td> -Edit the current version of this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Edithelp&action=edit edithelp]<br> -[[MediaWiki_talk:Edithelp|Talk]] -</td><td> -Editing help -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Edithelppage&action=edit edithelppage]<br> -[[MediaWiki_talk:Edithelppage|Talk]] -</td><td> -Help:Editing -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editing&action=edit editing]<br> -[[MediaWiki_talk:Editing|Talk]] -</td><td> -Editing $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editingold&action=edit editingold]<br> -[[MediaWiki_talk:Editingold|Talk]] -</td><td> -&lt;strong&gt;WARNING: You are editing an out-of-date -revision of this page. -If you save it, any changes made since this revision will be lost.&lt;/strong&gt; - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editsection&action=edit editsection]<br> -[[MediaWiki_talk:Editsection|Talk]] -</td><td> -edit -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editthispage&action=edit editthispage]<br> -[[MediaWiki_talk:Editthispage|Talk]] -</td><td> -Edit this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailflag&action=edit emailflag]<br> -[[MediaWiki_talk:Emailflag|Talk]] -</td><td> -Disable e-mail from other users -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailforlost&action=edit emailforlost]<br> -[[MediaWiki_talk:Emailforlost|Talk]] -</td><td> -Fields marked with a star (*) are optional. Storing an email address enables people to contact you through the website without you having to reveal your -email address to them, and it can be used to send you a new password if you forget it.&lt;br /&gt;&lt;br /&gt;Your real name, if you choose to provide it, will be used for giving you attribution for your work. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailfrom&action=edit emailfrom]<br> -[[MediaWiki_talk:Emailfrom|Talk]] -</td><td> -From -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailmessage&action=edit emailmessage]<br> -[[MediaWiki_talk:Emailmessage|Talk]] -</td><td> -Message -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailpage&action=edit emailpage]<br> -[[MediaWiki_talk:Emailpage|Talk]] -</td><td> -E-mail user -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailpagetext&action=edit emailpagetext]<br> -[[MediaWiki_talk:Emailpagetext|Talk]] -</td><td> -If this user has entered a valid e-mail address in -his or her user preferences, the form below will send a single message. -The e-mail address you entered in your user preferences will appear -as the &quot;From&quot; address of the mail, so the recipient will be able -to reply. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailsend&action=edit emailsend]<br> -[[MediaWiki_talk:Emailsend|Talk]] -</td><td> -Send -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailsent&action=edit emailsent]<br> -[[MediaWiki_talk:Emailsent|Talk]] -</td><td> -E-mail sent -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailsenttext&action=edit emailsenttext]<br> -[[MediaWiki_talk:Emailsenttext|Talk]] -</td><td> -Your e-mail message has been sent. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailsubject&action=edit emailsubject]<br> -[[MediaWiki_talk:Emailsubject|Talk]] -</td><td> -Subject -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailto&action=edit emailto]<br> -[[MediaWiki_talk:Emailto|Talk]] -</td><td> -To -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailuser&action=edit emailuser]<br> -[[MediaWiki_talk:Emailuser|Talk]] -</td><td> -E-mail this user -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Enterlockreason&action=edit enterlockreason]<br> -[[MediaWiki_talk:Enterlockreason|Talk]] -</td><td> -Enter a reason for the lock, including an estimate -of when the lock will be released -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Error&action=edit error]<br> -[[MediaWiki_talk:Error|Talk]] -</td><td> -Error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Errorpagetitle&action=edit errorpagetitle]<br> -[[MediaWiki_talk:Errorpagetitle|Talk]] -</td><td> -Error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Exbeforeblank&action=edit exbeforeblank]<br> -[[MediaWiki_talk:Exbeforeblank|Talk]] -</td><td> -content before blanking was: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Exblank&action=edit exblank]<br> -[[MediaWiki_talk:Exblank|Talk]] -</td><td> -page was empty -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Excontent&action=edit excontent]<br> -[[MediaWiki_talk:Excontent|Talk]] -</td><td> -content was: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Explainconflict&action=edit explainconflict]<br> -[[MediaWiki_talk:Explainconflict|Talk]] -</td><td> -Someone else has changed this page since you -started editing it. -The upper text area contains the page text as it currently exists. -Your changes are shown in the lower text area. -You will have to merge your changes into the existing text. -&lt;b&gt;Only&lt;/b&gt; the text in the upper text area will be saved when you -press &quot;Save page&quot;. -&lt;p&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Export&action=edit export]<br> -[[MediaWiki_talk:Export|Talk]] -</td><td> -Export pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Exportcuronly&action=edit exportcuronly]<br> -[[MediaWiki_talk:Exportcuronly|Talk]] -</td><td> -Include only the current revision, not the full history -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Exporttext&action=edit exporttext]<br> -[[MediaWiki_talk:Exporttext|Talk]] -</td><td> -You can export the text and editing history of a particular -page or set of pages wrapped in some XML; this can then be imported into another -wiki running MediaWiki software, transformed, or just kept for your private -amusement. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Extlink_sample&action=edit extlink_sample]<br> -[[MediaWiki_talk:Extlink_sample|Talk]] -</td><td> -http&#58;//www.example.com link title -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Extlink_tip&action=edit extlink_tip]<br> -[[MediaWiki_talk:Extlink_tip|Talk]] -</td><td> -External link (remember http&#58;// prefix) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Faq&action=edit faq]<br> -[[MediaWiki_talk:Faq|Talk]] -</td><td> -FAQ -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Faqpage&action=edit faqpage]<br> -[[MediaWiki_talk:Faqpage|Talk]] -</td><td> -Wiktionary:FAQ -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Feedlinks&action=edit feedlinks]<br> -[[MediaWiki_talk:Feedlinks|Talk]] -</td><td> -Feed: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filecopyerror&action=edit filecopyerror]<br> -[[MediaWiki_talk:Filecopyerror|Talk]] -</td><td> -Could not copy file &quot;$1&quot; to &quot;$2&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filedeleteerror&action=edit filedeleteerror]<br> -[[MediaWiki_talk:Filedeleteerror|Talk]] -</td><td> -Could not delete file &quot;$1&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filedesc&action=edit filedesc]<br> -[[MediaWiki_talk:Filedesc|Talk]] -</td><td> -Summary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filename&action=edit filename]<br> -[[MediaWiki_talk:Filename|Talk]] -</td><td> -Filename -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filenotfound&action=edit filenotfound]<br> -[[MediaWiki_talk:Filenotfound|Talk]] -</td><td> -Could not find file &quot;$1&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filerenameerror&action=edit filerenameerror]<br> -[[MediaWiki_talk:Filerenameerror|Talk]] -</td><td> -Could not rename file &quot;$1&quot; to &quot;$2&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filesource&action=edit filesource]<br> -[[MediaWiki_talk:Filesource|Talk]] -</td><td> -Source -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filestatus&action=edit filestatus]<br> -[[MediaWiki_talk:Filestatus|Talk]] -</td><td> -Copyright status -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Fileuploaded&action=edit fileuploaded]<br> -[[MediaWiki_talk:Fileuploaded|Talk]] -</td><td> -File &quot;$1&quot; uploaded successfully. -Please follow this link: $2 to the description page and fill -in information about the file, such as where it came from, when it was -created and by whom, and anything else you may know about it. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Formerror&action=edit formerror]<br> -[[MediaWiki_talk:Formerror|Talk]] -</td><td> -Error: could not submit form -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Fromwikipedia&action=edit fromwikipedia]<br> -[[MediaWiki_talk:Fromwikipedia|Talk]] -</td><td> -From Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Getimagelist&action=edit getimagelist]<br> -[[MediaWiki_talk:Getimagelist|Talk]] -</td><td> -fetching image list -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Go&action=edit go]<br> -[[MediaWiki_talk:Go|Talk]] -</td><td> -Go -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Googlesearch&action=edit googlesearch]<br> -[[MediaWiki_talk:Googlesearch|Talk]] -</td><td> - -&lt;!-- SiteSearch Google --&gt; -&lt;FORM method=GET action=&quot;http&#58;//www.google.com/search&quot;&gt; -&lt;TABLE bgcolor=&quot;#FFFFFF&quot;&gt;&lt;tr&gt;&lt;td&gt; -&lt;A HREF=&quot;http&#58;//www.google.com/&quot;&gt; -&lt;IMG SRC=&quot;http&#58;//www.google.com/logos/Logo_40wht.gif&quot; -border=&quot;0&quot; ALT=&quot;Google&quot;&gt;&lt;/A&gt; -&lt;/td&gt; -&lt;td&gt; -&lt;INPUT TYPE=text name=q size=31 maxlength=255 value=&quot;$1&quot;&gt; -&lt;INPUT type=submit name=btnG VALUE=&quot;Google Search&quot;&gt; -&lt;font size=-1&gt; -&lt;input type=hidden name=domains value=&quot;http&#58;//tl.wiktionary.org&quot;&gt;&lt;br /&gt;&lt;input type=radio name=sitesearch value=&quot;&quot;&gt; WWW &lt;input type=radio name=sitesearch value=&quot;http&#58;//tl.wiktionary.org&quot; checked&gt; http&#58;//tl.wiktionary.org &lt;br /&gt; -&lt;input type=&#39;hidden&#39; name=&#39;ie&#39; value=&#39;$2&#39;&gt; -&lt;input type=&#39;hidden&#39; name=&#39;oe&#39; value=&#39;$2&#39;&gt; -&lt;/font&gt; -&lt;/td&gt;&lt;/tr&gt;&lt;/TABLE&gt; -&lt;/FORM&gt; -&lt;!-- SiteSearch Google --&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Guesstimezone&action=edit guesstimezone]<br> -[[MediaWiki_talk:Guesstimezone|Talk]] -</td><td> -Fill in from browser -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Headline_sample&action=edit headline_sample]<br> -[[MediaWiki_talk:Headline_sample|Talk]] -</td><td> -Headline text -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Headline_tip&action=edit headline_tip]<br> -[[MediaWiki_talk:Headline_tip|Talk]] -</td><td> -Level 2 headline -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Help&action=edit help]<br> -[[MediaWiki_talk:Help|Talk]] -</td><td> -Help -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Helppage&action=edit helppage]<br> -[[MediaWiki_talk:Helppage|Talk]] -</td><td> -Help:Contents -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Hide&action=edit hide]<br> -[[MediaWiki_talk:Hide|Talk]] -</td><td> -hide -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Hidetoc&action=edit hidetoc]<br> -[[MediaWiki_talk:Hidetoc|Talk]] -</td><td> -hide -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Hist&action=edit hist]<br> -[[MediaWiki_talk:Hist|Talk]] -</td><td> -hist -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Histlegend&action=edit histlegend]<br> -[[MediaWiki_talk:Histlegend|Talk]] -</td><td> -Diff selection: mark the radio boxes of the versions to compare and hit enter or the button at the bottom.&lt;br/&gt; -Legend: (cur) = difference with current version, -(last) = difference with preceding version, M = minor edit. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:History&action=edit history]<br> -[[MediaWiki_talk:History|Talk]] -</td><td> -Page history -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:History_short&action=edit history_short]<br> -[[MediaWiki_talk:History_short|Talk]] -</td><td> -History -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Historywarning&action=edit historywarning]<br> -[[MediaWiki_talk:Historywarning|Talk]] -</td><td> -Warning: The page you are about to delete has a history: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Hr_tip&action=edit hr_tip]<br> -[[MediaWiki_talk:Hr_tip|Talk]] -</td><td> -Horizontal line (use sparingly) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ignorewarning&action=edit ignorewarning]<br> -[[MediaWiki_talk:Ignorewarning|Talk]] -</td><td> -Ignore warning and save file anyway. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ilshowmatch&action=edit ilshowmatch]<br> -[[MediaWiki_talk:Ilshowmatch|Talk]] -</td><td> -Show all images with names matching -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ilsubmit&action=edit ilsubmit]<br> -[[MediaWiki_talk:Ilsubmit|Talk]] -</td><td> -Search -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Image_sample&action=edit image_sample]<br> -[[MediaWiki_talk:Image_sample|Talk]] -</td><td> -Example.jpg -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Image_tip&action=edit image_tip]<br> -[[MediaWiki_talk:Image_tip|Talk]] -</td><td> -Embedded image -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagelinks&action=edit imagelinks]<br> -[[MediaWiki_talk:Imagelinks|Talk]] -</td><td> -Image links -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagelist&action=edit imagelist]<br> -[[MediaWiki_talk:Imagelist|Talk]] -</td><td> -Image list -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagelisttext&action=edit imagelisttext]<br> -[[MediaWiki_talk:Imagelisttext|Talk]] -</td><td> -Below is a list of $1 images sorted $2. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagepage&action=edit imagepage]<br> -[[MediaWiki_talk:Imagepage|Talk]] -</td><td> -View image page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagereverted&action=edit imagereverted]<br> -[[MediaWiki_talk:Imagereverted|Talk]] -</td><td> -Revert to earlier version was successful. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imgdelete&action=edit imgdelete]<br> -[[MediaWiki_talk:Imgdelete|Talk]] -</td><td> -del -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imgdesc&action=edit imgdesc]<br> -[[MediaWiki_talk:Imgdesc|Talk]] -</td><td> -desc -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imghistlegend&action=edit imghistlegend]<br> -[[MediaWiki_talk:Imghistlegend|Talk]] -</td><td> -Legend: (cur) = this is the current image, (del) = delete -this old version, (rev) = revert to this old version. -&lt;br /&gt;&lt;i&gt;Click on date to see image uploaded on that date&lt;/i&gt;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imghistory&action=edit imghistory]<br> -[[MediaWiki_talk:Imghistory|Talk]] -</td><td> -Image history -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imglegend&action=edit imglegend]<br> -[[MediaWiki_talk:Imglegend|Talk]] -</td><td> -Legend: (desc) = show/edit image description. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Import&action=edit import]<br> -[[MediaWiki_talk:Import|Talk]] -</td><td> -Import pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importfailed&action=edit importfailed]<br> -[[MediaWiki_talk:Importfailed|Talk]] -</td><td> -Import failed: $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importhistoryconflict&action=edit importhistoryconflict]<br> -[[MediaWiki_talk:Importhistoryconflict|Talk]] -</td><td> -Conflicting history revision exists (may have imported this page before) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importnotext&action=edit importnotext]<br> -[[MediaWiki_talk:Importnotext|Talk]] -</td><td> -Empty or no text -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importsuccess&action=edit importsuccess]<br> -[[MediaWiki_talk:Importsuccess|Talk]] -</td><td> -Import succeeded! -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importtext&action=edit importtext]<br> -[[MediaWiki_talk:Importtext|Talk]] -</td><td> -Please export the file from the source wiki using the Special:Export utility, save it to your disk and upload it here. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Infobox&action=edit infobox]<br> -[[MediaWiki_talk:Infobox|Talk]] -</td><td> -Click a button to get an example text -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Infobox_alert&action=edit infobox_alert]<br> -[[MediaWiki_talk:Infobox_alert|Talk]] -</td><td> -Please enter the text you want to be formatted.\n It will be shown in the infobox for copy and pasting.\nExample:\n$1\nwill become:\n$2 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Internalerror&action=edit internalerror]<br> -[[MediaWiki_talk:Internalerror|Talk]] -</td><td> -Internal error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Intl&action=edit intl]<br> -[[MediaWiki_talk:Intl|Talk]] -</td><td> -Interlanguage links -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ip_range_invalid&action=edit ip_range_invalid]<br> -[[MediaWiki_talk:Ip_range_invalid|Talk]] -</td><td> -Invalid IP range. - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipaddress&action=edit ipaddress]<br> -[[MediaWiki_talk:Ipaddress|Talk]] -</td><td> -IP Address/username -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipb_expiry_invalid&action=edit ipb_expiry_invalid]<br> -[[MediaWiki_talk:Ipb_expiry_invalid|Talk]] -</td><td> -Expiry time invalid. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipbexpiry&action=edit ipbexpiry]<br> -[[MediaWiki_talk:Ipbexpiry|Talk]] -</td><td> -Expiry -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipblocklist&action=edit ipblocklist]<br> -[[MediaWiki_talk:Ipblocklist|Talk]] -</td><td> -List of blocked IP addresses and usernames -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipbreason&action=edit ipbreason]<br> -[[MediaWiki_talk:Ipbreason|Talk]] -</td><td> -Reason -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipbsubmit&action=edit ipbsubmit]<br> -[[MediaWiki_talk:Ipbsubmit|Talk]] -</td><td> -Block this user -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipusubmit&action=edit ipusubmit]<br> -[[MediaWiki_talk:Ipusubmit|Talk]] -</td><td> -Unblock this address -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipusuccess&action=edit ipusuccess]<br> -[[MediaWiki_talk:Ipusuccess|Talk]] -</td><td> -&quot;$1&quot; unblocked -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Isbn&action=edit isbn]<br> -[[MediaWiki_talk:Isbn|Talk]] -</td><td> -ISBN -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Isredirect&action=edit isredirect]<br> -[[MediaWiki_talk:Isredirect|Talk]] -</td><td> -redirect page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Italic_sample&action=edit italic_sample]<br> -[[MediaWiki_talk:Italic_sample|Talk]] -</td><td> -Italic text -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Italic_tip&action=edit italic_tip]<br> -[[MediaWiki_talk:Italic_tip|Talk]] -</td><td> -Italic text -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Iteminvalidname&action=edit iteminvalidname]<br> -[[MediaWiki_talk:Iteminvalidname|Talk]] -</td><td> -Problem with item &#39;$1&#39;, invalid name... -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Largefile&action=edit largefile]<br> -[[MediaWiki_talk:Largefile|Talk]] -</td><td> -It is recommended that images not exceed 100k in size. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Last&action=edit last]<br> -[[MediaWiki_talk:Last|Talk]] -</td><td> -last -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lastmodified&action=edit lastmodified]<br> -[[MediaWiki_talk:Lastmodified|Talk]] -</td><td> -This page was last modified $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lastmodifiedby&action=edit lastmodifiedby]<br> -[[MediaWiki_talk:Lastmodifiedby|Talk]] -</td><td> -This page was last modified $1 by $2. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lineno&action=edit lineno]<br> -[[MediaWiki_talk:Lineno|Talk]] -</td><td> -Line $1: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Link_sample&action=edit link_sample]<br> -[[MediaWiki_talk:Link_sample|Talk]] -</td><td> -Link title -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Link_tip&action=edit link_tip]<br> -[[MediaWiki_talk:Link_tip|Talk]] -</td><td> -Internal link -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Linklistsub&action=edit linklistsub]<br> -[[MediaWiki_talk:Linklistsub|Talk]] -</td><td> -(List of links) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Linkshere&action=edit linkshere]<br> -[[MediaWiki_talk:Linkshere|Talk]] -</td><td> -The following pages link to here: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Linkstoimage&action=edit linkstoimage]<br> -[[MediaWiki_talk:Linkstoimage|Talk]] -</td><td> -The following pages link to this image: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Linktrail&action=edit linktrail]<br> -[[MediaWiki_talk:Linktrail|Talk]] -</td><td> -/^(&#91;a-z]+)(.*)$/sD -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Listform&action=edit listform]<br> -[[MediaWiki_talk:Listform|Talk]] -</td><td> -list -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Listusers&action=edit listusers]<br> -[[MediaWiki_talk:Listusers|Talk]] -</td><td> -User list -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loadhist&action=edit loadhist]<br> -[[MediaWiki_talk:Loadhist|Talk]] -</td><td> -Loading page history -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loadingrev&action=edit loadingrev]<br> -[[MediaWiki_talk:Loadingrev|Talk]] -</td><td> -loading revision for diff -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Localtime&action=edit localtime]<br> -[[MediaWiki_talk:Localtime|Talk]] -</td><td> -Local time display -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockbtn&action=edit lockbtn]<br> -[[MediaWiki_talk:Lockbtn|Talk]] -</td><td> -Lock database -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockconfirm&action=edit lockconfirm]<br> -[[MediaWiki_talk:Lockconfirm|Talk]] -</td><td> -Yes, I really want to lock the database. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockdb&action=edit lockdb]<br> -[[MediaWiki_talk:Lockdb|Talk]] -</td><td> -Lock database -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockdbsuccesssub&action=edit lockdbsuccesssub]<br> -[[MediaWiki_talk:Lockdbsuccesssub|Talk]] -</td><td> -Database lock succeeded -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockdbsuccesstext&action=edit lockdbsuccesstext]<br> -[[MediaWiki_talk:Lockdbsuccesstext|Talk]] -</td><td> -The database has been locked. -&lt;br /&gt;Remember to remove the lock after your maintenance is complete. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockdbtext&action=edit lockdbtext]<br> -[[MediaWiki_talk:Lockdbtext|Talk]] -</td><td> -Locking the database will suspend the ability of all -users to edit pages, change their preferences, edit their watchlists, and -other things requiring changes in the database. -Please confirm that this is what you intend to do, and that you will -unlock the database when your maintenance is done. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Locknoconfirm&action=edit locknoconfirm]<br> -[[MediaWiki_talk:Locknoconfirm|Talk]] -</td><td> -You did not check the confirmation box. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Login&action=edit login]<br> -[[MediaWiki_talk:Login|Talk]] -</td><td> -Log in -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginend&action=edit loginend]<br> -[[MediaWiki_talk:Loginend|Talk]] -</td><td> -&amp;nbsp; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginerror&action=edit loginerror]<br> -[[MediaWiki_talk:Loginerror|Talk]] -</td><td> -Login error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginpagetitle&action=edit loginpagetitle]<br> -[[MediaWiki_talk:Loginpagetitle|Talk]] -</td><td> -User login -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginproblem&action=edit loginproblem]<br> -[[MediaWiki_talk:Loginproblem|Talk]] -</td><td> -&lt;b&gt;There has been a problem with your login.&lt;/b&gt;&lt;br /&gt;Try again! -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginprompt&action=edit loginprompt]<br> -[[MediaWiki_talk:Loginprompt|Talk]] -</td><td> -You must have cookies enabled to log in to Wiktionary. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginreqtext&action=edit loginreqtext]<br> -[[MediaWiki_talk:Loginreqtext|Talk]] -</td><td> -You must &#91;&#91;special:Userlogin&#124;login]] to view other pages. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginreqtitle&action=edit loginreqtitle]<br> -[[MediaWiki_talk:Loginreqtitle|Talk]] -</td><td> -Login Required -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginsuccess&action=edit loginsuccess]<br> -[[MediaWiki_talk:Loginsuccess|Talk]] -</td><td> -You are now logged in to Wiktionary as &quot;$1&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginsuccesstitle&action=edit loginsuccesstitle]<br> -[[MediaWiki_talk:Loginsuccesstitle|Talk]] -</td><td> -Login successful -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Logout&action=edit logout]<br> -[[MediaWiki_talk:Logout|Talk]] -</td><td> -Log out -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Logouttext&action=edit logouttext]<br> -[[MediaWiki_talk:Logouttext|Talk]] -</td><td> -You are now logged out. -You can continue to use Wiktionary anonymously, or you can log in -again as the same or as a different user. Note that some pages may -continue to be displayed as if you were still logged in, until you clear -your browser cache - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Logouttitle&action=edit logouttitle]<br> -[[MediaWiki_talk:Logouttitle|Talk]] -</td><td> -User logout -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lonelypages&action=edit lonelypages]<br> -[[MediaWiki_talk:Lonelypages|Talk]] -</td><td> -Orphaned pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Longpages&action=edit longpages]<br> -[[MediaWiki_talk:Longpages|Talk]] -</td><td> -Long pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Longpagewarning&action=edit longpagewarning]<br> -[[MediaWiki_talk:Longpagewarning|Talk]] -</td><td> -WARNING: This page is $1 kilobytes long; some -browsers may have problems editing pages approaching or longer than 32kb. -Please consider breaking the page into smaller sections. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mailerror&action=edit mailerror]<br> -[[MediaWiki_talk:Mailerror|Talk]] -</td><td> -Error sending mail: $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mailmypassword&action=edit mailmypassword]<br> -[[MediaWiki_talk:Mailmypassword|Talk]] -</td><td> -Mail me a new password -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mailnologin&action=edit mailnologin]<br> -[[MediaWiki_talk:Mailnologin|Talk]] -</td><td> -No send address -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mailnologintext&action=edit mailnologintext]<br> -[[MediaWiki_talk:Mailnologintext|Talk]] -</td><td> -You must be &lt;a href=&quot;{{localurl:Special:Userlogin&quot;&gt;logged in&lt;/a&gt; -and have a valid e-mail address in your &lt;a href=&quot;/wiki/Special:Preferences&quot;&gt;preferences&lt;/a&gt; -to send e-mail to other users. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mainpage&action=edit mainpage]<br> -[[MediaWiki_talk:Mainpage|Talk]] -</td><td> -Main Page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mainpagedocfooter&action=edit mainpagedocfooter]<br> -[[MediaWiki_talk:Mainpagedocfooter|Talk]] -</td><td> -Please see &#91;http&#58;//meta.wikipedia.org/wiki/MediaWiki_i18n documentation on customizing the interface] -and the &#91;http&#58;//meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User&#39;s Guide] for usage and configuration help. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mainpagetext&action=edit mainpagetext]<br> -[[MediaWiki_talk:Mainpagetext|Talk]] -</td><td> -Wiki software successfully installed. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Maintenance&action=edit maintenance]<br> -[[MediaWiki_talk:Maintenance|Talk]] -</td><td> -Maintenance page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Maintenancebacklink&action=edit maintenancebacklink]<br> -[[MediaWiki_talk:Maintenancebacklink|Talk]] -</td><td> -Back to Maintenance Page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Maintnancepagetext&action=edit maintnancepagetext]<br> -[[MediaWiki_talk:Maintnancepagetext|Talk]] -</td><td> -This page includes several handy tools for everyday maintenance. Some of these functions tend to stress the database, so please do not hit reload after every item you fixed ;-) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysop&action=edit makesysop]<br> -[[MediaWiki_talk:Makesysop|Talk]] -</td><td> -Make a user into a sysop -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysopfail&action=edit makesysopfail]<br> -[[MediaWiki_talk:Makesysopfail|Talk]] -</td><td> -&lt;b&gt;User &quot;$1&quot; could not be made into a sysop. (Did you enter the name correctly?)&lt;/b&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysopname&action=edit makesysopname]<br> -[[MediaWiki_talk:Makesysopname|Talk]] -</td><td> -Name of the user: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysopok&action=edit makesysopok]<br> -[[MediaWiki_talk:Makesysopok|Talk]] -</td><td> -&lt;b&gt;User &quot;$1&quot; is now a sysop&lt;/b&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysopsubmit&action=edit makesysopsubmit]<br> -[[MediaWiki_talk:Makesysopsubmit|Talk]] -</td><td> -Make this user into a sysop -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysoptext&action=edit makesysoptext]<br> -[[MediaWiki_talk:Makesysoptext|Talk]] -</td><td> -This form is used by bureaucrats to turn ordinary users into administrators. -Type the name of the user in the box and press the button to make the user an administrator -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysoptitle&action=edit makesysoptitle]<br> -[[MediaWiki_talk:Makesysoptitle|Talk]] -</td><td> -Make a user into a sysop -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Matchtotals&action=edit matchtotals]<br> -[[MediaWiki_talk:Matchtotals|Talk]] -</td><td> -The query &quot;$1&quot; matched $2 page titles -and the text of $3 pages. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math&action=edit math]<br> -[[MediaWiki_talk:Math|Talk]] -</td><td> -Rendering math -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_bad_output&action=edit math_bad_output]<br> -[[MediaWiki_talk:Math_bad_output|Talk]] -</td><td> -Can&#39;t write to or create math output directory -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_bad_tmpdir&action=edit math_bad_tmpdir]<br> -[[MediaWiki_talk:Math_bad_tmpdir|Talk]] -</td><td> -Can&#39;t write to or create math temp directory -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_failure&action=edit math_failure]<br> -[[MediaWiki_talk:Math_failure|Talk]] -</td><td> -Failed to parse -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_image_error&action=edit math_image_error]<br> -[[MediaWiki_talk:Math_image_error|Talk]] -</td><td> -PNG conversion failed; check for correct installation of latex, dvips, gs, and convert -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_lexing_error&action=edit math_lexing_error]<br> -[[MediaWiki_talk:Math_lexing_error|Talk]] -</td><td> -lexing error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_notexvc&action=edit math_notexvc]<br> -[[MediaWiki_talk:Math_notexvc|Talk]] -</td><td> -Missing texvc executable; please see math/README to configure. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_sample&action=edit math_sample]<br> -[[MediaWiki_talk:Math_sample|Talk]] -</td><td> -Insert formula here -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_syntax_error&action=edit math_syntax_error]<br> -[[MediaWiki_talk:Math_syntax_error|Talk]] -</td><td> -syntax error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_tip&action=edit math_tip]<br> -[[MediaWiki_talk:Math_tip|Talk]] -</td><td> -Mathematical formula (LaTeX) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_unknown_error&action=edit math_unknown_error]<br> -[[MediaWiki_talk:Math_unknown_error|Talk]] -</td><td> -unknown error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_unknown_function&action=edit math_unknown_function]<br> -[[MediaWiki_talk:Math_unknown_function|Talk]] -</td><td> -unknown function -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Media_sample&action=edit media_sample]<br> -[[MediaWiki_talk:Media_sample|Talk]] -</td><td> -Example.mp3 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Media_tip&action=edit media_tip]<br> -[[MediaWiki_talk:Media_tip|Talk]] -</td><td> -Media file link -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Minlength&action=edit minlength]<br> -[[MediaWiki_talk:Minlength|Talk]] -</td><td> -Image names must be at least three letters. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Minoredit&action=edit minoredit]<br> -[[MediaWiki_talk:Minoredit|Talk]] -</td><td> -This is a minor edit -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Minoreditletter&action=edit minoreditletter]<br> -[[MediaWiki_talk:Minoreditletter|Talk]] -</td><td> -M -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mispeelings&action=edit mispeelings]<br> -[[MediaWiki_talk:Mispeelings|Talk]] -</td><td> -Pages with misspellings -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mispeelingspage&action=edit mispeelingspage]<br> -[[MediaWiki_talk:Mispeelingspage|Talk]] -</td><td> -List of common misspellings -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mispeelingstext&action=edit mispeelingstext]<br> -[[MediaWiki_talk:Mispeelingstext|Talk]] -</td><td> -The following pages contain a common misspelling, which are listed on $1. The correct spelling might be given (like this). -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missingarticle&action=edit missingarticle]<br> -[[MediaWiki_talk:Missingarticle|Talk]] -</td><td> -The database did not find the text of a page -that it should have found, named &quot;$1&quot;. - -&lt;p&gt;This is usually caused by following an outdated diff or history link to a -page that has been deleted. - -&lt;p&gt;If this is not the case, you may have found a bug in the software. -Please report this to an administrator, making note of the URL. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missingimage&action=edit missingimage]<br> -[[MediaWiki_talk:Missingimage|Talk]] -</td><td> -&lt;b&gt;Missing image&lt;/b&gt;&lt;br /&gt;&lt;i&gt;$1&lt;/i&gt; - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missinglanguagelinks&action=edit missinglanguagelinks]<br> -[[MediaWiki_talk:Missinglanguagelinks|Talk]] -</td><td> -Missing Language Links -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missinglanguagelinksbutton&action=edit missinglanguagelinksbutton]<br> -[[MediaWiki_talk:Missinglanguagelinksbutton|Talk]] -</td><td> -Find missing language links for -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missinglanguagelinkstext&action=edit missinglanguagelinkstext]<br> -[[MediaWiki_talk:Missinglanguagelinkstext|Talk]] -</td><td> -These pages do &lt;i&gt;not&lt;/i&gt; link to their counterpart in $1. Redirects and subpages are &lt;i&gt;not&lt;/i&gt; shown. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Moredotdotdot&action=edit moredotdotdot]<br> -[[MediaWiki_talk:Moredotdotdot|Talk]] -</td><td> -More... -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Move&action=edit move]<br> -[[MediaWiki_talk:Move|Talk]] -</td><td> -Move -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movearticle&action=edit movearticle]<br> -[[MediaWiki_talk:Movearticle|Talk]] -</td><td> -Move page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movedto&action=edit movedto]<br> -[[MediaWiki_talk:Movedto|Talk]] -</td><td> -moved to -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movenologin&action=edit movenologin]<br> -[[MediaWiki_talk:Movenologin|Talk]] -</td><td> -Not logged in -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movenologintext&action=edit movenologintext]<br> -[[MediaWiki_talk:Movenologintext|Talk]] -</td><td> -You must be a registered user and &lt;a href=&quot;/wiki/Special:Userlogin&quot;&gt;logged in&lt;/a&gt; -to move a page. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movepage&action=edit movepage]<br> -[[MediaWiki_talk:Movepage|Talk]] -</td><td> -Move page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movepagebtn&action=edit movepagebtn]<br> -[[MediaWiki_talk:Movepagebtn|Talk]] -</td><td> -Move page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movepagetalktext&action=edit movepagetalktext]<br> -[[MediaWiki_talk:Movepagetalktext|Talk]] -</td><td> -The associated talk page, if any, will be automatically moved along with it &#39;&#39;&#39;unless:&#39;&#39;&#39; -*You are moving the page across namespaces, -*A non-empty talk page already exists under the new name, or -*You uncheck the box below. - -In those cases, you will have to move or merge the page manually if desired. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movepagetext&action=edit movepagetext]<br> -[[MediaWiki_talk:Movepagetext|Talk]] -</td><td> -Using the form below will rename a page, moving all -of its history to the new name. -The old title will become a redirect page to the new title. -Links to the old page title will not be changed; be sure to -&#91;&#91;Special:Maintenance&#124;check]] for double or broken redirects. -You are responsible for making sure that links continue to -point where they are supposed to go. - -Note that the page will &#39;&#39;&#39;not&#39;&#39;&#39; be moved if there is already -a page at the new title, unless it is empty or a redirect and has no -past edit history. This means that you can rename a page back to where -it was just renamed from if you make a mistake, and you cannot overwrite -an existing page. - -&lt;b&gt;WARNING!&lt;/b&gt; -This can be a drastic and unexpected change for a popular page; -please be sure you understand the consequences of this before -proceeding. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movetalk&action=edit movetalk]<br> -[[MediaWiki_talk:Movetalk|Talk]] -</td><td> -Move &quot;talk&quot; page as well, if applicable. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movethispage&action=edit movethispage]<br> -[[MediaWiki_talk:Movethispage|Talk]] -</td><td> -Move this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mycontris&action=edit mycontris]<br> -[[MediaWiki_talk:Mycontris|Talk]] -</td><td> -My contributions -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mypage&action=edit mypage]<br> -[[MediaWiki_talk:Mypage|Talk]] -</td><td> -My page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mytalk&action=edit mytalk]<br> -[[MediaWiki_talk:Mytalk|Talk]] -</td><td> -My talk -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Navigation&action=edit navigation]<br> -[[MediaWiki_talk:Navigation|Talk]] -</td><td> -Navigation -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nbytes&action=edit nbytes]<br> -[[MediaWiki_talk:Nbytes|Talk]] -</td><td> -$1 bytes -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nchanges&action=edit nchanges]<br> -[[MediaWiki_talk:Nchanges|Talk]] -</td><td> -$1 changes -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newarticle&action=edit newarticle]<br> -[[MediaWiki_talk:Newarticle|Talk]] -</td><td> -(New) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newarticletext&action=edit newarticletext]<br> -[[MediaWiki_talk:Newarticletext|Talk]] -</td><td> -You&#39;ve followed a link to a page that doesn&#39;t exist yet. -To create the page, start typing in the box below -(see the &#91;&#91;Wiktionary:Help&#124;help page]] for more info). -If you are here by mistake, just click your browser&#39;s &#39;&#39;&#39;back&#39;&#39;&#39; button. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newmessages&action=edit newmessages]<br> -[[MediaWiki_talk:Newmessages|Talk]] -</td><td> -You have $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newmessageslink&action=edit newmessageslink]<br> -[[MediaWiki_talk:Newmessageslink|Talk]] -</td><td> -new messages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newpage&action=edit newpage]<br> -[[MediaWiki_talk:Newpage|Talk]] -</td><td> -New page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newpageletter&action=edit newpageletter]<br> -[[MediaWiki_talk:Newpageletter|Talk]] -</td><td> -N -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newpages&action=edit newpages]<br> -[[MediaWiki_talk:Newpages|Talk]] -</td><td> -New pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newpassword&action=edit newpassword]<br> -[[MediaWiki_talk:Newpassword|Talk]] -</td><td> -New password -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newtitle&action=edit newtitle]<br> -[[MediaWiki_talk:Newtitle|Talk]] -</td><td> -To new title -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newusersonly&action=edit newusersonly]<br> -[[MediaWiki_talk:Newusersonly|Talk]] -</td><td> - (new users only) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Next&action=edit next]<br> -[[MediaWiki_talk:Next|Talk]] -</td><td> -next -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nextn&action=edit nextn]<br> -[[MediaWiki_talk:Nextn|Talk]] -</td><td> -next $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nlinks&action=edit nlinks]<br> -[[MediaWiki_talk:Nlinks|Talk]] -</td><td> -$1 links -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noaffirmation&action=edit noaffirmation]<br> -[[MediaWiki_talk:Noaffirmation|Talk]] -</td><td> -You must affirm that your upload does not violate -any copyrights. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noarticletext&action=edit noarticletext]<br> -[[MediaWiki_talk:Noarticletext|Talk]] -</td><td> -(There is currently no text in this page) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noblockreason&action=edit noblockreason]<br> -[[MediaWiki_talk:Noblockreason|Talk]] -</td><td> -You must supply a reason for the block. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noconnect&action=edit noconnect]<br> -[[MediaWiki_talk:Noconnect|Talk]] -</td><td> -Sorry! The wiki is experiencing some technical difficulties, and cannot contact the database server. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nocontribs&action=edit nocontribs]<br> -[[MediaWiki_talk:Nocontribs|Talk]] -</td><td> -No changes were found matching these criteria. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nocookieslogin&action=edit nocookieslogin]<br> -[[MediaWiki_talk:Nocookieslogin|Talk]] -</td><td> -Wiktionary uses cookies to log in users. You have cookies disabled. Please enable them and try again. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nocookiesnew&action=edit nocookiesnew]<br> -[[MediaWiki_talk:Nocookiesnew|Talk]] -</td><td> -The user account was created, but you are not logged in. Wiktionary uses cookies to log in users. You have cookies disabled. Please enable them, then log in with your new username and password. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nocreativecommons&action=edit nocreativecommons]<br> -[[MediaWiki_talk:Nocreativecommons|Talk]] -</td><td> -Creative Commons RDF metadata disabled for this server. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nodb&action=edit nodb]<br> -[[MediaWiki_talk:Nodb|Talk]] -</td><td> -Could not select database $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nodublincore&action=edit nodublincore]<br> -[[MediaWiki_talk:Nodublincore|Talk]] -</td><td> -Dublin Core RDF metadata disabled for this server. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noemail&action=edit noemail]<br> -[[MediaWiki_talk:Noemail|Talk]] -</td><td> -There is no e-mail address recorded for user &quot;$1&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noemailtext&action=edit noemailtext]<br> -[[MediaWiki_talk:Noemailtext|Talk]] -</td><td> -This user has not specified a valid e-mail address, -or has chosen not to receive e-mail from other users. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noemailtitle&action=edit noemailtitle]<br> -[[MediaWiki_talk:Noemailtitle|Talk]] -</td><td> -No e-mail address -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nogomatch&action=edit nogomatch]<br> -[[MediaWiki_talk:Nogomatch|Talk]] -</td><td> -No page with this exact title exists, trying full text search. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nohistory&action=edit nohistory]<br> -[[MediaWiki_talk:Nohistory|Talk]] -</td><td> -There is no edit history for this page. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nolinkshere&action=edit nolinkshere]<br> -[[MediaWiki_talk:Nolinkshere|Talk]] -</td><td> -No pages link to here. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nolinkstoimage&action=edit nolinkstoimage]<br> -[[MediaWiki_talk:Nolinkstoimage|Talk]] -</td><td> -There are no pages that link to this image. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noname&action=edit noname]<br> -[[MediaWiki_talk:Noname|Talk]] -</td><td> -You have not specified a valid user name. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nonefound&action=edit nonefound]<br> -[[MediaWiki_talk:Nonefound|Talk]] -</td><td> -&lt;strong&gt;Note&lt;/strong&gt;: unsuccessful searches are -often caused by searching for common words like &quot;have&quot; and &quot;from&quot;, -which are not indexed, or by specifying more than one search term (only pages -containing all of the search terms will appear in the result). -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nospecialpagetext&action=edit nospecialpagetext]<br> -[[MediaWiki_talk:Nospecialpagetext|Talk]] -</td><td> -You have requested a special page that is not -recognized by the wiki. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nosuchaction&action=edit nosuchaction]<br> -[[MediaWiki_talk:Nosuchaction|Talk]] -</td><td> -No such action -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nosuchactiontext&action=edit nosuchactiontext]<br> -[[MediaWiki_talk:Nosuchactiontext|Talk]] -</td><td> -The action specified by the URL is not -recognized by the wiki -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nosuchspecialpage&action=edit nosuchspecialpage]<br> -[[MediaWiki_talk:Nosuchspecialpage|Talk]] -</td><td> -No such special page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nosuchuser&action=edit nosuchuser]<br> -[[MediaWiki_talk:Nosuchuser|Talk]] -</td><td> -There is no user by the name &quot;$1&quot;. -Check your spelling, or use the form below to create a new user account. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notacceptable&action=edit notacceptable]<br> -[[MediaWiki_talk:Notacceptable|Talk]] -</td><td> -The wiki server can&#39;t provide data in a format your client can read. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notanarticle&action=edit notanarticle]<br> -[[MediaWiki_talk:Notanarticle|Talk]] -</td><td> -Not a content page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notargettext&action=edit notargettext]<br> -[[MediaWiki_talk:Notargettext|Talk]] -</td><td> -You have not specified a target page or user -to perform this function on. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notargettitle&action=edit notargettitle]<br> -[[MediaWiki_talk:Notargettitle|Talk]] -</td><td> -No target -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Note&action=edit note]<br> -[[MediaWiki_talk:Note|Talk]] -</td><td> -&lt;strong&gt;Note:&lt;/strong&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notextmatches&action=edit notextmatches]<br> -[[MediaWiki_talk:Notextmatches|Talk]] -</td><td> -No page text matches -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notitlematches&action=edit notitlematches]<br> -[[MediaWiki_talk:Notitlematches|Talk]] -</td><td> -No page title matches -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notloggedin&action=edit notloggedin]<br> -[[MediaWiki_talk:Notloggedin|Talk]] -</td><td> -Not logged in -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nowatchlist&action=edit nowatchlist]<br> -[[MediaWiki_talk:Nowatchlist|Talk]] -</td><td> -You have no items on your watchlist. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nowiki_sample&action=edit nowiki_sample]<br> -[[MediaWiki_talk:Nowiki_sample|Talk]] -</td><td> -Insert non-formatted text here -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nowiki_tip&action=edit nowiki_tip]<br> -[[MediaWiki_talk:Nowiki_tip|Talk]] -</td><td> -Ignore wiki formatting -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-category&action=edit nstab-category]<br> -[[MediaWiki_talk:Nstab-category|Talk]] -</td><td> -Category -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-help&action=edit nstab-help]<br> -[[MediaWiki_talk:Nstab-help|Talk]] -</td><td> -Help -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-image&action=edit nstab-image]<br> -[[MediaWiki_talk:Nstab-image|Talk]] -</td><td> -Image -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-main&action=edit nstab-main]<br> -[[MediaWiki_talk:Nstab-main|Talk]] -</td><td> -Article -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-media&action=edit nstab-media]<br> -[[MediaWiki_talk:Nstab-media|Talk]] -</td><td> -Media -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-mediawiki&action=edit nstab-mediawiki]<br> -[[MediaWiki_talk:Nstab-mediawiki|Talk]] -</td><td> -Message -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-special&action=edit nstab-special]<br> -[[MediaWiki_talk:Nstab-special|Talk]] -</td><td> -Special -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-template&action=edit nstab-template]<br> -[[MediaWiki_talk:Nstab-template|Talk]] -</td><td> -Template -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-user&action=edit nstab-user]<br> -[[MediaWiki_talk:Nstab-user|Talk]] -</td><td> -User page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-wp&action=edit nstab-wp]<br> -[[MediaWiki_talk:Nstab-wp|Talk]] -</td><td> -About -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nviews&action=edit nviews]<br> -[[MediaWiki_talk:Nviews|Talk]] -</td><td> -$1 views -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ok&action=edit ok]<br> -[[MediaWiki_talk:Ok|Talk]] -</td><td> -OK -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Oldpassword&action=edit oldpassword]<br> -[[MediaWiki_talk:Oldpassword|Talk]] -</td><td> -Old password -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Orig&action=edit orig]<br> -[[MediaWiki_talk:Orig|Talk]] -</td><td> -orig -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Orphans&action=edit orphans]<br> -[[MediaWiki_talk:Orphans|Talk]] -</td><td> -Orphaned pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Othercontribs&action=edit othercontribs]<br> -[[MediaWiki_talk:Othercontribs|Talk]] -</td><td> -Based on work by $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Otherlanguages&action=edit otherlanguages]<br> -[[MediaWiki_talk:Otherlanguages|Talk]] -</td><td> -Other languages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Pagemovedsub&action=edit pagemovedsub]<br> -[[MediaWiki_talk:Pagemovedsub|Talk]] -</td><td> -Move succeeded -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Pagemovedtext&action=edit pagemovedtext]<br> -[[MediaWiki_talk:Pagemovedtext|Talk]] -</td><td> -Page &quot;&#91;&#91;$1]]&quot; moved to &quot;&#91;&#91;$2]]&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Pagetitle&action=edit pagetitle]<br> -[[MediaWiki_talk:Pagetitle|Talk]] -</td><td> -$1 - Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Passwordremindertext&action=edit passwordremindertext]<br> -[[MediaWiki_talk:Passwordremindertext|Talk]] -</td><td> -Someone (probably you, from IP address $1) -requested that we send you a new Wiktionary login password. -The password for user &quot;$2&quot; is now &quot;$3&quot;. -You should log in and change your password now. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Passwordremindertitle&action=edit passwordremindertitle]<br> -[[MediaWiki_talk:Passwordremindertitle|Talk]] -</td><td> -Password reminder from Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Passwordsent&action=edit passwordsent]<br> -[[MediaWiki_talk:Passwordsent|Talk]] -</td><td> -A new password has been sent to the e-mail address -registered for &quot;$1&quot;. -Please log in again after you receive it. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Perfcached&action=edit perfcached]<br> -[[MediaWiki_talk:Perfcached|Talk]] -</td><td> -The following data is cached and may not be completely up to date: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Perfdisabled&action=edit perfdisabled]<br> -[[MediaWiki_talk:Perfdisabled|Talk]] -</td><td> -Sorry! This feature has been temporarily disabled -because it slows the database down to the point that no one can use -the wiki. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Perfdisabledsub&action=edit perfdisabledsub]<br> -[[MediaWiki_talk:Perfdisabledsub|Talk]] -</td><td> -Here&#39;s a saved copy from $1: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Personaltools&action=edit personaltools]<br> -[[MediaWiki_talk:Personaltools|Talk]] -</td><td> -Personal tools -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Popularpages&action=edit popularpages]<br> -[[MediaWiki_talk:Popularpages|Talk]] -</td><td> -Popular pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Portal&action=edit portal]<br> -[[MediaWiki_talk:Portal|Talk]] -</td><td> -Community portal -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Portal-url&action=edit portal-url]<br> -[[MediaWiki_talk:Portal-url|Talk]] -</td><td> -Wiktionary:Community Portal -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Postcomment&action=edit postcomment]<br> -[[MediaWiki_talk:Postcomment|Talk]] -</td><td> -Post a comment -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Poweredby&action=edit poweredby]<br> -[[MediaWiki_talk:Poweredby|Talk]] -</td><td> -Wiktionary is powered by &#91;http&#58;//www.mediawiki.org/ MediaWiki], an open source wiki engine. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Powersearch&action=edit powersearch]<br> -[[MediaWiki_talk:Powersearch|Talk]] -</td><td> -Search -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Powersearchtext&action=edit powersearchtext]<br> -[[MediaWiki_talk:Powersearchtext|Talk]] -</td><td> - -Search in namespaces :&lt;br /&gt; -$1&lt;br /&gt; -$2 List redirects &amp;nbsp; Search for $3 $9 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Preferences&action=edit preferences]<br> -[[MediaWiki_talk:Preferences|Talk]] -</td><td> -Preferences -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefs-help-userdata&action=edit prefs-help-userdata]<br> -[[MediaWiki_talk:Prefs-help-userdata|Talk]] -</td><td> -* &lt;strong&gt;Real name&lt;/strong&gt; (optional): if you choose to provide it this will be used for giving you attribution for your work.&lt;br/&gt; -* &lt;strong&gt;Email&lt;/strong&gt; (optional): Enables people to contact you through the website without you having to reveal your -email address to them, and it can be used to send you a new password if you forget it. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefs-misc&action=edit prefs-misc]<br> -[[MediaWiki_talk:Prefs-misc|Talk]] -</td><td> -Misc settings -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefs-personal&action=edit prefs-personal]<br> -[[MediaWiki_talk:Prefs-personal|Talk]] -</td><td> -User data -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefs-rc&action=edit prefs-rc]<br> -[[MediaWiki_talk:Prefs-rc|Talk]] -</td><td> -Recent changes and stub display -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefslogintext&action=edit prefslogintext]<br> -[[MediaWiki_talk:Prefslogintext|Talk]] -</td><td> -You are logged in as &quot;$1&quot;. -Your internal ID number is $2. - -See &#91;&#91;Wiktionary:User preferences help]] for help deciphering the options. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefsnologin&action=edit prefsnologin]<br> -[[MediaWiki_talk:Prefsnologin|Talk]] -</td><td> -Not logged in -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefsnologintext&action=edit prefsnologintext]<br> -[[MediaWiki_talk:Prefsnologintext|Talk]] -</td><td> -You must be &lt;a href=&quot;/wiki/Special:Userlogin&quot;&gt;logged in&lt;/a&gt; -to set user preferences. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefsreset&action=edit prefsreset]<br> -[[MediaWiki_talk:Prefsreset|Talk]] -</td><td> -Preferences have been reset from storage. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Preview&action=edit preview]<br> -[[MediaWiki_talk:Preview|Talk]] -</td><td> -Preview -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Previewconflict&action=edit previewconflict]<br> -[[MediaWiki_talk:Previewconflict|Talk]] -</td><td> -This preview reflects the text in the upper -text editing area as it will appear if you choose to save. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Previewnote&action=edit previewnote]<br> -[[MediaWiki_talk:Previewnote|Talk]] -</td><td> -Remember that this is only a preview, and has not yet been saved! -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prevn&action=edit prevn]<br> -[[MediaWiki_talk:Prevn|Talk]] -</td><td> -previous $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Printableversion&action=edit printableversion]<br> -[[MediaWiki_talk:Printableversion|Talk]] -</td><td> -Printable version -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Printsubtitle&action=edit printsubtitle]<br> -[[MediaWiki_talk:Printsubtitle|Talk]] -</td><td> -(From http&#58;//tl.wiktionary.org) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protect&action=edit protect]<br> -[[MediaWiki_talk:Protect|Talk]] -</td><td> -Protect -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectcomment&action=edit protectcomment]<br> -[[MediaWiki_talk:Protectcomment|Talk]] -</td><td> -Reason for protecting -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectedarticle&action=edit protectedarticle]<br> -[[MediaWiki_talk:Protectedarticle|Talk]] -</td><td> -protected &#91;&#91;$1]] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectedpage&action=edit protectedpage]<br> -[[MediaWiki_talk:Protectedpage|Talk]] -</td><td> -Protected page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectedpagewarning&action=edit protectedpagewarning]<br> -[[MediaWiki_talk:Protectedpagewarning|Talk]] -</td><td> -WARNING: This page has been locked so that only -users with sysop privileges can edit it. Be sure you are following the -&lt;a href=&#39;/w/wiki.phtml/Wiktionary:Protected_page_guidelines&#39;&gt;protected page -guidelines&lt;/a&gt;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectedtext&action=edit protectedtext]<br> -[[MediaWiki_talk:Protectedtext|Talk]] -</td><td> -This page has been locked to prevent editing; there are -a number of reasons why this may be so, please see -&#91;&#91;Wiktionary:Protected page]]. - -You can view and copy the source of this page: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectlogpage&action=edit protectlogpage]<br> -[[MediaWiki_talk:Protectlogpage|Talk]] -</td><td> -Protection_log -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectlogtext&action=edit protectlogtext]<br> -[[MediaWiki_talk:Protectlogtext|Talk]] -</td><td> -Below is a list of page locks/unlocks. -See &#91;&#91;Wiktionary:Protected page]] for more information. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectpage&action=edit protectpage]<br> -[[MediaWiki_talk:Protectpage|Talk]] -</td><td> -Protect page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectreason&action=edit protectreason]<br> -[[MediaWiki_talk:Protectreason|Talk]] -</td><td> -(give a reason) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectsub&action=edit protectsub]<br> -[[MediaWiki_talk:Protectsub|Talk]] -</td><td> -(Protecting &quot;$1&quot;) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectthispage&action=edit protectthispage]<br> -[[MediaWiki_talk:Protectthispage|Talk]] -</td><td> -Protect this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Proxyblocker&action=edit proxyblocker]<br> -[[MediaWiki_talk:Proxyblocker|Talk]] -</td><td> -Proxy blocker -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Proxyblockreason&action=edit proxyblockreason]<br> -[[MediaWiki_talk:Proxyblockreason|Talk]] -</td><td> -Your IP address has been blocked because it is an open proxy. Please contact your Internet service provider or tech support and inform them of this serious security problem. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Proxyblocksuccess&action=edit proxyblocksuccess]<br> -[[MediaWiki_talk:Proxyblocksuccess|Talk]] -</td><td> -Done. - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbbrowse&action=edit qbbrowse]<br> -[[MediaWiki_talk:Qbbrowse|Talk]] -</td><td> -Browse -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbedit&action=edit qbedit]<br> -[[MediaWiki_talk:Qbedit|Talk]] -</td><td> -Edit -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbfind&action=edit qbfind]<br> -[[MediaWiki_talk:Qbfind|Talk]] -</td><td> -Find -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbmyoptions&action=edit qbmyoptions]<br> -[[MediaWiki_talk:Qbmyoptions|Talk]] -</td><td> -My pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbpageinfo&action=edit qbpageinfo]<br> -[[MediaWiki_talk:Qbpageinfo|Talk]] -</td><td> -Context -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbpageoptions&action=edit qbpageoptions]<br> -[[MediaWiki_talk:Qbpageoptions|Talk]] -</td><td> -This page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbsettings&action=edit qbsettings]<br> -[[MediaWiki_talk:Qbsettings|Talk]] -</td><td> -Quickbar settings -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbspecialpages&action=edit qbspecialpages]<br> -[[MediaWiki_talk:Qbspecialpages|Talk]] -</td><td> -Special pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Querybtn&action=edit querybtn]<br> -[[MediaWiki_talk:Querybtn|Talk]] -</td><td> -Submit query -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Querysuccessful&action=edit querysuccessful]<br> -[[MediaWiki_talk:Querysuccessful|Talk]] -</td><td> -Query successful -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Randompage&action=edit randompage]<br> -[[MediaWiki_talk:Randompage|Talk]] -</td><td> -Random page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Range_block_disabled&action=edit range_block_disabled]<br> -[[MediaWiki_talk:Range_block_disabled|Talk]] -</td><td> -The sysop ability to create range blocks is disabled. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rchide&action=edit rchide]<br> -[[MediaWiki_talk:Rchide|Talk]] -</td><td> -in $4 form; $1 minor edits; $2 secondary namespaces; $3 multiple edits. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rclinks&action=edit rclinks]<br> -[[MediaWiki_talk:Rclinks|Talk]] -</td><td> -Show last $1 changes in last $2 days&lt;br /&gt;$3 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rclistfrom&action=edit rclistfrom]<br> -[[MediaWiki_talk:Rclistfrom|Talk]] -</td><td> -Show new changes starting from $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rcliu&action=edit rcliu]<br> -[[MediaWiki_talk:Rcliu|Talk]] -</td><td> -; $1 edits from logged in users -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rcloaderr&action=edit rcloaderr]<br> -[[MediaWiki_talk:Rcloaderr|Talk]] -</td><td> -Loading recent changes -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rclsub&action=edit rclsub]<br> -[[MediaWiki_talk:Rclsub|Talk]] -</td><td> -(to pages linked from &quot;$1&quot;) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rcnote&action=edit rcnote]<br> -[[MediaWiki_talk:Rcnote|Talk]] -</td><td> -Below are the last &lt;strong&gt;$1&lt;/strong&gt; changes in last &lt;strong&gt;$2&lt;/strong&gt; days. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rcnotefrom&action=edit rcnotefrom]<br> -[[MediaWiki_talk:Rcnotefrom|Talk]] -</td><td> -Below are the changes since &lt;b&gt;$2&lt;/b&gt; (up to &lt;b&gt;$1&lt;/b&gt; shown). -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Readonly&action=edit readonly]<br> -[[MediaWiki_talk:Readonly|Talk]] -</td><td> -Database locked -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Readonlytext&action=edit readonlytext]<br> -[[MediaWiki_talk:Readonlytext|Talk]] -</td><td> -The database is currently locked to new -entries and other modifications, probably for routine database maintenance, -after which it will be back to normal. -The administrator who locked it offered this explanation: -&lt;p&gt;$1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Readonlywarning&action=edit readonlywarning]<br> -[[MediaWiki_talk:Readonlywarning|Talk]] -</td><td> -WARNING: The database has been locked for maintenance, -so you will not be able to save your edits right now. You may wish to cut-n-paste -the text into a text file and save it for later. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Recentchanges&action=edit recentchanges]<br> -[[MediaWiki_talk:Recentchanges|Talk]] -</td><td> -Recent changes -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Recentchangescount&action=edit recentchangescount]<br> -[[MediaWiki_talk:Recentchangescount|Talk]] -</td><td> -Number of titles in recent changes -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Recentchangeslinked&action=edit recentchangeslinked]<br> -[[MediaWiki_talk:Recentchangeslinked|Talk]] -</td><td> -Related changes -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Recentchangestext&action=edit recentchangestext]<br> -[[MediaWiki_talk:Recentchangestext|Talk]] -</td><td> -Track the most recent changes to the wiki on this page. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Redirectedfrom&action=edit redirectedfrom]<br> -[[MediaWiki_talk:Redirectedfrom|Talk]] -</td><td> -(Redirected from $1) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Remembermypassword&action=edit remembermypassword]<br> -[[MediaWiki_talk:Remembermypassword|Talk]] -</td><td> -Remember my password across sessions. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Removechecked&action=edit removechecked]<br> -[[MediaWiki_talk:Removechecked|Talk]] -</td><td> -Remove checked items from watchlist -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Removedwatch&action=edit removedwatch]<br> -[[MediaWiki_talk:Removedwatch|Talk]] -</td><td> -Removed from watchlist -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Removedwatchtext&action=edit removedwatchtext]<br> -[[MediaWiki_talk:Removedwatchtext|Talk]] -</td><td> -The page &quot;$1&quot; has been removed from your watchlist. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Removingchecked&action=edit removingchecked]<br> -[[MediaWiki_talk:Removingchecked|Talk]] -</td><td> -Removing requested items from watchlist... -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Resetprefs&action=edit resetprefs]<br> -[[MediaWiki_talk:Resetprefs|Talk]] -</td><td> -Reset preferences -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Restorelink&action=edit restorelink]<br> -[[MediaWiki_talk:Restorelink|Talk]] -</td><td> -$1 deleted edits -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Resultsperpage&action=edit resultsperpage]<br> -[[MediaWiki_talk:Resultsperpage|Talk]] -</td><td> -Hits to show per page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Retrievedfrom&action=edit retrievedfrom]<br> -[[MediaWiki_talk:Retrievedfrom|Talk]] -</td><td> -Retrieved from &quot;$1&quot; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Returnto&action=edit returnto]<br> -[[MediaWiki_talk:Returnto|Talk]] -</td><td> -Return to $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Retypenew&action=edit retypenew]<br> -[[MediaWiki_talk:Retypenew|Talk]] -</td><td> -Retype new password -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Reupload&action=edit reupload]<br> -[[MediaWiki_talk:Reupload|Talk]] -</td><td> -Re-upload -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Reuploaddesc&action=edit reuploaddesc]<br> -[[MediaWiki_talk:Reuploaddesc|Talk]] -</td><td> -Return to the upload form. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Reverted&action=edit reverted]<br> -[[MediaWiki_talk:Reverted|Talk]] -</td><td> -Reverted to earlier revision -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revertimg&action=edit revertimg]<br> -[[MediaWiki_talk:Revertimg|Talk]] -</td><td> -rev -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revertpage&action=edit revertpage]<br> -[[MediaWiki_talk:Revertpage|Talk]] -</td><td> -Reverted edit of $2, changed back to last version by $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revhistory&action=edit revhistory]<br> -[[MediaWiki_talk:Revhistory|Talk]] -</td><td> -Revision history -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revisionasof&action=edit revisionasof]<br> -[[MediaWiki_talk:Revisionasof|Talk]] -</td><td> -Revision as of $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revnotfound&action=edit revnotfound]<br> -[[MediaWiki_talk:Revnotfound|Talk]] -</td><td> -Revision not found -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revnotfoundtext&action=edit revnotfoundtext]<br> -[[MediaWiki_talk:Revnotfoundtext|Talk]] -</td><td> -The old revision of the page you asked for could not be found. -Please check the URL you used to access this page. - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rfcurl&action=edit rfcurl]<br> -[[MediaWiki_talk:Rfcurl|Talk]] -</td><td> -http&#58;//www.faqs.org/rfcs/rfc$1.html -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rights&action=edit rights]<br> -[[MediaWiki_talk:Rights|Talk]] -</td><td> -Rights: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rollback&action=edit rollback]<br> -[[MediaWiki_talk:Rollback|Talk]] -</td><td> -Roll back edits -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rollback_short&action=edit rollback_short]<br> -[[MediaWiki_talk:Rollback_short|Talk]] -</td><td> -Rollback -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rollbackfailed&action=edit rollbackfailed]<br> -[[MediaWiki_talk:Rollbackfailed|Talk]] -</td><td> -Rollback failed -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rollbacklink&action=edit rollbacklink]<br> -[[MediaWiki_talk:Rollbacklink|Talk]] -</td><td> -rollback -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rows&action=edit rows]<br> -[[MediaWiki_talk:Rows|Talk]] -</td><td> -Rows -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Savearticle&action=edit savearticle]<br> -[[MediaWiki_talk:Savearticle|Talk]] -</td><td> -Save page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Savedprefs&action=edit savedprefs]<br> -[[MediaWiki_talk:Savedprefs|Talk]] -</td><td> -Your preferences have been saved. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Savefile&action=edit savefile]<br> -[[MediaWiki_talk:Savefile|Talk]] -</td><td> -Save file -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Saveprefs&action=edit saveprefs]<br> -[[MediaWiki_talk:Saveprefs|Talk]] -</td><td> -Save preferences -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Search&action=edit search]<br> -[[MediaWiki_talk:Search|Talk]] -</td><td> -Search -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchdisabled&action=edit searchdisabled]<br> -[[MediaWiki_talk:Searchdisabled|Talk]] -</td><td> -&lt;p&gt;Sorry! Full text search has been disabled temporarily, for performance reasons. In the meantime, you can use the Google search below, which may be out of date.&lt;/p&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchhelppage&action=edit searchhelppage]<br> -[[MediaWiki_talk:Searchhelppage|Talk]] -</td><td> -Wiktionary:Searching -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchingwikipedia&action=edit searchingwikipedia]<br> -[[MediaWiki_talk:Searchingwikipedia|Talk]] -</td><td> -Searching Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchquery&action=edit searchquery]<br> -[[MediaWiki_talk:Searchquery|Talk]] -</td><td> -For query &quot;$1&quot; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchresults&action=edit searchresults]<br> -[[MediaWiki_talk:Searchresults|Talk]] -</td><td> -Search results -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchresultshead&action=edit searchresultshead]<br> -[[MediaWiki_talk:Searchresultshead|Talk]] -</td><td> -Search result settings -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchresulttext&action=edit searchresulttext]<br> -[[MediaWiki_talk:Searchresulttext|Talk]] -</td><td> -For more information about searching Wiktionary, see $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sectionedit&action=edit sectionedit]<br> -[[MediaWiki_talk:Sectionedit|Talk]] -</td><td> - (section) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selectnewerversionfordiff&action=edit selectnewerversionfordiff]<br> -[[MediaWiki_talk:Selectnewerversionfordiff|Talk]] -</td><td> -Select a newer version for comparison -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selectolderversionfordiff&action=edit selectolderversionfordiff]<br> -[[MediaWiki_talk:Selectolderversionfordiff|Talk]] -</td><td> -Select an older version for comparison -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selectonly&action=edit selectonly]<br> -[[MediaWiki_talk:Selectonly|Talk]] -</td><td> -Only read-only queries are allowed. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selflinks&action=edit selflinks]<br> -[[MediaWiki_talk:Selflinks|Talk]] -</td><td> -Pages with Self Links -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selflinkstext&action=edit selflinkstext]<br> -[[MediaWiki_talk:Selflinkstext|Talk]] -</td><td> -The following pages contain a link to themselves, which they should not. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Seriousxhtmlerrors&action=edit seriousxhtmlerrors]<br> -[[MediaWiki_talk:Seriousxhtmlerrors|Talk]] -</td><td> -There were serious xhtml markup errors detected by tidy. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Servertime&action=edit servertime]<br> -[[MediaWiki_talk:Servertime|Talk]] -</td><td> -Server time is now -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Set_rights_fail&action=edit set_rights_fail]<br> -[[MediaWiki_talk:Set_rights_fail|Talk]] -</td><td> -&lt;b&gt;User rights for &quot;$1&quot; could not be set. (Did you enter the name correctly?)&lt;/b&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Set_user_rights&action=edit set_user_rights]<br> -[[MediaWiki_talk:Set_user_rights|Talk]] -</td><td> -Set user rights -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Setbureaucratflag&action=edit setbureaucratflag]<br> -[[MediaWiki_talk:Setbureaucratflag|Talk]] -</td><td> -Set bureaucrat flag -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Shortpages&action=edit shortpages]<br> -[[MediaWiki_talk:Shortpages|Talk]] -</td><td> -Short pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Show&action=edit show]<br> -[[MediaWiki_talk:Show|Talk]] -</td><td> -show -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showhideminor&action=edit showhideminor]<br> -[[MediaWiki_talk:Showhideminor|Talk]] -</td><td> -$1 minor edits &#124; $2 bots &#124; $3 logged in users -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showingresults&action=edit showingresults]<br> -[[MediaWiki_talk:Showingresults|Talk]] -</td><td> -Showing below &lt;b&gt;$1&lt;/b&gt; results starting with #&lt;b&gt;$2&lt;/b&gt;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showingresultsnum&action=edit showingresultsnum]<br> -[[MediaWiki_talk:Showingresultsnum|Talk]] -</td><td> -Showing below &lt;b&gt;$3&lt;/b&gt; results starting with #&lt;b&gt;$2&lt;/b&gt;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showlast&action=edit showlast]<br> -[[MediaWiki_talk:Showlast|Talk]] -</td><td> -Show last $1 images sorted $2. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showpreview&action=edit showpreview]<br> -[[MediaWiki_talk:Showpreview|Talk]] -</td><td> -Show preview -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showtoc&action=edit showtoc]<br> -[[MediaWiki_talk:Showtoc|Talk]] -</td><td> -show -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sig_tip&action=edit sig_tip]<br> -[[MediaWiki_talk:Sig_tip|Talk]] -</td><td> -Your signature with timestamp -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitestats&action=edit sitestats]<br> -[[MediaWiki_talk:Sitestats|Talk]] -</td><td> -Site statistics -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitestatstext&action=edit sitestatstext]<br> -[[MediaWiki_talk:Sitestatstext|Talk]] -</td><td> -There are &#39;&#39;&#39;$1&#39;&#39;&#39; total pages in the database. -This includes &quot;talk&quot; pages, pages about Wiktionary, minimal &quot;stub&quot; -pages, redirects, and others that probably don&#39;t qualify as content pages. -Excluding those, there are &#39;&#39;&#39;$2&#39;&#39;&#39; pages that are probably legitimate -content pages. - -There have been a total of &#39;&#39;&#39;$3&#39;&#39;&#39; page views, and &#39;&#39;&#39;$4&#39;&#39;&#39; page edits -since the wiki was setup. -That comes to &#39;&#39;&#39;$5&#39;&#39;&#39; average edits per page, and &#39;&#39;&#39;$6&#39;&#39;&#39; views per edit. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitesubtitle&action=edit sitesubtitle]<br> -[[MediaWiki_talk:Sitesubtitle|Talk]] -</td><td> -The Free Encyclopedia -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitesupport&action=edit sitesupport]<br> -[[MediaWiki_talk:Sitesupport|Talk]] -</td><td> -Donations -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitetitle&action=edit sitetitle]<br> -[[MediaWiki_talk:Sitetitle|Talk]] -</td><td> -Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Siteuser&action=edit siteuser]<br> -[[MediaWiki_talk:Siteuser|Talk]] -</td><td> -Wiktionary user $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Siteusers&action=edit siteusers]<br> -[[MediaWiki_talk:Siteusers|Talk]] -</td><td> -Wiktionary user(s) $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Skin&action=edit skin]<br> -[[MediaWiki_talk:Skin|Talk]] -</td><td> -Skin -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Spamprotectiontext&action=edit spamprotectiontext]<br> -[[MediaWiki_talk:Spamprotectiontext|Talk]] -</td><td> -The page you wanted to save was blocked by the spam filter. This is probably caused by a link to an external site. - -You might want to check the following regular expression for patterns that are currently blocked: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Spamprotectiontitle&action=edit spamprotectiontitle]<br> -[[MediaWiki_talk:Spamprotectiontitle|Talk]] -</td><td> -Spam protection filter -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Specialpage&action=edit specialpage]<br> -[[MediaWiki_talk:Specialpage|Talk]] -</td><td> -Special Page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Specialpages&action=edit specialpages]<br> -[[MediaWiki_talk:Specialpages|Talk]] -</td><td> -Special pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Spheading&action=edit spheading]<br> -[[MediaWiki_talk:Spheading|Talk]] -</td><td> -Special pages for all users -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sqlislogged&action=edit sqlislogged]<br> -[[MediaWiki_talk:Sqlislogged|Talk]] -</td><td> -Please note that all queries are logged. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sqlquery&action=edit sqlquery]<br> -[[MediaWiki_talk:Sqlquery|Talk]] -</td><td> -Enter query -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Statistics&action=edit statistics]<br> -[[MediaWiki_talk:Statistics|Talk]] -</td><td> -Statistics -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Storedversion&action=edit storedversion]<br> -[[MediaWiki_talk:Storedversion|Talk]] -</td><td> -Stored version -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Stubthreshold&action=edit stubthreshold]<br> -[[MediaWiki_talk:Stubthreshold|Talk]] -</td><td> -Threshold for stub display -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Subcategories&action=edit subcategories]<br> -[[MediaWiki_talk:Subcategories|Talk]] -</td><td> -Subcategories -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Subject&action=edit subject]<br> -[[MediaWiki_talk:Subject|Talk]] -</td><td> -Subject/headline -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Subjectpage&action=edit subjectpage]<br> -[[MediaWiki_talk:Subjectpage|Talk]] -</td><td> -View subject -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Successfulupload&action=edit successfulupload]<br> -[[MediaWiki_talk:Successfulupload|Talk]] -</td><td> -Successful upload -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Summary&action=edit summary]<br> -[[MediaWiki_talk:Summary|Talk]] -</td><td> -Summary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sysopspheading&action=edit sysopspheading]<br> -[[MediaWiki_talk:Sysopspheading|Talk]] -</td><td> -For sysop use only -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sysoptext&action=edit sysoptext]<br> -[[MediaWiki_talk:Sysoptext|Talk]] -</td><td> -The action you have requested can only be -performed by users with &quot;sysop&quot; status. -See $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sysoptitle&action=edit sysoptitle]<br> -[[MediaWiki_talk:Sysoptitle|Talk]] -</td><td> -Sysop access required -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tableform&action=edit tableform]<br> -[[MediaWiki_talk:Tableform|Talk]] -</td><td> -table -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talk&action=edit talk]<br> -[[MediaWiki_talk:Talk|Talk]] -</td><td> -Discussion -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkexists&action=edit talkexists]<br> -[[MediaWiki_talk:Talkexists|Talk]] -</td><td> -The page itself was moved successfully, but the -talk page could not be moved because one already exists at the new -title. Please merge them manually. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkpage&action=edit talkpage]<br> -[[MediaWiki_talk:Talkpage|Talk]] -</td><td> -Discuss this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkpagemoved&action=edit talkpagemoved]<br> -[[MediaWiki_talk:Talkpagemoved|Talk]] -</td><td> -The corresponding talk page was also moved. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkpagenotmoved&action=edit talkpagenotmoved]<br> -[[MediaWiki_talk:Talkpagenotmoved|Talk]] -</td><td> -The corresponding talk page was &lt;strong&gt;not&lt;/strong&gt; moved. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkpagetext&action=edit talkpagetext]<br> -[[MediaWiki_talk:Talkpagetext|Talk]] -</td><td> -&lt;!-- MediaWiki:talkpagetext --&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Textboxsize&action=edit textboxsize]<br> -[[MediaWiki_talk:Textboxsize|Talk]] -</td><td> -Textbox dimensions -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Textmatches&action=edit textmatches]<br> -[[MediaWiki_talk:Textmatches|Talk]] -</td><td> -Page text matches -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Thisisdeleted&action=edit thisisdeleted]<br> -[[MediaWiki_talk:Thisisdeleted|Talk]] -</td><td> -View or restore $1? -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Thumbnail-more&action=edit thumbnail-more]<br> -[[MediaWiki_talk:Thumbnail-more|Talk]] -</td><td> -Enlarge -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Timezonelegend&action=edit timezonelegend]<br> -[[MediaWiki_talk:Timezonelegend|Talk]] -</td><td> -Time zone -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Timezoneoffset&action=edit timezoneoffset]<br> -[[MediaWiki_talk:Timezoneoffset|Talk]] -</td><td> -Offset -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Timezonetext&action=edit timezonetext]<br> -[[MediaWiki_talk:Timezonetext|Talk]] -</td><td> -Enter number of hours your local time differs -from server time (UTC). -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Titlematches&action=edit titlematches]<br> -[[MediaWiki_talk:Titlematches|Talk]] -</td><td> -Article title matches -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Toc&action=edit toc]<br> -[[MediaWiki_talk:Toc|Talk]] -</td><td> -Table of contents -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Toolbox&action=edit toolbox]<br> -[[MediaWiki_talk:Toolbox|Talk]] -</td><td> -Toolbox -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-addsection&action=edit tooltip-addsection]<br> -[[MediaWiki_talk:Tooltip-addsection|Talk]] -</td><td> -Add a comment to this page. &#91;alt-+] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-anontalk&action=edit tooltip-anontalk]<br> -[[MediaWiki_talk:Tooltip-anontalk|Talk]] -</td><td> -Discussion about edits from this ip address &#91;alt-n] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-anonuserpage&action=edit tooltip-anonuserpage]<br> -[[MediaWiki_talk:Tooltip-anonuserpage|Talk]] -</td><td> -The user page for the ip you&#39;re editing as &#91;alt-.] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-article&action=edit tooltip-article]<br> -[[MediaWiki_talk:Tooltip-article|Talk]] -</td><td> -View the content page &#91;alt-a] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-atom&action=edit tooltip-atom]<br> -[[MediaWiki_talk:Tooltip-atom|Talk]] -</td><td> -Atom feed for this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-compareselectedversions&action=edit tooltip-compareselectedversions]<br> -[[MediaWiki_talk:Tooltip-compareselectedversions|Talk]] -</td><td> -See the differences between the two selected versions of this page. &#91;alt-v] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-contributions&action=edit tooltip-contributions]<br> -[[MediaWiki_talk:Tooltip-contributions|Talk]] -</td><td> -View the list of contributions of this user -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-currentevents&action=edit tooltip-currentevents]<br> -[[MediaWiki_talk:Tooltip-currentevents|Talk]] -</td><td> -Find background information on current events -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-delete&action=edit tooltip-delete]<br> -[[MediaWiki_talk:Tooltip-delete|Talk]] -</td><td> -Delete this page &#91;alt-d] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-edit&action=edit tooltip-edit]<br> -[[MediaWiki_talk:Tooltip-edit|Talk]] -</td><td> -You can edit this page. Please use the preview button before saving. &#91;alt-e] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-emailuser&action=edit tooltip-emailuser]<br> -[[MediaWiki_talk:Tooltip-emailuser|Talk]] -</td><td> -Send a mail to this user -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-help&action=edit tooltip-help]<br> -[[MediaWiki_talk:Tooltip-help|Talk]] -</td><td> -The place to find out. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-history&action=edit tooltip-history]<br> -[[MediaWiki_talk:Tooltip-history|Talk]] -</td><td> -Past versions of this page, &#91;alt-h] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-login&action=edit tooltip-login]<br> -[[MediaWiki_talk:Tooltip-login|Talk]] -</td><td> -You are encouraged to log in, it is not mandatory however. &#91;alt-o] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-logout&action=edit tooltip-logout]<br> -[[MediaWiki_talk:Tooltip-logout|Talk]] -</td><td> -Log out &#91;alt-o] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-mainpage&action=edit tooltip-mainpage]<br> -[[MediaWiki_talk:Tooltip-mainpage|Talk]] -</td><td> -Visit the Main Page &#91;alt-z] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-minoredit&action=edit tooltip-minoredit]<br> -[[MediaWiki_talk:Tooltip-minoredit|Talk]] -</td><td> -Mark this as a minor edit &#91;alt-i] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-move&action=edit tooltip-move]<br> -[[MediaWiki_talk:Tooltip-move|Talk]] -</td><td> -Move this page &#91;alt-m] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-mycontris&action=edit tooltip-mycontris]<br> -[[MediaWiki_talk:Tooltip-mycontris|Talk]] -</td><td> -List of my contributions &#91;alt-y] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-mytalk&action=edit tooltip-mytalk]<br> -[[MediaWiki_talk:Tooltip-mytalk|Talk]] -</td><td> -My talk page &#91;alt-n] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-nomove&action=edit tooltip-nomove]<br> -[[MediaWiki_talk:Tooltip-nomove|Talk]] -</td><td> -You don&#39;t have the permissions to move this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-portal&action=edit tooltip-portal]<br> -[[MediaWiki_talk:Tooltip-portal|Talk]] -</td><td> -About the project, what you can do, where to find things -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-preferences&action=edit tooltip-preferences]<br> -[[MediaWiki_talk:Tooltip-preferences|Talk]] -</td><td> -My preferences -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-preview&action=edit tooltip-preview]<br> -[[MediaWiki_talk:Tooltip-preview|Talk]] -</td><td> -Preview your changes, please use this before saving! &#91;alt-p] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-protect&action=edit tooltip-protect]<br> -[[MediaWiki_talk:Tooltip-protect|Talk]] -</td><td> -Protect this page &#91;alt-=] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-randompage&action=edit tooltip-randompage]<br> -[[MediaWiki_talk:Tooltip-randompage|Talk]] -</td><td> -Load a random page &#91;alt-x] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-recentchanges&action=edit tooltip-recentchanges]<br> -[[MediaWiki_talk:Tooltip-recentchanges|Talk]] -</td><td> -The list of recent changes in the wiki. &#91;alt-r] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-recentchangeslinked&action=edit tooltip-recentchangeslinked]<br> -[[MediaWiki_talk:Tooltip-recentchangeslinked|Talk]] -</td><td> -Recent changes in pages linking to this page &#91;alt-c] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-rss&action=edit tooltip-rss]<br> -[[MediaWiki_talk:Tooltip-rss|Talk]] -</td><td> -RSS feed for this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-save&action=edit tooltip-save]<br> -[[MediaWiki_talk:Tooltip-save|Talk]] -</td><td> -Save your changes &#91;alt-s] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-search&action=edit tooltip-search]<br> -[[MediaWiki_talk:Tooltip-search|Talk]] -</td><td> -Search this wiki &#91;alt-f] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-sitesupport&action=edit tooltip-sitesupport]<br> -[[MediaWiki_talk:Tooltip-sitesupport|Talk]] -</td><td> -Support Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-specialpage&action=edit tooltip-specialpage]<br> -[[MediaWiki_talk:Tooltip-specialpage|Talk]] -</td><td> -This is a special page, you can&#39;t edit the page itself. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-specialpages&action=edit tooltip-specialpages]<br> -[[MediaWiki_talk:Tooltip-specialpages|Talk]] -</td><td> -List of all special pages &#91;alt-q] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-talk&action=edit tooltip-talk]<br> -[[MediaWiki_talk:Tooltip-talk|Talk]] -</td><td> -Discussion about the content page &#91;alt-t] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-undelete&action=edit tooltip-undelete]<br> -[[MediaWiki_talk:Tooltip-undelete|Talk]] -</td><td> -Restore the $1 edits done to this page before it was deleted &#91;alt-d] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-unwatch&action=edit tooltip-unwatch]<br> -[[MediaWiki_talk:Tooltip-unwatch|Talk]] -</td><td> -Remove this page from your watchlist &#91;alt-w] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-upload&action=edit tooltip-upload]<br> -[[MediaWiki_talk:Tooltip-upload|Talk]] -</td><td> -Upload images or media files &#91;alt-u] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-userpage&action=edit tooltip-userpage]<br> -[[MediaWiki_talk:Tooltip-userpage|Talk]] -</td><td> -My user page &#91;alt-.] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-viewsource&action=edit tooltip-viewsource]<br> -[[MediaWiki_talk:Tooltip-viewsource|Talk]] -</td><td> -This page is protected. You can view its source. &#91;alt-e] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-watch&action=edit tooltip-watch]<br> -[[MediaWiki_talk:Tooltip-watch|Talk]] -</td><td> -Add this page to your watchlist &#91;alt-w] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-watchlist&action=edit tooltip-watchlist]<br> -[[MediaWiki_talk:Tooltip-watchlist|Talk]] -</td><td> -The list of pages you&#39;re monitoring for changes. &#91;alt-l] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-whatlinkshere&action=edit tooltip-whatlinkshere]<br> -[[MediaWiki_talk:Tooltip-whatlinkshere|Talk]] -</td><td> -List of all wiki pages that link here &#91;alt-b] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uclinks&action=edit uclinks]<br> -[[MediaWiki_talk:Uclinks|Talk]] -</td><td> -View the last $1 changes; view the last $2 days. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ucnote&action=edit ucnote]<br> -[[MediaWiki_talk:Ucnote|Talk]] -</td><td> -Below are this user&#39;s last &lt;b&gt;$1&lt;/b&gt; changes in the last &lt;b&gt;$2&lt;/b&gt; days. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uctop&action=edit uctop]<br> -[[MediaWiki_talk:Uctop|Talk]] -</td><td> - (top) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unblockip&action=edit unblockip]<br> -[[MediaWiki_talk:Unblockip|Talk]] -</td><td> -Unblock user -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unblockiptext&action=edit unblockiptext]<br> -[[MediaWiki_talk:Unblockiptext|Talk]] -</td><td> -Use the form below to restore write access -to a previously blocked IP address or username. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unblocklink&action=edit unblocklink]<br> -[[MediaWiki_talk:Unblocklink|Talk]] -</td><td> -unblock -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unblocklogentry&action=edit unblocklogentry]<br> -[[MediaWiki_talk:Unblocklogentry|Talk]] -</td><td> -unblocked &quot;$1&quot; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undelete&action=edit undelete]<br> -[[MediaWiki_talk:Undelete|Talk]] -</td><td> -Restore deleted page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undelete_short&action=edit undelete_short]<br> -[[MediaWiki_talk:Undelete_short|Talk]] -</td><td> -Undelete $1 edits -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletearticle&action=edit undeletearticle]<br> -[[MediaWiki_talk:Undeletearticle|Talk]] -</td><td> -Restore deleted page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletebtn&action=edit undeletebtn]<br> -[[MediaWiki_talk:Undeletebtn|Talk]] -</td><td> -Restore! -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletedarticle&action=edit undeletedarticle]<br> -[[MediaWiki_talk:Undeletedarticle|Talk]] -</td><td> -restored &quot;$1&quot; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletedtext&action=edit undeletedtext]<br> -[[MediaWiki_talk:Undeletedtext|Talk]] -</td><td> -&#91;&#91;$1]] has been successfully restored. -See &#91;&#91;Wiktionary:Deletion_log]] for a record of recent deletions and restorations. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletehistory&action=edit undeletehistory]<br> -[[MediaWiki_talk:Undeletehistory|Talk]] -</td><td> -If you restore the page, all revisions will be restored to the history. -If a new page with the same name has been created since the deletion, the restored -revisions will appear in the prior history, and the current revision of the live page -will not be automatically replaced. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletepage&action=edit undeletepage]<br> -[[MediaWiki_talk:Undeletepage|Talk]] -</td><td> -View and restore deleted pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletepagetext&action=edit undeletepagetext]<br> -[[MediaWiki_talk:Undeletepagetext|Talk]] -</td><td> -The following pages have been deleted but are still in the archive and -can be restored. The archive may be periodically cleaned out. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeleterevision&action=edit undeleterevision]<br> -[[MediaWiki_talk:Undeleterevision|Talk]] -</td><td> -Deleted revision as of $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeleterevisions&action=edit undeleterevisions]<br> -[[MediaWiki_talk:Undeleterevisions|Talk]] -</td><td> -$1 revisions archived -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unexpected&action=edit unexpected]<br> -[[MediaWiki_talk:Unexpected|Talk]] -</td><td> -Unexpected value: &quot;$1&quot;=&quot;$2&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockbtn&action=edit unlockbtn]<br> -[[MediaWiki_talk:Unlockbtn|Talk]] -</td><td> -Unlock database -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockconfirm&action=edit unlockconfirm]<br> -[[MediaWiki_talk:Unlockconfirm|Talk]] -</td><td> -Yes, I really want to unlock the database. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockdb&action=edit unlockdb]<br> -[[MediaWiki_talk:Unlockdb|Talk]] -</td><td> -Unlock database -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockdbsuccesssub&action=edit unlockdbsuccesssub]<br> -[[MediaWiki_talk:Unlockdbsuccesssub|Talk]] -</td><td> -Database lock removed -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockdbsuccesstext&action=edit unlockdbsuccesstext]<br> -[[MediaWiki_talk:Unlockdbsuccesstext|Talk]] -</td><td> -The database has been unlocked. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockdbtext&action=edit unlockdbtext]<br> -[[MediaWiki_talk:Unlockdbtext|Talk]] -</td><td> -Unlocking the database will restore the ability of all -users to edit pages, change their preferences, edit their watchlists, and -other things requiring changes in the database. -Please confirm that this is what you intend to do. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotect&action=edit unprotect]<br> -[[MediaWiki_talk:Unprotect|Talk]] -</td><td> -Unprotect -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotectcomment&action=edit unprotectcomment]<br> -[[MediaWiki_talk:Unprotectcomment|Talk]] -</td><td> -Reason for unprotecting -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotectedarticle&action=edit unprotectedarticle]<br> -[[MediaWiki_talk:Unprotectedarticle|Talk]] -</td><td> -unprotected &#91;&#91;$1]] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotectsub&action=edit unprotectsub]<br> -[[MediaWiki_talk:Unprotectsub|Talk]] -</td><td> -(Unprotecting &quot;$1&quot;) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotectthispage&action=edit unprotectthispage]<br> -[[MediaWiki_talk:Unprotectthispage|Talk]] -</td><td> -Unprotect this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unusedimages&action=edit unusedimages]<br> -[[MediaWiki_talk:Unusedimages|Talk]] -</td><td> -Unused images -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unusedimagestext&action=edit unusedimagestext]<br> -[[MediaWiki_talk:Unusedimagestext|Talk]] -</td><td> -&lt;p&gt;Please note that other web sites may link to an image with -a direct URL, and so may still be listed here despite being -in active use. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unwatch&action=edit unwatch]<br> -[[MediaWiki_talk:Unwatch|Talk]] -</td><td> -Unwatch -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unwatchthispage&action=edit unwatchthispage]<br> -[[MediaWiki_talk:Unwatchthispage|Talk]] -</td><td> -Stop watching -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Updated&action=edit updated]<br> -[[MediaWiki_talk:Updated|Talk]] -</td><td> -(Updated) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Upload&action=edit upload]<br> -[[MediaWiki_talk:Upload|Talk]] -</td><td> -Upload file -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadbtn&action=edit uploadbtn]<br> -[[MediaWiki_talk:Uploadbtn|Talk]] -</td><td> -Upload file -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploaddisabled&action=edit uploaddisabled]<br> -[[MediaWiki_talk:Uploaddisabled|Talk]] -</td><td> -Sorry, uploading is disabled. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadedfiles&action=edit uploadedfiles]<br> -[[MediaWiki_talk:Uploadedfiles|Talk]] -</td><td> -Uploaded files -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadedimage&action=edit uploadedimage]<br> -[[MediaWiki_talk:Uploadedimage|Talk]] -</td><td> -uploaded &quot;$1&quot; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploaderror&action=edit uploaderror]<br> -[[MediaWiki_talk:Uploaderror|Talk]] -</td><td> -Upload error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadfile&action=edit uploadfile]<br> -[[MediaWiki_talk:Uploadfile|Talk]] -</td><td> -Upload images, sounds, documents etc. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadlink&action=edit uploadlink]<br> -[[MediaWiki_talk:Uploadlink|Talk]] -</td><td> -Upload images -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadlog&action=edit uploadlog]<br> -[[MediaWiki_talk:Uploadlog|Talk]] -</td><td> -upload log -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadlogpage&action=edit uploadlogpage]<br> -[[MediaWiki_talk:Uploadlogpage|Talk]] -</td><td> -Upload_log -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadlogpagetext&action=edit uploadlogpagetext]<br> -[[MediaWiki_talk:Uploadlogpagetext|Talk]] -</td><td> -Below is a list of the most recent file uploads. -All times shown are server time (UTC). -&lt;ul&gt; -&lt;/ul&gt; - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadnologin&action=edit uploadnologin]<br> -[[MediaWiki_talk:Uploadnologin|Talk]] -</td><td> -Not logged in -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadnologintext&action=edit uploadnologintext]<br> -[[MediaWiki_talk:Uploadnologintext|Talk]] -</td><td> -You must be &lt;a href=&quot;/wiki/Special:Userlogin&quot;&gt;logged in&lt;/a&gt; -to upload files. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadtext&action=edit uploadtext]<br> -[[MediaWiki_talk:Uploadtext|Talk]] -</td><td> -&lt;strong&gt;STOP!&lt;/strong&gt; Before you upload here, -make sure to read and follow the &lt;a href=&quot;/wiki/Special:Image_use_policy&quot;&gt;image use policy&lt;/a&gt;. -&lt;p&gt;If a file with the name you are specifying already -exists on the wiki, it&#39;ll be replaced without warning. -So unless you mean to update a file, it&#39;s a good idea -to first check if such a file exists. -&lt;p&gt;To view or search previously uploaded images, -go to the &lt;a href=&quot;/wiki/Special:Imagelist&quot;&gt;list of uploaded images&lt;/a&gt;. -Uploads and deletions are logged on the &lt;a href=&quot;/wiki/Wiktionary:Upload_log&quot;&gt;upload log&lt;/a&gt;. -&lt;/p&gt;&lt;p&gt;Use the form below to upload new image files for use in -illustrating your pages. -On most browsers, you will see a &quot;Browse...&quot; button, which will -bring up your operating system&#39;s standard file open dialog. -Choosing a file will fill the name of that file into the text -field next to the button. -You must also check the box affirming that you are not -violating any copyrights by uploading the file. -Press the &quot;Upload&quot; button to finish the upload. -This may take some time if you have a slow internet connection. -&lt;p&gt;The preferred formats are JPEG for photographic images, PNG -for drawings and other iconic images, and OGG for sounds. -Please name your files descriptively to avoid confusion. -To include the image in a page, use a link in the form -&lt;b&gt;&#91;&#91;Image:file.jpg]]&lt;/b&gt; or &lt;b&gt;&#91;&#91;Image:file.png&#124;alt text]]&lt;/b&gt; -or &lt;b&gt;&#91;&#91;Media:file.ogg]]&lt;/b&gt; for sounds. -&lt;p&gt;Please note that as with wiki pages, others may edit or -delete your uploads if they think it serves the project, and -you may be blocked from uploading if you abuse the system. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadwarning&action=edit uploadwarning]<br> -[[MediaWiki_talk:Uploadwarning|Talk]] -</td><td> -Upload warning -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:User_rights_set&action=edit user_rights_set]<br> -[[MediaWiki_talk:User_rights_set|Talk]] -</td><td> -&lt;b&gt;User rights for &quot;$1&quot; updated&lt;/b&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Usercssjs&action=edit usercssjs]<br> -[[MediaWiki_talk:Usercssjs|Talk]] -</td><td> -&#39;&#39;&#39;Note:&#39;&#39;&#39; After saving, you have to tell your bowser to get the new version: &#39;&#39;&#39;Mozilla:&#39;&#39;&#39; click &#39;&#39;reload&#39;&#39;(or &#39;&#39;ctrl-r&#39;&#39;), &#39;&#39;&#39;IE / Opera:&#39;&#39;&#39; &#39;&#39;ctrl-f5&#39;&#39;, &#39;&#39;&#39;Safari:&#39;&#39;&#39; &#39;&#39;cmd-r&#39;&#39;, &#39;&#39;&#39;Konqueror&#39;&#39;&#39; &#39;&#39;ctrl-r&#39;&#39;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Usercssjsyoucanpreview&action=edit usercssjsyoucanpreview]<br> -[[MediaWiki_talk:Usercssjsyoucanpreview|Talk]] -</td><td> -&lt;strong&gt;Tip:&lt;/strong&gt; Use the &#39;Show preview&#39; button to test your new css/js before saving. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Usercsspreview&action=edit usercsspreview]<br> -[[MediaWiki_talk:Usercsspreview|Talk]] -</td><td> -&#39;&#39;&#39;Remember that you are only previewing your user css, it has not yet been saved!&#39;&#39;&#39; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userexists&action=edit userexists]<br> -[[MediaWiki_talk:Userexists|Talk]] -</td><td> -The user name you entered is already in use. Please choose a different name. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userjspreview&action=edit userjspreview]<br> -[[MediaWiki_talk:Userjspreview|Talk]] -</td><td> -&#39;&#39;&#39;Remember that you are only testing/previewing your user javascript, it has not yet been saved!&#39;&#39;&#39; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userlogin&action=edit userlogin]<br> -[[MediaWiki_talk:Userlogin|Talk]] -</td><td> -Log in -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userlogout&action=edit userlogout]<br> -[[MediaWiki_talk:Userlogout|Talk]] -</td><td> -Log out -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Usermailererror&action=edit usermailererror]<br> -[[MediaWiki_talk:Usermailererror|Talk]] -</td><td> -Mail object returned error: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userpage&action=edit userpage]<br> -[[MediaWiki_talk:Userpage|Talk]] -</td><td> -View user page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userstats&action=edit userstats]<br> -[[MediaWiki_talk:Userstats|Talk]] -</td><td> -User statistics -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userstatstext&action=edit userstatstext]<br> -[[MediaWiki_talk:Userstatstext|Talk]] -</td><td> -There are &#39;&#39;&#39;$1&#39;&#39;&#39; registered users. -&#39;&#39;&#39;$2&#39;&#39;&#39; of these are administrators (see $3). -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Version&action=edit version]<br> -[[MediaWiki_talk:Version|Talk]] -</td><td> -Version -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Viewcount&action=edit viewcount]<br> -[[MediaWiki_talk:Viewcount|Talk]] -</td><td> -This page has been accessed $1 times. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Viewprevnext&action=edit viewprevnext]<br> -[[MediaWiki_talk:Viewprevnext|Talk]] -</td><td> -View ($1) ($2) ($3). -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Viewsource&action=edit viewsource]<br> -[[MediaWiki_talk:Viewsource|Talk]] -</td><td> -View source -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Viewtalkpage&action=edit viewtalkpage]<br> -[[MediaWiki_talk:Viewtalkpage|Talk]] -</td><td> -View discussion -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wantedpages&action=edit wantedpages]<br> -[[MediaWiki_talk:Wantedpages|Talk]] -</td><td> -Wanted pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watch&action=edit watch]<br> -[[MediaWiki_talk:Watch|Talk]] -</td><td> -Watch -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchdetails&action=edit watchdetails]<br> -[[MediaWiki_talk:Watchdetails|Talk]] -</td><td> -($1 pages watched not counting talk pages; -$2 total pages edited since cutoff; -$3... -&lt;a href=&#39;$4&#39;&gt;show and edit complete list&lt;/a&gt;.) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watcheditlist&action=edit watcheditlist]<br> -[[MediaWiki_talk:Watcheditlist|Talk]] -</td><td> -Here&#39;s an alphabetical list of your -watched pages. Check the boxes of pages you want to remove -from your watchlist and click the &#39;remove checked&#39; button -at the bottom of the screen. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchlist&action=edit watchlist]<br> -[[MediaWiki_talk:Watchlist|Talk]] -</td><td> -My watchlist -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchlistcontains&action=edit watchlistcontains]<br> -[[MediaWiki_talk:Watchlistcontains|Talk]] -</td><td> -Your watchlist contains $1 pages. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchlistsub&action=edit watchlistsub]<br> -[[MediaWiki_talk:Watchlistsub|Talk]] -</td><td> -(for user &quot;$1&quot;) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchmethod-list&action=edit watchmethod-list]<br> -[[MediaWiki_talk:Watchmethod-list|Talk]] -</td><td> -checking watched pages for recent edits -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchmethod-recent&action=edit watchmethod-recent]<br> -[[MediaWiki_talk:Watchmethod-recent|Talk]] -</td><td> -checking recent edits for watched pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchnochange&action=edit watchnochange]<br> -[[MediaWiki_talk:Watchnochange|Talk]] -</td><td> -None of your watched items were edited in the time period displayed. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchnologin&action=edit watchnologin]<br> -[[MediaWiki_talk:Watchnologin|Talk]] -</td><td> -Not logged in -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchnologintext&action=edit watchnologintext]<br> -[[MediaWiki_talk:Watchnologintext|Talk]] -</td><td> -You must be &lt;a href=&quot;/wiki/Special:Userlogin&quot;&gt;logged in&lt;/a&gt; -to modify your watchlist. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchthis&action=edit watchthis]<br> -[[MediaWiki_talk:Watchthis|Talk]] -</td><td> -Watch this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchthispage&action=edit watchthispage]<br> -[[MediaWiki_talk:Watchthispage|Talk]] -</td><td> -Watch this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Welcomecreation&action=edit welcomecreation]<br> -[[MediaWiki_talk:Welcomecreation|Talk]] -</td><td> -&lt;h2&gt;Welcome, $1!&lt;/h2&gt;&lt;p&gt;Your account has been created. -Don&#39;t forget to change your Wiktionary preferences. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whatlinkshere&action=edit whatlinkshere]<br> -[[MediaWiki_talk:Whatlinkshere|Talk]] -</td><td> -What links here -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistacctext&action=edit whitelistacctext]<br> -[[MediaWiki_talk:Whitelistacctext|Talk]] -</td><td> -To be allowed to create accounts in this Wiki you have to &#91;&#91;Special:Userlogin&#124;log]] in and have the appropriate permissions. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistacctitle&action=edit whitelistacctitle]<br> -[[MediaWiki_talk:Whitelistacctitle|Talk]] -</td><td> -You are not allowed to create an account -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistedittext&action=edit whitelistedittext]<br> -[[MediaWiki_talk:Whitelistedittext|Talk]] -</td><td> -You have to &#91;&#91;Special:Userlogin&#124;login]] to edit pages. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistedittitle&action=edit whitelistedittitle]<br> -[[MediaWiki_talk:Whitelistedittitle|Talk]] -</td><td> -Login required to edit -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistreadtext&action=edit whitelistreadtext]<br> -[[MediaWiki_talk:Whitelistreadtext|Talk]] -</td><td> -You have to &#91;&#91;Special:Userlogin&#124;login]] to read pages. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistreadtitle&action=edit whitelistreadtitle]<br> -[[MediaWiki_talk:Whitelistreadtitle|Talk]] -</td><td> -Login required to read -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wikipediapage&action=edit wikipediapage]<br> -[[MediaWiki_talk:Wikipediapage|Talk]] -</td><td> -View project page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wikititlesuffix&action=edit wikititlesuffix]<br> -[[MediaWiki_talk:Wikititlesuffix|Talk]] -</td><td> -Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wlnote&action=edit wlnote]<br> -[[MediaWiki_talk:Wlnote|Talk]] -</td><td> -Below are the last $1 changes in the last &lt;b&gt;$2&lt;/b&gt; hours. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wlsaved&action=edit wlsaved]<br> -[[MediaWiki_talk:Wlsaved|Talk]] -</td><td> -This is a saved version of your watchlist. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wlshowlast&action=edit wlshowlast]<br> -[[MediaWiki_talk:Wlshowlast|Talk]] -</td><td> -Show last $1 hours $2 days $3 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wrong_wfQuery_params&action=edit wrong_wfQuery_params]<br> -[[MediaWiki_talk:Wrong_wfQuery_params|Talk]] -</td><td> -Incorrect parameters to wfQuery()&lt;br /&gt; -Function: $1&lt;br /&gt; -Query: $2 - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wrongpassword&action=edit wrongpassword]<br> -[[MediaWiki_talk:Wrongpassword|Talk]] -</td><td> -The password you entered is incorrect. Please try again. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourdiff&action=edit yourdiff]<br> -[[MediaWiki_talk:Yourdiff|Talk]] -</td><td> -Differences -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Youremail&action=edit youremail]<br> -[[MediaWiki_talk:Youremail|Talk]] -</td><td> -Your email* -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourname&action=edit yourname]<br> -[[MediaWiki_talk:Yourname|Talk]] -</td><td> -Your user name -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yournick&action=edit yournick]<br> -[[MediaWiki_talk:Yournick|Talk]] -</td><td> -Your nickname (for signatures) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourpassword&action=edit yourpassword]<br> -[[MediaWiki_talk:Yourpassword|Talk]] -</td><td> -Your password -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourpasswordagain&action=edit yourpasswordagain]<br> -[[MediaWiki_talk:Yourpasswordagain|Talk]] -</td><td> -Retype password -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourrealname&action=edit yourrealname]<br> -[[MediaWiki_talk:Yourrealname|Talk]] -</td><td> -Your real name* -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourtext&action=edit yourtext]<br> -[[MediaWiki_talk:Yourtext|Talk]] -</td><td> -Your text -</td><td> - -</td></tr></table> - - \ No newline at end of file diff --git a/tests/parser/preprocess/All_system_messages.txt b/tests/parser/preprocess/All_system_messages.txt deleted file mode 100644 index 3c30da94..00000000 --- a/tests/parser/preprocess/All_system_messages.txt +++ /dev/null @@ -1,5624 +0,0 @@ -{{int:allmessagestext}} - -
        -'''Name''' - -'''Default text''' - -'''Current text''' -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:1movedto2&action=edit 1movedto2]
        -[[MediaWiki_talk:1movedto2|Talk]] -
        -$1 moved to $2 - -{{int:1movedto2}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Monobook.css&action=edit Monobook.css]
        -[[MediaWiki_talk:Monobook.css|Talk]] -
        -/* edit this file to customize the monobook skin for the entire site */ - -{{int:Monobook.css}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:About&action=edit about]
        -[[MediaWiki_talk:About|Talk]] -
        -About - -{{int:About}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Aboutpage&action=edit aboutpage]
        -[[MediaWiki_talk:Aboutpage|Talk]] -
        -Wiktionary:About - -{{int:Aboutpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Aboutwikipedia&action=edit aboutwikipedia]
        -[[MediaWiki_talk:Aboutwikipedia|Talk]] -
        -About Wiktionary - -{{int:Aboutwikipedia}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-addsection&action=edit accesskey-addsection]
        -[[MediaWiki_talk:Accesskey-addsection|Talk]] -
        -+ - -{{int:Accesskey-addsection}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-anontalk&action=edit accesskey-anontalk]
        -[[MediaWiki_talk:Accesskey-anontalk|Talk]] -
        -n - -{{int:Accesskey-anontalk}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-anonuserpage&action=edit accesskey-anonuserpage]
        -[[MediaWiki_talk:Accesskey-anonuserpage|Talk]] -
        -. - -{{int:Accesskey-anonuserpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-article&action=edit accesskey-article]
        -[[MediaWiki_talk:Accesskey-article|Talk]] -
        -a - -{{int:Accesskey-article}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-compareselectedversions&action=edit accesskey-compareselectedversions]
        -[[MediaWiki_talk:Accesskey-compareselectedversions|Talk]] -
        -v - -{{int:Accesskey-compareselectedversions}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-contributions&action=edit accesskey-contributions]
        -[[MediaWiki_talk:Accesskey-contributions|Talk]] -
        -&lt;accesskey-contributions&gt; - -{{int:Accesskey-contributions}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-currentevents&action=edit accesskey-currentevents]
        -[[MediaWiki_talk:Accesskey-currentevents|Talk]] -
        -&lt;accesskey-currentevents&gt; - -{{int:Accesskey-currentevents}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-delete&action=edit accesskey-delete]
        -[[MediaWiki_talk:Accesskey-delete|Talk]] -
        -d - -{{int:Accesskey-delete}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-edit&action=edit accesskey-edit]
        -[[MediaWiki_talk:Accesskey-edit|Talk]] -
        -e - -{{int:Accesskey-edit}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-emailuser&action=edit accesskey-emailuser]
        -[[MediaWiki_talk:Accesskey-emailuser|Talk]] -
        -&lt;accesskey-emailuser&gt; - -{{int:Accesskey-emailuser}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-help&action=edit accesskey-help]
        -[[MediaWiki_talk:Accesskey-help|Talk]] -
        -&lt;accesskey-help&gt; - -{{int:Accesskey-help}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-history&action=edit accesskey-history]
        -[[MediaWiki_talk:Accesskey-history|Talk]] -
        -h - -{{int:Accesskey-history}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-login&action=edit accesskey-login]
        -[[MediaWiki_talk:Accesskey-login|Talk]] -
        -o - -{{int:Accesskey-login}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-logout&action=edit accesskey-logout]
        -[[MediaWiki_talk:Accesskey-logout|Talk]] -
        -o - -{{int:Accesskey-logout}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-mainpage&action=edit accesskey-mainpage]
        -[[MediaWiki_talk:Accesskey-mainpage|Talk]] -
        -z - -{{int:Accesskey-mainpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-minoredit&action=edit accesskey-minoredit]
        -[[MediaWiki_talk:Accesskey-minoredit|Talk]] -
        -i - -{{int:Accesskey-minoredit}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-move&action=edit accesskey-move]
        -[[MediaWiki_talk:Accesskey-move|Talk]] -
        -m - -{{int:Accesskey-move}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-mycontris&action=edit accesskey-mycontris]
        -[[MediaWiki_talk:Accesskey-mycontris|Talk]] -
        -y - -{{int:Accesskey-mycontris}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-mytalk&action=edit accesskey-mytalk]
        -[[MediaWiki_talk:Accesskey-mytalk|Talk]] -
        -n - -{{int:Accesskey-mytalk}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-portal&action=edit accesskey-portal]
        -[[MediaWiki_talk:Accesskey-portal|Talk]] -
        -&lt;accesskey-portal&gt; - -{{int:Accesskey-portal}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-preferences&action=edit accesskey-preferences]
        -[[MediaWiki_talk:Accesskey-preferences|Talk]] -
        -&lt;accesskey-preferences&gt; - -{{int:Accesskey-preferences}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-preview&action=edit accesskey-preview]
        -[[MediaWiki_talk:Accesskey-preview|Talk]] -
        -p - -{{int:Accesskey-preview}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-protect&action=edit accesskey-protect]
        -[[MediaWiki_talk:Accesskey-protect|Talk]] -
        -= - -{{int:Accesskey-protect}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-randompage&action=edit accesskey-randompage]
        -[[MediaWiki_talk:Accesskey-randompage|Talk]] -
        -x - -{{int:Accesskey-randompage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-recentchanges&action=edit accesskey-recentchanges]
        -[[MediaWiki_talk:Accesskey-recentchanges|Talk]] -
        -r - -{{int:Accesskey-recentchanges}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-recentchangeslinked&action=edit accesskey-recentchangeslinked]
        -[[MediaWiki_talk:Accesskey-recentchangeslinked|Talk]] -
        -c - -{{int:Accesskey-recentchangeslinked}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-save&action=edit accesskey-save]
        -[[MediaWiki_talk:Accesskey-save|Talk]] -
        -s - -{{int:Accesskey-save}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-search&action=edit accesskey-search]
        -[[MediaWiki_talk:Accesskey-search|Talk]] -
        -f - -{{int:Accesskey-search}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-sitesupport&action=edit accesskey-sitesupport]
        -[[MediaWiki_talk:Accesskey-sitesupport|Talk]] -
        -&lt;accesskey-sitesupport&gt; - -{{int:Accesskey-sitesupport}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-specialpage&action=edit accesskey-specialpage]
        -[[MediaWiki_talk:Accesskey-specialpage|Talk]] -
        -&lt;accesskey-specialpage&gt; - -{{int:Accesskey-specialpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-specialpages&action=edit accesskey-specialpages]
        -[[MediaWiki_talk:Accesskey-specialpages|Talk]] -
        -q - -{{int:Accesskey-specialpages}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-talk&action=edit accesskey-talk]
        -[[MediaWiki_talk:Accesskey-talk|Talk]] -
        -t - -{{int:Accesskey-talk}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-undelete&action=edit accesskey-undelete]
        -[[MediaWiki_talk:Accesskey-undelete|Talk]] -
        -d - -{{int:Accesskey-undelete}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-unwatch&action=edit accesskey-unwatch]
        -[[MediaWiki_talk:Accesskey-unwatch|Talk]] -
        -w - -{{int:Accesskey-unwatch}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-upload&action=edit accesskey-upload]
        -[[MediaWiki_talk:Accesskey-upload|Talk]] -
        -u - -{{int:Accesskey-upload}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-userpage&action=edit accesskey-userpage]
        -[[MediaWiki_talk:Accesskey-userpage|Talk]] -
        -. - -{{int:Accesskey-userpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-viewsource&action=edit accesskey-viewsource]
        -[[MediaWiki_talk:Accesskey-viewsource|Talk]] -
        -e - -{{int:Accesskey-viewsource}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-watch&action=edit accesskey-watch]
        -[[MediaWiki_talk:Accesskey-watch|Talk]] -
        -w - -{{int:Accesskey-watch}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-watchlist&action=edit accesskey-watchlist]
        -[[MediaWiki_talk:Accesskey-watchlist|Talk]] -
        -l - -{{int:Accesskey-watchlist}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-whatlinkshere&action=edit accesskey-whatlinkshere]
        -[[MediaWiki_talk:Accesskey-whatlinkshere|Talk]] -
        -b - -{{int:Accesskey-whatlinkshere}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accmailtext&action=edit accmailtext]
        -[[MediaWiki_talk:Accmailtext|Talk]] -
        -The Password for '$1' has been sent to $2. - -{{int:Accmailtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accmailtitle&action=edit accmailtitle]
        -[[MediaWiki_talk:Accmailtitle|Talk]] -
        -Password sent. - -{{int:Accmailtitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Actioncomplete&action=edit actioncomplete]
        -[[MediaWiki_talk:Actioncomplete|Talk]] -
        -Action complete - -{{int:Actioncomplete}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Addedwatch&action=edit addedwatch]
        -[[MediaWiki_talk:Addedwatch|Talk]] -
        -Added to watchlist - -{{int:Addedwatch}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Addedwatchtext&action=edit addedwatchtext]
        -[[MediaWiki_talk:Addedwatchtext|Talk]] -
        -The page "$1" has been added to your [[Special:Watchlist|watchlist]]. -Future changes to this page and its associated Talk page will be listed there, -and the page will appear '''bolded''' in the [[Special:Recentchanges|list of recent changes]] to -make it easier to pick out. - -<p>If you want to remove the page from your watchlist later, click "Stop watching" in the sidebar. - -{{int:Addedwatchtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Addsection&action=edit addsection]
        -[[MediaWiki_talk:Addsection|Talk]] -
        -+ - -{{int:Addsection}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Administrators&action=edit administrators]
        -[[MediaWiki_talk:Administrators|Talk]] -
        -Wiktionary:Administrators - -{{int:Administrators}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Affirmation&action=edit affirmation]
        -[[MediaWiki_talk:Affirmation|Talk]] -
        -I affirm that the copyright holder of this file -agrees to license it under the terms of the $1. - -{{int:Affirmation}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:All&action=edit all]
        -[[MediaWiki_talk:All|Talk]] -
        -all - -{{int:All}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Allmessages&action=edit allmessages]
        -[[MediaWiki_talk:Allmessages|Talk]] -
        -All system messages - -{{int:Allmessages}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Allmessagestext&action=edit allmessagestext]
        -[[MediaWiki_talk:Allmessagestext|Talk]] -
        -This is a list of all system messages available in the MediaWiki: namespace. - -{{int:Allmessagestext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Allpages&action=edit allpages]
        -[[MediaWiki_talk:Allpages|Talk]] -
        -All pages - -{{int:Allpages}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Alphaindexline&action=edit alphaindexline]
        -[[MediaWiki_talk:Alphaindexline|Talk]] -
        -$1 to $2 - -{{int:Alphaindexline}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Alreadyloggedin&action=edit alreadyloggedin]
        -[[MediaWiki_talk:Alreadyloggedin|Talk]] -
        -<font color=red><b>User $1, you are already logged in!</b></font><br /> - - -{{int:Alreadyloggedin}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Alreadyrolled&action=edit alreadyrolled]
        -[[MediaWiki_talk:Alreadyrolled|Talk]] -
        -Cannot rollback last edit of [[$1]] -by [[User:$2|$2]] ([[User talk:$2|Talk]]); someone else has edited or rolled back the page already. - -Last edit was by [[User:$3|$3]] ([[User talk:$3|Talk]]). - -{{int:Alreadyrolled}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ancientpages&action=edit ancientpages]
        -[[MediaWiki_talk:Ancientpages|Talk]] -
        -Oldest pages - -{{int:Ancientpages}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:And&action=edit and]
        -[[MediaWiki_talk:And|Talk]] -
        -and - -{{int:And}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Anontalk&action=edit anontalk]
        -[[MediaWiki_talk:Anontalk|Talk]] -
        -Talk for this IP - -{{int:Anontalk}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Anontalkpagetext&action=edit anontalkpagetext]
        -[[MediaWiki_talk:Anontalkpagetext|Talk]] -
        -----''This is the discussion page for an anonymous user who has not created an account yet or who does not use it. We therefore have to use the numerical [[IP address]] to identify him/her. Such an IP address can be shared by several users. If you are an anonymous user and feel that irrelevant comments have been directed at you, please [[Special:Userlogin|create an account or log in]] to avoid future confusion with other anonymous users.'' - -{{int:Anontalkpagetext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Anonymous&action=edit anonymous]
        -[[MediaWiki_talk:Anonymous|Talk]] -
        -Anonymous user(s) of Wiktionary - -{{int:Anonymous}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Article&action=edit article]
        -[[MediaWiki_talk:Article|Talk]] -
        -Content page - -{{int:Article}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Articleexists&action=edit articleexists]
        -[[MediaWiki_talk:Articleexists|Talk]] -
        -A page of that name already exists, or the -name you have chosen is not valid. -Please choose another name. - -{{int:Articleexists}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Articlepage&action=edit articlepage]
        -[[MediaWiki_talk:Articlepage|Talk]] -
        -View content page - -{{int:Articlepage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Asksql&action=edit asksql]
        -[[MediaWiki_talk:Asksql|Talk]] -
        -SQL query - -{{int:Asksql}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Asksqltext&action=edit asksqltext]
        -[[MediaWiki_talk:Asksqltext|Talk]] -
        -Use the form below to make a direct query of the -database. -Use single quotes ('like this') to delimit string literals. -This can often add considerable load to the server, so please use -this function sparingly. - -{{int:Asksqltext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Autoblocker&action=edit autoblocker]
        -[[MediaWiki_talk:Autoblocker|Talk]] -
        -Autoblocked because you share an IP address with "$1". Reason "$2". - -{{int:Autoblocker}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badarticleerror&action=edit badarticleerror]
        -[[MediaWiki_talk:Badarticleerror|Talk]] -
        -This action cannot be performed on this page. - -{{int:Badarticleerror}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badfilename&action=edit badfilename]
        -[[MediaWiki_talk:Badfilename|Talk]] -
        -Image name has been changed to "$1". - -{{int:Badfilename}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badfiletype&action=edit badfiletype]
        -[[MediaWiki_talk:Badfiletype|Talk]] -
        -".$1" is not a recommended image file format. - -{{int:Badfiletype}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badipaddress&action=edit badipaddress]
        -[[MediaWiki_talk:Badipaddress|Talk]] -
        -Invalid IP address - -{{int:Badipaddress}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badquery&action=edit badquery]
        -[[MediaWiki_talk:Badquery|Talk]] -
        -Badly formed search query - -{{int:Badquery}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badquerytext&action=edit badquerytext]
        -[[MediaWiki_talk:Badquerytext|Talk]] -
        -We could not process your query. -This is probably because you have attempted to search for a -word fewer than three letters long, which is not yet supported. -It could also be that you have mistyped the expression, for -example "fish and and scales". -Please try another query. - -{{int:Badquerytext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badretype&action=edit badretype]
        -[[MediaWiki_talk:Badretype|Talk]] -
        -The passwords you entered do not match. - -{{int:Badretype}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badtitle&action=edit badtitle]
        -[[MediaWiki_talk:Badtitle|Talk]] -
        -Bad title - -{{int:Badtitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badtitletext&action=edit badtitletext]
        -[[MediaWiki_talk:Badtitletext|Talk]] -
        -The requested page title was invalid, empty, or -an incorrectly linked inter-language or inter-wiki title. - -{{int:Badtitletext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blanknamespace&action=edit blanknamespace]
        -[[MediaWiki_talk:Blanknamespace|Talk]] -
        -(Main) - -{{int:Blanknamespace}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockedtext&action=edit blockedtext]
        -[[MediaWiki_talk:Blockedtext|Talk]] -
        -Your user name or IP address has been blocked by $1. -The reason given is this:<br />''$2''<p>You may contact $1 or one of the other -[[Wiktionary:Administrators|administrators]] to discuss the block. - -Note that you may not use the "email this user" feature unless you have a valid email address registered in your [[Special:Preferences|user preferences]]. - -Your IP address is $3. Please include this address in any queries you make. - - -{{int:Blockedtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockedtitle&action=edit blockedtitle]
        -[[MediaWiki_talk:Blockedtitle|Talk]] -
        -User is blocked - -{{int:Blockedtitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockip&action=edit blockip]
        -[[MediaWiki_talk:Blockip|Talk]] -
        -Block user - -{{int:Blockip}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockipsuccesssub&action=edit blockipsuccesssub]
        -[[MediaWiki_talk:Blockipsuccesssub|Talk]] -
        -Block succeeded - -{{int:Blockipsuccesssub}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockipsuccesstext&action=edit blockipsuccesstext]
        -[[MediaWiki_talk:Blockipsuccesstext|Talk]] -
        -"$1" has been blocked. -<br />See [[Special:Ipblocklist|IP block list]] to review blocks. - -{{int:Blockipsuccesstext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockiptext&action=edit blockiptext]
        -[[MediaWiki_talk:Blockiptext|Talk]] -
        -Use the form below to block write access -from a specific IP address or username. -This should be done only only to prevent vandalism, and in -accordance with [[Wiktionary:Policy|policy]]. -Fill in a specific reason below (for example, citing particular -pages that were vandalized). - -{{int:Blockiptext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklink&action=edit blocklink]
        -[[MediaWiki_talk:Blocklink|Talk]] -
        -block - -{{int:Blocklink}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklistline&action=edit blocklistline]
        -[[MediaWiki_talk:Blocklistline|Talk]] -
        -$1, $2 blocked $3 (expires $4) - -{{int:Blocklistline}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklogentry&action=edit blocklogentry]
        -[[MediaWiki_talk:Blocklogentry|Talk]] -
        -blocked "$1" with an expiry time of $2 - -{{int:Blocklogentry}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklogpage&action=edit blocklogpage]
        -[[MediaWiki_talk:Blocklogpage|Talk]] -
        -Block_log - -{{int:Blocklogpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklogtext&action=edit blocklogtext]
        -[[MediaWiki_talk:Blocklogtext|Talk]] -
        -This is a log of user blocking and unblocking actions. Automatically -blocked IP addresses are not be listed. See the [[Special:Ipblocklist|IP block list]] for -the list of currently operational bans and blocks. - -{{int:Blocklogtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bold_sample&action=edit bold_sample]
        -[[MediaWiki_talk:Bold_sample|Talk]] -
        -Bold text - -{{int:Bold_sample}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bold_tip&action=edit bold_tip]
        -[[MediaWiki_talk:Bold_tip|Talk]] -
        -Bold text - -{{int:Bold_tip}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Booksources&action=edit booksources]
        -[[MediaWiki_talk:Booksources|Talk]] -
        -Book sources - -{{int:Booksources}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Booksourcetext&action=edit booksourcetext]
        -[[MediaWiki_talk:Booksourcetext|Talk]] -
        -Below is a list of links to other sites that -sell new and used books, and may also have further information -about books you are looking for.Wiktionary is not affiliated with any of these businesses, and -this list should not be construed as an endorsement. - -{{int:Booksourcetext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Brokenredirects&action=edit brokenredirects]
        -[[MediaWiki_talk:Brokenredirects|Talk]] -
        -Broken Redirects - -{{int:Brokenredirects}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Brokenredirectstext&action=edit brokenredirectstext]
        -[[MediaWiki_talk:Brokenredirectstext|Talk]] -
        -The following redirects link to a non-existing pages. - -{{int:Brokenredirectstext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bugreports&action=edit bugreports]
        -[[MediaWiki_talk:Bugreports|Talk]] -
        -Bug reports - -{{int:Bugreports}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bugreportspage&action=edit bugreportspage]
        -[[MediaWiki_talk:Bugreportspage|Talk]] -
        -Wiktionary:Bug_reports - -{{int:Bugreportspage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bureaucratlog&action=edit bureaucratlog]
        -[[MediaWiki_talk:Bureaucratlog|Talk]] -
        -Bureaucrat_log - -{{int:Bureaucratlog}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bureaucratlogentry&action=edit bureaucratlogentry]
        -[[MediaWiki_talk:Bureaucratlogentry|Talk]] -
        -Rights for user "$1" set "$2" - -{{int:Bureaucratlogentry}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bureaucrattext&action=edit bureaucrattext]
        -[[MediaWiki_talk:Bureaucrattext|Talk]] -
        -The action you have requested can only be -performed by sysops with "bureaucrat" status. - -{{int:Bureaucrattext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bureaucrattitle&action=edit bureaucrattitle]
        -[[MediaWiki_talk:Bureaucrattitle|Talk]] -
        -Bureaucrat access required - -{{int:Bureaucrattitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bydate&action=edit bydate]
        -[[MediaWiki_talk:Bydate|Talk]] -
        -by date - -{{int:Bydate}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Byname&action=edit byname]
        -[[MediaWiki_talk:Byname|Talk]] -
        -by name - -{{int:Byname}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bysize&action=edit bysize]
        -[[MediaWiki_talk:Bysize|Talk]] -
        -by size - -{{int:Bysize}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cachederror&action=edit cachederror]
        -[[MediaWiki_talk:Cachederror|Talk]] -
        -The following is a cached copy of the requested page, and may not be up to date. - -{{int:Cachederror}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cancel&action=edit cancel]
        -[[MediaWiki_talk:Cancel|Talk]] -
        -Cancel - -{{int:Cancel}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cannotdelete&action=edit cannotdelete]
        -[[MediaWiki_talk:Cannotdelete|Talk]] -
        -Could not delete the page or image specified. (It may have already been deleted by someone else.) - -{{int:Cannotdelete}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cantrollback&action=edit cantrollback]
        -[[MediaWiki_talk:Cantrollback|Talk]] -
        -Cannot revert edit; last contributor is only author of this page. - -{{int:Cantrollback}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Categories&action=edit categories]
        -[[MediaWiki_talk:Categories|Talk]] -
        -Categories - -{{int:Categories}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Category&action=edit category]
        -[[MediaWiki_talk:Category|Talk]] -
        -category - -{{int:Category}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Category_header&action=edit category_header]
        -[[MediaWiki_talk:Category_header|Talk]] -
        -Articles in category "$1" - -{{int:Category_header}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Changepassword&action=edit changepassword]
        -[[MediaWiki_talk:Changepassword|Talk]] -
        -Change password - -{{int:Changepassword}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Changes&action=edit changes]
        -[[MediaWiki_talk:Changes|Talk]] -
        -changes - -{{int:Changes}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Columns&action=edit columns]
        -[[MediaWiki_talk:Columns|Talk]] -
        -Columns - -{{int:Columns}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Commentedit&action=edit commentedit]
        -[[MediaWiki_talk:Commentedit|Talk]] -
        - (comment) - -{{int:Commentedit}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Compareselectedversions&action=edit compareselectedversions]
        -[[MediaWiki_talk:Compareselectedversions|Talk]] -
        -Compare selected versions - -{{int:Compareselectedversions}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirm&action=edit confirm]
        -[[MediaWiki_talk:Confirm|Talk]] -
        -Confirm - -{{int:Confirm}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmcheck&action=edit confirmcheck]
        -[[MediaWiki_talk:Confirmcheck|Talk]] -
        -Yes, I really want to delete this. - -{{int:Confirmcheck}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmdelete&action=edit confirmdelete]
        -[[MediaWiki_talk:Confirmdelete|Talk]] -
        -Confirm delete - -{{int:Confirmdelete}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmdeletetext&action=edit confirmdeletetext]
        -[[MediaWiki_talk:Confirmdeletetext|Talk]] -
        -You are about to permanently delete a page -or image along with all of its history from the database. -Please confirm that you intend to do this, that you understand the -consequences, and that you are doing this in accordance with -[[Wiktionary:Policy]]. - -{{int:Confirmdeletetext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmprotect&action=edit confirmprotect]
        -[[MediaWiki_talk:Confirmprotect|Talk]] -
        -Confirm protection - -{{int:Confirmprotect}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmprotecttext&action=edit confirmprotecttext]
        -[[MediaWiki_talk:Confirmprotecttext|Talk]] -
        -Do you really want to protect this page? - -{{int:Confirmprotecttext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmunprotect&action=edit confirmunprotect]
        -[[MediaWiki_talk:Confirmunprotect|Talk]] -
        -Confirm unprotection - -{{int:Confirmunprotect}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmunprotecttext&action=edit confirmunprotecttext]
        -[[MediaWiki_talk:Confirmunprotecttext|Talk]] -
        -Do you really want to unprotect this page? - -{{int:Confirmunprotecttext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contextchars&action=edit contextchars]
        -[[MediaWiki_talk:Contextchars|Talk]] -
        -Characters of context per line - -{{int:Contextchars}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contextlines&action=edit contextlines]
        -[[MediaWiki_talk:Contextlines|Talk]] -
        -Lines to show per hit - -{{int:Contextlines}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contribslink&action=edit contribslink]
        -[[MediaWiki_talk:Contribslink|Talk]] -
        -contribs - -{{int:Contribslink}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contribsub&action=edit contribsub]
        -[[MediaWiki_talk:Contribsub|Talk]] -
        -For $1 - -{{int:Contribsub}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contributions&action=edit contributions]
        -[[MediaWiki_talk:Contributions|Talk]] -
        -User contributions - -{{int:Contributions}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Copyright&action=edit copyright]
        -[[MediaWiki_talk:Copyright|Talk]] -
        -Content is available under $1. - -{{int:Copyright}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Copyrightpage&action=edit copyrightpage]
        -[[MediaWiki_talk:Copyrightpage|Talk]] -
        -Wiktionary:Copyrights - -{{int:Copyrightpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Copyrightpagename&action=edit copyrightpagename]
        -[[MediaWiki_talk:Copyrightpagename|Talk]] -
        -Wiktionary copyright - -{{int:Copyrightpagename}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Copyrightwarning&action=edit copyrightwarning]
        -[[MediaWiki_talk:Copyrightwarning|Talk]] -
        -Please note that all contributions to Wiktionary are -considered to be released under the GNU Free Documentation License -(see $1 for details). -If you don't want your writing to be edited mercilessly and redistributed -at will, then don't submit it here.<br /> -You are also promising us that you wrote this yourself, or copied it from a -public domain or similar free resource. -<strong>DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!</strong> - -{{int:Copyrightwarning}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Couldntremove&action=edit couldntremove]
        -[[MediaWiki_talk:Couldntremove|Talk]] -
        -Couldn't remove item '$1'... - -{{int:Couldntremove}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Createaccount&action=edit createaccount]
        -[[MediaWiki_talk:Createaccount|Talk]] -
        -Create new account - -{{int:Createaccount}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Createaccountmail&action=edit createaccountmail]
        -[[MediaWiki_talk:Createaccountmail|Talk]] -
        -by email - -{{int:Createaccountmail}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cur&action=edit cur]
        -[[MediaWiki_talk:Cur|Talk]] -
        -cur - -{{int:Cur}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Currentevents&action=edit currentevents]
        -[[MediaWiki_talk:Currentevents|Talk]] -
        -Current events - -{{int:Currentevents}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Currentrev&action=edit currentrev]
        -[[MediaWiki_talk:Currentrev|Talk]] -
        -Current revision - -{{int:Currentrev}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Databaseerror&action=edit databaseerror]
        -[[MediaWiki_talk:Databaseerror|Talk]] -
        -Database error - -{{int:Databaseerror}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dateformat&action=edit dateformat]
        -[[MediaWiki_talk:Dateformat|Talk]] -
        -Date format - -{{int:Dateformat}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dberrortext&action=edit dberrortext]
        -[[MediaWiki_talk:Dberrortext|Talk]] -
        -A database query syntax error has occurred. -This could be because of an illegal search query (see $5), -or it may indicate a bug in the software. -The last attempted database query was: -<blockquote><tt>$1</tt></blockquote> -from within function "<tt>$2</tt>". -MySQL returned error "<tt>$3: $4</tt>". - -{{int:Dberrortext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dberrortextcl&action=edit dberrortextcl]
        -[[MediaWiki_talk:Dberrortextcl|Talk]] -
        -A database query syntax error has occurred. -The last attempted database query was: -"$1" -from within function "$2". -MySQL returned error "$3: $4". - - -{{int:Dberrortextcl}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deadendpages&action=edit deadendpages]
        -[[MediaWiki_talk:Deadendpages|Talk]] -
        -Dead-end pages - -{{int:Deadendpages}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Debug&action=edit debug]
        -[[MediaWiki_talk:Debug|Talk]] -
        -Debug - -{{int:Debug}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Defaultns&action=edit defaultns]
        -[[MediaWiki_talk:Defaultns|Talk]] -
        -Search in these namespaces by default: - -{{int:Defaultns}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Defemailsubject&action=edit defemailsubject]
        -[[MediaWiki_talk:Defemailsubject|Talk]] -
        -Wiktionary e-mail - -{{int:Defemailsubject}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Delete&action=edit delete]
        -[[MediaWiki_talk:Delete|Talk]] -
        -Delete - -{{int:Delete}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletecomment&action=edit deletecomment]
        -[[MediaWiki_talk:Deletecomment|Talk]] -
        -Reason for deletion - -{{int:Deletecomment}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletedarticle&action=edit deletedarticle]
        -[[MediaWiki_talk:Deletedarticle|Talk]] -
        -deleted "$1" - -{{int:Deletedarticle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletedtext&action=edit deletedtext]
        -[[MediaWiki_talk:Deletedtext|Talk]] -
        -"$1" has been deleted. -See $2 for a record of recent deletions. - -{{int:Deletedtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deleteimg&action=edit deleteimg]
        -[[MediaWiki_talk:Deleteimg|Talk]] -
        -del - -{{int:Deleteimg}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletepage&action=edit deletepage]
        -[[MediaWiki_talk:Deletepage|Talk]] -
        -Delete page - -{{int:Deletepage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletesub&action=edit deletesub]
        -[[MediaWiki_talk:Deletesub|Talk]] -
        -(Deleting "$1") - -{{int:Deletesub}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletethispage&action=edit deletethispage]
        -[[MediaWiki_talk:Deletethispage|Talk]] -
        -Delete this page - -{{int:Deletethispage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletionlog&action=edit deletionlog]
        -[[MediaWiki_talk:Deletionlog|Talk]] -
        -deletion log - -{{int:Deletionlog}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dellogpage&action=edit dellogpage]
        -[[MediaWiki_talk:Dellogpage|Talk]] -
        -Deletion_log - -{{int:Dellogpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dellogpagetext&action=edit dellogpagetext]
        -[[MediaWiki_talk:Dellogpagetext|Talk]] -
        -Below is a list of the most recent deletions. -All times shown are server time (UTC). -<ul> -</ul> - - -{{int:Dellogpagetext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Developerspheading&action=edit developerspheading]
        -[[MediaWiki_talk:Developerspheading|Talk]] -
        -For developer use only - -{{int:Developerspheading}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Developertext&action=edit developertext]
        -[[MediaWiki_talk:Developertext|Talk]] -
        -The action you have requested can only be -performed by users with "developer" status. -See $1. - -{{int:Developertext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Developertitle&action=edit developertitle]
        -[[MediaWiki_talk:Developertitle|Talk]] -
        -Developer access required - -{{int:Developertitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Diff&action=edit diff]
        -[[MediaWiki_talk:Diff|Talk]] -
        -diff - -{{int:Diff}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Difference&action=edit difference]
        -[[MediaWiki_talk:Difference|Talk]] -
        -(Difference between revisions) - -{{int:Difference}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Disclaimerpage&action=edit disclaimerpage]
        -[[MediaWiki_talk:Disclaimerpage|Talk]] -
        -Wiktionary:General_disclaimer - -{{int:Disclaimerpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Disclaimers&action=edit disclaimers]
        -[[MediaWiki_talk:Disclaimers|Talk]] -
        -Disclaimers - -{{int:Disclaimers}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Doubleredirects&action=edit doubleredirects]
        -[[MediaWiki_talk:Doubleredirects|Talk]] -
        -Double Redirects - -{{int:Doubleredirects}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Doubleredirectstext&action=edit doubleredirectstext]
        -[[MediaWiki_talk:Doubleredirectstext|Talk]] -
        -<b>Attention:</b> This list may contain false positives. That usually means there is additional text with links below the first #REDIRECT.<br /> -Each row contains links to the first and second redirect, as well as the first line of the second redirect text, usually giving the "real" target page, which the first redirect should point to. - -{{int:Doubleredirectstext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Edit&action=edit edit]
        -[[MediaWiki_talk:Edit|Talk]] -
        -Edit - -{{int:Edit}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editcomment&action=edit editcomment]
        -[[MediaWiki_talk:Editcomment|Talk]] -
        -The edit comment was: "<i>$1</i>". - -{{int:Editcomment}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editconflict&action=edit editconflict]
        -[[MediaWiki_talk:Editconflict|Talk]] -
        -Edit conflict: $1 - -{{int:Editconflict}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editcurrent&action=edit editcurrent]
        -[[MediaWiki_talk:Editcurrent|Talk]] -
        -Edit the current version of this page - -{{int:Editcurrent}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Edithelp&action=edit edithelp]
        -[[MediaWiki_talk:Edithelp|Talk]] -
        -Editing help - -{{int:Edithelp}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Edithelppage&action=edit edithelppage]
        -[[MediaWiki_talk:Edithelppage|Talk]] -
        -Help:Editing - -{{int:Edithelppage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editing&action=edit editing]
        -[[MediaWiki_talk:Editing|Talk]] -
        -Editing $1 - -{{int:Editing}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editingold&action=edit editingold]
        -[[MediaWiki_talk:Editingold|Talk]] -
        -<strong>WARNING: You are editing an out-of-date -revision of this page. -If you save it, any changes made since this revision will be lost.</strong> - - -{{int:Editingold}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editsection&action=edit editsection]
        -[[MediaWiki_talk:Editsection|Talk]] -
        -edit - -{{int:Editsection}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editthispage&action=edit editthispage]
        -[[MediaWiki_talk:Editthispage|Talk]] -
        -Edit this page - -{{int:Editthispage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailflag&action=edit emailflag]
        -[[MediaWiki_talk:Emailflag|Talk]] -
        -Disable e-mail from other users - -{{int:Emailflag}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailforlost&action=edit emailforlost]
        -[[MediaWiki_talk:Emailforlost|Talk]] -
        -Fields marked with a star (*) are optional. Storing an email address enables people to contact you through the website without you having to reveal your -email address to them, and it can be used to send you a new password if you forget it.<br /><br />Your real name, if you choose to provide it, will be used for giving you attribution for your work. - -{{int:Emailforlost}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailfrom&action=edit emailfrom]
        -[[MediaWiki_talk:Emailfrom|Talk]] -
        -From - -{{int:Emailfrom}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailmessage&action=edit emailmessage]
        -[[MediaWiki_talk:Emailmessage|Talk]] -
        -Message - -{{int:Emailmessage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailpage&action=edit emailpage]
        -[[MediaWiki_talk:Emailpage|Talk]] -
        -E-mail user - -{{int:Emailpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailpagetext&action=edit emailpagetext]
        -[[MediaWiki_talk:Emailpagetext|Talk]] -
        -If this user has entered a valid e-mail address in -his or her user preferences, the form below will send a single message. -The e-mail address you entered in your user preferences will appear -as the "From" address of the mail, so the recipient will be able -to reply. - -{{int:Emailpagetext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailsend&action=edit emailsend]
        -[[MediaWiki_talk:Emailsend|Talk]] -
        -Send - -{{int:Emailsend}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailsent&action=edit emailsent]
        -[[MediaWiki_talk:Emailsent|Talk]] -
        -E-mail sent - -{{int:Emailsent}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailsenttext&action=edit emailsenttext]
        -[[MediaWiki_talk:Emailsenttext|Talk]] -
        -Your e-mail message has been sent. - -{{int:Emailsenttext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailsubject&action=edit emailsubject]
        -[[MediaWiki_talk:Emailsubject|Talk]] -
        -Subject - -{{int:Emailsubject}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailto&action=edit emailto]
        -[[MediaWiki_talk:Emailto|Talk]] -
        -To - -{{int:Emailto}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailuser&action=edit emailuser]
        -[[MediaWiki_talk:Emailuser|Talk]] -
        -E-mail this user - -{{int:Emailuser}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Enterlockreason&action=edit enterlockreason]
        -[[MediaWiki_talk:Enterlockreason|Talk]] -
        -Enter a reason for the lock, including an estimate -of when the lock will be released - -{{int:Enterlockreason}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Error&action=edit error]
        -[[MediaWiki_talk:Error|Talk]] -
        -Error - -{{int:Error}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Errorpagetitle&action=edit errorpagetitle]
        -[[MediaWiki_talk:Errorpagetitle|Talk]] -
        -Error - -{{int:Errorpagetitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Exbeforeblank&action=edit exbeforeblank]
        -[[MediaWiki_talk:Exbeforeblank|Talk]] -
        -content before blanking was: - -{{int:Exbeforeblank}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Exblank&action=edit exblank]
        -[[MediaWiki_talk:Exblank|Talk]] -
        -page was empty - -{{int:Exblank}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Excontent&action=edit excontent]
        -[[MediaWiki_talk:Excontent|Talk]] -
        -content was: - -{{int:Excontent}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Explainconflict&action=edit explainconflict]
        -[[MediaWiki_talk:Explainconflict|Talk]] -
        -Someone else has changed this page since you -started editing it. -The upper text area contains the page text as it currently exists. -Your changes are shown in the lower text area. -You will have to merge your changes into the existing text. -<b>Only</b> the text in the upper text area will be saved when you -press "Save page". -<p> - -{{int:Explainconflict}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Export&action=edit export]
        -[[MediaWiki_talk:Export|Talk]] -
        -Export pages - -{{int:Export}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Exportcuronly&action=edit exportcuronly]
        -[[MediaWiki_talk:Exportcuronly|Talk]] -
        -Include only the current revision, not the full history - -{{int:Exportcuronly}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Exporttext&action=edit exporttext]
        -[[MediaWiki_talk:Exporttext|Talk]] -
        -You can export the text and editing history of a particular -page or set of pages wrapped in some XML; this can then be imported into another -wiki running MediaWiki software, transformed, or just kept for your private -amusement. - -{{int:Exporttext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Extlink_sample&action=edit extlink_sample]
        -[[MediaWiki_talk:Extlink_sample|Talk]] -
        -http://www.example.com link title - -{{int:Extlink_sample}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Extlink_tip&action=edit extlink_tip]
        -[[MediaWiki_talk:Extlink_tip|Talk]] -
        -External link (remember http:// prefix) - -{{int:Extlink_tip}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Faq&action=edit faq]
        -[[MediaWiki_talk:Faq|Talk]] -
        -FAQ - -{{int:Faq}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Faqpage&action=edit faqpage]
        -[[MediaWiki_talk:Faqpage|Talk]] -
        -Wiktionary:FAQ - -{{int:Faqpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Feedlinks&action=edit feedlinks]
        -[[MediaWiki_talk:Feedlinks|Talk]] -
        -Feed: - -{{int:Feedlinks}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filecopyerror&action=edit filecopyerror]
        -[[MediaWiki_talk:Filecopyerror|Talk]] -
        -Could not copy file "$1" to "$2". - -{{int:Filecopyerror}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filedeleteerror&action=edit filedeleteerror]
        -[[MediaWiki_talk:Filedeleteerror|Talk]] -
        -Could not delete file "$1". - -{{int:Filedeleteerror}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filedesc&action=edit filedesc]
        -[[MediaWiki_talk:Filedesc|Talk]] -
        -Summary - -{{int:Filedesc}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filename&action=edit filename]
        -[[MediaWiki_talk:Filename|Talk]] -
        -Filename - -{{int:Filename}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filenotfound&action=edit filenotfound]
        -[[MediaWiki_talk:Filenotfound|Talk]] -
        -Could not find file "$1". - -{{int:Filenotfound}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filerenameerror&action=edit filerenameerror]
        -[[MediaWiki_talk:Filerenameerror|Talk]] -
        -Could not rename file "$1" to "$2". - -{{int:Filerenameerror}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filesource&action=edit filesource]
        -[[MediaWiki_talk:Filesource|Talk]] -
        -Source - -{{int:Filesource}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filestatus&action=edit filestatus]
        -[[MediaWiki_talk:Filestatus|Talk]] -
        -Copyright status - -{{int:Filestatus}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Fileuploaded&action=edit fileuploaded]
        -[[MediaWiki_talk:Fileuploaded|Talk]] -
        -File "$1" uploaded successfully. -Please follow this link: $2 to the description page and fill -in information about the file, such as where it came from, when it was -created and by whom, and anything else you may know about it. - -{{int:Fileuploaded}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Formerror&action=edit formerror]
        -[[MediaWiki_talk:Formerror|Talk]] -
        -Error: could not submit form - -{{int:Formerror}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Fromwikipedia&action=edit fromwikipedia]
        -[[MediaWiki_talk:Fromwikipedia|Talk]] -
        -From Wiktionary - -{{int:Fromwikipedia}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Getimagelist&action=edit getimagelist]
        -[[MediaWiki_talk:Getimagelist|Talk]] -
        -fetching image list - -{{int:Getimagelist}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Go&action=edit go]
        -[[MediaWiki_talk:Go|Talk]] -
        -Go - -{{int:Go}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Googlesearch&action=edit googlesearch]
        -[[MediaWiki_talk:Googlesearch|Talk]] -
        - -<!-- SiteSearch Google --> -<FORM method=GET action="http://www.google.com/search"> -<TABLE bgcolor="#FFFFFF"><tr><td> -<A HREF="http://www.google.com/"> -<IMG SRC="http://www.google.com/logos/Logo_40wht.gif" -border="0" ALT="Google"></A> -</td> -<td> -<INPUT TYPE=text name=q size=31 maxlength=255 value="$1"> -<INPUT type=submit name=btnG VALUE="Google Search"> -<font size=-1> -<input type=hidden name=domains value="http://tl.wiktionary.org"><br /><input type=radio name=sitesearch value=""> WWW <input type=radio name=sitesearch value="http://tl.wiktionary.org" checked> http://tl.wiktionary.org <br /> -<input type='hidden' name='ie' value='$2'> -<input type='hidden' name='oe' value='$2'> -</font> -</td></tr></TABLE> -</FORM> -<!-- SiteSearch Google --> - -{{int:Googlesearch}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Guesstimezone&action=edit guesstimezone]
        -[[MediaWiki_talk:Guesstimezone|Talk]] -
        -Fill in from browser - -{{int:Guesstimezone}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Headline_sample&action=edit headline_sample]
        -[[MediaWiki_talk:Headline_sample|Talk]] -
        -Headline text - -{{int:Headline_sample}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Headline_tip&action=edit headline_tip]
        -[[MediaWiki_talk:Headline_tip|Talk]] -
        -Level 2 headline - -{{int:Headline_tip}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Help&action=edit help]
        -[[MediaWiki_talk:Help|Talk]] -
        -Help - -{{int:Help}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Helppage&action=edit helppage]
        -[[MediaWiki_talk:Helppage|Talk]] -
        -Help:Contents - -{{int:Helppage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Hide&action=edit hide]
        -[[MediaWiki_talk:Hide|Talk]] -
        -hide - -{{int:Hide}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Hidetoc&action=edit hidetoc]
        -[[MediaWiki_talk:Hidetoc|Talk]] -
        -hide - -{{int:Hidetoc}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Hist&action=edit hist]
        -[[MediaWiki_talk:Hist|Talk]] -
        -hist - -{{int:Hist}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Histlegend&action=edit histlegend]
        -[[MediaWiki_talk:Histlegend|Talk]] -
        -Diff selection: mark the radio boxes of the versions to compare and hit enter or the button at the bottom.<br/> -Legend: (cur) = difference with current version, -(last) = difference with preceding version, M = minor edit. - -{{int:Histlegend}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:History&action=edit history]
        -[[MediaWiki_talk:History|Talk]] -
        -Page history - -{{int:History}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:History_short&action=edit history_short]
        -[[MediaWiki_talk:History_short|Talk]] -
        -History - -{{int:History_short}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Historywarning&action=edit historywarning]
        -[[MediaWiki_talk:Historywarning|Talk]] -
        -Warning: The page you are about to delete has a history: - -{{int:Historywarning}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Hr_tip&action=edit hr_tip]
        -[[MediaWiki_talk:Hr_tip|Talk]] -
        -Horizontal line (use sparingly) - -{{int:Hr_tip}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ignorewarning&action=edit ignorewarning]
        -[[MediaWiki_talk:Ignorewarning|Talk]] -
        -Ignore warning and save file anyway. - -{{int:Ignorewarning}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ilshowmatch&action=edit ilshowmatch]
        -[[MediaWiki_talk:Ilshowmatch|Talk]] -
        -Show all images with names matching - -{{int:Ilshowmatch}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ilsubmit&action=edit ilsubmit]
        -[[MediaWiki_talk:Ilsubmit|Talk]] -
        -Search - -{{int:Ilsubmit}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Image_sample&action=edit image_sample]
        -[[MediaWiki_talk:Image_sample|Talk]] -
        -Example.jpg - -{{int:Image_sample}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Image_tip&action=edit image_tip]
        -[[MediaWiki_talk:Image_tip|Talk]] -
        -Embedded image - -{{int:Image_tip}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagelinks&action=edit imagelinks]
        -[[MediaWiki_talk:Imagelinks|Talk]] -
        -Image links - -{{int:Imagelinks}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagelist&action=edit imagelist]
        -[[MediaWiki_talk:Imagelist|Talk]] -
        -Image list - -{{int:Imagelist}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagelisttext&action=edit imagelisttext]
        -[[MediaWiki_talk:Imagelisttext|Talk]] -
        -Below is a list of $1 images sorted $2. - -{{int:Imagelisttext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagepage&action=edit imagepage]
        -[[MediaWiki_talk:Imagepage|Talk]] -
        -View image page - -{{int:Imagepage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagereverted&action=edit imagereverted]
        -[[MediaWiki_talk:Imagereverted|Talk]] -
        -Revert to earlier version was successful. - -{{int:Imagereverted}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imgdelete&action=edit imgdelete]
        -[[MediaWiki_talk:Imgdelete|Talk]] -
        -del - -{{int:Imgdelete}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imgdesc&action=edit imgdesc]
        -[[MediaWiki_talk:Imgdesc|Talk]] -
        -desc - -{{int:Imgdesc}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imghistlegend&action=edit imghistlegend]
        -[[MediaWiki_talk:Imghistlegend|Talk]] -
        -Legend: (cur) = this is the current image, (del) = delete -this old version, (rev) = revert to this old version. -<br /><i>Click on date to see image uploaded on that date</i>. - -{{int:Imghistlegend}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imghistory&action=edit imghistory]
        -[[MediaWiki_talk:Imghistory|Talk]] -
        -Image history - -{{int:Imghistory}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imglegend&action=edit imglegend]
        -[[MediaWiki_talk:Imglegend|Talk]] -
        -Legend: (desc) = show/edit image description. - -{{int:Imglegend}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Import&action=edit import]
        -[[MediaWiki_talk:Import|Talk]] -
        -Import pages - -{{int:Import}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importfailed&action=edit importfailed]
        -[[MediaWiki_talk:Importfailed|Talk]] -
        -Import failed: $1 - -{{int:Importfailed}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importhistoryconflict&action=edit importhistoryconflict]
        -[[MediaWiki_talk:Importhistoryconflict|Talk]] -
        -Conflicting history revision exists (may have imported this page before) - -{{int:Importhistoryconflict}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importnotext&action=edit importnotext]
        -[[MediaWiki_talk:Importnotext|Talk]] -
        -Empty or no text - -{{int:Importnotext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importsuccess&action=edit importsuccess]
        -[[MediaWiki_talk:Importsuccess|Talk]] -
        -Import succeeded! - -{{int:Importsuccess}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importtext&action=edit importtext]
        -[[MediaWiki_talk:Importtext|Talk]] -
        -Please export the file from the source wiki using the Special:Export utility, save it to your disk and upload it here. - -{{int:Importtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Infobox&action=edit infobox]
        -[[MediaWiki_talk:Infobox|Talk]] -
        -Click a button to get an example text - -{{int:Infobox}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Infobox_alert&action=edit infobox_alert]
        -[[MediaWiki_talk:Infobox_alert|Talk]] -
        -Please enter the text you want to be formatted.\n It will be shown in the infobox for copy and pasting.\nExample:\n$1\nwill become:\n$2 - -{{int:Infobox_alert}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Internalerror&action=edit internalerror]
        -[[MediaWiki_talk:Internalerror|Talk]] -
        -Internal error - -{{int:Internalerror}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Intl&action=edit intl]
        -[[MediaWiki_talk:Intl|Talk]] -
        -Interlanguage links - -{{int:Intl}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ip_range_invalid&action=edit ip_range_invalid]
        -[[MediaWiki_talk:Ip_range_invalid|Talk]] -
        -Invalid IP range. - - -{{int:Ip_range_invalid}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipaddress&action=edit ipaddress]
        -[[MediaWiki_talk:Ipaddress|Talk]] -
        -IP Address/username - -{{int:Ipaddress}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipb_expiry_invalid&action=edit ipb_expiry_invalid]
        -[[MediaWiki_talk:Ipb_expiry_invalid|Talk]] -
        -Expiry time invalid. - -{{int:Ipb_expiry_invalid}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipbexpiry&action=edit ipbexpiry]
        -[[MediaWiki_talk:Ipbexpiry|Talk]] -
        -Expiry - -{{int:Ipbexpiry}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipblocklist&action=edit ipblocklist]
        -[[MediaWiki_talk:Ipblocklist|Talk]] -
        -List of blocked IP addresses and usernames - -{{int:Ipblocklist}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipbreason&action=edit ipbreason]
        -[[MediaWiki_talk:Ipbreason|Talk]] -
        -Reason - -{{int:Ipbreason}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipbsubmit&action=edit ipbsubmit]
        -[[MediaWiki_talk:Ipbsubmit|Talk]] -
        -Block this user - -{{int:Ipbsubmit}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipusubmit&action=edit ipusubmit]
        -[[MediaWiki_talk:Ipusubmit|Talk]] -
        -Unblock this address - -{{int:Ipusubmit}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipusuccess&action=edit ipusuccess]
        -[[MediaWiki_talk:Ipusuccess|Talk]] -
        -"$1" unblocked - -{{int:Ipusuccess}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Isbn&action=edit isbn]
        -[[MediaWiki_talk:Isbn|Talk]] -
        -ISBN - -{{int:Isbn}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Isredirect&action=edit isredirect]
        -[[MediaWiki_talk:Isredirect|Talk]] -
        -redirect page - -{{int:Isredirect}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Italic_sample&action=edit italic_sample]
        -[[MediaWiki_talk:Italic_sample|Talk]] -
        -Italic text - -{{int:Italic_sample}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Italic_tip&action=edit italic_tip]
        -[[MediaWiki_talk:Italic_tip|Talk]] -
        -Italic text - -{{int:Italic_tip}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Iteminvalidname&action=edit iteminvalidname]
        -[[MediaWiki_talk:Iteminvalidname|Talk]] -
        -Problem with item '$1', invalid name... - -{{int:Iteminvalidname}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Largefile&action=edit largefile]
        -[[MediaWiki_talk:Largefile|Talk]] -
        -It is recommended that images not exceed 100k in size. - -{{int:Largefile}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Last&action=edit last]
        -[[MediaWiki_talk:Last|Talk]] -
        -last - -{{int:Last}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lastmodified&action=edit lastmodified]
        -[[MediaWiki_talk:Lastmodified|Talk]] -
        -This page was last modified $1. - -{{int:Lastmodified}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lastmodifiedby&action=edit lastmodifiedby]
        -[[MediaWiki_talk:Lastmodifiedby|Talk]] -
        -This page was last modified $1 by $2. - -{{int:Lastmodifiedby}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lineno&action=edit lineno]
        -[[MediaWiki_talk:Lineno|Talk]] -
        -Line $1: - -{{int:Lineno}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Link_sample&action=edit link_sample]
        -[[MediaWiki_talk:Link_sample|Talk]] -
        -Link title - -{{int:Link_sample}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Link_tip&action=edit link_tip]
        -[[MediaWiki_talk:Link_tip|Talk]] -
        -Internal link - -{{int:Link_tip}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Linklistsub&action=edit linklistsub]
        -[[MediaWiki_talk:Linklistsub|Talk]] -
        -(List of links) - -{{int:Linklistsub}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Linkshere&action=edit linkshere]
        -[[MediaWiki_talk:Linkshere|Talk]] -
        -The following pages link to here: - -{{int:Linkshere}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Linkstoimage&action=edit linkstoimage]
        -[[MediaWiki_talk:Linkstoimage|Talk]] -
        -The following pages link to this image: - -{{int:Linkstoimage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Linktrail&action=edit linktrail]
        -[[MediaWiki_talk:Linktrail|Talk]] -
        -/^([a-z]+)(.*)$/sD - -{{int:Linktrail}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Listform&action=edit listform]
        -[[MediaWiki_talk:Listform|Talk]] -
        -list - -{{int:Listform}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Listusers&action=edit listusers]
        -[[MediaWiki_talk:Listusers|Talk]] -
        -User list - -{{int:Listusers}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loadhist&action=edit loadhist]
        -[[MediaWiki_talk:Loadhist|Talk]] -
        -Loading page history - -{{int:Loadhist}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loadingrev&action=edit loadingrev]
        -[[MediaWiki_talk:Loadingrev|Talk]] -
        -loading revision for diff - -{{int:Loadingrev}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Localtime&action=edit localtime]
        -[[MediaWiki_talk:Localtime|Talk]] -
        -Local time display - -{{int:Localtime}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockbtn&action=edit lockbtn]
        -[[MediaWiki_talk:Lockbtn|Talk]] -
        -Lock database - -{{int:Lockbtn}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockconfirm&action=edit lockconfirm]
        -[[MediaWiki_talk:Lockconfirm|Talk]] -
        -Yes, I really want to lock the database. - -{{int:Lockconfirm}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockdb&action=edit lockdb]
        -[[MediaWiki_talk:Lockdb|Talk]] -
        -Lock database - -{{int:Lockdb}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockdbsuccesssub&action=edit lockdbsuccesssub]
        -[[MediaWiki_talk:Lockdbsuccesssub|Talk]] -
        -Database lock succeeded - -{{int:Lockdbsuccesssub}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockdbsuccesstext&action=edit lockdbsuccesstext]
        -[[MediaWiki_talk:Lockdbsuccesstext|Talk]] -
        -The database has been locked. -<br />Remember to remove the lock after your maintenance is complete. - -{{int:Lockdbsuccesstext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockdbtext&action=edit lockdbtext]
        -[[MediaWiki_talk:Lockdbtext|Talk]] -
        -Locking the database will suspend the ability of all -users to edit pages, change their preferences, edit their watchlists, and -other things requiring changes in the database. -Please confirm that this is what you intend to do, and that you will -unlock the database when your maintenance is done. - -{{int:Lockdbtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Locknoconfirm&action=edit locknoconfirm]
        -[[MediaWiki_talk:Locknoconfirm|Talk]] -
        -You did not check the confirmation box. - -{{int:Locknoconfirm}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Login&action=edit login]
        -[[MediaWiki_talk:Login|Talk]] -
        -Log in - -{{int:Login}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginend&action=edit loginend]
        -[[MediaWiki_talk:Loginend|Talk]] -
        -&nbsp; - -{{int:Loginend}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginerror&action=edit loginerror]
        -[[MediaWiki_talk:Loginerror|Talk]] -
        -Login error - -{{int:Loginerror}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginpagetitle&action=edit loginpagetitle]
        -[[MediaWiki_talk:Loginpagetitle|Talk]] -
        -User login - -{{int:Loginpagetitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginproblem&action=edit loginproblem]
        -[[MediaWiki_talk:Loginproblem|Talk]] -
        -<b>There has been a problem with your login.</b><br />Try again! - -{{int:Loginproblem}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginprompt&action=edit loginprompt]
        -[[MediaWiki_talk:Loginprompt|Talk]] -
        -You must have cookies enabled to log in to Wiktionary. - -{{int:Loginprompt}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginreqtext&action=edit loginreqtext]
        -[[MediaWiki_talk:Loginreqtext|Talk]] -
        -You must [[special:Userlogin|login]] to view other pages. - -{{int:Loginreqtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginreqtitle&action=edit loginreqtitle]
        -[[MediaWiki_talk:Loginreqtitle|Talk]] -
        -Login Required - -{{int:Loginreqtitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginsuccess&action=edit loginsuccess]
        -[[MediaWiki_talk:Loginsuccess|Talk]] -
        -You are now logged in to Wiktionary as "$1". - -{{int:Loginsuccess}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginsuccesstitle&action=edit loginsuccesstitle]
        -[[MediaWiki_talk:Loginsuccesstitle|Talk]] -
        -Login successful - -{{int:Loginsuccesstitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Logout&action=edit logout]
        -[[MediaWiki_talk:Logout|Talk]] -
        -Log out - -{{int:Logout}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Logouttext&action=edit logouttext]
        -[[MediaWiki_talk:Logouttext|Talk]] -
        -You are now logged out. -You can continue to use Wiktionary anonymously, or you can log in -again as the same or as a different user. Note that some pages may -continue to be displayed as if you were still logged in, until you clear -your browser cache - - -{{int:Logouttext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Logouttitle&action=edit logouttitle]
        -[[MediaWiki_talk:Logouttitle|Talk]] -
        -User logout - -{{int:Logouttitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lonelypages&action=edit lonelypages]
        -[[MediaWiki_talk:Lonelypages|Talk]] -
        -Orphaned pages - -{{int:Lonelypages}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Longpages&action=edit longpages]
        -[[MediaWiki_talk:Longpages|Talk]] -
        -Long pages - -{{int:Longpages}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Longpagewarning&action=edit longpagewarning]
        -[[MediaWiki_talk:Longpagewarning|Talk]] -
        -WARNING: This page is $1 kilobytes long; some -browsers may have problems editing pages approaching or longer than 32kb. -Please consider breaking the page into smaller sections. - -{{int:Longpagewarning}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mailerror&action=edit mailerror]
        -[[MediaWiki_talk:Mailerror|Talk]] -
        -Error sending mail: $1 - -{{int:Mailerror}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mailmypassword&action=edit mailmypassword]
        -[[MediaWiki_talk:Mailmypassword|Talk]] -
        -Mail me a new password - -{{int:Mailmypassword}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mailnologin&action=edit mailnologin]
        -[[MediaWiki_talk:Mailnologin|Talk]] -
        -No send address - -{{int:Mailnologin}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mailnologintext&action=edit mailnologintext]
        -[[MediaWiki_talk:Mailnologintext|Talk]] -
        -You must be <a href="{{localurl:Special:Userlogin">logged in</a> -and have a valid e-mail address in your <a href="/wiki/Special:Preferences">preferences</a> -to send e-mail to other users. - -{{int:Mailnologintext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mainpage&action=edit mainpage]
        -[[MediaWiki_talk:Mainpage|Talk]] -
        -Main Page - -{{int:Mainpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mainpagedocfooter&action=edit mainpagedocfooter]
        -[[MediaWiki_talk:Mainpagedocfooter|Talk]] -
        -Please see [http://meta.wikipedia.org/wiki/MediaWiki_i18n documentation on customizing the interface] -and the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide] for usage and configuration help. - -{{int:Mainpagedocfooter}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mainpagetext&action=edit mainpagetext]
        -[[MediaWiki_talk:Mainpagetext|Talk]] -
        -Wiki software successfully installed. - -{{int:Mainpagetext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Maintenance&action=edit maintenance]
        -[[MediaWiki_talk:Maintenance|Talk]] -
        -Maintenance page - -{{int:Maintenance}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Maintenancebacklink&action=edit maintenancebacklink]
        -[[MediaWiki_talk:Maintenancebacklink|Talk]] -
        -Back to Maintenance Page - -{{int:Maintenancebacklink}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Maintnancepagetext&action=edit maintnancepagetext]
        -[[MediaWiki_talk:Maintnancepagetext|Talk]] -
        -This page includes several handy tools for everyday maintenance. Some of these functions tend to stress the database, so please do not hit reload after every item you fixed ;-) - -{{int:Maintnancepagetext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysop&action=edit makesysop]
        -[[MediaWiki_talk:Makesysop|Talk]] -
        -Make a user into a sysop - -{{int:Makesysop}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysopfail&action=edit makesysopfail]
        -[[MediaWiki_talk:Makesysopfail|Talk]] -
        -<b>User "$1" could not be made into a sysop. (Did you enter the name correctly?)</b> - -{{int:Makesysopfail}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysopname&action=edit makesysopname]
        -[[MediaWiki_talk:Makesysopname|Talk]] -
        -Name of the user: - -{{int:Makesysopname}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysopok&action=edit makesysopok]
        -[[MediaWiki_talk:Makesysopok|Talk]] -
        -<b>User "$1" is now a sysop</b> - -{{int:Makesysopok}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysopsubmit&action=edit makesysopsubmit]
        -[[MediaWiki_talk:Makesysopsubmit|Talk]] -
        -Make this user into a sysop - -{{int:Makesysopsubmit}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysoptext&action=edit makesysoptext]
        -[[MediaWiki_talk:Makesysoptext|Talk]] -
        -This form is used by bureaucrats to turn ordinary users into administrators. -Type the name of the user in the box and press the button to make the user an administrator - -{{int:Makesysoptext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysoptitle&action=edit makesysoptitle]
        -[[MediaWiki_talk:Makesysoptitle|Talk]] -
        -Make a user into a sysop - -{{int:Makesysoptitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Matchtotals&action=edit matchtotals]
        -[[MediaWiki_talk:Matchtotals|Talk]] -
        -The query "$1" matched $2 page titles -and the text of $3 pages. - -{{int:Matchtotals}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math&action=edit math]
        -[[MediaWiki_talk:Math|Talk]] -
        -Rendering math - -{{int:Math}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_bad_output&action=edit math_bad_output]
        -[[MediaWiki_talk:Math_bad_output|Talk]] -
        -Can't write to or create math output directory - -{{int:Math_bad_output}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_bad_tmpdir&action=edit math_bad_tmpdir]
        -[[MediaWiki_talk:Math_bad_tmpdir|Talk]] -
        -Can't write to or create math temp directory - -{{int:Math_bad_tmpdir}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_failure&action=edit math_failure]
        -[[MediaWiki_talk:Math_failure|Talk]] -
        -Failed to parse - -{{int:Math_failure}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_image_error&action=edit math_image_error]
        -[[MediaWiki_talk:Math_image_error|Talk]] -
        -PNG conversion failed; check for correct installation of latex, dvips, gs, and convert - -{{int:Math_image_error}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_lexing_error&action=edit math_lexing_error]
        -[[MediaWiki_talk:Math_lexing_error|Talk]] -
        -lexing error - -{{int:Math_lexing_error}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_notexvc&action=edit math_notexvc]
        -[[MediaWiki_talk:Math_notexvc|Talk]] -
        -Missing texvc executable; please see math/README to configure. - -{{int:Math_notexvc}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_sample&action=edit math_sample]
        -[[MediaWiki_talk:Math_sample|Talk]] -
        -Insert formula here - -{{int:Math_sample}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_syntax_error&action=edit math_syntax_error]
        -[[MediaWiki_talk:Math_syntax_error|Talk]] -
        -syntax error - -{{int:Math_syntax_error}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_tip&action=edit math_tip]
        -[[MediaWiki_talk:Math_tip|Talk]] -
        -Mathematical formula (LaTeX) - -{{int:Math_tip}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_unknown_error&action=edit math_unknown_error]
        -[[MediaWiki_talk:Math_unknown_error|Talk]] -
        -unknown error - -{{int:Math_unknown_error}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_unknown_function&action=edit math_unknown_function]
        -[[MediaWiki_talk:Math_unknown_function|Talk]] -
        -unknown function - -{{int:Math_unknown_function}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Media_sample&action=edit media_sample]
        -[[MediaWiki_talk:Media_sample|Talk]] -
        -Example.mp3 - -{{int:Media_sample}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Media_tip&action=edit media_tip]
        -[[MediaWiki_talk:Media_tip|Talk]] -
        -Media file link - -{{int:Media_tip}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Minlength&action=edit minlength]
        -[[MediaWiki_talk:Minlength|Talk]] -
        -Image names must be at least three letters. - -{{int:Minlength}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Minoredit&action=edit minoredit]
        -[[MediaWiki_talk:Minoredit|Talk]] -
        -This is a minor edit - -{{int:Minoredit}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Minoreditletter&action=edit minoreditletter]
        -[[MediaWiki_talk:Minoreditletter|Talk]] -
        -M - -{{int:Minoreditletter}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mispeelings&action=edit mispeelings]
        -[[MediaWiki_talk:Mispeelings|Talk]] -
        -Pages with misspellings - -{{int:Mispeelings}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mispeelingspage&action=edit mispeelingspage]
        -[[MediaWiki_talk:Mispeelingspage|Talk]] -
        -List of common misspellings - -{{int:Mispeelingspage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mispeelingstext&action=edit mispeelingstext]
        -[[MediaWiki_talk:Mispeelingstext|Talk]] -
        -The following pages contain a common misspelling, which are listed on $1. The correct spelling might be given (like this). - -{{int:Mispeelingstext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missingarticle&action=edit missingarticle]
        -[[MediaWiki_talk:Missingarticle|Talk]] -
        -The database did not find the text of a page -that it should have found, named "$1". - -<p>This is usually caused by following an outdated diff or history link to a -page that has been deleted. - -<p>If this is not the case, you may have found a bug in the software. -Please report this to an administrator, making note of the URL. - -{{int:Missingarticle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missingimage&action=edit missingimage]
        -[[MediaWiki_talk:Missingimage|Talk]] -
        -<b>Missing image</b><br /><i>$1</i> - - -{{int:Missingimage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missinglanguagelinks&action=edit missinglanguagelinks]
        -[[MediaWiki_talk:Missinglanguagelinks|Talk]] -
        -Missing Language Links - -{{int:Missinglanguagelinks}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missinglanguagelinksbutton&action=edit missinglanguagelinksbutton]
        -[[MediaWiki_talk:Missinglanguagelinksbutton|Talk]] -
        -Find missing language links for - -{{int:Missinglanguagelinksbutton}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missinglanguagelinkstext&action=edit missinglanguagelinkstext]
        -[[MediaWiki_talk:Missinglanguagelinkstext|Talk]] -
        -These pages do <i>not</i> link to their counterpart in $1. Redirects and subpages are <i>not</i> shown. - -{{int:Missinglanguagelinkstext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Moredotdotdot&action=edit moredotdotdot]
        -[[MediaWiki_talk:Moredotdotdot|Talk]] -
        -More... - -{{int:Moredotdotdot}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Move&action=edit move]
        -[[MediaWiki_talk:Move|Talk]] -
        -Move - -{{int:Move}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movearticle&action=edit movearticle]
        -[[MediaWiki_talk:Movearticle|Talk]] -
        -Move page - -{{int:Movearticle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movedto&action=edit movedto]
        -[[MediaWiki_talk:Movedto|Talk]] -
        -moved to - -{{int:Movedto}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movenologin&action=edit movenologin]
        -[[MediaWiki_talk:Movenologin|Talk]] -
        -Not logged in - -{{int:Movenologin}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movenologintext&action=edit movenologintext]
        -[[MediaWiki_talk:Movenologintext|Talk]] -
        -You must be a registered user and <a href="/wiki/Special:Userlogin">logged in</a> -to move a page. - -{{int:Movenologintext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movepage&action=edit movepage]
        -[[MediaWiki_talk:Movepage|Talk]] -
        -Move page - -{{int:Movepage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movepagebtn&action=edit movepagebtn]
        -[[MediaWiki_talk:Movepagebtn|Talk]] -
        -Move page - -{{int:Movepagebtn}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movepagetalktext&action=edit movepagetalktext]
        -[[MediaWiki_talk:Movepagetalktext|Talk]] -
        -The associated talk page, if any, will be automatically moved along with it '''unless:''' -*You are moving the page across namespaces, -*A non-empty talk page already exists under the new name, or -*You uncheck the box below. - -In those cases, you will have to move or merge the page manually if desired. - -{{int:Movepagetalktext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movepagetext&action=edit movepagetext]
        -[[MediaWiki_talk:Movepagetext|Talk]] -
        -Using the form below will rename a page, moving all -of its history to the new name. -The old title will become a redirect page to the new title. -Links to the old page title will not be changed; be sure to -[[Special:Maintenance|check]] for double or broken redirects. -You are responsible for making sure that links continue to -point where they are supposed to go. - -Note that the page will '''not''' be moved if there is already -a page at the new title, unless it is empty or a redirect and has no -past edit history. This means that you can rename a page back to where -it was just renamed from if you make a mistake, and you cannot overwrite -an existing page. - -<b>WARNING!</b> -This can be a drastic and unexpected change for a popular page; -please be sure you understand the consequences of this before -proceeding. - -{{int:Movepagetext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movetalk&action=edit movetalk]
        -[[MediaWiki_talk:Movetalk|Talk]] -
        -Move "talk" page as well, if applicable. - -{{int:Movetalk}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movethispage&action=edit movethispage]
        -[[MediaWiki_talk:Movethispage|Talk]] -
        -Move this page - -{{int:Movethispage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mycontris&action=edit mycontris]
        -[[MediaWiki_talk:Mycontris|Talk]] -
        -My contributions - -{{int:Mycontris}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mypage&action=edit mypage]
        -[[MediaWiki_talk:Mypage|Talk]] -
        -My page - -{{int:Mypage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mytalk&action=edit mytalk]
        -[[MediaWiki_talk:Mytalk|Talk]] -
        -My talk - -{{int:Mytalk}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Navigation&action=edit navigation]
        -[[MediaWiki_talk:Navigation|Talk]] -
        -Navigation - -{{int:Navigation}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nbytes&action=edit nbytes]
        -[[MediaWiki_talk:Nbytes|Talk]] -
        -$1 bytes - -{{int:Nbytes}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nchanges&action=edit nchanges]
        -[[MediaWiki_talk:Nchanges|Talk]] -
        -$1 changes - -{{int:Nchanges}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newarticle&action=edit newarticle]
        -[[MediaWiki_talk:Newarticle|Talk]] -
        -(New) - -{{int:Newarticle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newarticletext&action=edit newarticletext]
        -[[MediaWiki_talk:Newarticletext|Talk]] -
        -You've followed a link to a page that doesn't exist yet. -To create the page, start typing in the box below -(see the [[Wiktionary:Help|help page]] for more info). -If you are here by mistake, just click your browser's '''back''' button. - -{{int:Newarticletext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newmessages&action=edit newmessages]
        -[[MediaWiki_talk:Newmessages|Talk]] -
        -You have $1. - -{{int:Newmessages}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newmessageslink&action=edit newmessageslink]
        -[[MediaWiki_talk:Newmessageslink|Talk]] -
        -new messages - -{{int:Newmessageslink}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newpage&action=edit newpage]
        -[[MediaWiki_talk:Newpage|Talk]] -
        -New page - -{{int:Newpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newpageletter&action=edit newpageletter]
        -[[MediaWiki_talk:Newpageletter|Talk]] -
        -N - -{{int:Newpageletter}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newpages&action=edit newpages]
        -[[MediaWiki_talk:Newpages|Talk]] -
        -New pages - -{{int:Newpages}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newpassword&action=edit newpassword]
        -[[MediaWiki_talk:Newpassword|Talk]] -
        -New password - -{{int:Newpassword}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newtitle&action=edit newtitle]
        -[[MediaWiki_talk:Newtitle|Talk]] -
        -To new title - -{{int:Newtitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newusersonly&action=edit newusersonly]
        -[[MediaWiki_talk:Newusersonly|Talk]] -
        - (new users only) - -{{int:Newusersonly}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Next&action=edit next]
        -[[MediaWiki_talk:Next|Talk]] -
        -next - -{{int:Next}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nextn&action=edit nextn]
        -[[MediaWiki_talk:Nextn|Talk]] -
        -next $1 - -{{int:Nextn}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nlinks&action=edit nlinks]
        -[[MediaWiki_talk:Nlinks|Talk]] -
        -$1 links - -{{int:Nlinks}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noaffirmation&action=edit noaffirmation]
        -[[MediaWiki_talk:Noaffirmation|Talk]] -
        -You must affirm that your upload does not violate -any copyrights. - -{{int:Noaffirmation}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noarticletext&action=edit noarticletext]
        -[[MediaWiki_talk:Noarticletext|Talk]] -
        -(There is currently no text in this page) - -{{int:Noarticletext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noblockreason&action=edit noblockreason]
        -[[MediaWiki_talk:Noblockreason|Talk]] -
        -You must supply a reason for the block. - -{{int:Noblockreason}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noconnect&action=edit noconnect]
        -[[MediaWiki_talk:Noconnect|Talk]] -
        -Sorry! The wiki is experiencing some technical difficulties, and cannot contact the database server. - -{{int:Noconnect}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nocontribs&action=edit nocontribs]
        -[[MediaWiki_talk:Nocontribs|Talk]] -
        -No changes were found matching these criteria. - -{{int:Nocontribs}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nocookieslogin&action=edit nocookieslogin]
        -[[MediaWiki_talk:Nocookieslogin|Talk]] -
        -Wiktionary uses cookies to log in users. You have cookies disabled. Please enable them and try again. - -{{int:Nocookieslogin}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nocookiesnew&action=edit nocookiesnew]
        -[[MediaWiki_talk:Nocookiesnew|Talk]] -
        -The user account was created, but you are not logged in. Wiktionary uses cookies to log in users. You have cookies disabled. Please enable them, then log in with your new username and password. - -{{int:Nocookiesnew}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nocreativecommons&action=edit nocreativecommons]
        -[[MediaWiki_talk:Nocreativecommons|Talk]] -
        -Creative Commons RDF metadata disabled for this server. - -{{int:Nocreativecommons}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nodb&action=edit nodb]
        -[[MediaWiki_talk:Nodb|Talk]] -
        -Could not select database $1 - -{{int:Nodb}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nodublincore&action=edit nodublincore]
        -[[MediaWiki_talk:Nodublincore|Talk]] -
        -Dublin Core RDF metadata disabled for this server. - -{{int:Nodublincore}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noemail&action=edit noemail]
        -[[MediaWiki_talk:Noemail|Talk]] -
        -There is no e-mail address recorded for user "$1". - -{{int:Noemail}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noemailtext&action=edit noemailtext]
        -[[MediaWiki_talk:Noemailtext|Talk]] -
        -This user has not specified a valid e-mail address, -or has chosen not to receive e-mail from other users. - -{{int:Noemailtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noemailtitle&action=edit noemailtitle]
        -[[MediaWiki_talk:Noemailtitle|Talk]] -
        -No e-mail address - -{{int:Noemailtitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nogomatch&action=edit nogomatch]
        -[[MediaWiki_talk:Nogomatch|Talk]] -
        -No page with this exact title exists, trying full text search. - -{{int:Nogomatch}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nohistory&action=edit nohistory]
        -[[MediaWiki_talk:Nohistory|Talk]] -
        -There is no edit history for this page. - -{{int:Nohistory}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nolinkshere&action=edit nolinkshere]
        -[[MediaWiki_talk:Nolinkshere|Talk]] -
        -No pages link to here. - -{{int:Nolinkshere}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nolinkstoimage&action=edit nolinkstoimage]
        -[[MediaWiki_talk:Nolinkstoimage|Talk]] -
        -There are no pages that link to this image. - -{{int:Nolinkstoimage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noname&action=edit noname]
        -[[MediaWiki_talk:Noname|Talk]] -
        -You have not specified a valid user name. - -{{int:Noname}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nonefound&action=edit nonefound]
        -[[MediaWiki_talk:Nonefound|Talk]] -
        -<strong>Note</strong>: unsuccessful searches are -often caused by searching for common words like "have" and "from", -which are not indexed, or by specifying more than one search term (only pages -containing all of the search terms will appear in the result). - -{{int:Nonefound}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nospecialpagetext&action=edit nospecialpagetext]
        -[[MediaWiki_talk:Nospecialpagetext|Talk]] -
        -You have requested a special page that is not -recognized by the wiki. - -{{int:Nospecialpagetext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nosuchaction&action=edit nosuchaction]
        -[[MediaWiki_talk:Nosuchaction|Talk]] -
        -No such action - -{{int:Nosuchaction}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nosuchactiontext&action=edit nosuchactiontext]
        -[[MediaWiki_talk:Nosuchactiontext|Talk]] -
        -The action specified by the URL is not -recognized by the wiki - -{{int:Nosuchactiontext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nosuchspecialpage&action=edit nosuchspecialpage]
        -[[MediaWiki_talk:Nosuchspecialpage|Talk]] -
        -No such special page - -{{int:Nosuchspecialpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nosuchuser&action=edit nosuchuser]
        -[[MediaWiki_talk:Nosuchuser|Talk]] -
        -There is no user by the name "$1". -Check your spelling, or use the form below to create a new user account. - -{{int:Nosuchuser}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notacceptable&action=edit notacceptable]
        -[[MediaWiki_talk:Notacceptable|Talk]] -
        -The wiki server can't provide data in a format your client can read. - -{{int:Notacceptable}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notanarticle&action=edit notanarticle]
        -[[MediaWiki_talk:Notanarticle|Talk]] -
        -Not a content page - -{{int:Notanarticle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notargettext&action=edit notargettext]
        -[[MediaWiki_talk:Notargettext|Talk]] -
        -You have not specified a target page or user -to perform this function on. - -{{int:Notargettext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notargettitle&action=edit notargettitle]
        -[[MediaWiki_talk:Notargettitle|Talk]] -
        -No target - -{{int:Notargettitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Note&action=edit note]
        -[[MediaWiki_talk:Note|Talk]] -
        -<strong>Note:</strong> - -{{int:Note}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notextmatches&action=edit notextmatches]
        -[[MediaWiki_talk:Notextmatches|Talk]] -
        -No page text matches - -{{int:Notextmatches}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notitlematches&action=edit notitlematches]
        -[[MediaWiki_talk:Notitlematches|Talk]] -
        -No page title matches - -{{int:Notitlematches}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notloggedin&action=edit notloggedin]
        -[[MediaWiki_talk:Notloggedin|Talk]] -
        -Not logged in - -{{int:Notloggedin}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nowatchlist&action=edit nowatchlist]
        -[[MediaWiki_talk:Nowatchlist|Talk]] -
        -You have no items on your watchlist. - -{{int:Nowatchlist}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nowiki_sample&action=edit nowiki_sample]
        -[[MediaWiki_talk:Nowiki_sample|Talk]] -
        -Insert non-formatted text here - -{{int:Nowiki_sample}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nowiki_tip&action=edit nowiki_tip]
        -[[MediaWiki_talk:Nowiki_tip|Talk]] -
        -Ignore wiki formatting - -{{int:Nowiki_tip}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-category&action=edit nstab-category]
        -[[MediaWiki_talk:Nstab-category|Talk]] -
        -Category - -{{int:Nstab-category}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-help&action=edit nstab-help]
        -[[MediaWiki_talk:Nstab-help|Talk]] -
        -Help - -{{int:Nstab-help}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-image&action=edit nstab-image]
        -[[MediaWiki_talk:Nstab-image|Talk]] -
        -Image - -{{int:Nstab-image}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-main&action=edit nstab-main]
        -[[MediaWiki_talk:Nstab-main|Talk]] -
        -Article - -{{int:Nstab-main}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-media&action=edit nstab-media]
        -[[MediaWiki_talk:Nstab-media|Talk]] -
        -Media - -{{int:Nstab-media}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-mediawiki&action=edit nstab-mediawiki]
        -[[MediaWiki_talk:Nstab-mediawiki|Talk]] -
        -Message - -{{int:Nstab-mediawiki}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-special&action=edit nstab-special]
        -[[MediaWiki_talk:Nstab-special|Talk]] -
        -Special - -{{int:Nstab-special}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-template&action=edit nstab-template]
        -[[MediaWiki_talk:Nstab-template|Talk]] -
        -Template - -{{int:Nstab-template}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-user&action=edit nstab-user]
        -[[MediaWiki_talk:Nstab-user|Talk]] -
        -User page - -{{int:Nstab-user}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-wp&action=edit nstab-wp]
        -[[MediaWiki_talk:Nstab-wp|Talk]] -
        -About - -{{int:Nstab-wp}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nviews&action=edit nviews]
        -[[MediaWiki_talk:Nviews|Talk]] -
        -$1 views - -{{int:Nviews}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ok&action=edit ok]
        -[[MediaWiki_talk:Ok|Talk]] -
        -OK - -{{int:Ok}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Oldpassword&action=edit oldpassword]
        -[[MediaWiki_talk:Oldpassword|Talk]] -
        -Old password - -{{int:Oldpassword}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Orig&action=edit orig]
        -[[MediaWiki_talk:Orig|Talk]] -
        -orig - -{{int:Orig}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Orphans&action=edit orphans]
        -[[MediaWiki_talk:Orphans|Talk]] -
        -Orphaned pages - -{{int:Orphans}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Othercontribs&action=edit othercontribs]
        -[[MediaWiki_talk:Othercontribs|Talk]] -
        -Based on work by $1. - -{{int:Othercontribs}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Otherlanguages&action=edit otherlanguages]
        -[[MediaWiki_talk:Otherlanguages|Talk]] -
        -Other languages - -{{int:Otherlanguages}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Pagemovedsub&action=edit pagemovedsub]
        -[[MediaWiki_talk:Pagemovedsub|Talk]] -
        -Move succeeded - -{{int:Pagemovedsub}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Pagemovedtext&action=edit pagemovedtext]
        -[[MediaWiki_talk:Pagemovedtext|Talk]] -
        -Page "[[$1]]" moved to "[[$2]]". - -{{int:Pagemovedtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Pagetitle&action=edit pagetitle]
        -[[MediaWiki_talk:Pagetitle|Talk]] -
        -$1 - Wiktionary - -{{int:Pagetitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Passwordremindertext&action=edit passwordremindertext]
        -[[MediaWiki_talk:Passwordremindertext|Talk]] -
        -Someone (probably you, from IP address $1) -requested that we send you a new Wiktionary login password. -The password for user "$2" is now "$3". -You should log in and change your password now. - -{{int:Passwordremindertext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Passwordremindertitle&action=edit passwordremindertitle]
        -[[MediaWiki_talk:Passwordremindertitle|Talk]] -
        -Password reminder from Wiktionary - -{{int:Passwordremindertitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Passwordsent&action=edit passwordsent]
        -[[MediaWiki_talk:Passwordsent|Talk]] -
        -A new password has been sent to the e-mail address -registered for "$1". -Please log in again after you receive it. - -{{int:Passwordsent}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Perfcached&action=edit perfcached]
        -[[MediaWiki_talk:Perfcached|Talk]] -
        -The following data is cached and may not be completely up to date: - -{{int:Perfcached}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Perfdisabled&action=edit perfdisabled]
        -[[MediaWiki_talk:Perfdisabled|Talk]] -
        -Sorry! This feature has been temporarily disabled -because it slows the database down to the point that no one can use -the wiki. - -{{int:Perfdisabled}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Perfdisabledsub&action=edit perfdisabledsub]
        -[[MediaWiki_talk:Perfdisabledsub|Talk]] -
        -Here's a saved copy from $1: - -{{int:Perfdisabledsub}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Personaltools&action=edit personaltools]
        -[[MediaWiki_talk:Personaltools|Talk]] -
        -Personal tools - -{{int:Personaltools}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Popularpages&action=edit popularpages]
        -[[MediaWiki_talk:Popularpages|Talk]] -
        -Popular pages - -{{int:Popularpages}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Portal&action=edit portal]
        -[[MediaWiki_talk:Portal|Talk]] -
        -Community portal - -{{int:Portal}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Portal-url&action=edit portal-url]
        -[[MediaWiki_talk:Portal-url|Talk]] -
        -Wiktionary:Community Portal - -{{int:Portal-url}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Postcomment&action=edit postcomment]
        -[[MediaWiki_talk:Postcomment|Talk]] -
        -Post a comment - -{{int:Postcomment}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Poweredby&action=edit poweredby]
        -[[MediaWiki_talk:Poweredby|Talk]] -
        -Wiktionary is powered by [http://www.mediawiki.org/ MediaWiki], an open source wiki engine. - -{{int:Poweredby}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Powersearch&action=edit powersearch]
        -[[MediaWiki_talk:Powersearch|Talk]] -
        -Search - -{{int:Powersearch}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Powersearchtext&action=edit powersearchtext]
        -[[MediaWiki_talk:Powersearchtext|Talk]] -
        - -Search in namespaces :<br /> -$1<br /> -$2 List redirects &nbsp; Search for $3 $9 - -{{int:Powersearchtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Preferences&action=edit preferences]
        -[[MediaWiki_talk:Preferences|Talk]] -
        -Preferences - -{{int:Preferences}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefs-help-userdata&action=edit prefs-help-userdata]
        -[[MediaWiki_talk:Prefs-help-userdata|Talk]] -
        -* <strong>Real name</strong> (optional): if you choose to provide it this will be used for giving you attribution for your work.<br/> -* <strong>Email</strong> (optional): Enables people to contact you through the website without you having to reveal your -email address to them, and it can be used to send you a new password if you forget it. - -{{int:Prefs-help-userdata}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefs-misc&action=edit prefs-misc]
        -[[MediaWiki_talk:Prefs-misc|Talk]] -
        -Misc settings - -{{int:Prefs-misc}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefs-personal&action=edit prefs-personal]
        -[[MediaWiki_talk:Prefs-personal|Talk]] -
        -User data - -{{int:Prefs-personal}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefs-rc&action=edit prefs-rc]
        -[[MediaWiki_talk:Prefs-rc|Talk]] -
        -Recent changes and stub display - -{{int:Prefs-rc}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefslogintext&action=edit prefslogintext]
        -[[MediaWiki_talk:Prefslogintext|Talk]] -
        -You are logged in as "$1". -Your internal ID number is $2. - -See [[Wiktionary:User preferences help]] for help deciphering the options. - -{{int:Prefslogintext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefsnologin&action=edit prefsnologin]
        -[[MediaWiki_talk:Prefsnologin|Talk]] -
        -Not logged in - -{{int:Prefsnologin}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefsnologintext&action=edit prefsnologintext]
        -[[MediaWiki_talk:Prefsnologintext|Talk]] -
        -You must be <a href="/wiki/Special:Userlogin">logged in</a> -to set user preferences. - -{{int:Prefsnologintext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefsreset&action=edit prefsreset]
        -[[MediaWiki_talk:Prefsreset|Talk]] -
        -Preferences have been reset from storage. - -{{int:Prefsreset}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Preview&action=edit preview]
        -[[MediaWiki_talk:Preview|Talk]] -
        -Preview - -{{int:Preview}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Previewconflict&action=edit previewconflict]
        -[[MediaWiki_talk:Previewconflict|Talk]] -
        -This preview reflects the text in the upper -text editing area as it will appear if you choose to save. - -{{int:Previewconflict}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Previewnote&action=edit previewnote]
        -[[MediaWiki_talk:Previewnote|Talk]] -
        -Remember that this is only a preview, and has not yet been saved! - -{{int:Previewnote}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prevn&action=edit prevn]
        -[[MediaWiki_talk:Prevn|Talk]] -
        -previous $1 - -{{int:Prevn}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Printableversion&action=edit printableversion]
        -[[MediaWiki_talk:Printableversion|Talk]] -
        -Printable version - -{{int:Printableversion}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Printsubtitle&action=edit printsubtitle]
        -[[MediaWiki_talk:Printsubtitle|Talk]] -
        -(From http://tl.wiktionary.org) - -{{int:Printsubtitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protect&action=edit protect]
        -[[MediaWiki_talk:Protect|Talk]] -
        -Protect - -{{int:Protect}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectcomment&action=edit protectcomment]
        -[[MediaWiki_talk:Protectcomment|Talk]] -
        -Reason for protecting - -{{int:Protectcomment}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectedarticle&action=edit protectedarticle]
        -[[MediaWiki_talk:Protectedarticle|Talk]] -
        -protected [[$1]] - -{{int:Protectedarticle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectedpage&action=edit protectedpage]
        -[[MediaWiki_talk:Protectedpage|Talk]] -
        -Protected page - -{{int:Protectedpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectedpagewarning&action=edit protectedpagewarning]
        -[[MediaWiki_talk:Protectedpagewarning|Talk]] -
        -WARNING: This page has been locked so that only -users with sysop privileges can edit it. Be sure you are following the -<a href='/w/wiki.phtml/Wiktionary:Protected_page_guidelines'>protected page -guidelines</a>. - -{{int:Protectedpagewarning}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectedtext&action=edit protectedtext]
        -[[MediaWiki_talk:Protectedtext|Talk]] -
        -This page has been locked to prevent editing; there are -a number of reasons why this may be so, please see -[[Wiktionary:Protected page]]. - -You can view and copy the source of this page: - -{{int:Protectedtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectlogpage&action=edit protectlogpage]
        -[[MediaWiki_talk:Protectlogpage|Talk]] -
        -Protection_log - -{{int:Protectlogpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectlogtext&action=edit protectlogtext]
        -[[MediaWiki_talk:Protectlogtext|Talk]] -
        -Below is a list of page locks/unlocks. -See [[Wiktionary:Protected page]] for more information. - -{{int:Protectlogtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectpage&action=edit protectpage]
        -[[MediaWiki_talk:Protectpage|Talk]] -
        -Protect page - -{{int:Protectpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectreason&action=edit protectreason]
        -[[MediaWiki_talk:Protectreason|Talk]] -
        -(give a reason) - -{{int:Protectreason}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectsub&action=edit protectsub]
        -[[MediaWiki_talk:Protectsub|Talk]] -
        -(Protecting "$1") - -{{int:Protectsub}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectthispage&action=edit protectthispage]
        -[[MediaWiki_talk:Protectthispage|Talk]] -
        -Protect this page - -{{int:Protectthispage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Proxyblocker&action=edit proxyblocker]
        -[[MediaWiki_talk:Proxyblocker|Talk]] -
        -Proxy blocker - -{{int:Proxyblocker}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Proxyblockreason&action=edit proxyblockreason]
        -[[MediaWiki_talk:Proxyblockreason|Talk]] -
        -Your IP address has been blocked because it is an open proxy. Please contact your Internet service provider or tech support and inform them of this serious security problem. - -{{int:Proxyblockreason}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Proxyblocksuccess&action=edit proxyblocksuccess]
        -[[MediaWiki_talk:Proxyblocksuccess|Talk]] -
        -Done. - - -{{int:Proxyblocksuccess}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbbrowse&action=edit qbbrowse]
        -[[MediaWiki_talk:Qbbrowse|Talk]] -
        -Browse - -{{int:Qbbrowse}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbedit&action=edit qbedit]
        -[[MediaWiki_talk:Qbedit|Talk]] -
        -Edit - -{{int:Qbedit}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbfind&action=edit qbfind]
        -[[MediaWiki_talk:Qbfind|Talk]] -
        -Find - -{{int:Qbfind}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbmyoptions&action=edit qbmyoptions]
        -[[MediaWiki_talk:Qbmyoptions|Talk]] -
        -My pages - -{{int:Qbmyoptions}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbpageinfo&action=edit qbpageinfo]
        -[[MediaWiki_talk:Qbpageinfo|Talk]] -
        -Context - -{{int:Qbpageinfo}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbpageoptions&action=edit qbpageoptions]
        -[[MediaWiki_talk:Qbpageoptions|Talk]] -
        -This page - -{{int:Qbpageoptions}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbsettings&action=edit qbsettings]
        -[[MediaWiki_talk:Qbsettings|Talk]] -
        -Quickbar settings - -{{int:Qbsettings}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbspecialpages&action=edit qbspecialpages]
        -[[MediaWiki_talk:Qbspecialpages|Talk]] -
        -Special pages - -{{int:Qbspecialpages}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Querybtn&action=edit querybtn]
        -[[MediaWiki_talk:Querybtn|Talk]] -
        -Submit query - -{{int:Querybtn}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Querysuccessful&action=edit querysuccessful]
        -[[MediaWiki_talk:Querysuccessful|Talk]] -
        -Query successful - -{{int:Querysuccessful}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Randompage&action=edit randompage]
        -[[MediaWiki_talk:Randompage|Talk]] -
        -Random page - -{{int:Randompage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Range_block_disabled&action=edit range_block_disabled]
        -[[MediaWiki_talk:Range_block_disabled|Talk]] -
        -The sysop ability to create range blocks is disabled. - -{{int:Range_block_disabled}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rchide&action=edit rchide]
        -[[MediaWiki_talk:Rchide|Talk]] -
        -in $4 form; $1 minor edits; $2 secondary namespaces; $3 multiple edits. - -{{int:Rchide}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rclinks&action=edit rclinks]
        -[[MediaWiki_talk:Rclinks|Talk]] -
        -Show last $1 changes in last $2 days<br />$3 - -{{int:Rclinks}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rclistfrom&action=edit rclistfrom]
        -[[MediaWiki_talk:Rclistfrom|Talk]] -
        -Show new changes starting from $1 - -{{int:Rclistfrom}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rcliu&action=edit rcliu]
        -[[MediaWiki_talk:Rcliu|Talk]] -
        -; $1 edits from logged in users - -{{int:Rcliu}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rcloaderr&action=edit rcloaderr]
        -[[MediaWiki_talk:Rcloaderr|Talk]] -
        -Loading recent changes - -{{int:Rcloaderr}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rclsub&action=edit rclsub]
        -[[MediaWiki_talk:Rclsub|Talk]] -
        -(to pages linked from "$1") - -{{int:Rclsub}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rcnote&action=edit rcnote]
        -[[MediaWiki_talk:Rcnote|Talk]] -
        -Below are the last <strong>$1</strong> changes in last <strong>$2</strong> days. - -{{int:Rcnote}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rcnotefrom&action=edit rcnotefrom]
        -[[MediaWiki_talk:Rcnotefrom|Talk]] -
        -Below are the changes since <b>$2</b> (up to <b>$1</b> shown). - -{{int:Rcnotefrom}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Readonly&action=edit readonly]
        -[[MediaWiki_talk:Readonly|Talk]] -
        -Database locked - -{{int:Readonly}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Readonlytext&action=edit readonlytext]
        -[[MediaWiki_talk:Readonlytext|Talk]] -
        -The database is currently locked to new -entries and other modifications, probably for routine database maintenance, -after which it will be back to normal. -The administrator who locked it offered this explanation: -<p>$1 - -{{int:Readonlytext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Readonlywarning&action=edit readonlywarning]
        -[[MediaWiki_talk:Readonlywarning|Talk]] -
        -WARNING: The database has been locked for maintenance, -so you will not be able to save your edits right now. You may wish to cut-n-paste -the text into a text file and save it for later. - -{{int:Readonlywarning}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Recentchanges&action=edit recentchanges]
        -[[MediaWiki_talk:Recentchanges|Talk]] -
        -Recent changes - -{{int:Recentchanges}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Recentchangescount&action=edit recentchangescount]
        -[[MediaWiki_talk:Recentchangescount|Talk]] -
        -Number of titles in recent changes - -{{int:Recentchangescount}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Recentchangeslinked&action=edit recentchangeslinked]
        -[[MediaWiki_talk:Recentchangeslinked|Talk]] -
        -Related changes - -{{int:Recentchangeslinked}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Recentchangestext&action=edit recentchangestext]
        -[[MediaWiki_talk:Recentchangestext|Talk]] -
        -Track the most recent changes to the wiki on this page. - -{{int:Recentchangestext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Redirectedfrom&action=edit redirectedfrom]
        -[[MediaWiki_talk:Redirectedfrom|Talk]] -
        -(Redirected from $1) - -{{int:Redirectedfrom}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Remembermypassword&action=edit remembermypassword]
        -[[MediaWiki_talk:Remembermypassword|Talk]] -
        -Remember my password across sessions. - -{{int:Remembermypassword}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Removechecked&action=edit removechecked]
        -[[MediaWiki_talk:Removechecked|Talk]] -
        -Remove checked items from watchlist - -{{int:Removechecked}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Removedwatch&action=edit removedwatch]
        -[[MediaWiki_talk:Removedwatch|Talk]] -
        -Removed from watchlist - -{{int:Removedwatch}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Removedwatchtext&action=edit removedwatchtext]
        -[[MediaWiki_talk:Removedwatchtext|Talk]] -
        -The page "$1" has been removed from your watchlist. - -{{int:Removedwatchtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Removingchecked&action=edit removingchecked]
        -[[MediaWiki_talk:Removingchecked|Talk]] -
        -Removing requested items from watchlist... - -{{int:Removingchecked}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Resetprefs&action=edit resetprefs]
        -[[MediaWiki_talk:Resetprefs|Talk]] -
        -Reset preferences - -{{int:Resetprefs}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Restorelink&action=edit restorelink]
        -[[MediaWiki_talk:Restorelink|Talk]] -
        -$1 deleted edits - -{{int:Restorelink}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Resultsperpage&action=edit resultsperpage]
        -[[MediaWiki_talk:Resultsperpage|Talk]] -
        -Hits to show per page - -{{int:Resultsperpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Retrievedfrom&action=edit retrievedfrom]
        -[[MediaWiki_talk:Retrievedfrom|Talk]] -
        -Retrieved from "$1" - -{{int:Retrievedfrom}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Returnto&action=edit returnto]
        -[[MediaWiki_talk:Returnto|Talk]] -
        -Return to $1. - -{{int:Returnto}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Retypenew&action=edit retypenew]
        -[[MediaWiki_talk:Retypenew|Talk]] -
        -Retype new password - -{{int:Retypenew}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Reupload&action=edit reupload]
        -[[MediaWiki_talk:Reupload|Talk]] -
        -Re-upload - -{{int:Reupload}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Reuploaddesc&action=edit reuploaddesc]
        -[[MediaWiki_talk:Reuploaddesc|Talk]] -
        -Return to the upload form. - -{{int:Reuploaddesc}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Reverted&action=edit reverted]
        -[[MediaWiki_talk:Reverted|Talk]] -
        -Reverted to earlier revision - -{{int:Reverted}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revertimg&action=edit revertimg]
        -[[MediaWiki_talk:Revertimg|Talk]] -
        -rev - -{{int:Revertimg}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revertpage&action=edit revertpage]
        -[[MediaWiki_talk:Revertpage|Talk]] -
        -Reverted edit of $2, changed back to last version by $1 - -{{int:Revertpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revhistory&action=edit revhistory]
        -[[MediaWiki_talk:Revhistory|Talk]] -
        -Revision history - -{{int:Revhistory}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revisionasof&action=edit revisionasof]
        -[[MediaWiki_talk:Revisionasof|Talk]] -
        -Revision as of $1 - -{{int:Revisionasof}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revnotfound&action=edit revnotfound]
        -[[MediaWiki_talk:Revnotfound|Talk]] -
        -Revision not found - -{{int:Revnotfound}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revnotfoundtext&action=edit revnotfoundtext]
        -[[MediaWiki_talk:Revnotfoundtext|Talk]] -
        -The old revision of the page you asked for could not be found. -Please check the URL you used to access this page. - - -{{int:Revnotfoundtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rfcurl&action=edit rfcurl]
        -[[MediaWiki_talk:Rfcurl|Talk]] -
        -http://www.faqs.org/rfcs/rfc$1.html - -{{int:Rfcurl}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rights&action=edit rights]
        -[[MediaWiki_talk:Rights|Talk]] -
        -Rights: - -{{int:Rights}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rollback&action=edit rollback]
        -[[MediaWiki_talk:Rollback|Talk]] -
        -Roll back edits - -{{int:Rollback}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rollback_short&action=edit rollback_short]
        -[[MediaWiki_talk:Rollback_short|Talk]] -
        -Rollback - -{{int:Rollback_short}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rollbackfailed&action=edit rollbackfailed]
        -[[MediaWiki_talk:Rollbackfailed|Talk]] -
        -Rollback failed - -{{int:Rollbackfailed}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rollbacklink&action=edit rollbacklink]
        -[[MediaWiki_talk:Rollbacklink|Talk]] -
        -rollback - -{{int:Rollbacklink}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rows&action=edit rows]
        -[[MediaWiki_talk:Rows|Talk]] -
        -Rows - -{{int:Rows}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Savearticle&action=edit savearticle]
        -[[MediaWiki_talk:Savearticle|Talk]] -
        -Save page - -{{int:Savearticle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Savedprefs&action=edit savedprefs]
        -[[MediaWiki_talk:Savedprefs|Talk]] -
        -Your preferences have been saved. - -{{int:Savedprefs}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Savefile&action=edit savefile]
        -[[MediaWiki_talk:Savefile|Talk]] -
        -Save file - -{{int:Savefile}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Saveprefs&action=edit saveprefs]
        -[[MediaWiki_talk:Saveprefs|Talk]] -
        -Save preferences - -{{int:Saveprefs}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Search&action=edit search]
        -[[MediaWiki_talk:Search|Talk]] -
        -Search - -{{int:Search}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchdisabled&action=edit searchdisabled]
        -[[MediaWiki_talk:Searchdisabled|Talk]] -
        -<p>Sorry! Full text search has been disabled temporarily, for performance reasons. In the meantime, you can use the Google search below, which may be out of date.</p> - -{{int:Searchdisabled}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchhelppage&action=edit searchhelppage]
        -[[MediaWiki_talk:Searchhelppage|Talk]] -
        -Wiktionary:Searching - -{{int:Searchhelppage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchingwikipedia&action=edit searchingwikipedia]
        -[[MediaWiki_talk:Searchingwikipedia|Talk]] -
        -Searching Wiktionary - -{{int:Searchingwikipedia}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchquery&action=edit searchquery]
        -[[MediaWiki_talk:Searchquery|Talk]] -
        -For query "$1" - -{{int:Searchquery}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchresults&action=edit searchresults]
        -[[MediaWiki_talk:Searchresults|Talk]] -
        -Search results - -{{int:Searchresults}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchresultshead&action=edit searchresultshead]
        -[[MediaWiki_talk:Searchresultshead|Talk]] -
        -Search result settings - -{{int:Searchresultshead}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchresulttext&action=edit searchresulttext]
        -[[MediaWiki_talk:Searchresulttext|Talk]] -
        -For more information about searching Wiktionary, see $1. - -{{int:Searchresulttext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sectionedit&action=edit sectionedit]
        -[[MediaWiki_talk:Sectionedit|Talk]] -
        - (section) - -{{int:Sectionedit}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selectnewerversionfordiff&action=edit selectnewerversionfordiff]
        -[[MediaWiki_talk:Selectnewerversionfordiff|Talk]] -
        -Select a newer version for comparison - -{{int:Selectnewerversionfordiff}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selectolderversionfordiff&action=edit selectolderversionfordiff]
        -[[MediaWiki_talk:Selectolderversionfordiff|Talk]] -
        -Select an older version for comparison - -{{int:Selectolderversionfordiff}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selectonly&action=edit selectonly]
        -[[MediaWiki_talk:Selectonly|Talk]] -
        -Only read-only queries are allowed. - -{{int:Selectonly}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selflinks&action=edit selflinks]
        -[[MediaWiki_talk:Selflinks|Talk]] -
        -Pages with Self Links - -{{int:Selflinks}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selflinkstext&action=edit selflinkstext]
        -[[MediaWiki_talk:Selflinkstext|Talk]] -
        -The following pages contain a link to themselves, which they should not. - -{{int:Selflinkstext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Seriousxhtmlerrors&action=edit seriousxhtmlerrors]
        -[[MediaWiki_talk:Seriousxhtmlerrors|Talk]] -
        -There were serious xhtml markup errors detected by tidy. - -{{int:Seriousxhtmlerrors}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Servertime&action=edit servertime]
        -[[MediaWiki_talk:Servertime|Talk]] -
        -Server time is now - -{{int:Servertime}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Set_rights_fail&action=edit set_rights_fail]
        -[[MediaWiki_talk:Set_rights_fail|Talk]] -
        -<b>User rights for "$1" could not be set. (Did you enter the name correctly?)</b> - -{{int:Set_rights_fail}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Set_user_rights&action=edit set_user_rights]
        -[[MediaWiki_talk:Set_user_rights|Talk]] -
        -Set user rights - -{{int:Set_user_rights}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Setbureaucratflag&action=edit setbureaucratflag]
        -[[MediaWiki_talk:Setbureaucratflag|Talk]] -
        -Set bureaucrat flag - -{{int:Setbureaucratflag}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Shortpages&action=edit shortpages]
        -[[MediaWiki_talk:Shortpages|Talk]] -
        -Short pages - -{{int:Shortpages}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Show&action=edit show]
        -[[MediaWiki_talk:Show|Talk]] -
        -show - -{{int:Show}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showhideminor&action=edit showhideminor]
        -[[MediaWiki_talk:Showhideminor|Talk]] -
        -$1 minor edits | $2 bots | $3 logged in users - -{{int:Showhideminor}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showingresults&action=edit showingresults]
        -[[MediaWiki_talk:Showingresults|Talk]] -
        -Showing below <b>$1</b> results starting with #<b>$2</b>. - -{{int:Showingresults}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showingresultsnum&action=edit showingresultsnum]
        -[[MediaWiki_talk:Showingresultsnum|Talk]] -
        -Showing below <b>$3</b> results starting with #<b>$2</b>. - -{{int:Showingresultsnum}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showlast&action=edit showlast]
        -[[MediaWiki_talk:Showlast|Talk]] -
        -Show last $1 images sorted $2. - -{{int:Showlast}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showpreview&action=edit showpreview]
        -[[MediaWiki_talk:Showpreview|Talk]] -
        -Show preview - -{{int:Showpreview}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showtoc&action=edit showtoc]
        -[[MediaWiki_talk:Showtoc|Talk]] -
        -show - -{{int:Showtoc}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sig_tip&action=edit sig_tip]
        -[[MediaWiki_talk:Sig_tip|Talk]] -
        -Your signature with timestamp - -{{int:Sig_tip}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitestats&action=edit sitestats]
        -[[MediaWiki_talk:Sitestats|Talk]] -
        -Site statistics - -{{int:Sitestats}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitestatstext&action=edit sitestatstext]
        -[[MediaWiki_talk:Sitestatstext|Talk]] -
        -There are '''$1''' total pages in the database. -This includes "talk" pages, pages about Wiktionary, minimal "stub" -pages, redirects, and others that probably don't qualify as content pages. -Excluding those, there are '''$2''' pages that are probably legitimate -content pages. - -There have been a total of '''$3''' page views, and '''$4''' page edits -since the wiki was setup. -That comes to '''$5''' average edits per page, and '''$6''' views per edit. - -{{int:Sitestatstext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitesubtitle&action=edit sitesubtitle]
        -[[MediaWiki_talk:Sitesubtitle|Talk]] -
        -The Free Encyclopedia - -{{int:Sitesubtitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitesupport&action=edit sitesupport]
        -[[MediaWiki_talk:Sitesupport|Talk]] -
        -Donations - -{{int:Sitesupport}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitetitle&action=edit sitetitle]
        -[[MediaWiki_talk:Sitetitle|Talk]] -
        -Wiktionary - -{{int:Sitetitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Siteuser&action=edit siteuser]
        -[[MediaWiki_talk:Siteuser|Talk]] -
        -Wiktionary user $1 - -{{int:Siteuser}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Siteusers&action=edit siteusers]
        -[[MediaWiki_talk:Siteusers|Talk]] -
        -Wiktionary user(s) $1 - -{{int:Siteusers}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Skin&action=edit skin]
        -[[MediaWiki_talk:Skin|Talk]] -
        -Skin - -{{int:Skin}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Spamprotectiontext&action=edit spamprotectiontext]
        -[[MediaWiki_talk:Spamprotectiontext|Talk]] -
        -The page you wanted to save was blocked by the spam filter. This is probably caused by a link to an external site. - -You might want to check the following regular expression for patterns that are currently blocked: - -{{int:Spamprotectiontext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Spamprotectiontitle&action=edit spamprotectiontitle]
        -[[MediaWiki_talk:Spamprotectiontitle|Talk]] -
        -Spam protection filter - -{{int:Spamprotectiontitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Specialpage&action=edit specialpage]
        -[[MediaWiki_talk:Specialpage|Talk]] -
        -Special Page - -{{int:Specialpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Specialpages&action=edit specialpages]
        -[[MediaWiki_talk:Specialpages|Talk]] -
        -Special pages - -{{int:Specialpages}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Spheading&action=edit spheading]
        -[[MediaWiki_talk:Spheading|Talk]] -
        -Special pages for all users - -{{int:Spheading}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sqlislogged&action=edit sqlislogged]
        -[[MediaWiki_talk:Sqlislogged|Talk]] -
        -Please note that all queries are logged. - -{{int:Sqlislogged}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sqlquery&action=edit sqlquery]
        -[[MediaWiki_talk:Sqlquery|Talk]] -
        -Enter query - -{{int:Sqlquery}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Statistics&action=edit statistics]
        -[[MediaWiki_talk:Statistics|Talk]] -
        -Statistics - -{{int:Statistics}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Storedversion&action=edit storedversion]
        -[[MediaWiki_talk:Storedversion|Talk]] -
        -Stored version - -{{int:Storedversion}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Stubthreshold&action=edit stubthreshold]
        -[[MediaWiki_talk:Stubthreshold|Talk]] -
        -Threshold for stub display - -{{int:Stubthreshold}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Subcategories&action=edit subcategories]
        -[[MediaWiki_talk:Subcategories|Talk]] -
        -Subcategories - -{{int:Subcategories}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Subject&action=edit subject]
        -[[MediaWiki_talk:Subject|Talk]] -
        -Subject/headline - -{{int:Subject}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Subjectpage&action=edit subjectpage]
        -[[MediaWiki_talk:Subjectpage|Talk]] -
        -View subject - -{{int:Subjectpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Successfulupload&action=edit successfulupload]
        -[[MediaWiki_talk:Successfulupload|Talk]] -
        -Successful upload - -{{int:Successfulupload}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Summary&action=edit summary]
        -[[MediaWiki_talk:Summary|Talk]] -
        -Summary - -{{int:Summary}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sysopspheading&action=edit sysopspheading]
        -[[MediaWiki_talk:Sysopspheading|Talk]] -
        -For sysop use only - -{{int:Sysopspheading}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sysoptext&action=edit sysoptext]
        -[[MediaWiki_talk:Sysoptext|Talk]] -
        -The action you have requested can only be -performed by users with "sysop" status. -See $1. - -{{int:Sysoptext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sysoptitle&action=edit sysoptitle]
        -[[MediaWiki_talk:Sysoptitle|Talk]] -
        -Sysop access required - -{{int:Sysoptitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tableform&action=edit tableform]
        -[[MediaWiki_talk:Tableform|Talk]] -
        -table - -{{int:Tableform}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talk&action=edit talk]
        -[[MediaWiki_talk:Talk|Talk]] -
        -Discussion - -{{int:Talk}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkexists&action=edit talkexists]
        -[[MediaWiki_talk:Talkexists|Talk]] -
        -The page itself was moved successfully, but the -talk page could not be moved because one already exists at the new -title. Please merge them manually. - -{{int:Talkexists}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkpage&action=edit talkpage]
        -[[MediaWiki_talk:Talkpage|Talk]] -
        -Discuss this page - -{{int:Talkpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkpagemoved&action=edit talkpagemoved]
        -[[MediaWiki_talk:Talkpagemoved|Talk]] -
        -The corresponding talk page was also moved. - -{{int:Talkpagemoved}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkpagenotmoved&action=edit talkpagenotmoved]
        -[[MediaWiki_talk:Talkpagenotmoved|Talk]] -
        -The corresponding talk page was <strong>not</strong> moved. - -{{int:Talkpagenotmoved}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkpagetext&action=edit talkpagetext]
        -[[MediaWiki_talk:Talkpagetext|Talk]] -
        -<!-- MediaWiki:talkpagetext --> - -{{int:Talkpagetext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Textboxsize&action=edit textboxsize]
        -[[MediaWiki_talk:Textboxsize|Talk]] -
        -Textbox dimensions - -{{int:Textboxsize}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Textmatches&action=edit textmatches]
        -[[MediaWiki_talk:Textmatches|Talk]] -
        -Page text matches - -{{int:Textmatches}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Thisisdeleted&action=edit thisisdeleted]
        -[[MediaWiki_talk:Thisisdeleted|Talk]] -
        -View or restore $1? - -{{int:Thisisdeleted}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Thumbnail-more&action=edit thumbnail-more]
        -[[MediaWiki_talk:Thumbnail-more|Talk]] -
        -Enlarge - -{{int:Thumbnail-more}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Timezonelegend&action=edit timezonelegend]
        -[[MediaWiki_talk:Timezonelegend|Talk]] -
        -Time zone - -{{int:Timezonelegend}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Timezoneoffset&action=edit timezoneoffset]
        -[[MediaWiki_talk:Timezoneoffset|Talk]] -
        -Offset - -{{int:Timezoneoffset}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Timezonetext&action=edit timezonetext]
        -[[MediaWiki_talk:Timezonetext|Talk]] -
        -Enter number of hours your local time differs -from server time (UTC). - -{{int:Timezonetext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Titlematches&action=edit titlematches]
        -[[MediaWiki_talk:Titlematches|Talk]] -
        -Article title matches - -{{int:Titlematches}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Toc&action=edit toc]
        -[[MediaWiki_talk:Toc|Talk]] -
        -Table of contents - -{{int:Toc}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Toolbox&action=edit toolbox]
        -[[MediaWiki_talk:Toolbox|Talk]] -
        -Toolbox - -{{int:Toolbox}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-addsection&action=edit tooltip-addsection]
        -[[MediaWiki_talk:Tooltip-addsection|Talk]] -
        -Add a comment to this page. [alt-+] - -{{int:Tooltip-addsection}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-anontalk&action=edit tooltip-anontalk]
        -[[MediaWiki_talk:Tooltip-anontalk|Talk]] -
        -Discussion about edits from this ip address [alt-n] - -{{int:Tooltip-anontalk}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-anonuserpage&action=edit tooltip-anonuserpage]
        -[[MediaWiki_talk:Tooltip-anonuserpage|Talk]] -
        -The user page for the ip you're editing as [alt-.] - -{{int:Tooltip-anonuserpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-article&action=edit tooltip-article]
        -[[MediaWiki_talk:Tooltip-article|Talk]] -
        -View the content page [alt-a] - -{{int:Tooltip-article}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-atom&action=edit tooltip-atom]
        -[[MediaWiki_talk:Tooltip-atom|Talk]] -
        -Atom feed for this page - -{{int:Tooltip-atom}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-compareselectedversions&action=edit tooltip-compareselectedversions]
        -[[MediaWiki_talk:Tooltip-compareselectedversions|Talk]] -
        -See the differences between the two selected versions of this page. [alt-v] - -{{int:Tooltip-compareselectedversions}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-contributions&action=edit tooltip-contributions]
        -[[MediaWiki_talk:Tooltip-contributions|Talk]] -
        -View the list of contributions of this user - -{{int:Tooltip-contributions}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-currentevents&action=edit tooltip-currentevents]
        -[[MediaWiki_talk:Tooltip-currentevents|Talk]] -
        -Find background information on current events - -{{int:Tooltip-currentevents}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-delete&action=edit tooltip-delete]
        -[[MediaWiki_talk:Tooltip-delete|Talk]] -
        -Delete this page [alt-d] - -{{int:Tooltip-delete}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-edit&action=edit tooltip-edit]
        -[[MediaWiki_talk:Tooltip-edit|Talk]] -
        -You can edit this page. Please use the preview button before saving. [alt-e] - -{{int:Tooltip-edit}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-emailuser&action=edit tooltip-emailuser]
        -[[MediaWiki_talk:Tooltip-emailuser|Talk]] -
        -Send a mail to this user - -{{int:Tooltip-emailuser}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-help&action=edit tooltip-help]
        -[[MediaWiki_talk:Tooltip-help|Talk]] -
        -The place to find out. - -{{int:Tooltip-help}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-history&action=edit tooltip-history]
        -[[MediaWiki_talk:Tooltip-history|Talk]] -
        -Past versions of this page, [alt-h] - -{{int:Tooltip-history}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-login&action=edit tooltip-login]
        -[[MediaWiki_talk:Tooltip-login|Talk]] -
        -You are encouraged to log in, it is not mandatory however. [alt-o] - -{{int:Tooltip-login}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-logout&action=edit tooltip-logout]
        -[[MediaWiki_talk:Tooltip-logout|Talk]] -
        -Log out [alt-o] - -{{int:Tooltip-logout}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-mainpage&action=edit tooltip-mainpage]
        -[[MediaWiki_talk:Tooltip-mainpage|Talk]] -
        -Visit the Main Page [alt-z] - -{{int:Tooltip-mainpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-minoredit&action=edit tooltip-minoredit]
        -[[MediaWiki_talk:Tooltip-minoredit|Talk]] -
        -Mark this as a minor edit [alt-i] - -{{int:Tooltip-minoredit}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-move&action=edit tooltip-move]
        -[[MediaWiki_talk:Tooltip-move|Talk]] -
        -Move this page [alt-m] - -{{int:Tooltip-move}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-mycontris&action=edit tooltip-mycontris]
        -[[MediaWiki_talk:Tooltip-mycontris|Talk]] -
        -List of my contributions [alt-y] - -{{int:Tooltip-mycontris}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-mytalk&action=edit tooltip-mytalk]
        -[[MediaWiki_talk:Tooltip-mytalk|Talk]] -
        -My talk page [alt-n] - -{{int:Tooltip-mytalk}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-nomove&action=edit tooltip-nomove]
        -[[MediaWiki_talk:Tooltip-nomove|Talk]] -
        -You don't have the permissions to move this page - -{{int:Tooltip-nomove}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-portal&action=edit tooltip-portal]
        -[[MediaWiki_talk:Tooltip-portal|Talk]] -
        -About the project, what you can do, where to find things - -{{int:Tooltip-portal}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-preferences&action=edit tooltip-preferences]
        -[[MediaWiki_talk:Tooltip-preferences|Talk]] -
        -My preferences - -{{int:Tooltip-preferences}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-preview&action=edit tooltip-preview]
        -[[MediaWiki_talk:Tooltip-preview|Talk]] -
        -Preview your changes, please use this before saving! [alt-p] - -{{int:Tooltip-preview}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-protect&action=edit tooltip-protect]
        -[[MediaWiki_talk:Tooltip-protect|Talk]] -
        -Protect this page [alt-=] - -{{int:Tooltip-protect}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-randompage&action=edit tooltip-randompage]
        -[[MediaWiki_talk:Tooltip-randompage|Talk]] -
        -Load a random page [alt-x] - -{{int:Tooltip-randompage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-recentchanges&action=edit tooltip-recentchanges]
        -[[MediaWiki_talk:Tooltip-recentchanges|Talk]] -
        -The list of recent changes in the wiki. [alt-r] - -{{int:Tooltip-recentchanges}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-recentchangeslinked&action=edit tooltip-recentchangeslinked]
        -[[MediaWiki_talk:Tooltip-recentchangeslinked|Talk]] -
        -Recent changes in pages linking to this page [alt-c] - -{{int:Tooltip-recentchangeslinked}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-rss&action=edit tooltip-rss]
        -[[MediaWiki_talk:Tooltip-rss|Talk]] -
        -RSS feed for this page - -{{int:Tooltip-rss}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-save&action=edit tooltip-save]
        -[[MediaWiki_talk:Tooltip-save|Talk]] -
        -Save your changes [alt-s] - -{{int:Tooltip-save}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-search&action=edit tooltip-search]
        -[[MediaWiki_talk:Tooltip-search|Talk]] -
        -Search this wiki [alt-f] - -{{int:Tooltip-search}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-sitesupport&action=edit tooltip-sitesupport]
        -[[MediaWiki_talk:Tooltip-sitesupport|Talk]] -
        -Support Wiktionary - -{{int:Tooltip-sitesupport}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-specialpage&action=edit tooltip-specialpage]
        -[[MediaWiki_talk:Tooltip-specialpage|Talk]] -
        -This is a special page, you can't edit the page itself. - -{{int:Tooltip-specialpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-specialpages&action=edit tooltip-specialpages]
        -[[MediaWiki_talk:Tooltip-specialpages|Talk]] -
        -List of all special pages [alt-q] - -{{int:Tooltip-specialpages}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-talk&action=edit tooltip-talk]
        -[[MediaWiki_talk:Tooltip-talk|Talk]] -
        -Discussion about the content page [alt-t] - -{{int:Tooltip-talk}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-undelete&action=edit tooltip-undelete]
        -[[MediaWiki_talk:Tooltip-undelete|Talk]] -
        -Restore the $1 edits done to this page before it was deleted [alt-d] - -{{int:Tooltip-undelete}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-unwatch&action=edit tooltip-unwatch]
        -[[MediaWiki_talk:Tooltip-unwatch|Talk]] -
        -Remove this page from your watchlist [alt-w] - -{{int:Tooltip-unwatch}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-upload&action=edit tooltip-upload]
        -[[MediaWiki_talk:Tooltip-upload|Talk]] -
        -Upload images or media files [alt-u] - -{{int:Tooltip-upload}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-userpage&action=edit tooltip-userpage]
        -[[MediaWiki_talk:Tooltip-userpage|Talk]] -
        -My user page [alt-.] - -{{int:Tooltip-userpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-viewsource&action=edit tooltip-viewsource]
        -[[MediaWiki_talk:Tooltip-viewsource|Talk]] -
        -This page is protected. You can view its source. [alt-e] - -{{int:Tooltip-viewsource}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-watch&action=edit tooltip-watch]
        -[[MediaWiki_talk:Tooltip-watch|Talk]] -
        -Add this page to your watchlist [alt-w] - -{{int:Tooltip-watch}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-watchlist&action=edit tooltip-watchlist]
        -[[MediaWiki_talk:Tooltip-watchlist|Talk]] -
        -The list of pages you're monitoring for changes. [alt-l] - -{{int:Tooltip-watchlist}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-whatlinkshere&action=edit tooltip-whatlinkshere]
        -[[MediaWiki_talk:Tooltip-whatlinkshere|Talk]] -
        -List of all wiki pages that link here [alt-b] - -{{int:Tooltip-whatlinkshere}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uclinks&action=edit uclinks]
        -[[MediaWiki_talk:Uclinks|Talk]] -
        -View the last $1 changes; view the last $2 days. - -{{int:Uclinks}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ucnote&action=edit ucnote]
        -[[MediaWiki_talk:Ucnote|Talk]] -
        -Below are this user's last <b>$1</b> changes in the last <b>$2</b> days. - -{{int:Ucnote}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uctop&action=edit uctop]
        -[[MediaWiki_talk:Uctop|Talk]] -
        - (top) - -{{int:Uctop}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unblockip&action=edit unblockip]
        -[[MediaWiki_talk:Unblockip|Talk]] -
        -Unblock user - -{{int:Unblockip}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unblockiptext&action=edit unblockiptext]
        -[[MediaWiki_talk:Unblockiptext|Talk]] -
        -Use the form below to restore write access -to a previously blocked IP address or username. - -{{int:Unblockiptext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unblocklink&action=edit unblocklink]
        -[[MediaWiki_talk:Unblocklink|Talk]] -
        -unblock - -{{int:Unblocklink}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unblocklogentry&action=edit unblocklogentry]
        -[[MediaWiki_talk:Unblocklogentry|Talk]] -
        -unblocked "$1" - -{{int:Unblocklogentry}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undelete&action=edit undelete]
        -[[MediaWiki_talk:Undelete|Talk]] -
        -Restore deleted page - -{{int:Undelete}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undelete_short&action=edit undelete_short]
        -[[MediaWiki_talk:Undelete_short|Talk]] -
        -Undelete $1 edits - -{{int:Undelete_short}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletearticle&action=edit undeletearticle]
        -[[MediaWiki_talk:Undeletearticle|Talk]] -
        -Restore deleted page - -{{int:Undeletearticle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletebtn&action=edit undeletebtn]
        -[[MediaWiki_talk:Undeletebtn|Talk]] -
        -Restore! - -{{int:Undeletebtn}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletedarticle&action=edit undeletedarticle]
        -[[MediaWiki_talk:Undeletedarticle|Talk]] -
        -restored "$1" - -{{int:Undeletedarticle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletedtext&action=edit undeletedtext]
        -[[MediaWiki_talk:Undeletedtext|Talk]] -
        -[[$1]] has been successfully restored. -See [[Wiktionary:Deletion_log]] for a record of recent deletions and restorations. - -{{int:Undeletedtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletehistory&action=edit undeletehistory]
        -[[MediaWiki_talk:Undeletehistory|Talk]] -
        -If you restore the page, all revisions will be restored to the history. -If a new page with the same name has been created since the deletion, the restored -revisions will appear in the prior history, and the current revision of the live page -will not be automatically replaced. - -{{int:Undeletehistory}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletepage&action=edit undeletepage]
        -[[MediaWiki_talk:Undeletepage|Talk]] -
        -View and restore deleted pages - -{{int:Undeletepage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletepagetext&action=edit undeletepagetext]
        -[[MediaWiki_talk:Undeletepagetext|Talk]] -
        -The following pages have been deleted but are still in the archive and -can be restored. The archive may be periodically cleaned out. - -{{int:Undeletepagetext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeleterevision&action=edit undeleterevision]
        -[[MediaWiki_talk:Undeleterevision|Talk]] -
        -Deleted revision as of $1 - -{{int:Undeleterevision}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeleterevisions&action=edit undeleterevisions]
        -[[MediaWiki_talk:Undeleterevisions|Talk]] -
        -$1 revisions archived - -{{int:Undeleterevisions}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unexpected&action=edit unexpected]
        -[[MediaWiki_talk:Unexpected|Talk]] -
        -Unexpected value: "$1"="$2". - -{{int:Unexpected}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockbtn&action=edit unlockbtn]
        -[[MediaWiki_talk:Unlockbtn|Talk]] -
        -Unlock database - -{{int:Unlockbtn}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockconfirm&action=edit unlockconfirm]
        -[[MediaWiki_talk:Unlockconfirm|Talk]] -
        -Yes, I really want to unlock the database. - -{{int:Unlockconfirm}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockdb&action=edit unlockdb]
        -[[MediaWiki_talk:Unlockdb|Talk]] -
        -Unlock database - -{{int:Unlockdb}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockdbsuccesssub&action=edit unlockdbsuccesssub]
        -[[MediaWiki_talk:Unlockdbsuccesssub|Talk]] -
        -Database lock removed - -{{int:Unlockdbsuccesssub}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockdbsuccesstext&action=edit unlockdbsuccesstext]
        -[[MediaWiki_talk:Unlockdbsuccesstext|Talk]] -
        -The database has been unlocked. - -{{int:Unlockdbsuccesstext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockdbtext&action=edit unlockdbtext]
        -[[MediaWiki_talk:Unlockdbtext|Talk]] -
        -Unlocking the database will restore the ability of all -users to edit pages, change their preferences, edit their watchlists, and -other things requiring changes in the database. -Please confirm that this is what you intend to do. - -{{int:Unlockdbtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotect&action=edit unprotect]
        -[[MediaWiki_talk:Unprotect|Talk]] -
        -Unprotect - -{{int:Unprotect}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotectcomment&action=edit unprotectcomment]
        -[[MediaWiki_talk:Unprotectcomment|Talk]] -
        -Reason for unprotecting - -{{int:Unprotectcomment}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotectedarticle&action=edit unprotectedarticle]
        -[[MediaWiki_talk:Unprotectedarticle|Talk]] -
        -unprotected [[$1]] - -{{int:Unprotectedarticle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotectsub&action=edit unprotectsub]
        -[[MediaWiki_talk:Unprotectsub|Talk]] -
        -(Unprotecting "$1") - -{{int:Unprotectsub}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotectthispage&action=edit unprotectthispage]
        -[[MediaWiki_talk:Unprotectthispage|Talk]] -
        -Unprotect this page - -{{int:Unprotectthispage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unusedimages&action=edit unusedimages]
        -[[MediaWiki_talk:Unusedimages|Talk]] -
        -Unused images - -{{int:Unusedimages}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unusedimagestext&action=edit unusedimagestext]
        -[[MediaWiki_talk:Unusedimagestext|Talk]] -
        -<p>Please note that other web sites may link to an image with -a direct URL, and so may still be listed here despite being -in active use. - -{{int:Unusedimagestext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unwatch&action=edit unwatch]
        -[[MediaWiki_talk:Unwatch|Talk]] -
        -Unwatch - -{{int:Unwatch}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unwatchthispage&action=edit unwatchthispage]
        -[[MediaWiki_talk:Unwatchthispage|Talk]] -
        -Stop watching - -{{int:Unwatchthispage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Updated&action=edit updated]
        -[[MediaWiki_talk:Updated|Talk]] -
        -(Updated) - -{{int:Updated}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Upload&action=edit upload]
        -[[MediaWiki_talk:Upload|Talk]] -
        -Upload file - -{{int:Upload}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadbtn&action=edit uploadbtn]
        -[[MediaWiki_talk:Uploadbtn|Talk]] -
        -Upload file - -{{int:Uploadbtn}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploaddisabled&action=edit uploaddisabled]
        -[[MediaWiki_talk:Uploaddisabled|Talk]] -
        -Sorry, uploading is disabled. - -{{int:Uploaddisabled}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadedfiles&action=edit uploadedfiles]
        -[[MediaWiki_talk:Uploadedfiles|Talk]] -
        -Uploaded files - -{{int:Uploadedfiles}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadedimage&action=edit uploadedimage]
        -[[MediaWiki_talk:Uploadedimage|Talk]] -
        -uploaded "$1" - -{{int:Uploadedimage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploaderror&action=edit uploaderror]
        -[[MediaWiki_talk:Uploaderror|Talk]] -
        -Upload error - -{{int:Uploaderror}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadfile&action=edit uploadfile]
        -[[MediaWiki_talk:Uploadfile|Talk]] -
        -Upload images, sounds, documents etc. - -{{int:Uploadfile}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadlink&action=edit uploadlink]
        -[[MediaWiki_talk:Uploadlink|Talk]] -
        -Upload images - -{{int:Uploadlink}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadlog&action=edit uploadlog]
        -[[MediaWiki_talk:Uploadlog|Talk]] -
        -upload log - -{{int:Uploadlog}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadlogpage&action=edit uploadlogpage]
        -[[MediaWiki_talk:Uploadlogpage|Talk]] -
        -Upload_log - -{{int:Uploadlogpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadlogpagetext&action=edit uploadlogpagetext]
        -[[MediaWiki_talk:Uploadlogpagetext|Talk]] -
        -Below is a list of the most recent file uploads. -All times shown are server time (UTC). -<ul> -</ul> - - -{{int:Uploadlogpagetext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadnologin&action=edit uploadnologin]
        -[[MediaWiki_talk:Uploadnologin|Talk]] -
        -Not logged in - -{{int:Uploadnologin}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadnologintext&action=edit uploadnologintext]
        -[[MediaWiki_talk:Uploadnologintext|Talk]] -
        -You must be <a href="/wiki/Special:Userlogin">logged in</a> -to upload files. - -{{int:Uploadnologintext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadtext&action=edit uploadtext]
        -[[MediaWiki_talk:Uploadtext|Talk]] -
        -<strong>STOP!</strong> Before you upload here, -make sure to read and follow the <a href="/wiki/Special:Image_use_policy">image use policy</a>. -<p>If a file with the name you are specifying already -exists on the wiki, it'll be replaced without warning. -So unless you mean to update a file, it's a good idea -to first check if such a file exists. -<p>To view or search previously uploaded images, -go to the <a href="/wiki/Special:Imagelist">list of uploaded images</a>. -Uploads and deletions are logged on the <a href="/wiki/Wiktionary:Upload_log">upload log</a>. -</p><p>Use the form below to upload new image files for use in -illustrating your pages. -On most browsers, you will see a "Browse..." button, which will -bring up your operating system's standard file open dialog. -Choosing a file will fill the name of that file into the text -field next to the button. -You must also check the box affirming that you are not -violating any copyrights by uploading the file. -Press the "Upload" button to finish the upload. -This may take some time if you have a slow internet connection. -<p>The preferred formats are JPEG for photographic images, PNG -for drawings and other iconic images, and OGG for sounds. -Please name your files descriptively to avoid confusion. -To include the image in a page, use a link in the form -<b>[[Image:file.jpg]]</b> or <b>[[Image:file.png|alt text]]</b> -or <b>[[Media:file.ogg]]</b> for sounds. -<p>Please note that as with wiki pages, others may edit or -delete your uploads if they think it serves the project, and -you may be blocked from uploading if you abuse the system. - -{{int:Uploadtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadwarning&action=edit uploadwarning]
        -[[MediaWiki_talk:Uploadwarning|Talk]] -
        -Upload warning - -{{int:Uploadwarning}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:User_rights_set&action=edit user_rights_set]
        -[[MediaWiki_talk:User_rights_set|Talk]] -
        -<b>User rights for "$1" updated</b> - -{{int:User_rights_set}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Usercssjs&action=edit usercssjs]
        -[[MediaWiki_talk:Usercssjs|Talk]] -
        -'''Note:''' After saving, you have to tell your bowser to get the new version: '''Mozilla:''' click ''reload''(or ''ctrl-r''), '''IE / Opera:''' ''ctrl-f5'', '''Safari:''' ''cmd-r'', '''Konqueror''' ''ctrl-r''. - -{{int:Usercssjs}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Usercssjsyoucanpreview&action=edit usercssjsyoucanpreview]
        -[[MediaWiki_talk:Usercssjsyoucanpreview|Talk]] -
        -<strong>Tip:</strong> Use the 'Show preview' button to test your new css/js before saving. - -{{int:Usercssjsyoucanpreview}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Usercsspreview&action=edit usercsspreview]
        -[[MediaWiki_talk:Usercsspreview|Talk]] -
        -'''Remember that you are only previewing your user css, it has not yet been saved!''' - -{{int:Usercsspreview}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userexists&action=edit userexists]
        -[[MediaWiki_talk:Userexists|Talk]] -
        -The user name you entered is already in use. Please choose a different name. - -{{int:Userexists}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userjspreview&action=edit userjspreview]
        -[[MediaWiki_talk:Userjspreview|Talk]] -
        -'''Remember that you are only testing/previewing your user javascript, it has not yet been saved!''' - -{{int:Userjspreview}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userlogin&action=edit userlogin]
        -[[MediaWiki_talk:Userlogin|Talk]] -
        -Log in - -{{int:Userlogin}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userlogout&action=edit userlogout]
        -[[MediaWiki_talk:Userlogout|Talk]] -
        -Log out - -{{int:Userlogout}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Usermailererror&action=edit usermailererror]
        -[[MediaWiki_talk:Usermailererror|Talk]] -
        -Mail object returned error: - -{{int:Usermailererror}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userpage&action=edit userpage]
        -[[MediaWiki_talk:Userpage|Talk]] -
        -View user page - -{{int:Userpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userstats&action=edit userstats]
        -[[MediaWiki_talk:Userstats|Talk]] -
        -User statistics - -{{int:Userstats}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userstatstext&action=edit userstatstext]
        -[[MediaWiki_talk:Userstatstext|Talk]] -
        -There are '''$1''' registered users. -'''$2''' of these are administrators (see $3). - -{{int:Userstatstext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Version&action=edit version]
        -[[MediaWiki_talk:Version|Talk]] -
        -Version - -{{int:Version}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Viewcount&action=edit viewcount]
        -[[MediaWiki_talk:Viewcount|Talk]] -
        -This page has been accessed $1 times. - -{{int:Viewcount}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Viewprevnext&action=edit viewprevnext]
        -[[MediaWiki_talk:Viewprevnext|Talk]] -
        -View ($1) ($2) ($3). - -{{int:Viewprevnext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Viewsource&action=edit viewsource]
        -[[MediaWiki_talk:Viewsource|Talk]] -
        -View source - -{{int:Viewsource}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Viewtalkpage&action=edit viewtalkpage]
        -[[MediaWiki_talk:Viewtalkpage|Talk]] -
        -View discussion - -{{int:Viewtalkpage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wantedpages&action=edit wantedpages]
        -[[MediaWiki_talk:Wantedpages|Talk]] -
        -Wanted pages - -{{int:Wantedpages}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watch&action=edit watch]
        -[[MediaWiki_talk:Watch|Talk]] -
        -Watch - -{{int:Watch}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchdetails&action=edit watchdetails]
        -[[MediaWiki_talk:Watchdetails|Talk]] -
        -($1 pages watched not counting talk pages; -$2 total pages edited since cutoff; -$3... -<a href='$4'>show and edit complete list</a>.) - -{{int:Watchdetails}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watcheditlist&action=edit watcheditlist]
        -[[MediaWiki_talk:Watcheditlist|Talk]] -
        -Here's an alphabetical list of your -watched pages. Check the boxes of pages you want to remove -from your watchlist and click the 'remove checked' button -at the bottom of the screen. - -{{int:Watcheditlist}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchlist&action=edit watchlist]
        -[[MediaWiki_talk:Watchlist|Talk]] -
        -My watchlist - -{{int:Watchlist}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchlistcontains&action=edit watchlistcontains]
        -[[MediaWiki_talk:Watchlistcontains|Talk]] -
        -Your watchlist contains $1 pages. - -{{int:Watchlistcontains}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchlistsub&action=edit watchlistsub]
        -[[MediaWiki_talk:Watchlistsub|Talk]] -
        -(for user "$1") - -{{int:Watchlistsub}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchmethod-list&action=edit watchmethod-list]
        -[[MediaWiki_talk:Watchmethod-list|Talk]] -
        -checking watched pages for recent edits - -{{int:Watchmethod-list}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchmethod-recent&action=edit watchmethod-recent]
        -[[MediaWiki_talk:Watchmethod-recent|Talk]] -
        -checking recent edits for watched pages - -{{int:Watchmethod-recent}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchnochange&action=edit watchnochange]
        -[[MediaWiki_talk:Watchnochange|Talk]] -
        -None of your watched items were edited in the time period displayed. - -{{int:Watchnochange}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchnologin&action=edit watchnologin]
        -[[MediaWiki_talk:Watchnologin|Talk]] -
        -Not logged in - -{{int:Watchnologin}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchnologintext&action=edit watchnologintext]
        -[[MediaWiki_talk:Watchnologintext|Talk]] -
        -You must be <a href="/wiki/Special:Userlogin">logged in</a> -to modify your watchlist. - -{{int:Watchnologintext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchthis&action=edit watchthis]
        -[[MediaWiki_talk:Watchthis|Talk]] -
        -Watch this page - -{{int:Watchthis}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchthispage&action=edit watchthispage]
        -[[MediaWiki_talk:Watchthispage|Talk]] -
        -Watch this page - -{{int:Watchthispage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Welcomecreation&action=edit welcomecreation]
        -[[MediaWiki_talk:Welcomecreation|Talk]] -
        -<h2>Welcome, $1!</h2><p>Your account has been created. -Don't forget to change your Wiktionary preferences. - -{{int:Welcomecreation}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whatlinkshere&action=edit whatlinkshere]
        -[[MediaWiki_talk:Whatlinkshere|Talk]] -
        -What links here - -{{int:Whatlinkshere}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistacctext&action=edit whitelistacctext]
        -[[MediaWiki_talk:Whitelistacctext|Talk]] -
        -To be allowed to create accounts in this Wiki you have to [[Special:Userlogin|log]] in and have the appropriate permissions. - -{{int:Whitelistacctext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistacctitle&action=edit whitelistacctitle]
        -[[MediaWiki_talk:Whitelistacctitle|Talk]] -
        -You are not allowed to create an account - -{{int:Whitelistacctitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistedittext&action=edit whitelistedittext]
        -[[MediaWiki_talk:Whitelistedittext|Talk]] -
        -You have to [[Special:Userlogin|login]] to edit pages. - -{{int:Whitelistedittext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistedittitle&action=edit whitelistedittitle]
        -[[MediaWiki_talk:Whitelistedittitle|Talk]] -
        -Login required to edit - -{{int:Whitelistedittitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistreadtext&action=edit whitelistreadtext]
        -[[MediaWiki_talk:Whitelistreadtext|Talk]] -
        -You have to [[Special:Userlogin|login]] to read pages. - -{{int:Whitelistreadtext}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistreadtitle&action=edit whitelistreadtitle]
        -[[MediaWiki_talk:Whitelistreadtitle|Talk]] -
        -Login required to read - -{{int:Whitelistreadtitle}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wikipediapage&action=edit wikipediapage]
        -[[MediaWiki_talk:Wikipediapage|Talk]] -
        -View project page - -{{int:Wikipediapage}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wikititlesuffix&action=edit wikititlesuffix]
        -[[MediaWiki_talk:Wikititlesuffix|Talk]] -
        -Wiktionary - -{{int:Wikititlesuffix}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wlnote&action=edit wlnote]
        -[[MediaWiki_talk:Wlnote|Talk]] -
        -Below are the last $1 changes in the last <b>$2</b> hours. - -{{int:Wlnote}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wlsaved&action=edit wlsaved]
        -[[MediaWiki_talk:Wlsaved|Talk]] -
        -This is a saved version of your watchlist. - -{{int:Wlsaved}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wlshowlast&action=edit wlshowlast]
        -[[MediaWiki_talk:Wlshowlast|Talk]] -
        -Show last $1 hours $2 days $3 - -{{int:Wlshowlast}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wrong_wfQuery_params&action=edit wrong_wfQuery_params]
        -[[MediaWiki_talk:Wrong_wfQuery_params|Talk]] -
        -Incorrect parameters to wfQuery()<br /> -Function: $1<br /> -Query: $2 - - -{{int:Wrong_wfQuery_params}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wrongpassword&action=edit wrongpassword]
        -[[MediaWiki_talk:Wrongpassword|Talk]] -
        -The password you entered is incorrect. Please try again. - -{{int:Wrongpassword}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourdiff&action=edit yourdiff]
        -[[MediaWiki_talk:Yourdiff|Talk]] -
        -Differences - -{{int:Yourdiff}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Youremail&action=edit youremail]
        -[[MediaWiki_talk:Youremail|Talk]] -
        -Your email* - -{{int:Youremail}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourname&action=edit yourname]
        -[[MediaWiki_talk:Yourname|Talk]] -
        -Your user name - -{{int:Yourname}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yournick&action=edit yournick]
        -[[MediaWiki_talk:Yournick|Talk]] -
        -Your nickname (for signatures) - -{{int:Yournick}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourpassword&action=edit yourpassword]
        -[[MediaWiki_talk:Yourpassword|Talk]] -
        -Your password - -{{int:Yourpassword}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourpasswordagain&action=edit yourpasswordagain]
        -[[MediaWiki_talk:Yourpasswordagain|Talk]] -
        -Retype password - -{{int:Yourpasswordagain}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourrealname&action=edit yourrealname]
        -[[MediaWiki_talk:Yourrealname|Talk]] -
        -Your real name* - -{{int:Yourrealname}} -
        -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourtext&action=edit yourtext]
        -[[MediaWiki_talk:Yourtext|Talk]] -
        -Your text - -{{int:Yourtext}} -
        - diff --git a/tests/parser/preprocess/Factorial.expected b/tests/parser/preprocess/Factorial.expected deleted file mode 100644 index a10fd6ca..00000000 --- a/tests/parser/preprocess/Factorial.expected +++ /dev/null @@ -1,17 +0,0 @@ -1011*011*021*031*041*051*061*071*081*091*101*111*121*131*141*151*161*171*181*191*201*211*221*231*241*251*261*271*281*291*301*311*321*331*341*351*361*371*381*391*401*411*421*431*441*451*461*471*481*491*501*511*521*531*541*551*561*571*581*591*601*611*621*631*641*651*661*671*681*691*701*711*721*731*741*751*761*771*781*791*801*811*821*831*841*851*861*871*881*891*901*911*921*931*941*951*961*971*981*99<noinclude> - -This template finds the [[factorial]] of a number. To use it, enter:<br /> -<code><nowiki></nowiki></code><br /> -The input must be a positive interger smaller than 100 (better than most calculators, which go up to only 69). This template works by repeating conditional multiplications. Examples:<br /> -*<nowiki></nowiki> gives -*<nowiki></nowiki> gives -*<nowiki></nowiki> gives -*<nowiki></nowiki> gives -*<nowiki></nowiki> gives -*<nowiki></nowiki> gives (invalid input) -*<nowiki></nowiki> gives (invalid input) - -[[Category:Mathematical templates|]] -</noinclude> - - \ No newline at end of file diff --git a/tests/parser/preprocess/Factorial.txt b/tests/parser/preprocess/Factorial.txt deleted file mode 100644 index 316f0792..00000000 --- a/tests/parser/preprocess/Factorial.txt +++ /dev/null @@ -1,16 +0,0 @@ -{{#expr:{{#ifeq:{{#expr:{{{1}}}>=00}}|1|01{{#ifeq:{{#expr:{{{1}}}>=01}}|1|*01{{#ifeq:{{#expr:{{{1}}}>=02}}|1|*02{{#ifeq:{{#expr:{{{1}}}>=03}}|1|*03{{#ifeq:{{#expr:{{{1}}}>=04}}|1|*04{{#ifeq:{{#expr:{{{1}}}>=05}}|1|*05{{#ifeq:{{#expr:{{{1}}}>=06}}|1|*06{{#ifeq:{{#expr:{{{1}}}>=07}}|1|*07{{#ifeq:{{#expr:{{{1}}}>=08}}|1|*08{{#ifeq:{{#expr:{{{1}}}>=09}}|1|*09{{#ifeq:{{#expr:{{{1}}}>=10}}|1|*10{{#ifeq:{{#expr:{{{1}}}>=11}}|1|*11{{#ifeq:{{#expr:{{{1}}}>=12}}|1|*12{{#ifeq:{{#expr:{{{1}}}>=13}}|1|*13{{#ifeq:{{#expr:{{{1}}}>=14}}|1|*14{{#ifeq:{{#expr:{{{1}}}>=15}}|1|*15{{#ifeq:{{#expr:{{{1}}}>=16}}|1|*16{{#ifeq:{{#expr:{{{1}}}>=17}}|1|*17{{#ifeq:{{#expr:{{{1}}}>=18}}|1|*18{{#ifeq:{{#expr:{{{1}}}>=19}}|1|*19{{#ifeq:{{#expr:{{{1}}}>=20}}|1|*20{{#ifeq:{{#expr:{{{1}}}>=21}}|1|*21{{#ifeq:{{#expr:{{{1}}}>=22}}|1|*22{{#ifeq:{{#expr:{{{1}}}>=23}}|1|*23{{#ifeq:{{#expr:{{{1}}}>=24}}|1|*24{{#ifeq:{{#expr:{{{1}}}>=25}}|1|*25{{#ifeq:{{#expr:{{{1}}}>=26}}|1|*26{{#ifeq:{{#expr:{{{1}}}>=27}}|1|*27{{#ifeq:{{#expr:{{{1}}}>=28}}|1|*28{{#ifeq:{{#expr:{{{1}}}>=29}}|1|*29{{#ifeq:{{#expr:{{{1}}}>=30}}|1|*30{{#ifeq:{{#expr:{{{1}}}>=31}}|1|*31{{#ifeq:{{#expr:{{{1}}}>=32}}|1|*32{{#ifeq:{{#expr:{{{1}}}>=33}}|1|*33{{#ifeq:{{#expr:{{{1}}}>=34}}|1|*34{{#ifeq:{{#expr:{{{1}}}>=35}}|1|*35{{#ifeq:{{#expr:{{{1}}}>=36}}|1|*36{{#ifeq:{{#expr:{{{1}}}>=37}}|1|*37{{#ifeq:{{#expr:{{{1}}}>=38}}|1|*38{{#ifeq:{{#expr:{{{1}}}>=39}}|1|*39{{#ifeq:{{#expr:{{{1}}}>=40}}|1|*40{{#ifeq:{{#expr:{{{1}}}>=41}}|1|*41{{#ifeq:{{#expr:{{{1}}}>=42}}|1|*42{{#ifeq:{{#expr:{{{1}}}>=43}}|1|*43{{#ifeq:{{#expr:{{{1}}}>=44}}|1|*44{{#ifeq:{{#expr:{{{1}}}>=45}}|1|*45{{#ifeq:{{#expr:{{{1}}}>=46}}|1|*46{{#ifeq:{{#expr:{{{1}}}>=47}}|1|*47{{#ifeq:{{#expr:{{{1}}}>=48}}|1|*48{{#ifeq:{{#expr:{{{1}}}>=49}}|1|*49{{#ifeq:{{#expr:{{{1}}}>=50}}|1|*50{{#ifeq:{{#expr:{{{1}}}>=51}}|1|*51{{#ifeq:{{#expr:{{{1}}}>=52}}|1|*52{{#ifeq:{{#expr:{{{1}}}>=53}}|1|*53{{#ifeq:{{#expr:{{{1}}}>=54}}|1|*54{{#ifeq:{{#expr:{{{1}}}>=55}}|1|*55{{#ifeq:{{#expr:{{{1}}}>=56}}|1|*56{{#ifeq:{{#expr:{{{1}}}>=57}}|1|*57{{#ifeq:{{#expr:{{{1}}}>=58}}|1|*58{{#ifeq:{{#expr:{{{1}}}>=59}}|1|*59{{#ifeq:{{#expr:{{{1}}}>=60}}|1|*60{{#ifeq:{{#expr:{{{1}}}>=61}}|1|*61{{#ifeq:{{#expr:{{{1}}}>=62}}|1|*62{{#ifeq:{{#expr:{{{1}}}>=63}}|1|*63{{#ifeq:{{#expr:{{{1}}}>=64}}|1|*64{{#ifeq:{{#expr:{{{1}}}>=65}}|1|*65{{#ifeq:{{#expr:{{{1}}}>=66}}|1|*66{{#ifeq:{{#expr:{{{1}}}>=67}}|1|*67{{#ifeq:{{#expr:{{{1}}}>=68}}|1|*68{{#ifeq:{{#expr:{{{1}}}>=69}}|1|*69{{#ifeq:{{#expr:{{{1}}}>=70}}|1|*70{{#ifeq:{{#expr:{{{1}}}>=71}}|1|*71{{#ifeq:{{#expr:{{{1}}}>=72}}|1|*72{{#ifeq:{{#expr:{{{1}}}>=73}}|1|*73{{#ifeq:{{#expr:{{{1}}}>=74}}|1|*74{{#ifeq:{{#expr:{{{1}}}>=75}}|1|*75{{#ifeq:{{#expr:{{{1}}}>=76}}|1|*76{{#ifeq:{{#expr:{{{1}}}>=77}}|1|*77{{#ifeq:{{#expr:{{{1}}}>=78}}|1|*78{{#ifeq:{{#expr:{{{1}}}>=79}}|1|*79{{#ifeq:{{#expr:{{{1}}}>=80}}|1|*80{{#ifeq:{{#expr:{{{1}}}>=81}}|1|*81{{#ifeq:{{#expr:{{{1}}}>=82}}|1|*82{{#ifeq:{{#expr:{{{1}}}>=83}}|1|*83{{#ifeq:{{#expr:{{{1}}}>=84}}|1|*84{{#ifeq:{{#expr:{{{1}}}>=85}}|1|*85{{#ifeq:{{#expr:{{{1}}}>=86}}|1|*86{{#ifeq:{{#expr:{{{1}}}>=87}}|1|*87{{#ifeq:{{#expr:{{{1}}}>=88}}|1|*88{{#ifeq:{{#expr:{{{1}}}>=89}}|1|*89{{#ifeq:{{#expr:{{{1}}}>=90}}|1|*90{{#ifeq:{{#expr:{{{1}}}>=91}}|1|*91{{#ifeq:{{#expr:{{{1}}}>=92}}|1|*92{{#ifeq:{{#expr:{{{1}}}>=93}}|1|*93{{#ifeq:{{#expr:{{{1}}}>=94}}|1|*94{{#ifeq:{{#expr:{{{1}}}>=95}}|1|*95{{#ifeq:{{#expr:{{{1}}}>=96}}|1|*96{{#ifeq:{{#expr:{{{1}}}>=97}}|1|*97{{#ifeq:{{#expr:{{{1}}}>=98}}|1|*98{{#ifeq:{{#expr:{{{1}}}>=99}}|1|*99}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -{{Template documentation}} -This template finds the [[factorial]] of a number. To use it, enter:
        -{{factorial|input}}
        -The input must be a positive interger smaller than 100 (better than most calculators, which go up to only 69). This template works by repeating conditional multiplications. Examples:
        -*{{factorial|2}} gives {{factorial|2}} -*{{factorial|3}} gives {{factorial|3}} -*{{factorial|5}} gives {{factorial|5}} -*{{factorial|10}} gives {{factorial|10}} -*{{factorial|80}} gives {{factorial|80}} -*{{factorial|0.5}} gives {{factorial|0.5}} (invalid input) -*{{factorial|-1}} gives {{factorial|-1}} (invalid input) -{{esoteric}} -[[Category:Mathematical templates|{{PAGENAME}}]] -
        - diff --git a/tests/parser/preprocess/Fundraising.expected b/tests/parser/preprocess/Fundraising.expected deleted file mode 100644 index f5b32cc5..00000000 --- a/tests/parser/preprocess/Fundraising.expected +++ /dev/null @@ -1,18 +0,0 @@ -<div name="fundraising" id="fundraising" class="plainlinks" style="margin-top:5px; text-align: center; background-color: #ffffe0; border: solid 1px #e0e0c0"> -'''Pwede kang [[Wikimedia:give the gift of knowledge|maghandog ng kaalaman]] sa paraan ng [[Wikimedia:Fundraising#Donation_methods|pagbibigay ng donasyon sa Pundasyong Wikimedia!]]''' -<br /> -<fundraising/> -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -<fundraisinglogo/> -<br /> -<b>Ngayon, ang iyong [[Wikimedia:Fundraising|kontribusyon]] ay [[Wikimedia:Fundraising FAQ|itatambal]] ng isang anonimong kaibigan.</b> -<br /> -<small> -[[Wikimedia:Deductibility of donations|Pagbabawas sa mga buwis ng donasyon]] -| -[[Wikimedia:Fundraising FAQ|FAQ]] -| -[http://upload.wikimedia.org/wikipedia/foundation/2/28/Wikimedia_2006_fs.pdf Mga pampananalaping pahayag] -</small> -</div> - \ No newline at end of file diff --git a/tests/parser/preprocess/Fundraising.txt b/tests/parser/preprocess/Fundraising.txt deleted file mode 100644 index b868b4d8..00000000 --- a/tests/parser/preprocess/Fundraising.txt +++ /dev/null @@ -1,17 +0,0 @@ - diff --git a/tests/parser/preprocess/NestedTemplates.expected b/tests/parser/preprocess/NestedTemplates.expected deleted file mode 100644 index 645626df..00000000 --- a/tests/parser/preprocess/NestedTemplates.expected +++ /dev/null @@ -1,90 +0,0 @@ - - -argument - -Nach [[:meta:Help:Expansion#XML parse tree]] -{vorlagenname} - - -erweiterung - - - <template><title>vorlagenname - -<template><title>vorlagenname - - -nur etwas erweitert -<tplarg><title>vorlagenname - <tplarg><title>vorlagenname -<tplarg><title>vorlagenname -} -{ <template><title>vorlagenname} - -{ <template><title>vorlagenname} -{ -{<template><title>vorlagenname } - - {<template><title>vorlagenname } - -{<tplarg><title> } - - -<tplarg><title><template><title> - -{{<tplarg><title> } } -<template><title><tplarg><title> - -{<template><title><template><title> } -{ } -{ - -<template><title><tplarg><title> -<tplarg><title><template><title> - - - - -argument - -Nach [[:meta:Help:Expansion#XML parse tree]] -{vorlagenname} - - -erweiterung - - - <template><title>vorlagenname - -<template><title>vorlagenname - - -nur etwas erweitert -<tplarg><title>vorlagenname - <tplarg><title>vorlagenname -<tplarg><title>vorlagenname -} -{ <template><title>vorlagenname} - -{ <template><title>vorlagenname} -{ -{<template><title>vorlagenname } - - {<template><title>vorlagenname } - -{<tplarg><title> } - - -<tplarg><title><template><title> - -{{<tplarg><title> } } -<template><title><tplarg><title> - -{<template><title><template><title> } -{ } -{ - -<template><title><tplarg><title> -<tplarg><title><template><title> - - \ No newline at end of file diff --git a/tests/parser/preprocess/NestedTemplates.txt b/tests/parser/preprocess/NestedTemplates.txt deleted file mode 100644 index aa9a472d..00000000 --- a/tests/parser/preprocess/NestedTemplates.txt +++ /dev/null @@ -1,89 +0,0 @@ -{{vorlage}} - -{{{argument}}} - -Nach [[:meta:Help:Expansion#XML parse tree]] -{{{{vorlagenname}}}} -{{ {{vorlagenname}}}} -{{{{vorlagenname}} }} -{{{{vorlagenname}}erweiterung}} - -{{{{{vorlagenname}}}}} -{{{ {{vorlagenname}}}}} -{{ {{{vorlagenname}}}}} -{{{{{vorlagenname}} }}} -{{{{{vorlagenname}}} }} - -nur etwas erweitert -{{{{{{vorlagenname}}}}}} -{{{ {{{vorlagenname}}}}}} -{{{{{{vorlagenname}}} }}} -{{ {{{{vorlagenname}}}}}} -{{{{ {{vorlagenname}}}}}} -{{ {{ {{vorlagenname}}}}}} -{{{{ {{vorlagenname}}} }}} -{{{{{{vorlagenname}}}} }} -{{{{{{vorlagenname}} }}}} -{{ {{{{vorlagenname}} }}}} -{{{ {{{vorlagenname}} }}}} - -{{{{{{{ }}}}}}} - -{{{{{{{{ }}}}}}}} -{{{{{{{{ }} }}}}}} -{{{{{{{{ }}} }}}}} -{{{{{{{{ }}}} }}}} -{{{{{{{{ }}}}} }}} -{{{{{{{{ }}}}}} }} -{{{{{{{{ }} }} }}}} -{{{{{{{{ }} }}}} }} -{{{{{{{{ }}}} }} }} -{{{{{{{{ }}} }}} }} -{{{{{{{{ }}} }} }}} -{{{{{{{{ }} }}} }}} -{{{{{{{{ }} }} }} }} - -{{vorlage}} - -{{{argument}}} - -Nach [[:meta:Help:Expansion#XML parse tree]] -{{{{vorlagenname}}}} -{{ {{vorlagenname}}}} -{{{{vorlagenname}} }} -{{{{vorlagenname}}erweiterung}} - -{{{{{vorlagenname}}}}} -{{{ {{vorlagenname}}}}} -{{ {{{vorlagenname}}}}} -{{{{{vorlagenname}} }}} -{{{{{vorlagenname}}} }} - -nur etwas erweitert -{{{{{{vorlagenname}}}}}} -{{{ {{{vorlagenname}}}}}} -{{{{{{vorlagenname}}} }}} -{{ {{{{vorlagenname}}}}}} -{{{{ {{vorlagenname}}}}}} -{{ {{ {{vorlagenname}}}}}} -{{{{ {{vorlagenname}}} }}} -{{{{{{vorlagenname}}}} }} -{{{{{{vorlagenname}} }}}} -{{ {{{{vorlagenname}} }}}} -{{{ {{{vorlagenname}} }}}} - -{{{{{{{ }}}}}}} - -{{{{{{{{ }}}}}}}} -{{{{{{{{ }} }}}}}} -{{{{{{{{ }}} }}}}} -{{{{{{{{ }}}} }}}} -{{{{{{{{ }}}}} }}} -{{{{{{{{ }}}}}} }} -{{{{{{{{ }} }} }}}} -{{{{{{{{ }} }}}} }} -{{{{{{{{ }}}} }} }} -{{{{{{{{ }}} }}} }} -{{{{{{{{ }}} }} }}} -{{{{{{{{ }} }}} }}} -{{{{{{{{ }} }} }} }} diff --git a/tests/parser/preprocess/QuoteQuran.expected b/tests/parser/preprocess/QuoteQuran.expected deleted file mode 100644 index e9a78e46..00000000 --- a/tests/parser/preprocess/QuoteQuran.expected +++ /dev/null @@ -1,140 +0,0 @@ -<noinclude></noinclude> -<div class="boilerplate metadata rfa" style="background-color:#FFFFF5; margin: 2em 0 0 0; padding: 0 10px 0 10px; border: 1px solid #AAAAAA;">The [[Qur'an]], [[sura|chapter]] , [[ayat|verse]] [http://www.usc.edu/dept/MSA/quran/.qmt.html#. 21]''':'''</font></div> - - \ No newline at end of file diff --git a/tests/parser/preprocess/QuoteQuran.txt b/tests/parser/preprocess/QuoteQuran.txt deleted file mode 100644 index 3cfac5b2..00000000 --- a/tests/parser/preprocess/QuoteQuran.txt +++ /dev/null @@ -1,139 +0,0 @@ -{{Template sandbox notice}} -
        - diff --git a/tests/parserTests.php b/tests/parserTests.php deleted file mode 100644 index debb3575..00000000 --- a/tests/parserTests.php +++ /dev/null @@ -1,94 +0,0 @@ - - * http://www.mediawiki.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @file - * @ingroup Testing - */ - -$otions = array( 'quick', 'color', 'quiet', 'help', 'show-output', 'record', 'run-disabled', 'run-parsoid' ); -$optionsWithArgs = array( 'regex', 'filter', 'seed', 'setversion' ); - -require_once __DIR__ . '/../maintenance/commandLine.inc'; -require_once __DIR__ . '/TestsAutoLoader.php'; - -if ( isset( $options['help'] ) ) { - echo << Run test cases from a custom file instead of parserTests.txt - --record Record tests in database - --compare Compare with recorded results, without updating the database. - --setversion When using --record, set the version string to use (useful - with git-svn so that you can get the exact revision) - --keep-uploads Re-use the same upload directory for each test, don't delete it - --fuzz Do a fuzz test instead of a normal test - --seed Start the fuzz test from the specified seed - --help Show this help message - --run-disabled run disabled tests - --run-parsoid run parsoid tests (normally disabled) - -ENDS; - exit( 0 ); -} - -# Cases of weird db corruption were encountered when running tests on earlyish -# versions of SQLite -if ( $wgDBtype == 'sqlite' ) { - $db = wfGetDB( DB_MASTER ); - $version = $db->getServerVersion(); - if ( version_compare( $version, '3.6' ) < 0 ) { - die( "Parser tests require SQLite version 3.6 or later, you have $version\n" ); - } -} - -# There is a convention that the parser should never -# refer to $wgTitle directly, but instead use the title -# passed to it. -$wgTitle = Title::newFromText( 'Parser test script do not use' ); -$tester = new ParserTest( $options ); - -if ( isset( $options['file'] ) ) { - $files = array( $options['file'] ); -} else { - // Default parser tests and any set from extensions or local config - $files = $wgParserTestFiles; -} - -# Print out software version to assist with locating regressions -$version = SpecialVersion::getVersion(); -echo "This is MediaWiki version {$version}.\n\n"; - -if ( isset( $options['fuzz'] ) ) { - $tester->fuzzTest( $files ); -} else { - $ok = $tester->runTestsFromFiles( $files ); - exit( $ok ? 0 : 1 ); -} diff --git a/tests/phpunit/Makefile b/tests/phpunit/Makefile deleted file mode 100644 index c3e2a303..00000000 --- a/tests/phpunit/Makefile +++ /dev/null @@ -1,91 +0,0 @@ -.PHONY: help test phpunit install coverage warning destructive parser noparser safe databaseless list-groups -.DEFAULT: warning - -SHELL = /bin/sh -CONFIG_FILE = ${PWD}/suite.xml -PHP = php -PU = ${PHP} phpunit.php --configuration ${CONFIG_FILE} ${FLAGS} - -all test: warning - -warning: - @echo "Run 'make help' to get usage" - @echo "" - @echo "WARNING -- some tests are DESTRUCTIVE and will alter your wiki." - @echo "DO NOT RUN THESE TESTS on a production wiki." - @echo "" - @echo "Until the default tests are made non-destructive, you can run" - @echo "the destructive tests like so:" - @echo "" - @echo " make destructive" - @echo "" - @echo "Some tests are expected to be safe, you can run them with" - @echo "" - @echo " make safe" - @echo "" - @echo "You are recommended to run the tests with read-only credentials." - @echo "" - @echo "If you don't have a database running, you can still run" - @echo "" - @echo " make databaseless" - @echo "" - -destructive: phpunit - -phpunit: - ${PU} - -install: - ./install-phpunit.sh - -tap: - ${PU} --tap - -coverage: - ${PU} --coverage-html ../../docs/code-coverage - -parser: - ${PU} --group Parser -parserfuzz: - @echo "******************************************************************" - @echo "* This WILL kill your computer by eating all memory AND all swap *" - @echo "* *" - @echo "* If you are on a production machine. ABORT NOW!! *" - @echo "* Press control+C to stop *" - @echo "* *" - @echo "******************************************************************" - ${PU} --group Parser,ParserFuzz -noparser: - ${PU} --exclude-group Parser,Broken,ParserFuzz,Stub - -safe: - ${PU} --exclude-group Broken,ParserFuzz,Destructive,Stub - -databaseless: - ${PU} --exclude-group Broken,ParserFuzz,Destructive,Database,Stub - -database: - ${PU} --exclude-group Broken,ParserFuzz,Destructive,Stub --group Database - -list-groups: - ${PU} --list-groups - -help: - # Usage: - # make [OPTION=value] - # - # Targets: - # phpunit (default) Run all the tests with phpunit - # install Install PHPUnit from phpunit.de - # tap Run the tests individually through Test::Harness's prove(1) - # help You're looking at it! - # coverage Run the tests and generates an HTML code coverage report - # You will need the Xdebug PHP extension for the later. - # [no]parser Skip or only run Parser tests - # - # list-groups List availabe Tests groups. - # - # Options: - # CONFIG_FILE Path to a PHPUnit configuration file (default: suite.xml) - # FLAGS Additional flags to pass to PHPUnit - # PHP Path to php diff --git a/tests/phpunit/MediaWikiLangTestCase.php b/tests/phpunit/MediaWikiLangTestCase.php deleted file mode 100644 index 1131385f..00000000 --- a/tests/phpunit/MediaWikiLangTestCase.php +++ /dev/null @@ -1,33 +0,0 @@ -getCode() ) { - throw new MWException( "Error in MediaWikiLangTestCase::setUp(): " . - "\$wgLanguageCode ('$wgLanguageCode') is different from " . - "\$wgContLang->getCode() (" . $wgContLang->getCode() . ")" ); - } - - // HACK: Call getLanguage() so the real $wgContLang is cached as the user language - // rather than our fake one. This is to avoid breaking other, unrelated tests. - RequestContext::getMain()->getLanguage(); - - $langCode = 'en'; # For mainpage to be 'Main Page' - $langObj = Language::factory( $langCode ); - - $this->setMwGlobals( array( - 'wgLanguageCode' => $langCode, - 'wgLang' => $langObj, - 'wgContLang' => $langObj, - ) ); - - MessageCache::singleton()->disable(); - } -} diff --git a/tests/phpunit/MediaWikiPHPUnitCommand.php b/tests/phpunit/MediaWikiPHPUnitCommand.php deleted file mode 100644 index 042956a9..00000000 --- a/tests/phpunit/MediaWikiPHPUnitCommand.php +++ /dev/null @@ -1,119 +0,0 @@ - false, - 'file=' => false, - 'use-filebackend=' => false, - 'use-bagostuff=' => false, - 'use-jobqueue=' => false, - 'keep-uploads' => false, - 'use-normal-tables' => false, - 'reuse-db' => false, - 'wiki=' => false, - 'debug-tests' => false, - ); - - public function __construct() { - foreach ( self::$additionalOptions as $option => $default ) { - $this->longOptions[$option] = $option . 'Handler'; - } - } - - protected function handleArguments( array $argv ) { - parent::handleArguments( $argv ); - - if ( !isset( $this->arguments['listeners'] ) ) { - $this->arguments['listeners'] = array(); - } - - foreach ( $this->options[0] as $option ) { - switch ( $option[0] ) { - case '--debug-tests': - $this->arguments['listeners'][] = new MediaWikiPHPUnitTestListener( 'PHPUnitCommand' ); - break; - } - } - } - - public static function main( $exit = true ) { - $command = new self; - - if ( wfIsWindows() ) { - # Windows does not come anymore with ANSI.SYS loaded by default - # PHPUnit uses the suite.xml parameters to enable/disable colors - # which can be then forced to be enabled with --colors. - # The below code inject a parameter just like if the user called - # phpunit with a --no-color option (which does not exist). It - # overrides the suite.xml setting. - # Probably fix bug 29226 - $command->arguments['colors'] = false; - } - - # Makes MediaWiki PHPUnit directory includable so the PHPUnit will - # be able to resolve relative files inclusion such as suites/* - # PHPUnit uses stream_resolve_include_path() internally - # See bug 32022 - set_include_path( - __DIR__ - . PATH_SEPARATOR - . get_include_path() - ); - - $command->run( $_SERVER['argv'], $exit ); - } - - public function __call( $func, $args ) { - - if ( substr( $func, -7 ) == 'Handler' ) { - if ( is_null( $args[0] ) ) { - $args[0] = true; - } //Booleans - self::$additionalOptions[substr( $func, 0, -7 )] = $args[0]; - } - } - - public function run( array $argv, $exit = true ) { - wfProfileIn( __METHOD__ ); - - $ret = parent::run( $argv, false ); - - wfProfileOut( __METHOD__ ); - - // Return to real wiki db, so profiling data is preserved - MediaWikiTestCase::teardownTestDB(); - - // Log profiling data, e.g. in the database or UDP - wfLogProfilingData(); - - if ( $exit ) { - exit( $ret ); - } else { - return $ret; - } - } - - public function showHelp() { - parent::showHelp(); - - print <<logChannel = $logChannel; - } - - protected function getTestName( PHPUnit_Framework_Test $test ) { - $name = get_class( $test ); - - if ( $test instanceof PHPUnit_Framework_TestCase ) { - $name .= '::' . $test->getName( true ); - } - - return $name; - } - - protected function getErrorName( Exception $exception ) { - $name = get_class( $exception ); - $name = "[$name] " . $exception->getMessage(); - - return $name; - } - - /** - * An error occurred. - * - * @param PHPUnit_Framework_Test $test - * @param Exception $e - * @param float $time - */ - public function addError( PHPUnit_Framework_Test $test, Exception $e, $time ) { - wfDebugLog( $this->logChannel, 'ERROR in ' . $this->getTestName( $test ) . ': ' . $this->getErrorName( $e ) ); - } - - /** - * A failure occurred. - * - * @param PHPUnit_Framework_Test $test - * @param PHPUnit_Framework_AssertionFailedError $e - * @param float $time - */ - public function addFailure( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time ) { - wfDebugLog( $this->logChannel, 'FAILURE in ' . $this->getTestName( $test ) . ': ' . $this->getErrorName( $e ) ); - } - - /** - * Incomplete test. - * - * @param PHPUnit_Framework_Test $test - * @param Exception $e - * @param float $time - */ - public function addIncompleteTest( PHPUnit_Framework_Test $test, Exception $e, $time ) { - wfDebugLog( $this->logChannel, 'Incomplete test ' . $this->getTestName( $test ) . ': ' . $this->getErrorName( $e ) ); - } - - /** - * Skipped test. - * - * @param PHPUnit_Framework_Test $test - * @param Exception $e - * @param float $time - * - * @since Method available since Release 3.0.0 - */ - public function addSkippedTest( PHPUnit_Framework_Test $test, Exception $e, $time ) { - wfDebugLog( $this->logChannel, 'Skipped test ' . $this->getTestName( $test ) . ': ' . $this->getErrorName( $e ) ); - } - - /** - * A test suite started. - * - * @param PHPUnit_Framework_TestSuite $suite - * @since Method available since Release 2.2.0 - */ - public function startTestSuite( PHPUnit_Framework_TestSuite $suite ) { - wfDebugLog( $this->logChannel, 'START suite ' . $suite->getName() ); - } - - /** - * A test suite ended. - * - * @param PHPUnit_Framework_TestSuite $suite - * @since Method available since Release 2.2.0 - */ - public function endTestSuite( PHPUnit_Framework_TestSuite $suite ) { - wfDebugLog( $this->logChannel, 'END suite ' . $suite->getName() ); - } - - /** - * A test started. - * - * @param PHPUnit_Framework_Test $test - */ - public function startTest( PHPUnit_Framework_Test $test ) { - wfDebugLog( $this->logChannel, 'Start test ' . $this->getTestName( $test ) ); - } - - /** - * A test ended. - * - * @param PHPUnit_Framework_Test $test - * @param float $time - */ - public function endTest( PHPUnit_Framework_Test $test, $time ) { - wfDebugLog( $this->logChannel, 'End test ' . $this->getTestName( $test ) ); - } -} diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php deleted file mode 100644 index 6ce78b56..00000000 --- a/tests/phpunit/MediaWikiTestCase.php +++ /dev/null @@ -1,948 +0,0 @@ -backupGlobals = false; - $this->backupStaticAttributes = false; - } - - function run( PHPUnit_Framework_TestResult $result = null ) { - /* Some functions require some kind of caching, and will end up using the db, - * which we can't allow, as that would open a new connection for mysql. - * Replace with a HashBag. They would not be going to persist anyway. - */ - ObjectCache::$instances[CACHE_DB] = new HashBagOStuff; - - $needsResetDB = false; - $logName = get_class( $this ) . '::' . $this->getName( false ); - - if ( $this->needsDB() ) { - // set up a DB connection for this test to use - - self::$useTemporaryTables = !$this->getCliArg( 'use-normal-tables' ); - self::$reuseDB = $this->getCliArg( 'reuse-db' ); - - $this->db = wfGetDB( DB_MASTER ); - - $this->checkDbIsSupported(); - - if ( !self::$dbSetup ) { - wfProfileIn( $logName . ' (clone-db)' ); - - // switch to a temporary clone of the database - self::setupTestDB( $this->db, $this->dbPrefix() ); - - if ( ( $this->db->getType() == 'oracle' || !self::$useTemporaryTables ) && self::$reuseDB ) { - $this->resetDB(); - } - - wfProfileOut( $logName . ' (clone-db)' ); - } - - wfProfileIn( $logName . ' (prepare-db)' ); - $this->addCoreDBData(); - $this->addDBData(); - wfProfileOut( $logName . ' (prepare-db)' ); - - $needsResetDB = true; - } - - wfProfileIn( $logName ); - parent::run( $result ); - wfProfileOut( $logName ); - - if ( $needsResetDB ) { - wfProfileIn( $logName . ' (reset-db)' ); - $this->resetDB(); - wfProfileOut( $logName . ' (reset-db)' ); - } - } - - function usesTemporaryTables() { - return self::$useTemporaryTables; - } - - /** - * obtains a new temporary file name - * - * The obtained filename is enlisted to be removed upon tearDown - * - * @return string: absolute name of the temporary file - */ - protected function getNewTempFile() { - $fname = tempnam( wfTempDir(), 'MW_PHPUnit_' . get_class( $this ) . '_' ); - $this->tmpfiles[] = $fname; - - return $fname; - } - - /** - * obtains a new temporary directory - * - * The obtained directory is enlisted to be removed (recursively with all its contained - * files) upon tearDown. - * - * @return string: absolute name of the temporary directory - */ - protected function getNewTempDirectory() { - // Starting of with a temporary /file/. - $fname = $this->getNewTempFile(); - - // Converting the temporary /file/ to a /directory/ - // - // The following is not atomic, but at least we now have a single place, - // where temporary directory creation is bundled and can be improved - unlink( $fname ); - $this->assertTrue( wfMkdirParents( $fname ) ); - - return $fname; - } - - /** - * setUp and tearDown should (where significant) - * happen in reverse order. - */ - protected function setUp() { - wfProfileIn( __METHOD__ ); - parent::setUp(); - $this->called['setUp'] = 1; - - /* - // @todo global variables to restore for *every* test - array( - 'wgLang', - 'wgContLang', - 'wgLanguageCode', - 'wgUser', - 'wgTitle', - ); - */ - - // Cleaning up temporary files - foreach ( $this->tmpfiles as $fname ) { - if ( is_file( $fname ) || ( is_link( $fname ) ) ) { - unlink( $fname ); - } elseif ( is_dir( $fname ) ) { - wfRecursiveRemoveDir( $fname ); - } - } - - if ( $this->needsDB() && $this->db ) { - // Clean up open transactions - while ( $this->db->trxLevel() > 0 ) { - $this->db->rollback(); - } - - // don't ignore DB errors - $this->db->ignoreErrors( false ); - } - - wfProfileOut( __METHOD__ ); - } - - protected function tearDown() { - wfProfileIn( __METHOD__ ); - - // Cleaning up temporary files - foreach ( $this->tmpfiles as $fname ) { - if ( is_file( $fname ) || ( is_link( $fname ) ) ) { - unlink( $fname ); - } elseif ( is_dir( $fname ) ) { - wfRecursiveRemoveDir( $fname ); - } - } - - if ( $this->needsDB() && $this->db ) { - // Clean up open transactions - while ( $this->db->trxLevel() > 0 ) { - $this->db->rollback(); - } - - // don't ignore DB errors - $this->db->ignoreErrors( false ); - } - - // Restore mw globals - foreach ( $this->mwGlobals as $key => $value ) { - $GLOBALS[$key] = $value; - } - $this->mwGlobals = array(); - - parent::tearDown(); - wfProfileOut( __METHOD__ ); - } - - /** - * Make sure MediaWikiTestCase extending classes have called their - * parent setUp method - */ - final public function testMediaWikiTestCaseParentSetupCalled() { - $this->assertArrayHasKey( 'setUp', $this->called, - get_called_class() . "::setUp() must call parent::setUp()" - ); - } - - /** - * Individual test functions may override globals (either directly or through this - * setMwGlobals() function), however one must call this method at least once for - * each key within the setUp(). - * That way the key is added to the array of globals that will be reset afterwards - * in the tearDown(). And, equally important, that way all other tests are executed - * with the same settings (instead of using the unreliable local settings for most - * tests and fix it only for some tests). - * - * @example - * - * protected function setUp() { - * $this->setMwGlobals( 'wgRestrictStuff', true ); - * } - * - * function testFoo() {} - * - * function testBar() {} - * $this->assertTrue( self::getX()->doStuff() ); - * - * $this->setMwGlobals( 'wgRestrictStuff', false ); - * $this->assertTrue( self::getX()->doStuff() ); - * } - * - * function testQuux() {} - * - * - * @param array|string $pairs Key to the global variable, or an array - * of key/value pairs. - * @param mixed $value Value to set the global to (ignored - * if an array is given as first argument). - */ - protected function setMwGlobals( $pairs, $value = null ) { - - // Normalize (string, value) to an array - if ( is_string( $pairs ) ) { - $pairs = array( $pairs => $value ); - } - - foreach ( $pairs as $key => $value ) { - // NOTE: make sure we only save the global once or a second call to - // setMwGlobals() on the same global would override the original - // value. - if ( !array_key_exists( $key, $this->mwGlobals ) ) { - $this->mwGlobals[$key] = $GLOBALS[$key]; - } - - // Override the global - $GLOBALS[$key] = $value; - } - } - - /** - * Merges the given values into a MW global array variable. - * Useful for setting some entries in a configuration array, instead of - * setting the entire array. - * - * @param String $name The name of the global, as in wgFooBar - * @param Array $values The array containing the entries to set in that global - * - * @throws MWException if the designated global is not an array. - */ - protected function mergeMwGlobalArrayValue( $name, $values ) { - if ( !isset( $GLOBALS[$name] ) ) { - $merged = $values; - } else { - if ( !is_array( $GLOBALS[$name] ) ) { - throw new MWException( "MW global $name is not an array." ); - } - - // NOTE: do not use array_merge, it screws up for numeric keys. - $merged = $GLOBALS[$name]; - foreach ( $values as $k => $v ) { - $merged[$k] = $v; - } - } - - $this->setMwGlobals( $name, $merged ); - } - - function dbPrefix() { - return $this->db->getType() == 'oracle' ? self::ORA_DB_PREFIX : self::DB_PREFIX; - } - - function needsDB() { - # if the test says it uses database tables, it needs the database - if ( $this->tablesUsed ) { - return true; - } - - # if the test says it belongs to the Database group, it needs the database - $rc = new ReflectionClass( $this ); - if ( preg_match( '/@group +Database/im', $rc->getDocComment() ) ) { - return true; - } - - return false; - } - - /** - * Stub. If a test needs to add additional data to the database, it should - * implement this method and do so - */ - function addDBData() { - } - - private function addCoreDBData() { - # disabled for performance - #$this->tablesUsed[] = 'page'; - #$this->tablesUsed[] = 'revision'; - - if ( $this->db->getType() == 'oracle' ) { - - # Insert 0 user to prevent FK violations - # Anonymous user - $this->db->insert( 'user', array( - 'user_id' => 0, - 'user_name' => 'Anonymous' ), __METHOD__, array( 'IGNORE' ) ); - - # Insert 0 page to prevent FK violations - # Blank page - $this->db->insert( 'page', array( - 'page_id' => 0, - 'page_namespace' => 0, - 'page_title' => ' ', - 'page_restrictions' => null, - 'page_counter' => 0, - 'page_is_redirect' => 0, - 'page_is_new' => 0, - 'page_random' => 0, - 'page_touched' => $this->db->timestamp(), - 'page_latest' => 0, - 'page_len' => 0 ), __METHOD__, array( 'IGNORE' ) ); - } - - User::resetIdByNameCache(); - - //Make sysop user - $user = User::newFromName( 'UTSysop' ); - - if ( $user->idForName() == 0 ) { - $user->addToDatabase(); - $user->setPassword( 'UTSysopPassword' ); - - $user->addGroup( 'sysop' ); - $user->addGroup( 'bureaucrat' ); - $user->saveSettings(); - } - - //Make 1 page with 1 revision - $page = WikiPage::factory( Title::newFromText( 'UTPage' ) ); - if ( !$page->getId() == 0 ) { - $page->doEditContent( - new WikitextContent( 'UTContent' ), - 'UTPageSummary', - EDIT_NEW, - false, - User::newFromName( 'UTSysop' ) ); - } - } - - /** - * Restores MediaWiki to using the table set (table prefix) it was using before - * setupTestDB() was called. Useful if we need to perform database operations - * after the test run has finished (such as saving logs or profiling info). - */ - public static function teardownTestDB() { - if ( !self::$dbSetup ) { - return; - } - - CloneDatabase::changePrefix( self::$oldTablePrefix ); - - self::$oldTablePrefix = false; - self::$dbSetup = false; - } - - /** - * Creates an empty skeleton of the wiki database by cloning its structure - * to equivalent tables using the given $prefix. Then sets MediaWiki to - * use the new set of tables (aka schema) instead of the original set. - * - * This is used to generate a dummy table set, typically consisting of temporary - * tables, that will be used by tests instead of the original wiki database tables. - * - * @note: the original table prefix is stored in self::$oldTablePrefix. This is used - * by teardownTestDB() to return the wiki to using the original table set. - * - * @note: this method only works when first called. Subsequent calls have no effect, - * even if using different parameters. - * - * @param DatabaseBase $db The database connection - * @param String $prefix The prefix to use for the new table set (aka schema). - * - * @throws MWException if the database table prefix is already $prefix - */ - public static function setupTestDB( DatabaseBase $db, $prefix ) { - global $wgDBprefix; - if ( $wgDBprefix === $prefix ) { - throw new MWException( 'Cannot run unit tests, the database prefix is already "' . $prefix . '"' ); - } - - if ( self::$dbSetup ) { - return; - } - - $tablesCloned = self::listTables( $db ); - $dbClone = new CloneDatabase( $db, $tablesCloned, $prefix ); - $dbClone->useTemporaryTables( self::$useTemporaryTables ); - - self::$dbSetup = true; - self::$oldTablePrefix = $wgDBprefix; - - if ( ( $db->getType() == 'oracle' || !self::$useTemporaryTables ) && self::$reuseDB ) { - CloneDatabase::changePrefix( $prefix ); - - return; - } else { - $dbClone->cloneTableStructure(); - } - - if ( $db->getType() == 'oracle' ) { - $db->query( 'BEGIN FILL_WIKI_INFO; END;' ); - } - } - - /** - * Empty all tables so they can be repopulated for tests - */ - private function resetDB() { - if ( $this->db ) { - if ( $this->db->getType() == 'oracle' ) { - if ( self::$useTemporaryTables ) { - wfGetLB()->closeAll(); - $this->db = wfGetDB( DB_MASTER ); - } else { - foreach ( $this->tablesUsed as $tbl ) { - if ( $tbl == 'interwiki' ) { - continue; - } - $this->db->query( 'TRUNCATE TABLE ' . $this->db->tableName( $tbl ), __METHOD__ ); - } - } - } else { - foreach ( $this->tablesUsed as $tbl ) { - if ( $tbl == 'interwiki' || $tbl == 'user' ) { - continue; - } - $this->db->delete( $tbl, '*', __METHOD__ ); - } - } - } - } - - function __call( $func, $args ) { - static $compatibility = array( - 'assertInternalType' => 'assertType', - 'assertNotInternalType' => 'assertNotType', - 'assertInstanceOf' => 'assertType', - 'assertEmpty' => 'assertEmpty2', - ); - - if ( method_exists( $this->suite, $func ) ) { - return call_user_func_array( array( $this->suite, $func ), $args ); - } elseif ( isset( $compatibility[$func] ) ) { - return call_user_func_array( array( $this, $compatibility[$func] ), $args ); - } else { - throw new MWException( "Called non-existant $func method on " - . get_class( $this ) ); - } - } - - private function assertEmpty2( $value, $msg ) { - return $this->assertTrue( $value == '', $msg ); - } - - private static function unprefixTable( $tableName ) { - global $wgDBprefix; - - return substr( $tableName, strlen( $wgDBprefix ) ); - } - - private static function isNotUnittest( $table ) { - return strpos( $table, 'unittest_' ) !== 0; - } - - public static function listTables( $db ) { - global $wgDBprefix; - - $tables = $db->listTables( $wgDBprefix, __METHOD__ ); - - if ( $db->getType() === 'mysql' ) { - # bug 43571: cannot clone VIEWs under MySQL - $views = $db->listViews( $wgDBprefix, __METHOD__ ); - $tables = array_diff( $tables, $views ); - } - $tables = array_map( array( __CLASS__, 'unprefixTable' ), $tables ); - - // Don't duplicate test tables from the previous fataled run - $tables = array_filter( $tables, array( __CLASS__, 'isNotUnittest' ) ); - - if ( $db->getType() == 'sqlite' ) { - $tables = array_flip( $tables ); - // these are subtables of searchindex and don't need to be duped/dropped separately - unset( $tables['searchindex_content'] ); - unset( $tables['searchindex_segdir'] ); - unset( $tables['searchindex_segments'] ); - $tables = array_flip( $tables ); - } - - return $tables; - } - - protected function checkDbIsSupported() { - if ( !in_array( $this->db->getType(), $this->supportedDBs ) ) { - throw new MWException( $this->db->getType() . " is not currently supported for unit testing." ); - } - } - - public function getCliArg( $offset ) { - - if ( isset( MediaWikiPHPUnitCommand::$additionalOptions[$offset] ) ) { - return MediaWikiPHPUnitCommand::$additionalOptions[$offset]; - } - } - - public function setCliArg( $offset, $value ) { - - MediaWikiPHPUnitCommand::$additionalOptions[$offset] = $value; - } - - /** - * Don't throw a warning if $function is deprecated and called later - * - * @param $function String - * @return null - */ - function hideDeprecated( $function ) { - wfSuppressWarnings(); - wfDeprecated( $function ); - wfRestoreWarnings(); - } - - /** - * Asserts that the given database query yields the rows given by $expectedRows. - * The expected rows should be given as indexed (not associative) arrays, with - * the values given in the order of the columns in the $fields parameter. - * Note that the rows are sorted by the columns given in $fields. - * - * @since 1.20 - * - * @param $table String|Array the table(s) to query - * @param $fields String|Array the columns to include in the result (and to sort by) - * @param $condition String|Array "where" condition(s) - * @param $expectedRows Array - an array of arrays giving the expected rows. - * - * @throws MWException if this test cases's needsDB() method doesn't return true. - * Test cases can use "@group Database" to enable database test support, - * or list the tables under testing in $this->tablesUsed, or override the - * needsDB() method. - */ - protected function assertSelect( $table, $fields, $condition, array $expectedRows ) { - if ( !$this->needsDB() ) { - throw new MWException( 'When testing database state, the test cases\'s needDB()' . - ' method should return true. Use @group Database or $this->tablesUsed.' ); - } - - $db = wfGetDB( DB_SLAVE ); - - $res = $db->select( $table, $fields, $condition, wfGetCaller(), array( 'ORDER BY' => $fields ) ); - $this->assertNotEmpty( $res, "query failed: " . $db->lastError() ); - - $i = 0; - - foreach ( $expectedRows as $expected ) { - $r = $res->fetchRow(); - self::stripStringKeys( $r ); - - $i += 1; - $this->assertNotEmpty( $r, "row #$i missing" ); - - $this->assertEquals( $expected, $r, "row #$i mismatches" ); - } - - $r = $res->fetchRow(); - self::stripStringKeys( $r ); - - $this->assertFalse( $r, "found extra row (after #$i)" ); - } - - /** - * Utility method taking an array of elements and wrapping - * each element in it's own array. Useful for data providers - * that only return a single argument. - * - * @since 1.20 - * - * @param array $elements - * - * @return array - */ - protected function arrayWrap( array $elements ) { - return array_map( - function ( $element ) { - return array( $element ); - }, - $elements - ); - } - - /** - * Assert that two arrays are equal. By default this means that both arrays need to hold - * the same set of values. Using additional arguments, order and associated key can also - * be set as relevant. - * - * @since 1.20 - * - * @param array $expected - * @param array $actual - * @param boolean $ordered If the order of the values should match - * @param boolean $named If the keys should match - */ - protected function assertArrayEquals( array $expected, array $actual, $ordered = false, $named = false ) { - if ( !$ordered ) { - $this->objectAssociativeSort( $expected ); - $this->objectAssociativeSort( $actual ); - } - - if ( !$named ) { - $expected = array_values( $expected ); - $actual = array_values( $actual ); - } - - call_user_func_array( - array( $this, 'assertEquals' ), - array_merge( array( $expected, $actual ), array_slice( func_get_args(), 4 ) ) - ); - } - - /** - * Put each HTML element on its own line and then equals() the results - * - * Use for nicely formatting of PHPUnit diff output when comparing very - * simple HTML - * - * @since 1.20 - * - * @param String $expected HTML on oneline - * @param String $actual HTML on oneline - * @param String $msg Optional message - */ - protected function assertHTMLEquals( $expected, $actual, $msg = '' ) { - $expected = str_replace( '>', ">\n", $expected ); - $actual = str_replace( '>', ">\n", $actual ); - - $this->assertEquals( $expected, $actual, $msg ); - } - - /** - * Does an associative sort that works for objects. - * - * @since 1.20 - * - * @param array $array - */ - protected function objectAssociativeSort( array &$array ) { - uasort( - $array, - function ( $a, $b ) { - return serialize( $a ) > serialize( $b ) ? 1 : -1; - } - ); - } - - /** - * Utility function for eliminating all string keys from an array. - * Useful to turn a database result row as returned by fetchRow() into - * a pure indexed array. - * - * @since 1.20 - * - * @param $r mixed the array to remove string keys from. - */ - protected static function stripStringKeys( &$r ) { - if ( !is_array( $r ) ) { - return; - } - - foreach ( $r as $k => $v ) { - if ( is_string( $k ) ) { - unset( $r[$k] ); - } - } - } - - /** - * Asserts that the provided variable is of the specified - * internal type or equals the $value argument. This is useful - * for testing return types of functions that return a certain - * type or *value* when not set or on error. - * - * @since 1.20 - * - * @param string $type - * @param mixed $actual - * @param mixed $value - * @param string $message - */ - protected function assertTypeOrValue( $type, $actual, $value = false, $message = '' ) { - if ( $actual === $value ) { - $this->assertTrue( true, $message ); - } else { - $this->assertType( $type, $actual, $message ); - } - } - - /** - * Asserts the type of the provided value. This can be either - * in internal type such as boolean or integer, or a class or - * interface the value extends or implements. - * - * @since 1.20 - * - * @param string $type - * @param mixed $actual - * @param string $message - */ - protected function assertType( $type, $actual, $message = '' ) { - if ( class_exists( $type ) || interface_exists( $type ) ) { - $this->assertInstanceOf( $type, $actual, $message ); - } else { - $this->assertInternalType( $type, $actual, $message ); - } - } - - /** - * Returns true if the given namespace defaults to Wikitext - * according to $wgNamespaceContentModels - * - * @param int $ns The namespace ID to check - * - * @return bool - * @since 1.21 - */ - protected function isWikitextNS( $ns ) { - global $wgNamespaceContentModels; - - if ( isset( $wgNamespaceContentModels[$ns] ) ) { - return $wgNamespaceContentModels[$ns] === CONTENT_MODEL_WIKITEXT; - } - - return true; - } - - /** - * Returns the ID of a namespace that defaults to Wikitext. - * Throws an MWException if there is none. - * - * @return int the ID of the wikitext Namespace - * @since 1.21 - */ - protected function getDefaultWikitextNS() { - global $wgNamespaceContentModels; - - static $wikitextNS = null; // this is not going to change - if ( $wikitextNS !== null ) { - return $wikitextNS; - } - - // quickly short out on most common case: - if ( !isset( $wgNamespaceContentModels[NS_MAIN] ) ) { - return NS_MAIN; - } - - // NOTE: prefer content namespaces - $namespaces = array_unique( array_merge( - MWNamespace::getContentNamespaces(), - array( NS_MAIN, NS_HELP, NS_PROJECT ), // prefer these - MWNamespace::getValidNamespaces() - ) ); - - $namespaces = array_diff( $namespaces, array( - NS_FILE, NS_CATEGORY, NS_MEDIAWIKI, NS_USER // don't mess with magic namespaces - ) ); - - $talk = array_filter( $namespaces, function ( $ns ) { - return MWNamespace::isTalk( $ns ); - } ); - - // prefer non-talk pages - $namespaces = array_diff( $namespaces, $talk ); - $namespaces = array_merge( $namespaces, $talk ); - - // check default content model of each namespace - foreach ( $namespaces as $ns ) { - if ( !isset( $wgNamespaceContentModels[$ns] ) || - $wgNamespaceContentModels[$ns] === CONTENT_MODEL_WIKITEXT - ) { - - $wikitextNS = $ns; - - return $wikitextNS; - } - } - - // give up - // @todo Inside a test, we could skip the test as incomplete. - // But frequently, this is used in fixture setup. - throw new MWException( "No namespace defaults to wikitext!" ); - } - - /** - * Check, if $wgDiff3 is set and ready to merge - * Will mark the calling test as skipped, if not ready - * - * @since 1.21 - */ - protected function checkHasDiff3() { - global $wgDiff3; - - # This check may also protect against code injection in - # case of broken installations. - wfSuppressWarnings(); - $haveDiff3 = $wgDiff3 && file_exists( $wgDiff3 ); - wfRestoreWarnings(); - - if ( !$haveDiff3 ) { - $this->markTestSkipped( "Skip test, since diff3 is not configured" ); - } - } - - /** - * Check whether we have the 'gzip' commandline utility, will skip - * the test whenever "gzip -V" fails. - * - * Result is cached at the process level. - * - * @return bool - * - * @since 1.21 - */ - protected function checkHasGzip() { - static $haveGzip; - - if ( $haveGzip === null ) { - $retval = null; - wfShellExec( 'gzip -V', $retval ); - $haveGzip = ( $retval === 0 ); - } - - if ( !$haveGzip ) { - $this->markTestSkipped( "Skip test, requires the gzip utility in PATH" ); - } - - return $haveGzip; - } - - /** - * Check if $extName is a loaded PHP extension, will skip the - * test whenever it is not loaded. - * - * @since 1.21 - */ - protected function checkPHPExtension( $extName ) { - $loaded = extension_loaded( $extName ); - if ( !$loaded ) { - $this->markTestSkipped( "PHP extension '$extName' is not loaded, skipping." ); - } - - return $loaded; - } - - /** - * Asserts that an exception of the specified type occurs when running - * the provided code. - * - * @since 1.21 - * @deprecated since 1.22 Use setExpectedException - * - * @param callable $code - * @param string $expected - * @param string $message - */ - protected function assertException( $code, $expected = 'Exception', $message = '' ) { - $pokemons = null; - - try { - call_user_func( $code ); - } catch ( Exception $pokemons ) { - // Gotta Catch 'Em All! - } - - if ( $message === '' ) { - $message = 'An exception of type "' . $expected . '" should have been thrown'; - } - - $this->assertInstanceOf( $expected, $pokemons, $message ); - } -} diff --git a/tests/phpunit/README b/tests/phpunit/README deleted file mode 100644 index 0a32ba17..00000000 --- a/tests/phpunit/README +++ /dev/null @@ -1,53 +0,0 @@ -== MediaWiki PHPUnit Tests == - -The unit tests for MediaWiki are implemented using the PHPUnit testing -framework and require PHPUnit to run. - - -=== WARNING === - -Some of the unit tests are DESTRUCTIVE and WILL ALTER YOUR WIKI'S CONTENTS. - -DO NOT RUN THESE TESTS ON A PRODUCTION SYSTEM OR ON ANY SYSTEM WHERE YOU NEED -TO RETAIN YOUR DATA. - - -== Installation == - -If PHPUnit is not installed, follow the installation instructions in the -PHPUnit Manual at: - - http://www.phpunit.de/manual/current/en/installation.html - -- or - - -On Unix-like operating systems, run: - - make install - - -== Running tests == - -The tests are run from your operating system's command line. - -Ensure that you are in the tests/phpunit directory of your MediaWiki -installation. - - -On Unix-like operating systems, the tests runs are controlled with a makefile. -Run command: - - make help - -for a full list of options for running tests. - - -On Windows-family operating systems, run the 'run-tests.bat' batch file. - - -=== Writing tests === - -A guide to writing unit tests for MediaWiki can be found at: - - http://mediawiki.org/wiki/Unit_Testing - diff --git a/tests/phpunit/TODO b/tests/phpunit/TODO deleted file mode 100644 index b2fa7fb6..00000000 --- a/tests/phpunit/TODO +++ /dev/null @@ -1,10 +0,0 @@ -== Things To Do == -* Most of the tests are named poorly; naming should describe a use case in story-like language, not simply identify the -unit under test. An example would be the difference between testCalculate and testAddingIntegersTogetherWorks. -* Many of the tests make multiple assertions, and are thus not unitary tests. By using data-providers and more use-case -oriented test selection nearly all of these cases can be easily resolved. -* Some of the test files are either incorrectly named or in the wrong folder. Tests should be organized in a mirrored -structure to the source they are testing, and named the same, with the exception of the word "Test" at the end. -* Shared set-up code or base classes are present, but usually named improperly or appear to be poorly factored. Support -code should share as much of the same naming as the code it's supporting, and test and test-case depenencies should be -considered to resolve other shared needs. diff --git a/tests/phpunit/bootstrap.php b/tests/phpunit/bootstrap.php deleted file mode 100644 index d929b79d..00000000 --- a/tests/phpunit/bootstrap.php +++ /dev/null @@ -1,15 +0,0 @@ - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/phpunit/data/media/Png-native-test.png b/tests/phpunit/data/media/Png-native-test.png deleted file mode 100644 index a0b81ca9..00000000 Binary files a/tests/phpunit/data/media/Png-native-test.png and /dev/null differ diff --git a/tests/phpunit/data/media/QA_icon.svg b/tests/phpunit/data/media/QA_icon.svg deleted file mode 100644 index 6b5d86e4..00000000 --- a/tests/phpunit/data/media/QA_icon.svg +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ? - - - - - - - - \ No newline at end of file diff --git a/tests/phpunit/data/media/README b/tests/phpunit/data/media/README deleted file mode 100644 index fe3bc682..00000000 --- a/tests/phpunit/data/media/README +++ /dev/null @@ -1,38 +0,0 @@ -This directory contains media files for use with the -tests in includes/media directory. - -Image credits: - -QA_icon.svg: -http://es.wikipedia.org/wiki/Archivo:QA_icon.svg -GNU Lesser General Public License -~~helix84 (16.4.2007), Philverney (6.12.2005) David Vignoni - -Gtk-media-play-ltr.svg -http://commons.wikimedia.org/wiki/File:Gtk-media-play-ltr.svg -GNU Lesser General Public License -http://ftp.gnome.org/pub/GNOME/sources/gnome-themes-extras/0.9/gnome-themes-extras-0.9.0.tar.gz -David Vignoni - -US_states_by_total_state_tax_revenue.svg -http://commons.wikimedia.org/wiki/File:US_states_by_total_state_tax_revenue.svg -CC-BY 3.0 -TastyCakes on English Wikipedia - -greyscale-na-png.png, rgb-png.png, Xmp-exif-multilingual_test.jpg -greyscale-png.png, 1bit-png.png, Png-native-test.png, rgb-na-png.png, -test.tiff, test.jpg, jpeg-comment-multiple.jpg, jpeg-comment-utf.jpg, -jpeg-comment-iso8859-1.jpg, jpeg-comment-binary.jpg, jpeg-xmp-psir.jpg, -jpeg-xmp-alt.jpg, animated.gif, exif-user-comment.jpg, animated-xmp.gif, -iptc-timetest-invalid.jpg, jpeg-iptc-bad-hash.jpg, iptc-timetest.jpg, -xmp.png, nonanimated.gif, exif-gps.jpg, jpeg-xmp-psir.xmp, jpeg-iptc-good-hash.jpg, -jpeg-padding-even.jpg, jpeg-padding-odd.jpg -Are all by Bawolff. I don't think they contain enough originality to -claim copyright, but on the off chance they do, feel free to use them -however you feel fit, without restriction. - -Animated_PNG_example_bouncing_beach_ball.png -http://commons.wikimedia.org/wiki/File:Animated_PNG_example_bouncing_beach_ball.png (originally http://www.treebuilder.de/default.asp?file=89031.xml ) -Public Domain -Holger Will - diff --git a/tests/phpunit/data/media/Toll_Texas_1.svg b/tests/phpunit/data/media/Toll_Texas_1.svg deleted file mode 100644 index 73004e3e..00000000 --- a/tests/phpunit/data/media/Toll_Texas_1.svg +++ /dev/null @@ -1,150 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/phpunit/data/media/US_states_by_total_state_tax_revenue.svg b/tests/phpunit/data/media/US_states_by_total_state_tax_revenue.svg deleted file mode 100644 index 9afea859..00000000 --- a/tests/phpunit/data/media/US_states_by_total_state_tax_revenue.svg +++ /dev/null @@ -1,248 +0,0 @@ - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/phpunit/data/media/Wikimedia-logo.svg b/tests/phpunit/data/media/Wikimedia-logo.svg deleted file mode 100644 index 1e17acbe..00000000 --- a/tests/phpunit/data/media/Wikimedia-logo.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - \ No newline at end of file diff --git a/tests/phpunit/data/media/Xmp-exif-multilingual_test.jpg b/tests/phpunit/data/media/Xmp-exif-multilingual_test.jpg deleted file mode 100644 index f7b23025..00000000 Binary files a/tests/phpunit/data/media/Xmp-exif-multilingual_test.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/animated-xmp.gif b/tests/phpunit/data/media/animated-xmp.gif deleted file mode 100644 index fcba079d..00000000 Binary files a/tests/phpunit/data/media/animated-xmp.gif and /dev/null differ diff --git a/tests/phpunit/data/media/animated.gif b/tests/phpunit/data/media/animated.gif deleted file mode 100644 index a8f248b3..00000000 Binary files a/tests/phpunit/data/media/animated.gif and /dev/null differ diff --git a/tests/phpunit/data/media/broken_exif_date.jpg b/tests/phpunit/data/media/broken_exif_date.jpg deleted file mode 100644 index 82f62f57..00000000 Binary files a/tests/phpunit/data/media/broken_exif_date.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/exif-gps.jpg b/tests/phpunit/data/media/exif-gps.jpg deleted file mode 100644 index 40137340..00000000 Binary files a/tests/phpunit/data/media/exif-gps.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/exif-user-comment.jpg b/tests/phpunit/data/media/exif-user-comment.jpg deleted file mode 100644 index 9f23966a..00000000 Binary files a/tests/phpunit/data/media/exif-user-comment.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/greyscale-na-png.png b/tests/phpunit/data/media/greyscale-na-png.png deleted file mode 100644 index 4a4b7452..00000000 Binary files a/tests/phpunit/data/media/greyscale-na-png.png and /dev/null differ diff --git a/tests/phpunit/data/media/greyscale-png.png b/tests/phpunit/data/media/greyscale-png.png deleted file mode 100644 index 340a67b4..00000000 Binary files a/tests/phpunit/data/media/greyscale-png.png and /dev/null differ diff --git a/tests/phpunit/data/media/iptc-invalid-psir.jpg b/tests/phpunit/data/media/iptc-invalid-psir.jpg deleted file mode 100644 index 01b9acf3..00000000 Binary files a/tests/phpunit/data/media/iptc-invalid-psir.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/iptc-timetest-invalid.jpg b/tests/phpunit/data/media/iptc-timetest-invalid.jpg deleted file mode 100644 index b03e192a..00000000 Binary files a/tests/phpunit/data/media/iptc-timetest-invalid.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/iptc-timetest.jpg b/tests/phpunit/data/media/iptc-timetest.jpg deleted file mode 100644 index db9932ba..00000000 Binary files a/tests/phpunit/data/media/iptc-timetest.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-comment-binary.jpg b/tests/phpunit/data/media/jpeg-comment-binary.jpg deleted file mode 100644 index b467fe43..00000000 Binary files a/tests/phpunit/data/media/jpeg-comment-binary.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-comment-iso8859-1.jpg b/tests/phpunit/data/media/jpeg-comment-iso8859-1.jpg deleted file mode 100644 index d9ffbac1..00000000 Binary files a/tests/phpunit/data/media/jpeg-comment-iso8859-1.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-comment-multiple.jpg b/tests/phpunit/data/media/jpeg-comment-multiple.jpg deleted file mode 100644 index 363c7385..00000000 Binary files a/tests/phpunit/data/media/jpeg-comment-multiple.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-comment-utf.jpg b/tests/phpunit/data/media/jpeg-comment-utf.jpg deleted file mode 100644 index d6d35b4b..00000000 Binary files a/tests/phpunit/data/media/jpeg-comment-utf.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-iptc-bad-hash.jpg b/tests/phpunit/data/media/jpeg-iptc-bad-hash.jpg deleted file mode 100644 index 6464c5b8..00000000 Binary files a/tests/phpunit/data/media/jpeg-iptc-bad-hash.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-iptc-good-hash.jpg b/tests/phpunit/data/media/jpeg-iptc-good-hash.jpg deleted file mode 100644 index ef970854..00000000 Binary files a/tests/phpunit/data/media/jpeg-iptc-good-hash.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-padding-even.jpg b/tests/phpunit/data/media/jpeg-padding-even.jpg deleted file mode 100644 index c83c66bd..00000000 Binary files a/tests/phpunit/data/media/jpeg-padding-even.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-padding-odd.jpg b/tests/phpunit/data/media/jpeg-padding-odd.jpg deleted file mode 100644 index 25b93308..00000000 Binary files a/tests/phpunit/data/media/jpeg-padding-odd.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-xmp-alt.jpg b/tests/phpunit/data/media/jpeg-xmp-alt.jpg deleted file mode 100644 index 0e2c3f63..00000000 Binary files a/tests/phpunit/data/media/jpeg-xmp-alt.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-xmp-psir.jpg b/tests/phpunit/data/media/jpeg-xmp-psir.jpg deleted file mode 100644 index 4d19fcbe..00000000 Binary files a/tests/phpunit/data/media/jpeg-xmp-psir.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-xmp-psir.xmp b/tests/phpunit/data/media/jpeg-xmp-psir.xmp deleted file mode 100644 index fee6ee18..00000000 --- a/tests/phpunit/data/media/jpeg-xmp-psir.xmp +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - jpeg-xmp-psir.jpg - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/phpunit/data/media/landscape-plain.jpg b/tests/phpunit/data/media/landscape-plain.jpg deleted file mode 100644 index cf296555..00000000 Binary files a/tests/phpunit/data/media/landscape-plain.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/nonanimated.gif b/tests/phpunit/data/media/nonanimated.gif deleted file mode 100644 index 9e52a7f0..00000000 Binary files a/tests/phpunit/data/media/nonanimated.gif and /dev/null differ diff --git a/tests/phpunit/data/media/portrait-rotated.jpg b/tests/phpunit/data/media/portrait-rotated.jpg deleted file mode 100644 index 445feaed..00000000 Binary files a/tests/phpunit/data/media/portrait-rotated.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/rgb-na-png.png b/tests/phpunit/data/media/rgb-na-png.png deleted file mode 100644 index 2f2a5ca0..00000000 Binary files a/tests/phpunit/data/media/rgb-na-png.png and /dev/null differ diff --git a/tests/phpunit/data/media/rgb-png.png b/tests/phpunit/data/media/rgb-png.png deleted file mode 100644 index 6f40cc92..00000000 Binary files a/tests/phpunit/data/media/rgb-png.png and /dev/null differ diff --git a/tests/phpunit/data/media/test.jpg b/tests/phpunit/data/media/test.jpg deleted file mode 100644 index cb084253..00000000 Binary files a/tests/phpunit/data/media/test.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/test.tiff b/tests/phpunit/data/media/test.tiff deleted file mode 100644 index 6a36f760..00000000 Binary files a/tests/phpunit/data/media/test.tiff and /dev/null differ diff --git a/tests/phpunit/data/media/xmp.png b/tests/phpunit/data/media/xmp.png deleted file mode 100644 index 6b9f7a87..00000000 Binary files a/tests/phpunit/data/media/xmp.png and /dev/null differ diff --git a/tests/phpunit/data/xmp/1.result.php b/tests/phpunit/data/xmp/1.result.php deleted file mode 100644 index beead1bd..00000000 --- a/tests/phpunit/data/xmp/1.result.php +++ /dev/null @@ -1,8 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => '9' - ) -); diff --git a/tests/phpunit/data/xmp/1.xmp b/tests/phpunit/data/xmp/1.xmp deleted file mode 100644 index 66e15427..00000000 --- a/tests/phpunit/data/xmp/1.xmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - -True 0 1 False False - - diff --git a/tests/phpunit/data/xmp/2.result.php b/tests/phpunit/data/xmp/2.result.php deleted file mode 100644 index beead1bd..00000000 --- a/tests/phpunit/data/xmp/2.result.php +++ /dev/null @@ -1,8 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => '9' - ) -); diff --git a/tests/phpunit/data/xmp/2.xmp b/tests/phpunit/data/xmp/2.xmp deleted file mode 100644 index 0fa6a894..00000000 --- a/tests/phpunit/data/xmp/2.xmp +++ /dev/null @@ -1,12 +0,0 @@ - - - - - -True 1 False False - - diff --git a/tests/phpunit/data/xmp/3-invalid.result.php b/tests/phpunit/data/xmp/3-invalid.result.php deleted file mode 100644 index 5741b2c9..00000000 --- a/tests/phpunit/data/xmp/3-invalid.result.php +++ /dev/null @@ -1,7 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - ) -); diff --git a/tests/phpunit/data/xmp/3-invalid.xmp b/tests/phpunit/data/xmp/3-invalid.xmp deleted file mode 100644 index 2425e254..00000000 --- a/tests/phpunit/data/xmp/3-invalid.xmp +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - -0/10 - -fred - - - - - - - - -1 -False - - False False - - diff --git a/tests/phpunit/data/xmp/3.result.php b/tests/phpunit/data/xmp/3.result.php deleted file mode 100644 index beead1bd..00000000 --- a/tests/phpunit/data/xmp/3.result.php +++ /dev/null @@ -1,8 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => '9' - ) -); diff --git a/tests/phpunit/data/xmp/3.xmp b/tests/phpunit/data/xmp/3.xmp deleted file mode 100644 index 2cf19883..00000000 --- a/tests/phpunit/data/xmp/3.xmp +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - -0/10 - -fred - - - - - - - -True - -1 -False - - False False - - diff --git a/tests/phpunit/data/xmp/4.result.php b/tests/phpunit/data/xmp/4.result.php deleted file mode 100644 index 5741b2c9..00000000 --- a/tests/phpunit/data/xmp/4.result.php +++ /dev/null @@ -1,7 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - ) -); diff --git a/tests/phpunit/data/xmp/4.xmp b/tests/phpunit/data/xmp/4.xmp deleted file mode 100644 index 29eb614b..00000000 --- a/tests/phpunit/data/xmp/4.xmp +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - -0/10 - - -True 0 1 False False - - - - - - diff --git a/tests/phpunit/data/xmp/5.result.php b/tests/phpunit/data/xmp/5.result.php deleted file mode 100644 index 5741b2c9..00000000 --- a/tests/phpunit/data/xmp/5.result.php +++ /dev/null @@ -1,7 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - ) -); diff --git a/tests/phpunit/data/xmp/5.xmp b/tests/phpunit/data/xmp/5.xmp deleted file mode 100644 index 3cc61d68..00000000 --- a/tests/phpunit/data/xmp/5.xmp +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - -True 0 1 False False - - - - - - diff --git a/tests/phpunit/data/xmp/6.result.php b/tests/phpunit/data/xmp/6.result.php deleted file mode 100644 index beead1bd..00000000 --- a/tests/phpunit/data/xmp/6.result.php +++ /dev/null @@ -1,8 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => '9' - ) -); diff --git a/tests/phpunit/data/xmp/6.xmp b/tests/phpunit/data/xmp/6.xmp deleted file mode 100644 index f435ab23..00000000 --- a/tests/phpunit/data/xmp/6.xmp +++ /dev/null @@ -1,18 +0,0 @@ - - - - -0/10 - - - - - -True 0 1 False False - - diff --git a/tests/phpunit/data/xmp/7.result.php b/tests/phpunit/data/xmp/7.result.php deleted file mode 100644 index 115cdc92..00000000 --- a/tests/phpunit/data/xmp/7.result.php +++ /dev/null @@ -1,52 +0,0 @@ - - array( - 'CameraOwnerName' => 'Me!', - ), - 'xmp-general' => - array( - 'LicenseUrl' => 'http://creativecommons.com/cc-by-2.9', - 'ImageDescription' => - array( - 'x-default' => 'Test image for the cc: xmp: xmpRights: namespaces in xmp', - '_type' => 'lang', - ), - 'ObjectName' => - array( - 'x-default' => 'xmp core/xmp rights/cc ns test', - '_type' => 'lang', - ), - 'DateTimeDigitized' => '2005:04:03', - 'Software' => 'The one true editor: Vi (ok i used gimp)', - 'Identifier' => - array( - 0 => 'http://example.com/identifierurl', - 1 => 'urn:sha1:342524abcdef', - '_type' => 'ul', - ), - 'Label' => 'Test image', - 'DateTimeMetadata' => '2011:05:12', - 'DateTime' => '2007:03:04 06:34:10', - 'Nickname' => 'My little xmp test image', - 'Rating' => '5', - 'RightsCertificate' => 'http://example.com/rights-certificate/', - 'Copyrighted' => 'True', - 'CopyrightOwner' => - array( - 0 => 'Bawolff is copyright owner', - '_type' => 'ul', - ), - 'UsageTerms' => - array( - 'x-default' => 'do whatever you want', - 'en-gb' => 'Do whatever you want in british english', - '_type' => 'lang', - ), - 'WebStatement' => 'http://example.com/web_statement', - ), - 'xmp-deprecated' => - array( - 'Identifier' => 'http://example.com/identifierurl/wrong', - ), -); diff --git a/tests/phpunit/data/xmp/7.xmp b/tests/phpunit/data/xmp/7.xmp deleted file mode 100644 index e18e13d9..00000000 --- a/tests/phpunit/data/xmp/7.xmp +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - Me! - - - - http://creativecommons.com/cc-by-2.9 - - - - - - Test image for the cc: xmp: xmpRights: namespaces in xmp - - - http://example.com/identifierurl/wrong - - - xmp core/xmp rights/cc ns test - - - - - - 2005-04-03 - The one true editor: Vi (ok i used gimp) - - - http://example.com/identifierurl - - urn:sha1:342524abcdef - - - Test image - 2011-05-12 - 2007-03-04T12:34:10-06:00 - My little xmp test image - 7 - - - - http://example.com/rights-certificate/ - True - - - Bawolff is copyright owner - - - - - do whatever you want - Do whatever you want in british english - - - http://example.com/web_statement - - - - diff --git a/tests/phpunit/data/xmp/README b/tests/phpunit/data/xmp/README deleted file mode 100644 index bd949176..00000000 --- a/tests/phpunit/data/xmp/README +++ /dev/null @@ -1,3 +0,0 @@ -This directory contains a bunch of XMP files -as well as a bunch of php files containing what the -parsed version of the XMP looks like. diff --git a/tests/phpunit/data/xmp/bag-for-seq.result.php b/tests/phpunit/data/xmp/bag-for-seq.result.php deleted file mode 100644 index b5244f88..00000000 --- a/tests/phpunit/data/xmp/bag-for-seq.result.php +++ /dev/null @@ -1,10 +0,0 @@ - array( - 'Artist' => array( - '_type' => 'ul', - 0 => 'The author', - ) - ) -); diff --git a/tests/phpunit/data/xmp/bag-for-seq.xmp b/tests/phpunit/data/xmp/bag-for-seq.xmp deleted file mode 100644 index c6ed5b7c..00000000 --- a/tests/phpunit/data/xmp/bag-for-seq.xmp +++ /dev/null @@ -1 +0,0 @@ - The author diff --git a/tests/phpunit/data/xmp/flash.result.php b/tests/phpunit/data/xmp/flash.result.php deleted file mode 100644 index 018c0ac1..00000000 --- a/tests/phpunit/data/xmp/flash.result.php +++ /dev/null @@ -1,8 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => '127' - ) -); diff --git a/tests/phpunit/data/xmp/flash.xmp b/tests/phpunit/data/xmp/flash.xmp deleted file mode 100644 index b1373cc2..00000000 --- a/tests/phpunit/data/xmp/flash.xmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - -True 3 3 True True - - diff --git a/tests/phpunit/data/xmp/gps.result.php b/tests/phpunit/data/xmp/gps.result.php deleted file mode 100644 index 8ea9c68c..00000000 --- a/tests/phpunit/data/xmp/gps.result.php +++ /dev/null @@ -1,11 +0,0 @@ - - array( - 'GPSAltitude' => -3.14159265301, - 'GPSDOP' => '5/1', - 'GPSLatitude' => 88.51805555, - 'GPSLongitude' => -21.12356945, - 'GPSVersionID' => '2.2.0.0' - ) -); diff --git a/tests/phpunit/data/xmp/gps.xmp b/tests/phpunit/data/xmp/gps.xmp deleted file mode 100644 index e52d2c8a..00000000 --- a/tests/phpunit/data/xmp/gps.xmp +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - 103993/33102 - 1 - 5/1 - 88,31.083333N - 21,7.414167W - 2.2.0.0 - - - - - diff --git a/tests/phpunit/data/xmp/invalid-child-not-struct.result.php b/tests/phpunit/data/xmp/invalid-child-not-struct.result.php deleted file mode 100644 index 5741b2c9..00000000 --- a/tests/phpunit/data/xmp/invalid-child-not-struct.result.php +++ /dev/null @@ -1,7 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - ) -); diff --git a/tests/phpunit/data/xmp/invalid-child-not-struct.xmp b/tests/phpunit/data/xmp/invalid-child-not-struct.xmp deleted file mode 100644 index 6aa0c10b..00000000 --- a/tests/phpunit/data/xmp/invalid-child-not-struct.xmp +++ /dev/null @@ -1,12 +0,0 @@ - - - -True 0 1 False False - - - - diff --git a/tests/phpunit/data/xmp/no-namespace.result.php b/tests/phpunit/data/xmp/no-namespace.result.php deleted file mode 100644 index 3ff69201..00000000 --- a/tests/phpunit/data/xmp/no-namespace.result.php +++ /dev/null @@ -1,7 +0,0 @@ - - array( - 'FNumber' => '28/10', - ) -); diff --git a/tests/phpunit/data/xmp/no-namespace.xmp b/tests/phpunit/data/xmp/no-namespace.xmp deleted file mode 100644 index 7d6cdb2f..00000000 --- a/tests/phpunit/data/xmp/no-namespace.xmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/tests/phpunit/data/xmp/no-recognized-props.result.php b/tests/phpunit/data/xmp/no-recognized-props.result.php deleted file mode 100644 index b3ca9f5a..00000000 --- a/tests/phpunit/data/xmp/no-recognized-props.result.php +++ /dev/null @@ -1,2 +0,0 @@ - - - - - diff --git a/tests/phpunit/data/xmp/utf16BE.result.php b/tests/phpunit/data/xmp/utf16BE.result.php deleted file mode 100644 index ac7ea506..00000000 --- a/tests/phpunit/data/xmp/utf16BE.result.php +++ /dev/null @@ -1,12 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - ), - 'xmp-general' => - array( - 'Label' => '􊯍' - ), -); diff --git a/tests/phpunit/data/xmp/utf16BE.xmp b/tests/phpunit/data/xmp/utf16BE.xmp deleted file mode 100644 index 0cf60d60..00000000 Binary files a/tests/phpunit/data/xmp/utf16BE.xmp and /dev/null differ diff --git a/tests/phpunit/data/xmp/utf16LE.result.php b/tests/phpunit/data/xmp/utf16LE.result.php deleted file mode 100644 index ac7ea506..00000000 --- a/tests/phpunit/data/xmp/utf16LE.result.php +++ /dev/null @@ -1,12 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - ), - 'xmp-general' => - array( - 'Label' => '􊯍' - ), -); diff --git a/tests/phpunit/data/xmp/utf16LE.xmp b/tests/phpunit/data/xmp/utf16LE.xmp deleted file mode 100644 index 66d71f4c..00000000 Binary files a/tests/phpunit/data/xmp/utf16LE.xmp and /dev/null differ diff --git a/tests/phpunit/data/xmp/utf32BE.result.php b/tests/phpunit/data/xmp/utf32BE.result.php deleted file mode 100644 index ac7ea506..00000000 --- a/tests/phpunit/data/xmp/utf32BE.result.php +++ /dev/null @@ -1,12 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - ), - 'xmp-general' => - array( - 'Label' => '􊯍' - ), -); diff --git a/tests/phpunit/data/xmp/utf32BE.xmp b/tests/phpunit/data/xmp/utf32BE.xmp deleted file mode 100644 index 06afdf92..00000000 Binary files a/tests/phpunit/data/xmp/utf32BE.xmp and /dev/null differ diff --git a/tests/phpunit/data/xmp/utf32LE.result.php b/tests/phpunit/data/xmp/utf32LE.result.php deleted file mode 100644 index ac7ea506..00000000 --- a/tests/phpunit/data/xmp/utf32LE.result.php +++ /dev/null @@ -1,12 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - ), - 'xmp-general' => - array( - 'Label' => '􊯍' - ), -); diff --git a/tests/phpunit/data/xmp/utf32LE.xmp b/tests/phpunit/data/xmp/utf32LE.xmp deleted file mode 100644 index bf2097fe..00000000 Binary files a/tests/phpunit/data/xmp/utf32LE.xmp and /dev/null differ diff --git a/tests/phpunit/data/xmp/xmpExt.result.php b/tests/phpunit/data/xmp/xmpExt.result.php deleted file mode 100644 index beead1bd..00000000 --- a/tests/phpunit/data/xmp/xmpExt.result.php +++ /dev/null @@ -1,8 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => '9' - ) -); diff --git a/tests/phpunit/data/xmp/xmpExt.xmp b/tests/phpunit/data/xmp/xmpExt.xmp deleted file mode 100644 index da0383f8..00000000 --- a/tests/phpunit/data/xmp/xmpExt.xmp +++ /dev/null @@ -1,13 +0,0 @@ - - - - -True 0 1 False False - - diff --git a/tests/phpunit/data/xmp/xmpExt2.xmp b/tests/phpunit/data/xmp/xmpExt2.xmp deleted file mode 100644 index 060abb2c..00000000 --- a/tests/phpunit/data/xmp/xmpExt2.xmp +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/tests/phpunit/data/zip/cd-gap.zip b/tests/phpunit/data/zip/cd-gap.zip deleted file mode 100644 index b5ae6ccd..00000000 Binary files a/tests/phpunit/data/zip/cd-gap.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/cd-truncated.zip b/tests/phpunit/data/zip/cd-truncated.zip deleted file mode 100644 index 4d40d7d4..00000000 Binary files a/tests/phpunit/data/zip/cd-truncated.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/class-trailing-null.zip b/tests/phpunit/data/zip/class-trailing-null.zip deleted file mode 100644 index 31dcf3d8..00000000 Binary files a/tests/phpunit/data/zip/class-trailing-null.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/class-trailing-slash.zip b/tests/phpunit/data/zip/class-trailing-slash.zip deleted file mode 100644 index 9eb1f037..00000000 Binary files a/tests/phpunit/data/zip/class-trailing-slash.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/class.zip b/tests/phpunit/data/zip/class.zip deleted file mode 100644 index 98a625b7..00000000 Binary files a/tests/phpunit/data/zip/class.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/empty.zip b/tests/phpunit/data/zip/empty.zip deleted file mode 100644 index 15cb0ecb..00000000 Binary files a/tests/phpunit/data/zip/empty.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/looks-like-zip64.zip b/tests/phpunit/data/zip/looks-like-zip64.zip deleted file mode 100644 index 7428cddd..00000000 Binary files a/tests/phpunit/data/zip/looks-like-zip64.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/nosig.zip b/tests/phpunit/data/zip/nosig.zip deleted file mode 100644 index a22c73a4..00000000 Binary files a/tests/phpunit/data/zip/nosig.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/split.zip b/tests/phpunit/data/zip/split.zip deleted file mode 100644 index 6984ae6d..00000000 Binary files a/tests/phpunit/data/zip/split.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/trail.zip b/tests/phpunit/data/zip/trail.zip deleted file mode 100644 index 50bcea12..00000000 Binary files a/tests/phpunit/data/zip/trail.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/wrong-cd-start-disk.zip b/tests/phpunit/data/zip/wrong-cd-start-disk.zip deleted file mode 100644 index 59b45938..00000000 Binary files a/tests/phpunit/data/zip/wrong-cd-start-disk.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/wrong-central-entry-sig.zip b/tests/phpunit/data/zip/wrong-central-entry-sig.zip deleted file mode 100644 index 05329b43..00000000 Binary files a/tests/phpunit/data/zip/wrong-central-entry-sig.zip and /dev/null differ diff --git a/tests/phpunit/docs/ExportDemoTest.php b/tests/phpunit/docs/ExportDemoTest.php deleted file mode 100644 index b09487a6..00000000 --- a/tests/phpunit/docs/ExportDemoTest.php +++ /dev/null @@ -1,39 +0,0 @@ -validateXmlFileAgainstXsd( "../../docs/export-demo.xml" ); - } - - /** - * Validates a xml file against the xsd. - * - * The validation is slow, because php has to read the xsd on each call. - * - * @param $fname string: name of file to validate - */ - protected function validateXmlFileAgainstXsd( $fname ) { - $version = WikiExporter::schemaVersion(); - - $dom = new DomDocument(); - $dom->load( $fname ); - - // Ensure, the demo is for the current version - $this->assertEquals( $dom->documentElement->getAttribute( 'version' ), $version, 'export-demo.xml should have the current version' ); - - try { - $this->assertTrue( $dom->schemaValidate( "../../docs/export-" . $version . ".xsd" ), - "schemaValidate has found an error" ); - } catch ( Exception $e ) { - $this->fail( "xml not valid against xsd: " . $e->getMessage() ); - } - } -} diff --git a/tests/phpunit/includes/ArticleTablesTest.php b/tests/phpunit/includes/ArticleTablesTest.php deleted file mode 100644 index 469d1d19..00000000 --- a/tests/phpunit/includes/ArticleTablesTest.php +++ /dev/null @@ -1,32 +0,0 @@ -mRights = array( 'createpage', 'edit', 'purge' ); - $wgLanguageCode = 'es'; - $wgContLang = Language::factory( 'es' ); - - $wgLang = Language::factory( 'fr' ); - $page->doEditContent( new WikitextContent( '{{:{{int:history}}}}' ), 'Test code for bug 14404', 0, false, $user ); - $templates1 = $title->getTemplateLinksFrom(); - - $wgLang = Language::factory( 'de' ); - $page = WikiPage::factory( $title ); // In order to force the rerendering of the same wikitext - - // We need an edit, a purge is not enough to regenerate the tables - $page->doEditContent( new WikitextContent( '{{:{{int:history}}}}' ), 'Test code for bug 14404', EDIT_UPDATE, false, $user ); - $templates2 = $title->getTemplateLinksFrom(); - - $this->assertEquals( $templates1, $templates2 ); - $this->assertEquals( $templates1[0]->getFullText(), 'Historial' ); - } -} diff --git a/tests/phpunit/includes/ArticleTest.php b/tests/phpunit/includes/ArticleTest.php deleted file mode 100644 index b4d6dca6..00000000 --- a/tests/phpunit/includes/ArticleTest.php +++ /dev/null @@ -1,92 +0,0 @@ -title = Title::makeTitle( NS_MAIN, 'SomePage' ); - $this->article = new Article( $this->title ); - } - - /** cleanup title object and its article object */ - protected function tearDown() { - parent::tearDown(); - $this->title = null; - $this->article = null; - } - - public function testImplementsGetMagic() { - $this->assertEquals( false, $this->article->mLatest, "Article __get magic" ); - } - - /** - * @depends testImplementsGetMagic - */ - public function testImplementsSetMagic() { - $this->article->mLatest = 2; - $this->assertEquals( 2, $this->article->mLatest, "Article __set magic" ); - } - - /** - * @depends testImplementsSetMagic - */ - public function testImplementsCallMagic() { - $this->article->mLatest = 33; - $this->article->mDataLoaded = true; - $this->assertEquals( 33, $this->article->getLatest(), "Article __call magic" ); - } - - public function testGetOrSetOnNewProperty() { - $this->article->ext_someNewProperty = 12; - $this->assertEquals( 12, $this->article->ext_someNewProperty, - "Article get/set magic on new field" ); - - $this->article->ext_someNewProperty = -8; - $this->assertEquals( -8, $this->article->ext_someNewProperty, - "Article get/set magic on update to new field" ); - } - - /** - * Checks for the existence of the backwards compatibility static functions (forwarders to WikiPage class) - */ - public function testStaticFunctions() { - $this->hideDeprecated( 'Article::getAutosummary' ); - $this->hideDeprecated( 'WikiPage::getAutosummary' ); - $this->hideDeprecated( 'CategoryPage::getAutosummary' ); // Inherited from Article - - $this->assertEquals( WikiPage::selectFields(), Article::selectFields(), - "Article static functions" ); - $this->assertEquals( true, is_callable( "Article::onArticleCreate" ), - "Article static functions" ); - $this->assertEquals( true, is_callable( "Article::onArticleDelete" ), - "Article static functions" ); - $this->assertEquals( true, is_callable( "ImagePage::onArticleEdit" ), - "Article static functions" ); - $this->assertTrue( is_string( CategoryPage::getAutosummary( '', '', 0 ) ), - "Article static functions" ); - } - - public function testWikiPageFactory() { - $title = Title::makeTitle( NS_FILE, 'Someimage.png' ); - $page = WikiPage::factory( $title ); - $this->assertEquals( 'WikiFilePage', get_class( $page ) ); - - $title = Title::makeTitle( NS_CATEGORY, 'SomeCategory' ); - $page = WikiPage::factory( $title ); - $this->assertEquals( 'WikiCategoryPage', get_class( $page ) ); - - $title = Title::makeTitle( NS_MAIN, 'SomePage' ); - $page = WikiPage::factory( $title ); - $this->assertEquals( 'WikiPage', get_class( $page ) ); - } -} diff --git a/tests/phpunit/includes/BlockTest.php b/tests/phpunit/includes/BlockTest.php deleted file mode 100644 index 21de0985..00000000 --- a/tests/phpunit/includes/BlockTest.php +++ /dev/null @@ -1,354 +0,0 @@ -setMwGlobals( array( - 'wgLanguageCode' => 'en', - 'wgContLang' => Language::factory( 'en' ) - ) ); - } - - function addDBData() { - - $user = User::newFromName( 'UTBlockee' ); - if ( $user->getID() == 0 ) { - $user->addToDatabase(); - $user->setPassword( 'UTBlockeePassword' ); - - $user->saveSettings(); - } - - // Delete the last round's block if it's still there - $oldBlock = Block::newFromTarget( 'UTBlockee' ); - if ( $oldBlock ) { - // An old block will prevent our new one from saving. - $oldBlock->delete(); - } - - $this->block = new Block( 'UTBlockee', $user->getID(), 0, - 'Parce que', 0, false, time() + 100500 - ); - $this->madeAt = wfTimestamp( TS_MW ); - - $this->block->insert(); - // save up ID for use in assertion. Since ID is an autoincrement, - // its value might change depending on the order the tests are run. - // ApiBlockTest insert its own blocks! - $newBlockId = $this->block->getId(); - if ( $newBlockId ) { - $this->blockId = $newBlockId; - } else { - throw new MWException( "Failed to insert block for BlockTest; old leftover block remaining?" ); - } - - $this->addXffBlocks(); - } - - /** - * debug function : dump the ipblocks table - */ - function dumpBlocks() { - $v = $this->db->select( 'ipblocks', '*' ); - print "Got " . $v->numRows() . " rows. Full dump follow:\n"; - foreach ( $v as $row ) { - print_r( $row ); - } - } - - public function testInitializerFunctionsReturnCorrectBlock() { - // $this->dumpBlocks(); - - $this->assertTrue( $this->block->equals( Block::newFromTarget( 'UTBlockee' ) ), "newFromTarget() returns the same block as the one that was made" ); - - $this->assertTrue( $this->block->equals( Block::newFromID( $this->blockId ) ), "newFromID() returns the same block as the one that was made" ); - } - - /** - * per bug 26425 - */ - public function testBug26425BlockTimestampDefaultsToTime() { - // delta to stop one-off errors when things happen to go over a second mark. - $delta = abs( $this->madeAt - $this->block->mTimestamp ); - $this->assertLessThan( 2, $delta, "If no timestamp is specified, the block is recorded as time()" ); - } - - /** - * This is the method previously used to load block info in CheckUser etc - * passing an empty value (empty string, null, etc) as the ip parameter bypasses IP lookup checks. - * - * This stopped working with r84475 and friends: regression being fixed for bug 29116. - * - * @dataProvider provideBug29116Data - */ - public function testBug29116LoadWithEmptyIp( $vagueTarget ) { - $this->hideDeprecated( 'Block::load' ); - - $uid = User::idFromName( 'UTBlockee' ); - $this->assertTrue( ( $uid > 0 ), 'Must be able to look up the target user during tests' ); - - $block = new Block(); - $ok = $block->load( $vagueTarget, $uid ); - $this->assertTrue( $ok, "Block->load() with empty IP and user ID '$uid' should return a block" ); - - $this->assertTrue( $this->block->equals( $block ), "Block->load() returns the same block as the one that was made when given empty ip param " . var_export( $vagueTarget, true ) ); - } - - /** - * CheckUser since being changed to use Block::newFromTarget started failing - * because the new function didn't accept empty strings like Block::load() - * had. Regression bug 29116. - * - * @dataProvider provideBug29116Data - */ - public function testBug29116NewFromTargetWithEmptyIp( $vagueTarget ) { - $block = Block::newFromTarget( 'UTBlockee', $vagueTarget ); - $this->assertTrue( $this->block->equals( $block ), "newFromTarget() returns the same block as the one that was made when given empty vagueTarget param " . var_export( $vagueTarget, true ) ); - } - - public static function provideBug29116Data() { - return array( - array( null ), - array( '' ), - array( false ) - ); - } - - public function testBlockedUserCanNotCreateAccount() { - $username = 'BlockedUserToCreateAccountWith'; - $u = User::newFromName( $username ); - $u->setPassword( 'NotRandomPass' ); - $u->addToDatabase(); - unset( $u ); - - // Sanity check - $this->assertNull( - Block::newFromTarget( $username ), - "$username should not be blocked" - ); - - // Reload user - $u = User::newFromName( $username ); - $this->assertFalse( - $u->isBlockedFromCreateAccount(), - "Our sandbox user should be able to create account before being blocked" - ); - - // Foreign perspective (blockee not on current wiki)... - $block = new Block( - /* $address */ $username, - /* $user */ 14146, - /* $by */ 0, - /* $reason */ 'crosswiki block...', - /* $timestamp */ wfTimestampNow(), - /* $auto */ false, - /* $expiry */ $this->db->getInfinity(), - /* anonOnly */ false, - /* $createAccount */ true, - /* $enableAutoblock */ true, - /* $hideName (ipb_deleted) */ true, - /* $blockEmail */ true, - /* $allowUsertalk */ false, - /* $byName */ 'MetaWikiUser' - ); - $block->insert(); - - // Reload block from DB - $userBlock = Block::newFromTarget( $username ); - $this->assertTrue( - (bool)$block->prevents( 'createaccount' ), - "Block object in DB should prevents 'createaccount'" - ); - - $this->assertInstanceOf( - 'Block', - $userBlock, - "'$username' block block object should be existent" - ); - - // Reload user - $u = User::newFromName( $username ); - $this->assertTrue( - (bool)$u->isBlockedFromCreateAccount(), - "Our sandbox user '$username' should NOT be able to create account" - ); - } - - public function testCrappyCrossWikiBlocks() { - // Delete the last round's block if it's still there - $oldBlock = Block::newFromTarget( 'UserOnForeignWiki' ); - if ( $oldBlock ) { - // An old block will prevent our new one from saving. - $oldBlock->delete(); - } - - // Foreign perspective (blockee not on current wiki)... - $block = new Block( - /* $address */ 'UserOnForeignWiki', - /* $user */ 14146, - /* $by */ 0, - /* $reason */ 'crosswiki block...', - /* $timestamp */ wfTimestampNow(), - /* $auto */ false, - /* $expiry */ $this->db->getInfinity(), - /* anonOnly */ false, - /* $createAccount */ true, - /* $enableAutoblock */ true, - /* $hideName (ipb_deleted) */ true, - /* $blockEmail */ true, - /* $allowUsertalk */ false, - /* $byName */ 'MetaWikiUser' - ); - - $res = $block->insert( $this->db ); - $this->assertTrue( (bool)$res['id'], 'Block succeeded' ); - - // Local perspective (blockee on current wiki)... - $user = User::newFromName( 'UserOnForeignWiki' ); - $user->addToDatabase(); - // Set user ID to match the test value - $this->db->update( 'user', array( 'user_id' => 14146 ), array( 'user_id' => $user->getId() ) ); - $user = null; // clear - - $block = Block::newFromID( $res['id'] ); - $this->assertEquals( 'UserOnForeignWiki', $block->getTarget()->getName(), 'Correct blockee name' ); - $this->assertEquals( '14146', $block->getTarget()->getId(), 'Correct blockee id' ); - $this->assertEquals( 'MetaWikiUser', $block->getBlocker(), 'Correct blocker name' ); - $this->assertEquals( 'MetaWikiUser', $block->getByName(), 'Correct blocker name' ); - $this->assertEquals( 0, $block->getBy(), 'Correct blocker id' ); - } - - protected function addXffBlocks() { - static $inited = false; - - if ( $inited ) { - return; - } - - $inited = true; - - $blockList = array( - array( 'target' => '70.2.0.0/16', - 'type' => Block::TYPE_RANGE, - 'desc' => 'Range Hardblock', - 'ACDisable' => false, - 'isHardblock' => true, - 'isAutoBlocking' => false, - ), - array( 'target' => '2001:4860:4001::/48', - 'type' => Block::TYPE_RANGE, - 'desc' => 'Range6 Hardblock', - 'ACDisable' => false, - 'isHardblock' => true, - 'isAutoBlocking' => false, - ), - array( 'target' => '60.2.0.0/16', - 'type' => Block::TYPE_RANGE, - 'desc' => 'Range Softblock with AC Disabled', - 'ACDisable' => true, - 'isHardblock' => false, - 'isAutoBlocking' => false, - ), - array( 'target' => '50.2.0.0/16', - 'type' => Block::TYPE_RANGE, - 'desc' => 'Range Softblock', - 'ACDisable' => false, - 'isHardblock' => false, - 'isAutoBlocking' => false, - ), - array( 'target' => '50.1.1.1', - 'type' => Block::TYPE_IP, - 'desc' => 'Exact Softblock', - 'ACDisable' => false, - 'isHardblock' => false, - 'isAutoBlocking' => false, - ), - ); - - foreach ( $blockList as $insBlock ) { - $target = $insBlock['target']; - - if ( $insBlock['type'] === Block::TYPE_IP ) { - $target = User::newFromName( IP::sanitizeIP( $target ), false )->getName(); - } elseif ( $insBlock['type'] === Block::TYPE_RANGE ) { - $target = IP::sanitizeRange( $target ); - } - - $block = new Block(); - $block->setTarget( $target ); - $block->setBlocker( 'testblocker@global' ); - $block->mReason = $insBlock['desc']; - $block->mExpiry = 'infinity'; - $block->prevents( 'createaccount', $insBlock['ACDisable'] ); - $block->isHardblock( $insBlock['isHardblock'] ); - $block->isAutoblocking( $insBlock['isAutoBlocking'] ); - $block->insert(); - } - } - - public static function providerXff() { - return array( - array( 'xff' => '1.2.3.4, 70.2.1.1, 60.2.1.1, 2.3.4.5', - 'count' => 2, - 'result' => 'Range Hardblock' - ), - array( 'xff' => '1.2.3.4, 50.2.1.1, 60.2.1.1, 2.3.4.5', - 'count' => 2, - 'result' => 'Range Softblock with AC Disabled' - ), - array( 'xff' => '1.2.3.4, 70.2.1.1, 50.1.1.1, 2.3.4.5', - 'count' => 2, - 'result' => 'Exact Softblock' - ), - array( 'xff' => '1.2.3.4, 70.2.1.1, 50.2.1.1, 50.1.1.1, 2.3.4.5', - 'count' => 3, - 'result' => 'Exact Softblock' - ), - array( 'xff' => '1.2.3.4, 70.2.1.1, 50.2.1.1, 2.3.4.5', - 'count' => 2, - 'result' => 'Range Hardblock' - ), - array( 'xff' => '1.2.3.4, 70.2.1.1, 60.2.1.1, 2.3.4.5', - 'count' => 2, - 'result' => 'Range Hardblock' - ), - array( 'xff' => '50.2.1.1, 60.2.1.1, 2.3.4.5', - 'count' => 2, - 'result' => 'Range Softblock with AC Disabled' - ), - array( 'xff' => '1.2.3.4, 50.1.1.1, 60.2.1.1, 2.3.4.5', - 'count' => 2, - 'result' => 'Exact Softblock' - ), - array( 'xff' => '1.2.3.4, <$A_BUNCH-OF{INVALID}TEXT\>, 60.2.1.1, 2.3.4.5', - 'count' => 1, - 'result' => 'Range Softblock with AC Disabled' - ), - array( 'xff' => '1.2.3.4, 50.2.1.1, 2001:4860:4001:802::1003, 2.3.4.5', - 'count' => 2, - 'result' => 'Range6 Hardblock' - ), - ); - } - - /** - * @dataProvider providerXff - */ - public function testBlocksOnXff( $xff, $exCount, $exResult ) { - $list = array_map( 'trim', explode( ',', $xff ) ); - $xffblocks = Block::getBlocksForIPList( $list, true ); - $this->assertEquals( $exCount, count( $xffblocks ), 'Number of blocks for ' . $xff ); - $block = Block::chooseBlock( $xffblocks, $list ); - $this->assertEquals( $exResult, $block->mReason, 'Correct block type for XFF header ' . $xff ); - } -} diff --git a/tests/phpunit/includes/CdbTest.php b/tests/phpunit/includes/CdbTest.php deleted file mode 100644 index e3d9da7c..00000000 --- a/tests/phpunit/includes/CdbTest.php +++ /dev/null @@ -1,88 +0,0 @@ -markTestSkipped( 'Native CDB support is not available' ); - } - } - - /** - * @group medium - */ - public function testCdb() { - $dir = wfTempDir(); - if ( !is_writable( $dir ) ) { - $this->markTestSkipped( "Temp dir isn't writable" ); - } - - $phpcdbfile = $this->getNewTempFile(); - $dbacdbfile = $this->getNewTempFile(); - - $w1 = new CdbWriter_PHP( $phpcdbfile ); - $w2 = new CdbWriter_DBA( $dbacdbfile ); - - $data = array(); - for ( $i = 0; $i < 1000; $i++ ) { - $key = $this->randomString(); - $value = $this->randomString(); - $w1->set( $key, $value ); - $w2->set( $key, $value ); - - if ( !isset( $data[$key] ) ) { - $data[$key] = $value; - } - } - - $w1->close(); - $w2->close(); - - $this->assertEquals( - md5_file( $phpcdbfile ), - md5_file( $dbacdbfile ), - 'same hash' - ); - - $r1 = new CdbReader_PHP( $phpcdbfile ); - $r2 = new CdbReader_DBA( $dbacdbfile ); - - foreach ( $data as $key => $value ) { - if ( $key === '' ) { - // Known bug - continue; - } - $v1 = $r1->get( $key ); - $v2 = $r2->get( $key ); - - $v1 = $v1 === false ? '(not found)' : $v1; - $v2 = $v2 === false ? '(not found)' : $v2; - - # cdbAssert( 'Mismatch', $key, $v1, $v2 ); - $this->cdbAssert( "PHP error", $key, $v1, $value ); - $this->cdbAssert( "DBA error", $key, $v2, $value ); - } - } - - private function randomString() { - $len = mt_rand( 0, 10 ); - $s = ''; - for ( $j = 0; $j < $len; $j++ ) { - $s .= chr( mt_rand( 0, 255 ) ); - } - - return $s; - } - - private function cdbAssert( $msg, $key, $v1, $v2 ) { - $this->assertEquals( - $v2, - $v1, - $msg . ', k=' . bin2hex( $key ) - ); - } -} diff --git a/tests/phpunit/includes/CollationTest.php b/tests/phpunit/includes/CollationTest.php deleted file mode 100644 index 43bb3941..00000000 --- a/tests/phpunit/includes/CollationTest.php +++ /dev/null @@ -1,111 +0,0 @@ -markTestSkipped( 'These tests require intl extension' ); - } - } - - /** - * Test to make sure, that if you - * have "X" and "XY", the binary - * sortkey also has "X" being a - * prefix of "XY". Our collation - * code makes this assumption. - * - * @param $lang String Language code for collator - * @param $base String Base string - * @param $extended String String containing base as a prefix. - * - * @dataProvider prefixDataProvider - */ - public function testIsPrefix( $lang, $base, $extended ) { - $cp = Collator::create( $lang ); - $cp->setStrength( Collator::PRIMARY ); - $baseBin = $cp->getSortKey( $base ); - // Remove sortkey terminator - $baseBin = rtrim( $baseBin, "\0" ); - $extendedBin = $cp->getSortKey( $extended ); - $this->assertStringStartsWith( $baseBin, $extendedBin, "$base is not a prefix of $extended" ); - } - - function prefixDataProvider() { - return array( - array( 'en', 'A', 'AA' ), - array( 'en', 'A', 'AAA' ), - array( 'en', 'Д', 'ДЂ' ), - array( 'en', 'Д', 'ДA' ), - // 'Ʒ' should expand to 'Z ' (note space). - array( 'fi', 'Z', 'Ʒ' ), - // 'Þ' should expand to 'th' - array( 'sv', 't', 'Þ' ), - // Javanese is a limited use alphabet, so should have 3 bytes - // per character, so do some tests with it. - array( 'en', 'ꦲ', 'ꦲꦤ' ), - array( 'en', 'ꦲ', 'ꦲД' ), - array( 'en', 'A', 'Aꦲ' ), - ); - } - - /** - * Opposite of testIsPrefix - * - * @dataProvider notPrefixDataProvider - */ - public function testNotIsPrefix( $lang, $base, $extended ) { - $cp = Collator::create( $lang ); - $cp->setStrength( Collator::PRIMARY ); - $baseBin = $cp->getSortKey( $base ); - // Remove sortkey terminator - $baseBin = rtrim( $baseBin, "\0" ); - $extendedBin = $cp->getSortKey( $extended ); - $this->assertStringStartsNotWith( $baseBin, $extendedBin, "$base is a prefix of $extended" ); - } - - function notPrefixDataProvider() { - return array( - array( 'en', 'A', 'B' ), - array( 'en', 'AC', 'ABC' ), - array( 'en', 'Z', 'Ʒ' ), - array( 'en', 'A', 'ꦲ' ), - ); - } - - /** - * Test correct first letter is fetched. - * - * @param $collation String Collation name (aka uca-en) - * @param $string String String to get first letter of - * @param $firstLetter String Expected first letter. - * - * @dataProvider firstLetterProvider - */ - public function testGetFirstLetter( $collation, $string, $firstLetter ) { - $col = Collation::factory( $collation ); - $this->assertEquals( $firstLetter, $col->getFirstLetter( $string ) ); - } - - function firstLetterProvider() { - return array( - array( 'uppercase', 'Abc', 'A' ), - array( 'uppercase', 'abc', 'A' ), - array( 'identity', 'abc', 'a' ), - array( 'uca-en', 'abc', 'A' ), - array( 'uca-en', ' ', ' ' ), - array( 'uca-en', 'Êveryone', 'E' ), - array( 'uca-vi', 'Êveryone', 'Ê' ), - // Make sure thorn is not a first letter. - array( 'uca-sv', 'The', 'T' ), - array( 'uca-sv', 'Å', 'Å' ), - array( 'uca-hu', 'dzsdo', 'Dzs' ), - array( 'uca-hu', 'dzdso', 'Dz' ), - array( 'uca-hu', 'CSD', 'Cs' ), - array( 'uca-root', 'CSD', 'C' ), - array( 'uca-fi', 'Ǥ', 'G' ), - array( 'uca-fi', 'Ŧ', 'T' ), - array( 'uca-fi', 'Ʒ', 'Z' ), - array( 'uca-fi', 'Ŋ', 'N' ), - ); - } -} diff --git a/tests/phpunit/includes/DiffHistoryBlobTest.php b/tests/phpunit/includes/DiffHistoryBlobTest.php deleted file mode 100644 index a4d5b91a..00000000 --- a/tests/phpunit/includes/DiffHistoryBlobTest.php +++ /dev/null @@ -1,44 +0,0 @@ -markTestSkipped( 'The xdiff extension is not available' ); - - return; - } - if ( !function_exists( 'xdiff_string_rabdiff' ) ) { - $this->markTestSkipped( 'The version of xdiff extension is lower than 1.5.0' ); - - return; - } - if ( !extension_loaded( 'hash' ) ) { - $this->markTestSkipped( 'The hash extension is not available' ); - - return; - } - parent::setUp(); - } - - /** - * Test for DiffHistoryBlob::xdiffAdler32() - * @dataProvider provideXdiffAdler32 - */ - public function testXdiffAdler32( $input ) { - $xdiffHash = substr( xdiff_string_rabdiff( $input, '' ), 0, 4 ); - $dhb = new DiffHistoryBlob; - $myHash = $dhb->xdiffAdler32( $input ); - $this->assertSame( bin2hex( $xdiffHash ), bin2hex( $myHash ), - "Hash of " . addcslashes( $input, "\0..\37!@\@\177..\377" ) ); - } - - public static function provideXdiffAdler32() { - return array( - array( '', 'Empty string' ), - array( "\0", 'Null' ), - array( "\0\0\0", "Several nulls" ), - array( "Hello", "An ASCII string" ), - array( str_repeat( "x", 6000 ), "A string larger than xdiff's NMAX (5552)" ) - ); - } -} diff --git a/tests/phpunit/includes/EditPageTest.php b/tests/phpunit/includes/EditPageTest.php deleted file mode 100644 index 87272a4c..00000000 --- a/tests/phpunit/includes/EditPageTest.php +++ /dev/null @@ -1,491 +0,0 @@ -assertEquals( $title, $extracted ); - } - - public static function provideExtractSectionTitle() { - return array( - array( - "== Test ==\n\nJust a test section.", - "Test" - ), - array( - "An initial section, no header.", - false - ), - array( - "An initial section with a fake heder (bug 32617)\n\n== Test == ??\nwtf", - false - ), - array( - "== Section ==\nfollowed by a fake == Non-section == ??\nnoooo", - "Section" - ), - array( - "== Section== \t\r\n followed by whitespace (bug 35051)", - 'Section', - ), - ); - } - - protected function forceRevisionDate( WikiPage $page, $timestamp ) { - $dbw = wfGetDB( DB_MASTER ); - - $dbw->update( 'revision', - array( 'rev_timestamp' => $dbw->timestamp( $timestamp ) ), - array( 'rev_id' => $page->getLatest() ) ); - - $page->clear(); - } - - /** - * User input text is passed to rtrim() by edit page. This is a simple - * wrapper around assertEquals() which calls rrtrim() to normalize the - * expected and actual texts. - */ - function assertEditedTextEquals( $expected, $actual, $msg = '' ) { - return $this->assertEquals( rtrim( $expected ), rtrim( $actual ), $msg ); - } - - /** - * Performs an edit and checks the result. - * - * @param String|Title $title The title of the page to edit - * @param String|null $baseText Some text to create the page with before attempting the edit. - * @param User|String|null $user The user to perform the edit as. - * @param array $edit An array of request parameters used to define the edit to perform. - * Some well known fields are: - * * wpTextbox1: the text to submit - * * wpSummary: the edit summary - * * wpEditToken: the edit token (will be inserted if not provided) - * * wpEdittime: timestamp of the edit's base revision (will be inserted if not provided) - * * wpStarttime: timestamp when the edit started (will be inserted if not provided) - * * wpSectionTitle: the section to edit - * * wpMinorEdit: mark as minor edit - * * wpWatchthis: whether to watch the page - * @param int|null $expectedCode The expected result code (EditPage::AS_XXX constants). - * Set to null to skip the check. Defaults to EditPage::AS_OK. - * @param String|null $expectedText The text expected to be on the page after the edit. - * Set to null to skip the check. - * @param String|null $message An optional message to show along with any error message. - * - * @return WikiPage The page that was just edited, useful for getting the edit's rev_id, etc. - */ - protected function assertEdit( $title, $baseText, $user = null, array $edit, - $expectedCode = EditPage::AS_OK, $expectedText = null, $message = null - ) { - if ( is_string( $title ) ) { - $ns = $this->getDefaultWikitextNS(); - $title = Title::newFromText( $title, $ns ); - } - - if ( is_string( $user ) ) { - $user = User::newFromName( $user ); - - if ( $user->getId() === 0 ) { - $user->addToDatabase(); - } - } - - $page = WikiPage::factory( $title ); - - if ( $baseText !== null ) { - $content = ContentHandler::makeContent( $baseText, $title ); - $page->doEditContent( $content, "base text for test" ); - $this->forceRevisionDate( $page, '20120101000000' ); - - //sanity check - $page->clear(); - $currentText = ContentHandler::getContentText( $page->getContent() ); - - # EditPage rtrim() the user input, so we alter our expected text - # to reflect that. - $this->assertEditedTextEquals( $baseText, $currentText ); - } - - if ( $user == null ) { - $user = $GLOBALS['wgUser']; - } else { - $this->setMwGlobals( 'wgUser', $user ); - } - - if ( !isset( $edit['wpEditToken'] ) ) { - $edit['wpEditToken'] = $user->getEditToken(); - } - - if ( !isset( $edit['wpEdittime'] ) ) { - $edit['wpEdittime'] = $page->exists() ? $page->getTimestamp() : ''; - } - - if ( !isset( $edit['wpStarttime'] ) ) { - $edit['wpStarttime'] = wfTimestampNow(); - } - - $req = new FauxRequest( $edit, true ); // session ?? - - $ep = new EditPage( new Article( $title ) ); - $ep->setContextTitle( $title ); - $ep->importFormData( $req ); - - $bot = isset( $edit['bot'] ) ? (bool)$edit['bot'] : false; - - // this is where the edit happens! - // Note: don't want to use EditPage::AttemptSave, because it messes with $wgOut - // and throws exceptions like PermissionsError - $status = $ep->internalAttemptSave( $result, $bot ); - - if ( $expectedCode !== null ) { - // check edit code - $this->assertEquals( $expectedCode, $status->value, - "Expected result code mismatch. $message" ); - } - - $page = WikiPage::factory( $title ); - - if ( $expectedText !== null ) { - // check resulting page text - $content = $page->getContent(); - $text = ContentHandler::getContentText( $content ); - - # EditPage rtrim() the user input, so we alter our expected text - # to reflect that. - $this->assertEditedTextEquals( $expectedText, $text, - "Expected article text mismatch. $message" ); - } - - return $page; - } - - public function testCreatePage() { - $this->assertEdit( - 'EditPageTest_testCreatePage', - null, - null, - array( - 'wpTextbox1' => "Hello World!", - ), - EditPage::AS_SUCCESS_NEW_ARTICLE, - "Hello World!", - "expected article being created" - )->doDeleteArticleReal( 'EditPageTest_testCreatePage' ); - - $this->assertEdit( - 'EditPageTest_testCreatePage', - null, - null, - array( - 'wpTextbox1' => "", - ), - EditPage::AS_BLANK_ARTICLE, - null, - "expected article not being created if empty" - ); - - - $this->assertEdit( - 'MediaWiki:January', - null, - 'UTSysop', - array( - 'wpTextbox1' => "Not January", - ), - EditPage::AS_SUCCESS_NEW_ARTICLE, - "Not January", - "expected MediaWiki: page being created" - )->doDeleteArticleReal( 'EditPageTest_testCreatePage' ); - - $this->assertEdit( - 'MediaWiki:EditPageTest_testCreatePage', - null, - 'UTSysop', - array( - 'wpTextbox1' => "", - ), - EditPage::AS_BLANK_ARTICLE, - null, - "expected not-registered MediaWiki: page not being created if empty" - ); - - $this->assertEdit( - 'MediaWiki:January', - null, - 'UTSysop', - array( - 'wpTextbox1' => "", - ), - EditPage::AS_SUCCESS_NEW_ARTICLE, - "", - "expected registered MediaWiki: page being created even if empty" - )->doDeleteArticleReal( 'EditPageTest_testCreatePage' ); - - $this->assertEdit( - 'MediaWiki:Ipb-default-expiry', - null, - 'UTSysop', - array( - 'wpTextbox1' => "", - ), - EditPage::AS_BLANK_ARTICLE, - "", - "expected registered MediaWiki: page whose default content is empty not being created if empty" - ); - - $this->assertEdit( - 'MediaWiki:January', - null, - 'UTSysop', - array( - 'wpTextbox1' => "January", - ), - EditPage::AS_BLANK_ARTICLE, - null, - "expected MediaWiki: page not being created if text equals default message" - ); - } - - public function testUpdatePage() { - $text = "one"; - $edit = array( - 'wpTextbox1' => $text, - 'wpSummary' => 'first update', - ); - - $page = $this->assertEdit( 'EditPageTest_testUpdatePage', "zero", null, $edit, - EditPage::AS_SUCCESS_UPDATE, $text, - "expected successfull update with given text" ); - - $this->forceRevisionDate( $page, '20120101000000' ); - - $text = "two"; - $edit = array( - 'wpTextbox1' => $text, - 'wpSummary' => 'second update', - ); - - $this->assertEdit( 'EditPageTest_testUpdatePage', null, null, $edit, - EditPage::AS_SUCCESS_UPDATE, $text, - "expected successfull update with given text" ); - } - - public static function provideSectionEdit() { - $text = 'Intro - -== one == -first section. - -== two == -second section. -'; - - $sectionOne = '== one == -hello -'; - - $newSection = '== new section == - -hello -'; - - $textWithNewSectionOne = preg_replace( - '/== one ==.*== two ==/ms', - "$sectionOne\n== two ==", $text - ); - - $textWithNewSectionAdded = "$text\n$newSection"; - - return array( - array( #0 - $text, - '', - 'hello', - 'replace all', - 'hello' - ), - - array( #1 - $text, - '1', - $sectionOne, - 'replace first section', - $textWithNewSectionOne, - ), - - array( #2 - $text, - 'new', - 'hello', - 'new section', - $textWithNewSectionAdded, - ), - ); - } - - /** - * @dataProvider provideSectionEdit - */ - public function testSectionEdit( $base, $section, $text, $summary, $expected ) { - $edit = array( - 'wpTextbox1' => $text, - 'wpSummary' => $summary, - 'wpSection' => $section, - ); - - $this->assertEdit( 'EditPageTest_testSectionEdit', $base, null, $edit, - EditPage::AS_SUCCESS_UPDATE, $expected, - "expected successfull update of section" ); - } - - public static function provideAutoMerge() { - $tests = array(); - - $tests[] = array( #0: plain conflict - "Elmo", # base edit user - "one\n\ntwo\n\nthree\n", - array( #adam's edit - 'wpStarttime' => 1, - 'wpTextbox1' => "ONE\n\ntwo\n\nthree\n", - ), - array( #berta's edit - 'wpStarttime' => 2, - 'wpTextbox1' => "(one)\n\ntwo\n\nthree\n", - ), - EditPage::AS_CONFLICT_DETECTED, # expected code - "ONE\n\ntwo\n\nthree\n", # expected text - 'expected edit conflict', # message - ); - - $tests[] = array( #1: successful merge - "Elmo", # base edit user - "one\n\ntwo\n\nthree\n", - array( #adam's edit - 'wpStarttime' => 1, - 'wpTextbox1' => "ONE\n\ntwo\n\nthree\n", - ), - array( #berta's edit - 'wpStarttime' => 2, - 'wpTextbox1' => "one\n\ntwo\n\nTHREE\n", - ), - EditPage::AS_SUCCESS_UPDATE, # expected code - "ONE\n\ntwo\n\nTHREE\n", # expected text - 'expected automatic merge', # message - ); - - $text = "Intro\n\n"; - $text .= "== first section ==\n\n"; - $text .= "one\n\ntwo\n\nthree\n\n"; - $text .= "== second section ==\n\n"; - $text .= "four\n\nfive\n\nsix\n\n"; - - // extract the first section. - $section = preg_replace( '/.*(== first section ==.*)== second section ==.*/sm', '$1', $text ); - - // generate expected text after merge - $expected = str_replace( 'one', 'ONE', str_replace( 'three', 'THREE', $text ) ); - - $tests[] = array( #2: merge in section - "Elmo", # base edit user - $text, - array( #adam's edit - 'wpStarttime' => 1, - 'wpTextbox1' => str_replace( 'one', 'ONE', $section ), - 'wpSection' => '1' - ), - array( #berta's edit - 'wpStarttime' => 2, - 'wpTextbox1' => str_replace( 'three', 'THREE', $section ), - 'wpSection' => '1' - ), - EditPage::AS_SUCCESS_UPDATE, # expected code - $expected, # expected text - 'expected automatic section merge', # message - ); - - // see whether it makes a difference who did the base edit - $testsWithAdam = array_map( function ( $test ) { - $test[0] = 'Adam'; // change base edit user - return $test; - }, $tests ); - - $testsWithBerta = array_map( function ( $test ) { - $test[0] = 'Berta'; // change base edit user - return $test; - }, $tests ); - - return array_merge( $tests, $testsWithAdam, $testsWithBerta ); - } - - /** - * @dataProvider provideAutoMerge - */ - public function testAutoMerge( $baseUser, $text, $adamsEdit, $bertasEdit, - $expectedCode, $expectedText, $message = null - ) { - $this->checkHasDiff3(); - - //create page - $ns = $this->getDefaultWikitextNS(); - $title = Title::newFromText( 'EditPageTest_testAutoMerge', $ns ); - $page = WikiPage::factory( $title ); - - if ( $page->exists() ) { - $page->doDeleteArticle( "clean slate for testing" ); - } - - $baseEdit = array( - 'wpTextbox1' => $text, - ); - - $page = $this->assertEdit( 'EditPageTest_testAutoMerge', null, - $baseUser, $baseEdit, null, null, __METHOD__ ); - - $this->forceRevisionDate( $page, '20120101000000' ); - - $edittime = $page->getTimestamp(); - - // start timestamps for conflict detection - if ( !isset( $adamsEdit['wpStarttime'] ) ) { - $adamsEdit['wpStarttime'] = 1; - } - - if ( !isset( $bertasEdit['wpStarttime'] ) ) { - $bertasEdit['wpStarttime'] = 2; - } - - $starttime = wfTimestampNow(); - $adamsTime = wfTimestamp( TS_MW, (int)wfTimestamp( TS_UNIX, $starttime ) + (int)$adamsEdit['wpStarttime'] ); - $bertasTime = wfTimestamp( TS_MW, (int)wfTimestamp( TS_UNIX, $starttime ) + (int)$bertasEdit['wpStarttime'] ); - - $adamsEdit['wpStarttime'] = $adamsTime; - $bertasEdit['wpStarttime'] = $bertasTime; - - $adamsEdit['wpSummary'] = 'Adam\'s edit'; - $bertasEdit['wpSummary'] = 'Bertas\'s edit'; - - $adamsEdit['wpEdittime'] = $edittime; - $bertasEdit['wpEdittime'] = $edittime; - - // first edit - $this->assertEdit( 'EditPageTest_testAutoMerge', null, 'Adam', $adamsEdit, - EditPage::AS_SUCCESS_UPDATE, null, "expected successfull update" ); - - // second edit - $this->assertEdit( 'EditPageTest_testAutoMerge', null, 'Berta', $bertasEdit, - $expectedCode, $expectedText, $message ); - } -} diff --git a/tests/phpunit/includes/ExternalStoreTest.php b/tests/phpunit/includes/ExternalStoreTest.php deleted file mode 100644 index fcffcbc2..00000000 --- a/tests/phpunit/includes/ExternalStoreTest.php +++ /dev/null @@ -1,81 +0,0 @@ -setMwGlobals( 'wgExternalStores', false ); - - $this->assertFalse( - ExternalStore::fetchFromURL( 'FOO://cluster1/200' ), - 'Deny if wgExternalStores is not set to a non-empty array' - ); - - $this->setMwGlobals( 'wgExternalStores', array( 'FOO' ) ); - - $this->assertEquals( - ExternalStore::fetchFromURL( 'FOO://cluster1/200' ), - 'Hello', - 'Allow FOO://cluster1/200' - ); - $this->assertEquals( - ExternalStore::fetchFromURL( 'FOO://cluster1/300/0' ), - 'Hello', - 'Allow FOO://cluster1/300/0' - ); - # Assertions for r68900 - $this->assertFalse( - ExternalStore::fetchFromURL( 'ftp.example.org' ), - 'Deny domain ftp.example.org' - ); - $this->assertFalse( - ExternalStore::fetchFromURL( '/example.txt' ), - 'Deny path /example.txt' - ); - $this->assertFalse( - ExternalStore::fetchFromURL( 'http://' ), - 'Deny protocol http://' - ); - } -} - -class ExternalStoreFOO { - - protected $data = array( - 'cluster1' => array( - '200' => 'Hello', - '300' => array( - 'Hello', 'World', - ), - ), - ); - - /** - * Fetch data from given URL - * @param $url String: an url of the form FOO://cluster/id or FOO://cluster/id/itemid. - * @return mixed - */ - function fetchFromURL( $url ) { - // Based on ExternalStoreDB - $path = explode( '/', $url ); - $cluster = $path[2]; - $id = $path[3]; - if ( isset( $path[4] ) ) { - $itemID = $path[4]; - } else { - $itemID = false; - } - - if ( !isset( $this->data[$cluster][$id] ) ) { - return null; - } - - if ( $itemID !== false && is_array( $this->data[$cluster][$id] ) && isset( $this->data[$cluster][$id][$itemID] ) ) { - return $this->data[$cluster][$id][$itemID]; - } - - return $this->data[$cluster][$id]; - } -} diff --git a/tests/phpunit/includes/ExtraParserTest.php b/tests/phpunit/includes/ExtraParserTest.php deleted file mode 100644 index 6c67beb1..00000000 --- a/tests/phpunit/includes/ExtraParserTest.php +++ /dev/null @@ -1,157 +0,0 @@ -setMwGlobals( array( - 'wgShowDBErrorBacktrace' => true, - 'wgLanguageCode' => 'en', - 'wgContLang' => $contLang, - 'wgLang' => Language::factory( 'en' ), - 'wgMemc' => new EmptyBagOStuff, - 'wgAlwaysUseTidy' => false, - 'wgCleanSignatures' => true, - ) ); - - $this->options = ParserOptions::newFromUserAndLang( new User, $contLang ); - $this->options->setTemplateCallback( array( __CLASS__, 'statelessFetchTemplate' ) ); - $this->parser = new Parser; - - MagicWord::clearCache(); - } - - // Bug 8689 - Long numeric lines kill the parser - public function testBug8689() { - global $wgUser; - $longLine = '1.' . str_repeat( '1234567890', 100000 ) . "\n"; - - $t = Title::newFromText( 'Unit test' ); - $options = ParserOptions::newFromUser( $wgUser ); - $this->assertEquals( "

        $longLine

        ", - $this->parser->parse( $longLine, $t, $options )->getText() ); - } - - /* Test the parser entry points */ - public function testParse() { - $title = Title::newFromText( __FUNCTION__ ); - $parserOutput = $this->parser->parse( "Test\n{{Foo}}\n{{Bar}}", $title, $this->options ); - $this->assertEquals( "

        Test\nContent of Template:Foo\nContent of Template:Bar\n

        ", $parserOutput->getText() ); - } - - public function testPreSaveTransform() { - global $wgUser; - $title = Title::newFromText( __FUNCTION__ ); - $outputText = $this->parser->preSaveTransform( "Test\r\n{{subst:Foo}}\n{{Bar}}", $title, $wgUser, $this->options ); - - $this->assertEquals( "Test\nContent of ''Template:Foo''\n{{Bar}}", $outputText ); - } - - public function testPreprocess() { - $title = Title::newFromText( __FUNCTION__ ); - $outputText = $this->parser->preprocess( "Test\n{{Foo}}\n{{Bar}}", $title, $this->options ); - - $this->assertEquals( "Test\nContent of ''Template:Foo''\nContent of ''Template:Bar''", $outputText ); - } - - /** - * cleanSig() makes all templates substs and removes tildes - */ - public function testCleanSig() { - $title = Title::newFromText( __FUNCTION__ ); - $outputText = $this->parser->cleanSig( "{{Foo}} ~~~~" ); - - $this->assertEquals( "{{SUBST:Foo}} ", $outputText ); - } - - /** - * cleanSig() should do nothing if disabled - */ - public function testCleanSigDisabled() { - $this->setMwGlobals( 'wgCleanSignatures', false ); - - $title = Title::newFromText( __FUNCTION__ ); - $outputText = $this->parser->cleanSig( "{{Foo}} ~~~~" ); - - $this->assertEquals( "{{Foo}} ~~~~", $outputText ); - } - - /** - * cleanSigInSig() just removes tildes - * @dataProvider provideStringsForCleanSigInSig - */ - public function testCleanSigInSig( $in, $out ) { - $this->assertEquals( Parser::cleanSigInSig( $in ), $out ); - } - - public static function provideStringsForCleanSigInSig() { - return array( - array( "{{Foo}} ~~~~", "{{Foo}} " ), - array( "~~~", "" ), - array( "~~~~~", "" ), - ); - } - - public function testGetSection() { - $outputText2 = $this->parser->getSection( "Section 0\n== Heading 1 ==\nSection 1\n=== Heading 2 ===\nSection 2\n== Heading 3 ==\nSection 3\n", 2 ); - $outputText1 = $this->parser->getSection( "Section 0\n== Heading 1 ==\nSection 1\n=== Heading 2 ===\nSection 2\n== Heading 3 ==\nSection 3\n", 1 ); - - $this->assertEquals( "=== Heading 2 ===\nSection 2", $outputText2 ); - $this->assertEquals( "== Heading 1 ==\nSection 1\n=== Heading 2 ===\nSection 2", $outputText1 ); - } - - public function testReplaceSection() { - $outputText = $this->parser->replaceSection( "Section 0\n== Heading 1 ==\nSection 1\n=== Heading 2 ===\nSection 2\n== Heading 3 ==\nSection 3\n", 1, "New section 1" ); - - $this->assertEquals( "Section 0\nNew section 1\n\n== Heading 3 ==\nSection 3", $outputText ); - } - - /** - * Templates and comments are not affected, but noinclude/onlyinclude is. - */ - public function testGetPreloadText() { - $title = Title::newFromText( __FUNCTION__ ); - $outputText = $this->parser->getPreloadText( "{{Foo}} censored information ", $title, $this->options ); - - $this->assertEquals( "{{Foo}} information ", $outputText ); - } - - static function statelessFetchTemplate( $title, $parser = false ) { - $text = "Content of ''" . $title->getFullText() . "''"; - $deps = array(); - - return array( - 'text' => $text, - 'finalTitle' => $title, - 'deps' => $deps ); - } - - /** - * @group Database - */ - public function testTrackingCategory() { - $title = Title::newFromText( __FUNCTION__ ); - $catName = wfMessage( 'broken-file-category' )->inContentLanguage()->text(); - $cat = Title::makeTitleSafe( NS_CATEGORY, $catName ); - $expected = array( $cat->getDBkey() ); - $parserOutput = $this->parser->parse( "[[file:nonexistent]]", $title, $this->options ); - $result = $parserOutput->getCategoryLinks(); - $this->assertEquals( $expected, $result ); - } - - /** - * @group Database - */ - public function testTrackingCategorySpecial() { - // Special pages shouldn't have tracking cats. - $title = SpecialPage::getTitleFor( 'Contributions' ); - $parserOutput = $this->parser->parse( "[[file:nonexistent]]", $title, $this->options ); - $result = $parserOutput->getCategoryLinks(); - $this->assertEmpty( $result ); - } -} diff --git a/tests/phpunit/includes/FallbackTest.php b/tests/phpunit/includes/FallbackTest.php deleted file mode 100644 index f408f471..00000000 --- a/tests/phpunit/includes/FallbackTest.php +++ /dev/null @@ -1,73 +0,0 @@ -markTestSkipped( "The mb_string functions must be installed to test the fallback functions" ); - } - - $sampleUTF = "Östergötland_coat_of_arms.png"; - - //mb_substr - $substr_params = array( - array( 0, 0 ), - array( 5, -4 ), - array( 33 ), - array( 100, -5 ), - array( -8, 10 ), - array( 1, 1 ), - array( 2, -1 ) - ); - - foreach ( $substr_params as $param_set ) { - $old_param_set = $param_set; - array_unshift( $param_set, $sampleUTF ); - - $this->assertEquals( - call_user_func_array( 'mb_substr', $param_set ), - call_user_func_array( 'Fallback::mb_substr', $param_set ), - 'Fallback mb_substr with params ' . implode( ', ', $old_param_set ) - ); - } - - //mb_strlen - $this->assertEquals( - mb_strlen( $sampleUTF ), - Fallback::mb_strlen( $sampleUTF ), - 'Fallback mb_strlen' - ); - - //mb_str(r?)pos - $strpos_params = array( - //array( 'ter' ), - //array( 'Ö' ), - //array( 'Ö', 3 ), - //array( 'oat_', 100 ), - //array( 'c', -10 ), - //Broken for now - ); - - foreach ( $strpos_params as $param_set ) { - $old_param_set = $param_set; - array_unshift( $param_set, $sampleUTF ); - - $this->assertEquals( - call_user_func_array( 'mb_strpos', $param_set ), - call_user_func_array( 'Fallback::mb_strpos', $param_set ), - 'Fallback mb_strpos with params ' . implode( ', ', $old_param_set ) - ); - - $this->assertEquals( - call_user_func_array( 'mb_strrpos', $param_set ), - call_user_func_array( 'Fallback::mb_strrpos', $param_set ), - 'Fallback mb_strrpos with params ' . implode( ', ', $old_param_set ) - ); - } - } - -} \ No newline at end of file diff --git a/tests/phpunit/includes/FauxRequestTest.php b/tests/phpunit/includes/FauxRequestTest.php deleted file mode 100644 index 9f3aa11d..00000000 --- a/tests/phpunit/includes/FauxRequestTest.php +++ /dev/null @@ -1,15 +0,0 @@ -setHeader( 'Content-Type', $value ); - - $this->assertEquals( $request->getHeader( 'Content-Type' ), $value ); - $this->assertEquals( $request->getHeader( 'CONTENT-TYPE' ), $value ); - $this->assertEquals( $request->getHeader( 'content-type' ), $value ); - } -} diff --git a/tests/phpunit/includes/FauxResponseTest.php b/tests/phpunit/includes/FauxResponseTest.php deleted file mode 100644 index f9ba1b3b..00000000 --- a/tests/phpunit/includes/FauxResponseTest.php +++ /dev/null @@ -1,74 +0,0 @@ -response = new FauxResponse; - } - - public function testCookie() { - $this->assertEquals( null, $this->response->getcookie( 'key' ), 'Non-existing cookie' ); - $this->response->setcookie( 'key', 'val' ); - $this->assertEquals( 'val', $this->response->getcookie( 'key' ), 'Existing cookie' ); - } - - public function testHeader() { - $this->assertEquals( null, $this->response->getheader( 'Location' ), 'Non-existing header' ); - - $this->response->header( 'Location: http://localhost/' ); - $this->assertEquals( 'http://localhost/', $this->response->getheader( 'Location' ), 'Set header' ); - - $this->response->header( 'Location: http://127.0.0.1/' ); - $this->assertEquals( 'http://127.0.0.1/', $this->response->getheader( 'Location' ), 'Same header' ); - - $this->response->header( 'Location: http://127.0.0.2/', false ); - $this->assertEquals( 'http://127.0.0.1/', $this->response->getheader( 'Location' ), 'Same header with override disabled' ); - - $this->response->header( 'Location: http://localhost/' ); - $this->assertEquals( 'http://localhost/', $this->response->getheader( 'LOCATION' ), 'Get header case insensitive' ); - } - - public function testResponseCode() { - $this->response->header( 'HTTP/1.1 200' ); - $this->assertEquals( 200, $this->response->getStatusCode(), 'Header with no message' ); - - $this->response->header( 'HTTP/1.x 201' ); - $this->assertEquals( 201, $this->response->getStatusCode(), 'Header with no message and protocol 1.x' ); - - $this->response->header( 'HTTP/1.1 202 OK' ); - $this->assertEquals( 202, $this->response->getStatusCode(), 'Normal header' ); - - $this->response->header( 'HTTP/1.x 203 OK' ); - $this->assertEquals( 203, $this->response->getStatusCode(), 'Normal header with no message and protocol 1.x' ); - - $this->response->header( 'HTTP/1.x 204 OK', false, 205 ); - $this->assertEquals( 205, $this->response->getStatusCode(), 'Third parameter overrides the HTTP/... header' ); - - $this->response->header( 'Location: http://localhost/', false, 206 ); - $this->assertEquals( 206, $this->response->getStatusCode(), 'Third parameter with another header' ); - } -} diff --git a/tests/phpunit/includes/FormOptionsInitializationTest.php b/tests/phpunit/includes/FormOptionsInitializationTest.php deleted file mode 100644 index fb2304dc..00000000 --- a/tests/phpunit/includes/FormOptionsInitializationTest.php +++ /dev/null @@ -1,84 +0,0 @@ -options; - } -} - -/** - * Test class for FormOptions initialization - * Ensure the FormOptions::add() does what we want it to do. - * - * Generated by PHPUnit on 2011-02-28 at 20:46:27. - * - * Copyright © 2011, Antoine Musso - * - * @author Antoine Musso - */ -class FormOptionsInitializationTest extends MediaWikiTestCase { - /** - * @var FormOptions - */ - protected $object; - - - /** - * A new fresh and empty FormOptions object to test initialization - * with. - */ - protected function setUp() { - parent::setUp(); - $this->object = new FormOptionsExposed(); - } - - public function testAddStringOption() { - $this->object->add( 'foo', 'string value' ); - $this->assertEquals( - array( - 'foo' => array( - 'default' => 'string value', - 'consumed' => false, - 'type' => FormOptions::STRING, - 'value' => null, - ) - ), - $this->object->getOptions() - ); - } - - public function testAddIntegers() { - $this->object->add( 'one', 1 ); - $this->object->add( 'negone', -1 ); - $this->assertEquals( - array( - 'negone' => array( - 'default' => -1, - 'value' => null, - 'consumed' => false, - 'type' => FormOptions::INT, - ), - 'one' => array( - 'default' => 1, - 'value' => null, - 'consumed' => false, - 'type' => FormOptions::INT, - ) - ), - $this->object->getOptions() - ); - } -} diff --git a/tests/phpunit/includes/FormOptionsTest.php b/tests/phpunit/includes/FormOptionsTest.php deleted file mode 100644 index 0a13cfec..00000000 --- a/tests/phpunit/includes/FormOptionsTest.php +++ /dev/null @@ -1,91 +0,0 @@ -object = new FormOptions; - $this->object->add( 'string1', 'string one' ); - $this->object->add( 'string2', 'string two' ); - $this->object->add( 'integer', 0 ); - $this->object->add( 'intnull', 0, FormOptions::INTNULL ); - } - - /** Helpers for testGuessType() */ - /* @{ */ - private function assertGuessBoolean( $data ) { - $this->guess( FormOptions::BOOL, $data ); - } - private function assertGuessInt( $data ) { - $this->guess( FormOptions::INT, $data ); - } - private function assertGuessString( $data ) { - $this->guess( FormOptions::STRING, $data ); - } - - /** Generic helper */ - private function guess( $expected, $data ) { - $this->assertEquals( - $expected, - FormOptions::guessType( $data ) - ); - } - /* @} */ - - /** - * Reuse helpers above assertGuessBoolean assertGuessInt assertGuessString - */ - public function testGuessTypeDetection() { - $this->assertGuessBoolean( true ); - $this->assertGuessBoolean( false ); - - $this->assertGuessInt( 0 ); - $this->assertGuessInt( -5 ); - $this->assertGuessInt( 5 ); - $this->assertGuessInt( 0x0F ); - - $this->assertGuessString( 'true' ); - $this->assertGuessString( 'false' ); - $this->assertGuessString( '5' ); - $this->assertGuessString( '0' ); - } - - /** - * @expectedException MWException - */ - public function testGuessTypeOnArrayThrowException() { - $this->object->guessType( array( 'foo' ) ); - } - /** - * @expectedException MWException - */ - public function testGuessTypeOnNullThrowException() { - $this->object->guessType( null ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php deleted file mode 100644 index 6154df1d..00000000 --- a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php +++ /dev/null @@ -1,652 +0,0 @@ -setMwGlobals( array( - 'wgReadOnlyFile' => $readOnlyFile, - 'wgUrlProtocols' => array( - 'http://', - 'https://', - 'mailto:', - '//', - 'file://', # Non-default - ), - ) ); - } - - protected function tearDown() { - global $wgReadOnlyFile; - - if ( file_exists( $wgReadOnlyFile ) ) { - unlink( $wgReadOnlyFile ); - } - - parent::tearDown(); - } - - /** - * @dataProvider provideForWfArrayDiff2 - * @covers ::wfArrayDiff2 - */ - public function testWfArrayDiff2( $a, $b, $expected ) { - $this->assertEquals( - wfArrayDiff2( $a, $b ), $expected - ); - } - - // @todo Provide more tests - public static function provideForWfArrayDiff2() { - // $a $b $expected - return array( - array( - array( 'a', 'b' ), - array( 'a', 'b' ), - array(), - ), - array( - array( array( 'a' ), array( 'a', 'b', 'c' ) ), - array( array( 'a' ), array( 'a', 'b' ) ), - array( 1 => array( 'a', 'b', 'c' ) ), - ), - ); - } - - /** - * @covers ::wfRandom - */ - public function testRandom() { - # This could hypothetically fail, but it shouldn't ;) - $this->assertFalse( - wfRandom() == wfRandom() ); - } - - /** - * @covers ::wfUrlencode - */ - public function testUrlencode() { - $this->assertEquals( - "%E7%89%B9%E5%88%A5:Contributions/Foobar", - wfUrlencode( "\xE7\x89\xB9\xE5\x88\xA5:Contributions/Foobar" ) ); - } - - /** - * @covers ::wfExpandIRI - */ - public function testExpandIRI() { - $this->assertEquals( - "https://te.wikibooks.org/wiki/ఉబుంటు_వాడుకరి_మార్గదర్శని", - wfExpandIRI( "https://te.wikibooks.org/wiki/%E0%B0%89%E0%B0%AC%E0%B1%81%E0%B0%82%E0%B0%9F%E0%B1%81_%E0%B0%B5%E0%B0%BE%E0%B0%A1%E0%B1%81%E0%B0%95%E0%B0%B0%E0%B0%BF_%E0%B0%AE%E0%B0%BE%E0%B0%B0%E0%B1%8D%E0%B0%97%E0%B0%A6%E0%B0%B0%E0%B1%8D%E0%B0%B6%E0%B0%A8%E0%B0%BF" ) ); - } - - /** - * @covers ::wfReadOnly - */ - public function testReadOnlyEmpty() { - global $wgReadOnly; - $wgReadOnly = null; - - $this->assertFalse( wfReadOnly() ); - $this->assertFalse( wfReadOnly() ); - } - - /** - * @covers ::wfReadOnly - */ - public function testReadOnlySet() { - global $wgReadOnly, $wgReadOnlyFile; - - $f = fopen( $wgReadOnlyFile, "wt" ); - fwrite( $f, 'Message' ); - fclose( $f ); - $wgReadOnly = null; # Check on $wgReadOnlyFile - - $this->assertTrue( wfReadOnly() ); - $this->assertTrue( wfReadOnly() ); # Check cached - - unlink( $wgReadOnlyFile ); - $wgReadOnly = null; # Clean cache - - $this->assertFalse( wfReadOnly() ); - $this->assertFalse( wfReadOnly() ); - } - - public static function provideArrayToCGI() { - return array( - array( array(), '' ), // empty - array( array( 'foo' => 'bar' ), 'foo=bar' ), // string test - array( array( 'foo' => '' ), 'foo=' ), // empty string test - array( array( 'foo' => 1 ), 'foo=1' ), // number test - array( array( 'foo' => true ), 'foo=1' ), // true test - array( array( 'foo' => false ), '' ), // false test - array( array( 'foo' => null ), '' ), // null test - array( array( 'foo' => 'A&B=5+6@!"\'' ), 'foo=A%26B%3D5%2B6%40%21%22%27' ), // urlencoding test - array( array( 'foo' => 'bar', 'baz' => 'is', 'asdf' => 'qwerty' ), 'foo=bar&baz=is&asdf=qwerty' ), // multi-item test - array( array( 'foo' => array( 'bar' => 'baz' ) ), 'foo%5Bbar%5D=baz' ), - array( array( 'foo' => array( 'bar' => 'baz', 'qwerty' => 'asdf' ) ), 'foo%5Bbar%5D=baz&foo%5Bqwerty%5D=asdf' ), - array( array( 'foo' => array( 'bar', 'baz' ) ), 'foo%5B0%5D=bar&foo%5B1%5D=baz' ), - array( array( 'foo' => array( 'bar' => array( 'bar' => 'baz' ) ) ), 'foo%5Bbar%5D%5Bbar%5D=baz' ), - ); - } - - /** - * @dataProvider provideArrayToCGI - * @covers ::wfArrayToCgi - */ - public function testArrayToCGI( $array, $result ) { - $this->assertEquals( $result, wfArrayToCgi( $array ) ); - } - - - /** - * @covers ::testWfArrayDiff2 - */ - public function testArrayToCGI2() { - $this->assertEquals( - "baz=bar&foo=bar", - wfArrayToCgi( - array( 'baz' => 'bar' ), - array( 'foo' => 'bar', 'baz' => 'overridden value' ) ) ); - } - - public static function provideCgiToArray() { - return array( - array( '', array() ), // empty - array( 'foo=bar', array( 'foo' => 'bar' ) ), // string - array( 'foo=', array( 'foo' => '' ) ), // empty string - array( 'foo', array( 'foo' => '' ) ), // missing = - array( 'foo=bar&qwerty=asdf', array( 'foo' => 'bar', 'qwerty' => 'asdf' ) ), // multiple value - array( 'foo=A%26B%3D5%2B6%40%21%22%27', array( 'foo' => 'A&B=5+6@!"\'' ) ), // urldecoding test - array( 'foo%5Bbar%5D=baz', array( 'foo' => array( 'bar' => 'baz' ) ) ), - array( 'foo%5Bbar%5D=baz&foo%5Bqwerty%5D=asdf', array( 'foo' => array( 'bar' => 'baz', 'qwerty' => 'asdf' ) ) ), - array( 'foo%5B0%5D=bar&foo%5B1%5D=baz', array( 'foo' => array( 0 => 'bar', 1 => 'baz' ) ) ), - array( 'foo%5Bbar%5D%5Bbar%5D=baz', array( 'foo' => array( 'bar' => array( 'bar' => 'baz' ) ) ) ), - ); - } - - /** - * @dataProvider provideCgiToArray - * @covers ::wfCgiToArray - */ - public function testCgiToArray( $cgi, $result ) { - $this->assertEquals( $result, wfCgiToArray( $cgi ) ); - } - - public static function provideCgiRoundTrip() { - return array( - array( '' ), - array( 'foo=bar' ), - array( 'foo=' ), - array( 'foo=bar&baz=biz' ), - array( 'foo=A%26B%3D5%2B6%40%21%22%27' ), - array( 'foo%5Bbar%5D=baz' ), - array( 'foo%5B0%5D=bar&foo%5B1%5D=baz' ), - array( 'foo%5Bbar%5D%5Bbar%5D=baz' ), - ); - } - - /** - * @dataProvider provideCgiRoundTrip - * @covers ::wfArrayToCgi - */ - public function testCgiRoundTrip( $cgi ) { - $this->assertEquals( $cgi, wfArrayToCgi( wfCgiToArray( $cgi ) ) ); - } - - /** - * @covers ::mimeTypeMatch - */ - public function testMimeTypeMatch() { - $this->assertEquals( - 'text/html', - mimeTypeMatch( 'text/html', - array( 'application/xhtml+xml' => 1.0, - 'text/html' => 0.7, - 'text/plain' => 0.3 ) ) ); - $this->assertEquals( - 'text/*', - mimeTypeMatch( 'text/html', - array( 'image/*' => 1.0, - 'text/*' => 0.5 ) ) ); - $this->assertEquals( - '*/*', - mimeTypeMatch( 'text/html', - array( '*/*' => 1.0 ) ) ); - $this->assertNull( - mimeTypeMatch( 'text/html', - array( 'image/png' => 1.0, - 'image/svg+xml' => 0.5 ) ) ); - } - - /** - * @covers ::wfNegotiateType - */ - public function testNegotiateType() { - $this->assertEquals( - 'text/html', - wfNegotiateType( - array( 'application/xhtml+xml' => 1.0, - 'text/html' => 0.7, - 'text/plain' => 0.5, - 'text/*' => 0.2 ), - array( 'text/html' => 1.0 ) ) ); - $this->assertEquals( - 'application/xhtml+xml', - wfNegotiateType( - array( 'application/xhtml+xml' => 1.0, - 'text/html' => 0.7, - 'text/plain' => 0.5, - 'text/*' => 0.2 ), - array( 'application/xhtml+xml' => 1.0, - 'text/html' => 0.5 ) ) ); - $this->assertEquals( - 'text/html', - wfNegotiateType( - array( 'text/html' => 1.0, - 'text/plain' => 0.5, - 'text/*' => 0.5, - 'application/xhtml+xml' => 0.2 ), - array( 'application/xhtml+xml' => 1.0, - 'text/html' => 0.5 ) ) ); - $this->assertEquals( - 'text/html', - wfNegotiateType( - array( 'text/*' => 1.0, - 'image/*' => 0.7, - '*/*' => 0.3 ), - array( 'application/xhtml+xml' => 1.0, - 'text/html' => 0.5 ) ) ); - $this->assertNull( - wfNegotiateType( - array( 'text/*' => 1.0 ), - array( 'application/xhtml+xml' => 1.0 ) ) ); - } - - /** - * @covers ::wfDebug - * @covers ::wfDebugMem - */ - public function testDebugFunctionTest() { - - global $wgDebugLogFile, $wgDebugTimestamps; - - $old_log_file = $wgDebugLogFile; - $wgDebugLogFile = tempnam( wfTempDir(), 'mw-' ); - # @todo FIXME: $wgDebugTimestamps should be tested - $old_wgDebugTimestamps = $wgDebugTimestamps; - $wgDebugTimestamps = false; - - wfDebug( "This is a normal string" ); - $this->assertEquals( "This is a normal string", file_get_contents( $wgDebugLogFile ) ); - unlink( $wgDebugLogFile ); - - wfDebug( "This is nöt an ASCII string" ); - $this->assertEquals( "This is nöt an ASCII string", file_get_contents( $wgDebugLogFile ) ); - unlink( $wgDebugLogFile ); - - wfDebug( "\00305This has böth UTF and control chars\003" ); - $this->assertEquals( " 05This has böth UTF and control chars ", file_get_contents( $wgDebugLogFile ) ); - unlink( $wgDebugLogFile ); - - wfDebugMem(); - $this->assertGreaterThan( 5000, preg_replace( '/\D/', '', file_get_contents( $wgDebugLogFile ) ) ); - unlink( $wgDebugLogFile ); - - wfDebugMem( true ); - $this->assertGreaterThan( 5000000, preg_replace( '/\D/', '', file_get_contents( $wgDebugLogFile ) ) ); - unlink( $wgDebugLogFile ); - - $wgDebugLogFile = $old_log_file; - $wgDebugTimestamps = $old_wgDebugTimestamps; - } - - /** - * @covers ::wfClientAcceptsGzip - */ - public function testClientAcceptsGzipTest() { - - $settings = array( - 'gzip' => true, - 'bzip' => false, - '*' => false, - 'compress, gzip' => true, - 'gzip;q=1.0' => true, - 'foozip' => false, - 'foo*zip' => false, - 'gzip;q=abcde' => true, //is this REALLY valid? - 'gzip;q=12345678.9' => true, - ' gzip' => true, - ); - - if ( isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) { - $old_server_setting = $_SERVER['HTTP_ACCEPT_ENCODING']; - } - - foreach ( $settings as $encoding => $expect ) { - $_SERVER['HTTP_ACCEPT_ENCODING'] = $encoding; - - $this->assertEquals( $expect, wfClientAcceptsGzip( true ), - "'$encoding' => " . wfBoolToStr( $expect ) ); - } - - if ( isset( $old_server_setting ) ) { - $_SERVER['HTTP_ACCEPT_ENCODING'] = $old_server_setting; - } - } - - /** - * @covers ::swap - */ - public function testSwapVarsTest() { - $var1 = 1; - $var2 = 2; - - $this->assertEquals( $var1, 1, 'var1 is set originally' ); - $this->assertEquals( $var2, 2, 'var1 is set originally' ); - - swap( $var1, $var2 ); - - $this->assertEquals( $var1, 2, 'var1 is swapped' ); - $this->assertEquals( $var2, 1, 'var2 is swapped' ); - } - - /** - * @covers ::wfPercent - */ - public function testWfPercentTest() { - - $pcts = array( - array( 6 / 7, '0.86%', 2, false ), - array( 3 / 3, '1%' ), - array( 22 / 7, '3.14286%', 5 ), - array( 3 / 6, '0.5%' ), - array( 1 / 3, '0%', 0 ), - array( 10 / 3, '0%', -1 ), - array( 3 / 4 / 5, '0.1%', 1 ), - array( 6 / 7 * 8, '6.8571428571%', 10 ), - ); - - foreach ( $pcts as $pct ) { - if ( !isset( $pct[2] ) ) { - $pct[2] = 2; - } - if ( !isset( $pct[3] ) ) { - $pct[3] = true; - } - - $this->assertEquals( wfPercent( $pct[0], $pct[2], $pct[3] ), $pct[1], $pct[1] ); - } - } - - /** - * test @see wfShorthandToInteger() - * @dataProvider provideShorthand - * @covers ::wfShorthandToInteger - */ - public function testWfShorthandToInteger( $shorthand, $expected ) { - $this->assertEquals( $expected, - wfShorthandToInteger( $shorthand ) - ); - } - - /** array( shorthand, expected integer ) */ - public static function provideShorthand() { - return array( - # Null, empty ... - array( '', -1 ), - array( ' ', -1 ), - array( null, -1 ), - - # Failures returns 0 :( - array( 'ABCDEFG', 0 ), - array( 'Ak', 0 ), - - # Int, strings with spaces - array( 1, 1 ), - array( ' 1 ', 1 ), - array( 1023, 1023 ), - array( ' 1023 ', 1023 ), - - # kilo, Mega, Giga - array( '1k', 1024 ), - array( '1K', 1024 ), - array( '1m', 1024 * 1024 ), - array( '1M', 1024 * 1024 ), - array( '1g', 1024 * 1024 * 1024 ), - array( '1G', 1024 * 1024 * 1024 ), - - # Negatives - array( -1, -1 ), - array( -500, -500 ), - array( '-500', -500 ), - array( '-1k', -1024 ), - - # Zeroes - array( '0', 0 ), - array( '0k', 0 ), - array( '0M', 0 ), - array( '0G', 0 ), - array( '-0', 0 ), - array( '-0k', 0 ), - array( '-0M', 0 ), - array( '-0G', 0 ), - ); - } - - /** - * @param String $old: Text as it was in the database - * @param String $mine: Text submitted while user was editing - * @param String $yours: Text submitted by the user - * @param Boolean $expectedMergeResult Whether the merge should be a success - * @param String $expectedText: Text after merge has been completed - * - * @dataProvider provideMerge() - * @group medium - * @covers ::wfMerge - */ - public function testMerge( $old, $mine, $yours, $expectedMergeResult, $expectedText ) { - $this->checkHasDiff3(); - - $mergedText = null; - $isMerged = wfMerge( $old, $mine, $yours, $mergedText ); - - $msg = 'Merge should be a '; - $msg .= $expectedMergeResult ? 'success' : 'failure'; - $this->assertEquals( $expectedMergeResult, $isMerged, $msg ); - - if ( $isMerged ) { - // Verify the merged text - $this->assertEquals( $expectedText, $mergedText, - 'is merged text as expected?' ); - } - } - - public static function provideMerge() { - $EXPECT_MERGE_SUCCESS = true; - $EXPECT_MERGE_FAILURE = false; - - return array( - // #0: clean merge - array( - // old: - "one one one\n" . // trimmed - "\n" . - "two two two", - - // mine: - "one one one ONE ONE\n" . - "\n" . - "two two two\n", // with tailing whitespace - - // yours: - "one one one\n" . - "\n" . - "two two TWO TWO", // trimmed - - // ok: - $EXPECT_MERGE_SUCCESS, - - // result: - "one one one ONE ONE\n" . - "\n" . - "two two TWO TWO\n", // note: will always end in a newline - ), - - // #1: conflict, fail - array( - // old: - "one one one", // trimmed - - // mine: - "one one one ONE ONE\n" . - "\n" . - "bla bla\n" . - "\n", // with tailing whitespace - - // yours: - "one one one\n" . - "\n" . - "two two", // trimmed - - $EXPECT_MERGE_FAILURE, - - // result: - null, - ), - ); - } - - /** - * @dataProvider provideMakeUrlIndexes() - * @covers ::wfMakeUrlIndexes - */ - public function testMakeUrlIndexes( $url, $expected ) { - $index = wfMakeUrlIndexes( $url ); - $this->assertEquals( $expected, $index, "wfMakeUrlIndexes(\"$url\")" ); - } - - public static function provideMakeUrlIndexes() { - return array( - array( - // just a regular :) - 'https://bugzilla.wikimedia.org/show_bug.cgi?id=28627', - array( 'https://org.wikimedia.bugzilla./show_bug.cgi?id=28627' ) - ), - array( - // mailtos are handled special - // is this really right though? that final . probably belongs earlier? - 'mailto:wiki@wikimedia.org', - array( 'mailto:org.wikimedia@wiki.' ) - ), - - // file URL cases per bug 28627... - array( - // three slashes: local filesystem path Unix-style - 'file:///whatever/you/like.txt', - array( 'file://./whatever/you/like.txt' ) - ), - array( - // three slashes: local filesystem path Windows-style - 'file:///c:/whatever/you/like.txt', - array( 'file://./c:/whatever/you/like.txt' ) - ), - array( - // two slashes: UNC filesystem path Windows-style - 'file://intranet/whatever/you/like.txt', - array( 'file://intranet./whatever/you/like.txt' ) - ), - // Multiple-slash cases that can sorta work on Mozilla - // if you hack it just right are kinda pathological, - // and unreliable cross-platform or on IE which means they're - // unlikely to appear on intranets. - // - // Those will survive the algorithm but with results that - // are less consistent. - - // protocol-relative URL cases per bug 29854... - array( - '//bugzilla.wikimedia.org/show_bug.cgi?id=28627', - array( - 'http://org.wikimedia.bugzilla./show_bug.cgi?id=28627', - 'https://org.wikimedia.bugzilla./show_bug.cgi?id=28627' - ) - ), - ); - } - - /** - * @dataProvider provideWfMatchesDomainList - * @covers ::wfMatchesDomainList - */ - public function testWfMatchesDomainList( $url, $domains, $expected, $description ) { - $actual = wfMatchesDomainList( $url, $domains ); - $this->assertEquals( $expected, $actual, $description ); - } - - public static function provideWfMatchesDomainList() { - $a = array(); - $protocols = array( 'HTTP' => 'http:', 'HTTPS' => 'https:', 'protocol-relative' => '' ); - foreach ( $protocols as $pDesc => $p ) { - $a = array_merge( $a, array( - array( "$p//www.example.com", array(), false, "No matches for empty domains array, $pDesc URL" ), - array( "$p//www.example.com", array( 'www.example.com' ), true, "Exact match in domains array, $pDesc URL" ), - array( "$p//www.example.com", array( 'example.com' ), true, "Match without subdomain in domains array, $pDesc URL" ), - array( "$p//www.example2.com", array( 'www.example.com', 'www.example2.com', 'www.example3.com' ), true, "Exact match with other domains in array, $pDesc URL" ), - array( "$p//www.example2.com", array( 'example.com', 'example2.com', 'example3,com' ), true, "Match without subdomain with other domains in array, $pDesc URL" ), - array( "$p//www.example4.com", array( 'example.com', 'example2.com', 'example3,com' ), false, "Domain not in array, $pDesc URL" ), - array( "$p//nds-nl.wikipedia.org", array( 'nl.wikipedia.org' ), false, "Non-matching substring of domain, $pDesc URL" ), - ) ); - } - - return $a; - } - - /** - * @covers ::wfMkdirParents - */ - public function testWfMkdirParents() { - // Should not return true if file exists instead of directory - $fname = $this->getNewTempFile(); - wfSuppressWarnings(); - $ok = wfMkdirParents( $fname ); - wfRestoreWarnings(); - $this->assertFalse( $ok ); - } - - /** - * @dataProvider provideWfShellMaintenanceCmdList - * @covers ::wfShellMaintenanceCmd - */ - public function testWfShellMaintenanceCmd( $script, $parameters, $options, $expected, $description ) { - if ( wfIsWindows() ) { - // Approximation that's good enough for our purposes just now - $expected = str_replace( "'", '"', $expected ); - } - $actual = wfShellMaintenanceCmd( $script, $parameters, $options ); - $this->assertEquals( $expected, $actual, $description ); - } - - public static function provideWfShellMaintenanceCmdList() { - global $wgPhpCli; - - return array( - array( 'eval.php', array( '--help', '--test' ), array(), - "'$wgPhpCli' 'eval.php' '--help' '--test'", - "Called eval.php --help --test" ), - array( 'eval.php', array( '--help', '--test space' ), array( 'php' => 'php5' ), - "'php5' 'eval.php' '--help' '--test space'", - "Called eval.php --help --test with php option" ), - array( 'eval.php', array( '--help', '--test', 'X' ), array( 'wrapper' => 'MWScript.php' ), - "'$wgPhpCli' 'MWScript.php' 'eval.php' '--help' '--test' 'X'", - "Called eval.php --help --test with wrapper option" ), - array( 'eval.php', array( '--help', '--test', 'y' ), array( 'php' => 'php5', 'wrapper' => 'MWScript.php' ), - "'php5' 'MWScript.php' 'eval.php' '--help' '--test' 'y'", - "Called eval.php --help --test with wrapper and php option" ), - ); - } - /* @TODO many more! */ -} diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php deleted file mode 100644 index cf891e7b..00000000 --- a/tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertEquals( $expected, wfIsBadImage( $name, $title, $blacklist ), $desc ); - } - - public static function provideWfIsBadImageList() { - $blacklist = '* [[File:Bad.jpg]] except [[Nasty page]]'; - - return array( - array( 'Bad.jpg', false, $blacklist, true, - 'Called on a bad image' ), - array( 'Bad.jpg', Title::makeTitle( NS_MAIN, 'A page' ), $blacklist, true, - 'Called on a bad image' ), - array( 'NotBad.jpg', false, $blacklist, false, - 'Called on a non-bad image' ), - array( 'Bad.jpg', Title::makeTitle( NS_MAIN, 'Nasty page' ), $blacklist, false, - 'Called on a bad image but is on a whitelisted page' ), - array( 'File:Bad.jpg', false, $blacklist, false, - 'Called on a bad image with File:' ), - ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/README b/tests/phpunit/includes/GlobalFunctions/README deleted file mode 100644 index 0042bdac..00000000 --- a/tests/phpunit/includes/GlobalFunctions/README +++ /dev/null @@ -1,2 +0,0 @@ -This directory hold tests for includes/GlobalFunctions.php file -which is a pile of functions. diff --git a/tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php b/tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php deleted file mode 100644 index 9bb74873..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php +++ /dev/null @@ -1,111 +0,0 @@ -assertEquals( - $output, - wfAssembleUrl( $parts ), - "Testing $partsDump assembles to $output" - ); - } - - /** - * Provider of URL parts for testing wfAssembleUrl() - * - * @return array - */ - public static function provideURLParts() { - $schemes = array( - '' => array(), - '//' => array( - 'delimiter' => '//', - ), - 'http://' => array( - 'scheme' => 'http', - 'delimiter' => '://', - ), - ); - - $hosts = array( - '' => array(), - 'example.com' => array( - 'host' => 'example.com', - ), - 'example.com:123' => array( - 'host' => 'example.com', - 'port' => 123, - ), - 'id@example.com' => array( - 'user' => 'id', - 'host' => 'example.com', - ), - 'id@example.com:123' => array( - 'user' => 'id', - 'host' => 'example.com', - 'port' => 123, - ), - 'id:key@example.com' => array( - 'user' => 'id', - 'pass' => 'key', - 'host' => 'example.com', - ), - 'id:key@example.com:123' => array( - 'user' => 'id', - 'pass' => 'key', - 'host' => 'example.com', - 'port' => 123, - ), - ); - - $cases = array(); - foreach ( $schemes as $scheme => $schemeParts ) { - foreach ( $hosts as $host => $hostParts ) { - foreach ( array( '', '/path' ) as $path ) { - foreach ( array( '', 'query' ) as $query ) { - foreach ( array( '', 'fragment' ) as $fragment ) { - $parts = array_merge( - $schemeParts, - $hostParts - ); - $url = $scheme . - $host . - $path; - - if ( $path ) { - $parts['path'] = $path; - } - if ( $query ) { - $parts['query'] = $query; - $url .= '?' . $query; - } - if ( $fragment ) { - $parts['fragment'] = $fragment; - $url .= '#' . $fragment; - } - - $cases[] = array( - $parts, - $url, - ); - } - } - } - } - } - - $complexURL = 'http://id:key@example.org:321' . - '/over/there?name=ferret&foo=bar#nose'; - $cases[] = array( - wfParseUrl( $complexURL ), - $complexURL, - ); - - return $cases; - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php b/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php deleted file mode 100644 index a01c0d49..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php +++ /dev/null @@ -1,120 +0,0 @@ -assertEquals( $expected, wfBCP47( $code ), - "Applying BCP47 standard to lower case '$code'" - ); - - $code = strtoupper( $code ); - $this->assertEquals( $expected, wfBCP47( $code ), - "Applying BCP47 standard to upper case '$code'" - ); - } - - /** - * Array format is ($code, $expected) - */ - public static function provideLanguageCodes() { - return array( - // Extracted from BCP47 (list not exhaustive) - # 2.1.1 - array( 'en-ca-x-ca', 'en-CA-x-ca' ), - array( 'sgn-be-fr', 'sgn-BE-FR' ), - array( 'az-latn-x-latn', 'az-Latn-x-latn' ), - # 2.2 - array( 'sr-Latn-RS', 'sr-Latn-RS' ), - array( 'az-arab-ir', 'az-Arab-IR' ), - - # 2.2.5 - array( 'sl-nedis', 'sl-nedis' ), - array( 'de-ch-1996', 'de-CH-1996' ), - - # 2.2.6 - array( - 'en-latn-gb-boont-r-extended-sequence-x-private', - 'en-Latn-GB-boont-r-extended-sequence-x-private' - ), - - // Examples from BCP47 Appendix A - # Simple language subtag: - array( 'DE', 'de' ), - array( 'fR', 'fr' ), - array( 'ja', 'ja' ), - - # Language subtag plus script subtag: - array( 'zh-hans', 'zh-Hans' ), - array( 'sr-cyrl', 'sr-Cyrl' ), - array( 'sr-latn', 'sr-Latn' ), - - # Extended language subtags and their primary language subtag - # counterparts: - array( 'zh-cmn-hans-cn', 'zh-cmn-Hans-CN' ), - array( 'cmn-hans-cn', 'cmn-Hans-CN' ), - array( 'zh-yue-hk', 'zh-yue-HK' ), - array( 'yue-hk', 'yue-HK' ), - - # Language-Script-Region: - array( 'zh-hans-cn', 'zh-Hans-CN' ), - array( 'sr-latn-RS', 'sr-Latn-RS' ), - - # Language-Variant: - array( 'sl-rozaj', 'sl-rozaj' ), - array( 'sl-rozaj-biske', 'sl-rozaj-biske' ), - array( 'sl-nedis', 'sl-nedis' ), - - # Language-Region-Variant: - array( 'de-ch-1901', 'de-CH-1901' ), - array( 'sl-it-nedis', 'sl-IT-nedis' ), - - # Language-Script-Region-Variant: - array( 'hy-latn-it-arevela', 'hy-Latn-IT-arevela' ), - - # Language-Region: - array( 'de-de', 'de-DE' ), - array( 'en-us', 'en-US' ), - array( 'es-419', 'es-419' ), - - # Private use subtags: - array( 'de-ch-x-phonebk', 'de-CH-x-phonebk' ), - array( 'az-arab-x-aze-derbend', 'az-Arab-x-aze-derbend' ), - /** - * Previous test does not reflect the BCP which states: - * az-Arab-x-AZE-derbend - * AZE being private, it should be lower case, hence the test above - * should probably be: - #array( 'az-arab-x-aze-derbend', 'az-Arab-x-AZE-derbend' ), - */ - - # Private use registry values: - array( 'x-whatever', 'x-whatever' ), - array( 'qaa-qaaa-qm-x-southern', 'qaa-Qaaa-QM-x-southern' ), - array( 'de-qaaa', 'de-Qaaa' ), - array( 'sr-latn-qm', 'sr-Latn-QM' ), - array( 'sr-qaaa-rs', 'sr-Qaaa-RS' ), - - # Tags that use extensions - array( 'en-us-u-islamcal', 'en-US-u-islamcal' ), - array( 'zh-cn-a-myext-x-private', 'zh-CN-a-myext-x-private' ), - array( 'en-a-myext-b-another', 'en-a-myext-b-another' ), - - # Invalid: - // de-419-DE - // a-DE - // ar-a-aaa-b-bbb-a-ccc - ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php b/tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php deleted file mode 100644 index 7da804e6..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php +++ /dev/null @@ -1,182 +0,0 @@ -assertSame( $base2, wfBaseConvert( $base3, '3', '2' ) ); - $this->assertSame( $base2, wfBaseConvert( $base5, '5', '2' ) ); - $this->assertSame( $base2, wfBaseConvert( $base8, '8', '2' ) ); - $this->assertSame( $base2, wfBaseConvert( $base10, '10', '2' ) ); - $this->assertSame( $base2, wfBaseConvert( $base16, '16', '2' ) ); - $this->assertSame( $base2, wfBaseConvert( $base36, '36', '2' ) ); - } - - /** - * @dataProvider provideSingleDigitConversions - */ - public function testDigitToBase3( $base2, $base3, $base5, $base8, $base10, $base16, $base36 ) { - $this->assertSame( $base3, wfBaseConvert( $base2, '2', '3' ) ); - $this->assertSame( $base3, wfBaseConvert( $base5, '5', '3' ) ); - $this->assertSame( $base3, wfBaseConvert( $base8, '8', '3' ) ); - $this->assertSame( $base3, wfBaseConvert( $base10, '10', '3' ) ); - $this->assertSame( $base3, wfBaseConvert( $base16, '16', '3' ) ); - $this->assertSame( $base3, wfBaseConvert( $base36, '36', '3' ) ); - } - - /** - * @dataProvider provideSingleDigitConversions - */ - public function testDigitToBase5( $base2, $base3, $base5, $base8, $base10, $base16, $base36 ) { - $this->assertSame( $base5, wfBaseConvert( $base2, '2', '5' ) ); - $this->assertSame( $base5, wfBaseConvert( $base3, '3', '5' ) ); - $this->assertSame( $base5, wfBaseConvert( $base8, '8', '5' ) ); - $this->assertSame( $base5, wfBaseConvert( $base10, '10', '5' ) ); - $this->assertSame( $base5, wfBaseConvert( $base16, '16', '5' ) ); - $this->assertSame( $base5, wfBaseConvert( $base36, '36', '5' ) ); - } - - /** - * @dataProvider provideSingleDigitConversions - */ - public function testDigitToBase8( $base2, $base3, $base5, $base8, $base10, $base16, $base36 ) { - $this->assertSame( $base8, wfBaseConvert( $base2, '2', '8' ) ); - $this->assertSame( $base8, wfBaseConvert( $base3, '3', '8' ) ); - $this->assertSame( $base8, wfBaseConvert( $base5, '5', '8' ) ); - $this->assertSame( $base8, wfBaseConvert( $base10, '10', '8' ) ); - $this->assertSame( $base8, wfBaseConvert( $base16, '16', '8' ) ); - $this->assertSame( $base8, wfBaseConvert( $base36, '36', '8' ) ); - } - - /** - * @dataProvider provideSingleDigitConversions - */ - public function testDigitToBase10( $base2, $base3, $base5, $base8, $base10, $base16, $base36 ) { - $this->assertSame( $base10, wfBaseConvert( $base2, '2', '10' ) ); - $this->assertSame( $base10, wfBaseConvert( $base3, '3', '10' ) ); - $this->assertSame( $base10, wfBaseConvert( $base5, '5', '10' ) ); - $this->assertSame( $base10, wfBaseConvert( $base8, '8', '10' ) ); - $this->assertSame( $base10, wfBaseConvert( $base16, '16', '10' ) ); - $this->assertSame( $base10, wfBaseConvert( $base36, '36', '10' ) ); - } - - /** - * @dataProvider provideSingleDigitConversions - */ - public function testDigitToBase16( $base2, $base3, $base5, $base8, $base10, $base16, $base36 ) { - $this->assertSame( $base16, wfBaseConvert( $base2, '2', '16' ) ); - $this->assertSame( $base16, wfBaseConvert( $base3, '3', '16' ) ); - $this->assertSame( $base16, wfBaseConvert( $base5, '5', '16' ) ); - $this->assertSame( $base16, wfBaseConvert( $base8, '8', '16' ) ); - $this->assertSame( $base16, wfBaseConvert( $base10, '10', '16' ) ); - $this->assertSame( $base16, wfBaseConvert( $base36, '36', '16' ) ); - } - - /** - * @dataProvider provideSingleDigitConversions - */ - public function testDigitToBase36( $base2, $base3, $base5, $base8, $base10, $base16, $base36 ) { - $this->assertSame( $base36, wfBaseConvert( $base2, '2', '36' ) ); - $this->assertSame( $base36, wfBaseConvert( $base3, '3', '36' ) ); - $this->assertSame( $base36, wfBaseConvert( $base5, '5', '36' ) ); - $this->assertSame( $base36, wfBaseConvert( $base8, '8', '36' ) ); - $this->assertSame( $base36, wfBaseConvert( $base10, '10', '36' ) ); - $this->assertSame( $base36, wfBaseConvert( $base16, '16', '36' ) ); - } - - public function testLargeNumber() { - $this->assertSame( '1100110001111010000000101110100', wfBaseConvert( 'sd89ys', 36, 2 ) ); - $this->assertSame( '11102112120221201101', wfBaseConvert( 'sd89ys', 36, 3 ) ); - $this->assertSame( '12003102232400', wfBaseConvert( 'sd89ys', 36, 5 ) ); - $this->assertSame( '14617200564', wfBaseConvert( 'sd89ys', 36, 8 ) ); - $this->assertSame( '1715274100', wfBaseConvert( 'sd89ys', 36, 10 ) ); - $this->assertSame( '663d0174', wfBaseConvert( 'sd89ys', 36, 16 ) ); - } - - public static function provideNumbers() { - $x = array(); - $chars = '0123456789abcdefghijklmnopqrstuvwxyz'; - for ( $i = 0; $i < 50; $i++ ) { - $base = mt_rand( 2, 36 ); - $len = mt_rand( 10, 100 ); - - $str = ''; - for ( $j = 0; $j < $len; $j++ ) { - $str .= $chars[mt_rand( 0, $base - 1 )]; - } - - $x[] = array( $base, $str ); - } - - return $x; - } - - /** - * @dataProvider provideNumbers - */ - public function testIdentity( $base, $number ) { - $this->assertSame( $number, wfBaseConvert( $number, $base, $base, strlen( $number ) ) ); - } - - public function testInvalid() { - $this->assertFalse( wfBaseConvert( '101', 1, 15 ) ); - $this->assertFalse( wfBaseConvert( '101', 15, 1 ) ); - $this->assertFalse( wfBaseConvert( '101', 37, 15 ) ); - $this->assertFalse( wfBaseConvert( '101', 15, 37 ) ); - $this->assertFalse( wfBaseConvert( 'abcde', 10, 11 ) ); - $this->assertFalse( wfBaseConvert( '12930', 2, 10 ) ); - $this->assertFalse( wfBaseConvert( '101', 'abc', 15 ) ); - $this->assertFalse( wfBaseConvert( '101', 15, 'abc' ) ); - } - - public function testPadding() { - $number = "10101010101"; - $this->assertSame( strlen( $number ) + 5, strlen( wfBaseConvert( $number, 2, 2, strlen( $number ) + 5 ) ) ); - $this->assertSame( strlen( $number ), strlen( wfBaseConvert( $number, 2, 2, strlen( $number ) - 5 ) ) ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php b/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php deleted file mode 100644 index 8c548040..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php +++ /dev/null @@ -1,36 +0,0 @@ -assertEquals( $basename, wfBaseName( $fullpath ), - "wfBaseName('$fullpath') => '$basename'" ); - } - - public static function providePaths() { - return array( - array( '', '' ), - array( '/', '' ), - array( '\\', '' ), - array( '//', '' ), - array( '\\\\', '' ), - array( 'a', 'a' ), - array( 'aaaa', 'aaaa' ), - array( '/a', 'a' ), - array( '\\a', 'a' ), - array( '/aaaa', 'aaaa' ), - array( '\\aaaa', 'aaaa' ), - array( '/aaaa/', 'aaaa' ), - array( '\\aaaa\\', 'aaaa' ), - array( '\\aaaa\\', 'aaaa' ), - array( '/mnt/upload3/wikipedia/en/thumb/8/8b/Zork_Grand_Inquisitor_box_cover.jpg/93px-Zork_Grand_Inquisitor_box_cover.jpg', - '93px-Zork_Grand_Inquisitor_box_cover.jpg' ), - array( 'C:\\Progra~1\\Wikime~1\\Wikipe~1\\VIEWER.EXE', 'VIEWER.EXE' ), - array( 'Östergötland_coat_of_arms.png', 'Östergötland_coat_of_arms.png' ), - ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php b/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php deleted file mode 100644 index 41230a1e..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php +++ /dev/null @@ -1,111 +0,0 @@ -setMwGlobals( array( - 'wgServer' => $server, - 'wgCanonicalServer' => $canServer, - ) ); - - // Fake $_SERVER['HTTPS'] if needed - if ( $httpsMode ) { - $_SERVER['HTTPS'] = 'on'; - } else { - unset( $_SERVER['HTTPS'] ); - } - - $this->assertEquals( $fullUrl, wfExpandUrl( $shortUrl, $defaultProto ), $message ); - } - - /** - * Provider of URL examples for testing wfExpandUrl() - * - * @return array - */ - public static function provideExpandableUrls() { - $modes = array( 'http', 'https' ); - $servers = array( - 'http' => 'http://example.com', - 'https' => 'https://example.com', - 'protocol-relative' => '//example.com' - ); - $defaultProtos = array( - 'http' => PROTO_HTTP, - 'https' => PROTO_HTTPS, - 'protocol-relative' => PROTO_RELATIVE, - 'current' => PROTO_CURRENT, - 'canonical' => PROTO_CANONICAL - ); - - $retval = array(); - foreach ( $modes as $mode ) { - $httpsMode = $mode == 'https'; - foreach ( $servers as $serverDesc => $server ) { - foreach ( $modes as $canServerMode ) { - $canServer = "$canServerMode://example2.com"; - foreach ( $defaultProtos as $protoDesc => $defaultProto ) { - $retval[] = array( - 'http://example.com', 'http://example.com', - $defaultProto, $server, $canServer, $httpsMode, - "Testing fully qualified http URLs (no need to expand) ' . - '(defaultProto: $protoDesc , wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" - ); - $retval[] = array( - 'https://example.com', 'https://example.com', - $defaultProto, $server, $canServer, $httpsMode, - "Testing fully qualified https URLs (no need to expand) ' . - '(defaultProto: $protoDesc , wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" - ); - # Would be nice to support this, see fixme on wfExpandUrl() - $retval[] = array( - "wiki/FooBar", 'wiki/FooBar', - $defaultProto, $server, $canServer, $httpsMode, - "Test non-expandable relative URLs ' . - '(defaultProto: $protoDesc , wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" - ); - - // Determine expected protocol - if ( $protoDesc == 'protocol-relative' ) { - $p = ''; - } elseif ( $protoDesc == 'current' ) { - $p = "$mode:"; - } elseif ( $protoDesc == 'canonical' ) { - $p = "$canServerMode:"; - } else { - $p = $protoDesc . ':'; - } - // Determine expected server name - if ( $protoDesc == 'canonical' ) { - $srv = $canServer; - } elseif ( $serverDesc == 'protocol-relative' ) { - $srv = $p . $server; - } else { - $srv = $server; - } - - $retval[] = array( - "$p//wikipedia.org", '//wikipedia.org', - $defaultProto, $server, $canServer, $httpsMode, - "Test protocol-relative URL ' . - '(defaultProto: $protoDesc, wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" - ); - $retval[] = array( - "$srv/wiki/FooBar", '/wiki/FooBar', - $defaultProto, $server, $canServer, $httpsMode, - "Testing expanding URL beginning with / ' . - '(defaultProto: $protoDesc , wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" - ); - } - } - } - } - - return $retval; - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php b/tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php deleted file mode 100644 index 62296245..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php +++ /dev/null @@ -1,40 +0,0 @@ -assertEquals( __METHOD__, wfGetCaller( 1 ) ); - } - - function callerOne() { - return wfGetCaller(); - } - - public function testOne() { - $this->assertEquals( 'WfGetCallerTest::testOne', self::callerOne() ); - } - - function intermediateFunction( $level = 2, $n = 0 ) { - if ( $n > 0 ) { - return self::intermediateFunction( $level, $n - 1 ); - } - - return wfGetCaller( $level ); - } - - public function testTwo() { - $this->assertEquals( 'WfGetCallerTest::testTwo', self::intermediateFunction() ); - } - - public function testN() { - $this->assertEquals( 'WfGetCallerTest::testN', self::intermediateFunction( 2, 0 ) ); - $this->assertEquals( 'WfGetCallerTest::intermediateFunction', self::intermediateFunction( 1, 0 ) ); - - for ( $i = 0; $i < 10; $i++ ) { - $this->assertEquals( 'WfGetCallerTest::intermediateFunction', self::intermediateFunction( $i + 1, $i ) ); - } - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php b/tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php deleted file mode 100644 index 5032dc11..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php +++ /dev/null @@ -1,146 +0,0 @@ -setMwGlobals( 'wgUrlProtocols', array( - '//', 'http://', 'file://', 'mailto:', - ) ); - } - - /** - * @dataProvider provideURLs - */ - public function testWfParseUrl( $url, $parts ) { - $partsDump = var_export( $parts, true ); - $this->assertEquals( - $parts, - wfParseUrl( $url ), - "Testing $url parses to $partsDump" - ); - } - - /** - * Provider of URLs for testing wfParseUrl() - * - * @return array - */ - public static function provideURLs() { - return array( - array( - '//example.org', - array( - 'scheme' => '', - 'delimiter' => '//', - 'host' => 'example.org', - ) - ), - array( - 'http://example.org', - array( - 'scheme' => 'http', - 'delimiter' => '://', - 'host' => 'example.org', - ) - ), - array( - 'http://id:key@example.org:123/path?foo=bar#baz', - array( - 'scheme' => 'http', - 'delimiter' => '://', - 'user' => 'id', - 'pass' => 'key', - 'host' => 'example.org', - 'port' => 123, - 'path' => '/path', - 'query' => 'foo=bar', - 'fragment' => 'baz', - ) - ), - array( - 'file://example.org/etc/php.ini', - array( - 'scheme' => 'file', - 'delimiter' => '://', - 'host' => 'example.org', - 'path' => '/etc/php.ini', - ) - ), - array( - 'file:///etc/php.ini', - array( - 'scheme' => 'file', - 'delimiter' => '://', - 'host' => '', - 'path' => '/etc/php.ini', - ) - ), - array( - 'file:///c:/', - array( - 'scheme' => 'file', - 'delimiter' => '://', - 'host' => '', - 'path' => '/c:/', - ) - ), - array( - 'mailto:id@example.org', - array( - 'scheme' => 'mailto', - 'delimiter' => ':', - 'host' => 'id@example.org', - 'path' => '', - ) - ), - array( - 'mailto:id@example.org?subject=Foo', - array( - 'scheme' => 'mailto', - 'delimiter' => ':', - 'host' => 'id@example.org', - 'path' => '', - 'query' => 'subject=Foo', - ) - ), - array( - 'mailto:?subject=Foo', - array( - 'scheme' => 'mailto', - 'delimiter' => ':', - 'host' => '', - 'path' => '', - 'query' => 'subject=Foo', - ) - ), - array( - 'invalid://test/', - false - ), - ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php b/tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php deleted file mode 100644 index 238a2c9c..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php +++ /dev/null @@ -1,91 +0,0 @@ -assertEquals( - $outputPath, - wfRemoveDotSegments( $inputPath ), - "Testing $inputPath expands to $outputPath" - ); - } - - /** - * Provider of URL paths for testing wfRemoveDotSegments() - * - * @return array - */ - public static function providePaths() { - return array( - array( '/a/b/c/./../../g', '/a/g' ), - array( 'mid/content=5/../6', 'mid/6' ), - array( '/a//../b', '/a/b' ), - array( '/.../a', '/.../a' ), - array( '.../a', '.../a' ), - array( '', '' ), - array( '/', '/' ), - array( '//', '//' ), - array( '.', '' ), - array( '..', '' ), - array( '...', '...' ), - array( '/.', '/' ), - array( '/..', '/' ), - array( './', '' ), - array( '../', '' ), - array( './a', 'a' ), - array( '../a', 'a' ), - array( '../../a', 'a' ), - array( '.././a', 'a' ), - array( './../a', 'a' ), - array( '././a', 'a' ), - array( '../../', '' ), - array( '.././', '' ), - array( './../', '' ), - array( '././', '' ), - array( '../..', '' ), - array( '../.', '' ), - array( './..', '' ), - array( './.', '' ), - array( '/../../a', '/a' ), - array( '/.././a', '/a' ), - array( '/./../a', '/a' ), - array( '/././a', '/a' ), - array( '/../../', '/' ), - array( '/.././', '/' ), - array( '/./../', '/' ), - array( '/././', '/' ), - array( '/../..', '/' ), - array( '/../.', '/' ), - array( '/./..', '/' ), - array( '/./.', '/' ), - array( 'b/../../a', '/a' ), - array( 'b/.././a', '/a' ), - array( 'b/./../a', '/a' ), - array( 'b/././a', 'b/a' ), - array( 'b/../../', '/' ), - array( 'b/.././', '/' ), - array( 'b/./../', '/' ), - array( 'b/././', 'b/' ), - array( 'b/../..', '/' ), - array( 'b/../.', '/' ), - array( 'b/./..', '/' ), - array( 'b/./.', 'b/' ), - array( '/b/../../a', '/a' ), - array( '/b/.././a', '/a' ), - array( '/b/./../a', '/a' ), - array( '/b/././a', '/b/a' ), - array( '/b/../../', '/' ), - array( '/b/.././', '/' ), - array( '/b/./../', '/' ), - array( '/b/././', '/b/' ), - array( '/b/../..', '/' ), - array( '/b/../.', '/' ), - array( '/b/./..', '/' ), - array( '/b/./.', '/b/' ), - ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php b/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php deleted file mode 100644 index aadec87f..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php +++ /dev/null @@ -1,30 +0,0 @@ -assertEquals( - wfShorthandToInteger( $input ), - $output, - $description - ); - } - - public static function provideABunchOfShorthands() { - return array( - array( '', -1, 'Empty string' ), - array( ' ', -1, 'String of spaces' ), - array( '1G', 1024 * 1024 * 1024, 'One gig uppercased' ), - array( '1g', 1024 * 1024 * 1024, 'One gig lowercased' ), - array( '1M', 1024 * 1024, 'One meg uppercased' ), - array( '1m', 1024 * 1024, 'One meg lowercased' ), - array( '1K', 1024, 'One kb uppercased' ), - array( '1k', 1024, 'One kb lowercased' ), - ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php b/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php deleted file mode 100644 index 5998f186..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php +++ /dev/null @@ -1,134 +0,0 @@ -assertEquals( $output, wfTimestamp( $format, $input ), $desc ); - } - - public static function provideNormalTimestamps() { - $t = gmmktime( 12, 34, 56, 1, 15, 2001 ); - - return array( - // TS_UNIX - array( $t, TS_MW, '20010115123456', 'TS_UNIX to TS_MW' ), - array( -30281104, TS_MW, '19690115123456', 'Negative TS_UNIX to TS_MW' ), - array( $t, TS_UNIX, 979562096, 'TS_UNIX to TS_UNIX' ), - array( $t, TS_DB, '2001-01-15 12:34:56', 'TS_UNIX to TS_DB' ), - - array( $t, TS_ISO_8601_BASIC, '20010115T123456Z', 'TS_ISO_8601_BASIC to TS_DB' ), - - // TS_MW - array( '20010115123456', TS_MW, '20010115123456', 'TS_MW to TS_MW' ), - array( '20010115123456', TS_UNIX, 979562096, 'TS_MW to TS_UNIX' ), - array( '20010115123456', TS_DB, '2001-01-15 12:34:56', 'TS_MW to TS_DB' ), - array( '20010115123456', TS_ISO_8601_BASIC, '20010115T123456Z', 'TS_MW to TS_ISO_8601_BASIC' ), - - // TS_DB - array( '2001-01-15 12:34:56', TS_MW, '20010115123456', 'TS_DB to TS_MW' ), - array( '2001-01-15 12:34:56', TS_UNIX, 979562096, 'TS_DB to TS_UNIX' ), - array( '2001-01-15 12:34:56', TS_DB, '2001-01-15 12:34:56', 'TS_DB to TS_DB' ), - array( '2001-01-15 12:34:56', TS_ISO_8601_BASIC, '20010115T123456Z', 'TS_DB to TS_ISO_8601_BASIC' ), - - # rfc2822 section 3.3 - array( '20010115123456', TS_RFC2822, 'Mon, 15 Jan 2001 12:34:56 GMT', 'TS_MW to TS_RFC2822' ), - array( 'Mon, 15 Jan 2001 12:34:56 GMT', TS_MW, '20010115123456', 'TS_RFC2822 to TS_MW' ), - array( ' Mon, 15 Jan 2001 12:34:56 GMT', TS_MW, '20010115123456', 'TS_RFC2822 with leading space to TS_MW' ), - array( '15 Jan 2001 12:34:56 GMT', TS_MW, '20010115123456', 'TS_RFC2822 without optional day-of-week to TS_MW' ), - - # FWS = ([*WSP CRLF] 1*WSP) / obs-FWS ; Folding white space - # obs-FWS = 1*WSP *(CRLF 1*WSP) ; Section 4.2 - array( 'Mon, 15 Jan 2001 12:34:56 GMT', TS_MW, '20010115123456', 'TS_RFC2822 to TS_MW' ), - - # WSP = SP / HTAB ; rfc2234 - array( "Mon, 15 Jan\x092001 12:34:56 GMT", TS_MW, '20010115123456', 'TS_RFC2822 with HTAB to TS_MW' ), - array( "Mon, 15 Jan\x09 \x09 2001 12:34:56 GMT", TS_MW, '20010115123456', 'TS_RFC2822 with HTAB and SP to TS_MW' ), - array( 'Sun, 6 Nov 94 08:49:37 GMT', TS_MW, '19941106084937', 'TS_RFC2822 with obsolete year to TS_MW' ), - ); - } - - /** - * This test checks wfTimestamp() with values outside. - * It needs PHP 64 bits or PHP > 5.1. - * See r74778 and bug 25451 - * @dataProvider provideOldTimestamps - */ - public function testOldTimestamps( $input, $format, $output, $desc ) { - $this->assertEquals( $output, wfTimestamp( $format, $input ), $desc ); - } - - public static function provideOldTimestamps() { - return array( - array( '19011213204554', TS_RFC2822, 'Fri, 13 Dec 1901 20:45:54 GMT', 'Earliest time according to php documentation' ), - array( '20380119031407', TS_RFC2822, 'Tue, 19 Jan 2038 03:14:07 GMT', 'Latest 32 bit time' ), - array( '19011213204552', TS_UNIX, '-2147483648', 'Earliest 32 bit unix time' ), - array( '20380119031407', TS_UNIX, '2147483647', 'Latest 32 bit unix time' ), - array( '19011213204552', TS_RFC2822, 'Fri, 13 Dec 1901 20:45:52 GMT', 'Earliest 32 bit time' ), - array( '19011213204551', TS_RFC2822, 'Fri, 13 Dec 1901 20:45:51 GMT', 'Earliest 32 bit time - 1' ), - array( '20380119031408', TS_RFC2822, 'Tue, 19 Jan 2038 03:14:08 GMT', 'Latest 32 bit time + 1' ), - array( '19011212000000', TS_MW, '19011212000000', 'Convert to itself r74778#c10645' ), - array( '19011213204551', TS_UNIX, '-2147483649', 'Earliest 32 bit unix time - 1' ), - array( '20380119031408', TS_UNIX, '2147483648', 'Latest 32 bit unix time + 1' ), - array( '-2147483649', TS_MW, '19011213204551', '1901 negative unix time to MediaWiki' ), - array( '-5331871504', TS_MW, '18010115123456', '1801 negative unix time to MediaWiki' ), - array( '0117-08-09 12:34:56', TS_RFC2822, 'Tue, 09 Aug 0117 12:34:56 GMT', 'Death of Roman Emperor [[Trajan]]' ), - - /* @todo FIXME: 00 to 101 years are taken as being in [1970-2069] */ - array( '-58979923200', TS_RFC2822, 'Sun, 01 Jan 0101 00:00:00 GMT', '1/1/101' ), - array( '-62135596800', TS_RFC2822, 'Mon, 01 Jan 0001 00:00:00 GMT', 'Year 1' ), - - /* It is not clear if we should generate a year 0 or not - * We are completely off RFC2822 requirement of year being - * 1900 or later. - */ - array( '-62142076800', TS_RFC2822, 'Wed, 18 Oct 0000 00:00:00 GMT', 'ISO 8601:2004 [[year 0]], also called [[1 BC]]' ), - ); - } - - /** - * The Resource Loader uses wfTimestamp() to convert timestamps - * from If-Modified-Since header. Thus it must be able to parse all - * rfc2616 date formats - * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 - * @dataProvider provideHttpDates - */ - public function testHttpDate( $input, $output, $desc ) { - $this->assertEquals( $output, wfTimestamp( TS_MW, $input ), $desc ); - } - - public static function provideHttpDates() { - return array( - array( 'Sun, 06 Nov 1994 08:49:37 GMT', '19941106084937', 'RFC 822 date' ), - array( 'Sunday, 06-Nov-94 08:49:37 GMT', '19941106084937', 'RFC 850 date' ), - array( 'Sun Nov 6 08:49:37 1994', '19941106084937', "ANSI C's asctime() format" ), - // See http://www.squid-cache.org/mail-archive/squid-users/200307/0122.html and r77171 - array( 'Mon, 22 Nov 2010 14:12:42 GMT; length=52626', '20101122141242', 'Netscape extension to HTTP/1.0' ), - ); - } - - /** - * There are a number of assumptions in our codebase where wfTimestamp() - * should give the current date but it is not given a 0 there. See r71751 CR - */ - public function testTimestampParameter() { - $now = wfTimestamp( TS_UNIX ); - // We check that wfTimestamp doesn't return false (error) and use a LessThan assert - // for the cases where the test is run in a second boundary. - - $zero = wfTimestamp( TS_UNIX, 0 ); - $this->assertNotEquals( false, $zero ); - $this->assertLessThan( 5, $zero - $now ); - - $empty = wfTimestamp( TS_UNIX, '' ); - $this->assertNotEquals( false, $empty ); - $this->assertLessThan( 5, $empty - $now ); - - $null = wfTimestamp( TS_UNIX, null ); - $this->assertNotEquals( false, $null ); - $this->assertLessThan( 5, $null - $now ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php b/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php deleted file mode 100644 index ce6c82c5..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php +++ /dev/null @@ -1,119 +0,0 @@ -verifyEncodingFor( 'Apache', $input, $expected ); - } - - /** - * @dataProvider provideURLS - */ - public function testEncodingUrlWithMicrosoftIis7( $input, $expected ) { - $this->verifyEncodingFor( 'Microsoft-IIS/7', $input, $expected ); - } - - #### HELPERS ############################################################# - - /** - * Internal helper that actually run the test. - * Called by the public methods testEncodingUrlWith...() - * - */ - private function verifyEncodingFor( $server, $input, $expectations ) { - $expected = $this->extractExpect( $server, $expectations ); - - // save up global - $old = isset( $_SERVER['SERVER_SOFTWARE'] ) - ? $_SERVER['SERVER_SOFTWARE'] - : null; - $_SERVER['SERVER_SOFTWARE'] = $server; - wfUrlencode( null ); - - // do the requested test - $this->assertEquals( - $expected, - wfUrlencode( $input ), - "Encoding '$input' for server '$server' should be '$expected'" - ); - - // restore global - if ( $old === null ) { - unset( $_SERVER['SERVER_SOFTWARE'] ); - } else { - $_SERVER['SERVER_SOFTWARE'] = $old; - } - wfUrlencode( null ); - } - - /** - * Interprets the provider array. Return expected value depending - * the HTTP server name. - */ - private function extractExpect( $server, $expectations ) { - if ( is_string( $expectations ) ) { - return $expectations; - } elseif ( is_array( $expectations ) ) { - if ( !array_key_exists( $server, $expectations ) ) { - throw new MWException( __METHOD__ . " expectation does not have any value for server name $server. Check the provider array.\n" ); - } else { - return $expectations[$server]; - } - } else { - throw new MWException( __METHOD__ . " given invalid expectation for '$server'. Should be a string or an array( => ).\n" ); - } - } - - #### PROVIDERS ########################################################### - - /** - * Format is either: - * array( 'input', 'expected' ); - * Or: - * array( 'input', - * array( 'Apache', 'expected' ), - * array( 'Microsoft-IIS/7', 'expected' ), - * ), - * If you want to add other HTTP server name, you will have to add a new - * testing method much like the testEncodingUrlWith() method above. - */ - public static function provideURLS() { - return array( - ### RFC 1738 chars - // + is not safe - array( '+', '%2B' ), - // & and = not safe in queries - array( '&', '%26' ), - array( '=', '%3D' ), - - array( ':', array( - 'Apache' => ':', - 'Microsoft-IIS/7' => '%3A', - ) ), - - // remaining chars do not need encoding - array( - ';@$-_.!*', - ';@$-_.!*', - ), - - ### Other tests - // slash remain unchanged. %2F seems to break things - array( '/', '/' ), - - // Other 'funnies' chars - array( '[]', '%5B%5D' ), - array( '<>', '%3C%3E' ), - - // Apostrophe is encoded - array( '\'', '%27' ), - ); - } -} diff --git a/tests/phpunit/includes/HTMLCheckMatrixTest.php b/tests/phpunit/includes/HTMLCheckMatrixTest.php deleted file mode 100644 index 5bbafd37..00000000 --- a/tests/phpunit/includes/HTMLCheckMatrixTest.php +++ /dev/null @@ -1,102 +0,0 @@ - array( 'r1', 'r2' ), - 'columns' => array( 'c1', 'c2' ), - 'fieldname' => 'test', - ); - - public function testPlainInstantiation() { - try { - $form = new HTMLCheckMatrix( array() ); - } catch ( MWException $e ) { - $this->assertInstanceOf( 'HTMLFormFieldRequiredOptionsException', $e ); - return; - } - - $this->fail( 'Expected MWException indicating missing parameters but none was thrown.' ); - } - - public function testInstantiationWithMinimumRequiredParameters() { - $form = new HTMLCheckMatrix( self::$defaultOptions ); - $this->assertTrue( true ); // form instantiation must throw exception on failure - } - - public function testValidateCallsUserDefinedValidationCallback() { - $called = false; - $field = new HTMLCheckMatrix( self::$defaultOptions + array( - 'validation-callback' => function() use ( &$called ) { - $called = true; - return false; - }, - ) ); - $this->assertEquals( false, $this->validate( $field, array() ) ); - $this->assertTrue( $called ); - } - - public function testValidateRequiresArrayInput() { - $field = new HTMLCheckMatrix( self::$defaultOptions ); - $this->assertEquals( false, $this->validate( $field, null ) ); - $this->assertEquals( false, $this->validate( $field, true ) ); - $this->assertEquals( false, $this->validate( $field, 'abc' ) ); - $this->assertEquals( false, $this->validate( $field, new stdClass ) ); - $this->assertEquals( true, $this->validate( $field, array() ) ); - } - - public function testValidateAllowsOnlyKnownTags() { - $field = new HTMLCheckMatrix( self::$defaultOptions ); - $this->assertInternalType( 'string', $this->validate( $field, array( 'foo' ) ) ); - } - - public function testValidateAcceptsPartialTagList() { - $field = new HTMLCheckMatrix( self::$defaultOptions ); - $this->assertTrue( $this->validate( $field, array() ) ); - $this->assertTrue( $this->validate( $field, array( 'c1-r1' ) ) ); - $this->assertTrue( $this->validate( $field, array( 'c1-r1', 'c1-r2', 'c2-r1', 'c2-r2' ) ) ); - } - - /** - * This form object actually has no visibility into what happens later on, but essentially - * if the data submitted by the user passes validate the following is run: - * foreach ( $field->filterDataForSubmit( $data ) as $k => $v ) { - * $user->setOption( $k, $v ); - * } - */ - public function testValuesForcedOnRemainOn() { - $field = new HTMLCheckMatrix( self::$defaultOptions + array( - 'force-options-on' => array( 'c2-r1' ), - ) ); - $expected = array( - 'c1-r1' => false, - 'c1-r2' => false, - 'c2-r1' => true, - 'c2-r2' => false, - ); - $this->assertEquals( $expected, $field->filterDataForSubmit( array() ) ); - } - - public function testValuesForcedOffRemainOff() { - $field = new HTMLCheckMatrix( self::$defaultOptions + array( - 'force-options-off' => array( 'c1-r2', 'c2-r2' ), - ) ); - $expected = array( - 'c1-r1' => true, - 'c1-r2' => false, - 'c2-r1' => true, - 'c2-r2' => false, - ); - // array_keys on the result simulates submitting all fields checked - $this->assertEquals( $expected, $field->filterDataForSubmit( array_keys( $expected ) ) ); - } - - protected function validate( HTMLFormField $field, $submitted ) { - return $field->validate( - $submitted, - array( self::$defaultOptions['fieldname'] => $submitted ) - ); - } -} diff --git a/tests/phpunit/includes/HashRingTest.php b/tests/phpunit/includes/HashRingTest.php deleted file mode 100644 index 65f13696..00000000 --- a/tests/phpunit/includes/HashRingTest.php +++ /dev/null @@ -1,53 +0,0 @@ - 1, 's2' => 1, 's3' => 2, 's4' => 2, 's5' => 2, 's6' => 3 ) ); - - $locations = array(); - for ( $i = 0; $i < 20; $i++ ) { - $locations[ "hello$i"] = $ring->getLocation( "hello$i" ); - } - $expectedLocations = array( - "hello0" => "s5", - "hello1" => "s6", - "hello2" => "s2", - "hello3" => "s5", - "hello4" => "s6", - "hello5" => "s4", - "hello6" => "s5", - "hello7" => "s4", - "hello8" => "s5", - "hello9" => "s5", - "hello10" => "s3", - "hello11" => "s6", - "hello12" => "s1", - "hello13" => "s3", - "hello14" => "s3", - "hello15" => "s5", - "hello16" => "s4", - "hello17" => "s6", - "hello18" => "s6", - "hello19" => "s3" - ); - - $this->assertEquals( $expectedLocations, $locations, 'Items placed at proper locations' ); - - $locations = array(); - for ( $i = 0; $i < 5; $i++ ) { - $locations[ "hello$i"] = $ring->getLocations( "hello$i", 2 ); - } - - $expectedLocations = array( - "hello0" => array( "s5", "s6" ), - "hello1" => array( "s6", "s4" ), - "hello2" => array( "s2", "s1" ), - "hello3" => array( "s5", "s6" ), - "hello4" => array( "s6", "s4" ), - ); - $this->assertEquals( $expectedLocations, $locations, 'Items placed at proper locations' ); - } -} diff --git a/tests/phpunit/includes/HooksTest.php b/tests/phpunit/includes/HooksTest.php deleted file mode 100644 index 81dd4870..00000000 --- a/tests/phpunit/includes/HooksTest.php +++ /dev/null @@ -1,158 +0,0 @@ -assertSame( $expectedFoo, $foo, $msg ); - $this->assertSame( $expectedBar, $bar, $msg ); - } - - /** - * @dataProvider provideHooks - */ - public function testNewStyleHooks( $msg, $hook, $expectedFoo, $expectedBar ) { - $foo = $bar = 'original'; - - Hooks::register( 'MediaWikiHooksTest001', $hook ); - Hooks::run( 'MediaWikiHooksTest001', array( &$foo, &$bar ) ); - - $this->assertSame( $expectedFoo, $foo, $msg ); - $this->assertSame( $expectedBar, $bar, $msg ); - } - - public function testNewStyleHookInteraction() { - global $wgHooks; - - $a = new NothingClass(); - $b = new NothingClass(); - - $wgHooks['MediaWikiHooksTest001'][] = $a; - $this->assertTrue( Hooks::isRegistered( 'MediaWikiHooksTest001' ), 'Hook registered via $wgHooks should be noticed by Hooks::isRegistered' ); - - Hooks::register( 'MediaWikiHooksTest001', $b ); - $this->assertEquals( 2, count( Hooks::getHandlers( 'MediaWikiHooksTest001' ) ), 'Hooks::getHandlers() should return hooks registered via wgHooks as well as Hooks::register' ); - - $foo = 'quux'; - $bar = 'qaax'; - - Hooks::run( 'MediaWikiHooksTest001', array( &$foo, &$bar ) ); - $this->assertEquals( 1, $a->calls, 'Hooks::run() should run hooks registered via wgHooks as well as Hooks::register' ); - $this->assertEquals( 1, $b->calls, 'Hooks::run() should run hooks registered via wgHooks as well as Hooks::register' ); - } - - /** - * @expectedException MWException - */ - public function testUncallableFunction() { - Hooks::register( 'MediaWikiHooksTest001', 'ThisFunctionDoesntExist' ); - Hooks::run( 'MediaWikiHooksTest001', array() ); - } - - public function testFalseReturn() { - Hooks::register( 'MediaWikiHooksTest001', function ( &$foo ) { - return false; - } ); - Hooks::register( 'MediaWikiHooksTest001', function ( &$foo ) { - $foo = 'test'; - - return true; - } ); - $foo = 'original'; - Hooks::run( 'MediaWikiHooksTest001', array( &$foo ) ); - $this->assertSame( 'original', $foo, 'Hooks continued processing after a false return.' ); - } - - /** - * @expectedException FatalError - */ - public function testFatalError() { - Hooks::register( 'MediaWikiHooksTest001', function () { - return 'test'; - } ); - Hooks::run( 'MediaWikiHooksTest001', array() ); - } -} - -function NothingFunction( &$foo, &$bar ) { - $foo = 'changed-func'; - - return true; -} - -function NothingFunctionData( $data, &$foo, &$bar ) { - $foo = $data; - - return true; -} - -class NothingClass { - public $calls = 0; - - public static function someStatic( &$foo, &$bar ) { - $foo = 'changed-static'; - - return true; - } - - public function someNonStatic( &$foo, &$bar ) { - $this->calls++; - $foo = 'changed-nonstatic'; - $bar = 'changed-nonstatic'; - - return true; - } - - public function onMediaWikiHooksTest001( &$foo, &$bar ) { - $this->calls++; - $foo = 'changed-onevent'; - - return true; - } - - public function someNonStaticWithData( $data, &$foo, &$bar ) { - $this->calls++; - $foo = $data; - - return true; - } -} diff --git a/tests/phpunit/includes/HtmlFormatterTest.php b/tests/phpunit/includes/HtmlFormatterTest.php deleted file mode 100644 index a37df74f..00000000 --- a/tests/phpunit/includes/HtmlFormatterTest.php +++ /dev/null @@ -1,81 +0,0 @@ -filterContent(); - $html = $formatter->getText(); - $this->assertEquals( self::normalize( $expected ), self::normalize( $html ) ); - } - - private static function normalize( $s ) { - return str_replace( "\n", '', - str_replace( "\r", '', $s ) // "yay" to Windows! - ); - } - - public function getHtmlData() { - $removeImages = function( HtmlFormatter $f ) { - $f->setRemoveMedia(); - }; - $removeTags = function( HtmlFormatter $f ) { - $f->remove( array( 'table', '.foo', '#bar', 'div.baz' ) ); - }; - $flattenSomeStuff = function( HtmlFormatter $f ) { - $f->flatten( array( 's', 'div' ) ); - }; - $flattenEverything = function( HtmlFormatter $f ) { - $f->flattenAllTags(); - }; - return array( - // remove images if asked - array( - 'Blah', - '', - $removeImages, - ), - // basic tag removal - array( - '
        foo
        foo
        foo
        bar -foobar
        test
        -baz', - - '
        test
        -baz', - $removeTags, - ), - // don't flatten tags that start like chosen ones - array( - '
        foo bar
        ', - 'foo bar', - $flattenSomeStuff, - ), - // total flattening - array( - '
        bar2
        ', - 'bar2', - $flattenEverything, - ), - // UTF-8 preservation and security - array( - '<Тест!> &<&&&&', - '<Тест!> &<&&&&', - ), - // https://bugzilla.wikimedia.org/show_bug.cgi?id=53086 - array( - 'Foo[1] Bar', - 'Foo[1] Bar', - ), - ); - } -} diff --git a/tests/phpunit/includes/HtmlTest.php b/tests/phpunit/includes/HtmlTest.php deleted file mode 100644 index 1c62d032..00000000 --- a/tests/phpunit/includes/HtmlTest.php +++ /dev/null @@ -1,631 +0,0 @@ -setNamespaces( array( - -2 => 'Media', - -1 => 'Special', - 0 => '', - 1 => 'Talk', - 2 => 'User', - 3 => 'User_talk', - 4 => 'MyWiki', - 5 => 'MyWiki_Talk', - 6 => 'File', - 7 => 'File_talk', - 8 => 'MediaWiki', - 9 => 'MediaWiki_talk', - 10 => 'Template', - 11 => 'Template_talk', - 14 => 'Category', - 15 => 'Category_talk', - 100 => 'Custom', - 101 => 'Custom_talk', - ) ); - - $this->setMwGlobals( array( - 'wgLanguageCode' => $langCode, - 'wgContLang' => $langObj, - 'wgLang' => $langObj, - 'wgWellFormedXml' => false, - ) ); - } - - public function testElementBasics() { - $this->assertEquals( - '', - Html::element( 'img', null, '' ), - 'No close tag for short-tag elements' - ); - - $this->assertEquals( - '', - Html::element( 'element', null, null ), - 'Close tag for empty element (null, null)' - ); - - $this->assertEquals( - '', - Html::element( 'element', array(), '' ), - 'Close tag for empty element (array, string)' - ); - - $this->setMwGlobals( 'wgWellFormedXml', true ); - - $this->assertEquals( - '', - Html::element( 'img', null, '' ), - 'Self-closing tag for short-tag elements (wgWellFormedXml = true)' - ); - } - - public function dataXmlMimeType() { - return array( - // ( $mimetype, $isXmlMimeType ) - # HTML is not an XML MimeType - array( 'text/html', false ), - # XML is an XML MimeType - array( 'text/xml', true ), - array( 'application/xml', true ), - # XHTML is an XML MimeType - array( 'application/xhtml+xml', true ), - # Make sure other +xml MimeTypes are supported - # SVG is another random MimeType even though we don't use it - array( 'image/svg+xml', true ), - # Complete random other MimeTypes are not XML - array( 'text/plain', false ), - ); - } - - /** - * @dataProvider dataXmlMimeType - */ - public function testXmlMimeType( $mimetype, $isXmlMimeType ) { - $this->assertEquals( $isXmlMimeType, Html::isXmlMimeType( $mimetype ) ); - } - - public function testExpandAttributesSkipsNullAndFalse() { - - ### EMPTY ######## - $this->assertEmpty( - Html::expandAttributes( array( 'foo' => null ) ), - 'skip keys with null value' - ); - $this->assertEmpty( - Html::expandAttributes( array( 'foo' => false ) ), - 'skip keys with false value' - ); - $this->assertNotEmpty( - Html::expandAttributes( array( 'foo' => '' ) ), - 'keep keys with an empty string' - ); - } - - public function testExpandAttributesForBooleans() { - $this->assertEquals( - '', - Html::expandAttributes( array( 'selected' => false ) ), - 'Boolean attributes do not generates output when value is false' - ); - $this->assertEquals( - '', - Html::expandAttributes( array( 'selected' => null ) ), - 'Boolean attributes do not generates output when value is null' - ); - - $this->assertEquals( - ' selected', - Html::expandAttributes( array( 'selected' => true ) ), - 'Boolean attributes have no value when value is true' - ); - $this->assertEquals( - ' selected', - Html::expandAttributes( array( 'selected' ) ), - 'Boolean attributes have no value when value is true (passed as numerical array)' - ); - - $this->setMwGlobals( 'wgWellFormedXml', true ); - - $this->assertEquals( - ' selected=""', - Html::expandAttributes( array( 'selected' => true ) ), - 'Boolean attributes have empty string value when value is true (wgWellFormedXml)' - ); - } - - /** - * Test for Html::expandAttributes() - * Please note it output a string prefixed with a space! - */ - public function testExpandAttributesVariousExpansions() { - ### NOT EMPTY #### - $this->assertEquals( - ' empty_string=""', - Html::expandAttributes( array( 'empty_string' => '' ) ), - 'Empty string is always quoted' - ); - $this->assertEquals( - ' key=value', - Html::expandAttributes( array( 'key' => 'value' ) ), - 'Simple string value needs no quotes' - ); - $this->assertEquals( - ' one=1', - Html::expandAttributes( array( 'one' => 1 ) ), - 'Number 1 value needs no quotes' - ); - $this->assertEquals( - ' zero=0', - Html::expandAttributes( array( 'zero' => 0 ) ), - 'Number 0 value needs no quotes' - ); - - $this->setMwGlobals( 'wgWellFormedXml', true ); - - $this->assertEquals( - ' empty_string=""', - Html::expandAttributes( array( 'empty_string' => '' ) ), - 'Attribute values are always quoted (wgWellFormedXml): Empty string' - ); - $this->assertEquals( - ' key="value"', - Html::expandAttributes( array( 'key' => 'value' ) ), - 'Attribute values are always quoted (wgWellFormedXml): Simple string' - ); - $this->assertEquals( - ' one="1"', - Html::expandAttributes( array( 'one' => 1 ) ), - 'Attribute values are always quoted (wgWellFormedXml): Number 1' - ); - $this->assertEquals( - ' zero="0"', - Html::expandAttributes( array( 'zero' => 0 ) ), - 'Attribute values are always quoted (wgWellFormedXml): Number 0' - ); - } - - /** - * Html::expandAttributes has special features for HTML - * attributes that use space separated lists and also - * allows arrays to be used as values. - */ - public function testExpandAttributesListValueAttributes() { - ### STRING VALUES - $this->assertEquals( - ' class="redundant spaces here"', - Html::expandAttributes( array( 'class' => ' redundant spaces here ' ) ), - 'Normalization should strip redundant spaces' - ); - $this->assertEquals( - ' class="foo bar"', - Html::expandAttributes( array( 'class' => 'foo bar foo bar bar' ) ), - 'Normalization should remove duplicates in string-lists' - ); - ### "EMPTY" ARRAY VALUES - $this->assertEquals( - ' class=""', - Html::expandAttributes( array( 'class' => array() ) ), - 'Value with an empty array' - ); - $this->assertEquals( - ' class=""', - Html::expandAttributes( array( 'class' => array( null, '', ' ', ' ' ) ) ), - 'Array with null, empty string and spaces' - ); - ### NON-EMPTY ARRAY VALUES - $this->assertEquals( - ' class="foo bar"', - Html::expandAttributes( array( 'class' => array( - 'foo', - 'bar', - 'foo', - 'bar', - 'bar', - ) ) ), - 'Normalization should remove duplicates in the array' - ); - $this->assertEquals( - ' class="foo bar"', - Html::expandAttributes( array( 'class' => array( - 'foo bar', - 'bar foo', - 'foo', - 'bar bar', - ) ) ), - 'Normalization should remove duplicates in string-lists in the array' - ); - } - - /** - * Test feature added by r96188, let pass attributes values as - * a PHP array. Restricted to class,rel, accesskey. - */ - public function testExpandAttributesSpaceSeparatedAttributesWithBoolean() { - $this->assertEquals( - ' class="booltrue one"', - Html::expandAttributes( array( 'class' => array( - 'booltrue' => true, - 'one' => 1, - - # Method use isset() internally, make sure we do discard - # attributes values which have been assigned well known values - 'emptystring' => '', - 'boolfalse' => false, - 'zero' => 0, - 'null' => null, - ) ) ) - ); - } - - /** - * How do we handle duplicate keys in HTML attributes expansion? - * We could pass a "class" the values: 'GREEN' and array( 'GREEN' => false ) - * The later will take precedence. - * - * Feature added by r96188 - */ - public function testValueIsAuthoritativeInSpaceSeparatedAttributesArrays() { - $this->assertEquals( - ' class=""', - Html::expandAttributes( array( 'class' => array( - 'GREEN', - 'GREEN' => false, - 'GREEN', - ) ) ) - ); - } - - public function testNamespaceSelector() { - $this->assertEquals( - '', - Html::namespaceSelector(), - 'Basic namespace selector without custom options' - ); - - $this->assertEquals( - ' ' . - '', - Html::namespaceSelector( - array( 'selected' => '2', 'all' => 'all', 'label' => 'Select a namespace:' ), - array( 'name' => 'wpNamespace', 'id' => 'mw-test-namespace' ) - ), - 'Basic namespace selector with custom values' - ); - - $this->assertEquals( - ' ' . - '', - Html::namespaceSelector( - array( 'label' => 'Select a namespace:' ) - ), - 'Basic namespace selector with a custom label but no id attribtue for the ' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '', - Html::namespaceSelector( - array( 'exclude' => array( 0, 1, 3, 100, 101 ) ) - ), - 'Namespace selector namespace filtering.' - ); - } - - public function testCanDisableANamespaces() { - $this->assertEquals( - '', - Html::namespaceSelector( array( - 'disable' => array( 0, 1, 2, 3, 4 ) - ) ), - 'Namespace selector namespace disabling' - ); - } - - /** - * @dataProvider provideHtml5InputTypes - */ - public function testHtmlElementAcceptsNewHtml5TypesInHtml5Mode( $HTML5InputType ) { - $this->assertEquals( - '', - Html::element( 'input', array( 'type' => $HTML5InputType ) ), - 'In HTML5, HTML::element() should accept type="' . $HTML5InputType . '"' - ); - } - - /** - * List of input element types values introduced by HTML5 - * Full list at http://www.w3.org/TR/html-markup/input.html - */ - public static function provideHtml5InputTypes() { - $types = array( - 'datetime', - 'datetime-local', - 'date', - 'month', - 'time', - 'week', - 'number', - 'range', - 'email', - 'url', - 'search', - 'tel', - 'color', - ); - $cases = array(); - foreach ( $types as $type ) { - $cases[] = array( $type ); - } - - return $cases; - } - - /** - * Test out Html::element drops or enforces default value - * @covers Html::dropDefaults - * @dataProvider provideElementsWithAttributesHavingDefaultValues - */ - public function testDropDefaults( $expected, $element, $attribs, $message = '' ) { - $this->assertEquals( $expected, Html::element( $element, $attribs ), $message ); - } - - public static function provideElementsWithAttributesHavingDefaultValues() { - # Use cases in a concise format: - # , , [, ] - # Will be mapped to Html::element() - $cases = array(); - - ### Generic cases, match $attribDefault static array - $cases[] = array( '', - 'area', array( 'shape' => 'rect' ) - ); - - $cases[] = array( '', - 'button', array( 'formaction' => 'GET' ) - ); - $cases[] = array( '', - 'button', array( 'formenctype' => 'application/x-www-form-urlencoded' ) - ); - - $cases[] = array( '', - 'canvas', array( 'height' => '150' ) - ); - $cases[] = array( '', - 'canvas', array( 'width' => '300' ) - ); - # Also check with numeric values - $cases[] = array( '', - 'canvas', array( 'height' => 150 ) - ); - $cases[] = array( '', - 'canvas', array( 'width' => 300 ) - ); - - $cases[] = array( '', - 'command', array( 'type' => 'command' ) - ); - - $cases[] = array( '
        ', - 'form', array( 'action' => 'GET' ) - ); - $cases[] = array( '
        ', - 'form', array( 'autocomplete' => 'on' ) - ); - $cases[] = array( '
        ', - 'form', array( 'enctype' => 'application/x-www-form-urlencoded' ) - ); - - $cases[] = array( '', - 'input', array( 'formaction' => 'GET' ) - ); - $cases[] = array( '', - 'input', array( 'type' => 'text' ) - ); - - $cases[] = array( '', - 'keygen', array( 'keytype' => 'rsa' ) - ); - - $cases[] = array( '', - 'link', array( 'media' => 'all' ) - ); - - $cases[] = array( '', - 'menu', array( 'type' => 'list' ) - ); - - $cases[] = array( '', - 'script', array( 'type' => 'text/javascript' ) - ); - - $cases[] = array( '', - 'style', array( 'media' => 'all' ) - ); - $cases[] = array( '', - 'style', array( 'type' => 'text/css' ) - ); - - $cases[] = array( '', - 'textarea', array( 'wrap' => 'soft' ) - ); - - ### SPECIFIC CASES - - # - $cases[] = array( '', - 'link', array( 'type' => 'text/css' ) - ); - - # specific handling - $cases[] = array( '', - 'input', array( 'type' => 'checkbox', 'value' => 'on' ), - 'Default value "on" is stripped of checkboxes', - ); - $cases[] = array( '', - 'input', array( 'type' => 'radio', 'value' => 'on' ), - 'Default value "on" is stripped of radio buttons', - ); - $cases[] = array( '', - 'input', array( 'type' => 'submit', 'value' => 'Submit' ), - 'Default value "Submit" is kept on submit buttons (for possible l10n issues)', - ); - $cases[] = array( '', - 'input', array( 'type' => 'color', 'value' => '' ), - ); - $cases[] = array( '', - 'input', array( 'type' => 'range', 'value' => '' ), - ); - - # ', - 'button', array( 'type' => 'submit' ), - 'According to standard the default type is "submit". Depending on compatibility mode IE might use "button", instead.', - ); - - # ', - 'select', array( 'size' => '4', 'multiple' => true ), - ); - # .. with numeric value - $cases[] = array( '', - 'select', array( 'size' => 4, 'multiple' => true ), - ); - $cases[] = array( '', - 'select', array( 'size' => '1', 'multiple' => false ), - ); - # .. with numeric value - $cases[] = array( '', - 'select', array( 'size' => 1, 'multiple' => false ), - ); - - # Passing an array as value - $cases[] = array( '', - 'a', array( 'class' => array( 'css-class-one', 'css-class-two' ) ), - "dropDefaults accepts values given as an array" - ); - - # FIXME: doDropDefault should remove defaults given in an array - # Expected should be '' - $cases[] = array( '', - 'a', array( 'class' => array( '', '' ) ), - "dropDefaults accepts values given as an array" - ); - - # Craft the Html elements - $ret = array(); - foreach ( $cases as $case ) { - $ret[] = array( - $case[0], - $case[1], $case[2], - isset( $case[3] ) ? $case[3] : '' - ); - } - - return $ret; - } - - public function testFormValidationBlacklist() { - $this->assertEmpty( - Html::expandAttributes( array( 'min' => 1, 'max' => 100, 'pattern' => 'abc', 'required' => true, 'step' => 2 ) ), - 'Blacklist form validation attributes.' - ); - $this->assertEquals( - ' step=any', - Html::expandAttributes( array( 'min' => 1, 'max' => 100, 'pattern' => 'abc', 'required' => true, 'step' => 'any' ) ), - 'Allow special case "step=any".' - ); - } -} diff --git a/tests/phpunit/includes/HttpTest.php b/tests/phpunit/includes/HttpTest.php deleted file mode 100644 index 11d8ed60..00000000 --- a/tests/phpunit/includes/HttpTest.php +++ /dev/null @@ -1,216 +0,0 @@ -assertEquals( $expected, $ok, $msg ); - } - - public static function cookieDomains() { - return array( - array( false, "org" ), - array( false, ".org" ), - array( true, "wikipedia.org" ), - array( true, ".wikipedia.org" ), - array( false, "co.uk" ), - array( false, ".co.uk" ), - array( false, "gov.uk" ), - array( false, ".gov.uk" ), - array( true, "supermarket.uk" ), - array( false, "uk" ), - array( false, ".uk" ), - array( false, "127.0.0." ), - array( false, "127." ), - array( false, "127.0.0.1." ), - array( true, "127.0.0.1" ), - array( false, "333.0.0.1" ), - array( true, "example.com" ), - array( false, "example.com." ), - array( true, ".example.com" ), - - array( true, ".example.com", "www.example.com" ), - array( false, "example.com", "www.example.com" ), - array( true, "127.0.0.1", "127.0.0.1" ), - array( false, "127.0.0.1", "localhost" ), - ); - } - - /** - * Test Http::isValidURI() - * @bug 27854 : Http::isValidURI is too lax - * @dataProvider provideURI - * @covers Http::isValidURI - */ - public function testIsValidUri( $expect, $URI, $message = '' ) { - $this->assertEquals( - $expect, - (bool)Http::isValidURI( $URI ), - $message - ); - } - - /** - * Feeds URI to test a long regular expression in Http::isValidURI - */ - public static function provideURI() { - /** Format: 'boolean expectation', 'URI to test', 'Optional message' */ - return array( - array( false, '¿non sens before!! http://a', 'Allow anything before URI' ), - - # (http|https) - only two schemes allowed - array( true, 'http://www.example.org/' ), - array( true, 'https://www.example.org/' ), - array( true, 'http://www.example.org', 'URI without directory' ), - array( true, 'http://a', 'Short name' ), - array( true, 'http://étoile', 'Allow UTF-8 in hostname' ), # 'étoile' is french for 'star' - array( false, '\\host\directory', 'CIFS share' ), - array( false, 'gopher://host/dir', 'Reject gopher scheme' ), - array( false, 'telnet://host', 'Reject telnet scheme' ), - - # :\/\/ - double slashes - array( false, 'http//example.org', 'Reject missing colon in protocol' ), - array( false, 'http:/example.org', 'Reject missing slash in protocol' ), - array( false, 'http:example.org', 'Must have two slashes' ), - # Following fail since hostname can be made of anything - array( false, 'http:///example.org', 'Must have exactly two slashes, not three' ), - - # (\w+:{0,1}\w*@)? - optional user:pass - array( true, 'http://user@host', 'Username provided' ), - array( true, 'http://user:@host', 'Username provided, no password' ), - array( true, 'http://user:pass@host', 'Username and password provided' ), - - # (\S+) - host part is made of anything not whitespaces - array( false, 'http://!"èèè¿¿¿~~\'', 'hostname is made of any non whitespace' ), - array( false, 'http://exam:ple.org/', 'hostname can not use colons!' ), - - # (:[0-9]+)? - port number - array( true, 'http://example.org:80/' ), - array( true, 'https://example.org:80/' ), - array( true, 'http://example.org:443/' ), - array( true, 'https://example.org:443/' ), - - # Part after the hostname is / or / with something else - array( true, 'http://example/#' ), - array( true, 'http://example/!' ), - array( true, 'http://example/:' ), - array( true, 'http://example/.' ), - array( true, 'http://example/?' ), - array( true, 'http://example/+' ), - array( true, 'http://example/=' ), - array( true, 'http://example/&' ), - array( true, 'http://example/%' ), - array( true, 'http://example/@' ), - array( true, 'http://example/-' ), - array( true, 'http://example//' ), - array( true, 'http://example/&' ), - - # Fragment - array( true, 'http://exam#ple.org', ), # This one is valid, really! - array( true, 'http://example.org:80#anchor' ), - array( true, 'http://example.org/?id#anchor' ), - array( true, 'http://example.org/?#anchor' ), - - array( false, 'http://a ¿non !!sens after', 'Allow anything after URI' ), - ); - } - - /** - * Warning: - * - * These tests are for code that makes use of an artifact of how CURL - * handles header reporting on redirect pages, and will need to be - * rewritten when bug 29232 is taken care of (high-level handling of - * HTTP redirects). - */ - public function testRelativeRedirections() { - $h = MWHttpRequestTester::factory( 'http://oldsite/file.ext' ); - - # Forge a Location header - $h->setRespHeaders( 'location', array( - 'http://newsite/file.ext', - '/newfile.ext', - ) - ); - # Verify we correctly fix the Location - $this->assertEquals( - 'http://newsite/newfile.ext', - $h->getFinalUrl(), - "Relative file path Location: interpreted as full URL" - ); - - $h->setRespHeaders( 'location', array( - 'https://oldsite/file.ext' - ) - ); - $this->assertEquals( - 'https://oldsite/file.ext', - $h->getFinalUrl(), - "Location to the HTTPS version of the site" - ); - - $h->setRespHeaders( 'location', array( - '/anotherfile.ext', - 'http://anotherfile/hoster.ext', - 'https://anotherfile/hoster.ext' - ) - ); - $this->assertEquals( - 'https://anotherfile/hoster.ext', - $h->getFinalUrl( "Relative file path Location: should keep the latest host and scheme!" ) - ); - } -} - -/** - * Class to let us overwrite MWHttpRequest respHeaders variable - */ -class MWHttpRequestTester extends MWHttpRequest { - - // function derived from the MWHttpRequest factory function but - // returns appropriate tester class here - public static function factory( $url, $options = null ) { - if ( !Http::$httpEngine ) { - Http::$httpEngine = function_exists( 'curl_init' ) ? 'curl' : 'php'; - } elseif ( Http::$httpEngine == 'curl' && !function_exists( 'curl_init' ) ) { - throw new MWException( __METHOD__ . ': curl (http://php.net/curl) is not installed, but' . - 'Http::$httpEngine is set to "curl"' ); - } - - switch ( Http::$httpEngine ) { - case 'curl': - return new CurlHttpRequestTester( $url, $options ); - case 'php': - if ( !wfIniGetBool( 'allow_url_fopen' ) ) { - throw new MWException( __METHOD__ . ': allow_url_fopen needs to be enabled for pure PHP' . - ' http requests to work. If possible, curl should be used instead. See http://php.net/curl.' ); - } - - return new PhpHttpRequestTester( $url, $options ); - default: - } - } -} - -class CurlHttpRequestTester extends CurlHttpRequest { - function setRespHeaders( $name, $value ) { - $this->respHeaders[$name] = $value; - } -} - -class PhpHttpRequestTester extends PhpHttpRequest { - function setRespHeaders( $name, $value ) { - $this->respHeaders[$name] = $value; - } -} diff --git a/tests/phpunit/includes/IPTest.php b/tests/phpunit/includes/IPTest.php deleted file mode 100644 index c074eea6..00000000 --- a/tests/phpunit/includes/IPTest.php +++ /dev/null @@ -1,595 +0,0 @@ -assertFalse( IP::isIPAddress( false ), 'Boolean false is not an IP' ); - $this->assertFalse( IP::isIPAddress( true ), 'Boolean true is not an IP' ); - $this->assertFalse( IP::isIPAddress( "" ), 'Empty string is not an IP' ); - $this->assertFalse( IP::isIPAddress( 'abc' ), 'Garbage IP string' ); - $this->assertFalse( IP::isIPAddress( ':' ), 'Single ":" is not an IP' ); - $this->assertFalse( IP::isIPAddress( '2001:0DB8::A:1::1' ), 'IPv6 with a double :: occurrence' ); - $this->assertFalse( IP::isIPAddress( '2001:0DB8::A:1::' ), 'IPv6 with a double :: occurrence, last at end' ); - $this->assertFalse( IP::isIPAddress( '::2001:0DB8::5:1' ), 'IPv6 with a double :: occurrence, firt at beginning' ); - $this->assertFalse( IP::isIPAddress( '124.24.52' ), 'IPv4 not enough quads' ); - $this->assertFalse( IP::isIPAddress( '24.324.52.13' ), 'IPv4 out of range' ); - $this->assertFalse( IP::isIPAddress( '.24.52.13' ), 'IPv4 starts with period' ); - $this->assertFalse( IP::isIPAddress( 'fc:100:300' ), 'IPv6 with only 3 words' ); - - $this->assertTrue( IP::isIPAddress( '::' ), 'RFC 4291 IPv6 Unspecified Address' ); - $this->assertTrue( IP::isIPAddress( '::1' ), 'RFC 4291 IPv6 Loopback Address' ); - $this->assertTrue( IP::isIPAddress( '74.24.52.13/20', 'IPv4 range' ) ); - $this->assertTrue( IP::isIPAddress( 'fc:100:a:d:1:e:ac:0/24' ), 'IPv6 range' ); - $this->assertTrue( IP::isIPAddress( 'fc::100:a:d:1:e:ac/96' ), 'IPv6 range with "::"' ); - - $validIPs = array( 'fc:100::', 'fc:100:a:d:1:e:ac::', 'fc::100', '::fc:100:a:d:1:e:ac', - '::fc', 'fc::100:a:d:1:e:ac', 'fc:100:a:d:1:e:ac:0', '124.24.52.13', '1.24.52.13' ); - foreach ( $validIPs as $ip ) { - $this->assertTrue( IP::isIPAddress( $ip ), "$ip is a valid IP address" ); - } - } - - /** - * @covers IP::isIPv6 - */ - public function testisIPv6() { - $this->assertFalse( IP::isIPv6( ':fc:100::' ), 'IPv6 starting with lone ":"' ); - $this->assertFalse( IP::isIPv6( 'fc:100:::' ), 'IPv6 ending with a ":::"' ); - $this->assertFalse( IP::isIPv6( 'fc:300' ), 'IPv6 with only 2 words' ); - $this->assertFalse( IP::isIPv6( 'fc:100:300' ), 'IPv6 with only 3 words' ); - - $this->assertTrue( IP::isIPv6( 'fc:100::' ) ); - $this->assertTrue( IP::isIPv6( 'fc:100:a::' ) ); - $this->assertTrue( IP::isIPv6( 'fc:100:a:d::' ) ); - $this->assertTrue( IP::isIPv6( 'fc:100:a:d:1::' ) ); - $this->assertTrue( IP::isIPv6( 'fc:100:a:d:1:e::' ) ); - $this->assertTrue( IP::isIPv6( 'fc:100:a:d:1:e:ac::' ) ); - - $this->assertFalse( IP::isIPv6( 'fc:100:a:d:1:e:ac:0::' ), 'IPv6 with 8 words ending with "::"' ); - $this->assertFalse( IP::isIPv6( 'fc:100:a:d:1:e:ac:0:1::' ), 'IPv6 with 9 words ending with "::"' ); - - $this->assertFalse( IP::isIPv6( ':::' ) ); - $this->assertFalse( IP::isIPv6( '::0:' ), 'IPv6 ending in a lone ":"' ); - - $this->assertTrue( IP::isIPv6( '::' ), 'IPv6 zero address' ); - $this->assertTrue( IP::isIPv6( '::0' ) ); - $this->assertTrue( IP::isIPv6( '::fc' ) ); - $this->assertTrue( IP::isIPv6( '::fc:100' ) ); - $this->assertTrue( IP::isIPv6( '::fc:100:a' ) ); - $this->assertTrue( IP::isIPv6( '::fc:100:a:d' ) ); - $this->assertTrue( IP::isIPv6( '::fc:100:a:d:1' ) ); - $this->assertTrue( IP::isIPv6( '::fc:100:a:d:1:e' ) ); - $this->assertTrue( IP::isIPv6( '::fc:100:a:d:1:e:ac' ) ); - - $this->assertFalse( IP::isIPv6( '::fc:100:a:d:1:e:ac:0' ), 'IPv6 with "::" and 8 words' ); - $this->assertFalse( IP::isIPv6( '::fc:100:a:d:1:e:ac:0:1' ), 'IPv6 with 9 words' ); - - $this->assertFalse( IP::isIPv6( ':fc::100' ), 'IPv6 starting with lone ":"' ); - $this->assertFalse( IP::isIPv6( 'fc::100:' ), 'IPv6 ending with lone ":"' ); - $this->assertFalse( IP::isIPv6( 'fc:::100' ), 'IPv6 with ":::" in the middle' ); - - $this->assertTrue( IP::isIPv6( 'fc::100' ), 'IPv6 with "::" and 2 words' ); - $this->assertTrue( IP::isIPv6( 'fc::100:a' ), 'IPv6 with "::" and 3 words' ); - $this->assertTrue( IP::isIPv6( 'fc::100:a:d', 'IPv6 with "::" and 4 words' ) ); - $this->assertTrue( IP::isIPv6( 'fc::100:a:d:1' ), 'IPv6 with "::" and 5 words' ); - $this->assertTrue( IP::isIPv6( 'fc::100:a:d:1:e' ), 'IPv6 with "::" and 6 words' ); - $this->assertTrue( IP::isIPv6( 'fc::100:a:d:1:e:ac' ), 'IPv6 with "::" and 7 words' ); - $this->assertTrue( IP::isIPv6( '2001::df' ), 'IPv6 with "::" and 2 words' ); - $this->assertTrue( IP::isIPv6( '2001:5c0:1400:a::df' ), 'IPv6 with "::" and 5 words' ); - $this->assertTrue( IP::isIPv6( '2001:5c0:1400:a::df:2' ), 'IPv6 with "::" and 6 words' ); - - $this->assertFalse( IP::isIPv6( 'fc::100:a:d:1:e:ac:0' ), 'IPv6 with "::" and 8 words' ); - $this->assertFalse( IP::isIPv6( 'fc::100:a:d:1:e:ac:0:1' ), 'IPv6 with 9 words' ); - - $this->assertTrue( IP::isIPv6( 'fc:100:a:d:1:e:ac:0' ) ); - } - - /** - * @covers IP::isIPv4 - */ - public function testisIPv4() { - $this->assertFalse( IP::isIPv4( false ), 'Boolean false is not an IP' ); - $this->assertFalse( IP::isIPv4( true ), 'Boolean true is not an IP' ); - $this->assertFalse( IP::isIPv4( "" ), 'Empty string is not an IP' ); - $this->assertFalse( IP::isIPv4( 'abc' ) ); - $this->assertFalse( IP::isIPv4( ':' ) ); - $this->assertFalse( IP::isIPv4( '124.24.52' ), 'IPv4 not enough quads' ); - $this->assertFalse( IP::isIPv4( '24.324.52.13' ), 'IPv4 out of range' ); - $this->assertFalse( IP::isIPv4( '.24.52.13' ), 'IPv4 starts with period' ); - - $this->assertTrue( IP::isIPv4( '124.24.52.13' ) ); - $this->assertTrue( IP::isIPv4( '1.24.52.13' ) ); - $this->assertTrue( IP::isIPv4( '74.24.52.13/20', 'IPv4 range' ) ); - } - - /** - * @covers IP::isValid - */ - public function testValidIPs() { - foreach ( range( 0, 255 ) as $i ) { - $a = sprintf( "%03d", $i ); - $b = sprintf( "%02d", $i ); - $c = sprintf( "%01d", $i ); - foreach ( array_unique( array( $a, $b, $c ) ) as $f ) { - $ip = "$f.$f.$f.$f"; - $this->assertTrue( IP::isValid( $ip ), "$ip is a valid IPv4 address" ); - } - } - foreach ( range( 0x0, 0xFFFF, 0xF ) as $i ) { - $a = sprintf( "%04x", $i ); - $b = sprintf( "%03x", $i ); - $c = sprintf( "%02x", $i ); - foreach ( array_unique( array( $a, $b, $c ) ) as $f ) { - $ip = "$f:$f:$f:$f:$f:$f:$f:$f"; - $this->assertTrue( IP::isValid( $ip ), "$ip is a valid IPv6 address" ); - } - } - // test with some abbreviations - $this->assertFalse( IP::isValid( ':fc:100::' ), 'IPv6 starting with lone ":"' ); - $this->assertFalse( IP::isValid( 'fc:100:::' ), 'IPv6 ending with a ":::"' ); - $this->assertFalse( IP::isValid( 'fc:300' ), 'IPv6 with only 2 words' ); - $this->assertFalse( IP::isValid( 'fc:100:300' ), 'IPv6 with only 3 words' ); - - $this->assertTrue( IP::isValid( 'fc:100::' ) ); - $this->assertTrue( IP::isValid( 'fc:100:a:d:1:e::' ) ); - $this->assertTrue( IP::isValid( 'fc:100:a:d:1:e:ac::' ) ); - - $this->assertTrue( IP::isValid( 'fc::100' ), 'IPv6 with "::" and 2 words' ); - $this->assertTrue( IP::isValid( 'fc::100:a' ), 'IPv6 with "::" and 3 words' ); - $this->assertTrue( IP::isValid( '2001::df' ), 'IPv6 with "::" and 2 words' ); - $this->assertTrue( IP::isValid( '2001:5c0:1400:a::df' ), 'IPv6 with "::" and 5 words' ); - $this->assertTrue( IP::isValid( '2001:5c0:1400:a::df:2' ), 'IPv6 with "::" and 6 words' ); - $this->assertTrue( IP::isValid( 'fc::100:a:d:1' ), 'IPv6 with "::" and 5 words' ); - $this->assertTrue( IP::isValid( 'fc::100:a:d:1:e:ac' ), 'IPv6 with "::" and 7 words' ); - - $this->assertFalse( IP::isValid( 'fc:100:a:d:1:e:ac:0::' ), 'IPv6 with 8 words ending with "::"' ); - $this->assertFalse( IP::isValid( 'fc:100:a:d:1:e:ac:0:1::' ), 'IPv6 with 9 words ending with "::"' ); - } - - /** - * @covers IP::isValid - */ - public function testInvalidIPs() { - // Out of range... - foreach ( range( 256, 999 ) as $i ) { - $a = sprintf( "%03d", $i ); - $b = sprintf( "%02d", $i ); - $c = sprintf( "%01d", $i ); - foreach ( array_unique( array( $a, $b, $c ) ) as $f ) { - $ip = "$f.$f.$f.$f"; - $this->assertFalse( IP::isValid( $ip ), "$ip is not a valid IPv4 address" ); - } - } - foreach ( range( 'g', 'z' ) as $i ) { - $a = sprintf( "%04s", $i ); - $b = sprintf( "%03s", $i ); - $c = sprintf( "%02s", $i ); - foreach ( array_unique( array( $a, $b, $c ) ) as $f ) { - $ip = "$f:$f:$f:$f:$f:$f:$f:$f"; - $this->assertFalse( IP::isValid( $ip ), "$ip is not a valid IPv6 address" ); - } - } - // Have CIDR - $ipCIDRs = array( - '212.35.31.121/32', - '212.35.31.121/18', - '212.35.31.121/24', - '::ff:d:321:5/96', - 'ff::d3:321:5/116', - 'c:ff:12:1:ea:d:321:5/120', - ); - foreach ( $ipCIDRs as $i ) { - $this->assertFalse( IP::isValid( $i ), - "$i is an invalid IP address because it is a block" ); - } - // Incomplete/garbage - $invalid = array( - 'www.xn--var-xla.net', - '216.17.184.G', - '216.17.184.1.', - '216.17.184', - '216.17.184.', - '256.17.184.1' - ); - foreach ( $invalid as $i ) { - $this->assertFalse( IP::isValid( $i ), "$i is an invalid IP address" ); - } - } - - /** - * @covers IP::isValidBlock - */ - public function testValidBlocks() { - $valid = array( - '116.17.184.5/32', - '0.17.184.5/30', - '16.17.184.1/24', - '30.242.52.14/1', - '10.232.52.13/8', - '30.242.52.14/0', - '::e:f:2001/96', - '::c:f:2001/128', - '::10:f:2001/70', - '::fe:f:2001/1', - '::6d:f:2001/8', - '::fe:f:2001/0', - ); - foreach ( $valid as $i ) { - $this->assertTrue( IP::isValidBlock( $i ), "$i is a valid IP block" ); - } - } - - /** - * @covers IP::isValidBlock - */ - public function testInvalidBlocks() { - $invalid = array( - '116.17.184.5/33', - '0.17.184.5/130', - '16.17.184.1/-1', - '10.232.52.13/*', - '7.232.52.13/ab', - '11.232.52.13/', - '::e:f:2001/129', - '::c:f:2001/228', - '::10:f:2001/-1', - '::6d:f:2001/*', - '::86:f:2001/ab', - '::23:f:2001/', - ); - foreach ( $invalid as $i ) { - $this->assertFalse( IP::isValidBlock( $i ), "$i is not a valid IP block" ); - } - } - - /** - * Improve IP::sanitizeIP() code coverage - * @todo Most probably incomplete - */ - public function testSanitizeIP() { - $this->assertNull( IP::sanitizeIP( '' ) ); - $this->assertNull( IP::sanitizeIP( ' ' ) ); - } - - /** - * @covers IP::toUnsigned - * @dataProvider provideToUnsigned - */ - public function testToUnsigned( $expected, $input ) { - $result = IP::toUnsigned( $input ); - $this->assertTrue( $result === false || is_string( $result ) || is_int( $result ) ); - $this->assertEquals( $expected, $result ); - } - - /** - * Provider for IP::testToUnsigned() - */ - public static function provideToUnsigned() { - return array( - array( 1, '0.0.0.1' ), - array( 16909060, '1.2.3.4' ), - array( 2130706433, '127.0.0.1' ), - array( '2147483648', '128.0.0.0' ), - array( '3735931646', '222.173.202.254' ), - array( pow( 2, 32 ) - 1, '255.255.255.255' ), - array( false, 'IN.VA.LI.D' ), - array( 1, '::1' ), - array( '42540766452641154071740215577757643572', '2001:0db8:85a3:0000:0000:8a2e:0370:7334' ), - array( '42540766452641154071740215577757643572', '2001:db8:85a3::8a2e:0370:7334' ), - array( false, 'IN:VA::LI:D' ), - array( false, ':::1' ) - ); - } - - /** - * @covers IP::toHex - * @dataProvider provideToHex - */ - public function testToHex( $expected, $input ) { - $result = IP::toHex( $input ); - $this->assertTrue( $result === false || is_string( $result ) ); - $this->assertEquals( $expected, $result ); - } - - /** - * Provider for IP::testToHex() - */ - public static function provideToHex() { - return array( - array( '00000001', '0.0.0.1' ), - array( '01020304', '1.2.3.4' ), - array( '7F000001', '127.0.0.1' ), - array( '80000000', '128.0.0.0' ), - array( 'DEADCAFE', '222.173.202.254' ), - array( 'FFFFFFFF', '255.255.255.255' ), - array( false, 'IN.VA.LI.D' ), - array( 'v6-00000000000000000000000000000001', '::1' ), - array( 'v6-20010DB885A3000000008A2E03707334', '2001:0db8:85a3:0000:0000:8a2e:0370:7334' ), - array( 'v6-20010DB885A3000000008A2E03707334', '2001:db8:85a3::8a2e:0370:7334' ), - array( false, 'IN:VA::LI:D' ), - array( false, ':::1' ) - ); - } - - /** - * @covers IP::isPublic - */ - public function testPrivateIPs() { - $private = array( 'fc00::3', 'fc00::ff', '::1', '10.0.0.1', '172.16.0.1', '192.168.0.1' ); - foreach ( $private as $p ) { - $this->assertFalse( IP::isPublic( $p ), "$p is not a public IP address" ); - } - $public = array( '2001:5c0:1000:a::133', 'fc::3', '00FC::' ); - foreach ( $public as $p ) { - $this->assertTrue( IP::isPublic( $p ), "$p is a public IP address" ); - } - } - - // Private wrapper used to test CIDR Parsing. - private function assertFalseCIDR( $CIDR, $msg = '' ) { - $ff = array( false, false ); - $this->assertEquals( $ff, IP::parseCIDR( $CIDR ), $msg ); - } - - // Private wrapper to test network shifting using only dot notation - private function assertNet( $expected, $CIDR ) { - $parse = IP::parseCIDR( $CIDR ); - $this->assertEquals( $expected, long2ip( $parse[0] ), "network shifting $CIDR" ); - } - - /** - * @covers IP::hexToQuad - */ - public function testHexToQuad() { - $this->assertEquals( '0.0.0.1', IP::hexToQuad( '00000001' ) ); - $this->assertEquals( '255.0.0.0', IP::hexToQuad( 'FF000000' ) ); - $this->assertEquals( '255.255.255.255', IP::hexToQuad( 'FFFFFFFF' ) ); - $this->assertEquals( '10.188.222.255', IP::hexToQuad( '0ABCDEFF' ) ); - // hex not left-padded... - $this->assertEquals( '0.0.0.0', IP::hexToQuad( '0' ) ); - $this->assertEquals( '0.0.0.1', IP::hexToQuad( '1' ) ); - $this->assertEquals( '0.0.0.255', IP::hexToQuad( 'FF' ) ); - $this->assertEquals( '0.0.255.0', IP::hexToQuad( 'FF00' ) ); - } - - /** - * @covers IP::hexToOctet - */ - public function testHexToOctet() { - $this->assertEquals( '0:0:0:0:0:0:0:1', - IP::hexToOctet( '00000000000000000000000000000001' ) ); - $this->assertEquals( '0:0:0:0:0:0:FF:3', - IP::hexToOctet( '00000000000000000000000000FF0003' ) ); - $this->assertEquals( '0:0:0:0:0:0:FF00:6', - IP::hexToOctet( '000000000000000000000000FF000006' ) ); - $this->assertEquals( '0:0:0:0:0:0:FCCF:FAFF', - IP::hexToOctet( '000000000000000000000000FCCFFAFF' ) ); - $this->assertEquals( 'FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF', - IP::hexToOctet( 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF' ) ); - // hex not left-padded... - $this->assertEquals( '0:0:0:0:0:0:0:0', IP::hexToOctet( '0' ) ); - $this->assertEquals( '0:0:0:0:0:0:0:1', IP::hexToOctet( '1' ) ); - $this->assertEquals( '0:0:0:0:0:0:0:FF', IP::hexToOctet( 'FF' ) ); - $this->assertEquals( '0:0:0:0:0:0:0:FFD0', IP::hexToOctet( 'FFD0' ) ); - $this->assertEquals( '0:0:0:0:0:0:FA00:0', IP::hexToOctet( 'FA000000' ) ); - $this->assertEquals( '0:0:0:0:0:0:FCCF:FAFF', IP::hexToOctet( 'FCCFFAFF' ) ); - } - - /** - * IP::parseCIDR() returns an array containing a signed IP address - * representing the network mask and the bit mask. - * @covers IP::parseCIDR - */ - public function testCIDRParsing() { - $this->assertFalseCIDR( '192.0.2.0', "missing mask" ); - $this->assertFalseCIDR( '192.0.2.0/', "missing bitmask" ); - - // Verify if statement - $this->assertFalseCIDR( '256.0.0.0/32', "invalid net" ); - $this->assertFalseCIDR( '192.0.2.0/AA', "mask not numeric" ); - $this->assertFalseCIDR( '192.0.2.0/-1', "mask < 0" ); - $this->assertFalseCIDR( '192.0.2.0/33', "mask > 32" ); - - // Check internal logic - # 0 mask always result in array(0,0) - $this->assertEquals( array( 0, 0 ), IP::parseCIDR( '192.0.0.2/0' ) ); - $this->assertEquals( array( 0, 0 ), IP::parseCIDR( '0.0.0.0/0' ) ); - $this->assertEquals( array( 0, 0 ), IP::parseCIDR( '255.255.255.255/0' ) ); - - // @todo FIXME: Add more tests. - - # This part test network shifting - $this->assertNet( '192.0.0.0', '192.0.0.2/24' ); - $this->assertNet( '192.168.5.0', '192.168.5.13/24' ); - $this->assertNet( '10.0.0.160', '10.0.0.161/28' ); - $this->assertNet( '10.0.0.0', '10.0.0.3/28' ); - $this->assertNet( '10.0.0.0', '10.0.0.3/30' ); - $this->assertNet( '10.0.0.4', '10.0.0.4/30' ); - $this->assertNet( '172.17.32.0', '172.17.35.48/21' ); - $this->assertNet( '10.128.0.0', '10.135.0.0/9' ); - $this->assertNet( '134.0.0.0', '134.0.5.1/8' ); - } - - /** - * @covers IP::canonicalize - */ - public function testIPCanonicalizeOnValidIp() { - $this->assertEquals( '192.0.2.152', IP::canonicalize( '192.0.2.152' ), - 'Canonicalization of a valid IP returns it unchanged' ); - } - - /** - * @covers IP::canonicalize - */ - public function testIPCanonicalizeMappedAddress() { - $this->assertEquals( - '192.0.2.152', - IP::canonicalize( '::ffff:192.0.2.152' ) - ); - $this->assertEquals( - '192.0.2.152', - IP::canonicalize( '::192.0.2.152' ) - ); - } - - /** - * Issues there are most probably from IP::toHex() or IP::parseRange() - * @covers IP::isInRange - * @dataProvider provideIPsAndRanges - */ - public function testIPIsInRange( $expected, $addr, $range, $message = '' ) { - $this->assertEquals( - $expected, - IP::isInRange( $addr, $range ), - $message - ); - } - - /** Provider for testIPIsInRange() */ - public static function provideIPsAndRanges() { - # Format: (expected boolean, address, range, optional message) - return array( - # IPv4 - array( true, '192.0.2.0', '192.0.2.0/24', 'Network address' ), - array( true, '192.0.2.77', '192.0.2.0/24', 'Simple address' ), - array( true, '192.0.2.255', '192.0.2.0/24', 'Broadcast address' ), - - array( false, '0.0.0.0', '192.0.2.0/24' ), - array( false, '255.255.255', '192.0.2.0/24' ), - - # IPv6 - array( false, '::1', '2001:DB8::/32' ), - array( false, '::', '2001:DB8::/32' ), - array( false, 'FE80::1', '2001:DB8::/32' ), - - array( true, '2001:DB8::', '2001:DB8::/32' ), - array( true, '2001:0DB8::', '2001:DB8::/32' ), - array( true, '2001:DB8::1', '2001:DB8::/32' ), - array( true, '2001:0DB8::1', '2001:DB8::/32' ), - array( true, '2001:0DB8:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF', - '2001:DB8::/32' ), - - array( false, '2001:0DB8:F::', '2001:DB8::/96' ), - ); - } - - /** - * Test for IP::splitHostAndPort(). - * @dataProvider provideSplitHostAndPort - */ - public function testSplitHostAndPort( $expected, $input, $description ) { - $this->assertEquals( $expected, IP::splitHostAndPort( $input ), $description ); - } - - /** - * Provider for IP::splitHostAndPort() - */ - public static function provideSplitHostAndPort() { - return array( - array( false, '[', 'Unclosed square bracket' ), - array( false, '[::', 'Unclosed square bracket 2' ), - array( array( '::', false ), '::', 'Bare IPv6 0' ), - array( array( '::1', false ), '::1', 'Bare IPv6 1' ), - array( array( '::', false ), '[::]', 'Bracketed IPv6 0' ), - array( array( '::1', false ), '[::1]', 'Bracketed IPv6 1' ), - array( array( '::1', 80 ), '[::1]:80', 'Bracketed IPv6 with port' ), - array( false, '::x', 'Double colon but no IPv6' ), - array( array( 'x', 80 ), 'x:80', 'Hostname and port' ), - array( false, 'x:x', 'Hostname and invalid port' ), - array( array( 'x', false ), 'x', 'Plain hostname' ) - ); - } - - /** - * Test for IP::combineHostAndPort() - * @dataProvider provideCombineHostAndPort - */ - public function testCombineHostAndPort( $expected, $input, $description ) { - list( $host, $port, $defaultPort ) = $input; - $this->assertEquals( - $expected, - IP::combineHostAndPort( $host, $port, $defaultPort ), - $description ); - } - - /** - * Provider for IP::combineHostAndPort() - */ - public static function provideCombineHostAndPort() { - return array( - array( '[::1]', array( '::1', 2, 2 ), 'IPv6 default port' ), - array( '[::1]:2', array( '::1', 2, 3 ), 'IPv6 non-default port' ), - array( 'x', array( 'x', 2, 2 ), 'Normal default port' ), - array( 'x:2', array( 'x', 2, 3 ), 'Normal non-default port' ), - ); - } - - /** - * Test for IP::sanitizeRange() - * @dataProvider provideIPCIDRs - */ - public function testSanitizeRange( $input, $expected, $description ) { - $this->assertEquals( $expected, IP::sanitizeRange( $input ), $description ); - } - - /** - * Provider for IP::testSanitizeRange() - */ - public static function provideIPCIDRs() { - return array( - array( '35.56.31.252/16', '35.56.0.0/16', 'IPv4 range' ), - array( '135.16.21.252/24', '135.16.21.0/24', 'IPv4 range' ), - array( '5.36.71.252/32', '5.36.71.252/32', 'IPv4 silly range' ), - array( '5.36.71.252', '5.36.71.252', 'IPv4 non-range' ), - array( '0:1:2:3:4:c5:f6:7/96', '0:1:2:3:4:C5:0:0/96', 'IPv6 range' ), - array( '0:1:2:3:4:5:6:7/120', '0:1:2:3:4:5:6:0/120', 'IPv6 range' ), - array( '0:e1:2:3:4:5:e6:7/128', '0:E1:2:3:4:5:E6:7/128', 'IPv6 silly range' ), - array( '0:c1:A2:3:4:5:c6:7', '0:C1:A2:3:4:5:C6:7', 'IPv6 non range' ), - ); - } - - /** - * Test for IP::prettifyIP() - * @dataProvider provideIPsToPrettify - */ - public function testPrettifyIP( $ip, $prettified ) { - $this->assertEquals( $prettified, IP::prettifyIP( $ip ), "Prettify of $ip" ); - } - - /** - * Provider for IP::testPrettifyIP() - */ - public static function provideIPsToPrettify() { - return array( - array( '0:0:0:0:0:0:0:0', '::' ), - array( '0:0:0::0:0:0', '::' ), - array( '0:0:0:1:0:0:0:0', '0:0:0:1::' ), - array( '0:0::f', '::f' ), - array( '0::0:0:0:33:fef:b', '::33:fef:b' ), - array( '3f:535:0:0:0:0:e:fbb', '3f:535::e:fbb' ), - array( '0:0:fef:0:0:0:e:fbb', '0:0:fef::e:fbb' ), - array( 'abbc:2004::0:0:0:0', 'abbc:2004::' ), - array( 'cebc:2004:f:0:0:0:0:0', 'cebc:2004:f::' ), - array( '0:0:0:0:0:0:0:0/16', '::/16' ), - array( '0:0:0::0:0:0/64', '::/64' ), - array( '0:0::f/52', '::f/52' ), - array( '::0:0:33:fef:b/52', '::33:fef:b/52' ), - array( '3f:535:0:0:0:0:e:fbb/48', '3f:535::e:fbb/48' ), - array( '0:0:fef:0:0:0:e:fbb/96', '0:0:fef::e:fbb/96' ), - array( 'abbc:2004:0:0::0:0/40', 'abbc:2004::/40' ), - array( 'aebc:2004:f:0:0:0:0:0/80', 'aebc:2004:f::/80' ), - ); - } -} diff --git a/tests/phpunit/includes/LanguageConverterTest.php b/tests/phpunit/includes/LanguageConverterTest.php deleted file mode 100644 index 7c2134b9..00000000 --- a/tests/phpunit/includes/LanguageConverterTest.php +++ /dev/null @@ -1,148 +0,0 @@ -setMwGlobals( array( - 'wgContLang' => Language::factory( 'tg' ), - 'wgLanguageCode' => 'tg', - 'wgDefaultLanguageVariant' => false, - 'wgMemc' => new EmptyBagOStuff, - 'wgRequest' => new FauxRequest( array() ), - 'wgUser' => new User, - ) ); - - $this->lang = new LanguageToTest(); - $this->lc = new TestConverter( - $this->lang, 'tg', - array( 'tg', 'tg-latn' ) - ); - } - - protected function tearDown() { - unset( $this->lc ); - unset( $this->lang ); - - parent::tearDown(); - } - - public function testGetPreferredVariantDefaults() { - $this->assertEquals( 'tg', $this->lc->getPreferredVariant() ); - } - - public function testGetPreferredVariantHeaders() { - global $wgRequest; - $wgRequest->setHeader( 'Accept-Language', 'tg-latn' ); - - $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); - } - - public function testGetPreferredVariantHeaderWeight() { - global $wgRequest; - $wgRequest->setHeader( 'Accept-Language', 'tg;q=1' ); - - $this->assertEquals( 'tg', $this->lc->getPreferredVariant() ); - } - - public function testGetPreferredVariantHeaderWeight2() { - global $wgRequest; - $wgRequest->setHeader( 'Accept-Language', 'tg-latn;q=1' ); - - $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); - } - - public function testGetPreferredVariantHeaderMulti() { - global $wgRequest; - $wgRequest->setHeader( 'Accept-Language', 'en, tg-latn;q=1' ); - - $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); - } - - public function testGetPreferredVariantUserOption() { - global $wgUser; - - $wgUser = new User; - $wgUser->load(); // from 'defaults' - $wgUser->mId = 1; - $wgUser->mDataLoaded = true; - $wgUser->mOptionsLoaded = true; - $wgUser->setOption( 'variant', 'tg-latn' ); - - $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); - } - - public function testGetPreferredVariantUserOptionForForeignLanguage() { - global $wgContLang, $wgUser; - - $wgContLang = Language::factory( 'en' ); - $wgUser = new User; - $wgUser->load(); // from 'defaults' - $wgUser->mId = 1; - $wgUser->mDataLoaded = true; - $wgUser->mOptionsLoaded = true; - $wgUser->setOption( 'variant-tg', 'tg-latn' ); - - $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); - } - - public function testGetPreferredVariantHeaderUserVsUrl() { - global $wgContLang, $wgRequest, $wgUser; - - $wgContLang = Language::factory( 'tg-latn' ); - $wgRequest->setVal( 'variant', 'tg' ); - $wgUser = User::newFromId( "admin" ); - $wgUser->setId( 1 ); - $wgUser->mFrom = 'defaults'; - $wgUser->mOptionsLoaded = true; - // The user's data is ignored because the variant is set in the URL. - $wgUser->setOption( 'variant', 'tg-latn' ); - $this->assertEquals( 'tg', $this->lc->getPreferredVariant() ); - } - - - public function testGetPreferredVariantDefaultLanguageVariant() { - global $wgDefaultLanguageVariant; - - $wgDefaultLanguageVariant = 'tg-latn'; - $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); - } - - public function testGetPreferredVariantDefaultLanguageVsUrlVariant() { - global $wgDefaultLanguageVariant, $wgRequest, $wgContLang; - - $wgContLang = Language::factory( 'tg-latn' ); - $wgDefaultLanguageVariant = 'tg'; - $wgRequest->setVal( 'variant', null ); - $this->assertEquals( 'tg', $this->lc->getPreferredVariant() ); - } -} - -/** - * Test converter (from Tajiki to latin orthography) - */ -class TestConverter extends LanguageConverter { - private $table = array( - 'б' => 'b', - 'в' => 'v', - 'г' => 'g', - ); - - function loadDefaultTables() { - $this->mTables = array( - 'tg-latn' => new ReplacementArray( $this->table ), - 'tg' => new ReplacementArray() - ); - } -} - -class LanguageToTest extends Language { - function __construct() { - parent::__construct(); - $variants = array( 'tg', 'tg-latn' ); - $this->mConverter = new TestConverter( $this, 'tg', $variants ); - } -} diff --git a/tests/phpunit/includes/LicensesTest.php b/tests/phpunit/includes/LicensesTest.php deleted file mode 100644 index 478a2ffc..00000000 --- a/tests/phpunit/includes/LicensesTest.php +++ /dev/null @@ -1,22 +0,0 @@ - 'FooField', - 'type' => 'select', - 'section' => 'description', - 'id' => 'wpLicense', - 'label' => 'A label text', # Note can't test label-message because $wgOut is not defined - 'name' => 'AnotherName', - 'licenses' => $str, - ) ); - $this->assertThat( $lc, $this->isInstanceOf( 'Licenses' ) ); - } -} diff --git a/tests/phpunit/includes/LinkerTest.php b/tests/phpunit/includes/LinkerTest.php deleted file mode 100644 index b605f08f..00000000 --- a/tests/phpunit/includes/LinkerTest.php +++ /dev/null @@ -1,71 +0,0 @@ -setMwGlobals( array( - 'wgArticlePath' => '/wiki/$1', - 'wgWellFormedXml' => true, - ) ); - - $this->assertEquals( $expected, - Linker::userLink( $userId, $userName, $altUserName, $msg ) - ); - } - - public static function provideCasesForUserLink() { - # Format: - # - expected - # - userid - # - username - # - optional altUserName - # - optional message - return array( - - ### ANONYMOUS USER ######################################## - array( - 'JohnDoe', - 0, 'JohnDoe', false, - ), - array( - '::1', - 0, '::1', false, - 'Anonymous with pretty IPv6' - ), - array( - '::1', - 0, '0:0:0:0:0:0:0:1', false, - 'Anonymous with almost pretty IPv6' - ), - array( - '::1', - 0, '0000:0000:0000:0000:0000:0000:0000:0001', false, - 'Anonymous with full IPv6' - ), - array( - 'AlternativeUsername', - 0, '::1', 'AlternativeUsername', - 'Anonymous with pretty IPv6 and an alternative username' - ), - - # IPV4 - array( - '127.0.0.1', - 0, '127.0.0.1', false, - 'Anonymous with IPv4' - ), - array( - 'AlternativeUsername', - 0, '127.0.0.1', 'AlternativeUsername', - 'Anonymous with IPv4 and an alternative username' - ), - - ### Regular user ########################################## - # TODO! - ); - } -} diff --git a/tests/phpunit/includes/LinksUpdateTest.php b/tests/phpunit/includes/LinksUpdateTest.php deleted file mode 100644 index 5ade250e..00000000 --- a/tests/phpunit/includes/LinksUpdateTest.php +++ /dev/null @@ -1,175 +0,0 @@ -tablesUsed = array_merge( $this->tablesUsed, - array( - 'interwiki', - 'page_props', - 'pagelinks', - 'categorylinks', - 'langlinks', - 'externallinks', - 'imagelinks', - 'templatelinks', - 'iwlinks' - ) - ); - } - - protected function setUp() { - parent::setUp(); - $dbw = wfGetDB( DB_MASTER ); - $dbw->replace( - 'interwiki', - array( 'iw_prefix' ), - array( - 'iw_prefix' => 'linksupdatetest', - 'iw_url' => 'http://testing.com/wiki/$1', - 'iw_api' => 'http://testing.com/w/api.php', - 'iw_local' => 0, - 'iw_trans' => 0, - 'iw_wikiid' => 'linksupdatetest', - ) - ); - } - - protected function makeTitleAndParserOutput( $name, $id ) { - $t = Title::newFromText( $name ); - $t->mArticleID = $id; # XXX: this is fugly - - $po = new ParserOutput(); - $po->setTitleText( $t->getPrefixedText() ); - - return array( $t, $po ); - } - - public function testUpdate_pagelinks() { - list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 ); - - $po->addLink( Title::newFromText( "Foo" ) ); - $po->addLink( Title::newFromText( "Special:Foo" ) ); // special namespace should be ignored - $po->addLink( Title::newFromText( "linksupdatetest:Foo" ) ); // interwiki link should be ignored - $po->addLink( Title::newFromText( "#Foo" ) ); // hash link should be ignored - - $update = $this->assertLinksUpdate( $t, $po, 'pagelinks', 'pl_namespace, pl_title', 'pl_from = 111', array( - array( NS_MAIN, 'Foo' ), - ) ); - $this->assertArrayEquals( array( - Title::makeTitle( NS_MAIN, 'Foo' ), // newFromText doesn't yield the same internal state.... - ), $update->getAddedLinks() ); - - $po = new ParserOutput(); - $po->setTitleText( $t->getPrefixedText() ); - - $po->addLink( Title::newFromText( "Bar" ) ); - $po->addLink( Title::newFromText( "Talk:Bar" ) ); - - $update = $this->assertLinksUpdate( $t, $po, 'pagelinks', 'pl_namespace, pl_title', 'pl_from = 111', array( - array( NS_MAIN, 'Bar' ), - array( NS_TALK, 'Bar' ), - ) ); - $this->assertArrayEquals( array( - Title::makeTitle( NS_MAIN, 'Bar' ), - Title::makeTitle( NS_TALK, 'Bar' ), - ), $update->getAddedLinks() ); - $this->assertArrayEquals( array( - Title::makeTitle( NS_MAIN, 'Foo' ), - ), $update->getRemovedLinks() ); - } - - public function testUpdate_externallinks() { - list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 ); - - $po->addExternalLink( "http://testing.com/wiki/Foo" ); - - $this->assertLinksUpdate( $t, $po, 'externallinks', 'el_to, el_index', 'el_from = 111', array( - array( 'http://testing.com/wiki/Foo', 'http://com.testing./wiki/Foo' ), - ) ); - } - - public function testUpdate_categorylinks() { - $this->setMwGlobals( 'wgCategoryCollation', 'uppercase' ); - - list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 ); - - $po->addCategory( "Foo", "FOO" ); - - $this->assertLinksUpdate( $t, $po, 'categorylinks', 'cl_to, cl_sortkey', 'cl_from = 111', array( - array( 'Foo', "FOO\nTESTING" ), - ) ); - } - - public function testUpdate_iwlinks() { - list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 ); - - $target = Title::makeTitleSafe( NS_MAIN, "Foo", '', 'linksupdatetest' ); - $po->addInterwikiLink( $target ); - - $this->assertLinksUpdate( $t, $po, 'iwlinks', 'iwl_prefix, iwl_title', 'iwl_from = 111', array( - array( 'linksupdatetest', 'Foo' ), - ) ); - } - - public function testUpdate_templatelinks() { - list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 ); - - $po->addTemplate( Title::newFromText( "Template:Foo" ), 23, 42 ); - - $this->assertLinksUpdate( $t, $po, 'templatelinks', 'tl_namespace, tl_title', 'tl_from = 111', array( - array( NS_TEMPLATE, 'Foo' ), - ) ); - } - - public function testUpdate_imagelinks() { - list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 ); - - $po->addImage( "Foo.png" ); - - $this->assertLinksUpdate( $t, $po, 'imagelinks', 'il_to', 'il_from = 111', array( - array( 'Foo.png' ), - ) ); - } - - public function testUpdate_langlinks() { - list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 ); - - $po->addLanguageLink( Title::newFromText( "en:Foo" )->getFullText() ); - - $this->assertLinksUpdate( $t, $po, 'langlinks', 'll_lang, ll_title', 'll_from = 111', array( - array( 'En', 'Foo' ), - ) ); - } - - public function testUpdate_page_props() { - list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 ); - - $po->setProperty( "foo", "bar" ); - - $this->assertLinksUpdate( $t, $po, 'page_props', 'pp_propname, pp_value', 'pp_page = 111', array( - array( 'foo', 'bar' ), - ) ); - } - - // @todo test recursive, too! - - protected function assertLinksUpdate( Title $title, ParserOutput $parserOutput, $table, $fields, $condition, array $expectedRows ) { - $update = new LinksUpdate( $title, $parserOutput ); - - //NOTE: make sure LinksUpdate does not generate warnings when called inside a transaction. - $update->beginTransaction(); - $update->doUpdate(); - $update->commitTransaction(); - - $this->assertSelect( $table, $fields, $condition, $expectedRows ); - return $update; - } -} diff --git a/tests/phpunit/includes/LocalFileTest.php b/tests/phpunit/includes/LocalFileTest.php deleted file mode 100644 index 2501c783..00000000 --- a/tests/phpunit/includes/LocalFileTest.php +++ /dev/null @@ -1,107 +0,0 @@ -setMwGlobals( 'wgCapitalLinks', true ); - - $info = array( - 'name' => 'test', - 'directory' => '/testdir', - 'url' => '/testurl', - 'hashLevels' => 2, - 'transformVia404' => false, - 'backend' => new FSFileBackend( array( - 'name' => 'local-backend', - 'lockManager' => 'fsLockManager', - 'containerPaths' => array( - 'cont1' => "/testdir/local-backend/tempimages/cont1", - 'cont2' => "/testdir/local-backend/tempimages/cont2" - ) - ) ) - ); - $this->repo_hl0 = new LocalRepo( array( 'hashLevels' => 0 ) + $info ); - $this->repo_hl2 = new LocalRepo( array( 'hashLevels' => 2 ) + $info ); - $this->repo_lc = new LocalRepo( array( 'initialCapital' => false ) + $info ); - $this->file_hl0 = $this->repo_hl0->newFile( 'test!' ); - $this->file_hl2 = $this->repo_hl2->newFile( 'test!' ); - $this->file_lc = $this->repo_lc->newFile( 'test!' ); - } - - public function testGetHashPath() { - $this->assertEquals( '', $this->file_hl0->getHashPath() ); - $this->assertEquals( 'a/a2/', $this->file_hl2->getHashPath() ); - $this->assertEquals( 'c/c4/', $this->file_lc->getHashPath() ); - } - - public function testGetRel() { - $this->assertEquals( 'Test!', $this->file_hl0->getRel() ); - $this->assertEquals( 'a/a2/Test!', $this->file_hl2->getRel() ); - $this->assertEquals( 'c/c4/test!', $this->file_lc->getRel() ); - } - - public function testGetUrlRel() { - $this->assertEquals( 'Test%21', $this->file_hl0->getUrlRel() ); - $this->assertEquals( 'a/a2/Test%21', $this->file_hl2->getUrlRel() ); - $this->assertEquals( 'c/c4/test%21', $this->file_lc->getUrlRel() ); - } - - public function testGetArchivePath() { - $this->assertEquals( 'mwstore://local-backend/test-public/archive', $this->file_hl0->getArchivePath() ); - $this->assertEquals( 'mwstore://local-backend/test-public/archive/a/a2', $this->file_hl2->getArchivePath() ); - $this->assertEquals( 'mwstore://local-backend/test-public/archive/!', $this->file_hl0->getArchivePath( '!' ) ); - $this->assertEquals( 'mwstore://local-backend/test-public/archive/a/a2/!', $this->file_hl2->getArchivePath( '!' ) ); - } - - public function testGetThumbPath() { - $this->assertEquals( 'mwstore://local-backend/test-thumb/Test!', $this->file_hl0->getThumbPath() ); - $this->assertEquals( 'mwstore://local-backend/test-thumb/a/a2/Test!', $this->file_hl2->getThumbPath() ); - $this->assertEquals( 'mwstore://local-backend/test-thumb/Test!/x', $this->file_hl0->getThumbPath( 'x' ) ); - $this->assertEquals( 'mwstore://local-backend/test-thumb/a/a2/Test!/x', $this->file_hl2->getThumbPath( 'x' ) ); - } - - public function testGetArchiveUrl() { - $this->assertEquals( '/testurl/archive', $this->file_hl0->getArchiveUrl() ); - $this->assertEquals( '/testurl/archive/a/a2', $this->file_hl2->getArchiveUrl() ); - $this->assertEquals( '/testurl/archive/%21', $this->file_hl0->getArchiveUrl( '!' ) ); - $this->assertEquals( '/testurl/archive/a/a2/%21', $this->file_hl2->getArchiveUrl( '!' ) ); - } - - public function testGetThumbUrl() { - $this->assertEquals( '/testurl/thumb/Test%21', $this->file_hl0->getThumbUrl() ); - $this->assertEquals( '/testurl/thumb/a/a2/Test%21', $this->file_hl2->getThumbUrl() ); - $this->assertEquals( '/testurl/thumb/Test%21/x', $this->file_hl0->getThumbUrl( 'x' ) ); - $this->assertEquals( '/testurl/thumb/a/a2/Test%21/x', $this->file_hl2->getThumbUrl( 'x' ) ); - } - - public function testGetArchiveVirtualUrl() { - $this->assertEquals( 'mwrepo://test/public/archive', $this->file_hl0->getArchiveVirtualUrl() ); - $this->assertEquals( 'mwrepo://test/public/archive/a/a2', $this->file_hl2->getArchiveVirtualUrl() ); - $this->assertEquals( 'mwrepo://test/public/archive/%21', $this->file_hl0->getArchiveVirtualUrl( '!' ) ); - $this->assertEquals( 'mwrepo://test/public/archive/a/a2/%21', $this->file_hl2->getArchiveVirtualUrl( '!' ) ); - } - - public function testGetThumbVirtualUrl() { - $this->assertEquals( 'mwrepo://test/thumb/Test%21', $this->file_hl0->getThumbVirtualUrl() ); - $this->assertEquals( 'mwrepo://test/thumb/a/a2/Test%21', $this->file_hl2->getThumbVirtualUrl() ); - $this->assertEquals( 'mwrepo://test/thumb/Test%21/%21', $this->file_hl0->getThumbVirtualUrl( '!' ) ); - $this->assertEquals( 'mwrepo://test/thumb/a/a2/Test%21/%21', $this->file_hl2->getThumbVirtualUrl( '!' ) ); - } - - public function testGetUrl() { - $this->assertEquals( '/testurl/Test%21', $this->file_hl0->getUrl() ); - $this->assertEquals( '/testurl/a/a2/Test%21', $this->file_hl2->getUrl() ); - } - - public function testWfLocalFile() { - $file = wfLocalFile( "File:Some_file_that_probably_doesn't exist.png" ); - $this->assertThat( $file, $this->isInstanceOf( 'LocalFile' ), 'wfLocalFile() returns LocalFile for valid Titles' ); - } -} diff --git a/tests/phpunit/includes/LocalisationCacheTest.php b/tests/phpunit/includes/LocalisationCacheTest.php deleted file mode 100644 index b34847aa..00000000 --- a/tests/phpunit/includes/LocalisationCacheTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertEquals( - $cache->getItem( 'ar', 'pluralRules' ), - $cache->getItem( 'arz', 'pluralRules' ), - 'arz plural rules (undefined) fallback to ar (defined)' - ); - - $this->assertEquals( - $cache->getItem( 'ar', 'compiledPluralRules' ), - $cache->getItem( 'arz', 'compiledPluralRules' ), - 'arz compiled plural rules (undefined) fallback to ar (defined)' - ); - - $this->assertNotEquals( - $cache->getItem( 'ksh', 'pluralRules' ), - $cache->getItem( 'de', 'pluralRules' ), - 'ksh plural rules (defined) dont fallback to de (defined)' - ); - - $this->assertNotEquals( - $cache->getItem( 'ksh', 'compiledPluralRules' ), - $cache->getItem( 'de', 'compiledPluralRules' ), - 'ksh compiled plural rules (defined) dont fallback to de (defined)' - ); - } -} diff --git a/tests/phpunit/includes/MWExceptionHandlerTest.php b/tests/phpunit/includes/MWExceptionHandlerTest.php deleted file mode 100644 index 987dfa83..00000000 --- a/tests/phpunit/includes/MWExceptionHandlerTest.php +++ /dev/null @@ -1,73 +0,0 @@ -getTrace(); - $hasObject = false; - $hasArray = false; - foreach ( $trace as $frame ) { - if ( ! isset( $frame['args'] ) ) { - continue; - } - foreach ( $frame['args'] as $arg ) { - $hasObject = $hasObject || is_object( $arg ); - $hasArray = $hasArray || is_array( $arg ); - } - - if( $hasObject && $hasArray ) { - break; - } - } - $this->assertTrue( $hasObject, - "The stacktrace must have a function having an object has parameter" ); - $this->assertTrue( $hasArray, - "The stacktrace must have a function having an array has parameter" ); - - # Now we redact the trace.. and make sure no function arguments are - # arrays or objects. - $redacted = MWExceptionHandler::getRedactedTrace( $e ); - - foreach ( $redacted as $frame ) { - if ( ! isset( $frame['args'] ) ) { - continue; - } - foreach ( $frame['args'] as $arg ) { - $this->assertNotInternalType( 'array', $arg); - $this->assertNotInternalType( 'object', $arg); - } - } - } - - /** - * Helper function for testExpandArgumentsInCall - * - * Pass it an object and an array :-) - * - * @throws Exception - */ - protected static function helperThrowAnException( $a, $b ) { - throw new Exception(); - } -} diff --git a/tests/phpunit/includes/MWFunctionTest.php b/tests/phpunit/includes/MWFunctionTest.php deleted file mode 100644 index d86f2c9b..00000000 --- a/tests/phpunit/includes/MWFunctionTest.php +++ /dev/null @@ -1,30 +0,0 @@ -assertEquals( - MWFunction::newObj( 'MWBlankClass', $args )->args, - $newObject->args - ); - } -} - -class MWBlankClass { - - public $args = array(); - - function __construct( $arg1, $arg2, $arg3, $arg4 ) { - $this->args = array( $arg1, $arg2, $arg3, $arg4 ); - } -} - -class ExampleObject { -} diff --git a/tests/phpunit/includes/MWNamespaceTest.php b/tests/phpunit/includes/MWNamespaceTest.php deleted file mode 100644 index 10e9db61..00000000 --- a/tests/phpunit/includes/MWNamespaceTest.php +++ /dev/null @@ -1,571 +0,0 @@ -setMwGlobals( array( - 'wgContentNamespaces' => array( NS_MAIN ), - 'wgNamespacesWithSubpages' => array( - NS_TALK => true, - NS_USER => true, - NS_USER_TALK => true, - ), - 'wgCapitalLinks' => true, - 'wgCapitalLinkOverrides' => array(), - 'wgNonincludableNamespaces' => array(), - ) ); - } - -#### START OF TESTS ######################################################### - - /** - * @todo Write more texts, handle $wgAllowImageMoving setting - */ - public function testIsMovable() { - $this->assertFalse( MWNamespace::isMovable( NS_CATEGORY ) ); - # @todo FIXME: Write more tests!! - } - - /** - * Please make sure to change testIsTalk() if you change the assertions below - */ - public function testIsSubject() { - // Special namespaces - $this->assertIsSubject( NS_MEDIA ); - $this->assertIsSubject( NS_SPECIAL ); - - // Subject pages - $this->assertIsSubject( NS_MAIN ); - $this->assertIsSubject( NS_USER ); - $this->assertIsSubject( 100 ); # user defined - - // Talk pages - $this->assertIsNotSubject( NS_TALK ); - $this->assertIsNotSubject( NS_USER_TALK ); - $this->assertIsNotSubject( 101 ); # user defined - } - - /** - * Reverse of testIsSubject(). - * Please update testIsSubject() if you change assertions below - */ - public function testIsTalk() { - // Special namespaces - $this->assertIsNotTalk( NS_MEDIA ); - $this->assertIsNotTalk( NS_SPECIAL ); - - // Subject pages - $this->assertIsNotTalk( NS_MAIN ); - $this->assertIsNotTalk( NS_USER ); - $this->assertIsNotTalk( 100 ); # user defined - - // Talk pages - $this->assertIsTalk( NS_TALK ); - $this->assertIsTalk( NS_USER_TALK ); - $this->assertIsTalk( 101 ); # user defined - } - - /** - */ - public function testGetSubject() { - // Special namespaces are their own subjects - $this->assertEquals( NS_MEDIA, MWNamespace::getSubject( NS_MEDIA ) ); - $this->assertEquals( NS_SPECIAL, MWNamespace::getSubject( NS_SPECIAL ) ); - - $this->assertEquals( NS_MAIN, MWNamespace::getSubject( NS_TALK ) ); - $this->assertEquals( NS_USER, MWNamespace::getSubject( NS_USER_TALK ) ); - } - - /** - * Regular getTalk() calls - * Namespaces without a talk page (NS_MEDIA, NS_SPECIAL) are tested in - * the function testGetTalkExceptions() - */ - public function testGetTalk() { - $this->assertEquals( NS_TALK, MWNamespace::getTalk( NS_MAIN ) ); - $this->assertEquals( NS_TALK, MWNamespace::getTalk( NS_TALK ) ); - $this->assertEquals( NS_USER_TALK, MWNamespace::getTalk( NS_USER ) ); - $this->assertEquals( NS_USER_TALK, MWNamespace::getTalk( NS_USER_TALK ) ); - } - - /** - * Exceptions with getTalk() - * NS_MEDIA does not have talk pages. MediaWiki raise an exception for them. - * @expectedException MWException - */ - public function testGetTalkExceptionsForNsMedia() { - $this->assertNull( MWNamespace::getTalk( NS_MEDIA ) ); - } - - /** - * Exceptions with getTalk() - * NS_SPECIAL does not have talk pages. MediaWiki raise an exception for them. - * @expectedException MWException - */ - public function testGetTalkExceptionsForNsSpecial() { - $this->assertNull( MWNamespace::getTalk( NS_SPECIAL ) ); - } - - /** - * Regular getAssociated() calls - * Namespaces without an associated page (NS_MEDIA, NS_SPECIAL) are tested in - * the function testGetAssociatedExceptions() - */ - public function testGetAssociated() { - $this->assertEquals( NS_TALK, MWNamespace::getAssociated( NS_MAIN ) ); - $this->assertEquals( NS_MAIN, MWNamespace::getAssociated( NS_TALK ) ); - } - - ### Exceptions with getAssociated() - ### NS_MEDIA and NS_SPECIAL do not have talk pages. MediaWiki raises - ### an exception for them. - /** - * @expectedException MWException - */ - public function testGetAssociatedExceptionsForNsMedia() { - $this->assertNull( MWNamespace::getAssociated( NS_MEDIA ) ); - } - - /** - * @expectedException MWException - */ - public function testGetAssociatedExceptionsForNsSpecial() { - $this->assertNull( MWNamespace::getAssociated( NS_SPECIAL ) ); - } - - /** - * @todo Implement testExists(). - */ - /* - public function testExists() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.' - ); - } - */ - - /** - * Test MWNamespace::equals - * Note if we add a namespace registration system with keys like 'MAIN' - * we should add tests here for equivilance on things like 'MAIN' == 0 - * and 'MAIN' == NS_MAIN. - */ - public function testEquals() { - $this->assertTrue( MWNamespace::equals( NS_MAIN, NS_MAIN ) ); - $this->assertTrue( MWNamespace::equals( NS_MAIN, 0 ) ); // In case we make NS_MAIN 'MAIN' - $this->assertTrue( MWNamespace::equals( NS_USER, NS_USER ) ); - $this->assertTrue( MWNamespace::equals( NS_USER, 2 ) ); - $this->assertTrue( MWNamespace::equals( NS_USER_TALK, NS_USER_TALK ) ); - $this->assertTrue( MWNamespace::equals( NS_SPECIAL, NS_SPECIAL ) ); - $this->assertFalse( MWNamespace::equals( NS_MAIN, NS_TALK ) ); - $this->assertFalse( MWNamespace::equals( NS_USER, NS_USER_TALK ) ); - $this->assertFalse( MWNamespace::equals( NS_PROJECT, NS_TEMPLATE ) ); - } - - /** - * Test MWNamespace::subjectEquals - */ - public function testSubjectEquals() { - $this->assertSameSubject( NS_MAIN, NS_MAIN ); - $this->assertSameSubject( NS_MAIN, 0 ); // In case we make NS_MAIN 'MAIN' - $this->assertSameSubject( NS_USER, NS_USER ); - $this->assertSameSubject( NS_USER, 2 ); - $this->assertSameSubject( NS_USER_TALK, NS_USER_TALK ); - $this->assertSameSubject( NS_SPECIAL, NS_SPECIAL ); - $this->assertSameSubject( NS_MAIN, NS_TALK ); - $this->assertSameSubject( NS_USER, NS_USER_TALK ); - - $this->assertDifferentSubject( NS_PROJECT, NS_TEMPLATE ); - $this->assertDifferentSubject( NS_SPECIAL, NS_MAIN ); - } - - public function testSpecialAndMediaAreDifferentSubjects() { - $this->assertDifferentSubject( - NS_MEDIA, NS_SPECIAL, - "NS_MEDIA and NS_SPECIAL are different subject namespaces" - ); - $this->assertDifferentSubject( - NS_SPECIAL, NS_MEDIA, - "NS_SPECIAL and NS_MEDIA are different subject namespaces" - ); - } - - /** - * @todo Implement testGetCanonicalNamespaces(). - */ - /* - public function testGetCanonicalNamespaces() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.' - ); - } - */ - /** - * @todo Implement testGetCanonicalName(). - */ - /* - public function testGetCanonicalName() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.' - ); - } - */ - /** - * @todo Implement testGetCanonicalIndex(). - */ - /* - public function testGetCanonicalIndex() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.' - ); - } - */ - - /** - * @todo Implement testGetValidNamespaces(). - */ - /* - public function testGetValidNamespaces() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.' - ); - } - */ - - /** - */ - public function testCanTalk() { - $this->assertCanNotTalk( NS_MEDIA ); - $this->assertCanNotTalk( NS_SPECIAL ); - - $this->assertCanTalk( NS_MAIN ); - $this->assertCanTalk( NS_TALK ); - $this->assertCanTalk( NS_USER ); - $this->assertCanTalk( NS_USER_TALK ); - - // User defined namespaces - $this->assertCanTalk( 100 ); - $this->assertCanTalk( 101 ); - } - - /** - */ - public function testIsContent() { - // NS_MAIN is a content namespace per DefaultSettings.php - // and per function definition. - - $this->assertIsContent( NS_MAIN ); - - // Other namespaces which are not expected to be content - - $this->assertIsNotContent( NS_MEDIA ); - $this->assertIsNotContent( NS_SPECIAL ); - $this->assertIsNotContent( NS_TALK ); - $this->assertIsNotContent( NS_USER ); - $this->assertIsNotContent( NS_CATEGORY ); - $this->assertIsNotContent( 100 ); - } - - /** - * Similar to testIsContent() but alters the $wgContentNamespaces - * global variable. - */ - public function testIsContentAdvanced() { - global $wgContentNamespaces; - - // Test that user defined namespace #252 is not content - $this->assertIsNotContent( 252 ); - - // Bless namespace # 252 as a content namespace - $wgContentNamespaces[] = 252; - - $this->assertIsContent( 252 ); - - // Makes sure NS_MAIN was not impacted - $this->assertIsContent( NS_MAIN ); - } - - public function testIsWatchable() { - // Specials namespaces are not watchable - $this->assertIsNotWatchable( NS_MEDIA ); - $this->assertIsNotWatchable( NS_SPECIAL ); - - // Core defined namespaces are watchables - $this->assertIsWatchable( NS_MAIN ); - $this->assertIsWatchable( NS_TALK ); - - // Additional, user defined namespaces are watchables - $this->assertIsWatchable( 100 ); - $this->assertIsWatchable( 101 ); - } - - public function testHasSubpages() { - global $wgNamespacesWithSubpages; - - // Special namespaces: - $this->assertHasNotSubpages( NS_MEDIA ); - $this->assertHasNotSubpages( NS_SPECIAL ); - - // Namespaces without subpages - $this->assertHasNotSubpages( NS_MAIN ); - - $wgNamespacesWithSubpages[NS_MAIN] = true; - $this->assertHasSubpages( NS_MAIN ); - - $wgNamespacesWithSubpages[NS_MAIN] = false; - $this->assertHasNotSubpages( NS_MAIN ); - - // Some namespaces with subpages - $this->assertHasSubpages( NS_TALK ); - $this->assertHasSubpages( NS_USER ); - $this->assertHasSubpages( NS_USER_TALK ); - } - - /** - */ - public function testGetContentNamespaces() { - global $wgContentNamespaces; - - $this->assertEquals( - array( NS_MAIN ), - MWNamespace::getContentNamespaces(), - '$wgContentNamespaces is an array with only NS_MAIN by default' - ); - - # test !is_array( $wgcontentNamespaces ) - $wgContentNamespaces = ''; - $this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() ); - - $wgContentNamespaces = false; - $this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() ); - - $wgContentNamespaces = null; - $this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() ); - - $wgContentNamespaces = 5; - $this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() ); - - # test $wgContentNamespaces === array() - $wgContentNamespaces = array(); - $this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() ); - - # test !in_array( NS_MAIN, $wgContentNamespaces ) - $wgContentNamespaces = array( NS_USER, NS_CATEGORY ); - $this->assertEquals( - array( NS_MAIN, NS_USER, NS_CATEGORY ), - MWNamespace::getContentNamespaces(), - 'NS_MAIN is forced in $wgContentNamespaces even if unwanted' - ); - - # test other cases, return $wgcontentNamespaces as is - $wgContentNamespaces = array( NS_MAIN ); - $this->assertEquals( - array( NS_MAIN ), - MWNamespace::getContentNamespaces() - ); - - $wgContentNamespaces = array( NS_MAIN, NS_USER, NS_CATEGORY ); - $this->assertEquals( - array( NS_MAIN, NS_USER, NS_CATEGORY ), - MWNamespace::getContentNamespaces() - ); - } - - /** - */ - public function testGetSubjectNamespaces() { - $subjectsNS = MWNamespace::getSubjectNamespaces(); - $this->assertContains( NS_MAIN, $subjectsNS, - "Talk namespaces should have NS_MAIN" ); - $this->assertNotContains( NS_TALK, $subjectsNS, - "Talk namespaces should have NS_TALK" ); - - $this->assertNotContains( NS_MEDIA, $subjectsNS, - "Talk namespaces should not have NS_MEDIA" ); - $this->assertNotContains( NS_SPECIAL, $subjectsNS, - "Talk namespaces should not have NS_SPECIAL" ); - } - - /** - */ - public function testGetTalkNamespaces() { - $talkNS = MWNamespace::getTalkNamespaces(); - $this->assertContains( NS_TALK, $talkNS, - "Subject namespaces should have NS_TALK" ); - $this->assertNotContains( NS_MAIN, $talkNS, - "Subject namespaces should not have NS_MAIN" ); - - $this->assertNotContains( NS_MEDIA, $talkNS, - "Subject namespaces should not have NS_MEDIA" ); - $this->assertNotContains( NS_SPECIAL, $talkNS, - "Subject namespaces should not have NS_SPECIAL" ); - } - - /** - * Some namespaces are always capitalized per code definition - * in MWNamespace::$alwaysCapitalizedNamespaces - */ - public function testIsCapitalizedHardcodedAssertions() { - // NS_MEDIA and NS_FILE are treated the same - $this->assertEquals( - MWNamespace::isCapitalized( NS_MEDIA ), - MWNamespace::isCapitalized( NS_FILE ), - 'NS_MEDIA and NS_FILE have same capitalization rendering' - ); - - // Boths are capitalized by default - $this->assertIsCapitalized( NS_MEDIA ); - $this->assertIsCapitalized( NS_FILE ); - - // Always capitalized namespaces - // @see MWNamespace::$alwaysCapitalizedNamespaces - $this->assertIsCapitalized( NS_SPECIAL ); - $this->assertIsCapitalized( NS_USER ); - $this->assertIsCapitalized( NS_MEDIAWIKI ); - } - - /** - * Follows up for testIsCapitalizedHardcodedAssertions() but alter the - * global $wgCapitalLink setting to have extended coverage. - * - * MWNamespace::isCapitalized() rely on two global settings: - * $wgCapitalLinkOverrides = array(); by default - * $wgCapitalLinks = true; by default - * This function test $wgCapitalLinks - * - * Global setting correctness is tested against the NS_PROJECT and - * NS_PROJECT_TALK namespaces since they are not hardcoded nor specials - */ - public function testIsCapitalizedWithWgCapitalLinks() { - global $wgCapitalLinks; - - $this->assertIsCapitalized( NS_PROJECT ); - $this->assertIsCapitalized( NS_PROJECT_TALK ); - - $wgCapitalLinks = false; - - // hardcoded namespaces (see above function) are still capitalized: - $this->assertIsCapitalized( NS_SPECIAL ); - $this->assertIsCapitalized( NS_USER ); - $this->assertIsCapitalized( NS_MEDIAWIKI ); - - // setting is correctly applied - $this->assertIsNotCapitalized( NS_PROJECT ); - $this->assertIsNotCapitalized( NS_PROJECT_TALK ); - } - - /** - * Counter part for MWNamespace::testIsCapitalizedWithWgCapitalLinks() now - * testing the $wgCapitalLinkOverrides global. - * - * @todo split groups of assertions in autonomous testing functions - */ - public function testIsCapitalizedWithWgCapitalLinkOverrides() { - global $wgCapitalLinkOverrides; - - // Test default settings - $this->assertIsCapitalized( NS_PROJECT ); - $this->assertIsCapitalized( NS_PROJECT_TALK ); - - // hardcoded namespaces (see above function) are capitalized: - $this->assertIsCapitalized( NS_SPECIAL ); - $this->assertIsCapitalized( NS_USER ); - $this->assertIsCapitalized( NS_MEDIAWIKI ); - - // Hardcoded namespaces remains capitalized - $wgCapitalLinkOverrides[NS_SPECIAL] = false; - $wgCapitalLinkOverrides[NS_USER] = false; - $wgCapitalLinkOverrides[NS_MEDIAWIKI] = false; - - $this->assertIsCapitalized( NS_SPECIAL ); - $this->assertIsCapitalized( NS_USER ); - $this->assertIsCapitalized( NS_MEDIAWIKI ); - - $wgCapitalLinkOverrides[NS_PROJECT] = false; - $this->assertIsNotCapitalized( NS_PROJECT ); - - $wgCapitalLinkOverrides[NS_PROJECT] = true; - $this->assertIsCapitalized( NS_PROJECT ); - - unset( $wgCapitalLinkOverrides[NS_PROJECT] ); - $this->assertIsCapitalized( NS_PROJECT ); - } - - public function testHasGenderDistinction() { - // Namespaces with gender distinctions - $this->assertTrue( MWNamespace::hasGenderDistinction( NS_USER ) ); - $this->assertTrue( MWNamespace::hasGenderDistinction( NS_USER_TALK ) ); - - // Other ones, "genderless" - $this->assertFalse( MWNamespace::hasGenderDistinction( NS_MEDIA ) ); - $this->assertFalse( MWNamespace::hasGenderDistinction( NS_SPECIAL ) ); - $this->assertFalse( MWNamespace::hasGenderDistinction( NS_MAIN ) ); - $this->assertFalse( MWNamespace::hasGenderDistinction( NS_TALK ) ); - } - - public function testIsNonincludable() { - global $wgNonincludableNamespaces; - - $wgNonincludableNamespaces = array( NS_USER ); - - $this->assertTrue( MWNamespace::isNonincludable( NS_USER ) ); - $this->assertFalse( MWNamespace::isNonincludable( NS_TEMPLATE ) ); - } - - ####### HELPERS ########################################################### - function __call( $method, $args ) { - // Call the real method if it exists - if ( method_exists( $this, $method ) ) { - return $this->$method( $args ); - } - - if ( preg_match( '/^assert(Has|Is|Can)(Not|)(Subject|Talk|Watchable|Content|Subpages|Capitalized)$/', $method, $m ) ) { - # Interprets arguments: - $ns = $args[0]; - $msg = isset( $args[1] ) ? $args[1] : " dummy message"; - - # Forge the namespace constant name: - if ( $ns === 0 ) { - $ns_name = "NS_MAIN"; - } else { - $ns_name = "NS_" . strtoupper( MWNamespace::getCanonicalName( $ns ) ); - } - # ... and the MWNamespace method name - $nsMethod = strtolower( $m[1] ) . $m[3]; - - $expect = ( $m[2] === '' ); - $expect_name = $expect ? 'TRUE' : 'FALSE'; - - return $this->assertEquals( $expect, - MWNamespace::$nsMethod( $ns, $msg ), - "MWNamespace::$nsMethod( $ns_name ) should returns $expect_name" - ); - } - - throw new Exception( __METHOD__ . " could not find a method named $method\n" ); - } - - function assertSameSubject( $ns1, $ns2, $msg = '' ) { - $this->assertTrue( MWNamespace::subjectEquals( $ns1, $ns2, $msg ) ); - } - - function assertDifferentSubject( $ns1, $ns2, $msg = '' ) { - $this->assertFalse( MWNamespace::subjectEquals( $ns1, $ns2, $msg ) ); - } -} diff --git a/tests/phpunit/includes/MessageTest.php b/tests/phpunit/includes/MessageTest.php deleted file mode 100644 index 1e18f975..00000000 --- a/tests/phpunit/includes/MessageTest.php +++ /dev/null @@ -1,130 +0,0 @@ -setMwGlobals( array( - 'wgLang' => Language::factory( 'en' ), - 'wgForceUIMsgAsContentMsg' => array(), - ) ); - } - - public function testExists() { - $this->assertTrue( wfMessage( 'mainpage' )->exists() ); - $this->assertTrue( wfMessage( 'mainpage' )->params( array() )->exists() ); - $this->assertTrue( wfMessage( 'mainpage' )->rawParams( 'foo', 123 )->exists() ); - $this->assertFalse( wfMessage( 'i-dont-exist-evar' )->exists() ); - $this->assertFalse( wfMessage( 'i-dont-exist-evar' )->params( array() )->exists() ); - $this->assertFalse( wfMessage( 'i-dont-exist-evar' )->rawParams( 'foo', 123 )->exists() ); - } - - public function testKey() { - $this->assertInstanceOf( 'Message', wfMessage( 'mainpage' ) ); - $this->assertInstanceOf( 'Message', wfMessage( 'i-dont-exist-evar' ) ); - $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->text() ); - $this->assertEquals( '<i-dont-exist-evar>', wfMessage( 'i-dont-exist-evar' )->text() ); - $this->assertEquals( '', wfMessage( 'i-dont-exist-evar' )->plain() ); - $this->assertEquals( '<i-dont-exist-evar>', wfMessage( 'i-dont-exist-evar' )->escaped() ); - } - - public function testInLanguage() { - $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inLanguage( 'en' )->text() ); - $this->assertEquals( 'Заглавная страница', wfMessage( 'mainpage' )->inLanguage( 'ru' )->text() ); - $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inLanguage( Language::factory( 'en' ) )->text() ); - $this->assertEquals( 'Заглавная страница', wfMessage( 'mainpage' )->inLanguage( Language::factory( 'ru' ) )->text() ); - } - - public function testMessageParams() { - $this->assertEquals( 'Return to $1.', wfMessage( 'returnto' )->text() ); - $this->assertEquals( 'Return to $1.', wfMessage( 'returnto', array() )->text() ); - $this->assertEquals( 'You have foo (bar).', wfMessage( 'youhavenewmessages', 'foo', 'bar' )->text() ); - $this->assertEquals( 'You have foo (bar).', wfMessage( 'youhavenewmessages', array( 'foo', 'bar' ) )->text() ); - } - - public function testMessageParamSubstitution() { - $this->assertEquals( '(Заглавная страница)', wfMessage( 'parentheses', 'Заглавная страница' )->plain() ); - $this->assertEquals( '(Заглавная страница $1)', wfMessage( 'parentheses', 'Заглавная страница $1' )->plain() ); - $this->assertEquals( '(Заглавная страница)', wfMessage( 'parentheses' )->rawParams( 'Заглавная страница' )->plain() ); - $this->assertEquals( '(Заглавная страница $1)', wfMessage( 'parentheses' )->rawParams( 'Заглавная страница $1' )->plain() ); - } - - public function testDeliciouslyManyParams() { - $msg = new RawMessage( '$1$2$3$4$5$6$7$8$9$10$11$12' ); - // One less than above has placeholders - $params = array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k' ); - $this->assertEquals( 'abcdefghijka2', $msg->params( $params )->plain(), 'Params > 9 are replaced correctly' ); - } - - /** - * FIXME: This should not need database, but Language#formatExpiry does (bug 55912) - * @group Database - */ - public function testMessageParamTypes() { - $lang = Language::factory( 'en' ); - - $msg = new RawMessage( '$1' ); - $this->assertEquals( - $lang->formatNum( 123456.789 ), - $msg->inLanguage( $lang )->numParams( 123456.789 )->plain(), - 'numParams is handled correctly' - ); - - $msg = new RawMessage( '$1' ); - $this->assertEquals( - $lang->formatDuration( 1234 ), - $msg->inLanguage( $lang )->durationParams( 1234 )->plain(), - 'durationParams is handled correctly' - ); - - $msg = new RawMessage( '$1' ); - $this->assertEquals( - $lang->formatExpiry( wfTimestampNow() ), - $msg->inLanguage( $lang )->expiryParams( wfTimestampNow() )->plain(), - 'expiryParams is handled correctly' - ); - - $msg = new RawMessage( '$1' ); - $this->assertEquals( - $lang->formatTimePeriod( 1234 ), - $msg->inLanguage( $lang )->timeperiodParams( 1234 )->plain(), - 'timeperiodParams is handled correctly' - ); - - $msg = new RawMessage( '$1' ); - $this->assertEquals( - $lang->formatSize( 123456 ), - $msg->inLanguage( $lang )->sizeParams( 123456 )->plain(), - 'sizeParams is handled correctly' - ); - - $msg = new RawMessage( '$1' ); - $this->assertEquals( - $lang->formatBitrate( 123456 ), - $msg->inLanguage( $lang )->bitrateParams( 123456 )->plain(), - 'bitrateParams is handled correctly' - ); - } - - public function testInContentLanguageDisabled() { - $this->setMwGlobals( 'wgLang', Language::factory( 'fr' ) ); - - $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inContentLanguage()->plain(), 'ForceUIMsg disabled' ); - } - - public function testInContentLanguageEnabled() { - $this->setMwGlobals( array( - 'wgLang' => Language::factory( 'fr' ), - 'wgForceUIMsgAsContentMsg' => array( 'mainpage' ), - ) ); - - $this->assertEquals( 'Accueil', wfMessage( 'mainpage' )->inContentLanguage()->plain(), 'ForceUIMsg enabled' ); - } - - /** - * @expectedException MWException - */ - public function testInLanguageThrows() { - wfMessage( 'foo' )->inLanguage( 123 ); - } -} diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php deleted file mode 100644 index 56bb0fce..00000000 --- a/tests/phpunit/includes/OutputPageTest.php +++ /dev/null @@ -1,133 +0,0 @@ -setMWGlobals( array( - 'wgRequest' => $fauxRequest, - ) ); - - $actualReturn = OutputPage::transformCssMedia( $args['media'] ); - $this->assertSame( $args['expectedReturn'], $actualReturn, $args['message'] ); - } - - /** - * Tests print requests - */ - public function testPrintRequests() { - $this->assertTransformCssMediaCase( array( - 'printableQuery' => '1', - 'media' => 'screen', - 'expectedReturn' => null, - 'message' => 'On printable request, screen returns null' - ) ); - - $this->assertTransformCssMediaCase( array( - 'printableQuery' => '1', - 'media' => self::SCREEN_MEDIA_QUERY, - 'expectedReturn' => null, - 'message' => 'On printable request, screen media query returns null' - ) ); - - $this->assertTransformCssMediaCase( array( - 'printableQuery' => '1', - 'media' => self::SCREEN_ONLY_MEDIA_QUERY, - 'expectedReturn' => null, - 'message' => 'On printable request, screen media query with only returns null' - ) ); - - $this->assertTransformCssMediaCase( array( - 'printableQuery' => '1', - 'media' => 'print', - 'expectedReturn' => '', - 'message' => 'On printable request, media print returns empty string' - ) ); - } - - /** - * Tests screen requests, without either query parameter set - */ - public function testScreenRequests() { - $this->assertTransformCssMediaCase( array( - 'media' => 'screen', - 'expectedReturn' => 'screen', - 'message' => 'On screen request, screen media type is preserved' - ) ); - - $this->assertTransformCssMediaCase( array( - 'media' => 'handheld', - 'expectedReturn' => 'handheld', - 'message' => 'On screen request, handheld media type is preserved' - ) ); - - $this->assertTransformCssMediaCase( array( - 'media' => self::SCREEN_MEDIA_QUERY, - 'expectedReturn' => self::SCREEN_MEDIA_QUERY, - 'message' => 'On screen request, screen media query is preserved.' - ) ); - - $this->assertTransformCssMediaCase( array( - 'media' => self::SCREEN_ONLY_MEDIA_QUERY, - 'expectedReturn' => self::SCREEN_ONLY_MEDIA_QUERY, - 'message' => 'On screen request, screen media query with only is preserved.' - ) ); - - $this->assertTransformCssMediaCase( array( - 'media' => 'print', - 'expectedReturn' => 'print', - 'message' => 'On screen request, print media type is preserved' - ) ); - } - - /** - * Tests handheld behavior - */ - public function testHandheld() { - $this->assertTransformCssMediaCase( array( - 'handheldQuery' => '1', - 'media' => 'handheld', - 'expectedReturn' => '', - 'message' => 'On request with handheld querystring and media is handheld, returns empty string' - ) ); - - $this->assertTransformCssMediaCase( array( - 'handheldQuery' => '1', - 'media' => 'screen', - 'expectedReturn' => null, - 'message' => 'On request with handheld querystring and media is screen, returns null' - ) ); - } -} diff --git a/tests/phpunit/includes/PathRouterTest.php b/tests/phpunit/includes/PathRouterTest.php deleted file mode 100644 index adfb215a..00000000 --- a/tests/phpunit/includes/PathRouterTest.php +++ /dev/null @@ -1,263 +0,0 @@ -add( "/wiki/$1" ); - $this->basicRouter = $router; - } - - /** - * Test basic path parsing - */ - public function testBasic() { - $matches = $this->basicRouter->parse( "/wiki/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo" ) ); - } - - /** - * Test loose path auto-$1 - */ - public function testLoose() { - $router = new PathRouter; - $router->add( "/" ); # Should be the same as "/$1" - $matches = $router->parse( "/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo" ) ); - - $router = new PathRouter; - $router->add( "/wiki" ); # Should be the same as /wiki/$1 - $matches = $router->parse( "/wiki/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo" ) ); - - $router = new PathRouter; - $router->add( "/wiki/" ); # Should be the same as /wiki/$1 - $matches = $router->parse( "/wiki/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo" ) ); - } - - /** - * Test to ensure that path is based on specifity, not order - */ - public function testOrder() { - $router = new PathRouter; - $router->add( "/$1" ); - $router->add( "/a/$1" ); - $router->add( "/b/$1" ); - $matches = $router->parse( "/a/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo" ) ); - - $router = new PathRouter; - $router->add( "/b/$1" ); - $router->add( "/a/$1" ); - $router->add( "/$1" ); - $matches = $router->parse( "/a/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo" ) ); - } - - /** - * Test the handling of key based arrays with a url parameter - */ - public function testKeyParameter() { - $router = new PathRouter; - $router->add( array( 'edit' => "/edit/$1" ), array( 'action' => '$key' ) ); - $matches = $router->parse( "/edit/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo", 'action' => 'edit' ) ); - } - - /** - * Test the handling of $2 inside paths - */ - public function testAdditionalParameter() { - // Basic $2 - $router = new PathRouter; - $router->add( '/$2/$1', array( 'test' => '$2' ) ); - $matches = $router->parse( "/asdf/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo", 'test' => 'asdf' ) ); - } - - /** - * Test additional restricted value parameter - */ - public function testRestrictedValue() { - $router = new PathRouter; - $router->add( '/$2/$1', - array( 'test' => '$2' ), - array( '$2' => array( 'a', 'b' ) ) - ); - $router->add( '/$2/$1', - array( 'test2' => '$2' ), - array( '$2' => 'c' ) - ); - $router->add( '/$1' ); - - $matches = $router->parse( "/asdf/Foo" ); - $this->assertEquals( $matches, array( 'title' => "asdf/Foo" ) ); - - $matches = $router->parse( "/a/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo", 'test' => 'a' ) ); - - $matches = $router->parse( "/c/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo", 'test2' => 'c' ) ); - } - - public function callbackForTest( &$matches, $data ) { - $matches['x'] = $data['$1']; - $matches['foo'] = $data['foo']; - } - - public function testCallback() { - $router = new PathRouter; - $router->add( "/$1", - array( 'a' => 'b', 'data:foo' => 'bar' ), - array( 'callback' => array( $this, 'callbackForTest' ) ) - ); - $matches = $router->parse( '/Foo' ); - $this->assertEquals( $matches, array( - 'title' => "Foo", - 'x' => 'Foo', - 'a' => 'b', - 'foo' => 'bar' - ) ); - } - - /** - * Test to ensure that matches are not made if a parameter expects nonexistent input - */ - public function testFail() { - $router = new PathRouter; - $router->add( "/wiki/$1", array( 'title' => "$1$2" ) ); - $matches = $router->parse( "/wiki/A" ); - $this->assertEquals( array(), $matches ); - } - - /** - * Test to ensure weight of paths is handled correctly - */ - public function testWeight() { - $router = new PathRouter; - $router->addStrict( "/Bar", array( 'ping' => 'pong' ) ); - $router->add( "/asdf-$1", array( 'title' => 'qwerty-$1' ) ); - $router->add( "/$1" ); - $router->add( "/qwerty-$1", array( 'title' => 'asdf-$1' ) ); - $router->addStrict( "/Baz", array( 'marco' => 'polo' ) ); - $router->add( "/a/$1" ); - $router->add( "/asdf/$1" ); - $router->add( "/$2/$1", array( 'unrestricted' => '$2' ) ); - $router->add( array( 'qwerty' => "/qwerty/$1" ), array( 'qwerty' => '$key' ) ); - $router->add( "/$2/$1", array( 'restricted-to-y' => '$2' ), array( '$2' => 'y' ) ); - - foreach ( - array( - '/Foo' => array( 'title' => 'Foo' ), - '/Bar' => array( 'ping' => 'pong' ), - '/Baz' => array( 'marco' => 'polo' ), - '/asdf-foo' => array( 'title' => 'qwerty-foo' ), - '/qwerty-bar' => array( 'title' => 'asdf-bar' ), - '/a/Foo' => array( 'title' => 'Foo' ), - '/asdf/Foo' => array( 'title' => 'Foo' ), - '/qwerty/Foo' => array( 'title' => 'Foo', 'qwerty' => 'qwerty' ), - '/baz/Foo' => array( 'title' => 'Foo', 'unrestricted' => 'baz' ), - '/y/Foo' => array( 'title' => 'Foo', 'restricted-to-y' => 'y' ), - ) as $path => $result - ) { - $this->assertEquals( $router->parse( $path ), $result ); - } - } - - /** - * Make sure the router handles titles like Special:Recentchanges correctly - */ - public function testSpecial() { - $matches = $this->basicRouter->parse( "/wiki/Special:Recentchanges" ); - $this->assertEquals( $matches, array( 'title' => "Special:Recentchanges" ) ); - } - - /** - * Make sure the router decodes urlencoding properly - */ - public function testUrlencoding() { - $matches = $this->basicRouter->parse( "/wiki/Title_With%20Space" ); - $this->assertEquals( $matches, array( 'title' => "Title_With Space" ) ); - } - - public static function provideRegexpChars() { - return array( - array( "$" ), - array( "$1" ), - array( "\\" ), - array( "\\$1" ), - ); - } - - /** - * Make sure the router doesn't break on special characters like $ used in regexp replacements - * @dataProvider provideRegexpChars - */ - public function testRegexpChars( $char ) { - $matches = $this->basicRouter->parse( "/wiki/$char" ); - $this->assertEquals( $matches, array( 'title' => "$char" ) ); - } - - /** - * Make sure the router handles characters like +&() properly - */ - public function testCharacters() { - $matches = $this->basicRouter->parse( "/wiki/Plus+And&Dollar\\Stuff();[]{}*" ); - $this->assertEquals( $matches, array( 'title' => "Plus+And&Dollar\\Stuff();[]{}*" ) ); - } - - /** - * Make sure the router handles unicode characters correctly - * @depends testSpecial - * @depends testUrlencoding - * @depends testCharacters - */ - public function testUnicode() { - $matches = $this->basicRouter->parse( "/wiki/Spécial:Modifications_récentes" ); - $this->assertEquals( $matches, array( 'title' => "Spécial:Modifications_récentes" ) ); - - $matches = $this->basicRouter->parse( "/wiki/Sp%C3%A9cial:Modifications_r%C3%A9centes" ); - $this->assertEquals( $matches, array( 'title' => "Spécial:Modifications_récentes" ) ); - } - - /** - * Ensure the router doesn't choke on long paths. - */ - public function testLength() { - $matches = $this->basicRouter->parse( "/wiki/Lorem_ipsum_dolor_sit_amet,_consectetur_adipisicing_elit,_sed_do_eiusmod_tempor_incididunt_ut_labore_et_dolore_magna_aliqua._Ut_enim_ad_minim_veniam,_quis_nostrud_exercitation_ullamco_laboris_nisi_ut_aliquip_ex_ea_commodo_consequat._Duis_aute_irure_dolor_in_reprehenderit_in_voluptate_velit_esse_cillum_dolore_eu_fugiat_nulla_pariatur._Excepteur_sint_occaecat_cupidatat_non_proident,_sunt_in_culpa_qui_officia_deserunt_mollit_anim_id_est_laborum." ); - $this->assertEquals( $matches, array( 'title' => "Lorem_ipsum_dolor_sit_amet,_consectetur_adipisicing_elit,_sed_do_eiusmod_tempor_incididunt_ut_labore_et_dolore_magna_aliqua._Ut_enim_ad_minim_veniam,_quis_nostrud_exercitation_ullamco_laboris_nisi_ut_aliquip_ex_ea_commodo_consequat._Duis_aute_irure_dolor_in_reprehenderit_in_voluptate_velit_esse_cillum_dolore_eu_fugiat_nulla_pariatur._Excepteur_sint_occaecat_cupidatat_non_proident,_sunt_in_culpa_qui_officia_deserunt_mollit_anim_id_est_laborum." ) ); - } - - - /** - * Ensure that the php passed site of parameter values are not urldecoded - */ - public function testPatternUrlencoding() { - $router = new PathRouter; - $router->add( "/wiki/$1", array( 'title' => '%20:$1' ) ); - $matches = $router->parse( "/wiki/Foo" ); - $this->assertEquals( $matches, array( 'title' => '%20:Foo' ) ); - } - - /** - * Ensure that raw parameter values do not have any variable replacements or urldecoding - */ - public function testRawParamValue() { - $router = new PathRouter; - $router->add( "/wiki/$1", array( 'title' => array( 'value' => 'bar%20$1' ) ) ); - $matches = $router->parse( "/wiki/Foo" ); - $this->assertEquals( $matches, array( 'title' => 'bar%20$1' ) ); - } -} diff --git a/tests/phpunit/includes/PreferencesTest.php b/tests/phpunit/includes/PreferencesTest.php deleted file mode 100644 index 3dec2da0..00000000 --- a/tests/phpunit/includes/PreferencesTest.php +++ /dev/null @@ -1,91 +0,0 @@ -prefUsers['noemail'] = new User; - - $this->prefUsers['notauth'] = new User; - $this->prefUsers['notauth'] - ->setEmail( 'noauth@example.org' ); - - $this->prefUsers['auth'] = new User; - $this->prefUsers['auth'] - ->setEmail( 'noauth@example.org' ); - $this->prefUsers['auth'] - ->setEmailAuthenticationTimestamp( 1330946623 ); - - $this->context = new RequestContext; - $this->context->setTitle( Title::newFromText( 'PreferencesTest' ) ); - } - - protected function setUp() { - parent::setUp(); - - $this->setMwGlobals( array( - 'wgEnableEmail' => true, - 'wgEmailAuthentication' => true, - ) ); - } - - /** - * Placeholder to verify bug 34302 - * @covers Preferences::profilePreferences - */ - public function testEmailFieldsWhenUserHasNoEmail() { - $prefs = $this->prefsFor( 'noemail' ); - $this->assertArrayHasKey( 'cssclass', - $prefs['emailaddress'] - ); - $this->assertEquals( 'mw-email-none', $prefs['emailaddress']['cssclass'] ); - } - - /** - * Placeholder to verify bug 34302 - * @covers Preferences::profilePreferences - */ - public function testEmailFieldsWhenUserEmailNotAuthenticated() { - $prefs = $this->prefsFor( 'notauth' ); - $this->assertArrayHasKey( 'cssclass', - $prefs['emailaddress'] - ); - $this->assertEquals( 'mw-email-not-authenticated', $prefs['emailaddress']['cssclass'] ); - } - - /** - * Placeholder to verify bug 34302 - * @covers Preferences::profilePreferences - */ - public function testEmailFieldsWhenUserEmailIsAuthenticated() { - $prefs = $this->prefsFor( 'auth' ); - $this->assertArrayHasKey( 'cssclass', - $prefs['emailaddress'] - ); - $this->assertEquals( 'mw-email-authenticated', $prefs['emailaddress']['cssclass'] ); - } - - /** Helper */ - protected function prefsFor( $user_key ) { - $preferences = array(); - Preferences::profilePreferences( - $this->prefUsers[$user_key] - , $this->context - , $preferences - ); - - return $preferences; - } -} diff --git a/tests/phpunit/includes/RecentChangeTest.php b/tests/phpunit/includes/RecentChangeTest.php deleted file mode 100644 index cfa3e777..00000000 --- a/tests/phpunit/includes/RecentChangeTest.php +++ /dev/null @@ -1,280 +0,0 @@ -title = Title::newFromText( 'SomeTitle' ); - $this->target = Title::newFromText( 'TestTarget' ); - $this->user = User::newFromName( 'UserName' ); - - $this->user_comment = ''; - $this->context = RequestContext::newExtraneousContext( $this->title ); - } - - /** - * The testIrcMsgForAction* tests are supposed to cover the hacky - * LogFormatter::getIRCActionText / bug 34508 - * - * Third parties bots listen to those messages. They are clever enough - * to fetch the i18n messages from the wiki and then analyze the IRC feed - * to reverse engineer the $1, $2 messages. - * One thing bots can not detect is when MediaWiki change the meaning of - * a message like what happened when we deployed 1.19. $1 became the user - * performing the action which broke basically all bots around. - * - * Should cover the following log actions (which are most commonly used by bots): - * - block/block - * - block/unblock - * - delete/delete - * - delete/restore - * - newusers/create - * - newusers/create2 - * - newusers/autocreate - * - move/move - * - move/move_redir - * - protect/protect - * - protect/modifyprotect - * - protect/unprotect - * - upload/upload - * - * As well as the following Auto Edit Summaries: - * - blank - * - replace - * - rollback - * - undo - */ - - /** - * @covers LogFormatter::getIRCActionText - */ - public function testIrcMsgForLogTypeBlock() { - $sep = $this->context->msg( 'colon-separator' )->text(); - - # block/block - $this->assertIRCComment( - $this->context->msg( 'blocklogentry', 'SomeTitle' )->plain() . $sep . $this->user_comment, - 'block', 'block', - array(), - $this->user_comment - ); - # block/unblock - $this->assertIRCComment( - $this->context->msg( 'unblocklogentry', 'SomeTitle' )->plain() . $sep . $this->user_comment, - 'block', 'unblock', - array(), - $this->user_comment - ); - } - - /** - * @covers LogFormatter::getIRCActionText - */ - public function testIrcMsgForLogTypeDelete() { - $sep = $this->context->msg( 'colon-separator' )->text(); - - # delete/delete - $this->assertIRCComment( - $this->context->msg( 'deletedarticle', 'SomeTitle' )->plain() . $sep . $this->user_comment, - 'delete', 'delete', - array(), - $this->user_comment - ); - - # delete/restore - $this->assertIRCComment( - $this->context->msg( 'undeletedarticle', 'SomeTitle' )->plain() . $sep . $this->user_comment, - 'delete', 'restore', - array(), - $this->user_comment - ); - } - - /** - * @covers LogFormatter::getIRCActionText - */ - public function testIrcMsgForLogTypeNewusers() { - $this->assertIRCComment( - 'New user account', - 'newusers', 'newusers', - array() - ); - $this->assertIRCComment( - 'New user account', - 'newusers', 'create', - array() - ); - $this->assertIRCComment( - 'created new account SomeTitle', - 'newusers', 'create2', - array() - ); - $this->assertIRCComment( - 'Account created automatically', - 'newusers', 'autocreate', - array() - ); - } - - /** - * @covers LogFormatter::getIRCActionText - */ - public function testIrcMsgForLogTypeMove() { - $move_params = array( - '4::target' => $this->target->getPrefixedText(), - '5::noredir' => 0, - ); - $sep = $this->context->msg( 'colon-separator' )->text(); - - # move/move - $this->assertIRCComment( - $this->context->msg( '1movedto2', 'SomeTitle', 'TestTarget' )->plain() . $sep . $this->user_comment, - 'move', 'move', - $move_params, - $this->user_comment - ); - - # move/move_redir - $this->assertIRCComment( - $this->context->msg( '1movedto2_redir', 'SomeTitle', 'TestTarget' )->plain() . $sep . $this->user_comment, - 'move', 'move_redir', - $move_params, - $this->user_comment - ); - } - - /** - * @covers LogFormatter::getIRCActionText - */ - public function testIrcMsgForLogTypePatrol() { - # patrol/patrol - $this->assertIRCComment( - $this->context->msg( 'patrol-log-line', 'revision 777', '[[SomeTitle]]', '' )->plain(), - 'patrol', 'patrol', - array( - '4::curid' => '777', - '5::previd' => '666', - '6::auto' => 0, - ) - ); - } - - /** - * @covers LogFormatter::getIRCActionText - */ - public function testIrcMsgForLogTypeProtect() { - $protectParams = array( - '[edit=sysop] (indefinite) ‎[move=sysop] (indefinite)' - ); - $sep = $this->context->msg( 'colon-separator' )->text(); - - # protect/protect - $this->assertIRCComment( - $this->context->msg( 'protectedarticle', 'SomeTitle ' . $protectParams[0] )->plain() . $sep . $this->user_comment, - 'protect', 'protect', - $protectParams, - $this->user_comment - ); - - # protect/unprotect - $this->assertIRCComment( - $this->context->msg( 'unprotectedarticle', 'SomeTitle' )->plain() . $sep . $this->user_comment, - 'protect', 'unprotect', - array(), - $this->user_comment - ); - - # protect/modify - $this->assertIRCComment( - $this->context->msg( 'modifiedarticleprotection', 'SomeTitle ' . $protectParams[0] )->plain() . $sep . $this->user_comment, - 'protect', 'modify', - $protectParams, - $this->user_comment - ); - } - - /** - * @covers LogFormatter::getIRCActionText - */ - public function testIrcMsgForLogTypeUpload() { - $sep = $this->context->msg( 'colon-separator' )->text(); - - # upload/upload - $this->assertIRCComment( - $this->context->msg( 'uploadedimage', 'SomeTitle' )->plain() . $sep . $this->user_comment, - 'upload', 'upload', - array(), - $this->user_comment - ); - - # upload/overwrite - $this->assertIRCComment( - $this->context->msg( 'overwroteimage', 'SomeTitle' )->plain() . $sep . $this->user_comment, - 'upload', 'overwrite', - array(), - $this->user_comment - ); - } - - /** - * @todo Emulate these edits somehow and extract - * raw edit summary from RecentChange object - * -- - */ - /* - public function testIrcMsgForBlankingAES() { - // $this->context->msg( 'autosumm-blank', .. ); - } - - public function testIrcMsgForReplaceAES() { - // $this->context->msg( 'autosumm-replace', .. ); - } - - public function testIrcMsgForRollbackAES() { - // $this->context->msg( 'revertpage', .. ); - } - - public function testIrcMsgForUndoAES() { - // $this->context->msg( 'undo-summary', .. ); - } - */ - - /** - * @param $expected String Expected IRC text without colors codes - * @param $type String Log type (move, delete, suppress, patrol ...) - * @param $action String A log type action - * @param $params - * @param $comment String (optional) A comment for the log action - * @param $msg String (optional) A message for PHPUnit :-) - */ - protected function assertIRCComment( $expected, $type, $action, $params, $comment = null, $msg = '' ) { - - $logEntry = new ManualLogEntry( $type, $action ); - $logEntry->setPerformer( $this->user ); - $logEntry->setTarget( $this->title ); - if ( $comment !== null ) { - $logEntry->setComment( $comment ); - } - $logEntry->setParameters( $params ); - - $formatter = LogFormatter::newFromEntry( $logEntry ); - $formatter->setContext( $this->context ); - - // Apply the same transformation as done in IRCColourfulRCFeedFormatter::getLine for rc_comment - $ircRcComment = IRCColourfulRCFeedFormatter::cleanupForIRC( $formatter->getIRCActionComment() ); - - $this->assertEquals( - $expected, - $ircRcComment, - $msg - ); - } -} diff --git a/tests/phpunit/includes/RequestContextTest.php b/tests/phpunit/includes/RequestContextTest.php deleted file mode 100644 index 1776b5d5..00000000 --- a/tests/phpunit/includes/RequestContextTest.php +++ /dev/null @@ -1,73 +0,0 @@ -setTitle( $curTitle ); - $this->assertTrue( $curTitle->equals( $context->getWikiPage()->getTitle() ), - "When a title is first set WikiPage should be created on-demand for that title." ); - - $curTitle = Title::newFromText( "B" ); - $context->setWikiPage( WikiPage::factory( $curTitle ) ); - $this->assertTrue( $curTitle->equals( $context->getTitle() ), - "Title must be updated when a new WikiPage is provided." ); - - $curTitle = Title::newFromText( "C" ); - $context->setTitle( $curTitle ); - $this->assertTrue( $curTitle->equals( $context->getWikiPage()->getTitle() ), - "When a title is updated the WikiPage should be purged and recreated on-demand with the new title." ); - } - - /** - * @covers RequestContext::importScopedSession - */ - public function testImportScopedSession() { - $context = RequestContext::getMain(); - - $oInfo = $context->exportSession(); - $this->assertEquals( '127.0.0.1', $oInfo['ip'], "Correct initial IP address." ); - $this->assertEquals( 0, $oInfo['userId'], "Correct initial user ID." ); - - $user = User::newFromName( 'UnitTestContextUser' ); - $user->addToDatabase(); - - $sinfo = array( - 'sessionId' => 'd612ee607c87e749ef14da4983a702cd', - 'userId' => $user->getId(), - 'ip' => '192.0.2.0', - 'headers' => array( 'USER-AGENT' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0' ) - ); - $sc = RequestContext::importScopedSession( $sinfo ); // load new context - - $info = $context->exportSession(); - $this->assertEquals( $sinfo['ip'], $info['ip'], "Correct IP address." ); - $this->assertEquals( $sinfo['headers'], $info['headers'], "Correct headers." ); - $this->assertEquals( $sinfo['sessionId'], $info['sessionId'], "Correct session ID." ); - $this->assertEquals( $sinfo['userId'], $info['userId'], "Correct user ID." ); - $this->assertEquals( $sinfo['ip'], $context->getRequest()->getIP(), "Correct context IP address." ); - $this->assertEquals( $sinfo['headers'], $context->getRequest()->getAllHeaders(), "Correct context headers." ); - $this->assertEquals( $sinfo['sessionId'], session_id(), "Correct context session ID." ); - $this->assertEquals( true, $context->getUser()->isLoggedIn(), "Correct context user." ); - $this->assertEquals( $sinfo['userId'], $context->getUser()->getId(), "Correct context user ID." ); - $this->assertEquals( 'UnitTestContextUser', $context->getUser()->getName(), "Correct context user name." ); - - unset( $sc ); // restore previous context - - $info = $context->exportSession(); - $this->assertEquals( $oInfo['ip'], $info['ip'], "Correct initial IP address." ); - $this->assertEquals( $oInfo['headers'], $info['headers'], "Correct initial headers." ); - $this->assertEquals( $oInfo['sessionId'], $info['sessionId'], "Correct initial session ID." ); - $this->assertEquals( $oInfo['userId'], $info['userId'], "Correct initial user ID." ); - } -} diff --git a/tests/phpunit/includes/ResourceLoaderTest.php b/tests/phpunit/includes/ResourceLoaderTest.php deleted file mode 100644 index ca8b2b6e..00000000 --- a/tests/phpunit/includes/ResourceLoaderTest.php +++ /dev/null @@ -1,149 +0,0 @@ -setMwGlobals( array( - 'wgResourceLoaderLESSFunctions' => array( - 'test-sum' => function ( $frame, $less ) { - $sum = 0; - foreach ( $frame[2] as $arg ) { - $sum += (int)$arg[1]; - } - return $sum; - }, - ), - 'wgResourceLoaderLESSImportPaths' => array( - dirname( __DIR__ ) . '/data/less/common', - ), - 'wgResourceLoaderLESSVars' => array( - 'foo' => '2px', - 'Foo' => '#eeeeee', - 'bar' => 5, - ), - ) ); - } - - /* Hook Methods */ - - /** - * ResourceLoaderRegisterModules hook - */ - public static function resourceLoaderRegisterModules( &$resourceLoader ) { - self::$resourceLoaderRegisterModulesHook = true; - - return true; - } - - /* Provider Methods */ - public static function provideValidModules() { - return array( - array( 'TEST.validModule1', new ResourceLoaderTestModule() ), - ); - } - - public static function provideResourceLoaderContext() { - $resourceLoader = new ResourceLoader(); - $request = new FauxRequest(); - return array( - array( new ResourceLoaderContext( $resourceLoader, $request ) ), - ); - } - - /* Test Methods */ - - /** - * Ensures that the ResourceLoaderRegisterModules hook is called when a new ResourceLoader object is constructed - * @covers ResourceLoader::__construct - */ - public function testCreatingNewResourceLoaderCallsRegistrationHook() { - self::$resourceLoaderRegisterModulesHook = false; - $resourceLoader = new ResourceLoader(); - $this->assertTrue( self::$resourceLoaderRegisterModulesHook ); - - return $resourceLoader; - } - - /** - * @dataProvider provideValidModules - * @depends testCreatingNewResourceLoaderCallsRegistrationHook - * @covers ResourceLoader::register - * @covers ResourceLoader::getModule - */ - public function testRegisteredValidModulesAreAccessible( - $name, ResourceLoaderModule $module, ResourceLoader $resourceLoader - ) { - $resourceLoader->register( $name, $module ); - $this->assertEquals( $module, $resourceLoader->getModule( $name ) ); - } - - /** - * @dataProvider provideResourceLoaderContext - * @covers ResourceLoaderFileModule::compileLessFile - */ - public function testLessFileCompilation( $context ) { - $basePath = __DIR__ . '/../data/less/module'; - $module = new ResourceLoaderFileModule( array( - 'localBasePath' => $basePath, - 'styles' => array( 'styles.less' ), - ) ); - $styles = $module->getStyles( $context ); - $this->assertStringEqualsFile( $basePath . '/styles.css', $styles['all'] ); - } - - /** - * @dataProvider providePackedModules - * @covers ResourceLoader::makePackedModulesString - */ - public function testMakePackedModulesString( $desc, $modules, $packed ) { - $this->assertEquals( $packed, ResourceLoader::makePackedModulesString( $modules ), $desc ); - } - - /** - * @dataProvider providePackedModules - * @covers ResourceLoaderContext::expandModuleNames - */ - public function testexpandModuleNames( $desc, $modules, $packed ) { - $this->assertEquals( $modules, ResourceLoaderContext::expandModuleNames( $packed ), $desc ); - } - - public static function providePackedModules() { - return array( - array( - 'Example from makePackedModulesString doc comment', - array( 'foo.bar', 'foo.baz', 'bar.baz', 'bar.quux' ), - 'foo.bar,baz|bar.baz,quux', - ), - array( - 'Example from expandModuleNames doc comment', - array( 'jquery.foo', 'jquery.bar', 'jquery.ui.baz', 'jquery.ui.quux' ), - 'jquery.foo,bar|jquery.ui.baz,quux', - ), - array( - 'Regression fixed in r88706 with dotless names', - array( 'foo', 'bar', 'baz' ), - 'foo,bar,baz', - ), - array( - 'Prefixless modules after a prefixed module', - array( 'single.module', 'foobar', 'foobaz' ), - 'single.module|foobar,foobaz', - ), - ); - } -} - -/* Stubs */ - -class ResourceLoaderTestModule extends ResourceLoaderModule { -} - -/* Hooks */ -global $wgHooks; -$wgHooks['ResourceLoaderRegisterModules'][] = 'ResourceLoaderTest::resourceLoaderRegisterModules'; diff --git a/tests/phpunit/includes/RevisionStorageTest.php b/tests/phpunit/includes/RevisionStorageTest.php deleted file mode 100644 index e17c7b0f..00000000 --- a/tests/phpunit/includes/RevisionStorageTest.php +++ /dev/null @@ -1,546 +0,0 @@ -tablesUsed = array_merge( $this->tablesUsed, - array( 'page', - 'revision', - 'text', - - 'recentchanges', - 'logging', - - 'page_props', - 'pagelinks', - 'categorylinks', - 'langlinks', - 'externallinks', - 'imagelinks', - 'templatelinks', - 'iwlinks' ) ); - } - - protected function setUp() { - global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang; - - parent::setUp(); - - $wgExtraNamespaces[12312] = 'Dummy'; - $wgExtraNamespaces[12313] = 'Dummy_talk'; - - $wgNamespaceContentModels[12312] = 'DUMMY'; - $wgContentHandlers['DUMMY'] = 'DummyContentHandlerForTesting'; - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - if ( !$this->the_page ) { - $this->the_page = $this->createPage( 'RevisionStorageTest_the_page', "just a dummy page", CONTENT_MODEL_WIKITEXT ); - } - } - - public function tearDown() { - global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang; - - parent::tearDown(); - - unset( $wgExtraNamespaces[12312] ); - unset( $wgExtraNamespaces[12313] ); - - unset( $wgNamespaceContentModels[12312] ); - unset( $wgContentHandlers['DUMMY'] ); - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - } - - protected function makeRevision( $props = null ) { - if ( $props === null ) { - $props = array(); - } - - if ( !isset( $props['content'] ) && !isset( $props['text'] ) ) { - $props['text'] = 'Lorem Ipsum'; - } - - if ( !isset( $props['comment'] ) ) { - $props['comment'] = 'just a test'; - } - - if ( !isset( $props['page'] ) ) { - $props['page'] = $this->the_page->getId(); - } - - $rev = new Revision( $props ); - - $dbw = wfgetDB( DB_MASTER ); - $rev->insertOn( $dbw ); - - return $rev; - } - - protected function createPage( $page, $text, $model = null ) { - if ( is_string( $page ) ) { - if ( !preg_match( '/:/', $page ) && - ( $model === null || $model === CONTENT_MODEL_WIKITEXT ) - ) { - $ns = $this->getDefaultWikitextNS(); - $page = MWNamespace::getCanonicalName( $ns ) . ':' . $page; - } - - $page = Title::newFromText( $page ); - } - - if ( $page instanceof Title ) { - $page = new WikiPage( $page ); - } - - if ( $page->exists() ) { - $page->doDeleteArticle( "done" ); - } - - $content = ContentHandler::makeContent( $text, $page->getTitle(), $model ); - $page->doEditContent( $content, "testing", EDIT_NEW ); - - return $page; - } - - protected function assertRevEquals( Revision $orig, Revision $rev = null ) { - $this->assertNotNull( $rev, 'missing revision' ); - - $this->assertEquals( $orig->getId(), $rev->getId() ); - $this->assertEquals( $orig->getPage(), $rev->getPage() ); - $this->assertEquals( $orig->getTimestamp(), $rev->getTimestamp() ); - $this->assertEquals( $orig->getUser(), $rev->getUser() ); - $this->assertEquals( $orig->getContentModel(), $rev->getContentModel() ); - $this->assertEquals( $orig->getContentFormat(), $rev->getContentFormat() ); - $this->assertEquals( $orig->getSha1(), $rev->getSha1() ); - } - - /** - * @covers Revision::__construct - */ - public function testConstructFromRow() { - $orig = $this->makeRevision(); - - $dbr = wfgetDB( DB_SLAVE ); - $res = $dbr->select( 'revision', '*', array( 'rev_id' => $orig->getId() ) ); - $this->assertTrue( is_object( $res ), 'query failed' ); - - $row = $res->fetchObject(); - $res->free(); - - $rev = new Revision( $row ); - - $this->assertRevEquals( $orig, $rev ); - } - - /** - * @covers Revision::newFromRow - */ - public function testNewFromRow() { - $orig = $this->makeRevision(); - - $dbr = wfgetDB( DB_SLAVE ); - $res = $dbr->select( 'revision', '*', array( 'rev_id' => $orig->getId() ) ); - $this->assertTrue( is_object( $res ), 'query failed' ); - - $row = $res->fetchObject(); - $res->free(); - - $rev = Revision::newFromRow( $row ); - - $this->assertRevEquals( $orig, $rev ); - } - - - /** - * @covers Revision::newFromArchiveRow - */ - public function testNewFromArchiveRow() { - $page = $this->createPage( 'RevisionStorageTest_testNewFromArchiveRow', 'Lorem Ipsum', CONTENT_MODEL_WIKITEXT ); - $orig = $page->getRevision(); - $page->doDeleteArticle( 'test Revision::newFromArchiveRow' ); - - $dbr = wfgetDB( DB_SLAVE ); - $res = $dbr->select( 'archive', '*', array( 'ar_rev_id' => $orig->getId() ) ); - $this->assertTrue( is_object( $res ), 'query failed' ); - - $row = $res->fetchObject(); - $res->free(); - - $rev = Revision::newFromArchiveRow( $row ); - - $this->assertRevEquals( $orig, $rev ); - } - - /** - * @covers Revision::newFromId - */ - public function testNewFromId() { - $orig = $this->makeRevision(); - - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertRevEquals( $orig, $rev ); - } - - /** - * @covers Revision::fetchRevision - */ - public function testFetchRevision() { - $page = $this->createPage( 'RevisionStorageTest_testFetchRevision', 'one', CONTENT_MODEL_WIKITEXT ); - $id1 = $page->getRevision()->getId(); - - $page->doEditContent( new WikitextContent( 'two' ), 'second rev' ); - $id2 = $page->getRevision()->getId(); - - $res = Revision::fetchRevision( $page->getTitle() ); - - #note: order is unspecified - $rows = array(); - while ( ( $row = $res->fetchObject() ) ) { - $rows[$row->rev_id] = $row; - } - - $row = $res->fetchObject(); - $this->assertEquals( 1, count( $rows ), 'expected exactly one revision' ); - $this->assertArrayHasKey( $id2, $rows, 'missing revision with id ' . $id2 ); - } - - /** - * @covers Revision::selectFields - */ - public function testSelectFields() { - global $wgContentHandlerUseDB; - - $fields = Revision::selectFields(); - - $this->assertTrue( in_array( 'rev_id', $fields ), 'missing rev_id in list of fields' ); - $this->assertTrue( in_array( 'rev_page', $fields ), 'missing rev_page in list of fields' ); - $this->assertTrue( in_array( 'rev_timestamp', $fields ), 'missing rev_timestamp in list of fields' ); - $this->assertTrue( in_array( 'rev_user', $fields ), 'missing rev_user in list of fields' ); - - if ( $wgContentHandlerUseDB ) { - $this->assertTrue( in_array( 'rev_content_model', $fields ), - 'missing rev_content_model in list of fields' ); - $this->assertTrue( in_array( 'rev_content_format', $fields ), - 'missing rev_content_format in list of fields' ); - } - } - - /** - * @covers Revision::getPage - */ - public function testGetPage() { - $page = $this->the_page; - - $orig = $this->makeRevision( array( 'page' => $page->getId() ) ); - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertEquals( $page->getId(), $rev->getPage() ); - } - - /** - * @covers Revision::getText - */ - public function testGetText() { - $this->hideDeprecated( 'Revision::getText' ); - - $orig = $this->makeRevision( array( 'text' => 'hello hello.' ) ); - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertEquals( 'hello hello.', $rev->getText() ); - } - - /** - * @covers Revision::getContent - */ - public function testGetContent_failure() { - $rev = new Revision( array( - 'page' => $this->the_page->getId(), - 'content_model' => $this->the_page->getContentModel(), - 'text_id' => 123456789, // not in the test DB - ) ); - - $this->assertNull( $rev->getContent(), - "getContent() should return null if the revision's text blob could not be loaded." ); - - //NOTE: check this twice, once for lazy initialization, and once with the cached value. - $this->assertNull( $rev->getContent(), - "getContent() should return null if the revision's text blob could not be loaded." ); - } - - /** - * @covers Revision::getContent - */ - public function testGetContent() { - $orig = $this->makeRevision( array( 'text' => 'hello hello.' ) ); - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertEquals( 'hello hello.', $rev->getContent()->getNativeData() ); - } - - /** - * @covers Revision::revText - */ - public function testRevText() { - $this->hideDeprecated( 'Revision::revText' ); - $orig = $this->makeRevision( array( 'text' => 'hello hello rev.' ) ); - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertEquals( 'hello hello rev.', $rev->revText() ); - } - - /** - * @covers Revision::getRawText - */ - public function testGetRawText() { - $this->hideDeprecated( 'Revision::getRawText' ); - - $orig = $this->makeRevision( array( 'text' => 'hello hello raw.' ) ); - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertEquals( 'hello hello raw.', $rev->getRawText() ); - } - - /** - * @covers Revision::getContentModel - */ - public function testGetContentModel() { - global $wgContentHandlerUseDB; - - if ( !$wgContentHandlerUseDB ) { - $this->markTestSkipped( '$wgContentHandlerUseDB is disabled' ); - } - - $orig = $this->makeRevision( array( 'text' => 'hello hello.', - 'content_model' => CONTENT_MODEL_JAVASCRIPT ) ); - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContentModel() ); - } - - /** - * @covers Revision::getContentFormat - */ - public function testGetContentFormat() { - global $wgContentHandlerUseDB; - - if ( !$wgContentHandlerUseDB ) { - $this->markTestSkipped( '$wgContentHandlerUseDB is disabled' ); - } - - $orig = $this->makeRevision( array( - 'text' => 'hello hello.', - 'content_model' => CONTENT_MODEL_JAVASCRIPT, - 'content_format' => CONTENT_FORMAT_JAVASCRIPT - ) ); - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertEquals( CONTENT_FORMAT_JAVASCRIPT, $rev->getContentFormat() ); - } - - /** - * @covers Revision::isCurrent - */ - public function testIsCurrent() { - $page = $this->createPage( 'RevisionStorageTest_testIsCurrent', 'Lorem Ipsum', CONTENT_MODEL_WIKITEXT ); - $rev1 = $page->getRevision(); - - # @todo find out if this should be true - # $this->assertTrue( $rev1->isCurrent() ); - - $rev1x = Revision::newFromId( $rev1->getId() ); - $this->assertTrue( $rev1x->isCurrent() ); - - $page->doEditContent( ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ), 'second rev' ); - $rev2 = $page->getRevision(); - - # @todo find out if this should be true - # $this->assertTrue( $rev2->isCurrent() ); - - $rev1x = Revision::newFromId( $rev1->getId() ); - $this->assertFalse( $rev1x->isCurrent() ); - - $rev2x = Revision::newFromId( $rev2->getId() ); - $this->assertTrue( $rev2x->isCurrent() ); - } - - /** - * @covers Revision::getPrevious - */ - public function testGetPrevious() { - $page = $this->createPage( 'RevisionStorageTest_testGetPrevious', 'Lorem Ipsum testGetPrevious', CONTENT_MODEL_WIKITEXT ); - $rev1 = $page->getRevision(); - - $this->assertNull( $rev1->getPrevious() ); - - $page->doEditContent( ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ), - 'second rev testGetPrevious' ); - $rev2 = $page->getRevision(); - - $this->assertNotNull( $rev2->getPrevious() ); - $this->assertEquals( $rev1->getId(), $rev2->getPrevious()->getId() ); - } - - /** - * @covers Revision::getNext - */ - public function testGetNext() { - $page = $this->createPage( 'RevisionStorageTest_testGetNext', 'Lorem Ipsum testGetNext', CONTENT_MODEL_WIKITEXT ); - $rev1 = $page->getRevision(); - - $this->assertNull( $rev1->getNext() ); - - $page->doEditContent( ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ), - 'second rev testGetNext' ); - $rev2 = $page->getRevision(); - - $this->assertNotNull( $rev1->getNext() ); - $this->assertEquals( $rev2->getId(), $rev1->getNext()->getId() ); - } - - /** - * @covers Revision::newNullRevision - */ - public function testNewNullRevision() { - $page = $this->createPage( 'RevisionStorageTest_testNewNullRevision', 'some testing text', CONTENT_MODEL_WIKITEXT ); - $orig = $page->getRevision(); - - $dbw = wfGetDB( DB_MASTER ); - $rev = Revision::newNullRevision( $dbw, $page->getId(), 'a null revision', false ); - - $this->assertNotEquals( $orig->getId(), $rev->getId(), - 'new null revision shold have a different id from the original revision' ); - $this->assertEquals( $orig->getTextId(), $rev->getTextId(), - 'new null revision shold have the same text id as the original revision' ); - $this->assertEquals( 'some testing text', $rev->getContent()->getNativeData() ); - } - - public static function provideUserWasLastToEdit() { - return array( - array( #0 - 3, true, # actually the last edit - ), - array( #1 - 2, true, # not the current edit, but still by this user - ), - array( #2 - 1, false, # edit by another user - ), - array( #3 - 0, false, # first edit, by this user, but another user edited in the mean time - ), - ); - } - - /** - * @dataProvider provideUserWasLastToEdit - */ - public function testUserWasLastToEdit( $sinceIdx, $expectedLast ) { - $userA = User::newFromName( "RevisionStorageTest_userA" ); - $userB = User::newFromName( "RevisionStorageTest_userB" ); - - if ( $userA->getId() === 0 ) { - $userA = User::createNew( $userA->getName() ); - } - - if ( $userB->getId() === 0 ) { - $userB = User::createNew( $userB->getName() ); - } - - $ns = $this->getDefaultWikitextNS(); - - $dbw = wfGetDB( DB_MASTER ); - $revisions = array(); - - // create revisions ----------------------------- - $page = WikiPage::factory( Title::newFromText( - 'RevisionStorageTest_testUserWasLastToEdit', $ns ) ); - - # zero - $revisions[0] = new Revision( array( - 'page' => $page->getId(), - 'title' => $page->getTitle(), // we need the title to determine the page's default content model - 'timestamp' => '20120101000000', - 'user' => $userA->getId(), - 'text' => 'zero', - 'content_model' => CONTENT_MODEL_WIKITEXT, - 'summary' => 'edit zero' - ) ); - $revisions[0]->insertOn( $dbw ); - - # one - $revisions[1] = new Revision( array( - 'page' => $page->getId(), - 'title' => $page->getTitle(), // still need the title, because $page->getId() is 0 (there's no entry in the page table) - 'timestamp' => '20120101000100', - 'user' => $userA->getId(), - 'text' => 'one', - 'content_model' => CONTENT_MODEL_WIKITEXT, - 'summary' => 'edit one' - ) ); - $revisions[1]->insertOn( $dbw ); - - # two - $revisions[2] = new Revision( array( - 'page' => $page->getId(), - 'title' => $page->getTitle(), - 'timestamp' => '20120101000200', - 'user' => $userB->getId(), - 'text' => 'two', - 'content_model' => CONTENT_MODEL_WIKITEXT, - 'summary' => 'edit two' - ) ); - $revisions[2]->insertOn( $dbw ); - - # three - $revisions[3] = new Revision( array( - 'page' => $page->getId(), - 'title' => $page->getTitle(), - 'timestamp' => '20120101000300', - 'user' => $userA->getId(), - 'text' => 'three', - 'content_model' => CONTENT_MODEL_WIKITEXT, - 'summary' => 'edit three' - ) ); - $revisions[3]->insertOn( $dbw ); - - # four - $revisions[4] = new Revision( array( - 'page' => $page->getId(), - 'title' => $page->getTitle(), - 'timestamp' => '20120101000200', - 'user' => $userA->getId(), - 'text' => 'zero', - 'content_model' => CONTENT_MODEL_WIKITEXT, - 'summary' => 'edit four' - ) ); - $revisions[4]->insertOn( $dbw ); - - // test it --------------------------------- - $since = $revisions[$sinceIdx]->getTimestamp(); - - $wasLast = Revision::userWasLastToEdit( $dbw, $page->getId(), $userA->getId(), $since ); - - $this->assertEquals( $expectedLast, $wasLast ); - } -} diff --git a/tests/phpunit/includes/RevisionStorageTest_ContentHandlerUseDB.php b/tests/phpunit/includes/RevisionStorageTest_ContentHandlerUseDB.php deleted file mode 100644 index 4e83e355..00000000 --- a/tests/phpunit/includes/RevisionStorageTest_ContentHandlerUseDB.php +++ /dev/null @@ -1,81 +0,0 @@ -setMwGlobals( 'wgContentHandlerUseDB', false ); - - $dbw = wfGetDB( DB_MASTER ); - - $page_table = $dbw->tableName( 'page' ); - $revision_table = $dbw->tableName( 'revision' ); - $archive_table = $dbw->tableName( 'archive' ); - - if ( $dbw->fieldExists( $page_table, 'page_content_model' ) ) { - $dbw->query( "alter table $page_table drop column page_content_model" ); - $dbw->query( "alter table $revision_table drop column rev_content_model" ); - $dbw->query( "alter table $revision_table drop column rev_content_format" ); - $dbw->query( "alter table $archive_table drop column ar_content_model" ); - $dbw->query( "alter table $archive_table drop column ar_content_format" ); - } - - parent::setUp(); - } - - /** - * @covers Revision::selectFields - */ - public function testSelectFields() { - $fields = Revision::selectFields(); - - $this->assertTrue( in_array( 'rev_id', $fields ), 'missing rev_id in list of fields' ); - $this->assertTrue( in_array( 'rev_page', $fields ), 'missing rev_page in list of fields' ); - $this->assertTrue( in_array( 'rev_timestamp', $fields ), 'missing rev_timestamp in list of fields' ); - $this->assertTrue( in_array( 'rev_user', $fields ), 'missing rev_user in list of fields' ); - - $this->assertFalse( in_array( 'rev_content_model', $fields ), 'missing rev_content_model in list of fields' ); - $this->assertFalse( in_array( 'rev_content_format', $fields ), 'missing rev_content_format in list of fields' ); - } - - /** - * @covers Revision::getContentModel - */ - public function testGetContentModel() { - try { - $this->makeRevision( array( 'text' => 'hello hello.', - 'content_model' => CONTENT_MODEL_JAVASCRIPT ) ); - - $this->fail( "Creating JavaScript content on a wikitext page should fail with " - . "\$wgContentHandlerUseDB disabled" ); - } catch ( MWException $ex ) { - $this->assertTrue( true ); // ok - } - } - - - /** - * @covers Revision::getContentFormat - */ - public function testGetContentFormat() { - try { - // @todo change this to test failure on using a non-standard (but supported) format - // for a content model supported in the given location. As of 1.21, there are - // no alternative formats for any of the standard content models that could be - // used for this though. - - $this->makeRevision( array( 'text' => 'hello hello.', - 'content_model' => CONTENT_MODEL_JAVASCRIPT, - 'content_format' => 'text/javascript' ) ); - - $this->fail( "Creating JavaScript content on a wikitext page should fail with " - . "\$wgContentHandlerUseDB disabled" ); - } catch ( MWException $ex ) { - $this->assertTrue( true ); // ok - } - } -} diff --git a/tests/phpunit/includes/RevisionTest.php b/tests/phpunit/includes/RevisionTest.php deleted file mode 100644 index b5819ff6..00000000 --- a/tests/phpunit/includes/RevisionTest.php +++ /dev/null @@ -1,481 +0,0 @@ -setMwGlobals( array( - 'wgContLang' => Language::factory( 'en' ), - 'wgLanguageCode' => 'en', - 'wgLegacyEncoding' => false, - 'wgCompressRevisions' => false, - - 'wgContentHandlerTextFallback' => 'ignore', - ) ); - - $this->mergeMwGlobalArrayValue( - 'wgExtraNamespaces', - array( - 12312 => 'Dummy', - 12313 => 'Dummy_talk', - ) - ); - - $this->mergeMwGlobalArrayValue( - 'wgNamespaceContentModels', - array( - 12312 => 'testing', - ) - ); - - $this->mergeMwGlobalArrayValue( - 'wgContentHandlers', - array( - 'testing' => 'DummyContentHandlerForTesting', - 'RevisionTestModifyableContent' => 'RevisionTestModifyableContentHandler', - ) - ); - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - } - - function tearDown() { - global $wgContLang; - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - - parent::tearDown(); - } - - /** - * @covers Revision::getRevisionText - */ - public function testGetRevisionText() { - $row = new stdClass; - $row->old_flags = ''; - $row->old_text = 'This is a bunch of revision text.'; - $this->assertEquals( - 'This is a bunch of revision text.', - Revision::getRevisionText( $row ) ); - } - - /** - * @covers Revision::getRevisionText - */ - public function testGetRevisionTextGzip() { - $this->checkPHPExtension( 'zlib' ); - - $row = new stdClass; - $row->old_flags = 'gzip'; - $row->old_text = gzdeflate( 'This is a bunch of revision text.' ); - $this->assertEquals( - 'This is a bunch of revision text.', - Revision::getRevisionText( $row ) ); - } - - /** - * @covers Revision::getRevisionText - */ - public function testGetRevisionTextUtf8Native() { - $row = new stdClass; - $row->old_flags = 'utf-8'; - $row->old_text = "Wiki est l'\xc3\xa9cole superieur !"; - $GLOBALS['wgLegacyEncoding'] = 'iso-8859-1'; - $this->assertEquals( - "Wiki est l'\xc3\xa9cole superieur !", - Revision::getRevisionText( $row ) ); - } - - /** - * @covers Revision::getRevisionText - */ - public function testGetRevisionTextUtf8Legacy() { - $row = new stdClass; - $row->old_flags = ''; - $row->old_text = "Wiki est l'\xe9cole superieur !"; - $GLOBALS['wgLegacyEncoding'] = 'iso-8859-1'; - $this->assertEquals( - "Wiki est l'\xc3\xa9cole superieur !", - Revision::getRevisionText( $row ) ); - } - - /** - * @covers Revision::getRevisionText - */ - public function testGetRevisionTextUtf8NativeGzip() { - $this->checkPHPExtension( 'zlib' ); - - $row = new stdClass; - $row->old_flags = 'gzip,utf-8'; - $row->old_text = gzdeflate( "Wiki est l'\xc3\xa9cole superieur !" ); - $GLOBALS['wgLegacyEncoding'] = 'iso-8859-1'; - $this->assertEquals( - "Wiki est l'\xc3\xa9cole superieur !", - Revision::getRevisionText( $row ) ); - } - - /** - * @covers Revision::getRevisionText - */ - public function testGetRevisionTextUtf8LegacyGzip() { - $this->checkPHPExtension( 'zlib' ); - - $row = new stdClass; - $row->old_flags = 'gzip'; - $row->old_text = gzdeflate( "Wiki est l'\xe9cole superieur !" ); - $GLOBALS['wgLegacyEncoding'] = 'iso-8859-1'; - $this->assertEquals( - "Wiki est l'\xc3\xa9cole superieur !", - Revision::getRevisionText( $row ) ); - } - - /** - * @covers Revision::compressRevisionText - */ - public function testCompressRevisionTextUtf8() { - $row = new stdClass; - $row->old_text = "Wiki est l'\xc3\xa9cole superieur !"; - $row->old_flags = Revision::compressRevisionText( $row->old_text ); - $this->assertTrue( false !== strpos( $row->old_flags, 'utf-8' ), - "Flags should contain 'utf-8'" ); - $this->assertFalse( false !== strpos( $row->old_flags, 'gzip' ), - "Flags should not contain 'gzip'" ); - $this->assertEquals( "Wiki est l'\xc3\xa9cole superieur !", - $row->old_text, "Direct check" ); - $this->assertEquals( "Wiki est l'\xc3\xa9cole superieur !", - Revision::getRevisionText( $row ), "getRevisionText" ); - } - - /** - * @covers Revision::compressRevisionText - */ - public function testCompressRevisionTextUtf8Gzip() { - $this->checkPHPExtension( 'zlib' ); - $this->setMwGlobals( 'wgCompressRevisions', true ); - - $row = new stdClass; - $row->old_text = "Wiki est l'\xc3\xa9cole superieur !"; - $row->old_flags = Revision::compressRevisionText( $row->old_text ); - $this->assertTrue( false !== strpos( $row->old_flags, 'utf-8' ), - "Flags should contain 'utf-8'" ); - $this->assertTrue( false !== strpos( $row->old_flags, 'gzip' ), - "Flags should contain 'gzip'" ); - $this->assertEquals( "Wiki est l'\xc3\xa9cole superieur !", - gzinflate( $row->old_text ), "Direct check" ); - $this->assertEquals( "Wiki est l'\xc3\xa9cole superieur !", - Revision::getRevisionText( $row ), "getRevisionText" ); - } - - # ================================================================================================================= - - /** - * @param string $text - * @param string $title - * @param string $model - * @param null $format - * - * @return Revision - */ - function newTestRevision( $text, $title = "Test", $model = CONTENT_MODEL_WIKITEXT, $format = null ) { - if ( is_string( $title ) ) { - $title = Title::newFromText( $title ); - } - - $content = ContentHandler::makeContent( $text, $title, $model, $format ); - - $rev = new Revision( - array( - 'id' => 42, - 'page' => 23, - 'title' => $title, - - 'content' => $content, - 'length' => $content->getSize(), - 'comment' => "testing", - 'minor_edit' => false, - - 'content_format' => $format, - ) - ); - - return $rev; - } - - function dataGetContentModel() { - //NOTE: we expect the help namespace to always contain wikitext - return array( - array( 'hello world', 'Help:Hello', null, null, CONTENT_MODEL_WIKITEXT ), - array( 'hello world', 'User:hello/there.css', null, null, CONTENT_MODEL_CSS ), - array( serialize( 'hello world' ), 'Dummy:Hello', null, null, "testing" ), - ); - } - - /** - * @group Database - * @dataProvider dataGetContentModel - * @covers Revision::getContentModel - */ - public function testGetContentModel( $text, $title, $model, $format, $expectedModel ) { - $rev = $this->newTestRevision( $text, $title, $model, $format ); - - $this->assertEquals( $expectedModel, $rev->getContentModel() ); - } - - function dataGetContentFormat() { - //NOTE: we expect the help namespace to always contain wikitext - return array( - array( 'hello world', 'Help:Hello', null, null, CONTENT_FORMAT_WIKITEXT ), - array( 'hello world', 'Help:Hello', CONTENT_MODEL_CSS, null, CONTENT_FORMAT_CSS ), - array( 'hello world', 'User:hello/there.css', null, null, CONTENT_FORMAT_CSS ), - array( serialize( 'hello world' ), 'Dummy:Hello', null, null, "testing" ), - ); - } - - /** - * @group Database - * @dataProvider dataGetContentFormat - * @covers Revision::getContentFormat - */ - public function testGetContentFormat( $text, $title, $model, $format, $expectedFormat ) { - $rev = $this->newTestRevision( $text, $title, $model, $format ); - - $this->assertEquals( $expectedFormat, $rev->getContentFormat() ); - } - - function dataGetContentHandler() { - //NOTE: we expect the help namespace to always contain wikitext - return array( - array( 'hello world', 'Help:Hello', null, null, 'WikitextContentHandler' ), - array( 'hello world', 'User:hello/there.css', null, null, 'CssContentHandler' ), - array( serialize( 'hello world' ), 'Dummy:Hello', null, null, 'DummyContentHandlerForTesting' ), - ); - } - - /** - * @group Database - * @dataProvider dataGetContentHandler - * @covers Revision::getContentHandler - */ - public function testGetContentHandler( $text, $title, $model, $format, $expectedClass ) { - $rev = $this->newTestRevision( $text, $title, $model, $format ); - - $this->assertEquals( $expectedClass, get_class( $rev->getContentHandler() ) ); - } - - function dataGetContent() { - //NOTE: we expect the help namespace to always contain wikitext - return array( - array( 'hello world', 'Help:Hello', null, null, Revision::FOR_PUBLIC, 'hello world' ), - array( serialize( 'hello world' ), 'Hello', "testing", null, Revision::FOR_PUBLIC, serialize( 'hello world' ) ), - array( serialize( 'hello world' ), 'Dummy:Hello', null, null, Revision::FOR_PUBLIC, serialize( 'hello world' ) ), - ); - } - - /** - * @group Database - * @dataProvider dataGetContent - * @covers Revision::getContent - */ - public function testGetContent( $text, $title, $model, $format, $audience, $expectedSerialization ) { - $rev = $this->newTestRevision( $text, $title, $model, $format ); - $content = $rev->getContent( $audience ); - - $this->assertEquals( $expectedSerialization, is_null( $content ) ? null : $content->serialize( $format ) ); - } - - function dataGetText() { - //NOTE: we expect the help namespace to always contain wikitext - return array( - array( 'hello world', 'Help:Hello', null, null, Revision::FOR_PUBLIC, 'hello world' ), - array( serialize( 'hello world' ), 'Hello', "testing", null, Revision::FOR_PUBLIC, null ), - array( serialize( 'hello world' ), 'Dummy:Hello', null, null, Revision::FOR_PUBLIC, null ), - ); - } - - /** - * @group Database - * @dataProvider dataGetText - * @covers Revision::getText - */ - public function testGetText( $text, $title, $model, $format, $audience, $expectedText ) { - $this->hideDeprecated( 'Revision::getText' ); - - $rev = $this->newTestRevision( $text, $title, $model, $format ); - - $this->assertEquals( $expectedText, $rev->getText( $audience ) ); - } - - /** - * @group Database - * @dataProvider dataGetText - * @covers Revision::getRawText - */ - public function testGetRawText( $text, $title, $model, $format, $audience, $expectedText ) { - $this->hideDeprecated( 'Revision::getRawText' ); - - $rev = $this->newTestRevision( $text, $title, $model, $format ); - - $this->assertEquals( $expectedText, $rev->getRawText( $audience ) ); - } - - - public function dataGetSize() { - return array( - array( "hello world.", CONTENT_MODEL_WIKITEXT, 12 ), - array( serialize( "hello world." ), "testing", 12 ), - ); - } - - /** - * @covers Revision::getSize - * @group Database - * @dataProvider dataGetSize - */ - public function testGetSize( $text, $model, $expected_size ) { - $rev = $this->newTestRevision( $text, 'RevisionTest_testGetSize', $model ); - $this->assertEquals( $expected_size, $rev->getSize() ); - } - - public function dataGetSha1() { - return array( - array( "hello world.", CONTENT_MODEL_WIKITEXT, Revision::base36Sha1( "hello world." ) ), - array( serialize( "hello world." ), "testing", Revision::base36Sha1( serialize( "hello world." ) ) ), - ); - } - - /** - * @covers Revision::getSha1 - * @group Database - * @dataProvider dataGetSha1 - */ - public function testGetSha1( $text, $model, $expected_hash ) { - $rev = $this->newTestRevision( $text, 'RevisionTest_testGetSha1', $model ); - $this->assertEquals( $expected_hash, $rev->getSha1() ); - } - - /** - * @covers Revision::__construct - */ - public function testConstructWithText() { - $this->hideDeprecated( "Revision::getText" ); - - $rev = new Revision( array( - 'text' => 'hello world.', - 'content_model' => CONTENT_MODEL_JAVASCRIPT - ) ); - - $this->assertNotNull( $rev->getText(), 'no content text' ); - $this->assertNotNull( $rev->getContent(), 'no content object available' ); - $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContent()->getModel() ); - $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContentModel() ); - } - - /** - * @covers Revision::__construct - */ - public function testConstructWithContent() { - $this->hideDeprecated( "Revision::getText" ); - - $title = Title::newFromText( 'RevisionTest_testConstructWithContent' ); - - $rev = new Revision( array( - 'content' => ContentHandler::makeContent( 'hello world.', $title, CONTENT_MODEL_JAVASCRIPT ), - ) ); - - $this->assertNotNull( $rev->getText(), 'no content text' ); - $this->assertNotNull( $rev->getContent(), 'no content object available' ); - $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContent()->getModel() ); - $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContentModel() ); - } - - /** - * Tests whether $rev->getContent() returns a clone when needed. - * - * @group Database - * @covers Revision::getContent - */ - public function testGetContentClone() { - $content = new RevisionTestModifyableContent( "foo" ); - - $rev = new Revision( - array( - 'id' => 42, - 'page' => 23, - 'title' => Title::newFromText( "testGetContentClone_dummy" ), - - 'content' => $content, - 'length' => $content->getSize(), - 'comment' => "testing", - 'minor_edit' => false, - ) - ); - - $content = $rev->getContent( Revision::RAW ); - $content->setText( "bar" ); - - $content2 = $rev->getContent( Revision::RAW ); - $this->assertNotSame( $content, $content2, "expected a clone" ); // content is mutable, expect clone - $this->assertEquals( "foo", $content2->getText() ); // clone should contain the original text - - $content2->setText( "bla bla" ); - $this->assertEquals( "bar", $content->getText() ); // clones should be independent - } - - - /** - * Tests whether $rev->getContent() returns the same object repeatedly if appropriate. - * - * @group Database - * @covers Revision::getContent - */ - public function testGetContentUncloned() { - $rev = $this->newTestRevision( "hello", "testGetContentUncloned_dummy", CONTENT_MODEL_WIKITEXT ); - $content = $rev->getContent( Revision::RAW ); - $content2 = $rev->getContent( Revision::RAW ); - - // for immutable content like wikitext, this should be the same object - $this->assertSame( $content, $content2 ); - } -} - -class RevisionTestModifyableContent extends TextContent { - public function __construct( $text ) { - parent::__construct( $text, "RevisionTestModifyableContent" ); - } - - public function copy() { - return new RevisionTestModifyableContent( $this->mText ); - } - - public function getText() { - return $this->mText; - } - - public function setText( $text ) { - $this->mText = $text; - } -} - -class RevisionTestModifyableContentHandler extends TextContentHandler { - - public function __construct() { - parent::__construct( "RevisionTestModifyableContent", array( CONTENT_FORMAT_TEXT ) ); - } - - public function unserializeContent( $text, $format = null ) { - $this->checkFormat( $format ); - - return new RevisionTestModifyableContent( $text ); - } - - public function makeEmptyContent() { - return new RevisionTestModifyableContent( '' ); - } -} diff --git a/tests/phpunit/includes/SampleTest.php b/tests/phpunit/includes/SampleTest.php deleted file mode 100644 index 8516a4ce..00000000 --- a/tests/phpunit/includes/SampleTest.php +++ /dev/null @@ -1,105 +0,0 @@ -setMwGlobals( array( - 'wgContLang' => Language::factory( 'en' ), - 'wgLanguageCode' => 'en', - ) ); - } - - /** - * Anything cleanup you need to do should go here. - */ - protected function tearDown() { - parent::tearDown(); - } - - /** - * Name tests so that PHPUnit can turn them into sentences when - * they run. While MediaWiki isn't strictly an Agile Programming - * project, you are encouraged to use the naming described under - * "Agile Documentation" at - * http://www.phpunit.de/manual/3.4/en/other-uses-for-tests.html - */ - public function testTitleObjectStringConversion() { - $title = Title::newFromText( "text" ); - $this->assertInstanceOf( 'Title', $title, "Title creation" ); - $this->assertEquals( "Text", $title, "Automatic string conversion" ); - - $title = Title::newFromText( "text", NS_MEDIA ); - $this->assertEquals( "Media:Text", $title, "Title creation with namespace" ); - } - - /** - * If you want to run a the same test with a variety of data. use a data provider. - * see: http://www.phpunit.de/manual/3.4/en/writing-tests-for-phpunit.html - * - * Note: Data providers are always called statically and outside setUp/tearDown! - */ - public static function provideTitles() { - return array( - array( 'Text', NS_MEDIA, 'Media:Text' ), - array( 'Text', null, 'Text' ), - array( 'text', null, 'Text' ), - array( 'Text', NS_USER, 'User:Text' ), - array( 'Photo.jpg', NS_FILE, 'File:Photo.jpg' ) - ); - } - - /** - * @dataProvider provideTitles - * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.dataProvider - */ - public function testCreateBasicListOfTitles( $titleName, $ns, $text ) { - $title = Title::newFromText( $titleName, $ns ); - $this->assertEquals( $text, "$title", "see if '$titleName' matches '$text'" ); - } - - public function testSetUpMainPageTitleForNextTest() { - $title = Title::newMainPage(); - $this->assertEquals( "Main Page", "$title", "Test initial creation of a title" ); - - return $title; - } - - /** - * Instead of putting a bunch of tests in a single test method, - * you should put only one or two tests in each test method. This - * way, the test method names can remain descriptive. - * - * If you want to make tests depend on data created in another - * method, you can create dependencies feed whatever you return - * from the dependant method (e.g. testInitialCreation in this - * example) as arguments to the next method (e.g. $title in - * testTitleDepends is whatever testInitialCreatiion returned.) - */ - - /** - * @depends testSetUpMainPageTitleForNextTest - * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.depends - */ - public function testCheckMainPageTitleIsConsideredLocal( $title ) { - $this->assertTrue( $title->isLocal() ); - } - - /** - * @expectedException MWException object - * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.expectedException - */ - public function testTitleObjectFromObject() { - $title = Title::newFromText( Title::newFromText( "test" ) ); - $this->assertEquals( "Test", $title->isLocal() ); - } -} diff --git a/tests/phpunit/includes/SanitizerTest.php b/tests/phpunit/includes/SanitizerTest.php deleted file mode 100644 index 81246d33..00000000 --- a/tests/phpunit/includes/SanitizerTest.php +++ /dev/null @@ -1,302 +0,0 @@ -assertEquals( - "\xc3\xa9cole", - Sanitizer::decodeCharReferences( 'école' ), - 'decode named entities' - ); - } - - /** - * @covers Sanitizer::decodeCharReferences - */ - public function testDecodeNumericEntities() { - $this->assertEquals( - "\xc4\x88io bonas dans l'\xc3\xa9cole!", - Sanitizer::decodeCharReferences( "Ĉio bonas dans l'école!" ), - 'decode numeric entities' - ); - } - - /** - * @covers Sanitizer::decodeCharReferences - */ - public function testDecodeMixedEntities() { - $this->assertEquals( - "\xc4\x88io bonas dans l'\xc3\xa9cole!", - Sanitizer::decodeCharReferences( "Ĉio bonas dans l'école!" ), - 'decode mixed numeric/named entities' - ); - } - - /** - * @covers Sanitizer::decodeCharReferences - */ - public function testDecodeMixedComplexEntities() { - $this->assertEquals( - "\xc4\x88io bonas dans l'\xc3\xa9cole! (mais pas Ĉio dans l'école)", - Sanitizer::decodeCharReferences( - "Ĉio bonas dans l'école! (mais pas &#x108;io dans l'&eacute;cole)" - ), - 'decode mixed complex entities' - ); - } - - /** - * @covers Sanitizer::decodeCharReferences - */ - public function testInvalidAmpersand() { - $this->assertEquals( - 'a & b', - Sanitizer::decodeCharReferences( 'a & b' ), - 'Invalid ampersand' - ); - } - - /** - * @covers Sanitizer::decodeCharReferences - */ - public function testInvalidEntities() { - $this->assertEquals( - '&foo;', - Sanitizer::decodeCharReferences( '&foo;' ), - 'Invalid named entity' - ); - } - - /** - * @covers Sanitizer::decodeCharReferences - */ - public function testInvalidNumberedEntities() { - $this->assertEquals( UTF8_REPLACEMENT, Sanitizer::decodeCharReferences( "�" ), 'Invalid numbered entity' ); - } - - /** - * @covers Sanitizer::removeHTMLtags - * @dataProvider provideHtml5Tags - * - * @param String $tag Name of an HTML5 element (ie: 'video') - * @param Boolean $escaped Wheter sanitizer let the tag in or escape it (ie: '<video>') - */ - public function testRemovehtmltagsOnHtml5Tags( $tag, $escaped ) { - $this->setMwGlobals( array( - 'wgUseTidy' => false - ) ); - - if ( $escaped ) { - $this->assertEquals( "<$tag>", - Sanitizer::removeHTMLtags( "<$tag>" ) - ); - } else { - $this->assertEquals( "<$tag>\n", - Sanitizer::removeHTMLtags( "<$tag>" ) - ); - } - } - - /** - * Provide HTML5 tags - */ - public static function provideHtml5Tags() { - $ESCAPED = true; # We want tag to be escaped - $VERBATIM = false; # We want to keep the tag - return array( - array( 'data', $VERBATIM ), - array( 'mark', $VERBATIM ), - array( 'time', $VERBATIM ), - array( 'video', $ESCAPED ), - ); - } - - function dataRemoveHTMLtags() { - return array( - // former testSelfClosingTag - array( - '
        Hello world
        ', - '
        Hello world
        ', - 'Self-closing closing div' - ), - // Make sure special nested HTML5 semantics are not broken - // http://www.whatwg.org/html/text-level-semantics.html#the-kbd-element - array( - 'Shift+F3', - 'Shift+F3', - 'Nested .' - ), - // http://www.whatwg.org/html/text-level-semantics.html#the-sub-and-sup-elements - array( - 'xi, yi', - 'xi, yi', - 'Nested .' - ), - // http://www.whatwg.org/html/text-level-semantics.html#the-dfn-element - array( - 'GDO', - 'GDO', - ' inside ', - ), - ); - } - - /** - * @dataProvider dataRemoveHTMLtags - * @covers Sanitizer::removeHTMLtags - */ - public function testRemoveHTMLtags( $input, $output, $msg = null ) { - $GLOBALS['wgUseTidy'] = false; - $this->assertEquals( $output, Sanitizer::removeHTMLtags( $input ), $msg ); - } - - /** - * @dataProvider provideTagAttributesToDecode - * @covers Sanitizer::decodeTagAttributes - */ - public function testDecodeTagAttributes( $expected, $attributes, $message = '' ) { - $this->assertEquals( $expected, - Sanitizer::decodeTagAttributes( $attributes ), - $message - ); - } - - public static function provideTagAttributesToDecode() { - return array( - array( array( 'foo' => 'bar' ), 'foo=bar', 'Unquoted attribute' ), - array( array( 'foo' => 'bar' ), ' foo = bar ', 'Spaced attribute' ), - array( array( 'foo' => 'bar' ), 'foo="bar"', 'Double-quoted attribute' ), - array( array( 'foo' => 'bar' ), 'foo=\'bar\'', 'Single-quoted attribute' ), - array( array( 'foo' => 'bar', 'baz' => 'foo' ), 'foo=\'bar\' baz="foo"', 'Several attributes' ), - array( array( 'foo' => 'bar', 'baz' => 'foo' ), 'foo=\'bar\' baz="foo"', 'Several attributes' ), - array( array( 'foo' => 'bar', 'baz' => 'foo' ), 'foo=\'bar\' baz="foo"', 'Several attributes' ), - array( array( ':foo' => 'bar' ), ':foo=\'bar\'', 'Leading :' ), - array( array( '_foo' => 'bar' ), '_foo=\'bar\'', 'Leading _' ), - array( array( 'foo' => 'bar' ), 'Foo=\'bar\'', 'Leading capital' ), - array( array( 'foo' => 'BAR' ), 'FOO=BAR', 'Attribute keys are normalized to lowercase' ), - - # Invalid beginning - array( array(), '-foo=bar', 'Leading - is forbidden' ), - array( array(), '.foo=bar', 'Leading . is forbidden' ), - array( array( 'foo-bar' => 'bar' ), 'foo-bar=bar', 'A - is allowed inside the attribute' ), - array( array( 'foo-' => 'bar' ), 'foo-=bar', 'A - is allowed inside the attribute' ), - array( array( 'foo.bar' => 'baz' ), 'foo.bar=baz', 'A . is allowed inside the attribute' ), - array( array( 'foo.' => 'baz' ), 'foo.=baz', 'A . is allowed as last character' ), - array( array( 'foo6' => 'baz' ), 'foo6=baz', 'Numbers are allowed' ), - - # This bit is more relaxed than XML rules, but some extensions use - # it, like ProofreadPage (see bug 27539) - array( array( '1foo' => 'baz' ), '1foo=baz', 'Leading numbers are allowed' ), - array( array(), 'foo$=baz', 'Symbols are not allowed' ), - array( array(), 'foo@=baz', 'Symbols are not allowed' ), - array( array(), 'foo~=baz', 'Symbols are not allowed' ), - array( array( 'foo' => '1[#^`*%w/(' ), 'foo=1[#^`*%w/(', 'All kind of characters are allowed as values' ), - array( array( 'foo' => '1[#^`*%\'w/(' ), 'foo="1[#^`*%\'w/("', 'Double quotes are allowed if quoted by single quotes' ), - array( array( 'foo' => '1[#^`*%"w/(' ), 'foo=\'1[#^`*%"w/(\'', 'Single quotes are allowed if quoted by double quotes' ), - array( array( 'foo' => '&"' ), 'foo=&"', 'Special chars can be provided as entities' ), - array( array( 'foo' => '&foobar;' ), 'foo=&foobar;', 'Entity-like items are accepted' ), - ); - } - - /** - * @dataProvider provideDeprecatedAttributes - * @covers Sanitizer::fixTagAttributes - */ - public function testDeprecatedAttributesUnaltered( $inputAttr, $inputEl, $message = '' ) { - $this->assertEquals( " $inputAttr", - Sanitizer::fixTagAttributes( $inputAttr, $inputEl ), - $message - ); - } - - public static function provideDeprecatedAttributes() { - /** array( , , [message] ) */ - return array( - array( 'clear="left"', 'br' ), - array( 'clear="all"', 'br' ), - array( 'width="100"', 'td' ), - array( 'nowrap="true"', 'td' ), - array( 'nowrap=""', 'td' ), - array( 'align="right"', 'td' ), - array( 'align="center"', 'table' ), - array( 'align="left"', 'tr' ), - array( 'align="center"', 'div' ), - array( 'align="left"', 'h1' ), - array( 'align="left"', 'span' ), - ); - } - - /** - * @dataProvider provideCssCommentsFixtures - * @covers Sanitizer::checkCss - */ - public function testCssCommentsChecking( $expected, $css, $message = '' ) { - $this->assertEquals( $expected, - Sanitizer::checkCss( $css ), - $message - ); - } - - public static function provideCssCommentsFixtures() { - /** array( , , [message] ) */ - return array( - // Valid comments spanning entire input - array( '/**/', '/**/' ), - array( '/* comment */', '/* comment */' ), - // Weird stuff - array( ' ', '/****/' ), - array( ' ', '/* /* */' ), - array( 'display: block;', "display:/* foo */block;" ), - array( 'display: block;', "display:\\2f\\2a foo \\2a\\2f block;", - 'Backslash-escaped comments must be stripped (bug 28450)' ), - array( '', '/* unfinished comment structure', - 'Remove anything after a comment-start token' ), - array( '', "\\2f\\2a unifinished comment'", - 'Remove anything after a backslash-escaped comment-start token' ), - array( '/* insecure input */', 'filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'asdf.png\',sizingMethod=\'scale\');' ), - array( '/* insecure input */', '-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'asdf.png\',sizingMethod=\'scale\')";' ), - array( '/* insecure input */', 'width: expression(1+1);' ), - array( '/* insecure input */', 'background-image: image(asdf.png);' ), - array( '/* insecure input */', 'background-image: -webkit-image(asdf.png);' ), - array( '/* insecure input */', 'background-image: -moz-image(asdf.png);' ), - array( '/* insecure input */', 'background-image: image-set("asdf.png" 1x, "asdf.png" 2x);' ), - array( '/* insecure input */', 'background-image: -webkit-image-set("asdf.png" 1x, "asdf.png" 2x);' ), - array( '/* insecure input */', 'background-image: -moz-image-set("asdf.png" 1x, "asdf.png" 2x);' ), - ); - } - - /** - * Test for support or lack of support for specific attributes in the attribute whitelist. - */ - public static function provideAttributeSupport() { - /** array( , , ) */ - return array( - array( 'div', ' role="presentation"', ' role="presentation"', 'Support for WAI-ARIA\'s role="presentation".' ), - array( 'div', ' role="main"', '', "Other WAI-ARIA roles are currently not supported." ), - ); - } - - /** - * @dataProvider provideAttributeSupport - * @covers Sanitizer::fixTagAttributes - */ - public function testAttributeSupport( $tag, $attributes, $expected, $message ) { - $this->assertEquals( $expected, - Sanitizer::fixTagAttributes( $attributes, $tag ), - $message - ); - } -} diff --git a/tests/phpunit/includes/SanitizerValidateEmailTest.php b/tests/phpunit/includes/SanitizerValidateEmailTest.php deleted file mode 100644 index f13e8382..00000000 --- a/tests/phpunit/includes/SanitizerValidateEmailTest.php +++ /dev/null @@ -1,103 +0,0 @@ -assertEquals( - $expected, - Sanitizer::validateEmail( $addr ), - $msg - ); - } - - private function valid( $addr, $msg = '' ) { - $this->checkEmail( $addr, true, $msg ); - } - - private function invalid( $addr, $msg = '' ) { - $this->checkEmail( $addr, false, $msg ); - } - - public function testEmailWellKnownUserAtHostDotTldAreValid() { - $this->valid( 'user@example.com' ); - $this->valid( 'user@example.museum' ); - } - - public function testEmailWithUpperCaseCharactersAreValid() { - $this->valid( 'USER@example.com' ); - $this->valid( 'user@EXAMPLE.COM' ); - $this->valid( 'user@Example.com' ); - $this->valid( 'USER@eXAMPLE.com' ); - } - - public function testEmailWithAPlusInUserName() { - $this->valid( 'user+sub@example.com' ); - $this->valid( 'user+@example.com' ); - } - - public function testEmailDoesNotNeedATopLevelDomain() { - $this->valid( "user@localhost" ); - $this->valid( "FooBar@localdomain" ); - $this->valid( "nobody@mycompany" ); - } - - public function testEmailWithWhiteSpacesBeforeOrAfterAreInvalids() { - $this->invalid( " user@host.com" ); - $this->invalid( "user@host.com " ); - $this->invalid( "\tuser@host.com" ); - $this->invalid( "user@host.com\t" ); - } - - public function testEmailWithWhiteSpacesAreInvalids() { - $this->invalid( "User user@host" ); - $this->invalid( "first last@mycompany" ); - $this->invalid( "firstlast@my company" ); - } - - /** - * bug 26948 : comma were matched by an incorrect regexp range - */ - public function testEmailWithCommasAreInvalids() { - $this->invalid( "user,foo@example.org" ); - $this->invalid( "userfoo@ex,ample.org" ); - } - - public function testEmailWithHyphens() { - $this->valid( "user-foo@example.org" ); - $this->valid( "userfoo@ex-ample.org" ); - } - - public function testEmailDomainCanNotBeginWithDot() { - $this->invalid( "user@." ); - $this->invalid( "user@.localdomain" ); - $this->invalid( "user@localdomain." ); - $this->valid( "user.@localdomain" ); - $this->valid( ".@localdomain" ); - $this->invalid( ".@a............" ); - } - - public function testEmailWithFunnyCharacters() { - $this->valid( "\$user!ex{this}@123.com" ); - } - - public function testEmailTopLevelDomainCanBeNumerical() { - $this->valid( "user@example.1234" ); - } - - public function testEmailWithoutAtSignIsInvalid() { - $this->invalid( 'useràexample.com' ); - } - - public function testEmailWithOneCharacterDomainIsValid() { - $this->valid( 'user@a' ); - } -} diff --git a/tests/phpunit/includes/SiteConfigurationTest.php b/tests/phpunit/includes/SiteConfigurationTest.php deleted file mode 100644 index 053d8a7d..00000000 --- a/tests/phpunit/includes/SiteConfigurationTest.php +++ /dev/null @@ -1,335 +0,0 @@ -suffixes as $suffix ) { - if ( substr( $wiki, -strlen( $suffix ) ) == $suffix ) { - $site = $suffix; - $lang = substr( $wiki, 0, -strlen( $suffix ) ); - break; - } - } - - return array( - 'suffix' => $site, - 'lang' => $lang, - 'params' => array( - 'lang' => $lang, - 'site' => $site, - 'wiki' => $wiki, - ), - 'tags' => array( 'tag' ), - ); -} - -class SiteConfigurationTest extends MediaWikiTestCase { - - /** - * @var SiteConfiguration - */ - protected $mConf; - - protected function setUp() { - parent::setUp(); - - $this->mConf = new SiteConfiguration; - - $this->mConf->suffixes = array( 'wikipedia' => 'wiki' ); - $this->mConf->wikis = array( 'enwiki', 'dewiki', 'frwiki' ); - $this->mConf->settings = array( - 'simple' => array( - 'wiki' => 'wiki', - 'tag' => 'tag', - 'enwiki' => 'enwiki', - 'dewiki' => 'dewiki', - 'frwiki' => 'frwiki', - ), - - 'fallback' => array( - 'default' => 'default', - 'wiki' => 'wiki', - 'tag' => 'tag', - ), - - 'params' => array( - 'default' => '$lang $site $wiki', - ), - - '+global' => array( - 'wiki' => array( - 'wiki' => 'wiki', - ), - 'tag' => array( - 'tag' => 'tag', - ), - 'enwiki' => array( - 'enwiki' => 'enwiki', - ), - 'dewiki' => array( - 'dewiki' => 'dewiki', - ), - 'frwiki' => array( - 'frwiki' => 'frwiki', - ), - ), - - 'merge' => array( - '+wiki' => array( - 'wiki' => 'wiki', - ), - '+tag' => array( - 'tag' => 'tag', - ), - 'default' => array( - 'default' => 'default', - ), - '+enwiki' => array( - 'enwiki' => 'enwiki', - ), - '+dewiki' => array( - 'dewiki' => 'dewiki', - ), - '+frwiki' => array( - 'frwiki' => 'frwiki', - ), - ), - ); - - $GLOBALS['global'] = array( 'global' => 'global' ); - } - - /** - * @covers SiteConfiguration::siteFromDB - */ - public function testSiteFromDb() { - $this->assertEquals( - array( 'wikipedia', 'en' ), - $this->mConf->siteFromDB( 'enwiki' ), - 'siteFromDB()' - ); - $this->assertEquals( - array( 'wikipedia', '' ), - $this->mConf->siteFromDB( 'wiki' ), - 'siteFromDB() on a suffix' - ); - $this->assertEquals( - array( null, null ), - $this->mConf->siteFromDB( 'wikien' ), - 'siteFromDB() on a non-existing wiki' - ); - - $this->mConf->suffixes = array( 'wiki', '' ); - $this->assertEquals( - array( '', 'wikien' ), - $this->mConf->siteFromDB( 'wikien' ), - 'siteFromDB() on a non-existing wiki (2)' - ); - } - - /** - * @covers SiteConfiguration::getLocalDatabases - */ - public function testGetLocalDatabases() { - $this->assertEquals( - array( 'enwiki', 'dewiki', 'frwiki' ), - $this->mConf->getLocalDatabases(), - 'getLocalDatabases()' - ); - } - - /** - * @covers SiteConfiguration::get - */ - public function testGetConfVariables() { - $this->assertEquals( - 'enwiki', - $this->mConf->get( 'simple', 'enwiki', 'wiki' ), - 'get(): simple setting on an existing wiki' - ); - $this->assertEquals( - 'dewiki', - $this->mConf->get( 'simple', 'dewiki', 'wiki' ), - 'get(): simple setting on an existing wiki (2)' - ); - $this->assertEquals( - 'frwiki', - $this->mConf->get( 'simple', 'frwiki', 'wiki' ), - 'get(): simple setting on an existing wiki (3)' - ); - $this->assertEquals( - 'wiki', - $this->mConf->get( 'simple', 'wiki', 'wiki' ), - 'get(): simple setting on an suffix' - ); - $this->assertEquals( - 'wiki', - $this->mConf->get( 'simple', 'eswiki', 'wiki' ), - 'get(): simple setting on an non-existing wiki' - ); - - $this->assertEquals( - 'wiki', - $this->mConf->get( 'fallback', 'enwiki', 'wiki' ), - 'get(): fallback setting on an existing wiki' - ); - $this->assertEquals( - 'tag', - $this->mConf->get( 'fallback', 'dewiki', 'wiki', array(), array( 'tag' ) ), - 'get(): fallback setting on an existing wiki (with wiki tag)' - ); - $this->assertEquals( - 'wiki', - $this->mConf->get( 'fallback', 'wiki', 'wiki' ), - 'get(): fallback setting on an suffix' - ); - $this->assertEquals( - 'wiki', - $this->mConf->get( 'fallback', 'wiki', 'wiki', array(), array( 'tag' ) ), - 'get(): fallback setting on an suffix (with wiki tag)' - ); - $this->assertEquals( - 'wiki', - $this->mConf->get( 'fallback', 'eswiki', 'wiki' ), - 'get(): fallback setting on an non-existing wiki' - ); - $this->assertEquals( - 'tag', - $this->mConf->get( 'fallback', 'eswiki', 'wiki', array(), array( 'tag' ) ), - 'get(): fallback setting on an non-existing wiki (with wiki tag)' - ); - - $common = array( 'wiki' => 'wiki', 'default' => 'default' ); - $commonTag = array( 'tag' => 'tag', 'wiki' => 'wiki', 'default' => 'default' ); - $this->assertEquals( - array( 'enwiki' => 'enwiki' ) + $common, - $this->mConf->get( 'merge', 'enwiki', 'wiki' ), - 'get(): merging setting on an existing wiki' - ); - $this->assertEquals( - array( 'enwiki' => 'enwiki' ) + $commonTag, - $this->mConf->get( 'merge', 'enwiki', 'wiki', array(), array( 'tag' ) ), - 'get(): merging setting on an existing wiki (with tag)' - ); - $this->assertEquals( - array( 'dewiki' => 'dewiki' ) + $common, - $this->mConf->get( 'merge', 'dewiki', 'wiki' ), - 'get(): merging setting on an existing wiki (2)' - ); - $this->assertEquals( - array( 'dewiki' => 'dewiki' ) + $commonTag, - $this->mConf->get( 'merge', 'dewiki', 'wiki', array(), array( 'tag' ) ), - 'get(): merging setting on an existing wiki (2) (with tag)' - ); - $this->assertEquals( - array( 'frwiki' => 'frwiki' ) + $common, - $this->mConf->get( 'merge', 'frwiki', 'wiki' ), - 'get(): merging setting on an existing wiki (3)' - ); - $this->assertEquals( - array( 'frwiki' => 'frwiki' ) + $commonTag, - $this->mConf->get( 'merge', 'frwiki', 'wiki', array(), array( 'tag' ) ), - 'get(): merging setting on an existing wiki (3) (with tag)' - ); - $this->assertEquals( - array( 'wiki' => 'wiki' ) + $common, - $this->mConf->get( 'merge', 'wiki', 'wiki' ), - 'get(): merging setting on an suffix' - ); - $this->assertEquals( - array( 'wiki' => 'wiki' ) + $commonTag, - $this->mConf->get( 'merge', 'wiki', 'wiki', array(), array( 'tag' ) ), - 'get(): merging setting on an suffix (with tag)' - ); - $this->assertEquals( - $common, - $this->mConf->get( 'merge', 'eswiki', 'wiki' ), - 'get(): merging setting on an non-existing wiki' - ); - $this->assertEquals( - $commonTag, - $this->mConf->get( 'merge', 'eswiki', 'wiki', array(), array( 'tag' ) ), - 'get(): merging setting on an non-existing wiki (with tag)' - ); - } - - /** - * @covers SiteConfiguration::siteFromDB - */ - public function testSiteFromDbWithCallback() { - $this->mConf->siteParamsCallback = 'getSiteParams'; - - $this->assertEquals( - array( 'wiki', 'en' ), - $this->mConf->siteFromDB( 'enwiki' ), - 'siteFromDB() with callback' - ); - $this->assertEquals( - array( 'wiki', '' ), - $this->mConf->siteFromDB( 'wiki' ), - 'siteFromDB() with callback on a suffix' - ); - $this->assertEquals( - array( null, null ), - $this->mConf->siteFromDB( 'wikien' ), - 'siteFromDB() with callback on a non-existing wiki' - ); - } - - /** - * @covers SiteConfiguration::get - */ - public function testParameterReplacement() { - $this->mConf->siteParamsCallback = 'getSiteParams'; - - $this->assertEquals( - 'en wiki enwiki', - $this->mConf->get( 'params', 'enwiki', 'wiki' ), - 'get(): parameter replacement on an existing wiki' - ); - $this->assertEquals( - 'de wiki dewiki', - $this->mConf->get( 'params', 'dewiki', 'wiki' ), - 'get(): parameter replacement on an existing wiki (2)' - ); - $this->assertEquals( - 'fr wiki frwiki', - $this->mConf->get( 'params', 'frwiki', 'wiki' ), - 'get(): parameter replacement on an existing wiki (3)' - ); - $this->assertEquals( - ' wiki wiki', - $this->mConf->get( 'params', 'wiki', 'wiki' ), - 'get(): parameter replacement on an suffix' - ); - $this->assertEquals( - 'es wiki eswiki', - $this->mConf->get( 'params', 'eswiki', 'wiki' ), - 'get(): parameter replacement on an non-existing wiki' - ); - } - - /** - * @covers SiteConfiguration::getAll - */ - public function testGetAllGlobals() { - $this->mConf->siteParamsCallback = 'getSiteParams'; - - $getall = array( - 'simple' => 'enwiki', - 'fallback' => 'tag', - 'params' => 'en wiki enwiki', - 'global' => array( 'enwiki' => 'enwiki' ) + $GLOBALS['global'], - 'merge' => array( 'enwiki' => 'enwiki', 'tag' => 'tag', 'wiki' => 'wiki', 'default' => 'default' ), - ); - $this->assertEquals( $getall, $this->mConf->getAll( 'enwiki' ), 'getAll()' ); - - $this->mConf->extractAllGlobals( 'enwiki', 'wiki' ); - - $this->assertEquals( $getall['simple'], $GLOBALS['simple'], 'extractAllGlobals(): simple setting' ); - $this->assertEquals( $getall['fallback'], $GLOBALS['fallback'], 'extractAllGlobals(): fallback setting' ); - $this->assertEquals( $getall['params'], $GLOBALS['params'], 'extractAllGlobals(): parameter replacement' ); - $this->assertEquals( $getall['global'], $GLOBALS['global'], 'extractAllGlobals(): merging with global' ); - $this->assertEquals( $getall['merge'], $GLOBALS['merge'], 'extractAllGlobals(): merging setting' ); - } -} diff --git a/tests/phpunit/includes/StringUtilsTest.php b/tests/phpunit/includes/StringUtilsTest.php deleted file mode 100644 index 89759e5c..00000000 --- a/tests/phpunit/includes/StringUtilsTest.php +++ /dev/null @@ -1,147 +0,0 @@ -markTestSkipped( 'Test requires the mbstring PHP extension' ); - } - $this->assertEquals( $expected, - StringUtils::isUtf8( $string ), - 'Testing string "' . $this->escaped( $string ) . '" with mb_check_encoding' - ); - } - - /** - * This tests StringUtils::isUtf8 making sure we use the pure PHP - * implementation used as a fallback when mb_check_encoding() is - * not available. - * - * @covers StringUtils::isUtf8 - * @dataProvider provideStringsForIsUtf8Check - */ - public function testIsUtf8WithPhpFallbackImplementation( $expected, $string ) { - $this->assertEquals( $expected, - StringUtils::isUtf8( $string, /** disable mbstring: */true ), - 'Testing string "' . $this->escaped( $string ) . '" with pure PHP implementation' - ); - } - - /** - * Print high range characters as an hexadecimal - */ - function escaped( $string ) { - $escaped = ''; - $length = strlen( $string ); - for ( $i = 0; $i < $length; $i++ ) { - $char = $string[$i]; - $val = ord( $char ); - if ( $val > 127 ) { - $escaped .= '\x' . dechex( $val ); - } else { - $escaped .= $char; - } - } - - return $escaped; - } - - /** - * See also "UTF-8 decoder capability and stress test" by - * Markus Kuhn: - * http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt - */ - public static function provideStringsForIsUtf8Check() { - // Expected return values for StringUtils::isUtf8() - $PASS = true; - $FAIL = false; - - return array( - 'some ASCII' => array( $PASS, 'Some ASCII' ), - 'euro sign' => array( $PASS, "Euro sign €" ), - - 'first possible sequence 1 byte' => array( $PASS, "\x00" ), - 'first possible sequence 2 bytes' => array( $PASS, "\xc2\x80" ), - 'first possible sequence 3 bytes' => array( $PASS, "\xe0\xa0\x80" ), - 'first possible sequence 4 bytes' => array( $PASS, "\xf0\x90\x80\x80" ), - 'first possible sequence 5 bytes' => array( $FAIL, "\xf8\x88\x80\x80\x80" ), - 'first possible sequence 6 bytes' => array( $FAIL, "\xfc\x84\x80\x80\x80\x80" ), - - 'last possible sequence 1 byte' => array( $PASS, "\x7f" ), - 'last possible sequence 2 bytes' => array( $PASS, "\xdf\xbf" ), - 'last possible sequence 3 bytes' => array( $PASS, "\xef\xbf\xbf" ), - 'last possible sequence 4 bytes (U+1FFFFF)' => array( $FAIL, "\xf7\xbf\xbf\xbf" ), - 'last possible sequence 5 bytes' => array( $FAIL, "\xfb\xbf\xbf\xbf\xbf" ), - 'last possible sequence 6 bytes' => array( $FAIL, "\xfd\xbf\xbf\xbf\xbf\xbf" ), - - 'boundary 1' => array( $PASS, "\xed\x9f\xbf" ), - 'boundary 2' => array( $PASS, "\xee\x80\x80" ), - 'boundary 3' => array( $PASS, "\xef\xbf\xbd" ), - 'boundary 4' => array( $PASS, "\xf2\x80\x80\x80" ), - 'boundary 5 (U+FFFFF)' => array( $PASS, "\xf3\xbf\xbf\xbf" ), - 'boundary 6 (U+100000)' => array( $PASS, "\xf4\x80\x80\x80" ), - 'boundary 7 (U+10FFFF)' => array( $PASS, "\xf4\x8f\xbf\xbf" ), - 'boundary 8 (U+110000)' => array( $FAIL, "\xf4\x90\x80\x80" ), - - 'malformed 1' => array( $FAIL, "\x80" ), - 'malformed 2' => array( $FAIL, "\xbf" ), - 'malformed 3' => array( $FAIL, "\x80\xbf" ), - 'malformed 4' => array( $FAIL, "\x80\xbf\x80" ), - 'malformed 5' => array( $FAIL, "\x80\xbf\x80\xbf" ), - 'malformed 6' => array( $FAIL, "\x80\xbf\x80\xbf\x80" ), - 'malformed 7' => array( $FAIL, "\x80\xbf\x80\xbf\x80\xbf" ), - 'malformed 8' => array( $FAIL, "\x80\xbf\x80\xbf\x80\xbf\x80" ), - - 'last byte missing 1' => array( $FAIL, "\xc0" ), - 'last byte missing 2' => array( $FAIL, "\xe0\x80" ), - 'last byte missing 3' => array( $FAIL, "\xf0\x80\x80" ), - 'last byte missing 4' => array( $FAIL, "\xf8\x80\x80\x80" ), - 'last byte missing 5' => array( $FAIL, "\xfc\x80\x80\x80\x80" ), - 'last byte missing 6' => array( $FAIL, "\xdf" ), - 'last byte missing 7' => array( $FAIL, "\xef\xbf" ), - 'last byte missing 8' => array( $FAIL, "\xf7\xbf\xbf" ), - 'last byte missing 9' => array( $FAIL, "\xfb\xbf\xbf\xbf" ), - 'last byte missing 10' => array( $FAIL, "\xfd\xbf\xbf\xbf\xbf" ), - - 'extra continuation byte 1' => array( $FAIL, "e\xaf" ), - 'extra continuation byte 2' => array( $FAIL, "\xc3\x89\xaf" ), - 'extra continuation byte 3' => array( $FAIL, "\xef\xbc\xa5\xaf" ), - 'extra continuation byte 4' => array( $FAIL, "\xf0\x9d\x99\xb4\xaf" ), - - 'impossible bytes 1' => array( $FAIL, "\xfe" ), - 'impossible bytes 2' => array( $FAIL, "\xff" ), - 'impossible bytes 3' => array( $FAIL, "\xfe\xfe\xff\xff" ), - - 'overlong sequences 1' => array( $FAIL, "\xc0\xaf" ), - 'overlong sequences 2' => array( $FAIL, "\xc1\xaf" ), - 'overlong sequences 3' => array( $FAIL, "\xe0\x80\xaf" ), - 'overlong sequences 4' => array( $FAIL, "\xf0\x80\x80\xaf" ), - 'overlong sequences 5' => array( $FAIL, "\xf8\x80\x80\x80\xaf" ), - 'overlong sequences 6' => array( $FAIL, "\xfc\x80\x80\x80\x80\xaf" ), - - 'maximum overlong sequences 1' => array( $FAIL, "\xc1\xbf" ), - 'maximum overlong sequences 2' => array( $FAIL, "\xe0\x9f\xbf" ), - 'maximum overlong sequences 3' => array( $FAIL, "\xf0\x8f\xbf\xbf" ), - 'maximum overlong sequences 4' => array( $FAIL, "\xf8\x87\xbf\xbf" ), - 'maximum overlong sequences 5' => array( $FAIL, "\xfc\x83\xbf\xbf\xbf\xbf" ), - - 'surrogates 1 (U+D799)' => array( $PASS, "\xed\x9f\xbf" ), - 'surrogates 2 (U+E000)' => array( $PASS, "\xee\x80\x80" ), - 'surrogates 3 (U+D800)' => array( $FAIL, "\xed\xa0\x80" ), - 'surrogates 4 (U+DBFF)' => array( $FAIL, "\xed\xaf\xbf" ), - 'surrogates 5 (U+DC00)' => array( $FAIL, "\xed\xb0\x80" ), - 'surrogates 6 (U+DFFF)' => array( $FAIL, "\xed\xbf\xbf" ), - 'surrogates 7 (U+D800 U+DC00)' => array( $FAIL, "\xed\xa0\x80\xed\xb0\x80" ), - - 'noncharacters 1' => array( $PASS, "\xef\xbf\xbe" ), - 'noncharacters 2' => array( $PASS, "\xef\xbf\xbf" ), - ); - } -} diff --git a/tests/phpunit/includes/TemplateCategoriesTest.php b/tests/phpunit/includes/TemplateCategoriesTest.php deleted file mode 100644 index fb63a564..00000000 --- a/tests/phpunit/includes/TemplateCategoriesTest.php +++ /dev/null @@ -1,53 +0,0 @@ -mRights = array( 'createpage', 'edit', 'purge' ); - - $page->doEditContent( - new WikitextContent( '{{Categorising template}}' ), - 'Create a page with a template', - 0, - false, - $user - ); - - $this->assertEquals( - array() - , $title->getParentCategories() - ); - - $template = WikiPage::factory( Title::newFromText( 'Template:Categorising template' ) ); - - $template->doEditContent( - new WikitextContent( '[[Category:Solved bugs]]' ), - 'Add a category through a template', - 0, - false, - $user - ); - - // Run the job queue - JobQueueGroup::destroySingletons(); - $jobs = new RunJobs; - $jobs->loadParamsAndArgs( null, array( 'quiet' => true ), null ); - $jobs->execute(); - - $this->assertEquals( - array( 'Category:Solved_bugs' => $title->getPrefixedText() ) - , $title->getParentCategories() - ); - } -} diff --git a/tests/phpunit/includes/TestUser.php b/tests/phpunit/includes/TestUser.php deleted file mode 100644 index 23e65031..00000000 --- a/tests/phpunit/includes/TestUser.php +++ /dev/null @@ -1,59 +0,0 @@ -username = $username; - $this->realname = $realname; - $this->email = $email; - $this->groups = $groups; - - // don't allow user to hardcode or select passwords -- people sometimes run tests - // on live wikis. Sometimes we create sysop users in these tests. A sysop user with - // a known password would be a Bad Thing. - $this->password = User::randomPassword(); - - $this->user = User::newFromName( $this->username ); - $this->user->load(); - - // In an ideal world we'd have a new wiki (or mock data store) for every single test. - // But for now, we just need to create or update the user with the desired properties. - // we particularly need the new password, since we just generated it randomly. - // In core MediaWiki, there is no functionality to delete users, so this is the best we can do. - if ( !$this->user->getID() ) { - // create the user - $this->user = User::createNew( - $this->username, array( - "email" => $this->email, - "real_name" => $this->realname - ) - ); - if ( !$this->user ) { - throw new Exception( "error creating user" ); - } - } - - // update the user to use the new random password and other details - $this->user->setPassword( $this->password ); - $this->user->setEmail( $this->email ); - $this->user->setRealName( $this->realname ); - // remove all groups, replace with any groups specified - foreach ( $this->user->getGroups() as $group ) { - $this->user->removeGroup( $group ); - } - if ( count( $this->groups ) ) { - foreach ( $this->groups as $group ) { - $this->user->addGroup( $group ); - } - } - $this->user->saveSettings(); - } -} diff --git a/tests/phpunit/includes/TimeAdjustTest.php b/tests/phpunit/includes/TimeAdjustTest.php deleted file mode 100644 index 0b368c25..00000000 --- a/tests/phpunit/includes/TimeAdjustTest.php +++ /dev/null @@ -1,41 +0,0 @@ -iniSet( 'precision', 15 ); - } - - /** - * Test offset usage for a given Language::userAdjust - * @dataProvider dataUserAdjust - * @covers Language::userAdjust - */ - public function testUserAdjust( $date, $localTZoffset, $expected ) { - global $wgContLang; - - $this->setMwGlobals( 'wgLocalTZoffset', $localTZoffset ); - - $this->assertEquals( - strval( $expected ), - strval( $wgContLang->userAdjust( $date, '' ) ), - "User adjust {$date} by {$localTZoffset} minutes should give {$expected}" - ); - } - - public static function dataUserAdjust() { - return array( - array( 20061231235959, 0, 20061231235959 ), - array( 20061231235959, 5, 20070101000459 ), - array( 20061231235959, 15, 20070101001459 ), - array( 20061231235959, 60, 20070101005959 ), - array( 20061231235959, 90, 20070101012959 ), - array( 20061231235959, 120, 20070101015959 ), - array( 20061231235959, 540, 20070101085959 ), - array( 20061231235959, -5, 20061231235459 ), - array( 20061231235959, -30, 20061231232959 ), - array( 20061231235959, -60, 20061231225959 ), - ); - } -} diff --git a/tests/phpunit/includes/TimestampTest.php b/tests/phpunit/includes/TimestampTest.php deleted file mode 100644 index 53388392..00000000 --- a/tests/phpunit/includes/TimestampTest.php +++ /dev/null @@ -1,304 +0,0 @@ -setLanguage( Language::factory( 'en' ) ); - } - - /** - * Test parsing of valid timestamps and outputing to MW format. - * @dataProvider provideValidTimestamps - * @covers MWTimestamp::getTimestamp - */ - public function testValidParse( $format, $original, $expected ) { - $timestamp = new MWTimestamp( $original ); - $this->assertEquals( $expected, $timestamp->getTimestamp( TS_MW ) ); - } - - /** - * Test outputting valid timestamps to different formats. - * @dataProvider provideValidTimestamps - * @covers MWTimestamp::getTimestamp - */ - public function testValidOutput( $format, $expected, $original ) { - $timestamp = new MWTimestamp( $original ); - $this->assertEquals( $expected, (string)$timestamp->getTimestamp( $format ) ); - } - - /** - * Test an invalid timestamp. - * @expectedException TimestampException - * @covers MWTimestamp - */ - public function testInvalidParse() { - new MWTimestamp( "This is not a timestamp." ); - } - - /** - * Test requesting an invalid output format. - * @expectedException TimestampException - * @covers MWTimestamp::getTimestamp - */ - public function testInvalidOutput() { - $timestamp = new MWTimestamp( '1343761268' ); - $timestamp->getTimestamp( 98 ); - } - - /** - * Returns a list of valid timestamps in the format: - * array( type, timestamp_of_type, timestamp_in_MW ) - */ - public static function provideValidTimestamps() { - return array( - // Various formats - array( TS_UNIX, '1343761268', '20120731190108' ), - array( TS_MW, '20120731190108', '20120731190108' ), - array( TS_DB, '2012-07-31 19:01:08', '20120731190108' ), - array( TS_ISO_8601, '2012-07-31T19:01:08Z', '20120731190108' ), - array( TS_ISO_8601_BASIC, '20120731T190108Z', '20120731190108' ), - array( TS_EXIF, '2012:07:31 19:01:08', '20120731190108' ), - array( TS_RFC2822, 'Tue, 31 Jul 2012 19:01:08 GMT', '20120731190108' ), - array( TS_ORACLE, '31-07-2012 19:01:08.000000', '20120731190108' ), - array( TS_POSTGRES, '2012-07-31 19:01:08 GMT', '20120731190108' ), - // Some extremes and weird values - array( TS_ISO_8601, '9999-12-31T23:59:59Z', '99991231235959' ), - array( TS_UNIX, '-62135596801', '00001231235959' ) - ); - } - - /** - * @dataProvider provideHumanTimestampTests - * @covers MWTimestamp::getHumanTimestamp - */ - public function testHumanTimestamp( - $tsTime, // The timestamp to format - $currentTime, // The time to consider "now" - $timeCorrection, // The time offset to use - $dateFormat, // The date preference to use - $expectedOutput, // The expected output - $desc // Description - ) { - $user = $this->getMock( 'User' ); - $user->expects( $this->any() ) - ->method( 'getOption' ) - ->with( 'timecorrection' ) - ->will( $this->returnValue( $timeCorrection ) ); - - $user->expects( $this->any() ) - ->method( 'getDatePreference' ) - ->will( $this->returnValue( $dateFormat ) ); - - $tsTime = new MWTimestamp( $tsTime ); - $currentTime = new MWTimestamp( $currentTime ); - - $this->assertEquals( - $expectedOutput, - $tsTime->getHumanTimestamp( $currentTime, $user ), - $desc - ); - } - - public static function provideHumanTimestampTests() { - return array( - array( - '20111231170000', - '20120101000000', - 'Offset|0', - 'mdy', - 'Yesterday at 17:00', - '"Yesterday" across years', - ), - array( - '20120717190900', - '20120717190929', - 'Offset|0', - 'mdy', - 'just now', - '"Just now"', - ), - array( - '20120717190900', - '20120717191530', - 'Offset|0', - 'mdy', - '6 minutes ago', - 'X minutes ago', - ), - array( - '20121006173100', - '20121006173200', - 'Offset|0', - 'mdy', - '1 minute ago', - '"1 minute ago"', - ), - array( - '20120617190900', - '20120717190900', - 'Offset|0', - 'mdy', - 'June 17', - 'Another month' - ), - array( - '19910130151500', - '20120716193700', - 'Offset|0', - 'mdy', - '15:15, January 30, 1991', - 'Different year', - ), - array( - '20120101050000', - '20120101080000', - 'Offset|-360', - 'mdy', - 'Yesterday at 23:00', - '"Yesterday" across years with time correction', - ), - array( - '20120714184300', - '20120716184300', - 'Offset|-420', - 'mdy', - 'Saturday at 11:43', - 'Recent weekday with time correction', - ), - array( - '20120714184300', - '20120715040000', - 'Offset|-420', - 'mdy', - '11:43', - 'Today at another time with time correction', - ), - array( - '20120617190900', - '20120717190900', - 'Offset|0', - 'dmy', - '17 June', - 'Another month with dmy' - ), - array( - '20120617190900', - '20120717190900', - 'Offset|0', - 'ISO 8601', - '06-17', - 'Another month with ISO-8601' - ), - array( - '19910130151500', - '20120716193700', - 'Offset|0', - 'ISO 8601', - '1991-01-30T15:15:00', - 'Different year with ISO-8601', - ), - ); - } - - /** - * @dataProvider provideRelativeTimestampTests - * @covers MWTimestamp::getRelativeTimestamp - */ - public function testRelativeTimestamp( - $tsTime, // The timestamp to format - $currentTime, // The time to consider "now" - $timeCorrection, // The time offset to use - $dateFormat, // The date preference to use - $expectedOutput, // The expected output - $desc // Description - ) { - $user = $this->getMock( 'User' ); - $user->expects( $this->any() ) - ->method( 'getOption' ) - ->with( 'timecorrection' ) - ->will( $this->returnValue( $timeCorrection ) ); - - $tsTime = new MWTimestamp( $tsTime ); - $currentTime = new MWTimestamp( $currentTime ); - - $this->assertEquals( - $expectedOutput, - $tsTime->getRelativeTimestamp( $currentTime, $user ), - $desc - ); - } - - public static function provideRelativeTimestampTests() { - return array( - array( - '20111231170000', - '20120101000000', - 'Offset|0', - 'mdy', - '7 hours ago', - '"Yesterday" across years', - ), - array( - '20120717190900', - '20120717190929', - 'Offset|0', - 'mdy', - '29 seconds ago', - '"Just now"', - ), - array( - '20120717190900', - '20120717191530', - 'Offset|0', - 'mdy', - '6 minutes and 30 seconds ago', - 'Combination of multiple units', - ), - array( - '20121006173100', - '20121006173200', - 'Offset|0', - 'mdy', - '1 minute ago', - '"1 minute ago"', - ), - array( - '19910130151500', - '20120716193700', - 'Offset|0', - 'mdy', - '2 decades, 1 year, 168 days, 2 hours, 8 minutes and 48 seconds ago', - 'A long time ago', - ), - array( - '20120101050000', - '20120101080000', - 'Offset|-360', - 'mdy', - '3 hours ago', - '"Yesterday" across years with time correction', - ), - array( - '20120714184300', - '20120716184300', - 'Offset|-420', - 'mdy', - '2 days ago', - 'Recent weekday with time correction', - ), - array( - '20120714184300', - '20120715040000', - 'Offset|-420', - 'mdy', - '9 hours and 17 minutes ago', - 'Today at another time with time correction', - ), - ); - } -} diff --git a/tests/phpunit/includes/TitleMethodsTest.php b/tests/phpunit/includes/TitleMethodsTest.php deleted file mode 100644 index 3079d73a..00000000 --- a/tests/phpunit/includes/TitleMethodsTest.php +++ /dev/null @@ -1,300 +0,0 @@ -mergeMwGlobalArrayValue( - 'wgExtraNamespaces', - array( - 12302 => 'TEST-JS', - 12303 => 'TEST-JS_TALK', - ) - ); - - $this->mergeMwGlobalArrayValue( - 'wgNamespaceContentModels', - array( - 12302 => CONTENT_MODEL_JAVASCRIPT, - ) - ); - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - } - - public function tearDown() { - global $wgContLang; - - parent::tearDown(); - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - } - - public static function provideEquals() { - return array( - array( 'Main Page', 'Main Page', true ), - array( 'Main Page', 'Not The Main Page', false ), - array( 'Main Page', 'Project:Main Page', false ), - array( 'File:Example.png', 'Image:Example.png', true ), - array( 'Special:Version', 'Special:Version', true ), - array( 'Special:Version', 'Special:Recentchanges', false ), - array( 'Special:Version', 'Main Page', false ), - ); - } - - /** - * @dataProvider provideEquals - * @covers Title::equals - */ - public function testEquals( $titleA, $titleB, $expectedBool ) { - $titleA = Title::newFromText( $titleA ); - $titleB = Title::newFromText( $titleB ); - - $this->assertEquals( $expectedBool, $titleA->equals( $titleB ) ); - $this->assertEquals( $expectedBool, $titleB->equals( $titleA ) ); - } - - public static function provideInNamespace() { - return array( - array( 'Main Page', NS_MAIN, true ), - array( 'Main Page', NS_TALK, false ), - array( 'Main Page', NS_USER, false ), - array( 'User:Foo', NS_USER, true ), - array( 'User:Foo', NS_USER_TALK, false ), - array( 'User:Foo', NS_TEMPLATE, false ), - array( 'User_talk:Foo', NS_USER_TALK, true ), - array( 'User_talk:Foo', NS_USER, false ), - ); - } - - /** - * @dataProvider provideInNamespace - * @covers Title::inNamespace - */ - public function testInNamespace( $title, $ns, $expectedBool ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedBool, $title->inNamespace( $ns ) ); - } - - /** - * @covers Title::inNamespaces - */ - public function testInNamespaces() { - $mainpage = Title::newFromText( 'Main Page' ); - $this->assertTrue( $mainpage->inNamespaces( NS_MAIN, NS_USER ) ); - $this->assertTrue( $mainpage->inNamespaces( array( NS_MAIN, NS_USER ) ) ); - $this->assertTrue( $mainpage->inNamespaces( array( NS_USER, NS_MAIN ) ) ); - $this->assertFalse( $mainpage->inNamespaces( array( NS_PROJECT, NS_TEMPLATE ) ) ); - } - - public static function provideHasSubjectNamespace() { - return array( - array( 'Main Page', NS_MAIN, true ), - array( 'Main Page', NS_TALK, true ), - array( 'Main Page', NS_USER, false ), - array( 'User:Foo', NS_USER, true ), - array( 'User:Foo', NS_USER_TALK, true ), - array( 'User:Foo', NS_TEMPLATE, false ), - array( 'User_talk:Foo', NS_USER_TALK, true ), - array( 'User_talk:Foo', NS_USER, true ), - ); - } - - /** - * @dataProvider provideHasSubjectNamespace - * @covers Title::hasSubjectNamespace - */ - public function testHasSubjectNamespace( $title, $ns, $expectedBool ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedBool, $title->hasSubjectNamespace( $ns ) ); - } - - public function dataGetContentModel() { - return array( - array( 'Help:Foo', CONTENT_MODEL_WIKITEXT ), - array( 'Help:Foo.js', CONTENT_MODEL_WIKITEXT ), - array( 'Help:Foo/bar.js', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo.js', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo/bar.js', CONTENT_MODEL_JAVASCRIPT ), - array( 'User:Foo/bar.css', CONTENT_MODEL_CSS ), - array( 'User talk:Foo/bar.css', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo/bar.js.xxx', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo/bar.xxx', CONTENT_MODEL_WIKITEXT ), - array( 'MediaWiki:Foo.js', CONTENT_MODEL_JAVASCRIPT ), - array( 'MediaWiki:Foo.css', CONTENT_MODEL_CSS ), - array( 'MediaWiki:Foo/bar.css', CONTENT_MODEL_CSS ), - array( 'MediaWiki:Foo.JS', CONTENT_MODEL_WIKITEXT ), - array( 'MediaWiki:Foo.CSS', CONTENT_MODEL_WIKITEXT ), - array( 'MediaWiki:Foo.css.xxx', CONTENT_MODEL_WIKITEXT ), - array( 'TEST-JS:Foo', CONTENT_MODEL_JAVASCRIPT ), - array( 'TEST-JS:Foo.js', CONTENT_MODEL_JAVASCRIPT ), - array( 'TEST-JS:Foo/bar.js', CONTENT_MODEL_JAVASCRIPT ), - array( 'TEST-JS_TALK:Foo.js', CONTENT_MODEL_WIKITEXT ), - ); - } - - /** - * @dataProvider dataGetContentModel - * @covers Title::getContentModel - */ - public function testGetContentModel( $title, $expectedModelId ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedModelId, $title->getContentModel() ); - } - - /** - * @dataProvider dataGetContentModel - * @covers Title::hasContentModel - */ - public function testHasContentModel( $title, $expectedModelId ) { - $title = Title::newFromText( $title ); - $this->assertTrue( $title->hasContentModel( $expectedModelId ) ); - } - - public static function provideIsCssOrJsPage() { - return array( - array( 'Help:Foo', false ), - array( 'Help:Foo.js', false ), - array( 'Help:Foo/bar.js', false ), - array( 'User:Foo', false ), - array( 'User:Foo.js', false ), - array( 'User:Foo/bar.js', false ), - array( 'User:Foo/bar.css', false ), - array( 'User talk:Foo/bar.css', false ), - array( 'User:Foo/bar.js.xxx', false ), - array( 'User:Foo/bar.xxx', false ), - array( 'MediaWiki:Foo.js', true ), - array( 'MediaWiki:Foo.css', true ), - array( 'MediaWiki:Foo.JS', false ), - array( 'MediaWiki:Foo.CSS', false ), - array( 'MediaWiki:Foo.css.xxx', false ), - array( 'TEST-JS:Foo', false ), - array( 'TEST-JS:Foo.js', false ), - ); - } - - /** - * @dataProvider provideIsCssOrJsPage - * @covers Title::isCssOrJsPage - */ - public function testIsCssOrJsPage( $title, $expectedBool ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedBool, $title->isCssOrJsPage() ); - } - - public static function provideIsCssJsSubpage() { - return array( - array( 'Help:Foo', false ), - array( 'Help:Foo.js', false ), - array( 'Help:Foo/bar.js', false ), - array( 'User:Foo', false ), - array( 'User:Foo.js', false ), - array( 'User:Foo/bar.js', true ), - array( 'User:Foo/bar.css', true ), - array( 'User talk:Foo/bar.css', false ), - array( 'User:Foo/bar.js.xxx', false ), - array( 'User:Foo/bar.xxx', false ), - array( 'MediaWiki:Foo.js', false ), - array( 'User:Foo/bar.JS', false ), - array( 'User:Foo/bar.CSS', false ), - array( 'TEST-JS:Foo', false ), - array( 'TEST-JS:Foo.js', false ), - ); - } - - /** - * @dataProvider provideIsCssJsSubpage - * @covers Title::isCssJsSubpage - */ - public function testIsCssJsSubpage( $title, $expectedBool ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedBool, $title->isCssJsSubpage() ); - } - - public static function provideIsCssSubpage() { - return array( - array( 'Help:Foo', false ), - array( 'Help:Foo.css', false ), - array( 'User:Foo', false ), - array( 'User:Foo.js', false ), - array( 'User:Foo.css', false ), - array( 'User:Foo/bar.js', false ), - array( 'User:Foo/bar.css', true ), - ); - } - - /** - * @dataProvider provideIsCssSubpage - * @covers Title::isCssSubpage - */ - public function testIsCssSubpage( $title, $expectedBool ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedBool, $title->isCssSubpage() ); - } - - public static function provideIsJsSubpage() { - return array( - array( 'Help:Foo', false ), - array( 'Help:Foo.css', false ), - array( 'User:Foo', false ), - array( 'User:Foo.js', false ), - array( 'User:Foo.css', false ), - array( 'User:Foo/bar.js', true ), - array( 'User:Foo/bar.css', false ), - ); - } - - /** - * @dataProvider provideIsJsSubpage - * @covers Title::isJsSubpage - */ - public function testIsJsSubpage( $title, $expectedBool ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedBool, $title->isJsSubpage() ); - } - - public static function provideIsWikitextPage() { - return array( - array( 'Help:Foo', true ), - array( 'Help:Foo.js', true ), - array( 'Help:Foo/bar.js', true ), - array( 'User:Foo', true ), - array( 'User:Foo.js', true ), - array( 'User:Foo/bar.js', false ), - array( 'User:Foo/bar.css', false ), - array( 'User talk:Foo/bar.css', true ), - array( 'User:Foo/bar.js.xxx', true ), - array( 'User:Foo/bar.xxx', true ), - array( 'MediaWiki:Foo.js', false ), - array( 'MediaWiki:Foo.css', false ), - array( 'MediaWiki:Foo/bar.css', false ), - array( 'User:Foo/bar.JS', true ), - array( 'User:Foo/bar.CSS', true ), - array( 'TEST-JS:Foo', false ), - array( 'TEST-JS:Foo.js', false ), - array( 'TEST-JS_TALK:Foo.js', true ), - ); - } - - /** - * @dataProvider provideIsWikitextPage - * @covers Title::isWikitextPage - */ - public function testIsWikitextPage( $title, $expectedBool ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedBool, $title->isWikitextPage() ); - } -} diff --git a/tests/phpunit/includes/TitlePermissionTest.php b/tests/phpunit/includes/TitlePermissionTest.php deleted file mode 100644 index f15c1772..00000000 --- a/tests/phpunit/includes/TitlePermissionTest.php +++ /dev/null @@ -1,742 +0,0 @@ -setMwGlobals( array( - 'wgMemc' => new EmptyBagOStuff, - 'wgContLang' => $langObj, - 'wgLanguageCode' => 'en', - 'wgLang' => $langObj, - 'wgLocaltimezone' => $localZone, - 'wgLocalTZoffset' => $localOffset, - 'wgNamespaceProtection' => array( - NS_MEDIAWIKI => 'editinterface', - ), - ) ); - - $this->userName = 'Useruser'; - $this->altUserName = 'Altuseruser'; - date_default_timezone_set( $localZone ); - - $this->title = Title::makeTitle( NS_MAIN, "Main Page" ); - if ( !isset( $this->userUser ) || !( $this->userUser instanceOf User ) ) { - $this->userUser = User::newFromName( $this->userName ); - - if ( !$this->userUser->getID() ) { - $this->userUser = User::createNew( $this->userName, array( - "email" => "test@example.com", - "real_name" => "Test User" ) ); - $this->userUser->load(); - } - - $this->altUser = User::newFromName( $this->altUserName ); - if ( !$this->altUser->getID() ) { - $this->altUser = User::createNew( $this->altUserName, array( - "email" => "alttest@example.com", - "real_name" => "Test User Alt" ) ); - $this->altUser->load(); - } - - $this->anonUser = User::newFromId( 0 ); - - $this->user = $this->userUser; - } - } - - protected function setUserPerm( $perm ) { - // Setting member variables is evil!!! - - if ( is_array( $perm ) ) { - $this->user->mRights = $perm; - } else { - $this->user->mRights = array( $perm ); - } - } - - protected function setTitle( $ns, $title = "Main_Page" ) { - $this->title = Title::makeTitle( $ns, $title ); - } - - protected function setUser( $userName = null ) { - if ( $userName === 'anon' ) { - $this->user = $this->anonUser; - } elseif ( $userName === null || $userName === $this->userName ) { - $this->user = $this->userUser; - } else { - $this->user = $this->altUser; - } - } - - /** - * @todo This test method should be split up into separate test methods and - * data providers - */ - public function testQuickPermissions() { - global $wgContLang; - $prefix = $wgContLang->getFormattedNsText( NS_PROJECT ); - - $this->setUser( 'anon' ); - $this->setTitle( NS_TALK ); - $this->setUserPerm( "createtalk" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setTitle( NS_TALK ); - $this->setUserPerm( "createpage" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array( array( "nocreatetext" ) ), $res ); - - $this->setTitle( NS_TALK ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array( array( 'nocreatetext' ) ), $res ); - - $this->setTitle( NS_MAIN ); - $this->setUserPerm( "createpage" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setTitle( NS_MAIN ); - $this->setUserPerm( "createtalk" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array( array( 'nocreatetext' ) ), $res ); - - $this->setUser( $this->userName ); - $this->setTitle( NS_TALK ); - $this->setUserPerm( "createtalk" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setTitle( NS_TALK ); - $this->setUserPerm( "createpage" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array( array( 'nocreate-loggedin' ) ), $res ); - - $this->setTitle( NS_TALK ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array( array( 'nocreate-loggedin' ) ), $res ); - - $this->setTitle( NS_MAIN ); - $this->setUserPerm( "createpage" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setTitle( NS_MAIN ); - $this->setUserPerm( "createtalk" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array( array( 'nocreate-loggedin' ) ), $res ); - - $this->setTitle( NS_MAIN ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array( array( 'nocreate-loggedin' ) ), $res ); - - $this->setUser( 'anon' ); - $this->setTitle( NS_USER, $this->userName . '' ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'cant-move-user-page' ), array( 'movenologintext' ) ), $res ); - - $this->setTitle( NS_USER, $this->userName . '/subpage' ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenologintext' ) ), $res ); - - $this->setTitle( NS_USER, $this->userName . '' ); - $this->setUserPerm( "move-rootuserpages" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenologintext' ) ), $res ); - - $this->setTitle( NS_USER, $this->userName . '/subpage' ); - $this->setUserPerm( "move-rootuserpages" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenologintext' ) ), $res ); - - $this->setTitle( NS_USER, $this->userName . '' ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'cant-move-user-page' ), array( 'movenologintext' ) ), $res ); - - $this->setTitle( NS_USER, $this->userName . '/subpage' ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenologintext' ) ), $res ); - - $this->setTitle( NS_USER, $this->userName . '' ); - $this->setUserPerm( "move-rootuserpages" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenologintext' ) ), $res ); - - $this->setTitle( NS_USER, $this->userName . '/subpage' ); - $this->setUserPerm( "move-rootuserpages" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenologintext' ) ), $res ); - - $this->setUser( $this->userName ); - $this->setTitle( NS_FILE, "img.png" ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenotallowedfile' ), array( 'movenotallowed' ) ), $res ); - - $this->setTitle( NS_FILE, "img.png" ); - $this->setUserPerm( "movefile" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenotallowed' ) ), $res ); - - $this->setUser( 'anon' ); - $this->setTitle( NS_FILE, "img.png" ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenotallowedfile' ), array( 'movenologintext' ) ), $res ); - - $this->setTitle( NS_FILE, "img.png" ); - $this->setUserPerm( "movefile" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenologintext' ) ), $res ); - - $this->setUser( $this->userName ); - $this->setUserPerm( "move" ); - $this->runGroupPermissions( 'move', array( array( 'movenotallowedfile' ) ) ); - - $this->setUserPerm( "" ); - $this->runGroupPermissions( 'move', array( array( 'movenotallowedfile' ), array( 'movenotallowed' ) ) ); - - $this->setUser( 'anon' ); - $this->setUserPerm( "move" ); - $this->runGroupPermissions( 'move', array( array( 'movenotallowedfile' ) ) ); - - $this->setUserPerm( "" ); - $this->runGroupPermissions( 'move', array( array( 'movenotallowedfile' ), array( 'movenotallowed' ) ), - array( array( 'movenotallowedfile' ), array( 'movenologintext' ) ) ); - - if ( $this->isWikitextNS( NS_MAIN ) ) { - //NOTE: some content models don't allow moving - // @todo find a Wikitext namespace for testing - - $this->setTitle( NS_MAIN ); - $this->setUser( 'anon' ); - $this->setUserPerm( "move" ); - $this->runGroupPermissions( 'move', array() ); - - $this->setUserPerm( "" ); - $this->runGroupPermissions( 'move', array( array( 'movenotallowed' ) ), - array( array( 'movenologintext' ) ) ); - - $this->setUser( $this->userName ); - $this->setUserPerm( "" ); - $this->runGroupPermissions( 'move', array( array( 'movenotallowed' ) ) ); - - $this->setUserPerm( "move" ); - $this->runGroupPermissions( 'move', array() ); - - $this->setUser( 'anon' ); - $this->setUserPerm( 'move' ); - $res = $this->title->getUserPermissionsErrors( 'move-target', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setUserPerm( '' ); - $res = $this->title->getUserPermissionsErrors( 'move-target', $this->user ); - $this->assertEquals( array( array( 'movenotallowed' ) ), $res ); - } - - $this->setTitle( NS_USER ); - $this->setUser( $this->userName ); - $this->setUserPerm( array( "move", "move-rootuserpages" ) ); - $res = $this->title->getUserPermissionsErrors( 'move-target', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setUserPerm( "move" ); - $res = $this->title->getUserPermissionsErrors( 'move-target', $this->user ); - $this->assertEquals( array( array( 'cant-move-to-user-page' ) ), $res ); - - $this->setUser( 'anon' ); - $this->setUserPerm( array( "move", "move-rootuserpages" ) ); - $res = $this->title->getUserPermissionsErrors( 'move-target', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setTitle( NS_USER, "User/subpage" ); - $this->setUserPerm( array( "move", "move-rootuserpages" ) ); - $res = $this->title->getUserPermissionsErrors( 'move-target', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setUserPerm( "move" ); - $res = $this->title->getUserPermissionsErrors( 'move-target', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setUser( 'anon' ); - $check = array( 'edit' => array( array( array( 'badaccess-groups', "*, [[$prefix:Users|Users]]", 2 ) ), - array( array( 'badaccess-group0' ) ), - array(), true ), - 'protect' => array( array( array( 'badaccess-groups', "[[$prefix:Administrators|Administrators]]", 1 ), array( 'protect-cantedit' ) ), - array( array( 'badaccess-group0' ), array( 'protect-cantedit' ) ), - array( array( 'protect-cantedit' ) ), false ), - '' => array( array(), array(), array(), true ) ); - - foreach ( array( "edit", "protect", "" ) as $action ) { - $this->setUserPerm( null ); - $this->assertEquals( $check[$action][0], - $this->title->getUserPermissionsErrors( $action, $this->user, true ) ); - - global $wgGroupPermissions; - $old = $wgGroupPermissions; - $wgGroupPermissions = array(); - - $this->assertEquals( $check[$action][1], - $this->title->getUserPermissionsErrors( $action, $this->user, true ) ); - $wgGroupPermissions = $old; - - $this->setUserPerm( $action ); - $this->assertEquals( $check[$action][2], - $this->title->getUserPermissionsErrors( $action, $this->user, true ) ); - - $this->setUserPerm( $action ); - $this->assertEquals( $check[$action][3], - $this->title->userCan( $action, $this->user, true ) ); - $this->assertEquals( $check[$action][3], - $this->title->quickUserCan( $action, $this->user ) ); - # count( User::getGroupsWithPermissions( $action ) ) < 1 - } - } - - protected function runGroupPermissions( $action, $result, $result2 = null ) { - global $wgGroupPermissions; - - if ( $result2 === null ) { - $result2 = $result; - } - - $wgGroupPermissions['autoconfirmed']['move'] = false; - $wgGroupPermissions['user']['move'] = false; - $res = $this->title->getUserPermissionsErrors( $action, $this->user ); - $this->assertEquals( $result, $res ); - - $wgGroupPermissions['autoconfirmed']['move'] = true; - $wgGroupPermissions['user']['move'] = false; - $res = $this->title->getUserPermissionsErrors( $action, $this->user ); - $this->assertEquals( $result2, $res ); - - $wgGroupPermissions['autoconfirmed']['move'] = true; - $wgGroupPermissions['user']['move'] = true; - $res = $this->title->getUserPermissionsErrors( $action, $this->user ); - $this->assertEquals( $result2, $res ); - - $wgGroupPermissions['autoconfirmed']['move'] = false; - $wgGroupPermissions['user']['move'] = true; - $res = $this->title->getUserPermissionsErrors( $action, $this->user ); - $this->assertEquals( $result2, $res ); - } - - /** - * @todo This test method should be split up into separate test methods and - * data providers - */ - public function testSpecialsAndNSPermissions() { - global $wgNamespaceProtection; - $this->setUser( $this->userName ); - - $this->setTitle( NS_SPECIAL ); - - $this->assertEquals( array( array( 'badaccess-group0' ), array( 'ns-specialprotected' ) ), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - - $this->setTitle( NS_MAIN ); - $this->setUserPerm( 'bogus' ); - $this->assertEquals( array(), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - - $this->setTitle( NS_MAIN ); - $this->setUserPerm( '' ); - $this->assertEquals( array( array( 'badaccess-group0' ) ), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - - $wgNamespaceProtection[NS_USER] = array( 'bogus' ); - - $this->setTitle( NS_USER ); - $this->setUserPerm( '' ); - $this->assertEquals( array( array( 'badaccess-group0' ), array( 'namespaceprotected', 'User' ) ), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - - $this->setTitle( NS_MEDIAWIKI ); - $this->setUserPerm( 'bogus' ); - $this->assertEquals( array( array( 'protectedinterface' ) ), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - - $this->setTitle( NS_MEDIAWIKI ); - $this->setUserPerm( 'bogus' ); - $this->assertEquals( array( array( 'protectedinterface' ) ), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - - $wgNamespaceProtection = null; - - $this->setUserPerm( 'bogus' ); - $this->assertEquals( array(), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - $this->assertEquals( true, - $this->title->userCan( 'bogus', $this->user ) ); - - $this->setUserPerm( '' ); - $this->assertEquals( array( array( 'badaccess-group0' ) ), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - $this->assertEquals( false, - $this->title->userCan( 'bogus', $this->user ) ); - } - - /** - * @todo This test method should be split up into separate test methods and - * data providers - */ - public function testCssAndJavascriptPermissions() { - $this->setUser( $this->userName ); - - $this->setTitle( NS_USER, $this->userName . '/test.js' ); - $this->runCSSandJSPermissions( - array( array( 'badaccess-group0' ), array( 'mycustomjsprotected' ) ), - array( array( 'badaccess-group0' ), array( 'mycustomjsprotected' ) ), - array( array( 'badaccess-group0' ) ), - array( array( 'badaccess-group0' ), array( 'mycustomjsprotected' ) ), - array( array( 'badaccess-group0' ) ) - ); - - $this->setTitle( NS_USER, $this->userName . '/test.css' ); - $this->runCSSandJSPermissions( - array( array( 'badaccess-group0' ), array( 'mycustomcssprotected' ) ), - array( array( 'badaccess-group0' ) ), - array( array( 'badaccess-group0' ), array( 'mycustomcssprotected' ) ), - array( array( 'badaccess-group0' ) ), - array( array( 'badaccess-group0' ), array( 'mycustomcssprotected' ) ) - ); - - $this->setTitle( NS_USER, $this->altUserName . '/test.js' ); - $this->runCSSandJSPermissions( - array( array( 'badaccess-group0' ), array( 'customjsprotected' ) ), - array( array( 'badaccess-group0' ), array( 'customjsprotected' ) ), - array( array( 'badaccess-group0' ), array( 'customjsprotected' ) ), - array( array( 'badaccess-group0' ), array( 'customjsprotected' ) ), - array( array( 'badaccess-group0' ) ) - ); - - $this->setTitle( NS_USER, $this->altUserName . '/test.css' ); - $this->runCSSandJSPermissions( - array( array( 'badaccess-group0' ), array( 'customcssprotected' ) ), - array( array( 'badaccess-group0' ), array( 'customcssprotected' ) ), - array( array( 'badaccess-group0' ), array( 'customcssprotected' ) ), - array( array( 'badaccess-group0' ) ), - array( array( 'badaccess-group0' ), array( 'customcssprotected' ) ) - ); - - $this->setTitle( NS_USER, $this->altUserName . '/tempo' ); - $this->runCSSandJSPermissions( - array( array( 'badaccess-group0' ) ), - array( array( 'badaccess-group0' ) ), - array( array( 'badaccess-group0' ) ), - array( array( 'badaccess-group0' ) ), - array( array( 'badaccess-group0' ) ) - ); - } - - protected function runCSSandJSPermissions( $result0, $result1, $result2, $result3, $result4 ) { - $this->setUserPerm( '' ); - $this->assertEquals( $result0, - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - - $this->setUserPerm( 'editmyusercss' ); - $this->assertEquals( $result1, - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - - $this->setUserPerm( 'editmyuserjs' ); - $this->assertEquals( $result2, - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - - $this->setUserPerm( 'editusercss' ); - $this->assertEquals( $result3, - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - - $this->setUserPerm( 'edituserjs' ); - $this->assertEquals( $result4, - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - - $this->setUserPerm( 'editusercssjs' ); - $this->assertEquals( array( array( 'badaccess-group0' ) ), - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - - $this->setUserPerm( array( 'edituserjs', 'editusercss' ) ); - $this->assertEquals( array( array( 'badaccess-group0' ) ), - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - } - - /** - * @todo This test method should be split up into separate test methods and - * data providers - */ - public function testPageRestrictions() { - global $wgContLang; - - $prefix = $wgContLang->getFormattedNsText( NS_PROJECT ); - - $this->setTitle( NS_MAIN ); - $this->title->mRestrictionsLoaded = true; - $this->setUserPerm( "edit" ); - $this->title->mRestrictions = array( "bogus" => array( 'bogus', "sysop", "protect", "" ) ); - - $this->assertEquals( array(), - $this->title->getUserPermissionsErrors( 'edit', - $this->user ) ); - - $this->assertEquals( true, - $this->title->quickUserCan( 'edit', $this->user ) ); - $this->title->mRestrictions = array( "edit" => array( 'bogus', "sysop", "protect", "" ), - "bogus" => array( 'bogus', "sysop", "protect", "" ) ); - - $this->assertEquals( array( array( 'badaccess-group0' ), - array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'editprotected' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - $this->assertEquals( array( array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'editprotected' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'edit', - $this->user ) ); - $this->setUserPerm( "" ); - $this->assertEquals( array( array( 'badaccess-group0' ), - array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'editprotected' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - $this->assertEquals( array( array( 'badaccess-groups', "*, [[$prefix:Users|Users]]", 2 ), - array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'editprotected' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'edit', - $this->user ) ); - $this->setUserPerm( array( "edit", "editprotected" ) ); - $this->assertEquals( array( array( 'badaccess-group0' ), - array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - $this->assertEquals( array( - array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'edit', - $this->user ) ); - - $this->title->mCascadeRestriction = true; - $this->setUserPerm( "edit" ); - $this->assertEquals( false, - $this->title->quickUserCan( 'bogus', $this->user ) ); - $this->assertEquals( false, - $this->title->quickUserCan( 'edit', $this->user ) ); - $this->assertEquals( array( array( 'badaccess-group0' ), - array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'editprotected' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - $this->assertEquals( array( array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'editprotected' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'edit', - $this->user ) ); - - $this->setUserPerm( array( "edit", "editprotected" ) ); - $this->assertEquals( false, - $this->title->quickUserCan( 'bogus', $this->user ) ); - $this->assertEquals( false, - $this->title->quickUserCan( 'edit', $this->user ) ); - $this->assertEquals( array( array( 'badaccess-group0' ), - array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'protect' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - $this->assertEquals( array( array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'protect' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'edit', - $this->user ) ); - } - - public function testCascadingSourcesRestrictions() { - $this->setTitle( NS_MAIN, "test page" ); - $this->setUserPerm( array( "edit", "bogus" ) ); - - $this->title->mCascadeSources = array( Title::makeTitle( NS_MAIN, "Bogus" ), Title::makeTitle( NS_MAIN, "UnBogus" ) ); - $this->title->mCascadingRestrictions = array( "bogus" => array( 'bogus', "sysop", "protect", "" ) ); - - $this->assertEquals( false, - $this->title->userCan( 'bogus', $this->user ) ); - $this->assertEquals( array( array( "cascadeprotected", 2, "* [[:Bogus]]\n* [[:UnBogus]]\n" ), - array( "cascadeprotected", 2, "* [[:Bogus]]\n* [[:UnBogus]]\n" ), - array( "cascadeprotected", 2, "* [[:Bogus]]\n* [[:UnBogus]]\n" ) ), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - - $this->assertEquals( true, - $this->title->userCan( 'edit', $this->user ) ); - $this->assertEquals( array(), - $this->title->getUserPermissionsErrors( 'edit', $this->user ) ); - } - - /** - * @todo This test method should be split up into separate test methods and - * data providers - */ - public function testActionPermissions() { - $this->setUserPerm( array( "createpage" ) ); - $this->setTitle( NS_MAIN, "test page" ); - $this->title->mTitleProtection['pt_create_perm'] = ''; - $this->title->mTitleProtection['pt_user'] = $this->user->getID(); - $this->title->mTitleProtection['pt_expiry'] = wfGetDB( DB_SLAVE )->getInfinity(); - $this->title->mTitleProtection['pt_reason'] = 'test'; - $this->title->mCascadeRestriction = false; - - $this->assertEquals( array( array( 'titleprotected', 'Useruser', 'test' ) ), - $this->title->getUserPermissionsErrors( 'create', $this->user ) ); - $this->assertEquals( false, - $this->title->userCan( 'create', $this->user ) ); - - $this->title->mTitleProtection['pt_create_perm'] = 'sysop'; - $this->setUserPerm( array( 'createpage', 'protect' ) ); - $this->assertEquals( array( array( 'titleprotected', 'Useruser', 'test' ) ), - $this->title->getUserPermissionsErrors( 'create', $this->user ) ); - $this->assertEquals( false, - $this->title->userCan( 'create', $this->user ) ); - - $this->setUserPerm( array( 'createpage', 'editprotected' ) ); - $this->assertEquals( array(), - $this->title->getUserPermissionsErrors( 'create', $this->user ) ); - $this->assertEquals( true, - $this->title->userCan( 'create', $this->user ) ); - - $this->setUserPerm( array( 'createpage' ) ); - $this->assertEquals( array( array( 'titleprotected', 'Useruser', 'test' ) ), - $this->title->getUserPermissionsErrors( 'create', $this->user ) ); - $this->assertEquals( false, - $this->title->userCan( 'create', $this->user ) ); - - $this->setTitle( NS_MEDIA, "test page" ); - $this->setUserPerm( array( "move" ) ); - $this->assertEquals( false, - $this->title->userCan( 'move', $this->user ) ); - $this->assertEquals( array( array( 'immobile-source-namespace', 'Media' ) ), - $this->title->getUserPermissionsErrors( 'move', $this->user ) ); - - $this->setTitle( NS_HELP, "test page" ); - $this->assertEquals( array(), - $this->title->getUserPermissionsErrors( 'move', $this->user ) ); - $this->assertEquals( true, - $this->title->userCan( 'move', $this->user ) ); - - $this->title->mInterwiki = "no"; - $this->assertEquals( array( array( 'immobile-source-page' ) ), - $this->title->getUserPermissionsErrors( 'move', $this->user ) ); - $this->assertEquals( false, - $this->title->userCan( 'move', $this->user ) ); - - $this->setTitle( NS_MEDIA, "test page" ); - $this->assertEquals( false, - $this->title->userCan( 'move-target', $this->user ) ); - $this->assertEquals( array( array( 'immobile-target-namespace', 'Media' ) ), - $this->title->getUserPermissionsErrors( 'move-target', $this->user ) ); - - $this->setTitle( NS_HELP, "test page" ); - $this->assertEquals( array(), - $this->title->getUserPermissionsErrors( 'move-target', $this->user ) ); - $this->assertEquals( true, - $this->title->userCan( 'move-target', $this->user ) ); - - $this->title->mInterwiki = "no"; - $this->assertEquals( array( array( 'immobile-target-page' ) ), - $this->title->getUserPermissionsErrors( 'move-target', $this->user ) ); - $this->assertEquals( false, - $this->title->userCan( 'move-target', $this->user ) ); - } - - public function testUserBlock() { - global $wgEmailConfirmToEdit, $wgEmailAuthentication; - $wgEmailConfirmToEdit = true; - $wgEmailAuthentication = true; - - $this->setUserPerm( array( "createpage", "move" ) ); - $this->setTitle( NS_HELP, "test page" ); - - # $short - $this->assertEquals( array( array( 'confirmedittext' ) ), - $this->title->getUserPermissionsErrors( 'move-target', $this->user ) ); - $wgEmailConfirmToEdit = false; - $this->assertEquals( true, $this->title->userCan( 'move-target', $this->user ) ); - - # $wgEmailConfirmToEdit && !$user->isEmailConfirmed() && $action != 'createaccount' - $this->assertEquals( array(), - $this->title->getUserPermissionsErrors( 'move-target', - $this->user ) ); - - global $wgLang; - $prev = time(); - $now = time() + 120; - $this->user->mBlockedby = $this->user->getId(); - $this->user->mBlock = new Block( '127.0.8.1', 0, $this->user->getId(), - 'no reason given', $prev + 3600, 1, 0 ); - $this->user->mBlock->mTimestamp = 0; - $this->assertEquals( array( array( 'autoblockedtext', - '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1', - 'Useruser', null, 'infinite', '127.0.8.1', - $wgLang->timeanddate( wfTimestamp( TS_MW, $prev ), true ) ) ), - $this->title->getUserPermissionsErrors( 'move-target', - $this->user ) ); - - $this->assertEquals( false, $this->title->userCan( 'move-target', $this->user ) ); - // quickUserCan should ignore user blocks - $this->assertEquals( true, $this->title->quickUserCan( 'move-target', $this->user ) ); - - global $wgLocalTZoffset; - $wgLocalTZoffset = -60; - $this->user->mBlockedby = $this->user->getName(); - $this->user->mBlock = new Block( '127.0.8.1', 0, $this->user->getId(), - 'no reason given', $now, 0, 10 ); - $this->assertEquals( array( array( 'blockedtext', - '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1', - 'Useruser', null, '23:00, 31 December 1969', '127.0.8.1', - $wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ) ), - $this->title->getUserPermissionsErrors( 'move-target', $this->user ) ); - # $action != 'read' && $action != 'createaccount' && $user->isBlockedFrom( $this ) - # $user->blockedFor() == '' - # $user->mBlock->mExpiry == 'infinity' - } -} diff --git a/tests/phpunit/includes/TitleTest.php b/tests/phpunit/includes/TitleTest.php deleted file mode 100644 index 6bfe5453..00000000 --- a/tests/phpunit/includes/TitleTest.php +++ /dev/null @@ -1,485 +0,0 @@ -setMwGlobals( array( - 'wgLanguageCode' => 'en', - 'wgContLang' => Language::factory( 'en' ), - // User language - 'wgLang' => Language::factory( 'en' ), - 'wgAllowUserJs' => false, - 'wgDefaultLanguageVariant' => false, - ) ); - } - - /** - * @covers Title::legalChars - */ - public function testLegalChars() { - $titlechars = Title::legalChars(); - - foreach ( range( 1, 255 ) as $num ) { - $chr = chr( $num ); - if ( strpos( "#[]{}<>|", $chr ) !== false || preg_match( "/[\\x00-\\x1f\\x7f]/", $chr ) ) { - $this->assertFalse( (bool)preg_match( "/[$titlechars]/", $chr ), "chr($num) = $chr is not a valid titlechar" ); - } else { - $this->assertTrue( (bool)preg_match( "/[$titlechars]/", $chr ), "chr($num) = $chr is a valid titlechar" ); - } - } - } - - /** - * See also mediawiki.Title.test.js - * @covers Title::secureAndSplit - * @todo This method should be split into 2 separate tests each with a provider - */ - public function testSecureAndSplit() { - // Valid - foreach ( array( - 'Sandbox', - 'A "B"', - 'A \'B\'', - '.com', - '~', - '"', - '\'', - 'Talk:Sandbox', - 'Talk:Foo:Sandbox', - 'File:Example.svg', - 'File_talk:Example.svg', - 'Foo/.../Sandbox', - 'Sandbox/...', - 'A~~', - // Length is 256 total, but only title part matters - 'Category:' . str_repeat( 'x', 248 ), - str_repeat( 'x', 252 ) - ) as $text ) { - $this->assertInstanceOf( 'Title', Title::newFromText( $text ), "Valid: $text" ); - } - - // Invalid - foreach ( array( - '', - '__ __', - ' __ ', - // Bad characters forbidden regardless of wgLegalTitleChars - 'A [ B', - 'A ] B', - 'A { B', - 'A } B', - 'A < B', - 'A > B', - 'A | B', - // URL encoding - 'A%20B', - 'A%23B', - 'A%2523B', - // XML/HTML character entity references - // Note: Commented out because they are not marked invalid by the PHP test as - // Title::newFromText runs Sanitizer::decodeCharReferencesAndNormalize first. - //'A é B', - //'A é B', - //'A é B', - // Subject of NS_TALK does not roundtrip to NS_MAIN - 'Talk:File:Example.svg', - // Directory navigation - '.', - '..', - './Sandbox', - '../Sandbox', - 'Foo/./Sandbox', - 'Foo/../Sandbox', - 'Sandbox/.', - 'Sandbox/..', - // Tilde - 'A ~~~ Name', - 'A ~~~~ Signature', - 'A ~~~~~ Timestamp', - str_repeat( 'x', 256 ), - // Namespace prefix without actual title - // ':', // bug 54044 - 'Talk:', - 'Category: ', - 'Category: #bar' - ) as $text ) { - $this->assertNull( Title::newFromText( $text ), "Invalid: $text" ); - } - } - - public static function provideConvertByteClassToUnicodeClass() { - return array( - array( - ' %!"$&\'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF+', - ' %!"$&\'()*,\\-./0-9:;=?@A-Z\\\\\\^_`a-z~+\\u0080-\\uFFFF', - ), - array( - 'QWERTYf-\\xFF+', - 'QWERTYf-\\x7F+\\u0080-\\uFFFF', - ), - array( - 'QWERTY\\x66-\\xFD+', - 'QWERTYf-\\x7F+\\u0080-\\uFFFF', - ), - array( - 'QWERTYf-y+', - 'QWERTYf-y+', - ), - array( - 'QWERTYf-\\x80+', - 'QWERTYf-\\x7F+\\u0080-\\uFFFF', - ), - array( - 'QWERTY\\x66-\\x80+\\x23', - 'QWERTYf-\\x7F+#\\u0080-\\uFFFF', - ), - array( - 'QWERTY\\x66-\\x80+\\xD3', - 'QWERTYf-\\x7F+\\u0080-\\uFFFF', - ), - array( - '\\\\\\x99', - '\\\\\\u0080-\\uFFFF', - ), - array( - '-\\x99', - '\\-\\u0080-\\uFFFF', - ), - array( - 'QWERTY\\-\\x99', - 'QWERTY\\-\\u0080-\\uFFFF', - ), - array( - '\\\\x99', - '\\\\x99', - ), - array( - 'A-\\x9F', - 'A-\\x7F\\u0080-\\uFFFF', - ), - array( - '\\x66-\\x77QWERTY\\x88-\\x91FXZ', - 'f-wQWERTYFXZ\\u0080-\\uFFFF', - ), - array( - '\\x66-\\x99QWERTY\\xAA-\\xEEFXZ', - 'f-\\x7FQWERTYFXZ\\u0080-\\uFFFF', - ), - ); - } - - /** - * @dataProvider provideConvertByteClassToUnicodeClass - * @covers Title::convertByteClassToUnicodeClass - */ - public function testConvertByteClassToUnicodeClass( $byteClass, $unicodeClass ) { - $this->assertEquals( $unicodeClass, Title::convertByteClassToUnicodeClass( $byteClass ) ); - } - - /** - * @dataProvider provideBug31100 - * @covers Title::fixSpecialName - */ - public function testBug31100FixSpecialName( $text, $expectedParam ) { - $title = Title::newFromText( $text ); - $fixed = $title->fixSpecialName(); - $stuff = explode( '/', $fixed->getDBkey(), 2 ); - if ( count( $stuff ) == 2 ) { - $par = $stuff[1]; - } else { - $par = null; - } - $this->assertEquals( $expectedParam, $par, "Bug 31100 regression check: Title->fixSpecialName() should preserve parameter" ); - } - - public static function provideBug31100() { - return array( - array( 'Special:Version', null ), - array( 'Special:Version/', '' ), - array( 'Special:Version/param', 'param' ), - ); - } - - /** - * Auth-less test of Title::isValidMoveOperation - * - * @group Database - * @param string $source - * @param string $target - * @param array|string|bool $expected Required error - * @dataProvider provideTestIsValidMoveOperation - * @covers Title::isValidMoveOperation - */ - public function testIsValidMoveOperation( $source, $target, $expected ) { - $title = Title::newFromText( $source ); - $nt = Title::newFromText( $target ); - $errors = $title->isValidMoveOperation( $nt, false ); - if ( $expected === true ) { - $this->assertTrue( $errors ); - } else { - $errors = $this->flattenErrorsArray( $errors ); - foreach ( (array)$expected as $error ) { - $this->assertContains( $error, $errors ); - } - } - } - - /** - * Provides test parameter values for testIsValidMoveOperation() - */ - public function dataTestIsValidMoveOperation() { - return array( - array( 'Test', 'Test', 'selfmove' ), - array( 'File:Test.jpg', 'Page', 'imagenocrossnamespace' ) - ); - } - - /** - * Auth-less test of Title::userCan - * - * @param array $whitelistRegexp - * @param string $source - * @param string $action - * @param array|string|bool $expected Required error - * - * @covers Title::checkReadPermissions - * @dataProvider dataWgWhitelistReadRegexp - */ - public function testWgWhitelistReadRegexp( $whitelistRegexp, $source, $action, $expected ) { - // $wgWhitelistReadRegexp must be an array. Since the provided test cases - // usually have only one regex, it is more concise to write the lonely regex - // as a string. Thus we cast to an array() to honor $wgWhitelistReadRegexp - // type requisite. - if ( is_string( $whitelistRegexp ) ) { - $whitelistRegexp = array( $whitelistRegexp ); - } - - $title = Title::newFromDBkey( $source ); - - global $wgGroupPermissions; - $oldPermissions = $wgGroupPermissions; - // Disallow all so we can ensure our regex works - $wgGroupPermissions = array(); - $wgGroupPermissions['*']['read'] = false; - - global $wgWhitelistRead; - $oldWhitelist = $wgWhitelistRead; - // Undo any LocalSettings explicite whitelists so they won't cause a - // failing test to succeed. Set it to some random non sense just - // to make sure we properly test Title::checkReadPermissions() - $wgWhitelistRead = array( 'some random non sense title' ); - - global $wgWhitelistReadRegexp; - $oldWhitelistRegexp = $wgWhitelistReadRegexp; - $wgWhitelistReadRegexp = $whitelistRegexp; - - // Just use $wgUser which in test is a user object for '127.0.0.1' - global $wgUser; - // Invalidate user rights cache to take in account $wgGroupPermissions - // change above. - $wgUser->clearInstanceCache(); - $errors = $title->userCan( $action, $wgUser ); - - // Restore globals - $wgGroupPermissions = $oldPermissions; - $wgWhitelistRead = $oldWhitelist; - $wgWhitelistReadRegexp = $oldWhitelistRegexp; - - if ( is_bool( $expected ) ) { - # Forge the assertion message depending on the assertion expectation - $allowableness = $expected - ? " should be allowed" - : " should NOT be allowed"; - $this->assertEquals( $expected, $errors, "User action '$action' on [[$source]] $allowableness." ); - } else { - $errors = $this->flattenErrorsArray( $errors ); - foreach ( (array)$expected as $error ) { - $this->assertContains( $error, $errors ); - } - } - } - - /** - * Provides test parameter values for testWgWhitelistReadRegexp() - */ - public function dataWgWhitelistReadRegexp() { - $ALLOWED = true; - $DISALLOWED = false; - - return array( - // Everything, if this doesn't work, we're really in trouble - array( '/.*/', 'Main_Page', 'read', $ALLOWED ), - array( '/.*/', 'Main_Page', 'edit', $DISALLOWED ), - - // We validate against the title name, not the db key - array( '/^Main_Page$/', 'Main_Page', 'read', $DISALLOWED ), - // Main page - array( '/^Main/', 'Main_Page', 'read', $ALLOWED ), - array( '/^Main.*/', 'Main_Page', 'read', $ALLOWED ), - // With spaces - array( '/Mic\sCheck/', 'Mic Check', 'read', $ALLOWED ), - // Unicode multibyte - // ...without unicode modifier - array( '/Unicode Test . Yes/', 'Unicode Test Ñ Yes', 'read', $DISALLOWED ), - // ...with unicode modifier - array( '/Unicode Test . Yes/u', 'Unicode Test Ñ Yes', 'read', $ALLOWED ), - // Case insensitive - array( '/MiC ChEcK/', 'mic check', 'read', $DISALLOWED ), - array( '/MiC ChEcK/i', 'mic check', 'read', $ALLOWED ), - - // From DefaultSettings.php: - array( "@^UsEr.*@i", 'User is banned', 'read', $ALLOWED ), - array( "@^UsEr.*@i", 'User:John Doe', 'read', $ALLOWED ), - - // With namespaces: - array( '/^Special:NewPages$/', 'Special:NewPages', 'read', $ALLOWED ), - array( null, 'Special:Newpages', 'read', $DISALLOWED ), - - ); - } - - public function flattenErrorsArray( $errors ) { - $result = array(); - foreach ( $errors as $error ) { - $result[] = $error[0]; - } - - return $result; - } - - public static function provideTestIsValidMoveOperation() { - return array( - array( 'Test', 'Test', 'selfmove' ), - array( 'File:Test.jpg', 'Page', 'imagenocrossnamespace' ) - ); - } - - /** - * @dataProvider provideGetPageViewLanguage - * @covers Title::getPageViewLanguage - */ - public function testGetPageViewLanguage( $expected, $titleText, $contLang, $lang, $variant, $msg = '' ) { - global $wgLanguageCode, $wgContLang, $wgLang, $wgDefaultLanguageVariant, $wgAllowUserJs; - - // Setup environnement for this test - $wgLanguageCode = $contLang; - $wgContLang = Language::factory( $contLang ); - $wgLang = Language::factory( $lang ); - $wgDefaultLanguageVariant = $variant; - $wgAllowUserJs = true; - - $title = Title::newFromText( $titleText ); - $this->assertInstanceOf( 'Title', $title, - "Test must be passed a valid title text, you gave '$titleText'" - ); - $this->assertEquals( $expected, - $title->getPageViewLanguage()->getCode(), - $msg - ); - } - - public static function provideGetPageViewLanguage() { - # Format: - # - expected - # - Title name - # - wgContLang (expected in most case) - # - wgLang (on some specific pages) - # - wgDefaultLanguageVariant - # - Optional message - return array( - array( 'fr', 'Help:I_need_somebody', 'fr', 'fr', false ), - array( 'es', 'Help:I_need_somebody', 'es', 'zh-tw', false ), - array( 'zh', 'Help:I_need_somebody', 'zh', 'zh-tw', false ), - - array( 'es', 'Help:I_need_somebody', 'es', 'zh-tw', 'zh-cn' ), - array( 'es', 'MediaWiki:About', 'es', 'zh-tw', 'zh-cn' ), - array( 'es', 'MediaWiki:About/', 'es', 'zh-tw', 'zh-cn' ), - array( 'de', 'MediaWiki:About/de', 'es', 'zh-tw', 'zh-cn' ), - array( 'en', 'MediaWiki:Common.js', 'es', 'zh-tw', 'zh-cn' ), - array( 'en', 'MediaWiki:Common.css', 'es', 'zh-tw', 'zh-cn' ), - array( 'en', 'User:JohnDoe/Common.js', 'es', 'zh-tw', 'zh-cn' ), - array( 'en', 'User:JohnDoe/Monobook.css', 'es', 'zh-tw', 'zh-cn' ), - - array( 'zh-cn', 'Help:I_need_somebody', 'zh', 'zh-tw', 'zh-cn' ), - array( 'zh', 'MediaWiki:About', 'zh', 'zh-tw', 'zh-cn' ), - array( 'zh', 'MediaWiki:About/', 'zh', 'zh-tw', 'zh-cn' ), - array( 'de', 'MediaWiki:About/de', 'zh', 'zh-tw', 'zh-cn' ), - array( 'zh-cn', 'MediaWiki:About/zh-cn', 'zh', 'zh-tw', 'zh-cn' ), - array( 'zh-tw', 'MediaWiki:About/zh-tw', 'zh', 'zh-tw', 'zh-cn' ), - array( 'en', 'MediaWiki:Common.js', 'zh', 'zh-tw', 'zh-cn' ), - array( 'en', 'MediaWiki:Common.css', 'zh', 'zh-tw', 'zh-cn' ), - array( 'en', 'User:JohnDoe/Common.js', 'zh', 'zh-tw', 'zh-cn' ), - array( 'en', 'User:JohnDoe/Monobook.css', 'zh', 'zh-tw', 'zh-cn' ), - - array( 'zh-tw', 'Special:NewPages', 'es', 'zh-tw', 'zh-cn' ), - array( 'zh-tw', 'Special:NewPages', 'zh', 'zh-tw', 'zh-cn' ), - - ); - } - - /** - * @dataProvider provideBaseTitleCases - * @covers Title::getBaseText - */ - public function testGetBaseText( $title, $expected, $msg = '' ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expected, - $title->getBaseText(), - $msg - ); - } - - public static function provideBaseTitleCases() { - return array( - # Title, expected base, optional message - array( 'User:John_Doe/subOne/subTwo', 'John Doe/subOne' ), - array( 'User:Foo/Bar/Baz', 'Foo/Bar' ), - ); - } - - /** - * @dataProvider provideRootTitleCases - * @covers Title::getRootText - */ - public function testGetRootText( $title, $expected, $msg = '' ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expected, - $title->getRootText(), - $msg - ); - } - - public static function provideRootTitleCases() { - return array( - # Title, expected base, optional message - array( 'User:John_Doe/subOne/subTwo', 'John Doe' ), - array( 'User:Foo/Bar/Baz', 'Foo' ), - ); - } - - /** - * @todo Handle $wgNamespacesWithSubpages cases - * @dataProvider provideSubpageTitleCases - * @covers Title::getSubpageText - */ - public function testGetSubpageText( $title, $expected, $msg = '' ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expected, - $title->getSubpageText(), - $msg - ); - } - - public static function provideSubpageTitleCases() { - return array( - # Title, expected base, optional message - array( 'User:John_Doe/subOne/subTwo', 'subTwo' ), - array( 'User:John_Doe/subOne', 'subOne' ), - ); - } -} diff --git a/tests/phpunit/includes/UIDGeneratorTest.php b/tests/phpunit/includes/UIDGeneratorTest.php deleted file mode 100644 index 8f78ae51..00000000 --- a/tests/phpunit/includes/UIDGeneratorTest.php +++ /dev/null @@ -1,98 +0,0 @@ -assertEquals( true, ctype_digit( $id ), "UID made of digit characters" ); - $this->assertLessThanOrEqual( $digitlen, strlen( $id ), - "UID has the right number of digits" ); - $this->assertLessThanOrEqual( $bits, strlen( wfBaseConvert( $id, 10, 2 ) ), - "UID has the right number of bits" ); - - $ids = array(); - for ( $i = 0; $i < 300; $i++ ) { - $ids[] = call_user_func( array( 'UIDGenerator', $method ) ); - } - - $lastId = array_shift( $ids ); - if ( $hostbits ) { - $lastHost = substr( wfBaseConvert( $lastId, 10, 2, $bits ), -$hostbits ); - } - - $this->assertArrayEquals( array_unique( $ids ), $ids, "All generated IDs are unique." ); - - foreach ( $ids as $id ) { - $id_bin = wfBaseConvert( $id, 10, 2 ); - $lastId_bin = wfBaseConvert( $lastId, 10, 2 ); - - $this->assertGreaterThanOrEqual( - substr( $id_bin, 0, $tbits ), - substr( $lastId_bin, 0, $tbits ), - "New ID timestamp ($id_bin) >= prior one ($lastId_bin)." ); - - if ( $hostbits ) { - $this->assertEquals( - substr( $id_bin, 0, -$hostbits ), - substr( $lastId_bin, 0, -$hostbits ), - "Host ID of ($id_bin) is same as prior one ($lastId_bin)." ); - } - - $lastId = $id; - } - } - - /** - * array( method, length, bits, hostbits ) - * NOTE: When adding a new method name here please update the covers tags for the tests! - */ - public static function provider_testTimestampedUID() { - return array( - array( 'newTimestampedUID128', 39, 128, 46, 48 ), - array( 'newTimestampedUID128', 39, 128, 46, 48 ), - array( 'newTimestampedUID88', 27, 88, 46, 32 ), - ); - } - - /** - * @covers UIDGenerator::newUUIDv4 - */ - public function testUUIDv4() { - for ( $i = 0; $i < 100; $i++ ) { - $id = UIDGenerator::newUUIDv4(); - $this->assertEquals( true, - preg_match( '!^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$!', $id ), - "UID $id has the right format" ); - } - } - - /** - * @covers UIDGenerator::newRawUUIDv4 - */ - public function testRawUUIDv4() { - for ( $i = 0; $i < 100; $i++ ) { - $id = UIDGenerator::newRawUUIDv4(); - $this->assertEquals( true, - preg_match( '!^[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15}$!', $id ), - "UID $id has the right format" ); - } - } - - /** - * @covers UIDGenerator::newRawUUIDv4 - */ - public function testRawUUIDv4QuickRand() { - for ( $i = 0; $i < 100; $i++ ) { - $id = UIDGenerator::newRawUUIDv4( UIDGenerator::QUICK_RAND ); - $this->assertEquals( true, - preg_match( '!^[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15}$!', $id ), - "UID $id has the right format" ); - } - } - -} diff --git a/tests/phpunit/includes/UserMailerTest.php b/tests/phpunit/includes/UserMailerTest.php deleted file mode 100644 index 278edfaa..00000000 --- a/tests/phpunit/includes/UserMailerTest.php +++ /dev/null @@ -1,14 +0,0 @@ -assertEquals( - "=?UTF-8?Q?=C4=88u=20legebla=3F?=", - UserMailer::quotedPrintable( "\xc4\x88u legebla?", "UTF-8" ) ); - } - -} \ No newline at end of file diff --git a/tests/phpunit/includes/UserTest.php b/tests/phpunit/includes/UserTest.php deleted file mode 100644 index ff33e825..00000000 --- a/tests/phpunit/includes/UserTest.php +++ /dev/null @@ -1,237 +0,0 @@ -setMwGlobals( array( - 'wgGroupPermissions' => array(), - 'wgRevokePermissions' => array(), - ) ); - - $this->setUpPermissionGlobals(); - - $this->user = new User; - $this->user->addGroup( 'unittesters' ); - } - - private function setUpPermissionGlobals() { - global $wgGroupPermissions, $wgRevokePermissions; - - # Data for regular $wgGroupPermissions test - $wgGroupPermissions['unittesters'] = array( - 'test' => true, - 'runtest' => true, - 'writetest' => false, - 'nukeworld' => false, - ); - $wgGroupPermissions['testwriters'] = array( - 'test' => true, - 'writetest' => true, - 'modifytest' => true, - ); - - # Data for regular $wgRevokePermissions test - $wgRevokePermissions['formertesters'] = array( - 'runtest' => true, - ); - - # For the options test - $wgGroupPermissions['*'] = array( - 'editmyoptions' => true, - ); - } - - /** - * @covers User::getGroupPermissions - */ - public function testGroupPermissions() { - $rights = User::getGroupPermissions( array( 'unittesters' ) ); - $this->assertContains( 'runtest', $rights ); - $this->assertNotContains( 'writetest', $rights ); - $this->assertNotContains( 'modifytest', $rights ); - $this->assertNotContains( 'nukeworld', $rights ); - - $rights = User::getGroupPermissions( array( 'unittesters', 'testwriters' ) ); - $this->assertContains( 'runtest', $rights ); - $this->assertContains( 'writetest', $rights ); - $this->assertContains( 'modifytest', $rights ); - $this->assertNotContains( 'nukeworld', $rights ); - } - - /** - * @covers User::getGroupPermissions - */ - public function testRevokePermissions() { - $rights = User::getGroupPermissions( array( 'unittesters', 'formertesters' ) ); - $this->assertNotContains( 'runtest', $rights ); - $this->assertNotContains( 'writetest', $rights ); - $this->assertNotContains( 'modifytest', $rights ); - $this->assertNotContains( 'nukeworld', $rights ); - } - - /** - * @covers User::getRights - */ - public function testUserPermissions() { - $rights = $this->user->getRights(); - $this->assertContains( 'runtest', $rights ); - $this->assertNotContains( 'writetest', $rights ); - $this->assertNotContains( 'modifytest', $rights ); - $this->assertNotContains( 'nukeworld', $rights ); - } - - /** - * @dataProvider provideGetGroupsWithPermission - * @covers User::getGroupsWithPermission - */ - public function testGetGroupsWithPermission( $expected, $right ) { - $result = User::getGroupsWithPermission( $right ); - sort( $result ); - sort( $expected ); - - $this->assertEquals( $expected, $result, "Groups with permission $right" ); - } - - public static function provideGetGroupsWithPermission() { - return array( - array( - array( 'unittesters', 'testwriters' ), - 'test' - ), - array( - array( 'unittesters' ), - 'runtest' - ), - array( - array( 'testwriters' ), - 'writetest' - ), - array( - array( 'testwriters' ), - 'modifytest' - ), - ); - } - - /** - * @dataProvider provideUserNames - * @covers User::isValidUserName - */ - public function testIsValidUserName( $username, $result, $message ) { - $this->assertEquals( $this->user->isValidUserName( $username ), $result, $message ); - } - - public static function provideUserNames() { - return array( - array( '', false, 'Empty string' ), - array( ' ', false, 'Blank space' ), - array( 'abcd', false, 'Starts with small letter' ), - array( 'Ab/cd', false, 'Contains slash' ), - array( 'Ab cd', true, 'Whitespace' ), - array( '192.168.1.1', false, 'IP' ), - array( 'User:Abcd', false, 'Reserved Namespace' ), - array( '12abcd232', true, 'Starts with Numbers' ), - array( '?abcd', true, 'Start with ? mark' ), - array( '#abcd', false, 'Start with #' ), - array( 'Abcdകഖഗഘ', true, ' Mixed scripts' ), - array( 'ജോസ്‌തോമസ്', false, 'ZWNJ- Format control character' ), - array( 'Ab cd', false, ' Ideographic space' ), - ); - } - - /** - * Test, if for all rights a right- message exist, - * which is used on Special:ListGroupRights as help text - * Extensions and core - */ - public function testAllRightsWithMessage() { - //Getting all user rights, for core: User::$mCoreRights, for extensions: $wgAvailableRights - $allRights = User::getAllRights(); - $allMessageKeys = Language::getMessageKeysFor( 'en' ); - - $rightsWithMessage = array(); - foreach ( $allMessageKeys as $message ) { - // === 0: must be at beginning of string (position 0) - if ( strpos( $message, 'right-' ) === 0 ) { - $rightsWithMessage[] = substr( $message, strlen( 'right-' ) ); - } - } - - sort( $allRights ); - sort( $rightsWithMessage ); - - $this->assertEquals( - $allRights, - $rightsWithMessage, - 'Each user rights (core/extensions) has a corresponding right- message.' - ); - } - - /** - * Test User::editCount - * @group medium - * @covers User::getEditCount - */ - public function testEditCount() { - $user = User::newFromName( 'UnitTestUser' ); - $user->loadDefaults(); - $user->addToDatabase(); - - // let the user have a few (3) edits - $page = WikiPage::factory( Title::newFromText( 'Help:UserTest_EditCount' ) ); - for ( $i = 0; $i < 3; $i++ ) { - $page->doEdit( (string)$i, 'test', 0, false, $user ); - } - - $user->clearInstanceCache(); - $this->assertEquals( 3, $user->getEditCount(), 'After three edits, the user edit count should be 3' ); - - // increase the edit count and clear the cache - $user->incEditCount(); - - $user->clearInstanceCache(); - $this->assertEquals( 4, $user->getEditCount(), 'After increasing the edit count manually, the user edit count should be 4' ); - } - - /** - * Test changing user options. - * @covers User::setOption - * @covers User::getOption - */ - public function testOptions() { - $user = User::newFromName( 'UnitTestUser' ); - $user->addToDatabase(); - - $user->setOption( 'someoption', 'test' ); - $user->setOption( 'cols', 200 ); - $user->saveSettings(); - - $user = User::newFromName( 'UnitTestUser' ); - $this->assertEquals( 'test', $user->getOption( 'someoption' ) ); - $this->assertEquals( 200, $user->getOption( 'cols' ) ); - } - - /** - * Bug 37963 - * Make sure defaults are loaded when setOption is called. - * @covers User::loadOptions - */ - public function testAnonOptions() { - global $wgDefaultUserOptions; - $this->user->setOption( 'someoption', 'test' ); - $this->assertEquals( $wgDefaultUserOptions['cols'], $this->user->getOption( 'cols' ) ); - $this->assertEquals( 'test', $this->user->getOption( 'someoption' ) ); - } -} diff --git a/tests/phpunit/includes/WebRequestTest.php b/tests/phpunit/includes/WebRequestTest.php deleted file mode 100644 index f8ed14b6..00000000 --- a/tests/phpunit/includes/WebRequestTest.php +++ /dev/null @@ -1,310 +0,0 @@ -oldServer = $_SERVER; - } - - protected function tearDown() { - $_SERVER = $this->oldServer; - - parent::tearDown(); - } - - /** - * @dataProvider provideDetectServer - * @covers WebRequest::detectServer - */ - public function testDetectServer( $expected, $input, $description ) { - $_SERVER = $input; - $result = WebRequest::detectServer(); - $this->assertEquals( $expected, $result, $description ); - } - - public static function provideDetectServer() { - return array( - array( - 'http://x', - array( - 'HTTP_HOST' => 'x' - ), - 'Host header' - ), - array( - 'https://x', - array( - 'HTTP_HOST' => 'x', - 'HTTPS' => 'on', - ), - 'Host header with secure' - ), - array( - 'http://x', - array( - 'HTTP_HOST' => 'x', - 'SERVER_PORT' => 80, - ), - 'Default SERVER_PORT', - ), - array( - 'http://x', - array( - 'HTTP_HOST' => 'x', - 'HTTPS' => 'off', - ), - 'Secure off' - ), - array( - 'http://y', - array( - 'SERVER_NAME' => 'y', - ), - 'Server name' - ), - array( - 'http://x', - array( - 'HTTP_HOST' => 'x', - 'SERVER_NAME' => 'y', - ), - 'Host server name precedence' - ), - array( - 'http://[::1]:81', - array( - 'HTTP_HOST' => '[::1]', - 'SERVER_NAME' => '::1', - 'SERVER_PORT' => '81', - ), - 'Apache bug 26005' - ), - array( - 'http://localhost', - array( - 'SERVER_NAME' => '[2001' - ), - 'Kind of like lighttpd per commit message in MW r83847', - ), - array( - 'http://[2a01:e35:2eb4:1::2]:777', - array( - 'SERVER_NAME' => '[2a01:e35:2eb4:1::2]:777' - ), - 'Possible lighttpd environment per bug 14977 comment 13', - ), - ); - } - - /** - * @dataProvider provideGetIP - * @covers WebRequest::getIP - */ - public function testGetIP( $expected, $input, $squid, $xffList, $private, $description ) { - $_SERVER = $input; - $this->setMwGlobals( array( - 'wgSquidServersNoPurge' => $squid, - 'wgUsePrivateIPs' => $private, - 'wgHooks' => array( - 'IsTrustedProxy' => array( - function( &$ip, &$trusted ) use ( $xffList ) { - $trusted = $trusted || in_array( $ip, $xffList ); - return true; - } - ) - ) - ) ); - - $request = new WebRequest(); - $result = $request->getIP(); - $this->assertEquals( $expected, $result, $description ); - } - - public static function provideGetIP() { - return array( - array( - '127.0.0.1', - array( - 'REMOTE_ADDR' => '127.0.0.1' - ), - array(), - array(), - false, - 'Simple IPv4' - ), - array( - '::1', - array( - 'REMOTE_ADDR' => '::1' - ), - array(), - array(), - false, - 'Simple IPv6' - ), - array( - '12.0.0.1', - array( - 'REMOTE_ADDR' => 'abcd:0001:002:03:4:555:6666:7777', - 'HTTP_X_FORWARDED_FOR' => '12.0.0.1, abcd:0001:002:03:4:555:6666:7777', - ), - array( 'ABCD:1:2:3:4:555:6666:7777' ), - array(), - false, - 'IPv6 normalisation' - ), - array( - '12.0.0.3', - array( - 'REMOTE_ADDR' => '12.0.0.1', - 'HTTP_X_FORWARDED_FOR' => '12.0.0.3, 12.0.0.2' - ), - array( '12.0.0.1', '12.0.0.2' ), - array(), - false, - 'With X-Forwaded-For' - ), - array( - '12.0.0.1', - array( - 'REMOTE_ADDR' => '12.0.0.1', - 'HTTP_X_FORWARDED_FOR' => '12.0.0.3, 12.0.0.2' - ), - array(), - array(), - false, - 'With X-Forwaded-For and disallowed server' - ), - array( - '12.0.0.2', - array( - 'REMOTE_ADDR' => '12.0.0.1', - 'HTTP_X_FORWARDED_FOR' => '12.0.0.3, 12.0.0.2' - ), - array( '12.0.0.1' ), - array(), - false, - 'With multiple X-Forwaded-For and only one allowed server' - ), - array( - '10.0.0.3', - array( - 'REMOTE_ADDR' => '12.0.0.2', - 'HTTP_X_FORWARDED_FOR' => '10.0.0.4, 10.0.0.3, 12.0.0.2' - ), - array( '12.0.0.1', '12.0.0.2' ), - array(), - false, - 'With X-Forwaded-For and private IP (from cache proxy)' - ), - array( - '10.0.0.4', - array( - 'REMOTE_ADDR' => '12.0.0.2', - 'HTTP_X_FORWARDED_FOR' => '10.0.0.4, 10.0.0.3, 12.0.0.2' - ), - array( '12.0.0.1', '12.0.0.2', '10.0.0.3' ), - array(), - true, - 'With X-Forwaded-For and private IP (allowed)' - ), - array( - '10.0.0.4', - array( - 'REMOTE_ADDR' => '12.0.0.2', - 'HTTP_X_FORWARDED_FOR' => '10.0.0.4, 10.0.0.3, 12.0.0.2' - ), - array( '12.0.0.1', '12.0.0.2' ), - array( '10.0.0.3' ), - true, - 'With X-Forwaded-For and private IP (allowed)' - ), - array( - '10.0.0.3', - array( - 'REMOTE_ADDR' => '12.0.0.2', - 'HTTP_X_FORWARDED_FOR' => '10.0.0.4, 10.0.0.3, 12.0.0.2' - ), - array( '12.0.0.1', '12.0.0.2' ), - array( '10.0.0.3' ), - false, - 'With X-Forwaded-For and private IP (disallowed)' - ), - array( - '12.0.0.3', - array( - 'REMOTE_ADDR' => '12.0.0.1', - 'HTTP_X_FORWARDED_FOR' => '12.0.0.3, 12.0.0.2' - ), - array(), - array( '12.0.0.1', '12.0.0.2' ), - false, - 'With X-Forwaded-For' - ), - array( - '12.0.0.2', - array( - 'REMOTE_ADDR' => '12.0.0.1', - 'HTTP_X_FORWARDED_FOR' => '12.0.0.3, 12.0.0.2' - ), - array(), - array( '12.0.0.1' ), - false, - 'With multiple X-Forwaded-For and only one allowed server' - ), - array( - '12.0.0.2', - array( - 'REMOTE_ADDR' => '12.0.0.2', - 'HTTP_X_FORWARDED_FOR' => '10.0.0.3, 12.0.0.2' - ), - array(), - array( '12.0.0.2' ), - false, - 'With X-Forwaded-For and private IP and hook (disallowed)' - ), - ); - } - - /** - * @expectedException MWException - * @covers WebRequest::getIP - */ - public function testGetIpLackOfRemoteAddrThrowAnException() { - $request = new WebRequest(); - # Next call throw an exception about lacking an IP - $request->getIP(); - } - - public static function provideLanguageData() { - return array( - array( '', array(), 'Empty Accept-Language header' ), - array( 'en', array( 'en' => 1 ), 'One language' ), - array( 'en, ar', array( 'en' => 1, 'ar' => 1 ), 'Two languages listed in appearance order.' ), - array( 'zh-cn,zh-tw', array( 'zh-cn' => 1, 'zh-tw' => 1 ), 'Two equally prefered languages, listed in appearance order per rfc3282. Checks c9119' ), - array( 'es, en; q=0.5', array( 'es' => 1, 'en' => '0.5' ), 'Spanish as first language and English and second' ), - array( 'en; q=0.5, es', array( 'es' => 1, 'en' => '0.5' ), 'Less prefered language first' ), - array( 'fr, en; q=0.5, es', array( 'fr' => 1, 'es' => 1, 'en' => '0.5' ), 'Three languages' ), - array( 'en; q=0.5, es', array( 'es' => 1, 'en' => '0.5' ), 'Two languages' ), - array( 'en, zh;q=0', array( 'en' => 1 ), "It's Chinese to me" ), - array( 'es; q=1, pt;q=0.7, it; q=0.6, de; q=0.1, ru;q=0', array( 'es' => '1', 'pt' => '0.7', 'it' => '0.6', 'de' => '0.1' ), 'Preference for romance languages' ), - array( 'en-gb, en-us; q=1', array( 'en-gb' => 1, 'en-us' => '1' ), 'Two equally prefered English variants' ), - ); - } - - /** - * @dataProvider provideLanguageData - * @covers WebRequest::getAcceptLang - */ - public function testAcceptLang( $acceptLanguageHeader, $expectedLanguages, $description ) { - $_SERVER = array( 'HTTP_ACCEPT_LANGUAGE' => $acceptLanguageHeader ); - $request = new WebRequest(); - $this->assertSame( $request->getAcceptLang(), $expectedLanguages, $description ); - } -} diff --git a/tests/phpunit/includes/WikiPageTest.php b/tests/phpunit/includes/WikiPageTest.php deleted file mode 100644 index e0d786b9..00000000 --- a/tests/phpunit/includes/WikiPageTest.php +++ /dev/null @@ -1,1074 +0,0 @@ -tablesUsed = array_merge( - $this->tablesUsed, - array( 'page', - 'revision', - 'text', - - 'recentchanges', - 'logging', - - 'page_props', - 'pagelinks', - 'categorylinks', - 'langlinks', - 'externallinks', - 'imagelinks', - 'templatelinks', - 'iwlinks' ) ); - } - - protected function setUp() { - parent::setUp(); - $this->pages_to_delete = array(); - - LinkCache::singleton()->clear(); # avoid cached redirect status, etc - } - - protected function tearDown() { - foreach ( $this->pages_to_delete as $p ) { - /* @var $p WikiPage */ - - try { - if ( $p->exists() ) { - $p->doDeleteArticle( "testing done." ); - } - } catch ( MWException $ex ) { - // fail silently - } - } - parent::tearDown(); - } - - /** - * @param Title $title - * @param String $model - * @return WikiPage - */ - protected function newPage( $title, $model = null ) { - if ( is_string( $title ) ) { - $ns = $this->getDefaultWikitextNS(); - $title = Title::newFromText( $title, $ns ); - } - - $p = new WikiPage( $title ); - - $this->pages_to_delete[] = $p; - - return $p; - } - - /** - * @param String|Title|WikiPage $page - * @param String $text - * @param int $model - * - * @return WikiPage - */ - protected function createPage( $page, $text, $model = null ) { - if ( is_string( $page ) || $page instanceof Title ) { - $page = $this->newPage( $page, $model ); - } - - $content = ContentHandler::makeContent( $text, $page->getTitle(), $model ); - $page->doEditContent( $content, "testing", EDIT_NEW ); - - return $page; - } - - /** - * @covers WikiPage::doEditContent - */ - public function testDoEditContent() { - $page = $this->newPage( "WikiPageTest_testDoEditContent" ); - $title = $page->getTitle(); - - $content = ContentHandler::makeContent( "[[Lorem ipsum]] dolor sit amet, consetetur sadipscing elitr, sed diam " - . " nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.", - $title, CONTENT_MODEL_WIKITEXT ); - - $page->doEditContent( $content, "[[testing]] 1" ); - - $this->assertTrue( $title->getArticleID() > 0, "Title object should have new page id" ); - $this->assertTrue( $page->getId() > 0, "WikiPage should have new page id" ); - $this->assertTrue( $title->exists(), "Title object should indicate that the page now exists" ); - $this->assertTrue( $page->exists(), "WikiPage object should indicate that the page now exists" ); - - $id = $page->getId(); - - # ------------------------ - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) ); - $n = $res->numRows(); - $res->free(); - - $this->assertEquals( 1, $n, 'pagelinks should contain one link from the page' ); - - # ------------------------ - $page = new WikiPage( $title ); - - $retrieved = $page->getContent(); - $this->assertTrue( $content->equals( $retrieved ), 'retrieved content doesn\'t equal original' ); - - # ------------------------ - $content = ContentHandler::makeContent( "At vero eos et accusam et justo duo [[dolores]] et ea rebum. " - . "Stet clita kasd [[gubergren]], no sea takimata sanctus est.", - $title, CONTENT_MODEL_WIKITEXT ); - - $page->doEditContent( $content, "testing 2" ); - - # ------------------------ - $page = new WikiPage( $title ); - - $retrieved = $page->getContent(); - $this->assertTrue( $content->equals( $retrieved ), 'retrieved content doesn\'t equal original' ); - - # ------------------------ - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) ); - $n = $res->numRows(); - $res->free(); - - $this->assertEquals( 2, $n, 'pagelinks should contain two links from the page' ); - } - - /** - * @covers WikiPage::doEdit - */ - public function testDoEdit() { - $this->hideDeprecated( "WikiPage::doEdit" ); - $this->hideDeprecated( "WikiPage::getText" ); - $this->hideDeprecated( "Revision::getText" ); - - //NOTE: assume help namespace will default to wikitext - $title = Title::newFromText( "Help:WikiPageTest_testDoEdit" ); - - $page = $this->newPage( $title ); - - $text = "[[Lorem ipsum]] dolor sit amet, consetetur sadipscing elitr, sed diam " - . " nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat."; - - $page->doEdit( $text, "[[testing]] 1" ); - - $this->assertTrue( $title->getArticleID() > 0, "Title object should have new page id" ); - $this->assertTrue( $page->getId() > 0, "WikiPage should have new page id" ); - $this->assertTrue( $title->exists(), "Title object should indicate that the page now exists" ); - $this->assertTrue( $page->exists(), "WikiPage object should indicate that the page now exists" ); - - $id = $page->getId(); - - # ------------------------ - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) ); - $n = $res->numRows(); - $res->free(); - - $this->assertEquals( 1, $n, 'pagelinks should contain one link from the page' ); - - # ------------------------ - $page = new WikiPage( $title ); - - $retrieved = $page->getText(); - $this->assertEquals( $text, $retrieved, 'retrieved text doesn\'t equal original' ); - - # ------------------------ - $text = "At vero eos et accusam et justo duo [[dolores]] et ea rebum. " - . "Stet clita kasd [[gubergren]], no sea takimata sanctus est."; - - $page->doEdit( $text, "testing 2" ); - - # ------------------------ - $page = new WikiPage( $title ); - - $retrieved = $page->getText(); - $this->assertEquals( $text, $retrieved, 'retrieved text doesn\'t equal original' ); - - # ------------------------ - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) ); - $n = $res->numRows(); - $res->free(); - - $this->assertEquals( 2, $n, 'pagelinks should contain two links from the page' ); - } - - /** - * @covers WikiPage::doQuickEdit - */ - public function testDoQuickEdit() { - global $wgUser; - - $this->hideDeprecated( "WikiPage::doQuickEdit" ); - - //NOTE: assume help namespace will default to wikitext - $page = $this->createPage( "Help:WikiPageTest_testDoQuickEdit", "original text" ); - - $text = "quick text"; - $page->doQuickEdit( $text, $wgUser, "testing q" ); - - # --------------------- - $page = new WikiPage( $page->getTitle() ); - $this->assertEquals( $text, $page->getText() ); - } - - /** - * @covers WikiPage::doQuickEditContent - */ - public function testDoQuickEditContent() { - global $wgUser; - - $page = $this->createPage( "WikiPageTest_testDoQuickEditContent", "original text", CONTENT_MODEL_WIKITEXT ); - - $content = ContentHandler::makeContent( "quick text", $page->getTitle(), CONTENT_MODEL_WIKITEXT ); - $page->doQuickEditContent( $content, $wgUser, "testing q" ); - - # --------------------- - $page = new WikiPage( $page->getTitle() ); - $this->assertTrue( $content->equals( $page->getContent() ) ); - } - - /** - * @covers WikiPage::doDeleteArticle - */ - public function testDoDeleteArticle() { - $page = $this->createPage( "WikiPageTest_testDoDeleteArticle", "[[original text]] foo", CONTENT_MODEL_WIKITEXT ); - $id = $page->getId(); - - $page->doDeleteArticle( "testing deletion" ); - - $this->assertFalse( $page->getTitle()->getArticleID() > 0, "Title object should now have page id 0" ); - $this->assertFalse( $page->getId() > 0, "WikiPage should now have page id 0" ); - $this->assertFalse( $page->exists(), "WikiPage::exists should return false after page was deleted" ); - $this->assertNull( $page->getContent(), "WikiPage::getContent should return null after page was deleted" ); - $this->assertFalse( $page->getText(), "WikiPage::getText should return false after page was deleted" ); - - $t = Title::newFromText( $page->getTitle()->getPrefixedText() ); - $this->assertFalse( $t->exists(), "Title::exists should return false after page was deleted" ); - - # ------------------------ - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) ); - $n = $res->numRows(); - $res->free(); - - $this->assertEquals( 0, $n, 'pagelinks should contain no more links from the page' ); - } - - /** - * @covers WikiPage::doDeleteUpdates - */ - public function testDoDeleteUpdates() { - $page = $this->createPage( "WikiPageTest_testDoDeleteArticle", "[[original text]] foo", CONTENT_MODEL_WIKITEXT ); - $id = $page->getId(); - - $page->doDeleteUpdates( $id ); - - # ------------------------ - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) ); - $n = $res->numRows(); - $res->free(); - - $this->assertEquals( 0, $n, 'pagelinks should contain no more links from the page' ); - } - - /** - * @covers WikiPage::getRevision - */ - public function testGetRevision() { - $page = $this->newPage( "WikiPageTest_testGetRevision" ); - - $rev = $page->getRevision(); - $this->assertNull( $rev ); - - # ----------------- - $this->createPage( $page, "some text", CONTENT_MODEL_WIKITEXT ); - - $rev = $page->getRevision(); - - $this->assertEquals( $page->getLatest(), $rev->getId() ); - $this->assertEquals( "some text", $rev->getContent()->getNativeData() ); - } - - /** - * @covers WikiPage::getContent - */ - public function testGetContent() { - $page = $this->newPage( "WikiPageTest_testGetContent" ); - - $content = $page->getContent(); - $this->assertNull( $content ); - - # ----------------- - $this->createPage( $page, "some text", CONTENT_MODEL_WIKITEXT ); - - $content = $page->getContent(); - $this->assertEquals( "some text", $content->getNativeData() ); - } - - /** - * @covers WikiPage::getText - */ - public function testGetText() { - $this->hideDeprecated( "WikiPage::getText" ); - - $page = $this->newPage( "WikiPageTest_testGetText" ); - - $text = $page->getText(); - $this->assertFalse( $text ); - - # ----------------- - $this->createPage( $page, "some text", CONTENT_MODEL_WIKITEXT ); - - $text = $page->getText(); - $this->assertEquals( "some text", $text ); - } - - /** - * @covers WikiPage::getRawText - */ - public function testGetRawText() { - $this->hideDeprecated( "WikiPage::getRawText" ); - - $page = $this->newPage( "WikiPageTest_testGetRawText" ); - - $text = $page->getRawText(); - $this->assertFalse( $text ); - - # ----------------- - $this->createPage( $page, "some text", CONTENT_MODEL_WIKITEXT ); - - $text = $page->getRawText(); - $this->assertEquals( "some text", $text ); - } - - /** - * @covers WikiPage::getContentModel - */ - public function testGetContentModel() { - global $wgContentHandlerUseDB; - - if ( !$wgContentHandlerUseDB ) { - $this->markTestSkipped( '$wgContentHandlerUseDB is disabled' ); - } - - $page = $this->createPage( "WikiPageTest_testGetContentModel", "some text", CONTENT_MODEL_JAVASCRIPT ); - - $page = new WikiPage( $page->getTitle() ); - $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $page->getContentModel() ); - } - - /** - * @covers WikiPage::getContentHandler - */ - public function testGetContentHandler() { - global $wgContentHandlerUseDB; - - if ( !$wgContentHandlerUseDB ) { - $this->markTestSkipped( '$wgContentHandlerUseDB is disabled' ); - } - - $page = $this->createPage( "WikiPageTest_testGetContentHandler", "some text", CONTENT_MODEL_JAVASCRIPT ); - - $page = new WikiPage( $page->getTitle() ); - $this->assertEquals( 'JavaScriptContentHandler', get_class( $page->getContentHandler() ) ); - } - - /** - * @covers WikiPage::exists - */ - public function testExists() { - $page = $this->newPage( "WikiPageTest_testExists" ); - $this->assertFalse( $page->exists() ); - - # ----------------- - $this->createPage( $page, "some text", CONTENT_MODEL_WIKITEXT ); - $this->assertTrue( $page->exists() ); - - $page = new WikiPage( $page->getTitle() ); - $this->assertTrue( $page->exists() ); - - # ----------------- - $page->doDeleteArticle( "done testing" ); - $this->assertFalse( $page->exists() ); - - $page = new WikiPage( $page->getTitle() ); - $this->assertFalse( $page->exists() ); - } - - public static function provideHasViewableContent() { - return array( - array( 'WikiPageTest_testHasViewableContent', false, true ), - array( 'Special:WikiPageTest_testHasViewableContent', false ), - array( 'MediaWiki:WikiPageTest_testHasViewableContent', false ), - array( 'Special:Userlogin', true ), - array( 'MediaWiki:help', true ), - ); - } - - /** - * @dataProvider provideHasViewableContent - * @covers WikiPage::hasViewableContent - */ - public function testHasViewableContent( $title, $viewable, $create = false ) { - $page = $this->newPage( $title ); - $this->assertEquals( $viewable, $page->hasViewableContent() ); - - if ( $create ) { - $this->createPage( $page, "some text", CONTENT_MODEL_WIKITEXT ); - $this->assertTrue( $page->hasViewableContent() ); - - $page = new WikiPage( $page->getTitle() ); - $this->assertTrue( $page->hasViewableContent() ); - } - } - - public static function provideGetRedirectTarget() { - return array( - array( 'WikiPageTest_testGetRedirectTarget_1', CONTENT_MODEL_WIKITEXT, "hello world", null ), - array( 'WikiPageTest_testGetRedirectTarget_2', CONTENT_MODEL_WIKITEXT, "#REDIRECT [[hello world]]", "Hello world" ), - ); - } - - /** - * @dataProvider provideGetRedirectTarget - * @covers WikiPage::getRedirectTarget - */ - public function testGetRedirectTarget( $title, $model, $text, $target ) { - $page = $this->createPage( $title, $text, $model ); - - # sanity check, because this test seems to fail for no reason for some people. - $c = $page->getContent(); - $this->assertEquals( 'WikitextContent', get_class( $c ) ); - - # now, test the actual redirect - $t = $page->getRedirectTarget(); - $this->assertEquals( $target, is_null( $t ) ? null : $t->getPrefixedText() ); - } - - /** - * @dataProvider provideGetRedirectTarget - * @covers WikiPage::isRedirect - */ - public function testIsRedirect( $title, $model, $text, $target ) { - $page = $this->createPage( $title, $text, $model ); - $this->assertEquals( !is_null( $target ), $page->isRedirect() ); - } - - public static function provideIsCountable() { - return array( - - // any - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - '', - 'any', - true - ), - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - 'Foo', - 'any', - true - ), - - // comma - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - 'Foo', - 'comma', - false - ), - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - 'Foo, bar', - 'comma', - true - ), - - // link - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - 'Foo', - 'link', - false - ), - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - 'Foo [[bar]]', - 'link', - true - ), - - // redirects - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - '#REDIRECT [[bar]]', - 'any', - false - ), - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - '#REDIRECT [[bar]]', - 'comma', - false - ), - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - '#REDIRECT [[bar]]', - 'link', - false - ), - - // not a content namespace - array( 'Talk:WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - 'Foo', - 'any', - false - ), - array( 'Talk:WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - 'Foo, bar', - 'comma', - false - ), - array( 'Talk:WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - 'Foo [[bar]]', - 'link', - false - ), - - // not a content namespace, different model - array( 'MediaWiki:WikiPageTest_testIsCountable.js', - null, - 'Foo', - 'any', - false - ), - array( 'MediaWiki:WikiPageTest_testIsCountable.js', - null, - 'Foo, bar', - 'comma', - false - ), - array( 'MediaWiki:WikiPageTest_testIsCountable.js', - null, - 'Foo [[bar]]', - 'link', - false - ), - ); - } - - - /** - * @dataProvider provideIsCountable - * @covers WikiPage::isCountable - */ - public function testIsCountable( $title, $model, $text, $mode, $expected ) { - global $wgContentHandlerUseDB; - - $this->setMwGlobals( 'wgArticleCountMethod', $mode ); - - $title = Title::newFromText( $title ); - - if ( !$wgContentHandlerUseDB && $model && ContentHandler::getDefaultModelFor( $title ) != $model ) { - $this->markTestSkipped( "Can not use non-default content model $model for " - . $title->getPrefixedDBkey() . " with \$wgContentHandlerUseDB disabled." ); - } - - $page = $this->createPage( $title, $text, $model ); - $hasLinks = wfGetDB( DB_SLAVE )->selectField( 'pagelinks', 1, - array( 'pl_from' => $page->getId() ), __METHOD__ ); - - $editInfo = $page->prepareContentForEdit( $page->getContent() ); - - $v = $page->isCountable(); - $w = $page->isCountable( $editInfo ); - - $this->assertEquals( $expected, $v, "isCountable( null ) returned unexpected value " . var_export( $v, true ) - . " instead of " . var_export( $expected, true ) . " in mode `$mode` for text \"$text\"" ); - - $this->assertEquals( $expected, $w, "isCountable( \$editInfo ) returned unexpected value " . var_export( $v, true ) - . " instead of " . var_export( $expected, true ) . " in mode `$mode` for text \"$text\"" ); - } - - public static function provideGetParserOutput() { - return array( - array( CONTENT_MODEL_WIKITEXT, "hello ''world''\n", "

        hello world

        " ), - // @todo more...? - ); - } - - /** - * @dataProvider provideGetParserOutput - * @covers WikiPage::getParserOutput - */ - public function testGetParserOutput( $model, $text, $expectedHtml ) { - $page = $this->createPage( 'WikiPageTest_testGetParserOutput', $text, $model ); - - $opt = $page->makeParserOptions( 'canonical' ); - $po = $page->getParserOutput( $opt ); - $text = $po->getText(); - - $text = trim( preg_replace( '//sm', '', $text ) ); # strip injected comments - $text = preg_replace( '!\s*(

        )!sm', '\1', $text ); # don't let tidy confuse us - - $this->assertEquals( $expectedHtml, $text ); - - return $po; - } - - /** - * @covers WikiPage::getParserOutput - */ - public function testGetParserOutput_nonexisting() { - static $count = 0; - $count++; - - $page = new WikiPage( new Title( "WikiPageTest_testGetParserOutput_nonexisting_$count" ) ); - - $opt = new ParserOptions(); - $po = $page->getParserOutput( $opt ); - - $this->assertFalse( $po, "getParserOutput() shall return false for non-existing pages." ); - } - - /** - * @covers WikiPage::getParserOutput - */ - public function testGetParserOutput_badrev() { - $page = $this->createPage( 'WikiPageTest_testGetParserOutput', "dummy", CONTENT_MODEL_WIKITEXT ); - - $opt = new ParserOptions(); - $po = $page->getParserOutput( $opt, $page->getLatest() + 1234 ); - - // @todo would be neat to also test deleted revision - - $this->assertFalse( $po, "getParserOutput() shall return false for non-existing revisions." ); - } - - static $sections = - - "Intro - -== stuff == -hello world - -== test == -just a test - -== foo == -more stuff -"; - - - public function dataReplaceSection() { - //NOTE: assume the Help namespace to contain wikitext - return array( - array( 'Help:WikiPageTest_testReplaceSection', - CONTENT_MODEL_WIKITEXT, - WikiPageTest::$sections, - "0", - "No more", - null, - trim( preg_replace( '/^Intro/sm', 'No more', WikiPageTest::$sections ) ) - ), - array( 'Help:WikiPageTest_testReplaceSection', - CONTENT_MODEL_WIKITEXT, - WikiPageTest::$sections, - "", - "No more", - null, - "No more" - ), - array( 'Help:WikiPageTest_testReplaceSection', - CONTENT_MODEL_WIKITEXT, - WikiPageTest::$sections, - "2", - "== TEST ==\nmore fun", - null, - trim( preg_replace( '/^== test ==.*== foo ==/sm', - "== TEST ==\nmore fun\n\n== foo ==", - WikiPageTest::$sections ) ) - ), - array( 'Help:WikiPageTest_testReplaceSection', - CONTENT_MODEL_WIKITEXT, - WikiPageTest::$sections, - "8", - "No more", - null, - trim( WikiPageTest::$sections ) - ), - array( 'Help:WikiPageTest_testReplaceSection', - CONTENT_MODEL_WIKITEXT, - WikiPageTest::$sections, - "new", - "No more", - "New", - trim( WikiPageTest::$sections ) . "\n\n== New ==\n\nNo more" - ), - ); - } - - /** - * @dataProvider dataReplaceSection - * @covers WikiPage::replaceSection - */ - public function testReplaceSection( $title, $model, $text, $section, $with, $sectionTitle, $expected ) { - $this->hideDeprecated( "WikiPage::replaceSection" ); - - $page = $this->createPage( $title, $text, $model ); - $text = $page->replaceSection( $section, $with, $sectionTitle ); - $text = trim( $text ); - - $this->assertEquals( $expected, $text ); - } - - /** - * @dataProvider dataReplaceSection - * @covers WikiPage::replaceSectionContent - */ - public function testReplaceSectionContent( $title, $model, $text, $section, $with, $sectionTitle, $expected ) { - $page = $this->createPage( $title, $text, $model ); - - $content = ContentHandler::makeContent( $with, $page->getTitle(), $page->getContentModel() ); - $c = $page->replaceSectionContent( $section, $content, $sectionTitle ); - - $this->assertEquals( $expected, is_null( $c ) ? null : trim( $c->getNativeData() ) ); - } - - /* @todo FIXME: fix this! - public function testGetUndoText() { - $this->checkHasDiff3(); - - $text = "one"; - $page = $this->createPage( "WikiPageTest_testGetUndoText", $text ); - $rev1 = $page->getRevision(); - - $text .= "\n\ntwo"; - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), "adding section two"); - $rev2 = $page->getRevision(); - - $text .= "\n\nthree"; - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), "adding section three"); - $rev3 = $page->getRevision(); - - $text .= "\n\nfour"; - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), "adding section four"); - $rev4 = $page->getRevision(); - - $text .= "\n\nfive"; - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), "adding section five"); - $rev5 = $page->getRevision(); - - $text .= "\n\nsix"; - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), "adding section six"); - $rev6 = $page->getRevision(); - - $undo6 = $page->getUndoText( $rev6 ); - if ( $undo6 === false ) $this->fail( "getUndoText failed for rev6" ); - $this->assertEquals( "one\n\ntwo\n\nthree\n\nfour\n\nfive", $undo6 ); - - $undo3 = $page->getUndoText( $rev4, $rev2 ); - if ( $undo3 === false ) $this->fail( "getUndoText failed for rev4..rev2" ); - $this->assertEquals( "one\n\ntwo\n\nfive", $undo3 ); - - $undo2 = $page->getUndoText( $rev2 ); - if ( $undo2 === false ) $this->fail( "getUndoText failed for rev2" ); - $this->assertEquals( "one\n\nfive", $undo2 ); - } - */ - - /** - * @todo FIXME: this is a better rollback test than the one below, but it keeps failing in jenkins for some reason. - */ - public function broken_testDoRollback() { - $admin = new User(); - $admin->setName( "Admin" ); - - $text = "one"; - $page = $this->newPage( "WikiPageTest_testDoRollback" ); - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), - "section one", EDIT_NEW, false, $admin ); - - $user1 = new User(); - $user1->setName( "127.0.1.11" ); - $text .= "\n\ntwo"; - $page = new WikiPage( $page->getTitle() ); - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), - "adding section two", 0, false, $user1 ); - - $user2 = new User(); - $user2->setName( "127.0.2.13" ); - $text .= "\n\nthree"; - $page = new WikiPage( $page->getTitle() ); - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), - "adding section three", 0, false, $user2 ); - - # we are having issues with doRollback spuriously failing. apparently the last revision somehow goes missing - # or not committed under some circumstances. so, make sure the last revision has the right user name. - $dbr = wfGetDB( DB_SLAVE ); - $this->assertEquals( 3, Revision::countByPageId( $dbr, $page->getId() ) ); - - $page = new WikiPage( $page->getTitle() ); - $rev3 = $page->getRevision(); - $this->assertEquals( '127.0.2.13', $rev3->getUserText() ); - - $rev2 = $rev3->getPrevious(); - $this->assertEquals( '127.0.1.11', $rev2->getUserText() ); - - $rev1 = $rev2->getPrevious(); - $this->assertEquals( 'Admin', $rev1->getUserText() ); - - # now, try the actual rollback - $admin->addGroup( "sysop" ); #XXX: make the test user a sysop... - $token = $admin->getEditToken( array( $page->getTitle()->getPrefixedText(), $user2->getName() ), null ); - $errors = $page->doRollback( $user2->getName(), "testing revert", $token, false, $details, $admin ); - - if ( $errors ) { - $this->fail( "Rollback failed:\n" . print_r( $errors, true ) . ";\n" . print_r( $details, true ) ); - } - - $page = new WikiPage( $page->getTitle() ); - $this->assertEquals( $rev2->getSha1(), $page->getRevision()->getSha1(), - "rollback did not revert to the correct revision" ); - $this->assertEquals( "one\n\ntwo", $page->getContent()->getNativeData() ); - } - - /** - * @todo FIXME: the above rollback test is better, but it keeps failing in jenkins for some reason. - * @covers WikiPage::doRollback - */ - public function testDoRollback() { - $admin = new User(); - $admin->setName( "Admin" ); - - $text = "one"; - $page = $this->newPage( "WikiPageTest_testDoRollback" ); - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle(), CONTENT_MODEL_WIKITEXT ), - "section one", EDIT_NEW, false, $admin ); - $rev1 = $page->getRevision(); - - $user1 = new User(); - $user1->setName( "127.0.1.11" ); - $text .= "\n\ntwo"; - $page = new WikiPage( $page->getTitle() ); - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle(), CONTENT_MODEL_WIKITEXT ), - "adding section two", 0, false, $user1 ); - - # now, try the rollback - $admin->addGroup( "sysop" ); #XXX: make the test user a sysop... - $token = $admin->getEditToken( array( $page->getTitle()->getPrefixedText(), $user1->getName() ), null ); - $errors = $page->doRollback( $user1->getName(), "testing revert", $token, false, $details, $admin ); - - if ( $errors ) { - $this->fail( "Rollback failed:\n" . print_r( $errors, true ) . ";\n" . print_r( $details, true ) ); - } - - $page = new WikiPage( $page->getTitle() ); - $this->assertEquals( $rev1->getSha1(), $page->getRevision()->getSha1(), - "rollback did not revert to the correct revision" ); - $this->assertEquals( "one", $page->getContent()->getNativeData() ); - } - - public static function provideGetAutosummary() { - return array( - array( - 'Hello there, world!', - '#REDIRECT [[Foo]]', - 0, - '/^Redirected page .*Foo/' - ), - - array( - null, - 'Hello world!', - EDIT_NEW, - '/^Created page .*Hello/' - ), - - array( - 'Hello there, world!', - '', - 0, - '/^Blanked/' - ), - - array( - 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut - labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et - ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.', - 'Hello world!', - 0, - '/^Replaced .*Hello/' - ), - - array( - 'foo', - 'bar', - 0, - '/^$/' - ), - ); - } - - /** - * @dataProvider provideGetAutoSummary - * @covers WikiPage::getAutosummary - */ - public function testGetAutosummary( $old, $new, $flags, $expected ) { - $this->hideDeprecated( "WikiPage::getAutosummary" ); - - $page = $this->newPage( "WikiPageTest_testGetAutosummary" ); - - $summary = $page->getAutosummary( $old, $new, $flags ); - - $this->assertTrue( (bool)preg_match( $expected, $summary ), - "Autosummary didn't match expected pattern $expected: $summary" ); - } - - public static function provideGetAutoDeleteReason() { - return array( - array( - array(), - false, - false - ), - - array( - array( - array( "first edit", null ), - ), - "/first edit.*only contributor/", - false - ), - - array( - array( - array( "first edit", null ), - array( "second edit", null ), - ), - "/second edit.*only contributor/", - true - ), - - array( - array( - array( "first edit", "127.0.2.22" ), - array( "second edit", "127.0.3.33" ), - ), - "/second edit/", - true - ), - - array( - array( - array( "first edit: " - . "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam " - . " nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. " - . "At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea " - . "takimata sanctus est Lorem ipsum dolor sit amet.'", null ), - ), - '/first edit:.*\.\.\."/', - false - ), - - array( - array( - array( "first edit", "127.0.2.22" ), - array( "", "127.0.3.33" ), - ), - "/before blanking.*first edit/", - true - ), - - ); - } - - /** - * @dataProvider provideGetAutoDeleteReason - * @covers WikiPage::getAutoDeleteReason - */ - public function testGetAutoDeleteReason( $edits, $expectedResult, $expectedHistory ) { - global $wgUser; - - //NOTE: assume Help namespace to contain wikitext - $page = $this->newPage( "Help:WikiPageTest_testGetAutoDeleteReason" ); - - $c = 1; - - foreach ( $edits as $edit ) { - $user = new User(); - - if ( !empty( $edit[1] ) ) { - $user->setName( $edit[1] ); - } else { - $user = $wgUser; - } - - $content = ContentHandler::makeContent( $edit[0], $page->getTitle(), $page->getContentModel() ); - - $page->doEditContent( $content, "test edit $c", $c < 2 ? EDIT_NEW : 0, false, $user ); - - $c += 1; - } - - $reason = $page->getAutoDeleteReason( $hasHistory ); - - if ( is_bool( $expectedResult ) || is_null( $expectedResult ) ) { - $this->assertEquals( $expectedResult, $reason ); - } else { - $this->assertTrue( (bool)preg_match( $expectedResult, $reason ), - "Autosummary didn't match expected pattern $expectedResult: $reason" ); - } - - $this->assertEquals( $expectedHistory, $hasHistory, - "expected \$hasHistory to be " . var_export( $expectedHistory, true ) ); - - $page->doDeleteArticle( "done" ); - } - - public static function providePreSaveTransform() { - return array( - array( 'hello this is ~~~', - "hello this is [[Special:Contributions/127.0.0.1|127.0.0.1]]", - ), - array( 'hello \'\'this\'\' is ~~~', - 'hello \'\'this\'\' is ~~~', - ), - ); - } - - /** - * @dataProvider providePreSaveTransform - * @covers WikiPage::preSaveTransform - */ - public function testPreSaveTransform( $text, $expected ) { - $this->hideDeprecated( 'WikiPage::preSaveTransform' ); - $user = new User(); - $user->setName( "127.0.0.1" ); - - //NOTE: assume Help namespace to contain wikitext - $page = $this->newPage( "Help:WikiPageTest_testPreloadTransform" ); - $text = $page->preSaveTransform( $text, $user ); - - $this->assertEquals( $expected, $text ); - } -} diff --git a/tests/phpunit/includes/WikiPageTest_ContentHandlerUseDB.php b/tests/phpunit/includes/WikiPageTest_ContentHandlerUseDB.php deleted file mode 100644 index 2a723e85..00000000 --- a/tests/phpunit/includes/WikiPageTest_ContentHandlerUseDB.php +++ /dev/null @@ -1,53 +0,0 @@ -setMwGlobals( 'wgContentHandlerUseDB', false ); - - $dbw = wfGetDB( DB_MASTER ); - - $page_table = $dbw->tableName( 'page' ); - $revision_table = $dbw->tableName( 'revision' ); - $archive_table = $dbw->tableName( 'archive' ); - - if ( $dbw->fieldExists( $page_table, 'page_content_model' ) ) { - $dbw->query( "alter table $page_table drop column page_content_model" ); - $dbw->query( "alter table $revision_table drop column rev_content_model" ); - $dbw->query( "alter table $revision_table drop column rev_content_format" ); - $dbw->query( "alter table $archive_table drop column ar_content_model" ); - $dbw->query( "alter table $archive_table drop column ar_content_format" ); - } - } - - /** - * @covers WikiPage::getContentModel - */ - public function testGetContentModel() { - $page = $this->createPage( "WikiPageTest_testGetContentModel", "some text", CONTENT_MODEL_JAVASCRIPT ); - - $page = new WikiPage( $page->getTitle() ); - - // NOTE: since the content model is not recorded in the database, - // we expect to get the default, namely CONTENT_MODEL_WIKITEXT - $this->assertEquals( CONTENT_MODEL_WIKITEXT, $page->getContentModel() ); - } - - /** - * @covers WikiPage::getContentHandler - */ - public function testGetContentHandler() { - $page = $this->createPage( "WikiPageTest_testGetContentHandler", "some text", CONTENT_MODEL_JAVASCRIPT ); - - // NOTE: since the content model is not recorded in the database, - // we expect to get the default, namely CONTENT_MODEL_WIKITEXT - $page = new WikiPage( $page->getTitle() ); - $this->assertEquals( 'WikitextContentHandler', get_class( $page->getContentHandler() ) ); - } -} diff --git a/tests/phpunit/includes/XmlJsTest.php b/tests/phpunit/includes/XmlJsTest.php deleted file mode 100644 index 161468e2..00000000 --- a/tests/phpunit/includes/XmlJsTest.php +++ /dev/null @@ -1,24 +0,0 @@ -assertEquals( $value, $obj->value ); - } - - public function provideConstruction(){ - return array( - array( null ), - array( '' ), - ); - } - -} diff --git a/tests/phpunit/includes/XmlSelectTest.php b/tests/phpunit/includes/XmlSelectTest.php deleted file mode 100644 index 56d28b54..00000000 --- a/tests/phpunit/includes/XmlSelectTest.php +++ /dev/null @@ -1,173 +0,0 @@ -setMwGlobals( array( - 'wgWellFormedXml' => true, - ) ); - $this->select = new XmlSelect(); - } - - protected function tearDown() { - parent::tearDown(); - $this->select = null; - } - - /** - * @covers XmlSelect::__construct - */ - public function testConstructWithoutParameters() { - $this->assertEquals( '', $this->select->getHTML() ); - } - - /** - * Parameters are $name (false), $id (false), $default (false) - * @dataProvider provideConstructionParameters - * @covers XmlSelect::__construct - */ - public function testConstructParameters( $name, $id, $default, $expected ) { - $this->select = new XmlSelect( $name, $id, $default ); - $this->assertEquals( $expected, $this->select->getHTML() ); - } - - /** - * Provide parameters for testConstructParameters() which use three - * parameters: - * - $name (default: false) - * - $id (default: false) - * - $default (default: false) - * Provides a fourth parameters representing the expected HTML output - */ - public static function provideConstructionParameters() { - return array( - /** - * Values are set following a 3-bit Gray code where two successive - * values differ by only one value. - * See http://en.wikipedia.org/wiki/Gray_code - */ - # $name $id $default - array( false, false, false, '' ), - array( false, false, 'foo', '' ), - array( false, 'id', 'foo', '' ), - array( false, 'id', false, '' ), - array( 'name', 'id', false, '' ), - array( 'name', 'id', 'foo', '' ), - array( 'name', false, 'foo', '' ), - array( 'name', false, false, '' ), - ); - } - - /** - * @covers XmlSelect::addOption - */ - public function testAddOption() { - $this->select->addOption( 'foo' ); - $this->assertEquals( '', $this->select->getHTML() ); - } - - /** - * @covers XmlSelect::addOption - */ - public function testAddOptionWithDefault() { - $this->select->addOption( 'foo', true ); - $this->assertEquals( '', $this->select->getHTML() ); - } - - /** - * @covers XmlSelect::addOption - */ - public function testAddOptionWithFalse() { - $this->select->addOption( 'foo', false ); - $this->assertEquals( '', $this->select->getHTML() ); - } - - /** - * @covers XmlSelect::addOption - */ - public function testAddOptionWithValueZero() { - $this->select->addOption( 'foo', 0 ); - $this->assertEquals( '', $this->select->getHTML() ); - } - - /** - * @covers XmlSelect::setDefault - */ - public function testSetDefault() { - $this->select->setDefault( 'bar1' ); - $this->select->addOption( 'foo1' ); - $this->select->addOption( 'bar1' ); - $this->select->addOption( 'foo2' ); - $this->assertEquals( - '', $this->select->getHTML() ); - } - - /** - * Adding default later on should set the correct selection or - * raise an exception. - * To handle this, we need to render the options in getHtml() - * @covers XmlSelect::setDefault - */ - public function testSetDefaultAfterAddingOptions() { - $this->select->addOption( 'foo1' ); - $this->select->addOption( 'bar1' ); - $this->select->addOption( 'foo2' ); - $this->select->setDefault( 'bar1' ); # setting default after adding options - $this->assertEquals( - '', $this->select->getHTML() ); - } - - /** - * @covers XmlSelect::setAttribute - * @covers XmlSelect::getAttribute - */ - public function testGetAttributes() { - # create some attributes - $this->select->setAttribute( 'dummy', 0x777 ); - $this->select->setAttribute( 'string', 'euro €' ); - $this->select->setAttribute( 1911, 'razor' ); - - # verify we can retrieve them - $this->assertEquals( - $this->select->getAttribute( 'dummy' ), - 0x777 - ); - $this->assertEquals( - $this->select->getAttribute( 'string' ), - 'euro €' - ); - $this->assertEquals( - $this->select->getAttribute( 1911 ), - 'razor' - ); - - # inexistant keys should give us 'null' - $this->assertEquals( - $this->select->getAttribute( 'I DO NOT EXIT' ), - null - ); - - # verify string / integer - $this->assertEquals( - $this->select->getAttribute( '1911' ), - 'razor' - ); - $this->assertEquals( - $this->select->getAttribute( 'dummy' ), - 0x777 - ); - } -} diff --git a/tests/phpunit/includes/XmlTest.php b/tests/phpunit/includes/XmlTest.php deleted file mode 100644 index 8205029f..00000000 --- a/tests/phpunit/includes/XmlTest.php +++ /dev/null @@ -1,402 +0,0 @@ -setNamespaces( array( - -2 => 'Media', - -1 => 'Special', - 0 => '', - 1 => 'Talk', - 2 => 'User', - 3 => 'User_talk', - 4 => 'MyWiki', - 5 => 'MyWiki_Talk', - 6 => 'File', - 7 => 'File_talk', - 8 => 'MediaWiki', - 9 => 'MediaWiki_talk', - 10 => 'Template', - 11 => 'Template_talk', - 100 => 'Custom', - 101 => 'Custom_talk', - ) ); - - $this->setMwGlobals( array( - 'wgLang' => $langObj, - 'wgWellFormedXml' => true, - ) ); - } - - /** - * @covers Xml::expandAttributes - */ - public function testExpandAttributes() { - $this->assertNull( Xml::expandAttributes( null ), - 'Converting a null list of attributes' - ); - $this->assertEquals( '', Xml::expandAttributes( array() ), - 'Converting an empty list of attributes' - ); - } - - /** - * @covers Xml::expandAttributes - */ - public function testExpandAttributesException() { - $this->setExpectedException( 'MWException' ); - Xml::expandAttributes( 'string' ); - } - - /** - * @covers Xml::element - */ - public function testElementOpen() { - $this->assertEquals( - '', - Xml::element( 'element', null, null ), - 'Opening element with no attributes' - ); - } - - /** - * @covers Xml::element - */ - public function testElementEmpty() { - $this->assertEquals( - '', - Xml::element( 'element', null, '' ), - 'Terminated empty element' - ); - } - - /** - * @covers Xml::input - */ - public function testElementInputCanHaveAValueOfZero() { - $this->assertEquals( - '', - Xml::input( 'name', false, 0 ), - 'Input with a value of 0 (bug 23797)' - ); - } - - /** - * @covers Xml::element - */ - public function testElementEscaping() { - $this->assertEquals( - 'hello <there> you & you', - Xml::element( 'element', null, 'hello you & you' ), - 'Element with no attributes and content that needs escaping' - ); - } - - /** - * @covers Xml::escapeTagsOnly - */ - public function testEscapeTagsOnly() { - $this->assertEquals( '"><', Xml::escapeTagsOnly( '"><' ), - 'replace " > and < with their HTML entitites' - ); - } - - /** - * @covers Xml::element - */ - public function testElementAttributes() { - $this->assertEquals( - '="<>">', - Xml::element( 'element', array( 'key' => 'value', '<>' => '<>' ), null ), - 'Element attributes, keys are not escaped' - ); - } - - /** - * @covers Xml::openElement - */ - public function testOpenElement() { - $this->assertEquals( - '', - Xml::openElement( 'element', array( 'k' => 'v' ) ), - 'openElement() shortcut' - ); - } - - /** - * @covers Xml::closeElement - */ - public function testCloseElement() { - $this->assertEquals( '', Xml::closeElement( 'element' ), 'closeElement() shortcut' ); - } - - /** - * @covers Xml::dateMenu - */ - public function testDateMenu() { - $curYear = intval( gmdate( 'Y' ) ); - $prevYear = $curYear - 1; - - $curMonth = intval( gmdate( 'n' ) ); - $prevMonth = $curMonth - 1; - if ( $prevMonth == 0 ) { - $prevMonth = 12; - } - $nextMonth = $curMonth + 1; - if ( $nextMonth == 13 ) { - $nextMonth = 1; - } - - $this->assertEquals( - ' ', - Xml::dateMenu( 2011, 02 ), - "Date menu for february 2011" - ); - $this->assertEquals( - ' ', - Xml::dateMenu( 2011, -1 ), - "Date menu with negative month for 'All'" - ); - $this->assertEquals( - Xml::dateMenu( $curYear, $curMonth ), - Xml::dateMenu( '', $curMonth ), - "Date menu year is the current one when not specified" - ); - - $wantedYear = $nextMonth == 1 ? $curYear : $prevYear; - $this->assertEquals( - Xml::dateMenu( $wantedYear, $nextMonth ), - Xml::dateMenu( '', $nextMonth ), - "Date menu next month is 11 months ago" - ); - - $this->assertEquals( - ' ', - Xml::dateMenu( '', '' ), - "Date menu with neither year or month" - ); - } - - /** - * @covers Xml::textarea - */ - public function testTextareaNoContent() { - $this->assertEquals( - '', - Xml::textarea( 'name', '' ), - 'textarea() with not content' - ); - } - - /** - * @covers Xml::textarea - */ - public function testTextareaAttribs() { - $this->assertEquals( - '', - Xml::textarea( 'name', '', 20, 10 ), - 'textarea() with custom attribs' - ); - } - - /** - * @covers Xml::label - */ - public function testLabelCreation() { - $this->assertEquals( - '', - Xml::label( 'name', 'id' ), - 'label() with no attribs' - ); - } - - /** - * @covers Xml::label - */ - public function testLabelAttributeCanOnlyBeClassOrTitle() { - $this->assertEquals( - '', - Xml::label( 'name', 'id', array( 'generated' => true ) ), - 'label() can not be given a generated attribute' - ); - $this->assertEquals( - '', - Xml::label( 'name', 'id', array( 'class' => 'nice' ) ), - 'label() can get a class attribute' - ); - $this->assertEquals( - '', - Xml::label( 'name', 'id', array( 'title' => 'nice tooltip' ) ), - 'label() can get a title attribute' - ); - $this->assertEquals( - '', - Xml::label( 'name', 'id', array( - 'generated' => true, - 'class' => 'nice', - 'title' => 'nice tooltip', - 'anotherattr' => 'value', - ) - ), - 'label() skip all attributes but "class" and "title"' - ); - } - - /** - * @covers Xml::languageSelector - */ - public function testLanguageSelector() { - $select = Xml::languageSelector( 'en', true, null, - array( 'id' => 'testlang' ), wfMessage( 'yourlanguage' ) ); - $this->assertEquals( - '', - $select[0] - ); - } - - /** - * @covers Xml::escapeJsString - */ - public function testEscapeJsStringSpecialChars() { - $this->assertEquals( - '\\\\\r\n', - Xml::escapeJsString( "\\\r\n" ), - 'escapeJsString() with special characters' - ); - } - - /** - * @covers Xml::encodeJsVar - */ - public function testEncodeJsVarBoolean() { - $this->assertEquals( - 'true', - Xml::encodeJsVar( true ), - 'encodeJsVar() with boolean' - ); - } - - /** - * @covers Xml::encodeJsVar - */ - public function testEncodeJsVarNull() { - $this->assertEquals( - 'null', - Xml::encodeJsVar( null ), - 'encodeJsVar() with null' - ); - } - - /** - * @covers Xml::encodeJsVar - */ - public function testEncodeJsVarArray() { - $this->assertEquals( - '["a",1]', - Xml::encodeJsVar( array( 'a', 1 ) ), - 'encodeJsVar() with array' - ); - $this->assertEquals( - '{"a":"a","b":1}', - Xml::encodeJsVar( array( 'a' => 'a', 'b' => 1 ) ), - 'encodeJsVar() with associative array' - ); - } - - /** - * @covers Xml::encodeJsVar - */ - public function testEncodeJsVarObject() { - $this->assertEquals( - '{"a":"a","b":1}', - Xml::encodeJsVar( (object)array( 'a' => 'a', 'b' => 1 ) ), - 'encodeJsVar() with object' - ); - } - - /** - * @covers Xml::encodeJsVar - */ - public function testEncodeJsVarInt() { - $this->assertEquals( - '123456', - Xml::encodeJsVar( 123456 ), - 'encodeJsVar() with int' - ); - } - - /** - * @covers Xml::encodeJsVar - */ - public function testEncodeJsVarFloat() { - $this->assertEquals( - '1.23456', - Xml::encodeJsVar( 1.23456 ), - 'encodeJsVar() with float' - ); - } - - /** - * @covers Xml::encodeJsVar - */ - public function testEncodeJsVarIntString() { - $this->assertEquals( - '"123456"', - Xml::encodeJsVar( '123456' ), - 'encodeJsVar() with int-like string' - ); - } - - /** - * @covers Xml::encodeJsVar - */ - public function testEncodeJsVarFloatString() { - $this->assertEquals( - '"1.23456"', - Xml::encodeJsVar( '1.23456' ), - 'encodeJsVar() with float-like string' - ); - } -} diff --git a/tests/phpunit/includes/XmlTypeCheckTest.php b/tests/phpunit/includes/XmlTypeCheckTest.php deleted file mode 100644 index 8d6f1ed7..00000000 --- a/tests/phpunit/includes/XmlTypeCheckTest.php +++ /dev/null @@ -1,30 +0,0 @@ -"; - const MAL_FORMED_XML = ""; - - /** - * @covers XMLTypeCheck::newFromString - * @covers XMLTypeCheck::getRootElement - */ - public function testWellFormedXML() { - $testXML = XmlTypeCheck::newFromString( self::WELL_FORMED_XML ); - $this->assertTrue( $testXML->wellFormed ); - $this->assertEquals( 'root', $testXML->getRootElement() ); - } - - /** - * @covers XMLTypeCheck::newFromString - */ - public function testMalFormedXML() { - $testXML = XmlTypeCheck::newFromString( self::MAL_FORMED_XML ); - $this->assertFalse( $testXML->wellFormed ); - } - -} diff --git a/tests/phpunit/includes/ZipDirectoryReaderTest.php b/tests/phpunit/includes/ZipDirectoryReaderTest.php deleted file mode 100644 index 2627a417..00000000 --- a/tests/phpunit/includes/ZipDirectoryReaderTest.php +++ /dev/null @@ -1,85 +0,0 @@ -zipDir = __DIR__ . '/../data/zip'; - } - - function zipCallback( $entry ) { - $this->entries[] = $entry; - } - - function readZipAssertError( $file, $error, $assertMessage ) { - $this->entries = array(); - $status = ZipDirectoryReader::read( "{$this->zipDir}/$file", array( $this, 'zipCallback' ) ); - $this->assertTrue( $status->hasMessage( $error ), $assertMessage ); - } - - function readZipAssertSuccess( $file, $assertMessage ) { - $this->entries = array(); - $status = ZipDirectoryReader::read( "{$this->zipDir}/$file", array( $this, 'zipCallback' ) ); - $this->assertTrue( $status->isOK(), $assertMessage ); - } - - public function testEmpty() { - $this->readZipAssertSuccess( 'empty.zip', 'Empty zip' ); - } - - public function testMultiDisk0() { - $this->readZipAssertError( 'split.zip', 'zip-unsupported', - 'Split zip error' ); - } - - public function testNoSignature() { - $this->readZipAssertError( 'nosig.zip', 'zip-wrong-format', - 'No signature should give "wrong format" error' ); - } - - public function testSimple() { - $this->readZipAssertSuccess( 'class.zip', 'Simple ZIP' ); - $this->assertEquals( $this->entries, array( array( - 'name' => 'Class.class', - 'mtime' => '20010115000000', - 'size' => 1, - ) ) ); - } - - public function testBadCentralEntrySignature() { - $this->readZipAssertError( 'wrong-central-entry-sig.zip', 'zip-bad', - 'Bad central entry error' ); - } - - public function testTrailingBytes() { - $this->readZipAssertError( 'trail.zip', 'zip-bad', - 'Trailing bytes error' ); - } - - public function testWrongCDStart() { - $this->readZipAssertError( 'wrong-cd-start-disk.zip', 'zip-unsupported', - 'Wrong CD start disk error' ); - } - - - public function testCentralDirectoryGap() { - $this->readZipAssertError( 'cd-gap.zip', 'zip-bad', - 'CD gap error' ); - } - - public function testCentralDirectoryTruncated() { - $this->readZipAssertError( 'cd-truncated.zip', 'zip-bad', - 'CD truncated error (should hit unpack() overrun)' ); - } - - public function testLooksLikeZip64() { - $this->readZipAssertError( 'looks-like-zip64.zip', 'zip-unsupported', - 'A file which looks like ZIP64 but isn\'t, should give error' ); - } -} diff --git a/tests/phpunit/includes/api/ApiAccountCreationTest.php b/tests/phpunit/includes/api/ApiAccountCreationTest.php deleted file mode 100644 index 68f80ac9..00000000 --- a/tests/phpunit/includes/api/ApiAccountCreationTest.php +++ /dev/null @@ -1,159 +0,0 @@ -setMwGlobals( array( 'wgEnableEmail' => true ) ); - } - - /** - * Test the account creation API with a valid request. Also - * make sure the new account can log in and is valid. - * - * This test does multiple API requests so it might end up being - * a bit slow. Raise the default timeout. - * @group medium - */ - public function testValid() { - global $wgServer; - - if ( !isset( $wgServer ) ) { - $this->markTestIncomplete( 'This test needs $wgServer to be set in LocalSettings.php' ); - } - - $password = User::randomPassword(); - - $ret = $this->doApiRequest( array( - 'action' => 'createaccount', - 'name' => 'Apitestnew', - 'password' => $password, - 'email' => 'test@domain.test', - 'realname' => 'Test Name' - ) ); - - $result = $ret[0]; - $this->assertNotInternalType( 'bool', $result ); - $this->assertNotInternalType( 'null', $result['createaccount'] ); - - // Should first ask for token. - $a = $result['createaccount']; - $this->assertEquals( 'needtoken', $a['result'] ); - $token = $a['token']; - - // Finally create the account - $ret = $this->doApiRequest( - array( - 'action' => 'createaccount', - 'name' => 'Apitestnew', - 'password' => $password, - 'token' => $token, - 'email' => 'test@domain.test', - 'realname' => 'Test Name' - ), - $ret[2] - ); - - $result = $ret[0]; - $this->assertNotInternalType( 'bool', $result ); - $this->assertEquals( 'success', $result['createaccount']['result'] ); - - // Try logging in with the new user. - $ret = $this->doApiRequest( array( - 'action' => 'login', - 'lgname' => 'Apitestnew', - 'lgpassword' => $password, - ) ); - - $result = $ret[0]; - $this->assertNotInternalType( 'bool', $result ); - $this->assertNotInternalType( 'null', $result['login'] ); - - $a = $result['login']['result']; - $this->assertEquals( 'NeedToken', $a ); - $token = $result['login']['token']; - - $ret = $this->doApiRequest( - array( - 'action' => 'login', - 'lgtoken' => $token, - 'lgname' => 'Apitestnew', - 'lgpassword' => $password, - ), - $ret[2] - ); - - $result = $ret[0]; - - $this->assertNotInternalType( 'bool', $result ); - $a = $result['login']['result']; - - $this->assertEquals( 'Success', $a ); - - // log out to destroy the session - $ret = $this->doApiRequest( - array( - 'action' => 'logout', - ), - $ret[2] - ); - $this->assertEquals( array(), $ret[0] ); - } - - /** - * Make sure requests with no names are invalid. - * @expectedException UsageException - */ - public function testNoName() { - $this->doApiRequest( array( - 'action' => 'createaccount', - 'token' => LoginForm::getCreateaccountToken(), - 'password' => 'password', - ) ); - } - - /** - * Make sure requests with no password are invalid. - * @expectedException UsageException - */ - public function testNoPassword() { - $this->doApiRequest( array( - 'action' => 'createaccount', - 'name' => 'testName', - 'token' => LoginForm::getCreateaccountToken(), - ) ); - } - - /** - * Make sure requests with existing users are invalid. - * @expectedException UsageException - */ - public function testExistingUser() { - $this->doApiRequest( array( - 'action' => 'createaccount', - 'name' => 'Apitestsysop', - 'token' => LoginForm::getCreateaccountToken(), - 'password' => 'password', - 'email' => 'test@domain.test', - ) ); - } - - /** - * Make sure requests with invalid emails are invalid. - * @expectedException UsageException - */ - public function testInvalidEmail() { - $this->doApiRequest( array( - 'action' => 'createaccount', - 'name' => 'Test User', - 'token' => LoginForm::getCreateaccountToken(), - 'password' => 'password', - 'email' => 'invalid', - ) ); - } -} diff --git a/tests/phpunit/includes/api/ApiBlockTest.php b/tests/phpunit/includes/api/ApiBlockTest.php deleted file mode 100644 index 8afb748a..00000000 --- a/tests/phpunit/includes/api/ApiBlockTest.php +++ /dev/null @@ -1,95 +0,0 @@ -doLogin(); - } - - function getTokens() { - return $this->getTokenList( self::$users['sysop'] ); - } - - function addDBData() { - $user = User::newFromName( 'UTApiBlockee' ); - - if ( $user->getId() == 0 ) { - $user->addToDatabase(); - $user->setPassword( 'UTApiBlockeePassword' ); - - $user->saveSettings(); - } - } - - /** - * This test has probably always been broken and use an invalid token - * Bug tracking brokenness is https://bugzilla.wikimedia.org/35646 - * - * Root cause is https://gerrit.wikimedia.org/r/3434 - * Which made the Block/Unblock API to actually verify the token - * previously always considered valid (bug 34212). - */ - public function testMakeNormalBlock() { - $tokens = $this->getTokens(); - - $user = User::newFromName( 'UTApiBlockee' ); - - if ( !$user->getId() ) { - $this->markTestIncomplete( "The user UTApiBlockee does not exist" ); - } - - if ( !array_key_exists( 'blocktoken', $tokens ) ) { - $this->markTestIncomplete( "No block token found" ); - } - - $this->doApiRequest( array( - 'action' => 'block', - 'user' => 'UTApiBlockee', - 'reason' => 'Some reason', - 'token' => $tokens['blocktoken'] ), null, false, self::$users['sysop']->user ); - - $block = Block::newFromTarget( 'UTApiBlockee' ); - - $this->assertTrue( !is_null( $block ), 'Block is valid' ); - - $this->assertEquals( 'UTApiBlockee', (string)$block->getTarget() ); - $this->assertEquals( 'Some reason', $block->mReason ); - $this->assertEquals( 'infinity', $block->mExpiry ); - } - - /** - * Attempting to block without a token should give a UsageException with - * error message: - * "The token parameter must be set" - * - * @dataProvider provideBlockUnblockAction - * @expectedException UsageException - */ - public function testBlockingActionWithNoToken( $action ) { - $this->doApiRequest( - array( - 'action' => $action, - 'user' => 'UTApiBlockee', - 'reason' => 'Some reason', - ), - null, - false, - self::$users['sysop']->user - ); - } - - /** - * Just provide the 'block' and 'unblock' action to test both API calls - */ - public static function provideBlockUnblockAction() { - return array( - array( 'block' ), - array( 'unblock' ), - ); - } -} diff --git a/tests/phpunit/includes/api/ApiEditPageTest.php b/tests/phpunit/includes/api/ApiEditPageTest.php deleted file mode 100644 index 0c49b12b..00000000 --- a/tests/phpunit/includes/api/ApiEditPageTest.php +++ /dev/null @@ -1,417 +0,0 @@ -resetNamespaces(); # reset namespace cache - - $this->doLogin(); - } - - public function tearDown() { - global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang; - - unset( $wgExtraNamespaces[12312] ); - unset( $wgExtraNamespaces[12313] ); - - unset( $wgNamespaceContentModels[12312] ); - unset( $wgContentHandlers["testing"] ); - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - - parent::tearDown(); - } - - public function testEdit() { - $name = 'Help:ApiEditPageTest_testEdit'; // assume Help namespace to default to wikitext - - // -- test new page -------------------------------------------- - $apiResult = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'text' => 'some text', - ) ); - $apiResult = $apiResult[0]; - - // Validate API result data - $this->assertArrayHasKey( 'edit', $apiResult ); - $this->assertArrayHasKey( 'result', $apiResult['edit'] ); - $this->assertEquals( 'Success', $apiResult['edit']['result'] ); - - $this->assertArrayHasKey( 'new', $apiResult['edit'] ); - $this->assertArrayNotHasKey( 'nochange', $apiResult['edit'] ); - - $this->assertArrayHasKey( 'pageid', $apiResult['edit'] ); - - // -- test existing page, no change ---------------------------- - $data = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'text' => 'some text', - ) ); - - $this->assertEquals( 'Success', $data[0]['edit']['result'] ); - - $this->assertArrayNotHasKey( 'new', $data[0]['edit'] ); - $this->assertArrayHasKey( 'nochange', $data[0]['edit'] ); - - // -- test existing page, with change -------------------------- - $data = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'text' => 'different text' - ) ); - - $this->assertEquals( 'Success', $data[0]['edit']['result'] ); - - $this->assertArrayNotHasKey( 'new', $data[0]['edit'] ); - $this->assertArrayNotHasKey( 'nochange', $data[0]['edit'] ); - - $this->assertArrayHasKey( 'oldrevid', $data[0]['edit'] ); - $this->assertArrayHasKey( 'newrevid', $data[0]['edit'] ); - $this->assertNotEquals( - $data[0]['edit']['newrevid'], - $data[0]['edit']['oldrevid'], - "revision id should change after edit" - ); - } - - public function testNonTextEdit() { - $name = 'Dummy:ApiEditPageTest_testNonTextEdit'; - $data = serialize( 'some bla bla text' ); - - // -- test new page -------------------------------------------- - $apiResult = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'text' => $data, ) ); - $apiResult = $apiResult[0]; - - // Validate API result data - $this->assertArrayHasKey( 'edit', $apiResult ); - $this->assertArrayHasKey( 'result', $apiResult['edit'] ); - $this->assertEquals( 'Success', $apiResult['edit']['result'] ); - - $this->assertArrayHasKey( 'new', $apiResult['edit'] ); - $this->assertArrayNotHasKey( 'nochange', $apiResult['edit'] ); - - $this->assertArrayHasKey( 'pageid', $apiResult['edit'] ); - - // validate resulting revision - $page = WikiPage::factory( Title::newFromText( $name ) ); - $this->assertEquals( "testing", $page->getContentModel() ); - $this->assertEquals( $data, $page->getContent()->serialize() ); - } - - public static function provideEditAppend() { - return array( - array( #0: append - 'foo', 'append', 'bar', "foobar" - ), - array( #1: prepend - 'foo', 'prepend', 'bar', "barfoo" - ), - array( #2: append to empty page - '', 'append', 'foo', "foo" - ), - array( #3: prepend to empty page - '', 'prepend', 'foo', "foo" - ), - array( #4: append to non-existing page - null, 'append', 'foo', "foo" - ), - array( #5: prepend to non-existing page - null, 'prepend', 'foo', "foo" - ), - ); - } - - /** - * @dataProvider provideEditAppend - */ - public function testEditAppend( $text, $op, $append, $expected ) { - static $count = 0; - $count++; - - // assume NS_HELP defaults to wikitext - $name = "Help:ApiEditPageTest_testEditAppend_$count"; - - // -- create page (or not) ----------------------------------------- - if ( $text !== null ) { - if ( $text === '' ) { - // can't create an empty page, so create it with some content - $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'text' => '(dummy)', ) ); - } - - list( $re ) = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'text' => $text, ) ); - - $this->assertEquals( 'Success', $re['edit']['result'] ); // sanity - } - - // -- try append/prepend -------------------------------------------- - list( $re ) = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - $op . 'text' => $append, ) ); - - $this->assertEquals( 'Success', $re['edit']['result'] ); - - // -- validate ----------------------------------------------------- - $page = new WikiPage( Title::newFromText( $name ) ); - $content = $page->getContent(); - $this->assertNotNull( $content, 'Page should have been created' ); - - $text = $content->getNativeData(); - - $this->assertEquals( $expected, $text ); - } - - /** - * Test editing of sections - */ - public function testEditSection() { - $name = 'Help:ApiEditPageTest_testEditSection'; - $page = WikiPage::factory( Title::newFromText( $name ) ); - $text = "==section 1==\ncontent 1\n==section 2==\ncontent2"; - // Preload the page with some text - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), 'summary' ); - - list( $re ) = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'section' => '1', - 'text' => "==section 1==\nnew content 1", - ) ); - $this->assertEquals( 'Success', $re['edit']['result'] ); - $newtext = WikiPage::factory( Title::newFromText( $name) )->getContent( Revision::RAW )->getNativeData(); - $this->assertEquals( $newtext, "==section 1==\nnew content 1\n\n==section 2==\ncontent2" ); - - // Test that we raise a 'nosuchsection' error - try { - $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'section' => '9999', - 'text' => 'text', - ) ); - $this->fail( "Should have raised a UsageException" ); - } catch ( UsageException $e ) { - $this->assertEquals( $e->getCodeString(), 'nosuchsection' ); - } - } - - /** - * Test action=edit§ion=new - * Run it twice so we test adding a new section on a - * page that doesn't exist (bug 52830) and one that - * does exist - */ - public function testEditNewSection() { - $name = 'Help:ApiEditPageTest_testEditNewSection'; - - // Test on a page that does not already exist - $this->assertFalse( Title::newFromText( $name )->exists() ); - list( $re ) = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'section' => 'new', - 'text' => 'test', - 'summary' => 'header', - )); - - $this->assertEquals( 'Success', $re['edit']['result'] ); - // Check the page text is correct - $text = WikiPage::factory( Title::newFromText( $name ) )->getContent( Revision::RAW )->getNativeData(); - $this->assertEquals( $text, "== header ==\n\ntest" ); - - // Now on one that does - $this->assertTrue( Title::newFromText( $name )->exists() ); - list( $re2 ) = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'section' => 'new', - 'text' => 'test', - 'summary' => 'header', - )); - - $this->assertEquals( 'Success', $re2['edit']['result'] ); - $text = WikiPage::factory( Title::newFromText( $name ) )->getContent( Revision::RAW )->getNativeData(); - $this->assertEquals( $text, "== header ==\n\ntest\n\n== header ==\n\ntest" ); - } - - public function testEditConflict() { - static $count = 0; - $count++; - - // assume NS_HELP defaults to wikitext - $name = "Help:ApiEditPageTest_testEditConflict_$count"; - $title = Title::newFromText( $name ); - - $page = WikiPage::factory( $title ); - - // base edit - $page->doEditContent( new WikitextContent( "Foo" ), - "testing 1", EDIT_NEW, false, self::$users['sysop']->user ); - $this->forceRevisionDate( $page, '20120101000000' ); - $baseTime = $page->getRevision()->getTimestamp(); - - // conflicting edit - $page->doEditContent( new WikitextContent( "Foo bar" ), - "testing 2", EDIT_UPDATE, $page->getLatest(), self::$users['uploader']->user ); - $this->forceRevisionDate( $page, '20120101020202' ); - - // try to save edit, expect conflict - try { - $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'text' => 'nix bar!', - 'basetimestamp' => $baseTime, - ), null, self::$users['sysop']->user ); - - $this->fail( 'edit conflict expected' ); - } catch ( UsageException $ex ) { - $this->assertEquals( 'editconflict', $ex->getCodeString() ); - } - } - - public function testEditConflict_redirect() { - static $count = 0; - $count++; - - // assume NS_HELP defaults to wikitext - $name = "Help:ApiEditPageTest_testEditConflict_redirect_$count"; - $title = Title::newFromText( $name ); - $page = WikiPage::factory( $title ); - - $rname = "Help:ApiEditPageTest_testEditConflict_redirect_r$count"; - $rtitle = Title::newFromText( $rname ); - $rpage = WikiPage::factory( $rtitle ); - - // base edit for content - $page->doEditContent( new WikitextContent( "Foo" ), - "testing 1", EDIT_NEW, false, self::$users['sysop']->user ); - $this->forceRevisionDate( $page, '20120101000000' ); - $baseTime = $page->getRevision()->getTimestamp(); - - // base edit for redirect - $rpage->doEditContent( new WikitextContent( "#REDIRECT [[$name]]" ), - "testing 1", EDIT_NEW, false, self::$users['sysop']->user ); - $this->forceRevisionDate( $rpage, '20120101000000' ); - - // conflicting edit to redirect - $rpage->doEditContent( new WikitextContent( "#REDIRECT [[$name]]\n\n[[Category:Test]]" ), - "testing 2", EDIT_UPDATE, $page->getLatest(), self::$users['uploader']->user ); - $this->forceRevisionDate( $rpage, '20120101020202' ); - - // try to save edit; should work, because we follow the redirect - list( $re, , ) = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $rname, - 'text' => 'nix bar!', - 'basetimestamp' => $baseTime, - 'redirect' => true, - ), null, self::$users['sysop']->user ); - - $this->assertEquals( 'Success', $re['edit']['result'], - "no edit conflict expected when following redirect" ); - - // try again, without following the redirect. Should fail. - try { - $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $rname, - 'text' => 'nix bar!', - 'basetimestamp' => $baseTime, - ), null, self::$users['sysop']->user ); - - $this->fail( 'edit conflict expected' ); - } catch ( UsageException $ex ) { - $this->assertEquals( 'editconflict', $ex->getCodeString() ); - } - } - - public function testEditConflict_bug41990() { - static $count = 0; - $count++; - - /* - * bug 41990: if the target page has a newer revision than the redirect, then editing the - * redirect while specifying 'redirect' and *not* specifying 'basetimestamp' erroneously - * caused an edit conflict to be detected. - */ - - // assume NS_HELP defaults to wikitext - $name = "Help:ApiEditPageTest_testEditConflict_redirect_bug41990_$count"; - $title = Title::newFromText( $name ); - $page = WikiPage::factory( $title ); - - $rname = "Help:ApiEditPageTest_testEditConflict_redirect_bug41990_r$count"; - $rtitle = Title::newFromText( $rname ); - $rpage = WikiPage::factory( $rtitle ); - - // base edit for content - $page->doEditContent( new WikitextContent( "Foo" ), - "testing 1", EDIT_NEW, false, self::$users['sysop']->user ); - $this->forceRevisionDate( $page, '20120101000000' ); - - // base edit for redirect - $rpage->doEditContent( new WikitextContent( "#REDIRECT [[$name]]" ), - "testing 1", EDIT_NEW, false, self::$users['sysop']->user ); - $this->forceRevisionDate( $rpage, '20120101000000' ); - $baseTime = $rpage->getRevision()->getTimestamp(); - - // new edit to content - $page->doEditContent( new WikitextContent( "Foo bar" ), - "testing 2", EDIT_UPDATE, $page->getLatest(), self::$users['uploader']->user ); - $this->forceRevisionDate( $rpage, '20120101020202' ); - - // try to save edit; should work, following the redirect. - list( $re, , ) = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $rname, - 'text' => 'nix bar!', - 'redirect' => true, - ), null, self::$users['sysop']->user ); - - $this->assertEquals( 'Success', $re['edit']['result'], - "no edit conflict expected here" ); - } - - protected function forceRevisionDate( WikiPage $page, $timestamp ) { - $dbw = wfGetDB( DB_MASTER ); - - $dbw->update( 'revision', - array( 'rev_timestamp' => $dbw->timestamp( $timestamp ) ), - array( 'rev_id' => $page->getLatest() ) ); - - $page->clear(); - } -} diff --git a/tests/phpunit/includes/api/ApiOptionsTest.php b/tests/phpunit/includes/api/ApiOptionsTest.php deleted file mode 100644 index ad1e73ab..00000000 --- a/tests/phpunit/includes/api/ApiOptionsTest.php +++ /dev/null @@ -1,420 +0,0 @@ - 'success' ); - - protected function setUp() { - parent::setUp(); - - $this->mUserMock = $this->getMockBuilder( 'User' ) - ->disableOriginalConstructor() - ->getMock(); - - // Set up groups and rights - $this->mUserMock->expects( $this->any() ) - ->method( 'getEffectiveGroups' )->will( $this->returnValue( array( '*', 'user' ) ) ); - $this->mUserMock->expects( $this->any() ) - ->method( 'isAllowed' )->will( $this->returnValue( true ) ); - - // Set up callback for User::getOptionKinds - $this->mUserMock->expects( $this->any() ) - ->method( 'getOptionKinds' )->will( $this->returnCallback( array( $this, 'getOptionKinds' ) ) ); - - // Create a new context - $this->mContext = new DerivativeContext( new RequestContext() ); - $this->mContext->getContext()->setTitle( Title::newFromText( 'Test' ) ); - $this->mContext->setUser( $this->mUserMock ); - - $main = new ApiMain( $this->mContext ); - - // Empty session - $this->mSession = array(); - - $this->mTested = new ApiOptions( $main, 'options' ); - - global $wgHooks; - if ( !isset( $wgHooks['GetPreferences'] ) ) { - $wgHooks['GetPreferences'] = array(); - } - $this->mOldGetPreferencesHooks = $wgHooks['GetPreferences']; - $wgHooks['GetPreferences'][] = array( $this, 'hookGetPreferences' ); - } - - protected function tearDown() { - global $wgHooks; - - if ( $this->mOldGetPreferencesHooks !== false ) { - $wgHooks['GetPreferences'] = $this->mOldGetPreferencesHooks; - $this->mOldGetPreferencesHooks = false; - } - - parent::tearDown(); - } - - public function hookGetPreferences( $user, &$preferences ) { - $preferences = array(); - - foreach ( array( 'name', 'willBeNull', 'willBeEmpty', 'willBeHappy' ) as $k ) { - $preferences[$k] = array( - 'type' => 'text', - 'section' => 'test', - 'label' => ' ', - ); - } - - $preferences['testmultiselect'] = array( - 'type' => 'multiselect', - 'options' => array( - 'Test' => array( - 'Some HTML here for option 1' => 'opt1', - 'Some HTML here for option 2' => 'opt2', - 'Some HTML here for option 3' => 'opt3', - 'Some HTML here for option 4' => 'opt4', - ), - ), - 'section' => 'test', - 'label' => ' ', - 'prefix' => 'testmultiselect-', - 'default' => array(), - ); - - return true; - } - - public function getOptionKinds( IContextSource $context, $options = null ) { - // Match with above. - $kinds = array( - 'name' => 'registered', - 'willBeNull' => 'registered', - 'willBeEmpty' => 'registered', - 'willBeHappy' => 'registered', - 'testmultiselect-opt1' => 'registered-multiselect', - 'testmultiselect-opt2' => 'registered-multiselect', - 'testmultiselect-opt3' => 'registered-multiselect', - 'testmultiselect-opt4' => 'registered-multiselect', - ); - - if ( $options === null ) { - return $kinds; - } - - $mapping = array(); - foreach ( $options as $key => $value ) { - if ( isset( $kinds[$key] ) ) { - $mapping[$key] = $kinds[$key]; - } elseif ( substr( $key, 0, 7 ) === 'userjs-' ) { - $mapping[$key] = 'userjs'; - } else { - $mapping[$key] = 'unused'; - } - } - - return $mapping; - } - - private function getSampleRequest( $custom = array() ) { - $request = array( - 'token' => '123ABC', - 'change' => null, - 'optionname' => null, - 'optionvalue' => null, - ); - - return array_merge( $request, $custom ); - } - - private function executeQuery( $request ) { - $this->mContext->setRequest( new FauxRequest( $request, true, $this->mSession ) ); - $this->mTested->execute(); - - return $this->mTested->getResult()->getData(); - } - - /** - * @expectedException UsageException - */ - public function testNoToken() { - $request = $this->getSampleRequest( array( 'token' => null ) ); - - $this->executeQuery( $request ); - } - - public function testAnon() { - $this->mUserMock->expects( $this->once() ) - ->method( 'isAnon' ) - ->will( $this->returnValue( true ) ); - - try { - $request = $this->getSampleRequest(); - - $this->executeQuery( $request ); - } catch ( UsageException $e ) { - $this->assertEquals( 'notloggedin', $e->getCodeString() ); - $this->assertEquals( 'Anonymous users cannot change preferences', $e->getMessage() ); - - return; - } - $this->fail( "UsageException was not thrown" ); - } - - public function testNoOptionname() { - try { - $request = $this->getSampleRequest( array( 'optionvalue' => '1' ) ); - - $this->executeQuery( $request ); - } catch ( UsageException $e ) { - $this->assertEquals( 'nooptionname', $e->getCodeString() ); - $this->assertEquals( 'The optionname parameter must be set', $e->getMessage() ); - - return; - } - $this->fail( "UsageException was not thrown" ); - } - - public function testNoChanges() { - $this->mUserMock->expects( $this->never() ) - ->method( 'resetOptions' ); - - $this->mUserMock->expects( $this->never() ) - ->method( 'setOption' ); - - $this->mUserMock->expects( $this->never() ) - ->method( 'saveSettings' ); - - try { - $request = $this->getSampleRequest(); - - $this->executeQuery( $request ); - } catch ( UsageException $e ) { - $this->assertEquals( 'nochanges', $e->getCodeString() ); - $this->assertEquals( 'No changes were requested', $e->getMessage() ); - - return; - } - $this->fail( "UsageException was not thrown" ); - } - - public function testReset() { - $this->mUserMock->expects( $this->once() ) - ->method( 'resetOptions' ) - ->with( $this->equalTo( array( 'all' ) ) ); - - $this->mUserMock->expects( $this->never() ) - ->method( 'setOption' ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'saveSettings' ); - - $request = $this->getSampleRequest( array( 'reset' => '' ) ); - - $response = $this->executeQuery( $request ); - - $this->assertEquals( self::$Success, $response ); - } - - public function testResetKinds() { - $this->mUserMock->expects( $this->once() ) - ->method( 'resetOptions' ) - ->with( $this->equalTo( array( 'registered' ) ) ); - - $this->mUserMock->expects( $this->never() ) - ->method( 'setOption' ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'saveSettings' ); - - $request = $this->getSampleRequest( array( 'reset' => '', 'resetkinds' => 'registered' ) ); - - $response = $this->executeQuery( $request ); - - $this->assertEquals( self::$Success, $response ); - } - - public function testOptionWithValue() { - $this->mUserMock->expects( $this->never() ) - ->method( 'resetOptions' ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'name' ), $this->equalTo( 'value' ) ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'saveSettings' ); - - $request = $this->getSampleRequest( array( 'optionname' => 'name', 'optionvalue' => 'value' ) ); - - $response = $this->executeQuery( $request ); - - $this->assertEquals( self::$Success, $response ); - } - - public function testOptionResetValue() { - $this->mUserMock->expects( $this->never() ) - ->method( 'resetOptions' ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'name' ), $this->identicalTo( null ) ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'saveSettings' ); - - $request = $this->getSampleRequest( array( 'optionname' => 'name' ) ); - $response = $this->executeQuery( $request ); - - $this->assertEquals( self::$Success, $response ); - } - - public function testChange() { - $this->mUserMock->expects( $this->never() ) - ->method( 'resetOptions' ); - - $this->mUserMock->expects( $this->at( 2 ) ) - ->method( 'getOptions' ); - - $this->mUserMock->expects( $this->at( 4 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'willBeNull' ), $this->identicalTo( null ) ); - - $this->mUserMock->expects( $this->at( 5 ) ) - ->method( 'getOptions' ); - - $this->mUserMock->expects( $this->at( 6 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'willBeEmpty' ), $this->equalTo( '' ) ); - - $this->mUserMock->expects( $this->at( 7 ) ) - ->method( 'getOptions' ); - - $this->mUserMock->expects( $this->at( 8 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'willBeHappy' ), $this->equalTo( 'Happy' ) ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'saveSettings' ); - - $request = $this->getSampleRequest( array( 'change' => 'willBeNull|willBeEmpty=|willBeHappy=Happy' ) ); - - $response = $this->executeQuery( $request ); - - $this->assertEquals( self::$Success, $response ); - } - - public function testResetChangeOption() { - $this->mUserMock->expects( $this->once() ) - ->method( 'resetOptions' ); - - $this->mUserMock->expects( $this->at( 4 ) ) - ->method( 'getOptions' ); - - $this->mUserMock->expects( $this->at( 5 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'willBeHappy' ), $this->equalTo( 'Happy' ) ); - - $this->mUserMock->expects( $this->at( 6 ) ) - ->method( 'getOptions' ); - - $this->mUserMock->expects( $this->at( 7 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'name' ), $this->equalTo( 'value' ) ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'saveSettings' ); - - $args = array( - 'reset' => '', - 'change' => 'willBeHappy=Happy', - 'optionname' => 'name', - 'optionvalue' => 'value' - ); - - $response = $this->executeQuery( $this->getSampleRequest( $args ) ); - - $this->assertEquals( self::$Success, $response ); - } - - public function testMultiSelect() { - $this->mUserMock->expects( $this->never() ) - ->method( 'resetOptions' ); - - $this->mUserMock->expects( $this->at( 3 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'testmultiselect-opt1' ), $this->identicalTo( true ) ); - - $this->mUserMock->expects( $this->at( 4 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'testmultiselect-opt2' ), $this->identicalTo( null ) ); - - $this->mUserMock->expects( $this->at( 5 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'testmultiselect-opt3' ), $this->identicalTo( false ) ); - - $this->mUserMock->expects( $this->at( 6 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'testmultiselect-opt4' ), $this->identicalTo( false ) ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'saveSettings' ); - - $request = $this->getSampleRequest( array( - 'change' => 'testmultiselect-opt1=1|testmultiselect-opt2|testmultiselect-opt3=|testmultiselect-opt4=0' - ) ); - - $response = $this->executeQuery( $request ); - - $this->assertEquals( self::$Success, $response ); - } - - public function testUnknownOption() { - $this->mUserMock->expects( $this->never() ) - ->method( 'resetOptions' ); - - $this->mUserMock->expects( $this->never() ) - ->method( 'saveSettings' ); - - $request = $this->getSampleRequest( array( - 'change' => 'unknownOption=1' - ) ); - - $response = $this->executeQuery( $request ); - - $this->assertEquals( array( - 'options' => 'success', - 'warnings' => array( - 'options' => array( - '*' => "Validation error for 'unknownOption': not a valid preference" - ) - ) - ), $response ); - } - - public function testUserjsOption() { - $this->mUserMock->expects( $this->never() ) - ->method( 'resetOptions' ); - - $this->mUserMock->expects( $this->at( 3 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'userjs-option' ), $this->equalTo( '1' ) ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'saveSettings' ); - - $request = $this->getSampleRequest( array( - 'change' => 'userjs-option=1' - ) ); - - $response = $this->executeQuery( $request ); - - $this->assertEquals( self::$Success, $response ); - } -} diff --git a/tests/phpunit/includes/api/ApiParseTest.php b/tests/phpunit/includes/api/ApiParseTest.php deleted file mode 100644 index 2d714e65..00000000 --- a/tests/phpunit/includes/api/ApiParseTest.php +++ /dev/null @@ -1,29 +0,0 @@ -doLogin(); - } - - public function testParseNonexistentPage() { - $somePage = mt_rand(); - - try { - $this->doApiRequest( array( - 'action' => 'parse', - 'page' => $somePage ) ); - - $this->fail( "API did not return an error when parsing a nonexistent page" ); - } catch ( UsageException $ex ) { - $this->assertEquals( 'missingtitle', $ex->getCodeString(), - "Parse request for nonexistent page must give 'missingtitle' error: " . var_export( $ex->getMessageArray(), true ) ); - } - } -} diff --git a/tests/phpunit/includes/api/ApiPurgeTest.php b/tests/phpunit/includes/api/ApiPurgeTest.php deleted file mode 100644 index 28b5ff4d..00000000 --- a/tests/phpunit/includes/api/ApiPurgeTest.php +++ /dev/null @@ -1,40 +0,0 @@ -doLogin(); - } - - /** - * @group Broken - */ - public function testPurgeMainPage() { - if ( !Title::newFromText( 'UTPage' )->exists() ) { - $this->markTestIncomplete( "The article [[UTPage]] does not exist" ); - } - - $somePage = mt_rand(); - - $data = $this->doApiRequest( array( - 'action' => 'purge', - 'titles' => 'UTPage|' . $somePage . '|%5D' ) ); - - $this->assertArrayHasKey( 'purge', $data[0], - "Must receive a 'purge' result from API" ); - - $this->assertEquals( 3, count( $data[0]['purge'] ), - "Purge request for three articles should give back three results received: " . var_export( $data[0]['purge'], true ) ); - - $pages = array( 'UTPage' => 'purged', $somePage => 'missing', '%5D' => 'invalid' ); - foreach ( $data[0]['purge'] as $v ) { - $this->assertArrayHasKey( $pages[$v['title']], $v ); - } - } -} diff --git a/tests/phpunit/includes/api/ApiTest.php b/tests/phpunit/includes/api/ApiTest.php deleted file mode 100644 index 472f8c4a..00000000 --- a/tests/phpunit/includes/api/ApiTest.php +++ /dev/null @@ -1,259 +0,0 @@ -assertEquals( - null, $mock->requireOnlyOneParameter( array( "filename" => "foo.txt", - "enablechunks" => false ), "filename", "enablechunks" ) ); - } - - /** - * @expectedException UsageException - */ - public function testRequireOnlyOneParameterZero() { - $mock = new MockApi(); - - $this->assertEquals( - null, $mock->requireOnlyOneParameter( array( "filename" => "foo.txt", - "enablechunks" => 0 ), "filename", "enablechunks" ) ); - } - - /** - * @expectedException UsageException - */ - public function testRequireOnlyOneParameterTrue() { - $mock = new MockApi(); - - $this->assertEquals( - null, $mock->requireOnlyOneParameter( array( "filename" => "foo.txt", - "enablechunks" => true ), "filename", "enablechunks" ) ); - } - - /** - * Test that the API will accept a FauxRequest and execute. The help action - * (default) throws a UsageException. Just validate we're getting proper XML - * - * @expectedException UsageException - */ - public function testApi() { - $api = new ApiMain( - new FauxRequest( array( 'action' => 'help', 'format' => 'xml' ) ) - ); - $api->execute(); - $api->getPrinter()->setBufferResult( true ); - $api->printResult( false ); - $resp = $api->getPrinter()->getBuffer(); - - libxml_use_internal_errors( true ); - $sxe = simplexml_load_string( $resp ); - $this->assertNotInternalType( "bool", $sxe ); - $this->assertThat( $sxe, $this->isInstanceOf( "SimpleXMLElement" ) ); - } - - /** - * Test result of attempted login with an empty username - */ - public function testApiLoginNoName() { - $data = $this->doApiRequest( array( 'action' => 'login', - 'lgname' => '', 'lgpassword' => self::$users['sysop']->password, - ) ); - $this->assertEquals( 'NoName', $data[0]['login']['result'] ); - } - - public function testApiLoginBadPass() { - global $wgServer; - - $user = self::$users['sysop']; - $user->user->logOut(); - - if ( !isset( $wgServer ) ) { - $this->markTestIncomplete( 'This test needs $wgServer to be set in LocalSettings.php' ); - } - $ret = $this->doApiRequest( array( - "action" => "login", - "lgname" => $user->username, - "lgpassword" => "bad", - ) ); - - $result = $ret[0]; - - $this->assertNotInternalType( "bool", $result ); - $a = $result["login"]["result"]; - $this->assertEquals( "NeedToken", $a ); - - $token = $result["login"]["token"]; - - $ret = $this->doApiRequest( - array( - "action" => "login", - "lgtoken" => $token, - "lgname" => $user->username, - "lgpassword" => "badnowayinhell", - ), - $ret[2] - ); - - $result = $ret[0]; - - $this->assertNotInternalType( "bool", $result ); - $a = $result["login"]["result"]; - - $this->assertEquals( "WrongPass", $a ); - } - - public function testApiLoginGoodPass() { - global $wgServer; - - if ( !isset( $wgServer ) ) { - $this->markTestIncomplete( 'This test needs $wgServer to be set in LocalSettings.php' ); - } - - $user = self::$users['sysop']; - $user->user->logOut(); - - $ret = $this->doApiRequest( array( - "action" => "login", - "lgname" => $user->username, - "lgpassword" => $user->password, - ) - ); - - $result = $ret[0]; - $this->assertNotInternalType( "bool", $result ); - $this->assertNotInternalType( "null", $result["login"] ); - - $a = $result["login"]["result"]; - $this->assertEquals( "NeedToken", $a ); - $token = $result["login"]["token"]; - - $ret = $this->doApiRequest( - array( - "action" => "login", - "lgtoken" => $token, - "lgname" => $user->username, - "lgpassword" => $user->password, - ), - $ret[2] - ); - - $result = $ret[0]; - - $this->assertNotInternalType( "bool", $result ); - $a = $result["login"]["result"]; - - $this->assertEquals( "Success", $a ); - } - - /** - * @group Broken - */ - public function testApiGotCookie() { - $this->markTestIncomplete( "The server can't do external HTTP requests, and the internal one won't give cookies" ); - - global $wgServer, $wgScriptPath; - - if ( !isset( $wgServer ) ) { - $this->markTestIncomplete( 'This test needs $wgServer to be set in LocalSettings.php' ); - } - $user = self::$users['sysop']; - - $req = MWHttpRequest::factory( self::$apiUrl . "?action=login&format=xml", - array( "method" => "POST", - "postData" => array( - "lgname" => $user->username, - "lgpassword" => $user->password - ) - ) - ); - $req->execute(); - - libxml_use_internal_errors( true ); - $sxe = simplexml_load_string( $req->getContent() ); - $this->assertNotInternalType( "bool", $sxe ); - $this->assertThat( $sxe, $this->isInstanceOf( "SimpleXMLElement" ) ); - $this->assertNotInternalType( "null", $sxe->login[0] ); - - $a = $sxe->login[0]->attributes()->result[0]; - $this->assertEquals( ' result="NeedToken"', $a->asXML() ); - $token = (string)$sxe->login[0]->attributes()->token; - - $req->setData( array( - "lgtoken" => $token, - "lgname" => $user->username, - "lgpassword" => $user->password ) ); - $req->execute(); - - $cj = $req->getCookieJar(); - $serverName = parse_url( $wgServer, PHP_URL_HOST ); - $this->assertNotEquals( false, $serverName ); - $serializedCookie = $cj->serializeToHttpRequest( $wgScriptPath, $serverName ); - $this->assertNotEquals( '', $serializedCookie ); - $this->assertRegexp( '/_session=[^;]*; .*UserID=[0-9]*; .*UserName=' . $user->userName . '; .*Token=/', $serializedCookie ); - - return $cj; - } - - public function testRunLogin() { - $sysopUser = self::$users['sysop']; - $data = $this->doApiRequest( array( - 'action' => 'login', - 'lgname' => $sysopUser->username, - 'lgpassword' => $sysopUser->password ) ); - - $this->assertArrayHasKey( "login", $data[0] ); - $this->assertArrayHasKey( "result", $data[0]['login'] ); - $this->assertEquals( "NeedToken", $data[0]['login']['result'] ); - $token = $data[0]['login']['token']; - - $data = $this->doApiRequest( array( - 'action' => 'login', - "lgtoken" => $token, - "lgname" => $sysopUser->username, - "lgpassword" => $sysopUser->password ), $data[2] ); - - $this->assertArrayHasKey( "login", $data[0] ); - $this->assertArrayHasKey( "result", $data[0]['login'] ); - $this->assertEquals( "Success", $data[0]['login']['result'] ); - $this->assertArrayHasKey( 'lgtoken', $data[0]['login'] ); - - return $data; - } - - public function testGettingToken() { - foreach ( self::$users as $user ) { - $this->runTokenTest( $user ); - } - } - - function runTokenTest( $user ) { - $tokens = $this->getTokenList( $user ); - - $rights = $user->user->getRights(); - - $this->assertArrayHasKey( 'edittoken', $tokens ); - $this->assertArrayHasKey( 'movetoken', $tokens ); - - if ( isset( $rights['delete'] ) ) { - $this->assertArrayHasKey( 'deletetoken', $tokens ); - } - - if ( isset( $rights['block'] ) ) { - $this->assertArrayHasKey( 'blocktoken', $tokens ); - $this->assertArrayHasKey( 'unblocktoken', $tokens ); - } - - if ( isset( $rights['protect'] ) ) { - $this->assertArrayHasKey( 'protecttoken', $tokens ); - } - - return $tokens; - } -} diff --git a/tests/phpunit/includes/api/ApiTestCase.php b/tests/phpunit/includes/api/ApiTestCase.php deleted file mode 100644 index 94ef9c68..00000000 --- a/tests/phpunit/includes/api/ApiTestCase.php +++ /dev/null @@ -1,253 +0,0 @@ - new TestUser( - 'Apitestsysop', - 'Api Test Sysop', - 'api_test_sysop@example.com', - array( 'sysop' ) - ), - 'uploader' => new TestUser( - 'Apitestuser', - 'Api Test User', - 'api_test_user@example.com', - array() - ) - ); - - $this->setMwGlobals( array( - 'wgMemc' => new EmptyBagOStuff(), - 'wgAuth' => new StubObject( 'wgAuth', 'AuthPlugin' ), - 'wgRequest' => new FauxRequest( array() ), - 'wgUser' => self::$users['sysop']->user, - ) ); - - $this->apiContext = new ApiTestContext(); - } - - /** - * Edits or creates a page/revision - * @param $pageName string page title - * @param $text string content of the page - * @param $summary string optional summary string for the revision - * @param $defaultNs int optional namespace id - * @return array as returned by WikiPage::doEditContent() - */ - protected function editPage( $pageName, $text, $summary = '', $defaultNs = NS_MAIN ) { - $title = Title::newFromText( $pageName, $defaultNs ); - $page = WikiPage::factory( $title ); - - return $page->doEditContent( ContentHandler::makeContent( $text, $title ), $summary ); - } - - /** - * Does the API request and returns the result. - * - * The returned value is an array containing - * - the result data (array) - * - the request (WebRequest) - * - the session data of the request (array) - * - if $appendModule is true, the Api module $module - * - * @param array $params - * @param array|null $session - * @param bool $appendModule - * @param User|null $user - * - * @return array - */ - protected function doApiRequest( array $params, array $session = null, $appendModule = false, User $user = null ) { - global $wgRequest, $wgUser; - - if ( is_null( $session ) ) { - // re-use existing global session by default - $session = $wgRequest->getSessionArray(); - } - - // set up global environment - if ( $user ) { - $wgUser = $user; - } - - $wgRequest = new FauxRequest( $params, true, $session ); - RequestContext::getMain()->setRequest( $wgRequest ); - - // set up local environment - $context = $this->apiContext->newTestContext( $wgRequest, $wgUser ); - - $module = new ApiMain( $context, true ); - - // run it! - $module->execute(); - - // construct result - $results = array( - $module->getResultData(), - $context->getRequest(), - $context->getRequest()->getSessionArray() - ); - - if ( $appendModule ) { - $results[] = $module; - } - - return $results; - } - - /** - * Add an edit token to the API request - * This is cheating a bit -- we grab a token in the correct format and then add it to the pseudo-session and to the - * request, without actually requesting a "real" edit token - * @param $params Array: key-value API params - * @param $session Array|null: session array - * @param $user User|null A User object for the context - * @return result of the API call - * @throws Exception in case wsToken is not set in the session - */ - protected function doApiRequestWithToken( array $params, array $session = null, User $user = null ) { - global $wgRequest; - - if ( $session === null ) { - $session = $wgRequest->getSessionArray(); - } - - if ( $session['wsToken'] ) { - // add edit token to fake session - $session['wsEditToken'] = $session['wsToken']; - // add token to request parameters - $params['token'] = md5( $session['wsToken'] ) . User::EDIT_TOKEN_SUFFIX; - - return $this->doApiRequest( $params, $session, false, $user ); - } else { - throw new Exception( "request data not in right format" ); - } - } - - protected function doLogin( $user = 'sysop' ) { - if ( !array_key_exists( $user, self::$users ) ) { - throw new MWException( "Can not log in to undefined user $user" ); - } - - $data = $this->doApiRequest( array( - 'action' => 'login', - 'lgname' => self::$users[ $user ]->username, - 'lgpassword' => self::$users[ $user ]->password ) ); - - $token = $data[0]['login']['token']; - - $data = $this->doApiRequest( - array( - 'action' => 'login', - 'lgtoken' => $token, - 'lgname' => self::$users[ $user ]->username, - 'lgpassword' => self::$users[ $user ]->password, - ), - $data[2] - ); - - return $data; - } - - protected function getTokenList( $user, $session = null ) { - $data = $this->doApiRequest( array( - 'action' => 'tokens', - 'type' => 'edit|delete|protect|move|block|unblock|watch' - ), $session, false, $user->user ); - - if ( !array_key_exists( 'tokens', $data[0] ) ) { - throw new MWException( 'Api failed to return a token list' ); - } - - return $data[0]['tokens']; - } - - public function testApiTestGroup() { - $groups = PHPUnit_Util_Test::getGroups( get_class( $this ) ); - $constraint = PHPUnit_Framework_Assert::logicalOr( - $this->contains( 'medium' ), - $this->contains( 'large' ) - ); - $this->assertThat( $groups, $constraint, - 'ApiTestCase::setUp can be slow, tests must be "medium" or "large"' - ); - } -} - -class UserWrapper { - public $userName; - public $password; - public $user; - - public function __construct( $userName, $password, $group = '' ) { - $this->userName = $userName; - $this->password = $password; - - $this->user = User::newFromName( $this->userName ); - if ( !$this->user->getID() ) { - $this->user = User::createNew( $this->userName, array( - "email" => "test@example.com", - "real_name" => "Test User" ) ); - } - $this->user->setPassword( $this->password ); - - if ( $group !== '' ) { - $this->user->addGroup( $group ); - } - $this->user->saveSettings(); - } -} - -class MockApi extends ApiBase { - public function execute() { - } - - public function getVersion() { - } - - public function __construct() { - } - - public function getAllowedParams() { - return array( - 'filename' => null, - 'enablechunks' => false, - 'sessionkey' => null, - ); - } -} - -class ApiTestContext extends RequestContext { - - /** - * Returns a DerivativeContext with the request variables in place - * - * @param $request WebRequest request object including parameters and session - * @param $user User or null - * @return DerivativeContext - */ - public function newTestContext( WebRequest $request, User $user = null ) { - $context = new DerivativeContext( $this ); - $context->setRequest( $request ); - if ( $user !== null ) { - $context->setUser( $user ); - } - - return $context; - } -} diff --git a/tests/phpunit/includes/api/ApiTestCaseUpload.php b/tests/phpunit/includes/api/ApiTestCaseUpload.php deleted file mode 100644 index 7e18b6ed..00000000 --- a/tests/phpunit/includes/api/ApiTestCaseUpload.php +++ /dev/null @@ -1,149 +0,0 @@ -setMwGlobals( array( - 'wgEnableUploads' => true, - 'wgEnableAPI' => true, - ) ); - - wfSetupSession(); - - $this->clearFakeUploads(); - } - - protected function tearDown() { - $this->clearTempUpload(); - - parent::tearDown(); - } - - /** - * Helper function -- remove files and associated articles by Title - * @param $title Title: title to be removed - */ - public function deleteFileByTitle( $title ) { - if ( $title->exists() ) { - $file = wfFindFile( $title, array( 'ignoreRedirect' => true ) ); - $noOldArchive = ""; // yes this really needs to be set this way - $comment = "removing for test"; - $restrictDeletedVersions = false; - $status = FileDeleteForm::doDelete( $title, $file, $noOldArchive, $comment, $restrictDeletedVersions ); - if ( !$status->isGood() ) { - return false; - } - $page = WikiPage::factory( $title ); - $page->doDeleteArticle( "removing for test" ); - - // see if it now doesn't exist; reload - $title = Title::newFromText( $title->getText(), NS_FILE ); - } - - return !( $title && $title instanceof Title && $title->exists() ); - } - - /** - * Helper function -- remove files and associated articles with a particular filename - * @param $fileName String: filename to be removed - */ - public function deleteFileByFileName( $fileName ) { - return $this->deleteFileByTitle( Title::newFromText( $fileName, NS_FILE ) ); - } - - /** - * Helper function -- given a file on the filesystem, find matching content in the db (and associated articles) and remove them. - * @param $filePath String: path to file on the filesystem - */ - public function deleteFileByContent( $filePath ) { - $hash = FSFile::getSha1Base36FromPath( $filePath ); - $dupes = RepoGroup::singleton()->findBySha1( $hash ); - $success = true; - foreach ( $dupes as $dupe ) { - $success &= $this->deleteFileByTitle( $dupe->getTitle() ); - } - - return $success; - } - - /** - * Fake an upload by dumping the file into temp space, and adding info to $_FILES. - * (This is what PHP would normally do). - * @param $fieldName String: name this would have in the upload form - * @param $fileName String: name to title this - * @param $type String: mime type - * @param $filePath String: path where to find file contents - */ - function fakeUploadFile( $fieldName, $fileName, $type, $filePath ) { - $tmpName = tempnam( wfTempDir(), "" ); - if ( !file_exists( $filePath ) ) { - throw new Exception( "$filePath doesn't exist!" ); - } - - if ( !copy( $filePath, $tmpName ) ) { - throw new Exception( "couldn't copy $filePath to $tmpName" ); - } - - clearstatcache(); - $size = filesize( $tmpName ); - if ( $size === false ) { - throw new Exception( "couldn't stat $tmpName" ); - } - - $_FILES[$fieldName] = array( - 'name' => $fileName, - 'type' => $type, - 'tmp_name' => $tmpName, - 'size' => $size, - 'error' => null - ); - - return true; - } - - function fakeUploadChunk( $fieldName, $fileName, $type, & $chunkData ) { - $tmpName = tempnam( wfTempDir(), "" ); - // copy the chunk data to temp location: - if ( !file_put_contents( $tmpName, $chunkData ) ) { - throw new Exception( "couldn't copy chunk data to $tmpName" ); - } - - clearstatcache(); - $size = filesize( $tmpName ); - if ( $size === false ) { - throw new Exception( "couldn't stat $tmpName" ); - } - - $_FILES[$fieldName] = array( - 'name' => $fileName, - 'type' => $type, - 'tmp_name' => $tmpName, - 'size' => $size, - 'error' => null - ); - } - - function clearTempUpload() { - if ( isset( $_FILES['file']['tmp_name'] ) ) { - $tmp = $_FILES['file']['tmp_name']; - if ( file_exists( $tmp ) ) { - unlink( $tmp ); - } - } - } - - /** - * Remove traces of previous fake uploads - */ - function clearFakeUploads() { - $_FILES = array(); - } -} diff --git a/tests/phpunit/includes/api/ApiUploadTest.php b/tests/phpunit/includes/api/ApiUploadTest.php deleted file mode 100644 index 1540af55..00000000 --- a/tests/phpunit/includes/api/ApiUploadTest.php +++ /dev/null @@ -1,561 +0,0 @@ - 'login', - 'lgname' => $user->username, - 'lgpassword' => $user->password - ); - list( $result, , $session ) = $this->doApiRequest( $params ); - $this->assertArrayHasKey( "login", $result ); - $this->assertArrayHasKey( "result", $result['login'] ); - $this->assertEquals( "NeedToken", $result['login']['result'] ); - $token = $result['login']['token']; - - $params = array( - 'action' => 'login', - 'lgtoken' => $token, - 'lgname' => $user->username, - 'lgpassword' => $user->password - ); - list( $result, , $session ) = $this->doApiRequest( $params, $session ); - $this->assertArrayHasKey( "login", $result ); - $this->assertArrayHasKey( "result", $result['login'] ); - $this->assertEquals( "Success", $result['login']['result'] ); - $this->assertArrayHasKey( 'lgtoken', $result['login'] ); - - $this->assertNotEmpty( $session, 'API Login must return a session' ); - - return $session; - } - - /** - * @depends testLogin - */ - public function testUploadRequiresToken( $session ) { - $exception = false; - try { - $this->doApiRequest( array( - 'action' => 'upload' - ) ); - } catch ( UsageException $e ) { - $exception = true; - $this->assertEquals( "The token parameter must be set", $e->getMessage() ); - } - $this->assertTrue( $exception, "Got exception" ); - } - - /** - * @depends testLogin - */ - public function testUploadMissingParams( $session ) { - $exception = false; - try { - $this->doApiRequestWithToken( array( - 'action' => 'upload', - ), $session, self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $exception = true; - $this->assertEquals( "One of the parameters filekey, file, url, statuskey is required", - $e->getMessage() ); - } - $this->assertTrue( $exception, "Got exception" ); - } - - - /** - * @depends testLogin - */ - public function testUpload( $session ) { - $extension = 'png'; - $mimeType = 'image/png'; - - try { - $randomImageGenerator = new RandomImageGenerator(); - $filePaths = $randomImageGenerator->writeImages( 1, $extension, wfTempDir() ); - } catch ( Exception $e ) { - $this->markTestIncomplete( $e->getMessage() ); - } - - $filePath = $filePaths[0]; - $fileSize = filesize( $filePath ); - $fileName = basename( $filePath ); - - $this->deleteFileByFileName( $fileName ); - $this->deleteFileByContent( $filePath ); - - if ( !$this->fakeUploadFile( 'file', $fileName, $mimeType, $filePath ) ) { - $this->markTestIncomplete( "Couldn't upload file!\n" ); - } - - $params = array( - 'action' => 'upload', - 'filename' => $fileName, - 'file' => 'dummy content', - 'comment' => 'dummy comment', - 'text' => "This is the page text for $fileName", - ); - - $exception = false; - try { - list( $result, , ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $exception = true; - } - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertEquals( 'Success', $result['upload']['result'] ); - $this->assertEquals( $fileSize, (int)$result['upload']['imageinfo']['size'] ); - $this->assertEquals( $mimeType, $result['upload']['imageinfo']['mime'] ); - $this->assertFalse( $exception ); - - // clean up - $this->deleteFileByFilename( $fileName ); - unlink( $filePath ); - } - - - /** - * @depends testLogin - */ - public function testUploadZeroLength( $session ) { - $mimeType = 'image/png'; - - $filePath = tempnam( wfTempDir(), "" ); - $fileName = "apiTestUploadZeroLength.png"; - - $this->deleteFileByFileName( $fileName ); - - if ( !$this->fakeUploadFile( 'file', $fileName, $mimeType, $filePath ) ) { - $this->markTestIncomplete( "Couldn't upload file!\n" ); - } - - $params = array( - 'action' => 'upload', - 'filename' => $fileName, - 'file' => 'dummy content', - 'comment' => 'dummy comment', - 'text' => "This is the page text for $fileName", - ); - - $exception = false; - try { - $this->doApiRequestWithToken( $params, $session, self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $this->assertContains( 'The file you submitted was empty', $e->getMessage() ); - $exception = true; - } - $this->assertTrue( $exception ); - - // clean up - $this->deleteFileByFilename( $fileName ); - unlink( $filePath ); - } - - - /** - * @depends testLogin - */ - public function testUploadSameFileName( $session ) { - $extension = 'png'; - $mimeType = 'image/png'; - - try { - $randomImageGenerator = new RandomImageGenerator(); - $filePaths = $randomImageGenerator->writeImages( 2, $extension, wfTempDir() ); - } catch ( Exception $e ) { - $this->markTestIncomplete( $e->getMessage() ); - } - - // we'll reuse this filename - $fileName = basename( $filePaths[0] ); - - // clear any other files with the same name - $this->deleteFileByFileName( $fileName ); - - // we reuse these params - $params = array( - 'action' => 'upload', - 'filename' => $fileName, - 'file' => 'dummy content', - 'comment' => 'dummy comment', - 'text' => "This is the page text for $fileName", - ); - - // first upload .... should succeed - - if ( !$this->fakeUploadFile( 'file', $fileName, $mimeType, $filePaths[0] ) ) { - $this->markTestIncomplete( "Couldn't upload file!\n" ); - } - - $exception = false; - try { - list( $result, , $session ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $exception = true; - } - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertEquals( 'Success', $result['upload']['result'] ); - $this->assertFalse( $exception ); - - // second upload with the same name (but different content) - - if ( !$this->fakeUploadFile( 'file', $fileName, $mimeType, $filePaths[1] ) ) { - $this->markTestIncomplete( "Couldn't upload file!\n" ); - } - - $exception = false; - try { - list( $result, , ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); // FIXME: leaks a temporary file - } catch ( UsageException $e ) { - $exception = true; - } - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertEquals( 'Warning', $result['upload']['result'] ); - $this->assertTrue( isset( $result['upload']['warnings'] ) ); - $this->assertTrue( isset( $result['upload']['warnings']['exists'] ) ); - $this->assertFalse( $exception ); - - // clean up - $this->deleteFileByFilename( $fileName ); - unlink( $filePaths[0] ); - unlink( $filePaths[1] ); - } - - - /** - * @depends testLogin - */ - public function testUploadSameContent( $session ) { - $extension = 'png'; - $mimeType = 'image/png'; - - try { - $randomImageGenerator = new RandomImageGenerator(); - $filePaths = $randomImageGenerator->writeImages( 1, $extension, wfTempDir() ); - } catch ( Exception $e ) { - $this->markTestIncomplete( $e->getMessage() ); - } - - $fileNames[0] = basename( $filePaths[0] ); - $fileNames[1] = "SameContentAs" . $fileNames[0]; - - // clear any other files with the same name or content - $this->deleteFileByContent( $filePaths[0] ); - $this->deleteFileByFileName( $fileNames[0] ); - $this->deleteFileByFileName( $fileNames[1] ); - - // first upload .... should succeed - - $params = array( - 'action' => 'upload', - 'filename' => $fileNames[0], - 'file' => 'dummy content', - 'comment' => 'dummy comment', - 'text' => "This is the page text for " . $fileNames[0], - ); - - if ( !$this->fakeUploadFile( 'file', $fileNames[0], $mimeType, $filePaths[0] ) ) { - $this->markTestIncomplete( "Couldn't upload file!\n" ); - } - - $exception = false; - try { - list( $result, , $session ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $exception = true; - } - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertEquals( 'Success', $result['upload']['result'] ); - $this->assertFalse( $exception ); - - // second upload with the same content (but different name) - - if ( !$this->fakeUploadFile( 'file', $fileNames[1], $mimeType, $filePaths[0] ) ) { - $this->markTestIncomplete( "Couldn't upload file!\n" ); - } - - $params = array( - 'action' => 'upload', - 'filename' => $fileNames[1], - 'file' => 'dummy content', - 'comment' => 'dummy comment', - 'text' => "This is the page text for " . $fileNames[1], - ); - - $exception = false; - try { - list( $result ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); // FIXME: leaks a temporary file - } catch ( UsageException $e ) { - $exception = true; - } - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertEquals( 'Warning', $result['upload']['result'] ); - $this->assertTrue( isset( $result['upload']['warnings'] ) ); - $this->assertTrue( isset( $result['upload']['warnings']['duplicate'] ) ); - $this->assertFalse( $exception ); - - // clean up - $this->deleteFileByFilename( $fileNames[0] ); - $this->deleteFileByFilename( $fileNames[1] ); - unlink( $filePaths[0] ); - } - - /** - * @depends testLogin - */ - public function testUploadStash( $session ) { - $this->setMwGlobals( array( - 'wgUser' => self::$users['uploader']->user, // @todo FIXME: still used somewhere - ) ); - - $extension = 'png'; - $mimeType = 'image/png'; - - try { - $randomImageGenerator = new RandomImageGenerator(); - $filePaths = $randomImageGenerator->writeImages( 1, $extension, wfTempDir() ); - } catch ( Exception $e ) { - $this->markTestIncomplete( $e->getMessage() ); - } - - $filePath = $filePaths[0]; - $fileSize = filesize( $filePath ); - $fileName = basename( $filePath ); - - $this->deleteFileByFileName( $fileName ); - $this->deleteFileByContent( $filePath ); - - if ( !$this->fakeUploadFile( 'file', $fileName, $mimeType, $filePath ) ) { - $this->markTestIncomplete( "Couldn't upload file!\n" ); - } - - $params = array( - 'action' => 'upload', - 'stash' => 1, - 'filename' => $fileName, - 'file' => 'dummy content', - 'comment' => 'dummy comment', - 'text' => "This is the page text for $fileName", - ); - - $exception = false; - try { - list( $result, , $session ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); // FIXME: leaks a temporary file - } catch ( UsageException $e ) { - $exception = true; - } - $this->assertFalse( $exception ); - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertEquals( 'Success', $result['upload']['result'] ); - $this->assertEquals( $fileSize, (int)$result['upload']['imageinfo']['size'] ); - $this->assertEquals( $mimeType, $result['upload']['imageinfo']['mime'] ); - $this->assertTrue( isset( $result['upload']['filekey'] ) ); - $this->assertEquals( $result['upload']['sessionkey'], $result['upload']['filekey'] ); - $filekey = $result['upload']['filekey']; - - // it should be visible from Special:UploadStash - // XXX ...but how to test this, with a fake WebRequest with the session? - - // now we should try to release the file from stash - $params = array( - 'action' => 'upload', - 'filekey' => $filekey, - 'filename' => $fileName, - 'comment' => 'dummy comment', - 'text' => "This is the page text for $fileName, altered", - ); - - $this->clearFakeUploads(); - $exception = false; - try { - list( $result ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $exception = true; - } - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertEquals( 'Success', $result['upload']['result'] ); - $this->assertFalse( $exception, "No UsageException exception." ); - - // clean up - $this->deleteFileByFilename( $fileName ); - unlink( $filePath ); - } - - /** - * @depends testLogin - */ - public function testUploadChunks( $session ) { - $this->setMwGlobals( array( - 'wgUser' => self::$users['uploader']->user, // @todo FIXME: still used somewhere - ) ); - - $chunkSize = 1048576; - // Download a large image file - // ( using RandomImageGenerator for large files is not stable ) - $mimeType = 'image/jpeg'; - $url = 'http://upload.wikimedia.org/wikipedia/commons/e/ed/Oberaargletscher_from_Oberaar%2C_2010_07.JPG'; - $filePath = wfTempDir() . '/Oberaargletscher_from_Oberaar.jpg'; - try { - // Only download if the file is not avaliable in the temp location: - if ( !is_file( $filePath ) ) { - copy( $url, $filePath ); - } - } catch ( Exception $e ) { - $this->markTestIncomplete( $e->getMessage() ); - } - - $fileSize = filesize( $filePath ); - $fileName = basename( $filePath ); - - $this->deleteFileByFileName( $fileName ); - $this->deleteFileByContent( $filePath ); - - // Base upload params: - $params = array( - 'action' => 'upload', - 'stash' => 1, - 'filename' => $fileName, - 'filesize' => $fileSize, - 'offset' => 0, - ); - - // Upload chunks - $chunkSessionKey = false; - $resultOffset = 0; - // Open the file: - $handle = @fopen( $filePath, "r" ); - if ( $handle === false ) { - $this->markTestIncomplete( "could not open file: $filePath" ); - } - while ( !feof( $handle ) ) { - // Get the current chunk - $chunkData = @fread( $handle, $chunkSize ); - - // Upload the current chunk into the $_FILE object: - $this->fakeUploadChunk( 'chunk', 'blob', $mimeType, $chunkData ); - - // Check for chunkSessionKey - if ( !$chunkSessionKey ) { - // Upload fist chunk ( and get the session key ) - try { - list( $result, , $session ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $this->markTestIncomplete( $e->getMessage() ); - } - // Make sure we got a valid chunk continue: - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertTrue( isset( $result['upload']['filekey'] ) ); - // If we don't get a session key mark test incomplete. - if ( !isset( $result['upload']['filekey'] ) ) { - $this->markTestIncomplete( "no filekey provided" ); - } - $chunkSessionKey = $result['upload']['filekey']; - $this->assertEquals( 'Continue', $result['upload']['result'] ); - // First chunk should have chunkSize == offset - $this->assertEquals( $chunkSize, $result['upload']['offset'] ); - $resultOffset = $result['upload']['offset']; - continue; - } - // Filekey set to chunk session - $params['filekey'] = $chunkSessionKey; - // Update the offset ( always add chunkSize for subquent chunks should be in-sync with $result['upload']['offset'] ) - $params['offset'] += $chunkSize; - // Make sure param offset is insync with resultOffset: - $this->assertEquals( $resultOffset, $params['offset'] ); - // Upload current chunk - try { - list( $result, , $session ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $this->markTestIncomplete( $e->getMessage() ); - } - // Make sure we got a valid chunk continue: - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertTrue( isset( $result['upload']['filekey'] ) ); - - // Check if we were on the last chunk: - if ( $params['offset'] + $chunkSize >= $fileSize ) { - $this->assertEquals( 'Success', $result['upload']['result'] ); - break; - } else { - $this->assertEquals( 'Continue', $result['upload']['result'] ); - // update $resultOffset - $resultOffset = $result['upload']['offset']; - } - } - fclose( $handle ); - - // Check that we got a valid file result: - wfDebug( __METHOD__ . " hohoh filesize {$fileSize} info {$result['upload']['imageinfo']['size']}\n\n" ); - $this->assertEquals( $fileSize, $result['upload']['imageinfo']['size'] ); - $this->assertEquals( $mimeType, $result['upload']['imageinfo']['mime'] ); - $this->assertTrue( isset( $result['upload']['filekey'] ) ); - $filekey = $result['upload']['filekey']; - - // Now we should try to release the file from stash - $params = array( - 'action' => 'upload', - 'filekey' => $filekey, - 'filename' => $fileName, - 'comment' => 'dummy comment', - 'text' => "This is the page text for $fileName, altered", - ); - $this->clearFakeUploads(); - $exception = false; - try { - list( $result ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $exception = true; - } - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertEquals( 'Success', $result['upload']['result'] ); - $this->assertFalse( $exception ); - - // clean up - $this->deleteFileByFilename( $fileName ); - // don't remove downloaded temporary file for fast subquent tests. - //unlink( $filePath ); - } -} diff --git a/tests/phpunit/includes/api/ApiWatchTest.php b/tests/phpunit/includes/api/ApiWatchTest.php deleted file mode 100644 index 028ea9ff..00000000 --- a/tests/phpunit/includes/api/ApiWatchTest.php +++ /dev/null @@ -1,148 +0,0 @@ -doLogin(); - } - - function getTokens() { - return $this->getTokenList( self::$users['sysop'] ); - } - - /** - */ - public function testWatchEdit() { - $tokens = $this->getTokens(); - - $data = $this->doApiRequest( array( - 'action' => 'edit', - 'title' => 'Help:UTPage', // Help namespace is hopefully wikitext - 'text' => 'new text', - 'token' => $tokens['edittoken'], - 'watchlist' => 'watch' ) ); - $this->assertArrayHasKey( 'edit', $data[0] ); - $this->assertArrayHasKey( 'result', $data[0]['edit'] ); - $this->assertEquals( 'Success', $data[0]['edit']['result'] ); - - return $data; - } - - /** - * @depends testWatchEdit - */ - public function testWatchClear() { - $tokens = $this->getTokens(); - - $data = $this->doApiRequest( array( - 'action' => 'query', - 'list' => 'watchlist' ) ); - - if ( isset( $data[0]['query']['watchlist'] ) ) { - $wl = $data[0]['query']['watchlist']; - - foreach ( $wl as $page ) { - $data = $this->doApiRequest( array( - 'action' => 'watch', - 'title' => $page['title'], - 'unwatch' => true, - 'token' => $tokens['watchtoken'] ) ); - } - } - $data = $this->doApiRequest( array( - 'action' => 'query', - 'list' => 'watchlist' ), $data ); - $this->assertArrayHasKey( 'query', $data[0] ); - $this->assertArrayHasKey( 'watchlist', $data[0]['query'] ); - $this->assertEquals( 0, count( $data[0]['query']['watchlist'] ) ); - - return $data; - } - - /** - */ - public function testWatchProtect() { - $tokens = $this->getTokens(); - - $data = $this->doApiRequest( array( - 'action' => 'protect', - 'token' => $tokens['protecttoken'], - 'title' => 'Help:UTPage', - 'protections' => 'edit=sysop', - 'watchlist' => 'unwatch' ) ); - - $this->assertArrayHasKey( 'protect', $data[0] ); - $this->assertArrayHasKey( 'protections', $data[0]['protect'] ); - $this->assertEquals( 1, count( $data[0]['protect']['protections'] ) ); - $this->assertArrayHasKey( 'edit', $data[0]['protect']['protections'][0] ); - } - - /** - */ - public function testGetRollbackToken() { - $this->getTokens(); - - if ( !Title::newFromText( 'Help:UTPage' )->exists() ) { - $this->markTestSkipped( "The article [[Help:UTPage]] does not exist" ); //TODO: just create it? - } - - $data = $this->doApiRequest( array( - 'action' => 'query', - 'prop' => 'revisions', - 'titles' => 'Help:UTPage', - 'rvtoken' => 'rollback' ) ); - - $this->assertArrayHasKey( 'query', $data[0] ); - $this->assertArrayHasKey( 'pages', $data[0]['query'] ); - $keys = array_keys( $data[0]['query']['pages'] ); - $key = array_pop( $keys ); - - if ( isset( $data[0]['query']['pages'][$key]['missing'] ) ) { - $this->markTestSkipped( "Target page (Help:UTPage) doesn't exist" ); - } - - $this->assertArrayHasKey( 'pageid', $data[0]['query']['pages'][$key] ); - $this->assertArrayHasKey( 'revisions', $data[0]['query']['pages'][$key] ); - $this->assertArrayHasKey( 0, $data[0]['query']['pages'][$key]['revisions'] ); - $this->assertArrayHasKey( 'rollbacktoken', $data[0]['query']['pages'][$key]['revisions'][0] ); - - return $data; - } - - /** - * @group Broken - * Broken because there is currently no revision info in the $pageinfo - * - * @depends testGetRollbackToken - */ - public function testWatchRollback( $data ) { - $keys = array_keys( $data[0]['query']['pages'] ); - $key = array_pop( $keys ); - $pageinfo = $data[0]['query']['pages'][$key]; - $revinfo = $pageinfo['revisions'][0]; - - try { - $data = $this->doApiRequest( array( - 'action' => 'rollback', - 'title' => 'Help:UTPage', - 'user' => $revinfo['user'], - 'token' => $pageinfo['rollbacktoken'], - 'watchlist' => 'watch' ) ); - - $this->assertArrayHasKey( 'rollback', $data[0] ); - $this->assertArrayHasKey( 'title', $data[0]['rollback'] ); - } catch ( UsageException $ue ) { - if ( $ue->getCodeString() == 'onlyauthor' ) { - $this->markTestIncomplete( "Only one author to 'Help:UTPage', cannot test rollback" ); - } else { - $this->fail( "Received error '" . $ue->getCodeString() . "'" ); - } - } - } -} diff --git a/tests/phpunit/includes/api/PrefixUniquenessTest.php b/tests/phpunit/includes/api/PrefixUniquenessTest.php deleted file mode 100644 index d9be85e3..00000000 --- a/tests/phpunit/includes/api/PrefixUniquenessTest.php +++ /dev/null @@ -1,25 +0,0 @@ -getModuleManager()->getNamesWithClasses(); - $prefixes = array(); - - foreach ( $modules as $name => $class ) { - $module = new $class( $main, $name ); - $prefix = $module->getModulePrefix(); - if ( isset( $prefixes[$prefix] ) ) { - $this->fail( "Module prefix '{$prefix}' is shared between {$class} and {$prefixes[$prefix]}" ); - } - $prefixes[$module->getModulePrefix()] = $class; - } - $this->assertTrue( true ); // dummy call to make this test non-incomplete - } -} diff --git a/tests/phpunit/includes/api/RandomImageGenerator.php b/tests/phpunit/includes/api/RandomImageGenerator.php deleted file mode 100644 index 59756b21..00000000 --- a/tests/phpunit/includes/api/RandomImageGenerator.php +++ /dev/null @@ -1,468 +0,0 @@ - - */ - -/** - * RandomImageGenerator: does what it says on the tin. - * Can fetch a random image, or also write a number of them to disk with random filenames. - */ -class RandomImageGenerator { - - private $dictionaryFile; - private $minWidth = 400; - private $maxWidth = 800; - private $minHeight = 400; - private $maxHeight = 800; - private $shapesToDraw = 5; - - /** - * Orientations: 0th row, 0th column, Exif orientation code, rotation 2x2 matrix that is opposite of orientation - * n.b. we do not handle the 'flipped' orientations, which is why there is no entry for 2, 4, 5, or 7. Those - * seem to be rare in real images anyway - * (we also would need a non-symmetric shape for the images to test those, like a letter F) - */ - private static $orientations = array( - array( - '0thRow' => 'top', - '0thCol' => 'left', - 'exifCode' => 1, - 'counterRotation' => array( array( 1, 0 ), array( 0, 1 ) ) - ), - array( - '0thRow' => 'bottom', - '0thCol' => 'right', - 'exifCode' => 3, - 'counterRotation' => array( array( -1, 0 ), array( 0, -1 ) ) - ), - array( - '0thRow' => 'right', - '0thCol' => 'top', - 'exifCode' => 6, - 'counterRotation' => array( array( 0, 1 ), array( 1, 0 ) ) - ), - array( - '0thRow' => 'left', - '0thCol' => 'bottom', - 'exifCode' => 8, - 'counterRotation' => array( array( 0, -1 ), array( -1, 0 ) ) - ) - ); - - - public function __construct( $options = array() ) { - foreach ( array( 'dictionaryFile', 'minWidth', 'minHeight', 'maxWidth', 'maxHeight', 'shapesToDraw' ) as $property ) { - if ( isset( $options[$property] ) ) { - $this->$property = $options[$property]; - } - } - - // find the dictionary file, to generate random names - if ( !isset( $this->dictionaryFile ) ) { - foreach ( - array( - '/usr/share/dict/words', - '/usr/dict/words', - __DIR__ . '/words.txt' - ) as $dictionaryFile - ) { - if ( is_file( $dictionaryFile ) and is_readable( $dictionaryFile ) ) { - $this->dictionaryFile = $dictionaryFile; - break; - } - } - } - if ( !isset( $this->dictionaryFile ) ) { - throw new Exception( "RandomImageGenerator: dictionary file not found or not specified properly" ); - } - } - - /** - * Writes random images with random filenames to disk in the directory you specify, or current working directory - * - * @param $number Integer: number of filenames to write - * @param $format String: optional, must be understood by ImageMagick, such as 'jpg' or 'gif' - * @param $dir String: directory, optional (will default to current working directory) - * @return Array: filenames we just wrote - */ - function writeImages( $number, $format = 'jpg', $dir = null ) { - $filenames = $this->getRandomFilenames( $number, $format, $dir ); - $imageWriteMethod = $this->getImageWriteMethod( $format ); - foreach ( $filenames as $filename ) { - $this->{$imageWriteMethod}( $this->getImageSpec(), $format, $filename ); - } - - return $filenames; - } - - - /** - * Figure out how we write images. This is a factor of both format and the local system - * @param $format (a typical extension like 'svg', 'jpg', etc.) - */ - function getImageWriteMethod( $format ) { - global $wgUseImageMagick, $wgImageMagickConvertCommand; - if ( $format === 'svg' ) { - return 'writeSvg'; - } else { - // figure out how to write images - global $wgExiv2Command; - if ( class_exists( 'Imagick' ) && $wgExiv2Command && is_executable( $wgExiv2Command ) ) { - return 'writeImageWithApi'; - } elseif ( $wgUseImageMagick && $wgImageMagickConvertCommand && is_executable( $wgImageMagickConvertCommand ) ) { - return 'writeImageWithCommandLine'; - } - } - throw new Exception( "RandomImageGenerator: could not find a suitable method to write images in '$format' format" ); - } - - /** - * Return a number of randomly-generated filenames - * Each filename uses two words randomly drawn from the dictionary, like elephantine_spatula.jpg - * - * @param $number Integer: of filenames to generate - * @param $extension String: optional, defaults to 'jpg' - * @param $dir String: optional, defaults to current working directory - * @return Array: of filenames - */ - private function getRandomFilenames( $number, $extension = 'jpg', $dir = null ) { - if ( is_null( $dir ) ) { - $dir = getcwd(); - } - $filenames = array(); - foreach ( $this->getRandomWordPairs( $number ) as $pair ) { - $basename = $pair[0] . '_' . $pair[1]; - if ( !is_null( $extension ) ) { - $basename .= '.' . $extension; - } - $basename = preg_replace( '/\s+/', '', $basename ); - $filenames[] = "$dir/$basename"; - } - - return $filenames; - } - - - /** - * Generate data representing an image of random size (within limits), - * consisting of randomly colored and sized upward pointing triangles against a random background color - * (This data is used in the writeImage* methods). - * @return {Mixed} - */ - public function getImageSpec() { - $spec = array(); - - $spec['width'] = mt_rand( $this->minWidth, $this->maxWidth ); - $spec['height'] = mt_rand( $this->minHeight, $this->maxHeight ); - $spec['fill'] = $this->getRandomColor(); - - $diagonalLength = sqrt( pow( $spec['width'], 2 ) + pow( $spec['height'], 2 ) ); - - $draws = array(); - for ( $i = 0; $i <= $this->shapesToDraw; $i++ ) { - $radius = mt_rand( 0, $diagonalLength / 4 ); - if ( $radius == 0 ) { - continue; - } - $originX = mt_rand( -1 * $radius, $spec['width'] + $radius ); - $originY = mt_rand( -1 * $radius, $spec['height'] + $radius ); - $angle = mt_rand( 0, ( 3.141592 / 2 ) * $radius ) / $radius; - $legDeltaX = round( $radius * sin( $angle ) ); - $legDeltaY = round( $radius * cos( $angle ) ); - - $draw = array(); - $draw['fill'] = $this->getRandomColor(); - $draw['shape'] = array( - array( 'x' => $originX, 'y' => $originY - $radius ), - array( 'x' => $originX + $legDeltaX, 'y' => $originY + $legDeltaY ), - array( 'x' => $originX - $legDeltaX, 'y' => $originY + $legDeltaY ), - array( 'x' => $originX, 'y' => $originY - $radius ) - ); - $draws[] = $draw; - } - - $spec['draws'] = $draws; - - return $spec; - } - - /** - * Given array( array('x' => 10, 'y' => 20), array( 'x' => 30, y=> 5 ) ) - * returns "10,20 30,5" - * Useful for SVG and imagemagick command line arguments - * @param $shape: Array of arrays, each array containing x & y keys mapped to numeric values - * @return string - */ - static function shapePointsToString( $shape ) { - $points = array(); - foreach ( $shape as $point ) { - $points[] = $point['x'] . ',' . $point['y']; - } - - return join( " ", $points ); - } - - /** - * Based on image specification, write a very simple SVG file to disk. - * Ignores the background spec because transparency is cool. :) - * @param $spec: spec describing background and shapes to draw - * @param $format: file format to write (which is obviously always svg here) - * @param $filename: filename to write to - */ - public function writeSvg( $spec, $format, $filename ) { - $svg = new SimpleXmlElement( '' ); - $svg->addAttribute( 'xmlns', 'http://www.w3.org/2000/svg' ); - $svg->addAttribute( 'version', '1.1' ); - $svg->addAttribute( 'width', $spec['width'] ); - $svg->addAttribute( 'height', $spec['height'] ); - $g = $svg->addChild( 'g' ); - foreach ( $spec['draws'] as $drawSpec ) { - $shape = $g->addChild( 'polygon' ); - $shape->addAttribute( 'fill', $drawSpec['fill'] ); - $shape->addAttribute( 'points', self::shapePointsToString( $drawSpec['shape'] ) ); - } - - if ( !$fh = fopen( $filename, 'w' ) ) { - throw new Exception( "couldn't open $filename for writing" ); - } - fwrite( $fh, $svg->asXML() ); - if ( !fclose( $fh ) ) { - throw new Exception( "couldn't close $filename" ); - } - } - - /** - * Based on an image specification, write such an image to disk, using Imagick PHP extension - * @param $spec: spec describing background and circles to draw - * @param $format: file format to write - * @param $filename: filename to write to - */ - public function writeImageWithApi( $spec, $format, $filename ) { - // this is a hack because I can't get setImageOrientation() to work. See below. - global $wgExiv2Command; - - $image = new Imagick(); - /** - * If the format is 'jpg', will also add a random orientation -- the image will be drawn rotated with triangle points - * facing in some direction (0, 90, 180 or 270 degrees) and a countering rotation should turn the triangle points upward again - */ - $orientation = self::$orientations[0]; // default is normal orientation - if ( $format == 'jpg' ) { - $orientation = self::$orientations[array_rand( self::$orientations )]; - $spec = self::rotateImageSpec( $spec, $orientation['counterRotation'] ); - } - - $image->newImage( $spec['width'], $spec['height'], new ImagickPixel( $spec['fill'] ) ); - - foreach ( $spec['draws'] as $drawSpec ) { - $draw = new ImagickDraw(); - $draw->setFillColor( $drawSpec['fill'] ); - $draw->polygon( $drawSpec['shape'] ); - $image->drawImage( $draw ); - } - - $image->setImageFormat( $format ); - - // this doesn't work, even though it's documented to do so... - // $image->setImageOrientation( $orientation['exifCode'] ); - - $image->writeImage( $filename ); - - // because the above setImageOrientation call doesn't work... nor can I get an external imagemagick binary to do this either... - // hacking this for now (only works if you have exiv2 installed, a program to read and manipulate exif) - if ( $wgExiv2Command ) { - $cmd = wfEscapeShellArg( $wgExiv2Command ) - . " -M " - . wfEscapeShellArg( "set Exif.Image.Orientation " . $orientation['exifCode'] ) - . " " - . wfEscapeShellArg( $filename ); - - $retval = 0; - $err = wfShellExec( $cmd, $retval ); - if ( $retval !== 0 ) { - print "Error with $cmd: $retval, $err\n"; - } - } - } - - /** - * Given an image specification, produce rotated version - * This is used when simulating a rotated image capture with Exif orientation - * @param $spec Object returned by getImageSpec - * @param $matrix 2x2 transformation matrix - * @return transformed Spec - */ - private static function rotateImageSpec( &$spec, $matrix ) { - $tSpec = array(); - $dims = self::matrixMultiply2x2( $matrix, $spec['width'], $spec['height'] ); - $correctionX = 0; - $correctionY = 0; - if ( $dims['x'] < 0 ) { - $correctionX = abs( $dims['x'] ); - } - if ( $dims['y'] < 0 ) { - $correctionY = abs( $dims['y'] ); - } - $tSpec['width'] = abs( $dims['x'] ); - $tSpec['height'] = abs( $dims['y'] ); - $tSpec['fill'] = $spec['fill']; - $tSpec['draws'] = array(); - foreach ( $spec['draws'] as $draw ) { - $tDraw = array( - 'fill' => $draw['fill'], - 'shape' => array() - ); - foreach ( $draw['shape'] as $point ) { - $tPoint = self::matrixMultiply2x2( $matrix, $point['x'], $point['y'] ); - $tPoint['x'] += $correctionX; - $tPoint['y'] += $correctionY; - $tDraw['shape'][] = $tPoint; - } - $tSpec['draws'][] = $tDraw; - } - - return $tSpec; - } - - /** - * Given a matrix and a pair of images, return new position - * @param $matrix: 2x2 rotation matrix - * @param $x: x-coordinate number - * @param $y: y-coordinate number - * @return Array transformed with properties x, y - */ - private static function matrixMultiply2x2( $matrix, $x, $y ) { - return array( - 'x' => $x * $matrix[0][0] + $y * $matrix[0][1], - 'y' => $x * $matrix[1][0] + $y * $matrix[1][1] - ); - } - - - /** - * Based on an image specification, write such an image to disk, using the command line ImageMagick program ('convert'). - * - * Sample command line: - * $ convert -size 100x60 xc:rgb(90,87,45) \ - * -draw 'fill rgb(12,34,56) polygon 41,39 44,57 50,57 41,39' \ - * -draw 'fill rgb(99,123,231) circle 59,39 56,57' \ - * -draw 'fill rgb(240,12,32) circle 50,21 50,3' filename.png - * - * @param $spec: spec describing background and shapes to draw - * @param $format: file format to write (unused by this method but kept so it has the same signature as writeImageWithApi) - * @param $filename: filename to write to - */ - public function writeImageWithCommandLine( $spec, $format, $filename ) { - global $wgImageMagickConvertCommand; - $args = array(); - $args[] = "-size " . wfEscapeShellArg( $spec['width'] . 'x' . $spec['height'] ); - $args[] = wfEscapeShellArg( "xc:" . $spec['fill'] ); - foreach ( $spec['draws'] as $draw ) { - $fill = $draw['fill']; - $polygon = self::shapePointsToString( $draw['shape'] ); - $drawCommand = "fill $fill polygon $polygon"; - $args[] = '-draw ' . wfEscapeShellArg( $drawCommand ); - } - $args[] = wfEscapeShellArg( $filename ); - - $command = wfEscapeShellArg( $wgImageMagickConvertCommand ) . " " . implode( " ", $args ); - $retval = null; - wfShellExec( $command, $retval ); - - return ( $retval === 0 ); - } - - /** - * Generate a string of random colors for ImageMagick or SVG, like "rgb(12, 37, 98)" - * - * @return {String} - */ - public function getRandomColor() { - $components = array(); - for ( $i = 0; $i <= 2; $i++ ) { - $components[] = mt_rand( 0, 255 ); - } - - return 'rgb(' . join( ', ', $components ) . ')'; - } - - /** - * Get an array of random pairs of random words, like array( array( 'foo', 'bar' ), array( 'quux', 'baz' ) ); - * - * @param $number Integer: number of pairs - * @return Array: of two-element arrays - */ - private function getRandomWordPairs( $number ) { - $lines = $this->getRandomLines( $number * 2 ); - // construct pairs of words - $pairs = array(); - $count = count( $lines ); - for ( $i = 0; $i < $count; $i += 2 ) { - $pairs[] = array( $lines[$i], $lines[$i + 1] ); - } - - return $pairs; - } - - /** - * Return N random lines from a file - * - * Will throw exception if the file could not be read or if it had fewer lines than requested. - * - * @param $number_desired Integer: number of lines desired - * @return Array: of exactly n elements, drawn randomly from lines the file - */ - private function getRandomLines( $number_desired ) { - $filepath = $this->dictionaryFile; - - // initialize array of lines - $lines = array(); - for ( $i = 0; $i < $number_desired; $i++ ) { - $lines[] = null; - } - - /* - * This algorithm obtains N random lines from a file in one single pass. It does this by replacing elements of - * a fixed-size array of lines, less and less frequently as it reads the file. - */ - $fh = fopen( $filepath, "r" ); - if ( !$fh ) { - throw new Exception( "couldn't open $filepath" ); - } - $line_number = 0; - $max_index = $number_desired - 1; - while ( !feof( $fh ) ) { - $line = fgets( $fh ); - if ( $line !== false ) { - $line_number++; - $line = trim( $line ); - if ( mt_rand( 0, $line_number ) <= $max_index ) { - $lines[mt_rand( 0, $max_index )] = $line; - } - } - } - fclose( $fh ); - if ( $line_number < $number_desired ) { - throw new Exception( "not enough lines in $filepath" ); - } - - return $lines; - } -} diff --git a/tests/phpunit/includes/api/format/ApiFormatPhpTest.php b/tests/phpunit/includes/api/format/ApiFormatPhpTest.php deleted file mode 100644 index a0bbb2dc..00000000 --- a/tests/phpunit/includes/api/format/ApiFormatPhpTest.php +++ /dev/null @@ -1,17 +0,0 @@ -apiRequest( 'php', array( 'action' => 'query', 'meta' => 'siteinfo' ) ); - - $this->assertInternalType( 'array', unserialize( $data ) ); - $this->assertGreaterThan( 0, count( (array)$data ) ); - } -} diff --git a/tests/phpunit/includes/api/format/ApiFormatTestBase.php b/tests/phpunit/includes/api/format/ApiFormatTestBase.php deleted file mode 100644 index 153f2cf4..00000000 --- a/tests/phpunit/includes/api/format/ApiFormatTestBase.php +++ /dev/null @@ -1,22 +0,0 @@ -createPrinterByName( $format ); - $printer->setUnescapeAmps( false ); - - $printer->initPrinter( false ); - - ob_start(); - $printer->execute(); - $out = ob_get_clean(); - - $printer->closePrinter(); - - return $out; - } -} diff --git a/tests/phpunit/includes/api/generateRandomImages.php b/tests/phpunit/includes/api/generateRandomImages.php deleted file mode 100644 index 87f5c4c0..00000000 --- a/tests/phpunit/includes/api/generateRandomImages.php +++ /dev/null @@ -1,46 +0,0 @@ -writeImages( $number, $format ); - } -} - -$maintClass = 'GenerateRandomImages'; -require RUN_MAINTENANCE_IF_MAIN; diff --git a/tests/phpunit/includes/api/query/ApiQueryBasicTest.php b/tests/phpunit/includes/api/query/ApiQueryBasicTest.php deleted file mode 100644 index 1a2aa832..00000000 --- a/tests/phpunit/includes/api/query/ApiQueryBasicTest.php +++ /dev/null @@ -1,395 +0,0 @@ -@gmail.com" - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @file - */ - -require_once 'ApiQueryTestBase.php'; - -/** These tests validate basic functionality of the api query module - * - * @group API - * @group Database - * @group medium - */ -class ApiQueryBasicTest extends ApiQueryTestBase { - /** - * Create a set of pages. These must not change, otherwise the tests might give wrong results. - * @see MediaWikiTestCase::addDBData() - */ - function addDBData() { - try { - if ( Title::newFromText( 'AQBT-All' )->exists() ) { - return; - } - - // Ordering is important, as it will be returned in the same order as stored in the index - $this->editPage( 'AQBT-All', '[[Category:AQBT-Cat]] [[AQBT-Links]] {{AQBT-T}}' ); - $this->editPage( 'AQBT-Categories', '[[Category:AQBT-Cat]]' ); - $this->editPage( 'AQBT-Links', '[[AQBT-All]] [[AQBT-Categories]] [[AQBT-Templates]]' ); - $this->editPage( 'AQBT-Templates', '{{AQBT-T}}' ); - $this->editPage( 'AQBT-T', 'Content', '', NS_TEMPLATE ); - - // Refresh due to the bug with listing transclusions as links if they don't exist - $this->editPage( 'AQBT-All', '[[Category:AQBT-Cat]] [[AQBT-Links]] {{AQBT-T}}' ); - $this->editPage( 'AQBT-Templates', '{{AQBT-T}}' ); - } catch ( Exception $e ) { - $this->exceptionFromAddDBData = $e; - } - } - - private static $links = array( - array( 'prop' => 'links', 'titles' => 'AQBT-All' ), - array( 'pages' => array( - '1' => array( - 'pageid' => 1, - 'ns' => 0, - 'title' => 'AQBT-All', - 'links' => array( - array( 'ns' => 0, 'title' => 'AQBT-Links' ), - ) - ) - ) ) - ); - - private static $templates = array( - array( 'prop' => 'templates', 'titles' => 'AQBT-All' ), - array( 'pages' => array( - '1' => array( - 'pageid' => 1, - 'ns' => 0, - 'title' => 'AQBT-All', - 'templates' => array( - array( 'ns' => 10, 'title' => 'Template:AQBT-T' ), - ) - ) - ) ) - ); - - private static $categories = array( - array( 'prop' => 'categories', 'titles' => 'AQBT-All' ), - array( 'pages' => array( - '1' => array( - 'pageid' => 1, - 'ns' => 0, - 'title' => 'AQBT-All', - 'categories' => array( - array( 'ns' => 14, 'title' => 'Category:AQBT-Cat' ), - ) - ) - ) ) - ); - - private static $allpages = array( - array( 'list' => 'allpages', 'apprefix' => 'AQBT-' ), - array( 'allpages' => array( - array( 'pageid' => 1, 'ns' => 0, 'title' => 'AQBT-All' ), - array( 'pageid' => 2, 'ns' => 0, 'title' => 'AQBT-Categories' ), - array( 'pageid' => 3, 'ns' => 0, 'title' => 'AQBT-Links' ), - array( 'pageid' => 4, 'ns' => 0, 'title' => 'AQBT-Templates' ), - ) ) - ); - - private static $alllinks = array( - array( 'list' => 'alllinks', 'alprefix' => 'AQBT-' ), - array( 'alllinks' => array( - array( 'ns' => 0, 'title' => 'AQBT-All' ), - array( 'ns' => 0, 'title' => 'AQBT-Categories' ), - array( 'ns' => 0, 'title' => 'AQBT-Links' ), - array( 'ns' => 0, 'title' => 'AQBT-Templates' ), - ) ) - ); - - private static $alltransclusions = array( - array( 'list' => 'alltransclusions', 'atprefix' => 'AQBT-' ), - array( 'alltransclusions' => array( - array( 'ns' => 10, 'title' => 'Template:AQBT-T' ), - array( 'ns' => 10, 'title' => 'Template:AQBT-T' ), - ) ) - ); - - private static $allcategories = array( - array( 'list' => 'allcategories', 'acprefix' => 'AQBT-' ), - array( 'allcategories' => array( - array( '*' => 'AQBT-Cat' ), - ) ) - ); - - private static $backlinks = array( - array( 'list' => 'backlinks', 'bltitle' => 'AQBT-Links' ), - array( 'backlinks' => array( - array( 'pageid' => 1, 'ns' => 0, 'title' => 'AQBT-All' ), - ) ) - ); - - private static $embeddedin = array( - array( 'list' => 'embeddedin', 'eititle' => 'Template:AQBT-T' ), - array( 'embeddedin' => array( - array( 'pageid' => 1, 'ns' => 0, 'title' => 'AQBT-All' ), - array( 'pageid' => 4, 'ns' => 0, 'title' => 'AQBT-Templates' ), - ) ) - ); - - private static $categorymembers = array( - array( 'list' => 'categorymembers', 'cmtitle' => 'Category:AQBT-Cat' ), - array( 'categorymembers' => array( - array( 'pageid' => 1, 'ns' => 0, 'title' => 'AQBT-All' ), - array( 'pageid' => 2, 'ns' => 0, 'title' => 'AQBT-Categories' ), - ) ) - ); - - private static $generatorAllpages = array( - array( 'generator' => 'allpages', 'gapprefix' => 'AQBT-' ), - array( 'pages' => array( - '1' => array( - 'pageid' => 1, - 'ns' => 0, - 'title' => 'AQBT-All' ), - '2' => array( - 'pageid' => 2, - 'ns' => 0, - 'title' => 'AQBT-Categories' ), - '3' => array( - 'pageid' => 3, - 'ns' => 0, - 'title' => 'AQBT-Links' ), - '4' => array( - 'pageid' => 4, - 'ns' => 0, - 'title' => 'AQBT-Templates' ), - ) ) - ); - - private static $generatorLinks = array( - array( 'generator' => 'links', 'titles' => 'AQBT-Links' ), - array( 'pages' => array( - '1' => array( - 'pageid' => 1, - 'ns' => 0, - 'title' => 'AQBT-All' ), - '2' => array( - 'pageid' => 2, - 'ns' => 0, - 'title' => 'AQBT-Categories' ), - '4' => array( - 'pageid' => 4, - 'ns' => 0, - 'title' => 'AQBT-Templates' ), - ) ) - ); - - private static $generatorLinksPropLinks = array( - array( 'prop' => 'links' ), - array( 'pages' => array( - '1' => array( 'links' => array( - array( 'ns' => 0, 'title' => 'AQBT-Links' ), - ) ) - ) ) - ); - - private static $generatorLinksPropTemplates = array( - array( 'prop' => 'templates' ), - array( 'pages' => array( - '1' => array( 'templates' => array( - array( 'ns' => 10, 'title' => 'Template:AQBT-T' ) ) ), - '4' => array( 'templates' => array( - array( 'ns' => 10, 'title' => 'Template:AQBT-T' ) ) ), - ) ) - ); - - /** - * Test basic props - */ - public function testProps() { - $this->check( self::$links ); - $this->check( self::$templates ); - $this->check( self::$categories ); - } - - /** - * Test basic lists - */ - public function testLists() { - $this->check( self::$allpages ); - $this->check( self::$alllinks ); - $this->check( self::$alltransclusions ); - // This test is temporarily disabled until a sqlite bug is fixed - // $this->check( self::$allcategories ); - $this->check( self::$backlinks ); - $this->check( self::$embeddedin ); - $this->check( self::$categorymembers ); - } - - /** - * Test basic lists - */ - public function testAllTogether() { - - // All props together - $this->check( $this->merge( - self::$links, - self::$templates, - self::$categories - ) ); - - // All lists together - $this->check( $this->merge( - self::$allpages, - self::$alllinks, - self::$alltransclusions, - // This test is temporarily disabled until a sqlite bug is fixed - // self::$allcategories, - self::$backlinks, - self::$embeddedin, - self::$categorymembers - ) ); - - // All props+lists together - $this->check( $this->merge( - self::$links, - self::$templates, - self::$categories, - self::$allpages, - self::$alllinks, - self::$alltransclusions, - // This test is temporarily disabled until a sqlite bug is fixed - // self::$allcategories, - self::$backlinks, - self::$embeddedin, - self::$categorymembers - ) ); - } - - /** - * Test basic lists - */ - public function testGenerator() { - // generator=allpages - $this->check( self::$generatorAllpages ); - // generator=allpages & list=allpages - $this->check( $this->merge( - self::$generatorAllpages, - self::$allpages ) ); - // generator=links - $this->check( self::$generatorLinks ); - // generator=links & prop=links - $this->check( $this->merge( - self::$generatorLinks, - self::$generatorLinksPropLinks ) ); - // generator=links & prop=templates - $this->check( $this->merge( - self::$generatorLinks, - self::$generatorLinksPropTemplates ) ); - // generator=links & prop=links|templates - $this->check( $this->merge( - self::$generatorLinks, - self::$generatorLinksPropLinks, - self::$generatorLinksPropTemplates ) ); - // generator=links & prop=links|templates & list=allpages|... - $this->check( $this->merge( - self::$generatorLinks, - self::$generatorLinksPropLinks, - self::$generatorLinksPropTemplates, - self::$allpages, - self::$alllinks, - self::$alltransclusions, - // This test is temporarily disabled until a sqlite bug is fixed - // self::$allcategories, - self::$backlinks, - self::$embeddedin, - self::$categorymembers ) ); - } - - /** - * Test bug 51821 - */ - public function testGeneratorRedirects() { - $this->editPage( 'AQBT-Target', 'test' ); - $this->editPage( 'AQBT-Redir', '#REDIRECT [[AQBT-Target]]' ); - $this->check( array( - array( 'generator' => 'backlinks', 'gbltitle' => 'AQBT-Target', 'redirects' => '1' ), - array( - 'redirects' => array( - array( - 'from' => 'AQBT-Redir', - 'to' => 'AQBT-Target', - ) - ), - 'pages' => array( - '6' => array( - 'pageid' => 6, - 'ns' => 0, - 'title' => 'AQBT-Target', - ) - ), - ) - ) ); - } - - /** - * Recursively merges the expected values in the $item into the $all - */ - private function mergeExpected( &$all, $item ) { - foreach ( $item as $k => $v ) { - if ( array_key_exists( $k, $all ) ) { - if ( is_array( $all[$k] ) ) { - $this->mergeExpected( $all[$k], $v ); - } else { - $this->assertEquals( $all[$k], $v ); - } - } else { - $all[$k] = $v; - } - } - } - - /** - * Recursively compare arrays, ignoring mismatches in numeric key and pageids. - * @param $expected array expected values - * @param $result array returned values - */ - private function assertQueryResults( $expected, $result ) { - reset( $expected ); - reset( $result ); - while ( true ) { - $e = each( $expected ); - $r = each( $result ); - // If either of the arrays is shorter, abort. If both are done, success. - $this->assertEquals( (bool)$e, (bool)$r ); - if ( !$e ) { - break; // done - } - // continue only if keys are identical or both keys are numeric - $this->assertTrue( $e['key'] === $r['key'] || ( is_numeric( $e['key'] ) && is_numeric( $r['key'] ) ) ); - // don't compare pageids - if ( $e['key'] !== 'pageid' ) { - // If values are arrays, compare recursively, otherwise compare with === - if ( is_array( $e['value'] ) && is_array( $r['value'] ) ) { - $this->assertQueryResults( $e['value'], $r['value'] ); - } else { - $this->assertEquals( $e['value'], $r['value'] ); - } - } - } - } -} diff --git a/tests/phpunit/includes/api/query/ApiQueryContinue2Test.php b/tests/phpunit/includes/api/query/ApiQueryContinue2Test.php deleted file mode 100644 index 4d5ddbae..00000000 --- a/tests/phpunit/includes/api/query/ApiQueryContinue2Test.php +++ /dev/null @@ -1,68 +0,0 @@ -@gmail.com" - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - */ - -require_once 'ApiQueryContinueTestBase.php'; - -/** - * @group API - * @group Database - * @group medium - */ -class ApiQueryContinue2Test extends ApiQueryContinueTestBase { - /** - * Create a set of pages. These must not change, otherwise the tests might give wrong results. - * @see MediaWikiTestCase::addDBData() - */ - function addDBData() { - try { - $this->editPage( 'AQCT73462-A', '**AQCT73462-A** [[AQCT73462-B]] [[AQCT73462-C]]' ); - $this->editPage( 'AQCT73462-B', '[[AQCT73462-A]] **AQCT73462-B** [[AQCT73462-C]]' ); - $this->editPage( 'AQCT73462-C', '[[AQCT73462-A]] [[AQCT73462-B]] **AQCT73462-C**' ); - $this->editPage( 'AQCT73462-A', '**AQCT73462-A** [[AQCT73462-B]] [[AQCT73462-C]]' ); - $this->editPage( 'AQCT73462-B', '[[AQCT73462-A]] **AQCT73462-B** [[AQCT73462-C]]' ); - $this->editPage( 'AQCT73462-C', '[[AQCT73462-A]] [[AQCT73462-B]] **AQCT73462-C**' ); - } catch ( Exception $e ) { - $this->exceptionFromAddDBData = $e; - } - } - - /** - * @medium - */ - public function testA() { - $this->mVerbose = false; - $mk = function ( $g, $p, $gDir ) { - return array( - 'generator' => 'allpages', - 'gapprefix' => 'AQCT73462-', - 'prop' => 'links', - 'gaplimit' => "$g", - 'pllimit' => "$p", - 'gapdir' => $gDir ? "ascending" : "descending", - ); - }; - // generator + 1 prop + 1 list - $data = $this->query( $mk( 99, 99, true ), 1, 'g1p', false ); - $this->checkC( $data, $mk( 1, 1, true ), 6, 'g1p-11t' ); - $this->checkC( $data, $mk( 2, 2, true ), 3, 'g1p-22t' ); - $this->checkC( $data, $mk( 1, 1, false ), 6, 'g1p-11f' ); - $this->checkC( $data, $mk( 2, 2, false ), 3, 'g1p-22f' ); - } -} diff --git a/tests/phpunit/includes/api/query/ApiQueryContinueTest.php b/tests/phpunit/includes/api/query/ApiQueryContinueTest.php deleted file mode 100644 index f494e9ca..00000000 --- a/tests/phpunit/includes/api/query/ApiQueryContinueTest.php +++ /dev/null @@ -1,313 +0,0 @@ -@gmail.com" - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - */ - -require_once 'ApiQueryContinueTestBase.php'; - -/** - * These tests validate the new continue functionality of the api query module by - * doing multiple requests with varying parameters, merging the results, and checking - * that the result matches the full data received in one no-limits call. - * - * @group API - * @group Database - * @group medium - */ -class ApiQueryContinueTest extends ApiQueryContinueTestBase { - /** - * Create a set of pages. These must not change, otherwise the tests might give wrong results. - * @see MediaWikiTestCase::addDBData() - */ - function addDBData() { - try { - $this->editPage( 'Template:AQCT-T1', '**Template:AQCT-T1**' ); - $this->editPage( 'Template:AQCT-T2', '**Template:AQCT-T2**' ); - $this->editPage( 'Template:AQCT-T3', '**Template:AQCT-T3**' ); - $this->editPage( 'Template:AQCT-T4', '**Template:AQCT-T4**' ); - $this->editPage( 'Template:AQCT-T5', '**Template:AQCT-T5**' ); - - $this->editPage( 'AQCT-1', '**AQCT-1** {{AQCT-T2}} {{AQCT-T3}} {{AQCT-T4}} {{AQCT-T5}}' ); - $this->editPage( 'AQCT-2', '[[AQCT-1]] **AQCT-2** {{AQCT-T3}} {{AQCT-T4}} {{AQCT-T5}}' ); - $this->editPage( 'AQCT-3', '[[AQCT-1]] [[AQCT-2]] **AQCT-3** {{AQCT-T4}} {{AQCT-T5}}' ); - $this->editPage( 'AQCT-4', '[[AQCT-1]] [[AQCT-2]] [[AQCT-3]] **AQCT-4** {{AQCT-T5}}' ); - $this->editPage( 'AQCT-5', '[[AQCT-1]] [[AQCT-2]] [[AQCT-3]] [[AQCT-4]] **AQCT-5**' ); - } catch ( Exception $e ) { - $this->exceptionFromAddDBData = $e; - } - } - - /** - * Test smart continue - list=allpages - * @medium - */ - public function test1List() { - $this->mVerbose = false; - $mk = function ( $l ) { - return array( - 'list' => 'allpages', - 'apprefix' => 'AQCT-', - 'aplimit' => "$l", - ); - }; - $data = $this->query( $mk( 99 ), 1, '1L', false ); - - // 1 list - $this->checkC( $data, $mk( 1 ), 5, '1L-1' ); - $this->checkC( $data, $mk( 2 ), 3, '1L-2' ); - $this->checkC( $data, $mk( 3 ), 2, '1L-3' ); - $this->checkC( $data, $mk( 4 ), 2, '1L-4' ); - $this->checkC( $data, $mk( 5 ), 1, '1L-5' ); - } - - /** - * Test smart continue - list=allpages|alltransclusions - * @medium - */ - public function test2Lists() { - $this->mVerbose = false; - $mk = function ( $l1, $l2 ) { - return array( - 'list' => 'allpages|alltransclusions', - 'apprefix' => 'AQCT-', - 'atprefix' => 'AQCT-', - 'atunique' => '', - 'aplimit' => "$l1", - 'atlimit' => "$l2", - ); - }; - // 2 lists - $data = $this->query( $mk( 99, 99 ), 1, '2L', false ); - $this->checkC( $data, $mk( 1, 1 ), 5, '2L-11' ); - $this->checkC( $data, $mk( 2, 2 ), 3, '2L-22' ); - $this->checkC( $data, $mk( 3, 3 ), 2, '2L-33' ); - $this->checkC( $data, $mk( 4, 4 ), 2, '2L-44' ); - $this->checkC( $data, $mk( 5, 5 ), 1, '2L-55' ); - } - - /** - * Test smart continue - generator=allpages, prop=links - * @medium - */ - public function testGen1Prop() { - $this->mVerbose = false; - $mk = function ( $g, $p ) { - return array( - 'generator' => 'allpages', - 'gapprefix' => 'AQCT-', - 'gaplimit' => "$g", - 'prop' => 'links', - 'pllimit' => "$p", - ); - }; - // generator + 1 prop - $data = $this->query( $mk( 99, 99 ), 1, 'G1P', false ); - $this->checkC( $data, $mk( 1, 1 ), 11, 'G1P-11' ); - $this->checkC( $data, $mk( 2, 2 ), 6, 'G1P-22' ); - $this->checkC( $data, $mk( 3, 3 ), 4, 'G1P-33' ); - $this->checkC( $data, $mk( 4, 4 ), 3, 'G1P-44' ); - $this->checkC( $data, $mk( 5, 5 ), 2, 'G1P-55' ); - } - - /** - * Test smart continue - generator=allpages, prop=links|templates - * @medium - */ - public function testGen2Prop() { - $this->mVerbose = false; - $mk = function ( $g, $p1, $p2 ) { - return array( - 'generator' => 'allpages', - 'gapprefix' => 'AQCT-', - 'gaplimit' => "$g", - 'prop' => 'links|templates', - 'pllimit' => "$p1", - 'tllimit' => "$p2", - ); - }; - // generator + 2 props - $data = $this->query( $mk( 99, 99, 99 ), 1, 'G2P', false ); - $this->checkC( $data, $mk( 1, 1, 1 ), 16, 'G2P-111' ); - $this->checkC( $data, $mk( 2, 2, 2 ), 9, 'G2P-222' ); - $this->checkC( $data, $mk( 3, 3, 3 ), 6, 'G2P-333' ); - $this->checkC( $data, $mk( 4, 4, 4 ), 4, 'G2P-444' ); - $this->checkC( $data, $mk( 5, 5, 5 ), 2, 'G2P-555' ); - $this->checkC( $data, $mk( 5, 1, 1 ), 10, 'G2P-511' ); - $this->checkC( $data, $mk( 4, 2, 2 ), 7, 'G2P-422' ); - $this->checkC( $data, $mk( 2, 3, 3 ), 7, 'G2P-233' ); - $this->checkC( $data, $mk( 2, 4, 4 ), 5, 'G2P-244' ); - $this->checkC( $data, $mk( 1, 5, 5 ), 5, 'G2P-155' ); - } - - /** - * Test smart continue - generator=allpages, prop=links, list=alltransclusions - * @medium - */ - public function testGen1Prop1List() { - $this->mVerbose = false; - $mk = function ( $g, $p, $l ) { - return array( - 'generator' => 'allpages', - 'gapprefix' => 'AQCT-', - 'gaplimit' => "$g", - 'prop' => 'links', - 'pllimit' => "$p", - 'list' => 'alltransclusions', - 'atprefix' => 'AQCT-', - 'atunique' => '', - 'atlimit' => "$l", - ); - }; - // generator + 1 prop + 1 list - $data = $this->query( $mk( 99, 99, 99 ), 1, 'G1P1L', false ); - $this->checkC( $data, $mk( 1, 1, 1 ), 11, 'G1P1L-111' ); - $this->checkC( $data, $mk( 2, 2, 2 ), 6, 'G1P1L-222' ); - $this->checkC( $data, $mk( 3, 3, 3 ), 4, 'G1P1L-333' ); - $this->checkC( $data, $mk( 4, 4, 4 ), 3, 'G1P1L-444' ); - $this->checkC( $data, $mk( 5, 5, 5 ), 2, 'G1P1L-555' ); - $this->checkC( $data, $mk( 5, 5, 1 ), 4, 'G1P1L-551' ); - $this->checkC( $data, $mk( 5, 5, 2 ), 2, 'G1P1L-552' ); - } - - /** - * Test smart continue - generator=allpages, prop=links|templates, - * list=alllinks|alltransclusions, meta=siteinfo - * @medium - */ - public function testGen2Prop2List1Meta() { - $this->mVerbose = false; - $mk = function ( $g, $p1, $p2, $l1, $l2 ) { - return array( - 'generator' => 'allpages', - 'gapprefix' => 'AQCT-', - 'gaplimit' => "$g", - 'prop' => 'links|templates', - 'pllimit' => "$p1", - 'tllimit' => "$p2", - 'list' => 'alllinks|alltransclusions', - 'alprefix' => 'AQCT-', - 'alunique' => '', - 'allimit' => "$l1", - 'atprefix' => 'AQCT-', - 'atunique' => '', - 'atlimit' => "$l2", - 'meta' => 'siteinfo', - 'siprop' => 'namespaces', - ); - }; - // generator + 1 prop + 1 list - $data = $this->query( $mk( 99, 99, 99, 99, 99 ), 1, 'G2P2L1M', false ); - $this->checkC( $data, $mk( 1, 1, 1, 1, 1 ), 16, 'G2P2L1M-11111' ); - $this->checkC( $data, $mk( 2, 2, 2, 2, 2 ), 9, 'G2P2L1M-22222' ); - $this->checkC( $data, $mk( 3, 3, 3, 3, 3 ), 6, 'G2P2L1M-33333' ); - $this->checkC( $data, $mk( 4, 4, 4, 4, 4 ), 4, 'G2P2L1M-44444' ); - $this->checkC( $data, $mk( 5, 5, 5, 5, 5 ), 2, 'G2P2L1M-55555' ); - $this->checkC( $data, $mk( 5, 5, 5, 1, 1 ), 4, 'G2P2L1M-55511' ); - $this->checkC( $data, $mk( 5, 5, 5, 2, 2 ), 2, 'G2P2L1M-55522' ); - $this->checkC( $data, $mk( 5, 1, 1, 5, 5 ), 10, 'G2P2L1M-51155' ); - $this->checkC( $data, $mk( 5, 2, 2, 5, 5 ), 5, 'G2P2L1M-52255' ); - } - - /** - * Test smart continue - generator=templates, prop=templates - * @medium - */ - public function testSameGenAndProp() { - $this->mVerbose = false; - $mk = function ( $g, $gDir, $p, $pDir ) { - return array( - 'titles' => 'AQCT-1', - 'generator' => 'templates', - 'gtllimit' => "$g", - 'gtldir' => $gDir ? 'ascending' : 'descending', - 'prop' => 'templates', - 'tllimit' => "$p", - 'tldir' => $pDir ? 'ascending' : 'descending', - ); - }; - // generator + 1 prop - $data = $this->query( $mk( 99, true, 99, true ), 1, 'G=P', false ); - - $this->checkC( $data, $mk( 1, true, 1, true ), 4, 'G=P-1t1t' ); - $this->checkC( $data, $mk( 2, true, 2, true ), 2, 'G=P-2t2t' ); - $this->checkC( $data, $mk( 3, true, 3, true ), 2, 'G=P-3t3t' ); - $this->checkC( $data, $mk( 1, true, 3, true ), 4, 'G=P-1t3t' ); - $this->checkC( $data, $mk( 3, true, 1, true ), 2, 'G=P-3t1t' ); - - $this->checkC( $data, $mk( 1, true, 1, false ), 4, 'G=P-1t1f' ); - $this->checkC( $data, $mk( 2, true, 2, false ), 2, 'G=P-2t2f' ); - $this->checkC( $data, $mk( 3, true, 3, false ), 2, 'G=P-3t3f' ); - $this->checkC( $data, $mk( 1, true, 3, false ), 4, 'G=P-1t3f' ); - $this->checkC( $data, $mk( 3, true, 1, false ), 2, 'G=P-3t1f' ); - - $this->checkC( $data, $mk( 1, false, 1, true ), 4, 'G=P-1f1t' ); - $this->checkC( $data, $mk( 2, false, 2, true ), 2, 'G=P-2f2t' ); - $this->checkC( $data, $mk( 3, false, 3, true ), 2, 'G=P-3f3t' ); - $this->checkC( $data, $mk( 1, false, 3, true ), 4, 'G=P-1f3t' ); - $this->checkC( $data, $mk( 3, false, 1, true ), 2, 'G=P-3f1t' ); - - $this->checkC( $data, $mk( 1, false, 1, false ), 4, 'G=P-1f1f' ); - $this->checkC( $data, $mk( 2, false, 2, false ), 2, 'G=P-2f2f' ); - $this->checkC( $data, $mk( 3, false, 3, false ), 2, 'G=P-3f3f' ); - $this->checkC( $data, $mk( 1, false, 3, false ), 4, 'G=P-1f3f' ); - $this->checkC( $data, $mk( 3, false, 1, false ), 2, 'G=P-3f1f' ); - } - - /** - * Test smart continue - generator=allpages, list=allpages - * @medium - */ - public function testSameGenList() { - $this->mVerbose = false; - $mk = function ( $g, $gDir, $l, $pDir ) { - return array( - 'generator' => 'allpages', - 'gapprefix' => 'AQCT-', - 'gaplimit' => "$g", - 'gapdir' => $gDir ? 'ascending' : 'descending', - 'list' => 'allpages', - 'apprefix' => 'AQCT-', - 'aplimit' => "$l", - 'apdir' => $pDir ? 'ascending' : 'descending', - ); - }; - // generator + 1 list - $data = $this->query( $mk( 99, true, 99, true ), 1, 'G=L', false ); - - $this->checkC( $data, $mk( 1, true, 1, true ), 5, 'G=L-1t1t' ); - $this->checkC( $data, $mk( 2, true, 2, true ), 3, 'G=L-2t2t' ); - $this->checkC( $data, $mk( 3, true, 3, true ), 2, 'G=L-3t3t' ); - $this->checkC( $data, $mk( 1, true, 3, true ), 5, 'G=L-1t3t' ); - $this->checkC( $data, $mk( 3, true, 1, true ), 5, 'G=L-3t1t' ); - $this->checkC( $data, $mk( 1, true, 1, false ), 5, 'G=L-1t1f' ); - $this->checkC( $data, $mk( 2, true, 2, false ), 3, 'G=L-2t2f' ); - $this->checkC( $data, $mk( 3, true, 3, false ), 2, 'G=L-3t3f' ); - $this->checkC( $data, $mk( 1, true, 3, false ), 5, 'G=L-1t3f' ); - $this->checkC( $data, $mk( 3, true, 1, false ), 5, 'G=L-3t1f' ); - $this->checkC( $data, $mk( 1, false, 1, true ), 5, 'G=L-1f1t' ); - $this->checkC( $data, $mk( 2, false, 2, true ), 3, 'G=L-2f2t' ); - $this->checkC( $data, $mk( 3, false, 3, true ), 2, 'G=L-3f3t' ); - $this->checkC( $data, $mk( 1, false, 3, true ), 5, 'G=L-1f3t' ); - $this->checkC( $data, $mk( 3, false, 1, true ), 5, 'G=L-3f1t' ); - $this->checkC( $data, $mk( 1, false, 1, false ), 5, 'G=L-1f1f' ); - $this->checkC( $data, $mk( 2, false, 2, false ), 3, 'G=L-2f2f' ); - $this->checkC( $data, $mk( 3, false, 3, false ), 2, 'G=L-3f3f' ); - $this->checkC( $data, $mk( 1, false, 3, false ), 5, 'G=L-1f3f' ); - $this->checkC( $data, $mk( 3, false, 1, false ), 5, 'G=L-3f1f' ); - } -} diff --git a/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php b/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php deleted file mode 100644 index fbb1e640..00000000 --- a/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php +++ /dev/null @@ -1,209 +0,0 @@ -@gmail.com" - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @file - */ - -require_once 'ApiQueryTestBase.php'; - -abstract class ApiQueryContinueTestBase extends ApiQueryTestBase { - - /** - * Enable to print in-depth debugging info during the test run - */ - protected $mVerbose = false; - - /** - * Run query() and compare against expected values - */ - protected function checkC( $expected, $params, $expectedCount, $id, $continue = true ) { - $result = $this->query( $params, $expectedCount, $id, $continue ); - $this->assertResult( $expected, $result, $id ); - } - - /** - * Run query in a loop until no more values are available - * @param array $params api parameters - * @param int $expectedCount max number of iterations - * @param string $id unit test id - * @param boolean $useContinue true to use smart continue - * @return mixed: merged results data array - * @throws Exception - */ - protected function query( $params, $expectedCount, $id, $useContinue = true ) { - if ( isset( $params['action'] ) ) { - $this->assertEquals( 'query', $params['action'], 'Invalid query action' ); - } else { - $params['action'] = 'query'; - } - if ( $useContinue && !isset( $params['continue'] ) ) { - $params['continue'] = ''; - } - $count = 0; - $result = array(); - $continue = array(); - do { - $request = array_merge( $params, $continue ); - uksort( $request, function ( $a, $b ) { - // put 'continue' params at the end - lazy method - $a = strpos( $a, 'continue' ) !== false ? 'zzz ' . $a : $a; - $b = strpos( $b, 'continue' ) !== false ? 'zzz ' . $b : $b; - - return strcmp( $a, $b ); - } ); - $reqStr = http_build_query( $request ); - //$reqStr = str_replace( '&', ' & ', $reqStr ); - $this->assertLessThan( $expectedCount, $count, "$id more data: $reqStr" ); - if ( $this->mVerbose ) { - print "$id (#$count): $reqStr\n"; - } - try { - $data = $this->doApiRequest( $request ); - } catch ( Exception $e ) { - throw new Exception( "$id on $count", 0, $e ); - } - $data = $data[0]; - if ( isset( $data['warnings'] ) ) { - $warnings = json_encode( $data['warnings'] ); - $this->fail( "$id Warnings on #$count in $reqStr\n$warnings" ); - } - $this->assertArrayHasKey( 'query', $data, "$id no 'query' on #$count in $reqStr" ); - if ( isset( $data['continue'] ) ) { - $continue = $data['continue']; - unset( $data['continue'] ); - } else { - $continue = array(); - } - if ( $this->mVerbose ) { - $this->printResult( $data ); - } - $this->mergeResult( $result, $data ); - $count++; - if ( empty( $continue ) ) { - // $this->assertEquals( $expectedCount, $count, "$id finished early" ); - if ( $expectedCount > $count ) { - print "***** $id Finished early in $count turns. $expectedCount was expected\n"; - } - - return $result; - } elseif ( !$useContinue ) { - $this->assertFalse( 'Non-smart query must be requested all at once' ); - } - } while ( true ); - } - - private function printResult( $data ) { - $q = $data['query']; - $print = array(); - if ( isset( $q['pages'] ) ) { - foreach ( $q['pages'] as $p ) { - $m = $p['title']; - if ( isset( $p['links'] ) ) { - $m .= '/[' . implode( ',', array_map( - function ( $v ) { - return $v['title']; - }, - $p['links'] ) ) . ']'; - } - if ( isset( $p['categories'] ) ) { - $m .= '/(' . implode( ',', array_map( - function ( $v ) { - return str_replace( 'Category:', '', $v['title'] ); - }, - $p['categories'] ) ) . ')'; - } - $print[] = $m; - } - } - if ( isset( $q['allcategories'] ) ) { - $print[] = '*Cats/(' . implode( ',', array_map( - function ( $v ) { - return $v['*']; - }, - $q['allcategories'] ) ) . ')'; - } - self::GetItems( $q, 'allpages', 'Pages', $print ); - self::GetItems( $q, 'alllinks', 'Links', $print ); - self::GetItems( $q, 'alltransclusions', 'Trnscl', $print ); - print ' ' . implode( ' ', $print ) . "\n"; - } - - private static function GetItems( $q, $moduleName, $name, &$print ) { - if ( isset( $q[$moduleName] ) ) { - $print[] = "*$name/[" . implode( ',', - array_map( function ( $v ) { - return $v['title']; - }, - $q[$moduleName] ) ) . ']'; - } - } - - /** - * Recursively merge the new result returned from the query to the previous results. - * @param mixed $results - * @param mixed $newResult - * @param bool $numericIds If true, treat keys as ids to be merged instead of appending - */ - protected function mergeResult( &$results, $newResult, $numericIds = false ) { - $this->assertEquals( is_array( $results ), is_array( $newResult ), 'Type of result and data do not match' ); - if ( !is_array( $results ) ) { - $this->assertEquals( $results, $newResult, 'Repeated result must be the same as before' ); - } else { - $sort = null; - foreach ( $newResult as $key => $value ) { - if ( !$numericIds && $sort === null ) { - if ( !is_array( $value ) ) { - $sort = false; - } elseif ( array_key_exists( 'title', $value ) ) { - $sort = function ( $a, $b ) { - return strcmp( $a['title'], $b['title'] ); - }; - } else { - $sort = false; - } - } - $keyExists = array_key_exists( $key, $results ); - if ( is_numeric( $key ) ) { - if ( $numericIds ) { - if ( !$keyExists ) { - $results[$key] = $value; - } else { - $this->mergeResult( $results[$key], $value ); - } - } else { - $results[] = $value; - } - } elseif ( !$keyExists ) { - $results[$key] = $value; - } else { - $this->mergeResult( $results[$key], $value, $key === 'pages' ); - } - } - if ( $numericIds ) { - ksort( $results, SORT_NUMERIC ); - } elseif ( $sort !== null && $sort !== false ) { - uasort( $results, $sort ); - } - } - } -} diff --git a/tests/phpunit/includes/api/query/ApiQueryRevisionsTest.php b/tests/phpunit/includes/api/query/ApiQueryRevisionsTest.php deleted file mode 100644 index 1bca2256..00000000 --- a/tests/phpunit/includes/api/query/ApiQueryRevisionsTest.php +++ /dev/null @@ -1,39 +0,0 @@ -doEdit( 'Some text', 'inserting content' ); - - $apiResult = $this->doApiRequest( array( - 'action' => 'query', - 'prop' => 'revisions', - 'titles' => $pageName, - 'rvprop' => 'content', - ) ); - $this->assertArrayHasKey( 'query', $apiResult[0] ); - $this->assertArrayHasKey( 'pages', $apiResult[0]['query'] ); - foreach ( $apiResult[0]['query']['pages'] as $page ) { - $this->assertArrayHasKey( 'revisions', $page ); - foreach ( $page['revisions'] as $revision ) { - $this->assertArrayHasKey( 'contentformat', $revision, - 'contentformat should be included when asking content so client knows how to interpret it' - ); - $this->assertArrayHasKey( 'contentmodel', $revision, - 'contentmodel should be included when asking content so client knows how to interpret it' - ); - } - } - } -} diff --git a/tests/phpunit/includes/api/query/ApiQueryTest.php b/tests/phpunit/includes/api/query/ApiQueryTest.php deleted file mode 100644 index f5645555..00000000 --- a/tests/phpunit/includes/api/query/ApiQueryTest.php +++ /dev/null @@ -1,66 +0,0 @@ -doLogin(); - } - - public function testTitlesGetNormalized() { - - global $wgMetaNamespace; - - $data = $this->doApiRequest( array( - 'action' => 'query', - 'titles' => 'Project:articleA|article_B' ) ); - - $this->assertArrayHasKey( 'query', $data[0] ); - $this->assertArrayHasKey( 'normalized', $data[0]['query'] ); - - // Forge a normalized title - $to = Title::newFromText( $wgMetaNamespace . ':ArticleA' ); - - $this->assertEquals( - array( - 'from' => 'Project:articleA', - 'to' => $to->getPrefixedText(), - ), - $data[0]['query']['normalized'][0] - ); - - $this->assertEquals( - array( - 'from' => 'article_B', - 'to' => 'Article B' - ), - $data[0]['query']['normalized'][1] - ); - } - - public function testTitlesAreRejectedIfInvalid() { - $title = false; - while ( !$title || Title::newFromText( $title )->exists() ) { - $title = md5( mt_rand( 0, 10000 ) + rand( 0, 999000 ) ); - } - - $data = $this->doApiRequest( array( - 'action' => 'query', - 'titles' => $title . '|Talk:' ) ); - - $this->assertArrayHasKey( 'query', $data[0] ); - $this->assertArrayHasKey( 'pages', $data[0]['query'] ); - $this->assertEquals( 2, count( $data[0]['query']['pages'] ) ); - - $this->assertArrayHasKey( -2, $data[0]['query']['pages'] ); - $this->assertArrayHasKey( -1, $data[0]['query']['pages'] ); - - $this->assertArrayHasKey( 'missing', $data[0]['query']['pages'][-2] ); - $this->assertArrayHasKey( 'invalid', $data[0]['query']['pages'][-1] ); - } -} diff --git a/tests/phpunit/includes/api/query/ApiQueryTestBase.php b/tests/phpunit/includes/api/query/ApiQueryTestBase.php deleted file mode 100644 index 8ee8ea96..00000000 --- a/tests/phpunit/includes/api/query/ApiQueryTestBase.php +++ /dev/null @@ -1,150 +0,0 @@ -@gmail.com" - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @file - */ - -/** This class has some common functionality for testing query module - */ -abstract class ApiQueryTestBase extends ApiTestCase { - - const PARAM_ASSERT = <<validateRequestExpectedPair( $v ); - $request = array_merge_recursive( $request, $req ); - $this->mergeExpected( $expected, $exp ); - } - - return array( $request, $expected ); - } - - /** - * Check that the parameter is a valid two element array, - * with the first element being API request and the second - expected result - */ - private function validateRequestExpectedPair( $v ) { - $this->assertType( 'array', $v, self::PARAM_ASSERT ); - $this->assertEquals( 2, count( $v ), self::PARAM_ASSERT ); - $this->assertArrayHasKey( 0, $v, self::PARAM_ASSERT ); - $this->assertArrayHasKey( 1, $v, self::PARAM_ASSERT ); - $this->assertType( 'array', $v[0], self::PARAM_ASSERT ); - $this->assertType( 'array', $v[1], self::PARAM_ASSERT ); - - return $v; - } - - /** - * Recursively merges the expected values in the $item into the $all - */ - private function mergeExpected( &$all, $item ) { - foreach ( $item as $k => $v ) { - if ( array_key_exists( $k, $all ) ) { - if ( is_array( $all[$k] ) ) { - $this->mergeExpected( $all[$k], $v ); - } else { - $this->assertEquals( $all[$k], $v ); - } - } else { - $all[$k] = $v; - } - } - } - - /** - * Checks that the request's result matches the expected results. - * @param $values array is a two element array( request, expected_results ) - * @throws Exception - */ - protected function check( $values ) { - list( $req, $exp ) = $this->validateRequestExpectedPair( $values ); - if ( !array_key_exists( 'action', $req ) ) { - $req['action'] = 'query'; - } - foreach ( $req as &$val ) { - if ( is_array( $val ) ) { - $val = implode( '|', array_unique( $val ) ); - } - } - $result = $this->doApiRequest( $req ); - $this->assertResult( array( 'query' => $exp ), $result[0], $req ); - } - - protected function assertResult( $exp, $result, $message = '' ) { - try { - $this->assertResultRecursive( $exp, $result ); - } catch ( Exception $e ) { - if ( is_array( $message ) ) { - $message = http_build_query( $message ); - } - print "\nRequest: $message\n"; - print "\nExpected:\n"; - print_r( $exp ); - print "\nResult:\n"; - print_r( $result ); - throw $e; // rethrow it - } - } - - /** - * Recursively compare arrays, ignoring mismatches in numeric key and pageids. - * @param $expected array expected values - * @param $result array returned values - */ - private function assertResultRecursive( $expected, $result ) { - reset( $expected ); - reset( $result ); - while ( true ) { - $e = each( $expected ); - $r = each( $result ); - // If either of the arrays is shorter, abort. If both are done, success. - $this->assertEquals( (bool)$e, (bool)$r ); - if ( !$e ) { - break; // done - } - // continue only if keys are identical or both keys are numeric - $this->assertTrue( $e['key'] === $r['key'] || ( is_numeric( $e['key'] ) && is_numeric( $r['key'] ) ) ); - // don't compare pageids - if ( $e['key'] !== 'pageid' ) { - // If values are arrays, compare recursively, otherwise compare with === - if ( is_array( $e['value'] ) && is_array( $r['value'] ) ) { - $this->assertResultRecursive( $e['value'], $r['value'] ); - } else { - $this->assertEquals( $e['value'], $r['value'] ); - } - } - } - } -} diff --git a/tests/phpunit/includes/api/words.txt b/tests/phpunit/includes/api/words.txt deleted file mode 100644 index 7ce23ee3..00000000 --- a/tests/phpunit/includes/api/words.txt +++ /dev/null @@ -1,1000 +0,0 @@ -Andaquian -Anoplanthus -Araquaju -Astrophyton -Avarish -Batonga -Bdellidae -Betoyan -Bismarck -Britishness -Carmen -Chatillon -Clement -Coryphaena -Croton -Cyrillianism -Dagomba -Decimus -Dichorisandra -Duculinae -Empusa -Escallonia -Fathometer -Fon -Fundulinae -Gadswoons -Gederathite -Gemini -Gerbera -Gregarinida -Gyracanthus -Halopsychidae -Hasidim -Hemerobius -Ichthyosauridae -Iscariot -Jeames -Jesuitry -Jovian -Judaization -Katie -Ladin -Langhian -Lapithaean -Lisette -Macrochira -Malaxis -Malvastrum -Maranhao -Marxian -Maurist -Metrosideros -Micky -Microsporon -Odacidae -Ophiuchid -Osmorhiza -Paguma -Palesman -Papayaceae -Pastinaca -Philoxenian -Pleurostigma -Rarotongan -Rhodoraceae -Rong -Saho -Sanyakoan -Sardanapalian -Sauropoda -Sedentaria -Shambu -Shukulumbwe -Solonian -Spaniardization -Spirochaetaceae -Stomatopoda -Stratiotes -Taiwanhemp -Titanically -Venetianed -Victrola -Yuman -abatis -abaton -abjoint -acanthoma -acari -acceptance -actinography -acuteness -addiment -adelite -adelomorphic -adelphogamy -adipocele -aelurophobia -affined -aflaunt -agathokakological -aischrolatreia -alarmedly -alebench -aleurone -allelotropic -allerion -alloplastic -allowable -alternacy -alternariose -altricial -ambitionist -amendment -amiableness -amicableness -ammo -amortizable -anchorate -anemometrically -angelocracy -angelological -anodal -anomalure -antedate -antiagglutinin -antirationalist -antiscorbutic -antisplasher -antithesize -antiunionist -antoecian -apolegamic -appropriation -archididascalian -archival -arteriophlebotomy -articulable -asseveration -assignation -atelo -atrienses -atrophy -atterminement -atypic -automower -aveloz -awrist -azteca -bairnteam -balsamweed -bannerman -beardy -becry -beek -beggarwise -bescab -bestness -bethel -bewildering -bibliophilism -bitterblain -blakeberyed -boccarella -bocedization -boobyalla -bourbon -bowbent -bowerbird -brachygnathous -brail -branchiferous -brelaw -brew -brideweed -bridgeable -brombenzamide -buddler -burbankian -burr -buskin -cacochymical -calefactory -caliper -canaliculus -candidature -canellaceous -canniness -canning -cantilene -carbonatation -carthamic -caseum -caudated -causationist -ceruleite -chalder -chalta -charmel -chekan -chillness -chirogymnast -chirpling -chlorinous -cholanthrene -chondroblast -chromatography -chromophilous -chronical -cicatrice -cinchonine -city -clubbing -coastal -coaxially -coercible -coeternity -coff -coinventor -collyba -combinator -complanation -comprehensibility -conchuela -congenital -context -contranatural -corallum -cordately -cornupete -corolliferous -coroneted -corticosterone -coseat -cottage -crocetin -crossleted -crottels -curvedness -cycadeous -cyclism -cylindrically -cynanche -cyrtoceratitic -cystospasm -danceress -dancette -dawny -daydreamy -debar -decarburization -decorousness -decrepitness -delirious -deozonizer -dermatosis -desma -deutencephalic -diacetate -diarthrodial -diathermy -dicolic -dimastigate -dimidiation -dipetto -disavowable -disintrench -disman -dismay -disorder -disoxygenation -dithionous -dogman -dragonfly -dramatical -drawspan -drubbly -drunk -duskly -ecderonic -ectocuniform -ectocyst -ehrwaldite -electrocute -elemicin -embracing -emotionality -enactment -enamor -enclave -endameba -endochylous -endocrinologist -endolymph -endothecal -entasia -epigeous -episcopicide -epitrichial -erminee -erraticalness -eruptivity -erythrocytoschisis -esperance -estuous -eucrystalline -eugeny -evacuant -everbloomer -evocation -exarchateship -exasperate -excorticate -excrementary -exile -expandedly -exponency -expressionist -expulsion -extemporary -extollation -extortive -extrabulbar -extraprostatic -facticide -fairer -fakery -fasibitikite -fatiscent -fearless -febrifuge -ferie -fibrousness -fingered -fisheye -flagpole -flagrantness -fleche -fluidism -folliculin -footbreadth -forceps -forecontrive -forthbring -foveated -fuchsin -fungicidal -funori -gamelang -gametically -garvanzo -gasoliner -gastrophile -germproof -gerontism -gigantical -glaciology -godmotherhood -gooseherd -gordunite -gove -gracilis -greathead -grieveship -guidable -gyromancy -gyrostat -habitus -hailweed -handhole -hangalai -haznadar -heliced -hemihypertrophy -hemimorphic -hemistrumectomy -heptavalent -heptite -herbalist -herpetology -hesperid -hexacarbon -hieromnemon -hobbyless -holodactylic -homoeoarchy -hopperings -hospitable -houseboat -huh -huntedly -hydroponics -hydrosomal -hyperdactylia -hyperperistalsis -hypogeocarpous -ideogram -idiopathical -illegitimate -imambarah -impotently -improvise -impuberal -inaccurately -incarnant -inchoation -incliner -incredulous -indiscriminateness -indulgenced -inebriation -inexpressiveness -infibulate -inflectedness -iniome -ink -inquietly -insaturable -insinuative -instiller -institutive -insultproof -interactionist -intercensal -interpenetrable -intertranspicuous -intrinsicality -inwards -iridiocyte -iridoparalysis -irreportable -isoprene -isosmotic -izard -jacuaru -jaculative -jerkined -joe -joyous -julienne -justicehood -kali -kalidium -katha -kathal -keelage -keratomycosis -khaki -khedival -kinkily -knife -kolo -kraken -kwarta -labba -labber -laboress -lacunar -latch -lauric -lawter -lectotype -leeches -legible -lepidosteoid -leucobasalt -leverer -libellate -limnimeter -lithography -lithotypic -locomotor -logarithmetically -logistician -lyncine -lysogenesis -machan -macromyelon -maharana -mandibulate -manganapatite -marchpane -mas -masochistic -mastaba -matching -meditatively -megalopolitan -melaniline -mentum -mercaptides -mestome -metasomatism -meterless -micronuclear -micropetalous -microreaction -microsporophore -mileway -milliarium -millisecond -misbind -miscollocation -misreader -modernicide -modification -modulant -monkfish -monoamino -monocarbide -monographical -morphinomaniac -mullein -munge -mutilate -mycophagist -myelosarcoma -myospasm -myriadly -nagaika -naphthionate -natant -naviculaeform -nayward -neallotype -necrophilia -nectared -neigher -neogamous -neurodynia -neurorthopteran -nidation -nieceship -nitrobacteria -nitrosification -nogheaded -nonassertive -noneuphonious -nonextant -nonincrease -nonintermittent -nonmetallic -nonprehensile -nonremunerative -nonsocial -nonvesting -noontime -noreaster -nounal -nub -nucleoplasm -nullisome -numero -numerous -oblongatal -observe -obtusilingual -obvert -occipitoatlantal -oceanside -ochlophobist -odontiasis -opalescence -opticon -oraculousness -orarium -organically -orthopedically -ostosis -overadvance -overbuilt -overdiscouragement -overdoer -overhardy -overjocular -overmagnify -overofficered -overpotent -overprizer -overrunner -overshrink -oversimply -oversplash -ovology -oxskin -oxychloride -oxygenant -ozokerite -pactional -palaeoanthropography -palaeographical -palaeopsychology -palliasse -palpebral -pandaric -pantelegraph -papicolist -papulate -parakinetic -parasitism -parochialic -parochialize -passionlike -patch -paucidentate -pawnbrokeress -pecite -pecky -pedipulation -pellitory -perfilograph -periblast -perigemmal -periost -periplus -perishable -periwig -permansive -persistingly -persymmetrical -phantom -phasmatrope -philocaly -philogyny -philosophister -philotherianism -phorology -phototrophic -phrator -phratral -phthisipneumony -physogastry -phytologic -phytoptid -pianograph -picqueter -piculet -pigeoner -pimaric -pinesap -pist -planometer -platano -playful -plea -pleuropneumonic -plowwoman -plump -pluviographical -pneumocele -podophthalmate -polyad -polythalamian -poppyhead -portamento -portmanteau -portraitlike -possible -potassamide -powderer -praepubis -preanesthetic -prebarbaric -predealer -predomination -prefactory -preirrigational -prelector -presbytership -presecure -preservable -prespecialist -preventionism -prewound -princely -priorship -proannexationist -proanthropos -probeable -probouleutic -profitless -proplasma -prosectorial -protecting -protochemistry -protosulphate -pseudoataxia -psilology -psychoneurotic -pterygial -publicist -purgation -purplishness -putatively -pyracene -pyrenomycete -pyromancy -pyrophone -quadroon -quailhead -qualifier -quaternal -rabblelike -rambunctious -rapidness -ratably -rationalism -razor -reannoy -recultivation -regulable -reimplant -reimposition -reimprison -reinjure -reinspiration -reintroduce -remantle -reprehensibility -reptant -require -resteal -restful -returnability -revisableness -rewash -rewhirl -reyield -rhizotomy -rhodamine -rigwiddie -rimester -ripper -rippet -rockish -rockwards -rollicky -roosters -rooted -rosal -rozum -saccharated -sagamore -sagy -salesmanship -salivous -sallet -salta -saprostomous -satiation -sauropsid -sawarra -sawback -scabish -scabrate -scampavia -scientificophilosophical -scirrosity -scoliometer -scolopendrelloid -secantly -seignioral -semibull -semic -seminarianism -semiped -semiprivate -semispherical -semispontaneous -seneschal -septendecimal -serotherapist -servation -sesquisulphuret -severish -sextipartite -sextubercular -shipyard -shuckpen -siderosis -silex -sillyhow -silverbelly -silverbelly -simulacrum -sisham -sixte -skeiner -skiapod -slopped -slubby -smalts -sockmaker -solute -somethingness -somnify -southwester -spathilla -spectrochemical -sphagnology -spinales -spiriting -spirling -spirochetemia -spreadboard -spurflower -squawdom -squeezing -staircase -staker -stamphead -statolith -stekan -stellulate -stinker -stomodaea -streamingly -strikingness -strouthocamelian -stuprum -subacutely -subboreal -subcontractor -subendorsement -subprofitable -subserviate -subsneer -subungual -sucuruju -sugan -sulphocarbolate -summerwood -superficialist -superinference -superregenerative -supplicate -suspendible -synchronizer -syntectic -tachyglossate -tailless -taintment -takingly -taletelling -tarpon -tasteful -taxeater -taxy -teache -teachless -teg -tegmen -teletyper -temperable -ten -tenent -teskere -testes -thallogen -thapsia -thewness -thickety -thiobacteria -thorniness -throwing -thyroprivic -tinnitus -tocalote -tolerationist -tonalamatl -torvous -totality -tottering -toug -tracheopathia -tragedical -translucent -trifoveolate -trilaurin -trophoplasmatic -trunkless -turbanless -turnpiker -twangle -twitterboned -ultraornate -umbilication -unabatingly -unabjured -unadequateness -unaffectedness -unarriving -unassorted -unattacked -unbenumbed -unboasted -unburning -uncensorious -uncongested -uncontemnedly -uncontemporary -uncrook -uncrystallizability -uncurb -uncustomariness -underbillow -undercanopy -underestimation -underhanging -underpetticoated -underpropped -undersole -understocking -underworld -undevout -undisappointing -undistinctive -unfiscal -unfluted -unfreckled -ungentilize -unglobe -unhelped -unhomogeneously -unifoliate -uninflammable -uninterrogated -unisonal -unkindled -unlikeableness -unlisty -unlocked -unmoving -unmultipliable -unnestled -unnoticed -unobservable -unobviated -unoffensively -unofficerlike -unpoetic -unpractically -unquestionableness -unrehearsed -unrevised -unrhetorical -unsadden -unsaluting -unscriptural -unseeking -unshowed -unsolicitous -unsprouted -unsubjective -unsubsidized -unsymbolic -untenant -unterrified -untranquil -untraversed -untrusty -untying -unwillful -unwinding -upspring -uptwist -urachovesical -uropygial -vagabondism -varicoid -varletess -vasal -ventrocaudal -verisimilitude -vermigerous -vibrometer -viminal -virus -vocationalism -voguey -vulnerability -waggle -wamblingly -warmus -waxer -waying -wedgeable -wellmaker -whomever -wigged -witchlike -wokas -woodrowel -woodsman -woolding -xanthelasmic -xiphosternum -yachtman -yachtsmanlike -yelp -zoophytal \ No newline at end of file diff --git a/tests/phpunit/includes/cache/GenderCacheTest.php b/tests/phpunit/includes/cache/GenderCacheTest.php deleted file mode 100644 index ce2db5d7..00000000 --- a/tests/phpunit/includes/cache/GenderCacheTest.php +++ /dev/null @@ -1,104 +0,0 @@ -getID() == 0 ) { - $user->addToDatabase(); - $user->setPassword( 'UTMalePassword' ); - } - //ensure the right gender - $user->setOption( 'gender', 'male' ); - $user->saveSettings(); - - $user = User::newFromName( 'UTFemale' ); - if ( $user->getID() == 0 ) { - $user->addToDatabase(); - $user->setPassword( 'UTFemalePassword' ); - } - //ensure the right gender - $user->setOption( 'gender', 'female' ); - $user->saveSettings(); - - $user = User::newFromName( 'UTDefaultGender' ); - if ( $user->getID() == 0 ) { - $user->addToDatabase(); - $user->setPassword( 'UTDefaultGenderPassword' ); - } - //ensure the default gender - $user->setOption( 'gender', null ); - $user->saveSettings(); - } - - /** - * test usernames - * - * @dataProvider provideUserGenders - * @covers GenderCache::getGenderOf - */ - public function testUserName( $username, $expectedGender ) { - $genderCache = GenderCache::singleton(); - $gender = $genderCache->getGenderOf( $username ); - $this->assertEquals( $gender, $expectedGender, "GenderCache normal" ); - } - - /** - * genderCache should work with user objects, too - * - * @dataProvider provideUserGenders - * @covers GenderCache::getGenderOf - */ - public function testUserObjects( $username, $expectedGender ) { - $genderCache = GenderCache::singleton(); - $user = User::newFromName( $username ); - $gender = $genderCache->getGenderOf( $user ); - $this->assertEquals( $gender, $expectedGender, "GenderCache normal" ); - } - - public static function provideUserGenders() { - return array( - array( 'UTMale', 'male' ), - array( 'UTFemale', 'female' ), - array( 'UTDefaultGender', 'unknown' ), - array( 'UTNotExist', 'unknown' ), - //some not valid user - array( '127.0.0.1', 'unknown' ), - array( 'user@test', 'unknown' ), - ); - } - - /** - * test strip of subpages to avoid unnecessary queries - * against the never existing username - * - * @dataProvider provideStripSubpages - * @covers GenderCache::getGenderOf - */ - public function testStripSubpages( $pageWithSubpage, $expectedGender ) { - $genderCache = GenderCache::singleton(); - $gender = $genderCache->getGenderOf( $pageWithSubpage ); - $this->assertEquals( $gender, $expectedGender, "GenderCache must strip of subpages" ); - } - - public static function provideStripSubpages() { - return array( - array( 'UTMale/subpage', 'male' ), - array( 'UTFemale/subpage', 'female' ), - array( 'UTDefaultGender/subpage', 'unknown' ), - array( 'UTNotExist/subpage', 'unknown' ), - array( '127.0.0.1/subpage', 'unknown' ), - ); - } -} diff --git a/tests/phpunit/includes/cache/MessageCacheTest.php b/tests/phpunit/includes/cache/MessageCacheTest.php deleted file mode 100644 index 803acf73..00000000 --- a/tests/phpunit/includes/cache/MessageCacheTest.php +++ /dev/null @@ -1,128 +0,0 @@ -configureLanguages(); - MessageCache::singleton()->enable(); - } - - /** - * Helper function -- setup site language for testing - */ - protected function configureLanguages() { - // for the test, we need the content language to be anything but English, - // let's choose e.g. German (de) - $langCode = 'de'; - $langObj = Language::factory( $langCode ); - - $this->setMwGlobals( array( - 'wgLanguageCode' => $langCode, - 'wgLang' => $langObj, - 'wgContLang' => $langObj, - ) ); - } - - function addDBData() { - $this->configureLanguages(); - - // Set up messages and fallbacks ab -> ru -> de - $this->makePage( 'FallbackLanguageTest-Full', 'ab' ); - $this->makePage( 'FallbackLanguageTest-Full', 'ru' ); - $this->makePage( 'FallbackLanguageTest-Full', 'de' ); - - // Fallbacks where ab does not exist - $this->makePage( 'FallbackLanguageTest-Partial', 'ru' ); - $this->makePage( 'FallbackLanguageTest-Partial', 'de' ); - - // Fallback to the content language - $this->makePage( 'FallbackLanguageTest-ContLang', 'de' ); - - // Add customizations for an existing message. - $this->makePage( 'sunday', 'ru' ); - - // Full key tests -- always want russian - $this->makePage( 'MessageCacheTest-FullKeyTest', 'ab' ); - $this->makePage( 'MessageCacheTest-FullKeyTest', 'ru' ); - - // In content language -- get base if no derivative - $this->makePage( 'FallbackLanguageTest-NoDervContLang', 'de', 'de/none', false ); - } - - /** - * Helper function for addDBData -- adds a simple page to the database - * - * @param string $title Title of page to be created - * @param string $lang Language and content of the created page - * @param string|null $content Content of the created page, or null for a generic string - * @param bool $createSubPage Set to false if a root page should be created - */ - protected function makePage( $title, $lang, $content = null, $createSubPage = true ) { - global $wgContLang; - - if ( $content === null ) { - $content = $lang; - } - if ( $lang !== $wgContLang->getCode() || $createSubPage ) { - $title = "$title/$lang"; - } - - $title = Title::newFromText( $title, NS_MEDIAWIKI ); - $wikiPage = new WikiPage( $title ); - $contentHandler = ContentHandler::makeContent( $content, $title ); - $wikiPage->doEditContent( $contentHandler, "$lang translation test case" ); - } - - /** - * Test message fallbacks, bug #1495 - * - * @dataProvider provideMessagesForFallback - */ - public function testMessageFallbacks( $message, $lang, $expectedContent ) { - $result = MessageCache::singleton()->get( $message, true, $lang ); - $this->assertEquals( $expectedContent, $result, "Message fallback failed." ); - } - - function provideMessagesForFallback() { - return array( - array( 'FallbackLanguageTest-Full', 'ab', 'ab' ), - array( 'FallbackLanguageTest-Partial', 'ab', 'ru' ), - array( 'FallbackLanguageTest-ContLang', 'ab', 'de' ), - array( 'FallbackLanguageTest-None', 'ab', false ), - - // Existing message with customizations on the fallbacks - array( 'sunday', 'ab', 'амҽыш' ), - - // bug 46579 - array( 'FallbackLanguageTest-NoDervContLang', 'de', 'de/none' ), - // UI language different from content language should only use de/none as last option - array( 'FallbackLanguageTest-NoDervContLang', 'fit', 'de/none' ), - ); - } - - /** - * There's a fallback case where the message key is given as fully qualified -- this - * should ignore the passed $lang and use the language from the key - * - * @dataProvider provideMessagesForFullKeys - */ - public function testFullKeyBehaviour( $message, $lang, $expectedContent ) { - $result = MessageCache::singleton()->get( $message, true, $lang, true ); - $this->assertEquals( $expectedContent, $result, "Full key message fallback failed." ); - } - - function provideMessagesForFullKeys() { - return array( - array( 'MessageCacheTest-FullKeyTest/ru', 'ru', 'ru' ), - array( 'MessageCacheTest-FullKeyTest/ru', 'ab', 'ru' ), - array( 'MessageCacheTest-FullKeyTest/ru/foo', 'ru', false ), - ); - } - -} diff --git a/tests/phpunit/includes/cache/ProcessCacheLRUTest.php b/tests/phpunit/includes/cache/ProcessCacheLRUTest.php deleted file mode 100644 index d3793d83..00000000 --- a/tests/phpunit/includes/cache/ProcessCacheLRUTest.php +++ /dev/null @@ -1,237 +0,0 @@ -assertAttributeEquals( array(), 'cache', $cache, $msg ); - } - - /** - * Helper to fill a cache object passed by reference - */ - function fillCache( &$cache, $numEntries ) { - // Fill cache with three values - for ( $i = 1; $i <= $numEntries; $i++ ) { - $cache->set( "cache-key-$i", "prop-$i", "value-$i" ); - } - } - - /** - * Generates an array of what would be expected in cache for a given cache - * size and a number of entries filled in sequentially - */ - function getExpectedCache( $cacheMaxEntries, $entryToFill ) { - $expected = array(); - - if ( $entryToFill === 0 ) { - # The cache is empty! - return array(); - } elseif ( $entryToFill <= $cacheMaxEntries ) { - # Cache is not fully filled - $firstKey = 1; - } else { - # Cache overflowed - $firstKey = 1 + $entryToFill - $cacheMaxEntries; - } - - $lastKey = $entryToFill; - - for ( $i = $firstKey; $i <= $lastKey; $i++ ) { - $expected["cache-key-$i"] = array( "prop-$i" => "value-$i" ); - } - - return $expected; - } - - /** - * Highlight diff between assertEquals and assertNotSame - */ - public function testPhpUnitArrayEquality() { - $one = array( 'A' => 1, 'B' => 2 ); - $two = array( 'B' => 2, 'A' => 1 ); - $this->assertEquals( $one, $two ); // == - $this->assertNotSame( $one, $two ); // === - } - - /** - * @dataProvider provideInvalidConstructorArg - * @expectedException MWException - */ - public function testConstructorGivenInvalidValue( $maxSize ) { - new ProcessCacheLRUTestable( $maxSize ); - } - - /** - * Value which are forbidden by the constructor - */ - public static function provideInvalidConstructorArg() { - return array( - array( null ), - array( array() ), - array( new stdClass() ), - array( 0 ), - array( '5' ), - array( -1 ), - ); - } - - public function testAddAndGetAKey() { - $oneCache = new ProcessCacheLRUTestable( 1 ); - $this->assertCacheEmpty( $oneCache ); - - // First set just one value - $oneCache->set( 'cache-key', 'prop1', 'value1' ); - $this->assertEquals( 1, $oneCache->getEntriesCount() ); - $this->assertTrue( $oneCache->has( 'cache-key', 'prop1' ) ); - $this->assertEquals( 'value1', $oneCache->get( 'cache-key', 'prop1' ) ); - } - - public function testDeleteOldKey() { - $oneCache = new ProcessCacheLRUTestable( 1 ); - $this->assertCacheEmpty( $oneCache ); - - $oneCache->set( 'cache-key', 'prop1', 'value1' ); - $oneCache->set( 'cache-key', 'prop1', 'value2' ); - $this->assertEquals( 'value2', $oneCache->get( 'cache-key', 'prop1' ) ); - } - - /** - * This test that we properly overflow when filling a cache with - * a sequence of always different cache-keys. Meant to verify we correclty - * delete the older key. - * - * @dataProvider provideCacheFilling - * @param $cacheMaxEntries Maximum entry the created cache will hold - * @param $entryToFill Number of entries to insert in the created cache. - */ - public function testFillingCache( $cacheMaxEntries, $entryToFill, $msg = '' ) { - $cache = new ProcessCacheLRUTestable( $cacheMaxEntries ); - $this->fillCache( $cache, $entryToFill ); - - $this->assertSame( - $this->getExpectedCache( $cacheMaxEntries, $entryToFill ), - $cache->getCache(), - "Filling a $cacheMaxEntries entries cache with $entryToFill entries" - ); - } - - /** - * Provider for testFillingCache - */ - public static function provideCacheFilling() { - // ($cacheMaxEntries, $entryToFill, $msg='') - return array( - array( 1, 0 ), - array( 1, 1 ), - array( 1, 2 ), # overflow - array( 5, 33 ), # overflow - ); - } - - /** - * Create a cache with only one remaining entry then update - * the first inserted entry. Should bump it to the top. - */ - public function testReplaceExistingKeyShouldBumpEntryToTop() { - $maxEntries = 3; - - $cache = new ProcessCacheLRUTestable( $maxEntries ); - // Fill cache leaving just one remaining slot - $this->fillCache( $cache, $maxEntries - 1 ); - - // Set an existing cache key - $cache->set( "cache-key-1", "prop-1", "new-value-for-1" ); - - $this->assertSame( - array( - 'cache-key-2' => array( 'prop-2' => 'value-2' ), - 'cache-key-1' => array( 'prop-1' => 'new-value-for-1' ), - ), - $cache->getCache() - ); - } - - public function testRecentlyAccessedKeyStickIn() { - $cache = new ProcessCacheLRUTestable( 2 ); - $cache->set( 'first', 'prop1', 'value1' ); - $cache->set( 'second', 'prop2', 'value2' ); - - // Get first - $cache->get( 'first', 'prop1' ); - // Cache a third value, should invalidate the least used one - $cache->set( 'third', 'prop3', 'value3' ); - - $this->assertFalse( $cache->has( 'second', 'prop2' ) ); - } - - /** - * This first create a full cache then update the value for the 2nd - * filled entry. - * Given a cache having 1,2,3 as key, updating 2 should bump 2 to - * the top of the queue with the new value: 1,3,2* (* = updated). - */ - public function testReplaceExistingKeyInAFullCacheShouldBumpToTop() { - $maxEntries = 3; - - $cache = new ProcessCacheLRUTestable( $maxEntries ); - $this->fillCache( $cache, $maxEntries ); - - // Set an existing cache key - $cache->set( "cache-key-2", "prop-2", "new-value-for-2" ); - $this->assertSame( - array( - 'cache-key-1' => array( 'prop-1' => 'value-1' ), - 'cache-key-3' => array( 'prop-3' => 'value-3' ), - 'cache-key-2' => array( 'prop-2' => 'new-value-for-2' ), - ), - $cache->getCache() - ); - $this->assertEquals( 'new-value-for-2', - $cache->get( 'cache-key-2', 'prop-2' ) - ); - } - - public function testBumpExistingKeyToTop() { - $cache = new ProcessCacheLRUTestable( 3 ); - $this->fillCache( $cache, 3 ); - - // Set the very first cache key to a new value - $cache->set( "cache-key-1", "prop-1", "new value for 1" ); - $this->assertEquals( - array( - 'cache-key-2' => array( 'prop-2' => 'value-2' ), - 'cache-key-3' => array( 'prop-3' => 'value-3' ), - 'cache-key-1' => array( 'prop-1' => 'new value for 1' ), - ), - $cache->getCache() - ); - } -} - -/** - * Overrides some ProcessCacheLRU methods and properties accessibility. - */ -class ProcessCacheLRUTestable extends ProcessCacheLRU { - public $cache = array(); - - public function getCache() { - return $this->cache; - } - - public function getEntriesCount() { - return count( $this->cache ); - } -} diff --git a/tests/phpunit/includes/content/ContentHandlerTest.php b/tests/phpunit/includes/content/ContentHandlerTest.php deleted file mode 100644 index aedf594d..00000000 --- a/tests/phpunit/includes/content/ContentHandlerTest.php +++ /dev/null @@ -1,451 +0,0 @@ -setMwGlobals( array( - 'wgExtraNamespaces' => array( - 12312 => 'Dummy', - 12313 => 'Dummy_talk', - ), - // The below tests assume that namespaces not mentioned here (Help, User, MediaWiki, ..) - // default to CONTENT_MODEL_WIKITEXT. - 'wgNamespaceContentModels' => array( - 12312 => 'testing', - ), - 'wgContentHandlers' => array( - CONTENT_MODEL_WIKITEXT => 'WikitextContentHandler', - CONTENT_MODEL_JAVASCRIPT => 'JavaScriptContentHandler', - CONTENT_MODEL_CSS => 'CssContentHandler', - CONTENT_MODEL_TEXT => 'TextContentHandler', - 'testing' => 'DummyContentHandlerForTesting', - ), - ) ); - - // Reset namespace cache - MWNamespace::getCanonicalNamespaces( true ); - $wgContLang->resetNamespaces(); - } - - public function tearDown() { - global $wgContLang; - - // Reset namespace cache - MWNamespace::getCanonicalNamespaces( true ); - $wgContLang->resetNamespaces(); - - parent::tearDown(); - } - - public static function dataGetDefaultModelFor() { - return array( - array( 'Help:Foo', CONTENT_MODEL_WIKITEXT ), - array( 'Help:Foo.js', CONTENT_MODEL_WIKITEXT ), - array( 'Help:Foo/bar.js', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo.js', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo/bar.js', CONTENT_MODEL_JAVASCRIPT ), - array( 'User:Foo/bar.css', CONTENT_MODEL_CSS ), - array( 'User talk:Foo/bar.css', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo/bar.js.xxx', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo/bar.xxx', CONTENT_MODEL_WIKITEXT ), - array( 'MediaWiki:Foo.js', CONTENT_MODEL_JAVASCRIPT ), - array( 'MediaWiki:Foo.css', CONTENT_MODEL_CSS ), - array( 'MediaWiki:Foo.JS', CONTENT_MODEL_WIKITEXT ), - array( 'MediaWiki:Foo.CSS', CONTENT_MODEL_WIKITEXT ), - array( 'MediaWiki:Foo.css.xxx', CONTENT_MODEL_WIKITEXT ), - ); - } - - /** - * @dataProvider dataGetDefaultModelFor - * @covers ContentHandler::getDefaultModelFor - */ - public function testGetDefaultModelFor( $title, $expectedModelId ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedModelId, ContentHandler::getDefaultModelFor( $title ) ); - } - - /** - * @dataProvider dataGetDefaultModelFor - * @covers ContentHandler::getForTitle - */ - public function testGetForTitle( $title, $expectedContentModel ) { - $title = Title::newFromText( $title ); - $handler = ContentHandler::getForTitle( $title ); - $this->assertEquals( $expectedContentModel, $handler->getModelID() ); - } - - public static function dataGetLocalizedName() { - return array( - array( null, null ), - array( "xyzzy", null ), - - // XXX: depends on content language - array( CONTENT_MODEL_JAVASCRIPT, '/javascript/i' ), - ); - } - - /** - * @dataProvider dataGetLocalizedName - * @covers ContentHandler::getLocalizedName - */ - public function testGetLocalizedName( $id, $expected ) { - $name = ContentHandler::getLocalizedName( $id ); - - if ( $expected ) { - $this->assertNotNull( $name, "no name found for content model $id" ); - $this->assertTrue( preg_match( $expected, $name ) > 0, - "content model name for #$id did not match pattern $expected" - ); - } else { - $this->assertEquals( $id, $name, "localization of unknown model $id should have " - . "fallen back to use the model id directly." - ); - } - } - - public static function dataGetPageLanguage() { - global $wgLanguageCode; - - return array( - array( "Main", $wgLanguageCode ), - array( "Dummy:Foo", $wgLanguageCode ), - array( "MediaWiki:common.js", 'en' ), - array( "User:Foo/common.js", 'en' ), - array( "MediaWiki:common.css", 'en' ), - array( "User:Foo/common.css", 'en' ), - array( "User:Foo", $wgLanguageCode ), - - array( CONTENT_MODEL_JAVASCRIPT, 'javascript' ), - ); - } - - /** - * @dataProvider dataGetPageLanguage - * @covers ContentHandler::getPageLanguage - */ - public function testGetPageLanguage( $title, $expected ) { - if ( is_string( $title ) ) { - $title = Title::newFromText( $title ); - } - - $expected = wfGetLangObj( $expected ); - - $handler = ContentHandler::getForTitle( $title ); - $lang = $handler->getPageLanguage( $title ); - - $this->assertEquals( $expected->getCode(), $lang->getCode() ); - } - - public static function dataGetContentText_Null() { - return array( - array( 'fail' ), - array( 'serialize' ), - array( 'ignore' ), - ); - } - - /** - * @dataProvider dataGetContentText_Null - * @covers ContentHandler::getContentText - */ - public function testGetContentText_Null( $contentHandlerTextFallback ) { - $this->setMwGlobals( 'wgContentHandlerTextFallback', $contentHandlerTextFallback ); - - $content = null; - - $text = ContentHandler::getContentText( $content ); - $this->assertEquals( '', $text ); - } - - public static function dataGetContentText_TextContent() { - return array( - array( 'fail' ), - array( 'serialize' ), - array( 'ignore' ), - ); - } - - /** - * @dataProvider dataGetContentText_TextContent - * @covers ContentHandler::getContentText - */ - public function testGetContentText_TextContent( $contentHandlerTextFallback ) { - $this->setMwGlobals( 'wgContentHandlerTextFallback', $contentHandlerTextFallback ); - - $content = new WikitextContent( "hello world" ); - - $text = ContentHandler::getContentText( $content ); - $this->assertEquals( $content->getNativeData(), $text ); - } - - /** - * ContentHandler::getContentText should have thrown an exception for non-text Content object - * @expectedException MWException - * @covers ContentHandler::getContentText - */ - public function testGetContentText_NonTextContent_fail() { - $this->setMwGlobals( 'wgContentHandlerTextFallback', 'fail' ); - - $content = new DummyContentForTesting( "hello world" ); - - ContentHandler::getContentText( $content ); - } - - /** - * @covers ContentHandler::getContentText - */ - public function testGetContentText_NonTextContent_serialize() { - $this->setMwGlobals( 'wgContentHandlerTextFallback', 'serialize' ); - - $content = new DummyContentForTesting( "hello world" ); - - $text = ContentHandler::getContentText( $content ); - $this->assertEquals( $content->serialize(), $text ); - } - - /** - * @covers ContentHandler::getContentText - */ - public function testGetContentText_NonTextContent_ignore() { - $this->setMwGlobals( 'wgContentHandlerTextFallback', 'ignore' ); - - $content = new DummyContentForTesting( "hello world" ); - - $text = ContentHandler::getContentText( $content ); - $this->assertNull( $text ); - } - - /* - public static function makeContent( $text, Title $title, $modelId = null, $format = null ) {} - */ - - public static function dataMakeContent() { - return array( - array( 'hallo', 'Help:Test', null, null, CONTENT_MODEL_WIKITEXT, 'hallo', false ), - array( 'hallo', 'MediaWiki:Test.js', null, null, CONTENT_MODEL_JAVASCRIPT, 'hallo', false ), - array( serialize( 'hallo' ), 'Dummy:Test', null, null, "testing", 'hallo', false ), - - array( 'hallo', 'Help:Test', null, CONTENT_FORMAT_WIKITEXT, CONTENT_MODEL_WIKITEXT, 'hallo', false ), - array( 'hallo', 'MediaWiki:Test.js', null, CONTENT_FORMAT_JAVASCRIPT, CONTENT_MODEL_JAVASCRIPT, 'hallo', false ), - array( serialize( 'hallo' ), 'Dummy:Test', null, "testing", "testing", 'hallo', false ), - - array( 'hallo', 'Help:Test', CONTENT_MODEL_CSS, null, CONTENT_MODEL_CSS, 'hallo', false ), - array( 'hallo', 'MediaWiki:Test.js', CONTENT_MODEL_CSS, null, CONTENT_MODEL_CSS, 'hallo', false ), - array( serialize( 'hallo' ), 'Dummy:Test', CONTENT_MODEL_CSS, null, CONTENT_MODEL_CSS, serialize( 'hallo' ), false ), - - array( 'hallo', 'Help:Test', CONTENT_MODEL_WIKITEXT, "testing", null, null, true ), - array( 'hallo', 'MediaWiki:Test.js', CONTENT_MODEL_CSS, "testing", null, null, true ), - array( 'hallo', 'Dummy:Test', CONTENT_MODEL_JAVASCRIPT, "testing", null, null, true ), - ); - } - - /** - * @dataProvider dataMakeContent - * @covers ContentHandler::makeContent - */ - public function testMakeContent( $data, $title, $modelId, $format, $expectedModelId, $expectedNativeData, $shouldFail ) { - $title = Title::newFromText( $title ); - - try { - $content = ContentHandler::makeContent( $data, $title, $modelId, $format ); - - if ( $shouldFail ) { - $this->fail( "ContentHandler::makeContent should have failed!" ); - } - - $this->assertEquals( $expectedModelId, $content->getModel(), 'bad model id' ); - $this->assertEquals( $expectedNativeData, $content->getNativeData(), 'bads native data' ); - } catch ( MWException $ex ) { - if ( !$shouldFail ) { - $this->fail( "ContentHandler::makeContent failed unexpectedly: " . $ex->getMessage() ); - } else { - // dummy, so we don't get the "test did not perform any assertions" message. - $this->assertTrue( true ); - } - } - } - - /* - public function testSupportsSections() { - $this->markTestIncomplete( "not yet implemented" ); - } - */ - - /** - * @covers ContentHandler::runLegacyHooks - */ - public function testRunLegacyHooks() { - Hooks::register( 'testRunLegacyHooks', __CLASS__ . '::dummyHookHandler' ); - - $content = new WikitextContent( 'test text' ); - $ok = ContentHandler::runLegacyHooks( 'testRunLegacyHooks', array( 'foo', &$content, 'bar' ), false ); - - $this->assertTrue( $ok, "runLegacyHooks should have returned true" ); - $this->assertEquals( "TEST TEXT", $content->getNativeData() ); - } - - public static function dummyHookHandler( $foo, &$text, $bar ) { - if ( $text === null || $text === false ) { - return false; - } - - $text = strtoupper( $text ); - - return true; - } -} - -class DummyContentHandlerForTesting extends ContentHandler { - - public function __construct( $dataModel ) { - parent::__construct( $dataModel, array( "testing" ) ); - } - - /** - * Serializes Content object of the type supported by this ContentHandler. - * - * @param Content $content the Content object to serialize - * @param null $format the desired serialization format - * @return String serialized form of the content - */ - public function serializeContent( Content $content, $format = null ) { - return $content->serialize(); - } - - /** - * Unserializes a Content object of the type supported by this ContentHandler. - * - * @param $blob String serialized form of the content - * @param null $format the format used for serialization - * @return Content the Content object created by deserializing $blob - */ - public function unserializeContent( $blob, $format = null ) { - $d = unserialize( $blob ); - - return new DummyContentForTesting( $d ); - } - - /** - * Creates an empty Content object of the type supported by this ContentHandler. - * - */ - public function makeEmptyContent() { - return new DummyContentForTesting( '' ); - } -} - -class DummyContentForTesting extends AbstractContent { - - public function __construct( $data ) { - parent::__construct( "testing" ); - - $this->data = $data; - } - - public function serialize( $format = null ) { - return serialize( $this->data ); - } - - /** - * @return String a string representing the content in a way useful for building a full text search index. - * If no useful representation exists, this method returns an empty string. - */ - public function getTextForSearchIndex() { - return ''; - } - - /** - * @return String the wikitext to include when another page includes this content, or false if the content is not - * includable in a wikitext page. - */ - public function getWikitextForTransclusion() { - return false; - } - - /** - * Returns a textual representation of the content suitable for use in edit summaries and log messages. - * - * @param int $maxlength Maximum length of the summary text. - * @return string The summary text. - */ - public function getTextForSummary( $maxlength = 250 ) { - return ''; - } - - /** - * Returns native represenation of the data. Interpretation depends on the data model used, - * as given by getDataModel(). - * - * @return mixed the native representation of the content. Could be a string, a nested array - * structure, an object, a binary blob... anything, really. - */ - public function getNativeData() { - return $this->data; - } - - /** - * returns the content's nominal size in bogo-bytes. - * - * @return int - */ - public function getSize() { - return strlen( $this->data ); - } - - /** - * Return a copy of this Content object. The following must be true for the object returned - * if $copy = $original->copy() - * - * * get_class($original) === get_class($copy) - * * $original->getModel() === $copy->getModel() - * * $original->equals( $copy ) - * - * If and only if the Content object is imutable, the copy() method can and should - * return $this. That is, $copy === $original may be true, but only for imutable content - * objects. - * - * @return Content. A copy of this object. - */ - public function copy() { - return $this; - } - - /** - * Returns true if this content is countable as a "real" wiki page, provided - * that it's also in a countable location (e.g. a current revision in the main namespace). - * - * @param boolean $hasLinks if it is known whether this content contains links, provide this information here, - * to avoid redundant parsing to find out. - * @return boolean - */ - public function isCountable( $hasLinks = null ) { - return false; - } - - /** - * @param Title $title - * @param null $revId - * @param null|ParserOptions $options - * @param boolean $generateHtml whether to generate Html (default: true). If false, - * the result of calling getText() on the ParserOutput object returned by - * this method is undefined. - * - * @return ParserOutput - */ - public function getParserOutput( Title $title, $revId = null, ParserOptions $options = null, $generateHtml = true ) { - return new ParserOutput( $this->getNativeData() ); - } -} diff --git a/tests/phpunit/includes/content/CssContentTest.php b/tests/phpunit/includes/content/CssContentTest.php deleted file mode 100644 index bd6d41fe..00000000 --- a/tests/phpunit/includes/content/CssContentTest.php +++ /dev/null @@ -1,87 +0,0 @@ -setName( '127.0.0.1' ); - - $this->setMwGlobals( array( - 'wgUser' => $user, - 'wgTextModelsToParse' => array( - CONTENT_MODEL_CSS, - ) - ) ); - } - - public function newContent( $text ) { - return new CssContent( $text ); - } - - public static function dataGetParserOutput() { - return array( - array( - 'MediaWiki:Test.css', - null, - "hello \n", - "
        \nhello <world>\n\n
        " - ), - array( - 'MediaWiki:Test.css', - null, - "/* hello [[world]] */\n", - "
        \n/* hello [[world]] */\n\n
        ", - array( - 'Links' => array( - array( 'World' => 0 ) - ) - ) - ), - - // TODO: more...? - ); - } - - /** - * @covers CssContent::getModel - */ - public function testGetModel() { - $content = $this->newContent( 'hello world.' ); - - $this->assertEquals( CONTENT_MODEL_CSS, $content->getModel() ); - } - - /** - * @covers CssContent::getContentHandler - */ - public function testGetContentHandler() { - $content = $this->newContent( 'hello world.' ); - - $this->assertEquals( CONTENT_MODEL_CSS, $content->getContentHandler()->getModelID() ); - } - - public static function dataEquals() { - return array( - array( new CssContent( 'hallo' ), null, false ), - array( new CssContent( 'hallo' ), new CssContent( 'hallo' ), true ), - array( new CssContent( 'hallo' ), new WikitextContent( 'hallo' ), false ), - array( new CssContent( 'hallo' ), new CssContent( 'HALLO' ), false ), - ); - } - - /** - * @dataProvider dataEquals - * @covers CssContent::equals - */ - public function testEquals( Content $a, Content $b = null, $equal = false ) { - $this->assertEquals( $equal, $a->equals( $b ) ); - } -} diff --git a/tests/phpunit/includes/content/JavaScriptContentTest.php b/tests/phpunit/includes/content/JavaScriptContentTest.php deleted file mode 100644 index c8616ff0..00000000 --- a/tests/phpunit/includes/content/JavaScriptContentTest.php +++ /dev/null @@ -1,287 +0,0 @@ -\n", - "
        \nhello <world>\n\n
        " - ), - array( - 'MediaWiki:Test.js', - null, - "hello(); // [[world]]\n", - "
        \nhello(); // [[world]]\n\n
        ", - array( - 'Links' => array( - array( 'World' => 0 ) - ) - ) - ), - - // TODO: more...? - ); - } - - // XXX: Unused function - public static function dataGetSection() { - return array( - array( WikitextContentTest::$sections, - '0', - null - ), - array( WikitextContentTest::$sections, - '2', - null - ), - array( WikitextContentTest::$sections, - '8', - null - ), - ); - } - - // XXX: Unused function - public static function dataReplaceSection() { - return array( - array( WikitextContentTest::$sections, - '0', - 'No more', - null, - null - ), - array( WikitextContentTest::$sections, - '', - 'No more', - null, - null - ), - array( WikitextContentTest::$sections, - '2', - "== TEST ==\nmore fun", - null, - null - ), - array( WikitextContentTest::$sections, - '8', - 'No more', - null, - null - ), - array( WikitextContentTest::$sections, - 'new', - 'No more', - 'New', - null - ), - ); - } - - /** - * @covers JavaScriptContent::addSectionHeader - */ - public function testAddSectionHeader() { - $content = $this->newContent( 'hello world' ); - $c = $content->addSectionHeader( 'test' ); - - $this->assertTrue( $content->equals( $c ) ); - } - - // XXX: currently, preSaveTransform is applied to scripts. this may change or become optional. - public static function dataPreSaveTransform() { - return array( - array( 'hello this is ~~~', - "hello this is [[Special:Contributions/127.0.0.1|127.0.0.1]]", - ), - array( 'hello \'\'this\'\' is ~~~', - 'hello \'\'this\'\' is ~~~', - ), - array( " Foo \n ", - " Foo", - ), - ); - } - - public static function dataPreloadTransform() { - return array( - array( 'hello this is ~~~', - 'hello this is ~~~', - ), - array( 'hello \'\'this\'\' is foobar', - 'hello \'\'this\'\' is foobar', - ), - ); - } - - public static function dataGetRedirectTarget() { - return array( - array( '#REDIRECT [[Test]]', - null, - ), - array( '#REDIRECT Test', - null, - ), - array( '* #REDIRECT [[Test]]', - null, - ), - ); - } - - /** - * @todo Test needs database! - */ - /* - public function getRedirectChain() { - $text = $this->getNativeData(); - return Title::newFromRedirectArray( $text ); - } - */ - - /** - * @todo Test needs database! - */ - /* - public function getUltimateRedirectTarget() { - $text = $this->getNativeData(); - return Title::newFromRedirectRecurse( $text ); - } - */ - - public static function dataIsCountable() { - return array( - array( '', - null, - 'any', - true - ), - array( 'Foo', - null, - 'any', - true - ), - array( 'Foo', - null, - 'comma', - false - ), - array( 'Foo, bar', - null, - 'comma', - false - ), - array( 'Foo', - null, - 'link', - false - ), - array( 'Foo [[bar]]', - null, - 'link', - false - ), - array( 'Foo', - true, - 'link', - false - ), - array( 'Foo [[bar]]', - false, - 'link', - false - ), - array( '#REDIRECT [[bar]]', - true, - 'any', - true - ), - array( '#REDIRECT [[bar]]', - true, - 'comma', - false - ), - array( '#REDIRECT [[bar]]', - true, - 'link', - false - ), - ); - } - - public static function dataGetTextForSummary() { - return array( - array( "hello\nworld.", - 16, - 'hello world.', - ), - array( 'hello world.', - 8, - 'hello...', - ), - array( '[[hello world]].', - 8, - '[[hel...', - ), - ); - } - - /** - * @covers JavaScriptContent::matchMagicWord - */ - public function testMatchMagicWord() { - $mw = MagicWord::get( "staticredirect" ); - - $content = $this->newContent( "#REDIRECT [[FOO]]\n__STATICREDIRECT__" ); - $this->assertFalse( $content->matchMagicWord( $mw ), "should not have matched magic word, since it's not wikitext" ); - } - - /** - * @covers JavaScriptContent::updateRedirect - */ - public function testUpdateRedirect() { - $target = Title::newFromText( "testUpdateRedirect_target" ); - - $content = $this->newContent( "#REDIRECT [[Someplace]]" ); - $newContent = $content->updateRedirect( $target ); - - $this->assertTrue( $content->equals( $newContent ), "content should be unchanged since it's not wikitext" ); - } - - /** - * @covers JavaScriptContent::getModel - */ - public function testGetModel() { - $content = $this->newContent( "hello world." ); - - $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $content->getModel() ); - } - - /** - * @covers JavaScriptContent::getContentHandler - */ - public function testGetContentHandler() { - $content = $this->newContent( "hello world." ); - - $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $content->getContentHandler()->getModelID() ); - } - - public static function dataEquals() { - return array( - array( new JavaScriptContent( "hallo" ), null, false ), - array( new JavaScriptContent( "hallo" ), new JavaScriptContent( "hallo" ), true ), - array( new JavaScriptContent( "hallo" ), new CssContent( "hallo" ), false ), - array( new JavaScriptContent( "hallo" ), new JavaScriptContent( "HALLO" ), false ), - ); - } -} diff --git a/tests/phpunit/includes/content/TextContentTest.php b/tests/phpunit/includes/content/TextContentTest.php deleted file mode 100644 index a1f099f3..00000000 --- a/tests/phpunit/includes/content/TextContentTest.php +++ /dev/null @@ -1,458 +0,0 @@ -setName( '127.0.0.1' ); - - $this->setMwGlobals( array( - 'wgUser' => $user, - 'wgTextModelsToParse' => array( - CONTENT_MODEL_WIKITEXT, - CONTENT_MODEL_CSS, - CONTENT_MODEL_JAVASCRIPT, - ), - 'wgUseTidy' => false, - 'wgAlwaysUseTidy' => false, - ) ); - - $this->context = new RequestContext( new FauxRequest() ); - $this->context->setTitle( Title::newFromText( 'Test' ) ); - $this->context->setUser( $user ); - } - - public function newContent( $text ) { - return new TextContent( $text ); - } - - public static function dataGetParserOutput() { - return array( - array( - 'TextContentTest_testGetParserOutput', - CONTENT_MODEL_TEXT, - "hello ''world'' & [[stuff]]\n", "hello ''world'' & [[stuff]]", - array( - 'Links' => array() - ) - ), - // TODO: more...? - ); - } - - /** - * @dataProvider dataGetParserOutput - * @covers TextContent::getParserOutput - */ - public function testGetParserOutput( $title, $model, $text, $expectedHtml, $expectedFields = null ) { - $title = Title::newFromText( $title ); - $content = ContentHandler::makeContent( $text, $title, $model ); - - $po = $content->getParserOutput( $title ); - - $html = $po->getText(); - $html = preg_replace( '##sm', '', $html ); // strip comments - - $this->assertEquals( $expectedHtml, trim( $html ) ); - - if ( $expectedFields ) { - foreach ( $expectedFields as $field => $exp ) { - $f = 'get' . ucfirst( $field ); - $v = call_user_func( array( $po, $f ) ); - - if ( is_array( $exp ) ) { - $this->assertArrayEquals( $exp, $v ); - } else { - $this->assertEquals( $exp, $v ); - } - } - } - - // TODO: assert more properties - } - - public static function dataPreSaveTransform() { - return array( - array( - #0: no signature resolution - 'hello this is ~~~', - 'hello this is ~~~', - ), - array( - #1: rtrim - " Foo \n ", - ' Foo', - ), - ); - } - - /** - * @dataProvider dataPreSaveTransform - * @covers TextContent::preSaveTransform - */ - public function testPreSaveTransform( $text, $expected ) { - global $wgContLang; - - $options = ParserOptions::newFromUserAndLang( $this->context->getUser(), $wgContLang ); - - $content = $this->newContent( $text ); - $content = $content->preSaveTransform( $this->context->getTitle(), $this->context->getUser(), $options ); - - $this->assertEquals( $expected, $content->getNativeData() ); - } - - public static function dataPreloadTransform() { - return array( - array( - 'hello this is ~~~', - 'hello this is ~~~', - ), - ); - } - - /** - * @dataProvider dataPreloadTransform - * @covers TextContent::preloadTransform - */ - public function testPreloadTransform( $text, $expected ) { - global $wgContLang; - $options = ParserOptions::newFromUserAndLang( $this->context->getUser(), $wgContLang ); - - $content = $this->newContent( $text ); - $content = $content->preloadTransform( $this->context->getTitle(), $options ); - - $this->assertEquals( $expected, $content->getNativeData() ); - } - - public static function dataGetRedirectTarget() { - return array( - array( '#REDIRECT [[Test]]', - null, - ), - ); - } - - /** - * @dataProvider dataGetRedirectTarget - * @covers TextContent::getRedirectTarget - */ - public function testGetRedirectTarget( $text, $expected ) { - $content = $this->newContent( $text ); - $t = $content->getRedirectTarget(); - - if ( is_null( $expected ) ) { - $this->assertNull( $t, "text should not have generated a redirect target: $text" ); - } else { - $this->assertEquals( $expected, $t->getPrefixedText() ); - } - } - - /** - * @dataProvider dataGetRedirectTarget - * @covers TextContent::isRedirect - */ - public function testIsRedirect( $text, $expected ) { - $content = $this->newContent( $text ); - - $this->assertEquals( !is_null( $expected ), $content->isRedirect() ); - } - - /** - * @todo Test needs database! Should be done by a test class in the Database group. - */ - /* - public function getRedirectChain() { - $text = $this->getNativeData(); - return Title::newFromRedirectArray( $text ); - } - */ - - /** - * @todo Test needs database! Should be done by a test class in the Database group. - */ - /* - public function getUltimateRedirectTarget() { - $text = $this->getNativeData(); - return Title::newFromRedirectRecurse( $text ); - } - */ - - public static function dataIsCountable() { - return array( - array( '', - null, - 'any', - true - ), - array( 'Foo', - null, - 'any', - true - ), - array( 'Foo', - null, - 'comma', - false - ), - array( 'Foo, bar', - null, - 'comma', - false - ), - ); - } - - /** - * @dataProvider dataIsCountable - * @group Database - * @covers TextContent::isCountable - */ - public function testIsCountable( $text, $hasLinks, $mode, $expected ) { - $this->setMwGlobals( 'wgArticleCountMethod', $mode ); - - $content = $this->newContent( $text ); - - $v = $content->isCountable( $hasLinks, $this->context->getTitle() ); - - $this->assertEquals( $expected, $v, 'isCountable() returned unexpected value ' . var_export( $v, true ) - . ' instead of ' . var_export( $expected, true ) . " in mode `$mode` for text \"$text\"" ); - } - - public static function dataGetTextForSummary() { - return array( - array( "hello\nworld.", - 16, - 'hello world.', - ), - array( 'hello world.', - 8, - 'hello...', - ), - array( '[[hello world]].', - 8, - '[[hel...', - ), - ); - } - - /** - * @dataProvider dataGetTextForSummary - * @covers TextContent::getTextForSummary - */ - public function testGetTextForSummary( $text, $maxlength, $expected ) { - $content = $this->newContent( $text ); - - $this->assertEquals( $expected, $content->getTextForSummary( $maxlength ) ); - } - - /** - * @covers TextContent::getTextForSearchIndex - */ - public function testGetTextForSearchIndex() { - $content = $this->newContent( 'hello world.' ); - - $this->assertEquals( 'hello world.', $content->getTextForSearchIndex() ); - } - - /** - * @covers TextContent::copy - */ - public function testCopy() { - $content = $this->newContent( 'hello world.' ); - $copy = $content->copy(); - - $this->assertTrue( $content->equals( $copy ), 'copy must be equal to original' ); - $this->assertEquals( 'hello world.', $copy->getNativeData() ); - } - - /** - * @covers TextContent::getSize - */ - public function testGetSize() { - $content = $this->newContent( 'hello world.' ); - - $this->assertEquals( 12, $content->getSize() ); - } - - /** - * @covers TextContent::getNativeData - */ - public function testGetNativeData() { - $content = $this->newContent( 'hello world.' ); - - $this->assertEquals( 'hello world.', $content->getNativeData() ); - } - - /** - * @covers TextContent::getWikitextForTransclusion - */ - public function testGetWikitextForTransclusion() { - $content = $this->newContent( 'hello world.' ); - - $this->assertEquals( 'hello world.', $content->getWikitextForTransclusion() ); - } - - /** - * @covers TextContent::getModel - */ - public function testGetModel() { - $content = $this->newContent( "hello world." ); - - $this->assertEquals( CONTENT_MODEL_TEXT, $content->getModel() ); - } - - /** - * @covers TextContent::getContentHandler - */ - public function testGetContentHandler() { - $content = $this->newContent( "hello world." ); - - $this->assertEquals( CONTENT_MODEL_TEXT, $content->getContentHandler()->getModelID() ); - } - - public static function dataIsEmpty() { - return array( - array( '', true ), - array( ' ', false ), - array( '0', false ), - array( 'hallo welt.', false ), - ); - } - - /** - * @dataProvider dataIsEmpty - * @covers TextContent::isEmpty - */ - public function testIsEmpty( $text, $empty ) { - $content = $this->newContent( $text ); - - $this->assertEquals( $empty, $content->isEmpty() ); - } - - public static function dataEquals() { - return array( - array( new TextContent( "hallo" ), null, false ), - array( new TextContent( "hallo" ), new TextContent( "hallo" ), true ), - array( new TextContent( "hallo" ), new JavaScriptContent( "hallo" ), false ), - array( new TextContent( "hallo" ), new WikitextContent( "hallo" ), false ), - array( new TextContent( "hallo" ), new TextContent( "HALLO" ), false ), - ); - } - - /** - * @dataProvider dataEquals - * @covers TextContent::equals - */ - public function testEquals( Content $a, Content $b = null, $equal = false ) { - $this->assertEquals( $equal, $a->equals( $b ) ); - } - - public static function dataGetDeletionUpdates() { - return array( - array( "TextContentTest_testGetSecondaryDataUpdates_1", - CONTENT_MODEL_TEXT, "hello ''world''\n", - array() - ), - array( "TextContentTest_testGetSecondaryDataUpdates_2", - CONTENT_MODEL_TEXT, "hello [[world test 21344]]\n", - array() - ), - // TODO: more...? - ); - } - - /** - * @dataProvider dataGetDeletionUpdates - * @covers TextContent::getDeletionUpdates - */ - public function testDeletionUpdates( $title, $model, $text, $expectedStuff ) { - $ns = $this->getDefaultWikitextNS(); - $title = Title::newFromText( $title, $ns ); - - $content = ContentHandler::makeContent( $text, $title, $model ); - - $page = WikiPage::factory( $title ); - $page->doEditContent( $content, '' ); - - $updates = $content->getDeletionUpdates( $page ); - - // make updates accessible by class name - foreach ( $updates as $update ) { - $class = get_class( $update ); - $updates[$class] = $update; - } - - if ( !$expectedStuff ) { - $this->assertTrue( true ); // make phpunit happy - return; - } - - foreach ( $expectedStuff as $class => $fieldValues ) { - $this->assertArrayHasKey( $class, $updates, "missing an update of type $class" ); - - $update = $updates[$class]; - - foreach ( $fieldValues as $field => $value ) { - $v = $update->$field; #if the field doesn't exist, just crash and burn - $this->assertEquals( $value, $v, "unexpected value for field $field in instance of $class" ); - } - } - - $page->doDeleteArticle( '' ); - } - - public static function provideConvert() { - return array( - array( // #0 - 'Hallo Welt', - CONTENT_MODEL_WIKITEXT, - 'lossless', - 'Hallo Welt' - ), - array( // #1 - 'Hallo Welt', - CONTENT_MODEL_WIKITEXT, - 'lossless', - 'Hallo Welt' - ), - array( // #1 - 'Hallo Welt', - CONTENT_MODEL_CSS, - 'lossless', - 'Hallo Welt' - ), - array( // #1 - 'Hallo Welt', - CONTENT_MODEL_JAVASCRIPT, - 'lossless', - 'Hallo Welt' - ), - ); - } - - /** - * @dataProvider provideConvert - * @covers TextContent::convert - */ - public function testConvert( $text, $model, $lossy, $expectedNative ) { - $content = $this->newContent( $text ); - - $converted = $content->convert( $model, $lossy ); - - if ( $expectedNative === false ) { - $this->assertFalse( $converted, "conversion to $model was expected to fail!" ); - } else { - $this->assertInstanceOf( 'Content', $converted ); - $this->assertEquals( $expectedNative, $converted->getNativeData() ); - } - } -} diff --git a/tests/phpunit/includes/content/WikitextContentHandlerTest.php b/tests/phpunit/includes/content/WikitextContentHandlerTest.php deleted file mode 100644 index 75a72784..00000000 --- a/tests/phpunit/includes/content/WikitextContentHandlerTest.php +++ /dev/null @@ -1,227 +0,0 @@ -handler = ContentHandler::getForModelID( CONTENT_MODEL_WIKITEXT ); - } - - /** - * @covers WikitextContentHandler::serializeContent - */ - public function testSerializeContent() { - $content = new WikitextContent( 'hello world' ); - - $this->assertEquals( 'hello world', $this->handler->serializeContent( $content ) ); - $this->assertEquals( 'hello world', $this->handler->serializeContent( $content, CONTENT_FORMAT_WIKITEXT ) ); - - try { - $this->handler->serializeContent( $content, 'dummy/foo' ); - $this->fail( "serializeContent() should have failed on unknown format" ); - } catch ( MWException $e ) { - // ok, as expected - } - } - - /** - * @covers WikitextContentHandler::unserializeContent - */ - public function testUnserializeContent() { - $content = $this->handler->unserializeContent( 'hello world' ); - $this->assertEquals( 'hello world', $content->getNativeData() ); - - $content = $this->handler->unserializeContent( 'hello world', CONTENT_FORMAT_WIKITEXT ); - $this->assertEquals( 'hello world', $content->getNativeData() ); - - try { - $this->handler->unserializeContent( 'hello world', 'dummy/foo' ); - $this->fail( "unserializeContent() should have failed on unknown format" ); - } catch ( MWException $e ) { - // ok, as expected - } - } - - /** - * @covers WikitextContentHandler::makeEmptyContent - */ - public function testMakeEmptyContent() { - $content = $this->handler->makeEmptyContent(); - - $this->assertTrue( $content->isEmpty() ); - $this->assertEquals( '', $content->getNativeData() ); - } - - public static function dataIsSupportedFormat() { - return array( - array( null, true ), - array( CONTENT_FORMAT_WIKITEXT, true ), - array( 99887766, false ), - ); - } - - /** - * @dataProvider provideMakeRedirectContent - * @param Title|string $title Title object or string for Title::newFromText() - * @param string $expected Serialized form of the content object built - * @covers WikitextContentHandler::makeRedirectContent - */ - public function testMakeRedirectContent( $title, $expected ) { - global $wgContLang; - $wgContLang->resetNamespaces(); - - if ( is_string( $title ) ) { - $title = Title::newFromText( $title ); - } - $content = $this->handler->makeRedirectContent( $title ); - $this->assertEquals( $expected, $content->serialize() ); - } - - public static function provideMakeRedirectContent() { - return array( - array( 'Hello', '#REDIRECT [[Hello]]' ), - array( 'Template:Hello', '#REDIRECT [[Template:Hello]]' ), - array( 'Hello#section', '#REDIRECT [[Hello#section]]' ), - array( 'user:john_doe#section', '#REDIRECT [[User:John doe#section]]' ), - array( 'MEDIAWIKI:FOOBAR', '#REDIRECT [[MediaWiki:FOOBAR]]' ), - array( 'Category:Foo', '#REDIRECT [[:Category:Foo]]' ), - array( Title::makeTitle( NS_MAIN, 'en:Foo' ), '#REDIRECT [[en:Foo]]' ), - array( Title::makeTitle( NS_MAIN, 'Foo', '', 'en' ), '#REDIRECT [[:en:Foo]]' ), - array( Title::makeTitle( NS_MAIN, 'Bar', 'fragment', 'google' ), '#REDIRECT [[google:Bar#fragment]]' ), - ); - } - - /** - * @dataProvider dataIsSupportedFormat - * @covers WikitextContentHandler::isSupportedFormat - */ - public function testIsSupportedFormat( $format, $supported ) { - $this->assertEquals( $supported, $this->handler->isSupportedFormat( $format ) ); - } - - public static function dataMerge3() { - return array( - array( - "first paragraph - - second paragraph\n", - - "FIRST paragraph - - second paragraph\n", - - "first paragraph - - SECOND paragraph\n", - - "FIRST paragraph - - SECOND paragraph\n", - ), - - array( "first paragraph - second paragraph\n", - - "Bla bla\n", - - "Blubberdibla\n", - - false, - ), - ); - } - - /** - * @dataProvider dataMerge3 - * @covers WikitextContentHandler::merge3 - */ - public function testMerge3( $old, $mine, $yours, $expected ) { - $this->checkHasDiff3(); - - // test merge - $oldContent = new WikitextContent( $old ); - $myContent = new WikitextContent( $mine ); - $yourContent = new WikitextContent( $yours ); - - $merged = $this->handler->merge3( $oldContent, $myContent, $yourContent ); - - $this->assertEquals( $expected, $merged ? $merged->getNativeData() : $merged ); - } - - public static function dataGetAutosummary() { - return array( - array( - 'Hello there, world!', - '#REDIRECT [[Foo]]', - 0, - '/^Redirected page .*Foo/' - ), - - array( - null, - 'Hello world!', - EDIT_NEW, - '/^Created page .*Hello/' - ), - - array( - 'Hello there, world!', - '', - 0, - '/^Blanked/' - ), - - array( - 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut - labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et - ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.', - 'Hello world!', - 0, - '/^Replaced .*Hello/' - ), - - array( - 'foo', - 'bar', - 0, - '/^$/' - ), - ); - } - - /** - * @dataProvider dataGetAutosummary - * @covers WikitextContentHandler::getAutosummary - */ - public function testGetAutosummary( $old, $new, $flags, $expected ) { - $oldContent = is_null( $old ) ? null : new WikitextContent( $old ); - $newContent = is_null( $new ) ? null : new WikitextContent( $new ); - - $summary = $this->handler->getAutosummary( $oldContent, $newContent, $flags ); - - $this->assertTrue( (bool)preg_match( $expected, $summary ), "Autosummary didn't match expected pattern $expected: $summary" ); - } - - /** - * @todo Text case requires database, should be done by a test class in the Database group - */ - /* - public function testGetAutoDeleteReason( Title $title, &$hasHistory ) {} - */ - - /** - * @todo Text case requires database, should be done by a test class in the Database group - */ - /* - public function testGetUndoContent( Revision $current, Revision $undo, Revision $undoafter = null ) {} - */ -} diff --git a/tests/phpunit/includes/content/WikitextContentTest.php b/tests/phpunit/includes/content/WikitextContentTest.php deleted file mode 100644 index 9f20073d..00000000 --- a/tests/phpunit/includes/content/WikitextContentTest.php +++ /dev/null @@ -1,404 +0,0 @@ -hello world\n

        " - ), - // TODO: more...? - ); - } - - public static function dataGetSecondaryDataUpdates() { - return array( - array( "WikitextContentTest_testGetSecondaryDataUpdates_1", - CONTENT_MODEL_WIKITEXT, "hello ''world''\n", - array( - 'LinksUpdate' => array( - 'mRecursive' => true, - 'mLinks' => array() - ) - ) - ), - array( "WikitextContentTest_testGetSecondaryDataUpdates_2", - CONTENT_MODEL_WIKITEXT, "hello [[world test 21344]]\n", - array( - 'LinksUpdate' => array( - 'mRecursive' => true, - 'mLinks' => array( - array( 'World_test_21344' => 0 ) - ) - ) - ) - ), - // TODO: more...? - ); - } - - /** - * @dataProvider dataGetSecondaryDataUpdates - * @group Database - * @covers WikitextContent::getSecondaryDataUpdates - */ - public function testGetSecondaryDataUpdates( $title, $model, $text, $expectedStuff ) { - $ns = $this->getDefaultWikitextNS(); - $title = Title::newFromText( $title, $ns ); - - $content = ContentHandler::makeContent( $text, $title, $model ); - - $page = WikiPage::factory( $title ); - $page->doEditContent( $content, '' ); - - $updates = $content->getSecondaryDataUpdates( $title ); - - // make updates accessible by class name - foreach ( $updates as $update ) { - $class = get_class( $update ); - $updates[$class] = $update; - } - - foreach ( $expectedStuff as $class => $fieldValues ) { - $this->assertArrayHasKey( $class, $updates, "missing an update of type $class" ); - - $update = $updates[$class]; - - foreach ( $fieldValues as $field => $value ) { - $v = $update->$field; #if the field doesn't exist, just crash and burn - $this->assertEquals( $value, $v, "unexpected value for field $field in instance of $class" ); - } - } - - $page->doDeleteArticle( '' ); - } - - public static function dataGetSection() { - return array( - array( WikitextContentTest::$sections, - "0", - "Intro" - ), - array( WikitextContentTest::$sections, - "2", - "== test == -just a test" - ), - array( WikitextContentTest::$sections, - "8", - false - ), - ); - } - - /** - * @dataProvider dataGetSection - * @covers WikitextContent::getSection - */ - public function testGetSection( $text, $sectionId, $expectedText ) { - $content = $this->newContent( $text ); - - $sectionContent = $content->getSection( $sectionId ); - if ( is_object( $sectionContent ) ) { - $sectionText = $sectionContent->getNativeData(); - } else { - $sectionText = $sectionContent; - } - - $this->assertEquals( $expectedText, $sectionText ); - } - - public static function dataReplaceSection() { - return array( - array( WikitextContentTest::$sections, - "0", - "No more", - null, - trim( preg_replace( '/^Intro/sm', 'No more', WikitextContentTest::$sections ) ) - ), - array( WikitextContentTest::$sections, - "", - "No more", - null, - "No more" - ), - array( WikitextContentTest::$sections, - "2", - "== TEST ==\nmore fun", - null, - trim( preg_replace( '/^== test ==.*== foo ==/sm', "== TEST ==\nmore fun\n\n== foo ==", WikitextContentTest::$sections ) ) - ), - array( WikitextContentTest::$sections, - "8", - "No more", - null, - WikitextContentTest::$sections - ), - array( WikitextContentTest::$sections, - "new", - "No more", - "New", - trim( WikitextContentTest::$sections ) . "\n\n\n== New ==\n\nNo more" - ), - ); - } - - /** - * @dataProvider dataReplaceSection - * @covers WikitextContent::replaceSection - */ - public function testReplaceSection( $text, $section, $with, $sectionTitle, $expected ) { - $content = $this->newContent( $text ); - $c = $content->replaceSection( $section, $this->newContent( $with ), $sectionTitle ); - - $this->assertEquals( $expected, is_null( $c ) ? null : $c->getNativeData() ); - } - - /** - * @covers WikitextContent::addSectionHeader - */ - public function testAddSectionHeader() { - $content = $this->newContent( 'hello world' ); - $content = $content->addSectionHeader( 'test' ); - - $this->assertEquals( "== test ==\n\nhello world", $content->getNativeData() ); - } - - public static function dataPreSaveTransform() { - return array( - array( 'hello this is ~~~', - "hello this is [[Special:Contributions/127.0.0.1|127.0.0.1]]", - ), - array( 'hello \'\'this\'\' is ~~~', - 'hello \'\'this\'\' is ~~~', - ), - array( // rtrim - " Foo \n ", - " Foo", - ), - ); - } - - public static function dataPreloadTransform() { - return array( - array( 'hello this is ~~~', - "hello this is ~~~", - ), - array( 'hello \'\'this\'\' is foobar', - 'hello \'\'this\'\' is bar', - ), - ); - } - - public static function dataGetRedirectTarget() { - return array( - array( '#REDIRECT [[Test]]', - 'Test', - ), - array( '#REDIRECT Test', - null, - ), - array( '* #REDIRECT [[Test]]', - null, - ), - ); - } - - public static function dataGetTextForSummary() { - return array( - array( "hello\nworld.", - 16, - 'hello world.', - ), - array( 'hello world.', - 8, - 'hello...', - ), - array( '[[hello world]].', - 8, - 'hel...', - ), - ); - } - - /** - * @todo Test needs database! Should be done by a test class in the Database group. - */ - /* - public function getRedirectChain() { - $text = $this->getNativeData(); - return Title::newFromRedirectArray( $text ); - } - */ - - /** - * @todo Test needs database! Should be done by a test class in the Database group. - */ - /* - public function getUltimateRedirectTarget() { - $text = $this->getNativeData(); - return Title::newFromRedirectRecurse( $text ); - } - */ - - public static function dataIsCountable() { - return array( - array( '', - null, - 'any', - true - ), - array( 'Foo', - null, - 'any', - true - ), - array( 'Foo', - null, - 'comma', - false - ), - array( 'Foo, bar', - null, - 'comma', - true - ), - array( 'Foo', - null, - 'link', - false - ), - array( 'Foo [[bar]]', - null, - 'link', - true - ), - array( 'Foo', - true, - 'link', - true - ), - array( 'Foo [[bar]]', - false, - 'link', - false - ), - array( '#REDIRECT [[bar]]', - true, - 'any', - false - ), - array( '#REDIRECT [[bar]]', - true, - 'comma', - false - ), - array( '#REDIRECT [[bar]]', - true, - 'link', - false - ), - ); - } - - /** - * @covers WikitextContent::matchMagicWord - */ - public function testMatchMagicWord() { - $mw = MagicWord::get( "staticredirect" ); - - $content = $this->newContent( "#REDIRECT [[FOO]]\n__STATICREDIRECT__" ); - $this->assertTrue( $content->matchMagicWord( $mw ), "should have matched magic word" ); - - $content = $this->newContent( "#REDIRECT [[FOO]]" ); - $this->assertFalse( $content->matchMagicWord( $mw ), "should not have matched magic word" ); - } - - /** - * @covers WikitextContent::updateRedirect - */ - public function testUpdateRedirect() { - $target = Title::newFromText( "testUpdateRedirect_target" ); - - // test with non-redirect page - $content = $this->newContent( "hello world." ); - $newContent = $content->updateRedirect( $target ); - - $this->assertTrue( $content->equals( $newContent ), "content should be unchanged" ); - - // test with actual redirect - $content = $this->newContent( "#REDIRECT [[Someplace]]" ); - $newContent = $content->updateRedirect( $target ); - - $this->assertFalse( $content->equals( $newContent ), "content should have changed" ); - $this->assertTrue( $newContent->isRedirect(), "new content should be a redirect" ); - - $this->assertEquals( $target->getFullText(), $newContent->getRedirectTarget()->getFullText() ); - } - - /** - * @covers WikitextContent::getModel - */ - public function testGetModel() { - $content = $this->newContent( "hello world." ); - - $this->assertEquals( CONTENT_MODEL_WIKITEXT, $content->getModel() ); - } - - /** - * @covers WikitextContent::getContentHandler - */ - public function testGetContentHandler() { - $content = $this->newContent( "hello world." ); - - $this->assertEquals( CONTENT_MODEL_WIKITEXT, $content->getContentHandler()->getModelID() ); - } - - public static function dataEquals() { - return array( - array( new WikitextContent( "hallo" ), null, false ), - array( new WikitextContent( "hallo" ), new WikitextContent( "hallo" ), true ), - array( new WikitextContent( "hallo" ), new JavaScriptContent( "hallo" ), false ), - array( new WikitextContent( "hallo" ), new TextContent( "hallo" ), false ), - array( new WikitextContent( "hallo" ), new WikitextContent( "HALLO" ), false ), - ); - } - - public static function dataGetDeletionUpdates() { - return array( - array( "WikitextContentTest_testGetSecondaryDataUpdates_1", - CONTENT_MODEL_WIKITEXT, "hello ''world''\n", - array( 'LinksDeletionUpdate' => array() ) - ), - array( "WikitextContentTest_testGetSecondaryDataUpdates_2", - CONTENT_MODEL_WIKITEXT, "hello [[world test 21344]]\n", - array( 'LinksDeletionUpdate' => array() ) - ), - // @todo more...? - ); - } -} diff --git a/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php b/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php deleted file mode 100644 index ba63c091..00000000 --- a/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php +++ /dev/null @@ -1,209 +0,0 @@ -addIdentifierQuotes( $in ); - $this->assertEquals($expected, $quoted); - } - - - /** - * Feeds testAddIdentifierQuotes - * - * Named per bug 20281 convention. - */ - function provideDiapers() { - return array( - // Format: expected, input - array( '``', '' ), - - // Yeah I really hate loosely typed PHP idiocies nowadays - array( '``', null ), - - // Dear codereviewer, guess what addIdentifierQuotes() - // will return with thoses: - array( '``', false ), - array( '`1`', true ), - - // We never know what could happen - array( '`0`', 0 ), - array( '`1`', 1 ), - - // Whatchout! Should probably use something more meaningful - array( "`'`", "'" ), # single quote - array( '`"`', '"' ), # double quote - array( '````', '`' ), # backtick - array( '`’`', '’' ), # apostrophe (look at your encyclopedia) - - // sneaky NUL bytes are lurking everywhere - array( '``', "\0" ), - array( '`xyzzy`', "\0x\0y\0z\0z\0y\0" ), - - // unicode chars - array( - self::createUnicodeString( '`\u0001a\uFFFFb`' ), - self::createUnicodeString( '\u0001a\uFFFFb' ) - ), - array( - self::createUnicodeString( '`\u0001\uFFFF`' ), - self::createUnicodeString( '\u0001\u0000\uFFFF\u0000' ) - ), - array( '`☃`', '☃' ), - array( '`メインページ`', 'メインページ' ), - array( '`Басты_бет`', 'Басты_бет' ), - - // Real world: - array( '`Alix`', 'Alix' ), # while( ! $recovered ) { sleep(); } - array( '`Backtick: ```', 'Backtick: `' ), - array( '`This is a test`', 'This is a test' ), - ); - } - - private static function createUnicodeString($str) { - return json_decode( '"' . $str . '"' ); - } - - function getMockForViews() { - $db = $this->getMockBuilder( 'DatabaseMysql' ) - ->disableOriginalConstructor() - ->setMethods( array( 'fetchRow', 'query' ) ) - ->getMock(); - - $db->expects( $this->any() ) - ->method( 'query' ) - ->with( $this->anything() ) - ->will( - $this->returnValue( null ) - ); - - $db->expects( $this->any() ) - ->method( 'fetchRow' ) - ->with( $this->anything() ) - ->will( $this->onConsecutiveCalls( - array( 'Tables_in_' => 'view1' ), - array( 'Tables_in_' => 'view2' ), - array( 'Tables_in_' => 'myview' ), - false # no more rows - )); - return $db; - } - /** - * @covers DatabaseMysqlBase::listViews - */ - function testListviews() { - $db = $this->getMockForViews(); - - // The first call populate an internal cache of views - $this->assertEquals( array( 'view1', 'view2', 'myview'), - $db->listViews() ); - $this->assertEquals( array( 'view1', 'view2', 'myview'), - $db->listViews() ); - - // Prefix filtering - $this->assertEquals( array( 'view1', 'view2' ), - $db->listViews( 'view' ) ); - $this->assertEquals( array( 'myview' ), - $db->listViews( 'my' ) ); - $this->assertEquals( array(), - $db->listViews( 'UNUSED_PREFIX' ) ); - $this->assertEquals( array( 'view1', 'view2', 'myview'), - $db->listViews( '' ) ); - } - - /** - * @covers DatabaseMysqlBase::isView - * @dataProvider provideViewExistanceChecks - */ - function testIsView( $isView, $viewName ) { - $db = $this->getMockForViews(); - - switch( $isView ) { - case true: - $this->assertTrue( $db->isView( $viewName ), - "$viewName should be considered a view" ); - break; - - case false: - $this->assertFalse( $db->isView( $viewName ), - "$viewName has not been defined as a view" ); - break; - } - - } - - function provideViewExistanceChecks() { - return array( - // format: whether it is a view, view name - array( true, 'view1' ), - array( true, 'view2' ), - array( true, 'myview' ), - - array( false, 'user' ), - - array( false, 'view10' ), - array( false, 'my' ), - array( false, 'OH_MY_GOD' ), # they killed kenny! - ); - } - -} diff --git a/tests/phpunit/includes/db/DatabaseSQLTest.php b/tests/phpunit/includes/db/DatabaseSQLTest.php deleted file mode 100644 index bdd567e7..00000000 --- a/tests/phpunit/includes/db/DatabaseSQLTest.php +++ /dev/null @@ -1,721 +0,0 @@ -database = new DatabaseTestHelper( __CLASS__ ); - } - - protected function assertLastSql( $sqlText ) { - $this->assertEquals( - $this->database->getLastSqls(), - $sqlText - ); - } - - /** - * @dataProvider provideSelect - * @covers DatabaseBase::select - */ - public function testSelect( $sql, $sqlText ) { - $this->database->select( - $sql['tables'], - $sql['fields'], - isset( $sql['conds'] ) ? $sql['conds'] : array(), - __METHOD__, - isset( $sql['options'] ) ? $sql['options'] : array(), - isset( $sql['join_conds'] ) ? $sql['join_conds'] : array() - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideSelect() { - return array( - array( - array( - 'tables' => 'table', - 'fields' => array( 'field', 'alias' => 'field2' ), - 'conds' => array( 'alias' => 'text' ), - ), - "SELECT field,field2 AS alias " . - "FROM table " . - "WHERE alias = 'text'" - ), - array( - array( - 'tables' => 'table', - 'fields' => array( 'field', 'alias' => 'field2' ), - 'conds' => array( 'alias' => 'text' ), - 'options' => array( 'LIMIT' => 1, 'ORDER BY' => 'field' ), - ), - "SELECT field,field2 AS alias " . - "FROM table " . - "WHERE alias = 'text' " . - "ORDER BY field " . - "LIMIT 1" - ), - array( - array( - 'tables' => array( 'table', 't2' => 'table2' ), - 'fields' => array( 'tid', 'field', 'alias' => 'field2', 't2.id' ), - 'conds' => array( 'alias' => 'text' ), - 'options' => array( 'LIMIT' => 1, 'ORDER BY' => 'field' ), - 'join_conds' => array( 't2' => array( - 'LEFT JOIN', 'tid = t2.id' - ) ), - ), - "SELECT tid,field,field2 AS alias,t2.id " . - "FROM table LEFT JOIN table2 t2 ON ((tid = t2.id)) " . - "WHERE alias = 'text' " . - "ORDER BY field " . - "LIMIT 1" - ), - array( - array( - 'tables' => array( 'table', 't2' => 'table2' ), - 'fields' => array( 'tid', 'field', 'alias' => 'field2', 't2.id' ), - 'conds' => array( 'alias' => 'text' ), - 'options' => array( 'LIMIT' => 1, 'GROUP BY' => 'field', 'HAVING' => 'COUNT(*) > 1' ), - 'join_conds' => array( 't2' => array( - 'LEFT JOIN', 'tid = t2.id' - ) ), - ), - "SELECT tid,field,field2 AS alias,t2.id " . - "FROM table LEFT JOIN table2 t2 ON ((tid = t2.id)) " . - "WHERE alias = 'text' " . - "GROUP BY field HAVING COUNT(*) > 1 " . - "LIMIT 1" - ), - array( - array( - 'tables' => array( 'table', 't2' => 'table2' ), - 'fields' => array( 'tid', 'field', 'alias' => 'field2', 't2.id' ), - 'conds' => array( 'alias' => 'text' ), - 'options' => array( 'LIMIT' => 1, 'GROUP BY' => array( 'field', 'field2' ), 'HAVING' => array( 'COUNT(*) > 1', 'field' => 1 ) ), - 'join_conds' => array( 't2' => array( - 'LEFT JOIN', 'tid = t2.id' - ) ), - ), - "SELECT tid,field,field2 AS alias,t2.id " . - "FROM table LEFT JOIN table2 t2 ON ((tid = t2.id)) " . - "WHERE alias = 'text' " . - "GROUP BY field,field2 HAVING (COUNT(*) > 1) AND field = '1' " . - "LIMIT 1" - ), - array( - array( - 'tables' => array( 'table' ), - 'fields' => array( 'alias' => 'field' ), - 'conds' => array( 'alias' => array( 1, 2, 3, 4 ) ), - ), - "SELECT field AS alias " . - "FROM table " . - "WHERE alias IN ('1','2','3','4')" - ), - ); - } - - /** - * @dataProvider provideUpdate - * @covers DatabaseBase::update - */ - public function testUpdate( $sql, $sqlText ) { - $this->database->update( - $sql['table'], - $sql['values'], - $sql['conds'], - __METHOD__, - isset( $sql['options'] ) ? $sql['options'] : array() - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideUpdate() { - return array( - array( - array( - 'table' => 'table', - 'values' => array( 'field' => 'text', 'field2' => 'text2' ), - 'conds' => array( 'alias' => 'text' ), - ), - "UPDATE table " . - "SET field = 'text'" . - ",field2 = 'text2' " . - "WHERE alias = 'text'" - ), - array( - array( - 'table' => 'table', - 'values' => array( 'field = other', 'field2' => 'text2' ), - 'conds' => array( 'id' => '1' ), - ), - "UPDATE table " . - "SET field = other" . - ",field2 = 'text2' " . - "WHERE id = '1'" - ), - array( - array( - 'table' => 'table', - 'values' => array( 'field = other', 'field2' => 'text2' ), - 'conds' => '*', - ), - "UPDATE table " . - "SET field = other" . - ",field2 = 'text2'" - ), - ); - } - - /** - * @dataProvider provideDelete - * @covers DatabaseBase::delete - */ - public function testDelete( $sql, $sqlText ) { - $this->database->delete( - $sql['table'], - $sql['conds'], - __METHOD__ - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideDelete() { - return array( - array( - array( - 'table' => 'table', - 'conds' => array( 'alias' => 'text' ), - ), - "DELETE FROM table " . - "WHERE alias = 'text'" - ), - array( - array( - 'table' => 'table', - 'conds' => '*', - ), - "DELETE FROM table" - ), - ); - } - - /** - * @dataProvider provideUpsert - * @covers DatabaseBase::upsert - */ - public function testUpsert( $sql, $sqlText ) { - $this->database->upsert( - $sql['table'], - $sql['rows'], - $sql['uniqueIndexes'], - $sql['set'], - __METHOD__ - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideUpsert() { - return array( - array( - array( - 'table' => 'upsert_table', - 'rows' => array( 'field' => 'text', 'field2' => 'text2' ), - 'uniqueIndexes' => array( 'field' ), - 'set' => array( 'field' => 'set' ), - ), - "BEGIN; " . - "UPDATE upsert_table " . - "SET field = 'set' " . - "WHERE ((field = 'text')); " . - "INSERT IGNORE INTO upsert_table " . - "(field,field2) " . - "VALUES ('text','text2'); " . - "COMMIT" - ), - ); - } - - /** - * @dataProvider provideDeleteJoin - * @covers DatabaseBase::deleteJoin - */ - public function testDeleteJoin( $sql, $sqlText ) { - $this->database->deleteJoin( - $sql['delTable'], - $sql['joinTable'], - $sql['delVar'], - $sql['joinVar'], - $sql['conds'], - __METHOD__ - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideDeleteJoin() { - return array( - array( - array( - 'delTable' => 'table', - 'joinTable' => 'table_join', - 'delVar' => 'field', - 'joinVar' => 'field_join', - 'conds' => array( 'alias' => 'text' ), - ), - "DELETE FROM table " . - "WHERE field IN (" . - "SELECT field_join FROM table_join WHERE alias = 'text'" . - ")" - ), - array( - array( - 'delTable' => 'table', - 'joinTable' => 'table_join', - 'delVar' => 'field', - 'joinVar' => 'field_join', - 'conds' => '*', - ), - "DELETE FROM table " . - "WHERE field IN (" . - "SELECT field_join FROM table_join " . - ")" - ), - ); - } - - /** - * @dataProvider provideInsert - * @covers DatabaseBase::insert - */ - public function testInsert( $sql, $sqlText ) { - $this->database->insert( - $sql['table'], - $sql['rows'], - __METHOD__, - isset( $sql['options'] ) ? $sql['options'] : array() - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideInsert() { - return array( - array( - array( - 'table' => 'table', - 'rows' => array( 'field' => 'text', 'field2' => 2 ), - ), - "INSERT INTO table " . - "(field,field2) " . - "VALUES ('text','2')" - ), - array( - array( - 'table' => 'table', - 'rows' => array( 'field' => 'text', 'field2' => 2 ), - 'options' => 'IGNORE', - ), - "INSERT IGNORE INTO table " . - "(field,field2) " . - "VALUES ('text','2')" - ), - array( - array( - 'table' => 'table', - 'rows' => array( - array( 'field' => 'text', 'field2' => 2 ), - array( 'field' => 'multi', 'field2' => 3 ), - ), - 'options' => 'IGNORE', - ), - "INSERT IGNORE INTO table " . - "(field,field2) " . - "VALUES " . - "('text','2')," . - "('multi','3')" - ), - ); - } - - /** - * @dataProvider provideInsertSelect - * @covers DatabaseBase::insertSelect - */ - public function testInsertSelect( $sql, $sqlText ) { - $this->database->insertSelect( - $sql['destTable'], - $sql['srcTable'], - $sql['varMap'], - $sql['conds'], - __METHOD__, - isset( $sql['insertOptions'] ) ? $sql['insertOptions'] : array(), - isset( $sql['selectOptions'] ) ? $sql['selectOptions'] : array() - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideInsertSelect() { - return array( - array( - array( - 'destTable' => 'insert_table', - 'srcTable' => 'select_table', - 'varMap' => array( 'field_insert' => 'field_select', 'field' => 'field2' ), - 'conds' => '*', - ), - "INSERT INTO insert_table " . - "(field_insert,field) " . - "SELECT field_select,field2 " . - "FROM select_table" - ), - array( - array( - 'destTable' => 'insert_table', - 'srcTable' => 'select_table', - 'varMap' => array( 'field_insert' => 'field_select', 'field' => 'field2' ), - 'conds' => array( 'field' => 2 ), - ), - "INSERT INTO insert_table " . - "(field_insert,field) " . - "SELECT field_select,field2 " . - "FROM select_table " . - "WHERE field = '2'" - ), - array( - array( - 'destTable' => 'insert_table', - 'srcTable' => 'select_table', - 'varMap' => array( 'field_insert' => 'field_select', 'field' => 'field2' ), - 'conds' => array( 'field' => 2 ), - 'insertOptions' => 'IGNORE', - 'selectOptions' => array( 'ORDER BY' => 'field' ), - ), - "INSERT IGNORE INTO insert_table " . - "(field_insert,field) " . - "SELECT field_select,field2 " . - "FROM select_table " . - "WHERE field = '2' " . - "ORDER BY field" - ), - ); - } - - /** - * @dataProvider provideReplace - * @covers DatabaseBase::replace - */ - public function testReplace( $sql, $sqlText ) { - $this->database->replace( - $sql['table'], - $sql['uniqueIndexes'], - $sql['rows'], - __METHOD__ - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideReplace() { - return array( - array( - array( - 'table' => 'replace_table', - 'uniqueIndexes' => array( 'field' ), - 'rows' => array( 'field' => 'text', 'field2' => 'text2' ), - ), - "DELETE FROM replace_table " . - "WHERE ( field='text' ); " . - "INSERT INTO replace_table " . - "(field,field2) " . - "VALUES ('text','text2')" - ), - array( - array( - 'table' => 'module_deps', - 'uniqueIndexes' => array( array( 'md_module', 'md_skin' ) ), - 'rows' => array( - 'md_module' => 'module', - 'md_skin' => 'skin', - 'md_deps' => 'deps', - ), - ), - "DELETE FROM module_deps " . - "WHERE ( md_module='module' AND md_skin='skin' ); " . - "INSERT INTO module_deps " . - "(md_module,md_skin,md_deps) " . - "VALUES ('module','skin','deps')" - ), - array( - array( - 'table' => 'module_deps', - 'uniqueIndexes' => array( array( 'md_module', 'md_skin' ) ), - 'rows' => array( - array( - 'md_module' => 'module', - 'md_skin' => 'skin', - 'md_deps' => 'deps', - ), array( - 'md_module' => 'module2', - 'md_skin' => 'skin2', - 'md_deps' => 'deps2', - ), - ), - ), - "DELETE FROM module_deps " . - "WHERE ( md_module='module' AND md_skin='skin' ); " . - "INSERT INTO module_deps " . - "(md_module,md_skin,md_deps) " . - "VALUES ('module','skin','deps'); " . - "DELETE FROM module_deps " . - "WHERE ( md_module='module2' AND md_skin='skin2' ); " . - "INSERT INTO module_deps " . - "(md_module,md_skin,md_deps) " . - "VALUES ('module2','skin2','deps2')" - ), - array( - array( - 'table' => 'module_deps', - 'uniqueIndexes' => array( 'md_module', 'md_skin' ), - 'rows' => array( - array( - 'md_module' => 'module', - 'md_skin' => 'skin', - 'md_deps' => 'deps', - ), array( - 'md_module' => 'module2', - 'md_skin' => 'skin2', - 'md_deps' => 'deps2', - ), - ), - ), - "DELETE FROM module_deps " . - "WHERE ( md_module='module' ) OR ( md_skin='skin' ); " . - "INSERT INTO module_deps " . - "(md_module,md_skin,md_deps) " . - "VALUES ('module','skin','deps'); " . - "DELETE FROM module_deps " . - "WHERE ( md_module='module2' ) OR ( md_skin='skin2' ); " . - "INSERT INTO module_deps " . - "(md_module,md_skin,md_deps) " . - "VALUES ('module2','skin2','deps2')" - ), - array( - array( - 'table' => 'module_deps', - 'uniqueIndexes' => array(), - 'rows' => array( - 'md_module' => 'module', - 'md_skin' => 'skin', - 'md_deps' => 'deps', - ), - ), - "INSERT INTO module_deps " . - "(md_module,md_skin,md_deps) " . - "VALUES ('module','skin','deps')" - ), - ); - } - - /** - * @dataProvider provideNativeReplace - * @covers DatabaseBase::nativeReplace - */ - public function testNativeReplace( $sql, $sqlText ) { - $this->database->nativeReplace( - $sql['table'], - $sql['rows'], - __METHOD__ - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideNativeReplace() { - return array( - array( - array( - 'table' => 'replace_table', - 'rows' => array( 'field' => 'text', 'field2' => 'text2' ), - ), - "REPLACE INTO replace_table " . - "(field,field2) " . - "VALUES ('text','text2')" - ), - ); - } - - /** - * @dataProvider provideConditional - * @covers DatabaseBase::conditional - */ - public function testConditional( $sql, $sqlText ) { - $this->assertEquals( trim( $this->database->conditional( - $sql['conds'], - $sql['true'], - $sql['false'] - ) ), $sqlText ); - } - - public static function provideConditional() { - return array( - array( - array( - 'conds' => array( 'field' => 'text' ), - 'true' => 1, - 'false' => 'NULL', - ), - "(CASE WHEN field = 'text' THEN 1 ELSE NULL END)" - ), - array( - array( - 'conds' => array( 'field' => 'text', 'field2' => 'anothertext' ), - 'true' => 1, - 'false' => 'NULL', - ), - "(CASE WHEN field = 'text' AND field2 = 'anothertext' THEN 1 ELSE NULL END)" - ), - array( - array( - 'conds' => 'field=1', - 'true' => 1, - 'false' => 'NULL', - ), - "(CASE WHEN field=1 THEN 1 ELSE NULL END)" - ), - ); - } - - /** - * @dataProvider provideBuildConcat - * @covers DatabaseBase::buildConcat - */ - public function testBuildConcat( $stringList, $sqlText ) { - $this->assertEquals( trim( $this->database->buildConcat( - $stringList - ) ), $sqlText ); - } - - public static function provideBuildConcat() { - return array( - array( - array( 'field', 'field2' ), - "CONCAT(field,field2)" - ), - array( - array( "'test'", 'field2' ), - "CONCAT('test',field2)" - ), - ); - } - - /** - * @dataProvider provideBuildLike - * @covers DatabaseBase::buildLike - */ - public function testBuildLike( $array, $sqlText ) { - $this->assertEquals( trim( $this->database->buildLike( - $array - ) ), $sqlText ); - } - - public static function provideBuildLike() { - return array( - array( - 'text', - "LIKE 'text'" - ), - array( - array( 'text', new LikeMatch( '%' ) ), - "LIKE 'text%'" - ), - array( - array( 'text', new LikeMatch( '%' ), 'text2' ), - "LIKE 'text%text2'" - ), - array( - array( 'text', new LikeMatch( '_' ) ), - "LIKE 'text_'" - ), - ); - } - - /** - * @dataProvider provideUnionQueries - * @covers DatabaseBase::unionQueries - */ - public function testUnionQueries( $sql, $sqlText ) { - $this->assertEquals( trim( $this->database->unionQueries( - $sql['sqls'], - $sql['all'] - ) ), $sqlText ); - } - - public static function provideUnionQueries() { - return array( - array( - array( - 'sqls' => array( 'RAW SQL', 'RAW2SQL' ), - 'all' => true, - ), - "(RAW SQL) UNION ALL (RAW2SQL)" - ), - array( - array( - 'sqls' => array( 'RAW SQL', 'RAW2SQL' ), - 'all' => false, - ), - "(RAW SQL) UNION (RAW2SQL)" - ), - array( - array( - 'sqls' => array( 'RAW SQL', 'RAW2SQL', 'RAW3SQL' ), - 'all' => false, - ), - "(RAW SQL) UNION (RAW2SQL) UNION (RAW3SQL)" - ), - ); - } - - /** - * @covers DatabaseBase::commit - */ - public function testTransactionCommit() { - $this->database->begin( __METHOD__ ); - $this->database->commit( __METHOD__ ); - $this->assertLastSql( 'BEGIN; COMMIT' ); - } - - /** - * @covers DatabaseBase::rollback - */ - public function testTransactionRollback() { - $this->database->begin( __METHOD__ ); - $this->database->rollback( __METHOD__ ); - $this->assertLastSql( 'BEGIN; ROLLBACK' ); - } - - /** - * @covers DatabaseBase::dropTable - */ - public function testDropTable() { - $this->database->setExistingTables( array( 'table' ) ); - $this->database->dropTable( 'table', __METHOD__ ); - $this->assertLastSql( 'DROP TABLE table' ); - } - - /** - * @covers DatabaseBase::dropTable - */ - public function testDropNonExistingTable() { - $this->assertFalse( - $this->database->dropTable( 'non_existing', __METHOD__ ) - ); - } -} diff --git a/tests/phpunit/includes/db/DatabaseSqliteTest.php b/tests/phpunit/includes/db/DatabaseSqliteTest.php deleted file mode 100644 index 70ee9465..00000000 --- a/tests/phpunit/includes/db/DatabaseSqliteTest.php +++ /dev/null @@ -1,421 +0,0 @@ -lastQuery = $sql; - - return true; - } - - /** - * Override parent visibility to public - */ - public function replaceVars( $s ) { - return parent::replaceVars( $s ); - } -} - -/** - * @group sqlite - * @group Database - * @group medium - */ -class DatabaseSqliteTest extends MediaWikiTestCase { - - /** - * @var MockDatabaseSqlite - */ - var $db; - - protected function setUp() { - parent::setUp(); - - if ( !Sqlite::isPresent() ) { - $this->markTestSkipped( 'No SQLite support detected' ); - } - $this->db = new MockDatabaseSqlite(); - if ( version_compare( $this->db->getServerVersion(), '3.6.0', '<' ) ) { - $this->markTestSkipped( "SQLite at least 3.6 required, {$this->db->getServerVersion()} found" ); - } - } - - private function replaceVars( $sql ) { - // normalize spacing to hide implementation details - return preg_replace( '/\s+/', ' ', $this->db->replaceVars( $sql ) ); - } - - private function assertResultIs( $expected, $res ) { - $this->assertNotNull( $res ); - $i = 0; - foreach ( $res as $row ) { - foreach ( $expected[$i] as $key => $value ) { - $this->assertTrue( isset( $row->$key ) ); - $this->assertEquals( $value, $row->$key ); - } - $i++; - } - $this->assertEquals( count( $expected ), $i, 'Unexpected number of rows' ); - } - - public static function provideAddQuotes() { - return array( - array( // #0: empty - '', "''" - ), - array( // #1: simple - 'foo bar', "'foo bar'" - ), - array( // #2: including quote - 'foo\'bar', "'foo''bar'" - ), - array( // #3: including \0 (must be represented as hex, per https://bugs.php.net/bug.php?id=63419) - "x\0y", - "x'780079'", - ), - array( // #4: blob object (must be represented as hex) - new Blob( "hello" ), - "x'68656c6c6f'", - ), - ); - } - - /** - * @dataProvider provideAddQuotes() - * @covers DatabaseSqlite::addQuotes - */ - public function testAddQuotes( $value, $expected ) { - // check quoting - $db = new DatabaseSqliteStandalone( ':memory:' ); - $this->assertEquals( $expected, $db->addQuotes( $value ), 'string not quoted as expected' ); - - // ok, quoting works as expected, now try a round trip. - $re = $db->query( 'select ' . $db->addQuotes( $value ) ); - - $this->assertTrue( $re !== false, 'query failed' ); - - if ( $row = $re->fetchRow() ) { - if ( $value instanceof Blob ) { - $value = $value->fetch(); - } - - $this->assertEquals( $value, $row[0], 'string mangled by the database' ); - } else { - $this->fail( 'query returned no result' ); - } - } - - /** - * @covers DatabaseSqlite::replaceVars - */ - public function testReplaceVars() { - $this->assertEquals( 'foo', $this->replaceVars( 'foo' ), "Don't break anything accidentally" ); - - $this->assertEquals( "CREATE TABLE /**/foo (foo_key INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, " - . "foo_bar TEXT, foo_name TEXT NOT NULL DEFAULT '', foo_int INTEGER, foo_int2 INTEGER );", - $this->replaceVars( "CREATE TABLE /**/foo (foo_key int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, - foo_bar char(13), foo_name varchar(255) binary NOT NULL DEFAULT '', foo_int tinyint ( 8 ), foo_int2 int(16) ) ENGINE=MyISAM;" ) - ); - - $this->assertEquals( "CREATE TABLE foo ( foo1 REAL, foo2 REAL, foo3 REAL );", - $this->replaceVars( "CREATE TABLE foo ( foo1 FLOAT, foo2 DOUBLE( 1,10), foo3 DOUBLE PRECISION );" ) - ); - - $this->assertEquals( "CREATE TABLE foo ( foo_binary1 BLOB, foo_binary2 BLOB );", - $this->replaceVars( "CREATE TABLE foo ( foo_binary1 binary(16), foo_binary2 varbinary(32) );" ) - ); - - $this->assertEquals( "CREATE TABLE text ( text_foo TEXT );", - $this->replaceVars( "CREATE TABLE text ( text_foo tinytext );" ), - 'Table name changed' - ); - - $this->assertEquals( "CREATE TABLE foo ( foobar INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL );", - $this->replaceVars( "CREATE TABLE foo ( foobar INT PRIMARY KEY NOT NULL AUTO_INCREMENT );" ) - ); - $this->assertEquals( "CREATE TABLE foo ( foobar INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL );", - $this->replaceVars( "CREATE TABLE foo ( foobar INT PRIMARY KEY AUTO_INCREMENT NOT NULL );" ) - ); - - $this->assertEquals( "CREATE TABLE enums( enum1 TEXT, myenum TEXT)", - $this->replaceVars( "CREATE TABLE enums( enum1 ENUM('A', 'B'), myenum ENUM ('X', 'Y'))" ) - ); - - $this->assertEquals( "ALTER TABLE foo ADD COLUMN foo_bar INTEGER DEFAULT 42", - $this->replaceVars( "ALTER TABLE foo\nADD COLUMN foo_bar int(10) unsigned DEFAULT 42" ) - ); - } - - /** - * @covers DatabaseSqlite::tableName - */ - public function testTableName() { - // @todo Moar! - $db = new DatabaseSqliteStandalone( ':memory:' ); - $this->assertEquals( 'foo', $db->tableName( 'foo' ) ); - $this->assertEquals( 'sqlite_master', $db->tableName( 'sqlite_master' ) ); - $db->tablePrefix( 'foo' ); - $this->assertEquals( 'sqlite_master', $db->tableName( 'sqlite_master' ) ); - $this->assertEquals( 'foobar', $db->tableName( 'bar' ) ); - } - - /** - * @covers DatabaseSqlite::duplicateTableStructure - */ - public function testDuplicateTableStructure() { - $db = new DatabaseSqliteStandalone( ':memory:' ); - $db->query( 'CREATE TABLE foo(foo, barfoo)' ); - - $db->duplicateTableStructure( 'foo', 'bar' ); - $this->assertEquals( 'CREATE TABLE "bar"(foo, barfoo)', - $db->selectField( 'sqlite_master', 'sql', array( 'name' => 'bar' ) ), - 'Normal table duplication' - ); - - $db->duplicateTableStructure( 'foo', 'baz', true ); - $this->assertEquals( 'CREATE TABLE "baz"(foo, barfoo)', - $db->selectField( 'sqlite_temp_master', 'sql', array( 'name' => 'baz' ) ), - 'Creation of temporary duplicate' - ); - $this->assertEquals( 0, - $db->selectField( 'sqlite_master', 'COUNT(*)', array( 'name' => 'baz' ) ), - 'Create a temporary duplicate only' - ); - } - - /** - * @covers DatabaseSqlite::duplicateTableStructure - */ - public function testDuplicateTableStructureVirtual() { - $db = new DatabaseSqliteStandalone( ':memory:' ); - if ( $db->getFulltextSearchModule() != 'FTS3' ) { - $this->markTestSkipped( 'FTS3 not supported, cannot create virtual tables' ); - } - $db->query( 'CREATE VIRTUAL TABLE "foo" USING FTS3(foobar)' ); - - $db->duplicateTableStructure( 'foo', 'bar' ); - $this->assertEquals( 'CREATE VIRTUAL TABLE "bar" USING FTS3(foobar)', - $db->selectField( 'sqlite_master', 'sql', array( 'name' => 'bar' ) ), - 'Duplication of virtual tables' - ); - - $db->duplicateTableStructure( 'foo', 'baz', true ); - $this->assertEquals( 'CREATE VIRTUAL TABLE "baz" USING FTS3(foobar)', - $db->selectField( 'sqlite_master', 'sql', array( 'name' => 'baz' ) ), - "Can't create temporary virtual tables, should fall back to non-temporary duplication" - ); - } - - /** - * @covers DatabaseSqlite::deleteJoin - */ - public function testDeleteJoin() { - $db = new DatabaseSqliteStandalone( ':memory:' ); - $db->query( 'CREATE TABLE a (a_1)', __METHOD__ ); - $db->query( 'CREATE TABLE b (b_1, b_2)', __METHOD__ ); - $db->insert( 'a', array( - array( 'a_1' => 1 ), - array( 'a_1' => 2 ), - array( 'a_1' => 3 ), - ), - __METHOD__ - ); - $db->insert( 'b', array( - array( 'b_1' => 2, 'b_2' => 'a' ), - array( 'b_1' => 3, 'b_2' => 'b' ), - ), - __METHOD__ - ); - $db->deleteJoin( 'a', 'b', 'a_1', 'b_1', array( 'b_2' => 'a' ), __METHOD__ ); - $res = $db->query( "SELECT * FROM a", __METHOD__ ); - $this->assertResultIs( array( - array( 'a_1' => 1 ), - array( 'a_1' => 3 ), - ), - $res - ); - } - - public function testEntireSchema() { - global $IP; - - $result = Sqlite::checkSqlSyntax( "$IP/maintenance/tables.sql" ); - if ( $result !== true ) { - $this->fail( $result ); - } - $this->assertTrue( true ); // avoid test being marked as incomplete due to lack of assertions - } - - /** - * Runs upgrades of older databases and compares results with current schema - * @todo Currently only checks list of tables - */ - public function testUpgrades() { - global $IP, $wgVersion, $wgProfileToDatabase; - - // Versions tested - $versions = array( - //'1.13', disabled for now, was totally screwed up - // SQLite wasn't included in 1.14 - '1.15', - '1.16', - '1.17', - '1.18', - ); - - // Mismatches for these columns we can safely ignore - $ignoredColumns = array( - 'user_newtalk.user_last_timestamp', // r84185 - ); - - $currentDB = new DatabaseSqliteStandalone( ':memory:' ); - $currentDB->sourceFile( "$IP/maintenance/tables.sql" ); - if ( $wgProfileToDatabase ) { - $currentDB->sourceFile( "$IP/maintenance/sqlite/archives/patch-profiling.sql" ); - } - $currentTables = $this->getTables( $currentDB ); - sort( $currentTables ); - - foreach ( $versions as $version ) { - $versions = "upgrading from $version to $wgVersion"; - $db = $this->prepareDB( $version ); - $tables = $this->getTables( $db ); - $this->assertEquals( $currentTables, $tables, "Different tables $versions" ); - foreach ( $tables as $table ) { - $currentCols = $this->getColumns( $currentDB, $table ); - $cols = $this->getColumns( $db, $table ); - $this->assertEquals( - array_keys( $currentCols ), - array_keys( $cols ), - "Mismatching columns for table \"$table\" $versions" - ); - foreach ( $currentCols as $name => $column ) { - $fullName = "$table.$name"; - $this->assertEquals( - (bool)$column->pk, - (bool)$cols[$name]->pk, - "PRIMARY KEY status does not match for column $fullName $versions" - ); - if ( !in_array( $fullName, $ignoredColumns ) ) { - $this->assertEquals( - (bool)$column->notnull, - (bool)$cols[$name]->notnull, - "NOT NULL status does not match for column $fullName $versions" - ); - $this->assertEquals( - $column->dflt_value, - $cols[$name]->dflt_value, - "Default values does not match for column $fullName $versions" - ); - } - } - $currentIndexes = $this->getIndexes( $currentDB, $table ); - $indexes = $this->getIndexes( $db, $table ); - $this->assertEquals( - array_keys( $currentIndexes ), - array_keys( $indexes ), - "mismatching indexes for table \"$table\" $versions" - ); - } - $db->close(); - } - } - - /** - * @covers DatabaseSqlite::insertId - */ - public function testInsertIdType() { - $db = new DatabaseSqliteStandalone( ':memory:' ); - - $databaseCreation = $db->query( 'CREATE TABLE a ( a_1 )', __METHOD__ ); - $this->assertInstanceOf( 'ResultWrapper', $databaseCreation, "Database creation" ); - - $insertion = $db->insert( 'a', array( 'a_1' => 10 ), __METHOD__ ); - $this->assertTrue( $insertion, "Insertion worked" ); - - $this->assertInternalType( 'integer', $db->insertId(), "Actual typecheck" ); - $this->assertTrue( $db->close(), "closing database" ); - } - - private function prepareDB( $version ) { - static $maint = null; - if ( $maint === null ) { - $maint = new FakeMaintenance(); - $maint->loadParamsAndArgs( null, array( 'quiet' => 1 ) ); - } - - global $IP; - $db = new DatabaseSqliteStandalone( ':memory:' ); - $db->sourceFile( "$IP/tests/phpunit/data/db/sqlite/tables-$version.sql" ); - $updater = DatabaseUpdater::newForDB( $db, false, $maint ); - $updater->doUpdates( array( 'core' ) ); - - return $db; - } - - private function getTables( $db ) { - $list = array_flip( $db->listTables() ); - $excluded = array( - 'external_user', // removed from core in 1.22 - 'math', // moved out of core in 1.18 - 'trackbacks', // removed from core in 1.19 - 'searchindex', - 'searchindex_content', - 'searchindex_segments', - 'searchindex_segdir', - // FTS4 ready!!1 - 'searchindex_docsize', - 'searchindex_stat', - ); - foreach ( $excluded as $t ) { - unset( $list[$t] ); - } - $list = array_flip( $list ); - sort( $list ); - - return $list; - } - - private function getColumns( $db, $table ) { - $cols = array(); - $res = $db->query( "PRAGMA table_info($table)" ); - $this->assertNotNull( $res ); - foreach ( $res as $col ) { - $cols[$col->name] = $col; - } - ksort( $cols ); - - return $cols; - } - - private function getIndexes( $db, $table ) { - $indexes = array(); - $res = $db->query( "PRAGMA index_list($table)" ); - $this->assertNotNull( $res ); - foreach ( $res as $index ) { - $res2 = $db->query( "PRAGMA index_info({$index->name})" ); - $this->assertNotNull( $res2 ); - $index->columns = array(); - foreach ( $res2 as $col ) { - $index->columns[] = $col; - } - $indexes[$index->name] = $index; - } - ksort( $indexes ); - - return $indexes; - } - - public function testCaseInsensitiveLike() { - // TODO: Test this for all databases - $db = new DatabaseSqliteStandalone( ':memory:' ); - $res = $db->query( 'SELECT "a" LIKE "A" AS a' ); - $row = $res->fetchRow(); - $this->assertFalse( (bool)$row['a'] ); - } -} diff --git a/tests/phpunit/includes/db/DatabaseTest.php b/tests/phpunit/includes/db/DatabaseTest.php deleted file mode 100644 index 301fc990..00000000 --- a/tests/phpunit/includes/db/DatabaseTest.php +++ /dev/null @@ -1,234 +0,0 @@ -db = wfGetDB( DB_MASTER ); - } - - protected function tearDown() { - parent::tearDown(); - if ( $this->functionTest ) { - $this->dropFunctions(); - $this->functionTest = false; - } - } - /** - * @covers DatabaseBase::dropTable - */ - public function testAddQuotesNull() { - $check = "NULL"; - if ( $this->db->getType() === 'sqlite' || $this->db->getType() === 'oracle' ) { - $check = "''"; - } - $this->assertEquals( $check, $this->db->addQuotes( null ) ); - } - - public function testAddQuotesInt() { - # returning just "1234" should be ok too, though... - # maybe - $this->assertEquals( - "'1234'", - $this->db->addQuotes( 1234 ) ); - } - - public function testAddQuotesFloat() { - # returning just "1234.5678" would be ok too, though - $this->assertEquals( - "'1234.5678'", - $this->db->addQuotes( 1234.5678 ) ); - } - - public function testAddQuotesString() { - $this->assertEquals( - "'string'", - $this->db->addQuotes( 'string' ) ); - } - - public function testAddQuotesStringQuote() { - $check = "'string''s cause trouble'"; - if ( $this->db->getType() === 'mysql' ) { - $check = "'string\'s cause trouble'"; - } - $this->assertEquals( - $check, - $this->db->addQuotes( "string's cause trouble" ) ); - } - - private function getSharedTableName( $table, $database, $prefix, $format = 'quoted' ) { - global $wgSharedDB, $wgSharedTables, $wgSharedPrefix; - - $oldName = $wgSharedDB; - $oldTables = $wgSharedTables; - $oldPrefix = $wgSharedPrefix; - - $wgSharedDB = $database; - $wgSharedTables = array( $table ); - $wgSharedPrefix = $prefix; - - $ret = $this->db->tableName( $table, $format ); - - $wgSharedDB = $oldName; - $wgSharedTables = $oldTables; - $wgSharedPrefix = $oldPrefix; - - return $ret; - } - - private function prefixAndQuote( $table, $database = null, $prefix = null, $format = 'quoted' ) { - if ( $this->db->getType() === 'sqlite' || $format !== 'quoted' ) { - $quote = ''; - } elseif ( $this->db->getType() === 'mysql' ) { - $quote = '`'; - } elseif ( $this->db->getType() === 'oracle' ) { - $quote = '/*Q*/'; - } else { - $quote = '"'; - } - - if ( $database !== null ) { - if ( $this->db->getType() === 'oracle' ) { - $database = $quote . $database . '.'; - } else { - $database = $quote . $database . $quote . '.'; - } - } - - if ( $prefix === null ) { - $prefix = $this->dbPrefix(); - } - - if ( $this->db->getType() === 'oracle' ) { - return strtoupper($database . $quote . $prefix . $table); - } else { - return $database . $quote . $prefix . $table . $quote; - } - } - - public function testTableNameLocal() { - $this->assertEquals( - $this->prefixAndQuote( 'tablename' ), - $this->db->tableName( 'tablename' ) - ); - } - - public function testTableNameRawLocal() { - $this->assertEquals( - $this->prefixAndQuote( 'tablename', null, null, 'raw' ), - $this->db->tableName( 'tablename', 'raw' ) - ); - } - - public function testTableNameShared() { - $this->assertEquals( - $this->prefixAndQuote( 'tablename', 'sharedatabase', 'sh_' ), - $this->getSharedTableName( 'tablename', 'sharedatabase', 'sh_' ) - ); - - $this->assertEquals( - $this->prefixAndQuote( 'tablename', 'sharedatabase', null ), - $this->getSharedTableName( 'tablename', 'sharedatabase', null ) - ); - } - - public function testTableNameRawShared() { - $this->assertEquals( - $this->prefixAndQuote( 'tablename', 'sharedatabase', 'sh_', 'raw' ), - $this->getSharedTableName( 'tablename', 'sharedatabase', 'sh_', 'raw' ) - ); - - $this->assertEquals( - $this->prefixAndQuote( 'tablename', 'sharedatabase', null, 'raw' ), - $this->getSharedTableName( 'tablename', 'sharedatabase', null, 'raw' ) - ); - } - - public function testTableNameForeign() { - $this->assertEquals( - $this->prefixAndQuote( 'tablename', 'databasename', '' ), - $this->db->tableName( 'databasename.tablename' ) - ); - } - - public function testTableNameRawForeign() { - $this->assertEquals( - $this->prefixAndQuote( 'tablename', 'databasename', '', 'raw' ), - $this->db->tableName( 'databasename.tablename', 'raw' ) - ); - } - - public function testFillPreparedEmpty() { - $sql = $this->db->fillPrepared( - 'SELECT * FROM interwiki', array() ); - $this->assertEquals( - "SELECT * FROM interwiki", - $sql ); - } - - public function testFillPreparedQuestion() { - $sql = $this->db->fillPrepared( - 'SELECT * FROM cur WHERE cur_namespace=? AND cur_title=?', - array( 4, "Snicker's_paradox" ) ); - - $check = "SELECT * FROM cur WHERE cur_namespace='4' AND cur_title='Snicker''s_paradox'"; - if ( $this->db->getType() === 'mysql' ) { - $check = "SELECT * FROM cur WHERE cur_namespace='4' AND cur_title='Snicker\'s_paradox'"; - } - $this->assertEquals( $check, $sql ); - } - - public function testFillPreparedBang() { - $sql = $this->db->fillPrepared( - 'SELECT user_id FROM ! WHERE user_name=?', - array( '"user"', "Slash's Dot" ) ); - - $check = "SELECT user_id FROM \"user\" WHERE user_name='Slash''s Dot'"; - if ( $this->db->getType() === 'mysql' ) { - $check = "SELECT user_id FROM \"user\" WHERE user_name='Slash\'s Dot'"; - } - $this->assertEquals( $check, $sql ); - } - - public function testFillPreparedRaw() { - $sql = $this->db->fillPrepared( - "SELECT * FROM cur WHERE cur_title='This_\\&_that,_WTF\\?\\!'", - array( '"user"', "Slash's Dot" ) ); - $this->assertEquals( - "SELECT * FROM cur WHERE cur_title='This_&_that,_WTF?!'", - $sql ); - } - - public function testStoredFunctions() { - if ( !in_array( wfGetDB( DB_MASTER )->getType(), array( 'mysql', 'postgres' ) ) ) { - $this->markTestSkipped( 'MySQL or Postgres required' ); - } - global $IP; - $this->dropFunctions(); - $this->functionTest = true; - $this->assertTrue( $this->db->sourceFile( "$IP/tests/phpunit/data/db/{$this->db->getType()}/functions.sql" ) ); - $res = $this->db->query( 'SELECT mw_test_function() AS test', __METHOD__ ); - $this->assertEquals( 42, $res->fetchObject()->test ); - } - - private function dropFunctions() { - $this->db->query( 'DROP FUNCTION IF EXISTS mw_test_function' - . ( $this->db->getType() == 'postgres' ? '()' : '' ) - ); - } - - public function testUnknownTableCorruptsResults() { - $res = $this->db->select( 'page', '*', array( 'page_id' => 1 ) ); - $this->assertFalse( $this->db->tableExists( 'foobarbaz' ) ); - $this->assertInternalType( 'int', $res->numRows() ); - } -} diff --git a/tests/phpunit/includes/db/DatabaseTestHelper.php b/tests/phpunit/includes/db/DatabaseTestHelper.php deleted file mode 100644 index 790f273c..00000000 --- a/tests/phpunit/includes/db/DatabaseTestHelper.php +++ /dev/null @@ -1,166 +0,0 @@ -testName = $testName; - } - - /** - * Returns SQL queries grouped by '; ' - * Clear the list of queries that have been done so far. - */ - public function getLastSqls() { - $lastSqls = implode( '; ', $this->lastSqls ); - $this->lastSqls = array(); - - return $lastSqls; - } - - public function setExistingTables( $tablesExists ) { - $this->tablesExists = (array)$tablesExists; - } - - protected function addSql( $sql ) { - // clean up spaces before and after some words and the whole string - $this->lastSqls[] = trim( preg_replace( - '/\s{2,}(?=FROM|WHERE|GROUP BY|ORDER BY|LIMIT)|(?<=SELECT|INSERT|UPDATE)\s{2,}/', - ' ', $sql - ) ); - } - - protected function checkFunctionName( $fname ) { - if ( substr( $fname, 0, strlen( $this->testName ) ) !== $this->testName ) { - throw new MWException( 'function name does not start with test class. ' . - $fname . ' vs. ' . $this->testName . '. ' . - 'Please provide __METHOD__ to database methods.' ); - } - } - - function strencode( $s ) { - // Choose apos to avoid handling of escaping double quotes in quoted text - return str_replace( "'", "\'", $s ); - } - - public function addIdentifierQuotes( $s ) { - // no escaping to avoid handling of double quotes in quoted text - return $s; - } - - public function query( $sql, $fname = '', $tempIgnore = false ) { - $this->checkFunctionName( $fname ); - $this->addSql( $sql ); - - return parent::query( $sql, $fname, $tempIgnore ); - } - - public function tableExists( $table, $fname = __METHOD__ ) { - $this->checkFunctionName( $fname ); - - return in_array( $table, (array)$this->tablesExists ); - } - - // Redeclare parent method to make it public - public function nativeReplace( $table, $rows, $fname ) { - return parent::nativeReplace( $table, $rows, $fname ); - } - - function getType() { - return 'test'; - } - - function open( $server, $user, $password, $dbName ) { - return false; - } - - function fetchObject( $res ) { - return false; - } - - function fetchRow( $res ) { - return false; - } - - function numRows( $res ) { - return -1; - } - - function numFields( $res ) { - return -1; - } - - function fieldName( $res, $n ) { - return 'test'; - } - - function insertId() { - return -1; - } - - function dataSeek( $res, $row ) { - /* nop */ - } - - function lastErrno() { - return -1; - } - - function lastError() { - return 'test'; - } - - function fieldInfo( $table, $field ) { - return false; - } - - function indexInfo( $table, $index, $fname = 'Database::indexInfo' ) { - return false; - } - - function affectedRows() { - return -1; - } - - function getSoftwareLink() { - return 'test'; - } - - function getServerVersion() { - return 'test'; - } - - function getServerInfo() { - return 'test'; - } - - protected function closeConnection() { - return false; - } - - protected function doQuery( $sql ) { - return array(); - } -} diff --git a/tests/phpunit/includes/db/ORMRowTest.php b/tests/phpunit/includes/db/ORMRowTest.php deleted file mode 100644 index 27d4d0e8..00000000 --- a/tests/phpunit/includes/db/ORMRowTest.php +++ /dev/null @@ -1,226 +0,0 @@ - - */ -abstract class ORMRowTest extends \MediaWikiTestCase { - - /** - * @since 1.20 - * @return string - */ - abstract protected function getRowClass(); - - /** - * @since 1.20 - * @return IORMTable - */ - abstract protected function getTableInstance(); - - /** - * @since 1.20 - * @return array - */ - abstract public function constructorTestProvider(); - - /** - * @since 1.20 - * @param IORMRow $row - * @param array $data - */ - protected function verifyFields( IORMRow $row, array $data ) { - foreach ( array_keys( $data ) as $fieldName ) { - $this->assertEquals( $data[$fieldName], $row->getField( $fieldName ) ); - } - } - - /** - * @since 1.20 - * @param array $data - * @param boolean $loadDefaults - * @return IORMRow - */ - protected function getRowInstance( array $data, $loadDefaults ) { - $class = $this->getRowClass(); - - return new $class( $this->getTableInstance(), $data, $loadDefaults ); - } - - /** - * @since 1.20 - * @return array - */ - protected function getMockValues() { - return array( - 'id' => 1, - 'str' => 'foobar4645645', - 'int' => 42, - 'float' => 4.2, - 'bool' => true, - 'array' => array( 42, 'foobar' ), - 'blob' => new stdClass() - ); - } - - /** - * @since 1.20 - * @return array - */ - protected function getMockFields() { - $mockValues = $this->getMockValues(); - $mockFields = array(); - - foreach ( $this->getTableInstance()->getFields() as $name => $type ) { - if ( $name !== 'id' ) { - $mockFields[$name] = $mockValues[$type]; - } - } - - return $mockFields; - } - - /** - * @since 1.20 - * @return array of IORMRow - */ - public function instanceProvider() { - $instances = array(); - - foreach ( $this->constructorTestProvider() as $arguments ) { - $instances[] = array( call_user_func_array( array( $this, 'getRowInstance' ), $arguments ) ); - } - - return $instances; - } - - /** - * @dataProvider constructorTestProvider - */ - public function testConstructor( array $data, $loadDefaults ) { - $this->verifyFields( $this->getRowInstance( $data, $loadDefaults ), $data ); - } - - /** - * @dataProvider constructorTestProvider - */ - public function testSaveAndRemove( array $data, $loadDefaults ) { - $item = $this->getRowInstance( $data, $loadDefaults ); - - $this->assertTrue( $item->save() ); - - $this->assertTrue( $item->hasIdField() ); - $this->assertTrue( is_integer( $item->getId() ) ); - - $id = $item->getId(); - - $this->assertTrue( $item->save() ); - - $this->assertEquals( $id, $item->getId() ); - - $this->verifyFields( $item, $data ); - - $this->assertTrue( $item->remove() ); - - $this->assertFalse( $item->hasIdField() ); - - $this->assertTrue( $item->save() ); - - $this->verifyFields( $item, $data ); - - $this->assertTrue( $item->remove() ); - - $this->assertFalse( $item->hasIdField() ); - - $this->verifyFields( $item, $data ); - } - - /** - * @dataProvider instanceProvider - */ - public function testSetField( IORMRow $item ) { - foreach ( $this->getMockFields() as $name => $value ) { - $item->setField( $name, $value ); - $this->assertEquals( $value, $item->getField( $name ) ); - } - } - - /** - * @since 1.20 - * @param array $expected - * @param IORMRow $item - */ - protected function assertFieldValues( array $expected, IORMRow $item ) { - foreach ( $expected as $name => $type ) { - if ( $name !== 'id' ) { - $this->assertEquals( $expected[$name], $item->getField( $name ) ); - } - } - } - - /** - * @dataProvider instanceProvider - */ - public function testSetFields( IORMRow $item ) { - $originalValues = $item->getFields(); - - $item->setFields( array(), false ); - - foreach ( $item->getTable()->getFields() as $name => $type ) { - $originalHas = array_key_exists( $name, $originalValues ); - $newHas = $item->hasField( $name ); - - $this->assertEquals( $originalHas, $newHas ); - - if ( $originalHas && $newHas ) { - $this->assertEquals( $originalValues[$name], $item->getField( $name ) ); - } - } - - $mockFields = $this->getMockFields(); - - $item->setFields( $mockFields, false ); - - $this->assertFieldValues( $originalValues, $item ); - - $item->setFields( $mockFields, true ); - - $this->assertFieldValues( $mockFields, $item ); - } - - // TODO: test all of the methods! - -} diff --git a/tests/phpunit/includes/db/ORMTableTest.php b/tests/phpunit/includes/db/ORMTableTest.php deleted file mode 100644 index e583d1bc..00000000 --- a/tests/phpunit/includes/db/ORMTableTest.php +++ /dev/null @@ -1,146 +0,0 @@ - - * @author Daniel Kinzler - */ -class ORMTableTest extends MediaWikiTestCase { - - /** - * @since 1.21 - * @return string - */ - protected function getTableClass() { - return 'PageORMTableForTesting'; - } - - /** - * @since 1.21 - * @return IORMTable - */ - public function getTable() { - $class = $this->getTableClass(); - - return $class::singleton(); - } - - /** - * @since 1.21 - * @return string - */ - public function getRowClass() { - return $this->getTable()->getRowClass(); - } - - /** - * @since 1.21 - */ - public function testSingleton() { - $class = $this->getTableClass(); - - $this->assertInstanceOf( $class, $class::singleton() ); - $this->assertTrue( $class::singleton() === $class::singleton() ); - } - - /** - * @since 1.21 - */ - public function testIgnoreErrorsOverride() { - $table = $this->getTable(); - - $db = $table->getReadDbConnection(); - $db->ignoreErrors( true ); - - try { - $table->rawSelect( "this is invalid" ); - $this->fail( "An invalid query should trigger a DBQueryError even if ignoreErrors is enabled." ); - } catch ( DBQueryError $ex ) { - $this->assertTrue( true, "just making phpunit happy" ); - } - - $db->ignoreErrors( false ); - } -} - -/** - * Dummy ORM table for testing, reading Title objects from the page table. - * - * @since 1.21 - */ - -class PageORMTableForTesting extends ORMTable { - - /** - * @see ORMTable::getName - * - * @return string - */ - public function getName() { - return 'page'; - } - - /** - * @see ORMTable::getRowClass - * - * @return string - */ - public function getRowClass() { - return 'Title'; - } - - /** - * @see ORMTable::newRow - * - * @return IORMRow - */ - public function newRow( array $data, $loadDefaults = false ) { - return Title::makeTitle( $data['namespace'], $data['title'] ); - } - - /** - * @see ORMTable::getFields - * - * @return array - */ - public function getFields() { - return array( - 'id' => 'int', - 'namespace' => 'int', - 'title' => 'str', - ); - } - - /** - * @see ORMTable::getFieldPrefix - * - * @return string - */ - protected function getFieldPrefix() { - return 'page_'; - } -} diff --git a/tests/phpunit/includes/db/TestORMRowTest.php b/tests/phpunit/includes/db/TestORMRowTest.php deleted file mode 100644 index f65642b8..00000000 --- a/tests/phpunit/includes/db/TestORMRowTest.php +++ /dev/null @@ -1,215 +0,0 @@ - - */ -require_once __DIR__ . "/ORMRowTest.php"; - -class TestORMRowTest extends ORMRowTest { - - /** - * @since 1.20 - * @return string - */ - protected function getRowClass() { - return 'TestORMRow'; - } - - /** - * @since 1.20 - * @return IORMTable - */ - protected function getTableInstance() { - return TestORMTable::singleton(); - } - - protected function setUp() { - parent::setUp(); - - $dbw = wfGetDB( DB_MASTER ); - - $isSqlite = $GLOBALS['wgDBtype'] === 'sqlite'; - $isPostgres = $GLOBALS['wgDBtype'] === 'postgres'; - - $idField = $isSqlite ? 'INTEGER' : 'INT unsigned'; - $primaryKey = $isSqlite ? 'PRIMARY KEY AUTOINCREMENT' : 'auto_increment PRIMARY KEY'; - - if ( $isPostgres ) { - $dbw->query( - 'CREATE TABLE IF NOT EXISTS ' . $dbw->tableName( 'orm_test' ) . "( - test_id serial PRIMARY KEY, - test_name TEXT NOT NULL DEFAULT '', - test_age INTEGER NOT NULL DEFAULT 0, - test_height REAL NOT NULL DEFAULT 0, - test_awesome INTEGER NOT NULL DEFAULT 0, - test_stuff BYTEA, - test_moarstuff BYTEA, - test_time TIMESTAMPTZ - );", - __METHOD__ - ); - } else { - $dbw->query( - 'CREATE TABLE IF NOT EXISTS ' . $dbw->tableName( 'orm_test' ) . '( - test_id ' . $idField . ' NOT NULL ' . $primaryKey . ', - test_name VARCHAR(255) NOT NULL, - test_age TINYINT unsigned NOT NULL, - test_height FLOAT NOT NULL, - test_awesome TINYINT unsigned NOT NULL, - test_stuff BLOB NOT NULL, - test_moarstuff BLOB NOT NULL, - test_time varbinary(14) NOT NULL - );', - __METHOD__ - ); - } - } - - protected function tearDown() { - $dbw = wfGetDB( DB_MASTER ); - $dbw->dropTable( 'orm_test', __METHOD__ ); - - parent::tearDown(); - } - - public function constructorTestProvider() { - $dbw = wfGetDB( DB_MASTER ); - return array( - array( - array( - 'name' => 'Foobar', - 'time' => $dbw->timestamp( '20120101020202' ), - 'age' => 42, - 'height' => 9000.1, - 'awesome' => true, - 'stuff' => array( 13, 11, 7, 5, 3, 2 ), - 'moarstuff' => (object)array( 'foo' => 'bar', 'bar' => array( 4, 2 ), 'baz' => true ) - ), - true - ), - ); - } - - /** - * @since 1.21 - * @return array - */ - protected function getMockValues() { - return array( - 'id' => 1, - 'str' => 'foobar4645645', - 'int' => 42, - 'float' => 4.2, - 'bool' => '', - 'array' => array( 42, 'foobar' ), - 'blob' => new stdClass() - ); - } -} - -class TestORMRow extends ORMRow { -} - -class TestORMTable extends ORMTable { - - /** - * Returns the name of the database table objects of this type are stored in. - * - * @since 1.20 - * - * @return string - */ - public function getName() { - return 'orm_test'; - } - - /** - * Returns the name of a IORMRow implementing class that - * represents single rows in this table. - * - * @since 1.20 - * - * @return string - */ - public function getRowClass() { - return 'TestORMRow'; - } - - /** - * Returns an array with the fields and their types this object contains. - * This corresponds directly to the fields in the database, without prefix. - * - * field name => type - * - * Allowed types: - * * id - * * str - * * int - * * float - * * bool - * * array - * * blob - * - * @since 1.20 - * - * @return array - */ - public function getFields() { - return array( - 'id' => 'id', - 'name' => 'str', - 'age' => 'int', - 'height' => 'float', - 'awesome' => 'bool', - 'stuff' => 'array', - 'moarstuff' => 'blob', - 'time' => 'str', // TS_MW - ); - } - - /** - * Gets the db field prefix. - * - * @since 1.20 - * - * @return string - */ - protected function getFieldPrefix() { - return 'test_'; - } -} diff --git a/tests/phpunit/includes/debug/MWDebugTest.php b/tests/phpunit/includes/debug/MWDebugTest.php deleted file mode 100644 index 6926b1c8..00000000 --- a/tests/phpunit/includes/debug/MWDebugTest.php +++ /dev/null @@ -1,72 +0,0 @@ -assertEquals( - array( array( - 'msg' => 'logging a string', - 'type' => 'log', - 'caller' => __METHOD__, - ) ), - MWDebug::getLog() - ); - } - - public function testAddWarning() { - MWDebug::warning( 'Warning message' ); - $this->assertEquals( - array( array( - 'msg' => 'Warning message', - 'type' => 'warn', - 'caller' => 'MWDebugTest::testAddWarning', - ) ), - MWDebug::getLog() - ); - } - - public function testAvoidDuplicateDeprecations() { - MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); - MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); - - // assertCount() not available on WMF integration server - $this->assertEquals( 1, - count( MWDebug::getLog() ), - "Only one deprecated warning per function should be kept" - ); - } - - public function testAvoidNonConsecutivesDuplicateDeprecations() { - MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); - MWDebug::warning( 'some warning' ); - MWDebug::log( 'we could have logged something too' ); - // Another deprecation - MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); - - // assertCount() not available on WMF integration server - $this->assertEquals( 3, - count( MWDebug::getLog() ), - "Only one deprecated warning per function should be kept" - ); - } -} diff --git a/tests/phpunit/includes/filebackend/FileBackendTest.php b/tests/phpunit/includes/filebackend/FileBackendTest.php deleted file mode 100644 index fcfa724f..00000000 --- a/tests/phpunit/includes/filebackend/FileBackendTest.php +++ /dev/null @@ -1,2306 +0,0 @@ -getCliArg( 'use-filebackend=' ) ) { - if ( self::$backendToUse ) { - $this->singleBackend = self::$backendToUse; - } else { - $name = $this->getCliArg( 'use-filebackend=' ); - $useConfig = array(); - foreach ( $wgFileBackends as $conf ) { - if ( $conf['name'] == $name ) { - $useConfig = $conf; - break; - } - } - $useConfig['name'] = 'localtesting'; // swap name - $useConfig['shardViaHashLevels'] = array( // test sharding - 'unittest-cont1' => array( 'levels' => 1, 'base' => 16, 'repeat' => 1 ) - ); - $class = $useConfig['class']; - self::$backendToUse = new $class( $useConfig ); - $this->singleBackend = self::$backendToUse; - } - } else { - $this->singleBackend = new FSFileBackend( array( - 'name' => 'localtesting', - 'lockManager' => 'fsLockManager', - #'parallelize' => 'implicit', - 'wikiId' => wfWikiID() . $uniqueId, - 'containerPaths' => array( - 'unittest-cont1' => "{$tmpPrefix}-localtesting-cont1", - 'unittest-cont2' => "{$tmpPrefix}-localtesting-cont2" ) - ) ); - } - $this->multiBackend = new FileBackendMultiWrite( array( - 'name' => 'localtesting', - 'lockManager' => 'fsLockManager', - 'parallelize' => 'implicit', - 'wikiId' => wfWikiId() . $uniqueId, - 'backends' => array( - array( - 'name' => 'localmultitesting1', - 'class' => 'FSFileBackend', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array( - 'unittest-cont1' => "{$tmpPrefix}-localtestingmulti1-cont1", - 'unittest-cont2' => "{$tmpPrefix}-localtestingmulti1-cont2" ), - 'isMultiMaster' => false - ), - array( - 'name' => 'localmultitesting2', - 'class' => 'FSFileBackend', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array( - 'unittest-cont1' => "{$tmpPrefix}-localtestingmulti2-cont1", - 'unittest-cont2' => "{$tmpPrefix}-localtestingmulti2-cont2" ), - 'isMultiMaster' => true - ) - ) - ) ); - $this->filesToPrune = array(); - } - - private static function baseStorePath() { - return 'mwstore://localtesting'; - } - - private function backendClass() { - return get_class( $this->backend ); - } - - /** - * @dataProvider provider_testIsStoragePath - * @covers FileBackend::isStoragePath - */ - public function testIsStoragePath( $path, $isStorePath ) { - $this->assertEquals( $isStorePath, FileBackend::isStoragePath( $path ), - "FileBackend::isStoragePath on path '$path'" ); - } - - public static function provider_testIsStoragePath() { - return array( - array( 'mwstore://', true ), - array( 'mwstore://backend', true ), - array( 'mwstore://backend/container', true ), - array( 'mwstore://backend/container/', true ), - array( 'mwstore://backend/container/path', true ), - array( 'mwstore://backend//container/', true ), - array( 'mwstore://backend//container//', true ), - array( 'mwstore://backend//container//path', true ), - array( 'mwstore:///', true ), - array( 'mwstore:/', false ), - array( 'mwstore:', false ), - ); - } - - /** - * @dataProvider provider_testSplitStoragePath - * @covers FileBackend::splitStoragePath - */ - public function testSplitStoragePath( $path, $res ) { - $this->assertEquals( $res, FileBackend::splitStoragePath( $path ), - "FileBackend::splitStoragePath on path '$path'" ); - } - - public static function provider_testSplitStoragePath() { - return array( - array( 'mwstore://backend/container', array( 'backend', 'container', '' ) ), - array( 'mwstore://backend/container/', array( 'backend', 'container', '' ) ), - array( 'mwstore://backend/container/path', array( 'backend', 'container', 'path' ) ), - array( 'mwstore://backend/container//path', array( 'backend', 'container', '/path' ) ), - array( 'mwstore://backend//container/path', array( null, null, null ) ), - array( 'mwstore://backend//container//path', array( null, null, null ) ), - array( 'mwstore://', array( null, null, null ) ), - array( 'mwstore://backend', array( null, null, null ) ), - array( 'mwstore:///', array( null, null, null ) ), - array( 'mwstore:/', array( null, null, null ) ), - array( 'mwstore:', array( null, null, null ) ) - ); - } - - /** - * @dataProvider provider_normalizeStoragePath - * @covers FileBackend::normalizeStoragePath - */ - public function testNormalizeStoragePath( $path, $res ) { - $this->assertEquals( $res, FileBackend::normalizeStoragePath( $path ), - "FileBackend::normalizeStoragePath on path '$path'" ); - } - - public static function provider_normalizeStoragePath() { - return array( - array( 'mwstore://backend/container', 'mwstore://backend/container' ), - array( 'mwstore://backend/container/', 'mwstore://backend/container' ), - array( 'mwstore://backend/container/path', 'mwstore://backend/container/path' ), - array( 'mwstore://backend/container//path', 'mwstore://backend/container/path' ), - array( 'mwstore://backend/container///path', 'mwstore://backend/container/path' ), - array( 'mwstore://backend/container///path//to///obj', 'mwstore://backend/container/path/to/obj' ), - array( 'mwstore://', null ), - array( 'mwstore://backend', null ), - array( 'mwstore://backend//container/path', null ), - array( 'mwstore://backend//container//path', null ), - array( 'mwstore:///', null ), - array( 'mwstore:/', null ), - array( 'mwstore:', null ), - ); - } - - /** - * @dataProvider provider_testParentStoragePath - * @covers FileBackend::parentStoragePath - */ - public function testParentStoragePath( $path, $res ) { - $this->assertEquals( $res, FileBackend::parentStoragePath( $path ), - "FileBackend::parentStoragePath on path '$path'" ); - } - - public static function provider_testParentStoragePath() { - return array( - array( 'mwstore://backend/container/path/to/obj', 'mwstore://backend/container/path/to' ), - array( 'mwstore://backend/container/path/to', 'mwstore://backend/container/path' ), - array( 'mwstore://backend/container/path', 'mwstore://backend/container' ), - array( 'mwstore://backend/container', null ), - array( 'mwstore://backend/container/path/to/obj/', 'mwstore://backend/container/path/to' ), - array( 'mwstore://backend/container/path/to/', 'mwstore://backend/container/path' ), - array( 'mwstore://backend/container/path/', 'mwstore://backend/container' ), - array( 'mwstore://backend/container/', null ), - ); - } - - /** - * @dataProvider provider_testExtensionFromPath - * @covers FileBackend::extensionFromPath - */ - public function testExtensionFromPath( $path, $res ) { - $this->assertEquals( $res, FileBackend::extensionFromPath( $path ), - "FileBackend::extensionFromPath on path '$path'" ); - } - - public static function provider_testExtensionFromPath() { - return array( - array( 'mwstore://backend/container/path.txt', 'txt' ), - array( 'mwstore://backend/container/path.svg.png', 'png' ), - array( 'mwstore://backend/container/path', '' ), - array( 'mwstore://backend/container/path.', '' ), - ); - } - - /** - * @dataProvider provider_testStore - */ - public function testStore( $op ) { - $this->filesToPrune[] = $op['src']; - - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestStore( $op ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestStore( $op ); - $this->filesToPrune[] = $op['src']; # avoid file leaking - $this->tearDownFiles(); - } - - /** - * @covers FileBackend::doOperation - */ - private function doTestStore( $op ) { - $backendName = $this->backendClass(); - - $source = $op['src']; - $dest = $op['dst']; - $this->prepare( array( 'dir' => dirname( $dest ) ) ); - - file_put_contents( $source, "Unit test file" ); - - if ( isset( $op['overwrite'] ) || isset( $op['overwriteSame'] ) ) { - $this->backend->store( $op ); - } - - $status = $this->backend->doOperation( $op ); - - $this->assertGoodStatus( $status, - "Store from $source to $dest succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Store from $source to $dest succeeded ($backendName)." ); - $this->assertEquals( array( 0 => true ), $status->success, - "Store from $source to $dest has proper 'success' field in Status ($backendName)." ); - $this->assertEquals( true, file_exists( $source ), - "Source file $source still exists ($backendName)." ); - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $dest ) ), - "Destination file $dest exists ($backendName)." ); - - $this->assertEquals( filesize( $source ), - $this->backend->getFileSize( array( 'src' => $dest ) ), - "Destination file $dest has correct size ($backendName)." ); - - $props1 = FSFile::getPropsFromPath( $source ); - $props2 = $this->backend->getFileProps( array( 'src' => $dest ) ); - $this->assertEquals( $props1, $props2, - "Source and destination have the same props ($backendName)." ); - - $this->assertBackendPathsConsistent( array( $dest ) ); - } - - public static function provider_testStore() { - $cases = array(); - - $tmpName = TempFSFile::factory( "unittests_", 'txt' )->getPath(); - $toPath = self::baseStorePath() . '/unittest-cont1/e/fun/obj1.txt'; - $op = array( 'op' => 'store', 'src' => $tmpName, 'dst' => $toPath ); - $cases[] = array( - $op, // operation - $tmpName, // source - $toPath, // dest - ); - - $op2 = $op; - $op2['overwrite'] = true; - $cases[] = array( - $op2, // operation - $tmpName, // source - $toPath, // dest - ); - - $op2 = $op; - $op2['overwriteSame'] = true; - $cases[] = array( - $op2, // operation - $tmpName, // source - $toPath, // dest - ); - - return $cases; - } - - /** - * @dataProvider provider_testCopy - * @covers FileBackend::doOperation - */ - public function testCopy( $op ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestCopy( $op ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestCopy( $op ); - $this->tearDownFiles(); - } - - private function doTestCopy( $op ) { - $backendName = $this->backendClass(); - - $source = $op['src']; - $dest = $op['dst']; - $this->prepare( array( 'dir' => dirname( $source ) ) ); - $this->prepare( array( 'dir' => dirname( $dest ) ) ); - - if ( isset( $op['ignoreMissingSource'] ) ) { - $status = $this->backend->doOperation( $op ); - $this->assertGoodStatus( $status, - "Move from $source to $dest succeeded without warnings ($backendName)." ); - $this->assertEquals( array( 0 => true ), $status->success, - "Move from $source to $dest has proper 'success' field in Status ($backendName)." ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $source ) ), - "Source file $source does not exist ($backendName)." ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $dest ) ), - "Destination file $dest does not exist ($backendName)." ); - - return; // done - } - - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => 'blahblah', 'dst' => $source ) ); - $this->assertGoodStatus( $status, - "Creation of file at $source succeeded ($backendName)." ); - - if ( isset( $op['overwrite'] ) || isset( $op['overwriteSame'] ) ) { - $this->backend->copy( $op ); - } - - $status = $this->backend->doOperation( $op ); - - $this->assertGoodStatus( $status, - "Copy from $source to $dest succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Copy from $source to $dest succeeded ($backendName)." ); - $this->assertEquals( array( 0 => true ), $status->success, - "Copy from $source to $dest has proper 'success' field in Status ($backendName)." ); - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $source ) ), - "Source file $source still exists ($backendName)." ); - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $dest ) ), - "Destination file $dest exists after copy ($backendName)." ); - - $this->assertEquals( - $this->backend->getFileSize( array( 'src' => $source ) ), - $this->backend->getFileSize( array( 'src' => $dest ) ), - "Destination file $dest has correct size ($backendName)." ); - - $props1 = $this->backend->getFileProps( array( 'src' => $source ) ); - $props2 = $this->backend->getFileProps( array( 'src' => $dest ) ); - $this->assertEquals( $props1, $props2, - "Source and destination have the same props ($backendName)." ); - - $this->assertBackendPathsConsistent( array( $source, $dest ) ); - } - - public static function provider_testCopy() { - $cases = array(); - - $source = self::baseStorePath() . '/unittest-cont1/e/file.txt'; - $dest = self::baseStorePath() . '/unittest-cont2/a/fileMoved.txt'; - - $op = array( 'op' => 'copy', 'src' => $source, 'dst' => $dest ); - $cases[] = array( - $op, // operation - $source, // source - $dest, // dest - ); - - $op2 = $op; - $op2['overwrite'] = true; - $cases[] = array( - $op2, // operation - $source, // source - $dest, // dest - ); - - $op2 = $op; - $op2['overwriteSame'] = true; - $cases[] = array( - $op2, // operation - $source, // source - $dest, // dest - ); - - $op2 = $op; - $op2['ignoreMissingSource'] = true; - $cases[] = array( - $op2, // operation - $source, // source - $dest, // dest - ); - - $op2 = $op; - $op2['ignoreMissingSource'] = true; - $cases[] = array( - $op2, // operation - self::baseStorePath() . '/unittest-cont-bad/e/file.txt', // source - $dest, // dest - ); - - return $cases; - } - - /** - * @dataProvider provider_testMove - * @covers FileBackend::doOperation - */ - public function testMove( $op ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestMove( $op ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestMove( $op ); - $this->tearDownFiles(); - } - - private function doTestMove( $op ) { - $backendName = $this->backendClass(); - - $source = $op['src']; - $dest = $op['dst']; - $this->prepare( array( 'dir' => dirname( $source ) ) ); - $this->prepare( array( 'dir' => dirname( $dest ) ) ); - - if ( isset( $op['ignoreMissingSource'] ) ) { - $status = $this->backend->doOperation( $op ); - $this->assertGoodStatus( $status, - "Move from $source to $dest succeeded without warnings ($backendName)." ); - $this->assertEquals( array( 0 => true ), $status->success, - "Move from $source to $dest has proper 'success' field in Status ($backendName)." ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $source ) ), - "Source file $source does not exist ($backendName)." ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $dest ) ), - "Destination file $dest does not exist ($backendName)." ); - - return; // done - } - - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => 'blahblah', 'dst' => $source ) ); - $this->assertGoodStatus( $status, - "Creation of file at $source succeeded ($backendName)." ); - - if ( isset( $op['overwrite'] ) || isset( $op['overwriteSame'] ) ) { - $this->backend->copy( $op ); - } - - $status = $this->backend->doOperation( $op ); - $this->assertGoodStatus( $status, - "Move from $source to $dest succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Move from $source to $dest succeeded ($backendName)." ); - $this->assertEquals( array( 0 => true ), $status->success, - "Move from $source to $dest has proper 'success' field in Status ($backendName)." ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $source ) ), - "Source file $source does not still exists ($backendName)." ); - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $dest ) ), - "Destination file $dest exists after move ($backendName)." ); - - $this->assertNotEquals( - $this->backend->getFileSize( array( 'src' => $source ) ), - $this->backend->getFileSize( array( 'src' => $dest ) ), - "Destination file $dest has correct size ($backendName)." ); - - $props1 = $this->backend->getFileProps( array( 'src' => $source ) ); - $props2 = $this->backend->getFileProps( array( 'src' => $dest ) ); - $this->assertEquals( false, $props1['fileExists'], - "Source file does not exist accourding to props ($backendName)." ); - $this->assertEquals( true, $props2['fileExists'], - "Destination file exists accourding to props ($backendName)." ); - - $this->assertBackendPathsConsistent( array( $source, $dest ) ); - } - - public static function provider_testMove() { - $cases = array(); - - $source = self::baseStorePath() . '/unittest-cont1/e/file.txt'; - $dest = self::baseStorePath() . '/unittest-cont2/a/fileMoved.txt'; - - $op = array( 'op' => 'move', 'src' => $source, 'dst' => $dest ); - $cases[] = array( - $op, // operation - $source, // source - $dest, // dest - ); - - $op2 = $op; - $op2['overwrite'] = true; - $cases[] = array( - $op2, // operation - $source, // source - $dest, // dest - ); - - $op2 = $op; - $op2['overwriteSame'] = true; - $cases[] = array( - $op2, // operation - $source, // source - $dest, // dest - ); - - $op2 = $op; - $op2['ignoreMissingSource'] = true; - $cases[] = array( - $op2, // operation - $source, // source - $dest, // dest - ); - - $op2 = $op; - $op2['ignoreMissingSource'] = true; - $cases[] = array( - $op2, // operation - self::baseStorePath() . '/unittest-cont-bad/e/file.txt', // source - $dest, // dest - ); - - return $cases; - } - - /** - * @dataProvider provider_testDelete - * @covers FileBackend::doOperation - */ - public function testDelete( $op, $withSource, $okStatus ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestDelete( $op, $withSource, $okStatus ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestDelete( $op, $withSource, $okStatus ); - $this->tearDownFiles(); - } - - private function doTestDelete( $op, $withSource, $okStatus ) { - $backendName = $this->backendClass(); - - $source = $op['src']; - $this->prepare( array( 'dir' => dirname( $source ) ) ); - - if ( $withSource ) { - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => 'blahblah', 'dst' => $source ) ); - $this->assertGoodStatus( $status, - "Creation of file at $source succeeded ($backendName)." ); - } - - $status = $this->backend->doOperation( $op ); - if ( $okStatus ) { - $this->assertGoodStatus( $status, - "Deletion of file at $source succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Deletion of file at $source succeeded ($backendName)." ); - $this->assertEquals( array( 0 => true ), $status->success, - "Deletion of file at $source has proper 'success' field in Status ($backendName)." ); - } else { - $this->assertEquals( false, $status->isOK(), - "Deletion of file at $source failed ($backendName)." ); - } - - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $source ) ), - "Source file $source does not exist after move ($backendName)." ); - - $this->assertFalse( - $this->backend->getFileSize( array( 'src' => $source ) ), - "Source file $source has correct size (false) ($backendName)." ); - - $props1 = $this->backend->getFileProps( array( 'src' => $source ) ); - $this->assertFalse( $props1['fileExists'], - "Source file $source does not exist according to props ($backendName)." ); - - $this->assertBackendPathsConsistent( array( $source ) ); - } - - public static function provider_testDelete() { - $cases = array(); - - $source = self::baseStorePath() . '/unittest-cont1/e/myfacefile.txt'; - - $op = array( 'op' => 'delete', 'src' => $source ); - $cases[] = array( - $op, // operation - true, // with source - true // succeeds - ); - - $cases[] = array( - $op, // operation - false, // without source - false // fails - ); - - $op['ignoreMissingSource'] = true; - $cases[] = array( - $op, // operation - false, // without source - true // succeeds - ); - - $op['ignoreMissingSource'] = true; - $op['src'] = self::baseStorePath() . '/unittest-cont-bad/e/file.txt'; - $cases[] = array( - $op, // operation - false, // without source - true // succeeds - ); - - return $cases; - } - - /** - * @dataProvider provider_testDescribe - * @covers FileBackend::doOperation - */ - public function testDescribe( $op, $withSource, $okStatus ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestDescribe( $op, $withSource, $okStatus ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestDescribe( $op, $withSource, $okStatus ); - $this->tearDownFiles(); - } - - private function doTestDescribe( $op, $withSource, $okStatus ) { - $backendName = $this->backendClass(); - - $source = $op['src']; - $this->prepare( array( 'dir' => dirname( $source ) ) ); - - if ( $withSource ) { - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => 'blahblah', 'dst' => $source ) ); - $this->assertGoodStatus( $status, - "Creation of file at $source succeeded ($backendName)." ); - } - - $status = $this->backend->doOperation( $op ); - if ( $okStatus ) { - $this->assertGoodStatus( $status, - "Describe of file at $source succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Describe of file at $source succeeded ($backendName)." ); - $this->assertEquals( array( 0 => true ), $status->success, - "Describe of file at $source has proper 'success' field in Status ($backendName)." ); - } else { - $this->assertEquals( false, $status->isOK(), - "Describe of file at $source failed ($backendName)." ); - } - - $this->assertBackendPathsConsistent( array( $source ) ); - } - - public static function provider_testDescribe() { - $cases = array(); - - $source = self::baseStorePath() . '/unittest-cont1/e/myfacefile.txt'; - - $op = array( 'op' => 'describe', 'src' => $source, - 'headers' => array( 'X-Content-Length' => '91.3', 'Content-Old-Header' => '' ), - 'disposition' => 'inline' ); - $cases[] = array( - $op, // operation - true, // with source - true // succeeds - ); - - $cases[] = array( - $op, // operation - false, // without source - false // fails - ); - - return $cases; - } - - /** - * @dataProvider provider_testCreate - * @covers FileBackend::doOperation - */ - public function testCreate( $op, $alreadyExists, $okStatus, $newSize ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestCreate( $op, $alreadyExists, $okStatus, $newSize ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestCreate( $op, $alreadyExists, $okStatus, $newSize ); - $this->tearDownFiles(); - } - - private function doTestCreate( $op, $alreadyExists, $okStatus, $newSize ) { - $backendName = $this->backendClass(); - - $dest = $op['dst']; - $this->prepare( array( 'dir' => dirname( $dest ) ) ); - - $oldText = 'blah...blah...waahwaah'; - if ( $alreadyExists ) { - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => $oldText, 'dst' => $dest ) ); - $this->assertGoodStatus( $status, - "Creation of file at $dest succeeded ($backendName)." ); - } - - $status = $this->backend->doOperation( $op ); - if ( $okStatus ) { - $this->assertGoodStatus( $status, - "Creation of file at $dest succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Creation of file at $dest succeeded ($backendName)." ); - $this->assertEquals( array( 0 => true ), $status->success, - "Creation of file at $dest has proper 'success' field in Status ($backendName)." ); - } else { - $this->assertEquals( false, $status->isOK(), - "Creation of file at $dest failed ($backendName)." ); - } - - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $dest ) ), - "Destination file $dest exists after creation ($backendName)." ); - - $props1 = $this->backend->getFileProps( array( 'src' => $dest ) ); - $this->assertEquals( true, $props1['fileExists'], - "Destination file $dest exists according to props ($backendName)." ); - if ( $okStatus ) { // file content is what we saved - $this->assertEquals( $newSize, $props1['size'], - "Destination file $dest has expected size according to props ($backendName)." ); - $this->assertEquals( $newSize, - $this->backend->getFileSize( array( 'src' => $dest ) ), - "Destination file $dest has correct size ($backendName)." ); - } else { // file content is some other previous text - $this->assertEquals( strlen( $oldText ), $props1['size'], - "Destination file $dest has original size according to props ($backendName)." ); - $this->assertEquals( strlen( $oldText ), - $this->backend->getFileSize( array( 'src' => $dest ) ), - "Destination file $dest has original size according to props ($backendName)." ); - } - - $this->assertBackendPathsConsistent( array( $dest ) ); - } - - /** - * @dataProvider provider_testCreate - */ - public static function provider_testCreate() { - $cases = array(); - - $dest = self::baseStorePath() . '/unittest-cont2/a/myspacefile.txt'; - - $op = array( 'op' => 'create', 'content' => 'test test testing', 'dst' => $dest ); - $cases[] = array( - $op, // operation - false, // no dest already exists - true, // succeeds - strlen( $op['content'] ) - ); - - $op2 = $op; - $op2['content'] = "\n"; - $cases[] = array( - $op2, // operation - false, // no dest already exists - true, // succeeds - strlen( $op2['content'] ) - ); - - $op2 = $op; - $op2['content'] = "fsf\n waf 3kt"; - $cases[] = array( - $op2, // operation - true, // dest already exists - false, // fails - strlen( $op2['content'] ) - ); - - $op2 = $op; - $op2['content'] = "egm'g gkpe gpqg eqwgwqg"; - $op2['overwrite'] = true; - $cases[] = array( - $op2, // operation - true, // dest already exists - true, // succeeds - strlen( $op2['content'] ) - ); - - $op2 = $op; - $op2['content'] = "39qjmg3-qg"; - $op2['overwriteSame'] = true; - $cases[] = array( - $op2, // operation - true, // dest already exists - false, // succeeds - strlen( $op2['content'] ) - ); - - return $cases; - } - - /** - * @covers FileBackend::doQuickOperations - */ - public function testDoQuickOperations() { - $this->backend = $this->singleBackend; - $this->doTestDoQuickOperations(); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->doTestDoQuickOperations(); - $this->tearDownFiles(); - } - - private function doTestDoQuickOperations() { - $backendName = $this->backendClass(); - - $base = self::baseStorePath(); - $files = array( - "$base/unittest-cont1/e/fileA.a", - "$base/unittest-cont1/e/fileB.a", - "$base/unittest-cont1/e/fileC.a" - ); - $createOps = array(); - $purgeOps = array(); - foreach ( $files as $path ) { - $status = $this->prepare( array( 'dir' => dirname( $path ) ) ); - $this->assertGoodStatus( $status, - "Preparing $path succeeded without warnings ($backendName)." ); - $createOps[] = array( 'op' => 'create', 'dst' => $path, 'content' => mt_rand( 0, 50000 ) ); - $copyOps[] = array( 'op' => 'copy', 'src' => $path, 'dst' => "$path-2" ); - $moveOps[] = array( 'op' => 'move', 'src' => "$path-2", 'dst' => "$path-3" ); - $purgeOps[] = array( 'op' => 'delete', 'src' => $path ); - $purgeOps[] = array( 'op' => 'delete', 'src' => "$path-3" ); - } - $purgeOps[] = array( 'op' => 'null' ); - - $this->assertGoodStatus( - $this->backend->doQuickOperations( $createOps ), - "Creation of source files succeeded ($backendName)." ); - foreach ( $files as $file ) { - $this->assertTrue( $this->backend->fileExists( array( 'src' => $file ) ), - "File $file exists." ); - } - - $this->assertGoodStatus( - $this->backend->doQuickOperations( $copyOps ), - "Quick copy of source files succeeded ($backendName)." ); - foreach ( $files as $file ) { - $this->assertTrue( $this->backend->fileExists( array( 'src' => "$file-2" ) ), - "File $file-2 exists." ); - } - - $this->assertGoodStatus( - $this->backend->doQuickOperations( $moveOps ), - "Quick move of source files succeeded ($backendName)." ); - foreach ( $files as $file ) { - $this->assertTrue( $this->backend->fileExists( array( 'src' => "$file-3" ) ), - "File $file-3 move in." ); - $this->assertFalse( $this->backend->fileExists( array( 'src' => "$file-2" ) ), - "File $file-2 moved away." ); - } - - $this->assertGoodStatus( - $this->backend->quickCopy( array( 'src' => $files[0], 'dst' => $files[0] ) ), - "Copy of file {$files[0]} over itself succeeded ($backendName)." ); - $this->assertTrue( $this->backend->fileExists( array( 'src' => $files[0] ) ), - "File {$files[0]} still exists." ); - - $this->assertGoodStatus( - $this->backend->quickMove( array( 'src' => $files[0], 'dst' => $files[0] ) ), - "Move of file {$files[0]} over itself succeeded ($backendName)." ); - $this->assertTrue( $this->backend->fileExists( array( 'src' => $files[0] ) ), - "File {$files[0]} still exists." ); - - $this->assertGoodStatus( - $this->backend->doQuickOperations( $purgeOps ), - "Quick deletion of source files succeeded ($backendName)." ); - foreach ( $files as $file ) { - $this->assertFalse( $this->backend->fileExists( array( 'src' => $file ) ), - "File $file purged." ); - $this->assertFalse( $this->backend->fileExists( array( 'src' => "$file-3" ) ), - "File $file-3 purged." ); - } - } - - /** - * @dataProvider provider_testConcatenate - */ - public function testConcatenate( $op, $srcs, $srcsContent, $alreadyExists, $okStatus ) { - $this->filesToPrune[] = $op['dst']; - - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestConcatenate( $op, $srcs, $srcsContent, $alreadyExists, $okStatus ); - $this->filesToPrune[] = $op['dst']; # avoid file leaking - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestConcatenate( $op, $srcs, $srcsContent, $alreadyExists, $okStatus ); - $this->filesToPrune[] = $op['dst']; # avoid file leaking - $this->tearDownFiles(); - } - - private function doTestConcatenate( $params, $srcs, $srcsContent, $alreadyExists, $okStatus ) { - $backendName = $this->backendClass(); - - $expContent = ''; - // Create sources - $ops = array(); - foreach ( $srcs as $i => $source ) { - $this->prepare( array( 'dir' => dirname( $source ) ) ); - $ops[] = array( - 'op' => 'create', // operation - 'dst' => $source, // source - 'content' => $srcsContent[$i] - ); - $expContent .= $srcsContent[$i]; - } - $status = $this->backend->doOperations( $ops ); - - $this->assertGoodStatus( $status, - "Creation of source files succeeded ($backendName)." ); - - $dest = $params['dst']; - if ( $alreadyExists ) { - $ok = file_put_contents( $dest, 'blah...blah...waahwaah' ) !== false; - $this->assertEquals( true, $ok, - "Creation of file at $dest succeeded ($backendName)." ); - } else { - $ok = file_put_contents( $dest, '' ) !== false; - $this->assertEquals( true, $ok, - "Creation of 0-byte file at $dest succeeded ($backendName)." ); - } - - // Combine the files into one - $status = $this->backend->concatenate( $params ); - if ( $okStatus ) { - $this->assertGoodStatus( $status, - "Creation of concat file at $dest succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Creation of concat file at $dest succeeded ($backendName)." ); - } else { - $this->assertEquals( false, $status->isOK(), - "Creation of concat file at $dest failed ($backendName)." ); - } - - if ( $okStatus ) { - $this->assertEquals( true, is_file( $dest ), - "Dest concat file $dest exists after creation ($backendName)." ); - } else { - $this->assertEquals( true, is_file( $dest ), - "Dest concat file $dest exists after failed creation ($backendName)." ); - } - - $contents = file_get_contents( $dest ); - $this->assertNotEquals( false, $contents, "File at $dest exists ($backendName)." ); - - if ( $okStatus ) { - $this->assertEquals( $expContent, $contents, - "Concat file at $dest has correct contents ($backendName)." ); - } else { - $this->assertNotEquals( $expContent, $contents, - "Concat file at $dest has correct contents ($backendName)." ); - } - } - - public static function provider_testConcatenate() { - $cases = array(); - - $rand = mt_rand( 0, 2000000000 ) . time(); - $dest = wfTempDir() . "/randomfile!$rand.txt"; - $srcs = array( - self::baseStorePath() . '/unittest-cont1/e/file1.txt', - self::baseStorePath() . '/unittest-cont1/e/file2.txt', - self::baseStorePath() . '/unittest-cont1/e/file3.txt', - self::baseStorePath() . '/unittest-cont1/e/file4.txt', - self::baseStorePath() . '/unittest-cont1/e/file5.txt', - self::baseStorePath() . '/unittest-cont1/e/file6.txt', - self::baseStorePath() . '/unittest-cont1/e/file7.txt', - self::baseStorePath() . '/unittest-cont1/e/file8.txt', - self::baseStorePath() . '/unittest-cont1/e/file9.txt', - self::baseStorePath() . '/unittest-cont1/e/file10.txt' - ); - $content = array( - 'egfage', - 'ageageag', - 'rhokohlr', - 'shgmslkg', - 'kenga', - 'owagmal', - 'kgmae', - 'g eak;g', - 'lkaem;a', - 'legma' - ); - $params = array( 'srcs' => $srcs, 'dst' => $dest ); - - $cases[] = array( - $params, // operation - $srcs, // sources - $content, // content for each source - false, // no dest already exists - true, // succeeds - ); - - $cases[] = array( - $params, // operation - $srcs, // sources - $content, // content for each source - true, // dest already exists - false, // succeeds - ); - - return $cases; - } - - /** - * @dataProvider provider_testGetFileStat - * @covers FileBackend::getFileStat - */ - public function testGetFileStat( $path, $content, $alreadyExists ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestGetFileStat( $path, $content, $alreadyExists ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestGetFileStat( $path, $content, $alreadyExists ); - $this->tearDownFiles(); - } - - private function doTestGetFileStat( $path, $content, $alreadyExists ) { - $backendName = $this->backendClass(); - - if ( $alreadyExists ) { - $this->prepare( array( 'dir' => dirname( $path ) ) ); - $status = $this->create( array( 'dst' => $path, 'content' => $content ) ); - $this->assertGoodStatus( $status, - "Creation of file at $path succeeded ($backendName)." ); - - $size = $this->backend->getFileSize( array( 'src' => $path ) ); - $time = $this->backend->getFileTimestamp( array( 'src' => $path ) ); - $stat = $this->backend->getFileStat( array( 'src' => $path ) ); - - $this->assertEquals( strlen( $content ), $size, - "Correct file size of '$path'" ); - $this->assertTrue( abs( time() - wfTimestamp( TS_UNIX, $time ) ) < 10, - "Correct file timestamp of '$path'" ); - - $size = $stat['size']; - $time = $stat['mtime']; - $this->assertEquals( strlen( $content ), $size, - "Correct file size of '$path'" ); - $this->assertTrue( abs( time() - wfTimestamp( TS_UNIX, $time ) ) < 10, - "Correct file timestamp of '$path'" ); - - $this->backend->clearCache( array( $path ) ); - - $size = $this->backend->getFileSize( array( 'src' => $path ) ); - - $this->assertEquals( strlen( $content ), $size, - "Correct file size of '$path'" ); - - $this->backend->preloadCache( array( $path ) ); - - $size = $this->backend->getFileSize( array( 'src' => $path ) ); - - $this->assertEquals( strlen( $content ), $size, - "Correct file size of '$path'" ); - } else { - $size = $this->backend->getFileSize( array( 'src' => $path ) ); - $time = $this->backend->getFileTimestamp( array( 'src' => $path ) ); - $stat = $this->backend->getFileStat( array( 'src' => $path ) ); - - $this->assertFalse( $size, "Correct file size of '$path'" ); - $this->assertFalse( $time, "Correct file timestamp of '$path'" ); - $this->assertFalse( $stat, "Correct file stat of '$path'" ); - } - } - - public static function provider_testGetFileStat() { - $cases = array(); - - $base = self::baseStorePath(); - $cases[] = array( "$base/unittest-cont1/e/b/z/some_file.txt", "some file contents", true ); - $cases[] = array( "$base/unittest-cont1/e/b/some-other_file.txt", "", true ); - $cases[] = array( "$base/unittest-cont1/e/b/some-diff_file.txt", null, false ); - - return $cases; - } - - /** - * @dataProvider provider_testGetFileContents - * @covers FileBackend::getFileContents - * @covers FileBackend::getFileContentsMulti - */ - public function testGetFileContents( $source, $content ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestGetFileContents( $source, $content ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestGetFileContents( $source, $content ); - $this->tearDownFiles(); - } - - private function doTestGetFileContents( $source, $content ) { - $backendName = $this->backendClass(); - - $srcs = (array)$source; - $content = (array)$content; - foreach ( $srcs as $i => $src ) { - $this->prepare( array( 'dir' => dirname( $src ) ) ); - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => $content[$i], 'dst' => $src ) ); - $this->assertGoodStatus( $status, - "Creation of file at $src succeeded ($backendName)." ); - } - - if ( is_array( $source ) ) { - $contents = $this->backend->getFileContentsMulti( array( 'srcs' => $source ) ); - foreach ( $contents as $path => $data ) { - $this->assertNotEquals( false, $data, "Contents of $path exists ($backendName)." ); - $this->assertEquals( current( $content ), $data, "Contents of $path is correct ($backendName)." ); - next( $content ); - } - $this->assertEquals( $source, array_keys( $contents ), "Contents in right order ($backendName)." ); - $this->assertEquals( count( $source ), count( $contents ), "Contents array size correct ($backendName)." ); - } else { - $data = $this->backend->getFileContents( array( 'src' => $source ) ); - $this->assertNotEquals( false, $data, "Contents of $source exists ($backendName)." ); - $this->assertEquals( $content[0], $data, "Contents of $source is correct ($backendName)." ); - } - } - - public static function provider_testGetFileContents() { - $cases = array(); - - $base = self::baseStorePath(); - $cases[] = array( "$base/unittest-cont1/e/b/z/some_file.txt", "some file contents" ); - $cases[] = array( "$base/unittest-cont1/e/b/some-other_file.txt", "more file contents" ); - $cases[] = array( - array( "$base/unittest-cont1/e/a/x.txt", "$base/unittest-cont1/e/a/y.txt", - "$base/unittest-cont1/e/a/z.txt" ), - array( "contents xx", "contents xy", "contents xz" ) - ); - - return $cases; - } - - /** - * @dataProvider provider_testGetLocalCopy - * @covers FileBackend::getLocalCopy - */ - public function testGetLocalCopy( $source, $content ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestGetLocalCopy( $source, $content ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestGetLocalCopy( $source, $content ); - $this->tearDownFiles(); - } - - private function doTestGetLocalCopy( $source, $content ) { - $backendName = $this->backendClass(); - - $srcs = (array)$source; - $content = (array)$content; - foreach ( $srcs as $i => $src ) { - $this->prepare( array( 'dir' => dirname( $src ) ) ); - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => $content[$i], 'dst' => $src ) ); - $this->assertGoodStatus( $status, - "Creation of file at $src succeeded ($backendName)." ); - } - - if ( is_array( $source ) ) { - $tmpFiles = $this->backend->getLocalCopyMulti( array( 'srcs' => $source ) ); - foreach ( $tmpFiles as $path => $tmpFile ) { - $this->assertNotNull( $tmpFile, - "Creation of local copy of $path succeeded ($backendName)." ); - $contents = file_get_contents( $tmpFile->getPath() ); - $this->assertNotEquals( false, $contents, "Local copy of $path exists ($backendName)." ); - $this->assertEquals( current( $content ), $contents, "Local copy of $path is correct ($backendName)." ); - next( $content ); - } - $this->assertEquals( $source, array_keys( $tmpFiles ), "Local copies in right order ($backendName)." ); - $this->assertEquals( count( $source ), count( $tmpFiles ), "Local copies array size correct ($backendName)." ); - } else { - $tmpFile = $this->backend->getLocalCopy( array( 'src' => $source ) ); - $this->assertNotNull( $tmpFile, - "Creation of local copy of $source succeeded ($backendName)." ); - $contents = file_get_contents( $tmpFile->getPath() ); - $this->assertNotEquals( false, $contents, "Local copy of $source exists ($backendName)." ); - $this->assertEquals( $content[0], $contents, "Local copy of $source is correct ($backendName)." ); - } - - $obj = new stdClass(); - $tmpFile->bind( $obj ); - } - - public static function provider_testGetLocalCopy() { - $cases = array(); - - $base = self::baseStorePath(); - $cases[] = array( "$base/unittest-cont1/e/a/z/some_file.txt", "some file contents" ); - $cases[] = array( "$base/unittest-cont1/e/a/some-other_file.txt", "more file contents" ); - $cases[] = array( "$base/unittest-cont1/e/a/\$odd&.txt", "test file contents" ); - $cases[] = array( - array( "$base/unittest-cont1/e/a/x.txt", "$base/unittest-cont1/e/a/y.txt", - "$base/unittest-cont1/e/a/z.txt" ), - array( "contents xx", "contents xy", "contents xz" ) - ); - - return $cases; - } - - /** - * @dataProvider provider_testGetLocalReference - * @covers FileBackend::getLocalReference - */ - public function testGetLocalReference( $source, $content ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestGetLocalReference( $source, $content ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestGetLocalReference( $source, $content ); - $this->tearDownFiles(); - } - - private function doTestGetLocalReference( $source, $content ) { - $backendName = $this->backendClass(); - - $srcs = (array)$source; - $content = (array)$content; - foreach ( $srcs as $i => $src ) { - $this->prepare( array( 'dir' => dirname( $src ) ) ); - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => $content[$i], 'dst' => $src ) ); - $this->assertGoodStatus( $status, - "Creation of file at $src succeeded ($backendName)." ); - } - - if ( is_array( $source ) ) { - $tmpFiles = $this->backend->getLocalReferenceMulti( array( 'srcs' => $source ) ); - foreach ( $tmpFiles as $path => $tmpFile ) { - $this->assertNotNull( $tmpFile, - "Creation of local copy of $path succeeded ($backendName)." ); - $contents = file_get_contents( $tmpFile->getPath() ); - $this->assertNotEquals( false, $contents, "Local ref of $path exists ($backendName)." ); - $this->assertEquals( current( $content ), $contents, "Local ref of $path is correct ($backendName)." ); - next( $content ); - } - $this->assertEquals( $source, array_keys( $tmpFiles ), "Local refs in right order ($backendName)." ); - $this->assertEquals( count( $source ), count( $tmpFiles ), "Local refs array size correct ($backendName)." ); - } else { - $tmpFile = $this->backend->getLocalReference( array( 'src' => $source ) ); - $this->assertNotNull( $tmpFile, - "Creation of local copy of $source succeeded ($backendName)." ); - $contents = file_get_contents( $tmpFile->getPath() ); - $this->assertNotEquals( false, $contents, "Local ref of $source exists ($backendName)." ); - $this->assertEquals( $content[0], $contents, "Local ref of $source is correct ($backendName)." ); - } - } - - public static function provider_testGetLocalReference() { - $cases = array(); - - $base = self::baseStorePath(); - $cases[] = array( "$base/unittest-cont1/e/a/z/some_file.txt", "some file contents" ); - $cases[] = array( "$base/unittest-cont1/e/a/some-other_file.txt", "more file contents" ); - $cases[] = array( "$base/unittest-cont1/e/a/\$odd&.txt", "test file contents" ); - $cases[] = array( - array( "$base/unittest-cont1/e/a/x.txt", "$base/unittest-cont1/e/a/y.txt", - "$base/unittest-cont1/e/a/z.txt" ), - array( "contents xx", "contents xy", "contents xz" ) - ); - - return $cases; - } - - /** - * @covers FileBackend::getLocalCopy - * @covers FileBackend::getLocalReference - */ - public function testGetLocalCopyAndReference404() { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestGetLocalCopyAndReference404(); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestGetLocalCopyAndReference404(); - $this->tearDownFiles(); - } - - public function doTestGetLocalCopyAndReference404() { - $backendName = $this->backendClass(); - - $base = self::baseStorePath(); - - $tmpFile = $this->backend->getLocalCopy( array( - 'src' => "$base/unittest-cont1/not-there" ) ); - $this->assertEquals( null, $tmpFile, "Local copy of not existing file is null ($backendName)." ); - - $tmpFile = $this->backend->getLocalReference( array( - 'src' => "$base/unittest-cont1/not-there" ) ); - $this->assertEquals( null, $tmpFile, "Local ref of not existing file is null ($backendName)." ); - } - - /** - * @dataProvider provider_testGetFileHttpUrl - * @covers FileBackend::getFileHttpUrl - */ - public function testGetFileHttpUrl( $source, $content ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestGetFileHttpUrl( $source, $content ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestGetFileHttpUrl( $source, $content ); - $this->tearDownFiles(); - } - - private function doTestGetFileHttpUrl( $source, $content ) { - $backendName = $this->backendClass(); - - $this->prepare( array( 'dir' => dirname( $source ) ) ); - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => $content, 'dst' => $source ) ); - $this->assertGoodStatus( $status, - "Creation of file at $source succeeded ($backendName)." ); - - $url = $this->backend->getFileHttpUrl( array( 'src' => $source ) ); - - if ( $url !== null ) { // supported - $data = Http::request( "GET", $url ); - $this->assertEquals( $content, $data, - "HTTP GET of URL has right contents ($backendName)." ); - } - } - - public static function provider_testGetFileHttpUrl() { - $cases = array(); - - $base = self::baseStorePath(); - $cases[] = array( "$base/unittest-cont1/e/a/z/some_file.txt", "some file contents" ); - $cases[] = array( "$base/unittest-cont1/e/a/some-other_file.txt", "more file contents" ); - $cases[] = array( "$base/unittest-cont1/e/a/\$odd&.txt", "test file contents" ); - - return $cases; - } - - /** - * @dataProvider provider_testPrepareAndClean - * @covers FileBackend::prepare - * @covers FileBackend::clean - */ - public function testPrepareAndClean( $path, $isOK ) { - $this->backend = $this->singleBackend; - $this->doTestPrepareAndClean( $path, $isOK ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->doTestPrepareAndClean( $path, $isOK ); - $this->tearDownFiles(); - } - - public static function provider_testPrepareAndClean() { - $base = self::baseStorePath(); - - return array( - array( "$base/unittest-cont1/e/a/z/some_file1.txt", true ), - array( "$base/unittest-cont2/a/z/some_file2.txt", true ), - # Specific to FS backend with no basePath field set - #array( "$base/unittest-cont3/a/z/some_file3.txt", false ), - ); - } - - private function doTestPrepareAndClean( $path, $isOK ) { - $backendName = $this->backendClass(); - - $status = $this->prepare( array( 'dir' => dirname( $path ) ) ); - if ( $isOK ) { - $this->assertGoodStatus( $status, - "Preparing dir $path succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Preparing dir $path succeeded ($backendName)." ); - } else { - $this->assertEquals( false, $status->isOK(), - "Preparing dir $path failed ($backendName)." ); - } - - $status = $this->backend->clean( array( 'dir' => dirname( $path ) ) ); - if ( $isOK ) { - $this->assertGoodStatus( $status, - "Cleaning dir $path succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Cleaning dir $path succeeded ($backendName)." ); - } else { - $this->assertEquals( false, $status->isOK(), - "Cleaning dir $path failed ($backendName)." ); - } - } - - public function testRecursiveClean() { - $this->backend = $this->singleBackend; - $this->doTestRecursiveClean(); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->doTestRecursiveClean(); - $this->tearDownFiles(); - } - - /** - * @covers FileBackend::clean - */ - private function doTestRecursiveClean() { - $backendName = $this->backendClass(); - - $base = self::baseStorePath(); - $dirs = array( - "$base/unittest-cont1", - "$base/unittest-cont1/e", - "$base/unittest-cont1/e/a", - "$base/unittest-cont1/e/a/b", - "$base/unittest-cont1/e/a/b/c", - "$base/unittest-cont1/e/a/b/c/d0", - "$base/unittest-cont1/e/a/b/c/d1", - "$base/unittest-cont1/e/a/b/c/d2", - "$base/unittest-cont1/e/a/b/c/d0/1", - "$base/unittest-cont1/e/a/b/c/d0/2", - "$base/unittest-cont1/e/a/b/c/d1/3", - "$base/unittest-cont1/e/a/b/c/d1/4", - "$base/unittest-cont1/e/a/b/c/d2/5", - "$base/unittest-cont1/e/a/b/c/d2/6" - ); - foreach ( $dirs as $dir ) { - $status = $this->prepare( array( 'dir' => $dir ) ); - $this->assertGoodStatus( $status, - "Preparing dir $dir succeeded without warnings ($backendName)." ); - } - - if ( $this->backend instanceof FSFileBackend ) { - foreach ( $dirs as $dir ) { - $this->assertEquals( true, $this->backend->directoryExists( array( 'dir' => $dir ) ), - "Dir $dir exists ($backendName)." ); - } - } - - $status = $this->backend->clean( - array( 'dir' => "$base/unittest-cont1", 'recursive' => 1 ) ); - $this->assertGoodStatus( $status, - "Recursive cleaning of dir $dir succeeded without warnings ($backendName)." ); - - foreach ( $dirs as $dir ) { - $this->assertEquals( false, $this->backend->directoryExists( array( 'dir' => $dir ) ), - "Dir $dir no longer exists ($backendName)." ); - } - } - - // @todo testSecure - - /** - * @covers FileBackend::doOperations - */ - public function testDoOperations() { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestDoOperations(); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestDoOperations(); - $this->tearDownFiles(); - } - - private function doTestDoOperations() { - $base = self::baseStorePath(); - - $fileA = "$base/unittest-cont1/e/a/b/fileA.txt"; - $fileAContents = '3tqtmoeatmn4wg4qe-mg3qt3 tq'; - $fileB = "$base/unittest-cont1/e/a/b/fileB.txt"; - $fileBContents = 'g-jmq3gpqgt3qtg q3GT '; - $fileC = "$base/unittest-cont1/e/a/b/fileC.txt"; - $fileCContents = 'eigna[ogmewt 3qt g3qg flew[ag'; - $fileD = "$base/unittest-cont1/e/a/b/fileD.txt"; - - $this->prepare( array( 'dir' => dirname( $fileA ) ) ); - $this->create( array( 'dst' => $fileA, 'content' => $fileAContents ) ); - $this->prepare( array( 'dir' => dirname( $fileB ) ) ); - $this->create( array( 'dst' => $fileB, 'content' => $fileBContents ) ); - $this->prepare( array( 'dir' => dirname( $fileC ) ) ); - $this->create( array( 'dst' => $fileC, 'content' => $fileCContents ) ); - $this->prepare( array( 'dir' => dirname( $fileD ) ) ); - - $status = $this->backend->doOperations( array( - array( 'op' => 'describe', 'src' => $fileA, - 'headers' => array( 'X-Content-Length' => '91.3' ), 'disposition' => 'inline' ), - array( 'op' => 'copy', 'src' => $fileA, 'dst' => $fileC, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: (file:) - array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileA, 'overwriteSame' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileD, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileB, 'dst' => $fileC ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileD, 'dst' => $fileA, 'overwriteSame' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileA, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'copy', 'src' => $fileA, 'dst' => $fileC ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileA, 'dst' => $fileC, 'overwriteSame' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileC, 'overwrite' => 1 ), - // Does nothing - array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileC, 'overwriteSame' => 1 ), - // Does nothing - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileC, 'overwrite' => 1 ), - // Does nothing - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileC, 'overwriteSame' => 1 ), - // Does nothing - array( 'op' => 'null' ), - // Does nothing - ) ); - - $this->assertGoodStatus( $status, "Operation batch succeeded" ); - $this->assertEquals( true, $status->isOK(), "Operation batch succeeded" ); - $this->assertEquals( 14, count( $status->success ), - "Operation batch has correct success array" ); - - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $fileA ) ), - "File does not exist at $fileA" ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $fileB ) ), - "File does not exist at $fileB" ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $fileD ) ), - "File does not exist at $fileD" ); - - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $fileC ) ), - "File exists at $fileC" ); - $this->assertEquals( $fileBContents, - $this->backend->getFileContents( array( 'src' => $fileC ) ), - "Correct file contents of $fileC" ); - $this->assertEquals( strlen( $fileBContents ), - $this->backend->getFileSize( array( 'src' => $fileC ) ), - "Correct file size of $fileC" ); - $this->assertEquals( wfBaseConvert( sha1( $fileBContents ), 16, 36, 31 ), - $this->backend->getFileSha1Base36( array( 'src' => $fileC ) ), - "Correct file SHA-1 of $fileC" ); - } - - /** - * @covers FileBackend::doOperations - */ - public function testDoOperationsPipeline() { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestDoOperationsPipeline(); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestDoOperationsPipeline(); - $this->tearDownFiles(); - } - - // concurrency orientated - private function doTestDoOperationsPipeline() { - $base = self::baseStorePath(); - - $fileAContents = '3tqtmoeatmn4wg4qe-mg3qt3 tq'; - $fileBContents = 'g-jmq3gpqgt3qtg q3GT '; - $fileCContents = 'eigna[ogmewt 3qt g3qg flew[ag'; - - $tmpNameA = TempFSFile::factory( "unittests_", 'txt' )->getPath(); - file_put_contents( $tmpNameA, $fileAContents ); - $tmpNameB = TempFSFile::factory( "unittests_", 'txt' )->getPath(); - file_put_contents( $tmpNameB, $fileBContents ); - $tmpNameC = TempFSFile::factory( "unittests_", 'txt' )->getPath(); - file_put_contents( $tmpNameC, $fileCContents ); - - $this->filesToPrune[] = $tmpNameA; # avoid file leaking - $this->filesToPrune[] = $tmpNameB; # avoid file leaking - $this->filesToPrune[] = $tmpNameC; # avoid file leaking - - $fileA = "$base/unittest-cont1/e/a/b/fileA.txt"; - $fileB = "$base/unittest-cont1/e/a/b/fileB.txt"; - $fileC = "$base/unittest-cont1/e/a/b/fileC.txt"; - $fileD = "$base/unittest-cont1/e/a/b/fileD.txt"; - - $this->prepare( array( 'dir' => dirname( $fileA ) ) ); - $this->create( array( 'dst' => $fileA, 'content' => $fileAContents ) ); - $this->prepare( array( 'dir' => dirname( $fileB ) ) ); - $this->prepare( array( 'dir' => dirname( $fileC ) ) ); - $this->prepare( array( 'dir' => dirname( $fileD ) ) ); - - $status = $this->backend->doOperations( array( - array( 'op' => 'store', 'src' => $tmpNameA, 'dst' => $fileA, 'overwriteSame' => 1 ), - array( 'op' => 'store', 'src' => $tmpNameB, 'dst' => $fileB, 'overwrite' => 1 ), - array( 'op' => 'store', 'src' => $tmpNameC, 'dst' => $fileC, 'overwrite' => 1 ), - array( 'op' => 'copy', 'src' => $fileA, 'dst' => $fileC, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: (file:) - array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileA, 'overwriteSame' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileD, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileB, 'dst' => $fileC ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileD, 'dst' => $fileA, 'overwriteSame' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileA, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'copy', 'src' => $fileA, 'dst' => $fileC ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileA, 'dst' => $fileC, 'overwriteSame' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileC, 'overwrite' => 1 ), - // Does nothing - array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileC, 'overwriteSame' => 1 ), - // Does nothing - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileC, 'overwrite' => 1 ), - // Does nothing - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileC, 'overwriteSame' => 1 ), - // Does nothing - array( 'op' => 'null' ), - // Does nothing - ) ); - - $this->assertGoodStatus( $status, "Operation batch succeeded" ); - $this->assertEquals( true, $status->isOK(), "Operation batch succeeded" ); - $this->assertEquals( 16, count( $status->success ), - "Operation batch has correct success array" ); - - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $fileA ) ), - "File does not exist at $fileA" ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $fileB ) ), - "File does not exist at $fileB" ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $fileD ) ), - "File does not exist at $fileD" ); - - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $fileC ) ), - "File exists at $fileC" ); - $this->assertEquals( $fileBContents, - $this->backend->getFileContents( array( 'src' => $fileC ) ), - "Correct file contents of $fileC" ); - $this->assertEquals( strlen( $fileBContents ), - $this->backend->getFileSize( array( 'src' => $fileC ) ), - "Correct file size of $fileC" ); - $this->assertEquals( wfBaseConvert( sha1( $fileBContents ), 16, 36, 31 ), - $this->backend->getFileSha1Base36( array( 'src' => $fileC ) ), - "Correct file SHA-1 of $fileC" ); - } - - /** - * @covers FileBackend::doOperations - */ - public function testDoOperationsFailing() { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestDoOperationsFailing(); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestDoOperationsFailing(); - $this->tearDownFiles(); - } - - private function doTestDoOperationsFailing() { - $base = self::baseStorePath(); - - $fileA = "$base/unittest-cont2/a/b/fileA.txt"; - $fileAContents = '3tqtmoeatmn4wg4qe-mg3qt3 tq'; - $fileB = "$base/unittest-cont2/a/b/fileB.txt"; - $fileBContents = 'g-jmq3gpqgt3qtg q3GT '; - $fileC = "$base/unittest-cont2/a/b/fileC.txt"; - $fileCContents = 'eigna[ogmewt 3qt g3qg flew[ag'; - $fileD = "$base/unittest-cont2/a/b/fileD.txt"; - - $this->prepare( array( 'dir' => dirname( $fileA ) ) ); - $this->create( array( 'dst' => $fileA, 'content' => $fileAContents ) ); - $this->prepare( array( 'dir' => dirname( $fileB ) ) ); - $this->create( array( 'dst' => $fileB, 'content' => $fileBContents ) ); - $this->prepare( array( 'dir' => dirname( $fileC ) ) ); - $this->create( array( 'dst' => $fileC, 'content' => $fileCContents ) ); - - $status = $this->backend->doOperations( array( - array( 'op' => 'copy', 'src' => $fileA, 'dst' => $fileC, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: (file:) - array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileA, 'overwriteSame' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'copy', 'src' => $fileB, 'dst' => $fileD, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileD ), - // Now: A:, B:, C:, D: (failed) - array( 'op' => 'move', 'src' => $fileB, 'dst' => $fileC, 'overwriteSame' => 1 ), - // Now: A:, B:, C:, D: (failed) - array( 'op' => 'move', 'src' => $fileB, 'dst' => $fileA, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'delete', 'src' => $fileD ), - // Now: A:, B:, C:, D: - array( 'op' => 'null' ), - // Does nothing - ), array( 'force' => 1 ) ); - - $this->assertNotEquals( array(), $status->errors, "Operation had warnings" ); - $this->assertEquals( true, $status->isOK(), "Operation batch succeeded" ); - $this->assertEquals( 8, count( $status->success ), - "Operation batch has correct success array" ); - - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $fileB ) ), - "File does not exist at $fileB" ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $fileD ) ), - "File does not exist at $fileD" ); - - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $fileA ) ), - "File does not exist at $fileA" ); - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $fileC ) ), - "File exists at $fileC" ); - $this->assertEquals( $fileBContents, - $this->backend->getFileContents( array( 'src' => $fileA ) ), - "Correct file contents of $fileA" ); - $this->assertEquals( strlen( $fileBContents ), - $this->backend->getFileSize( array( 'src' => $fileA ) ), - "Correct file size of $fileA" ); - $this->assertEquals( wfBaseConvert( sha1( $fileBContents ), 16, 36, 31 ), - $this->backend->getFileSha1Base36( array( 'src' => $fileA ) ), - "Correct file SHA-1 of $fileA" ); - } - - /** - * @covers FileBackend::getFileList - */ - public function testGetFileList() { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestGetFileList(); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestGetFileList(); - $this->tearDownFiles(); - } - - private function doTestGetFileList() { - $backendName = $this->backendClass(); - $base = self::baseStorePath(); - - // Should have no errors - $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont-notexists" ) ); - - $files = array( - "$base/unittest-cont1/e/test1.txt", - "$base/unittest-cont1/e/test2.txt", - "$base/unittest-cont1/e/test3.txt", - "$base/unittest-cont1/e/subdir1/test1.txt", - "$base/unittest-cont1/e/subdir1/test2.txt", - "$base/unittest-cont1/e/subdir2/test3.txt", - "$base/unittest-cont1/e/subdir2/test4.txt", - "$base/unittest-cont1/e/subdir2/subdir/test1.txt", - "$base/unittest-cont1/e/subdir2/subdir/test2.txt", - "$base/unittest-cont1/e/subdir2/subdir/test3.txt", - "$base/unittest-cont1/e/subdir2/subdir/test4.txt", - "$base/unittest-cont1/e/subdir2/subdir/test5.txt", - "$base/unittest-cont1/e/subdir2/subdir/sub/test0.txt", - "$base/unittest-cont1/e/subdir2/subdir/sub/120-px-file.txt", - ); - - // Add the files - $ops = array(); - foreach ( $files as $file ) { - $this->prepare( array( 'dir' => dirname( $file ) ) ); - $ops[] = array( 'op' => 'create', 'content' => 'xxy', 'dst' => $file ); - } - $status = $this->backend->doQuickOperations( $ops ); - $this->assertGoodStatus( $status, - "Creation of files succeeded ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Creation of files succeeded with OK status ($backendName)." ); - - // Expected listing at root - $expected = array( - "e/test1.txt", - "e/test2.txt", - "e/test3.txt", - "e/subdir1/test1.txt", - "e/subdir1/test2.txt", - "e/subdir2/test3.txt", - "e/subdir2/test4.txt", - "e/subdir2/subdir/test1.txt", - "e/subdir2/subdir/test2.txt", - "e/subdir2/subdir/test3.txt", - "e/subdir2/subdir/test4.txt", - "e/subdir2/subdir/test5.txt", - "e/subdir2/subdir/sub/test0.txt", - "e/subdir2/subdir/sub/120-px-file.txt", - ); - sort( $expected ); - - // Actual listing (no trailing slash) at root - $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont1" ) ); - $list = $this->listToArray( $iter ); - sort( $list ); - $this->assertEquals( $expected, $list, "Correct file listing ($backendName)." ); - - // Actual listing (no trailing slash) at root with advise - $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont1", 'adviseStat' => 1 ) ); - $list = $this->listToArray( $iter ); - sort( $list ); - $this->assertEquals( $expected, $list, "Correct file listing ($backendName)." ); - - // Actual listing (with trailing slash) at root - $list = array(); - $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont1/" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - $this->assertEquals( $expected, $list, "Correct file listing ($backendName)." ); - - // Expected listing at subdir - $expected = array( - "test1.txt", - "test2.txt", - "test3.txt", - "test4.txt", - "test5.txt", - "sub/test0.txt", - "sub/120-px-file.txt", - ); - sort( $expected ); - - // Actual listing (no trailing slash) at subdir - $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont1/e/subdir2/subdir" ) ); - $list = $this->listToArray( $iter ); - sort( $list ); - $this->assertEquals( $expected, $list, "Correct file listing ($backendName)." ); - - // Actual listing (no trailing slash) at subdir with advise - $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont1/e/subdir2/subdir", 'adviseStat' => 1 ) ); - $list = $this->listToArray( $iter ); - sort( $list ); - $this->assertEquals( $expected, $list, "Correct file listing ($backendName)." ); - - // Actual listing (with trailing slash) at subdir - $list = array(); - $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont1/e/subdir2/subdir/" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - $this->assertEquals( $expected, $list, "Correct file listing ($backendName)." ); - - // Actual listing (using iterator second time) - $list = $this->listToArray( $iter ); - sort( $list ); - $this->assertEquals( $expected, $list, "Correct file listing ($backendName), second iteration." ); - - // Actual listing (top files only) at root - $iter = $this->backend->getTopFileList( array( 'dir' => "$base/unittest-cont1" ) ); - $list = $this->listToArray( $iter ); - sort( $list ); - $this->assertEquals( array(), $list, "Correct top file listing ($backendName)." ); - - // Expected listing (top files only) at subdir - $expected = array( - "test1.txt", - "test2.txt", - "test3.txt", - "test4.txt", - "test5.txt" - ); - sort( $expected ); - - // Actual listing (top files only) at subdir - $iter = $this->backend->getTopFileList( array( 'dir' => "$base/unittest-cont1/e/subdir2/subdir" ) ); - $list = $this->listToArray( $iter ); - sort( $list ); - $this->assertEquals( $expected, $list, "Correct top file listing ($backendName)." ); - - // Actual listing (top files only) at subdir with advise - $iter = $this->backend->getTopFileList( array( 'dir' => "$base/unittest-cont1/e/subdir2/subdir", 'adviseStat' => 1 ) ); - $list = $this->listToArray( $iter ); - sort( $list ); - $this->assertEquals( $expected, $list, "Correct top file listing ($backendName)." ); - - foreach ( $files as $file ) { // clean up - $this->backend->doOperation( array( 'op' => 'delete', 'src' => $file ) ); - } - - $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont1/not/exists" ) ); - foreach ( $iter as $iter ) { - // no errors - } - } - - /** - * @covers FileBackend::getTopDirectoryList - * @covers FileBackend::getDirectoryList - */ - public function testGetDirectoryList() { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestGetDirectoryList(); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestGetDirectoryList(); - $this->tearDownFiles(); - } - - private function doTestGetDirectoryList() { - $backendName = $this->backendClass(); - - $base = self::baseStorePath(); - $files = array( - "$base/unittest-cont1/e/test1.txt", - "$base/unittest-cont1/e/test2.txt", - "$base/unittest-cont1/e/test3.txt", - "$base/unittest-cont1/e/subdir1/test1.txt", - "$base/unittest-cont1/e/subdir1/test2.txt", - "$base/unittest-cont1/e/subdir2/test3.txt", - "$base/unittest-cont1/e/subdir2/test4.txt", - "$base/unittest-cont1/e/subdir2/subdir/test1.txt", - "$base/unittest-cont1/e/subdir3/subdir/test2.txt", - "$base/unittest-cont1/e/subdir4/subdir/test3.txt", - "$base/unittest-cont1/e/subdir4/subdir/test4.txt", - "$base/unittest-cont1/e/subdir4/subdir/test5.txt", - "$base/unittest-cont1/e/subdir4/subdir/sub/test0.txt", - "$base/unittest-cont1/e/subdir4/subdir/sub/120-px-file.txt", - ); - - // Add the files - $ops = array(); - foreach ( $files as $file ) { - $this->prepare( array( 'dir' => dirname( $file ) ) ); - $ops[] = array( 'op' => 'create', 'content' => 'xxy', 'dst' => $file ); - } - $status = $this->backend->doQuickOperations( $ops ); - $this->assertGoodStatus( $status, - "Creation of files succeeded ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Creation of files succeeded with OK status ($backendName)." ); - - $this->assertEquals( true, - $this->backend->directoryExists( array( 'dir' => "$base/unittest-cont1/e/subdir1" ) ), - "Directory exists in ($backendName)." ); - $this->assertEquals( true, - $this->backend->directoryExists( array( 'dir' => "$base/unittest-cont1/e/subdir2/subdir" ) ), - "Directory exists in ($backendName)." ); - $this->assertEquals( false, - $this->backend->directoryExists( array( 'dir' => "$base/unittest-cont1/e/subdir2/test1.txt" ) ), - "Directory does not exists in ($backendName)." ); - - // Expected listing - $expected = array( - "e", - ); - sort( $expected ); - - // Actual listing (no trailing slash) - $list = array(); - $iter = $this->backend->getTopDirectoryList( array( 'dir' => "$base/unittest-cont1" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct top dir listing ($backendName)." ); - - // Expected listing - $expected = array( - "subdir1", - "subdir2", - "subdir3", - "subdir4", - ); - sort( $expected ); - - // Actual listing (no trailing slash) - $list = array(); - $iter = $this->backend->getTopDirectoryList( array( 'dir' => "$base/unittest-cont1/e" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct top dir listing ($backendName)." ); - - // Actual listing (with trailing slash) - $list = array(); - $iter = $this->backend->getTopDirectoryList( array( 'dir' => "$base/unittest-cont1/e/" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct top dir listing ($backendName)." ); - - // Expected listing - $expected = array( - "subdir", - ); - sort( $expected ); - - // Actual listing (no trailing slash) - $list = array(); - $iter = $this->backend->getTopDirectoryList( array( 'dir' => "$base/unittest-cont1/e/subdir2" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct top dir listing ($backendName)." ); - - // Actual listing (with trailing slash) - $list = array(); - $iter = $this->backend->getTopDirectoryList( array( 'dir' => "$base/unittest-cont1/e/subdir2/" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct top dir listing ($backendName)." ); - - // Actual listing (using iterator second time) - $list = array(); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct top dir listing ($backendName), second iteration." ); - - // Expected listing (recursive) - $expected = array( - "e", - "e/subdir1", - "e/subdir2", - "e/subdir3", - "e/subdir4", - "e/subdir2/subdir", - "e/subdir3/subdir", - "e/subdir4/subdir", - "e/subdir4/subdir/sub", - ); - sort( $expected ); - - // Actual listing (recursive) - $list = array(); - $iter = $this->backend->getDirectoryList( array( 'dir' => "$base/unittest-cont1/" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct dir listing ($backendName)." ); - - // Expected listing (recursive) - $expected = array( - "subdir", - "subdir/sub", - ); - sort( $expected ); - - // Actual listing (recursive) - $list = array(); - $iter = $this->backend->getDirectoryList( array( 'dir' => "$base/unittest-cont1/e/subdir4" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct dir listing ($backendName)." ); - - // Actual listing (recursive, second time) - $list = array(); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct dir listing ($backendName)." ); - - $iter = $this->backend->getDirectoryList( array( 'dir' => "$base/unittest-cont1/e/subdir1" ) ); - $items = $this->listToArray( $iter ); - $this->assertEquals( array(), $items, "Directory listing is empty." ); - - foreach ( $files as $file ) { // clean up - $this->backend->doOperation( array( 'op' => 'delete', 'src' => $file ) ); - } - - $iter = $this->backend->getDirectoryList( array( 'dir' => "$base/unittest-cont1/not/exists" ) ); - foreach ( $iter as $file ) { - // no errors - } - - $items = $this->listToArray( $iter ); - $this->assertEquals( array(), $items, "Directory listing is empty." ); - - $iter = $this->backend->getDirectoryList( array( 'dir' => "$base/unittest-cont1/e/not/exists" ) ); - $items = $this->listToArray( $iter ); - $this->assertEquals( array(), $items, "Directory listing is empty." ); - } - - /** - * @covers FileBackend::lockFiles - * @covers FileBackend::unlockFiles - */ - public function testLockCalls() { - $this->backend = $this->singleBackend; - $this->doTestLockCalls(); - } - - private function doTestLockCalls() { - $backendName = $this->backendClass(); - - $paths = array( - "test1.txt", - "test2.txt", - "test3.txt", - "subdir1", - "subdir1", // duplicate - "subdir1/test1.txt", - "subdir1/test2.txt", - "subdir2", - "subdir2", // duplicate - "subdir2/test3.txt", - "subdir2/test4.txt", - "subdir2/subdir", - "subdir2/subdir/test1.txt", - "subdir2/subdir/test2.txt", - "subdir2/subdir/test3.txt", - "subdir2/subdir/test4.txt", - "subdir2/subdir/test5.txt", - "subdir2/subdir/sub", - "subdir2/subdir/sub/test0.txt", - "subdir2/subdir/sub/120-px-file.txt", - ); - - for ( $i = 0; $i < 25; $i++ ) { - $status = $this->backend->lockFiles( $paths, LockManager::LOCK_EX ); - $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), - "Locking of files succeeded ($backendName) ($i)." ); - $this->assertEquals( true, $status->isOK(), - "Locking of files succeeded with OK status ($backendName) ($i)." ); - - $status = $this->backend->lockFiles( $paths, LockManager::LOCK_SH ); - $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), - "Locking of files succeeded ($backendName) ($i)." ); - $this->assertEquals( true, $status->isOK(), - "Locking of files succeeded with OK status ($backendName) ($i)." ); - - $status = $this->backend->unlockFiles( $paths, LockManager::LOCK_SH ); - $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), - "Locking of files succeeded ($backendName) ($i)." ); - $this->assertEquals( true, $status->isOK(), - "Locking of files succeeded with OK status ($backendName) ($i)." ); - - $status = $this->backend->unlockFiles( $paths, LockManager::LOCK_EX ); - $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), - "Locking of files succeeded ($backendName). ($i)" ); - $this->assertEquals( true, $status->isOK(), - "Locking of files succeeded with OK status ($backendName) ($i)." ); - - ## Flip the acquire/release ordering around ## - - $status = $this->backend->lockFiles( $paths, LockManager::LOCK_SH ); - $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), - "Locking of files succeeded ($backendName) ($i)." ); - $this->assertEquals( true, $status->isOK(), - "Locking of files succeeded with OK status ($backendName) ($i)." ); - - $status = $this->backend->lockFiles( $paths, LockManager::LOCK_EX ); - $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), - "Locking of files succeeded ($backendName) ($i)." ); - $this->assertEquals( true, $status->isOK(), - "Locking of files succeeded with OK status ($backendName) ($i)." ); - - $status = $this->backend->unlockFiles( $paths, LockManager::LOCK_EX ); - $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), - "Locking of files succeeded ($backendName). ($i)" ); - $this->assertEquals( true, $status->isOK(), - "Locking of files succeeded with OK status ($backendName) ($i)." ); - - $status = $this->backend->unlockFiles( $paths, LockManager::LOCK_SH ); - $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), - "Locking of files succeeded ($backendName) ($i)." ); - $this->assertEquals( true, $status->isOK(), - "Locking of files succeeded with OK status ($backendName) ($i)." ); - } - - $status = Status::newGood(); - $sl = $this->backend->getScopedFileLocks( $paths, LockManager::LOCK_EX, $status ); - $this->assertType( 'ScopedLock', $sl, - "Scoped locking of files succeeded ($backendName)." ); - $this->assertEquals( array(), $status->errors, - "Scoped locking of files succeeded ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Scoped locking of files succeeded with OK status ($backendName)." ); - - ScopedLock::release( $sl ); - $this->assertEquals( null, $sl, - "Scoped unlocking of files succeeded ($backendName)." ); - $this->assertEquals( array(), $status->errors, - "Scoped unlocking of files succeeded ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Scoped unlocking of files succeeded with OK status ($backendName)." ); - } - - // helper function - private function listToArray( $iter ) { - return is_array( $iter ) ? $iter : iterator_to_array( $iter ); - } - - // test helper wrapper for backend prepare() function - private function prepare( array $params ) { - return $this->backend->prepare( $params ); - } - - // test helper wrapper for backend prepare() function - private function create( array $params ) { - $params['op'] = 'create'; - - return $this->backend->doQuickOperations( array( $params ) ); - } - - function tearDownFiles() { - foreach ( $this->filesToPrune as $file ) { - if ( is_file( $file ) ) { - unlink( $file ); - } - } - $containers = array( 'unittest-cont1', 'unittest-cont2' ); - foreach ( $containers as $container ) { - $this->deleteFiles( $container ); - } - $this->filesToPrune = array(); - } - - private function deleteFiles( $container ) { - $base = self::baseStorePath(); - $iter = $this->backend->getFileList( array( 'dir' => "$base/$container" ) ); - if ( $iter ) { - foreach ( $iter as $file ) { - $this->backend->quickDelete( array( 'src' => "$base/$container/$file" ) ); - } - // free the directory, to avoid Permission denied under windows on rmdir - unset( $iter ); - } - $this->backend->clean( array( 'dir' => "$base/$container", 'recursive' => 1 ) ); - } - - function assertBackendPathsConsistent( array $paths ) { - if ( $this->backend instanceof FileBackendMultiWrite ) { - $status = $this->backend->consistencyCheck( $paths ); - $this->assertGoodStatus( $status, "Files synced: " . implode( ',', $paths ) ); - } - } - - function assertGoodStatus( $status, $msg ) { - $this->assertEquals( print_r( array(), 1 ), print_r( $status->errors, 1 ), $msg ); - } -} diff --git a/tests/phpunit/includes/filerepo/FileRepoTest.php b/tests/phpunit/includes/filerepo/FileRepoTest.php deleted file mode 100644 index e3a75567..00000000 --- a/tests/phpunit/includes/filerepo/FileRepoTest.php +++ /dev/null @@ -1,55 +0,0 @@ - 'foobar' - ) ); - } - - /** - * @expectedException MWException - * @covers FileRepo::__construct - */ - public function testFileRepoConstructionOptionNeedBackendKey() { - new FileRepo( array( - 'name' => 'foobar' - ) ); - } - - /** - * @covers FileRepo::__construct - */ - public function testFileRepoConstructionWithRequiredOptions() { - $f = new FileRepo( array( - 'name' => 'FileRepoTestRepository', - 'backend' => new FSFileBackend( array( - 'name' => 'local-testing', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array() - ) ) - ) ); - $this->assertInstanceOf( 'FileRepo', $f ); - } -} diff --git a/tests/phpunit/includes/filerepo/StoreBatchTest.php b/tests/phpunit/includes/filerepo/StoreBatchTest.php deleted file mode 100644 index b33c1bbb..00000000 --- a/tests/phpunit/includes/filerepo/StoreBatchTest.php +++ /dev/null @@ -1,134 +0,0 @@ -getCliArg( 'use-filebackend=' ) ) { - $name = $this->getCliArg( 'use-filebackend=' ); - $useConfig = array(); - foreach ( $wgFileBackends as $conf ) { - if ( $conf['name'] == $name ) { - $useConfig = $conf; - } - } - $useConfig['name'] = 'local-testing'; // swap name - $class = $useConfig['class']; - $backend = new $class( $useConfig ); - } else { - $backend = new FSFileBackend( array( - 'name' => 'local-testing', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array( - 'unittests-public' => "{$tmpPrefix}-public", - 'unittests-thumb' => "{$tmpPrefix}-thumb", - 'unittests-temp' => "{$tmpPrefix}-temp", - 'unittests-deleted' => "{$tmpPrefix}-deleted", - ) - ) ); - } - $this->repo = new FileRepo( array( - 'name' => 'unittests', - 'backend' => $backend - ) ); - - $this->date = gmdate( "YmdHis" ); - $this->createdFiles = array(); - } - - protected function tearDown() { - $this->repo->cleanupBatch( $this->createdFiles ); // delete files - foreach ( $this->createdFiles as $tmp ) { // delete dirs - $tmp = $this->repo->resolveVirtualUrl( $tmp ); - while ( $tmp = FileBackend::parentStoragePath( $tmp ) ) { - $this->repo->getBackend()->clean( array( 'dir' => $tmp ) ); - } - } - parent::tearDown(); - } - - /** - * Store a file or virtual URL source into a media file name. - * - * @param $originalName string The title of the image - * @param $srcPath string The filepath or virtual URL - * @param $flags integer Flags to pass into repo::store(). - * @return FileRepoStatus - */ - private function storeit( $originalName, $srcPath, $flags ) { - $hashPath = $this->repo->getHashPath( $originalName ); - $dstRel = "$hashPath{$this->date}!$originalName"; - $dstUrlRel = $hashPath . $this->date . '!' . rawurlencode( $originalName ); - - $result = $this->repo->store( $srcPath, 'temp', $dstRel, $flags ); - $result->value = $this->repo->getVirtualUrl( 'temp' ) . '/' . $dstUrlRel; - $this->createdFiles[] = $result->value; - - return $result; - } - - /** - * Test storing a file using different flags. - * - * @param $fn string The title of the image - * @param $infn string The name of the file (in the filesystem) - * @param $otherfn string The name of the different file (in the filesystem) - * @param $fromrepo bool 'true' if we want to copy from a virtual URL out of the Repo. - */ - private function storecohort( $fn, $infn, $otherfn, $fromrepo ) { - $f = $this->storeit( $fn, $infn, 0 ); - $this->assertTrue( $f->isOK(), 'failed to store a new file' ); - $this->assertEquals( $f->failCount, 0, "counts wrong {$f->successCount} {$f->failCount}" ); - $this->assertEquals( $f->successCount, 1, "counts wrong {$f->successCount} {$f->failCount}" ); - if ( $fromrepo ) { - $f = $this->storeit( "Other-$fn", $infn, FileRepo::OVERWRITE ); - $infn = $f->value; - } - // This should work because we're allowed to overwrite - $f = $this->storeit( $fn, $infn, FileRepo::OVERWRITE ); - $this->assertTrue( $f->isOK(), 'We should be allowed to overwrite' ); - $this->assertEquals( $f->failCount, 0, "counts wrong {$f->successCount} {$f->failCount}" ); - $this->assertEquals( $f->successCount, 1, "counts wrong {$f->successCount} {$f->failCount}" ); - // This should fail because we're overwriting. - $f = $this->storeit( $fn, $infn, 0 ); - $this->assertFalse( $f->isOK(), 'We should not be allowed to overwrite' ); - $this->assertEquals( $f->failCount, 1, "counts wrong {$f->successCount} {$f->failCount}" ); - $this->assertEquals( $f->successCount, 0, "counts wrong {$f->successCount} {$f->failCount}" ); - // This should succeed because we're overwriting the same content. - $f = $this->storeit( $fn, $infn, FileRepo::OVERWRITE_SAME ); - $this->assertTrue( $f->isOK(), 'We should be able to overwrite the same content' ); - $this->assertEquals( $f->failCount, 0, "counts wrong {$f->successCount} {$f->failCount}" ); - $this->assertEquals( $f->successCount, 1, "counts wrong {$f->successCount} {$f->failCount}" ); - // This should fail because we're overwriting different content. - if ( $fromrepo ) { - $f = $this->storeit( "Other-$fn", $otherfn, FileRepo::OVERWRITE ); - $otherfn = $f->value; - } - $f = $this->storeit( $fn, $otherfn, FileRepo::OVERWRITE_SAME ); - $this->assertFalse( $f->isOK(), 'We should not be allowed to overwrite different content' ); - $this->assertEquals( $f->failCount, 1, "counts wrong {$f->successCount} {$f->failCount}" ); - $this->assertEquals( $f->successCount, 0, "counts wrong {$f->successCount} {$f->failCount}" ); - } - - /** - * @covers FileRepo::store - */ - public function teststore() { - global $IP; - $this->storecohort( "Test1.png", "$IP/skins/monobook/wiki.png", "$IP/skins/monobook/video.png", false ); - $this->storecohort( "Test2.png", "$IP/skins/monobook/wiki.png", "$IP/skins/monobook/video.png", true ); - } -} diff --git a/tests/phpunit/includes/installer/InstallDocFormatterTest.php b/tests/phpunit/includes/installer/InstallDocFormatterTest.php deleted file mode 100644 index 0e5f2671..00000000 --- a/tests/phpunit/includes/installer/InstallDocFormatterTest.php +++ /dev/null @@ -1,65 +0,0 @@ -assertEquals( - $expected, - InstallDocFormatter::format( $unformattedText ), - $message - ); - } - - /** - * Provider for testFormat() - */ - public static function provideDocFormattingTests() { - # Format: (expected string, unformattedText string, optional message) - return array( - # Escape some wikitext - array( 'Install <tag>', 'Install ', 'Escaping <' ), - array( 'Install {{template}}', 'Install {{template}}', 'Escaping [[' ), - array( 'Install [[page]]', 'Install [[page]]', 'Escaping {{' ), - array( 'Install __TOC__', 'Install __TOC__', 'Escaping __' ), - array( 'Install ', "Install \r", 'Removing \r' ), - - # Transform \t{1,2} into :{1,2} - array( ':One indentation', "\tOne indentation", 'Replacing a single \t' ), - array( '::Two indentations', "\t\tTwo indentations", 'Replacing 2 x \t' ), - - # Transform 'bug 123' links - array( - '[https://bugzilla.wikimedia.org/123 bug 123]', - 'bug 123', 'Testing bug 123 links' ), - array( - '([https://bugzilla.wikimedia.org/987654 bug 987654])', - '(bug 987654)', 'Testing (bug 987654) links' ), - - # "bug abc" shouldn't work - array( 'bug foobar', 'bug foobar', "Don't match bug followed by non-digits" ), - array( 'bug !!fakefake!!', 'bug !!fakefake!!', "Don't match bug followed by non-digits" ), - - # Transform '$wgFooBar' links - array( - '[http://www.mediawiki.org/wiki/Manual:$wgFooBar $wgFooBar]', - '$wgFooBar', 'Testing basic $wgFooBar' ), - array( - '[http://www.mediawiki.org/wiki/Manual:$wgFooBar45 $wgFooBar45]', - '$wgFooBar45', 'Testing $wgFooBar45 (with numbers)' ), - array( - '[http://www.mediawiki.org/wiki/Manual:$wgFoo_Bar $wgFoo_Bar]', - '$wgFoo_Bar', 'Testing $wgFoo_Bar (with underscore)' ), - - # Icky variables that shouldn't link - array( '$myAwesomeVariable', '$myAwesomeVariable', 'Testing $myAwesomeVariable (not starting with $wg)' ), - array( '$()not!a&Var', '$()not!a&Var', 'Testing $()not!a&Var (obviously not a variable)' ), - ); - } -} diff --git a/tests/phpunit/includes/installer/OracleInstallerTest.php b/tests/phpunit/includes/installer/OracleInstallerTest.php deleted file mode 100644 index 66e65592..00000000 --- a/tests/phpunit/includes/installer/OracleInstallerTest.php +++ /dev/null @@ -1,48 +0,0 @@ -assertEquals( $expected, - OracleInstaller::checkConnectStringFormat( $connectString ), - $msg - ); - } - - /** - * Provider to test OracleInstaller::checkConnectStringFormat() - */ - function provideOracleConnectStrings() { - // expected result, connectString[, message] - return array( - array( true, 'simple_01', 'Simple TNS name' ), - array( true, 'simple_01.world', 'TNS name with domain' ), - array( true, 'simple_01.domain.net', 'TNS name with domain' ), - array( true, 'host123', 'Host only' ), - array( true, 'host123.domain.net', 'FQDN only' ), - array( true, '//host123.domain.net', 'FQDN URL only' ), - array( true, '123.223.213.132', 'Host IP only' ), - array( true, 'host:1521', 'Host and port' ), - array( true, 'host:1521/service', 'Host, port and service' ), - array( true, 'host:1521/service:shared', 'Host, port, service and shared server type' ), - array( true, 'host:1521/service:dedicated', 'Host, port, service and dedicated server type' ), - array( true, 'host:1521/service:pooled', 'Host, port, service and pooled server type' ), - array( true, 'host:1521/service:shared/instance1', 'Host, port, service, server type and instance' ), - array( true, 'host:1521//instance1', 'Host, port and instance' ), - ); - } - -} diff --git a/tests/phpunit/includes/jobqueue/JobQueueTest.php b/tests/phpunit/includes/jobqueue/JobQueueTest.php deleted file mode 100644 index 4e51c4fc..00000000 --- a/tests/phpunit/includes/jobqueue/JobQueueTest.php +++ /dev/null @@ -1,329 +0,0 @@ -tablesUsed[] = 'job'; - } - - protected function setUp() { - global $wgJobTypeConf; - parent::setUp(); - - $this->setMwGlobals( 'wgMemc', new HashBagOStuff() ); - - if ( $this->getCliArg( 'use-jobqueue=' ) ) { - $name = $this->getCliArg( 'use-jobqueue=' ); - if ( !isset( $wgJobTypeConf[$name] ) ) { - throw new MWException( "No \$wgJobTypeConf entry for '$name'." ); - } - $baseConfig = $wgJobTypeConf[$name]; - } else { - $baseConfig = array( 'class' => 'JobQueueDB' ); - } - $baseConfig['type'] = 'null'; - $baseConfig['wiki'] = wfWikiID(); - $variants = array( - 'queueRand' => array( 'order' => 'random', 'claimTTL' => 0 ), - 'queueRandTTL' => array( 'order' => 'random', 'claimTTL' => 10 ), - 'queueTimestamp' => array( 'order' => 'timestamp', 'claimTTL' => 0 ), - 'queueTimestampTTL' => array( 'order' => 'timestamp', 'claimTTL' => 10 ), - 'queueFifo' => array( 'order' => 'fifo', 'claimTTL' => 0 ), - 'queueFifoTTL' => array( 'order' => 'fifo', 'claimTTL' => 10 ), - ); - foreach ( $variants as $q => $settings ) { - try { - $this->$q = JobQueue::factory( $settings + $baseConfig ); - if ( !( $this->$q instanceof JobQueueDB ) ) { - $this->$q->setTestingPrefix( 'unittests-' . wfRandomString( 32 ) ); - } - } catch ( MWException $e ) { - // unsupported? - // @todo What if it was another error? - }; - } - } - - protected function tearDown() { - parent::tearDown(); - foreach ( - array( - 'queueRand', 'queueRandTTL', 'queueTimestamp', 'queueTimestampTTL', - 'queueFifo', 'queueFifoTTL' - ) as $q - ) { - if ( $this->$q ) { - $this->$q->delete(); - } - $this->$q = null; - } - } - - /** - * @dataProvider provider_queueLists - */ - public function testProperties( $queue, $recycles, $desc ) { - $queue = $this->$queue; - if ( !$queue ) { - $this->markTestSkipped( $desc ); - } - - $this->assertEquals( wfWikiID(), $queue->getWiki(), "Proper wiki ID ($desc)" ); - $this->assertEquals( 'null', $queue->getType(), "Proper job type ($desc)" ); - } - - /** - * @dataProvider provider_queueLists - */ - public function testBasicOperations( $queue, $recycles, $desc ) { - $queue = $this->$queue; - if ( !$queue ) { - $this->markTestSkipped( $desc ); - } - - $this->assertTrue( $queue->isEmpty(), "Queue is empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "Queue is empty ($desc)" ); - - $this->assertTrue( $queue->push( $this->newJob() ), "Push worked ($desc)" ); - $this->assertTrue( $queue->batchPush( array( $this->newJob() ) ), "Push worked ($desc)" ); - - $this->assertFalse( $queue->isEmpty(), "Queue is not empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 2, $queue->getSize(), "Queue size is correct ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "No jobs active ($desc)" ); - $jobs = iterator_to_array( $queue->getAllQueuedJobs() ); - $this->assertEquals( 2, count( $jobs ), "Queue iterator size is correct ($desc)" ); - - $job1 = $queue->pop(); - $this->assertFalse( $queue->isEmpty(), "Queue is not empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 1, $queue->getSize(), "Queue size is correct ($desc)" ); - - $queue->flushCaches(); - if ( $recycles ) { - $this->assertEquals( 1, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } else { - $this->assertEquals( 0, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } - - $job2 = $queue->pop(); - $this->assertTrue( $queue->isEmpty(), "Queue is empty ($desc)" ); - $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" ); - - $queue->flushCaches(); - if ( $recycles ) { - $this->assertEquals( 2, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } else { - $this->assertEquals( 0, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } - - $queue->ack( $job1 ); - - $queue->flushCaches(); - if ( $recycles ) { - $this->assertEquals( 1, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } else { - $this->assertEquals( 0, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } - - $queue->ack( $job2 ); - - $queue->flushCaches(); - $this->assertEquals( 0, $queue->getAcquiredCount(), "Active job count ($desc)" ); - - $this->assertTrue( $queue->batchPush( array( $this->newJob(), $this->newJob() ) ), - "Push worked ($desc)" ); - $this->assertFalse( $queue->isEmpty(), "Queue is not empty ($desc)" ); - - $queue->delete(); - $queue->flushCaches(); - $this->assertTrue( $queue->isEmpty(), "Queue is empty ($desc)" ); - $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" ); - } - - /** - * @dataProvider provider_queueLists - */ - public function testBasicDeduplication( $queue, $recycles, $desc ) { - $queue = $this->$queue; - if ( !$queue ) { - $this->markTestSkipped( $desc ); - } - - $this->assertTrue( $queue->isEmpty(), "Queue is empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "Queue is empty ($desc)" ); - - $this->assertTrue( - $queue->batchPush( - array( $this->newDedupedJob(), $this->newDedupedJob(), $this->newDedupedJob() ) - ), - "Push worked ($desc)" ); - - $this->assertFalse( $queue->isEmpty(), "Queue is not empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 1, $queue->getSize(), "Queue size is correct ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "No jobs active ($desc)" ); - - $this->assertTrue( - $queue->batchPush( - array( $this->newDedupedJob(), $this->newDedupedJob(), $this->newDedupedJob() ) - ), - "Push worked ($desc)" - ); - - $this->assertFalse( $queue->isEmpty(), "Queue is not empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 1, $queue->getSize(), "Queue size is correct ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "No jobs active ($desc)" ); - - $job1 = $queue->pop(); - $this->assertTrue( $queue->isEmpty(), "Queue is empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" ); - if ( $recycles ) { - $this->assertEquals( 1, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } else { - $this->assertEquals( 0, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } - - $queue->ack( $job1 ); - - $queue->flushCaches(); - $this->assertEquals( 0, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } - - /** - * @dataProvider provider_queueLists - */ - public function testRootDeduplication( $queue, $recycles, $desc ) { - $queue = $this->$queue; - if ( !$queue ) { - $this->markTestSkipped( $desc ); - } - - $this->assertTrue( $queue->isEmpty(), "Queue is empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "Queue is empty ($desc)" ); - - $id = wfRandomString( 32 ); - $root1 = Job::newRootJobParams( "nulljobspam:$id" ); // task ID/timestamp - for ( $i = 0; $i < 5; ++$i ) { - $this->assertTrue( $queue->push( $this->newJob( 0, $root1 ) ), "Push worked ($desc)" ); - } - $queue->deduplicateRootJob( $this->newJob( 0, $root1 ) ); - sleep( 1 ); // roo job timestamp will increase - $root2 = Job::newRootJobParams( "nulljobspam:$id" ); // task ID/timestamp - $this->assertNotEquals( $root1['rootJobTimestamp'], $root2['rootJobTimestamp'], - "Root job signatures have different timestamps." ); - for ( $i = 0; $i < 5; ++$i ) { - $this->assertTrue( $queue->push( $this->newJob( 0, $root2 ) ), "Push worked ($desc)" ); - } - $queue->deduplicateRootJob( $this->newJob( 0, $root2 ) ); - - $this->assertFalse( $queue->isEmpty(), "Queue is not empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 10, $queue->getSize(), "Queue size is correct ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "No jobs active ($desc)" ); - - $dupcount = 0; - $jobs = array(); - do { - $job = $queue->pop(); - if ( $job ) { - $jobs[] = $job; - $queue->ack( $job ); - } - if ( $job instanceof DuplicateJob ) { - ++$dupcount; - } - } while ( $job ); - - $this->assertEquals( 10, count( $jobs ), "Correct number of jobs popped ($desc)" ); - $this->assertEquals( 5, $dupcount, "Correct number of duplicate jobs popped ($desc)" ); - } - - /** - * @dataProvider provider_fifoQueueLists - */ - public function testJobOrder( $queue, $recycles, $desc ) { - $queue = $this->$queue; - if ( !$queue ) { - $this->markTestSkipped( $desc ); - } - - $this->assertTrue( $queue->isEmpty(), "Queue is empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "Queue is empty ($desc)" ); - - for ( $i = 0; $i < 10; ++$i ) { - $this->assertTrue( $queue->push( $this->newJob( $i ) ), "Push worked ($desc)" ); - } - - for ( $i = 0; $i < 10; ++$i ) { - $job = $queue->pop(); - $this->assertTrue( $job instanceof Job, "Jobs popped from queue ($desc)" ); - $params = $job->getParams(); - $this->assertEquals( $i, $params['i'], "Job popped from queue is FIFO ($desc)" ); - $queue->ack( $job ); - } - - $this->assertFalse( $queue->pop(), "Queue is not empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "No jobs active ($desc)" ); - } - - public static function provider_queueLists() { - return array( - array( 'queueRand', false, 'Random queue without ack()' ), - array( 'queueRandTTL', true, 'Random queue with ack()' ), - array( 'queueTimestamp', false, 'Time ordered queue without ack()' ), - array( 'queueTimestampTTL', true, 'Time ordered queue with ack()' ), - array( 'queueFifo', false, 'FIFO ordered queue without ack()' ), - array( 'queueFifoTTL', true, 'FIFO ordered queue with ack()' ) - ); - } - - public static function provider_fifoQueueLists() { - return array( - array( 'queueFifo', false, 'Ordered queue without ack()' ), - array( 'queueFifoTTL', true, 'Ordered queue with ack()' ) - ); - } - - function newJob( $i = 0, $rootJob = array() ) { - return new NullJob( Title::newMainPage(), - array( 'lives' => 0, 'usleep' => 0, 'removeDuplicates' => 0, 'i' => $i ) + $rootJob ); - } - - function newDedupedJob( $i = 0, $rootJob = array() ) { - return new NullJob( Title::newMainPage(), - array( 'lives' => 0, 'usleep' => 0, 'removeDuplicates' => 1, 'i' => $i ) + $rootJob ); - } -} diff --git a/tests/phpunit/includes/json/FormatJsonTest.php b/tests/phpunit/includes/json/FormatJsonTest.php deleted file mode 100644 index 149be05b..00000000 --- a/tests/phpunit/includes/json/FormatJsonTest.php +++ /dev/null @@ -1,161 +0,0 @@ - new stdClass, - 'emptyArray' => array(), - 'string' => 'foobar\\', - 'filledArray' => array( - array( - 123, - 456, - ), - // Nested json works without problems - '"7":["8",{"9":"10"}]', - // Whitespace clean up doesn't touch strings that look alike - "{\n\t\"emptyObject\": {\n\t},\n\t\"emptyArray\": [ ]\n}", - ), - ); - - // 4 space indent, no trailing whitespace, no trailing linefeed - $json = '{ - "emptyObject": {}, - "emptyArray": [], - "string": "foobar\\\\", - "filledArray": [ - [ - 123, - 456 - ], - "\"7\":[\"8\",{\"9\":\"10\"}]", - "{\n\t\"emptyObject\": {\n\t},\n\t\"emptyArray\": [ ]\n}" - ] -}'; - - $json = str_replace( "\r", '', $json ); // Windows compat - $this->assertSame( $json, FormatJson::encode( $obj, true ) ); - } - - public static function provideEncodeDefault() { - return self::getEncodeTestCases( array() ); - } - - /** - * @dataProvider provideEncodeDefault - */ - public function testEncodeDefault( $from, $to ) { - $this->assertSame( $to, FormatJson::encode( $from ) ); - } - - public static function provideEncodeUtf8() { - return self::getEncodeTestCases( array( 'unicode' ) ); - } - - /** - * @dataProvider provideEncodeUtf8 - */ - public function testEncodeUtf8( $from, $to ) { - $this->assertSame( $to, FormatJson::encode( $from, false, FormatJson::UTF8_OK ) ); - } - - public static function provideEncodeXmlMeta() { - return self::getEncodeTestCases( array( 'xmlmeta' ) ); - } - - /** - * @dataProvider provideEncodeXmlMeta - */ - public function testEncodeXmlMeta( $from, $to ) { - $this->assertSame( $to, FormatJson::encode( $from, false, FormatJson::XMLMETA_OK ) ); - } - - public static function provideEncodeAllOk() { - return self::getEncodeTestCases( array( 'unicode', 'xmlmeta' ) ); - } - - /** - * @dataProvider provideEncodeAllOk - */ - public function testEncodeAllOk( $from, $to ) { - $this->assertSame( $to, FormatJson::encode( $from, false, FormatJson::ALL_OK ) ); - } - - public function testEncodePhpBug46944() { - $this->assertNotEquals( - '\ud840\udc00', - strtolower( FormatJson::encode( "\xf0\xa0\x80\x80" ) ), - 'Test encoding an broken json_encode character (U+20000)' - ); - } - - public function testDecodeReturnType() { - $this->assertInternalType( - 'object', - FormatJson::decode( '{"Name": "Cheeso", "Rank": 7}' ), - 'Default to object' - ); - - $this->assertInternalType( - 'array', - FormatJson::decode( '{"Name": "Cheeso", "Rank": 7}', true ), - 'Optional array' - ); - } - - /** - * Generate a set of test cases for a particular combination of encoder options. - * - * @param array $unescapedGroups List of character groups to leave unescaped - * @return array: Arrays of unencoded strings and corresponding encoded strings - */ - private static function getEncodeTestCases( array $unescapedGroups ) { - $groups = array( - 'always' => array( - // Forward slash (always unescaped) - '/' => '/', - - // Control characters - "\0" => '\u0000', - "\x08" => '\b', - "\t" => '\t', - "\n" => '\n', - "\r" => '\r', - "\f" => '\f', - "\x1f" => '\u001f', // representative example - - // Double quotes - '"' => '\"', - - // Backslashes - '\\' => '\\\\', - '\\\\' => '\\\\\\\\', - '\\u00e9' => '\\\u00e9', // security check for Unicode unescaping - - // Line terminators - "\xe2\x80\xa8" => '\u2028', - "\xe2\x80\xa9" => '\u2029', - ), - 'unicode' => array( - "\xc3\xa9" => '\u00e9', - "\xf0\x9d\x92\x9e" => '\ud835\udc9e', // U+1D49E, outside the BMP - ), - 'xmlmeta' => array( - '<' => '\u003C', // JSON_HEX_TAG uses uppercase hex digits - '>' => '\u003E', - '&' => '\u0026', - ), - ); - - $cases = array(); - foreach ( $groups as $name => $rules ) { - $leaveUnescaped = in_array( $name, $unescapedGroups ); - foreach ( $rules as $from => $to ) { - $cases[] = array( $from, '"' . ( $leaveUnescaped ? $from : $to ) . '"' ); - } - } - - return $cases; - } -} diff --git a/tests/phpunit/includes/libs/CSSJanusTest.php b/tests/phpunit/includes/libs/CSSJanusTest.php deleted file mode 100644 index 5a3c1619..00000000 --- a/tests/phpunit/includes/libs/CSSJanusTest.php +++ /dev/null @@ -1,606 +0,0 @@ -assertEquals( $transformedA, $cssB, 'Test A-B transformation' ); - - $transformedB = CSSJanus::transform( $cssB ); - $this->assertEquals( $transformedB, $cssA, 'Test B-A transformation' ); - } else { - // If no B version is provided, it means - // the output should equal the input. - $transformedA = CSSJanus::transform( $cssA ); - $this->assertEquals( $transformedA, $cssA, 'Nothing was flipped' ); - } - } - - /** - * @dataProvider provideTransformAdvancedCases - */ - public function testTransformAdvanced( $code, $expectedOutput, $options = array() ) { - $swapLtrRtlInURL = isset( $options['swapLtrRtlInURL'] ) ? $options['swapLtrRtlInURL'] : false; - $swapLeftRightInURL = isset( $options['swapLeftRightInURL'] ) ? $options['swapLeftRightInURL'] : false; - - $flipped = CSSJanus::transform( $code, $swapLtrRtlInURL, $swapLeftRightInURL ); - - $this->assertEquals( $expectedOutput, $flipped, - 'Test flipping, options: url-ltr-rtl=' . ( $swapLtrRtlInURL ? 'true' : 'false' ) - . ' url-left-right=' . ( $swapLeftRightInURL ? 'true' : 'false' ) - ); - } - - /** - * @dataProvider provideTransformBrokenCases - * @group Broken - */ - public function testTransformBroken( $code, $expectedOutput ) { - $flipped = CSSJanus::transform( $code ); - - $this->assertEquals( $expectedOutput, $flipped, 'Test flipping' ); - } - - /** - * These transform cases are tested *in both directions* - * No need to declare a principle twice in both directions here. - */ - public static function provideTransformCases() { - return array( - // Property keys - array( - '.foo { left: 0; }', - '.foo { right: 0; }' - ), - // Guard against partial keys - // (CSS currently doesn't have flippable properties - // that contain the direction as part of the key without - // dash separation) - array( - '.foo { alright: 0; }' - ), - array( - '.foo { balleft: 0; }' - ), - - // Dashed property keys - array( - '.foo { padding-left: 0; }', - '.foo { padding-right: 0; }' - ), - array( - '.foo { margin-left: 0; }', - '.foo { margin-right: 0; }' - ), - array( - '.foo { border-left: 0; }', - '.foo { border-right: 0; }' - ), - - // Double-dashed property keys - array( - '.foo { border-left-color: red; }', - '.foo { border-right-color: red; }' - ), - array( - // Includes unknown properties? - '.foo { x-left-y: 0; }', - '.foo { x-right-y: 0; }' - ), - - // Multi-value properties - array( - '.foo { padding: 0; }' - ), - array( - '.foo { padding: 0 1px; }' - ), - array( - '.foo { padding: 0 1px 2px; }' - ), - array( - '.foo { padding: 0 1px 2px 3px; }', - '.foo { padding: 0 3px 2px 1px; }' - ), - - // Shorthand / Four notation - array( - '.foo { padding: .25em 15px 0pt 0ex; }', - '.foo { padding: .25em 0ex 0pt 15px; }' - ), - array( - '.foo { margin: 1px -4px 3px 2px; }', - '.foo { margin: 1px 2px 3px -4px; }' - ), - array( - '.foo { padding: 0 15px .25em 0; }', - '.foo { padding: 0 0 .25em 15px; }' - ), - array( - '.foo { padding: 1px 4.1grad 3px 2%; }', - '.foo { padding: 1px 2% 3px 4.1grad; }' - ), - array( - '.foo { padding: 1px 2px 3px auto; }', - '.foo { padding: 1px auto 3px 2px; }' - ), - array( - '.foo { padding: 1px inherit 3px auto; }', - '.foo { padding: 1px auto 3px inherit; }' - ), - // border-radius assigns different meanings to the values - array( - '.foo { border-radius: .25em 15px 0pt 0ex; }', - '.foo { border-radius: 15px .25em 0ex 0pt; }' - ), - array( - '.foo { border-radius: 0px 0px 5px 5px; }', - ), - // Ensure the rule doesn't break other stuff - array( - '.foo { x-unknown: a b c d; }' - ), - array( - '.foo barpx 0 2% { opacity: 0; }' - ), - array( - '#settings td p strong' - ), - array( - // Color names - '.foo { border-color: red green blue white }', - '.foo { border-color: red white blue green }', - ), - array( - // Color name, hexdecimal, RGB & RGBA - '.foo { border-color: red #f00 rgb(255, 0, 0) rgba(255, 0, 0, 0.5) }', - '.foo { border-color: red rgba(255, 0, 0, 0.5) rgb(255, 0, 0) #f00 }', - ), - array( - // Color name, hexdecimal, HSL & HSLA - '.foo { border-color: red #f00 hsl(0, 100%, 50%) hsla(0, 100%, 50%, 0.5) }', - '.foo { border-color: red hsla(0, 100%, 50%, 0.5) hsl(0, 100%, 50%) #f00 }', - ), - array( - // Do not mangle 5 or more values - '.foo { -x-unknown: 1 2 3 4 5; }' - ), - array( - '.foo { -x-unknown: 1 2 3 4 5 6; }' - ), - - // Shorthand / Three notation - array( - '.foo { margin: 1em 0 .25em; }' - ), - array( - '.foo { margin:-1.5em 0 -.75em; }' - ), - - // Shorthand / Two notation - array( - '.foo { padding: 1px 2px; }' - ), - - // Shorthand / One notation - array( - '.foo { padding: 1px; }' - ), - - // text-shadow and box-shadow - array( - '.foo { box-shadow: -6px 3px 8px 5px rgba(0, 0, 0, 0.25); }', - '.foo { box-shadow: 6px 3px 8px 5px rgba(0, 0, 0, 0.25); }', - ), - array( - '.foo { box-shadow: inset -6px 3px 8px 5px rgba(0, 0, 0, 0.25); }', - '.foo { box-shadow: inset 6px 3px 8px 5px rgba(0, 0, 0, 0.25); }', - ), - array( - '.foo { text-shadow: orange 2px 0; }', - '.foo { text-shadow: orange -2px 0; }', - ), - array( - '.foo { text-shadow: 2px 0 orange; }', - '.foo { text-shadow: -2px 0 orange; }', - ), - array( - // Don't mangle zeroes - '.foo { text-shadow: orange 0 2px; }' - ), - - // Direction - // Note: This differs from the Python implementation, - // see also CSSJanus::fixDirection for more info. - array( - '.foo { direction: ltr; }', - '.foo { direction: rtl; }' - ), - array( - '.foo { direction: rtl; }', - '.foo { direction: ltr; }' - ), - array( - 'input { direction: ltr; }', - 'input { direction: rtl; }' - ), - array( - 'input { direction: rtl; }', - 'input { direction: ltr; }' - ), - array( - 'body { direction: ltr; }', - 'body { direction: rtl; }' - ), - array( - '.foo, body, input { direction: ltr; }', - '.foo, body, input { direction: rtl; }' - ), - array( - 'body { padding: 10px; direction: ltr; }', - 'body { padding: 10px; direction: rtl; }' - ), - array( - 'body { direction: ltr } .myClass { direction: ltr }', - 'body { direction: rtl } .myClass { direction: rtl }' - ), - - // Left/right values - array( - '.foo { float: left; }', - '.foo { float: right; }' - ), - array( - '.foo { text-align: left; }', - '.foo { text-align: right; }' - ), - array( - '.foo { -x-unknown: left; }', - '.foo { -x-unknown: right; }' - ), - // Guard against selectors that look flippable - array( - '.column-left { width: 0; }' - ), - array( - 'a.left { width: 0; }' - ), - array( - 'a.leftification { width: 0; }' - ), - array( - 'a.ltr { width: 0; }' - ), - array( - #
        - '.a-ltr.png { width: 0; }' - ), - array( - # - 'foo-ltr[attr="x"] { width: 0; }' - ), - array( - 'div.left > span.right+span.left { width: 0; }' - ), - array( - '.thisclass .left .myclass { width: 0; }' - ), - array( - '.thisclass .left .myclass #myid { width: 0; }' - ), - - // Cursor values (east/west) - array( - '.foo { cursor: e-resize; }', - '.foo { cursor: w-resize; }' - ), - array( - '.foo { cursor: se-resize; }', - '.foo { cursor: sw-resize; }' - ), - array( - '.foo { cursor: ne-resize; }', - '.foo { cursor: nw-resize; }' - ), - - // Background - array( - '.foo { background-position: top left; }', - '.foo { background-position: top right; }' - ), - array( - '.foo { background: url(/foo/bar.png) top left; }', - '.foo { background: url(/foo/bar.png) top right; }' - ), - array( - '.foo { background: url(/foo/bar.png) top left no-repeat; }', - '.foo { background: url(/foo/bar.png) top right no-repeat; }' - ), - array( - '.foo { background: url(/foo/bar.png) no-repeat top left; }', - '.foo { background: url(/foo/bar.png) no-repeat top right; }' - ), - array( - '.foo { background: #fff url(/foo/bar.png) no-repeat top left; }', - '.foo { background: #fff url(/foo/bar.png) no-repeat top right; }' - ), - array( - '.foo { background-position: 100% 40%; }', - '.foo { background-position: 0% 40%; }' - ), - array( - '.foo { background-position: 23% 0; }', - '.foo { background-position: 77% 0; }' - ), - array( - '.foo { background-position: 23% auto; }', - '.foo { background-position: 77% auto; }' - ), - array( - '.foo { background-position-x: 23%; }', - '.foo { background-position-x: 77%; }' - ), - array( - '.foo { background-position-y: 23%; }', - '.foo { background-position-y: 23%; }' - ), - array( - '.foo { background:url(../foo.png) no-repeat 75% 50%; }', - '.foo { background:url(../foo.png) no-repeat 25% 50%; }' - ), - array( - '.foo { background: 10% 20% } .bar { background: 40% 30% }', - '.foo { background: 90% 20% } .bar { background: 60% 30% }' - ), - - // Multiple rules - array( - 'body { direction: rtl; float: right; } .foo { direction: ltr; float: right; }', - 'body { direction: ltr; float: left; } .foo { direction: rtl; float: left; }', - ), - - // Duplicate properties - array( - '.foo { float: left; float: right; float: left; }', - '.foo { float: right; float: left; float: right; }', - ), - - // Preserve comments - array( - '/* left /* right */left: 10px', - '/* left /* right */right: 10px' - ), - array( - '/*left*//*left*/left: 10px', - '/*left*//*left*/right: 10px' - ), - array( - '/* Going right is cool */ .foo { width: 0 }', - ), - array( - "/* padding-right 1 2 3 4 */\n#test { width: 0}\n/*right*/" - ), - array( - "/** Two line comment\n * left\n \*/\n#test {width: 0}" - ), - - // @noflip annotation - array( - // before selector (single) - '/* @noflip */ div { float: left; }' - ), - array( - // before selector (multiple) - '/* @noflip */ div, .notme { float: left; }' - ), - array( - // inside selector - 'div, /* @noflip */ .foo { float: left; }' - ), - array( - // after selector - 'div, .notme /* @noflip */ { float: left; }' - ), - array( - // before multiple rules - '/* @noflip */ div { float: left; } .foo { float: left; }', - '/* @noflip */ div { float: left; } .foo { float: right; }' - ), - array( - // support parentheses in selector - '/* @noflip */ .test:not(:first) { margin-right: -0.25em; margin-left: 0.25em; }', - '/* @noflip */ .test:not(:first) { margin-right: -0.25em; margin-left: 0.25em; }' - ), - array( - // after multiple rules - '.foo { float: left; } /* @noflip */ div { float: left; }', - '.foo { float: right; } /* @noflip */ div { float: left; }' - ), - array( - // before multiple properties - 'div { /* @noflip */ float: left; text-align: left; }', - 'div { /* @noflip */ float: left; text-align: right; }' - ), - array( - // after multiple properties - 'div { float: left; /* @noflip */ text-align: left; }', - 'div { float: right; /* @noflip */ text-align: left; }' - ), - - // Guard against css3 stuff - array( - 'background-image: -moz-linear-gradient(#326cc1, #234e8c);' - ), - array( - 'background-image: -webkit-gradient(linear, 100% 0%, 0% 0%, from(#666666), to(#ffffff));' - ), - - // CSS syntax / white-space variations - // spaces, no spaces, tabs, new lines, omitting semi-colons - array( - ".foo { left: 0; }", - ".foo { right: 0; }" - ), - array( - ".foo{ left: 0; }", - ".foo{ right: 0; }" - ), - array( - ".foo{ left: 0 }", - ".foo{ right: 0 }" - ), - array( - ".foo{left:0 }", - ".foo{right:0 }" - ), - array( - ".foo{left:0}", - ".foo{right:0}" - ), - array( - ".foo { left : 0 ; }", - ".foo { right : 0 ; }" - ), - array( - ".foo\n { left : 0 ; }", - ".foo\n { right : 0 ; }" - ), - array( - ".foo\n { \nleft : 0 ; }", - ".foo\n { \nright : 0 ; }" - ), - array( - ".foo\n { \n left : 0 ; }", - ".foo\n { \n right : 0 ; }" - ), - array( - ".foo\n { \n left\n : 0; }", - ".foo\n { \n right\n : 0; }" - ), - array( - ".foo \n { \n left\n : 0; }", - ".foo \n { \n right\n : 0; }" - ), - array( - ".foo\n{\nleft\n:\n0;}", - ".foo\n{\nright\n:\n0;}" - ), - array( - ".foo\n.bar {\n\tleft: 0;\n}", - ".foo\n.bar {\n\tright: 0;\n}" - ), - array( - ".foo\t{\tleft\t:\t0;}", - ".foo\t{\tright\t:\t0;}" - ), - - // Guard against partial keys - array( - '.foo { leftxx: 0; }', - '.foo { leftxx: 0; }' - ), - array( - '.foo { rightxx: 0; }', - '.foo { rightxx: 0; }' - ), - ); - } - - /** - * These cases are tested in one way only (format: actual, expected, msg). - * If both ways can be tested, either put both versions in here or move - * it to provideTransformCases(). - */ - public static function provideTransformAdvancedCases() { - $bgPairs = array( - # [ - _ . ] <-> [ left right ltr rtl ] - 'foo.jpg' => 'foo.jpg', - 'left.jpg' => 'right.jpg', - 'ltr.jpg' => 'rtl.jpg', - - 'foo-left.png' => 'foo-right.png', - 'foo_left.png' => 'foo_right.png', - 'foo.left.png' => 'foo.right.png', - - 'foo-ltr.png' => 'foo-rtl.png', - 'foo_ltr.png' => 'foo_rtl.png', - 'foo.ltr.png' => 'foo.rtl.png', - - 'left-foo.png' => 'right-foo.png', - 'left_foo.png' => 'right_foo.png', - 'left.foo.png' => 'right.foo.png', - - 'ltr-foo.png' => 'rtl-foo.png', - 'ltr_foo.png' => 'rtl_foo.png', - 'ltr.foo.png' => 'rtl.foo.png', - - 'foo-ltr-left.gif' => 'foo-rtl-right.gif', - 'foo_ltr_left.gif' => 'foo_rtl_right.gif', - 'foo.ltr.left.gif' => 'foo.rtl.right.gif', - 'foo-ltr_left.gif' => 'foo-rtl_right.gif', - 'foo_ltr.left.gif' => 'foo_rtl.right.gif', - ); - $provider = array(); - foreach ( $bgPairs as $left => $right ) { - # By default '-rtl' and '-left' etc. are not touched, - # Only when the appropiate parameter is set. - $provider[] = array( - ".foo { background: url(images/$left); }", - ".foo { background: url(images/$left); }" - ); - $provider[] = array( - ".foo { background: url(images/$right); }", - ".foo { background: url(images/$right); }" - ); - $provider[] = array( - ".foo { background: url(images/$left); }", - ".foo { background: url(images/$right); }", - array( - 'swapLtrRtlInURL' => true, - 'swapLeftRightInURL' => true, - ) - ); - $provider[] = array( - ".foo { background: url(images/$right); }", - ".foo { background: url(images/$left); }", - array( - 'swapLtrRtlInURL' => true, - 'swapLeftRightInURL' => true, - ) - ); - } - - return $provider; - } - - /** - * Cases that are currently failing, but - * should be looked at in the future as enhancements and/or bug fix - */ - public static function provideTransformBrokenCases() { - return array( - // Guard against selectors that look flippable - array( - # - 'foo-left-x[attr="x"] { width: 0; }', - 'foo-left-x[attr="x"] { width: 0; }' - ), - array( - #
        - '.foo[data-left="x"] { width: 0; }', - '.foo[data-left="x"] { width: 0; }' - ), - ); - } -} diff --git a/tests/phpunit/includes/libs/CSSMinTest.php b/tests/phpunit/includes/libs/CSSMinTest.php deleted file mode 100644 index 951dd7b9..00000000 --- a/tests/phpunit/includes/libs/CSSMinTest.php +++ /dev/null @@ -1,133 +0,0 @@ -setMwGlobals( array( - 'wgServer' => $server, - 'wgCanonicalServer' => $server, - ) ); - } - - /** - * @dataProvider provideMinifyCases - */ - public function testMinify( $code, $expectedOutput ) { - $minified = CSSMin::minify( $code ); - - $this->assertEquals( $expectedOutput, $minified, 'Minified output should be in the form expected.' ); - } - - public static function provideMinifyCases() { - return array( - // Whitespace - array( "\r\t\f \v\n\r", "" ), - array( "foo, bar {\n\tprop: value;\n}", "foo,bar{prop:value}" ), - - // Loose comments - array( "/* foo */", "" ), - array( "/*******\n foo\n *******/", "" ), - array( "/*!\n foo\n */", "" ), - - // Inline comments in various different places - array( "/* comment */foo, bar {\n\tprop: value;\n}", "foo,bar{prop:value}" ), - array( "foo/* comment */, bar {\n\tprop: value;\n}", "foo,bar{prop:value}" ), - array( "foo,/* comment */ bar {\n\tprop: value;\n}", "foo,bar{prop:value}" ), - array( "foo, bar/* comment */ {\n\tprop: value;\n}", "foo,bar{prop:value}" ), - array( "foo, bar {\n\t/* comment */prop: value;\n}", "foo,bar{prop:value}" ), - array( "foo, bar {\n\tprop: /* comment */value;\n}", "foo,bar{prop:value}" ), - array( "foo, bar {\n\tprop: value /* comment */;\n}", "foo,bar{prop:value }" ), - array( "foo, bar {\n\tprop: value; /* comment */\n}", "foo,bar{prop:value; }" ), - - // Keep track of things that aren't as minified as much as they - // could be (bug 35493) - array( 'foo { prop: value ;}', 'foo{prop:value }' ), - array( 'foo { prop : value; }', 'foo{prop :value}' ), - array( 'foo { prop: value ; }', 'foo{prop:value }' ), - array( 'foo { font-family: "foo" , "bar"; }', 'foo{font-family:"foo" ,"bar"}' ), - array( "foo { src:\n\turl('foo') ,\n\turl('bar') ; }", "foo{src:url('foo') ,url('bar') }" ), - - // Interesting cases with string values - // - Double quotes, single quotes - array( 'foo { content: ""; }', 'foo{content:""}' ), - array( "foo { content: ''; }", "foo{content:''}" ), - array( 'foo { content: "\'"; }', 'foo{content:"\'"}' ), - array( "foo { content: '\"'; }", "foo{content:'\"'}" ), - // - Whitespace in string values - array( 'foo { content: " "; }', 'foo{content:" "}' ), - ); - } - - /** - * @dataProvider provideRemapCases - */ - public function testRemap( $message, $params, $expectedOutput ) { - $remapped = call_user_func_array( 'CSSMin::remap', $params ); - - $messageAdd = " Case: $message"; - $this->assertEquals( $expectedOutput, $remapped, 'CSSMin::remap should return the expected url form.' . $messageAdd ); - } - - public static function provideRemapCases() { - // Parameter signature: - // CSSMin::remap( $code, $local, $remote, $embedData = true ) - return array( - array( - 'Simple case', - array( 'foo { prop: url(bar.png); }', false, 'http://example.org', false ), - 'foo { prop: url(http://example.org/bar.png); }', - ), - array( - 'Without trailing slash', - array( 'foo { prop: url(../bar.png); }', false, 'http://example.org/quux', false ), - 'foo { prop: url(http://example.org/quux/../bar.png); }', - ), - array( - 'With trailing slash on remote (bug 27052)', - array( 'foo { prop: url(../bar.png); }', false, 'http://example.org/quux/', false ), - 'foo { prop: url(http://example.org/quux/../bar.png); }', - ), - array( - 'Guard against stripping double slashes from query', - array( 'foo { prop: url(bar.png?corge=//grault); }', false, 'http://example.org/quux/', false ), - 'foo { prop: url(http://example.org/quux/bar.png?corge=//grault); }', - ), - array( - 'Expand absolute paths', - array( 'foo { prop: url(/w/skin/images/bar.png); }', false, 'http://example.org/quux', false ), - 'foo { prop: url(http://doc.example.org/w/skin/images/bar.png); }', - ), - ); - } - - /** - * Seperated because they are currently broken (bug 35492) - * - * @group Broken - * @dataProvider provideStringCases - */ - public function testMinifyWithCSSStringValues( $code, $expectedOutput ) { - $this->testMinifyOutput( $code, $expectedOutput ); - } - - public static function provideStringCases() { - return array( - // String values should be respected - // - More than one space in a string value - array( 'foo { content: " "; }', 'foo{content:" "}' ), - // - Using a tab in a string value (turns into a space) - array( "foo { content: '\t'; }", "foo{content:'\t'}" ), - // - Using css-like syntax in string values - array( 'foo::after { content: "{;}"; position: absolute; }', 'foo::after{content:"{;}";position:absolute}' ), - ); - } -} diff --git a/tests/phpunit/includes/libs/GenericArrayObjectTest.php b/tests/phpunit/includes/libs/GenericArrayObjectTest.php deleted file mode 100644 index 7436c43c..00000000 --- a/tests/phpunit/includes/libs/GenericArrayObjectTest.php +++ /dev/null @@ -1,263 +0,0 @@ - - */ -abstract class GenericArrayObjectTest extends MediaWikiTestCase { - - /** - * Returns objects that can serve as elements in the concrete GenericArrayObject deriving class being tested. - * - * @since 1.20 - * - * @return array - */ - abstract public function elementInstancesProvider(); - - /** - * Returns the name of the concrete class being tested. - * - * @since 1.20 - * - * @return string - */ - abstract public function getInstanceClass(); - - /** - * Provides instances of the concrete class being tested. - * - * @since 1.20 - * - * @return array - */ - public function instanceProvider() { - $instances = array(); - - foreach ( $this->elementInstancesProvider() as $elementInstances ) { - $instances[] = $this->getNew( $elementInstances[0] ); - } - - return $this->arrayWrap( $instances ); - } - - /** - * @since 1.20 - * - * @param array $elements - * - * @return GenericArrayObject - */ - protected function getNew( array $elements = array() ) { - $class = $this->getInstanceClass(); - - return new $class( $elements ); - } - - /** - * @dataProvider elementInstancesProvider - * - * @since 1.20 - * - * @param array $elements - */ - public function testConstructor( array $elements ) { - $arrayObject = $this->getNew( $elements ); - - $this->assertEquals( count( $elements ), $arrayObject->count() ); - } - - /** - * @dataProvider elementInstancesProvider - * - * @since 1.20 - * - * @param array $elements - */ - public function testIsEmpty( array $elements ) { - $arrayObject = $this->getNew( $elements ); - - $this->assertEquals( $elements === array(), $arrayObject->isEmpty() ); - } - - /** - * @dataProvider instanceProvider - * - * @since 1.20 - * - * @param GenericArrayObject $list - */ - public function testUnset( GenericArrayObject $list ) { - if ( $list->isEmpty() ) { - $this->assertTrue( true ); // We cannot test unset if there are no elements - } else { - $offset = $list->getIterator()->key(); - $count = $list->count(); - $list->offsetUnset( $offset ); - $this->assertEquals( $count - 1, $list->count() ); - } - - if ( !$list->isEmpty() ) { - $offset = $list->getIterator()->key(); - $count = $list->count(); - unset( $list[$offset] ); - $this->assertEquals( $count - 1, $list->count() ); - } - } - - /** - * @dataProvider elementInstancesProvider - * - * @since 1.20 - * - * @param array $elements - */ - public function testAppend( array $elements ) { - $list = $this->getNew(); - - $listSize = count( $elements ); - - foreach ( $elements as $element ) { - $list->append( $element ); - } - - $this->assertEquals( $listSize, $list->count() ); - - $list = $this->getNew(); - - foreach ( $elements as $element ) { - $list[] = $element; - } - - $this->assertEquals( $listSize, $list->count() ); - - $this->checkTypeChecks( function ( GenericArrayObject $list, $element ) { - $list->append( $element ); - } ); - } - - /** - * @since 1.20 - * - * @param callback $function - */ - protected function checkTypeChecks( $function ) { - $excption = null; - $list = $this->getNew(); - - $elementClass = $list->getObjectType(); - - foreach ( array( 42, 'foo', array(), new stdClass(), 4.2 ) as $element ) { - $validValid = $element instanceof $elementClass; - - try { - call_user_func( $function, $list, $element ); - $valid = true; - } catch ( InvalidArgumentException $exception ) { - $valid = false; - } - - $this->assertEquals( - $validValid, - $valid, - 'Object of invalid type got successfully added to a GenericArrayObject' - ); - } - } - - /** - * @dataProvider elementInstancesProvider - * - * @since 1.20 - * - * @param array $elements - */ - public function testOffsetSet( array $elements ) { - if ( $elements === array() ) { - $this->assertTrue( true ); - - return; - } - - $list = $this->getNew(); - - $element = reset( $elements ); - $list->offsetSet( 42, $element ); - $this->assertEquals( $element, $list->offsetGet( 42 ) ); - - $list = $this->getNew(); - - $element = reset( $elements ); - $list['oHai'] = $element; - $this->assertEquals( $element, $list['oHai'] ); - - $list = $this->getNew(); - - $element = reset( $elements ); - $list->offsetSet( 9001, $element ); - $this->assertEquals( $element, $list[9001] ); - - $list = $this->getNew(); - - $element = reset( $elements ); - $list->offsetSet( null, $element ); - $this->assertEquals( $element, $list[0] ); - - $list = $this->getNew(); - $offset = 0; - - foreach ( $elements as $element ) { - $list->offsetSet( null, $element ); - $this->assertEquals( $element, $list[$offset++] ); - } - - $this->assertEquals( count( $elements ), $list->count() ); - - $this->checkTypeChecks( function ( GenericArrayObject $list, $element ) { - $list->offsetSet( mt_rand(), $element ); - } ); - } - - /** - * @dataProvider instanceProvider - * - * @since 1.21 - * - * @param GenericArrayObject $list - */ - public function testSerialization( GenericArrayObject $list ) { - $serialization = serialize( $list ); - $copy = unserialize( $serialization ); - - $this->assertEquals( $serialization, serialize( $copy ) ); - $this->assertEquals( count( $list ), count( $copy ) ); - - $list = $list->getArrayCopy(); - $copy = $copy->getArrayCopy(); - - $this->assertArrayEquals( $list, $copy, true, true ); - } -} diff --git a/tests/phpunit/includes/libs/IEUrlExtensionTest.php b/tests/phpunit/includes/libs/IEUrlExtensionTest.php deleted file mode 100644 index 66fe915a..00000000 --- a/tests/phpunit/includes/libs/IEUrlExtensionTest.php +++ /dev/null @@ -1,126 +0,0 @@ -assertEquals( - 'y', - IEUrlExtension::findIE6Extension( 'x.y' ), - 'Simple extension' - ); - } - - public function testSimpleNoExt() { - $this->assertEquals( - '', - IEUrlExtension::findIE6Extension( 'x' ), - 'No extension' - ); - } - - public function testEmpty() { - $this->assertEquals( - '', - IEUrlExtension::findIE6Extension( '' ), - 'Empty string' - ); - } - - public function testQuestionMark() { - $this->assertEquals( - '', - IEUrlExtension::findIE6Extension( '?' ), - 'Question mark only' - ); - } - - public function testExtQuestionMark() { - $this->assertEquals( - 'x', - IEUrlExtension::findIE6Extension( '.x?' ), - 'Extension then question mark' - ); - } - - public function testQuestionMarkExt() { - $this->assertEquals( - 'x', - IEUrlExtension::findIE6Extension( '?.x' ), - 'Question mark then extension' - ); - } - - public function testInvalidChar() { - $this->assertEquals( - '', - IEUrlExtension::findIE6Extension( '.x*' ), - 'Extension with invalid character' - ); - } - - public function testInvalidCharThenExtension() { - $this->assertEquals( - 'x', - IEUrlExtension::findIE6Extension( '*.x' ), - 'Invalid character followed by an extension' - ); - } - - public function testMultipleQuestionMarks() { - $this->assertEquals( - 'c', - IEUrlExtension::findIE6Extension( 'a?b?.c?.d?e?f' ), - 'Multiple question marks' - ); - } - - public function testExeException() { - $this->assertEquals( - 'd', - IEUrlExtension::findIE6Extension( 'a?b?.exe?.d?.e' ), - '.exe exception' - ); - } - - public function testExeException2() { - $this->assertEquals( - 'exe', - IEUrlExtension::findIE6Extension( 'a?b?.exe' ), - '.exe exception 2' - ); - } - - public function testHash() { - $this->assertEquals( - '', - IEUrlExtension::findIE6Extension( 'a#b.c' ), - 'Hash character preceding extension' - ); - } - - public function testHash2() { - $this->assertEquals( - '', - IEUrlExtension::findIE6Extension( 'a?#b.c' ), - 'Hash character preceding extension 2' - ); - } - - public function testDotAtEnd() { - $this->assertEquals( - '', - IEUrlExtension::findIE6Extension( '.' ), - 'Dot at end of string' - ); - } - - public function testTwoDots() { - $this->assertEquals( - 'z', - IEUrlExtension::findIE6Extension( 'x.y.z' ), - 'Two dots' - ); - } -} diff --git a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php deleted file mode 100644 index ab72e361..00000000 --- a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php +++ /dev/null @@ -1,170 +0,0 @@ - bar", "" ), - array( "--> Foo", "" ), - array( "x --> y", "x-->y" ), - - // Semicolon insertion - array( "(function(){return\nx;})", "(function(){return\nx;})" ), - array( "throw\nx;", "throw\nx;" ), - array( "while(p){continue\nx;}", "while(p){continue\nx;}" ), - array( "while(p){break\nx;}", "while(p){break\nx;}" ), - array( "var\nx;", "var x;" ), - array( "x\ny;", "x\ny;" ), - array( "x\n++y;", "x\n++y;" ), - array( "x\n!y;", "x\n!y;" ), - array( "x\n{y}", "x\n{y}" ), - array( "x\n+y;", "x+y;" ), - array( "x\n(y);", "x(y);" ), - array( "5.\nx;", "5.\nx;" ), - array( "0xFF.\nx;", "0xFF.x;" ), - array( "5.3.\nx;", "5.3.x;" ), - - // Semicolon insertion between an expression having an inline - // comment after it, and a statement on the next line (bug 27046). - array( "var a = this //foo bar \n for ( b = 0; c < d; b++ ) {}", "var a=this\nfor(b=0;cparse( $minified, 'minify-test.js', 1 ); - - $this->assertEquals( $expectedOutput, $minified, "Minified output should be in the form expected." ); - } - - public static function provideBug32548() { - return array( - array( - // This one gets interpreted all together by the prior code; - // no break at the 'E' happens. - '1.23456789E55', - ), - array( - // This one breaks under the bad code; splits between 'E' and '+' - '1.23456789E+5', - ), - array( - // This one breaks under the bad code; splits between 'E' and '-' - '1.23456789E-5', - ), - ); - } - - /** - * @dataProvider provideBug32548 - */ - public function testBug32548Exponent( $num ) { - // Long line breaking was being incorrectly done between the base and - // exponent part of a number, causing a syntax error. The line should - // instead break at the start of the number. - $prefix = 'var longVarName' . str_repeat( '_', 973 ) . '='; - $suffix = ',shortVarName=0;'; - - $input = $prefix . $num . $suffix; - $expected = $prefix . "\n" . $num . $suffix; - - $minified = JavaScriptMinifier::minify( $input ); - - $this->assertEquals( $expected, $minified, "Line breaks must not occur in middle of exponent" ); - } -} diff --git a/tests/phpunit/includes/logging/LogFormatterTest.php b/tests/phpunit/includes/logging/LogFormatterTest.php deleted file mode 100644 index e8ccf433..00000000 --- a/tests/phpunit/includes/logging/LogFormatterTest.php +++ /dev/null @@ -1,207 +0,0 @@ -setMwGlobals( array( - 'wgLogTypes' => array( 'phpunit' ), - 'wgLogActionsHandlers' => array( 'phpunit/test' => 'LogFormatter', - 'phpunit/param' => 'LogFormatter' ), - 'wgUser' => User::newFromName( 'Testuser' ), - 'wgExtensionMessagesFiles' => array( 'LogTests' => __DIR__ . '/LogTests.i18n.php' ), - ) ); - - $wgLang->getLocalisationCache()->recache( $wgLang->getCode() ); - - $this->user = User::newFromName( 'Testuser' ); - $this->title = Title::newMainPage(); - - $this->context = new RequestContext(); - $this->context->setUser( $this->user ); - $this->context->setTitle( $this->title ); - $this->context->setLanguage( $wgLang ); - } - - protected function tearDown() { - parent::tearDown(); - - global $wgLang; - $wgLang->getLocalisationCache()->recache( $wgLang->getCode() ); - } - - public function newLogEntry( $action, $params ) { - $logEntry = new ManualLogEntry( 'phpunit', $action ); - $logEntry->setPerformer( $this->user ); - $logEntry->setTarget( $this->title ); - $logEntry->setComment( 'A very good reason' ); - - $logEntry->setParameters( $params ); - - return $logEntry; - } - - public function testNormalLogParams() { - $entry = $this->newLogEntry( 'test', array() ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $formatter->setShowUserToolLinks( false ); - $paramsWithoutTools = $formatter->getMessageParametersForTesting(); - unset( $formatter->parsedParameters ); - - $formatter->setShowUserToolLinks( true ); - $paramsWithTools = $formatter->getMessageParametersForTesting(); - - $userLink = Linker::userLink( - $this->user->getId(), - $this->user->getName() - ); - - $userTools = Linker::userToolLinksRedContribs( - $this->user->getId(), - $this->user->getName(), - $this->user->getEditCount() - ); - - $titleLink = Linker::link( $this->title, null, array(), array() ); - - // $paramsWithoutTools and $paramsWithTools should be only different - // in index 0 - $this->assertEquals( $paramsWithoutTools[1], $paramsWithTools[1] ); - $this->assertEquals( $paramsWithoutTools[2], $paramsWithTools[2] ); - - $this->assertEquals( $userLink, $paramsWithoutTools[0]['raw'] ); - $this->assertEquals( $userLink . $userTools, $paramsWithTools[0]['raw'] ); - - $this->assertEquals( $this->user->getName(), $paramsWithoutTools[1] ); - - $this->assertEquals( $titleLink, $paramsWithoutTools[2]['raw'] ); - } - - public function testLogParamsTypeRaw() { - $params = array( '4:raw:raw' => Linker::link( $this->title, null, array(), array() ) ); - $expected = Linker::link( $this->title, null, array(), array() ); - - $entry = $this->newLogEntry( 'param', $params ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $logParam = $formatter->getActionText(); - - $this->assertEquals( $expected, $logParam ); - } - - public function testLogParamsTypeMsg() { - $params = array( '4:msg:msg' => 'log-description-phpunit' ); - $expected = wfMessage( 'log-description-phpunit' )->text(); - - $entry = $this->newLogEntry( 'param', $params ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $logParam = $formatter->getActionText(); - - $this->assertEquals( $expected, $logParam ); - } - - public function testLogParamsTypeMsgContent() { - $params = array( '4:msg-content:msgContent' => 'log-description-phpunit' ); - $expected = wfMessage( 'log-description-phpunit' )->inContentLanguage()->text(); - - $entry = $this->newLogEntry( 'param', $params ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $logParam = $formatter->getActionText(); - - $this->assertEquals( $expected, $logParam ); - } - - public function testLogParamsTypeNumber() { - global $wgLang; - - $params = array( '4:number:number' => 123456789 ); - $expected = $wgLang->formatNum( 123456789 ); - - $entry = $this->newLogEntry( 'param', $params ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $logParam = $formatter->getActionText(); - - $this->assertEquals( $expected, $logParam ); - } - - public function testLogParamsTypeUserLink() { - $params = array( '4:user-link:userLink' => $this->user->getName() ); - $expected = Linker::userLink( - $this->user->getId(), - $this->user->getName() - ); - - $entry = $this->newLogEntry( 'param', $params ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $logParam = $formatter->getActionText(); - - $this->assertEquals( $expected, $logParam ); - } - - public function testLogParamsTypeTitleLink() { - $params = array( '4:title-link:titleLink' => $this->title->getText() ); - $expected = Linker::link( $this->title, null, array(), array() ); - - $entry = $this->newLogEntry( 'param', $params ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $logParam = $formatter->getActionText(); - - $this->assertEquals( $expected, $logParam ); - } - - public function testLogParamsTypePlain() { - $params = array( '4:plain:plain' => 'Some plain text' ); - $expected = 'Some plain text'; - - $entry = $this->newLogEntry( 'param', $params ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $logParam = $formatter->getActionText(); - - $this->assertEquals( $expected, $logParam ); - } - - public function testLogComment() { - $entry = $this->newLogEntry( 'test', array() ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $comment = ltrim( Linker::commentBlock( $entry->getComment() ) ); - - $this->assertEquals( $comment, $formatter->getComment() ); - } -} diff --git a/tests/phpunit/includes/logging/LogTests.i18n.php b/tests/phpunit/includes/logging/LogTests.i18n.php deleted file mode 100644 index 78787ba1..00000000 --- a/tests/phpunit/includes/logging/LogTests.i18n.php +++ /dev/null @@ -1,15 +0,0 @@ - 'PHPUnit-log', - 'log-description-phpunit' => 'Log for PHPUnit-tests', - 'logentry-phpunit-test' => '$1 {{GENDER:$2|tests}} with page $3', - 'logentry-phpunit-param' => '$4', -); diff --git a/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php b/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php deleted file mode 100644 index a0e63a8a..00000000 --- a/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php +++ /dev/null @@ -1,167 +0,0 @@ -setMwGlobals( 'wgShowEXIF', false ); - - $this->filePath = __DIR__ . '/../../data/media/'; - } - - /** - * Test if having conflicting metadata values from different - * types of metadata, that the right one takes precedence. - * - * Basically the file has IPTC and XMP metadata, the - * IPTC should override the XMP, except for the multilingual - * translation (to en) where XMP should win. - * @covers BitmapMetadataHandler::Jpeg - */ - public function testMultilingualCascade() { - if ( !extension_loaded( 'exif' ) ) { - $this->markTestSkipped( "This test needs the exif extension." ); - } - if ( !extension_loaded( 'xml' ) ) { - $this->markTestSkipped( "This test needs the xml extension." ); - } - - $this->setMwGlobals( 'wgShowEXIF', true ); - - $meta = BitmapMetadataHandler::Jpeg( $this->filePath . - '/Xmp-exif-multilingual_test.jpg' ); - - $expected = array( - 'x-default' => 'right(iptc)', - 'en' => 'right translation', - '_type' => 'lang' - ); - - $this->assertArrayHasKey( 'ImageDescription', $meta, - 'Did not extract any ImageDescription info?!' ); - - $this->assertEquals( $expected, $meta['ImageDescription'] ); - } - - /** - * Test for jpeg comments are being handled by - * BitmapMetadataHandler correctly. - * - * There's more extensive tests of comment extraction in - * JpegMetadataExtractorTests.php - * @covers BitmapMetadataHandler::Jpeg - */ - public function testJpegComment() { - $meta = BitmapMetadataHandler::Jpeg( $this->filePath . - 'jpeg-comment-utf.jpg' ); - - $this->assertEquals( 'UTF-8 JPEG Comment — ¼', - $meta['JPEGFileComment'][0] ); - } - - /** - * Make sure a bad iptc block doesn't stop the other metadata - * from being extracted. - * @covers BitmapMetadataHandler::Jpeg - */ - public function testBadIPTC() { - $meta = BitmapMetadataHandler::Jpeg( $this->filePath . - 'iptc-invalid-psir.jpg' ); - $this->assertEquals( 'Created with GIMP', $meta['JPEGFileComment'][0] ); - } - - /** - * @covers BitmapMetadataHandler::Jpeg - */ - public function testIPTCDates() { - $meta = BitmapMetadataHandler::Jpeg( $this->filePath . - 'iptc-timetest.jpg' ); - - $this->assertEquals( '2020:07:14 01:36:05', $meta['DateTimeDigitized'] ); - $this->assertEquals( '1997:03:02 00:01:02', $meta['DateTimeOriginal'] ); - } - - /** - * File has an invalid time (+ one valid but really weird time) - * that shouldn't be included - * @covers BitmapMetadataHandler::Jpeg - */ - public function testIPTCDatesInvalid() { - $meta = BitmapMetadataHandler::Jpeg( $this->filePath . - 'iptc-timetest-invalid.jpg' ); - - $this->assertEquals( '1845:03:02 00:01:02', $meta['DateTimeOriginal'] ); - $this->assertFalse( isset( $meta['DateTimeDigitized'] ) ); - } - - /** - * XMP data should take priority over iptc data - * when hash has been updated, but not when - * the hash is wrong. - * @covers BitmapMetadataHandler::addMetadata - * @covers BitmapMetadataHandler::getMetadataArray - */ - public function testMerging() { - $merger = new BitmapMetadataHandler(); - $merger->addMetadata( array( 'foo' => 'xmp' ), 'xmp-general' ); - $merger->addMetadata( array( 'bar' => 'xmp' ), 'xmp-general' ); - $merger->addMetadata( array( 'baz' => 'xmp' ), 'xmp-general' ); - $merger->addMetadata( array( 'fred' => 'xmp' ), 'xmp-general' ); - $merger->addMetadata( array( 'foo' => 'iptc (hash)' ), 'iptc-good-hash' ); - $merger->addMetadata( array( 'bar' => 'iptc (bad hash)' ), 'iptc-bad-hash' ); - $merger->addMetadata( array( 'baz' => 'iptc (bad hash)' ), 'iptc-bad-hash' ); - $merger->addMetadata( array( 'fred' => 'iptc (no hash)' ), 'iptc-no-hash' ); - $merger->addMetadata( array( 'baz' => 'exif' ), 'exif' ); - - $actual = $merger->getMetadataArray(); - $expected = array( - 'foo' => 'xmp', - 'bar' => 'iptc (bad hash)', - 'baz' => 'exif', - 'fred' => 'xmp', - ); - $this->assertEquals( $expected, $actual ); - } - - /** - * @covers BitmapMetadataHandler::png - */ - public function testPNGXMP() { - if ( !extension_loaded( 'xml' ) ) { - $this->markTestSkipped( "This test needs the xml extension." ); - } - $handler = new BitmapMetadataHandler(); - $result = $handler->png( $this->filePath . 'xmp.png' ); - $expected = array( - 'frameCount' => 0, - 'loopCount' => 1, - 'duration' => 0, - 'bitDepth' => 1, - 'colorType' => 'index-coloured', - 'metadata' => array( - 'SerialNumber' => '123456789', - '_MW_PNG_VERSION' => 1, - ), - ); - $this->assertEquals( $expected, $result ); - } - - /** - * @covers BitmapMetadataHandler::png - */ - public function testPNGNative() { - $handler = new BitmapMetadataHandler(); - $result = $handler->png( $this->filePath . 'Png-native-test.png' ); - $expected = 'http://example.com/url'; - $this->assertEquals( $expected, $result['metadata']['Identifier']['x-default'] ); - } - - /** - * @covers BitmapMetadataHandler::getTiffByteOrder - */ - public function testTiffByteOrder() { - $handler = new BitmapMetadataHandler(); - $res = $handler->getTiffByteOrder( $this->filePath . 'test.tiff' ); - $this->assertEquals( 'LE', $res ); - } -} diff --git a/tests/phpunit/includes/media/BitmapScalingTest.php b/tests/phpunit/includes/media/BitmapScalingTest.php deleted file mode 100644 index 9395b660..00000000 --- a/tests/phpunit/includes/media/BitmapScalingTest.php +++ /dev/null @@ -1,137 +0,0 @@ -setMwGlobals( array( - 'wgMaxImageArea' => 1.25e7, // 3500x3500 - 'wgCustomConvertCommand' => 'dummy', // Set so that we don't get client side rendering - ) ); - } - - /** - * @dataProvider provideNormaliseParams - * @covers BitmapHandler::normaliseParams - */ - public function testNormaliseParams( $fileDimensions, $expectedParams, $params, $msg ) { - $file = new FakeDimensionFile( $fileDimensions ); - $handler = new BitmapHandler; - $valid = $handler->normaliseParams( $file, $params ); - $this->assertTrue( $valid ); - $this->assertEquals( $expectedParams, $params, $msg ); - } - - public static function provideNormaliseParams() { - return array( - /* Regular resize operations */ - array( - array( 1024, 768 ), - array( - 'width' => 512, 'height' => 384, - 'physicalWidth' => 512, 'physicalHeight' => 384, - 'page' => 1, - ), - array( 'width' => 512 ), - 'Resizing with width set', - ), - array( - array( 1024, 768 ), - array( - 'width' => 512, 'height' => 384, - 'physicalWidth' => 512, 'physicalHeight' => 384, - 'page' => 1, - ), - array( 'width' => 512, 'height' => 768 ), - 'Resizing with height set too high', - ), - array( - array( 1024, 768 ), - array( - 'width' => 512, 'height' => 384, - 'physicalWidth' => 512, 'physicalHeight' => 384, - 'page' => 1, - ), - array( 'width' => 1024, 'height' => 384 ), - 'Resizing with height set', - ), - - /* Very tall images */ - array( - array( 1000, 100 ), - array( - 'width' => 5, 'height' => 1, - 'physicalWidth' => 5, 'physicalHeight' => 1, - 'page' => 1, - ), - array( 'width' => 5 ), - 'Very wide image', - ), - - array( - array( 100, 1000 ), - array( - 'width' => 1, 'height' => 10, - 'physicalWidth' => 1, 'physicalHeight' => 10, - 'page' => 1, - ), - array( 'width' => 1 ), - 'Very high image', - ), - array( - array( 100, 1000 ), - array( - 'width' => 1, 'height' => 5, - 'physicalWidth' => 1, 'physicalHeight' => 10, - 'page' => 1, - ), - array( 'width' => 10, 'height' => 5 ), - 'Very high image with height set', - ), - /* Max image area */ - array( - array( 4000, 4000 ), - array( - 'width' => 5000, 'height' => 5000, - 'physicalWidth' => 4000, 'physicalHeight' => 4000, - 'page' => 1, - ), - array( 'width' => 5000 ), - 'Bigger than max image size but doesn\'t need scaling', - ), - ); - } - - /** - * @covers BitmapHandler::doTransform - */ - public function testTooBigImage() { - $file = new FakeDimensionFile( array( 4000, 4000 ) ); - $handler = new BitmapHandler; - $params = array( 'width' => '3700' ); // Still bigger than max size. - $this->assertEquals( 'TransformParameterError', - get_class( $handler->doTransform( $file, 'dummy path', '', $params ) ) ); - } - - /** - * @covers BitmapHandler::doTransform - */ - public function testTooBigMustRenderImage() { - $file = new FakeDimensionFile( array( 4000, 4000 ) ); - $file->mustRender = true; - $handler = new BitmapHandler; - $params = array( 'width' => '5000' ); // Still bigger than max size. - $this->assertEquals( 'TransformParameterError', - get_class( $handler->doTransform( $file, 'dummy path', '', $params ) ) ); - } - - /** - * @covers BitmapHandler::getImageArea - */ - public function testImageArea() { - $file = new FakeDimensionFile( array( 7, 9 ) ); - $handler = new BitmapHandler; - $this->assertEquals( 63, $handler->getImageArea( $file ) ); - } -} diff --git a/tests/phpunit/includes/media/ExifBitmapTest.php b/tests/phpunit/includes/media/ExifBitmapTest.php deleted file mode 100644 index a2e0eb62..00000000 --- a/tests/phpunit/includes/media/ExifBitmapTest.php +++ /dev/null @@ -1,139 +0,0 @@ -markTestSkipped( "This test needs the exif extension." ); - } - - $this->setMwGlobals( 'wgShowEXIF', true ); - - $this->handler = new ExifBitmapHandler; - - } - - /** - * @covers ExifBitmapHandler::isMetadataValid - */ - public function testIsOldBroken() { - $res = $this->handler->isMetadataValid( null, ExifBitmapHandler::OLD_BROKEN_FILE ); - $this->assertEquals( ExifBitmapHandler::METADATA_COMPATIBLE, $res ); - } - - /** - * @covers ExifBitmapHandler::isMetadataValid - */ - public function testIsBrokenFile() { - $res = $this->handler->isMetadataValid( null, ExifBitmapHandler::BROKEN_FILE ); - $this->assertEquals( ExifBitmapHandler::METADATA_GOOD, $res ); - } - - /** - * @covers ExifBitmapHandler::isMetadataValid - */ - public function testIsInvalid() { - $res = $this->handler->isMetadataValid( null, 'Something Invalid Here.' ); - $this->assertEquals( ExifBitmapHandler::METADATA_BAD, $res ); - } - - /** - * @covers ExifBitmapHandler::isMetadataValid - */ - public function testGoodMetadata() { - $meta = 'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:2;}'; - $res = $this->handler->isMetadataValid( null, $meta ); - $this->assertEquals( ExifBitmapHandler::METADATA_GOOD, $res ); - } - - /** - * @covers ExifBitmapHandler::isMetadataValid - */ - public function testIsOldGood() { - $meta = 'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:1;}'; - $res = $this->handler->isMetadataValid( null, $meta ); - $this->assertEquals( ExifBitmapHandler::METADATA_COMPATIBLE, $res ); - } - - /** - * Handle metadata from paged tiff handler (gotten via instant commons) gracefully. - * @covers ExifBitmapHandler::isMetadataValid - */ - public function testPagedTiffHandledGracefully() { - $meta = 'a:6:{s:9:"page_data";a:1:{i:1;a:5:{s:5:"width";i:643;s:6:"height";i:448;s:5:"alpha";s:4:"true";s:4:"page";i:1;s:6:"pixels";i:288064;}}s:10:"page_count";i:1;s:10:"first_page";i:1;s:9:"last_page";i:1;s:4:"exif";a:9:{s:10:"ImageWidth";i:643;s:11:"ImageLength";i:448;s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:4;s:12:"RowsPerStrip";i:50;s:19:"PlanarConfiguration";i:1;s:22:"MEDIAWIKI_EXIF_VERSION";i:1;}s:21:"TIFF_METADATA_VERSION";s:3:"1.4";}'; - $res = $this->handler->isMetadataValid( null, $meta ); - $this->assertEquals( ExifBitmapHandler::METADATA_BAD, $res ); - } - - /** - * @covers ExifBitmapHandler::convertMetadataVersion - */ - public function testConvertMetadataLatest() { - $metadata = array( - 'foo' => array( 'First', 'Second', '_type' => 'ol' ), - 'MEDIAWIKI_EXIF_VERSION' => 2 - ); - $res = $this->handler->convertMetadataVersion( $metadata, 2 ); - $this->assertEquals( $metadata, $res ); - } - - /** - * @covers ExifBitmapHandler::convertMetadataVersion - */ - public function testConvertMetadataToOld() { - $metadata = array( - 'foo' => array( 'First', 'Second', '_type' => 'ol' ), - 'bar' => array( 'First', 'Second', '_type' => 'ul' ), - 'baz' => array( 'First', 'Second' ), - 'fred' => 'Single', - 'MEDIAWIKI_EXIF_VERSION' => 2, - ); - $expected = array( - 'foo' => "\n#First\n#Second", - 'bar' => "\n*First\n*Second", - 'baz' => "\n*First\n*Second", - 'fred' => 'Single', - 'MEDIAWIKI_EXIF_VERSION' => 1, - ); - $res = $this->handler->convertMetadataVersion( $metadata, 1 ); - $this->assertEquals( $expected, $res ); - } - - /** - * @covers ExifBitmapHandler::convertMetadataVersion - */ - public function testConvertMetadataSoftware() { - $metadata = array( - 'Software' => array( array( 'GIMP', '1.1' ) ), - 'MEDIAWIKI_EXIF_VERSION' => 2, - ); - $expected = array( - 'Software' => 'GIMP (Version 1.1)', - 'MEDIAWIKI_EXIF_VERSION' => 1, - ); - $res = $this->handler->convertMetadataVersion( $metadata, 1 ); - $this->assertEquals( $expected, $res ); - } - - /** - * @covers ExifBitmapHandler::convertMetadataVersion - */ - public function testConvertMetadataSoftwareNormal() { - $metadata = array( - 'Software' => array( "GIMP 1.2", "vim" ), - 'MEDIAWIKI_EXIF_VERSION' => 2, - ); - $expected = array( - 'Software' => "\n*GIMP 1.2\n*vim", - 'MEDIAWIKI_EXIF_VERSION' => 1, - ); - $res = $this->handler->convertMetadataVersion( $metadata, 1 ); - $this->assertEquals( $expected, $res ); - } -} diff --git a/tests/phpunit/includes/media/ExifRotationTest.php b/tests/phpunit/includes/media/ExifRotationTest.php deleted file mode 100644 index 64276d92..00000000 --- a/tests/phpunit/includes/media/ExifRotationTest.php +++ /dev/null @@ -1,248 +0,0 @@ -markTestSkipped( "This test needs the exif extension." ); - } - - $this->handler = new BitmapHandler(); - $filePath = __DIR__ . '/../../data/media'; - - $tmpDir = $this->getNewTempDirectory(); - - $this->repo = new FSRepo( array( - 'name' => 'temp', - 'url' => 'http://localhost/thumbtest', - 'backend' => new FSFileBackend( array( - 'name' => 'localtesting', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array( 'temp-thumb' => $tmpDir, 'data' => $filePath ) - ) ) - ) ); - - $this->setMwGlobals( array( - 'wgShowEXIF' => true, - 'wgEnableAutoRotation' => true, - ) ); - } - - /** - * @dataProvider provideFiles - */ - public function testMetadata( $name, $type, $info ) { - if ( !BitmapHandler::canRotate() ) { - $this->markTestSkipped( "This test needs a rasterizer that can auto-rotate." ); - } - $file = $this->dataFile( $name, $type ); - $this->assertEquals( $info['width'], $file->getWidth(), "$name: width check" ); - $this->assertEquals( $info['height'], $file->getHeight(), "$name: height check" ); - } - - /** - * - * @dataProvider provideFiles - */ - public function testRotationRendering( $name, $type, $info, $thumbs ) { - if ( !BitmapHandler::canRotate() ) { - $this->markTestSkipped( "This test needs a rasterizer that can auto-rotate." ); - } - foreach ( $thumbs as $size => $out ) { - if ( preg_match( '/^(\d+)px$/', $size, $matches ) ) { - $params = array( - 'width' => $matches[1], - ); - } elseif ( preg_match( '/^(\d+)x(\d+)px$/', $size, $matches ) ) { - $params = array( - 'width' => $matches[1], - 'height' => $matches[2] - ); - } else { - throw new MWException( 'bogus test data format ' . $size ); - } - - $file = $this->dataFile( $name, $type ); - $thumb = $file->transform( $params, File::RENDER_NOW | File::RENDER_FORCE ); - - $this->assertEquals( $out[0], $thumb->getWidth(), "$name: thumb reported width check for $size" ); - $this->assertEquals( $out[1], $thumb->getHeight(), "$name: thumb reported height check for $size" ); - - $gis = getimagesize( $thumb->getLocalCopyPath() ); - if ( $out[0] > $info['width'] ) { - // Physical image won't be scaled bigger than the original. - $this->assertEquals( $info['width'], $gis[0], "$name: thumb actual width check for $size" ); - $this->assertEquals( $info['height'], $gis[1], "$name: thumb actual height check for $size" ); - } else { - $this->assertEquals( $out[0], $gis[0], "$name: thumb actual width check for $size" ); - $this->assertEquals( $out[1], $gis[1], "$name: thumb actual height check for $size" ); - } - } - } - - /* Utility function */ - private function dataFile( $name, $type ) { - return new UnregisteredLocalFile( false, $this->repo, - "mwstore://localtesting/data/$name", $type ); - } - - public static function provideFiles() { - return array( - array( - 'landscape-plain.jpg', - 'image/jpeg', - array( - 'width' => 1024, - 'height' => 768, - ), - array( - '800x600px' => array( 800, 600 ), - '9999x800px' => array( 1067, 800 ), - '800px' => array( 800, 600 ), - '600px' => array( 600, 450 ), - ) - ), - array( - 'portrait-rotated.jpg', - 'image/jpeg', - array( - 'width' => 768, // as rotated - 'height' => 1024, // as rotated - ), - array( - '800x600px' => array( 450, 600 ), - '9999x800px' => array( 600, 800 ), - '800px' => array( 800, 1067 ), - '600px' => array( 600, 800 ), - ) - ) - ); - } - - /** - * Same as before, but with auto-rotation disabled. - * @dataProvider provideFilesNoAutoRotate - */ - public function testMetadataNoAutoRotate( $name, $type, $info ) { - $this->setMwGlobals( 'wgEnableAutoRotation', false ); - - $file = $this->dataFile( $name, $type ); - $this->assertEquals( $info['width'], $file->getWidth(), "$name: width check" ); - $this->assertEquals( $info['height'], $file->getHeight(), "$name: height check" ); - } - - /** - * - * @dataProvider provideFilesNoAutoRotate - */ - public function testRotationRenderingNoAutoRotate( $name, $type, $info, $thumbs ) { - $this->setMwGlobals( 'wgEnableAutoRotation', false ); - - foreach ( $thumbs as $size => $out ) { - if ( preg_match( '/^(\d+)px$/', $size, $matches ) ) { - $params = array( - 'width' => $matches[1], - ); - } elseif ( preg_match( '/^(\d+)x(\d+)px$/', $size, $matches ) ) { - $params = array( - 'width' => $matches[1], - 'height' => $matches[2] - ); - } else { - throw new MWException( 'bogus test data format ' . $size ); - } - - $file = $this->dataFile( $name, $type ); - $thumb = $file->transform( $params, File::RENDER_NOW | File::RENDER_FORCE ); - - $this->assertEquals( $out[0], $thumb->getWidth(), "$name: thumb reported width check for $size" ); - $this->assertEquals( $out[1], $thumb->getHeight(), "$name: thumb reported height check for $size" ); - - $gis = getimagesize( $thumb->getLocalCopyPath() ); - if ( $out[0] > $info['width'] ) { - // Physical image won't be scaled bigger than the original. - $this->assertEquals( $info['width'], $gis[0], "$name: thumb actual width check for $size" ); - $this->assertEquals( $info['height'], $gis[1], "$name: thumb actual height check for $size" ); - } else { - $this->assertEquals( $out[0], $gis[0], "$name: thumb actual width check for $size" ); - $this->assertEquals( $out[1], $gis[1], "$name: thumb actual height check for $size" ); - } - } - } - - public static function provideFilesNoAutoRotate() { - return array( - array( - 'landscape-plain.jpg', - 'image/jpeg', - array( - 'width' => 1024, - 'height' => 768, - ), - array( - '800x600px' => array( 800, 600 ), - '9999x800px' => array( 1067, 800 ), - '800px' => array( 800, 600 ), - '600px' => array( 600, 450 ), - ) - ), - array( - 'portrait-rotated.jpg', - 'image/jpeg', - array( - 'width' => 1024, // since not rotated - 'height' => 768, // since not rotated - ), - array( - '800x600px' => array( 800, 600 ), - '9999x800px' => array( 1067, 800 ), - '800px' => array( 800, 600 ), - '600px' => array( 600, 450 ), - ) - ) - ); - } - - - const TEST_WIDTH = 100; - const TEST_HEIGHT = 200; - - /** - * @dataProvider provideBitmapExtractPreRotationDimensions - */ - public function testBitmapExtractPreRotationDimensions( $rotation, $expected ) { - $result = $this->handler->extractPreRotationDimensions( array( - 'physicalWidth' => self::TEST_WIDTH, - 'physicalHeight' => self::TEST_HEIGHT, - ), $rotation ); - $this->assertEquals( $expected, $result ); - } - - public static function provideBitmapExtractPreRotationDimensions() { - return array( - array( - 0, - array( self::TEST_WIDTH, self::TEST_HEIGHT ) - ), - array( - 90, - array( self::TEST_HEIGHT, self::TEST_WIDTH ) - ), - array( - 180, - array( self::TEST_WIDTH, self::TEST_HEIGHT ) - ), - array( - 270, - array( self::TEST_HEIGHT, self::TEST_WIDTH ) - ), - ); - } -} diff --git a/tests/phpunit/includes/media/ExifTest.php b/tests/phpunit/includes/media/ExifTest.php deleted file mode 100644 index dea36b03..00000000 --- a/tests/phpunit/includes/media/ExifTest.php +++ /dev/null @@ -1,46 +0,0 @@ -markTestSkipped( "This test needs the exif extension." ); - } - - $this->mediaPath = __DIR__ . '/../../data/media/'; - - - - $this->setMwGlobals( 'wgShowEXIF', true ); - } - - public function testGPSExtraction() { - $filename = $this->mediaPath . 'exif-gps.jpg'; - $seg = JpegMetadataExtractor::segmentSplitter( $filename ); - $exif = new Exif( $filename, $seg['byteOrder'] ); - $data = $exif->getFilteredData(); - $expected = array( - 'GPSLatitude' => 88.5180555556, - 'GPSLongitude' => -21.12357, - 'GPSAltitude' => -3.141592653, - 'GPSDOP' => '5/1', - 'GPSVersionID' => '2.2.0.0', - ); - $this->assertEquals( $expected, $data, '', 0.0000000001 ); - } - - public function testUnicodeUserComment() { - $filename = $this->mediaPath . 'exif-user-comment.jpg'; - $seg = JpegMetadataExtractor::segmentSplitter( $filename ); - $exif = new Exif( $filename, $seg['byteOrder'] ); - $data = $exif->getFilteredData(); - - $expected = array( - 'UserComment' => 'test⁔comment' - ); - $this->assertEquals( $expected, $data ); - } -} diff --git a/tests/phpunit/includes/media/FakeDimensionFile.php b/tests/phpunit/includes/media/FakeDimensionFile.php deleted file mode 100644 index 7926000b..00000000 --- a/tests/phpunit/includes/media/FakeDimensionFile.php +++ /dev/null @@ -1,28 +0,0 @@ -dimensions = $dimensions; - } - - public function getWidth( $page = 1 ) { - return $this->dimensions[0]; - } - - public function getHeight( $page = 1 ) { - return $this->dimensions[1]; - } - - public function mustRender() { - return $this->mustRender; - } - - public function getPath() { - return ''; - } -} \ No newline at end of file diff --git a/tests/phpunit/includes/media/FormatMetadataTest.php b/tests/phpunit/includes/media/FormatMetadataTest.php deleted file mode 100644 index a073e4ca..00000000 --- a/tests/phpunit/includes/media/FormatMetadataTest.php +++ /dev/null @@ -1,59 +0,0 @@ -markTestSkipped( "This test needs the exif extension." ); - } - $filePath = __DIR__ . '/../../data/media'; - $this->backend = new FSFileBackend( array( - 'name' => 'localtesting', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array( 'data' => $filePath ) - ) ); - $this->repo = new FSRepo( array( - 'name' => 'temp', - 'url' => 'http://localhost/thumbtest', - 'backend' => $this->backend - ) ); - - $this->setMwGlobals( 'wgShowEXIF', true ); - } - - public function testInvalidDate() { - $file = $this->dataFile( 'broken_exif_date.jpg', 'image/jpeg' ); - - // Throws an error if bug hit - $meta = $file->formatMetadata(); - $this->assertNotEquals( false, $meta, 'Valid metadata extracted' ); - - // Find date exif entry - $this->assertArrayHasKey( 'visible', $meta ); - $dateIndex = null; - foreach ( $meta['visible'] as $i => $data ) { - if ( $data['id'] == 'exif-datetimeoriginal' ) { - $dateIndex = $i; - } - } - $this->assertNotNull( $dateIndex, 'Date entry exists in metadata' ); - $this->assertEquals( '0000:01:00 00:02:27', - $meta['visible'][$dateIndex]['value'], - 'File with invalid date metadata (bug 29471)' ); - } - - private function dataFile( $name, $type ) { - return new UnregisteredLocalFile( false, $this->repo, - "mwstore://localtesting/data/$name", $type ); - } -} diff --git a/tests/phpunit/includes/media/GIFMetadataExtractorTest.php b/tests/phpunit/includes/media/GIFMetadataExtractorTest.php deleted file mode 100644 index 9e3f9244..00000000 --- a/tests/phpunit/includes/media/GIFMetadataExtractorTest.php +++ /dev/null @@ -1,107 +0,0 @@ -mediaPath = __DIR__ . '/../../data/media/'; - } - - /** - * Put in a file, and see if the metadata coming out is as expected. - * @param $filename String - * @param $expected Array The extracted metadata. - * @dataProvider provideGetMetadata - * @covers GIFMetadataExtractor::getMetadata - */ - public function testGetMetadata( $filename, $expected ) { - $actual = GIFMetadataExtractor::getMetadata( $this->mediaPath . $filename ); - $this->assertEquals( $expected, $actual ); - } - - public static function provideGetMetadata() { - - $xmpNugget = << - - - - - The interwebs - - - - Bawolff - - - A file to test GIF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -EOF; - $xmpNugget = str_replace( "\r", '', $xmpNugget ); // Windows compat - - return array( - array( - 'nonanimated.gif', - array( - 'comment' => array( 'GIF test file ⁕ Created with GIMP' ), - 'duration' => 0.1, - 'frameCount' => 1, - 'looped' => false, - 'xmp' => '', - ) - ), - array( - 'animated.gif', - array( - 'comment' => array( 'GIF test file . Created with GIMP' ), - 'duration' => 2.4, - 'frameCount' => 4, - 'looped' => true, - 'xmp' => '', - ) - ), - - array( - 'animated-xmp.gif', - array( - 'xmp' => $xmpNugget, - 'duration' => 2.4, - 'frameCount' => 4, - 'looped' => true, - 'comment' => array( 'GIƒ·test·file' ), - ) - ), - ); - } -} diff --git a/tests/phpunit/includes/media/GIFTest.php b/tests/phpunit/includes/media/GIFTest.php deleted file mode 100644 index c8e729c8..00000000 --- a/tests/phpunit/includes/media/GIFTest.php +++ /dev/null @@ -1,120 +0,0 @@ -filePath = __DIR__ . '/../../data/media'; - $this->backend = new FSFileBackend( array( - 'name' => 'localtesting', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array( 'data' => $this->filePath ) - ) ); - $this->repo = new FSRepo( array( - 'name' => 'temp', - 'url' => 'http://localhost/thumbtest', - 'backend' => $this->backend - ) ); - $this->handler = new GIFHandler(); - } - - /** - * @covers GIFHandler::getMetadata - */ - public function testInvalidFile() { - $res = $this->handler->getMetadata( null, $this->filePath . '/README' ); - $this->assertEquals( GIFHandler::BROKEN_FILE, $res ); - } - - /** - * @param $filename String basename of the file to check - * @param $expected boolean Expected result. - * @dataProvider provideIsAnimated - * @covers GIFHandler::isAnimatedImage - */ - public function testIsAnimanted( $filename, $expected ) { - $file = $this->dataFile( $filename, 'image/gif' ); - $actual = $this->handler->isAnimatedImage( $file ); - $this->assertEquals( $expected, $actual ); - } - - public static function provideIsAnimated() { - return array( - array( 'animated.gif', true ), - array( 'nonanimated.gif', false ), - ); - } - - /** - * @param $filename String - * @param $expected Integer Total image area - * @dataProvider provideGetImageArea - * @covers GIFHandler::getImageArea - */ - public function testGetImageArea( $filename, $expected ) { - $file = $this->dataFile( $filename, 'image/gif' ); - $actual = $this->handler->getImageArea( $file, $file->getWidth(), $file->getHeight() ); - $this->assertEquals( $expected, $actual ); - } - - public static function provideGetImageArea() { - return array( - array( 'animated.gif', 5400 ), - array( 'nonanimated.gif', 1350 ), - ); - } - - /** - * @param $metadata String Serialized metadata - * @param $expected Integer One of the class constants of GIFHandler - * @dataProvider provideIsMetadataValid - * @covers GIFHandler::isMetadataValid - */ - public function testIsMetadataValid( $metadata, $expected ) { - $actual = $this->handler->isMetadataValid( null, $metadata ); - $this->assertEquals( $expected, $actual ); - } - - public static function provideIsMetadataValid() { - return array( - array( GIFHandler::BROKEN_FILE, GIFHandler::METADATA_GOOD ), - array( '', GIFHandler::METADATA_BAD ), - array( null, GIFHandler::METADATA_BAD ), - array( 'Something invalid!', GIFHandler::METADATA_BAD ), - array( 'a:4:{s:10:"frameCount";i:1;s:6:"looped";b:0;s:8:"duration";d:0.1000000000000000055511151231257827021181583404541015625;s:8:"metadata";a:2:{s:14:"GIFFileComment";a:1:{i:0;s:35:"GIF test file ⁕ Created with GIMP";}s:15:"_MW_GIF_VERSION";i:1;}}', GIFHandler::METADATA_GOOD ), - ); - } - - /** - * @param $filename String - * @param $expected String Serialized array - * @dataProvider provideGetMetadata - * @covers GIFHandler::getMetadata - */ - public function testGetMetadata( $filename, $expected ) { - $file = $this->dataFile( $filename, 'image/gif' ); - $actual = $this->handler->getMetadata( $file, "$this->filePath/$filename" ); - $this->assertEquals( unserialize( $expected ), unserialize( $actual ) ); - } - - public static function provideGetMetadata() { - return array( - array( 'nonanimated.gif', 'a:4:{s:10:"frameCount";i:1;s:6:"looped";b:0;s:8:"duration";d:0.1000000000000000055511151231257827021181583404541015625;s:8:"metadata";a:2:{s:14:"GIFFileComment";a:1:{i:0;s:35:"GIF test file ⁕ Created with GIMP";}s:15:"_MW_GIF_VERSION";i:1;}}' ), - array( 'animated-xmp.gif', 'a:4:{s:10:"frameCount";i:4;s:6:"looped";b:1;s:8:"duration";d:2.399999999999999911182158029987476766109466552734375;s:8:"metadata";a:5:{s:6:"Artist";s:7:"Bawolff";s:16:"ImageDescription";a:2:{s:9:"x-default";s:18:"A file to test GIF";s:5:"_type";s:4:"lang";}s:15:"SublocationDest";s:13:"The interwebs";s:14:"GIFFileComment";a:1:{i:0;s:16:"GIƒ·test·file";}s:15:"_MW_GIF_VERSION";i:1;}}' ), - ); - } - - private function dataFile( $name, $type ) { - return new UnregisteredLocalFile( false, $this->repo, - "mwstore://localtesting/data/$name", $type ); - } -} diff --git a/tests/phpunit/includes/media/IPTCTest.php b/tests/phpunit/includes/media/IPTCTest.php deleted file mode 100644 index 81c1d287..00000000 --- a/tests/phpunit/includes/media/IPTCTest.php +++ /dev/null @@ -1,81 +0,0 @@ -assertEquals( 'UTF-8', $res ); - } - - /** - * @covers IPTC::Parse - */ - public function testIPTCParseNoCharset88591() { - // basically IPTC for keyword with value of 0xBC which is 1/4 in iso-8859-1 - // This data doesn't specify a charset. We're supposed to guess - // (which basically means utf-8 if valid, windows 1252 (iso 8859-1) if not) - $iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x06\x1c\x02\x19\x00\x01\xBC"; - $res = IPTC::Parse( $iptcData ); - $this->assertEquals( array( '¼' ), $res['Keywords'] ); - } - - /** - * @covers IPTC::Parse - */ - public function testIPTCParseNoCharset88591b() { - /* This one contains a sequence that's valid iso 8859-1 but not valid utf8 */ - /* \xC3 = Ã, \xB8 = ¸ */ - $iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x09\x1c\x02\x19\x00\x04\xC3\xC3\xC3\xB8"; - $res = IPTC::Parse( $iptcData ); - $this->assertEquals( array( 'ÃÃø' ), $res['Keywords'] ); - } - - /** - * Same as testIPTCParseNoCharset88591b, but forcing the charset to utf-8. - * What should happen is the first "\xC3\xC3" should be dropped as invalid, - * leaving \xC3\xB8, which is ø - * @covers IPTC::Parse - */ - public function testIPTCParseForcedUTFButInvalid() { - $iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x11\x1c\x02\x19\x00\x04\xC3\xC3\xC3\xB8" - . "\x1c\x01\x5A\x00\x03\x1B\x25\x47"; - $res = IPTC::Parse( $iptcData ); - $this->assertEquals( array( 'ø' ), $res['Keywords'] ); - } - - /** - * @covers IPTC::Parse - */ - public function testIPTCParseNoCharsetUTF8() { - $iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x07\x1c\x02\x19\x00\x02¼"; - $res = IPTC::Parse( $iptcData ); - $this->assertEquals( array( '¼' ), $res['Keywords'] ); - } - - /** - * Testing something that has 2 values for keyword - * @covers IPTC::Parse - */ - public function testIPTCParseMulti() { - $iptcData = /* identifier */ "Photoshop 3.0\08BIM\4\4" - /* length */ . "\0\0\0\0\0\x0D" - . "\x1c\x02\x19" . "\x00\x01" . "\xBC" - . "\x1c\x02\x19" . "\x00\x02" . "\xBC\xBD"; - $res = IPTC::Parse( $iptcData ); - $this->assertEquals( array( '¼', '¼½' ), $res['Keywords'] ); - } - - /** - * @covers IPTC::Parse - */ - public function testIPTCParseUTF8() { - // This has the magic "\x1c\x01\x5A\x00\x03\x1B\x25\x47" which marks content as UTF8. - $iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x0F\x1c\x02\x19\x00\x02¼\x1c\x01\x5A\x00\x03\x1B\x25\x47"; - $res = IPTC::Parse( $iptcData ); - $this->assertEquals( array( '¼' ), $res['Keywords'] ); - } -} diff --git a/tests/phpunit/includes/media/JpegMetadataExtractorTest.php b/tests/phpunit/includes/media/JpegMetadataExtractorTest.php deleted file mode 100644 index eafc8a2e..00000000 --- a/tests/phpunit/includes/media/JpegMetadataExtractorTest.php +++ /dev/null @@ -1,109 +0,0 @@ -filePath = __DIR__ . '/../../data/media/'; - } - - /** - * We also use this test to test padding bytes don't - * screw stuff up - * - * @param string $file filename - * - * @dataProvider provideUtf8Comment - */ - public function testUtf8Comment( $file ) { - $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . $file ); - $this->assertEquals( array( 'UTF-8 JPEG Comment — ¼' ), $res['COM'] ); - } - - public static function provideUtf8Comment() { - return array( - array( 'jpeg-comment-utf.jpg' ), - array( 'jpeg-padding-even.jpg' ), - array( 'jpeg-padding-odd.jpg' ), - ); - } - - /** The file is iso-8859-1, but it should get auto converted */ - public function testIso88591Comment() { - $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-comment-iso8859-1.jpg' ); - $this->assertEquals( array( 'ISO-8859-1 JPEG Comment - ¼' ), $res['COM'] ); - } - - /** Comment values that are non-textual (random binary junk) should not be shown. - * The example test file has a comment with a 0x5 byte in it which is a control character - * and considered binary junk for our purposes. - */ - public function testBinaryCommentStripped() { - $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-comment-binary.jpg' ); - $this->assertEmpty( $res['COM'] ); - } - - /* Very rarely a file can have multiple comments. - * Order of comments is based on order inside the file. - */ - public function testMultipleComment() { - $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-comment-multiple.jpg' ); - $this->assertEquals( array( 'foo', 'bar' ), $res['COM'] ); - } - - public function testXMPExtraction() { - $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-xmp-psir.jpg' ); - $expected = file_get_contents( $this->filePath . 'jpeg-xmp-psir.xmp' ); - $this->assertEquals( $expected, $res['XMP'] ); - } - - public function testPSIRExtraction() { - $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-xmp-psir.jpg' ); - $expected = '50686f746f73686f7020332e30003842494d04040000000000181c02190004746573741c02190003666f6f1c020000020004'; - $this->assertEquals( $expected, bin2hex( $res['PSIR'][0] ) ); - } - - public function testXMPExtractionAltAppId() { - $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-xmp-alt.jpg' ); - $expected = file_get_contents( $this->filePath . 'jpeg-xmp-psir.xmp' ); - $this->assertEquals( $expected, $res['XMP'] ); - } - - - public function testIPTCHashComparisionNoHash() { - $segments = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-xmp-psir.jpg' ); - $res = JpegMetadataExtractor::doPSIR( $segments['PSIR'][0] ); - - $this->assertEquals( 'iptc-no-hash', $res ); - } - - public function testIPTCHashComparisionBadHash() { - $segments = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-iptc-bad-hash.jpg' ); - $res = JpegMetadataExtractor::doPSIR( $segments['PSIR'][0] ); - - $this->assertEquals( 'iptc-bad-hash', $res ); - } - - public function testIPTCHashComparisionGoodHash() { - $segments = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-iptc-good-hash.jpg' ); - $res = JpegMetadataExtractor::doPSIR( $segments['PSIR'][0] ); - - $this->assertEquals( 'iptc-good-hash', $res ); - } - - public function testExifByteOrder() { - $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'exif-user-comment.jpg' ); - $expected = 'BE'; - $this->assertEquals( $expected, $res['byteOrder'] ); - } -} diff --git a/tests/phpunit/includes/media/JpegTest.php b/tests/phpunit/includes/media/JpegTest.php deleted file mode 100644 index 9af4f1e1..00000000 --- a/tests/phpunit/includes/media/JpegTest.php +++ /dev/null @@ -1,33 +0,0 @@ -markTestSkipped( "This test needs the exif extension." ); - } - - $this->filePath = __DIR__ . '/../../data/media/'; - - - $this->setMwGlobals( 'wgShowEXIF', true ); - } - - public function testInvalidFile() { - $jpeg = new JpegHandler; - $res = $jpeg->getMetadata( null, $this->filePath . 'README' ); - $this->assertEquals( ExifBitmapHandler::BROKEN_FILE, $res ); - } - - public function testJpegMetadataExtraction() { - $h = new JpegHandler; - $res = $h->getMetadata( null, $this->filePath . 'test.jpg' ); - $expected = 'a:7:{s:16:"ImageDescription";s:9:"Test file";s:11:"XResolution";s:4:"72/1";s:11:"YResolution";s:4:"72/1";s:14:"ResolutionUnit";i:2;s:16:"YCbCrPositioning";i:1;s:15:"JPEGFileComment";a:1:{i:0;s:17:"Created with GIMP";}s:22:"MEDIAWIKI_EXIF_VERSION";i:2;}'; - - // Unserialize in case serialization format ever changes. - $this->assertEquals( unserialize( $expected ), unserialize( $res ) ); - } -} diff --git a/tests/phpunit/includes/media/MediaHandlerTest.php b/tests/phpunit/includes/media/MediaHandlerTest.php deleted file mode 100644 index c28898bb..00000000 --- a/tests/phpunit/includes/media/MediaHandlerTest.php +++ /dev/null @@ -1,53 +0,0 @@ - 50, - 'height' => 50, - 'tests' => array( - 50 => 50, - 17 => 17, - 18 => 18 ) ), - array( - 'width' => 366, - 'height' => 300, - 'tests' => array( - 50 => 61, - 17 => 21, - 18 => 22 ) ), - array( - 'width' => 300, - 'height' => 366, - 'tests' => array( - 50 => 41, - 17 => 14, - 18 => 15 ) ), - array( - 'width' => 100, - 'height' => 400, - 'tests' => array( - 50 => 12, - 17 => 4, - 18 => 4 ) ) ); - foreach ( $vals as $row ) { - $tests = $row['tests']; - $height = $row['height']; - $width = $row['width']; - foreach ( $tests as $max => $expected ) { - $y = round( $expected * $height / $width ); - $result = MediaHandler::fitBoxWidth( $width, $height, $max ); - $y2 = round( $result * $height / $width ); - $this->assertEquals( $expected, - $result, - "($width, $height, $max) wanted: {$expected}x$y, got: {$result}x$y2" ); - } - } - } -} diff --git a/tests/phpunit/includes/media/PNGMetadataExtractorTest.php b/tests/phpunit/includes/media/PNGMetadataExtractorTest.php deleted file mode 100644 index 939f2cfc..00000000 --- a/tests/phpunit/includes/media/PNGMetadataExtractorTest.php +++ /dev/null @@ -1,155 +0,0 @@ -filePath = __DIR__ . '/../../data/media/'; - } - - /** - * Tests zTXt tag (compressed textual metadata) - */ - public function testPngNativetZtxt() { - $this->checkPHPExtension( 'zlib' ); - - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'Png-native-test.png' ); - $expected = "foo bar baz foo foo foo foof foo foo foo foo"; - $this->assertArrayHasKey( 'text', $meta ); - $meta = $meta['text']; - $this->assertArrayHasKey( 'Make', $meta ); - $this->assertArrayHasKey( 'x-default', $meta['Make'] ); - - $this->assertEquals( $expected, $meta['Make']['x-default'] ); - } - - /** - * Test tEXt tag (Uncompressed textual metadata) - */ - public function testPngNativeText() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'Png-native-test.png' ); - $expected = "Some long image desc"; - $this->assertArrayHasKey( 'text', $meta ); - $meta = $meta['text']; - $this->assertArrayHasKey( 'ImageDescription', $meta ); - $this->assertArrayHasKey( 'x-default', $meta['ImageDescription'] ); - $this->assertArrayHasKey( '_type', $meta['ImageDescription'] ); - - $this->assertEquals( $expected, $meta['ImageDescription']['x-default'] ); - } - - /** - * tEXt tags must be encoded iso-8859-1 (vs iTXt which are utf-8) - * Make sure non-ascii characters get converted properly - */ - public function testPngNativeTextNonAscii() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'Png-native-test.png' ); - - // Note the Copyright symbol here is a utf-8 one - // (aka \xC2\xA9) where in the file its iso-8859-1 - // encoded as just \xA9. - $expected = "© 2010 Bawolff"; - - $this->assertArrayHasKey( 'text', $meta ); - $meta = $meta['text']; - $this->assertArrayHasKey( 'Copyright', $meta ); - $this->assertArrayHasKey( 'x-default', $meta['Copyright'] ); - - $this->assertEquals( $expected, $meta['Copyright']['x-default'] ); - } - - /** - * Test extraction of pHYs tags, which can tell what the - * actual resolution of the image is (aka in dots per meter). - */ - /* - public function testPngPhysTag() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'Png-native-test.png' ); - - $this->assertArrayHasKey( 'text', $meta ); - $meta = $meta['text']; - - $this->assertEquals( '2835/100', $meta['XResolution'] ); - $this->assertEquals( '2835/100', $meta['YResolution'] ); - $this->assertEquals( 3, $meta['ResolutionUnit'] ); // 3 = cm - } - */ - - /** - * Given a normal static PNG, check the animation metadata returned. - */ - public function testStaticPngAnimationMetadata() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'Png-native-test.png' ); - - $this->assertEquals( 0, $meta['frameCount'] ); - $this->assertEquals( 1, $meta['loopCount'] ); - $this->assertEquals( 0, $meta['duration'] ); - } - - /** - * Given an animated APNG image file - * check it gets animated metadata right. - */ - public function testApngAnimationMetadata() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'Animated_PNG_example_bouncing_beach_ball.png' ); - - $this->assertEquals( 20, $meta['frameCount'] ); - // Note loop count of 0 = infinity - $this->assertEquals( 0, $meta['loopCount'] ); - $this->assertEquals( 1.5, $meta['duration'], '', 0.00001 ); - } - - public function testPngBitDepth8() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'Png-native-test.png' ); - - $this->assertEquals( 8, $meta['bitDepth'] ); - } - - public function testPngBitDepth1() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - '1bit-png.png' ); - $this->assertEquals( 1, $meta['bitDepth'] ); - } - - - public function testPngIndexColour() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'Png-native-test.png' ); - - $this->assertEquals( 'index-coloured', $meta['colorType'] ); - } - - public function testPngRgbColour() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'rgb-png.png' ); - $this->assertEquals( 'truecolour-alpha', $meta['colorType'] ); - } - - public function testPngRgbNoAlphaColour() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'rgb-na-png.png' ); - $this->assertEquals( 'truecolour', $meta['colorType'] ); - } - - public function testPngGreyscaleColour() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'greyscale-png.png' ); - $this->assertEquals( 'greyscale-alpha', $meta['colorType'] ); - } - - public function testPngGreyscaleNoAlphaColour() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'greyscale-na-png.png' ); - $this->assertEquals( 'greyscale', $meta['colorType'] ); - } -} diff --git a/tests/phpunit/includes/media/PNGTest.php b/tests/phpunit/includes/media/PNGTest.php deleted file mode 100644 index ad4c2493..00000000 --- a/tests/phpunit/includes/media/PNGTest.php +++ /dev/null @@ -1,123 +0,0 @@ -filePath = __DIR__ . '/../../data/media'; - $this->backend = new FSFileBackend( array( - 'name' => 'localtesting', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array( 'data' => $this->filePath ) - ) ); - $this->repo = new FSRepo( array( - 'name' => 'temp', - 'url' => 'http://localhost/thumbtest', - 'backend' => $this->backend - ) ); - $this->handler = new PNGHandler(); - } - - /** - * @covers PNGHandler::getMetadata - */ - public function testInvalidFile() { - $res = $this->handler->getMetadata( null, $this->filePath . '/README' ); - $this->assertEquals( PNGHandler::BROKEN_FILE, $res ); - } - - /** - * @param $filename String basename of the file to check - * @param $expected boolean Expected result. - * @dataProvider provideIsAnimated - * @covers PNGHandler::isAnimatedImage - */ - public function testIsAnimanted( $filename, $expected ) { - $file = $this->dataFile( $filename, 'image/png' ); - $actual = $this->handler->isAnimatedImage( $file ); - $this->assertEquals( $expected, $actual ); - } - - public static function provideIsAnimated() { - return array( - array( 'Animated_PNG_example_bouncing_beach_ball.png', true ), - array( '1bit-png.png', false ), - ); - } - - /** - * @param $filename String - * @param $expected Integer Total image area - * @dataProvider provideGetImageArea - * @covers PNGHandler::getImageArea - */ - public function testGetImageArea( $filename, $expected ) { - $file = $this->dataFile( $filename, 'image/png' ); - $actual = $this->handler->getImageArea( $file, $file->getWidth(), $file->getHeight() ); - $this->assertEquals( $expected, $actual ); - } - - public static function provideGetImageArea() { - return array( - array( '1bit-png.png', 2500 ), - array( 'greyscale-png.png', 2500 ), - array( 'Png-native-test.png', 126000 ), - array( 'Animated_PNG_example_bouncing_beach_ball.png', 10000 ), - ); - } - - /** - * @param $metadata String Serialized metadata - * @param $expected Integer One of the class constants of PNGHandler - * @dataProvider provideIsMetadataValid - * @covers PNGHandler::isMetadataValid - */ - public function testIsMetadataValid( $metadata, $expected ) { - $actual = $this->handler->isMetadataValid( null, $metadata ); - $this->assertEquals( $expected, $actual ); - } - - public static function provideIsMetadataValid() { - return array( - array( PNGHandler::BROKEN_FILE, PNGHandler::METADATA_GOOD ), - array( '', PNGHandler::METADATA_BAD ), - array( null, PNGHandler::METADATA_BAD ), - array( 'Something invalid!', PNGHandler::METADATA_BAD ), - array( 'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:8;s:9:"colorType";s:10:"truecolour";s:8:"metadata";a:1:{s:15:"_MW_PNG_VERSION";i:1;}}', PNGHandler::METADATA_GOOD ), - ); - } - - /** - * @param $filename String - * @param $expected String Serialized array - * @dataProvider provideGetMetadata - * @covers PNGHandler::getMetadata - */ - public function testGetMetadata( $filename, $expected ) { - $file = $this->dataFile( $filename, 'image/png' ); - $actual = $this->handler->getMetadata( $file, "$this->filePath/$filename" ); -// $this->assertEquals( unserialize( $expected ), unserialize( $actual ) ); - $this->assertEquals( ( $expected ), ( $actual ) ); - } - - public static function provideGetMetadata() { - return array( - array( 'rgb-na-png.png', 'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:8;s:9:"colorType";s:10:"truecolour";s:8:"metadata";a:1:{s:15:"_MW_PNG_VERSION";i:1;}}' ), - array( 'xmp.png', 'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:1;s:9:"colorType";s:14:"index-coloured";s:8:"metadata";a:2:{s:12:"SerialNumber";s:9:"123456789";s:15:"_MW_PNG_VERSION";i:1;}}' ), - ); - } - - private function dataFile( $name, $type ) { - return new UnregisteredLocalFile( false, $this->repo, - "mwstore://localtesting/data/$name", $type ); - } -} diff --git a/tests/phpunit/includes/media/SVGMetadataExtractorTest.php b/tests/phpunit/includes/media/SVGMetadataExtractorTest.php deleted file mode 100644 index 257009b0..00000000 --- a/tests/phpunit/includes/media/SVGMetadataExtractorTest.php +++ /dev/null @@ -1,112 +0,0 @@ -assertMetadata( $infile, $expected ); - } - - /** - * @dataProvider provideSvgFilesWithXMLMetadata - */ - public function testGetXMLMetadata( $infile, $expected ) { - $r = new XMLReader(); - if ( !method_exists( $r, 'readInnerXML' ) ) { - $this->markTestSkipped( 'XMLReader::readInnerXML() does not exist (libxml >2.6.20 needed).' ); - - return; - } - $this->assertMetadata( $infile, $expected ); - } - - function assertMetadata( $infile, $expected ) { - try { - $data = SVGMetadataExtractor::getMetadata( $infile ); - $this->assertEquals( $expected, $data, 'SVG metadata extraction test' ); - } catch ( MWException $e ) { - if ( $expected === false ) { - $this->assertTrue( true, 'SVG metadata extracted test (expected failure)' ); - } else { - throw $e; - } - } - } - - public static function provideSvgFiles() { - $base = __DIR__ . '/../../data/media'; - - return array( - array( - "$base/Wikimedia-logo.svg", - array( - 'width' => 1024, - 'height' => 1024, - 'originalWidth' => '1024', - 'originalHeight' => '1024', - ) - ), - array( - "$base/QA_icon.svg", - array( - 'width' => 60, - 'height' => 60, - 'originalWidth' => '60', - 'originalHeight' => '60', - ) - ), - array( - "$base/Gtk-media-play-ltr.svg", - array( - 'width' => 60, - 'height' => 60, - 'originalWidth' => '60.0000000', - 'originalHeight' => '60.0000000', - ) - ), - array( - "$base/Toll_Texas_1.svg", - // This file triggered bug 31719, needs entity expansion in the xmlns checks - array( - 'width' => 385, - 'height' => 385, - 'originalWidth' => '385', - 'originalHeight' => '385.0004883', - ) - ) - ); - } - - public static function provideSvgFilesWithXMLMetadata() { - $base = __DIR__ . '/../../data/media'; - $metadata = ' - - image/svg+xml - - - '; - $metadata = str_replace( "\r", '', $metadata ); // Windows compat - return array( - array( - "$base/US_states_by_total_state_tax_revenue.svg", - array( - 'height' => 593, - 'metadata' => $metadata, - 'width' => 959, - 'originalWidth' => '958.69', - 'originalHeight' => '592.78998', - ) - ), - ); - } -} diff --git a/tests/phpunit/includes/media/TiffTest.php b/tests/phpunit/includes/media/TiffTest.php deleted file mode 100644 index 8d74b98d..00000000 --- a/tests/phpunit/includes/media/TiffTest.php +++ /dev/null @@ -1,39 +0,0 @@ -markTestSkipped( "This test needs the exif extension." ); - } - - $this->setMwGlobals( 'wgShowEXIF', true ); - - $this->filePath = __DIR__ . '/../../data/media/'; - $this->handler = new TiffHandler; - } - - /** - * @covers TiffHandler::getMetadata - */ - public function testInvalidFile() { - $res = $this->handler->getMetadata( null, $this->filePath . 'README' ); - $this->assertEquals( ExifBitmapHandler::BROKEN_FILE, $res ); - } - - /** - * @covers TiffHandler::getMetadata - */ - public function testTiffMetadataExtraction() { - $res = $this->handler->getMetadata( null, $this->filePath . 'test.tiff' ); - $expected = 'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:2;}'; - // Re-unserialize in case there are subtle differences between how versions - // of php serialize stuff. - $this->assertEquals( unserialize( $expected ), unserialize( $res ) ); - } -} diff --git a/tests/phpunit/includes/media/XMPTest.php b/tests/phpunit/includes/media/XMPTest.php deleted file mode 100644 index d12e9b00..00000000 --- a/tests/phpunit/includes/media/XMPTest.php +++ /dev/null @@ -1,166 +0,0 @@ -markTestSkipped( 'Requires libxml to do XMP parsing' ); - } - } - - /** - * Put XMP in, compare what comes out... - * - * @param $xmp String the actual xml data. - * @param $expected Array expected result of parsing the xmp. - * @param $info String Short sentence on what's being tested. - * - * @throws Exception - * @dataProvider provideXMPParse - */ - public function testXMPParse( $xmp, $expected, $info ) { - if ( !is_string( $xmp ) || !is_array( $expected ) ) { - throw new Exception( "Invalid data provided to " . __METHOD__ ); - } - $reader = new XMPReader; - $reader->parse( $xmp ); - $this->assertEquals( $expected, $reader->getResults(), $info, 0.0000000001 ); - } - - public static function provideXMPParse() { - $xmpPath = __DIR__ . '/../../data/xmp/'; - $data = array(); - - // $xmpFiles format: array of arrays with first arg file base name, - // with the actual file having .xmp on the end for the xmp - // and .result.php on the end for a php file containing the result - // array. Second argument is some info on what's being tested. - $xmpFiles = array( - array( '1', 'parseType=Resource test' ), - array( '2', 'Structure with mixed attribute and element props' ), - array( '3', 'Extra qualifiers (that should be ignored)' ), - array( '3-invalid', 'Test ignoring qualifiers that look like normal props' ), - array( '4', 'Flash as qualifier' ), - array( '5', 'Flash as qualifier 2' ), - array( '6', 'Multiple rdf:Description' ), - array( '7', 'Generic test of several property types' ), - array( 'flash', 'Test of Flash property' ), - array( 'invalid-child-not-struct', 'Test child props not in struct or ignored' ), - array( 'no-recognized-props', 'Test namespace and no recognized props' ), - array( 'no-namespace', 'Test non-namespaced attributes are ignored' ), - array( 'bag-for-seq', "Allow bag's instead of seq's. (bug 27105)" ), - array( 'utf16BE', 'UTF-16BE encoding' ), - array( 'utf16LE', 'UTF-16LE encoding' ), - array( 'utf32BE', 'UTF-32BE encoding' ), - array( 'utf32LE', 'UTF-32LE encoding' ), - array( 'xmpExt', 'Extended XMP missing second part' ), - array( 'gps', 'Handling of exif GPS parameters in XMP' ), - ); - - foreach ( $xmpFiles as $file ) { - $xmp = file_get_contents( $xmpPath . $file[0] . '.xmp' ); - // I'm not sure if this is the best way to handle getting the - // result array, but it seems kind of big to put directly in the test - // file. - $result = null; - include $xmpPath . $file[0] . '.result.php'; - $data[] = array( $xmp, $result, '[' . $file[0] . '.xmp] ' . $file[1] ); - } - - return $data; - } - - /** Test ExtendedXMP block support. (Used when the XMP has to be split - * over multiple jpeg segments, due to 64k size limit on jpeg segments. - * - * @todo This is based on what the standard says. Need to find a real - * world example file to double check the support for this is right. - */ - public function testExtendedXMP() { - $xmpPath = __DIR__ . '/../../data/xmp/'; - $standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' ); - $extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' ); - - $md5sum = '28C74E0AC2D796886759006FBE2E57B7'; // of xmpExt2.xmp - $length = pack( 'N', strlen( $extendedXMP ) ); - $offset = pack( 'N', 0 ); - $extendedPacket = $md5sum . $length . $offset . $extendedXMP; - - $reader = new XMPReader(); - $reader->parse( $standardXMP ); - $reader->parseExtended( $extendedPacket ); - $actual = $reader->getResults(); - - $expected = array( - 'xmp-exif' => array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => 9, - 'FNumber' => '2/10', - ) - ); - - $this->assertEquals( $expected, $actual ); - } - - /** - * This test has an extended XMP block with a wrong guid (md5sum) - * and thus should only return the StandardXMP, not the ExtendedXMP. - */ - public function testExtendedXMPWithWrongGUID() { - $xmpPath = __DIR__ . '/../../data/xmp/'; - $standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' ); - $extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' ); - - $md5sum = '28C74E0AC2D796886759006FBE2E57B9'; // Note last digit. - $length = pack( 'N', strlen( $extendedXMP ) ); - $offset = pack( 'N', 0 ); - $extendedPacket = $md5sum . $length . $offset . $extendedXMP; - - $reader = new XMPReader(); - $reader->parse( $standardXMP ); - $reader->parseExtended( $extendedPacket ); - $actual = $reader->getResults(); - - $expected = array( - 'xmp-exif' => array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => 9, - ) - ); - - $this->assertEquals( $expected, $actual ); - } - - /** - * Have a high offset to simulate a missing packet, - * which should cause it to ignore the ExtendedXMP packet. - */ - public function testExtendedXMPMissingPacket() { - $xmpPath = __DIR__ . '/../../data/xmp/'; - $standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' ); - $extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' ); - - $md5sum = '28C74E0AC2D796886759006FBE2E57B7'; // of xmpExt2.xmp - $length = pack( 'N', strlen( $extendedXMP ) ); - $offset = pack( 'N', 2048 ); - $extendedPacket = $md5sum . $length . $offset . $extendedXMP; - - $reader = new XMPReader(); - $reader->parse( $standardXMP ); - $reader->parseExtended( $extendedPacket ); - $actual = $reader->getResults(); - - $expected = array( - 'xmp-exif' => array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => 9, - ) - ); - - $this->assertEquals( $expected, $actual ); - } -} diff --git a/tests/phpunit/includes/media/XMPValidateTest.php b/tests/phpunit/includes/media/XMPValidateTest.php deleted file mode 100644 index 96bf5e47..00000000 --- a/tests/phpunit/includes/media/XMPValidateTest.php +++ /dev/null @@ -1,46 +0,0 @@ -assertEquals( $expected, $value ); - } - - public static function provideDates() { - /* For reference valid date formats are: - * YYYY - * YYYY-MM - * YYYY-MM-DD - * YYYY-MM-DDThh:mmTZD - * YYYY-MM-DDThh:mm:ssTZD - * YYYY-MM-DDThh:mm:ss.sTZD - * (Time zone is optional) - */ - return array( - array( '1992', '1992' ), - array( '1992-04', '1992:04' ), - array( '1992-02-01', '1992:02:01' ), - array( '2011-09-29', '2011:09:29' ), - array( '1982-12-15T20:12', '1982:12:15 20:12' ), - array( '1982-12-15T20:12Z', '1982:12:15 20:12' ), - array( '1982-12-15T20:12+02:30', '1982:12:15 22:42' ), - array( '1982-12-15T01:12-02:30', '1982:12:14 22:42' ), - array( '1982-12-15T20:12:11', '1982:12:15 20:12:11' ), - array( '1982-12-15T20:12:11Z', '1982:12:15 20:12:11' ), - array( '1982-12-15T20:12:11+01:10', '1982:12:15 21:22:11' ), - array( '2045-12-15T20:12:11', '2045:12:15 20:12:11' ), - array( '1867-06-01T15:00:00', '1867:06:01 15:00:00' ), - /* some invalid ones */ - array( '2001--12', null ), - array( '2001-5-12', null ), - array( '2001-5-12TZ', null ), - array( '2001-05-12T15', null ), - array( '2001-12T15:13', null ), - ); - } -} diff --git a/tests/phpunit/includes/normal/CleanUpTest.php b/tests/phpunit/includes/normal/CleanUpTest.php deleted file mode 100644 index 52dd2ef5..00000000 --- a/tests/phpunit/includes/normal/CleanUpTest.php +++ /dev/null @@ -1,409 +0,0 @@ - - * http://www.mediawiki.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @file - */ - -/** - * Additional tests for UtfNormal::cleanUp() function, inclusion - * regression checks for known problems. - * Requires PHPUnit. - * - * @ingroup UtfNormal - * @group Large - * - * We ignore code coverage for this test suite until they are rewritten - * to use data providers (bug 46561). - * @codeCoverageIgnore - */ -class CleanUpTest extends MediaWikiTestCase { - /** @todo document */ - public function testAscii() { - $text = 'This is plain ASCII text.'; - $this->assertEquals( $text, UtfNormal::cleanUp( $text ) ); - } - - /** @todo document */ - public function testNull() { - $text = "a \x00 null"; - $expect = "a \xef\xbf\xbd null"; - $this->assertEquals( - bin2hex( $expect ), - bin2hex( UtfNormal::cleanUp( $text ) ) ); - } - - /** @todo document */ - public function testLatin() { - $text = "L'\xc3\xa9cole"; - $this->assertEquals( $text, UtfNormal::cleanUp( $text ) ); - } - - /** @todo document */ - public function testLatinNormal() { - $text = "L'e\xcc\x81cole"; - $expect = "L'\xc3\xa9cole"; - $this->assertEquals( $expect, UtfNormal::cleanUp( $text ) ); - } - - /** - * This test is *very* expensive! - * @todo document - */ - function XtestAllChars() { - $rep = UTF8_REPLACEMENT; - for ( $i = 0x0; $i < UNICODE_MAX; $i++ ) { - $char = codepointToUtf8( $i ); - $clean = UtfNormal::cleanUp( $char ); - $x = sprintf( "%04X", $i ); - - if ( $i % 0x1000 == 0 ) { - echo "U+$x\n"; - } - - if ( $i == 0x0009 || - $i == 0x000a || - $i == 0x000d || - ( $i > 0x001f && $i < UNICODE_SURROGATE_FIRST ) || - ( $i > UNICODE_SURROGATE_LAST && $i < 0xfffe ) || - ( $i > 0xffff && $i <= UNICODE_MAX ) - ) { - if ( isset( UtfNormal::$utfCanonicalComp[$char] ) || isset( UtfNormal::$utfCanonicalDecomp[$char] ) ) { - $comp = UtfNormal::NFC( $char ); - $this->assertEquals( - bin2hex( $comp ), - bin2hex( $clean ), - "U+$x should be decomposed" ); - } else { - $this->assertEquals( - bin2hex( $char ), - bin2hex( $clean ), - "U+$x should be intact" ); - } - } else { - $this->assertEquals( bin2hex( $rep ), bin2hex( $clean ), $x ); - } - } - } - - /** @todo document */ - public function testAllBytes() { - $this->doTestBytes( '', '' ); - $this->doTestBytes( 'x', '' ); - $this->doTestBytes( '', 'x' ); - $this->doTestBytes( 'x', 'x' ); - } - - /** @todo document */ - function doTestBytes( $head, $tail ) { - for ( $i = 0x0; $i < 256; $i++ ) { - $char = $head . chr( $i ) . $tail; - $clean = UtfNormal::cleanUp( $char ); - $x = sprintf( "%02X", $i ); - - if ( $i == 0x0009 || - $i == 0x000a || - $i == 0x000d || - ( $i > 0x001f && $i < 0x80 ) - ) { - $this->assertEquals( - bin2hex( $char ), - bin2hex( $clean ), - "ASCII byte $x should be intact" ); - if ( $char != $clean ) { - return; - } - } else { - $norm = $head . UTF8_REPLACEMENT . $tail; - $this->assertEquals( - bin2hex( $norm ), - bin2hex( $clean ), - "Forbidden byte $x should be rejected" ); - if ( $norm != $clean ) { - return; - } - } - } - } - - /** @todo document */ - public function testDoubleBytes() { - $this->doTestDoubleBytes( '', '' ); - $this->doTestDoubleBytes( 'x', '' ); - $this->doTestDoubleBytes( '', 'x' ); - $this->doTestDoubleBytes( 'x', 'x' ); - } - - /** - * @todo document - */ - function doTestDoubleBytes( $head, $tail ) { - for ( $first = 0xc0; $first < 0x100; $first += 2 ) { - for ( $second = 0x80; $second < 0x100; $second += 2 ) { - $char = $head . chr( $first ) . chr( $second ) . $tail; - $clean = UtfNormal::cleanUp( $char ); - $x = sprintf( "%02X,%02X", $first, $second ); - if ( $first > 0xc1 && - $first < 0xe0 && - $second < 0xc0 - ) { - $norm = UtfNormal::NFC( $char ); - $this->assertEquals( - bin2hex( $norm ), - bin2hex( $clean ), - "Pair $x should be intact" ); - if ( $norm != $clean ) { - return; - } - } elseif ( $first > 0xfd || $second > 0xbf ) { - # fe and ff are not legal head bytes -- expect two replacement chars - $norm = $head . UTF8_REPLACEMENT . UTF8_REPLACEMENT . $tail; - $this->assertEquals( - bin2hex( $norm ), - bin2hex( $clean ), - "Forbidden pair $x should be rejected" ); - if ( $norm != $clean ) { - return; - } - } else { - $norm = $head . UTF8_REPLACEMENT . $tail; - $this->assertEquals( - bin2hex( $norm ), - bin2hex( $clean ), - "Forbidden pair $x should be rejected" ); - if ( $norm != $clean ) { - return; - } - } - } - } - } - - /** @todo document */ - public function testTripleBytes() { - $this->doTestTripleBytes( '', '' ); - $this->doTestTripleBytes( 'x', '' ); - $this->doTestTripleBytes( '', 'x' ); - $this->doTestTripleBytes( 'x', 'x' ); - } - - /** @todo document */ - function doTestTripleBytes( $head, $tail ) { - for ( $first = 0xc0; $first < 0x100; $first += 2 ) { - for ( $second = 0x80; $second < 0x100; $second += 2 ) { - #for( $third = 0x80; $third < 0x100; $third++ ) { - for ( $third = 0x80; $third < 0x81; $third++ ) { - $char = $head . chr( $first ) . chr( $second ) . chr( $third ) . $tail; - $clean = UtfNormal::cleanUp( $char ); - $x = sprintf( "%02X,%02X,%02X", $first, $second, $third ); - - if ( $first >= 0xe0 && - $first < 0xf0 && - $second < 0xc0 && - $third < 0xc0 - ) { - if ( $first == 0xe0 && $second < 0xa0 ) { - $this->assertEquals( - bin2hex( $head . UTF8_REPLACEMENT . $tail ), - bin2hex( $clean ), - "Overlong triplet $x should be rejected" ); - } elseif ( $first == 0xed && - ( chr( $first ) . chr( $second ) . chr( $third ) ) >= UTF8_SURROGATE_FIRST - ) { - $this->assertEquals( - bin2hex( $head . UTF8_REPLACEMENT . $tail ), - bin2hex( $clean ), - "Surrogate triplet $x should be rejected" ); - } else { - $this->assertEquals( - bin2hex( UtfNormal::NFC( $char ) ), - bin2hex( $clean ), - "Triplet $x should be intact" ); - } - } elseif ( $first > 0xc1 && $first < 0xe0 && $second < 0xc0 ) { - $this->assertEquals( - bin2hex( UtfNormal::NFC( $head . chr( $first ) . chr( $second ) ) . UTF8_REPLACEMENT . $tail ), - bin2hex( $clean ), - "Valid 2-byte $x + broken tail" ); - } elseif ( $second > 0xc1 && $second < 0xe0 && $third < 0xc0 ) { - $this->assertEquals( - bin2hex( $head . UTF8_REPLACEMENT . UtfNormal::NFC( chr( $second ) . chr( $third ) . $tail ) ), - bin2hex( $clean ), - "Broken head + valid 2-byte $x" ); - } elseif ( ( $first > 0xfd || $second > 0xfd ) && - ( ( $second > 0xbf && $third > 0xbf ) || - ( $second < 0xc0 && $third < 0xc0 ) || - ( $second > 0xfd ) || - ( $third > 0xfd ) ) - ) { - # fe and ff are not legal head bytes -- expect three replacement chars - $this->assertEquals( - bin2hex( $head . UTF8_REPLACEMENT . UTF8_REPLACEMENT . UTF8_REPLACEMENT . $tail ), - bin2hex( $clean ), - "Forbidden triplet $x should be rejected" ); - } elseif ( $first > 0xc2 && $second < 0xc0 && $third < 0xc0 ) { - $this->assertEquals( - bin2hex( $head . UTF8_REPLACEMENT . $tail ), - bin2hex( $clean ), - "Forbidden triplet $x should be rejected" ); - } else { - $this->assertEquals( - bin2hex( $head . UTF8_REPLACEMENT . UTF8_REPLACEMENT . $tail ), - bin2hex( $clean ), - "Forbidden triplet $x should be rejected" ); - } - } - } - } - } - - /** @todo document */ - public function testChunkRegression() { - # Check for regression against a chunking bug - $text = "\x46\x55\xb8" . - "\xdc\x96" . - "\xee" . - "\xe7" . - "\x44" . - "\xaa" . - "\x2f\x25"; - $expect = "\x46\x55\xef\xbf\xbd" . - "\xdc\x96" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\x44" . - "\xef\xbf\xbd" . - "\x2f\x25"; - - $this->assertEquals( - bin2hex( $expect ), - bin2hex( UtfNormal::cleanUp( $text ) ) ); - } - - /** @todo document */ - public function testInterposeRegression() { - $text = "\x4e\x30" . - "\xb1" . # bad tail - "\x3a" . - "\x92" . # bad tail - "\x62\x3a" . - "\x84" . # bad tail - "\x43" . - "\xc6" . # bad head - "\x3f" . - "\x92" . # bad tail - "\xad" . # bad tail - "\x7d" . - "\xd9\x95"; - - $expect = "\x4e\x30" . - "\xef\xbf\xbd" . - "\x3a" . - "\xef\xbf\xbd" . - "\x62\x3a" . - "\xef\xbf\xbd" . - "\x43" . - "\xef\xbf\xbd" . - "\x3f" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\x7d" . - "\xd9\x95"; - - $this->assertEquals( - bin2hex( $expect ), - bin2hex( UtfNormal::cleanUp( $text ) ) ); - } - - /** @todo document */ - public function testOverlongRegression() { - $text = "\x67" . - "\x1a" . # forbidden ascii - "\xea" . # bad head - "\xc1\xa6" . # overlong sequence - "\xad" . # bad tail - "\x1c" . # forbidden ascii - "\xb0" . # bad tail - "\x3c" . - "\x9e"; # bad tail - $expect = "\x67" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\x3c" . - "\xef\xbf\xbd"; - $this->assertEquals( - bin2hex( $expect ), - bin2hex( UtfNormal::cleanUp( $text ) ) ); - } - - /** @todo document */ - public function testSurrogateRegression() { - $text = "\xed\xb4\x96" . # surrogate 0xDD16 - "\x83" . # bad tail - "\xb4" . # bad tail - "\xac"; # bad head - $expect = "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd"; - $this->assertEquals( - bin2hex( $expect ), - bin2hex( UtfNormal::cleanUp( $text ) ) ); - } - - /** @todo document */ - public function testBomRegression() { - $text = "\xef\xbf\xbe" . # U+FFFE, illegal char - "\xb2" . # bad tail - "\xef" . # bad head - "\x59"; - $expect = "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\x59"; - $this->assertEquals( - bin2hex( $expect ), - bin2hex( UtfNormal::cleanUp( $text ) ) ); - } - - /** @todo document */ - public function testForbiddenRegression() { - $text = "\xef\xbf\xbf"; # U+FFFF, illegal char - $expect = "\xef\xbf\xbd"; - $this->assertEquals( - bin2hex( $expect ), - bin2hex( UtfNormal::cleanUp( $text ) ) ); - } - - /** @todo document */ - public function testHangulRegression() { - $text = "\xed\x9c\xaf" . # Hangul char - "\xe1\x87\x81"; # followed by another final jamo - $expect = $text; # Should *not* change. - $this->assertEquals( - bin2hex( $expect ), - bin2hex( UtfNormal::cleanUp( $text ) ) ); - } -} diff --git a/tests/phpunit/includes/objectcache/BagOStuffTest.php b/tests/phpunit/includes/objectcache/BagOStuffTest.php deleted file mode 100644 index aa783943..00000000 --- a/tests/phpunit/includes/objectcache/BagOStuffTest.php +++ /dev/null @@ -1,149 +0,0 @@ - - */ -class BagOStuffTest extends MediaWikiTestCase { - private $cache; - - protected function setUp() { - parent::setUp(); - - // type defined through parameter - if ( $this->getCliArg( 'use-bagostuff=' ) ) { - $name = $this->getCliArg( 'use-bagostuff=' ); - - $this->cache = ObjectCache::newFromId( $name ); - } else { - // no type defined - use simple hash - $this->cache = new HashBagOStuff; - } - - $this->cache->delete( wfMemcKey( 'test' ) ); - } - - protected function tearDown() { - } - - public function testMerge() { - $key = wfMemcKey( 'test' ); - - $usleep = 0; - - /** - * Callback method: append "merged" to whatever is in cache. - * - * @param BagOStuff $cache - * @param string $key - * @param int $existingValue - * @use int $usleep - * @return int - */ - $callback = function ( BagOStuff $cache, $key, $existingValue ) use ( &$usleep ) { - // let's pretend this is an expensive callback to test concurrent merge attempts - usleep( $usleep ); - - if ( $existingValue === false ) { - return 'merged'; - } - - return $existingValue . 'merged'; - }; - - // merge on non-existing value - $merged = $this->cache->merge( $key, $callback, 0 ); - $this->assertTrue( $merged ); - $this->assertEquals( $this->cache->get( $key ), 'merged' ); - - // merge on existing value - $merged = $this->cache->merge( $key, $callback, 0 ); - $this->assertTrue( $merged ); - $this->assertEquals( $this->cache->get( $key ), 'mergedmerged' ); - - /* - * Test concurrent merges by forking this process, if: - * - not manually called with --use-bagostuff - * - pcntl_fork is supported by the system - * - cache type will correctly support calls over forks - */ - $fork = (bool)$this->getCliArg( 'use-bagostuff=' ); - $fork &= function_exists( 'pcntl_fork' ); - $fork &= !$this->cache instanceof HashBagOStuff; - $fork &= !$this->cache instanceof EmptyBagOStuff; - $fork &= !$this->cache instanceof MultiWriteBagOStuff; - if ( $fork ) { - // callback should take awhile now so that we can test concurrent merge attempts - $usleep = 5000; - - $pid = pcntl_fork(); - if ( $pid == -1 ) { - // can't fork, ignore this test... - } elseif ( $pid ) { - // wait a little, making sure that the child process is calling merge - usleep( 3000 ); - - // attempt a merge - this should fail - $merged = $this->cache->merge( $key, $callback, 0, 1 ); - - // merge has failed because child process was merging (and we only attempted once) - $this->assertFalse( $merged ); - - // make sure the child's merge is completed and verify - usleep( 3000 ); - $this->assertEquals( $this->cache->get( $key ), 'mergedmergedmerged' ); - } else { - $this->cache->merge( $key, $callback, 0, 1 ); - - // Note: I'm not even going to check if the merge worked, I'll - // compare values in the parent process to test if this merge worked. - // I'm just going to exit this child process, since I don't want the - // child to output any test results (would be rather confusing to - // have test output twice) - exit; - } - } - } - - public function testAdd() { - $key = wfMemcKey( 'test' ); - $this->assertTrue( $this->cache->add( $key, 'test' ) ); - } - - public function testGet() { - $value = array( 'this' => 'is', 'a' => 'test' ); - - $key = wfMemcKey( 'test' ); - $this->cache->add( $key, $value ); - $this->assertEquals( $this->cache->get( $key ), $value ); - } - - /** - * @covers BagOStuff::incr - */ - public function testIncr() { - $key = wfMemcKey( 'test' ); - $this->cache->add( $key, 0 ); - $this->cache->incr( $key ); - $expectedValue = 1; - $actualValue = $this->cache->get( $key ); - $this->assertEquals( $expectedValue, $actualValue, 'Value should be 1 after incrementing' ); - } - - public function testGetMulti() { - $value1 = array( 'this' => 'is', 'a' => 'test' ); - $value2 = array( 'this' => 'is', 'another' => 'test' ); - - $key1 = wfMemcKey( 'test1' ); - $key2 = wfMemcKey( 'test2' ); - - $this->cache->add( $key1, $value1 ); - $this->cache->add( $key2, $value2 ); - - $this->assertEquals( $this->cache->getMulti( array( $key1, $key2 ) ), array( $key1 => $value1, $key2 => $value2 ) ); - - // cleanup - $this->cache->delete( $key1 ); - $this->cache->delete( $key2 ); - } -} diff --git a/tests/phpunit/includes/parser/MagicVariableTest.php b/tests/phpunit/includes/parser/MagicVariableTest.php deleted file mode 100644 index c2c97c01..00000000 --- a/tests/phpunit/includes/parser/MagicVariableTest.php +++ /dev/null @@ -1,242 +0,0 @@ -setMwGlobals( array( - 'wgLanguageCode' => 'en', - 'wgContLang' => $contLang, - ) ); - - $this->testParser = new Parser(); - $this->testParser->Options( ParserOptions::newFromUserAndLang( new User, $contLang ) ); - - # initialize parser output - $this->testParser->clearState(); - - # Needs a title to do magic word stuff - $title = Title::newFromText( 'Tests' ); - $title->mRedirect = false; # Else it needs a db connection just to check if it's a redirect (when deciding the page language) - - $this->testParser->setTitle( $title ); - } - - /** - * @param int $num upper limit for numbers - * @return array of numbers from 1 up to $num - */ - private static function createProviderUpTo( $num ) { - $ret = array(); - for ( $i = 1; $i <= $num; $i++ ) { - $ret[] = array( $i ); - } - - return $ret; - } - - /** - * @return array of months numbers (as an integer) - */ - public static function provideMonths() { - return self::createProviderUpTo( 12 ); - } - - /** - * @return array of days numbers (as an integer) - */ - public static function provideDays() { - return self::createProviderUpTo( 31 ); - } - - ############### TESTS ############################################# - # @todo FIXME: - # - those got copy pasted, we can probably make them cleaner - # - tests are lacking useful messages - - # day - - /** @dataProvider provideDays */ - public function testCurrentdayIsUnPadded( $day ) { - $this->assertUnPadded( 'currentday', $day ); - } - - /** @dataProvider provideDays */ - public function testCurrentdaytwoIsZeroPadded( $day ) { - $this->assertZeroPadded( 'currentday2', $day ); - } - - /** @dataProvider provideDays */ - public function testLocaldayIsUnPadded( $day ) { - $this->assertUnPadded( 'localday', $day ); - } - - /** @dataProvider provideDays */ - public function testLocaldaytwoIsZeroPadded( $day ) { - $this->assertZeroPadded( 'localday2', $day ); - } - - # month - - /** @dataProvider provideMonths */ - public function testCurrentmonthIsZeroPadded( $month ) { - $this->assertZeroPadded( 'currentmonth', $month ); - } - - /** @dataProvider provideMonths */ - public function testCurrentmonthoneIsUnPadded( $month ) { - $this->assertUnPadded( 'currentmonth1', $month ); - } - - /** @dataProvider provideMonths */ - public function testLocalmonthIsZeroPadded( $month ) { - $this->assertZeroPadded( 'localmonth', $month ); - } - - /** @dataProvider provideMonths */ - public function testLocalmonthoneIsUnPadded( $month ) { - $this->assertUnPadded( 'localmonth1', $month ); - } - - # revision day - - /** @dataProvider provideDays */ - public function testRevisiondayIsUnPadded( $day ) { - $this->assertUnPadded( 'revisionday', $day ); - } - - /** @dataProvider provideDays */ - public function testRevisiondaytwoIsZeroPadded( $day ) { - $this->assertZeroPadded( 'revisionday2', $day ); - } - - # revision month - - /** @dataProvider provideMonths */ - public function testRevisionmonthIsZeroPadded( $month ) { - $this->assertZeroPadded( 'revisionmonth', $month ); - } - - /** @dataProvider provideMonths */ - public function testRevisionmonthoneIsUnPadded( $month ) { - $this->assertUnPadded( 'revisionmonth1', $month ); - } - - /** - * Rough tests for {{SERVERNAME}} magic word - * Bug 31176 - * @group Database - * @dataProvider provideDataServernameFromDifferentProtocols - */ - public function testServernameFromDifferentProtocols( $server ) { - $this->setMwGlobals( 'wgServer', $server ); - - $this->assertMagic( 'localhost', 'servername' ); - } - - public static function provideDataServernameFromDifferentProtocols() { - return array( - array( 'http://localhost/' ), - array( 'https://localhost/' ), - array( '//localhost/' ), # bug 31176 - ); - } - - ############### HELPERS ############################################ - - /** assertion helper expecting a magic output which is zero padded */ - public function assertZeroPadded( $magic, $value ) { - $this->assertMagicPadding( $magic, $value, '%02d' ); - } - - /** assertion helper expecting a magic output which is unpadded */ - public function assertUnPadded( $magic, $value ) { - $this->assertMagicPadding( $magic, $value, '%d' ); - } - - /** - * Main assertion helper for magic variables padding - * @param $magic string Magic variable name - * @param $value mixed Month or day - * @param $format string sprintf format for $value - */ - private function assertMagicPadding( $magic, $value, $format ) { - # Initialize parser timestamp as year 2010 at 12h34 56s. - # month and day are given by the caller ($value). Month < 12! - if ( $value > 12 ) { - $month = $value % 12; - } else { - $month = $value; - } - - $this->setParserTS( - sprintf( '2010%02d%02d123456', $month, $value ) - ); - - # please keep the following commented line of code. It helps debugging. - //print "\nDEBUG (value $value):" . sprintf( '2010%02d%02d123456', $value, $value ) . "\n"; - - # format expectation and test it - $expected = sprintf( $format, $value ); - $this->assertMagic( $expected, $magic ); - } - - /** helper to set the parser timestamp and revision timestamp */ - private function setParserTS( $ts ) { - $this->testParser->Options()->setTimestamp( $ts ); - $this->testParser->mRevisionTimestamp = $ts; - } - - /** - * Assertion helper to test a magic variable output - */ - private function assertMagic( $expected, $magic ) { - if ( in_array( $magic, $this->expectedAsInteger ) ) { - $expected = (int)$expected; - } - - # Generate a message for the assertion - $msg = sprintf( "Magic %s should be <%s:%s>", - $magic, - $expected, - gettype( $expected ) - ); - - $this->assertSame( - $expected, - $this->testParser->getVariableValue( $magic ), - $msg - ); - } -} diff --git a/tests/phpunit/includes/parser/MediaWikiParserTest.php b/tests/phpunit/includes/parser/MediaWikiParserTest.php deleted file mode 100644 index c120ca34..00000000 --- a/tests/phpunit/includes/parser/MediaWikiParserTest.php +++ /dev/null @@ -1,120 +0,0 @@ - "\\'", '\\' => '\\\\' ) ); - /* This used to be ucfirst( basename( dirname( $filename ) ) ) - * and then was ucfirst( basename( $filename, '.txt' ) - * but that didn't work with names like foo.tests.txt - */ - $parserTestClassName = str_replace( '.', '_', ucfirst( $testsName ) ); - $parserTestClassDefinition = <<addTestSuite( $parserTestClassName ); - } - return $suite; - } - - /** - * Write $msg under log group 'tests-parser' - * @param string $msg Message to log - */ - protected static function debug( $msg ) { - return wfDebugLog( 'tests-parser', wfGetCaller() . ' ' . $msg ); - } -} diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php deleted file mode 100644 index eac4de5c..00000000 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ /dev/null @@ -1,969 +0,0 @@ -getCliArg( 'regex=' ) ) { - $this->regex = $this->getCliArg( 'regex=' ); - } else { - # Matches anything - $this->regex = ''; - } - - $this->keepUploads = $this->getCliArg( 'keep-uploads' ); - - $tmpGlobals = array(); - - $tmpGlobals['wgLanguageCode'] = 'en'; - $tmpGlobals['wgContLang'] = Language::factory( 'en' ); - $tmpGlobals['wgSitename'] = 'MediaWiki'; - $tmpGlobals['wgServer'] = 'http://example.org'; - $tmpGlobals['wgScript'] = '/index.php'; - $tmpGlobals['wgScriptPath'] = '/'; - $tmpGlobals['wgArticlePath'] = '/wiki/$1'; - $tmpGlobals['wgActionPaths'] = array(); - $tmpGlobals['wgVariantArticlePath'] = false; - $tmpGlobals['wgExtensionAssetsPath'] = '/extensions'; - $tmpGlobals['wgStylePath'] = '/skins'; - $tmpGlobals['wgEnableUploads'] = true; - $tmpGlobals['wgThumbnailScriptPath'] = false; - $tmpGlobals['wgLocalFileRepo'] = array( - 'class' => 'LocalRepo', - 'name' => 'local', - 'url' => 'http://example.com/images', - 'hashLevels' => 2, - 'transformVia404' => false, - 'backend' => 'local-backend' - ); - $tmpGlobals['wgForeignFileRepos'] = array(); - $tmpGlobals['wgDefaultExternalStore'] = array(); - $tmpGlobals['wgEnableParserCache'] = false; - $tmpGlobals['wgCapitalLinks'] = true; - $tmpGlobals['wgNoFollowLinks'] = true; - $tmpGlobals['wgNoFollowDomainExceptions'] = array(); - $tmpGlobals['wgExternalLinkTarget'] = false; - $tmpGlobals['wgThumbnailScriptPath'] = false; - $tmpGlobals['wgUseImageResize'] = true; - $tmpGlobals['wgAllowExternalImages'] = true; - $tmpGlobals['wgRawHtml'] = false; - $tmpGlobals['wgUseTidy'] = false; - $tmpGlobals['wgAlwaysUseTidy'] = false; - $tmpGlobals['wgWellFormedXml'] = true; - $tmpGlobals['wgAllowMicrodataAttributes'] = true; - $tmpGlobals['wgExperimentalHtmlIds'] = false; - $tmpGlobals['wgAdaptiveMessageCache'] = true; - $tmpGlobals['wgUseDatabaseMessages'] = true; - $tmpGlobals['wgLocaltimezone'] = 'UTC'; - $tmpGlobals['wgDeferredUpdateList'] = array(); - $tmpGlobals['wgGroupPermissions'] = array( - '*' => array( - 'createaccount' => true, - 'read' => true, - 'edit' => true, - 'createpage' => true, - 'createtalk' => true, - ) ); - $tmpGlobals['wgNamespaceProtection'] = array( NS_MEDIAWIKI => 'editinterface' ); - - $tmpGlobals['wgParser'] = new StubObject( - 'wgParser', $GLOBALS['wgParserConf']['class'], - array( $GLOBALS['wgParserConf'] ) ); - - $tmpGlobals['wgFileExtensions'][] = 'svg'; - $tmpGlobals['wgSVGConverter'] = 'rsvg'; - $tmpGlobals['wgSVGConverters']['rsvg'] = - '$path/rsvg-convert -w $width -h $height $input -o $output'; - - if ( $GLOBALS['wgStyleDirectory'] === false ) { - $tmpGlobals['wgStyleDirectory'] = "$IP/skins"; - } - - # Replace all media handlers with a mock. We do not need to generate - # actual thumbnails to do parser testing, we only care about receiving - # a ThumbnailImage properly initialized. - global $wgMediaHandlers; - foreach ( $wgMediaHandlers as $type => $handler ) { - $tmpGlobals['wgMediaHandlers'][$type] = 'MockBitmapHandler'; - } - // Vector images have to be handled slightly differently - $tmpGlobals['wgMediaHandlers']['image/svg+xml'] = 'MockSvgHandler'; - - $tmpHooks = $wgHooks; - $tmpHooks['ParserTestParser'][] = 'ParserTestParserHook::setup'; - $tmpHooks['ParserGetVariableValueTs'][] = 'ParserTest::getFakeTimestamp'; - $tmpGlobals['wgHooks'] = $tmpHooks; - # add a namespace shadowing a interwiki link, to test - # proper precedence when resolving links. (bug 51680) - $tmpGlobals['wgExtraNamespaces'] = array( 100 => 'MemoryAlpha' ); - - $this->setMwGlobals( $tmpGlobals ); - - $this->savedWeirdGlobals['image_alias'] = $wgNamespaceAliases['Image']; - $this->savedWeirdGlobals['image_talk_alias'] = $wgNamespaceAliases['Image_talk']; - - $wgNamespaceAliases['Image'] = NS_FILE; - $wgNamespaceAliases['Image_talk'] = NS_FILE_TALK; - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - } - - protected function tearDown() { - global $wgNamespaceAliases, $wgContLang; - - $wgNamespaceAliases['Image'] = $this->savedWeirdGlobals['image_alias']; - $wgNamespaceAliases['Image_talk'] = $this->savedWeirdGlobals['image_talk_alias']; - - // Restore backends - RepoGroup::destroySingleton(); - FileBackendGroup::destroySingleton(); - - // Remove temporary pages from the link cache - LinkCache::singleton()->clear(); - - // Restore message cache (temporary pages and $wgUseDatabaseMessages) - MessageCache::destroyInstance(); - - parent::tearDown(); - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - } - - public static function tearDownAfterClass() { - ParserTest::tearDownInterwikis(); - parent::tearDownAfterClass(); - } - - function addDBData() { - $this->tablesUsed[] = 'site_stats'; - # disabled for performance - #$this->tablesUsed[] = 'image'; - - # Update certain things in site_stats - $this->db->insert( 'site_stats', - array( 'ss_row_id' => 1, 'ss_images' => 2, 'ss_good_articles' => 1 ), - __METHOD__ - ); - - $user = User::newFromId( 0 ); - LinkCache::singleton()->clear(); # Avoids the odd failure at creating the nullRevision - - # Upload DB table entries for files. - # We will upload the actual files later. Note that if anything causes LocalFile::load() - # to be triggered before then, it will break via maybeUpgrade() setting the fileExists - # member to false and storing it in cache. - # note that the size/width/height/bits/etc of the file - # are actually set by inspecting the file itself; the arguments - # to recordUpload2 have no effect. That said, we try to make things - # match up so it is less confusing to readers of the code & tests. - $image = wfLocalFile( Title::makeTitle( NS_FILE, 'Foobar.jpg' ) ); - if ( !$this->db->selectField( 'image', '1', array( 'img_name' => $image->getName() ) ) ) { - $image->recordUpload2( - '', // archive name - 'Upload of some lame file', - 'Some lame file', - array( - 'size' => 7881, - 'width' => 1941, - 'height' => 220, - 'bits' => 8, - 'media_type' => MEDIATYPE_BITMAP, - 'mime' => 'image/jpeg', - 'metadata' => serialize( array() ), - 'sha1' => wfBaseConvert( '1', 16, 36, 31 ), - 'fileExists' => true ), - $this->db->timestamp( '20010115123500' ), $user - ); - } - - $image = wfLocalFile( Title::makeTitle( NS_FILE, 'Thumb.png' ) ); - if ( !$this->db->selectField( 'image', '1', array( 'img_name' => $image->getName() ) ) ) { - $image->recordUpload2( - '', // archive name - 'Upload of some lame thumbnail', - 'Some lame thumbnail', - array( - 'size' => 22589, - 'width' => 135, - 'height' => 135, - 'bits' => 8, - 'media_type' => MEDIATYPE_BITMAP, - 'mime' => 'image/png', - 'metadata' => serialize( array() ), - 'sha1' => wfBaseConvert( '2', 16, 36, 31 ), - 'fileExists' => true ), - $this->db->timestamp( '20130225203040' ), $user - ); - } - - # This image will be blacklisted in [[MediaWiki:Bad image list]] - $image = wfLocalFile( Title::makeTitle( NS_FILE, 'Bad.jpg' ) ); - if ( !$this->db->selectField( 'image', '1', array( 'img_name' => $image->getName() ) ) ) { - $image->recordUpload2( - '', // archive name - 'zomgnotcensored', - 'Borderline image', - array( - 'size' => 12345, - 'width' => 320, - 'height' => 240, - 'bits' => 24, - 'media_type' => MEDIATYPE_BITMAP, - 'mime' => 'image/jpeg', - 'metadata' => serialize( array() ), - 'sha1' => wfBaseConvert( '3', 16, 36, 31 ), - 'fileExists' => true ), - $this->db->timestamp( '20010115123500' ), $user - ); - } - $image = wfLocalFile( Title::makeTitle( NS_FILE, 'Foobar.svg' ) ); - if ( !$this->db->selectField( 'image', '1', array( 'img_name' => $image->getName() ) ) ) { - $image->recordUpload2( '', 'Upload of some lame SVG', 'Some lame SVG', array( - 'size' => 12345, - 'width' => 200, - 'height' => 200, - 'bits' => 24, - 'media_type' => MEDIATYPE_DRAWING, - 'mime' => 'image/svg+xml', - 'metadata' => serialize( array() ), - 'sha1' => wfBaseConvert( '', 16, 36, 31 ), - 'fileExists' => true - ), $this->db->timestamp( '20010115123500' ), $user ); - } - } - - //ParserTest setup/teardown functions - - /** - * Set up the global variables for a consistent environment for each test. - * Ideally this should replace the global configuration entirely. - */ - protected function setupGlobals( $opts = array(), $config = '' ) { - global $wgFileBackends; - # Find out values for some special options. - $lang = - self::getOptionValue( 'language', $opts, 'en' ); - $variant = - self::getOptionValue( 'variant', $opts, false ); - $maxtoclevel = - self::getOptionValue( 'wgMaxTocLevel', $opts, 999 ); - $linkHolderBatchSize = - self::getOptionValue( 'wgLinkHolderBatchSize', $opts, 1000 ); - - $uploadDir = $this->getUploadDir(); - if ( $this->getCliArg( 'use-filebackend=' ) ) { - if ( self::$backendToUse ) { - $backend = self::$backendToUse; - } else { - $name = $this->getCliArg( 'use-filebackend=' ); - $useConfig = array(); - foreach ( $wgFileBackends as $conf ) { - if ( $conf['name'] == $name ) { - $useConfig = $conf; - } - } - $useConfig['name'] = 'local-backend'; // swap name - $class = $conf['class']; - self::$backendToUse = new $class( $useConfig ); - $backend = self::$backendToUse; - } - } else { - # Replace with a mock. We do not care about generating real - # files on the filesystem, just need to expose the file - # informations. - $backend = new MockFileBackend( array( - 'name' => 'local-backend', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array( - 'local-public' => "$uploadDir", - 'local-thumb' => "$uploadDir/thumb", - ) - ) ); - } - - $settings = array( - 'wgLocalFileRepo' => array( - 'class' => 'LocalRepo', - 'name' => 'local', - 'url' => 'http://example.com/images', - 'hashLevels' => 2, - 'transformVia404' => false, - 'backend' => $backend - ), - 'wgEnableUploads' => self::getOptionValue( 'wgEnableUploads', $opts, true ), - 'wgLanguageCode' => $lang, - 'wgDBprefix' => $this->db->getType() != 'oracle' ? 'unittest_' : 'ut_', - 'wgRawHtml' => self::getOptionValue( 'wgRawHtml', $opts, false ), - 'wgNamespacesWithSubpages' => array( NS_MAIN => isset( $opts['subpage'] ) ), - 'wgAllowExternalImages' => self::getOptionValue( 'wgAllowExternalImages', $opts, true ), - 'wgMaxTocLevel' => $maxtoclevel, - 'wgUseTeX' => isset( $opts['math'] ) || isset( $opts['texvc'] ), - 'wgMathDirectory' => $uploadDir . '/math', - 'wgDefaultLanguageVariant' => $variant, - 'wgLinkHolderBatchSize' => $linkHolderBatchSize, - ); - - if ( $config ) { - $configLines = explode( "\n", $config ); - - foreach ( $configLines as $line ) { - list( $var, $value ) = explode( '=', $line, 2 ); - - $settings[$var] = eval( "return $value;" ); //??? - } - } - - $this->savedGlobals = array(); - - /** @since 1.20 */ - wfRunHooks( 'ParserTestGlobals', array( &$settings ) ); - - $langObj = Language::factory( $lang ); - $settings['wgContLang'] = $langObj; - $settings['wgLang'] = $langObj; - - $context = new RequestContext(); - $settings['wgOut'] = $context->getOutput(); - $settings['wgUser'] = $context->getUser(); - $settings['wgRequest'] = $context->getRequest(); - - foreach ( $settings as $var => $val ) { - if ( array_key_exists( $var, $GLOBALS ) ) { - $this->savedGlobals[$var] = $GLOBALS[$var]; - } - - $GLOBALS[$var] = $val; - } - - MagicWord::clearCache(); - - # The entries saved into RepoGroup cache with previous globals will be wrong. - RepoGroup::destroySingleton(); - FileBackendGroup::destroySingleton(); - - # Create dummy files in storage - $this->setupUploads(); - - # Publish the articles after we have the final language set - $this->publishTestArticles(); - - MessageCache::destroyInstance(); - - return $context; - } - - /** - * Get an FS upload directory (only applies to FSFileBackend) - * - * @return String: the directory - */ - protected function getUploadDir() { - if ( $this->keepUploads ) { - $dir = wfTempDir() . '/mwParser-images'; - - if ( is_dir( $dir ) ) { - return $dir; - } - } else { - $dir = wfTempDir() . "/mwParser-" . mt_rand() . "-images"; - } - - // wfDebug( "Creating upload directory $dir\n" ); - if ( file_exists( $dir ) ) { - wfDebug( "Already exists!\n" ); - - return $dir; - } - - return $dir; - } - - /** - * Create a dummy uploads directory which will contain a couple - * of files in order to pass existence tests. - * - * @return String: the directory - */ - protected function setupUploads() { - global $IP; - - $base = $this->getBaseDir(); - $backend = RepoGroup::singleton()->getLocalRepo()->getBackend(); - $backend->prepare( array( 'dir' => "$base/local-public/3/3a" ) ); - $backend->store( array( - 'src' => "$IP/skins/monobook/headbg.jpg", 'dst' => "$base/local-public/3/3a/Foobar.jpg" - ) ); - $backend->prepare( array( 'dir' => "$base/local-public/e/ea" ) ); - $backend->store( array( - 'src' => "$IP/skins/monobook/wiki.png", 'dst' => "$base/local-public/e/ea/Thumb.png" - ) ); - $backend->prepare( array( 'dir' => "$base/local-public/0/09" ) ); - $backend->store( array( - 'src' => "$IP/skins/monobook/headbg.jpg", 'dst' => "$base/local-public/0/09/Bad.jpg" - ) ); - - // No helpful SVG file to copy, so make one ourselves - $tmpDir = wfTempDir(); - $tempFsFile = new TempFSFile( "$tmpDir/Foobar.svg" ); - $tempFsFile->autocollect(); // destroy file when $tempFsFile leaves scope - file_put_contents( "$tmpDir/Foobar.svg", - '' . - 'Foo' ); - - $backend->prepare( array( 'dir' => "$base/local-public/f/ff" ) ); - $backend->quickStore( array( - 'src' => "$tmpDir/Foobar.svg", 'dst' => "$base/local-public/f/ff/Foobar.svg" - ) ); - } - - /** - * Restore default values and perform any necessary clean-up - * after each test runs. - */ - protected function teardownGlobals() { - $this->teardownUploads(); - - foreach ( $this->savedGlobals as $var => $val ) { - $GLOBALS[$var] = $val; - } - } - - /** - * Remove the dummy uploads directory - */ - private function teardownUploads() { - if ( $this->keepUploads ) { - return; - } - - $backend = RepoGroup::singleton()->getLocalRepo()->getBackend(); - if ( $backend instanceof MockFileBackend ) { - # In memory backend, so dont bother cleaning them up. - return; - } - - $base = $this->getBaseDir(); - // delete the files first, then the dirs. - self::deleteFiles( - array( - "$base/local-public/3/3a/Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/180px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/200px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/640px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/120px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/20px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/270px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/300px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/30px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/360px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/400px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/40px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/70px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/960px-Foobar.jpg", - - "$base/local-public/e/ea/Thumb.png", - - "$base/local-public/0/09/Bad.jpg", - - "$base/local-public/f/ff/Foobar.svg", - "$base/local-thumb/f/ff/Foobar.svg/180px-Foobar.svg.jpg", - "$base/local-thumb/f/ff/Foobar.svg/270px-Foobar.svg.jpg", - "$base/local-thumb/f/ff/Foobar.svg/360px-Foobar.svg.jpg", - "$base/local-thumb/f/ff/Foobar.svg/langde-180px-Foobar.svg.jpg", - "$base/local-thumb/f/ff/Foobar.svg/langde-270px-Foobar.svg.jpg", - "$base/local-thumb/f/ff/Foobar.svg/langde-360px-Foobar.svg.jpg", - - "$base/local-public/math/f/a/5/fa50b8b616463173474302ca3e63586b.png", - ) - ); - } - - /** - * Delete the specified files, if they exist. - * @param $files Array: full paths to files to delete. - */ - private static function deleteFiles( $files ) { - $backend = RepoGroup::singleton()->getLocalRepo()->getBackend(); - foreach ( $files as $file ) { - $backend->delete( array( 'src' => $file ), array( 'force' => 1 ) ); - } - foreach ( $files as $file ) { - $tmp = $file; - while ( $tmp = FileBackend::parentStoragePath( $tmp ) ) { - if ( !$backend->clean( array( 'dir' => $tmp ) )->isOK() ) { - break; - } - } - } - } - - protected function getBaseDir() { - return 'mwstore://local-backend'; - } - - public function parserTestProvider() { - if ( $this->file === false ) { - global $wgParserTestFiles; - $this->file = $wgParserTestFiles[0]; - } - - return new TestFileIterator( $this->file, $this ); - } - - /** - * Set the file from whose tests will be run by this instance - */ - public function setParserTestFile( $filename ) { - $this->file = $filename; - } - - /** - * @group medium - * @dataProvider parserTestProvider - */ - public function testParserTest( $desc, $input, $result, $opts, $config ) { - if ( $this->regex != '' && !preg_match( '/' . $this->regex . '/', $desc ) ) { - $this->assertTrue( true ); // XXX: don't flood output with "test made no assertions" - //$this->markTestSkipped( 'Filtered out by the user' ); - return; - } - - if ( !$this->isWikitextNS( NS_MAIN ) ) { - // parser tests frequently assume that the main namespace contains wikitext. - // @todo When setting up pages, force the content model. Only skip if - // $wgtContentModelUseDB is false. - $this->markTestSkipped( "Main namespace does not support wikitext," - . "skipping parser test: $desc" ); - } - - wfDebug( "Running parser test: $desc\n" ); - - $opts = $this->parseOptions( $opts ); - $context = $this->setupGlobals( $opts, $config ); - - $user = $context->getUser(); - $options = ParserOptions::newFromContext( $context ); - - if ( isset( $opts['title'] ) ) { - $titleText = $opts['title']; - } else { - $titleText = 'Parser test'; - } - - $local = isset( $opts['local'] ); - $preprocessor = isset( $opts['preprocessor'] ) ? $opts['preprocessor'] : null; - $parser = $this->getParser( $preprocessor ); - - $title = Title::newFromText( $titleText ); - - # Parser test requiring math. Make sure texvc is executable - # or just skip such tests. - if ( isset( $opts['math'] ) || isset( $opts['texvc'] ) ) { - global $wgTexvc; - - if ( !isset( $wgTexvc ) ) { - $this->markTestSkipped( "SKIPPED: \$wgTexvc is not set" ); - } elseif ( !is_executable( $wgTexvc ) ) { - $this->markTestSkipped( "SKIPPED: texvc binary does not exist" - . " or is not executable.\n" - . "Current configuration is:\n\$wgTexvc = '$wgTexvc'" ); - } - } - - if ( isset( $opts['pst'] ) ) { - $out = $parser->preSaveTransform( $input, $title, $user, $options ); - } elseif ( isset( $opts['msg'] ) ) { - $out = $parser->transformMsg( $input, $options, $title ); - } elseif ( isset( $opts['section'] ) ) { - $section = $opts['section']; - $out = $parser->getSection( $input, $section ); - } elseif ( isset( $opts['replace'] ) ) { - $section = $opts['replace'][0]; - $replace = $opts['replace'][1]; - $out = $parser->replaceSection( $input, $section, $replace ); - } elseif ( isset( $opts['comment'] ) ) { - $out = Linker::formatComment( $input, $title, $local ); - } elseif ( isset( $opts['preload'] ) ) { - $out = $parser->getPreloadText( $input, $title, $options ); - } else { - $output = $parser->parse( $input, $title, $options, true, true, 1337 ); - $output->setTOCEnabled( !isset( $opts['notoc'] ) ); - $out = $output->getText(); - - if ( isset( $opts['showtitle'] ) ) { - if ( $output->getTitleText() ) { - $title = $output->getTitleText(); - } - - $out = "$title\n$out"; - } - - if ( isset( $opts['ill'] ) ) { - $out = $this->tidy( implode( ' ', $output->getLanguageLinks() ) ); - } elseif ( isset( $opts['cat'] ) ) { - $outputPage = $context->getOutput(); - $outputPage->addCategoryLinks( $output->getCategories() ); - $cats = $outputPage->getCategoryLinks(); - - if ( isset( $cats['normal'] ) ) { - $out = $this->tidy( implode( ' ', $cats['normal'] ) ); - } else { - $out = ''; - } - } - $parser->mPreprocessor = null; - - $result = $this->tidy( $result ); - } - - $this->teardownGlobals(); - - $this->assertEquals( $result, $out, $desc ); - } - - /** - * Run a fuzz test series - * Draw input from a set of test files - * - * @todo fixme Needs some work to not eat memory until the world explodes - * - * @group ParserFuzz - */ - public function testFuzzTests() { - global $wgParserTestFiles; - - $files = $wgParserTestFiles; - - if ( $this->getCliArg( 'file=' ) ) { - $files = array( $this->getCliArg( 'file=' ) ); - } - - $dict = $this->getFuzzInput( $files ); - $dictSize = strlen( $dict ); - $logMaxLength = log( $this->maxFuzzTestLength ); - - ini_set( 'memory_limit', $this->memoryLimit * 1048576 ); - - $user = new User; - $opts = ParserOptions::newFromUser( $user ); - $title = Title::makeTitle( NS_MAIN, 'Parser_test' ); - - $id = 1; - - while ( true ) { - - // Generate test input - mt_srand( ++$this->fuzzSeed ); - $totalLength = mt_rand( 1, $this->maxFuzzTestLength ); - $input = ''; - - while ( strlen( $input ) < $totalLength ) { - $logHairLength = mt_rand( 0, 1000000 ) / 1000000 * $logMaxLength; - $hairLength = min( intval( exp( $logHairLength ) ), $dictSize ); - $offset = mt_rand( 0, $dictSize - $hairLength ); - $input .= substr( $dict, $offset, $hairLength ); - } - - $this->setupGlobals(); - $parser = $this->getParser(); - - // Run the test - try { - $parser->parse( $input, $title, $opts ); - $this->assertTrue( true, "Test $id, fuzz seed {$this->fuzzSeed}" ); - } catch ( Exception $exception ) { - $input_dump = sprintf( "string(%d) \"%s\"\n", strlen( $input ), $input ); - - $this->assertTrue( false, "Test $id, fuzz seed {$this->fuzzSeed}. \n\n" . - "Input: $input_dump\n\nError: {$exception->getMessage()}\n\n" . - "Backtrace: {$exception->getTraceAsString()}" ); - } - - $this->teardownGlobals(); - $parser->__destruct(); - - if ( $id % 100 == 0 ) { - $usage = intval( memory_get_usage( true ) / $this->memoryLimit / 1048576 * 100 ); - //echo "{$this->fuzzSeed}: $numSuccess/$numTotal (mem: $usage%)\n"; - if ( $usage > 90 ) { - $ret = "Out of memory:\n"; - $memStats = $this->getMemoryBreakdown(); - - foreach ( $memStats as $name => $usage ) { - $ret .= "$name: $usage\n"; - } - - throw new MWException( $ret ); - } - } - - $id++; - } - } - - //Various getter functions - - /** - * Get an input dictionary from a set of parser test files - */ - function getFuzzInput( $filenames ) { - $dict = ''; - - foreach ( $filenames as $filename ) { - $contents = file_get_contents( $filename ); - preg_match_all( '/!!\s*input\n(.*?)\n!!\s*result/s', $contents, $matches ); - - foreach ( $matches[1] as $match ) { - $dict .= $match . "\n"; - } - } - - return $dict; - } - - /** - * Get a memory usage breakdown - */ - function getMemoryBreakdown() { - $memStats = array(); - - foreach ( $GLOBALS as $name => $value ) { - $memStats['$' . $name] = strlen( serialize( $value ) ); - } - - $classes = get_declared_classes(); - - foreach ( $classes as $class ) { - $rc = new ReflectionClass( $class ); - $props = $rc->getStaticProperties(); - $memStats[$class] = strlen( serialize( $props ) ); - $methods = $rc->getMethods(); - - foreach ( $methods as $method ) { - $memStats[$class] += strlen( serialize( $method->getStaticVariables() ) ); - } - } - - $functions = get_defined_functions(); - - foreach ( $functions['user'] as $function ) { - $rf = new ReflectionFunction( $function ); - $memStats["$function()"] = strlen( serialize( $rf->getStaticVariables() ) ); - } - - asort( $memStats ); - - return $memStats; - } - - /** - * Get a Parser object - */ - function getParser( $preprocessor = null ) { - global $wgParserConf; - - $class = $wgParserConf['class']; - $parser = new $class( array( 'preprocessorClass' => $preprocessor ) + $wgParserConf ); - - wfRunHooks( 'ParserTestParser', array( &$parser ) ); - - return $parser; - } - - //Various action functions - - public function addArticle( $name, $text, $line ) { - self::$articles[$name] = array( $text, $line ); - } - - public function publishTestArticles() { - if ( empty( self::$articles ) ) { - return; - } - - foreach ( self::$articles as $name => $info ) { - list( $text, $line ) = $info; - ParserTest::addArticle( $name, $text, $line, 'ignoreduplicate' ); - } - } - - /** - * Steal a callback function from the primary parser, save it for - * application to our scary parser. If the hook is not installed, - * abort processing of this file. - * - * @param $name String - * @return Bool true if tag hook is present - */ - public function requireHook( $name ) { - global $wgParser; - $wgParser->firstCallInit(); // make sure hooks are loaded. - return isset( $wgParser->mTagHooks[$name] ); - } - - public function requireFunctionHook( $name ) { - global $wgParser; - $wgParser->firstCallInit(); // make sure hooks are loaded. - return isset( $wgParser->mFunctionHooks[$name] ); - } - - //Various "cleanup" functions - - /** - * Run the "tidy" command on text if the $wgUseTidy - * global is true - * - * @param $text String: the text to tidy - * @return String - */ - protected function tidy( $text ) { - global $wgUseTidy; - - if ( $wgUseTidy ) { - $text = MWTidy::tidy( $text ); - } - - return $text; - } - - /** - * Remove last character if it is a newline - */ - public function removeEndingNewline( $s ) { - if ( substr( $s, -1 ) === "\n" ) { - return substr( $s, 0, -1 ); - } else { - return $s; - } - } - - //Test options parser functions - - protected function parseOptions( $instring ) { - $opts = array(); - // foo - // foo=bar - // foo="bar baz" - // foo=[[bar baz]] - // foo=bar,"baz quux" - $regex = '/\b - ([\w-]+) # Key - \b - (?:\s* - = # First sub-value - \s* - ( - " - [^"]* # Quoted val - " - | - \[\[ - [^]]* # Link target - \]\] - | - [\w-]+ # Plain word - ) - (?:\s* - , # Sub-vals 1..N - \s* - ( - "[^"]*" # Quoted val - | - \[\[[^]]*\]\] # Link target - | - [\w-]+ # Plain word - ) - )* - )? - /x'; - - if ( preg_match_all( $regex, $instring, $matches, PREG_SET_ORDER ) ) { - foreach ( $matches as $bits ) { - array_shift( $bits ); - $key = strtolower( array_shift( $bits ) ); - if ( count( $bits ) == 0 ) { - $opts[$key] = true; - } elseif ( count( $bits ) == 1 ) { - $opts[$key] = $this->cleanupOption( array_shift( $bits ) ); - } else { - // Array! - $opts[$key] = array_map( array( $this, 'cleanupOption' ), $bits ); - } - } - } - - return $opts; - } - - protected function cleanupOption( $opt ) { - if ( substr( $opt, 0, 1 ) == '"' ) { - return substr( $opt, 1, -1 ); - } - - if ( substr( $opt, 0, 2 ) == '[[' ) { - return substr( $opt, 2, -2 ); - } - - return $opt; - } - - /** - * Use a regex to find out the value of an option - * @param $key String: name of option val to retrieve - * @param $opts Options array to look in - * @param $default Mixed: default value returned if not found - */ - protected static function getOptionValue( $key, $opts, $default ) { - $key = strtolower( $key ); - - if ( isset( $opts[$key] ) ) { - return $opts[$key]; - } else { - return $default; - } - } -} diff --git a/tests/phpunit/includes/parser/ParserMethodsTest.php b/tests/phpunit/includes/parser/ParserMethodsTest.php deleted file mode 100644 index e5c5cb21..00000000 --- a/tests/phpunit/includes/parser/ParserMethodsTest.php +++ /dev/null @@ -1,95 +0,0 @@ -~~~', - 'hello \'\'this\'\' is ~~~', - ), - ); - } - - /** - * @dataProvider providePreSaveTransform - * @covers Parser::preSaveTransform - */ - public function testPreSaveTransform( $text, $expected ) { - global $wgParser; - - $title = Title::newFromText( str_replace( '::', '__', __METHOD__ ) ); - $user = new User(); - $user->setName( "127.0.0.1" ); - $popts = ParserOptions::newFromUser( $user ); - $text = $wgParser->preSaveTransform( $text, $title, $user, $popts ); - - $this->assertEquals( $expected, $text ); - } - - /** - * @covers Parser::callParserFunction - */ - public function testCallParserFunction() { - global $wgParser; - - // Normal parses test passing PPNodes. Test passing an array. - $title = Title::newFromText( str_replace( '::', '__', __METHOD__ ) ); - $wgParser->startExternalParse( $title, new ParserOptions(), Parser::OT_HTML ); - $frame = $wgParser->getPreprocessor()->newFrame(); - $ret = $wgParser->callParserFunction( $frame, '#tag', - array( 'pre', 'foo', 'style' => 'margin-left: 1.6em' ) - ); - $ret['text'] = $wgParser->mStripState->unstripBoth( $ret['text'] ); - $this->assertSame( array( - 'found' => true, - 'text' => '
        foo
        ', - ), $ret, 'callParserFunction works for {{#tag:pre|foo|style=margin-left: 1.6em}}' ); - } - - /** - * @covers Parser::parse - * @covers ParserOutput::getSections - */ - public function testGetSections() { - global $wgParser; - - $title = Title::newFromText( str_replace( '::', '__', __METHOD__ ) ); - $out = $wgParser->parse( "==foo==\n

        bar

        \n==baz==\n", $title, new ParserOptions() ); - $this->assertSame( array( - array( - 'toclevel' => 1, - 'level' => '2', - 'line' => 'foo', - 'number' => '1', - 'index' => '1', - 'fromtitle' => $title->getPrefixedDBkey(), - 'byteoffset' => 0, - 'anchor' => 'foo', - ), - array( - 'toclevel' => 1, - 'level' => '2', - 'line' => 'bar', - 'number' => '2', - 'index' => '', - 'fromtitle' => false, - 'byteoffset' => null, - 'anchor' => 'bar', - ), - array( - 'toclevel' => 1, - 'level' => '2', - 'line' => 'baz', - 'number' => '3', - 'index' => '2', - 'fromtitle' => $title->getPrefixedDBkey(), - 'byteoffset' => 21, - 'anchor' => 'baz', - ), - ), $out->getSections(), 'getSections() with proper value when

        is used' ); - } - //@Todo Add tests for cleanSig() / cleanSigInSig(), getSection(), replaceSection(), getPreloadText() -} diff --git a/tests/phpunit/includes/parser/ParserOutputTest.php b/tests/phpunit/includes/parser/ParserOutputTest.php deleted file mode 100644 index c73666da..00000000 --- a/tests/phpunit/includes/parser/ParserOutputTest.php +++ /dev/null @@ -1,59 +0,0 @@ -assertEquals( $shouldMatch, ParserOutput::isLinkInternal( $server, $url ) ); - } - - /** - * @covers ParserOutput::setExtensionData - * @covers ParserOutput::getExtensionData - */ - public function testExtensionData() { - $po = new ParserOutput(); - - $po->setExtensionData( "one", "Foo" ); - - $this->assertEquals( "Foo", $po->getExtensionData( "one" ) ); - $this->assertNull( $po->getExtensionData( "spam" ) ); - - $po->setExtensionData( "two", "Bar" ); - $this->assertEquals( "Foo", $po->getExtensionData( "one" ) ); - $this->assertEquals( "Bar", $po->getExtensionData( "two" ) ); - - $po->setExtensionData( "one", null ); - $this->assertNull( $po->getExtensionData( "one" ) ); - $this->assertEquals( "Bar", $po->getExtensionData( "two" ) ); - } -} diff --git a/tests/phpunit/includes/parser/ParserPreloadTest.php b/tests/phpunit/includes/parser/ParserPreloadTest.php deleted file mode 100644 index d12fee36..00000000 --- a/tests/phpunit/includes/parser/ParserPreloadTest.php +++ /dev/null @@ -1,80 +0,0 @@ -testParserOptions = ParserOptions::newFromUserAndLang( new User, $wgContLang ); - - $this->testParser = new Parser(); - $this->testParser->Options( $this->testParserOptions ); - $this->testParser->clearState(); - - $this->title = Title::newFromText( 'Preload Test' ); - } - - protected function tearDown() { - parent::tearDown(); - - unset( $this->testParser ); - unset( $this->title ); - } - - /** - * @covers Parser::getPreloadText - */ - public function testPreloadSimpleText() { - $this->assertPreloaded( 'simple', 'simple' ); - } - - /** - * @covers Parser::getPreloadText - */ - public function testPreloadedPreIsUnstripped() { - $this->assertPreloaded( - '
        monospaced
        ', - '
        monospaced
        ', - '
         in preloaded text must be unstripped (bug 27467)'
        -		);
        -	}
        -
        -	/**
        -	 * @covers Parser::getPreloadText
        -	 */
        -	public function testPreloadedNowikiIsUnstripped() {
        -		$this->assertPreloaded(
        -			'[[Dummy title]]',
        -			'[[Dummy title]]',
        -			' in preloaded text must be unstripped (bug 27467)'
        -		);
        -	}
        -
        -	protected function assertPreloaded( $expected, $text, $msg = '' ) {
        -		$this->assertEquals(
        -			$expected,
        -			$this->testParser->getPreloadText(
        -				$text,
        -				$this->title,
        -				$this->testParserOptions
        -			),
        -			$msg
        -		);
        -	}
        -}
        diff --git a/tests/phpunit/includes/parser/PreprocessorTest.php b/tests/phpunit/includes/parser/PreprocessorTest.php
        deleted file mode 100644
        index 8aee937c..00000000
        --- a/tests/phpunit/includes/parser/PreprocessorTest.php
        +++ /dev/null
        @@ -1,239 +0,0 @@
        -mOptions = ParserOptions::newFromUserAndLang( new User, $wgContLang );
        -		$name = isset( $wgParserConf['preprocessorClass'] ) ? $wgParserConf['preprocessorClass'] : 'Preprocessor_DOM';
        -
        -		$this->mPreprocessor = new $name( $this );
        -	}
        -
        -	function getStripList() {
        -		return array( 'gallery', 'display map' /* Used by Maps, see r80025 CR */, '/foo' );
        -	}
        -
        -	public static function provideCases() {
        -		return array(
        -			array( "Foo", "Foo" ),
        -			array( "", "<!-- Foo -->" ),
        -			array( "", "<!-- Foo --><!-- Bar -->" ),
        -			array( "  ", "<!-- Foo -->  <!-- Bar -->" ),
        -			array( " \n ", "<!-- Foo --> \n <!-- Bar -->" ),
        -			array( " \n \n", "<!-- Foo --> \n <!-- Bar -->\n" ),
        -			array( "  \n", "<!-- Foo -->  <!-- Bar -->\n" ),
        -			array( "Bar", "<!-->Bar" ),
        -			array( "\n== Baz ==\n", "== Foo ==\n  <!-- Bar -->\n== Baz ==\n" ),
        -			array( "", "gallery" ),
        -			array( "Foo  Bar", "Foo gallery Bar" ),
        -			array( "", "gallery</gallery>" ),
        -			array( " ", "<foo> gallery</gallery>" ),
        -			array( " ", "<foo> gallery<gallery></gallery>" ),
        -			array( " Foo bar ", "<noinclude> Foo bar </noinclude>" ),
        -			array( "\n{{Foo}}\n", "<noinclude>\n\n</noinclude>" ),
        -			array( "\n{{Foo}}\n\n", "<noinclude>\n\n</noinclude>\n" ),
        -			array( "foo bar", "galleryfoo bar" ),
        -			array( "<{{foo}}>", "<>" ),
        -			array( "<{{{foo}}}>", "<foo>" ),
        -			array( "", "gallery</gallery</gallery>" ),
        -			array( "=== Foo === ", "=== Foo === " ),
        -			array( "=== Foo === ", "==<!-- -->= Foo === " ),
        -			array( "=== Foo === ", "=== Foo ==<!-- -->= " ),
        -			array( "=== Foo ===\n", "=== Foo ===<!-- -->\n" ),
        -			array( "=== Foo === \n", "=== Foo ===<!-- --> <!-- -->\n" ),
        -			array( "== Foo ==\n== Bar == \n", "== Foo ==\n== Bar == \n" ),
        -			array( "===========", "===========" ),
        -			array( "Foo\n=\n==\n=\n", "Foo\n=\n==\n=\n" ),
        -			array( "{{Foo}}", "" ),
        -			array( "\n{{Foo}}", "\n" ),
        -			array( "{{Foo|bar}}", "" ),
        -			array( "{{Foo|bar}}a", "a" ),
        -			array( "{{Foo|bar|baz}}", "" ),
        -			array( "{{Foo|1=bar}}", "" ),
        -			array( "{{Foo|=bar}}", "" ),
        -			array( "{{Foo|bar=baz}}", "" ),
        -			array( "{{Foo|{{bar}}=baz}}", "" ),
        -			array( "{{Foo|1=bar|baz}}", "" ),
        -			array( "{{Foo|1=bar|2=baz}}", "" ),
        -			array( "{{Foo|bar|foo=baz}}", "" ),
        -			array( "{{{1}}}", "1" ),
        -			array( "{{{1|}}}", "1" ),
        -			array( "{{{Foo}}}", "Foo" ),
        -			array( "{{{Foo|}}}", "Foo" ),
        -			array( "{{{Foo|bar|baz}}}", "Foobarbaz" ),
        -			array( "{{Foo}}", "{<!-- -->{Foo}}" ),
        -			array( "{{{{Foobar}}}}", "{Foobar}" ),
        -			array( "{{{ {{Foo}} }}}", " <template><title>Foo " ),
        -			array( "{{ {{{Foo}}} }}", "" ),
        -			array( "{{{{{Foo}}}}}", "" ),
        -			array( "{{{{{Foo}} }}}", "<template><title>Foo " ),
        -			array( "{{{{{{Foo}}}}}}", "<tplarg><title>Foo" ),
        -			array( "{{{{{{Foo}}}}}", "{" ),
        -			array( "[[[Foo]]", "[[[Foo]]" ),
        -			array( "{{Foo|[[[[bar]]|baz]]}}", "" ), // This test is important, since it means the difference between having the [[ rule stacked or not
        -			array( "{{Foo|[[[[bar]|baz]]}}", "{{Foo|[[[[bar]|baz]]}}" ),
        -			array( "{{Foo|Foo [[[[bar]|baz]]}}", "{{Foo|Foo [[[[bar]|baz]]}}" ),
        -			array( "Foo BarBaz", "Foo display mapBar</display map             >Baz" ),
        -			array( "Foo BarBaz", "Foo display map fooBar</display map             >Baz" ),
        -			array( "Foo ", "Foo gallery bar="baz" " ),
        -			array( "Foo ", "Foo gallery bar="1" baz=2 " ),
        -			array( "Foo", "/fooFoo<//foo>" ), # Worth blacklisting IMHO
        -			array( "{{#ifexpr: ({{{1|1}}} = 2) | Foo | Bar }}", "" ),
        -			array( "{{#if: {{{1|}}} | Foo | {{Bar}} }}", "" ),
        -			array( "{{#if: {{{1|}}} | Foo | [[Bar]] }}", "" ),
        -			array( "{{#if: {{{1|}}} | [[Foo]] | Bar }}", "" ),
        -			array( "{{#if: {{{1|}}} | 1 | {{#if: {{{1|}}} | 2 | 3 }} }}", "" ),
        -			array( "{{ {{Foo}}", "{{ " ),
        -			array( "{{Foobar {{Foo}} {{Bar}} {{Baz}} ", "{{Foobar    " ),
        -			array( "[[Foo]] |", "[[Foo]] |" ),
        -			array( "{{Foo|Bar|", "{{Foo|Bar|" ),
        -			array( "[[Foo]", "[[Foo]" ),
        -			array( "[[Foo|Bar]", "[[Foo|Bar]" ),
        -			array( "{{Foo| [[Bar] }}", "{{Foo| [[Bar] }}" ),
        -			array( "{{Foo| [[Bar|Baz] }}", "{{Foo| [[Bar|Baz] }}" ),
        -			array( "{{Foo|bar=[[baz]}}", "{{Foo|bar=[[baz]}}" ),
        -			array( "{{foo|", "{{foo|" ),
        -			array( "{{foo|}", "{{foo|}" ),
        -			array( "{{foo|} }}", "" ),
        -			array( "{{foo|bar=|}", "{{foo|bar=|}" ),
        -			array( "{{Foo|} Bar=", "{{Foo|} Bar=" ),
        -			array( "{{Foo|} Bar=}}", "" ),
        -			/* array( file_get_contents( __DIR__ . '/QuoteQuran.txt' ), file_get_contents( __DIR__ . '/QuoteQuranExpanded.txt' ) ), */
        -		);
        -	}
        -
        -	/**
        -	 * Get XML preprocessor tree from the preprocessor (which may not be the
        -	 * native XML-based one).
        -	 *
        -	 * @param string $wikiText
        -	 * @return string
        -	 */
        -	protected function preprocessToXml( $wikiText ) {
        -		if ( method_exists( $this->mPreprocessor, 'preprocessToXml' ) ) {
        -			return $this->normalizeXml( $this->mPreprocessor->preprocessToXml( $wikiText ) );
        -		}
        -
        -		$dom = $this->mPreprocessor->preprocessToObj( $wikiText );
        -		if ( is_callable( array( $dom, 'saveXML' ) ) ) {
        -			return $dom->saveXML();
        -		} else {
        -			return $this->normalizeXml( $dom->__toString() );
        -		}
        -	}
        -
        -	/**
        -	 * Normalize XML string to the form that a DOMDocument saves out.
        -	 *
        -	 * @param string $xml
        -	 * @return string
        -	 */
        -	protected function normalizeXml( $xml ) {
        -		return preg_replace( '!<([a-z]+)/>!', '<$1>', str_replace( ' />', '/>', $xml ) );
        -	}
        -
        -	/**
        -	 * @dataProvider provideCases
        -	 * @covers Preprocessor_DOM::preprocessToXml
        -	 */
        -	public function testPreprocessorOutput( $wikiText, $expectedXml ) {
        -		$this->assertEquals( $this->normalizeXml( $expectedXml ), $this->preprocessToXml( $wikiText ) );
        -	}
        -
        -	/**
        -	 * These are more complex test cases taken out of wiki articles.
        -	 */
        -	public static function provideFiles() {
        -		return array(
        -			array( "QuoteQuran" ), # http://en.wikipedia.org/w/index.php?title=Template:QuoteQuran/sandbox&oldid=237348988 GFDL + CC-BY-SA by Striver
        -			array( "Factorial" ), # http://en.wikipedia.org/w/index.php?title=Template:Factorial&oldid=98548758 GFDL + CC-BY-SA by Polonium
        -			array( "All_system_messages" ), # http://tl.wiktionary.org/w/index.php?title=Suleras:All_system_messages&oldid=2765 GPL text generated by MediaWiki
        -			array( "Fundraising" ), # http://tl.wiktionary.org/w/index.php?title=MediaWiki:Sitenotice&oldid=5716 GFDL + CC-BY-SA, copied there by Sky Harbor.
        -			array( "NestedTemplates" ), # bug 27936
        -		);
        -	}
        -
        -	/**
        -	 * @dataProvider provideFiles
        -	 * @covers Preprocessor_DOM::preprocessToXml
        -	 */
        -	public function testPreprocessorOutputFiles( $filename ) {
        -		$folder = __DIR__ . "/../../../parser/preprocess";
        -		$wikiText = file_get_contents( "$folder/$filename.txt" );
        -		$output = $this->preprocessToXml( $wikiText );
        -
        -		$expectedFilename = "$folder/$filename.expected";
        -		if ( file_exists( $expectedFilename ) ) {
        -			$expectedXml = $this->normalizeXml( file_get_contents( $expectedFilename ) );
        -			$this->assertEquals( $expectedXml, $output );
        -		} else {
        -			$tempFilename = tempnam( $folder, "$filename." );
        -			file_put_contents( $tempFilename, $output );
        -			$this->markTestIncomplete( "File $expectedFilename missing. Output stored as $tempFilename" );
        -		}
        -	}
        -
        -	/**
        -	 * Tests from Bug 28642 · https://bugzilla.wikimedia.org/28642
        -	 */
        -	public static function provideHeadings() {
        -		return array( /* These should become headings: */
        -			array( "== h ==", "== h ==<!--c1-->" ),
        -			array( "== h == 	", "== h == 	<!--c1-->" ),
        -			array( "== h == 	", "== h ==<!--c1--> 	" ),
        -			array( "== h == 	 	", "== h == 	<!--c1--> 	" ),
        -			array( "== h ==", "== h ==<!--c1--><!--c2-->" ),
        -			array( "== h == 	", "== h == 	<!--c1--><!--c2-->" ),
        -			array( "== h == 	", "== h ==<!--c1--><!--c2--> 	" ),
        -			array( "== h == 	 	", "== h == 	<!--c1--><!--c2--> 	" ),
        -			array( "== h == 	  ", "== h == 	<!--c1-->  <!--c2-->" ),
        -			array( "== h ==   	", "== h ==<!--c1-->  <!--c2--> 	" ),
        -			array( "== h == 	   	", "== h == 	<!--c1-->  <!--c2--> 	" ),
        -			array( "== h ==", "== h ==<!--c1--><!--c2--><!--c3-->" ),
        -			array( "== h ==  ", "== h ==<!--c1-->  <!--c2--><!--c3-->" ),
        -			array( "== h ==  ", "== h ==<!--c1--><!--c2-->  <!--c3-->" ),
        -			array( "== h ==    ", "== h ==<!--c1-->  <!--c2-->  <!--c3-->" ),
        -			array( "== h ==  ", "== h ==  <!--c1--><!--c2--><!--c3-->" ),
        -			array( "== h ==    ", "== h ==  <!--c1-->  <!--c2--><!--c3-->" ),
        -			array( "== h ==    ", "== h ==  <!--c1--><!--c2-->  <!--c3-->" ),
        -			array( "== h ==      ", "== h ==  <!--c1-->  <!--c2-->  <!--c3-->" ),
        -			array( "== h ==  ", "== h ==<!--c1--><!--c2--><!--c3-->  " ),
        -			array( "== h ==    ", "== h ==<!--c1-->  <!--c2--><!--c3-->  " ),
        -			array( "== h ==    ", "== h ==<!--c1--><!--c2-->  <!--c3-->  " ),
        -			array( "== h ==      ", "== h ==<!--c1-->  <!--c2-->  <!--c3-->  " ),
        -			array( "== h ==    ", "== h ==  <!--c1--><!--c2--><!--c3-->  " ),
        -			array( "== h ==      ", "== h ==  <!--c1-->  <!--c2--><!--c3-->  " ),
        -			array( "== h ==      ", "== h ==  <!--c1--><!--c2-->  <!--c3-->  " ),
        -			array( "== h ==        ", "== h ==  <!--c1-->  <!--c2-->  <!--c3-->  " ),
        -			array( "== h == 	", "== h ==<!--c1--> 	<!--c2-->" ),
        -			array( "== h == 	 	", "== h == 	<!--c1--> 	<!--c2-->" ),
        -			array( "== h == 	 	", "== h ==<!--c1--> 	<!--c2--> 	" ),
        -
        -			/* These are not working: */
        -			array( "== h == x   ", "== h == x <!--c1--><!--c2--><!--c3-->  " ),
        -			array( "== h == x   ", "== h ==<!--c1--> x <!--c2--><!--c3-->  " ),
        -			array( "== h == x ", "== h ==<!--c1--><!--c2--><!--c3--> x " ),
        -		);
        -	}
        -
        -	/**
        -	 * @dataProvider provideHeadings
        -	 * @covers Preprocessor_DOM::preprocessToXml
        -	 */
        -	public function testHeadings( $wikiText, $expectedXml ) {
        -		$this->assertEquals( $this->normalizeXml( $expectedXml ), $this->preprocessToXml( $wikiText ) );
        -	}
        -}
        diff --git a/tests/phpunit/includes/parser/TagHooksTest.php b/tests/phpunit/includes/parser/TagHooksTest.php
        deleted file mode 100644
        index 61cbe45d..00000000
        --- a/tests/phpunit/includes/parser/TagHooksTest.php
        +++ /dev/null
        @@ -1,82 +0,0 @@
        -bar" ), array( "foo\nbar" ), array( "foo\rbar" ) );
        -	}
        -
        -	protected function setUp() {
        -		parent::setUp();
        -
        -		$this->setMwGlobals( 'wgAlwaysUseTidy', false );
        -	}
        -
        -	/**
        -	 * @dataProvider provideValidNames
        -	 */
        -	public function testTagHooks( $tag ) {
        -		global $wgParserConf, $wgContLang;
        -		$parser = new Parser( $wgParserConf );
        -
        -		$parser->setHook( $tag, array( $this, 'tagCallback' ) );
        -		$parserOutput = $parser->parse( "Foo<$tag>BarBaz", Title::newFromText( 'Test' ), ParserOptions::newFromUserAndLang( new User, $wgContLang ) );
        -		$this->assertEquals( "

        FooOneBaz\n

        ", $parserOutput->getText() ); - - $parser->mPreprocessor = null; # Break the Parser <-> Preprocessor cycle - } - - /** - * @dataProvider provideBadNames - * @expectedException MWException - */ - public function testBadTagHooks( $tag ) { - global $wgParserConf, $wgContLang; - $parser = new Parser( $wgParserConf ); - - $parser->setHook( $tag, array( $this, 'tagCallback' ) ); - $parser->parse( "Foo<$tag>BarBaz", Title::newFromText( 'Test' ), ParserOptions::newFromUserAndLang( new User, $wgContLang ) ); - $this->fail( 'Exception not thrown.' ); - } - - /** - * @dataProvider provideValidNames - */ - public function testFunctionTagHooks( $tag ) { - global $wgParserConf, $wgContLang; - $parser = new Parser( $wgParserConf ); - - $parser->setFunctionTagHook( $tag, array( $this, 'functionTagCallback' ), 0 ); - $parserOutput = $parser->parse( "Foo<$tag>BarBaz", Title::newFromText( 'Test' ), ParserOptions::newFromUserAndLang( new User, $wgContLang ) ); - $this->assertEquals( "

        FooOneBaz\n

        ", $parserOutput->getText() ); - - $parser->mPreprocessor = null; # Break the Parser <-> Preprocessor cycle - } - - /** - * @dataProvider provideBadNames - * @expectedException MWException - */ - public function testBadFunctionTagHooks( $tag ) { - global $wgParserConf, $wgContLang; - $parser = new Parser( $wgParserConf ); - - $parser->setFunctionTagHook( $tag, array( $this, 'functionTagCallback' ), SFH_OBJECT_ARGS ); - $parser->parse( "Foo<$tag>BarBaz", Title::newFromText( 'Test' ), ParserOptions::newFromUserAndLang( new User, $wgContLang ) ); - $this->fail( 'Exception not thrown.' ); - } - - function tagCallback( $text, $params, $parser ) { - return str_rot13( $text ); - } - - function functionTagCallback( &$parser, $frame, $code, $attribs ) { - return str_rot13( $code ); - } -} diff --git a/tests/phpunit/includes/parser/TidyTest.php b/tests/phpunit/includes/parser/TidyTest.php deleted file mode 100644 index 57a88b9d..00000000 --- a/tests/phpunit/includes/parser/TidyTest.php +++ /dev/null @@ -1,44 +0,0 @@ -markTestSkipped( 'Tidy not found' ); - } - } - - /** - * @dataProvider provideTestWrapping - */ - public function testTidyWrapping( $expected, $text, $msg = '' ) { - $text = MWTidy::tidy( $text ); - // We don't care about where Tidy wants to stick is

        s - $text = trim( preg_replace( '##', '', $text ) ); - // Windows, we love you! - $text = str_replace( "\r", '', $text ); - $this->assertEquals( $expected, $text, $msg ); - } - - public function provideTestWrapping() { - return array( - array( - 'foo', - 'foo', - ' should survive tidy' - ), - array( - 'foo', - 'foo', - ' should survive tidy' - ), - array( 'foo', 'foo', ' should survive tidy' ), - array( "\nfoo", 'foo', ' should survive tidy' ), - array( "\nfoo", 'foo', ' should survive tidy' ), - ); - } -} \ No newline at end of file diff --git a/tests/phpunit/includes/search/SearchEngineTest.php b/tests/phpunit/includes/search/SearchEngineTest.php deleted file mode 100644 index 87067038..00000000 --- a/tests/phpunit/includes/search/SearchEngineTest.php +++ /dev/null @@ -1,176 +0,0 @@ -db->getType(); - $dbSupported = - ( $dbType === 'mysql' ) - || ( $dbType === 'sqlite' && $this->db->getFulltextSearchModule() == 'FTS3' ); - - if ( !$dbSupported ) { - $this->markTestSkipped( "MySQL or SQLite with FTS3 only" ); - } - - $searchType = $this->db->getSearchEngine(); - $this->search = new $searchType( $this->db ); - } - - protected function tearDown() { - unset( $this->search ); - - parent::tearDown(); - } - - function pageExists( $title ) { - return false; - } - - function addDBData() { - if ( $this->pageExists( 'Not_Main_Page' ) ) { - return; - } - - if ( !$this->isWikitextNS( NS_MAIN ) ) { - // @todo cover the case of non-wikitext content in the main namespace - return; - } - - $this->insertPage( "Not_Main_Page", "This is not a main page", 0 ); - $this->insertPage( 'Talk:Not_Main_Page', 'This is not a talk page to the main page, see [[smithee]]', 1 ); - $this->insertPage( 'Smithee', 'A smithee is one who smiths. See also [[Alan Smithee]]', 0 ); - $this->insertPage( 'Talk:Smithee', 'This article sucks.', 1 ); - $this->insertPage( 'Unrelated_page', 'Nothing in this page is about the S word.', 0 ); - $this->insertPage( 'Another_page', 'This page also is unrelated.', 0 ); - $this->insertPage( 'Help:Help', 'Help me!', 4 ); - $this->insertPage( 'Thppt', 'Blah blah', 0 ); - $this->insertPage( 'Alan_Smithee', 'yum', 0 ); - $this->insertPage( 'Pages', 'are\'food', 0 ); - $this->insertPage( 'HalfOneUp', 'AZ', 0 ); - $this->insertPage( 'FullOneUp', 'AZ', 0 ); - $this->insertPage( 'HalfTwoLow', 'az', 0 ); - $this->insertPage( 'FullTwoLow', 'az', 0 ); - $this->insertPage( 'HalfNumbers', '1234567890', 0 ); - $this->insertPage( 'FullNumbers', '1234567890', 0 ); - $this->insertPage( 'DomainName', 'example.com', 0 ); - } - - function fetchIds( $results ) { - if ( !$this->isWikitextNS( NS_MAIN ) ) { - $this->markTestIncomplete( __CLASS__ . " does no yet support non-wikitext content " - . "in the main namespace" ); - } - - $this->assertTrue( is_object( $results ) ); - - $matches = array(); - $row = $results->next(); - while ( $row ) { - $matches[] = $row->getTitle()->getPrefixedText(); - $row = $results->next(); - } - $results->free(); - # Search is not guaranteed to return results in a certain order; - # sort them numerically so we will compare simply that we received - # the expected matches. - sort( $matches ); - - return $matches; - } - - /** - * Insert a new page - * - * @param $pageName String: page name - * @param $text String: page's content - * @param $n Integer: unused - */ - function insertPage( $pageName, $text, $ns ) { - $title = Title::newFromText( $pageName, $ns ); - - $user = User::newFromName( 'WikiSysop' ); - $comment = 'Search Test'; - - // avoid memory leak...? - LinkCache::singleton()->clear(); - - $page = WikiPage::factory( $title ); - $page->doEditContent( ContentHandler::makeContent( $text, $title ), $comment, 0, false, $user ); - - $this->pageList[] = array( $title, $page->getId() ); - - return true; - } - - public function testFullWidth() { - $this->assertEquals( - array( 'FullOneUp', 'FullTwoLow', 'HalfOneUp', 'HalfTwoLow' ), - $this->fetchIds( $this->search->searchText( 'AZ' ) ), - "Search for normalized from Half-width Upper" ); - $this->assertEquals( - array( 'FullOneUp', 'FullTwoLow', 'HalfOneUp', 'HalfTwoLow' ), - $this->fetchIds( $this->search->searchText( 'az' ) ), - "Search for normalized from Half-width Lower" ); - $this->assertEquals( - array( 'FullOneUp', 'FullTwoLow', 'HalfOneUp', 'HalfTwoLow' ), - $this->fetchIds( $this->search->searchText( 'AZ' ) ), - "Search for normalized from Full-width Upper" ); - $this->assertEquals( - array( 'FullOneUp', 'FullTwoLow', 'HalfOneUp', 'HalfTwoLow' ), - $this->fetchIds( $this->search->searchText( 'az' ) ), - "Search for normalized from Full-width Lower" ); - } - - public function testTextSearch() { - $this->assertEquals( - array( 'Smithee' ), - $this->fetchIds( $this->search->searchText( 'smithee' ) ), - "Plain search failed" ); - } - - public function testTextPowerSearch() { - $this->search->setNamespaces( array( 0, 1, 4 ) ); - $this->assertEquals( - array( - 'Smithee', - 'Talk:Not Main Page', - ), - $this->fetchIds( $this->search->searchText( 'smithee' ) ), - "Power search failed" ); - } - - public function testTitleSearch() { - $this->assertEquals( - array( - 'Alan Smithee', - 'Smithee', - ), - $this->fetchIds( $this->search->searchTitle( 'smithee' ) ), - "Title search failed" ); - } - - public function testTextTitlePowerSearch() { - $this->search->setNamespaces( array( 0, 1, 4 ) ); - $this->assertEquals( - array( - 'Alan Smithee', - 'Smithee', - 'Talk:Smithee', - ), - $this->fetchIds( $this->search->searchTitle( 'smithee' ) ), - "Title power search failed" ); - } -} diff --git a/tests/phpunit/includes/search/SearchUpdateTest.php b/tests/phpunit/includes/search/SearchUpdateTest.php deleted file mode 100644 index 2f4fd501..00000000 --- a/tests/phpunit/includes/search/SearchUpdateTest.php +++ /dev/null @@ -1,74 +0,0 @@ -setMwGlobals( 'wgSearchType', 'MockSearch' ); - } - - function updateText( $text ) { - return trim( SearchUpdate::updateText( $text ) ); - } - - public function testUpdateText() { - $this->assertEquals( - 'test', - $this->updateText( '

        TeSt
        ' ), - 'HTML stripped, text lowercased' - ); - - $this->assertEquals( - 'foo bar boz quux', - $this->updateText( << -
        foo
        bar - bozquux - -EOT - ), 'Stripping HTML tables' ); - - $this->assertEquals( - 'a b', - $this->updateText( 'a > b' ), - 'Handle unclosed tags' - ); - - $text = str_pad( "foo assertNotEquals( - '', - $this->updateText( $text ), - 'Bug 18609' - ); - } - - public function testBug32712() { - $text = "text „http://example.com“ text"; - $result = $this->updateText( $text ); - $processed = preg_replace( '/Q/u', 'Q', $result ); - $this->assertTrue( - $processed != '', - 'Link surrounded by unicode quotes should not fail UTF-8 validation' - ); - } -} diff --git a/tests/phpunit/includes/site/MediaWikiSiteTest.php b/tests/phpunit/includes/site/MediaWikiSiteTest.php deleted file mode 100644 index c5d52d33..00000000 --- a/tests/phpunit/includes/site/MediaWikiSiteTest.php +++ /dev/null @@ -1,90 +0,0 @@ - - */ -class MediaWikiSiteTest extends SiteTest { - - public function testNormalizePageTitle() { - $site = new MediaWikiSite(); - $site->setGlobalId( 'enwiki' ); - - //NOTE: this does not actually call out to the enwiki site to perform the normalization, - // but uses a local Title object to do so. This is hardcoded on SiteLink::normalizePageTitle - // for the case that MW_PHPUNIT_TEST is set. - $this->assertEquals( 'Foo', $site->normalizePageName( ' foo ' ) ); - } - - public function fileUrlProvider() { - return array( - // url, filepath, path arg, expected - array( 'https://en.wikipedia.org', '/w/$1', 'api.php', 'https://en.wikipedia.org/w/api.php' ), - array( 'https://en.wikipedia.org', '/w/', 'api.php', 'https://en.wikipedia.org/w/' ), - array( 'https://en.wikipedia.org', '/foo/page.php?name=$1', 'api.php', 'https://en.wikipedia.org/foo/page.php?name=api.php' ), - array( 'https://en.wikipedia.org', '/w/$1', '', 'https://en.wikipedia.org/w/' ), - array( 'https://en.wikipedia.org', '/w/$1', 'foo/bar/api.php', 'https://en.wikipedia.org/w/foo/bar/api.php' ), - ); - } - - /** - * @dataProvider fileUrlProvider - * @covers MediaWikiSite::getFileUrl - */ - public function testGetFileUrl( $url, $filePath, $pathArgument, $expected ) { - $site = new MediaWikiSite(); - $site->setFilePath( $url . $filePath ); - - $this->assertEquals( $expected, $site->getFileUrl( $pathArgument ) ); - } - - public static function provideGetPageUrl() { - return array( - // path, page, expected substring - array( 'http://acme.test/wiki/$1', 'Berlin', '/wiki/Berlin' ), - array( 'http://acme.test/wiki/', 'Berlin', '/wiki/' ), - array( 'http://acme.test/w/index.php?title=$1', 'Berlin', '/w/index.php?title=Berlin' ), - array( 'http://acme.test/wiki/$1', '', '/wiki/' ), - array( 'http://acme.test/wiki/$1', 'Berlin/sub page', '/wiki/Berlin/sub_page' ), - array( 'http://acme.test/wiki/$1', 'Cork (city) ', '/Cork_(city)' ), - array( 'http://acme.test/wiki/$1', 'M&M', '/wiki/M%26M' ), - ); - } - - /** - * @dataProvider provideGetPageUrl - * @covers MediaWikiSite::getPageUrl - */ - public function testGetPageUrl( $path, $page, $expected ) { - $site = new MediaWikiSite(); - $site->setLinkPath( $path ); - - $this->assertContains( $path, $site->getPageUrl() ); - $this->assertContains( $expected, $site->getPageUrl( $page ) ); - } -} diff --git a/tests/phpunit/includes/site/SiteListTest.php b/tests/phpunit/includes/site/SiteListTest.php deleted file mode 100644 index 8af2fc1b..00000000 --- a/tests/phpunit/includes/site/SiteListTest.php +++ /dev/null @@ -1,197 +0,0 @@ - - */ -class SiteListTest extends MediaWikiTestCase { - - /** - * Returns instances of SiteList implementing objects. - * @return array - */ - public function siteListProvider() { - $sitesArrays = $this->siteArrayProvider(); - - $listInstances = array(); - - foreach ( $sitesArrays as $sitesArray ) { - $listInstances[] = new SiteList( $sitesArray[0] ); - } - - return $this->arrayWrap( $listInstances ); - } - - /** - * Returns arrays with instances of Site implementing objects. - * @return array - */ - public function siteArrayProvider() { - $sites = TestSites::getSites(); - - $siteArrays = array(); - - $siteArrays[] = $sites; - - $siteArrays[] = array( array_shift( $sites ) ); - - $siteArrays[] = array( array_shift( $sites ), array_shift( $sites ) ); - - return $this->arrayWrap( $siteArrays ); - } - - /** - * @dataProvider siteListProvider - * @param SiteList $sites - * @covers SiteList::isEmpty - */ - public function testIsEmpty( SiteList $sites ) { - $this->assertEquals( count( $sites ) === 0, $sites->isEmpty() ); - } - - /** - * @dataProvider siteListProvider - * @param SiteList $sites - * @covers SiteList::getSite - */ - public function testGetSiteByGlobalId( SiteList $sites ) { - if ( $sites->isEmpty() ) { - $this->assertTrue( true ); - } else { - /** - * @var Site $site - */ - foreach ( $sites as $site ) { - $this->assertEquals( $site, $sites->getSite( $site->getGlobalId() ) ); - } - } - } - - /** - * @dataProvider siteListProvider - * @param SiteList $sites - * @covers SiteList::getSiteByInternalId - */ - public function testGetSiteByInternalId( $sites ) { - /** - * @var Site $site - */ - foreach ( $sites as $site ) { - if ( is_integer( $site->getInternalId() ) ) { - $this->assertEquals( $site, $sites->getSiteByInternalId( $site->getInternalId() ) ); - } - } - - $this->assertTrue( true ); - } - - /** - * @dataProvider siteListProvider - * @param SiteList $sites - * @covers SiteList::hasSite - */ - public function testHasGlobalId( $sites ) { - $this->assertFalse( $sites->hasSite( 'non-existing-global-id' ) ); - $this->assertFalse( $sites->hasInternalId( 720101010 ) ); - - if ( !$sites->isEmpty() ) { - /** - * @var Site $site - */ - foreach ( $sites as $site ) { - $this->assertTrue( $sites->hasSite( $site->getGlobalId() ) ); - } - } - } - - /** - * @dataProvider siteListProvider - * @param SiteList $sites - * @covers SiteList::hasInternalId - */ - public function testHasInternallId( $sites ) { - /** - * @var Site $site - */ - foreach ( $sites as $site ) { - if ( is_integer( $site->getInternalId() ) ) { - $this->assertTrue( $site, $sites->hasInternalId( $site->getInternalId() ) ); - } - } - - $this->assertFalse( $sites->hasInternalId( -1 ) ); - } - - /** - * @dataProvider siteListProvider - * @param SiteList $sites - * @covers SiteList::getGlobalIdentifiers - */ - public function testGetGlobalIdentifiers( SiteList $sites ) { - $identifiers = $sites->getGlobalIdentifiers(); - - $this->assertTrue( is_array( $identifiers ) ); - - $expected = array(); - - /** - * @var Site $site - */ - foreach ( $sites as $site ) { - $expected[] = $site->getGlobalId(); - } - - $this->assertArrayEquals( $expected, $identifiers ); - } - - /** - * @dataProvider siteListProvider - * - * @since 1.21 - * - * @param SiteList $list - * @covers SiteList::getSerializationData - * @covers SiteList::unserialize - */ - public function testSerialization( SiteList $list ) { - $serialization = serialize( $list ); - /** - * @var SiteArray $copy - */ - $copy = unserialize( $serialization ); - - $this->assertArrayEquals( $list->getGlobalIdentifiers(), $copy->getGlobalIdentifiers() ); - - /** - * @var Site $site - */ - foreach ( $list as $site ) { - $this->assertTrue( $copy->hasInternalId( $site->getInternalId() ) ); - } - } -} diff --git a/tests/phpunit/includes/site/SiteSQLStoreTest.php b/tests/phpunit/includes/site/SiteSQLStoreTest.php deleted file mode 100644 index 6002c1a1..00000000 --- a/tests/phpunit/includes/site/SiteSQLStoreTest.php +++ /dev/null @@ -1,134 +0,0 @@ - - */ -class SiteSQLStoreTest extends MediaWikiTestCase { - - /** - * @covers SiteSQLStore::getSites - */ - public function testGetSites() { - $expectedSites = TestSites::getSites(); - TestSites::insertIntoDb(); - - $store = SiteSQLStore::newInstance(); - - $sites = $store->getSites(); - - $this->assertInstanceOf( 'SiteList', $sites ); - - /** - * @var Site $site - */ - foreach ( $sites as $site ) { - $this->assertInstanceOf( 'Site', $site ); - } - - foreach ( $expectedSites as $site ) { - if ( $site->getGlobalId() !== null ) { - $this->assertTrue( $sites->hasSite( $site->getGlobalId() ) ); - } - } - } - - /** - * @covers SiteSQLStore::saveSites - */ - public function testSaveSites() { - $store = SiteSQLStore::newInstance(); - - $sites = array(); - - $site = new Site(); - $site->setGlobalId( 'ertrywuutr' ); - $site->setLanguageCode( 'en' ); - $sites[] = $site; - - $site = new MediaWikiSite(); - $site->setGlobalId( 'sdfhxujgkfpth' ); - $site->setLanguageCode( 'nl' ); - $sites[] = $site; - - $this->assertTrue( $store->saveSites( $sites ) ); - - $site = $store->getSite( 'ertrywuutr' ); - $this->assertInstanceOf( 'Site', $site ); - $this->assertEquals( 'en', $site->getLanguageCode() ); - $this->assertTrue( is_integer( $site->getInternalId() ) ); - $this->assertTrue( $site->getInternalId() >= 0 ); - - $site = $store->getSite( 'sdfhxujgkfpth' ); - $this->assertInstanceOf( 'Site', $site ); - $this->assertEquals( 'nl', $site->getLanguageCode() ); - $this->assertTrue( is_integer( $site->getInternalId() ) ); - $this->assertTrue( $site->getInternalId() >= 0 ); - } - - /** - * @covers SiteSQLStore::reset - */ - public function testReset() { - $store1 = SiteSQLStore::newInstance(); - $store2 = SiteSQLStore::newInstance(); - - // initialize internal cache - $this->assertGreaterThan( 0, $store1->getSites()->count() ); - $this->assertGreaterThan( 0, $store2->getSites()->count() ); - - // Clear actual data. Will purge the external cache and reset the internal - // cache in $store1, but not the internal cache in store2. - $this->assertTrue( $store1->clear() ); - - // sanity check: $store2 should have a stale cache now - $this->assertNotNull( $store2->getSite( 'enwiki' ) ); - - // purge cache - $store2->reset(); - - // ...now the internal cache of $store2 should be updated and thus empty. - $site = $store2->getSite( 'enwiki' ); - $this->assertNull( $site ); - } - - /** - * @covers SiteSQLStore::clear - */ - public function testClear() { - $store = SiteSQLStore::newInstance(); - $this->assertTrue( $store->clear() ); - - $site = $store->getSite( 'enwiki' ); - $this->assertNull( $site ); - - $sites = $store->getSites(); - $this->assertEquals( 0, $sites->count() ); - } -} diff --git a/tests/phpunit/includes/site/SiteTest.php b/tests/phpunit/includes/site/SiteTest.php deleted file mode 100644 index 29c1ff33..00000000 --- a/tests/phpunit/includes/site/SiteTest.php +++ /dev/null @@ -1,296 +0,0 @@ - - */ -class SiteTest extends MediaWikiTestCase { - - public function instanceProvider() { - return $this->arrayWrap( TestSites::getSites() ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::getInterwikiIds - */ - public function testGetInterwikiIds( Site $site ) { - $this->assertInternalType( 'array', $site->getInterwikiIds() ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::getNavigationIds - */ - public function testGetNavigationIds( Site $site ) { - $this->assertInternalType( 'array', $site->getNavigationIds() ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::addNavigationId - */ - public function testAddNavigationId( Site $site ) { - $site->addNavigationId( 'foobar' ); - $this->assertTrue( in_array( 'foobar', $site->getNavigationIds(), true ) ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::addInterwikiId - */ - public function testAddInterwikiId( Site $site ) { - $site->addInterwikiId( 'foobar' ); - $this->assertTrue( in_array( 'foobar', $site->getInterwikiIds(), true ) ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::getLanguageCode - */ - public function testGetLanguageCode( Site $site ) { - $this->assertTypeOrValue( 'string', $site->getLanguageCode(), null ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::setLanguageCode - */ - public function testSetLanguageCode( Site $site ) { - $site->setLanguageCode( 'en' ); - $this->assertEquals( 'en', $site->getLanguageCode() ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::normalizePageName - */ - public function testNormalizePageName( Site $site ) { - $this->assertInternalType( 'string', $site->normalizePageName( 'Foobar' ) ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::getGlobalId - */ - public function testGetGlobalId( Site $site ) { - $this->assertTypeOrValue( 'string', $site->getGlobalId(), null ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::setGlobalId - */ - public function testSetGlobalId( Site $site ) { - $site->setGlobalId( 'foobar' ); - $this->assertEquals( 'foobar', $site->getGlobalId() ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::getType - */ - public function testGetType( Site $site ) { - $this->assertInternalType( 'string', $site->getType() ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::getPath - */ - public function testGetPath( Site $site ) { - $this->assertTypeOrValue( 'string', $site->getPath( 'page_path' ), null ); - $this->assertTypeOrValue( 'string', $site->getPath( 'file_path' ), null ); - $this->assertTypeOrValue( 'string', $site->getPath( 'foobar' ), null ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::getAllPaths - */ - public function testGetAllPaths( Site $site ) { - $this->assertInternalType( 'array', $site->getAllPaths() ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::setPath - * @covers Site::removePath - */ - public function testSetAndRemovePath( Site $site ) { - $count = count( $site->getAllPaths() ); - - $site->setPath( 'spam', 'http://www.wikidata.org/$1' ); - $site->setPath( 'spam', 'http://www.wikidata.org/foo/$1' ); - $site->setPath( 'foobar', 'http://www.wikidata.org/bar/$1' ); - - $this->assertEquals( $count + 2, count( $site->getAllPaths() ) ); - - $this->assertInternalType( 'string', $site->getPath( 'foobar' ) ); - $this->assertEquals( 'http://www.wikidata.org/foo/$1', $site->getPath( 'spam' ) ); - - $site->removePath( 'spam' ); - $site->removePath( 'foobar' ); - - $this->assertEquals( $count, count( $site->getAllPaths() ) ); - - $this->assertNull( $site->getPath( 'foobar' ) ); - $this->assertNull( $site->getPath( 'spam' ) ); - } - - /** - * @covers Site::setLinkPath - */ - public function testSetLinkPath() { - $site = new Site(); - $path = "TestPath/$1"; - - $site->setLinkPath( $path ); - $this->assertEquals( $path, $site->getLinkPath() ); - } - - /** - * @covers Site::getLinkPathType - */ - public function testGetLinkPathType() { - $site = new Site(); - - $path = 'TestPath/$1'; - $site->setLinkPath( $path ); - $this->assertEquals( $path, $site->getPath( $site->getLinkPathType() ) ); - - $path = 'AnotherPath/$1'; - $site->setPath( $site->getLinkPathType(), $path ); - $this->assertEquals( $path, $site->getLinkPath() ); - } - - /** - * @covers Site::setPath - */ - public function testSetPath() { - $site = new Site(); - - $path = 'TestPath/$1'; - $site->setPath( 'foo', $path ); - - $this->assertEquals( $path, $site->getPath( 'foo' ) ); - } - - /** - * @covers Site::setPath - * @covers Site::getProtocol - */ - public function testProtocolRelativePath() { - $site = new Site(); - - $type = $site->getLinkPathType(); - $path = '//acme.com/'; // protocol-relative URL - $site->setPath( $type, $path ); - - $this->assertEquals( '', $site->getProtocol() ); - } - - public static function provideGetPageUrl() { - //NOTE: the assumption that the URL is built by replacing $1 - // with the urlencoded version of $page - // is true for Site but not guaranteed for subclasses. - // Subclasses need to override this provider appropriately. - - return array( - array( #0 - 'http://acme.test/TestPath/$1', - 'Foo', - '/TestPath/Foo', - ), - array( #1 - 'http://acme.test/TestScript?x=$1&y=bla', - 'Foo', - 'TestScript?x=Foo&y=bla', - ), - array( #2 - 'http://acme.test/TestPath/$1', - 'foo & bar/xyzzy (quux-shmoox?)', - '/TestPath/foo%20%26%20bar%2Fxyzzy%20%28quux-shmoox%3F%29', - ), - ); - } - - /** - * @dataProvider provideGetPageUrl - * @covers Site::getPageUrl - */ - public function testGetPageUrl( $path, $page, $expected ) { - $site = new Site(); - - //NOTE: the assumption that getPageUrl is based on getLinkPath - // is true for Site but not guaranteed for subclasses. - // Subclasses need to override this test case appropriately. - $site->setLinkPath( $path ); - $this->assertContains( $path, $site->getPageUrl() ); - - $this->assertContains( $expected, $site->getPageUrl( $page ) ); - } - - protected function assertTypeOrFalse( $type, $value ) { - if ( $value === false ) { - $this->assertTrue( true ); - } else { - $this->assertInternalType( $type, $value ); - } - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::serialize - * @covers Site::unserialize - */ - public function testSerialization( Site $site ) { - $this->assertInstanceOf( 'Serializable', $site ); - - $serialization = serialize( $site ); - $newInstance = unserialize( $serialization ); - - $this->assertInstanceOf( 'Site', $newInstance ); - - $this->assertEquals( $serialization, serialize( $newInstance ) ); - } -} diff --git a/tests/phpunit/includes/site/TestSites.php b/tests/phpunit/includes/site/TestSites.php deleted file mode 100644 index f224b7d7..00000000 --- a/tests/phpunit/includes/site/TestSites.php +++ /dev/null @@ -1,100 +0,0 @@ - - */ -class TestSites { - - /** - * @since 1.21 - * - * @return array - */ - public static function getSites() { - $sites = array(); - - $site = new Site(); - $site->setGlobalId( 'foobar' ); - $sites[] = $site; - - $site = new MediaWikiSite(); - $site->setGlobalId( 'enwiktionary' ); - $site->setGroup( 'wiktionary' ); - $site->setLanguageCode( 'en' ); - $site->addNavigationId( 'enwiktionary' ); - $site->setPath( MediaWikiSite::PATH_PAGE, "https://en.wiktionary.org/wiki/$1" ); - $site->setPath( MediaWikiSite::PATH_FILE, "https://en.wiktionary.org/w/$1" ); - $sites[] = $site; - - $site = new MediaWikiSite(); - $site->setGlobalId( 'dewiktionary' ); - $site->setGroup( 'wiktionary' ); - $site->setLanguageCode( 'de' ); - $site->addInterwikiId( 'dewiktionary' ); - $site->addInterwikiId( 'wiktionaryde' ); - $site->setPath( MediaWikiSite::PATH_PAGE, "https://de.wiktionary.org/wiki/$1" ); - $site->setPath( MediaWikiSite::PATH_FILE, "https://de.wiktionary.org/w/$1" ); - $sites[] = $site; - - $site = new Site(); - $site->setGlobalId( 'spam' ); - $site->setGroup( 'spam' ); - $site->setLanguageCode( 'en' ); - $site->addNavigationId( 'spam' ); - $site->addNavigationId( 'spamz' ); - $site->addInterwikiId( 'spamzz' ); - $site->setLinkPath( "http://spamzz.test/testing/" ); - $sites[] = $site; - - foreach ( array( 'en', 'de', 'nl', 'sv', 'sr', 'no', 'nn' ) as $langCode ) { - $site = new MediaWikiSite(); - $site->setGlobalId( $langCode . 'wiki' ); - $site->setGroup( 'wikipedia' ); - $site->setLanguageCode( $langCode ); - $site->addInterwikiId( $langCode ); - $site->addNavigationId( $langCode ); - $site->setPath( MediaWikiSite::PATH_PAGE, "https://$langCode.wikipedia.org/wiki/$1" ); - $site->setPath( MediaWikiSite::PATH_FILE, "https://$langCode.wikipedia.org/w/$1" ); - $sites[] = $site; - } - - return $sites; - } - - /** - * Inserts sites into the database for the unit tests that need them. - * - * @since 0.1 - */ - public static function insertIntoDb() { - $sitesTable = SiteSQLStore::newInstance(); - $sitesTable->clear(); - $sitesTable->saveSites( TestSites::getSites() ); - } -} diff --git a/tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php b/tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php deleted file mode 100644 index a806b4ac..00000000 --- a/tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php +++ /dev/null @@ -1,79 +0,0 @@ -manualTest ) ) { - $this->queryPages[$class] = new $class; - } - } - } - - /** - * Test SQL for each of our QueryPages objects - * @group Database - */ - public function testQuerypageSqlQuery() { - global $wgDBtype; - - foreach ( $this->queryPages as $page ) { - - // With MySQL, skips special pages reopening a temporary table - // See http://bugs.mysql.com/bug.php?id=10327 - if ( - $wgDBtype === 'mysql' - && in_array( $page->getName(), $this->reopensTempTable ) - ) { - $this->markTestSkipped( "SQL query for page {$page->getName()} can not be tested on MySQL backend (it reopens a temporary table)" ); - continue; - } - - $msg = "SQL query for page {$page->getName()} should give a result wrapper object"; - - $result = $page->reallyDoQuery( 50 ); - if ( $result instanceof ResultWrapper ) { - $this->assertTrue( true, $msg ); - } else { - $this->assertFalse( false, $msg ); - } - } - } -} diff --git a/tests/phpunit/includes/specials/SpecialPreferencesTest.php b/tests/phpunit/includes/specials/SpecialPreferencesTest.php deleted file mode 100644 index 6c637c65..00000000 --- a/tests/phpunit/includes/specials/SpecialPreferencesTest.php +++ /dev/null @@ -1,60 +0,0 @@ -setMwGlobals( 'wgMaxSigChars', 2 ); - - $user = $this->getMock( 'User' ); - $user->expects( $this->any() ) - ->method( 'isAnon' ) - ->will( $this->returnValue( false ) ); - - # Yeah foreach requires an array, not NULL =( - $user->expects( $this->any() ) - ->method( 'getEffectiveGroups' ) - ->will( $this->returnValue( array() ) ); - - # The mocked user has a long nickname - $user->expects( $this->any() ) - ->method( 'getOption' ) - ->will( $this->returnValueMap( array( - array( 'nickname', null, false, 'superlongnickname' ), - ) - ) ); - - # Validate the mock (FIXME should probably be removed) - $this->assertFalse( $user->isAnon() ); - $this->assertEquals( array(), - $user->getEffectiveGroups() ); - $this->assertEquals( 'superlongnickname', - $user->getOption( 'nickname' ) ); - - # Forge a request to call the special page - $context = new RequestContext(); - $context->setRequest( new FauxRequest() ); - $context->setUser( $user ); - $context->setTitle( Title::newFromText( 'Test' ) ); - - # Do the call, should not spurt a fatal error. - $special = new SpecialPreferences(); - $special->setContext( $context ); - $special->execute( array() ); - } - -} diff --git a/tests/phpunit/includes/specials/SpecialRecentchangesTest.php b/tests/phpunit/includes/specials/SpecialRecentchangesTest.php deleted file mode 100644 index 436eb2e2..00000000 --- a/tests/phpunit/includes/specials/SpecialRecentchangesTest.php +++ /dev/null @@ -1,125 +0,0 @@ -setRequest( new FauxRequest( $requestOptions ) ); - - # setup the rc object - $this->rc = new SpecialRecentChanges(); - $this->rc->setContext( $context ); - $formOptions = $this->rc->setup( null ); - - # Filter out rc_timestamp conditions which depends on the test runtime - # This condition is not needed as of march 2, 2011 -- hashar - # @todo FIXME: Find a way to generate the correct rc_timestamp - $queryConditions = array_filter( - $this->rc->buildMainQueryConds( $formOptions ), - 'SpecialRecentchangesTest::filterOutRcTimestampCondition' - ); - - $this->assertEquals( - $expected, - $queryConditions, - $message - ); - } - - /** return false if condition begin with 'rc_timestamp ' */ - private static function filterOutRcTimestampCondition( $var ) { - return ( false === strpos( $var, 'rc_timestamp ' ) ); - } - - public function testRcNsFilter() { - $this->assertConditions( - array( # expected - 'rc_bot' => 0, - #0 => "rc_timestamp >= '20110223000000'", - 1 => "rc_namespace = '0'", - ), - array( - 'namespace' => NS_MAIN, - ), - "rc conditions with no options (aka default setting)" - ); - } - - public function testRcNsFilterInversion() { - $this->assertConditions( - array( # expected - #0 => "rc_timestamp >= '20110223000000'", - 'rc_bot' => 0, - 1 => sprintf( "rc_namespace != '%s'", NS_MAIN ), - ), - array( - 'namespace' => NS_MAIN, - 'invert' => 1, - ), - "rc conditions with namespace inverted" - ); - } - - /** - * @bug 2429 - * @dataProvider provideNamespacesAssociations - */ - public function testRcNsFilterAssociation( $ns1, $ns2 ) { - $this->assertConditions( - array( # expected - #0 => "rc_timestamp >= '20110223000000'", - 'rc_bot' => 0, - 1 => sprintf( "(rc_namespace = '%s' OR rc_namespace = '%s')", $ns1, $ns2 ), - ), - array( - 'namespace' => $ns1, - 'associated' => 1, - ), - "rc conditions with namespace inverted" - ); - } - - /** - * @bug 2429 - * @dataProvider provideNamespacesAssociations - */ - public function testRcNsFilterAssociationWithInversion( $ns1, $ns2 ) { - $this->assertConditions( - array( # expected - #0 => "rc_timestamp >= '20110223000000'", - 'rc_bot' => 0, - 1 => sprintf( "(rc_namespace != '%s' AND rc_namespace != '%s')", $ns1, $ns2 ), - ), - array( - 'namespace' => $ns1, - 'associated' => 1, - 'invert' => 1, - ), - "rc conditions with namespace inverted" - ); - } - - /** - * Provides associated namespaces to test recent changes - * namespaces association filtering. - */ - public static function provideNamespacesAssociations() { - return array( # (NS => Associated_NS) - array( NS_MAIN, NS_TALK ), - array( NS_TALK, NS_MAIN ), - ); - } -} diff --git a/tests/phpunit/includes/specials/SpecialSearchTest.php b/tests/phpunit/includes/specials/SpecialSearchTest.php deleted file mode 100644 index 17e883fd..00000000 --- a/tests/phpunit/includes/specials/SpecialSearchTest.php +++ /dev/null @@ -1,139 +0,0 @@ - true, 'ns6' => true). NULL to use default options. - * @param $userOptions Array User options to test with. For example array('searchNs5' => 1 );. NULL to use default options. - * @param $expectedProfile An expected search profile name - * @param $expectedNs Array Expected namespaces - */ - public function testProfileAndNamespaceLoading( - $requested, $userOptions, $expectedProfile, $expectedNS, - $message = 'Profile name and namespaces mismatches!' - ) { - $context = new RequestContext; - $context->setUser( - $this->newUserWithSearchNS( $userOptions ) - ); - /* - $context->setRequest( new FauxRequest( array( - 'ns5'=>true, - 'ns6'=>true, - ) )); - */ - $context->setRequest( new FauxRequest( $requested ) ); - $search = new SpecialSearch(); - $search->setContext( $context ); - $search->load(); - - /** - * Verify profile name and namespace in the same assertion to make - * sure we will be able to fully compare the above code. PHPUnit stop - * after an assertion fail. - */ - $this->assertEquals( - array( /** Expected: */ - 'ProfileName' => $expectedProfile, - 'Namespaces' => $expectedNS, - ) - , array( /** Actual: */ - 'ProfileName' => $search->getProfile(), - 'Namespaces' => $search->getNamespaces(), - ) - , $message - ); - } - - public static function provideSearchOptionsTests() { - $defaultNS = SearchEngine::defaultNamespaces(); - $EMPTY_REQUEST = array(); - $NO_USER_PREF = null; - - return array( - /** - * Parameters: - * , - * Followed by expected values: - * , - * Then an optional message. - */ - array( - $EMPTY_REQUEST, $NO_USER_PREF, - 'default', $defaultNS, - 'Bug 33270: No request nor user preferences should give default profile' - ), - array( - array( 'ns5' => 1 ), $NO_USER_PREF, - 'advanced', array( 5 ), - 'Web request with specific NS should override user preference' - ), - array( - $EMPTY_REQUEST, array( - 'searchNs2' => 1, - 'searchNs14' => 1, - ) + array_fill_keys( array_map( function ( $ns ) { - return "searchNs$ns"; - }, $defaultNS ), 0 ), - 'advanced', array( 2, 14 ), - 'Bug 33583: search with no option should honor User search preferences' - . ' and have all other namespace disabled' - ), - ); - } - - /** - * Helper to create a new User object with given options - * User remains anonymous though - */ - function newUserWithSearchNS( $opt = null ) { - $u = User::newFromId( 0 ); - if ( $opt === null ) { - return $u; - } - foreach ( $opt as $name => $value ) { - $u->setOption( $name, $value ); - } - - return $u; - } - - /** - * Verify we do not expand search term in on search result page - * https://gerrit.wikimedia.org/r/4841 - */ - public function testSearchTermIsNotExpanded() { - - # Initialize [[Special::Search]] - $search = new SpecialSearch(); - $search->getContext()->setTitle( Title::newFromText( 'Special:Search' ) ); - $search->load(); - - # Simulate a user searching for a given term - $term = '{{SITENAME}}'; - $search->showResults( $term ); - - # Lookup the HTML page title set for that page - $pageTitle = $search - ->getContext() - ->getOutput() - ->getHTMLTitle(); - - # Compare :-] - $this->assertRegExp( - '/' . preg_quote( $term ) . '/', - $pageTitle, - "Search term '{$term}' should not be expanded in Special:Search <title>" - ); - } -} diff --git a/tests/phpunit/includes/upload/UploadBaseTest.php b/tests/phpunit/includes/upload/UploadBaseTest.php deleted file mode 100644 index 982b46b2..00000000 --- a/tests/phpunit/includes/upload/UploadBaseTest.php +++ /dev/null @@ -1,147 +0,0 @@ -<?php - -/** - * @group Upload - */ -class UploadBaseTest extends MediaWikiTestCase { - - /** @var UploadTestHandler */ - protected $upload; - - protected function setUp() { - global $wgHooks; - parent::setUp(); - - $this->upload = new UploadTestHandler; - $this->hooks = $wgHooks; - $wgHooks['InterwikiLoadPrefix'][] = function ( $prefix, &$data ) { - return false; - }; - } - - protected function tearDown() { - global $wgHooks; - $wgHooks = $this->hooks; - - parent::tearDown(); - } - - - /** - * First checks the return code - * of UploadBase::getTitle() and then the actual returned title - * - * @dataProvider provideTestTitleValidation - * @covers UploadBase::getTitle - */ - public function testTitleValidation( $srcFilename, $dstFilename, $code, $msg ) { - /* Check the result code */ - $this->assertEquals( $code, - $this->upload->testTitleValidation( $srcFilename ), - "$msg code" ); - - /* If we expect a valid title, check the title itself. */ - if ( $code == UploadBase::OK ) { - $this->assertEquals( $dstFilename, - $this->upload->getTitle()->getText(), - "$msg text" ); - } - } - - /** - * Test various forms of valid and invalid titles that can be supplied. - */ - public static function provideTestTitleValidation() { - return array( - /* Test a valid title */ - array( 'ValidTitle.jpg', 'ValidTitle.jpg', UploadBase::OK, - 'upload valid title' ), - /* A title with a slash */ - array( 'A/B.jpg', 'B.jpg', UploadBase::OK, - 'upload title with slash' ), - /* A title with illegal char */ - array( 'A:B.jpg', 'A-B.jpg', UploadBase::OK, - 'upload title with colon' ), - /* Stripping leading File: prefix */ - array( 'File:C.jpg', 'C.jpg', UploadBase::OK, - 'upload title with File prefix' ), - /* Test illegal suggested title (r94601) */ - array( '%281%29.JPG', null, UploadBase::ILLEGAL_FILENAME, - 'illegal title for upload' ), - /* A title without extension */ - array( 'A', null, UploadBase::FILETYPE_MISSING, - 'upload title without extension' ), - /* A title with no basename */ - array( '.jpg', null, UploadBase::MIN_LENGTH_PARTNAME, - 'upload title without basename' ), - /* A title that is longer than 255 bytes */ - array( str_repeat( 'a', 255 ) . '.jpg', null, UploadBase::FILENAME_TOO_LONG, - 'upload title longer than 255 bytes' ), - /* A title that is longer than 240 bytes */ - array( str_repeat( 'a', 240 ) . '.jpg', null, UploadBase::FILENAME_TOO_LONG, - 'upload title longer than 240 bytes' ), - ); - } - - /** - * Test the upload verification functions - * @covers UploadBase::verifyUpload - */ - public function testVerifyUpload() { - /* Setup with zero file size */ - $this->upload->initializePathInfo( '', '', 0 ); - $result = $this->upload->verifyUpload(); - $this->assertEquals( UploadBase::EMPTY_FILE, - $result['status'], - 'upload empty file' ); - } - - // Helper used to create an empty file of size $size. - private function createFileOfSize( $size ) { - $filename = tempnam( wfTempDir(), "mwuploadtest" ); - - $fh = fopen( $filename, 'w' ); - ftruncate( $fh, $size ); - fclose( $fh ); - - return $filename; - } - - /** - * test uploading a 100 bytes file with $wgMaxUploadSize = 100 - * - * This method should be abstracted so we can test different settings. - */ - public function testMaxUploadSize() { - global $wgMaxUploadSize; - $savedGlobal = $wgMaxUploadSize; // save global - global $wgFileExtensions; - $wgFileExtensions[] = 'txt'; - - $wgMaxUploadSize = 100; - - $filename = $this->createFileOfSize( $wgMaxUploadSize ); - $this->upload->initializePathInfo( basename( $filename ) . '.txt', $filename, 100 ); - $result = $this->upload->verifyUpload(); - unlink( $filename ); - - $this->assertEquals( - array( 'status' => UploadBase::OK ), $result ); - - $wgMaxUploadSize = $savedGlobal; // restore global - } -} - -class UploadTestHandler extends UploadBase { - public function initializeFromRequest( &$request ) { - } - - public function testTitleValidation( $name ) { - $this->mTitle = false; - $this->mDesiredDestName = $name; - $this->mTitleError = UploadBase::OK; - $this->getTitle(); - - return $this->mTitleError; - } -} diff --git a/tests/phpunit/includes/upload/UploadFromUrlTest.php b/tests/phpunit/includes/upload/UploadFromUrlTest.php deleted file mode 100644 index a75fba69..00000000 --- a/tests/phpunit/includes/upload/UploadFromUrlTest.php +++ /dev/null @@ -1,350 +0,0 @@ -<?php - -/** - * @group Broken - * @group Upload - * @group Database - */ -class UploadFromUrlTest extends ApiTestCase { - protected function setUp() { - parent::setUp(); - - $this->setMwGlobals( array( - 'wgEnableUploads' => true, - 'wgAllowCopyUploads' => true, - 'wgAllowAsyncCopyUploads' => true, - ) ); - wfSetupSession(); - - if ( wfLocalFile( 'UploadFromUrlTest.png' )->exists() ) { - $this->deleteFile( 'UploadFromUrlTest.png' ); - } - } - - protected function doApiRequest( array $params, array $unused = null, $appendModule = false, User $user = null ) { - $sessionId = session_id(); - session_write_close(); - - $req = new FauxRequest( $params, true, $_SESSION ); - $module = new ApiMain( $req, true ); - $module->execute(); - - wfSetupSession( $sessionId ); - - return array( $module->getResultData(), $req ); - } - - /** - * Ensure that the job queue is empty before continuing - */ - public function testClearQueue() { - $job = JobQueueGroup::singleton()->pop(); - while ( $job ) { - $job = JobQueueGroup::singleton()->pop(); - } - $this->assertFalse( $job ); - } - - /** - * @todo Document why we test login, since the $wgUser hack used doesn't - * require login - */ - public function testLogin() { - $data = $this->doApiRequest( array( - 'action' => 'login', - 'lgname' => $this->user->userName, - 'lgpassword' => $this->user->passWord ) ); - $this->assertArrayHasKey( "login", $data[0] ); - $this->assertArrayHasKey( "result", $data[0]['login'] ); - $this->assertEquals( "NeedToken", $data[0]['login']['result'] ); - $token = $data[0]['login']['token']; - - $data = $this->doApiRequest( array( - 'action' => 'login', - "lgtoken" => $token, - 'lgname' => $this->user->userName, - 'lgpassword' => $this->user->passWord ) ); - - $this->assertArrayHasKey( "login", $data[0] ); - $this->assertArrayHasKey( "result", $data[0]['login'] ); - $this->assertEquals( "Success", $data[0]['login']['result'] ); - $this->assertArrayHasKey( 'lgtoken', $data[0]['login'] ); - - return $data; - } - - /** - * @depends testLogin - * @depends testClearQueue - */ - public function testSetupUrlDownload( $data ) { - $token = $this->user->getEditToken(); - $exception = false; - - try { - $this->doApiRequest( array( - 'action' => 'upload', - ) ); - } catch ( UsageException $e ) { - $exception = true; - $this->assertEquals( "The token parameter must be set", $e->getMessage() ); - } - $this->assertTrue( $exception, "Got exception" ); - - $exception = false; - try { - $this->doApiRequest( array( - 'action' => 'upload', - 'token' => $token, - ), $data ); - } catch ( UsageException $e ) { - $exception = true; - $this->assertEquals( "One of the parameters sessionkey, file, url, statuskey is required", - $e->getMessage() ); - } - $this->assertTrue( $exception, "Got exception" ); - - $exception = false; - try { - $this->doApiRequest( array( - 'action' => 'upload', - 'url' => 'http://www.example.com/test.png', - 'token' => $token, - ), $data ); - } catch ( UsageException $e ) { - $exception = true; - $this->assertEquals( "The filename parameter must be set", $e->getMessage() ); - } - $this->assertTrue( $exception, "Got exception" ); - - $this->user->removeGroup( 'sysop' ); - $exception = false; - try { - $this->doApiRequest( array( - 'action' => 'upload', - 'url' => 'http://www.example.com/test.png', - 'filename' => 'UploadFromUrlTest.png', - 'token' => $token, - ), $data ); - } catch ( UsageException $e ) { - $exception = true; - $this->assertEquals( "Permission denied", $e->getMessage() ); - } - $this->assertTrue( $exception, "Got exception" ); - - $this->user->addGroup( 'sysop' ); - $data = $this->doApiRequest( array( - 'action' => 'upload', - 'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png', - 'asyncdownload' => 1, - 'filename' => 'UploadFromUrlTest.png', - 'token' => $token, - ), $data ); - - $this->assertEquals( $data[0]['upload']['result'], 'Queued', 'Queued upload' ); - - $job = JobQueueGroup::singleton()->pop(); - $this->assertThat( $job, $this->isInstanceOf( 'UploadFromUrlJob' ), 'Queued upload inserted' ); - } - - /** - * @depends testLogin - * @depends testClearQueue - */ - public function testAsyncUpload( $data ) { - $token = $this->user->getEditToken(); - - $this->user->addGroup( 'users' ); - - $data = $this->doAsyncUpload( $token, true ); - $this->assertEquals( $data[0]['upload']['result'], 'Success' ); - $this->assertEquals( $data[0]['upload']['filename'], 'UploadFromUrlTest.png' ); - $this->assertTrue( wfLocalFile( $data[0]['upload']['filename'] )->exists() ); - - $this->deleteFile( 'UploadFromUrlTest.png' ); - - return $data; - } - - /** - * @depends testLogin - * @depends testClearQueue - */ - public function testAsyncUploadWarning( $data ) { - $token = $this->user->getEditToken(); - - $this->user->addGroup( 'users' ); - - $data = $this->doAsyncUpload( $token ); - - $this->assertEquals( $data[0]['upload']['result'], 'Warning' ); - $this->assertTrue( isset( $data[0]['upload']['sessionkey'] ) ); - - $data = $this->doApiRequest( array( - 'action' => 'upload', - 'sessionkey' => $data[0]['upload']['sessionkey'], - 'filename' => 'UploadFromUrlTest.png', - 'ignorewarnings' => 1, - 'token' => $token, - ) ); - $this->assertEquals( $data[0]['upload']['result'], 'Success' ); - $this->assertEquals( $data[0]['upload']['filename'], 'UploadFromUrlTest.png' ); - $this->assertTrue( wfLocalFile( $data[0]['upload']['filename'] )->exists() ); - - $this->deleteFile( 'UploadFromUrlTest.png' ); - - return $data; - } - - /** - * @depends testLogin - * @depends testClearQueue - */ - public function testSyncDownload( $data ) { - $token = $this->user->getEditToken(); - - $job = JobQueueGroup::singleton()->pop(); - $this->assertFalse( $job, 'Starting with an empty jobqueue' ); - - $this->user->addGroup( 'users' ); - $data = $this->doApiRequest( array( - 'action' => 'upload', - 'filename' => 'UploadFromUrlTest.png', - 'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png', - 'ignorewarnings' => true, - 'token' => $token, - ), $data ); - - $job = JobQueueGroup::singleton()->pop(); - $this->assertFalse( $job ); - - $this->assertEquals( 'Success', $data[0]['upload']['result'] ); - $this->deleteFile( 'UploadFromUrlTest.png' ); - - return $data; - } - - public function testLeaveMessage() { - $token = $this->user->user->getEditToken(); - - $talk = $this->user->user->getTalkPage(); - if ( $talk->exists() ) { - $page = WikiPage::factory( $talk ); - $page->doDeleteArticle( '' ); - } - - $this->assertFalse( (bool)$talk->getArticleID( Title::GAID_FOR_UPDATE ), 'User talk does not exist' ); - - $this->doApiRequest( array( - 'action' => 'upload', - 'filename' => 'UploadFromUrlTest.png', - 'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png', - 'asyncdownload' => 1, - 'token' => $token, - 'leavemessage' => 1, - 'ignorewarnings' => 1, - ) ); - - $job = JobQueueGroup::singleton()->pop(); - $this->assertEquals( 'UploadFromUrlJob', get_class( $job ) ); - $job->run(); - - $this->assertTrue( wfLocalFile( 'UploadFromUrlTest.png' )->exists() ); - $this->assertTrue( (bool)$talk->getArticleID( Title::GAID_FOR_UPDATE ), 'User talk exists' ); - - $this->deleteFile( 'UploadFromUrlTest.png' ); - - $talkRev = Revision::newFromTitle( $talk ); - $talkSize = $talkRev->getSize(); - - $exception = false; - try { - $this->doApiRequest( array( - 'action' => 'upload', - 'filename' => 'UploadFromUrlTest.png', - 'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png', - 'asyncdownload' => 1, - 'token' => $token, - 'leavemessage' => 1, - ) ); - } catch ( UsageException $e ) { - $exception = true; - $this->assertEquals( 'Using leavemessage without ignorewarnings is not supported', $e->getMessage() ); - } - $this->assertTrue( $exception ); - - $job = JobQueueGroup::singleton()->pop(); - $this->assertFalse( $job ); - - return; - /* - // Broken until using leavemessage with ignorewarnings is supported - $job->run(); - - $this->assertFalse( wfLocalFile( 'UploadFromUrlTest.png' )->exists() ); - - $talkRev = Revision::newFromTitle( $talk ); - $this->assertTrue( $talkRev->getSize() > $talkSize, 'New message left' ); - */ - } - - /** - * Helper function to perform an async upload, execute the job and fetch - * the status - * - * @return array The result of action=upload&statuskey=key - */ - private function doAsyncUpload( $token, $ignoreWarnings = false, $leaveMessage = false ) { - $params = array( - 'action' => 'upload', - 'filename' => 'UploadFromUrlTest.png', - 'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png', - 'asyncdownload' => 1, - 'token' => $token, - ); - if ( $ignoreWarnings ) { - $params['ignorewarnings'] = 1; - } - if ( $leaveMessage ) { - $params['leavemessage'] = 1; - } - - $data = $this->doApiRequest( $params ); - $this->assertEquals( $data[0]['upload']['result'], 'Queued' ); - $this->assertTrue( isset( $data[0]['upload']['statuskey'] ) ); - $statusKey = $data[0]['upload']['statuskey']; - - $job = JobQueueGroup::singleton()->pop(); - $this->assertEquals( 'UploadFromUrlJob', get_class( $job ) ); - - $status = $job->run(); - $this->assertTrue( $status ); - - $data = $this->doApiRequest( array( - 'action' => 'upload', - 'statuskey' => $statusKey, - 'token' => $token, - ) ); - - return $data; - } - - /** - * - */ - protected function deleteFile( $name ) { - $t = Title::newFromText( $name, NS_FILE ); - $this->assertTrue( $t->exists(), "File '$name' exists" ); - - if ( $t->exists() ) { - $file = wfFindFile( $name, array( 'ignoreRedirect' => true ) ); - $empty = ""; - FileDeleteForm::doDelete( $t, $file, $empty, "none", true ); - $page = WikiPage::factory( $t ); - $page->doDeleteArticle( "testing" ); - } - $t = Title::newFromText( $name, NS_FILE ); - - $this->assertFalse( $t->exists(), "File '$name' was deleted" ); - } -} diff --git a/tests/phpunit/includes/upload/UploadStashTest.php b/tests/phpunit/includes/upload/UploadStashTest.php deleted file mode 100644 index 7a0fea48..00000000 --- a/tests/phpunit/includes/upload/UploadStashTest.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php -/** - * @group Database - */ -class UploadStashTest extends MediaWikiTestCase { - /** - * @var Array of UploadStashTestUser - */ - public static $users; - - protected function setUp() { - parent::setUp(); - - // Setup a file for bug 29408 - $this->bug29408File = __DIR__ . '/bug29408'; - file_put_contents( $this->bug29408File, "\x00" ); - - self::$users = array( - 'sysop' => new TestUser( - 'Uploadstashtestsysop', - 'Upload Stash Test Sysop', - 'upload_stash_test_sysop@example.com', - array( 'sysop' ) - ), - 'uploader' => new TestUser( - 'Uploadstashtestuser', - 'Upload Stash Test User', - 'upload_stash_test_user@example.com', - array() - ) - ); - } - - protected function tearDown() { - if ( file_exists( $this->bug29408File . "." ) ) { - unlink( $this->bug29408File . "." ); - } - - if ( file_exists( $this->bug29408File ) ) { - unlink( $this->bug29408File ); - } - - parent::tearDown(); - } - - public function testBug29408() { - $this->setMwGlobals( 'wgUser', self::$users['uploader']->user ); - - $repo = RepoGroup::singleton()->getLocalRepo(); - $stash = new UploadStash( $repo ); - - // Throws exception caught by PHPUnit on failure - $file = $stash->stashFile( $this->bug29408File ); - // We'll never reach this point if we hit bug 29408 - $this->assertTrue( true, 'Unrecognized file without extension' ); - - $stash->removeFile( $file->getFileKey() ); - } - - public function testValidRequest() { - $request = new FauxRequest( array( 'wpFileKey' => 'foo' ) ); - $this->assertFalse( UploadFromStash::isValidRequest( $request ), 'Check failure on bad wpFileKey' ); - - $request = new FauxRequest( array( 'wpSessionKey' => 'foo' ) ); - $this->assertFalse( UploadFromStash::isValidRequest( $request ), 'Check failure on bad wpSessionKey' ); - - $request = new FauxRequest( array( 'wpFileKey' => 'testkey-test.test' ) ); - $this->assertTrue( UploadFromStash::isValidRequest( $request ), 'Check good wpFileKey' ); - - $request = new FauxRequest( array( 'wpFileKey' => 'testkey-test.test' ) ); - $this->assertTrue( UploadFromStash::isValidRequest( $request ), 'Check good wpSessionKey' ); - - $request = new FauxRequest( array( 'wpFileKey' => 'testkey-test.test', 'wpSessionKey' => 'foo' ) ); - $this->assertTrue( UploadFromStash::isValidRequest( $request ), 'Check key precedence' ); - } -} diff --git a/tests/phpunit/install-phpunit.sh b/tests/phpunit/install-phpunit.sh deleted file mode 100644 index 1f602935..00000000 --- a/tests/phpunit/install-phpunit.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -has_binary () { - if [ -z `which $1` ]; then - return 1 - fi - return 0 -} - -if [ `id -u` -ne 0 ]; then - echo '*** ERROR: Must be root to run' - exit 1 -fi - -if ( has_binary phpunit ); then - echo PHPUnit already installed -else if ( has_binary pear ); then - echo Installing phpunit with pear - pear channel-discover pear.phpunit.de - pear channel-discover components.ez.no - pear channel-discover pear.symfony.com - pear update-channels - pear install --alldeps phpunit/PHPUnit -else if ( has_binary apt-get ); then - echo Installing phpunit with apt-get - apt-get install phpunit -else if ( has_binary yum ); then - echo Installing phpunit with yum - yum install phpunit -else if ( has_binary port ); then - echo Installing phpunit with macports - port install php5-unit -fi -fi -fi -fi -fi diff --git a/tests/phpunit/languages/LanguageAmTest.php b/tests/phpunit/languages/LanguageAmTest.php deleted file mode 100644 index a644f5e0..00000000 --- a/tests/phpunit/languages/LanguageAmTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageAm.php */ -class LanguageAmTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageArTest.php b/tests/phpunit/languages/LanguageArTest.php deleted file mode 100644 index 7b48f236..00000000 --- a/tests/phpunit/languages/LanguageArTest.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php -/** - * Based on LanguagMlTest - * @file - */ - -/** Tests for MediaWiki languages/LanguageAr.php */ -class LanguageArTest extends LanguageClassesTestCase { - /** - * @covers Language::formatNum - * @todo split into a test and a dataprovider - */ - public function testFormatNum() { - $this->assertEquals( '١٬٢٣٤٬٥٦٧', $this->getLang()->formatNum( '1234567' ) ); - $this->assertEquals( '-١٢٫٨٩', $this->getLang()->formatNum( -12.89 ) ); - } - - /** - * Mostly to test the raw ascii feature. - * @dataProvider providerSprintfDate - * @covers Language::sprintfDate - */ - public function testSprintfDate( $format, $date, $expected ) { - $this->assertEquals( $expected, $this->getLang()->sprintfDate( $format, $date ) ); - } - - public static function providerSprintfDate() { - return array( - array( - 'xg "vs" g', - '20120102030410', - 'يناير vs ٣' - ), - array( - 'xmY', - '20120102030410', - '١٤٣٣' - ), - array( - 'xnxmY', - '20120102030410', - '1433' - ), - array( - 'xN xmj xmn xN xmY', - '20120102030410', - ' 7 2 ١٤٣٣' - ), - ); - } - - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'zero', 'one', 'two', 'few', 'many', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'zero', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'few', 3 ), - array( 'few', 9 ), - array( 'few', 110 ), - array( 'many', 11 ), - array( 'many', 15 ), - array( 'many', 99 ), - array( 'many', 9999 ), - array( 'other', 100 ), - array( 'other', 102 ), - array( 'other', 1000 ), - array( 'other', 1.7 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageBeTest.php b/tests/phpunit/languages/LanguageBeTest.php deleted file mode 100644 index 7bd586af..00000000 --- a/tests/phpunit/languages/LanguageBeTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageBe.php */ -class LanguageBeTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'many', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 1 ), - array( 'many', 11 ), - array( 'one', 91 ), - array( 'one', 121 ), - array( 'few', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'few', 334 ), - array( 'many', 5 ), - array( 'many', 15 ), - array( 'many', 120 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageBe_taraskTest.php b/tests/phpunit/languages/LanguageBe_taraskTest.php deleted file mode 100644 index dbdb5889..00000000 --- a/tests/phpunit/languages/LanguageBe_taraskTest.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php - -class LanguageBe_taraskTest extends LanguageClassesTestCase { - /** - * Make sure the language code we are given is indeed - * be-tarask. This is to ensure LanguageClassesTestCase - * does not give us the wrong language. - */ - public function testBeTaraskTestsUsesBeTaraskCode() { - $this->assertEquals( 'be-tarask', - $this->getLang()->getCode() - ); - } - - /** - * @see bug 23156 & r64981 - * @covers Language::commafy - */ - public function testSearchRightSingleQuotationMarkAsApostroph() { - $this->assertEquals( - "'", - $this->getLang()->normalizeForSearch( '’' ), - 'bug 23156: U+2019 conversion to U+0027' - ); - } - - /** - * @see bug 23156 & r64981 - * @covers Language::commafy - */ - public function testCommafy() { - $this->assertEquals( '1,234,567', $this->getLang()->commafy( '1234567' ) ); - $this->assertEquals( '12,345', $this->getLang()->commafy( '12345' ) ); - } - - /** - * @see bug 23156 & r64981 - * @covers Language::commafy - */ - public function testDoesNotCommafyFourDigitsNumber() { - $this->assertEquals( '1234', $this->getLang()->commafy( '1234' ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'many', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 1 ), - array( 'many', 11 ), - array( 'one', 91 ), - array( 'one', 121 ), - array( 'few', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'few', 334 ), - array( 'many', 5 ), - array( 'many', 15 ), - array( 'many', 120 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( '1=one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'other', 11 ), - array( 'other', 91 ), - array( 'other', 121 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageBhoTest.php b/tests/phpunit/languages/LanguageBhoTest.php deleted file mode 100644 index 187bfbbc..00000000 --- a/tests/phpunit/languages/LanguageBhoTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageBho.php */ -class LanguageBhoTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageBsTest.php b/tests/phpunit/languages/LanguageBsTest.php deleted file mode 100644 index 7aca2ab1..00000000 --- a/tests/phpunit/languages/LanguageBsTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for Croatian (hrvatski) */ -class LanguageBsTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 4 ), - array( 'other', 5 ), - array( 'other', 11 ), - array( 'other', 20 ), - array( 'one', 21 ), - array( 'few', 24 ), - array( 'other', 25 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageClassesTestCase.php b/tests/phpunit/languages/LanguageClassesTestCase.php deleted file mode 100644 index 632e037f..00000000 --- a/tests/phpunit/languages/LanguageClassesTestCase.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * Helping class to run tests using a clean language instance. - * - * This is intended for the MediaWiki language class tests under - * tests/phpunit/languages. - * - * Before each tests, a new language object is build which you - * can retrieve in your test using the $this->getLang() method: - * - * @par Using the crafted language object: - * @code - * function testHasLanguageObject() { - * $langObject = $this->getLang(); - * $this->assertInstanceOf( 'LanguageFoo', - * $langObject - * ); - * } - * @endcode - */ -abstract class LanguageClassesTestCase extends MediaWikiTestCase { - /** - * Internal language object - * - * A new object is created before each tests thanks to PHPUnit - * setUp() method, it is deleted after each test too. To get - * this object you simply use the getLang method. - * - * You must have setup a language code first. See $LanguageClassCode - * @code - * function testWeAreTheChampions() { - * $this->getLang(); # language object - * } - * @endcode - */ - private $languageObject; - - /** - * @return Language - */ - protected function getLang() { - return $this->languageObject; - } - - /** - * Create a new language object before each test. - */ - protected function setUp() { - parent::setUp(); - $found = preg_match( '/Language(.+)Test/', get_called_class(), $m ); - if ( $found ) { - # Normalize language code since classes uses underscores - $m[1] = str_replace( '_', '-', $m[1] ); - } else { - # Fallback to english language - $m[1] = 'en'; - wfDebug( - __METHOD__ . " could not extract a language name " - . "out of " . get_called_class() . " failling back to 'en'\n" - ); - } - // @todo validate $m[1] which should be a valid language code - $this->languageObject = Language::factory( $m[1] ); - } - - /** - * Delete the internal language object so each test start - * out with a fresh language instance. - */ - protected function tearDown() { - unset( $this->languageObject ); - parent::tearDown(); - } -} diff --git a/tests/phpunit/languages/LanguageCsTest.php b/tests/phpunit/languages/LanguageCsTest.php deleted file mode 100644 index da9e6b88..00000000 --- a/tests/phpunit/languages/LanguageCsTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/Languagecs.php */ -class LanguageCsTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'other', 5 ), - array( 'other', 11 ), - array( 'other', 20 ), - array( 'other', 25 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageCuTest.php b/tests/phpunit/languages/LanguageCuTest.php deleted file mode 100644 index 07193172..00000000 --- a/tests/phpunit/languages/LanguageCuTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageCu.php */ -class LanguageCuTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'other', 5 ), - array( 'one', 11 ), - array( 'other', 20 ), - array( 'two', 22 ), - array( 'few', 223 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageCyTest.php b/tests/phpunit/languages/LanguageCyTest.php deleted file mode 100644 index eaf663a8..00000000 --- a/tests/phpunit/languages/LanguageCyTest.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageCy.php */ -class LanguageCyTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'zero', 'one', 'two', 'few', 'many', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'zero', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'few', 3 ), - array( 'many', 6 ), - array( 'other', 4 ), - array( 'other', 5 ), - array( 'other', 11 ), - array( 'other', 20 ), - array( 'other', 22 ), - array( 'other', 223 ), - array( 'other', 200.00 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageDsbTest.php b/tests/phpunit/languages/LanguageDsbTest.php deleted file mode 100644 index 94c11bcc..00000000 --- a/tests/phpunit/languages/LanguageDsbTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageDsb.php */ -class LanguageDsbTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'one', 101 ), - array( 'one', 90001 ), - array( 'two', 2 ), - array( 'few', 3 ), - array( 'few', 203 ), - array( 'few', 4 ), - array( 'other', 99 ), - array( 'other', 555 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageFrTest.php b/tests/phpunit/languages/LanguageFrTest.php deleted file mode 100644 index 46b65011..00000000 --- a/tests/phpunit/languages/LanguageFrTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageFr.php */ -class LanguageFrTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageGaTest.php b/tests/phpunit/languages/LanguageGaTest.php deleted file mode 100644 index c009f56b..00000000 --- a/tests/phpunit/languages/LanguageGaTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageGa.php */ -class LanguageGaTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageGdTest.php b/tests/phpunit/languages/LanguageGdTest.php deleted file mode 100644 index 0b2612b2..00000000 --- a/tests/phpunit/languages/LanguageGdTest.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012-2013, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageGd.php */ -class LanguageGdTest extends LanguageClassesTestCase { - /** - * @dataProvider providerPlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providerPlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'one', 11 ), - array( 'two', 12 ), - array( 'few', 3 ), - array( 'few', 19 ), - array( 'other', 200 ), - ); - } - - /** - * @dataProvider providerPluralExplicit - * @covers Language::convertPlural - */ - public function testExplicitPlural( $result, $value ) { - $forms = array( 'one', 'two', 'few', 'other', '11=Form11', '12=Form12' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providerPluralExplicit() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'Form11', 11 ), - array( 'Form12', 12 ), - array( 'few', 3 ), - array( 'few', 19 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageGvTest.php b/tests/phpunit/languages/LanguageGvTest.php deleted file mode 100644 index fc58022a..00000000 --- a/tests/phpunit/languages/LanguageGvTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * Test for Manx (Gaelg) language - * - * @author Santhosh Thottingal - * @copyright Copyright © 2013, Santhosh Thottingal - * @file - */ - -class LanguageGvTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'few', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'other', 3 ), - array( 'few', 20 ), - array( 'one', 21 ), - array( 'two', 22 ), - array( 'other', 23 ), - array( 'other', 50 ), - array( 'few', 60 ), - array( 'other', 80 ), - array( 'few', 100 ) - ); - } -} diff --git a/tests/phpunit/languages/LanguageHeTest.php b/tests/phpunit/languages/LanguageHeTest.php deleted file mode 100644 index 8edc6ddf..00000000 --- a/tests/phpunit/languages/LanguageHeTest.php +++ /dev/null @@ -1,132 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageHe.php */ -class LanguageHeTest extends LanguageClassesTestCase { - /** - * The most common usage for the plural forms is two forms, - * for singular and plural. In this case, the second form - * is technically dual, but in practice it's used as plural. - * In some cases, usually with expressions of time, three forms - * are needed - singular, dual and plural. - * CLDR also specifies a fourth form for multiples of 10, - * which is very rare. It also has a mistake, because - * the number 10 itself is supposed to be just plural, - * so currently it's overridden in MediaWiki. - */ - - // @todo the below test*PluralForms test methods can be refactored - // to use a single test method and data provider.. - - /** - * @dataProvider provideTwoPluralForms - * @covers Language::convertPlural - */ - public function testTwoPluralForms( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider provideThreePluralForms - * @covers Language::convertPlural - */ - public function testThreePluralForms( $result, $value ) { - $forms = array( 'one', 'two', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider provideFourPluralForms - * @covers Language::convertPlural - */ - public function testFourPluralForms( $result, $value ) { - $forms = array( 'one', 'two', 'many', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider provideFourPluralForms - * @covers Language::convertPlural - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function provideTwoPluralForms() { - return array( - array( 'other', 0 ), // Zero - plural - array( 'one', 1 ), // Singular - array( 'other', 2 ), // No third form provided, use it as plural - array( 'other', 3 ), // Plural - other - array( 'other', 10 ), // No fourth form provided, use it as plural - array( 'other', 20 ), // No fourth form provided, use it as plural - ); - } - - public static function provideThreePluralForms() { - return array( - array( 'other', 0 ), // Zero - plural - array( 'one', 1 ), // Singular - array( 'two', 2 ), // Dual - array( 'other', 3 ), // Plural - other - array( 'other', 10 ), // No fourth form provided, use it as plural - array( 'other', 20 ), // No fourth form provided, use it as plural - ); - } - - public static function provideFourPluralForms() { - return array( - array( 'other', 0 ), // Zero - plural - array( 'one', 1 ), // Singular - array( 'two', 2 ), // Dual - array( 'other', 3 ), // Plural - other - array( 'other', 10 ), // 10 is supposed to be plural (other), not "many" - array( 'many', 20 ), // Fourth form provided - rare, but supported by CLDR - ); - } - - /** - * @dataProvider provideGrammar - * @covers Language::convertGrammar - */ - public function testGrammar( $result, $word, $case ) { - $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) ); - } - - // The comments in the beginning of the line help avoid RTL problems - // with text editors. - public static function provideGrammar() { - return array( - array( - /* result */'וויקיפדיה', - /* word */'ויקיפדיה', - /* case */'תחילית', - ), - array( - /* result */'וולפגנג', - /* word */'וולפגנג', - /* case */'prefixed', - ), - array( - /* result */'קובץ', - /* word */'הקובץ', - /* case */'תחילית', - ), - array( - /* result */'־Wikipedia', - /* word */'Wikipedia', - /* case */'תחילית', - ), - array( - /* result */'־1995', - /* word */'1995', - /* case */'תחילית', - ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageHiTest.php b/tests/phpunit/languages/LanguageHiTest.php deleted file mode 100644 index f6d2c9e9..00000000 --- a/tests/phpunit/languages/LanguageHiTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageHi.php */ -class LanguageHiTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageHrTest.php b/tests/phpunit/languages/LanguageHrTest.php deleted file mode 100644 index 644c5255..00000000 --- a/tests/phpunit/languages/LanguageHrTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageHr.php */ -class LanguageHrTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 4 ), - array( 'other', 5 ), - array( 'other', 11 ), - array( 'other', 20 ), - array( 'one', 21 ), - array( 'few', 24 ), - array( 'other', 25 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageHsbTest.php b/tests/phpunit/languages/LanguageHsbTest.php deleted file mode 100644 index f95a43bf..00000000 --- a/tests/phpunit/languages/LanguageHsbTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageHsb.php */ -class LanguageHsbTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'one', 101 ), - array( 'one', 90001 ), - array( 'two', 2 ), - array( 'few', 3 ), - array( 'few', 203 ), - array( 'few', 4 ), - array( 'other', 99 ), - array( 'other', 555 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageHuTest.php b/tests/phpunit/languages/LanguageHuTest.php deleted file mode 100644 index ee9197d7..00000000 --- a/tests/phpunit/languages/LanguageHuTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageHu.php */ -class LanguageHuTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageHyTest.php b/tests/phpunit/languages/LanguageHyTest.php deleted file mode 100644 index 92e0ef94..00000000 --- a/tests/phpunit/languages/LanguageHyTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for Armenian (Հայերեն) */ -class LanguageHyTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageKshTest.php b/tests/phpunit/languages/LanguageKshTest.php deleted file mode 100644 index 568a3780..00000000 --- a/tests/phpunit/languages/LanguageKshTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageKsh.php */ -class LanguageKshTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other', 'zero' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'zero', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageLnTest.php b/tests/phpunit/languages/LanguageLnTest.php deleted file mode 100644 index 10b3234f..00000000 --- a/tests/phpunit/languages/LanguageLnTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageLn.php */ -class LanguageLnTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageLtTest.php b/tests/phpunit/languages/LanguageLtTest.php deleted file mode 100644 index 30642f62..00000000 --- a/tests/phpunit/languages/LanguageLtTest.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageLt.php */ -class LanguageLtTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 9 ), - array( 'other', 10 ), - array( 'other', 11 ), - array( 'other', 20 ), - array( 'one', 21 ), - array( 'few', 32 ), - array( 'one', 41 ), - array( 'one', 40001 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testOneFewPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - // This fails for 21, but not sure why. - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 15 ), - array( 'other', 20 ), - array( 'one', 21 ), - array( 'other', 22 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageLvTest.php b/tests/phpunit/languages/LanguageLvTest.php deleted file mode 100644 index 7120cfe3..00000000 --- a/tests/phpunit/languages/LanguageLvTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for Latvian */ -class LanguageLvTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'zero', 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'zero', 0 ), - array( 'one', 1 ), - array( 'zero', 11 ), - array( 'one', 21 ), - array( 'zero', 411 ), - array( 'other', 2 ), - array( 'other', 9 ), - array( 'zero', 12 ), - array( 'other', 12.345 ), - array( 'zero', 20 ), - array( 'other', 22 ), - array( 'one', 31 ), - array( 'zero', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageMgTest.php b/tests/phpunit/languages/LanguageMgTest.php deleted file mode 100644 index 65e8fd7b..00000000 --- a/tests/phpunit/languages/LanguageMgTest.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageMg.php */ -class LanguageMgTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - array( 'other', 123.3434 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageMkTest.php b/tests/phpunit/languages/LanguageMkTest.php deleted file mode 100644 index ed155263..00000000 --- a/tests/phpunit/languages/LanguageMkTest.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for македонски/Macedonian */ -class LanguageMkTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'one', 11 ), - array( 'one', 21 ), - array( 'one', 411 ), - array( 'other', 12.345 ), - array( 'other', 20 ), - array( 'one', 31 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageMlTest.php b/tests/phpunit/languages/LanguageMlTest.php deleted file mode 100644 index 4fa45ce3..00000000 --- a/tests/phpunit/languages/LanguageMlTest.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2011, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageMl.php */ -class LanguageMlTest extends LanguageClassesTestCase { - - /** - * @dataProvider providerFormatNum - * @see bug 29495 - * @covers Language::formatNum - */ - public function testFormatNum( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->formatNum( $value ) ); - } - - public static function providerFormatNum() { - return array( - array( '12,34,567', '1234567' ), - array( '12,345', '12345' ), - array( '1', '1' ), - array( '123', '123' ), - array( '1,234', '1234' ), - array( '12,345.56', '12345.56' ), - array( '12,34,56,79,81,23,45,678', '12345679812345678' ), - array( '.12345', '.12345' ), - array( '-12,00,000', '-1200000' ), - array( '-98', '-98' ), - array( '-98', -98 ), - array( '-1,23,45,678', -12345678 ), - array( '', '' ), - array( '', null ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageMoTest.php b/tests/phpunit/languages/LanguageMoTest.php deleted file mode 100644 index e0e54ca8..00000000 --- a/tests/phpunit/languages/LanguageMoTest.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageMo.php */ -class LanguageMoTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'few', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 19 ), - array( 'other', 20 ), - array( 'other', 99 ), - array( 'other', 100 ), - array( 'few', 101 ), - array( 'few', 119 ), - array( 'other', 120 ), - array( 'other', 200 ), - array( 'few', 201 ), - array( 'few', 219 ), - array( 'other', 220 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageMtTest.php b/tests/phpunit/languages/LanguageMtTest.php deleted file mode 100644 index 96d2bc92..00000000 --- a/tests/phpunit/languages/LanguageMtTest.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageMt.php */ -class LanguageMtTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'many', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'few', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 10 ), - array( 'many', 11 ), - array( 'many', 19 ), - array( 'other', 20 ), - array( 'other', 99 ), - array( 'other', 100 ), - array( 'other', 101 ), - array( 'few', 102 ), - array( 'few', 110 ), - array( 'many', 111 ), - array( 'many', 119 ), - array( 'other', 120 ), - array( 'other', 201 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 10 ), - array( 'other', 11 ), - array( 'other', 19 ), - array( 'other', 20 ), - array( 'other', 99 ), - array( 'other', 100 ), - array( 'other', 101 ), - array( 'other', 102 ), - array( 'other', 110 ), - array( 'other', 111 ), - array( 'other', 119 ), - array( 'other', 120 ), - array( 'other', 201 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageNlTest.php b/tests/phpunit/languages/LanguageNlTest.php deleted file mode 100644 index 26bd691a..00000000 --- a/tests/phpunit/languages/LanguageNlTest.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2011, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageNl.php */ -class LanguageNlTest extends LanguageClassesTestCase { - - /** - * @covers Language::formatNum - * @todo split into a test and a dataprovider - */ - public function testFormatNum() { - $this->assertEquals( '1.234.567', $this->getLang()->formatNum( '1234567' ) ); - $this->assertEquals( '12.345', $this->getLang()->formatNum( '12345' ) ); - $this->assertEquals( '1', $this->getLang()->formatNum( '1' ) ); - $this->assertEquals( '123', $this->getLang()->formatNum( '123' ) ); - $this->assertEquals( '1.234', $this->getLang()->formatNum( '1234' ) ); - $this->assertEquals( '12.345,56', $this->getLang()->formatNum( '12345.56' ) ); - $this->assertEquals( ',1234556', $this->getLang()->formatNum( '.1234556' ) ); - } -} diff --git a/tests/phpunit/languages/LanguageNsoTest.php b/tests/phpunit/languages/LanguageNsoTest.php deleted file mode 100644 index 18efd736..00000000 --- a/tests/phpunit/languages/LanguageNsoTest.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageNso.php */ -class LanguageNsoTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguagePlTest.php b/tests/phpunit/languages/LanguagePlTest.php deleted file mode 100644 index d180037b..00000000 --- a/tests/phpunit/languages/LanguagePlTest.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguagePl.php */ -class LanguagePlTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'many' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'many', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'many', 5 ), - array( 'many', 9 ), - array( 'many', 10 ), - array( 'many', 11 ), - array( 'many', 21 ), - array( 'few', 22 ), - array( 'few', 23 ), - array( 'few', 24 ), - array( 'many', 25 ), - array( 'many', 200 ), - array( 'many', 201 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 3 ), - array( 'other', 4 ), - array( 'other', 5 ), - array( 'other', 9 ), - array( 'other', 10 ), - array( 'other', 11 ), - array( 'other', 21 ), - array( 'other', 22 ), - array( 'other', 23 ), - array( 'other', 24 ), - array( 'other', 25 ), - array( 'other', 200 ), - array( 'other', 201 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageRoTest.php b/tests/phpunit/languages/LanguageRoTest.php deleted file mode 100644 index ae7816bc..00000000 --- a/tests/phpunit/languages/LanguageRoTest.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageRo.php */ -class LanguageRoTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'few', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 19 ), - array( 'other', 20 ), - array( 'other', 99 ), - array( 'other', 100 ), - array( 'few', 101 ), - array( 'few', 119 ), - array( 'other', 120 ), - array( 'other', 200 ), - array( 'few', 201 ), - array( 'few', 219 ), - array( 'other', 220 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageRuTest.php b/tests/phpunit/languages/LanguageRuTest.php deleted file mode 100644 index e17c7085..00000000 --- a/tests/phpunit/languages/LanguageRuTest.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * based on LanguageBe_tarask.php - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageRu.php */ -class LanguageRuTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'many', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * Test explicit plural forms - n=FormN forms - * @covers Language::convertPlural - */ - public function testExplicitPlural() { - $forms = array( 'one','many', 'other', '12=dozen' ); - $this->assertEquals( 'dozen', $this->getLang()->convertPlural( 12, $forms ) ); - $forms = array( 'one', 'many', '100=hundred', 'other', '12=dozen' ); - $this->assertEquals( 'hundred', $this->getLang()->convertPlural( 100, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 1 ), - array( 'many', 11 ), - array( 'one', 91 ), - array( 'one', 121 ), - array( 'other', 2 ), - array( 'other', 3 ), - array( 'other', 4 ), - array( 'other', 334 ), - array( 'many', 5 ), - array( 'many', 15 ), - array( 'many', 120 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( '1=one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'one', 1 ), - array( 'other', 11 ), - array( 'other', 91 ), - array( 'other', 121 ), - ); - } - - /** - * @dataProvider providerGrammar - * @covers Language::convertGrammar - */ - public function testGrammar( $result, $word, $case ) { - $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) ); - } - - public static function providerGrammar() { - return array( - array( - 'Википедии', - 'Википедия', - 'genitive', - ), - array( - 'Викитеки', - 'Викитека', - 'genitive', - ), - array( - 'Викитеке', - 'Викитека', - 'prepositional', - ), - array( - 'Викиданных', - 'Викиданные', - 'prepositional', - ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageSeTest.php b/tests/phpunit/languages/LanguageSeTest.php deleted file mode 100644 index 533aa2bc..00000000 --- a/tests/phpunit/languages/LanguageSeTest.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageSe.php */ -class LanguageSeTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'other', 3 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 3 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageSgsTest.php b/tests/phpunit/languages/LanguageSgsTest.php deleted file mode 100644 index fa49a4dd..00000000 --- a/tests/phpunit/languages/LanguageSgsTest.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for Samogitian */ -class LanguageSgsTest extends LanguageClassesTestCase { - /** - * @dataProvider providePluralAllForms - * @covers Language::convertPlural - */ - public function testPluralAllForms( $result, $value ) { - $forms = array( 'one', 'two', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePluralAllForms - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePluralAllForms() { - return array( - array( 'few', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'other', 3 ), - array( 'few', 10 ), - array( 'few', 11 ), - array( 'few', 12 ), - array( 'few', 19 ), - array( 'other', 20 ), - array( 'few', 100 ), - array( 'one', 101 ), - array( 'few', 111 ), - array( 'few', 112 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 3 ), - array( 'other', 10 ), - array( 'other', 11 ), - array( 'other', 12 ), - array( 'other', 19 ), - array( 'other', 20 ), - array( 'other', 100 ), - array( 'one', 101 ), - array( 'other', 111 ), - array( 'other', 112 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageShTest.php b/tests/phpunit/languages/LanguageShTest.php deleted file mode 100644 index 1b390872..00000000 --- a/tests/phpunit/languages/LanguageShTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for srpskohrvatski / српскохрватски / Serbocroatian */ -class LanguageShTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 4 ), - array( 'other', 5 ), - array( 'other', 10 ), - array( 'other', 11 ), - array( 'other', 12 ), - array( 'one', 101 ), - array( 'few', 102 ), - array( 'other', 111 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageSkTest.php b/tests/phpunit/languages/LanguageSkTest.php deleted file mode 100644 index cb8a13b8..00000000 --- a/tests/phpunit/languages/LanguageSkTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Amir E. Aharoni - * based on LanguageSkTest.php - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageSk.php */ -class LanguageSkTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'other', 5 ), - array( 'other', 11 ), - array( 'other', 20 ), - array( 'other', 25 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageSlTest.php b/tests/phpunit/languages/LanguageSlTest.php deleted file mode 100644 index 9783dd80..00000000 --- a/tests/phpunit/languages/LanguageSlTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Amir E. Aharoni - * based on LanguageSkTest.php - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageSl.php */ -class LanguageSlTest extends LanguageClassesTestCase { - /** - * @dataProvider providerPlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providerPlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providerPlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'other', 5 ), - array( 'other', 99 ), - array( 'other', 100 ), - array( 'one', 101 ), - array( 'two', 102 ), - array( 'few', 103 ), - array( 'one', 201 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageSmaTest.php b/tests/phpunit/languages/LanguageSmaTest.php deleted file mode 100644 index 95cb333c..00000000 --- a/tests/phpunit/languages/LanguageSmaTest.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageSma.php */ -class LanguageSmaTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'other', 3 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 3 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageSrTest.php b/tests/phpunit/languages/LanguageSrTest.php deleted file mode 100644 index d6fedb57..00000000 --- a/tests/phpunit/languages/LanguageSrTest.php +++ /dev/null @@ -1,246 +0,0 @@ -<?php -/** - * PHPUnit tests for the Serbian language. - * The language can be represented using two scripts: - * - Latin (SR_el) - * - Cyrillic (SR_ec) - * Both representations seems to be bijective, hence MediaWiki can convert - * from one script to the other. - * - * @author Antoine Musso <hashar at free dot fr> - * @copyright Copyright © 2011, Antoine Musso <hashar at free dot fr> - * @file - * - * @todo methods in test class should be tidied: - * - Should be split into separate test methods and data providers - * - Tests for LanguageConverter and Language should probably be separate.. - */ - -/** Tests for MediaWiki languages/LanguageSr.php */ -class LanguageSrTest extends LanguageClassesTestCase { - /** - * @covers LanguageConverter::convertTo - */ - public function testEasyConversions() { - $this->assertCyrillic( - 'шђчћжШЂЧЋЖ', - 'Cyrillic guessing characters' - ); - $this->assertLatin( - 'šđč枊ĐČĆŽ', - 'Latin guessing characters' - ); - } - - /** - * @covers LanguageConverter::convertTo - */ - public function testMixedConversions() { - $this->assertCyrillic( - 'шђчћжШЂЧЋЖ - šđčćž', - 'Mostly cyrillic characters' - ); - $this->assertLatin( - 'šđč枊ĐČĆŽ - шђчћж', - 'Mostly latin characters' - ); - } - - /** - * @covers LanguageConverter::convertTo - */ - public function testSameAmountOfLatinAndCyrillicGetConverted() { - $this->assertConverted( - '4 latin: šđčć | 4 cyrillic: шђчћ', - 'sr-ec' - ); - $this->assertConverted( - '4 latin: šđčć | 4 cyrillic: шђчћ', - 'sr-el' - ); - } - - /** - * @author Nikola Smolenski - * @covers LanguageConverter::convertTo - */ - public function testConversionToCyrillic() { - //A simple convertion of Latin to Cyrillic - $this->assertEquals( 'абвг', - $this->convertToCyrillic( 'abvg' ) - ); - //Same as above, but assert that -{}-s must be removed and not converted - $this->assertEquals( 'ljабnjвгdž', - $this->convertToCyrillic( '-{lj}-ab-{nj}-vg-{dž}-' ) - ); - //A simple convertion of Cyrillic to Cyrillic - $this->assertEquals( 'абвг', - $this->convertToCyrillic( 'абвг' ) - ); - //Same as above, but assert that -{}-s must be removed and not converted - $this->assertEquals( 'ljабnjвгdž', - $this->convertToCyrillic( '-{lj}-аб-{nj}-вг-{dž}-' ) - ); - //This text has some Latin, but is recognized as Cyrillic, so it should not be converted - $this->assertEquals( 'abvgшђжчћ', - $this->convertToCyrillic( 'abvgшђжчћ' ) - ); - //Same as above, but assert that -{}-s must be removed - $this->assertEquals( 'љabvgњшђжчћџ', - $this->convertToCyrillic( '-{љ}-abvg-{њ}-шђжчћ-{џ}-' ) - ); - //This text has some Cyrillic, but is recognized as Latin, so it should be converted - $this->assertEquals( 'абвгшђжчћ', - $this->convertToCyrillic( 'абвгšđžčć' ) - ); - //Same as above, but assert that -{}-s must be removed and not converted - $this->assertEquals( 'ljабвгnjшђжчћdž', - $this->convertToCyrillic( '-{lj}-абвг-{nj}-šđžčć-{dž}-' ) - ); - // Roman numerals are not converted - $this->assertEquals( 'а I б II в III г IV шђжчћ', - $this->convertToCyrillic( 'a I b II v III g IV šđžčć' ) - ); - } - - /** - * @covers LanguageConverter::convertTo - */ - public function testConversionToLatin() { - //A simple convertion of Latin to Latin - $this->assertEquals( 'abcd', - $this->convertToLatin( 'abcd' ) - ); - //A simple convertion of Cyrillic to Latin - $this->assertEquals( 'abcd', - $this->convertToLatin( 'абцд' ) - ); - //This text has some Latin, but is recognized as Cyrillic, so it should be converted - $this->assertEquals( 'abcdšđžčć', - $this->convertToLatin( 'abcdшђжчћ' ) - ); - //This text has some Cyrillic, but is recognized as Latin, so it should not be converted - $this->assertEquals( 'абцдšđžčć', - $this->convertToLatin( 'абцдšđžčć' ) - ); - } - - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 1 ), - array( 'other', 11 ), - array( 'one', 91 ), - array( 'one', 121 ), - array( 'few', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'few', 334 ), - array( 'other', 5 ), - array( 'other', 15 ), - array( 'other', 120 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'one', 1 ), - array( 'other', 11 ), - array( 'other', 4 ), - array( 'one', 91 ), - array( 'one', 121 ), - ); - } - - ##### HELPERS ##################################################### - /** - *Wrapper to verify text stay the same after applying conversion - * @param $text string Text to convert - * @param $variant string Language variant 'sr-ec' or 'sr-el' - * @param $msg string Optional message - */ - protected function assertUnConverted( $text, $variant, $msg = '' ) { - $this->assertEquals( - $text, - $this->convertTo( $text, $variant ), - $msg - ); - } - - /** - * Wrapper to verify a text is different once converted to a variant. - * @param $text string Text to convert - * @param $variant string Language variant 'sr-ec' or 'sr-el' - * @param $msg string Optional message - */ - protected function assertConverted( $text, $variant, $msg = '' ) { - $this->assertNotEquals( - $text, - $this->convertTo( $text, $variant ), - $msg - ); - } - - /** - * Verifiy the given Cyrillic text is not converted when using - * using the cyrillic variant and converted to Latin when using - * the Latin variant. - */ - protected function assertCyrillic( $text, $msg = '' ) { - $this->assertUnConverted( $text, 'sr-ec', $msg ); - $this->assertConverted( $text, 'sr-el', $msg ); - } - - /** - * Verifiy the given Latin text is not converted when using - * using the Latin variant and converted to Cyrillic when using - * the Cyrillic variant. - */ - protected function assertLatin( $text, $msg = '' ) { - $this->assertUnConverted( $text, 'sr-el', $msg ); - $this->assertConverted( $text, 'sr-ec', $msg ); - } - - - /** Wrapper for converter::convertTo() method*/ - protected function convertTo( $text, $variant ) { - return $this->getLang() - ->mConverter - ->convertTo( - $text, $variant - ); - } - - protected function convertToCyrillic( $text ) { - return $this->convertTo( $text, 'sr-ec' ); - } - - protected function convertToLatin( $text ) { - return $this->convertTo( $text, 'sr-el' ); - } -} diff --git a/tests/phpunit/languages/LanguageTest.php b/tests/phpunit/languages/LanguageTest.php deleted file mode 100644 index 78929e23..00000000 --- a/tests/phpunit/languages/LanguageTest.php +++ /dev/null @@ -1,1567 +0,0 @@ -<?php - -class LanguageTest extends LanguageClassesTestCase { - /** - * @covers Language::convertDoubleWidth - * @covers Language::normalizeForSearch - */ - public function testLanguageConvertDoubleWidthToSingleWidth() { - $this->assertEquals( - "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", - $this->getLang()->normalizeForSearch( - "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" - ), - 'convertDoubleWidth() with the full alphabet and digits' - ); - } - - /** - * @dataProvider provideFormattableTimes# - * @covers Language::formatTimePeriod - */ - public function testFormatTimePeriod( $seconds, $format, $expected, $desc ) { - $this->assertEquals( $expected, $this->getLang()->formatTimePeriod( $seconds, $format ), $desc ); - } - - public static function provideFormattableTimes() { - return array( - array( - 9.45, - array(), - '9.5 s', - 'formatTimePeriod() rounding (<10s)' - ), - array( - 9.45, - array( 'noabbrevs' => true ), - '9.5 seconds', - 'formatTimePeriod() rounding (<10s)' - ), - array( - 9.95, - array(), - '10 s', - 'formatTimePeriod() rounding (<10s)' - ), - array( - 9.95, - array( 'noabbrevs' => true ), - '10 seconds', - 'formatTimePeriod() rounding (<10s)' - ), - array( - 59.55, - array(), - '1 min 0 s', - 'formatTimePeriod() rounding (<60s)' - ), - array( - 59.55, - array( 'noabbrevs' => true ), - '1 minute 0 seconds', - 'formatTimePeriod() rounding (<60s)' - ), - array( - 119.55, - array(), - '2 min 0 s', - 'formatTimePeriod() rounding (<1h)' - ), - array( - 119.55, - array( 'noabbrevs' => true ), - '2 minutes 0 seconds', - 'formatTimePeriod() rounding (<1h)' - ), - array( - 3599.55, - array(), - '1 h 0 min 0 s', - 'formatTimePeriod() rounding (<1h)' - ), - array( - 3599.55, - array( 'noabbrevs' => true ), - '1 hour 0 minutes 0 seconds', - 'formatTimePeriod() rounding (<1h)' - ), - array( - 7199.55, - array(), - '2 h 0 min 0 s', - 'formatTimePeriod() rounding (>=1h)' - ), - array( - 7199.55, - array( 'noabbrevs' => true ), - '2 hours 0 minutes 0 seconds', - 'formatTimePeriod() rounding (>=1h)' - ), - array( - 7199.55, - 'avoidseconds', - '2 h 0 min', - 'formatTimePeriod() rounding (>=1h), avoidseconds' - ), - array( - 7199.55, - array( 'avoid' => 'avoidseconds', 'noabbrevs' => true ), - '2 hours 0 minutes', - 'formatTimePeriod() rounding (>=1h), avoidseconds' - ), - array( - 7199.55, - 'avoidminutes', - '2 h 0 min', - 'formatTimePeriod() rounding (>=1h), avoidminutes' - ), - array( - 7199.55, - array( 'avoid' => 'avoidminutes', 'noabbrevs' => true ), - '2 hours 0 minutes', - 'formatTimePeriod() rounding (>=1h), avoidminutes' - ), - array( - 172799.55, - 'avoidseconds', - '48 h 0 min', - 'formatTimePeriod() rounding (=48h), avoidseconds' - ), - array( - 172799.55, - array( 'avoid' => 'avoidseconds', 'noabbrevs' => true ), - '48 hours 0 minutes', - 'formatTimePeriod() rounding (=48h), avoidseconds' - ), - array( - 259199.55, - 'avoidminutes', - '3 d 0 h', - 'formatTimePeriod() rounding (>48h), avoidminutes' - ), - array( - 259199.55, - array( 'avoid' => 'avoidminutes', 'noabbrevs' => true ), - '3 days 0 hours', - 'formatTimePeriod() rounding (>48h), avoidminutes' - ), - array( - 176399.55, - 'avoidseconds', - '2 d 1 h 0 min', - 'formatTimePeriod() rounding (>48h), avoidseconds' - ), - array( - 176399.55, - array( 'avoid' => 'avoidseconds', 'noabbrevs' => true ), - '2 days 1 hour 0 minutes', - 'formatTimePeriod() rounding (>48h), avoidseconds' - ), - array( - 176399.55, - 'avoidminutes', - '2 d 1 h', - 'formatTimePeriod() rounding (>48h), avoidminutes' - ), - array( - 176399.55, - array( 'avoid' => 'avoidminutes', 'noabbrevs' => true ), - '2 days 1 hour', - 'formatTimePeriod() rounding (>48h), avoidminutes' - ), - array( - 259199.55, - 'avoidseconds', - '3 d 0 h 0 min', - 'formatTimePeriod() rounding (>48h), avoidseconds' - ), - array( - 259199.55, - array( 'avoid' => 'avoidseconds', 'noabbrevs' => true ), - '3 days 0 hours 0 minutes', - 'formatTimePeriod() rounding (>48h), avoidseconds' - ), - array( - 172801.55, - 'avoidseconds', - '2 d 0 h 0 min', - 'formatTimePeriod() rounding, (>48h), avoidseconds' - ), - array( - 172801.55, - array( 'avoid' => 'avoidseconds', 'noabbrevs' => true ), - '2 days 0 hours 0 minutes', - 'formatTimePeriod() rounding, (>48h), avoidseconds' - ), - array( - 176460.55, - array(), - '2 d 1 h 1 min 1 s', - 'formatTimePeriod() rounding, recursion, (>48h)' - ), - array( - 176460.55, - array( 'noabbrevs' => true ), - '2 days 1 hour 1 minute 1 second', - 'formatTimePeriod() rounding, recursion, (>48h)' - ), - ); - } - - /** - * @covers Language::truncate - */ - public function testTruncate() { - $this->assertEquals( - "XXX", - $this->getLang()->truncate( "1234567890", 0, 'XXX' ), - 'truncate prefix, len 0, small ellipsis' - ); - - $this->assertEquals( - "12345XXX", - $this->getLang()->truncate( "1234567890", 8, 'XXX' ), - 'truncate prefix, small ellipsis' - ); - - $this->assertEquals( - "123456789", - $this->getLang()->truncate( "123456789", 5, 'XXXXXXXXXXXXXXX' ), - 'truncate prefix, large ellipsis' - ); - - $this->assertEquals( - "XXX67890", - $this->getLang()->truncate( "1234567890", -8, 'XXX' ), - 'truncate suffix, small ellipsis' - ); - - $this->assertEquals( - "123456789", - $this->getLang()->truncate( "123456789", -5, 'XXXXXXXXXXXXXXX' ), - 'truncate suffix, large ellipsis' - ); - } - - /** - * @dataProvider provideHTMLTruncateData - * @covers Language::truncateHTML - */ - public function testTruncateHtml( $len, $ellipsis, $input, $expected ) { - // Actual HTML... - $this->assertEquals( - $expected, - $this->getLang()->truncateHTML( $input, $len, $ellipsis ) - ); - } - - /** - * @return array format is ($len, $ellipsis, $input, $expected) - */ - public static function provideHTMLTruncateData() { - return array( - array( 0, 'XXX', "1234567890", "XXX" ), - array( 8, 'XXX', "1234567890", "12345XXX" ), - array( 5, 'XXXXXXXXXXXXXXX', '1234567890', "1234567890" ), - array( 2, '***', - '<p><span style="font-weight:bold;"></span></p>', - '<p><span style="font-weight:bold;"></span></p>', - ), - array( 2, '***', - '<p><span style="font-weight:bold;">123456789</span></p>', - '<p><span style="font-weight:bold;">***</span></p>', - ), - array( 2, '***', - '<p><span style="font-weight:bold;"> 23456789</span></p>', - '<p><span style="font-weight:bold;">***</span></p>', - ), - array( 3, '***', - '<p><span style="font-weight:bold;">123456789</span></p>', - '<p><span style="font-weight:bold;">***</span></p>', - ), - array( 4, '***', - '<p><span style="font-weight:bold;">123456789</span></p>', - '<p><span style="font-weight:bold;">1***</span></p>', - ), - array( 5, '***', - '<tt><span style="font-weight:bold;">123456789</span></tt>', - '<tt><span style="font-weight:bold;">12***</span></tt>', - ), - array( 6, '***', - '<p><a href="www.mediawiki.org">123456789</a></p>', - '<p><a href="www.mediawiki.org">123***</a></p>', - ), - array( 6, '***', - '<p><a href="www.mediawiki.org">12 456789</a></p>', - '<p><a href="www.mediawiki.org">12 ***</a></p>', - ), - array( 7, '***', - '<small><span style="font-weight:bold;">123<p id="#moo">456</p>789</span></small>', - '<small><span style="font-weight:bold;">123<p id="#moo">4***</p></span></small>', - ), - array( 8, '***', - '<div><span style="font-weight:bold;">123<span>4</span>56789</span></div>', - '<div><span style="font-weight:bold;">123<span>4</span>5***</span></div>', - ), - array( 9, '***', - '<p><table style="font-weight:bold;"><tr><td>123456789</td></tr></table></p>', - '<p><table style="font-weight:bold;"><tr><td>123456789</td></tr></table></p>', - ), - array( 10, '***', - '<p><font style="font-weight:bold;">123456789</font></p>', - '<p><font style="font-weight:bold;">123456789</font></p>', - ), - ); - } - - /** - * Test Language::isWellFormedLanguageTag() - * @dataProvider provideWellFormedLanguageTags - * @covers Language::isWellFormedLanguageTag - */ - public function testWellFormedLanguageTag( $code, $message = '' ) { - $this->assertTrue( - Language::isWellFormedLanguageTag( $code ), - "validating code $code $message" - ); - } - - /** - * The test cases are based on the tests in the GaBuZoMeu parser - * written by Stéphane Bortzmeyer <bortzmeyer@nic.fr> - * and distributed as free software, under the GNU General Public Licence. - * http://www.bortzmeyer.org/gabuzomeu-parsing-language-tags.html - */ - public static function provideWellFormedLanguageTags() { - return array( - array( 'fr', 'two-letter code' ), - array( 'fr-latn', 'two-letter code with lower case script code' ), - array( 'fr-Latn-FR', 'two-letter code with title case script code and uppercase country code' ), - array( 'fr-Latn-419', 'two-letter code with title case script code and region number' ), - array( 'fr-FR', 'two-letter code with uppercase' ), - array( 'ax-TZ', 'Not in the registry, but well-formed' ), - array( 'fr-shadok', 'two-letter code with variant' ), - array( 'fr-y-myext-myext2', 'non-x singleton' ), - array( 'fra-Latn', 'ISO 639 can be 3-letters' ), - array( 'fra', 'three-letter language code' ), - array( 'fra-FX', 'three-letter language code with country code' ), - array( 'i-klingon', 'grandfathered with singleton' ), - array( 'I-kLINgon', 'tags are case-insensitive...' ), - array( 'no-bok', 'grandfathered without singleton' ), - array( 'i-enochian', 'Grandfathered' ), - array( 'x-fr-CH', 'private use' ), - array( 'es-419', 'two-letter code with region number' ), - array( 'en-Latn-GB-boont-r-extended-sequence-x-private', 'weird, but well-formed' ), - array( 'ab-x-abc-x-abc', 'anything goes after x' ), - array( 'ab-x-abc-a-a', 'anything goes after x, including several non-x singletons' ), - array( 'i-default', 'grandfathered' ), - array( 'abcd-Latn', 'Language of 4 chars reserved for future use' ), - array( 'AaBbCcDd-x-y-any-x', 'Language of 5-8 chars, registered' ), - array( 'de-CH-1901', 'with country and year' ), - array( 'en-US-x-twain', 'with country and singleton' ), - array( 'zh-cmn', 'three-letter variant' ), - array( 'zh-cmn-Hant', 'three-letter variant and script' ), - array( 'zh-cmn-Hant-HK', 'three-letter variant, script and country' ), - array( 'xr-p-lze', 'Extension' ), - ); - } - - /** - * Negative test for Language::isWellFormedLanguageTag() - * @dataProvider provideMalformedLanguageTags - * @covers Language::isWellFormedLanguageTag - */ - public function testMalformedLanguageTag( $code, $message = '' ) { - $this->assertFalse( - Language::isWellFormedLanguageTag( $code ), - "validating that code $code is a malformed language tag - $message" - ); - } - - /** - * The test cases are based on the tests in the GaBuZoMeu parser - * written by Stéphane Bortzmeyer <bortzmeyer@nic.fr> - * and distributed as free software, under the GNU General Public Licence. - * http://www.bortzmeyer.org/gabuzomeu-parsing-language-tags.html - */ - public static function provideMalformedLanguageTags() { - return array( - array( 'f', 'language too short' ), - array( 'f-Latn', 'language too short with script' ), - array( 'xr-lxs-qut', 'variants too short' ), # extlangS - array( 'fr-Latn-F', 'region too short' ), - array( 'a-value', 'language too short with region' ), - array( 'tlh-a-b-foo', 'valid three-letter with wrong variant' ), - array( 'i-notexist', 'grandfathered but not registered: invalid, even if we only test well-formedness' ), - array( 'abcdefghi-012345678', 'numbers too long' ), - array( 'ab-abc-abc-abc-abc', 'invalid extensions' ), - array( 'ab-abcd-abc', 'invalid extensions' ), - array( 'ab-ab-abc', 'invalid extensions' ), - array( 'ab-123-abc', 'invalid extensions' ), - array( 'a-Hant-ZH', 'short language with valid extensions' ), - array( 'a1-Hant-ZH', 'invalid character in language' ), - array( 'ab-abcde-abc', 'invalid extensions' ), - array( 'ab-1abc-abc', 'invalid characters in extensions' ), - array( 'ab-ab-abcd', 'invalid order of extensions' ), - array( 'ab-123-abcd', 'invalid order of extensions' ), - array( 'ab-abcde-abcd', 'invalid extensions' ), - array( 'ab-1abc-abcd', 'invalid characters in extensions' ), - array( 'ab-a-b', 'extensions too short' ), - array( 'ab-a-x', 'extensions too short, even with singleton' ), - array( 'ab--ab', 'two separators' ), - array( 'ab-abc-', 'separator in the end' ), - array( '-ab-abc', 'separator in the beginning' ), - array( 'abcd-efg', 'language too long' ), - array( 'aabbccddE', 'tag too long' ), - array( 'pa_guru', 'A tag with underscore is invalid in strict mode' ), - array( 'de-f', 'subtag too short' ), - ); - } - - /** - * Negative test for Language::isWellFormedLanguageTag() - * @covers Language::isWellFormedLanguageTag - */ - public function testLenientLanguageTag() { - $this->assertTrue( - Language::isWellFormedLanguageTag( 'pa_guru', true ), - 'pa_guru is a well-formed language tag in lenient mode' - ); - } - - /** - * Test Language::isValidBuiltInCode() - * @dataProvider provideLanguageCodes - * @covers Language::isValidBuiltInCode - */ - public function testBuiltInCodeValidation( $code, $message = '' ) { - $this->assertTrue( - (bool)Language::isValidBuiltInCode( $code ), - "validating code $code $message" - ); - } - - /** - * @covers Language::isValidBuiltInCode - */ - public function testBuiltInCodeValidationRejectUnderscore() { - $this->assertFalse( - (bool)Language::isValidBuiltInCode( 'be_tarask' ), - "reject underscore in language code" - ); - } - - public static function provideLanguageCodes() { - return array( - array( 'fr', 'Two letters, minor case' ), - array( 'EN', 'Two letters, upper case' ), - array( 'tyv', 'Three letters' ), - array( 'tokipona', 'long language code' ), - array( 'be-tarask', 'With dash' ), - array( 'Zh-classical', 'Begin with upper case, dash' ), - array( 'Be-x-old', 'With extension (two dashes)' ), - ); - } - - /** - * Test Language::isKnownLanguageTag() - * @dataProvider provideKnownLanguageTags - * @covers Language::isKnownLanguageTag - */ - public function testKnownLanguageTag( $code, $message = '' ) { - $this->assertTrue( - (bool)Language::isKnownLanguageTag( $code ), - "validating code $code - $message" - ); - } - - public static function provideKnownLanguageTags() { - return array( - array( 'fr', 'simple code' ), - array( 'bat-smg', 'an MW legacy tag' ), - array( 'sgs', 'an internal standard MW name, for which a legacy tag is used externally' ), - ); - } - - /** - * @covers Language::isKnownLanguageTag - */ - public function testKnownCldrLanguageTag() { - if ( !class_exists( 'LanguageNames' ) ) { - $this->markTestSkipped( 'The LanguageNames class is not available. The cldr extension is probably not installed.' ); - } - - $this->assertTrue( - (bool)Language::isKnownLanguageTag( 'pal' ), - 'validating code "pal" an ancient language, which probably will not appear in Names.php, but appears in CLDR in English' - ); - } - - /** - * Negative tests for Language::isKnownLanguageTag() - * @dataProvider provideUnKnownLanguageTags - * @covers Language::isKnownLanguageTag - */ - public function testUnknownLanguageTag( $code, $message = '' ) { - $this->assertFalse( - (bool)Language::isKnownLanguageTag( $code ), - "checking that code $code is invalid - $message" - ); - } - - public static function provideUnknownLanguageTags() { - return array( - array( 'mw', 'non-existent two-letter code' ), - array( 'foo"<bar', 'very invalid language code' ), - ); - } - - /** - * Test too short timestamp - * @expectedException MWException - * @covers Language::sprintfDate - */ - public function testSprintfDateTooShortTimestamp() { - $this->getLang()->sprintfDate( 'xiY', '1234567890123' ); - } - - /** - * Test too long timestamp - * @expectedException MWException - * @covers Language::sprintfDate - */ - public function testSprintfDateTooLongTimestamp() { - $this->getLang()->sprintfDate( 'xiY', '123456789012345' ); - } - - /** - * Test too short timestamp - * @expectedException MWException - * @covers Language::sprintfDate - */ - public function testSprintfDateNotAllDigitTimestamp() { - $this->getLang()->sprintfDate( 'xiY', '-1234567890123' ); - } - - /** - * @dataProvider provideSprintfDateSamples - * @covers Language::sprintfDate - */ - public function testSprintfDate( $format, $ts, $expected, $msg ) { - $this->assertEquals( - $expected, - $this->getLang()->sprintfDate( $format, $ts ), - "sprintfDate('$format', '$ts'): $msg" - ); - } - - /** - * sprintfDate should always use UTC when no zone is given. - * @dataProvider provideSprintfDateSamples - * @covers Language::sprintfDate - */ - public function testSprintfDateNoZone( $format, $ts, $expected, $ignore, $msg ) { - $oldTZ = date_default_timezone_get(); - $res = date_default_timezone_set( 'Asia/Seoul' ); - if ( !$res ) { - $this->markTestSkipped( "Error setting Timezone" ); - } - - $this->assertEquals( - $expected, - $this->getLang()->sprintfDate( $format, $ts ), - "sprintfDate('$format', '$ts'): $msg" - ); - - date_default_timezone_set( $oldTZ ); - } - - /** - * sprintfDate should use passed timezone - * @dataProvider provideSprintfDateSamples - * @covers Language::sprintfDate - */ - public function testSprintfDateTZ( $format, $ts, $ignore, $expected, $msg ) { - $tz = new DateTimeZone( 'Asia/Seoul' ); - if ( !$tz ) { - $this->markTestSkipped( "Error getting Timezone" ); - } - - $this->assertEquals( - $expected, - $this->getLang()->sprintfDate( $format, $ts, $tz ), - "sprintfDate('$format', '$ts', 'Asia/Seoul'): $msg" - ); - } - - public static function provideSprintfDateSamples() { - return array( - array( - 'xiY', - '20111212000000', - '1390', // note because we're testing English locale we get Latin-standard digits - '1390', - 'Iranian calendar full year' - ), - array( - 'xiy', - '20111212000000', - '90', - '90', - 'Iranian calendar short year' - ), - array( - 'o', - '20120101235000', - '2011', - '2011', - 'ISO 8601 (week) year' - ), - array( - 'W', - '20120101235000', - '52', - '52', - 'Week number' - ), - array( - 'W', - '20120102235000', - '1', - '1', - 'Week number' - ), - array( - 'o-\\WW-N', - '20091231235000', - '2009-W53-4', - '2009-W53-4', - 'leap week' - ), - // What follows is mostly copied from http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23time - array( - 'Y', - '20120102090705', - '2012', - '2012', - 'Full year' - ), - array( - 'y', - '20120102090705', - '12', - '12', - '2 digit year' - ), - array( - 'L', - '20120102090705', - '1', - '1', - 'Leap year' - ), - array( - 'n', - '20120102090705', - '1', - '1', - 'Month index, not zero pad' - ), - array( - 'N', - '20120102090705', - '01', - '01', - 'Month index. Zero pad' - ), - array( - 'M', - '20120102090705', - 'Jan', - 'Jan', - 'Month abbrev' - ), - array( - 'F', - '20120102090705', - 'January', - 'January', - 'Full month' - ), - array( - 'xg', - '20120102090705', - 'January', - 'January', - 'Genitive month name (same in EN)' - ), - array( - 'j', - '20120102090705', - '2', - '2', - 'Day of month (not zero pad)' - ), - array( - 'd', - '20120102090705', - '02', - '02', - 'Day of month (zero-pad)' - ), - array( - 'z', - '20120102090705', - '1', - '1', - 'Day of year (zero-indexed)' - ), - array( - 'D', - '20120102090705', - 'Mon', - 'Mon', - 'Day of week (abbrev)' - ), - array( - 'l', - '20120102090705', - 'Monday', - 'Monday', - 'Full day of week' - ), - array( - 'N', - '20120101090705', - '7', - '7', - 'Day of week (Mon=1, Sun=7)' - ), - array( - 'w', - '20120101090705', - '0', - '0', - 'Day of week (Sun=0, Sat=6)' - ), - array( - 'N', - '20120102090705', - '1', - '1', - 'Day of week' - ), - array( - 'a', - '20120102090705', - 'am', - 'am', - 'am vs pm' - ), - array( - 'A', - '20120102120000', - 'PM', - 'PM', - 'AM vs PM' - ), - array( - 'a', - '20120102000000', - 'am', - 'am', - 'AM vs PM' - ), - array( - 'g', - '20120102090705', - '9', - '9', - '12 hour, not Zero' - ), - array( - 'h', - '20120102090705', - '09', - '09', - '12 hour, zero padded' - ), - array( - 'G', - '20120102090705', - '9', - '9', - '24 hour, not zero' - ), - array( - 'H', - '20120102090705', - '09', - '09', - '24 hour, zero' - ), - array( - 'H', - '20120102110705', - '11', - '11', - '24 hour, zero' - ), - array( - 'i', - '20120102090705', - '07', - '07', - 'Minutes' - ), - array( - 's', - '20120102090705', - '05', - '05', - 'seconds' - ), - array( - 'U', - '20120102090705', - '1325495225', - '1325462825', - 'unix time' - ), - array( - 't', - '20120102090705', - '31', - '31', - 'Days in current month' - ), - array( - 'c', - '20120102090705', - '2012-01-02T09:07:05+00:00', - '2012-01-02T09:07:05+09:00', - 'ISO 8601 timestamp' - ), - array( - 'r', - '20120102090705', - 'Mon, 02 Jan 2012 09:07:05 +0000', - 'Mon, 02 Jan 2012 09:07:05 +0900', - 'RFC 5322' - ), - array( - 'e', - '20120102090705', - 'UTC', - 'Asia/Seoul', - 'Timezone identifier' - ), - array( - 'I', - '19880602090705', - '0', - '1', - 'DST indicator' - ), - array( - 'O', - '20120102090705', - '+0000', - '+0900', - 'Timezone offset' - ), - array( - 'P', - '20120102090705', - '+00:00', - '+09:00', - 'Timezone offset with colon' - ), - array( - 'T', - '20120102090705', - 'UTC', - 'KST', - 'Timezone abbreviation' - ), - array( - 'Z', - '20120102090705', - '0', - '32400', - 'Timezone offset in seconds' - ), - array( - 'xmj xmF xmn xmY', - '20120102090705', - '7 Safar 2 1433', - '7 Safar 2 1433', - 'Islamic' - ), - array( - 'xij xiF xin xiY', - '20120102090705', - '12 Dey 10 1390', - '12 Dey 10 1390', - 'Iranian' - ), - array( - 'xjj xjF xjn xjY', - '20120102090705', - '7 Tevet 4 5772', - '7 Tevet 4 5772', - 'Hebrew' - ), - array( - 'xjt', - '20120102090705', - '29', - '29', - 'Hebrew number of days in month' - ), - array( - 'xjx', - '20120102090705', - 'Tevet', - 'Tevet', - 'Hebrew genitive month name (No difference in EN)' - ), - array( - 'xkY', - '20120102090705', - '2555', - '2555', - 'Thai year' - ), - array( - 'xoY', - '20120102090705', - '101', - '101', - 'Minguo' - ), - array( - 'xtY', - '20120102090705', - '平成24', - '平成24', - 'nengo' - ), - array( - 'xrxkYY', - '20120102090705', - 'MMDLV2012', - 'MMDLV2012', - 'Roman numerals' - ), - array( - 'xhxjYY', - '20120102090705', - 'ה\'תשע"ב2012', - 'ה\'תשע"ב2012', - 'Hebrew numberals' - ), - array( - 'xnY', - '20120102090705', - '2012', - '2012', - 'Raw numerals (doesn\'t mean much in EN)' - ), - array( - '[[Y "(yea"\\r)]] \\"xx\\"', - '20120102090705', - '[[2012 (year)]] "x"', - '[[2012 (year)]] "x"', - 'Various escaping' - ), - - ); - } - - /** - * @dataProvider provideFormatSizes - * @covers Language::formatSize - */ - public function testFormatSize( $size, $expected, $msg ) { - $this->assertEquals( - $expected, - $this->getLang()->formatSize( $size ), - "formatSize('$size'): $msg" - ); - } - - public static function provideFormatSizes() { - return array( - array( - 0, - "0 B", - "Zero bytes" - ), - array( - 1024, - "1 KB", - "1 kilobyte" - ), - array( - 1024 * 1024, - "1 MB", - "1,024 megabytes" - ), - array( - 1024 * 1024 * 1024, - "1 GB", - "1 gigabytes" - ), - array( - pow( 1024, 4 ), - "1 TB", - "1 terabyte" - ), - array( - pow( 1024, 5 ), - "1 PB", - "1 petabyte" - ), - array( - pow( 1024, 6 ), - "1 EB", - "1,024 exabyte" - ), - array( - pow( 1024, 7 ), - "1 ZB", - "1 zetabyte" - ), - array( - pow( 1024, 8 ), - "1 YB", - "1 yottabyte" - ), - // How big!? THIS BIG! - ); - } - - /** - * @dataProvider provideFormatBitrate - * @covers Language::formatBitrate - */ - public function testFormatBitrate( $bps, $expected, $msg ) { - $this->assertEquals( - $expected, - $this->getLang()->formatBitrate( $bps ), - "formatBitrate('$bps'): $msg" - ); - } - - public static function provideFormatBitrate() { - return array( - array( - 0, - "0 bps", - "0 bits per second" - ), - array( - 999, - "999 bps", - "999 bits per second" - ), - array( - 1000, - "1 kbps", - "1 kilobit per second" - ), - array( - 1000 * 1000, - "1 Mbps", - "1 megabit per second" - ), - array( - pow( 10, 9 ), - "1 Gbps", - "1 gigabit per second" - ), - array( - pow( 10, 12 ), - "1 Tbps", - "1 terabit per second" - ), - array( - pow( 10, 15 ), - "1 Pbps", - "1 petabit per second" - ), - array( - pow( 10, 18 ), - "1 Ebps", - "1 exabit per second" - ), - array( - pow( 10, 21 ), - "1 Zbps", - "1 zetabit per second" - ), - array( - pow( 10, 24 ), - "1 Ybps", - "1 yottabit per second" - ), - array( - pow( 10, 27 ), - "1,000 Ybps", - "1,000 yottabits per second" - ), - ); - } - - - /** - * @dataProvider provideFormatDuration - * @covers Language::formatDuration - */ - public function testFormatDuration( $duration, $expected, $intervals = array() ) { - $this->assertEquals( - $expected, - $this->getLang()->formatDuration( $duration, $intervals ), - "formatDuration('$duration'): $expected" - ); - } - - public static function provideFormatDuration() { - return array( - array( - 0, - '0 seconds', - ), - array( - 1, - '1 second', - ), - array( - 2, - '2 seconds', - ), - array( - 60, - '1 minute', - ), - array( - 2 * 60, - '2 minutes', - ), - array( - 3600, - '1 hour', - ), - array( - 2 * 3600, - '2 hours', - ), - array( - 24 * 3600, - '1 day', - ), - array( - 2 * 86400, - '2 days', - ), - array( - // ( 365 + ( 24 * 3 + 25 ) / 400 ) * 86400 = 31556952 - ( 365 + ( 24 * 3 + 25 ) / 400.0 ) * 86400, - '1 year', - ), - array( - 2 * 31556952, - '2 years', - ), - array( - 10 * 31556952, - '1 decade', - ), - array( - 20 * 31556952, - '2 decades', - ), - array( - 100 * 31556952, - '1 century', - ), - array( - 200 * 31556952, - '2 centuries', - ), - array( - 1000 * 31556952, - '1 millennium', - ), - array( - 2000 * 31556952, - '2 millennia', - ), - array( - 9001, - '2 hours, 30 minutes and 1 second' - ), - array( - 3601, - '1 hour and 1 second' - ), - array( - 31556952 + 2 * 86400 + 9000, - '1 year, 2 days, 2 hours and 30 minutes' - ), - array( - 42 * 1000 * 31556952 + 42, - '42 millennia and 42 seconds' - ), - array( - 60, - '60 seconds', - array( 'seconds' ), - ), - array( - 61, - '61 seconds', - array( 'seconds' ), - ), - array( - 1, - '1 second', - array( 'seconds' ), - ), - array( - 31556952 + 2 * 86400 + 9000, - '1 year, 2 days and 150 minutes', - array( 'years', 'days', 'minutes' ), - ), - array( - 42, - '0 days', - array( 'years', 'days' ), - ), - array( - 31556952 + 2 * 86400 + 9000, - '1 year, 2 days and 150 minutes', - array( 'minutes', 'days', 'years' ), - ), - array( - 42, - '0 days', - array( 'days', 'years' ), - ), - ); - } - - /** - * @dataProvider provideCheckTitleEncodingData - * @covers Language::checkTitleEncoding - */ - public function testCheckTitleEncoding( $s ) { - $this->assertEquals( - $s, - $this->getLang()->checkTitleEncoding( $s ), - "checkTitleEncoding('$s')" - ); - } - - public static function provideCheckTitleEncodingData() { - return array( - array( "" ), - array( "United States of America" ), // 7bit ASCII - array( rawurldecode( "S%C3%A9rie%20t%C3%A9l%C3%A9vis%C3%A9e" ) ), - array( - rawurldecode( - "Acteur%7CAlbert%20Robbins%7CAnglais%7CAnn%20Donahue%7CAnthony%20E.%20Zuiker%7CCarol%20Mendelsohn" - ) - ), - // The following two data sets come from bug 36839. They fail if checkTitleEncoding uses a regexp to test for - // valid UTF-8 encoding and the pcre.recursion_limit is low (like, say, 1024). They succeed if checkTitleEncoding - // uses mb_check_encoding for its test. - array( - rawurldecode( - "Acteur%7CAlbert%20Robbins%7CAnglais%7CAnn%20Donahue%7CAnthony%20E.%20Zuiker%7CCarol%20Mendelsohn%7C" - . "Catherine%20Willows%7CDavid%20Hodges%7CDavid%20Phillips%7CGil%20Grissom%7CGreg%20Sanders%7CHodges%7C" - . "Internet%20Movie%20Database%7CJim%20Brass%7CLady%20Heather%7C" - . "Les%20Experts%20(s%C3%A9rie%20t%C3%A9l%C3%A9vis%C3%A9e)%7CLes%20Experts%20:%20Manhattan%7C" - . "Les%20Experts%20:%20Miami%7CListe%20des%20personnages%20des%20Experts%7C" - . "Liste%20des%20%C3%A9pisodes%20des%20Experts%7CMod%C3%A8le%20discussion:Palette%20Les%20Experts%7C" - . "Nick%20Stokes%7CPersonnage%20de%20fiction%7CPersonnage%20fictif%7CPersonnage%20de%20fiction%7C" - . "Personnages%20r%C3%A9currents%20dans%20Les%20Experts%7CRaymond%20Langston%7CRiley%20Adams%7C" - . "Saison%201%20des%20Experts%7CSaison%2010%20des%20Experts%7CSaison%2011%20des%20Experts%7C" - . "Saison%2012%20des%20Experts%7CSaison%202%20des%20Experts%7CSaison%203%20des%20Experts%7C" - . "Saison%204%20des%20Experts%7CSaison%205%20des%20Experts%7CSaison%206%20des%20Experts%7C" - . "Saison%207%20des%20Experts%7CSaison%208%20des%20Experts%7CSaison%209%20des%20Experts%7C" - . "Sara%20Sidle%7CSofia%20Curtis%7CS%C3%A9rie%20t%C3%A9l%C3%A9vis%C3%A9e%7CWallace%20Langham%7C" - . "Warrick%20Brown%7CWendy%20Simms%7C%C3%89tats-Unis" - ), - ), - array( - rawurldecode( - "Mod%C3%A8le%3AArrondissements%20homonymes%7CMod%C3%A8le%3ABandeau%20standard%20pour%20page%20d'homonymie%7C" - . "Mod%C3%A8le%3ABatailles%20homonymes%7CMod%C3%A8le%3ACantons%20homonymes%7C" - . "Mod%C3%A8le%3ACommunes%20fran%C3%A7aises%20homonymes%7CMod%C3%A8le%3AFilms%20homonymes%7C" - . "Mod%C3%A8le%3AGouvernements%20homonymes%7CMod%C3%A8le%3AGuerres%20homonymes%7CMod%C3%A8le%3AHomonymie%7C" - . "Mod%C3%A8le%3AHomonymie%20bateau%7CMod%C3%A8le%3AHomonymie%20d'%C3%A9tablissements%20scolaires%20ou" - . "%20universitaires%7CMod%C3%A8le%3AHomonymie%20d'%C3%AEles%7CMod%C3%A8le%3AHomonymie%20de%20clubs%20sportifs%7C" - . "Mod%C3%A8le%3AHomonymie%20de%20comt%C3%A9s%7CMod%C3%A8le%3AHomonymie%20de%20monument%7C" - . "Mod%C3%A8le%3AHomonymie%20de%20nom%20romain%7CMod%C3%A8le%3AHomonymie%20de%20parti%20politique%7C" - . "Mod%C3%A8le%3AHomonymie%20de%20route%7CMod%C3%A8le%3AHomonymie%20dynastique%7C" - . "Mod%C3%A8le%3AHomonymie%20vid%C3%A9oludique%7CMod%C3%A8le%3AHomonymie%20%C3%A9difice%20religieux%7C" - . "Mod%C3%A8le%3AInternationalisation%7CMod%C3%A8le%3AIsom%C3%A9rie%7CMod%C3%A8le%3AParonymie%7C" - . "Mod%C3%A8le%3APatronyme%7CMod%C3%A8le%3APatronyme%20basque%7CMod%C3%A8le%3APatronyme%20italien%7C" - . "Mod%C3%A8le%3APatronymie%7CMod%C3%A8le%3APersonnes%20homonymes%7CMod%C3%A8le%3ASaints%20homonymes%7C" - . "Mod%C3%A8le%3ATitres%20homonymes%7CMod%C3%A8le%3AToponymie%7CMod%C3%A8le%3AUnit%C3%A9s%20homonymes%7C" - . "Mod%C3%A8le%3AVilles%20homonymes%7CMod%C3%A8le%3A%C3%89difices%20religieux%20homonymes" - ) - ) - ); - } - - /** - * @dataProvider provideRomanNumeralsData - * @covers Language::romanNumeral - */ - public function testRomanNumerals( $num, $numerals ) { - $this->assertEquals( - $numerals, - Language::romanNumeral( $num ), - "romanNumeral('$num')" - ); - } - - public static function provideRomanNumeralsData() { - return array( - array( 1, 'I' ), - array( 2, 'II' ), - array( 3, 'III' ), - array( 4, 'IV' ), - array( 5, 'V' ), - array( 6, 'VI' ), - array( 7, 'VII' ), - array( 8, 'VIII' ), - array( 9, 'IX' ), - array( 10, 'X' ), - array( 20, 'XX' ), - array( 30, 'XXX' ), - array( 40, 'XL' ), - array( 49, 'XLIX' ), - array( 50, 'L' ), - array( 60, 'LX' ), - array( 70, 'LXX' ), - array( 80, 'LXXX' ), - array( 90, 'XC' ), - array( 99, 'XCIX' ), - array( 100, 'C' ), - array( 200, 'CC' ), - array( 300, 'CCC' ), - array( 400, 'CD' ), - array( 500, 'D' ), - array( 600, 'DC' ), - array( 700, 'DCC' ), - array( 800, 'DCCC' ), - array( 900, 'CM' ), - array( 999, 'CMXCIX' ), - array( 1000, 'M' ), - array( 1989, 'MCMLXXXIX' ), - array( 2000, 'MM' ), - array( 3000, 'MMM' ), - array( 4000, 'MMMM' ), - array( 5000, 'MMMMM' ), - array( 6000, 'MMMMMM' ), - array( 7000, 'MMMMMMM' ), - array( 8000, 'MMMMMMMM' ), - array( 9000, 'MMMMMMMMM' ), - array( 9999, 'MMMMMMMMMCMXCIX' ), - array( 10000, 'MMMMMMMMMM' ), - ); - } - - /** - * @dataProvider providePluralData - * @covers Language::convertPlural - */ - public function testConvertPlural( $expected, $number, $forms ) { - $chosen = $this->getLang()->convertPlural( $number, $forms ); - $this->assertEquals( $expected, $chosen ); - } - - public static function providePluralData() { - // Params are: [expected text, number given, [the plural forms]] - return array( - array( 'plural', 0, array( - 'singular', 'plural' - ) ), - array( 'explicit zero', 0, array( - '0=explicit zero', 'singular', 'plural' - ) ), - array( 'explicit one', 1, array( - 'singular', 'plural', '1=explicit one', - ) ), - array( 'singular', 1, array( - 'singular', 'plural', '0=explicit zero', - ) ), - array( 'plural', 3, array( - '0=explicit zero', '1=explicit one', 'singular', 'plural' - ) ), - array( 'explicit eleven', 11, array( - 'singular', 'plural', '11=explicit eleven', - ) ), - array( 'plural', 12, array( - 'singular', 'plural', '11=explicit twelve', - ) ), - array( 'plural', 12, array( - 'singular', 'plural', '=explicit form', - ) ), - array( 'other', 2, array( - 'kissa=kala', '1=2=3', 'other', - ) ), - array( '', 2, array( - '0=explicit zero', '1=explicit one', - ) ), - ); - } - - /** - * @covers Language::translateBlockExpiry() - * @dataProvider provideTranslateBlockExpiry - */ - public function testTranslateBlockExpiry( $expectedData, $str, $desc ) { - $lang = $this->getLang(); - if ( is_array( $expectedData ) ) { - list( $func, $arg ) = $expectedData; - $expected = $lang->$func( $arg ); - } else { - $expected = $expectedData; - } - $this->assertEquals( $expected, $lang->translateBlockExpiry( $str ), $desc ); - } - - public static function provideTranslateBlockExpiry() { - return array( - array( '2 hours', '2 hours', 'simple data from ipboptions' ), - array( 'indefinite', 'infinite', 'infinite from ipboptions' ), - array( 'indefinite', 'infinity', 'alternative infinite from ipboptions' ), - array( 'indefinite', 'indefinite', 'another alternative infinite from ipboptions' ), - array( array( 'formatDuration', 1023 * 60 * 60 ), '1023 hours', 'relative' ), - array( array( 'formatDuration', -1023 ), '-1023 seconds', 'negative relative' ), - array( array( 'formatDuration', 0 ), 'now', 'now' ), - array( array( 'timeanddate', '20120102070000' ), '2012-1-1 7:00 +1 day', 'mixed, handled as absolute' ), - array( array( 'timeanddate', '19910203040506' ), '1991-2-3 4:05:06', 'absolute' ), - array( array( 'timeanddate', '19700101000000' ), '1970-1-1 0:00:00', 'absolute at epoch' ), - array( array( 'timeanddate', '19691231235959' ), '1969-12-31 23:59:59', 'time before epoch' ), - array( 'dummy', 'dummy', 'return garbage as is' ), - ); - } - - /** - * @covers Language::commafy() - * @dataProvider provideCommafyData - */ - public function testCommafy( $number, $numbersWithCommas ) { - $this->assertEquals( - $numbersWithCommas, - $this->getLang()->commafy( $number ), - "commafy('$number')" - ); - } - - public static function provideCommafyData() { - return array( - array( 1, '1' ), - array( 10, '10' ), - array( 100, '100' ), - array( 1000, '1,000' ), - array( 10000, '10,000' ), - array( 100000, '100,000' ), - array( 1000000, '1,000,000' ), - array( 1.0001, '1.0001' ), - array( 10.0001, '10.0001' ), - array( 100.0001, '100.0001' ), - array( 1000.0001, '1,000.0001' ), - array( 10000.0001, '10,000.0001' ), - array( 100000.0001, '100,000.0001' ), - array( 1000000.0001, '1,000,000.0001' ), - ); - } - - /** - * @covers Language::listToText - */ - public function testListToText() { - $lang = $this->getLang(); - $and = $lang->getMessageFromDB( 'and' ); - $s = $lang->getMessageFromDB( 'word-separator' ); - $c = $lang->getMessageFromDB( 'comma-separator' ); - - $this->assertEquals( '', $lang->listToText( array() ) ); - $this->assertEquals( 'a', $lang->listToText( array( 'a' ) ) ); - $this->assertEquals( "a{$and}{$s}b", $lang->listToText( array( 'a', 'b' ) ) ); - $this->assertEquals( "a{$c}b{$and}{$s}c", $lang->listToText( array( 'a', 'b', 'c' ) ) ); - $this->assertEquals( "a{$c}b{$c}c{$and}{$s}d", $lang->listToText( array( 'a', 'b', 'c', 'd' ) ) ); - } - - /** - * @dataProvider provideIsSupportedLanguage - * @covers Language::isSupportedLanguage - */ - public function testIsSupportedLanguage( $code, $expected, $comment ) { - $this->assertEquals( $expected, Language::isSupportedLanguage( $code ), $comment ); - } - - public static function provideIsSupportedLanguage() { - return array( - array( 'en', true, 'is supported language' ), - array( 'fi', true, 'is supported language' ), - array( 'bunny', false, 'is not supported language' ), - array( 'FI', false, 'is not supported language, input should be in lower case' ), - ); - } - - /** - * @dataProvider provideGetParentLanguage - * @covers Language::getParentLanguage - */ - public function testGetParentLanguage( $code, $expected, $comment ) { - $lang = Language::factory( $code ); - if ( is_null( $expected ) ) { - $this->assertNull( $lang->getParentLanguage(), $comment ); - } else { - $this->assertEquals( $expected, $lang->getParentLanguage()->getCode(), $comment ); - } - } - - public static function provideGetParentLanguage() { - return array( - array( 'zh-cn', 'zh', 'zh is the parent language of zh-cn' ), - array( 'zh', 'zh', 'zh is defined as the parent language of zh, because zh converter can convert zh-cn to zh' ), - array( 'zh-invalid', null, 'do not be fooled by arbitrarily composed language codes' ), - array( 'en-gb', null, 'en does not have converter' ), - array( 'en', null, 'en does not have converter. Although FakeConverter handles en -> en conversion but it is useless' ), - ); - } - - /** - * @dataProvider provideGetNamespaceAliases - * @covers Language::getNamespaceAliases - */ - public function testGetNamespaceAliases( $languageCode, $subset ) { - $language = Language::factory( $languageCode ); - $aliases = $language->getNamespaceAliases(); - foreach ( $subset as $alias => $nsId ) { - $this->assertEquals( $nsId, $aliases[$alias] ); - } - } - - public static function provideGetNamespaceAliases() { - // TODO: Add tests for NS_PROJECT_TALK and GenderNamespaces - return array( - array( - 'zh', - array( - '文件' => NS_FILE, - '檔案' => NS_FILE, - ), - ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageTiTest.php b/tests/phpunit/languages/LanguageTiTest.php deleted file mode 100644 index e225af97..00000000 --- a/tests/phpunit/languages/LanguageTiTest.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageTi.php */ -class LanguageTiTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageTlTest.php b/tests/phpunit/languages/LanguageTlTest.php deleted file mode 100644 index 7ac51c69..00000000 --- a/tests/phpunit/languages/LanguageTlTest.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageTl.php */ -class LanguageTlTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageTrTest.php b/tests/phpunit/languages/LanguageTrTest.php deleted file mode 100644 index 8fc2795c..00000000 --- a/tests/phpunit/languages/LanguageTrTest.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php -/** - * @author Antoine Musso - * @copyright Copyright © 2011, Antoine Musso - * @file - */ - -/** Tests for MediaWiki languages/LanguageTr.php */ -class LanguageTrTest extends LanguageClassesTestCase { - - /** - * See @bug 28040 - * Credits to irc://irc.freenode.net/wikipedia-tr users: - * - berm - * - []LuCkY[] - * - Emperyan - * @see http://en.wikipedia.org/wiki/Dotted_and_dotless_I - * @dataProvider provideDottedAndDotlessI - */ - public function testDottedAndDotlessI( $func, $input, $inputCase, $expected ) { - if ( $func == 'ucfirst' ) { - $res = $this->getLang()->ucfirst( $input ); - } elseif ( $func == 'lcfirst' ) { - $res = $this->getLang()->lcfirst( $input ); - } else { - throw new MWException( __METHOD__ . " given an invalid function name '$func'" ); - } - - $msg = "Converting $inputCase case '$input' with $func should give '$expected'"; - - $this->assertEquals( $expected, $res, $msg ); - } - - public static function provideDottedAndDotlessI() { - return array( - # function, input, input case, expected - # Case changed: - array( 'ucfirst', 'ı', 'lower', 'I' ), - array( 'ucfirst', 'i', 'lower', 'İ' ), - array( 'lcfirst', 'I', 'upper', 'ı' ), - array( 'lcfirst', 'İ', 'upper', 'i' ), - - # Already using the correct case - array( 'ucfirst', 'I', 'upper', 'I' ), - array( 'ucfirst', 'İ', 'upper', 'İ' ), - array( 'lcfirst', 'ı', 'lower', 'ı' ), - array( 'lcfirst', 'i', 'lower', 'i' ), - - # A real example taken from bug 28040 using - # http://tr.wikipedia.org/wiki/%C4%B0Phone - array( 'lcfirst', 'iPhone', 'lower', 'iPhone' ), - - # next case is valid in Turkish but are different words if we - # consider IPhone is English! - array( 'lcfirst', 'IPhone', 'upper', 'ıPhone' ), - - ); - } -} diff --git a/tests/phpunit/languages/LanguageUkTest.php b/tests/phpunit/languages/LanguageUkTest.php deleted file mode 100644 index 9051bcff..00000000 --- a/tests/phpunit/languages/LanguageUkTest.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * based on LanguageBe_tarask.php - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for Ukrainian */ -class LanguageUkTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'many', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * Test explicit plural forms - n=FormN forms - * @covers Language::convertPlural - */ - public function testExplicitPlural() { - $forms = array( 'one', 'few', 'many', 'other', '12=dozen' ); - $this->assertEquals( 'dozen', $this->getLang()->convertPlural( 12, $forms ) ); - $forms = array( 'one', 'few', 'many', '100=hundred', 'other', '12=dozen' ); - $this->assertEquals( 'hundred', $this->getLang()->convertPlural( 100, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 1 ), - array( 'many', 11 ), - array( 'one', 91 ), - array( 'one', 121 ), - array( 'few', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'few', 334 ), - array( 'many', 5 ), - array( 'many', 15 ), - array( 'many', 120 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( '1=one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'one', 1 ), - array( 'other', 11 ), - array( 'other', 91 ), - array( 'other', 121 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageUzTest.php b/tests/phpunit/languages/LanguageUzTest.php deleted file mode 100644 index 13f57c16..00000000 --- a/tests/phpunit/languages/LanguageUzTest.php +++ /dev/null @@ -1,121 +0,0 @@ -<?php -/** - * PHPUnit tests for the Uzbek language. - * The language can be represented using two scripts: - * - Latin (uz-latn) - * - Cyrillic (uz-cyrl) - * - * @author Robin Pepermans - * @author Antoine Musso <hashar at free dot fr> - * @copyright Copyright © 2012, Robin Pepermans - * @copyright Copyright © 2011, Antoine Musso <hashar at free dot fr> - * @file - * - * @todo methods in test class should be tidied: - * - Should be split into separate test methods and data providers - * - Tests for LanguageConverter and Language should probably be separate.. - */ - -/** Tests for MediaWiki languages/LanguageUz.php */ -class LanguageUzTest extends LanguageClassesTestCase { - - /** - * @author Nikola Smolenski - * @covers LanguageConverter::convertTo - */ - public function testConversionToCyrillic() { - // A convertion of Latin to Cyrillic - $this->assertEquals( 'абвгғ', - $this->convertToCyrillic( 'abvggʻ' ) - ); - // Same as above, but assert that -{}-s must be removed and not converted - $this->assertEquals( 'ljабnjвгўоdb', - $this->convertToCyrillic( '-{lj}-ab-{nj}-vgoʻo-{db}-' ) - ); - // A simple convertion of Cyrillic to Cyrillic - $this->assertEquals( 'абвг', - $this->convertToCyrillic( 'абвг' ) - ); - // Same as above, but assert that -{}-s must be removed and not converted - $this->assertEquals( 'ljабnjвгdaž', - $this->convertToCyrillic( '-{lj}-аб-{nj}-вг-{da}-ž' ) - ); - } - - /** - * @covers LanguageConverter::convertTo - */ - public function testConversionToLatin() { - // A simple convertion of Latin to Latin - $this->assertEquals( 'abdef', - $this->convertToLatin( 'abdef' ) - ); - // A convertion of Cyrillic to Latin - $this->assertEquals( 'gʻabtsdOʻQyo', - $this->convertToLatin( 'ғабцдЎҚё' ) - ); - } - - ##### HELPERS ##################################################### - /** - * Wrapper to verify text stay the same after applying conversion - * @param $text string Text to convert - * @param $variant string Language variant 'uz-cyrl' or 'uz-latn' - * @param $msg string Optional message - */ - protected function assertUnConverted( $text, $variant, $msg = '' ) { - $this->assertEquals( - $text, - $this->convertTo( $text, $variant ), - $msg - ); - } - - /** - * Wrapper to verify a text is different once converted to a variant. - * @param $text string Text to convert - * @param $variant string Language variant 'uz-cyrl' or 'uz-latn' - * @param $msg string Optional message - */ - protected function assertConverted( $text, $variant, $msg = '' ) { - $this->assertNotEquals( - $text, - $this->convertTo( $text, $variant ), - $msg - ); - } - - /** - * Verifiy the given Cyrillic text is not converted when using - * using the cyrillic variant and converted to Latin when using - * the Latin variant. - */ - protected function assertCyrillic( $text, $msg = '' ) { - $this->assertUnConverted( $text, 'uz-cyrl', $msg ); - $this->assertConverted( $text, 'uz-latn', $msg ); - } - - /** - * Verifiy the given Latin text is not converted when using - * using the Latin variant and converted to Cyrillic when using - * the Cyrillic variant. - */ - protected function assertLatin( $text, $msg = '' ) { - $this->assertUnConverted( $text, 'uz-latn', $msg ); - $this->assertConverted( $text, 'uz-cyrl', $msg ); - } - - - /** Wrapper for converter::convertTo() method*/ - protected function convertTo( $text, $variant ) { - return $this->getLang()->mConverter->convertTo( $text, $variant ); - } - - protected function convertToCyrillic( $text ) { - return $this->convertTo( $text, 'uz-cyrl' ); - } - - protected function convertToLatin( $text ) { - return $this->convertTo( $text, 'uz-latn' ); - } -} diff --git a/tests/phpunit/languages/LanguageWaTest.php b/tests/phpunit/languages/LanguageWaTest.php deleted file mode 100644 index d05196c0..00000000 --- a/tests/phpunit/languages/LanguageWaTest.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageWa.php */ -class LanguageWaTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - ); - } -} diff --git a/tests/phpunit/languages/utils/CLDRPluralRuleEvaluatorTest.php b/tests/phpunit/languages/utils/CLDRPluralRuleEvaluatorTest.php deleted file mode 100644 index bd3809d7..00000000 --- a/tests/phpunit/languages/utils/CLDRPluralRuleEvaluatorTest.php +++ /dev/null @@ -1,145 +0,0 @@ -<?php -/** - * @author Niklas Laxström - * @file - */ - -class CLDRPluralRuleEvaluatorTest extends MediaWikiTestCase { - /** - * @dataProvider validTestCases - */ - function testValidRules( $expected, $rules, $number, $comment ) { - $result = CLDRPluralRuleEvaluator::evaluate( $number, (array)$rules ); - $this->assertEquals( $expected, $result, $comment ); - } - - /** - * @dataProvider invalidTestCases - * @expectedException CLDRPluralRuleError - */ - function testInvalidRules( $rules, $comment ) { - CLDRPluralRuleEvaluator::evaluate( 1, (array)$rules ); - } - - function validTestCases() { - $tests = array( - # expected, number, rule, comment - array( 0, 'n is 1', 1, 'integer number and is' ), - array( 0, 'n is 1', "1", 'string integer number and is' ), - array( 0, 'n is 1', 1.0, 'float number and is' ), - array( 0, 'n is 1', "1.0", 'string float number and is' ), - array( 1, 'n is 1', 1.1, 'float number and is' ), - array( 1, 'n is 1', 2, 'float number and is' ), - - array( 0, 'n in 1,3,5', 3, '' ), - array( 1, 'n not in 1,3,5', 5, '' ), - - array( 1, 'n in 1,3,5', 2, '' ), - array( 0, 'n not in 1,3,5', 4, '' ), - - array( 0, 'n in 1..3', 2, '' ), - array( 0, 'n in 1..3', 3, 'in is inclusive' ), - array( 1, 'n in 1..3', 0, '' ), - - array( 1, 'n not in 1..3', 2, '' ), - array( 1, 'n not in 1..3', 3, 'in is inclusive' ), - array( 0, 'n not in 1..3', 0, '' ), - - array( 1, 'n is not 1 and n is not 2 and n is not 3', 1, 'and relation' ), - array( 0, 'n is not 1 and n is not 2 and n is not 4', 3, 'and relation' ), - - array( 0, 'n is not 1 or n is 1', 1, 'or relation' ), - array( 1, 'n is 1 or n is 2', 3, 'or relation' ), - - array( 0, 'n is 1', 1, 'extra whitespace' ), - - array( 0, 'n mod 3 is 1', 7, 'mod' ), - array( 0, 'n mod 3 is not 1', 4.3, 'mod with floats' ), - - array( 0, 'n within 1..3', 2, 'within with integer' ), - array( 0, 'n within 1..3', 2.5, 'within with float' ), - array( 0, 'n in 1..3', 2, 'in with integer' ), - array( 1, 'n in 1..3', 2.5, 'in with float' ), - - array( 0, 'n in 3 or n is 4 and n is 5', 3, 'and binds more tightly than or' ), - array( 1, 'n is 3 or n is 4 and n is 5', 4, 'and binds more tightly than or' ), - - array( 0, 'n mod 10 in 3..4,9 and n mod 100 not in 10..19,70..79,90..99', 24, 'breton rule' ), - array( 1, 'n mod 10 in 3..4,9 and n mod 100 not in 10..19,70..79,90..99', 25, 'breton rule' ), - - array( 0, 'n within 0..2 and n is not 2', 0, 'french rule' ), - array( 0, 'n within 0..2 and n is not 2', 1, 'french rule' ), - array( 0, 'n within 0..2 and n is not 2', 1.2, 'french rule' ), - array( 1, 'n within 0..2 and n is not 2', 2, 'french rule' ), - - array( 1, 'n in 3..10,13..19', 2, 'scottish rule - ranges with comma' ), - array( 0, 'n in 3..10,13..19', 4, 'scottish rule - ranges with comma' ), - array( 1, 'n in 3..10,13..19', 12.999, 'scottish rule - ranges with comma' ), - array( 0, 'n in 3..10,13..19', 13, 'scottish rule - ranges with comma' ), - - array( 0, '5 mod 3 is n', 2, 'n as result of mod - no need to pass' ), - - # Revision 33 new operand examples - # expected, rule, number, comment - array( 0, 'i is 1', '1.00', 'new operand i' ), - array( 0, 'v is 2', '1.00', 'new operand v' ), - array( 0, 'w is 0', '1.00', 'new operand w' ), - array( 0, 'f is 0', '1.00', 'new operand f' ), - array( 0, 't is 0', '1.00', 'new operand t' ), - - array( 0, 'i is 1', '1.30', 'new operand i' ), - array( 0, 'v is 2', '1.30', 'new operand v' ), - array( 0, 'w is 1', '1.30', 'new operand w' ), - array( 0, 'f is 30', '1.30', 'new operand f' ), - array( 0, 't is 3', '1.30', 'new operand t' ), - - array( 0, 'i is 1', '1.03', 'new operand i' ), - array( 0, 'v is 2', '1.03', 'new operand v' ), - array( 0, 'w is 2', '1.03', 'new operand w' ), - array( 0, 'f is 3', '1.03', 'new operand f' ), - array( 0, 't is 3', '1.03', 'new operand t' ), - - # Revision 33 new operator aliases - # expected, rule, number, comment - array( 0, 'n % 3 is 1', 7, 'new % operator' ), - array( 0, 'n = 1,3,5', 3, 'new = operator' ), - array( 1, 'n != 1,3,5', 5, 'new != operator' ), - - # Revision 33 samples - # expected, rule, number, comment - array( 0, 'n in 1,3,5@integer 3~10, 103~110, 1003, … @decimal 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 103.0, 1003.0, …', 3, 'samples' ), - - # Revision 33 some test cases from CLDR - array( 0, 'i = 1 and v = 0 or i = 0 and t = 1', '0.1', 'pt one' ), - array( 0, 'i = 1 and v = 0 or i = 0 and t = 1', '0.01', 'pt one' ), - array( 0, 'i = 1 and v = 0 or i = 0 and t = 1', '0.10', 'pt one' ), - array( 0, 'i = 1 and v = 0 or i = 0 and t = 1', '0.010', 'pt one' ), - array( 0, 'i = 1 and v = 0 or i = 0 and t = 1', '0.100', 'pt one' ), - array( 1, 'i = 1 and v = 0 or i = 0 and t = 1', '0.0', 'pt other' ), - array( 1, 'i = 1 and v = 0 or i = 0 and t = 1', '0.2', 'pt other' ), - array( 1, 'i = 1 and v = 0 or i = 0 and t = 1', '10.0', 'pt other' ), - array( 1, 'i = 1 and v = 0 or i = 0 and t = 1', '100.0', 'pt other' ), - array( 0, 'v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14', '2', 'bs few' ), - array( 0, 'v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14', '4', 'bs few' ), - array( 0, 'v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14', '22', 'bs few' ), - array( 0, 'v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14', '102', 'bs few' ), - array( 0, 'v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14', '0.2', 'bs few' ), - array( 0, 'v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14', '0.4', 'bs few' ), - array( 0, 'v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14', '10.2', 'bs few' ), - array( 1, 'v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14', '10.0', 'bs other' ), - - ); - - return $tests; - } - - function invalidTestCases() { - $tests = array( - array( 'n mod mod 5 is 1', 'mod mod' ), - array( 'n', 'just n' ), - array( 'n is in 5', 'is in' ), - ); - - return $tests; - } -} diff --git a/tests/phpunit/maintenance/DumpTestCase.php b/tests/phpunit/maintenance/DumpTestCase.php deleted file mode 100644 index 83d8c71d..00000000 --- a/tests/phpunit/maintenance/DumpTestCase.php +++ /dev/null @@ -1,379 +0,0 @@ -<?php - -/** - * Base TestCase for dumps - */ -abstract class DumpTestCase extends MediaWikiLangTestCase { - - /** - * exception to be rethrown once in sound PHPUnit surrounding - * - * As the current MediaWikiTestCase::run is not robust enough to recover - * from thrown exceptions directly, we cannot throw frow within - * self::addDBData, although it would be appropriate. Hence, we catch the - * exception and store it until we are in setUp and may finally rethrow - * the exception without crashing the test suite. - * - * @var Exception|null - */ - protected $exceptionFromAddDBData = null; - - /** - * Holds the xmlreader used for analyzing an xml dump - * - * @var XMLReader|null - */ - protected $xml = null; - - /** - * Adds a revision to a page, while returning the resuting revision's id - * - * @param $page WikiPage: page to add the revision to - * @param $text string: revisions text - * @param $text string: revisions summare - * - * @throws MWExcepion - */ - protected function addRevision( Page $page, $text, $summary ) { - $status = $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), $summary ); - if ( $status->isGood() ) { - $value = $status->getValue(); - $revision = $value['revision']; - $revision_id = $revision->getId(); - $text_id = $revision->getTextId(); - if ( ( $revision_id > 0 ) && ( $text_id > 0 ) ) { - return array( $revision_id, $text_id ); - } - } - throw new MWException( "Could not determine revision id (" . $status->getWikiText() . ")" ); - } - - - /** - * gunzips the given file and stores the result in the original file name - * - * @param $fname string: filename to read the gzipped data from and stored - * the gunzipped data into - */ - protected function gunzip( $fname ) { - $gzipped_contents = file_get_contents( $fname ); - if ( $gzipped_contents === false ) { - $this->fail( "Could not get contents of $fname" ); - } - - $contents = gzdecode( $gzipped_contents ); - - $this->assertEquals( - strlen( $contents ), - file_put_contents( $fname, $contents ), - '# bytes written' - ); - } - - /** - * Default set up function. - * - * Clears $wgUser, and reports errors from addDBData to PHPUnit - */ - protected function setUp() { - parent::setUp(); - - // Check if any Exception is stored for rethrowing from addDBData - // @see self::exceptionFromAddDBData - if ( $this->exceptionFromAddDBData !== null ) { - throw $this->exceptionFromAddDBData; - } - - $this->setMwGlobals( 'wgUser', new User() ); - } - - /** - * Checks for test output consisting only of lines containing ETA announcements - */ - function expectETAOutput() { - // Newer PHPUnits require assertion about the output using PHPUnit's own - // expectOutput[...] functions. However, the PHPUnit shipped prediactes - // do not allow to check /each/ line of the output using /readable/ REs. - // So we ... - // - // 1. ... add a dummy output checking to make PHPUnit not complain - // about unchecked test output - $this->expectOutputRegex( '//' ); - - // 2. Do the real output checking on our own. - $lines = explode( "\n", $this->getActualOutput() ); - $this->assertGreaterThan( 1, count( $lines ), "Minimal lines of produced output" ); - $this->assertEquals( '', array_pop( $lines ), "Output ends in LF" ); - $timestamp_re = "[0-9]{4}-[01][0-9]-[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-6][0-9]"; - foreach ( $lines as $line ) { - $this->assertRegExp( "/$timestamp_re: .* \(ID [0-9]+\) [0-9]* pages .*, [0-9]* revs .*, ETA/", $line ); - } - } - - - /** - * Step the current XML reader until node end of given name is found. - * - * @param $name string: name of the closing element to look for - * (e.g.: "mediawiki" when looking for </mediawiki>) - * - * @return bool: true if the end node could be found. false otherwise. - */ - protected function skipToNodeEnd( $name ) { - while ( $this->xml->read() ) { - if ( $this->xml->nodeType == XMLReader::END_ELEMENT && - $this->xml->name == $name - ) { - return true; - } - } - - return false; - } - - /** - * Step the current XML reader to the first element start after the node - * end of a given name. - * - * @param $name string: name of the closing element to look for - * (e.g.: "mediawiki" when looking for </mediawiki>) - * - * @return bool: true iff new element after the closing of $name could be - * found. false otherwise. - */ - protected function skipPastNodeEnd( $name ) { - $this->assertTrue( $this->skipToNodeEnd( $name ), - "Skipping to end of $name" ); - while ( $this->xml->read() ) { - if ( $this->xml->nodeType == XMLReader::ELEMENT ) { - return true; - } - } - - return false; - } - - /** - * Opens an XML file to analyze and optionally skips past siteinfo. - * - * @param $fname string: name of file to analyze - * @param $skip_siteinfo bool: (optional) If true, step the xml reader - * to the first element after </siteinfo> - */ - protected function assertDumpStart( $fname, $skip_siteinfo = true ) { - $this->xml = new XMLReader(); - $this->assertTrue( $this->xml->open( $fname ), - "Opening temporary file $fname via XMLReader failed" ); - if ( $skip_siteinfo ) { - $this->assertTrue( $this->skipPastNodeEnd( "siteinfo" ), - "Skipping past end of siteinfo" ); - } - } - - /** - * Asserts that the xml reader is at the final closing tag of an xml file and - * closes the reader. - * - * @param $tag string: (optional) the name of the final tag - * (e.g.: "mediawiki" for </mediawiki>) - */ - protected function assertDumpEnd( $name = "mediawiki" ) { - $this->assertNodeEnd( $name, false ); - if ( $this->xml->read() ) { - $this->skipWhitespace(); - } - $this->assertEquals( $this->xml->nodeType, XMLReader::NONE, - "No proper entity left to parse" ); - $this->xml->close(); - } - - /** - * Steps the xml reader over white space - */ - protected function skipWhitespace() { - $cont = true; - while ( $cont && ( ( $this->xml->nodeType == XMLReader::WHITESPACE ) - || ( $this->xml->nodeType == XMLReader::SIGNIFICANT_WHITESPACE ) ) ) { - $cont = $this->xml->read(); - } - } - - /** - * Asserts that the xml reader is at an element of given name, and optionally - * skips past it. - * - * @param $name string: the name of the element to check for - * (e.g.: "mediawiki" for <mediawiki>) - * @param $skip bool: (optional) if true, skip past the found element - */ - protected function assertNodeStart( $name, $skip = true ) { - $this->assertEquals( $name, $this->xml->name, "Node name" ); - $this->assertEquals( XMLReader::ELEMENT, $this->xml->nodeType, "Node type" ); - if ( $skip ) { - $this->assertTrue( $this->xml->read(), "Skipping past start tag" ); - } - } - - /** - * Asserts that the xml reader is at an closing element of given name, and optionally - * skips past it. - * - * @param $name string: the name of the closing element to check for - * (e.g.: "mediawiki" for </mediawiki>) - * @param $skip bool: (optional) if true, skip past the found element - */ - protected function assertNodeEnd( $name, $skip = true ) { - $this->assertEquals( $name, $this->xml->name, "Node name" ); - $this->assertEquals( XMLReader::END_ELEMENT, $this->xml->nodeType, "Node type" ); - if ( $skip ) { - $this->assertTrue( $this->xml->read(), "Skipping past end tag" ); - } - } - - - /** - * Asserts that the xml reader is at an element of given tag that contains a given text, - * and skips over the element. - * - * @param $name string: the name of the element to check for - * (e.g.: "mediawiki" for <mediawiki>...</mediawiki>) - * @param $text string|false: If string, check if it equals the elements text. - * If false, ignore the element's text - * @param $skip_ws bool: (optional) if true, skip past white spaces that trail the - * closing element. - */ - protected function assertTextNode( $name, $text, $skip_ws = true ) { - $this->assertNodeStart( $name ); - - if ( $text !== false ) { - $this->assertEquals( $text, $this->xml->value, "Text of node " . $name ); - } - $this->assertTrue( $this->xml->read(), "Skipping past processed text of " . $name ); - $this->assertNodeEnd( $name ); - - if ( $skip_ws ) { - $this->skipWhitespace(); - } - } - - /** - * Asserts that the xml reader is at the start of a page element and skips over the first - * tags, after checking them. - * - * Besides the opening page element, this function also checks for and skips over the - * title, ns, and id tags. Hence after this function, the xml reader is at the first - * revision of the current page. - * - * @param $id int: id of the page to assert - * @param $ns int: number of namespage to assert - * @param $name string: title of the current page - */ - protected function assertPageStart( $id, $ns, $name ) { - - $this->assertNodeStart( "page" ); - $this->skipWhitespace(); - - $this->assertTextNode( "title", $name ); - $this->assertTextNode( "ns", $ns ); - $this->assertTextNode( "id", $id ); - } - - /** - * Asserts that the xml reader is at the page's closing element and skips to the next - * element. - */ - protected function assertPageEnd() { - $this->assertNodeEnd( "page" ); - $this->skipWhitespace(); - } - - /** - * Asserts that the xml reader is at a revision and checks its representation before - * skipping over it. - * - * @param $id int: id of the revision - * @param $summary string: summary of the revision - * @param $text_id int: id of the revision's text - * @param $text_bytes int: # of bytes in the revision's text - * @param $text_sha1 string: the base36 SHA-1 of the revision's text - * @param $text string|false: (optional) The revision's string, or false to check for a - * revision stub - * @param $model String: the expected content model id (default: CONTENT_MODEL_WIKITEXT) - * @param $format String: the expected format model id (default: CONTENT_FORMAT_WIKITEXT) - * @param $parentid int|false: (optional) id of the parent revision - */ - protected function assertRevision( $id, $summary, $text_id, $text_bytes, $text_sha1, $text = false, $parentid = false, - $model = CONTENT_MODEL_WIKITEXT, $format = CONTENT_FORMAT_WIKITEXT - ) { - $this->assertNodeStart( "revision" ); - $this->skipWhitespace(); - - $this->assertTextNode( "id", $id ); - if ( $parentid !== false ) { - $this->assertTextNode( "parentid", $parentid ); - } - $this->assertTextNode( "timestamp", false ); - - $this->assertNodeStart( "contributor" ); - $this->skipWhitespace(); - $this->assertTextNode( "ip", false ); - $this->assertNodeEnd( "contributor" ); - $this->skipWhitespace(); - - $this->assertTextNode( "comment", $summary ); - $this->skipWhitespace(); - - if ( $this->xml->name == "text" ) { - // note: <text> tag may occur here or at the very end. - $text_found = true; - $this->assertText( $id, $text_id, $text_bytes, $text ); - } else { - $text_found = false; - } - - $this->assertTextNode( "sha1", $text_sha1 ); - - $this->assertTextNode( "model", $model ); - $this->skipWhitespace(); - - $this->assertTextNode( "format", $format ); - $this->skipWhitespace(); - - if ( !$text_found ) { - $this->assertText( $id, $text_id, $text_bytes, $text ); - } - - $this->assertNodeEnd( "revision" ); - $this->skipWhitespace(); - } - - protected function assertText( $id, $text_id, $text_bytes, $text ) { - $this->assertNodeStart( "text", false ); - if ( $text_bytes !== false ) { - $this->assertEquals( $this->xml->getAttribute( "bytes" ), $text_bytes, - "Attribute 'bytes' of revision " . $id ); - } - - if ( $text === false ) { - // Testing for a stub - $this->assertEquals( $this->xml->getAttribute( "id" ), $text_id, - "Text id of revision " . $id ); - $this->assertFalse( $this->xml->hasValue, "Revision has text" ); - $this->assertTrue( $this->xml->read(), "Skipping text start tag" ); - if ( ( $this->xml->nodeType == XMLReader::END_ELEMENT ) - && ( $this->xml->name == "text" ) - ) { - - $this->xml->read(); - } - $this->skipWhitespace(); - } else { - // Testing for a real dump - $this->assertTrue( $this->xml->read(), "Skipping text start tag" ); - $this->assertEquals( $text, $this->xml->value, "Text of revision " . $id ); - $this->assertTrue( $this->xml->read(), "Skipping past text" ); - $this->assertNodeEnd( "text" ); - $this->skipWhitespace(); - } - } -} diff --git a/tests/phpunit/maintenance/MaintenanceTest.php b/tests/phpunit/maintenance/MaintenanceTest.php deleted file mode 100644 index 318ce0da..00000000 --- a/tests/phpunit/maintenance/MaintenanceTest.php +++ /dev/null @@ -1,816 +0,0 @@ -<?php - -// It would be great if we were able to use PHPUnit's getMockForAbstractClass -// instead of the MaintenanceFixup hack below. However, we cannot do -// without changing the visibility and without working around hacks in -// Maintenance.php -// -// For the same reason, we cannot just use FakeMaintenance. - -/** - * makes parts of the API of Maintenance that is hidden by protected visibily - * visible for testing, and makes up for a stream closing hack in Maintenance.php. - * - * This class is solely used for being able to test Maintenance right now - * without having to apply major refactorings to fix some design issues in - * Maintenance.php. Before adding more functions here, please consider whether - * this approach is correct, or a refactoring Maintenance to separate concers - * is more appropriate. - * - * Upon refactoring, keep in mind that besides the maintenance scrits themselves - * and tests right here, also at least Extension:Maintenance make use of - * Maintenance. - * - * Due to a hack in Maintenance.php using register_shutdown_function, be sure to - * finally call simulateShutdown on MaintenanceFixup instance before a test - * ends. - * - */ -class MaintenanceFixup extends Maintenance { - - // --- Making up for the register_shutdown_function hack in Maintenance.php - - /** - * The test case that generated this instance. - * - * This member is motivated by allowing the destructor to check whether or not - * the test failed, in order to avoid unnecessary nags about omitted shutdown - * simulation. - * But as it is already available, we also usi it to flagging tests as failed - * - * @var MediaWikiTestCase - */ - private $testCase; - - /** - * shutdownSimulated === true if simulateShutdown has done it's work - * - * @var bool - */ - private $shutdownSimulated = false; - - /** - * Simulates what Maintenance wants to happen at script's end. - */ - public function simulateShutdown() { - - if ( $this->shutdownSimulated ) { - $this->testCase->fail( __METHOD__ . " called more than once" ); - } - - // The cleanup action. - $this->outputChanneled( false ); - - // Bookkeeping that we simulated the clean up. - $this->shutdownSimulated = true; - } - - // Note that the "public" here does not change visibility - public function outputChanneled( $msg, $channel = null ) { - if ( $this->shutdownSimulated ) { - if ( $msg !== false ) { - $this->testCase->fail( "Already past simulated shutdown, but msg is " - . "not false. Did the hack in Maintenance.php change? Please " - . "adapt the test case or Maintenance.php" ); - } - - // The current call is the one registered via register_shutdown_function. - // We can safely ignore it, as we simulated this one via simulateShutdown - // before (if we did not, the destructor of this instance will warn about - // it) - return; - } - - return call_user_func_array( array( "parent", __FUNCTION__ ), func_get_args() ); - } - - /** - * Safety net around register_shutdown_function of Maintenance.php - */ - public function __destruct() { - if ( !$this->shutdownSimulated ) { - // Someone generated a MaintenanceFixup instance without calling - // simulateShutdown. We'd have to raise a PHPUnit exception to correctly - // flag this illegal usage. However, we are already in a destruktor, which - // would trigger undefined behavior. Hence, we can only report to the - // error output :( Hopefully people read the PHPUnit output. - $name = $this->testCase->getName(); - fwrite( STDERR, "ERROR! Instance of " . __CLASS__ . " for test $name " - . "destructed without calling simulateShutdown method. Call " - . "simulateShutdown on the instance before it gets destructed." ); - } - - // The following guard is required, as PHP does not offer default destructors :( - if ( is_callable( "parent::__destruct" ) ) { - parent::__destruct(); - } - } - - public function __construct( MediaWikiTestCase $testCase ) { - parent::__construct(); - $this->testCase = $testCase; - } - - - // --- Making protected functions visible for test - - public function output( $out, $channel = null ) { - // Just to make PHP not nag about signature mismatches, we copied - // Maintenance::output signature. However, we do not use (or rely on) - // those variables. Instead we pass to Maintenance::output whatever we - // receive at runtime. - return call_user_func_array( array( "parent", __FUNCTION__ ), func_get_args() ); - } - - - // --- Requirements for getting instance of abstract class - - public function execute() { - $this->testCase->fail( __METHOD__ . " called unexpectedly" ); - } -} - -class MaintenanceTest extends MediaWikiTestCase { - - - /** - * The main Maintenance instance that is used for testing. - * - * @var MaintenanceFixup - */ - private $m; - - - protected function setUp() { - parent::setUp(); - $this->m = new MaintenanceFixup( $this ); - } - - protected function tearDown() { - if ( $this->m ) { - $this->m->simulateShutdown(); - $this->m = null; - } - parent::tearDown(); - } - - - /** - * asserts the output before and after simulating shutdown - * - * This function simulates shutdown of self::m. - * - * @param $preShutdownOutput string: expected output before simulating shutdown - * @param $expectNLAppending bool: Whether or not shutdown simulation is expected - * to add a newline to the output. If false, $preShutdownOutput is the - * expected output after shutdown simulation. Otherwise, - * $preShutdownOutput with an appended newline is the expected output - * after shutdown simulation. - */ - private function assertOutputPrePostShutdown( $preShutdownOutput, $expectNLAppending ) { - - $this->assertEquals( $preShutdownOutput, $this->getActualOutput(), - "Output before shutdown simulation" ); - - $this->m->simulateShutdown(); - $this->m = null; - - $postShutdownOutput = $preShutdownOutput . ( $expectNLAppending ? "\n" : "" ); - $this->expectOutputString( $postShutdownOutput ); - } - - - // Although the following tests do not seem to be too consistent (compare for - // example the newlines within the test.*StringString tests, or the - // test.*Intermittent.* tests), the objective of these tests is not to describe - // consistent behavior, but rather currently existing behavior. - - function testOutputEmpty() { - $this->m->output( "" ); - $this->assertOutputPrePostShutdown( "", false ); - } - - function testOutputString() { - $this->m->output( "foo" ); - $this->assertOutputPrePostShutdown( "foo", false ); - } - - function testOutputStringString() { - $this->m->output( "foo" ); - $this->m->output( "bar" ); - $this->assertOutputPrePostShutdown( "foobar", false ); - } - - function testOutputStringNL() { - $this->m->output( "foo\n" ); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testOutputStringNLNL() { - $this->m->output( "foo\n\n" ); - $this->assertOutputPrePostShutdown( "foo\n\n", false ); - } - - function testOutputStringNLString() { - $this->m->output( "foo\nbar" ); - $this->assertOutputPrePostShutdown( "foo\nbar", false ); - } - - function testOutputStringNLStringNL() { - $this->m->output( "foo\nbar\n" ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputStringNLStringNLLinewise() { - $this->m->output( "foo\n" ); - $this->m->output( "bar\n" ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputStringNLStringNLArbitrary() { - $this->m->output( "" ); - $this->m->output( "foo" ); - $this->m->output( "" ); - $this->m->output( "\n" ); - $this->m->output( "ba" ); - $this->m->output( "" ); - $this->m->output( "r\n" ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputStringNLStringNLArbitraryAgain() { - $this->m->output( "" ); - $this->m->output( "foo" ); - $this->m->output( "" ); - $this->m->output( "\nb" ); - $this->m->output( "a" ); - $this->m->output( "" ); - $this->m->output( "r\n" ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputWNullChannelEmpty() { - $this->m->output( "", null ); - $this->assertOutputPrePostShutdown( "", false ); - } - - function testOutputWNullChannelString() { - $this->m->output( "foo", null ); - $this->assertOutputPrePostShutdown( "foo", false ); - } - - function testOutputWNullChannelStringString() { - $this->m->output( "foo", null ); - $this->m->output( "bar", null ); - $this->assertOutputPrePostShutdown( "foobar", false ); - } - - function testOutputWNullChannelStringNL() { - $this->m->output( "foo\n", null ); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testOutputWNullChannelStringNLNL() { - $this->m->output( "foo\n\n", null ); - $this->assertOutputPrePostShutdown( "foo\n\n", false ); - } - - function testOutputWNullChannelStringNLString() { - $this->m->output( "foo\nbar", null ); - $this->assertOutputPrePostShutdown( "foo\nbar", false ); - } - - function testOutputWNullChannelStringNLStringNL() { - $this->m->output( "foo\nbar\n", null ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputWNullChannelStringNLStringNLLinewise() { - $this->m->output( "foo\n", null ); - $this->m->output( "bar\n", null ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputWNullChannelStringNLStringNLArbitrary() { - $this->m->output( "", null ); - $this->m->output( "foo", null ); - $this->m->output( "", null ); - $this->m->output( "\n", null ); - $this->m->output( "ba", null ); - $this->m->output( "", null ); - $this->m->output( "r\n", null ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputWNullChannelStringNLStringNLArbitraryAgain() { - $this->m->output( "", null ); - $this->m->output( "foo", null ); - $this->m->output( "", null ); - $this->m->output( "\nb", null ); - $this->m->output( "a", null ); - $this->m->output( "", null ); - $this->m->output( "r\n", null ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputWChannelString() { - $this->m->output( "foo", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo", true ); - } - - function testOutputWChannelStringNL() { - $this->m->output( "foo\n", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo", true ); - } - - function testOutputWChannelStringNLNL() { - // If this test fails, note that output takes strings with double line - // endings (although output's implementation in this situation calls - // outputChanneled with a string ending in a nl ... which is not allowed - // according to the documentation of outputChanneled) - $this->m->output( "foo\n\n", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\n", true ); - } - - function testOutputWChannelStringNLString() { - $this->m->output( "foo\nbar", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar", true ); - } - - function testOutputWChannelStringNLStringNL() { - $this->m->output( "foo\nbar\n", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar", true ); - } - - function testOutputWChannelStringNLStringNLLinewise() { - $this->m->output( "foo\n", "bazChannel" ); - $this->m->output( "bar\n", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar", true ); - } - - function testOutputWChannelStringNLStringNLArbitrary() { - $this->m->output( "", "bazChannel" ); - $this->m->output( "foo", "bazChannel" ); - $this->m->output( "", "bazChannel" ); - $this->m->output( "\n", "bazChannel" ); - $this->m->output( "ba", "bazChannel" ); - $this->m->output( "", "bazChannel" ); - $this->m->output( "r\n", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar", true ); - } - - function testOutputWChannelStringNLStringNLArbitraryAgain() { - $this->m->output( "", "bazChannel" ); - $this->m->output( "foo", "bazChannel" ); - $this->m->output( "", "bazChannel" ); - $this->m->output( "\nb", "bazChannel" ); - $this->m->output( "a", "bazChannel" ); - $this->m->output( "", "bazChannel" ); - $this->m->output( "r\n", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar", true ); - } - - function testOutputWMultipleChannelsChannelChange() { - $this->m->output( "foo", "bazChannel" ); - $this->m->output( "bar", "bazChannel" ); - $this->m->output( "qux", "quuxChannel" ); - $this->m->output( "corge", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar\nqux\ncorge", true ); - } - - function testOutputWMultipleChannelsChannelChangeNL() { - $this->m->output( "foo", "bazChannel" ); - $this->m->output( "bar\n", "bazChannel" ); - $this->m->output( "qux\n", "quuxChannel" ); - $this->m->output( "corge", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar\nqux\ncorge", true ); - } - - function testOutputWAndWOChannelStringStartWO() { - $this->m->output( "foo" ); - $this->m->output( "bar", "bazChannel" ); - $this->m->output( "qux" ); - $this->m->output( "quux", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar\nquxquux", true ); - } - - function testOutputWAndWOChannelStringStartW() { - $this->m->output( "foo", "bazChannel" ); - $this->m->output( "bar" ); - $this->m->output( "qux", "bazChannel" ); - $this->m->output( "quux" ); - $this->assertOutputPrePostShutdown( "foo\nbarqux\nquux", false ); - } - - function testOutputWChannelTypeSwitch() { - $this->m->output( "foo", 1 ); - $this->m->output( "bar", 1.0 ); - $this->assertOutputPrePostShutdown( "foo\nbar", true ); - } - - function testOutputIntermittentEmpty() { - $this->m->output( "foo" ); - $this->m->output( "" ); - $this->m->output( "bar" ); - $this->assertOutputPrePostShutdown( "foobar", false ); - } - - function testOutputIntermittentFalse() { - $this->m->output( "foo" ); - $this->m->output( false ); - $this->m->output( "bar" ); - $this->assertOutputPrePostShutdown( "foobar", false ); - } - - function testOutputIntermittentFalseAfterOtherChannel() { - $this->m->output( "qux", "quuxChannel" ); - $this->m->output( "foo" ); - $this->m->output( false ); - $this->m->output( "bar" ); - $this->assertOutputPrePostShutdown( "qux\nfoobar", false ); - } - - function testOutputWNullChannelIntermittentEmpty() { - $this->m->output( "foo", null ); - $this->m->output( "", null ); - $this->m->output( "bar", null ); - $this->assertOutputPrePostShutdown( "foobar", false ); - } - - function testOutputWNullChannelIntermittentFalse() { - $this->m->output( "foo", null ); - $this->m->output( false, null ); - $this->m->output( "bar", null ); - $this->assertOutputPrePostShutdown( "foobar", false ); - } - - function testOutputWChannelIntermittentEmpty() { - $this->m->output( "foo", "bazChannel" ); - $this->m->output( "", "bazChannel" ); - $this->m->output( "bar", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar", true ); - } - - function testOutputWChannelIntermittentFalse() { - $this->m->output( "foo", "bazChannel" ); - $this->m->output( false, "bazChannel" ); - $this->m->output( "bar", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar", true ); - } - - // Note that (per documentation) outputChanneled does take strings that end - // in \n, hence we do not test such strings. - - function testOutputChanneledEmpty() { - $this->m->outputChanneled( "" ); - $this->assertOutputPrePostShutdown( "\n", false ); - } - - function testOutputChanneledString() { - $this->m->outputChanneled( "foo" ); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testOutputChanneledStringString() { - $this->m->outputChanneled( "foo" ); - $this->m->outputChanneled( "bar" ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputChanneledStringNLString() { - $this->m->outputChanneled( "foo\nbar" ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputChanneledStringNLStringNLArbitraryAgain() { - $this->m->outputChanneled( "" ); - $this->m->outputChanneled( "foo" ); - $this->m->outputChanneled( "" ); - $this->m->outputChanneled( "\nb" ); - $this->m->outputChanneled( "a" ); - $this->m->outputChanneled( "" ); - $this->m->outputChanneled( "r" ); - $this->assertOutputPrePostShutdown( "\nfoo\n\n\nb\na\n\nr\n", false ); - } - - function testOutputChanneledWNullChannelEmpty() { - $this->m->outputChanneled( "", null ); - $this->assertOutputPrePostShutdown( "\n", false ); - } - - function testOutputChanneledWNullChannelString() { - $this->m->outputChanneled( "foo", null ); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testOutputChanneledWNullChannelStringString() { - $this->m->outputChanneled( "foo", null ); - $this->m->outputChanneled( "bar", null ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputChanneledWNullChannelStringNLString() { - $this->m->outputChanneled( "foo\nbar", null ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputChanneledWNullChannelStringNLStringNLArbitraryAgain() { - $this->m->outputChanneled( "", null ); - $this->m->outputChanneled( "foo", null ); - $this->m->outputChanneled( "", null ); - $this->m->outputChanneled( "\nb", null ); - $this->m->outputChanneled( "a", null ); - $this->m->outputChanneled( "", null ); - $this->m->outputChanneled( "r", null ); - $this->assertOutputPrePostShutdown( "\nfoo\n\n\nb\na\n\nr\n", false ); - } - - function testOutputChanneledWChannelString() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo", true ); - } - - function testOutputChanneledWChannelStringNLString() { - $this->m->outputChanneled( "foo\nbar", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar", true ); - } - - function testOutputChanneledWChannelStringString() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->outputChanneled( "bar", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar", true ); - } - - function testOutputChanneledWChannelStringNLStringNLArbitraryAgain() { - $this->m->outputChanneled( "", "bazChannel" ); - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->outputChanneled( "", "bazChannel" ); - $this->m->outputChanneled( "\nb", "bazChannel" ); - $this->m->outputChanneled( "a", "bazChannel" ); - $this->m->outputChanneled( "", "bazChannel" ); - $this->m->outputChanneled( "r", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar", true ); - } - - function testOutputChanneledWMultipleChannelsChannelChange() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->outputChanneled( "bar", "bazChannel" ); - $this->m->outputChanneled( "qux", "quuxChannel" ); - $this->m->outputChanneled( "corge", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar\nqux\ncorge", true ); - } - - function testOutputChanneledWMultipleChannelsChannelChangeEnclosedNull() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->outputChanneled( "bar", null ); - $this->m->outputChanneled( "qux", null ); - $this->m->outputChanneled( "corge", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar\nqux\ncorge", true ); - } - - function testOutputChanneledWMultipleChannelsChannelAfterNullChange() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->outputChanneled( "bar", null ); - $this->m->outputChanneled( "qux", null ); - $this->m->outputChanneled( "corge", "quuxChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar\nqux\ncorge", true ); - } - - function testOutputChanneledWAndWOChannelStringStartWO() { - $this->m->outputChanneled( "foo" ); - $this->m->outputChanneled( "bar", "bazChannel" ); - $this->m->outputChanneled( "qux" ); - $this->m->outputChanneled( "quux", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar\nqux\nquux", true ); - } - - function testOutputChanneledWAndWOChannelStringStartW() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->outputChanneled( "bar" ); - $this->m->outputChanneled( "qux", "bazChannel" ); - $this->m->outputChanneled( "quux" ); - $this->assertOutputPrePostShutdown( "foo\nbar\nqux\nquux\n", false ); - } - - function testOutputChanneledWChannelTypeSwitch() { - $this->m->outputChanneled( "foo", 1 ); - $this->m->outputChanneled( "bar", 1.0 ); - $this->assertOutputPrePostShutdown( "foo\nbar", true ); - } - - function testOutputChanneledWOChannelIntermittentEmpty() { - $this->m->outputChanneled( "foo" ); - $this->m->outputChanneled( "" ); - $this->m->outputChanneled( "bar" ); - $this->assertOutputPrePostShutdown( "foo\n\nbar\n", false ); - } - - function testOutputChanneledWOChannelIntermittentFalse() { - $this->m->outputChanneled( "foo" ); - $this->m->outputChanneled( false ); - $this->m->outputChanneled( "bar" ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputChanneledWNullChannelIntermittentEmpty() { - $this->m->outputChanneled( "foo", null ); - $this->m->outputChanneled( "", null ); - $this->m->outputChanneled( "bar", null ); - $this->assertOutputPrePostShutdown( "foo\n\nbar\n", false ); - } - - function testOutputChanneledWNullChannelIntermittentFalse() { - $this->m->outputChanneled( "foo", null ); - $this->m->outputChanneled( false, null ); - $this->m->outputChanneled( "bar", null ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputChanneledWChannelIntermittentEmpty() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->outputChanneled( "", "bazChannel" ); - $this->m->outputChanneled( "bar", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar", true ); - } - - function testOutputChanneledWChannelIntermittentFalse() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->outputChanneled( false, "bazChannel" ); - $this->m->outputChanneled( "bar", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar", true ); - } - - function testCleanupChanneledClean() { - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "", false ); - } - - function testCleanupChanneledAfterOutput() { - $this->m->output( "foo" ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo", false ); - } - - function testCleanupChanneledAfterOutputWNullChannel() { - $this->m->output( "foo", null ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo", false ); - } - - function testCleanupChanneledAfterOutputWChannel() { - $this->m->output( "foo", "bazChannel" ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testCleanupChanneledAfterNLOutput() { - $this->m->output( "foo\n" ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testCleanupChanneledAfterNLOutputWNullChannel() { - $this->m->output( "foo\n", null ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testCleanupChanneledAfterNLOutputWChannel() { - $this->m->output( "foo\n", "bazChannel" ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testCleanupChanneledAfterOutputChanneledWOChannel() { - $this->m->outputChanneled( "foo" ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testCleanupChanneledAfterOutputChanneledWNullChannel() { - $this->m->outputChanneled( "foo", null ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testCleanupChanneledAfterOutputChanneledWChannel() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testMultipleMaintenanceObjectsInteractionOutput() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->output( "foo" ); - $m2->output( "bar" ); - - $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foobar", false ); - } - - function testMultipleMaintenanceObjectsInteractionOutputWNullChannel() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->output( "foo", null ); - $m2->output( "bar", null ); - - $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foobar", false ); - } - - function testMultipleMaintenanceObjectsInteractionOutputWChannel() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->output( "foo", "bazChannel" ); - $m2->output( "bar", "bazChannel" ); - - $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foobar\n", true ); - } - - function testMultipleMaintenanceObjectsInteractionOutputWNullChannelNL() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->output( "foo\n", null ); - $m2->output( "bar\n", null ); - - $this->assertEquals( "foo\nbar\n", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testMultipleMaintenanceObjectsInteractionOutputWChannelNL() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->output( "foo\n", "bazChannel" ); - $m2->output( "bar\n", "bazChannel" ); - - $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foobar\n", true ); - } - - function testMultipleMaintenanceObjectsInteractionOutputChanneled() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->outputChanneled( "foo" ); - $m2->outputChanneled( "bar" ); - - $this->assertEquals( "foo\nbar\n", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testMultipleMaintenanceObjectsInteractionOutputChanneledWNullChannel() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->outputChanneled( "foo", null ); - $m2->outputChanneled( "bar", null ); - - $this->assertEquals( "foo\nbar\n", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testMultipleMaintenanceObjectsInteractionOutputChanneledWChannel() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->outputChanneled( "foo", "bazChannel" ); - $m2->outputChanneled( "bar", "bazChannel" ); - - $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foobar\n", true ); - } - - function testMultipleMaintenanceObjectsInteractionCleanupChanneledWChannel() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->outputChanneled( "foo", "bazChannel" ); - $m2->outputChanneled( "bar", "bazChannel" ); - - $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before first cleanup" ); - $this->m->cleanupChanneled(); - $this->assertEquals( "foobar\n", $this->getActualOutput(), - "Output after first cleanup" ); - $m2->cleanupChanneled(); - $this->assertEquals( "foobar\n\n", $this->getActualOutput(), - "Output after second cleanup" ); - - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foobar\n\n", false ); - } -} diff --git a/tests/phpunit/maintenance/backupPrefetchTest.php b/tests/phpunit/maintenance/backupPrefetchTest.php deleted file mode 100644 index bc2d7375..00000000 --- a/tests/phpunit/maintenance/backupPrefetchTest.php +++ /dev/null @@ -1,275 +0,0 @@ -<?php - -require_once __DIR__ . "/../../../maintenance/backupPrefetch.inc"; - -/** - * Tests for BaseDump - * - * @group Dump - */ -class BaseDumpTest extends MediaWikiTestCase { - - /** - * @var BaseDump the BaseDump instance used within a test. - * - * If set, this BaseDump gets automatically closed in tearDown. - */ - private $dump = null; - - protected function tearDown() { - if ( $this->dump !== null ) { - $this->dump->close(); - } - - // Bug 37458, parent teardown need to be done after closing the - // dump or it might cause some permissions errors. - parent::tearDown(); - } - - /** - * asserts that a prefetch yields an expected string - * - * @param $expected string|null: the exepcted result of the prefetch - * @param $page int: the page number to prefetch the text for - * @param $revision int: the revision number to prefetch the text for - */ - private function assertPrefetchEquals( $expected, $page, $revision ) { - $this->assertEquals( $expected, $this->dump->prefetch( $page, $revision ), - "Prefetch of page $page revision $revision" ); - } - - function testSequential() { - $fname = $this->setUpPrefetch(); - $this->dump = new BaseDump( $fname ); - - $this->assertPrefetchEquals( "BackupDumperTestP1Text1", 1, 1 ); - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - $this->assertPrefetchEquals( "BackupDumperTestP2Text4 some additional Text", 2, 5 ); - $this->assertPrefetchEquals( "Talk about BackupDumperTestP1 Text1", 4, 8 ); - } - - function testSynchronizeRevisionMissToRevision() { - $fname = $this->setUpPrefetch(); - $this->dump = new BaseDump( $fname ); - - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - $this->assertPrefetchEquals( null, 2, 3 ); - $this->assertPrefetchEquals( "BackupDumperTestP2Text4 some additional Text", 2, 5 ); - } - - function testSynchronizeRevisionMissToPage() { - $fname = $this->setUpPrefetch(); - $this->dump = new BaseDump( $fname ); - - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - $this->assertPrefetchEquals( null, 2, 40 ); - $this->assertPrefetchEquals( "Talk about BackupDumperTestP1 Text1", 4, 8 ); - } - - function testSynchronizePageMiss() { - $fname = $this->setUpPrefetch(); - $this->dump = new BaseDump( $fname ); - - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - $this->assertPrefetchEquals( null, 3, 40 ); - $this->assertPrefetchEquals( "Talk about BackupDumperTestP1 Text1", 4, 8 ); - } - - function testPageMissAtEnd() { - $fname = $this->setUpPrefetch(); - $this->dump = new BaseDump( $fname ); - - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - $this->assertPrefetchEquals( null, 6, 40 ); - } - - function testRevisionMissAtEnd() { - $fname = $this->setUpPrefetch(); - $this->dump = new BaseDump( $fname ); - - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - $this->assertPrefetchEquals( null, 4, 40 ); - } - - function testSynchronizePageMissAtStart() { - $fname = $this->setUpPrefetch(); - $this->dump = new BaseDump( $fname ); - - $this->assertPrefetchEquals( null, 0, 2 ); - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - } - - function testSynchronizeRevisionMissAtStart() { - $fname = $this->setUpPrefetch(); - $this->dump = new BaseDump( $fname ); - - $this->assertPrefetchEquals( null, 1, -2 ); - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - } - - function testSequentialAcrossFiles() { - $fname1 = $this->setUpPrefetch( array( 1 ) ); - $fname2 = $this->setUpPrefetch( array( 2, 4 ) ); - $this->dump = new BaseDump( $fname1 . ";" . $fname2 ); - - $this->assertPrefetchEquals( "BackupDumperTestP1Text1", 1, 1 ); - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - $this->assertPrefetchEquals( "BackupDumperTestP2Text4 some additional Text", 2, 5 ); - $this->assertPrefetchEquals( "Talk about BackupDumperTestP1 Text1", 4, 8 ); - } - - function testSynchronizeSkipAcrossFile() { - $fname1 = $this->setUpPrefetch( array( 1 ) ); - $fname2 = $this->setUpPrefetch( array( 2 ) ); - $fname3 = $this->setUpPrefetch( array( 4 ) ); - $this->dump = new BaseDump( $fname1 . ";" . $fname2 . ";" . $fname3 ); - - $this->assertPrefetchEquals( "BackupDumperTestP1Text1", 1, 1 ); - $this->assertPrefetchEquals( "Talk about BackupDumperTestP1 Text1", 4, 8 ); - } - - function testSynchronizeMissInWholeFirstFile() { - $fname1 = $this->setUpPrefetch( array( 1 ) ); - $fname2 = $this->setUpPrefetch( array( 2 ) ); - $this->dump = new BaseDump( $fname1 . ";" . $fname2 ); - - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - } - - - /** - * Constructs a temporary file that can be used for prefetching - * - * The temporary file is removed by DumpBackup upon tearDown. - * - * @param $requested_pages Array The indices of the page parts that should - * go into the prefetch file. 1,2,4 are available. - * @return String The file name of the created temporary file - */ - private function setUpPrefetch( $requested_pages = array( 1, 2, 4 ) ) { - // The file name, where we store the prepared prefetch file - $fname = $this->getNewTempFile(); - - // The header of every prefetch file - $header = '<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.7/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.7/ http://www.mediawiki.org/xml/export-0.7.xsd" version="0.7" xml:lang="en"> - <siteinfo> - <sitename>wikisvn</sitename> - <base>http://localhost/wiki-svn/index.php/Main_Page</base> - <generator>MediaWiki 1.21alpha</generator> - <case>first-letter</case> - <namespaces> - <namespace key="-2" case="first-letter">Media</namespace> - <namespace key="-1" case="first-letter">Special</namespace> - <namespace key="0" case="first-letter" /> - <namespace key="1" case="first-letter">Talk</namespace> - <namespace key="2" case="first-letter">User</namespace> - <namespace key="3" case="first-letter">User talk</namespace> - <namespace key="4" case="first-letter">Wikisvn</namespace> - <namespace key="5" case="first-letter">Wikisvn talk</namespace> - <namespace key="6" case="first-letter">File</namespace> - <namespace key="7" case="first-letter">File talk</namespace> - <namespace key="8" case="first-letter">MediaWiki</namespace> - <namespace key="9" case="first-letter">MediaWiki talk</namespace> - <namespace key="10" case="first-letter">Template</namespace> - <namespace key="11" case="first-letter">Template talk</namespace> - <namespace key="12" case="first-letter">Help</namespace> - <namespace key="13" case="first-letter">Help talk</namespace> - <namespace key="14" case="first-letter">Category</namespace> - <namespace key="15" case="first-letter">Category talk</namespace> - </namespaces> - </siteinfo> -'; - - // An array holding the pages that are available for prefetch - $available_pages = array(); - - // Simple plain page - $available_pages[1] = ' <page> - <title>BackupDumperTestP1 - 0 - 1 - - 1 - 2012-04-01T16:46:05Z - - 127.0.0.1 - - BackupDumperTestP1Summary1 - 0bolhl6ol7i6x0e7yq91gxgaan39j87 - BackupDumperTestP1Text1 - 1 - 1 - - -'; - // Page with more than one revisions. Hole in rev ids. - $available_pages[2] = ' - BackupDumperTestP2 - 0 - 2 - - 2 - 2012-04-01T16:46:05Z - - 127.0.0.1 - - BackupDumperTestP2Summary1 - jprywrymfhysqllua29tj3sc7z39dl2 - BackupDumperTestP2Text1 - 1 - 1 - - - 5 - 2 - 2012-04-01T16:46:05Z - - 127.0.0.1 - - BackupDumperTestP2Summary4 extra - 6o1ciaxa6pybnqprmungwofc4lv00wv - BackupDumperTestP2Text4 some additional Text - 1 - 1 - - -'; - // Page with id higher than previous id + 1 - $available_pages[4] = ' - Talk:BackupDumperTestP1 - 1 - 4 - - 8 - 2012-04-01T16:46:05Z - - 127.0.0.1 - - Talk BackupDumperTestP1 Summary1 - nktofwzd0tl192k3zfepmlzxoax1lpe - 1 - 1 - Talk about BackupDumperTestP1 Text1 - - -'; - - // The common ending for all files - $tail = ' -'; - - // Putting together the content of the prefetch files - $content = $header; - foreach ( $requested_pages as $i ) { - $this->assertTrue( array_key_exists( $i, $available_pages ), - "Check for availability of requested page " . $i ); - $content .= $available_pages[$i]; - } - $content .= $tail; - - $this->assertEquals( strlen( $content ), file_put_contents( - $fname, $content ), "Length of prepared prefetch" ); - - return $fname; - } -} diff --git a/tests/phpunit/maintenance/backupTextPassTest.php b/tests/phpunit/maintenance/backupTextPassTest.php deleted file mode 100644 index 653a1145..00000000 --- a/tests/phpunit/maintenance/backupTextPassTest.php +++ /dev/null @@ -1,581 +0,0 @@ -tablesUsed[] = 'page'; - $this->tablesUsed[] = 'revision'; - $this->tablesUsed[] = 'text'; - - $ns = $this->getDefaultWikitextNS(); - - try { - // Simple page - $title = Title::newFromText( 'BackupDumperTestP1', $ns ); - $page = WikiPage::factory( $title ); - list( $this->revId1_1, $this->textId1_1 ) = $this->addRevision( $page, - "BackupDumperTestP1Text1", "BackupDumperTestP1Summary1" ); - $this->pageId1 = $page->getId(); - - // Page with more than one revision - $title = Title::newFromText( 'BackupDumperTestP2', $ns ); - $page = WikiPage::factory( $title ); - list( $this->revId2_1, $this->textId2_1 ) = $this->addRevision( $page, - "BackupDumperTestP2Text1", "BackupDumperTestP2Summary1" ); - list( $this->revId2_2, $this->textId2_2 ) = $this->addRevision( $page, - "BackupDumperTestP2Text2", "BackupDumperTestP2Summary2" ); - list( $this->revId2_3, $this->textId2_3 ) = $this->addRevision( $page, - "BackupDumperTestP2Text3", "BackupDumperTestP2Summary3" ); - list( $this->revId2_4, $this->textId2_4 ) = $this->addRevision( $page, - "BackupDumperTestP2Text4 some additional Text ", - "BackupDumperTestP2Summary4 extra " ); - $this->pageId2 = $page->getId(); - - // Deleted page. - $title = Title::newFromText( 'BackupDumperTestP3', $ns ); - $page = WikiPage::factory( $title ); - list( $this->revId3_1, $this->textId3_1 ) = $this->addRevision( $page, - "BackupDumperTestP3Text1", "BackupDumperTestP2Summary1" ); - list( $this->revId3_2, $this->textId3_2 ) = $this->addRevision( $page, - "BackupDumperTestP3Text2", "BackupDumperTestP2Summary2" ); - $this->pageId3 = $page->getId(); - $page->doDeleteArticle( "Testing ;)" ); - - // Page from non-default namespace - - if ( $ns === NS_TALK ) { - // @todo work around this. - throw new MWException( "The default wikitext namespace is the talk namespace. " - . " We can't currently deal with that." ); - } - - $title = Title::newFromText( 'BackupDumperTestP1', NS_TALK ); - $page = WikiPage::factory( $title ); - list( $this->revId4_1, $this->textId4_1 ) = $this->addRevision( $page, - "Talk about BackupDumperTestP1 Text1", - "Talk BackupDumperTestP1 Summary1" ); - $this->pageId4 = $page->getId(); - } catch ( Exception $e ) { - // We'd love to pass $e directly. However, ... see - // documentation of exceptionFromAddDBData in - // DumpTestCase - $this->exceptionFromAddDBData = $e; - } - } - - protected function setUp() { - parent::setUp(); - - // Since we will restrict dumping by page ranges (to allow - // working tests, even if the db gets prepopulated by a base - // class), we have to assert, that the page id are consecutively - // increasing - $this->assertEquals( - array( $this->pageId2, $this->pageId3, $this->pageId4 ), - array( $this->pageId1 + 1, $this->pageId2 + 1, $this->pageId3 + 1 ), - "Page ids increasing without holes" ); - } - - function testPlain() { - // Setting up the dump - $nameStub = $this->setUpStub(); - $nameFull = $this->getNewTempFile(); - $dumper = new TextPassDumper( array( "--stub=file:" . $nameStub, - "--output=file:" . $nameFull ) ); - $dumper->reporting = false; - $dumper->setDb( $this->db ); - - // Performing the dump - $dumper->dump( WikiExporter::FULL, WikiExporter::TEXT ); - - // Checking for correctness of the dumped data - $this->assertDumpStart( $nameFull ); - - // Page 1 - $this->assertPageStart( $this->pageId1, NS_MAIN, "BackupDumperTestP1" ); - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, false, "0bolhl6ol7i6x0e7yq91gxgaan39j87", - "BackupDumperTestP1Text1" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, NS_MAIN, "BackupDumperTestP2" ); - $this->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1", - $this->textId2_1, false, "jprywrymfhysqllua29tj3sc7z39dl2", - "BackupDumperTestP2Text1" ); - $this->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2", - $this->textId2_2, false, "b7vj5ks32po5m1z1t1br4o7scdwwy95", - "BackupDumperTestP2Text2", $this->revId2_1 ); - $this->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3", - $this->textId2_3, false, "jfunqmh1ssfb8rs43r19w98k28gg56r", - "BackupDumperTestP2Text3", $this->revId2_2 ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, false, "6o1ciaxa6pybnqprmungwofc4lv00wv", - "BackupDumperTestP2Text4 some additional Text", $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - $this->assertPageStart( $this->pageId4, NS_TALK, "Talk:BackupDumperTestP1" ); - $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, false, "nktofwzd0tl192k3zfepmlzxoax1lpe", - "Talk about BackupDumperTestP1 Text1" ); - $this->assertPageEnd(); - - $this->assertDumpEnd(); - } - - function testPrefetchPlain() { - // The mapping between ids and text, for the hits of the prefetch mock - $prefetchMap = array( - array( $this->pageId1, $this->revId1_1, "Prefetch_________1Text1" ), - array( $this->pageId2, $this->revId2_3, "Prefetch_________2Text3" ) - ); - - // The mock itself - $prefetchMock = $this->getMock( 'BaseDump', array( 'prefetch' ), array(), '', false ); - $prefetchMock->expects( $this->exactly( 6 ) ) - ->method( 'prefetch' ) - ->will( $this->returnValueMap( $prefetchMap ) ); - - // Setting up of the dump - $nameStub = $this->setUpStub(); - $nameFull = $this->getNewTempFile(); - $dumper = new TextPassDumper( array( "--stub=file:" - . $nameStub, "--output=file:" . $nameFull ) ); - $dumper->prefetch = $prefetchMock; - $dumper->reporting = false; - $dumper->setDb( $this->db ); - - // Performing the dump - $dumper->dump( WikiExporter::FULL, WikiExporter::TEXT ); - - // Checking for correctness of the dumped data - $this->assertDumpStart( $nameFull ); - - // Page 1 - $this->assertPageStart( $this->pageId1, NS_MAIN, "BackupDumperTestP1" ); - // Prefetch kicks in. This is still the SHA-1 of the original text, - // But the actual text (with different SHA-1) comes from prefetch. - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, false, "0bolhl6ol7i6x0e7yq91gxgaan39j87", - "Prefetch_________1Text1" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, NS_MAIN, "BackupDumperTestP2" ); - $this->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1", - $this->textId2_1, false, "jprywrymfhysqllua29tj3sc7z39dl2", - "BackupDumperTestP2Text1" ); - $this->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2", - $this->textId2_2, false, "b7vj5ks32po5m1z1t1br4o7scdwwy95", - "BackupDumperTestP2Text2", $this->revId2_1 ); - // Prefetch kicks in. This is still the SHA-1 of the original text, - // But the actual text (with different SHA-1) comes from prefetch. - $this->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3", - $this->textId2_3, false, "jfunqmh1ssfb8rs43r19w98k28gg56r", - "Prefetch_________2Text3", $this->revId2_2 ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, false, "6o1ciaxa6pybnqprmungwofc4lv00wv", - "BackupDumperTestP2Text4 some additional Text", $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - $this->assertPageStart( $this->pageId4, NS_TALK, "Talk:BackupDumperTestP1" ); - $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, false, "nktofwzd0tl192k3zfepmlzxoax1lpe", - "Talk about BackupDumperTestP1 Text1" ); - $this->assertPageEnd(); - - $this->assertDumpEnd(); - } - - /** - * Ensures that checkpoint dumps are used and written, by successively increasing the - * stub size and dumping until the duration crosses a threshold. - * - * @param $checkpointFormat string: Either "file" for plain text or "gzip" for gzipped - * checkpoint files. - */ - private function checkpointHelper( $checkpointFormat = "file" ) { - // Getting temporary names - $nameStub = $this->getNewTempFile(); - $nameOutputDir = $this->getNewTempDirectory(); - - $stderr = fopen( 'php://output', 'a' ); - if ( $stderr === false ) { - $this->fail( "Could not open stream for stderr" ); - } - - $iterations = 32; // We'll start with that many iterations of revisions in stub - $lastDuration = 0; - $minDuration = 2; // We want the dump to take at least this many seconds - $checkpointAfter = 0.5; // Generate checkpoint after this many seconds - - // Until a dump takes at least $minDuration seconds, perform a dump and check - // duration. If the dump did not take long enough increase the iteration - // count, to generate a bigger stub file next time. - while ( $lastDuration < $minDuration ) { - - // Setting up the dump - wfRecursiveRemoveDir( $nameOutputDir ); - $this->assertTrue( wfMkdirParents( $nameOutputDir ), - "Creating temporary output directory " ); - $this->setUpStub( $nameStub, $iterations ); - $dumper = new TextPassDumper( array( "--stub=file:" . $nameStub, - "--output=" . $checkpointFormat . ":" . $nameOutputDir . "/full", - "--maxtime=1" /*This is in minutes. Fixup is below*/, - "--checkpointfile=checkpoint-%s-%s.xml.gz" ) ); - $dumper->setDb( $this->db ); - $dumper->maxTimeAllowed = $checkpointAfter; // Patching maxTime from 1 minute - $dumper->stderr = $stderr; - - // The actual dump and taking time - $ts_before = microtime( true ); - $dumper->dump( WikiExporter::FULL, WikiExporter::TEXT ); - $ts_after = microtime( true ); - $lastDuration = $ts_after - $ts_before; - - // Handling increasing the iteration count for the stubs - if ( $lastDuration < $minDuration ) { - $old_iterations = $iterations; - if ( $lastDuration > 0.2 ) { - // lastDuration is big enough, to allow an educated guess - $factor = ( $minDuration + 0.5 ) / $lastDuration; - if ( ( $factor > 1.1 ) && ( $factor < 100 ) ) { - // educated guess is reasonable - $iterations = (int)( $iterations * $factor ); - } - } - - if ( $old_iterations == $iterations ) { - // Heuristics were not applied, so we just *2. - $iterations *= 2; - } - - $this->assertLessThan( 50000, $iterations, - "Emergency stop against infinitely increasing iteration " - . "count ( last duration: $lastDuration )" ); - } - } - - // The dump (hopefully) did take long enough to produce more than one - // checkpoint file. - // - // We now check all the checkpoint files for validity. - - $files = scandir( $nameOutputDir ); - $this->assertTrue( asort( $files ), "Sorting files in temporary directory" ); - $fileOpened = false; - $lookingForPage = 1; - $checkpointFiles = 0; - - // Each run of the following loop body tries to handle exactly 1 /page/ (not - // iteration of stub content). $i is only increased after having treated page 4. - for ( $i = 0; $i < $iterations; ) { - - // 1. Assuring a file is opened and ready. Skipping across header if - // necessary. - if ( !$fileOpened ) { - $this->assertNotEmpty( $files, "No more existing dump files, " - . "but not yet all pages found" ); - $fname = array_shift( $files ); - while ( $fname == "." || $fname == ".." ) { - $this->assertNotEmpty( $files, "No more existing dump" - . " files, but not yet all pages found" ); - $fname = array_shift( $files ); - } - if ( $checkpointFormat == "gzip" ) { - $this->gunzip( $nameOutputDir . "/" . $fname ); - } - $this->assertDumpStart( $nameOutputDir . "/" . $fname ); - $fileOpened = true; - $checkpointFiles++; - } - - // 2. Performing a single page check - switch ( $lookingForPage ) { - case 1: - // Page 1 - $this->assertPageStart( $this->pageId1 + $i * self::$numOfPages, NS_MAIN, - "BackupDumperTestP1" ); - $this->assertRevision( $this->revId1_1 + $i * self::$numOfRevs, "BackupDumperTestP1Summary1", - $this->textId1_1, false, "0bolhl6ol7i6x0e7yq91gxgaan39j87", - "BackupDumperTestP1Text1" ); - $this->assertPageEnd(); - - $lookingForPage = 2; - break; - - case 2: - // Page 2 - $this->assertPageStart( $this->pageId2 + $i * self::$numOfPages, NS_MAIN, - "BackupDumperTestP2" ); - $this->assertRevision( $this->revId2_1 + $i * self::$numOfRevs, "BackupDumperTestP2Summary1", - $this->textId2_1, false, "jprywrymfhysqllua29tj3sc7z39dl2", - "BackupDumperTestP2Text1" ); - $this->assertRevision( $this->revId2_2 + $i * self::$numOfRevs, "BackupDumperTestP2Summary2", - $this->textId2_2, false, "b7vj5ks32po5m1z1t1br4o7scdwwy95", - "BackupDumperTestP2Text2", $this->revId2_1 + $i * self::$numOfRevs ); - $this->assertRevision( $this->revId2_3 + $i * self::$numOfRevs, "BackupDumperTestP2Summary3", - $this->textId2_3, false, "jfunqmh1ssfb8rs43r19w98k28gg56r", - "BackupDumperTestP2Text3", $this->revId2_2 + $i * self::$numOfRevs ); - $this->assertRevision( $this->revId2_4 + $i * self::$numOfRevs, - "BackupDumperTestP2Summary4 extra", - $this->textId2_4, false, "6o1ciaxa6pybnqprmungwofc4lv00wv", - "BackupDumperTestP2Text4 some additional Text", - $this->revId2_3 + $i * self::$numOfRevs ); - $this->assertPageEnd(); - - $lookingForPage = 4; - break; - - case 4: - // Page 4 - $this->assertPageStart( $this->pageId4 + $i * self::$numOfPages, NS_TALK, - "Talk:BackupDumperTestP1" ); - $this->assertRevision( $this->revId4_1 + $i * self::$numOfRevs, - "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, false, "nktofwzd0tl192k3zfepmlzxoax1lpe", - "Talk about BackupDumperTestP1 Text1" ); - $this->assertPageEnd(); - - $lookingForPage = 1; - - // We dealt with the whole iteration. - $i++; - break; - - default: - $this->fail( "Bad setting for lookingForPage ($lookingForPage)" ); - } - - // 3. Checking for the end of the current checkpoint file - if ( $this->xml->nodeType == XMLReader::END_ELEMENT - && $this->xml->name == "mediawiki" - ) { - $this->assertDumpEnd(); - $fileOpened = false; - } - } - - // Assuring we completely read all files ... - $this->assertFalse( $fileOpened, "Currently read file still open?" ); - $this->assertEmpty( $files, "Remaining unchecked files" ); - - // ... and have dealt with more than one checkpoint file - $this->assertGreaterThan( 1, $checkpointFiles, "expected more than 1 checkpoint to have been created. Checkpoint interval is $checkpointAfter seconds, maybe your computer is too fast?" ); - - $this->expectETAOutput(); - } - - /** - * @group large - */ - function testCheckpointPlain() { - $this->checkpointHelper(); - } - - /** - * tests for working checkpoint generation in gzip format work. - * - * We keep this test in addition to the simpler self::testCheckpointPlain, as there - * were once problems when the used sinks were DumpPipeOutputs. - * - * xmldumps-backup typically uses bzip2 instead of gzip. However, as bzip2 requires - * PHP extensions, we go for gzip instead, which triggers the same relevant code - * paths while still being testable on more systems. - * - * @group large - */ - function testCheckpointGzip() { - $this->checkHasGzip(); - $this->checkpointHelper( "gzip" ); - } - - - /** - * Creates a stub file that is used for testing the text pass of dumps - * - * @param $fname string: (Optional) Absolute name of the file to write - * the stub into. If this parameter is null, a new temporary - * file is generated that is automatically removed upon - * tearDown. - * @param $iterations integer: (Optional) specifies how often the block - * of 3 pages should go into the stub file. The page and - * revision id increase further and further, while the text - * id of the first iteration is reused. The pages and revision - * of iteration > 1 have no corresponding representation in the - * database. - * @return string absolute filename of the stub - */ - private function setUpStub( $fname = null, $iterations = 1 ) { - if ( $fname === null ) { - $fname = $this->getNewTempFile(); - } - $header = ' - - wikisvn - http://localhost/wiki-svn/index.php/Main_Page - MediaWiki 1.21alpha - first-letter - - Media - Special - - Talk - User - User talk - Wikisvn - Wikisvn talk - File - File talk - MediaWiki - MediaWiki talk - Template - Template talk - Help - Help talk - Category - Category talk - - -'; - $tail = ' -'; - - $content = $header; - $iterations = intval( $iterations ); - for ( $i = 0; $i < $iterations; $i++ ) { - - $page1 = ' - BackupDumperTestP1 - 0 - ' . ( $this->pageId1 + $i * self::$numOfPages ) . ' - - ' . ( $this->revId1_1 + $i * self::$numOfRevs ) . ' - 2012-04-01T16:46:05Z - - 127.0.0.1 - - BackupDumperTestP1Summary1 - 0bolhl6ol7i6x0e7yq91gxgaan39j87 - wikitext - text/x-wiki - - - -'; - $page2 = ' - BackupDumperTestP2 - 0 - ' . ( $this->pageId2 + $i * self::$numOfPages ) . ' - - ' . ( $this->revId2_1 + $i * self::$numOfRevs ) . ' - 2012-04-01T16:46:05Z - - 127.0.0.1 - - BackupDumperTestP2Summary1 - jprywrymfhysqllua29tj3sc7z39dl2 - wikitext - text/x-wiki - - - - ' . ( $this->revId2_2 + $i * self::$numOfRevs ) . ' - ' . ( $this->revId2_1 + $i * self::$numOfRevs ) . ' - 2012-04-01T16:46:05Z - - 127.0.0.1 - - BackupDumperTestP2Summary2 - b7vj5ks32po5m1z1t1br4o7scdwwy95 - wikitext - text/x-wiki - - - - ' . ( $this->revId2_3 + $i * self::$numOfRevs ) . ' - ' . ( $this->revId2_2 + $i * self::$numOfRevs ) . ' - 2012-04-01T16:46:05Z - - 127.0.0.1 - - BackupDumperTestP2Summary3 - jfunqmh1ssfb8rs43r19w98k28gg56r - wikitext - text/x-wiki - - - - ' . ( $this->revId2_4 + $i * self::$numOfRevs ) . ' - ' . ( $this->revId2_3 + $i * self::$numOfRevs ) . ' - 2012-04-01T16:46:05Z - - 127.0.0.1 - - BackupDumperTestP2Summary4 extra - 6o1ciaxa6pybnqprmungwofc4lv00wv - wikitext - text/x-wiki - - - -'; - // page 3 not in stub - - $page4 = ' - Talk:BackupDumperTestP1 - 1 - ' . ( $this->pageId4 + $i * self::$numOfPages ) . ' - - ' . ( $this->revId4_1 + $i * self::$numOfRevs ) . ' - 2012-04-01T16:46:05Z - - 127.0.0.1 - - Talk BackupDumperTestP1 Summary1 - nktofwzd0tl192k3zfepmlzxoax1lpe - wikitext - text/x-wiki - - - -'; - $content .= $page1 . $page2 . $page4; - } - $content .= $tail; - $this->assertEquals( strlen( $content ), file_put_contents( - $fname, $content ), "Length of prepared stub" ); - - return $fname; - } -} diff --git a/tests/phpunit/maintenance/backup_LogTest.php b/tests/phpunit/maintenance/backup_LogTest.php deleted file mode 100644 index 98d81653..00000000 --- a/tests/phpunit/maintenance/backup_LogTest.php +++ /dev/null @@ -1,228 +0,0 @@ -setPerformer( $user ); - $logEntry->setTarget( Title::newFromText( $title, $ns ) ); - if ( $comment !== null ) { - $logEntry->setComment( $comment ); - } - if ( $parameters !== null ) { - $logEntry->setParameters( $parameters ); - } - - return $logEntry->insert(); - } - - function addDBData() { - $this->tablesUsed[] = 'logging'; - $this->tablesUsed[] = 'user'; - - try { - $user1 = User::newFromName( 'BackupDumperLogUserA' ); - $this->userId1 = $user1->getId(); - if ( $this->userId1 === 0 ) { - $user1->addToDatabase(); - $this->userId1 = $user1->getId(); - } - $this->assertGreaterThan( 0, $this->userId1 ); - - $user2 = User::newFromName( 'BackupDumperLogUserB' ); - $this->userId2 = $user2->getId(); - if ( $this->userId2 === 0 ) { - $user2->addToDatabase(); - $this->userId2 = $user2->getId(); - } - $this->assertGreaterThan( 0, $this->userId2 ); - - $this->logId1 = $this->addLogEntry( 'type', 'subtype', - $user1, NS_MAIN, "PageA" ); - $this->assertGreaterThan( 0, $this->logId1 ); - - $this->logId2 = $this->addLogEntry( 'supress', 'delete', - $user2, NS_TALK, "PageB", "SomeComment" ); - $this->assertGreaterThan( 0, $this->logId2 ); - - $this->logId3 = $this->addLogEntry( 'move', 'delete', - $user2, NS_MAIN, "PageA", "SomeOtherComment", - array( 'key1' => 1, 3 => 'value3' ) ); - $this->assertGreaterThan( 0, $this->logId3 ); - } catch ( Exception $e ) { - // We'd love to pass $e directly. However, ... see - // documentation of exceptionFromAddDBData in - // DumpTestCase - $this->exceptionFromAddDBData = $e; - } - } - - - /** - * asserts that the xml reader is at the beginning of a log entry and skips over - * it while analyzing it. - * - * @param $id int: id of the log entry - * @param $user_name string: user name of the log entry's performer - * @param $user_id int: user id of the log entry 's performer - * @param $comment string|null: comment of the log entry. If null, the comment - * text is ignored. - * @param $type string: type of the log entry - * @param $subtype string: subtype of the log entry - * @param $title string: title of the log entry's target - * @param $parameters array: (optional) unserialized data accompanying the log entry - */ - private function assertLogItem( $id, $user_name, $user_id, $comment, $type, - $subtype, $title, $parameters = array() - ) { - - $this->assertNodeStart( "logitem" ); - $this->skipWhitespace(); - - $this->assertTextNode( "id", $id ); - $this->assertTextNode( "timestamp", false ); - - $this->assertNodeStart( "contributor" ); - $this->skipWhitespace(); - $this->assertTextNode( "username", $user_name ); - $this->assertTextNode( "id", $user_id ); - $this->assertNodeEnd( "contributor" ); - $this->skipWhitespace(); - - if ( $comment !== null ) { - $this->assertTextNode( "comment", $comment ); - } - $this->assertTextNode( "type", $type ); - $this->assertTextNode( "action", $subtype ); - $this->assertTextNode( "logtitle", $title ); - - $this->assertNodeStart( "params" ); - $parameters_xml = unserialize( $this->xml->value ); - $this->assertEquals( $parameters, $parameters_xml ); - $this->assertTrue( $this->xml->read(), "Skipping past processed text of params" ); - $this->assertNodeEnd( "params" ); - $this->skipWhitespace(); - - $this->assertNodeEnd( "logitem" ); - $this->skipWhitespace(); - } - - function testPlain() { - global $wgContLang; - - // Preparing the dump - $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array( "--output=file:" . $fname ) ); - $dumper->startId = $this->logId1; - $dumper->endId = $this->logId3 + 1; - $dumper->reporting = false; - $dumper->setDb( $this->db ); - - // Performing the dump - $dumper->dump( WikiExporter::LOGS, WikiExporter::TEXT ); - - // Analyzing the dumped data - $this->assertDumpStart( $fname ); - - $this->assertLogItem( $this->logId1, "BackupDumperLogUserA", - $this->userId1, null, "type", "subtype", "PageA" ); - - $this->assertNotNull( $wgContLang, "Content language object validation" ); - $namespace = $wgContLang->getNsText( NS_TALK ); - $this->assertInternalType( 'string', $namespace ); - $this->assertGreaterThan( 0, strlen( $namespace ) ); - $this->assertLogItem( $this->logId2, "BackupDumperLogUserB", - $this->userId2, "SomeComment", "supress", "delete", - $namespace . ":PageB" ); - - $this->assertLogItem( $this->logId3, "BackupDumperLogUserB", - $this->userId2, "SomeOtherComment", "move", "delete", - "PageA", array( 'key1' => 1, 3 => 'value3' ) ); - - $this->assertDumpEnd(); - } - - function testXmlDumpsBackupUseCaseLogging() { - global $wgContLang; - - $this->checkHasGzip(); - - // Preparing the dump - $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array( "--output=gzip:" . $fname, - "--reporting=2" ) ); - $dumper->startId = $this->logId1; - $dumper->endId = $this->logId3 + 1; - $dumper->setDb( $this->db ); - - // xmldumps-backup demands reporting, although this is currently not - // implemented in BackupDumper, when dumping logging data. We - // nevertheless capture the output of the dump process already now, - // to be able to alert (once dumping produces reports) that this test - // needs updates. - $dumper->stderr = fopen( 'php://output', 'a' ); - if ( $dumper->stderr === false ) { - $this->fail( "Could not open stream for stderr" ); - } - - // Performing the dump - $dumper->dump( WikiExporter::LOGS, WikiExporter::TEXT ); - - $this->assertTrue( fclose( $dumper->stderr ), "Closing stderr handle" ); - - // Analyzing the dumped data - $this->gunzip( $fname ); - - $this->assertDumpStart( $fname ); - - $this->assertLogItem( $this->logId1, "BackupDumperLogUserA", - $this->userId1, null, "type", "subtype", "PageA" ); - - $this->assertNotNull( $wgContLang, "Content language object validation" ); - $namespace = $wgContLang->getNsText( NS_TALK ); - $this->assertInternalType( 'string', $namespace ); - $this->assertGreaterThan( 0, strlen( $namespace ) ); - $this->assertLogItem( $this->logId2, "BackupDumperLogUserB", - $this->userId2, "SomeComment", "supress", "delete", - $namespace . ":PageB" ); - - $this->assertLogItem( $this->logId3, "BackupDumperLogUserB", - $this->userId2, "SomeOtherComment", "move", "delete", - "PageA", array( 'key1' => 1, 3 => 'value3' ) ); - - $this->assertDumpEnd(); - - // Currently, no reporting is implemented. Alert via failure, once - // this changes. - // If reporting for log dumps has been implemented, please update - // the following statement to catch good output - $this->expectOutputString( '' ); - } -} diff --git a/tests/phpunit/maintenance/backup_PageTest.php b/tests/phpunit/maintenance/backup_PageTest.php deleted file mode 100644 index 99bd2700..00000000 --- a/tests/phpunit/maintenance/backup_PageTest.php +++ /dev/null @@ -1,404 +0,0 @@ -setMwGlobals( array( - 'wgLanguageCode' => 'en', - 'wgContLang' => Language::factory( 'en' ), - ) ); - - $this->tablesUsed[] = 'page'; - $this->tablesUsed[] = 'revision'; - $this->tablesUsed[] = 'text'; - - try { - $this->namespace = $this->getDefaultWikitextNS(); - $this->talk_namespace = NS_TALK; - - if ( $this->namespace === $this->talk_namespace ) { - // @todo work around this. - throw new MWException( "The default wikitext namespace is the talk namespace. " - . " We can't currently deal with that." ); - } - - $this->pageTitle1 = Title::newFromText( 'BackupDumperTestP1', $this->namespace ); - $page = WikiPage::factory( $this->pageTitle1 ); - list( $this->revId1_1, $this->textId1_1 ) = $this->addRevision( $page, - "BackupDumperTestP1Text1", "BackupDumperTestP1Summary1" ); - $this->pageId1 = $page->getId(); - - $this->pageTitle2 = Title::newFromText( 'BackupDumperTestP2', $this->namespace ); - $page = WikiPage::factory( $this->pageTitle2 ); - list( $this->revId2_1, $this->textId2_1 ) = $this->addRevision( $page, - "BackupDumperTestP2Text1", "BackupDumperTestP2Summary1" ); - list( $this->revId2_2, $this->textId2_2 ) = $this->addRevision( $page, - "BackupDumperTestP2Text2", "BackupDumperTestP2Summary2" ); - list( $this->revId2_3, $this->textId2_3 ) = $this->addRevision( $page, - "BackupDumperTestP2Text3", "BackupDumperTestP2Summary3" ); - list( $this->revId2_4, $this->textId2_4 ) = $this->addRevision( $page, - "BackupDumperTestP2Text4 some additional Text ", - "BackupDumperTestP2Summary4 extra " ); - $this->pageId2 = $page->getId(); - - $this->pageTitle3 = Title::newFromText( 'BackupDumperTestP3', $this->namespace ); - $page = WikiPage::factory( $this->pageTitle3 ); - list( $this->revId3_1, $this->textId3_1 ) = $this->addRevision( $page, - "BackupDumperTestP3Text1", "BackupDumperTestP2Summary1" ); - list( $this->revId3_2, $this->textId3_2 ) = $this->addRevision( $page, - "BackupDumperTestP3Text2", "BackupDumperTestP2Summary2" ); - $this->pageId3 = $page->getId(); - $page->doDeleteArticle( "Testing ;)" ); - - $this->pageTitle4 = Title::newFromText( 'BackupDumperTestP1', $this->talk_namespace ); - $page = WikiPage::factory( $this->pageTitle4 ); - list( $this->revId4_1, $this->textId4_1 ) = $this->addRevision( $page, - "Talk about BackupDumperTestP1 Text1", - "Talk BackupDumperTestP1 Summary1" ); - $this->pageId4 = $page->getId(); - } catch ( Exception $e ) { - // We'd love to pass $e directly. However, ... see - // documentation of exceptionFromAddDBData in - // DumpTestCase - $this->exceptionFromAddDBData = $e; - } - } - - protected function setUp() { - parent::setUp(); - - // Since we will restrict dumping by page ranges (to allow - // working tests, even if the db gets prepopulated by a base - // class), we have to assert, that the page id are consecutively - // increasing - $this->assertEquals( - array( $this->pageId2, $this->pageId3, $this->pageId4 ), - array( $this->pageId1 + 1, $this->pageId2 + 1, $this->pageId3 + 1 ), - "Page ids increasing without holes" ); - } - - function testFullTextPlain() { - // Preparing the dump - $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array( "--output=file:" . $fname ) ); - $dumper->startId = $this->pageId1; - $dumper->endId = $this->pageId4 + 1; - $dumper->reporting = false; - $dumper->setDb( $this->db ); - - // Performing the dump - $dumper->dump( WikiExporter::FULL, WikiExporter::TEXT ); - - // Checking the dumped data - $this->assertDumpStart( $fname ); - - // Page 1 - $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() ); - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87", - "BackupDumperTestP1Text1" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() ); - $this->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1", - $this->textId2_1, 23, "jprywrymfhysqllua29tj3sc7z39dl2", - "BackupDumperTestP2Text1" ); - $this->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2", - $this->textId2_2, 23, "b7vj5ks32po5m1z1t1br4o7scdwwy95", - "BackupDumperTestP2Text2", $this->revId2_1 ); - $this->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3", - $this->textId2_3, 23, "jfunqmh1ssfb8rs43r19w98k28gg56r", - "BackupDumperTestP2Text3", $this->revId2_2 ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", - "BackupDumperTestP2Text4 some additional Text", $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - $this->assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() ); - $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe", - "Talk about BackupDumperTestP1 Text1" ); - $this->assertPageEnd(); - - $this->assertDumpEnd(); - } - - function testFullStubPlain() { - // Preparing the dump - $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array( "--output=file:" . $fname ) ); - $dumper->startId = $this->pageId1; - $dumper->endId = $this->pageId4 + 1; - $dumper->reporting = false; - $dumper->setDb( $this->db ); - - // Performing the dump - $dumper->dump( WikiExporter::FULL, WikiExporter::STUB ); - - // Checking the dumped data - $this->assertDumpStart( $fname ); - - // Page 1 - $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() ); - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() ); - $this->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1", - $this->textId2_1, 23, "jprywrymfhysqllua29tj3sc7z39dl2" ); - $this->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2", - $this->textId2_2, 23, "b7vj5ks32po5m1z1t1br4o7scdwwy95", false, $this->revId2_1 ); - $this->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3", - $this->textId2_3, 23, "jfunqmh1ssfb8rs43r19w98k28gg56r", false, $this->revId2_2 ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - $this->assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() ); - $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe" ); - $this->assertPageEnd(); - - $this->assertDumpEnd(); - } - - function testCurrentStubPlain() { - // Preparing the dump - $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array( "--output=file:" . $fname ) ); - $dumper->startId = $this->pageId1; - $dumper->endId = $this->pageId4 + 1; - $dumper->reporting = false; - $dumper->setDb( $this->db ); - - // Performing the dump - $dumper->dump( WikiExporter::CURRENT, WikiExporter::STUB ); - - // Checking the dumped data - $this->assertDumpStart( $fname ); - - // Page 1 - $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() ); - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - $this->assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() ); - $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe" ); - $this->assertPageEnd(); - - $this->assertDumpEnd(); - } - - function testCurrentStubGzip() { - $this->checkHasGzip(); - - // Preparing the dump - $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array( "--output=gzip:" . $fname ) ); - $dumper->startId = $this->pageId1; - $dumper->endId = $this->pageId4 + 1; - $dumper->reporting = false; - $dumper->setDb( $this->db ); - - // Performing the dump - $dumper->dump( WikiExporter::CURRENT, WikiExporter::STUB ); - - // Checking the dumped data - $this->gunzip( $fname ); - $this->assertDumpStart( $fname ); - - // Page 1 - $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() ); - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - $this->assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() ); - $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe" ); - $this->assertPageEnd(); - - $this->assertDumpEnd(); - } - - - function testXmlDumpsBackupUseCase() { - // xmldumps-backup typically performs a single dump that that writes - // out three files - // * gzipped stubs of everything (meta-history) - // * gzipped stubs of latest revisions of all pages (meta-current) - // * gzipped stubs of latest revisions of all pages of namespage 0 - // (articles) - // - // We reproduce such a setup with our mini fixture, although we omit - // chunks, and all the other gimmicks of xmldumps-backup. - // - $this->checkHasGzip(); - - $fnameMetaHistory = $this->getNewTempFile(); - $fnameMetaCurrent = $this->getNewTempFile(); - $fnameArticles = $this->getNewTempFile(); - - $dumper = new BackupDumper( array( "--output=gzip:" . $fnameMetaHistory, - "--output=gzip:" . $fnameMetaCurrent, "--filter=latest", - "--output=gzip:" . $fnameArticles, "--filter=latest", - "--filter=notalk", "--filter=namespace:!NS_USER", - "--reporting=1000" ) ); - $dumper->startId = $this->pageId1; - $dumper->endId = $this->pageId4 + 1; - $dumper->setDb( $this->db ); - - // xmldumps-backup uses reporting. We will not check the exact reported - // message, as they are dependent on the processing power of the used - // computer. We only check that reporting does not crash the dumping - // and that something is reported - $dumper->stderr = fopen( 'php://output', 'a' ); - if ( $dumper->stderr === false ) { - $this->fail( "Could not open stream for stderr" ); - } - - // Performing the dump - $dumper->dump( WikiExporter::FULL, WikiExporter::STUB ); - - $this->assertTrue( fclose( $dumper->stderr ), "Closing stderr handle" ); - - // Checking meta-history ------------------------------------------------- - - $this->gunzip( $fnameMetaHistory ); - $this->assertDumpStart( $fnameMetaHistory ); - - // Page 1 - $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() ); - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() ); - $this->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1", - $this->textId2_1, 23, "jprywrymfhysqllua29tj3sc7z39dl2" ); - $this->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2", - $this->textId2_2, 23, "b7vj5ks32po5m1z1t1br4o7scdwwy95", false, $this->revId2_1 ); - $this->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3", - $this->textId2_3, 23, "jfunqmh1ssfb8rs43r19w98k28gg56r", false, $this->revId2_2 ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - $this->assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() ); - $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe" ); - $this->assertPageEnd(); - - $this->assertDumpEnd(); - - // Checking meta-current ------------------------------------------------- - - $this->gunzip( $fnameMetaCurrent ); - $this->assertDumpStart( $fnameMetaCurrent ); - - // Page 1 - $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() ); - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - $this->assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() ); - $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe" ); - $this->assertPageEnd(); - - $this->assertDumpEnd(); - - // Checking articles ------------------------------------------------- - - $this->gunzip( $fnameArticles ); - $this->assertDumpStart( $fnameArticles ); - - // Page 1 - $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() ); - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - // -> Page is not in $this->namespace. Hence not visible - - $this->assertDumpEnd(); - - $this->expectETAOutput(); - } -} diff --git a/tests/phpunit/maintenance/fetchTextTest.php b/tests/phpunit/maintenance/fetchTextTest.php deleted file mode 100644 index e8df199e..00000000 --- a/tests/phpunit/maintenance/fetchTextTest.php +++ /dev/null @@ -1,238 +0,0 @@ - 0 ); - - - /** - * Data for the fake stdin - * - * @param $stdin String The string to be used instead of stdin - */ - function mockStdin( $stdin ) { - $this->mockStdinText = $stdin; - $this->mockSetUp = true; - } - - /** - * Gets invocation counters for mocked methods. - * - * @return Array An array, whose keys are function names. The corresponding values - * denote the number of times the function has been invoked. - */ - function mockGetInvocations() { - return $this->mockInvocations; - } - - // ----------------------------------------------------------------- - // Mocked functions from FetchText follow. - - function getStdin( $len = null ) { - $this->mockInvocations['getStdin']++; - if ( $len !== null ) { - throw new PHPUnit_Framework_ExpectationFailedException( - "Tried to get stdin with non null parameter" ); - } - - if ( !$this->mockSetUp ) { - throw new PHPUnit_Framework_ExpectationFailedException( - "Tried to get stdin before setting up rerouting" ); - } - - return fopen( 'data://text/plain,' . $this->mockStdinText, 'r' ); - } -} - -/** - * TestCase for FetchText - * - * @group Database - * @group Dump - */ -class FetchTextTest extends MediaWikiTestCase { - - // We add 5 Revisions for this test. Their corresponding text id's - // are stored in the following 5 variables. - private $textId1; - private $textId2; - private $textId3; - private $textId4; - private $textId5; - - - /** - * @var Exception|null As the current MediaWikiTestCase::run is not - * robust enough to recover from thrown exceptions directly, we cannot - * throw frow within addDBData, although it would be appropriate. Hence, - * we catch the exception and store it until we are in setUp and may - * finally rethrow the exception without crashing the test suite. - */ - private $exceptionFromAddDBData; - - /** - * @var FetchText the (mocked) FetchText that is to test - */ - private $fetchText; - - /** - * Adds a revision to a page, while returning the resuting text's id - * - * @param $page WikiPage The page to add the revision to - * @param $text String The revisions text - * @param $text String The revisions summare - * - * @throws MWExcepion - */ - private function addRevision( $page, $text, $summary ) { - $status = $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), $summary ); - if ( $status->isGood() ) { - $value = $status->getValue(); - $revision = $value['revision']; - $id = $revision->getTextId(); - if ( $id > 0 ) { - return $id; - } - } - throw new MWException( "Could not determine text id" ); - } - - - function addDBData() { - $this->tablesUsed[] = 'page'; - $this->tablesUsed[] = 'revision'; - $this->tablesUsed[] = 'text'; - - $wikitextNamespace = $this->getDefaultWikitextNS(); - - try { - $title = Title::newFromText( 'FetchTextTestPage1', $wikitextNamespace ); - $page = WikiPage::factory( $title ); - $this->textId1 = $this->addRevision( $page, "FetchTextTestPage1Text1", "FetchTextTestPage1Summary1" ); - - $title = Title::newFromText( 'FetchTextTestPage2', $wikitextNamespace ); - $page = WikiPage::factory( $title ); - $this->textId2 = $this->addRevision( $page, "FetchTextTestPage2Text1", "FetchTextTestPage2Summary1" ); - $this->textId3 = $this->addRevision( $page, "FetchTextTestPage2Text2", "FetchTextTestPage2Summary2" ); - $this->textId4 = $this->addRevision( $page, "FetchTextTestPage2Text3", "FetchTextTestPage2Summary3" ); - $this->textId5 = $this->addRevision( $page, "FetchTextTestPage2Text4 some additional Text ", "FetchTextTestPage2Summary4 extra " ); - } catch ( Exception $e ) { - // We'd love to pass $e directly. However, ... see - // documentation of exceptionFromAddDBData - $this->exceptionFromAddDBData = $e; - } - } - - - protected function setUp() { - parent::setUp(); - - // Check if any Exception is stored for rethrowing from addDBData - if ( $this->exceptionFromAddDBData !== null ) { - throw $this->exceptionFromAddDBData; - } - - $this->fetchText = new SemiMockedFetchText(); - } - - - /** - * Helper to relate FetchText's input and output - */ - private function assertFilter( $input, $expectedOutput ) { - $this->fetchText->mockStdin( $input ); - $this->fetchText->execute(); - $invocations = $this->fetchText->mockGetInvocations(); - $this->assertEquals( 1, $invocations['getStdin'], - "getStdin invocation counter" ); - $this->expectOutputString( $expectedOutput ); - } - - - // Instead of the following functions, a data provider would be great. - // However, as data providers are evaluated /before/ addDBData, a data - // provider would not know the required ids. - - function testExistingSimple() { - $this->assertFilter( $this->textId2, - $this->textId2 . "\n23\nFetchTextTestPage2Text1" ); - } - - function testExistingSimpleWithNewline() { - $this->assertFilter( $this->textId2 . "\n", - $this->textId2 . "\n23\nFetchTextTestPage2Text1" ); - } - - function testExistingSeveral() { - $this->assertFilter( "$this->textId1\n$this->textId5\n" - . "$this->textId3\n$this->textId3", - implode( "", array( - $this->textId1 . "\n23\nFetchTextTestPage1Text1", - $this->textId5 . "\n44\nFetchTextTestPage2Text4 " - . "some additional Text", - $this->textId3 . "\n23\nFetchTextTestPage2Text2", - $this->textId3 . "\n23\nFetchTextTestPage2Text2" - ) ) ); - } - - function testEmpty() { - $this->assertFilter( "", null ); - } - - function testNonExisting() { - $this->assertFilter( $this->textId5 + 10, ( $this->textId5 + 10 ) . "\n-1\n" ); - } - - function testNegativeInteger() { - $this->assertFilter( "-42", "-42\n-1\n" ); - } - - function testFloatingPointNumberExisting() { - // float -> int -> revision - $this->assertFilter( $this->textId3 + 0.14159, - $this->textId3 . "\n23\nFetchTextTestPage2Text2" ); - } - - function testFloatingPointNumberNonExisting() { - $this->assertFilter( $this->textId5 + 3.14159, - ( $this->textId5 + 3 ) . "\n-1\n" ); - } - - function testCharacters() { - $this->assertFilter( "abc", "0\n-1\n" ); - } - - function testMix() { - $this->assertFilter( "ab\n" . $this->textId4 . ".5cd\n\nefg\n" . $this->textId2 - . "\n" . $this->textId3, - implode( "", array( - "0\n-1\n", - $this->textId4 . "\n23\nFetchTextTestPage2Text3", - "0\n-1\n", - "0\n-1\n", - $this->textId2 . "\n23\nFetchTextTestPage2Text1", - $this->textId3 . "\n23\nFetchTextTestPage2Text2" - ) ) ); - } -} diff --git a/tests/phpunit/maintenance/getSlaveServerTest.php b/tests/phpunit/maintenance/getSlaveServerTest.php deleted file mode 100644 index 2c848862..00000000 --- a/tests/phpunit/maintenance/getSlaveServerTest.php +++ /dev/null @@ -1,67 +0,0 @@ -db->getType() === 'sqlite' ) { - // for SQLite, only the empty string is a good server name - return ''; - } - - $octet = '([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])'; - $ip = "(($octet\.){3}$octet)"; - - $label = '([a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)'; - $hostname = "($label(\.$label)*)"; - - return "($ip|$hostname)(:[0-9]{1,5})?"; - } - - function testPlain() { - $gss = new GetSlaveServer(); - $gss->execute(); - - $this->expectOutputRegex( "/^" . self::getServerRE() . "\n$/D" ); - } - - function testXmlDumpsBackupUseCase() { - global $wgDBprefix; - - global $argv; - $argv = array( null, "--globals" ); - - $gss = new GetSlaveServer(); - $gss->loadParamsAndArgs(); - $gss->execute(); - $gss->globals(); - - // The main answer - $output = $this->getActualOutput(); - $firstLineEndPos = strpos( $output, "\n" ); - if ( $firstLineEndPos === false ) { - $this->fail( "Could not find end of first line of output" ); - } - $firstLine = substr( $output, 0, $firstLineEndPos ); - $this->assertRegExp( "/^" . self::getServerRE() . "$/D", - $firstLine, "DB Server" ); - - // xmldumps-backup relies on the wgDBprefix in the output. - $this->expectOutputRegex( "/^[[:space:]]*\[wgDBprefix\][[:space:]]*=> " - . $wgDBprefix . "$/m" ); - } -} diff --git a/tests/phpunit/mocks/filebackend/MockFSFile.php b/tests/phpunit/mocks/filebackend/MockFSFile.php deleted file mode 100644 index e0463281..00000000 --- a/tests/phpunit/mocks/filebackend/MockFSFile.php +++ /dev/null @@ -1,69 +0,0 @@ - $this->exists(), - 'size' => $this->getSize(), - 'file-mime' => $this->getMimeType(), - 'sha1' => $this->getSha1Base36(), - ); - } - - public function getSha1Base36( $recache = false ) { - return '1234567890123456789012345678901'; - } -} diff --git a/tests/phpunit/mocks/filebackend/MockFileBackend.php b/tests/phpunit/mocks/filebackend/MockFileBackend.php deleted file mode 100644 index 49aefbd1..00000000 --- a/tests/phpunit/mocks/filebackend/MockFileBackend.php +++ /dev/null @@ -1,122 +0,0 @@ - - */ - -/** - * Class simulating a backend store. - * - * @ingroup FileBackend - * @since 1.22 - */ -class MockFileBackend extends FileBackendStore { - - protected $mocked = array(); - - /** Poor man debugging */ - protected function debug( $msg = '' ) { - wfDebug( wfGetCaller() . "$msg\n" ); - } - - public function isPathUsableInternal( $storagePath ) { - return true; - } - - protected function doCreateInternal( array $params ) { - if ( isset( $params['content'] ) ) { - $content = $params['content']; - } else { - $content = 'Default mocked file content'; - } - $this->debug( serialize( $params ) ); - $dst = $params['dst']; - $this->mocked[$dst] = $content; - return Status::newGood(); - } - - protected function doStoreInternal( array $params ) { - $this->debug( serialize( $params ) ); - return $this->doCreateInternal( $params ); - } - - protected function doCopyInternal( array $params ) { - $this->debug( serialize( $params ) ); - $src = $params['src']; - $dst = $params['dst']; - $this->mocked[$dst] = $this->mocked[$src]; - return Status::newGood(); - } - - protected function doDeleteInternal( array $params ) { - $this->debug( serialize( $params ) ); - $src = $params['src']; - unset( $this->mocked[$src] ); - return Status::newGood(); - } - - protected function doGetFileStat( array $params ) { - $src = $params['src']; - if ( array_key_exists( $src, $this->mocked ) ) { - $this->debug( "('$src') found" ); - return array( - 'mtime' => wfTimestamp( TS_MW ), - 'size' => strlen( $this->mocked[$src] ), - # No sha1, stat does not need it. - ); - } else { - $this->debug( "('$src') not found" ); - return false; - } - } - - protected function doGetLocalCopyMulti( array $params ) { - $tmpFiles = array(); // (path => MockFSFile) - - $this->debug( '(' . serialize( $params ) . ')' ); - foreach ( $params['srcs'] as $src ) { - $tmpFiles[$src] = new MockFSFile( - wfTempDir() . '/' . wfRandomString( 32 ) - ); - } - return $tmpFiles; - } - - protected function doDirectoryExists( $container, $dir, array $params ) { - $this->debug(); - return true; - } - - public function getDirectoryListInternal( $container, $dir, array $params ) { - $this->debug(); - return array(); - } - - public function getFileListInternal( $container, $dir, array $params ) { - $this->debug(); - return array(); - } - - protected function directoriesAreVirtual() { - $this->debug(); - return true; - } -} diff --git a/tests/phpunit/mocks/media/MockBitmapHandler.php b/tests/phpunit/mocks/media/MockBitmapHandler.php deleted file mode 100644 index 742b41e4..00000000 --- a/tests/phpunit/mocks/media/MockBitmapHandler.php +++ /dev/null @@ -1,92 +0,0 @@ -getClientScalingThumbnailImage( $image, $scalerParams ); - } -} -class MockSvgHandler extends SvgHandler { - function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) { - return MockImageHandler::doFakeTransform( $this, $image, $dstPath, $dstUrl, $params, $flags ); - } -} -/** - * Mock handler for images. - * - * This is really intended for unit testing. - * - * @ingroup Media - */ -class MockImageHandler { - - /** - * Override BitmapHandler::doTransform() making sure we do not generate - * a thumbnail at all. That is merely returning a ThumbnailImage that - * will be consumed by the unit test. There is no need to create a real - * thumbnail on the filesystem. - */ - static function doFakeTransform( $that, $image, $dstPath, $dstUrl, $params, $flags = 0 ) { - # Example of what we receive: - # $image: LocalFile - # $dstPath: /tmp/transform_7d0a7a2f1a09-1.jpg - # $dstUrl : http://example.com/images/thumb/0/09/Bad.jpg/320px-Bad.jpg - # $params: width: 320, descriptionUrl http://trunk.dev/wiki/File:Bad.jpg - - $that->normaliseParams( $image, $params ); - - $scalerParams = array( - # The size to which the image will be resized - 'physicalWidth' => $params['physicalWidth'], - 'physicalHeight' => $params['physicalHeight'], - 'physicalDimensions' => "{$params['physicalWidth']}x{$params['physicalHeight']}", - # The size of the image on the page - 'clientWidth' => $params['width'], - 'clientHeight' => $params['height'], - # Comment as will be added to the EXIF of the thumbnail - 'comment' => isset( $params['descriptionUrl'] ) ? - "File source: {$params['descriptionUrl']}" : '', - # Properties of the original image - 'srcWidth' => $image->getWidth(), - 'srcHeight' => $image->getHeight(), - 'mimeType' => $image->getMimeType(), - 'dstPath' => $dstPath, - 'dstUrl' => $dstUrl, - ); - - # In some cases, we do not bother generating a thumbnail. - if ( !$image->mustRender() && - $scalerParams['physicalWidth'] == $scalerParams['srcWidth'] - && $scalerParams['physicalHeight'] == $scalerParams['srcHeight'] - ) { - wfDebug( __METHOD__ . ": returning unscaled image\n" ); - // getClientScalingThumbnailImage is protected - return $that->doClientImage( $image, $scalerParams ); - } - - return new ThumbnailImage( $image, $dstUrl, false, $params ); - } -} diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php deleted file mode 100644 index 1d65e521..00000000 --- a/tests/phpunit/phpunit.php +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env php -addOption( 'with-phpunitdir', - 'Directory to include PHPUnit from, for example when using a git fetchout from upstream. Path will be prepended to PHP `include_path`.', - false, # not required - true # need arg - ); - } - - public function finalSetup() { - parent::finalSetup(); - - global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType; - global $wgLanguageConverterCacheType, $wgUseDatabaseMessages; - global $wgLocaltimezone, $wgLocalisationCacheConf; - global $wgDevelopmentWarnings; - - // Inject test autoloader - require_once __DIR__ . '/../TestsAutoLoader.php'; - - // wfWarn should cause tests to fail - $wgDevelopmentWarnings = true; - - $wgMainCacheType = CACHE_NONE; - $wgMessageCacheType = CACHE_NONE; - $wgParserCacheType = CACHE_NONE; - $wgLanguageConverterCacheType = CACHE_NONE; - - $wgUseDatabaseMessages = false; # Set for future resets - - // Assume UTC for testing purposes - $wgLocaltimezone = 'UTC'; - - $wgLocalisationCacheConf['storeClass'] = 'LCStore_Null'; - - // Bug 44192 Do not attempt to send a real e-mail - Hooks::clear( 'AlternateUserMailer' ); - Hooks::register( - 'AlternateUserMailer', - function () { - return false; - } - ); - } - - public function execute() { - global $IP; - - # Make sure we have --configuration or PHPUnit might complain - if ( !in_array( '--configuration', $_SERVER['argv'] ) ) { - //Hack to eliminate the need to use the Makefile (which sucks ATM) - array_splice( $_SERVER['argv'], 1, 0, - array( '--configuration', $IP . '/tests/phpunit/suite.xml' ) ); - } - - # --with-phpunitdir let us override the default PHPUnit version - if ( $phpunitDir = $this->getOption( 'with-phpunitdir' ) ) { - # Sanity checks - if ( !is_dir( $phpunitDir ) ) { - $this->error( "--with-phpunitdir should be set to an existing directory", 1 ); - } - if ( !is_readable( $phpunitDir . "/PHPUnit/Runner/Version.php" ) ) { - $this->error( "No usable PHPUnit installation in $phpunitDir.\nAborting.\n", 1 ); - } - - # Now prepends provided PHPUnit directory - $this->output( "Will attempt loading PHPUnit from `$phpunitDir`\n" ); - set_include_path( $phpunitDir - . PATH_SEPARATOR . get_include_path() ); - - # Cleanup $args array so the option and its value do not - # pollute PHPUnit - $key = array_search( '--with-phpunitdir', $_SERVER['argv'] ); - unset( $_SERVER['argv'][$key] ); // the option - unset( $_SERVER['argv'][$key + 1] ); // its value - $_SERVER['argv'] = array_values( $_SERVER['argv'] ); - } - } - - public function getDbType() { - return Maintenance::DB_ADMIN; - } -} - -$maintClass = 'PHPUnitMaintClass'; -require RUN_MAINTENANCE_IF_MAIN; - -if ( !class_exists( 'PHPUnit_Runner_Version' ) ) { - require_once 'PHPUnit/Runner/Version.php'; -} - -if ( PHPUnit_Runner_Version::id() !== '@package_version@' - && version_compare( PHPUnit_Runner_Version::id(), '3.6.7', '<' ) -) { - die( 'PHPUnit 3.6.7 or later required, you have ' . PHPUnit_Runner_Version::id() . ".\n" ); -} - -if ( !class_exists( 'PHPUnit_TextUI_Command' ) ) { - require_once 'PHPUnit/Autoload.php'; -} -MediaWikiPHPUnitCommand::main(); diff --git a/tests/phpunit/run-tests.bat b/tests/phpunit/run-tests.bat deleted file mode 100644 index e6eb3e0c..00000000 --- a/tests/phpunit/run-tests.bat +++ /dev/null @@ -1 +0,0 @@ -php phpunit.php --configuration suite.xml %* diff --git a/tests/phpunit/skins/SideBarTest.php b/tests/phpunit/skins/SideBarTest.php deleted file mode 100644 index a385320f..00000000 --- a/tests/phpunit/skins/SideBarTest.php +++ /dev/null @@ -1,206 +0,0 @@ -messages array */ - private function initMessagesHref() { - # List of default messages for the sidebar: - $URL_messages = array( - 'mainpage', - 'portal-url', - 'currentevents-url', - 'recentchanges-url', - 'randompage-url', - 'helppage', - ); - - foreach ( $URL_messages as $m ) { - $titleName = MessageCache::singleton()->get( $m ); - $title = Title::newFromText( $titleName ); - $this->messages[$m]['href'] = $title->getLocalURL(); - } - } - - protected function setUp() { - parent::setUp(); - $this->initMessagesHref(); - $this->skin = new SkinTemplate(); - $this->skin->getContext()->setLanguage( Language::factory( 'en' ) ); - } - - /** - * Internal helper to test the sidebar - * @param $expected - * @param $text - * @param $message (Default: '') - * @todo this assert method to should be converted to a test using a dataprovider.. - */ - private function assertSideBar( $expected, $text, $message = '' ) { - $bar = array(); - $this->skin->addToSidebarPlain( $bar, $text ); - $this->assertEquals( $expected, $bar, $message ); - } - - /** - * @covers SkinTemplate::addToSidebarPlain - */ - public function testSidebarWithOnlyTwoTitles() { - $this->assertSideBar( - array( - 'Title1' => array(), - 'Title2' => array(), - ), - '* Title1 -* Title2 -' - ); - } - - /** - * @covers SkinTemplate::addToSidebarPlain - */ - public function testExpandMessages() { - $this->assertSidebar( - array( 'Title' => array( - array( - 'text' => 'Help', - 'href' => $this->messages['helppage']['href'], - 'id' => 'n-help', - 'active' => null - ) - ) ), - '* Title -** helppage|help -' - ); - } - - /** - * @covers SkinTemplate::addToSidebarPlain - */ - public function testExternalUrlsRequireADescription() { - $this->assertSidebar( - array( 'Title' => array( - # ** http://www.mediawiki.org/| Home - array( - 'text' => 'Home', - 'href' => 'http://www.mediawiki.org/', - 'id' => 'n-Home', - 'active' => null, - 'rel' => 'nofollow', - ), - # ** http://valid.no.desc.org/ - # ... skipped since it is missing a pipe with a description - ) ), - '* Title -** http://www.mediawiki.org/| Home -** http://valid.no.desc.org/ -' - ); - } - - /** - * bug 33321 - Make sure there's a | after transforming. - * @group Database - * @covers SkinTemplate::addToSidebarPlain - */ - public function testTrickyPipe() { - $this->assertSidebar( - array( 'Title' => array( - # The first 2 are skipped - # Doesn't really test the url properly - # because it will vary with $wgArticlePath et al. - # ** Baz|Fred - array( - 'text' => 'Fred', - 'href' => Title::newFromText( 'Baz' )->getLocalURL(), - 'id' => 'n-Fred', - 'active' => null, - ), - array( - 'text' => 'title-to-display', - 'href' => Title::newFromText( 'page-to-go-to' )->getLocalURL(), - 'id' => 'n-title-to-display', - 'active' => null, - ), - ) ), - '* Title -** {{PAGENAME|Foo}} -** Bar -** Baz|Fred -** {{PLURAL:1|page-to-go-to{{int:pipe-separator/en}}title-to-display|branch not taken}} -' - ); - } - - - #### Attributes for external links ########################## - private function getAttribs() { - # Sidebar text we will use everytime - $text = '* Title -** http://www.mediawiki.org/| Home'; - - $bar = array(); - $this->skin->addToSideBarPlain( $bar, $text ); - - return $bar['Title'][0]; - } - - /** - * Simple test to verify our helper assertAttribs() is functional - */ - public function testTestAttributesAssertionHelper() { - $this->setMwGlobals( array( - 'wgNoFollowLinks' => true, - 'wgExternalLinkTarget' => false, - ) ); - $attribs = $this->getAttribs(); - - $this->assertArrayHasKey( 'rel', $attribs ); - $this->assertEquals( 'nofollow', $attribs['rel'] ); - - $this->assertArrayNotHasKey( 'target', $attribs ); - } - - /** - * Test $wgNoFollowLinks in sidebar - */ - public function testRespectWgnofollowlinks() { - $this->setMwGlobals( 'wgNoFollowLinks', false ); - - $attribs = $this->getAttribs(); - $this->assertArrayNotHasKey( 'rel', $attribs, - 'External URL in sidebar do not have rel=nofollow when $wgNoFollowLinks = false' - ); - } - - /** - * Test $wgExternaLinkTarget in sidebar - * @dataProvider dataRespectExternallinktarget - */ - public function testRespectExternallinktarget( $externalLinkTarget ) { - $this->setMwGlobals( 'wgExternalLinkTarget', $externalLinkTarget ); - - $attribs = $this->getAttribs(); - $this->assertArrayHasKey( 'target', $attribs ); - $this->assertEquals( $attribs['target'], $externalLinkTarget ); - } - - public static function dataRespectExternallinktarget() { - return array( - array( '_blank' ), - array( '_self' ), - ); - } -} diff --git a/tests/phpunit/structure/AutoLoaderTest.php b/tests/phpunit/structure/AutoLoaderTest.php deleted file mode 100644 index 205ea360..00000000 --- a/tests/phpunit/structure/AutoLoaderTest.php +++ /dev/null @@ -1,56 +0,0 @@ -assertEquals( - $results['expected'], - $results['actual'] - ); - } - - protected static function checkAutoLoadConf() { - global $wgAutoloadLocalClasses, $wgAutoloadClasses, $IP; - $supportsParsekit = function_exists( 'parsekit_compile_file' ); - - // wgAutoloadLocalClasses has precedence, just like in includes/AutoLoader.php - $expected = $wgAutoloadLocalClasses + $wgAutoloadClasses; - $actual = array(); - - $files = array_unique( $expected ); - - foreach ( $files as $file ) { - // Only prefix $IP if it doesn't have it already. - // Generally local classes don't have it, and those from extensions and test suites do. - if ( substr( $file, 0, 1 ) != '/' && substr( $file, 1, 1 ) != ':' ) { - $filePath = "$IP/$file"; - } else { - $filePath = $file; - } - if ( $supportsParsekit ) { - $parseInfo = parsekit_compile_file( "$filePath" ); - $classes = array_keys( $parseInfo['class_table'] ); - } else { - $contents = file_get_contents( "$filePath" ); - $m = array(); - preg_match_all( '/\n\s*(?:final)?\s*(?:abstract)?\s*(?:class|interface)\s+([a-zA-Z0-9_]+)/', $contents, $m, PREG_PATTERN_ORDER ); - $classes = $m[1]; - } - foreach ( $classes as $class ) { - $actual[$class] = $file; - } - } - - return array( - 'expected' => $expected, - 'actual' => $actual, - ); - } -} diff --git a/tests/phpunit/structure/ResourcesTest.php b/tests/phpunit/structure/ResourcesTest.php deleted file mode 100644 index fe823fa4..00000000 --- a/tests/phpunit/structure/ResourcesTest.php +++ /dev/null @@ -1,131 +0,0 @@ -assertFileExists( $filename, - "File '$resource' referenced by '$module' must exist." - ); - } - - /** - * This ask the ResouceLoader for all registered files from modules - * created by ResourceLoaderFileModule (or one of its descendants). - * - * - * Since the raw data is stored in protected properties, we have to - * overrride this through ReflectionObject methods. - */ - public static function provideResourceFiles() { - global $wgEnableJavaScriptTest; - - // Test existance of test suite files as well - // (can't use setUp or setMwGlobals because providers are static) - $live_wgEnableJavaScriptTest = $wgEnableJavaScriptTest; - $wgEnableJavaScriptTest = true; - - // Array with arguments for the test function - $cases = array(); - - // Initialize ResourceLoader - $rl = new ResourceLoader(); - - // See also ResourceLoaderFileModule::__construct - $filePathProps = array( - // Lists of file paths - 'lists' => array( - 'scripts', - 'debugScripts', - 'loaderScripts', - 'styles', - ), - - // Collated lists of file paths - 'nested-lists' => array( - 'languageScripts', - 'skinScripts', - 'skinStyles', - ), - ); - - foreach ( $rl->getModuleNames() as $moduleName ) { - $module = $rl->getModule( $moduleName ); - if ( !$module instanceof ResourceLoaderFileModule ) { - continue; - } - - $reflectedModule = new ReflectionObject( $module ); - - $files = array(); - - foreach ( $filePathProps['lists'] as $propName ) { - $property = $reflectedModule->getProperty( $propName ); - $property->setAccessible( true ); - $list = $property->getValue( $module ); - foreach ( $list as $key => $value ) { - // 'scripts' are numeral arrays. - // 'styles' can be numeral or associative. - // In case of associative the key is the file path - // and the value is the 'media' attribute. - if ( is_int( $key ) ) { - $files[] = $value; - } else { - $files[] = $key; - } - } - } - - foreach ( $filePathProps['nested-lists'] as $propName ) { - $property = $reflectedModule->getProperty( $propName ); - $property->setAccessible( true ); - $lists = $property->getValue( $module ); - foreach ( $lists as $list ) { - foreach ( $list as $key => $value ) { - // We need the same filter as for 'lists', - // due to 'skinStyles'. - if ( is_int( $key ) ) { - $files[] = $value; - } else { - $files[] = $key; - } - } - } - } - - // Get method for resolving the paths to full paths - $method = $reflectedModule->getMethod( 'getLocalPath' ); - $method->setAccessible( true ); - - // Populate cases - foreach ( $files as $file ) { - $cases[] = array( - $method->invoke( $module, $file ), - $module->getName(), - $file, - ); - } - } - - // Restore settings - $wgEnableJavaScriptTest = $live_wgEnableJavaScriptTest; - - return $cases; - } -} diff --git a/tests/phpunit/structure/StructureTest.php b/tests/phpunit/structure/StructureTest.php deleted file mode 100644 index df00d4df..00000000 --- a/tests/phpunit/structure/StructureTest.php +++ /dev/null @@ -1,63 +0,0 @@ -markTestSkipped( 'This test does not work on Windows' ); - } - $rootPath = escapeshellarg( __DIR__ . '/..' ); - $testClassRegex = implode( '|', array( - 'ApiFormatTestBase', - 'ApiTestCase', - 'ApiQueryTestBase', - 'ApiQueryContinueTestBase', - 'MediaWikiLangTestCase', - 'MediaWikiTestCase', - 'PHPUnit_Framework_TestCase', - 'DumpTestCase', - ) ); - $testClassRegex = "^class .* extends ($testClassRegex)"; - $finder = "find $rootPath -name '*.php' '!' -name '*Test.php'" . - " | xargs grep -El '$testClassRegex|function suite\('"; - - $results = null; - $exitCode = null; - exec( $finder, $results, $exitCode ); - - $this->assertEquals( - 0, - $exitCode, - 'Verify find/grep command succeeds.' - ); - - $results = array_filter( - $results, - array( $this, 'filterSuites' ) - ); - $strip = strlen( $rootPath ) - 1; - foreach ( $results as $k => $v ) { - $results[$k] = substr( $v, $strip ); - } - $this->assertEquals( - array(), - $results, - "Unit test file in $rootPath must end with Test." - ); - } - - /** - * Filter to remove testUnitTestFileNamesEndWithTest false positives. - */ - public function filterSuites( $filename ) { - return strpos( $filename, __DIR__ . '/../suites/' ) !== 0; - } -} diff --git a/tests/phpunit/suite.xml b/tests/phpunit/suite.xml deleted file mode 100644 index 7a9122fa..00000000 --- a/tests/phpunit/suite.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - includes - - - languages - - - skins - - - - maintenance - - - structure - - - suites/UploadFromUrlTestSuite.php - - - suites/ExtensionsTestSuite.php - suites/ExtensionsParserTestSuite.php - - - - - Utility - Broken - ParserFuzz - Stub - - - diff --git a/tests/phpunit/suites/ExtensionsParserTestSuite.php b/tests/phpunit/suites/ExtensionsParserTestSuite.php deleted file mode 100644 index 3d68b241..00000000 --- a/tests/phpunit/suites/ExtensionsParserTestSuite.php +++ /dev/null @@ -1,8 +0,0 @@ -addTestFile( $file ); - } - if ( !count( $files ) ) { - $this->addTest( new DummyExtensionsTest( 'testNothing' ) ); - } - } - - public static function suite() { - return new self; - } -} - -/** - * Needed to avoid warnings like 'No tests found in class "ExtensionsTestSuite".' - * when no extensions with tests are used. - */ -class DummyExtensionsTest extends MediaWikiTestCase { - public function testNothing() { - $this->assertTrue( true ); - } -} diff --git a/tests/phpunit/suites/UploadFromUrlTestSuite.php b/tests/phpunit/suites/UploadFromUrlTestSuite.php deleted file mode 100644 index 7eb599e3..00000000 --- a/tests/phpunit/suites/UploadFromUrlTestSuite.php +++ /dev/null @@ -1,207 +0,0 @@ - 'LocalRepo', - 'name' => 'local', - 'url' => 'http://example.com/images', - 'hashLevels' => 2, - 'transformVia404' => false, - 'backend' => new FSFileBackend( array( - 'name' => 'local-backend', - 'lockManager' => 'fsLockManager', - 'containerPaths' => array( - 'local-public' => wfTempDir() . '/test-repo/public', - 'local-thumb' => wfTempDir() . '/test-repo/thumb', - 'local-temp' => wfTempDir() . '/test-repo/temp', - 'local-deleted' => wfTempDir() . '/test-repo/delete', - ) - ) ), - ); - foreach ( $tmpGlobals as $var => $val ) { - if ( array_key_exists( $var, $GLOBALS ) ) { - $this->savedGlobals[$var] = $GLOBALS[$var]; - } - $GLOBALS[$var] = $val; - } - - $wgNamespaceProtection[NS_MEDIAWIKI] = 'editinterface'; - $wgNamespaceAliases['Image'] = NS_FILE; - $wgNamespaceAliases['Image_talk'] = NS_FILE_TALK; - - $wgEnableParserCache = false; - DeferredUpdates::clearPendingUpdates(); - $wgMemc = wfGetMainCache(); - $messageMemc = wfGetMessageCacheStorage(); - $parserMemc = wfGetParserCacheStorage(); - - // $wgContLang = new StubContLang; - $wgUser = new User; - $context = new RequestContext; - $wgLang = $context->getLanguage(); - $wgOut = $context->getOutput(); - $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) ); - $wgRequest = $context->getRequest(); - - if ( $wgStyleDirectory === false ) { - $wgStyleDirectory = "$IP/skins"; - } - - RepoGroup::destroySingleton(); - FileBackendGroup::destroySingleton(); - } - - protected function tearDown() { - foreach ( $this->savedGlobals as $var => $val ) { - $GLOBALS[$var] = $val; - } - // Restore backends - RepoGroup::destroySingleton(); - FileBackendGroup::destroySingleton(); - - $this->teardownUploadDir( $this->uploadDir ); - - parent::tearDown(); - } - - private $uploadDir; - private $keepUploads; - - /** - * Remove the dummy uploads directory - */ - private function teardownUploadDir( $dir ) { - if ( $this->keepUploads ) { - return; - } - - // delete the files first, then the dirs. - self::deleteFiles( - array( - "$dir/3/3a/Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg", - - "$dir/0/09/Bad.jpg", - ) - ); - - self::deleteDirs( - array( - "$dir/3/3a", - "$dir/3", - "$dir/thumb/6/65", - "$dir/thumb/6", - "$dir/thumb/3/3a/Foobar.jpg", - "$dir/thumb/3/3a", - "$dir/thumb/3", - - "$dir/0/09/", - "$dir/0/", - - "$dir/thumb", - "$dir", - ) - ); - } - - /** - * Delete the specified files, if they exist. - * - * @param $files Array: full paths to files to delete. - */ - private static function deleteFiles( $files ) { - foreach ( $files as $file ) { - if ( file_exists( $file ) ) { - unlink( $file ); - } - } - } - - /** - * Delete the specified directories, if they exist. Must be empty. - * - * @param $dirs Array: full paths to directories to delete. - */ - private static function deleteDirs( $dirs ) { - foreach ( $dirs as $dir ) { - if ( is_dir( $dir ) ) { - rmdir( $dir ); - } - } - } - - /** - * Create a dummy uploads directory which will contain a couple - * of files in order to pass existence tests. - * - * @return String: the directory - */ - private function setupUploadDir() { - global $IP; - - if ( $this->keepUploads ) { - $dir = wfTempDir() . '/mwParser-images'; - - if ( is_dir( $dir ) ) { - return $dir; - } - } else { - $dir = wfTempDir() . "/mwParser-" . mt_rand() . "-images"; - } - - wfDebug( "Creating upload directory $dir\n" ); - - if ( file_exists( $dir ) ) { - wfDebug( "Already exists!\n" ); - - return $dir; - } - - wfMkdirParents( $dir . '/3/3a', null, __METHOD__ ); - copy( "$IP/skins/monobook/headbg.jpg", "$dir/3/3a/Foobar.jpg" ); - - wfMkdirParents( $dir . '/0/09', null, __METHOD__ ); - copy( "$IP/skins/monobook/headbg.jpg", "$dir/0/09/Bad.jpg" ); - - return $dir; - } - - public static function suite() { - // Hack to invoke the autoloader required to get phpunit to recognize - // the UploadFromUrlTest class - class_exists( 'UploadFromUrlTest' ); - $suite = new UploadFromUrlTestSuite( 'UploadFromUrlTest' ); - - return $suite; - } -} diff --git a/tests/qunit/.htaccess b/tests/qunit/.htaccess deleted file mode 100644 index 605d2f4c..00000000 --- a/tests/qunit/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Allow from all diff --git a/tests/qunit/QUnitTestResources.php b/tests/qunit/QUnitTestResources.php deleted file mode 100644 index c8743750..00000000 --- a/tests/qunit/QUnitTestResources.php +++ /dev/null @@ -1,68 +0,0 @@ - array( - 'scripts' => array( - 'tests/qunit/suites/resources/startup.test.js', - 'tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js', - 'tests/qunit/suites/resources/jquery/jquery.byteLength.test.js', - 'tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js', - 'tests/qunit/suites/resources/jquery/jquery.client.test.js', - 'tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js', - 'tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js', - 'tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js', - 'tests/qunit/suites/resources/jquery/jquery.hidpi.test.js', - 'tests/qunit/suites/resources/jquery/jquery.highlightText.test.js', - 'tests/qunit/suites/resources/jquery/jquery.localize.test.js', - 'tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js', - 'tests/qunit/suites/resources/jquery/jquery.mwExtension.test.js', - 'tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js', - 'tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js', - 'tests/qunit/suites/resources/jquery/jquery.textSelection.test.js', - 'tests/qunit/data/mediawiki.jqueryMsg.data.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.jscompat.test.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.test.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js', - 'tests/qunit/suites/resources/mediawiki.api/mediawiki.api.test.js', - 'tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js', - 'tests/qunit/suites/resources/mediawiki.special/mediawiki.special.recentchanges.test.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.cldr.test.js', - ), - 'dependencies' => array( - 'jquery.autoEllipsis', - 'jquery.byteLength', - 'jquery.byteLimit', - 'jquery.client', - 'jquery.colorUtil', - 'jquery.delayedBind', - 'jquery.getAttrs', - 'jquery.hidpi', - 'jquery.highlightText', - 'jquery.localize', - 'jquery.makeCollapsible', - 'jquery.mwExtension', - 'jquery.tabIndex', - 'jquery.tablesorter', - 'jquery.textSelection', - 'mediawiki', - 'mediawiki.api', - 'mediawiki.api.parse', - 'mediawiki.jqueryMsg', - 'mediawiki.Title', - 'mediawiki.Uri', - 'mediawiki.user', - 'mediawiki.util', - 'mediawiki.special.recentchanges', - 'mediawiki.language', - 'mediawiki.cldr', - ), - ) -); diff --git a/tests/qunit/data/callMwLoaderTestCallback.js b/tests/qunit/data/callMwLoaderTestCallback.js deleted file mode 100644 index dd034115..00000000 --- a/tests/qunit/data/callMwLoaderTestCallback.js +++ /dev/null @@ -1 +0,0 @@ -mediaWiki.loader.testCallback(); diff --git a/tests/qunit/data/generateJqueryMsgData.php b/tests/qunit/data/generateJqueryMsgData.php deleted file mode 100644 index 12e5a2dc..00000000 --- a/tests/qunit/data/generateJqueryMsgData.php +++ /dev/null @@ -1,150 +0,0 @@ - - QUnit.test( 'Output matches PHP parser', mw.libs.phpParserData.tests.length, function ( assert ) { - mw.messages.set( mw.libs.phpParserData.messages ); - $.each( mw.libs.phpParserData.tests, function ( i, test ) { - QUnit.stop(); - getMwLanguage( test.lang, function ( langClass ) { - var parser = new mw.jqueryMsg.parser( { language: langClass } ); - assert.equal( - parser.parse( test.key, test.args ).html(), - test.result, - test.name - ); - QUnit.start(); - } ); - } ); - }); - * - * - * @example Jasmine - * - describe( 'match output to output from PHP parser', function () { - mw.messages.set( mw.libs.phpParserData.messages ); - $.each( mw.libs.phpParserData.tests, function ( i, test ) { - it( 'should parse ' + test.name, function () { - var langClass; - runs( function () { - getMwLanguage( test.lang, function ( gotIt ) { - langClass = gotIt; - }); - }); - waitsFor( function () { - return langClass !== undefined; - }, 'Language class should be loaded', 1000 ); - runs( function () { - console.log( test.lang, 'running tests' ); - var parser = new mw.jqueryMsg.parser( { language: langClass } ); - expect( - parser.parse( test.key, test.args ).html() - ).toEqual( test.result ); - } ); - } ); - } ); - } ); - * - */ - -require __DIR__ . '/../../../maintenance/Maintenance.php'; - -class GenerateJqueryMsgData extends Maintenance { - - static $keyToTestArgs = array( - 'undelete_short' => array( - array( 0 ), - array( 1 ), - array( 2 ), - array( 5 ), - array( 21 ), - array( 101 ) - ), - 'category-subcat-count' => array( - array( 0, 10 ), - array( 1, 1 ), - array( 1, 2 ), - array( 3, 30 ) - ) - ); - - public function __construct() { - parent::__construct(); - $this->mDescription = 'Create a specification for message parsing ini JSON format'; - // add any other options here - } - - public function execute() { - list( $messages, $tests ) = $this->getMessagesAndTests(); - $this->writeJavascriptFile( $messages, $tests, __DIR__ . '/mediawiki.jqueryMsg.data.js' ); - } - - private function getMessagesAndTests() { - $messages = array(); - $tests = array(); - foreach ( array( 'en', 'fr', 'ar', 'jp', 'zh' ) as $languageCode ) { - foreach ( self::$keyToTestArgs as $key => $testArgs ) { - foreach ( $testArgs as $args ) { - // Get the raw message, without any transformations. - $template = wfMessage( $key )->inLanguage( $languageCode )->plain(); - - // Get the magic-parsed version with args. - $result = wfMessage( $key, $args )->inLanguage( $languageCode )->text(); - - // Record the template, args, language, and expected result - // fake multiple languages by flattening them together. - $langKey = $languageCode . '_' . $key; - $messages[$langKey] = $template; - $tests[] = array( - 'name' => $languageCode . ' ' . $key . ' ' . join( ',', $args ), - 'key' => $langKey, - 'args' => $args, - 'result' => $result, - 'lang' => $languageCode - ); - } - } - } - return array( $messages, $tests ); - } - - private function writeJavascriptFile( $messages, $tests, $dataSpecFile ) { - $phpParserData = array( - 'messages' => $messages, - 'tests' => $tests, - ); - - $output = - "// This file stores the output from the PHP parser for various messages, arguments,\n" - . "// languages, and parser modes. Intended for use by a unit test framework by looping\n" - . "// through the object and comparing its parser return value with the 'result' property.\n" - . '// Last generated with ' . basename( __FILE__ ) . ' at ' . gmdate( 'r' ) . "\n" - // This file will contain unquoted JSON strings as javascript native object literals, - // flip the quotemark convention for this file. - . "/*jshint quotmark: double */\n" - . "\n" - . 'mediaWiki.libs.phpParserData = ' . FormatJson::encode( $phpParserData, true ) . ";\n"; - - $fp = file_put_contents( $dataSpecFile, $output ); - if ( $fp === false ) { - die( "Couldn't write to $dataSpecFile." ); - } - } -} - -$maintClass = "GenerateJqueryMsgData"; -require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/tests/qunit/data/load.mock.php b/tests/qunit/data/load.mock.php deleted file mode 100644 index f6eff77a..00000000 --- a/tests/qunit/data/load.mock.php +++ /dev/null @@ -1,59 +0,0 @@ - " -mw.loader.implement( 'testUsesMissing', function () { - QUnit.ok( false, 'Module test.usesMissing script should not run.'); - QUnit.start(); -}, {}, {}); -", - - 'testUsesNestedMissing' => " -mw.loader.implement( 'testUsesNestedMissing', function () { - QUnit.ok( false, 'Module testUsesNestedMissing script should not run.'); -}, {}, {}); -", -); - -$response = ''; - -// Only support for non-encoded module names, full module names expected -if ( isset( $_GET['modules'] ) ) { - $modules = explode( ',', $_GET['modules'] ); - foreach ( $modules as $module ) { - if ( isset( $moduleImplementations[$module] ) ) { - $response .= $moduleImplementations[$module]; - } else { - $response .= Xml::encodeJsCall( 'mw.loader.state', array( $module, 'missing' ), true ); - } - } -} - -echo $response; diff --git a/tests/qunit/data/mediawiki.jqueryMsg.data.js b/tests/qunit/data/mediawiki.jqueryMsg.data.js deleted file mode 100644 index 776ee24f..00000000 --- a/tests/qunit/data/mediawiki.jqueryMsg.data.js +++ /dev/null @@ -1,492 +0,0 @@ -// This file stores the output from the PHP parser for various messages, arguments, -// languages, and parser modes. Intended for use by a unit test framework by looping -// through the object and comparing its parser return value with the 'result' property. -// Last generated with generateJqueryMsgData.php at Sat, 03 Nov 2012 21:32:01 +0000 -/*jshint quotmark: double */ - -mediaWiki.libs.phpParserData = { - "messages": { - "en_undelete_short": "Undelete {{PLURAL:$1|one edit|$1 edits}}", - "en_category-subcat-count": "{{PLURAL:$2|This category has only the following subcategory.|This category has the following {{PLURAL:$1|subcategory|$1 subcategories}}, out of $2 total.}}", - "fr_undelete_short": "Restaurer $1 modification{{PLURAL:$1||s}}", - "fr_category-subcat-count": "Cette cat\u00e9gorie comprend {{PLURAL:$2|la sous-cat\u00e9gorie|$2 sous-cat\u00e9gories, dont {{PLURAL:$1|celle|les $1}}}} ci-dessous.", - "ar_undelete_short": "\u0627\u0633\u062a\u0631\u062c\u0627\u0639 {{PLURAL:$1|\u062a\u0639\u062f\u064a\u0644 \u0648\u0627\u062d\u062f|\u062a\u0639\u062f\u064a\u0644\u064a\u0646|$1 \u062a\u0639\u062f\u064a\u0644\u0627\u062a|$1 \u062a\u0639\u062f\u064a\u0644|$1 \u062a\u0639\u062f\u064a\u0644\u0627}}", - "ar_category-subcat-count": "{{PLURAL:$2|\u0644\u0627 \u062a\u0635\u0627\u0646\u064a\u0641 \u0641\u0631\u0639\u064a\u0629 \u0641\u064a \u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641|\u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0641\u064a\u0647 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0627\u0644\u0641\u0631\u0639\u064a \u0627\u0644\u062a\u0627\u0644\u064a \u0641\u0642\u0637.|\u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0641\u064a\u0647 {{PLURAL:$1||\u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0627\u0644\u0641\u0631\u0639\u064a|\u0647\u0630\u064a\u0646 \u0627\u0644\u062a\u0635\u0646\u064a\u0641\u064a\u0646 \u0627\u0644\u0641\u0631\u0639\u064a\u064a\u0646|\u0647\u0630\u0647 \u0627\u0644$1 \u062a\u0635\u0627\u0646\u064a\u0641 \u0627\u0644\u0641\u0631\u0639\u064a\u0629|\u0647\u0630\u0647 \u0627\u0644$1 \u062a\u0635\u0646\u064a\u0641\u0627 \u0641\u0631\u0639\u064a\u0627|\u0647\u0630\u0647 \u0627\u0644$1 \u062a\u0635\u0646\u064a\u0641 \u0641\u0631\u0639\u064a}}\u060c \u0645\u0646 \u0625\u062c\u0645\u0627\u0644\u064a $2.}}", - "jp_undelete_short": "Undelete {{PLURAL:$1|one edit|$1 edits}}", - "jp_category-subcat-count": "{{PLURAL:$2|This category has only the following subcategory.|This category has the following {{PLURAL:$1|subcategory|$1 subcategories}}, out of $2 total.}}", - "zh_undelete_short": "\u6062\u590d$1\u4e2a\u88ab\u5220\u9664\u7684\u7f16\u8f91", - "zh_category-subcat-count": "{{PLURAL:$2|\u672c\u5206\u7c7b\u53ea\u6709\u4e0b\u5217\u4e00\u4e2a\u5b50\u5206\u7c7b\u3002|\u672c\u5206\u7c7b\u5305\u542b\u4e0b\u5217$1\u4e2a\u5b50\u5206\u7c7b\uff0c\u5171$2\u4e2a\u5b50\u5206\u7c7b\u3002}}" - }, - "tests": [ - { - "name": "en undelete_short 0", - "key": "en_undelete_short", - "args": [ - 0 - ], - "result": "Undelete 0 edits", - "lang": "en" - }, - { - "name": "en undelete_short 1", - "key": "en_undelete_short", - "args": [ - 1 - ], - "result": "Undelete one edit", - "lang": "en" - }, - { - "name": "en undelete_short 2", - "key": "en_undelete_short", - "args": [ - 2 - ], - "result": "Undelete 2 edits", - "lang": "en" - }, - { - "name": "en undelete_short 5", - "key": "en_undelete_short", - "args": [ - 5 - ], - "result": "Undelete 5 edits", - "lang": "en" - }, - { - "name": "en undelete_short 21", - "key": "en_undelete_short", - "args": [ - 21 - ], - "result": "Undelete 21 edits", - "lang": "en" - }, - { - "name": "en undelete_short 101", - "key": "en_undelete_short", - "args": [ - 101 - ], - "result": "Undelete 101 edits", - "lang": "en" - }, - { - "name": "en category-subcat-count 0,10", - "key": "en_category-subcat-count", - "args": [ - 0, - 10 - ], - "result": "This category has the following 0 subcategories, out of 10 total.", - "lang": "en" - }, - { - "name": "en category-subcat-count 1,1", - "key": "en_category-subcat-count", - "args": [ - 1, - 1 - ], - "result": "This category has only the following subcategory.", - "lang": "en" - }, - { - "name": "en category-subcat-count 1,2", - "key": "en_category-subcat-count", - "args": [ - 1, - 2 - ], - "result": "This category has the following subcategory, out of 2 total.", - "lang": "en" - }, - { - "name": "en category-subcat-count 3,30", - "key": "en_category-subcat-count", - "args": [ - 3, - 30 - ], - "result": "This category has the following 3 subcategories, out of 30 total.", - "lang": "en" - }, - { - "name": "fr undelete_short 0", - "key": "fr_undelete_short", - "args": [ - 0 - ], - "result": "Restaurer 0 modification", - "lang": "fr" - }, - { - "name": "fr undelete_short 1", - "key": "fr_undelete_short", - "args": [ - 1 - ], - "result": "Restaurer 1 modification", - "lang": "fr" - }, - { - "name": "fr undelete_short 2", - "key": "fr_undelete_short", - "args": [ - 2 - ], - "result": "Restaurer 2 modifications", - "lang": "fr" - }, - { - "name": "fr undelete_short 5", - "key": "fr_undelete_short", - "args": [ - 5 - ], - "result": "Restaurer 5 modifications", - "lang": "fr" - }, - { - "name": "fr undelete_short 21", - "key": "fr_undelete_short", - "args": [ - 21 - ], - "result": "Restaurer 21 modifications", - "lang": "fr" - }, - { - "name": "fr undelete_short 101", - "key": "fr_undelete_short", - "args": [ - 101 - ], - "result": "Restaurer 101 modifications", - "lang": "fr" - }, - { - "name": "fr category-subcat-count 0,10", - "key": "fr_category-subcat-count", - "args": [ - 0, - 10 - ], - "result": "Cette cat\u00e9gorie comprend 10 sous-cat\u00e9gories, dont celle ci-dessous.", - "lang": "fr" - }, - { - "name": "fr category-subcat-count 1,1", - "key": "fr_category-subcat-count", - "args": [ - 1, - 1 - ], - "result": "Cette cat\u00e9gorie comprend la sous-cat\u00e9gorie ci-dessous.", - "lang": "fr" - }, - { - "name": "fr category-subcat-count 1,2", - "key": "fr_category-subcat-count", - "args": [ - 1, - 2 - ], - "result": "Cette cat\u00e9gorie comprend 2 sous-cat\u00e9gories, dont celle ci-dessous.", - "lang": "fr" - }, - { - "name": "fr category-subcat-count 3,30", - "key": "fr_category-subcat-count", - "args": [ - 3, - 30 - ], - "result": "Cette cat\u00e9gorie comprend 30 sous-cat\u00e9gories, dont les 3 ci-dessous.", - "lang": "fr" - }, - { - "name": "ar undelete_short 0", - "key": "ar_undelete_short", - "args": [ - 0 - ], - "result": "\u0627\u0633\u062a\u0631\u062c\u0627\u0639 \u062a\u0639\u062f\u064a\u0644 \u0648\u0627\u062d\u062f", - "lang": "ar" - }, - { - "name": "ar undelete_short 1", - "key": "ar_undelete_short", - "args": [ - 1 - ], - "result": "\u0627\u0633\u062a\u0631\u062c\u0627\u0639 \u062a\u0639\u062f\u064a\u0644\u064a\u0646", - "lang": "ar" - }, - { - "name": "ar undelete_short 2", - "key": "ar_undelete_short", - "args": [ - 2 - ], - "result": "\u0627\u0633\u062a\u0631\u062c\u0627\u0639 2 \u062a\u0639\u062f\u064a\u0644\u0627\u062a", - "lang": "ar" - }, - { - "name": "ar undelete_short 5", - "key": "ar_undelete_short", - "args": [ - 5 - ], - "result": "\u0627\u0633\u062a\u0631\u062c\u0627\u0639 5 \u062a\u0639\u062f\u064a\u0644", - "lang": "ar" - }, - { - "name": "ar undelete_short 21", - "key": "ar_undelete_short", - "args": [ - 21 - ], - "result": "\u0627\u0633\u062a\u0631\u062c\u0627\u0639 21 \u062a\u0639\u062f\u064a\u0644\u0627", - "lang": "ar" - }, - { - "name": "ar undelete_short 101", - "key": "ar_undelete_short", - "args": [ - 101 - ], - "result": "\u0627\u0633\u062a\u0631\u062c\u0627\u0639 101 \u062a\u0639\u062f\u064a\u0644\u0627", - "lang": "ar" - }, - { - "name": "ar category-subcat-count 0,10", - "key": "ar_category-subcat-count", - "args": [ - 0, - 10 - ], - "result": "\u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0641\u064a\u0647 \u060c \u0645\u0646 \u0625\u062c\u0645\u0627\u0644\u064a 10.", - "lang": "ar" - }, - { - "name": "ar category-subcat-count 1,1", - "key": "ar_category-subcat-count", - "args": [ - 1, - 1 - ], - "result": "\u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0641\u064a\u0647 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0627\u0644\u0641\u0631\u0639\u064a \u0627\u0644\u062a\u0627\u0644\u064a \u0641\u0642\u0637.", - "lang": "ar" - }, - { - "name": "ar category-subcat-count 1,2", - "key": "ar_category-subcat-count", - "args": [ - 1, - 2 - ], - "result": "\u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0641\u064a\u0647 \u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0627\u0644\u0641\u0631\u0639\u064a\u060c \u0645\u0646 \u0625\u062c\u0645\u0627\u0644\u064a 2.", - "lang": "ar" - }, - { - "name": "ar category-subcat-count 3,30", - "key": "ar_category-subcat-count", - "args": [ - 3, - 30 - ], - "result": "\u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0641\u064a\u0647 \u0647\u0630\u0647 \u0627\u06443 \u062a\u0635\u0627\u0646\u064a\u0641 \u0627\u0644\u0641\u0631\u0639\u064a\u0629\u060c \u0645\u0646 \u0625\u062c\u0645\u0627\u0644\u064a 30.", - "lang": "ar" - }, - { - "name": "jp undelete_short 0", - "key": "jp_undelete_short", - "args": [ - 0 - ], - "result": "Undelete 0 edits", - "lang": "jp" - }, - { - "name": "jp undelete_short 1", - "key": "jp_undelete_short", - "args": [ - 1 - ], - "result": "Undelete one edit", - "lang": "jp" - }, - { - "name": "jp undelete_short 2", - "key": "jp_undelete_short", - "args": [ - 2 - ], - "result": "Undelete 2 edits", - "lang": "jp" - }, - { - "name": "jp undelete_short 5", - "key": "jp_undelete_short", - "args": [ - 5 - ], - "result": "Undelete 5 edits", - "lang": "jp" - }, - { - "name": "jp undelete_short 21", - "key": "jp_undelete_short", - "args": [ - 21 - ], - "result": "Undelete 21 edits", - "lang": "jp" - }, - { - "name": "jp undelete_short 101", - "key": "jp_undelete_short", - "args": [ - 101 - ], - "result": "Undelete 101 edits", - "lang": "jp" - }, - { - "name": "jp category-subcat-count 0,10", - "key": "jp_category-subcat-count", - "args": [ - 0, - 10 - ], - "result": "This category has the following 0 subcategories, out of 10 total.", - "lang": "jp" - }, - { - "name": "jp category-subcat-count 1,1", - "key": "jp_category-subcat-count", - "args": [ - 1, - 1 - ], - "result": "This category has only the following subcategory.", - "lang": "jp" - }, - { - "name": "jp category-subcat-count 1,2", - "key": "jp_category-subcat-count", - "args": [ - 1, - 2 - ], - "result": "This category has the following subcategory, out of 2 total.", - "lang": "jp" - }, - { - "name": "jp category-subcat-count 3,30", - "key": "jp_category-subcat-count", - "args": [ - 3, - 30 - ], - "result": "This category has the following 3 subcategories, out of 30 total.", - "lang": "jp" - }, - { - "name": "zh undelete_short 0", - "key": "zh_undelete_short", - "args": [ - 0 - ], - "result": "\u6062\u590d0\u4e2a\u88ab\u5220\u9664\u7684\u7f16\u8f91", - "lang": "zh" - }, - { - "name": "zh undelete_short 1", - "key": "zh_undelete_short", - "args": [ - 1 - ], - "result": "\u6062\u590d1\u4e2a\u88ab\u5220\u9664\u7684\u7f16\u8f91", - "lang": "zh" - }, - { - "name": "zh undelete_short 2", - "key": "zh_undelete_short", - "args": [ - 2 - ], - "result": "\u6062\u590d2\u4e2a\u88ab\u5220\u9664\u7684\u7f16\u8f91", - "lang": "zh" - }, - { - "name": "zh undelete_short 5", - "key": "zh_undelete_short", - "args": [ - 5 - ], - "result": "\u6062\u590d5\u4e2a\u88ab\u5220\u9664\u7684\u7f16\u8f91", - "lang": "zh" - }, - { - "name": "zh undelete_short 21", - "key": "zh_undelete_short", - "args": [ - 21 - ], - "result": "\u6062\u590d21\u4e2a\u88ab\u5220\u9664\u7684\u7f16\u8f91", - "lang": "zh" - }, - { - "name": "zh undelete_short 101", - "key": "zh_undelete_short", - "args": [ - 101 - ], - "result": "\u6062\u590d101\u4e2a\u88ab\u5220\u9664\u7684\u7f16\u8f91", - "lang": "zh" - }, - { - "name": "zh category-subcat-count 0,10", - "key": "zh_category-subcat-count", - "args": [ - 0, - 10 - ], - "result": "\u672c\u5206\u7c7b\u5305\u542b\u4e0b\u52170\u4e2a\u5b50\u5206\u7c7b\uff0c\u517110\u4e2a\u5b50\u5206\u7c7b\u3002", - "lang": "zh" - }, - { - "name": "zh category-subcat-count 1,1", - "key": "zh_category-subcat-count", - "args": [ - 1, - 1 - ], - "result": "\u672c\u5206\u7c7b\u53ea\u6709\u4e0b\u5217\u4e00\u4e2a\u5b50\u5206\u7c7b\u3002", - "lang": "zh" - }, - { - "name": "zh category-subcat-count 1,2", - "key": "zh_category-subcat-count", - "args": [ - 1, - 2 - ], - "result": "\u672c\u5206\u7c7b\u5305\u542b\u4e0b\u52171\u4e2a\u5b50\u5206\u7c7b\uff0c\u51712\u4e2a\u5b50\u5206\u7c7b\u3002", - "lang": "zh" - }, - { - "name": "zh category-subcat-count 3,30", - "key": "zh_category-subcat-count", - "args": [ - 3, - 30 - ], - "result": "\u672c\u5206\u7c7b\u5305\u542b\u4e0b\u52173\u4e2a\u5b50\u5206\u7c7b\uff0c\u517130\u4e2a\u5b50\u5206\u7c7b\u3002", - "lang": "zh" - } - ] -}; diff --git a/tests/qunit/data/qunitOkCall.js b/tests/qunit/data/qunitOkCall.js deleted file mode 100644 index 3ed5514e..00000000 --- a/tests/qunit/data/qunitOkCall.js +++ /dev/null @@ -1,2 +0,0 @@ -QUnit.start(); -QUnit.assert.ok( true, 'Successfully loaded!' ); diff --git a/tests/qunit/data/styleTest.css.php b/tests/qunit/data/styleTest.css.php deleted file mode 100644 index 0e845811..00000000 --- a/tests/qunit/data/styleTest.css.php +++ /dev/null @@ -1,61 +0,0 @@ - - */ - QUnit.newMwEnvironment = ( function () { - var log, liveConfig, liveMessages; - - liveConfig = mw.config.values; - liveMessages = mw.messages.values; - - function freshConfigCopy( custom ) { - // Tests should mock all factors that directly influence the tested code. - // For backwards compatibility though we set mw.config to a copy of the live config - // and extend it with the (optionally) given custom settings for this test - // (instead of starting blank with only the given custmo settings). - // This is a shallow copy, so we don't end up with settings taking an array value - // extended with the custom settings - setting a config property means you override it, - // not extend it. - return $.extend( {}, liveConfig, custom ); - } - - function freshMessagesCopy( custom ) { - return $.extend( /*deep=*/true, {}, liveMessages, custom ); - } - - log = QUnit.urlParams.mwlogenv ? mw.log : function () {}; - - return function ( localEnv ) { - localEnv = $.extend( { - // QUnit - setup: $.noop, - teardown: $.noop, - // MediaWiki - config: {}, - messages: {} - }, localEnv ); - - return { - setup: function () { - log( 'MwEnvironment> SETUP for "' + QUnit.config.current.module - + ': ' + QUnit.config.current.testName + '"' ); - - // Greetings, mock environment! - mw.config.values = freshConfigCopy( localEnv.config ); - mw.messages.values = freshMessagesCopy( localEnv.messages ); - - localEnv.setup(); - }, - - teardown: function () { - log( 'MwEnvironment> TEARDOWN for "' + QUnit.config.current.module - + ': ' + QUnit.config.current.testName + '"' ); - - localEnv.teardown(); - - // Farewell, mock environment! - mw.config.values = liveConfig; - mw.messages.values = liveMessages; - } - }; - }; - }() ); - - // $.when stops as soon as one fails, which makes sense in most - // practical scenarios, but not in a unit test where we really do - // need to wait until all of them are finished. - QUnit.whenPromisesComplete = function () { - var altPromises = []; - - $.each( arguments, function ( i, arg ) { - var alt = $.Deferred(); - altPromises.push( alt ); - - // Whether this one fails or not, forwards it to - // the 'done' (resolve) callback of the alternative promise. - arg.always( alt.resolve ); - } ); - - return $.when.apply( $, altPromises ); - }; - - /** - * Recursively convert a node to a plain object representing its structure. - * Only considers attributes and contents (elements and text nodes). - * Attribute values are compared strictly and not normalised. - * - * @param {Node} node - * @return {Object|string} Plain JavaScript value representing the node. - */ - function getDomStructure( node ) { - var $node, children, processedChildren, i, len, el; - $node = $( node ); - if ( node.nodeType === ELEMENT_NODE ) { - children = $node.contents(); - processedChildren = []; - for ( i = 0, len = children.length; i < len; i++ ) { - el = children[i]; - if ( el.nodeType === ELEMENT_NODE || el.nodeType === TEXT_NODE ) { - processedChildren.push( getDomStructure( el ) ); - } - } - - return { - tagName: node.tagName, - attributes: $node.getAttrs(), - contents: processedChildren - }; - } else { - // Should be text node - return $node.text(); - } - } - - /** - * Gets structure of node for this HTML. - * - * @param {string} html HTML markup for one or more nodes. - */ - function getHtmlStructure( html ) { - var el = $( '
        ' ).append( html )[0]; - return getDomStructure( el ); - } - - /** - * Add-on assertion helpers - */ - // Define the add-ons - addons = { - - // Expect boolean true - assertTrue: function ( actual, message ) { - QUnit.push( actual === true, actual, true, message ); - }, - - // Expect boolean false - assertFalse: function ( actual, message ) { - QUnit.push( actual === false, actual, false, message ); - }, - - // Expect numerical value less than X - lt: function ( actual, expected, message ) { - QUnit.push( actual < expected, actual, 'less than ' + expected, message ); - }, - - // Expect numerical value less than or equal to X - ltOrEq: function ( actual, expected, message ) { - QUnit.push( actual <= expected, actual, 'less than or equal to ' + expected, message ); - }, - - // Expect numerical value greater than X - gt: function ( actual, expected, message ) { - QUnit.push( actual > expected, actual, 'greater than ' + expected, message ); - }, - - // Expect numerical value greater than or equal to X - gtOrEq: function ( actual, expected, message ) { - QUnit.push( actual >= expected, actual, 'greater than or equal to ' + expected, message ); - }, - - /** - * Asserts that two HTML strings are structurally equivalent. - * - * @param {string} actualHtml Actual HTML markup. - * @param {string} expectedHtml Expected HTML markup - * @param {string} message Assertion message. - */ - htmlEqual: function ( actualHtml, expectedHtml, message ) { - var actual = getHtmlStructure( actualHtml ), - expected = getHtmlStructure( expectedHtml ); - - QUnit.push( - QUnit.equiv( - actual, - expected - ), - actual, - expected, - message - ); - }, - - /** - * Asserts that two HTML strings are not structurally equivalent. - * - * @param {string} actualHtml Actual HTML markup. - * @param {string} expectedHtml Expected HTML markup. - * @param {string} message Assertion message. - */ - notHtmlEqual: function ( actualHtml, expectedHtml, message ) { - var actual = getHtmlStructure( actualHtml ), - expected = getHtmlStructure( expectedHtml ); - - QUnit.push( - !QUnit.equiv( - actual, - expected - ), - actual, - expected, - message - ); - } - }; - - $.extend( QUnit.assert, addons ); - - /** - * Small test suite to confirm proper functionality of the utilities and - * initializations defined above in this file. - */ - envExecCount = 0; - QUnit.module( 'mediawiki.tests.qunit.testrunner', QUnit.newMwEnvironment( { - setup: function () { - envExecCount += 1; - this.mwHtmlLive = mw.html; - mw.html = { - escape: function () { - return 'mocked-' + envExecCount; - } - }; - }, - teardown: function () { - mw.html = this.mwHtmlLive; - }, - config: { - testVar: 'foo' - }, - messages: { - testMsg: 'Foo.' - } - } ) ); - - QUnit.test( 'Setup', 3, function ( assert ) { - assert.equal( mw.html.escape( 'foo' ), 'mocked-1', 'extra setup() callback was ran.' ); - assert.equal( mw.config.get( 'testVar' ), 'foo', 'config object applied' ); - assert.equal( mw.messages.get( 'testMsg' ), 'Foo.', 'messages object applied' ); - - mw.config.set( 'testVar', 'bar' ); - mw.messages.set( 'testMsg', 'Bar.' ); - } ); - - QUnit.test( 'Teardown', 3, function ( assert ) { - assert.equal( mw.html.escape( 'foo' ), 'mocked-2', 'extra setup() callback was re-ran.' ); - assert.equal( mw.config.get( 'testVar' ), 'foo', 'config object restored and re-applied after test()' ); - assert.equal( mw.messages.get( 'testMsg' ), 'Foo.', 'messages object restored and re-applied after test()' ); - } ); - - QUnit.test( 'Loader status', 2, function ( assert ) { - var i, len, state, - modules = mw.loader.getModuleNames(), - error = [], - missing = []; - - for ( i = 0, len = modules.length; i < len; i++ ) { - state = mw.loader.getState( modules[i] ); - if ( state === 'error' ) { - error.push( modules[i] ); - } else if ( state === 'missing' ) { - missing.push( modules[i] ); - } - } - - assert.deepEqual( error, [], 'Modules in error state' ); - assert.deepEqual( missing, [], 'Modules in missing state' ); - } ); - - QUnit.test( 'htmlEqual', 8, function ( assert ) { - assert.htmlEqual( - '

        Child paragraph with A link

        Regular textA span
        ', - '

        Child paragraph with A link

        Regular textA span
        ', - 'Attribute order, spacing and quotation marks (equal)' - ); - - assert.notHtmlEqual( - '

        Child paragraph with A link

        Regular textA span
        ', - '

        Child paragraph with A link

        Regular textA span
        ', - 'Attribute order, spacing and quotation marks (not equal)' - ); - - assert.htmlEqual( - '', - '', - 'Multiple root nodes (equal)' - ); - - assert.notHtmlEqual( - '', - '', - 'Multiple root nodes (not equal, last label node is different)' - ); - - assert.htmlEqual( - 'fo"o
        b>ar', - 'fo"o
        b>ar', - 'Extra escaping is equal' - ); - assert.notHtmlEqual( - 'foo<br/>bar', - 'foo
        bar', - 'Text escaping (not equal)' - ); - - assert.htmlEqual( - 'fooexamplebar', - 'fooexamplebar', - 'Outer text nodes are compared (equal)' - ); - - assert.notHtmlEqual( - 'fooexamplebar', - 'fooexamplequux', - 'Outer text nodes are compared (last text node different)' - ); - - } ); - - QUnit.module( 'mediawiki.tests.qunit.testrunner-after', QUnit.newMwEnvironment() ); - - QUnit.test( 'Teardown', 3, function ( assert ) { - assert.equal( mw.html.escape( '<' ), '<', 'extra teardown() callback was ran.' ); - assert.equal( mw.config.get( 'testVar' ), null, 'config object restored to live in next module()' ); - assert.equal( mw.messages.get( 'testMsg' ), null, 'messages object restored to live in next module()' ); - } ); - -}( jQuery, mediaWiki, QUnit ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js b/tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js deleted file mode 100644 index e1895248..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js +++ /dev/null @@ -1,58 +0,0 @@ -( function ( $ ) { - - QUnit.module( 'jquery.autoEllipsis', QUnit.newMwEnvironment() ); - - function createWrappedDiv( text, width ) { - var $wrapper = $( '
        ' ).css( 'width', width ), - $div = $( '
        ' ).text( text ); - $wrapper.append( $div ); - return $wrapper; - } - - function findDivergenceIndex( a, b ) { - var i = 0; - while ( i < a.length && i < b.length && a[i] === b[i] ) { - i++; - } - return i; - } - - QUnit.test( 'Position right', 4, function ( assert ) { - // We need this thing to be visible, so append it to the DOM - var $span, spanText, d, spanTextNew, - origText = 'This is a really long random string and there is no way it fits in 100 pixels.', - $wrapper = createWrappedDiv( origText, '100px' ); - - $( '#qunit-fixture' ).append( $wrapper ); - $wrapper.autoEllipsis( { position: 'right' } ); - - // Verify that, and only one, span element was created - $span = $wrapper.find( '> span' ); - assert.strictEqual( $span.length, 1, 'autoEllipsis wrapped the contents in a span element' ); - - // Check that the text fits by turning on word wrapping - $span.css( 'whiteSpace', 'nowrap' ); - assert.ltOrEq( - $span.width(), - $span.parent().width(), - 'Text fits (making the span "white-space: nowrap" does not make it wider than its parent)' - ); - - // Add two characters using scary black magic - spanText = $span.text(); - d = findDivergenceIndex( origText, spanText ); - spanTextNew = spanText.substr( 0, d ) + origText[d] + origText[d] + '...'; - - assert.gt( spanTextNew.length, spanText.length, 'Verify that the new span-length is indeed greater' ); - - // Put this text in the span and verify it doesn't fit - $span.text( spanTextNew ); - // In IE6 width works like min-width, allow IE6's width to be "equal to" - if ( $.browser.msie && Number( $.browser.version ) === 6 ) { - assert.gtOrEq( $span.width(), $span.parent().width(), 'Fit is maximal (adding two characters makes it not fit any more) - IE6: Maybe equal to as well due to width behaving like min-width in IE6' ); - } else { - assert.gt( $span.width(), $span.parent().width(), 'Fit is maximal (adding two characters makes it not fit any more)' ); - } - } ); - -}( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.byteLength.test.js b/tests/qunit/suites/resources/jquery/jquery.byteLength.test.js deleted file mode 100644 index e6aa3aa8..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.byteLength.test.js +++ /dev/null @@ -1,37 +0,0 @@ -( function ( $ ) { - QUnit.module( 'jquery.byteLength', QUnit.newMwEnvironment() ); - - QUnit.test( 'Simple text', 5, function ( assert ) { - var azLc = 'abcdefghijklmnopqrstuvwxyz', - azUc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', - num = '0123456789', - x = '*', - space = ' '; - - assert.equal( $.byteLength( azLc ), 26, 'Lowercase a-z' ); - assert.equal( $.byteLength( azUc ), 26, 'Uppercase A-Z' ); - assert.equal( $.byteLength( num ), 10, 'Numbers 0-9' ); - assert.equal( $.byteLength( x ), 1, 'An asterisk' ); - assert.equal( $.byteLength( space ), 3, '3 spaces' ); - - } ); - - QUnit.test( 'Special text', 4, function ( assert ) { - // https://en.wikipedia.org/wiki/UTF-8 - var u0024 = '$', - // Cent symbol - u00A2 = '\u00A2', - // Euro symbol - u20AC = '\u20AC', - // Character \U00024B62 (Han script) can't be represented in javascript as a single - // code point, instead it is composed as a surrogate pair of two separate code units. - // http://codepoints.net/U+24B62 - // http://www.fileformat.info/info/unicode/char/24B62/index.htm - u024B62 = '\uD852\uDF62'; - - assert.strictEqual( $.byteLength( u0024 ), 1, 'U+0024' ); - assert.strictEqual( $.byteLength( u00A2 ), 2, 'U+00A2' ); - assert.strictEqual( $.byteLength( u20AC ), 3, 'U+20AC' ); - assert.strictEqual( $.byteLength( u024B62 ), 4, 'U+024B62 (surrogate pair: \\uD852\\uDF62)' ); - } ); -}( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js b/tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js deleted file mode 100644 index 22d2af19..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js +++ /dev/null @@ -1,252 +0,0 @@ -( function ( $, mw ) { - var simpleSample, U_20AC, mbSample; - - QUnit.module( 'jquery.byteLimit', QUnit.newMwEnvironment() ); - - // Simple sample (20 chars, 20 bytes) - simpleSample = '12345678901234567890'; - - // 3 bytes (euro-symbol) - U_20AC = '\u20AC'; - - // Multi-byte sample (22 chars, 26 bytes) - mbSample = '1234567890' + U_20AC + '1234567890' + U_20AC; - - // Basic sendkey-implementation - function addChars( $input, charstr ) { - var c, len; - - function x( $input, i ) { - // Add character to the value - return $input.val() + charstr.charAt( i ); - } - - for ( c = 0, len = charstr.length; c < len; c += 1 ) { - $input - .val( x( $input, c ) ) - .trigger( 'change' ); - } - } - - /** - * Test factory for $.fn.byteLimit - * - * @param {Object} options - * @param {string} options.description Test name - * @param {jQuery} options.$input jQuery object in an input element - * @param {string} options.sample Sequence of characters to simulate being - * added one by one - * @param {string} options.expected Expected final value of `$input` - */ - function byteLimitTest( options ) { - var opt = $.extend( { - description: '', - $input: null, - sample: '', - expected: '' - }, options ); - - QUnit.asyncTest( opt.description, 1, function ( assert ) { - setTimeout( function () { - opt.$input.appendTo( '#qunit-fixture' ); - - // Simulate pressing keys for each of the sample characters - addChars( opt.$input, opt.sample ); - - assert.equal( - opt.$input.val(), - opt.expected, - 'New value matches the expected string' - ); - - QUnit.start(); - }, 10 ); - } ); - } - - byteLimitTest( { - description: 'Plain text input', - $input: $( '' ), - sample: simpleSample, - expected: simpleSample - } ); - - byteLimitTest( { - description: 'Plain text input. Calling byteLimit with no parameters and no maxlength attribute (bug 36310)', - $input: $( '' ) - .byteLimit(), - sample: simpleSample, - expected: simpleSample - } ); - - byteLimitTest( { - description: 'Limit using the maxlength attribute', - $input: $( '' ) - .attr( 'maxlength', '10' ) - .byteLimit(), - sample: simpleSample, - expected: '1234567890' - } ); - - byteLimitTest( { - description: 'Limit using a custom value', - $input: $( '' ) - .byteLimit( 10 ), - sample: simpleSample, - expected: '1234567890' - } ); - - byteLimitTest( { - description: 'Limit using a custom value, overriding maxlength attribute', - $input: $( '' ) - .attr( 'maxlength', '10' ) - .byteLimit( 15 ), - sample: simpleSample, - expected: '123456789012345' - } ); - - byteLimitTest( { - description: 'Limit using a custom value (multibyte)', - $input: $( '' ) - .byteLimit( 14 ), - sample: mbSample, - expected: '1234567890' + U_20AC + '1' - } ); - - byteLimitTest( { - description: 'Limit using a custom value (multibyte) overlapping a byte', - $input: $( '' ) - .byteLimit( 12 ), - sample: mbSample, - expected: '1234567890' + '12' - } ); - - byteLimitTest( { - description: 'Pass the limit and a callback as input filter', - $input: $( '' ) - .byteLimit( 6, function ( val ) { - var title = mw.Title.newFromText( String( val ) ); - // Return without namespace prefix - return title ? title.getMain() : ''; - } ), - sample: 'User:Sample', - expected: 'User:Sample' - } ); - - byteLimitTest( { - description: 'Limit using the maxlength attribute and pass a callback as input filter', - $input: $( '' ) - .attr( 'maxlength', '6' ) - .byteLimit( function ( val ) { - var title = mw.Title.newFromText( String( val ) ); - // Return without namespace prefix - return title ? title.getMain() : ''; - } ), - sample: 'User:Sample', - expected: 'User:Sample' - } ); - - byteLimitTest( { - description: 'Pass the limit and a callback as input filter', - $input: $( '' ) - .byteLimit( 6, function ( val ) { - var title = mw.Title.newFromText( String( val ) ); - // Return without namespace prefix - return title ? title.getMain() : ''; - } ), - sample: 'User:Example', - // The callback alters the value to be used to calculeate - // the length. The altered value is "Exampl" which has - // a length of 6, the "e" would exceed the limit. - expected: 'User:Exampl' - } ); - - byteLimitTest( { - description: 'Input filter that increases the length', - $input: $( '' ) - .byteLimit( 10, function ( text ) { - return 'prefix' + text; - } ), - sample: simpleSample, - // Prefix adds 6 characters, limit is reached after 4 - expected: '1234' - } ); - - // Regression tests for bug 41450 - byteLimitTest( { - description: 'Input filter of which the base exceeds the limit', - $input: $( '' ) - .byteLimit( 3, function ( text ) { - return 'prefix' + text; - } ), - sample: simpleSample, - hasLimit: true, - limit: 6, // 'prefix' length - expected: '' - } ); - - QUnit.test( 'Confirm properties and attributes set', 4, function ( assert ) { - var $el, $elA, $elB; - - $el = $( '' ) - .attr( 'maxlength', '7' ) - .appendTo( '#qunit-fixture' ) - .byteLimit(); - - assert.strictEqual( $el.attr( 'maxlength' ), '7', 'maxlength attribute unchanged for simple limit' ); - - $el = $( '' ) - .attr( 'maxlength', '7' ) - .appendTo( '#qunit-fixture' ) - .byteLimit( 12 ); - - assert.strictEqual( $el.attr( 'maxlength' ), '12', 'maxlength attribute updated for custom limit' ); - - $el = $( '' ) - .attr( 'maxlength', '7' ) - .appendTo( '#qunit-fixture' ) - .byteLimit( 12, function ( val ) { - return val; - } ); - - assert.strictEqual( $el.attr( 'maxlength' ), undefined, 'maxlength attribute removed for limit with callback' ); - - $elA = $( '' ) - .addClass( 'mw-test-byteLimit-foo' ) - .attr( 'maxlength', '7' ) - .appendTo( '#qunit-fixture' ); - - $elB = $( '' ) - .addClass( 'mw-test-byteLimit-foo' ) - .attr( 'maxlength', '12' ) - .appendTo( '#qunit-fixture' ); - - $el = $( '.mw-test-byteLimit-foo' ); - - assert.strictEqual( $el.length, 2, 'Verify that there are no other elements clashing with this test suite' ); - - $el.byteLimit(); - } ); - - QUnit.test( 'Trim from insertion when limit exceeded', 2, function ( assert ) { - var $el; - - // Use a new because the bug only occurs on the first time - // the limit it reached (bug 40850) - $el = $( '' ) - .appendTo( '#qunit-fixture' ) - .byteLimit( 3 ) - .val( 'abc' ).trigger( 'change' ) - .val( 'zabc' ).trigger( 'change' ); - - assert.strictEqual( $el.val(), 'abc', 'Trim from the insertion point (at 0), not the end' ); - - $el = $( '' ) - .appendTo( '#qunit-fixture' ) - .byteLimit( 3 ) - .val( 'abc' ).trigger( 'change' ) - .val( 'azbc' ).trigger( 'change' ); - - assert.strictEqual( $el.val(), 'abc', 'Trim from the insertion point (at 1), not the end' ); - } ); -}( jQuery, mediaWiki ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.client.test.js b/tests/qunit/suites/resources/jquery/jquery.client.test.js deleted file mode 100644 index 4c7c3022..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.client.test.js +++ /dev/null @@ -1,542 +0,0 @@ -( function ( $ ) { - - QUnit.module( 'jquery.client', QUnit.newMwEnvironment() ); - - var uacount = 0, - // Object keyed by userAgent. Value is an array (human-readable name, client-profile object, navigator.platform value) - // Info based on results from http://toolserver.org/~krinkle/testswarm/job/174/ - uas = { - // Internet Explorer 6 - // Internet Explorer 7 - 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)': { - title: 'Internet Explorer 7', - platform: 'Win32', - profile: { - name: 'msie', - layout: 'trident', - layoutVersion: 'unknown', - platform: 'win', - version: '7.0', - versionBase: '7', - versionNumber: 7 - }, - wikiEditor: { - ltr: true, - rtl: false - } - }, - // Internet Explorer 8 - // Internet Explorer 9 - // Internet Explorer 10 - 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)': { - title: 'Internet Explorer 10', - platform: 'Win32', - profile: { - name: 'msie', - layout: 'trident', - layoutVersion: 6, - platform: 'win', - version: '10.0', - versionBase: '10', - versionNumber: 10 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Internet Explorer 11 - 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv 11.0) like Gecko': { - title: 'Internet Explorer 11', - platform: 'Win32', - profile: { - name: 'msie', - layout: 'trident', - layoutVersion: 7, - platform: 'win', - version: '11.0', - versionBase: '11', - versionNumber: 11 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Internet Explorer 11 - Windows 8.1 x64 Modern UI - 'Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; rv:11.0) like Gecko': { - title: 'Internet Explorer 11', - platform: 'Win64', - profile: { - name: 'msie', - layout: 'trident', - layoutVersion: 7, - platform: 'win', - version: '11.0', - versionBase: '11', - versionNumber: 11 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Internet Explorer 11 - Windows 8.1 x64 desktop UI - 'Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko': { - title: 'Internet Explorer 11', - platform: 'WOW64', - profile: { - name: 'msie', - layout: 'trident', - layoutVersion: 7, - platform: 'win', - version: '11.0', - versionBase: '11', - versionNumber: 11 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Firefox 2 - // Firefox 3.5 - 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.19) Gecko/20110420 Firefox/3.5.19': { - title: 'Firefox 3.5', - platform: 'MacIntel', - profile: { - name: 'firefox', - layout: 'gecko', - layoutVersion: 20110420, - platform: 'mac', - version: '3.5.19', - versionBase: '3', - versionNumber: 3.5 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Firefox 3.6 - 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110422 Ubuntu/10.10 (maverick) Firefox/3.6.17': { - title: 'Firefox 3.6', - platform: 'Linux i686', - profile: { - name: 'firefox', - layout: 'gecko', - layoutVersion: 20110422, - platform: 'linux', - version: '3.6.17', - versionBase: '3', - versionNumber: 3.6 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Firefox 4 - 'Mozilla/5.0 (Windows NT 6.0; rv:2.0.1) Gecko/20100101 Firefox/4.0.1': { - title: 'Firefox 4', - platform: 'Win32', - profile: { - name: 'firefox', - layout: 'gecko', - layoutVersion: 20100101, - platform: 'win', - version: '4.0.1', - versionBase: '4', - versionNumber: 4 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Firefox 10 nightly build - 'Mozilla/5.0 (X11; Linux x86_64; rv:10.0a1) Gecko/20111103 Firefox/10.0a1': { - title: 'Firefox 10 nightly', - platform: 'Linux', - profile: { - name: 'firefox', - layout: 'gecko', - layoutVersion: 20111103, - platform: 'linux', - version: '10.0a1', - versionBase: '10', - versionNumber: 10 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Iceweasel 10.0.6 - 'Mozilla/5.0 (X11; Linux i686; rv:10.0.6) Gecko/20100101 Iceweasel/10.0.6': { - title: 'Iceweasel 10.0.6', - platform: 'Linux', - profile: { - name: 'iceweasel', - layout: 'gecko', - layoutVersion: 20100101, - platform: 'linux', - version: '10.0.6', - versionBase: '10', - versionNumber: 10 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Iceweasel 15.0.1 - 'Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1 Iceweasel/15.0.1': { - title: 'Iceweasel 15.0.1', - platform: 'Linux', - profile: { - name: 'iceweasel', - layout: 'gecko', - layoutVersion: 20100101, - platform: 'linux', - version: '15.0.1', - versionBase: '15', - versionNumber: 15 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Firefox 5 - // Safari 3 - // Safari 4 - 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; nl-nl) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7': { - title: 'Safari 4', - platform: 'MacIntel', - profile: { - name: 'safari', - layout: 'webkit', - layoutVersion: 531, - platform: 'mac', - version: '4.0.5', - versionBase: '4', - versionNumber: 4 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - 'Mozilla/5.0 (Windows; U; Windows NT 6.0; cs-CZ) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7': { - title: 'Safari 4', - platform: 'Win32', - profile: { - name: 'safari', - layout: 'webkit', - layoutVersion: 533, - platform: 'win', - version: '4.0.5', - versionBase: '4', - versionNumber: 4 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Safari 5 - // Safari 6 - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/536.29.13 (KHTML, like Gecko) Version/6.0.4 Safari/536.29.13': { - title: 'Safari 6', - platform: 'MacIntel', - profile: { - name: 'safari', - layout: 'webkit', - layoutVersion: 536, - platform: 'mac', - version: '6.0.4', - versionBase: '6', - versionNumber: 6 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Safari 6.0.5+ (doesn't have the comma in "KHTML, like Gecko") - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 1084) AppleWebKit/536.30.1 (KHTML like Gecko) Version/6.0.5 Safari/536.30.1': { - title: 'Safari 6', - platform: 'MacIntel', - profile: { - name: 'safari', - layout: 'webkit', - layoutVersion: 536, - platform: 'mac', - version: '6.0.5', - versionBase: '6', - versionNumber: 6 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Opera 10+ - 'Opera/9.80 (Windows NT 5.1)': { - title: 'Opera 10+ (exact version unspecified)', - platform: 'Win32', - profile: { - name: 'opera', - layout: 'presto', - layoutVersion: 'unknown', - platform: 'win', - version: '10', - versionBase: '10', - versionNumber: 10 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Opera 12 - 'Opera/9.80 (Windows NT 5.1) Presto/2.12.388 Version/12.11': { - title: 'Opera 12', - platform: 'Win32', - profile: { - name: 'opera', - layout: 'presto', - layoutVersion: 'unknown', - platform: 'win', - version: '12.11', - versionBase: '12', - versionNumber: 12.11 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Opera 15 (WebKit-based) - 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.52 Safari/537.36 OPR/15.0.1147.130': { - title: 'Opera 15', - platform: 'Win32', - profile: { - name: 'opera', - layout: 'webkit', - layoutVersion: 537, - platform: 'win', - version: '15.0.1147.130', - versionBase: '15', - versionNumber: 15 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Chrome 5 - // Chrome 6 - // Chrome 7 - // Chrome 8 - // Chrome 9 - // Chrome 10 - // Chrome 11 - // Chrome 12 - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_5_8) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30': { - title: 'Chrome 12', - platform: 'MacIntel', - profile: { - name: 'chrome', - layout: 'webkit', - layoutVersion: 534, - platform: 'mac', - version: '12.0.742.112', - versionBase: '12', - versionNumber: 12 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.68 Safari/534.30': { - title: 'Chrome 12', - platform: 'Linux i686', - profile: { - name: 'chrome', - layout: 'webkit', - layoutVersion: 534, - platform: 'linux', - version: '12.0.742.68', - versionBase: '12', - versionNumber: 12 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Android WebKit Browser 2.3 - 'Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; HTC Vision Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1': { - title: 'Android WebKit Browser 2.3', - platform: 'Linux armv7l', - profile: { - name: 'android', - layout: 'webkit', - layoutVersion: 533, - platform: 'linux', - version: '2.3.5', - versionBase: '2', - versionNumber: 2.3 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Bug #34924 - 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.34 (KHTML, like Gecko) rekonq Safari/534.34': { - title: 'Rekonq', - platform: 'Linux i686', - profile: { - name: 'rekonq', - layout: 'webkit', - layoutVersion: 534, - platform: 'linux', - version: '534.34', - versionBase: '534', - versionNumber: 534.34 - }, - wikiEditor: { - ltr: true, - rtl: true - } - } - }, - testMap = { - // Example from WikiEditor - // Make sure to use raw numbers, a string like "7.0" would fail on a - // version 10 browser since in string comparaison "10" is before "7.0" :) - 'ltr': { - 'msie': [['>=', 7.0]], - 'firefox': [['>=', 2]], - 'opera': [['>=', 9.6]], - 'safari': [['>=', 3]], - 'chrome': [['>=', 3]], - 'netscape': [['>=', 9]], - 'blackberry': false, - 'ipod': false, - 'iphone': false - }, - 'rtl': { - 'msie': [['>=', 8]], - 'firefox': [['>=', 2]], - 'opera': [['>=', 9.6]], - 'safari': [['>=', 3]], - 'chrome': [['>=', 3]], - 'netscape': [['>=', 9]], - 'blackberry': false, - 'ipod': false, - 'iphone': false - } - } - ; - - // Count test cases - $.each( uas, function () { - uacount++; - } ); - - QUnit.test( 'profile( navObject )', 7, function ( assert ) { - var p = $.client.profile(); - - function unknownOrType( val, type, summary ) { - assert.ok( typeof val === type || val === 'unknown', summary ); - } - - assert.equal( typeof p, 'object', 'profile returns an object' ); - unknownOrType( p.layout, 'string', 'p.layout is a string (or "unknown")' ); - unknownOrType( p.layoutVersion, 'number', 'p.layoutVersion is a number (or "unknown")' ); - unknownOrType( p.platform, 'string', 'p.platform is a string (or "unknown")' ); - unknownOrType( p.version, 'string', 'p.version is a string (or "unknown")' ); - unknownOrType( p.versionBase, 'string', 'p.versionBase is a string (or "unknown")' ); - assert.equal( typeof p.versionNumber, 'number', 'p.versionNumber is a number' ); - } ); - - QUnit.test( 'profile( navObject ) - samples', uacount, function ( assert ) { - // Loop through and run tests - $.each( uas, function ( rawUserAgent, data ) { - // Generate a client profile object and compare recursively - var ret = $.client.profile( { - userAgent: rawUserAgent, - platform: data.platform - } ); - assert.deepEqual( ret, data.profile, 'Client profile support check for ' + data.title + ' (' + data.platform + '): ' + rawUserAgent ); - } ); - } ); - - QUnit.test( 'test( testMap )', 4, function ( assert ) { - // .test() uses eval, make sure no exceptions are thrown - // then do a basic return value type check - var testMatch = $.client.test( testMap ), - ie7Profile = $.client.profile( { - 'userAgent': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)', - 'platform': '' - } ); - - assert.equal( typeof testMatch, 'boolean', 'map with ltr/rtl split returns a boolean value' ); - - testMatch = $.client.test( testMap.ltr ); - - assert.equal( typeof testMatch, 'boolean', 'simple map (without ltr/rtl split) returns a boolean value' ); - - assert.equal( $.client.test( { - 'msie': null - }, ie7Profile ), true, 'returns true if any version of a browser are allowed (null)' ); - - assert.equal( $.client.test( { - 'msie': false - }, ie7Profile ), false, 'returns false if all versions of a browser are not allowed (false)' ); - } ); - - QUnit.test( 'test( testMap, exactMatchOnly )', 2, function ( assert ) { - var ie7Profile = $.client.profile( { - 'userAgent': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)', - 'platform': '' - } ); - - assert.equal( $.client.test( { - 'firefox': [['>=', 2]] - }, ie7Profile, false ), true, 'returns true if browser not found and exactMatchOnly not set' ); - - assert.equal( $.client.test( { - 'firefox': [['>=', 2]] - }, ie7Profile, true ), false, 'returns false if browser not found and exactMatchOnly is set' ); - } ); - - QUnit.test( 'test( testMap) - WikiEditor sample', uacount * 2, function ( assert ) { - var $body = $( 'body' ), - bodyClasses = $body.attr( 'class' ); - - // Loop through and run tests - $.each( uas, function ( agent, data ) { - $.each( ['ltr', 'rtl'], function ( i, dir ) { - var profile, testMatch; - $body.removeClass( 'ltr rtl' ).addClass( dir ); - profile = $.client.profile( { - userAgent: agent, - platform: data.platform - } ); - testMatch = $.client.test( testMap, profile ); - $body.removeClass( dir ); - - assert.equal( testMatch, data.wikiEditor[dir], 'testing comparison based on ' + dir + ', ' + agent ); - } ); - } ); - - // Restore body classes - $body.attr( 'class', bodyClasses ); - } ); -}( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js b/tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js deleted file mode 100644 index 39ae363c..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js +++ /dev/null @@ -1,63 +0,0 @@ -( function ( $ ) { - QUnit.module( 'jquery.colorUtil', QUnit.newMwEnvironment() ); - - QUnit.test( 'getRGB', 18, function ( assert ) { - assert.strictEqual( $.colorUtil.getRGB(), undefined, 'No arguments' ); - assert.strictEqual( $.colorUtil.getRGB( '' ), undefined, 'Empty string' ); - assert.deepEqual( $.colorUtil.getRGB( [0, 100, 255] ), [0, 100, 255], 'Parse array of rgb values' ); - assert.deepEqual( $.colorUtil.getRGB( 'rgb(0,100,255)' ), [0, 100, 255], 'Parse simple rgb string' ); - assert.deepEqual( $.colorUtil.getRGB( 'rgb(0, 100, 255)' ), [0, 100, 255], 'Parse simple rgb string with spaces' ); - assert.deepEqual( $.colorUtil.getRGB( 'rgb(0%,20%,40%)' ), [0, 51, 102], 'Parse rgb string with percentages' ); - assert.deepEqual( $.colorUtil.getRGB( 'rgb(0%, 20%, 40%)' ), [0, 51, 102], 'Parse rgb string with percentages and spaces' ); - assert.deepEqual( $.colorUtil.getRGB( '#f2ddee' ), [242, 221, 238], 'Hex string: 6 char lowercase' ); - assert.deepEqual( $.colorUtil.getRGB( '#f2DDEE' ), [242, 221, 238], 'Hex string: 6 char uppercase' ); - assert.deepEqual( $.colorUtil.getRGB( '#f2DdEe' ), [242, 221, 238], 'Hex string: 6 char mixed' ); - assert.deepEqual( $.colorUtil.getRGB( '#eee' ), [238, 238, 238], 'Hex string: 3 char lowercase' ); - assert.deepEqual( $.colorUtil.getRGB( '#EEE' ), [238, 238, 238], 'Hex string: 3 char uppercase' ); - assert.deepEqual( $.colorUtil.getRGB( '#eEe' ), [238, 238, 238], 'Hex string: 3 char mixed' ); - assert.deepEqual( $.colorUtil.getRGB( 'rgba(0, 0, 0, 0)' ), [255, 255, 255], 'Zero rgba for Safari 3; Transparent (whitespace)' ); - - // Perhaps this is a bug in colorUtil, but it is the current behavior so, let's keep - // track of it, so we will know in case it would ever change. - assert.strictEqual( $.colorUtil.getRGB( 'rgba(0,0,0,0)' ), undefined, 'Zero rgba without whitespace' ); - - assert.deepEqual( $.colorUtil.getRGB( 'lightGreen' ), [144, 238, 144], 'Color names (lightGreen)' ); - assert.deepEqual( $.colorUtil.getRGB( 'transparent' ), [255, 255, 255], 'Color names (transparent)' ); - assert.strictEqual( $.colorUtil.getRGB( 'mediaWiki' ), undefined, 'Inexisting color name' ); - } ); - - QUnit.test( 'rgbToHsl', 1, function ( assert ) { - var hsl, ret; - - // Cross-browser differences in decimals... - // Round to two decimals so they can be more reliably checked. - function dualDecimals( a ) { - return Math.round( a * 100 ) / 100; - } - - // Re-create the rgbToHsl return array items, limited to two decimals. - hsl = $.colorUtil.rgbToHsl( 144, 238, 144 ); - ret = [ dualDecimals( hsl[0] ), dualDecimals( hsl[1] ), dualDecimals( hsl[2] ) ]; - - assert.deepEqual( ret, [0.33, 0.73, 0.75], 'rgb(144, 238, 144): hsl(0.33, 0.73, 0.75)' ); - } ); - - QUnit.test( 'hslToRgb', 1, function ( assert ) { - var rgb, ret; - rgb = $.colorUtil.hslToRgb( 0.3, 0.7, 0.8 ); - - // Re-create the hslToRgb return array items, rounded to whole numbers. - ret = [ Math.round( rgb[0] ), Math.round( rgb[1] ), Math.round( rgb[2] ) ]; - - assert.deepEqual( ret, [183, 240, 168], 'hsl(0.3, 0.7, 0.8): rgb(183, 240, 168)' ); - } ); - - QUnit.test( 'getColorBrightness', 2, function ( assert ) { - var a, b; - a = $.colorUtil.getColorBrightness( 'red', +0.1 ); - assert.equal( a, 'rgb(255,50,50)', 'Start with named color "red", brighten 10%' ); - - b = $.colorUtil.getColorBrightness( 'rgb(200,50,50)', -0.2 ); - assert.equal( b, 'rgb(118,29,29)', 'Start with rgb string "rgb(200,50,50)", darken 20%' ); - } ); -}( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js b/tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js deleted file mode 100644 index 234b19cb..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js +++ /dev/null @@ -1,37 +0,0 @@ -( function ( $ ) { - QUnit.asyncTest( 'jquery.delayedBind with data option', 2, function ( assert ) { - var $fixture = $( '
        ' ).appendTo( '#qunit-fixture' ), - data = { - magic: 'beeswax' - }, - delay = 50; - - $fixture.delayedBind( delay, 'testevent', data, function ( e ) { - assert.ok( true, 'testevent fired' ); - assert.ok( e.data === data, 'data is passed through delayedBind' ); - QUnit.start(); - } ); - - // We'll trigger it thrice, but it should only happen once. - $fixture.trigger( 'testevent', {} ); - $fixture.trigger( 'testevent', {} ); - $fixture.trigger( 'testevent', {} ); - $fixture.trigger( 'testevent', {} ); - } ); - - QUnit.asyncTest( 'jquery.delayedBind without data option', 1, function ( assert ) { - var $fixture = $( '
        ' ).appendTo( '#qunit-fixture' ), - delay = 50; - - $fixture.delayedBind( delay, 'testevent', function () { - assert.ok( true, 'testevent fired' ); - QUnit.start(); - } ); - - // We'll trigger it thrice, but it should only happen once. - $fixture.trigger( 'testevent', {} ); - $fixture.trigger( 'testevent', {} ); - $fixture.trigger( 'testevent', {} ); - $fixture.trigger( 'testevent', {} ); - } ); -}( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js b/tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js deleted file mode 100644 index 0b7e87ee..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js +++ /dev/null @@ -1,13 +0,0 @@ -( function ( $ ) { - QUnit.module( 'jquery.getAttrs', QUnit.newMwEnvironment() ); - - QUnit.test( 'Check', 1, function ( assert ) { - var attrs = { - foo: 'bar', - 'class': 'lorem' - }, - $el = $( '
        ' ).attr( attrs ); - - assert.deepEqual( $el.getAttrs(), attrs, 'getAttrs() return object should match the attributes set, no more, no less' ); - } ); -}( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js b/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js deleted file mode 100644 index 906369ee..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js +++ /dev/null @@ -1,22 +0,0 @@ -( function ( $ ) { - QUnit.module( 'jquery.hidpi', QUnit.newMwEnvironment() ); - - QUnit.test( 'devicePixelRatio', 1, function ( assert ) { - var devicePixelRatio = $.devicePixelRatio(); - assert.equal( typeof devicePixelRatio, 'number', '$.devicePixelRatio() returns a number' ); - } ); - - QUnit.test( 'matchSrcSet', 6, function ( assert ) { - var srcset = 'onefive.png 1.5x, two.png 2x'; - - // Nice exact matches - assert.equal( $.matchSrcSet( 1, srcset ), null, '1.0 gives no match' ); - assert.equal( $.matchSrcSet( 1.5, srcset ), 'onefive.png', '1.5 gives match' ); - assert.equal( $.matchSrcSet( 2, srcset ), 'two.png', '2 gives match' ); - - // Non-exact matches; should return the next-biggest specified - assert.equal( $.matchSrcSet( 1.25, srcset ), null, '1.25 gives no match' ); - assert.equal( $.matchSrcSet( 1.75, srcset ), 'onefive.png', '1.75 gives match to 1.5' ); - assert.equal( $.matchSrcSet( 2.25, srcset ), 'two.png', '2.25 gives match to 2' ); - } ); -}( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.highlightText.test.js b/tests/qunit/suites/resources/jquery/jquery.highlightText.test.js deleted file mode 100644 index e1fb96dc..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.highlightText.test.js +++ /dev/null @@ -1,235 +0,0 @@ -( function ( $ ) { - QUnit.module( 'jquery.highlightText', QUnit.newMwEnvironment() ); - - QUnit.test( 'Check', function ( assert ) { - var $fixture, cases = [ - { - desc: 'Test 001', - text: 'Blue Öyster Cult', - highlight: 'Blue', - expected: 'Blue Öyster Cult' - }, - { - desc: 'Test 002', - text: 'Blue Öyster Cult', - highlight: 'Blue ', - expected: 'Blue Öyster Cult' - }, - { - desc: 'Test 003', - text: 'Blue Öyster Cult', - highlight: 'Blue Ö', - expected: 'Blue Öyster Cult' - }, - { - desc: 'Test 004', - text: 'Blue Öyster Cult', - highlight: 'Blue Öy', - expected: 'Blue Öyster Cult' - }, - { - desc: 'Test 005', - text: 'Blue Öyster Cult', - highlight: ' Blue', - expected: 'Blue Öyster Cult' - }, - { - desc: 'Test 006', - text: 'Blue Öyster Cult', - highlight: ' Blue ', - expected: 'Blue Öyster Cult' - }, - { - desc: 'Test 007', - text: 'Blue Öyster Cult', - highlight: ' Blue Ö', - expected: 'Blue Öyster Cult' - }, - { - desc: 'Test 008', - text: 'Blue Öyster Cult', - highlight: ' Blue Öy', - expected: 'Blue Öyster Cult' - }, - { - desc: 'Test 009: Highlighter broken on starting Umlaut?', - text: 'Österreich', - highlight: 'Österreich', - expected: 'Österreich' - }, - { - desc: 'Test 010: Highlighter broken on starting Umlaut?', - text: 'Österreich', - highlight: 'Ö', - expected: 'Österreich' - }, - { - desc: 'Test 011: Highlighter broken on starting Umlaut?', - text: 'Österreich', - highlight: 'Öst', - expected: 'Österreich' - }, - { - desc: 'Test 012: Highlighter broken on starting Umlaut?', - text: 'Österreich', - highlight: 'Oe', - expected: 'Österreich' - }, - { - desc: 'Test 013: Highlighter broken on punctuation mark?', - text: 'So good. To be there', - highlight: 'good', - expected: 'So good. To be there' - }, - { - desc: 'Test 014: Highlighter broken on space?', - text: 'So good. To be there', - highlight: 'be', - expected: 'So good. To be there' - }, - { - desc: 'Test 015: Highlighter broken on space?', - text: 'So good. To be there', - highlight: ' be', - expected: 'So good. To be there' - }, - { - desc: 'Test 016: Highlighter broken on space?', - text: 'So good. To be there', - highlight: 'be ', - expected: 'So good. To be there' - }, - { - desc: 'Test 017: Highlighter broken on space?', - text: 'So good. To be there', - highlight: ' be ', - expected: 'So good. To be there' - }, - { - desc: 'Test 018: en de Highlighter broken on special character at the end?', - text: 'So good. xbß', - highlight: 'xbß', - expected: 'So good. xbß' - }, - { - desc: 'Test 019: en de Highlighter broken on special character at the end?', - text: 'So good. xbß.', - highlight: 'xbß.', - expected: 'So good. xbß.' - }, - { - desc: 'Test 020: RTL he Hebrew', - text: 'חסיד אומות העולם', - highlight: 'חסיד אומות העולם', - expected: 'חסיד אומות העולם' - }, - { - desc: 'Test 021: RTL he Hebrew', - text: 'חסיד אומות העולם', - highlight: 'חסי', - expected: 'חסיד אומות העולם' - }, - { - desc: 'Test 022: ja Japanese', - text: '諸国民の中の正義の人', - highlight: '諸国民の中の正義の人', - expected: '諸国民の中の正義の人' - }, - { - desc: 'Test 023: ja Japanese', - text: '諸国民の中の正義の人', - highlight: '諸国', - expected: '諸国民の中の正義の人' - }, - { - desc: 'Test 024: fr French text and « french quotes » (guillemets)', - text: '« L\'oiseau est sur l’île »', - highlight: '« L\'oiseau est sur l’île »', - expected: '« L\'oiseau est sur l’île »' - }, - { - desc: 'Test 025: fr French text and « french quotes » (guillemets)', - text: '« L\'oiseau est sur l’île »', - highlight: '« L\'oise', - expected: '« L\'oiseau est sur l’île »' - }, - { - desc: 'Test 025a: fr French text and « french quotes » (guillemets) - does it match the single strings "«" and "L" separately?', - text: '« L\'oiseau est sur l’île »', - highlight: '« L', - expected: '« L\'oiseau est sur l’île »' - }, - { - desc: 'Test 026: ru Russian', - text: 'Праведники мира', - highlight: 'Праведники мира', - expected: 'Праведники мира' - }, - { - desc: 'Test 027: ru Russian', - text: 'Праведники мира', - highlight: 'Праве', - expected: 'Праведники мира' - }, - { - desc: 'Test 028 ka Georgian', - text: 'მთავარი გვერდი', - highlight: 'მთავარი გვერდი', - expected: 'მთავარი გვერდი' - }, - { - desc: 'Test 029 ka Georgian', - text: 'მთავარი გვერდი', - highlight: 'მთა', - expected: 'მთავარი გვერდი' - }, - { - desc: 'Test 030 hy Armenian', - text: 'Նոնա Գափրինդաշվիլի', - highlight: 'Նոնա Գափրինդաշվիլի', - expected: 'Նոնա Գափրինդաշվիլի' - }, - { - desc: 'Test 031 hy Armenian', - text: 'Նոնա Գափրինդաշվիլի', - highlight: 'Նոն', - expected: 'Նոնա Գափրինդաշվիլի' - }, - { - desc: 'Test 032: th Thai', - text: 'พอล แอร์ดิช', - highlight: 'พอล แอร์ดิช', - expected: 'พอล แอร์ดิช' - }, - { - desc: 'Test 033: th Thai', - text: 'พอล แอร์ดิช', - highlight: 'พอ', - expected: 'พอล แอร์ดิช' - }, - { - desc: 'Test 034: RTL ar Arabic', - text: 'بول إيردوس', - highlight: 'بول إيردوس', - expected: 'بول إيردوس' - }, - { - desc: 'Test 035: RTL ar Arabic', - text: 'بول إيردوس', - highlight: 'بو', - expected: 'بول إيردوس' - } - ]; - QUnit.expect( cases.length ); - - $.each( cases, function ( i, item ) { - $fixture = $( '

        ' ).text( item.text ).highlightText( item.highlight ); - assert.equal( - $fixture.html(), - // Re-parse to normalize - $( '

        ' ).html( item.expected ).html(), - item.desc || undefined - ); - } ); - } ); -}( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.localize.test.js b/tests/qunit/suites/resources/jquery/jquery.localize.test.js deleted file mode 100644 index 3ef27903..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.localize.test.js +++ /dev/null @@ -1,135 +0,0 @@ -( function ( $, mw ) { - QUnit.module( 'jquery.localize', QUnit.newMwEnvironment() ); - - QUnit.test( 'Handle basic replacements', 4, function ( assert ) { - var html, $lc; - mw.messages.set( 'basic', 'Basic stuff' ); - - // Tag: html:msg - html = '

        '; - $lc = $( html ).localize().find( 'span' ); - - assert.strictEqual( $lc.text(), 'Basic stuff', 'Tag: html:msg' ); - - // Attribute: title-msg - html = '
        '; - $lc = $( html ).localize().find( 'span' ); - - assert.strictEqual( $lc.attr( 'title' ), 'Basic stuff', 'Attribute: title-msg' ); - - // Attribute: alt-msg - html = '
        '; - $lc = $( html ).localize().find( 'span' ); - - assert.strictEqual( $lc.attr( 'alt' ), 'Basic stuff', 'Attribute: alt-msg' ); - - // Attribute: placeholder-msg - html = '
        '; - $lc = $( html ).localize().find( 'input' ); - - assert.strictEqual( $lc.attr( 'placeholder' ), 'Basic stuff', 'Attribute: placeholder-msg' ); - } ); - - QUnit.test( 'Proper escaping', 2, function ( assert ) { - var html, $lc; - mw.messages.set( 'properfoo', '' ); - - // This is handled by jQuery inside $.fn.localize, just a simple sanity checked - // making sure it is actually using text() and attr() (or something with the same effect) - - // Text escaping - html = '
        '; - $lc = $( html ).localize().find( 'span' ); - - assert.strictEqual( $lc.text(), mw.msg( 'properfoo' ), 'Content is inserted as text, not as html.' ); - - // Attribute escaping - html = '
        '; - $lc = $( html ).localize().find( 'span' ); - - assert.strictEqual( $lc.attr( 'title' ), mw.msg( 'properfoo' ), 'Attributes are not inserted raw.' ); - } ); - - QUnit.test( 'Options', 7, function ( assert ) { - mw.messages.set( { - 'foo-lorem': 'Lorem', - 'foo-ipsum': 'Ipsum', - 'foo-bar-title': 'Read more about bars', - 'foo-bar-label': 'The Bars', - 'foo-bazz-title': 'Read more about bazz at $1 (last modified: $2)', - 'foo-bazz-label': 'The Bazz ($1)', - 'foo-welcome': 'Welcome to $1! (last visit: $2)' - } ); - var html, $lc, x, sitename = 'Wikipedia'; - - // Message key prefix - html = '
        '; - $lc = $( html ).localize( { - prefix: 'foo-' - } ).find( 'span' ); - - assert.strictEqual( $lc.attr( 'title' ), 'Lorem', 'Message key prefix - attr' ); - assert.strictEqual( $lc.text(), 'Ipsum', 'Message key prefix - text' ); - - // Variable keys mapping - x = 'bar'; - html = '
        '; - $lc = $( html ).localize( { - keys: { - 'title': 'foo-' + x + '-title', - 'label': 'foo-' + x + '-label' - } - } ).find( 'span' ); - - assert.strictEqual( $lc.attr( 'title' ), 'Read more about bars', 'Variable keys mapping - attr' ); - assert.strictEqual( $lc.text(), 'The Bars', 'Variable keys mapping - text' ); - - // Passing parameteters to mw.msg - html = '
        '; - $lc = $( html ).localize( { - params: { - 'foo-welcome': [sitename, 'yesterday'] - } - } ).find( 'span' ); - - assert.strictEqual( $lc.text(), 'Welcome to Wikipedia! (last visit: yesterday)', 'Passing parameteters to mw.msg' ); - - // Combination of options prefix, params and keys - x = 'bazz'; - html = '
        '; - $lc = $( html ).localize( { - prefix: 'foo-', - keys: { - 'title': x + '-title', - 'label': x + '-label' - }, - params: { - 'title': [sitename, '3 minutes ago'], - 'label': [sitename, '3 minutes ago'] - - } - } ).find( 'span' ); - - assert.strictEqual( $lc.text(), 'The Bazz (Wikipedia)', 'Combination of options prefix, params and keys - text' ); - assert.strictEqual( $lc.attr( 'title' ), 'Read more about bazz at Wikipedia (last modified: 3 minutes ago)', 'Combination of options prefix, params and keys - attr' ); - } ); - - QUnit.test( 'Handle data text', 2, function ( assert ) { - var html, $lc; - mw.messages.set( 'option-one', 'Item 1' ); - mw.messages.set( 'option-two', 'Item 2' ); - html = ''; - $lc = $( html ).localize().find( 'option' ); - assert.strictEqual( $lc.eq( 0 ).text(), mw.msg( 'option-one' ), 'data-msg-text becomes text of options' ); - assert.strictEqual( $lc.eq( 1 ).text(), mw.msg( 'option-two' ), 'data-msg-text becomes text of options' ); - } ); - - QUnit.test( 'Handle data html', 2, function ( assert ) { - var html, $lc; - mw.messages.set( 'html', 'behold... there is a link here!!' ); - html = '
        '; - $lc = $( html ).localize().find( 'a' ); - assert.strictEqual( $lc.length, 1, 'link is created' ); - assert.strictEqual( $lc.text(), 'link', 'the link text got added' ); - } ); -}( jQuery, mediaWiki ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js b/tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js deleted file mode 100644 index 6da56ed2..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js +++ /dev/null @@ -1,287 +0,0 @@ -( function ( mw, $ ) { - var loremIpsum = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.'; - - QUnit.module( 'jquery.makeCollapsible', QUnit.newMwEnvironment() ); - - function prepareCollapsible( html, options ) { - return $( $.parseHTML( html ) ) - .appendTo( '#qunit-fixture' ) - // options might be undefined here - this is okay - .makeCollapsible( options ); - } - - // This test is first because if it fails, then almost all of the latter tests are meaningless. - QUnit.asyncTest( 'testing hooks/triggers', 4, function ( assert ) { - var $collapsible, $content, $toggle; - $collapsible = prepareCollapsible( - '
        ' + loremIpsum + '
        ' - ); - $content = $collapsible.find( '.mw-collapsible-content' ); - $toggle = $collapsible.find( '.mw-collapsible-toggle' ); - - // In one full collapse-expand cycle, each event will be fired once - - // On collapse... - $collapsible.on( 'beforeCollapse.mw-collapsible', function () { - assert.assertTrue( $content.is( ':visible' ), 'first beforeCollapseExpand: content is visible' ); - } ); - $collapsible.on( 'afterCollapse.mw-collapsible', function () { - assert.assertTrue( $content.is( ':hidden' ), 'first afterCollapseExpand: content is hidden' ); - - // On expand... - $collapsible.on( 'beforeExpand.mw-collapsible', function () { - assert.assertTrue( $content.is( ':hidden' ), 'second beforeCollapseExpand: content is hidden' ); - } ); - $collapsible.on( 'afterExpand.mw-collapsible', function () { - assert.assertTrue( $content.is( ':visible' ), 'second afterCollapseExpand: content is visible' ); - - QUnit.start(); - } ); - - // ...expanding happens here - $toggle.trigger( 'click' ); - } ); - - // ...collapsing happens here - $toggle.trigger( 'click' ); - } ); - - QUnit.asyncTest( 'basic operation (
        )', 5, function ( assert ) { - var $collapsible, $content, $toggle; - $collapsible = prepareCollapsible( - '
        ' + loremIpsum + '
        ' - ); - $content = $collapsible.find( '.mw-collapsible-content' ); - $toggle = $collapsible.find( '.mw-collapsible-toggle' ); - - assert.equal( $content.length, 1, 'content is present' ); - assert.equal( $content.find( $toggle ).length, 0, 'toggle is not a descendant of content' ); - - assert.assertTrue( $content.is( ':visible' ), 'content is visible' ); - - $collapsible.on( 'afterCollapse.mw-collapsible', function () { - assert.assertTrue( $content.is( ':hidden' ), 'after collapsing: content is hidden' ); - - $collapsible.on( 'afterExpand.mw-collapsible', function () { - assert.assertTrue( $content.is( ':visible' ), 'after expanding: content is visible' ); - QUnit.start(); - } ); - - $toggle.trigger( 'click' ); - } ); - - $toggle.trigger( 'click' ); - } ); - - QUnit.asyncTest( 'basic operation ()', 7, function ( assert ) { - var $collapsible, $headerRow, $contentRow, $toggle; - $collapsible = prepareCollapsible( - '
        ' + - '' + - '' + - '' + - '
        ' + loremIpsum + '' + loremIpsum + '
        ' + loremIpsum + '' + loremIpsum + '
        ' + loremIpsum + '' + loremIpsum + '
        ' - ); - $headerRow = $collapsible.find( 'tr:first' ); - $contentRow = $collapsible.find( 'tr:last' ); - - $toggle = $headerRow.find( 'td:last .mw-collapsible-toggle' ); - assert.equal( $toggle.length, 1, 'toggle is added to last cell of first row' ); - - assert.assertTrue( $headerRow.is( ':visible' ), 'headerRow is visible' ); - assert.assertTrue( $contentRow.is( ':visible' ), 'contentRow is visible' ); - - $collapsible.on( 'afterCollapse.mw-collapsible', function () { - assert.assertTrue( $headerRow.is( ':visible' ), 'after collapsing: headerRow is still visible' ); - assert.assertTrue( $contentRow.is( ':hidden' ), 'after collapsing: contentRow is hidden' ); - - $collapsible.on( 'afterExpand.mw-collapsible', function () { - assert.assertTrue( $headerRow.is( ':visible' ), 'after expanding: headerRow is still visible' ); - assert.assertTrue( $contentRow.is( ':visible' ), 'after expanding: contentRow is visible' ); - QUnit.start(); - } ); - - $toggle.trigger( 'click' ); - } ); - - $toggle.trigger( 'click' ); - } ); - - function listTest( listType, assert ) { - var $collapsible, $toggleItem, $contentItem, $toggle; - $collapsible = prepareCollapsible( - '<' + listType + ' class="mw-collapsible">' + - '
      1. ' + loremIpsum + '
      2. ' + - '
      3. ' + loremIpsum + '
      4. ' + - '' - ); - $toggleItem = $collapsible.find( 'li.mw-collapsible-toggle-li:first-child' ); - $contentItem = $collapsible.find( 'li:last' ); - - $toggle = $toggleItem.find( '.mw-collapsible-toggle' ); - assert.equal( $toggle.length, 1, 'toggle is present, added inside new zeroth list item' ); - - assert.assertTrue( $toggleItem.is( ':visible' ), 'toggleItem is visible' ); - assert.assertTrue( $contentItem.is( ':visible' ), 'contentItem is visible' ); - - $collapsible.on( 'afterCollapse.mw-collapsible', function () { - assert.assertTrue( $toggleItem.is( ':visible' ), 'after collapsing: toggleItem is still visible' ); - assert.assertTrue( $contentItem.is( ':hidden' ), 'after collapsing: contentItem is hidden' ); - - $collapsible.on( 'afterExpand.mw-collapsible', function () { - assert.assertTrue( $toggleItem.is( ':visible' ), 'after expanding: toggleItem is still visible' ); - assert.assertTrue( $contentItem.is( ':visible' ), 'after expanding: contentItem is visible' ); - QUnit.start(); - } ); - - $toggle.trigger( 'click' ); - } ); - - $toggle.trigger( 'click' ); - } - - QUnit.asyncTest( 'basic operation ( - -!! end -!! test -Definition Lists: Mixed Lists: Test 11 (parsoid) -!! options -parsoid -!! input -*#*#;*;;foo :bar -*#*#;boo :baz -!! result -
          -
        • -
            -
          1. -
              -
            • -
                -
              1. -
                -
                -
                  -
                • -
                  -
                  -
                  -
                  foo 
                  -
                  bar
                  -
                  -
                • -
                -
                boo 
                -
                baz
                -
              2. -
            • -
          2. -
        • -
        -!! end - - -!! test -Definition Lists: Weird Ones: Test 1 (php) -!! options -php -!! input -*#;*::;; foo : bar (who uses this?) -!! result -
          -
          1. -
          2. -
            foo 
            -
              -
            • -
              -
              -
              -
              bar (who uses this?) -
              -
              -
              -
              -
              -
              -
            -
            -
          3. -
        - - -

      5. - - - - -!! end -!! test -Definition Lists: Weird Ones: Test 1 (parsoid) -!! options -parsoid -!! input -*#;*::;; foo : bar (who uses this?) -!! result -
          -
        • -
            -
          1. -
            -
            -
              -
            • -
              -
              -
              -
              -
              -
              -
              -
              foo 
              -
              bar (who uses this?)
              -
              -
              -
              -
            • -
            -
          2. -
        • -
        -!! end - -### -### External links -### -!! test -External links: non-bracketed -!! input -Non-bracketed: http://example.com -!! result -

        Non-bracketed: http://example.com -

        -!! end - -!! test -External links: numbered -!! input -Numbered: [http://example.com] -Numbered: [http://example.net] -Numbered: [http://example.com] -!! result -

        Numbered: [1] -Numbered: [2] -Numbered: [3] -

        -!!end - -!! test -External links: specified text -!! input -Specified text: [http://example.com link] -!! result -

        Specified text: link -

        -!!end - -!! test -External links: trail -!! input -Linktrails should not work for external links: [http://example.com link]s -!! result -

        Linktrails should not work for external links: links -

        -!! end - -!! test -External links: dollar sign in URL -!! input -http://example.com/1$2345 -!! result -

        http://example.com/1$2345 -

        -!! end - -!! test -External links: dollar sign in URL (named) -!! input -[http://example.com/1$2345] -!! result -

        [1] -

        -!!end - -!! test -External links: open square bracket forbidden in URL (bug 4377) -!! input -http://example.com/1[2345 -!! result -

        http://example.com/1[2345 -

        -!! end - -!! test -External links: open square bracket forbidden in URL (named) (bug 4377) -!! input -[http://example.com/1[2345] -!! result -

        [2345 -

        -!!end - -!! test -External links: nowiki in URL link text (bug 6230) -!!input -[http://example.com/ ''example site''] -!! result -

        ''example site'' -

        -!! end - -!! test -External links: newline forbidden in text (bug 6230 regression check) -!! input -[http://example.com/ first -second] -!! result -

        [http://example.com/ first -second] -

        -!!end - -!! test -External links: Pipe char between url and text -!! input -[http://example.com | link] -!! result -

        | link -

        -!!end - -!! test -External links: protocol-relative URL in brackets -!! input -[//example.com/ Test] -!! result -

        Test -

        -!! end - -!! test -External links: protocol-relative URL in brackets without text -!! input -[//example.com] -!! result -

        [1] -

        -!! end - -!! test -External links: protocol-relative URL in free text is left alone -!! input -//example.com/Foo -!! result -

        //example.com/Foo -

        -!!end - -!! test -External links: protocol-relative URL in the middle of a word is left alone (bug 30269) -!! input -foo//example.com/Foo -!! result -

        foo//example.com/Foo -

        -!! end - -!! test -External image -!! input -External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png -!! result -

        External image: Ncwikicol.png -

        -!! end - -!! test -External image from https -!! input -External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png -!! result -

        External image from https: Ncwikicol.png -

        -!! end - -!! test -External image (when not allowed) -!! options -wgAllowExternalImages=0 -!! input -External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png -!! result -

        External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png -

        -!! end - -!! test -Link to non-http image, no img tag -!! input -Link to non-http image, no img tag: ftp://example.com/test.jpg -!! result -

        Link to non-http image, no img tag: ftp://example.com/test.jpg -

        -!! end - -!! test -External links: terminating separator -!! input -Terminating separator: http://example.com/thing, -!! result -

        Terminating separator: http://example.com/thing, -

        -!! end - -!! test -External links: intervening separator -!! input -Intervening separator: http://example.com/1,2,3 -!! result -

        Intervening separator: http://example.com/1,2,3 -

        -!! end - -!! test -External links: old bug with URL in query -!! input -Old bug with URL in query: [http://example.com/thing?url=http://example.com link] -!! result -

        Old bug with URL in query: link -

        -!! end - -!! test -External links: old URL-in-URL bug, mixed protocols -!! input -And again with mixed protocols: [ftp://example.com?url=http://example.com link] -!! result -

        And again with mixed protocols: link -

        -!!end - -!! test -External links: URL in text -!! input -URL in text: [http://example.com http://example.com] -!! result -

        URL in text: http://example.com -

        -!! end - -!! test -External links: Clickable images -!! input -ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png] -!! result -

        ja-style clickable images: Ncwikicol.png -

        -!!end - -!! test -External links: raw ampersand -!! input -Old & use: http://x&y -!! result -

        Old & use: http://x&y -

        -!! end - -!! test -External links: encoded ampersand -!! input -Old & use: http://x&y -!! result -

        Old & use: http://x&y -

        -!! end - -!! test -External links: encoded equals (bug 6102) -!! input -http://example.com/?foo=bar -!! result -

        http://example.com/?foo=bar -

        -!! end - -!! test -External links: [raw ampersand] -!! input -Old & use: [http://x&y] -!! result -

        Old & use: [1] -

        -!! end - -!! test -External links: [encoded ampersand] -!! input -Old & use: [http://x&y] -!! result -

        Old & use: [1] -

        -!! end - -!! test -External links: [encoded equals] (bug 6102) -!! input -[http://example.com/?foo=bar] -!! result -

        [1] -

        -!! end - -!! test -External links: [IDN ignored character reference in hostname; strip it right off] -!! input -[http://e‌xample.com/] -!! result -

        [1] -

        -!! end - -# FIXME: This test (the IDN characters in the text of a link) is an inconsistency. -# Where an external link could easily circumvent the sanitization of the text of -# a link like this (where an IDN-ignore character is in the URL somewhere), this -# test demands a higher standard. That's a bit strange. -# -# Example: -# -# http://e‌xample.com -> [http://example.com|http://example.com] -# [http://example.com|http://e‌xample.com] -> [http://example.com|http://e‌xample.com] -# -# The first example is sanitized, but the second is not. Any security benefits -# from this production are trivial to circumvent. Either remove this test and -# let the parser(s) do their thing unaccosted, or fix the inconsistency and change -# the test accordingly. -# -# All our love, -# The Parsoid team. -!! test -External links: IDN ignored character reference in hostname; strip it right off -!! input -http://e‌xample.com/ -!! result -

        http://example.com/ -

        -!! end - -!! test -External links: www.jpeg.org (bug 554) -!! input -http://www.jpeg.org -!!result -

        http://www.jpeg.org -

        -!! end - -!! test -External links: URL within URL (original bug 2) -!! input -[http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp] -!! result -

        [1] -

        -!! end - -!! test -BUG 361: URL inside bracketed URL -!! input -[http://www.example.com/foo http://www.example.com/bar] -!! result -

        http://www.example.com/bar -

        -!! end - -!! test -BUG 361: URL within URL, not bracketed -!! input -http://www.example.com/foo?=http://www.example.com/bar -!! result -

        http://www.example.com/foo?=http://www.example.com/bar -

        -!! end - -!! test -BUG 289: ">"-token in URL-tail -!! input -http://www.example.com/ -!! result -

        http://www.example.com/<hello> -

        -!!end - -!! test -BUG 289: literal ">"-token in URL-tail -!! input -http://www.example.com/html -!! result -

        http://www.example.com/html -

        -!!end - -!! test -BUG 289: ">"-token in bracketed URL -!! input -[http://www.example.com/ stuff] -!! result -

        <hello> stuff -

        -!!end - -!! test -BUG 289: literal ">"-token in bracketed URL -!! input -[http://www.example.com/html stuff] -!! result -

        html stuff -

        -!!end - -!! test -BUG 289: literal double quote at end of URL -!! input -http://www.example.com/"hello" -!! result -

        http://www.example.com/"hello" -

        -!!end - -!! test -BUG 289: literal double quote in bracketed URL -!! input -[http://www.example.com/"hello" stuff] -!! result -

        "hello" stuff -

        -!!end - -!! test -External links: multiple legal whitespace is fine, Magnus. Don't break it please. (bug 5081) -!! input -[http://www.example.com test] -!! result -

        test -

        -!! end - -!! test -External links: link text with spaces -!! input -[http://www.example.com a b c] -[http://www.example.com ''a'' ''b''] -!! result -

        a b c -a b -

        -!! end - -!! test -External links: wiki links within external link (Bug 3695) -!! input -[http://example.com [[wikilink]] embedded in ext link] -!! result -

        wikilink embedded in ext link -

        -!! end - -!! test -BUG 787: Links with one slash after the url protocol are invalid -!! input -http:/example.com - -[http:/example.com title] -!! result -

        http:/example.com -

        [http:/example.com title] -

        -!! end - -!! test -Bracketed external links with template-generated invalid target -!! input -[{{echo|http:/example.com}} title] -!! result -

        [http:/example.com title] -

        -!! end - -!! test -Bug 2702: Mismatched , and tags are invalid -!! input -''[http://example.com text''] -[http://example.com '''text]''' -''Something [http://example.com in italic''] -''Something [http://example.com mixed''''', even bold]''' -'''''Now [http://example.com both'''''] -!! result -

        text -text -Something in italic -Something mixed, even bold -Now both -

        -!! end - - -!! test -Bug 4781: %26 in URL -!! input -http://www.example.com/?title=AT%26T -!! result -

        http://www.example.com/?title=AT%26T -

        -!! end - -# According to http://dev.w3.org/html5/spec/Overview.html#parsing-urls a plain -# % is actually legal in HTML5. Any change in output would need testing though. -!! test -Bug 4781, 5267: %25 in URL -!! input -http://www.example.com/?title=100%25_Bran -!! result -

        http://www.example.com/?title=100%25_Bran -

        -!! end - -!! test -Bug 4781, 5267: %28, %29 in URL -!! input -http://www.example.com/?title=Ben-Hur_%281959_film%29 -!! result -

        http://www.example.com/?title=Ben-Hur_%281959_film%29 -

        -!! end - - -!! test -Bug 4781: %26 in autonumber URL -!! input -[http://www.example.com/?title=AT%26T] -!! result -

        [1] -

        -!! end - -!! test -Bug 4781, 5267: %26 in autonumber URL -!! input -[http://www.example.com/?title=100%25_Bran] -!! result -

        [1] -

        -!! end - -!! test -Bug 4781, 5267: %28, %29 in autonumber URL -!! input -[http://www.example.com/?title=Ben-Hur_%281959_film%29] -!! result -

        [1] -

        -!! end - - -!! test -Bug 4781: %26 in bracketed URL -!! input -[http://www.example.com/?title=AT%26T link] -!! result -

        link -

        -!! end - -!! test -Bug 4781, 5267: %26 in bracketed URL -!! input -[http://www.example.com/?title=100%25_Bran link] -!! result -

        link -

        -!! end - -!! test -Bug 4781, 5267: %28, %29 in bracketed URL -!! input -[http://www.example.com/?title=Ben-Hur_%281959_film%29 link] -!! result -

        link -

        -!! end - -!! test -External link containing double-single-quotes in text '' (bug 4598 sanity check) -!! input -Some [http://example.com/ pretty ''italics'' and stuff]! -!! result -

        Some pretty italics and stuff! -

        -!! end - -!! test -External link containing double-single-quotes in text embedded in italics (bug 4598 sanity check) -!! input -''Some [http://example.com/ pretty ''italics'' and stuff]!'' -!! result -

        Some pretty italics and stuff! -

        -!! end - -!! test -External link containing double-single-quotes with no space separating the url from text in italics -!! input -[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].] -!! result -

        La muerte de Casagemas (1901) en el sitio de Museo Picasso. -

        -!! end - -!! test -External link with comments in link text -!! input -[http://www.google.com Google ] -!! result -

        Google -

        -!! end - -!! test -URL-encoding in URL functions (single parameter) -!! input -{{localurl:Some page|amp=&}} -!! result -

        /index.php?title=Some_page&amp=& -

        -!! end - -!! test -URL-encoding in URL functions (multiple parameters) -!! input -{{localurl:Some page|q=?&=&}} -!! result -

        /index.php?title=Some_page&q=?&amp=& -

        -!! end - -!! test -Brackets in urls -!! input -http://example.com/index.php?foozoid%5B%5D=bar - -http://example.com/index.php?foozoid[]=bar -!! result -

        http://example.com/index.php?foozoid%5B%5D=bar -

        http://example.com/index.php?foozoid%5B%5D=bar -

        -!! end - -!! test -IPv6 urls (bug 21261) -!! options -disabled -!! input -http://[2404:130:0:1000::187:2]/index.php -!! result -

        http://[2404:130:0:1000::187:2]/index.php -

        -!! end - -!! test -Non-extlinks in brackets -!! input -[foo] -[foo bar] -[foo ''bar''] -[fool's] errand -[fool's errand] -[{{echo|foo}}] -[{{echo|foo}} bar] -[{{echo|foo}} ''bar''] -[{{echo|foo}}l's] errand -[{{echo|foo}}l's errand] -[url={{echo|foo}}] -[url=http://example.com] -!! result -

        [foo] -[foo bar] -[foo bar] -[fool's] errand -[fool's errand] -[foo] -[foo bar] -[foo bar] -[fool's] errand -[fool's errand] -[url=foo] -[url=http://example.com] -

        -!! end - -!! test -Parsoid: Percent encoding in external links -!! options -parsoid -!! input -[https://github.com/search?l=&q=ResourceLoader+%40wikimedia Search] -!! result -

        Search

        -!! end - -!! test -Parsoid: use url link syntax for links where the content is equal the link -target -!! options -parsoid -!! input -http://example.com -!! result -

        http://example.com

        -!! end - -### -### Quotes -### - -!! test -Quotes -!! input -Normal text. '''Bold text.''' Normal text. ''Italic text.'' - -Normal text. '''''Bold italic text.''''' Normal text. -!!result -

        Normal text. Bold text. Normal text. Italic text. -

        Normal text. Bold italic text. Normal text. -

        -!! end - - -!! test -Unclosed and unmatched quotes (php) -!! options -php -!! input -'''''Bold italic text '''with bold deactivated''' in between.''''' - -'''''Bold italic text ''with italic deactivated'' in between.''''' - -'''Bold text.. - -..spanning two paragraphs (should not work).''' - -'''Bold tag left open - -''Italic tag left open - -Normal text. - - -'''This year''''s election ''should'' beat '''last year''''s. - -''Tom'''s car is bigger than ''Susan'''s. - -Plain ''italic'''s plain -!! result -

        Bold italic text with bold deactivated in between. -

        Bold italic text with italic deactivated in between. -

        Bold text.. -

        ..spanning two paragraphs (should not work). -

        Bold tag left open -

        Italic tag left open -

        Normal text. -

        This year's election should beat last year's. -

        Toms car is bigger than Susans. -

        Plain italic's plain -

        -!! end -# Parsoid inserts an empty bold tag pair at the end of the line, that the PHP -# parser strips. The wikitext contains just the first half of the bold -# quote pair. -!! test -Unclosed and unmatched quotes (parsoid) -!! options -parsoid -!! input -'''''Bold italic text '''with bold deactivated''' in between.''''' - -'''''Bold italic text ''with italic deactivated'' in between.''''' - -'''Bold text.. - -..spanning two paragraphs (should not work).''' - -'''Bold tag left open - -''Italic tag left open - -Normal text. - - -'''This year''''s election ''should'' beat '''last year''''s. - -''Tom'''s car is bigger than ''Susan'''s. - -Plain ''italic'''s plain -!! result -

        Bold italic text with bold deactivated in between. -

        Bold italic text with italic deactivated in between. -

        Bold text.. -

        ..spanning two paragraphs (should not work). -

        Bold tag left open -

        Italic tag left open -

        Normal text. -

        This year's election should beat last year's. -

        Toms car is bigger than Susans. -

        Plain italic's plain -

        -!! end - -### -### Tables -### -### some content taken from http://meta.wikimedia.org/wiki/MediaWiki_User%27s_Guide:_Using_tables -### - -# This should not produce
        as
        -# is the bare minimum required by the spec, see: -# http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html#a_module_Basic_Tables -!! test -A table with no data. (php) -!! options -php -!! input -{||} -!! result -!! end -# Parsoid team replies: empty table tags are legal in HTML5 -!! test -A table with no data. (parsoid) -!! options -parsoid -!! input -{||} -!! result -
        -!! end - -# A table with nothing but a caption is invalid XHTML, we might want to render -# this as

        caption

        -!! test -A table with nothing but a caption (php) -!! options -php -!! input -{| -|+ caption -|} -!! result - -
        caption -
        - -!! end -# Parsoid team replies: table with only a caption is legal in HTML5 -!! test -A table with nothing but a caption (parsoid) -!! options -parsoid -!! input -{| -|+ caption -|} -!! result -
        caption
        -!! end - -!! test -A table with caption with default-spaced attributes and a table row -!! input -{| -|+ style="color: red;" | caption1 -|- -| foo -|} -!! result - - - -
        caption1 -
        foo -
        - -!! end - -!! test -A table with captions with non-default spaced attributes and a table row -!! input -{| -|+style="color: red;"|caption2 -|+ style="color: red;"| caption3 -|- -| foo -|} -!! result - - - - -
        caption2 - caption3 -
        foo -
        - -!! end - -!! test -Table td-cell syntax variations -!! input -{| -| foo bar foo | baz -| foo bar foo || baz -| style='color:red;' | baz -| style='color:red;' || baz -|} -!! result - - - - - - - -
        baz - foo bar foo baz - baz - style='color:red;' baz -
        - -!! end - -!! test -Simple table -!! input -{| -| 1 || 2 -|- -| 3 || 4 -|} -!! result - - - - - - -
        1 2 -
        3 4 -
        - -!! end - -!! test -Simple table but with multiple dashes for row wikitext -!! input -{| -| foo -|----- -| bar -|} -!! result - - - - -
        foo -
        bar -
        - -!! end -!! test -Multiplication table -!! input -{| border="1" cellpadding="2" -|+Multiplication table -|- -! × !! 1 !! 2 !! 3 -|- -! 1 -| 1 || 2 || 3 -|- -! 2 -| 2 || 4 || 6 -|- -! 3 -| 3 || 6 || 9 -|- -! 4 -| 4 || 8 || 12 -|- -! 5 -| 5 || 10 || 15 -|} -!! result - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        Multiplication table -
        × 1 2 3 -
        1 - 1 2 3 -
        2 - 2 4 6 -
        3 - 3 6 9 -
        4 - 4 8 12 -
        5 - 5 10 15 -
        - -!! end - -!! test -Accept "||" in table headings -!! input -{| -!h1 || h2 -|} -!! result - - - -
        h1 h2 -
        - -!! end - -!! test -Accept "||" in indented table headings -!! input -:{| -!h1 || h2 -|} -!! result -
        - - -
        h1 h2 -
        - -!! end - -!! test -Accept empty attributes in td/th cells (td/th cells starting with leading ||) -!! input -{| -!| h1 -|| a -|} -!! result - - - -
        h1 - a -
        - -!! end - -!!test -Accept "| !" at start of line in tables (ignore !-attribute) -!!input -{| -|- -| !style="color:red" | bar -|} -!!result - - - -
        bar -
        - -!!end - -!!test -Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between "|" and +/- -!!input -{| -|- -|style='color:red;'|+1 -|style='color:blue;'|-1 -|- -| 1 || 2 || 3 -| 1 ||+2 ||-3 -|- -| +1 -| -1 -|} -!!result - - - - - - - - - - - - - - -
        +1 --1 -
        1 2 3 - 1 +2 -3 -
        +1 - -1 -
        - -!!end - -!! test -Table rowspan -!! input -{| border=1 -| Cell 1, row 1 -|rowspan=2| Cell 2, row 1 (and 2) -| Cell 3, row 1 -|- -| Cell 1, row 2 -| Cell 3, row 2 -|} -!! result - - - - - - - -
        Cell 1, row 1 - Cell 2, row 1 (and 2) - Cell 3, row 1 -
        Cell 1, row 2 - Cell 3, row 2 -
        - -!! end - -!! test -Nested table -!! input -{| border=1 -| α -| -{| bgcolor=#ABCDEF border=2 -|nested -|- -|table -|} -|the original table again -|} -!! result - - - - -
        α - - - - - -
        nested -
        table -
        -
        the original table again -
        - -!! end - -!! test -Invalid attributes in table cell (bug 1830) -!! input -{| -|Cell:|broken -|} -!! result - - -
        broken -
        - -!! end - - -!! test -Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html) -!! input -{| -| |[ftp://|x||]" onmouseover="alert(document.cookie)">test -!! result - - - - - -
        [ftp://%7Cx]" onmouseover="alert(document.cookie)">test -
        - -!! end - - -!! test -Indented table markup mixed with indented pre content (proposed in bug 6200) -!! input - - - - -
        - Text that should be rendered preformatted -
        -!! result - - - - -
        -
        Text that should be rendered preformatted
        -
        -
        - -!! end - -!! test -Template-generated table cell attributes and cell content -!! input -{| -|{{table_attribs}} -| {{table_attribs}} -|} -!! result - - - -
        Foo - Foo -
        - -!! end - -!! test -Template-generated table cell attributes and cell content (2) -!! input -{| -|align=center {{table_attribs}} -|} -!! result - - -
        Foo -
        - -!! end - -!! test -Template-generated table cell attributes and cell content (3) -!! input -{| -|align=center {{table_cells}} -|} -!! result - - - - -
        Foo Bar Baz -
        - -!! end - -!! test -Table with row followed by newlines and table heading -!! input -{| -|- - -! foo -|} -!! result - - - - -
        foo -
        - -!! end - -!! test -Table with empty line following the start tag -!! input -{| - -|- -| foo -|} -!! result - - - - -
        foo -
        - -!! end - -# FIXME: Preserve the attribute properly (with an empty string as value) in -# the PHP parser. Parsoid implements the behavior below. -!! test -Table attributes with empty value -!! options -parsoid -!! input -{| -| style=| hello -|} -!! result - - - -
        hello -
        - -!! end - -!! test -Wikitext table with a lot of comments -!! input -{| - -| foo - -|- - -| - -|} -!! result - - - - -
        foo -
        -
        - -!! end - -!! test -Wikitext table with double-line table cell -!! input -{| -|a -b -|} -!! result - - -
        a -

        b -

        -
        - -!! end - -!! test -Table cell with a single comment -!! input -{| -| -| a -|} -!! result - - - -
        - a -
        - -!! end - -# The expected HTML structure in this test is debatable. The PHP parser does -# not parse this kind of table at all. The main focus for Parsoid is on -# round-tripping, so this output is ok for now. TODO: revisit! -!! test -Wikitext table with html-syntax row (Parsoid) -!! options -parsoid -!! input -{| -|- -foo -|} -!! result - - - -
        foo
        -!! end - -!! test -Implicit after a |- -(PHP parser relies on Tidy to add the missing tags) -!! options -parsoid=wt2html,wt2wt -!! input -{| -|- -a -|} -!! result - - -
        a
        -!! end - -!! test -Pres should be recognized in an explicit context, but not in an implicit context -(PHP parser relies on Tidy to add the missing tags) -!! options -parsoid=wt2html,wt2wt -!! input -{| -|- -| - a -|- - b -|} -!! result - - - - - -
        a
        b
        -!! end - -!! test -Lists should be recognized in an implicit context -(PHP parser relies on Tidy to add the missing tags) -!! options -parsoid=wt2html,wt2wt -!! input -{| -|- -*a -|} -!! result - - - - -
          -
        • a
        • -
        -!! end - -!! test -Parsoid: Round-trip tables directly followed by content (bug 51219) -!! options -parsoid=wt2html,wt2wt -!! input -{| -|foo -|} bar - -{| -|baz -|}quux -!! result - - -
        foo
        bar - - - -
        baz
        quux -!! end - -!! test -Parsoid: Default to a newline after tables in new content (bug 51219) -!! options -parsoid=html2wt -!! input -{| -|foo -|} - bar -{| -|baz -|} -'''quux''' -!! result - -
        foo
        bar - -
        baz
        quux -!! end - -### -### Internal links -### -!! test -Plain link, capitalized -!! input -[[Main Page]] -!! result -

        Main Page -

        -!! end - -!! test -Plain link, uncapitalized -!! input -[[main Page]] -!! result -

        main Page -

        -!! end - -!! test -Piped link -!! input -[[Main Page|The Main Page]] -!! result -

        The Main Page -

        -!! end - -!! test -Piped link with comment in link text -!! input -[[Main Page|The Main Page]] -!! result -

        The Main Page -

        -!! end - -!! test -Broken link -!! input -[[Zigzagzogzagzig]] -!! result -

        Zigzagzogzagzig -

        -!! end - -!! test -Broken link with fragment -!! input -[[Zigzagzogzagzig#zug]] -!! result -

        Zigzagzogzagzig#zug -

        -!! end - -!! test -Special page link with fragment -!! input -[[Special:Version#anchor]] -!! result -

        Special:Version#anchor -

        -!! end - -!! test -Nonexistent special page link with fragment -!! input -[[Special:ThisNameWillHopefullyNeverBeUsed#anchor]] -!! result -

        Special:ThisNameWillHopefullyNeverBeUsed#anchor -

        -!! end - -!! test -Link with prefix -!! input -xxx[[main Page]], xxx[[Main Page]], Xxx[[main Page]] XXX[[main Page]], XXX[[Main Page]] -!! result -

        xxxmain Page, xxxMain Page, Xxxmain Page XXXmain Page, XXXMain Page -

        -!! end - -!! test -Link with suffix -!! input -[[Main Page]]xxx, [[Main Page]]XXX, [[Main Page]]!!! -!! result -

        Main Pagexxx, Main PageXXX, Main Page!!! -

        -!! end - -!! article -prefixed article -!! text -Some text -!! endarticle - -!! test -Bug 43661: Piped links with identical prefixes -!! input -[[prefixed article|prefixed articles with spaces]] - -[[prefixed article|prefixed articlesaoeu]] - -[[Main Page|Main Page test]] -!! result -

        prefixed articles with spaces -

        prefixed articlesaoeu -

        Main Page test -

        -!! end - - -!! test -Link with HTML entity in suffix / tail -!! input -[[Main Page]]", [[Main Page]]a -!! result -

        Main Page", Main Pagea -

        -!! end - -!! test -Link with 3 brackets -!! input -[[[main page]]] -!! result -

        [[[main page]]] -

        -!! end - -!! test -Piped link with 3 brackets -!! input -[[[main page|the main page]]] -!! result -

        [[[main page|the main page]]] -

        -!! end - -!! test -Link with multiple pipes -!! input -[[Main Page|The|Main|Page]] -!! result -

        The|Main|Page -

        -!! end - -!! test -Link to namespaces -!! input -[[Talk:Parser testing]], [[Meta:Disclaimers]] -!! result -

        Talk:Parser testing, Meta:Disclaimers -

        -!! end - -!! article -MemoryAlpha:AlphaTest -!! text -This is an article in the MemoryAlpha namespace -(which shadows the memoryalpha interwiki link). -!! endarticle - -!! test -Namespace takes precedence over interwiki link (bug 51680) -!! input -[[MemoryAlpha:AlphaTest]] -!! result -

        MemoryAlpha:AlphaTest -

        -!! end - -!! test -Piped link to namespace -!! input -[[Meta:Disclaimers|The disclaimers]] -!! result -

        The disclaimers -

        -!! end - -!! test -Link containing } -!! input -[[Usually caused by a typo (oops}]] -!! result -

        [[Usually caused by a typo (oops}]] -

        -!! end - -!! test -Link containing % (not as a hex sequence) -!! input -[[7% Solution]] -!! result -

        7% Solution -

        -!! end - -!! test -Link containing % as a single hex sequence interpreted to char -!! input -[[7%25 Solution]] -!! result -

        7% Solution -

        -!!end - -!! test -Link containing % as a double hex sequence interpreted to hex sequence -!! input -[[7%2525 Solution]] -!! result -

        [[7%2525 Solution]] -

        -!!end - -!! test -Link containing "#<" and "#>" % as a hex sequences- these are valid section anchors -Example for such a section: == < == -!! input -[[%23%3c]][[%23%3e]] -!! result -

        #<#> -

        -!! end - -!! test -Link containing "<#" and ">#" as a hex sequences -!! input -[[%3c%23]][[%3e%23]] -!! result -

        [[%3c%23]][[%3e%23]] -

        -!! end - -!! test -Link containing an equals sign -!! input -[[Special:BookSources/isbn=4-00-026157-6]] -!! result -

        Special:BookSources/isbn=4-00-026157-6 -

        -!! end - -!! article -Foo~bar -!! text -Just a test of an article title containing a tilde. -!! endarticle - -# note that links containing signatures, like [[Foo~~~~]], are -# massaged by the pre-save transform (PST) and so the tildes are never -# seen by the parser. -!! test -Link containing a tilde -!! input -[[Foo~bar]] -!! result -

        Foo~bar -

        -!! end - -!! test -Link containing double-single-quotes '' (bug 4598) -!! input -[[Lista d''e paise d''o munno]] -!! result -

        Lista d''e paise d''o munno -

        -!! end - -!! test -Link containing double-single-quotes '' in text (bug 4598 sanity check) -!! input -Some [[Link|pretty ''italics'' and stuff]]! -!! result -

        Some pretty italics and stuff! -

        -!! end - -!! test -Link containing double-single-quotes '' in text embedded in italics (bug 4598 sanity check) -!! input -''Some [[Link|pretty ''italics'' and stuff]]! -!! result -

        Some pretty italics and stuff! -

        -!! end - -!! test -Link with double quotes in title part (literal) and alternate part (interpreted) -!! input -[[File:Denys Savchenko ''Pentecoste''.jpg]] - -[[''Pentecoste'']] - -[[''Pentecoste''|Pentecoste]] - -[[''Pentecoste''|''Pentecoste'']] -!! result -

        File:Denys Savchenko Pentecoste.jpg -

        ''Pentecoste'' -

        Pentecoste -

        Pentecoste -

        -!! end - -!! test -Broken image links with HTML captions (bug 39700) -!! input -[[File:Nonexistent|]] -[[File:Nonexistent|100px|]] -[[File:Nonexistent|<]] -[[File:Nonexistent|abc]] -!! result -

        <script></script> -<script></script> -< -abc -

        -!! end - -!! test -Plain link to URL -!! input -[[http://www.example.com]] -!! result -

        [[1]] -

        -!! end - -!! test -Plain link to URL with link text -!! input -[[http://www.example.com Link text]] -!! result -

        [Link text] -

        -!! end - -!! test -Plain link to protocol-relative URL -!! input -[[//www.example.com]] -!! result -

        [[1]] -

        -!! end - -!! test -Plain link to protocol-relative URL with link text -!! input -[[//www.example.com Link text]] -!! result -

        [Link text] -

        -!! end - -!! test -Plain link to page with question mark in title -!! input -[[A?b]] - -[[A?b|Baz]] -!! result -

        A?b -

        Baz -

        -!! end - - -# I'm fairly sure the expected result here is wrong. -# We want these to be URL links, not pseudo-pages with URLs for titles.... -# However the current output is also pretty screwy. -# -# ---- -# I'm changing it to match the current output--it arguably makes more -# sense in the light of the test above. Old expected result was: -#

        Piped link to URL: an example URL -#

        -# But I think this test is bordering on "garbage in, garbage out" anyway. -# -- wtm -!! test -Piped link to URL -!! input -Piped link to URL: [[http://www.example.com|an example URL]] -!! result -

        Piped link to URL: [example URL] -

        -!! end - -!! test -BUG 2: [[page|http://url/]] should link to page, not http://url/ -!! input -[[Main Page|http://url/]] -!! result -

        http://url/ -

        -!! end - -!! test -BUG 337: Escaped self-links should be bold -!! options -title=[[Bug462]] -!! input -[[Bug462]] [[Bug462]] -!! result -

        Bug462 Bug462 -

        -!! end - -!! test -Self-link to section should not be bold -!! options -title=[[Main Page]] -!! input -[[Main Page#section]] -!! result -

        Main Page#section -

        -!! end - -!! article -00 -!! text -This is 00. -!! endarticle - -!!test -Self-link to numeric title -!!options -title=[[0]] -!!input -[[0]] -!!result -

        0 -

        -!!end - -!!test -Link to numeric-equivalent title -!!options -title=[[0]] -!!input -[[00]] -!!result -

        00 -

        -!!end - -!! test - inside a link -!! input -[[Main Page]] [[Main Page|the main page [it's not very good]]] -!! result -

        [[Main Page]] the main page [it's not very good] -

        -!! end - -!! test -Non-breaking spaces in title -!! input -[[  Main   Page  ]] -!! result -

          Main   Page   -

        -!!end - -!! test -Internal link with ca linktrail, surrounded by bold apostrophes (bug 27473 primary issue) -!! options -language=ca -!! input -'''[[Main Page]]''' -!! result -

        Main Page -

        -!! end - -!! test -Internal link with ca linktrail, surrounded by italic apostrophes (bug 27473 primary issue) -!! options -language=ca -!! input -''[[Main Page]]'' -!! result -

        Main Page -

        -!! end - -!! test -Internal link with en linktrail: no apostrophes (bug 27473) -!! options -language=en -!! input -[[Something]]'nice -!! result -

        Something'nice -

        -!! end - -!! test -Internal link with ca linktrail with apostrophes (bug 27473) -!! options -language=ca -!! input -[[Something]]'nice -!! result -

        Something'nice -

        -!! end - -!! test -Internal link with kaa linktrail with apostrophes (bug 27473) -!! options -language=kaa -!! input -[[Something]]'nice -!! result -

        Something'nice -

        -!! end - -!! article -Söfnuður -!! text -Test. -!! endarticle - -!! test -Internal link with is link prefix -!! options -language=is -!! input -Aðrir mótmælenda[[söfnuður|söfnuðir]] og -!! result -

        Aðrir mótmælendasöfnuðir og -

        -!! end - -!! article -Mótmælendatrú -!! text -Test. -!! endarticle - -!! test -Internal link with is link trail and link prefix -!! options -language=is -!! input -[[mótmælendatrú|xxx]]ar -[[mótmælendatrú]]ar -mótmælenda[[söfnuður]] -mótmælenda[[söfnuður|söfnuðir]] -mótmælenda[[söfnuður|söfnuðir]]xxx -!! result -

        xxxar -mótmælendatrúar -mótmælendasöfnuður -mótmælendasöfnuðir -mótmælendasöfnuðirxxx -

        -!! end - -!! test -Parsoid link trail escaping -!! options -parsoid=html2wt,html2html -!! input -[[apple]]s -!! result -

        apples

        -!! end - -!! test -Parsoid link prefix escaping -!! options -language=is -parsoid=html2wt,html2html -!! input -Aðrir mótmælenda[[söfnuður]] -!! result -

        Aðrir mótmælendasöfnuður

        -!! end - -!! test -Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved -!! input -[[Foo| bar]] - -[[Foo| ''bar'']] - -[http://wp.org foo] - -[http://wp.org ''foo''] -!! result -

        bar -

        bar -

        foo -

        foo -

        -!! end - -### -### Interwiki links (see maintenance/interwiki.sql) -### - -!! test -Inline interwiki link -!! input -[[MeatBall:SoftSecurity]] -!! result -

        MeatBall:SoftSecurity -

        -!! end - -!! test -Inline interwiki link with empty title (bug 2372) -!! input -[[MeatBall:]] -!! result -

        MeatBall: -

        -!! end - -!! test -Interwiki link encoding conversion (bug 1636) -!! input -*[[Wikipedia:ro:Olteniţa]] -*[[Wikipedia:ro:Olteniţa]] -!! result - - -!! end - -!! test -Interwiki link with fragment (bug 2130) -!! input -[[MeatBall:SoftSecurity#foo]] -!! result -

        MeatBall:SoftSecurity#foo -

        -!! end - - -### -### Interlanguage links -### Language links (so that searching for '### language' matches..) -### - -!! test -Interlanguage link -!! input -Blah blah blah -[[zh:Chinese]] -!!result -

        Blah blah blah -

        -!! end - -!! test -Double interlanguage link -!! input -Blah blah blah -[[es:Spanish]] -[[zh:Chinese]] -!!result -

        Blah blah blah -

        -!! end - -!! test -Interlanguage link, with prefix links -!! options -language=ln -!! input -Blah blah blah -[[zh:Chinese]] -!!result -

        Blah blah blah -

        -!! end - -!! test -Double interlanguage link, with prefix links (bug 8897) -!! options -language=ln -!! input -Blah blah blah -[[es:Spanish]] -[[zh:Chinese]] -!!result -

        Blah blah blah -

        -!! end - -!! test -Parsoid-specific test: Wikilinks with   should RT properly -!! options -language=ln -!! input -[[WW II]] -!!result -

        WW II -

        -!! end - -!! test -Parsoid bug 53221: Wikilinks should be properly entity-escaped -!! options -parsoid=html2wt -!! input -He&nbsp;llo [[Foo|He&nbsp;llo]] - -He&nbsp;llo [[He&nbsp;llo]] -!!result -

        He&nbsp;llo He&nbsp;llo

        -

        He&nbsp;llo He&nbsp;llo

        -!! end - -!! test -Parsoid: handle constructor well -!! options -parsoid -!! input -[[constructor]] - -[[constructor:foo]] -!! result -

        constructor

        - - -

        constructor:foo

        -!! end - -!! test -Parsoid: recognize interlanguage links without a target page -!! options -parsoid -!! input -[[ko:]] -!! result -

        -

        -!! end - -!! test -Parsoid: recognize interwiki links without a target page -!! options -parsoid -!! input -[[:ko:]] -!! result -

        ko:

        -!! end - -### -### Redirects, Parsoid-only -### -!! test -Simple redirect to page -!! options -parsoid -!! input -#REDIRECT [[Main Page]] -!! result - -!! end - -!! test -Optional colon in #REDIRECT -!! options -# the colon is archaic syntax. we support it for wt2html, but we -# don't care that it roundtrips back to the modern syntax. -parsoid=wt2html,html2html -!! input -#REDIRECT:[[Main Page]] -!! result - -!! end - -!! test -Whitespace in #REDIRECT with optional colon -!! options -# the colon and gratuitous whitespace is archaic syntax. we support -# it for wt2html, but we don't care that it roundtrips back to the -# modern syntax (without extra whitespace) -parsoid=wt2html,html2html -!! input - - #REDIRECT -: -[[Main Page]] -!! result - -!! end - -!! test -Piped link in #REDIRECT -!! options -# content after piped link is ignored. we support this syntax, -# but don't care that the piped link is lost when we roundtrip this. -parsoid=wt2html -!! input -#REDIRECT [[Main Page|bar]] -!! result - -!! end - -!! test -Redirect to category -!! options -parsoid=wt2html -!! input -#REDIRECT [[Category:Foo]] -!! result - -!! end - -!! test -Redirect to category with URL encoding -!! options -parsoid=wt2html -!! input -#REDIRECT [[Category%3AFoo]] -!! result - -!! end - -!! test -Redirect to category page -!! options -parsoid=wt2html,html2html -!! input -#REDIRECT [[:Category:Foo]] -!! result -

        Category:Foo

        -!! end - -!! test -Redirect to image page (1) -!! options -parsoid -!! input -#REDIRECT [[File:Wiki.png]] -!! result - -!! end - -!! test -Redirect to image page (2) -!! options -parsoid -!! input -#REDIRECT [[Image:Wiki.png]] -!! result - -!! end - -!! test -Redirect to language -!! options -parsoid -!! input -#REDIRECT [[en:File:Wiki.png]] -!! result - -!! end - -!! test -Redirect to interwiki -!! options -parsoid -!! input -#REDIRECT [[meatball:File:Wiki.png]] -!! result - -!! end - -!! test -Non-English #REDIRECT -!! options -parsoid -language=is -!! input -#TILVÍSUN [[Main Page]] -!! result - -!! end - -## -## XHTML tidiness -### - -!! test -
        to
        -!! input -1
        2
        3 -!! result -

        1
        2
        3 -

        -!! end - -!! test -Broken br tag sanitization -!! options -php -!! input -
        -!! result -

        </br> -

        -!! end - -# TODO: Fix html2html mode (bug 51055)! -!! test -Parsoid: Broken br tag recognition -!! options -parsoid=wt2html -!! input -
        -!! result -


        -!! end - -!! test -Incorrecly removing closing slashes from correctly formed XHTML -!! input -
        -!! result -


        -

        -!! end - -!! test -Failing to transform badly formed HTML into correct XHTML -!! input -
        -
        -
        -!! result -


        -
        -
        -

        -!!end - -!! test -Handling html with a div self-closing tag -!! input -
        -
        -
        -
        -
        -
        -!! result -

        <div title /> -<div title/> -

        -
        -

        <div title=bar /> -<div title=bar/> -

        -
        -
        - -!! end - -!! test -Handling html with a br self-closing tag -!! input -
        -
        -
        -
        -
        -
        -!! result -


        -
        -
        -
        -
        -
        -

        -!! end - -!! test -Horizontal ruler (should it add that extra space?) -!! input -
        -
        -foo
        bar -!! result -
        -
        -foo
        bar - -!! end - -!! test -Horizontal ruler -- 4+ dashes render hr -!! input ----- -!! result -
        - -!! end - -!! test -Horizontal ruler -- eats additional dashes on the same line -!! input ---------- -!! result -
        - -!! end - -!! test -Horizontal ruler -- does not collapse dashes on consecutive lines -!! input ----- ----- -!! result -
        -
        - -!! end - -!! test -Horizontal ruler -- <4 dashes render as plain text -!! input ---- -!! result -

        --- -

        -!! end - -!! test -Horizontal ruler -- Supports content following dashes on same line -!! input ----- Foo -!! result -
        Foo - -!! end - -### -### Block-level elements -### -!! test -Common list -!! input -*Common list -* item 2 -*item 3 -!! result -
          -
        • Common list -
        • -
        • item 2 -
        • -
        • item 3 -
        • -
        - -!! end - -!! test -Numbered list -!! input -#Numbered list -#item 2 -# item 3 -!! result -
          -
        1. Numbered list -
        2. -
        3. item 2 -
        4. -
        5. item 3 -
        6. -
        - -!! end - -!! test -Mixed list -!! input -*Mixed list -*# with numbers -** and bullets -*# and numbers -*bullets again -**bullet level 2 -***bullet level 3 -***#Number on level 4 -**bullet level 2 -**#Number on level 3 -**#Number on level 3 -*#number level 2 -*Level 1 -*** Level 3 -#** Level 3, but ordered -!! result -
          -
        • Mixed list -
            -
          1. with numbers -
          2. -
          -
            -
          • and bullets -
          • -
          -
            -
          1. and numbers -
          2. -
          -
        • -
        • bullets again -
            -
          • bullet level 2 -
              -
            • bullet level 3 -
                -
              1. Number on level 4 -
              2. -
              -
            • -
            -
          • -
          • bullet level 2 -
              -
            1. Number on level 3 -
            2. -
            3. Number on level 3 -
            4. -
            -
          • -
          -
            -
          1. number level 2 -
          2. -
          -
        • -
        • Level 1 -
            -
            • -
            • Level 3 -
            • -
            -
          • -
          -
        • -
        -
          -
          • -
            • -
            • Level 3, but ordered -
            • -
            -
          • -
          -
        1. -
        - -!! end - -!! test -Nested lists 1 -!! input -*foo -**bar -!! result -
          -
        • foo -
            -
          • bar -
          • -
          -
        • -
        - -!! end - -!! test -Nested lists 2 -!! input -**foo -*bar -!! result -
          -
          • -
          • foo -
          • -
          -
        • -
        • bar -
        • -
        - -!! end - -!! test -Nested lists 3 (first element empty) -!! input -* -**bar -!! result -
          -
        • -
            -
          • bar -
          • -
          -
        • -
        - -!! end - -!! test -Nested lists 4 (first element empty) -!! input -** -*bar -!! result -
          -
          • -
          • -
          • -
          -
        • -
        • bar -
        • -
        - -!! end - -!! test -Nested lists 5 (both elements empty) -!! input -** -* -!! result -
          -
          • -
          • -
          • -
          -
        • -
        • -
        • -
        - -!! end - -!! test -Nested lists 6 (both elements empty) -!! input -* -** -!! result -
          -
        • -
            -
          • -
          • -
          -
        • -
        - -!! end - -!! test -Nested lists 7 (skip initial nesting levels) -!! input -*** foo -!! result -
          -
          • -
            • -
            • foo -
            • -
            -
          • -
          -
        • -
        - -!! end - -!! test -Nested lists 8 (multiple nesting transitions) -!! input -* foo -*** bar -** baz -* boo -!! result -
          -
        • foo -
            -
            • -
            • bar -
            • -
            -
          • -
          • baz -
          • -
          -
        • -
        • boo -
        • -
        - -!! end - -!! test -1. Lists with start-of-line-transparent tokens before bullets: Comments -!! input -*foo -*bar -*baz -!! result -
          -
        • foo -
        • -
        • bar -
        • -
        • baz -
        • -
        - -!! end - -!! test -2. Lists with start-of-line-transparent tokens before bullets: Template close -!! input -*foo {{echo|bar -}}*baz -!! result -
          -
        • foo bar -
        • -
        • baz -
        • -
        - -!! end - -!! test -List items are not parsed correctly following a
         block (bug 785)
        -!! input
        -* 
        foo
        -*
        bar
        -* zar -!! result -
          -
        • foo
          -
        • -
        • bar
          -
        • -
        • zar -
        • -
        - -!! end - -!! test -List items from template -!! input - -{{inner list}} -* item 2 - -* item 0 -{{inner list}} -* item 2 - -* item 0 -* notSOL{{inner list}} -* item 2 -!! result -
          -
        • item 1 -
        • -
        • item 2 -
        • -
        -
          -
        • item 0 -
        • -
        • item 1 -
        • -
        • item 2 -
        • -
        -
          -
        • item 0 -
        • -
        • notSOL -
        • -
        • item 1 -
        • -
        • item 2 -
        • -
        - -!! end - -!! test -List interrupted by empty line or heading -!! input -* foo - -** bar -== A heading == -* Another list item -!! result -
          -
        • foo -
        • -
        -
          -
          • -
          • bar -
          • -
          -
        • -
        -

        A heading[edit]

        -
          -
        • Another list item -
        • -
        - -!!end - -!!test -Multiple list tags generated by templates -!!input -{{echo|
      6. }}a -{{echo|
      7. }}b -{{echo|
      8. }}c -!!result -
      9. a -
      10. b -
      11. c
      12. - - - -!!end - -!!test -Single-comment whitespace lines dont break lists, and neither do multi-comment whitespace lines -!!input -*a - -*b - -*c - -*d -!!result -
          -
        • a -
        • -
        • b -
        • -
        • c -
        • -
        • d -
        • -
        - -!!end - -!!test -Replacing whitespace with tabs still doesn't break the list (gerrit 78327) -!!input -*a - -*b - -*c - -*d -!!result -
          -
        • a -
        • -
        • b -
        • -
        • c -
        • -
        • d -
        • -
        - -!!end - -!!test -Test the li-hack -(Cannot test this with PHP parser since it relies on Tidy for the hack) -!!options -parsoid=wt2html,wt2wt -!!input -* foo -*
      13. li-hack -* {{echo|
      14. templated li-hack}} -*
      15. unsupported li-hack with preceding comments - -
          -
        • not a li-hack -
        • -
        -!!result -
          -
        • foo
        • -
        • li-hack
        • -
        • templated li-hack
        • -
        • -
        • li-hack with preceding comments
        • -
        - -
          -
        • -
        • not a li-hack -
        • -
        -!!end - -!! test -Parsoid: Make sure nested lists are serialized on their own line even if HTML contains no newlines -!! options -parsoid -!! input -# foo -## bar -* foo -** bar -: foo -:: bar -!! result -
          -
        1. foo
            -
          1. bar
          2. -
        2. -
          -
        • foo
            -
          • bar
          • -
        • -
        -
        foo
        -
        bar
        -
        -
        -!! end - -!! test -Parsoid: Test of whitespace serialization with Templated bullets -!! options -parsoid -!! input -* {{bullet}} -!! result -
          -
        • Bar
        • -
        -!! end - -# ------------------------------------------------------------------------ -# The next set of tests are about Parsoid's ability to handle badly nested -# tags (parse, minimize scope of fixup, and roundtrip back) -# ------------------------------------------------------------------------ - -!! test -Unbalanced closing block tags break a list -(Parsoid-only since php parser generates broken html -- relies on Tidy to fix up) -!! options -parsoid -!! input -
        -*a
        -*b
        -!! result -
        -
          -
        • a -
        • -
        -
          -
        • b -
        • -
        -!! end - -!! test -Unbalanced closing non-block tags don't break a list -(Parsoid-only since php parser generates broken html -- relies on Tidy to fix up) -!! options -parsoid -!! input - -*a -*b -!! result -

        -

        -
          -
        • a -
        • -
        • b -
        • -
        -!! end - -!! test -Unclosed formatting tags that straddle lists are closed and reopened -(Parsoid-only since php parser generates broken html -- relies on Tidy to fix up) -!! options -parsoid -!! input -# a -# b -!! result -
          -
        1. a -
        2. -
        3. b -
        4. -
        -!! end - -!!test -List embedded in a non-block tag -(Ugly Parsoid output -- worth fixing; Disabled for PHP parser since it relies on Tidy) -!! options -parsoid -!!input - -* foo - -!!result -

        - -
          -
        • foo
        • -
        -
        -

        -!!end - -!! test -Table with missing opening tag -!! options -parsoid=wt2html,wt2wt -!! input - - - -
        foo
        -!! result - - - - -
        foo
        -!! end - -### -### Magic Words -### - -# Note that the current date is hard-coded as -# 1970-01-01T00:02:03Z (a Thursday) -# when running parser tests. The timezone is also fixed to GMT, so -# local date will be identical to current date. - -!! test -Magic Word: {{CURRENTDAY}} -!! input -{{CURRENTDAY}} -!! result -

        1 -

        -!! end - -!! test -Magic Word: {{CURRENTDAY2}} -!! input -{{CURRENTDAY2}} -!! result -

        01 -

        -!! end - -!! test -Magic Word: {{CURRENTDAYNAME}} -!! input -{{CURRENTDAYNAME}} -!! result -

        Thursday -

        -!! end - -!! test -Magic Word: {{CURRENTDOW}} -!! input -{{CURRENTDOW}} -!! result -

        4 -

        -!! end - -!! test -Magic Word: {{CURRENTMONTH}} -!! input -{{CURRENTMONTH}} -!! result -

        01 -

        -!! end - -!! test -Magic Word: {{CURRENTMONTH1}} -!! input -{{CURRENTMONTH1}} -!! result -

        1 -

        -!! end - -!! test -Magic Word: {{CURRENTMONTHABBREV}} -!! input -{{CURRENTMONTHABBREV}} -!! result -

        Jan -

        -!! end - -!! test -Magic Word: {{CURRENTMONTHNAME}} -!! input -{{CURRENTMONTHNAME}} -!! result -

        January -

        -!! end - -!! test -Magic Word: {{CURRENTMONTHNAMEGEN}} -!! input -{{CURRENTMONTHNAMEGEN}} -!! result -

        January -

        -!! end - -!! test -Magic Word: {{CURRENTTIME}} -!! input -{{CURRENTTIME}} -!! result -

        00:02 -

        -!! end - -!! test -Magic Word: {{CURRENTHOUR}} -!! input -{{CURRENTHOUR}} -!! result -

        00 -

        -!! end - -!! test -Magic Word: {{CURRENTWEEK}} (@bug 4594) -!! input -{{CURRENTWEEK}} -!! result -

        1 -

        -!! end - -!! test -Magic Word: {{CURRENTYEAR}} -!! input -{{CURRENTYEAR}} -!! result -

        1970 -

        -!! end - -!! test -Magic Word: {{CURRENTTIMESTAMP}} -!! input -{{CURRENTTIMESTAMP}} -!! result -

        19700101000203 -

        -!! end - -!! test -Magic Words LOCAL (UTC) -!! input -* {{LOCALMONTH}} -* {{LOCALMONTH1}} -* {{LOCALMONTHNAME}} -* {{LOCALMONTHNAMEGEN}} -* {{LOCALMONTHABBREV}} -* {{LOCALDAY}} -* {{LOCALDAY2}} -* {{LOCALDAYNAME}} -* {{LOCALYEAR}} -* {{LOCALTIME}} -* {{LOCALHOUR}} -* {{LOCALWEEK}} -* {{LOCALDOW}} -* {{LOCALTIMESTAMP}} -!! result -
          -
        • 01 -
        • -
        • 1 -
        • -
        • January -
        • -
        • January -
        • -
        • Jan -
        • -
        • 1 -
        • -
        • 01 -
        • -
        • Thursday -
        • -
        • 1970 -
        • -
        • 00:02 -
        • -
        • 00 -
        • -
        • 1 -
        • -
        • 4 -
        • -
        • 19700101000203 -
        • -
        - -!! end - -!! test -Magic Word: {{FULLPAGENAME}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{FULLPAGENAME}} -!! result -

        User:Ævar Arnfjörð Bjarmason -

        -!! end - -!! test -Magic Word: {{FULLPAGENAMEE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{FULLPAGENAMEE}} -!! result -

        User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason -

        -!! end - -!! test -Magic Word: {{TALKSPACE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{TALKSPACE}} -!! result -

        User talk -

        -!! end - -!! test -Magic Word: {{TALKSPACE}}, same namespace -!! options -title=[[User talk:Ævar Arnfjörð Bjarmason]] -!! input -{{TALKSPACE}} -!! result -

        User talk -

        -!! end - -!! test -Magic Word: {{TALKSPACE}}, main namespace -!! options -title=[[Parser Test]] -!! input -{{TALKSPACE}} -!! result -

        Talk -

        -!! end - -!! test -Magic Word: {{TALKSPACEE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{TALKSPACEE}} -!! result -

        User_talk -

        -!! end - -!! test -Magic Word: {{SUBJECTSPACE}} -!! options -title=[[User talk:Ævar Arnfjörð Bjarmason]] -!! input -{{SUBJECTSPACE}} -!! result -

        User -

        -!! end - -!! test -Magic Word: {{SUBJECTSPACE}}, same namespace -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{SUBJECTSPACE}} -!! result -

        User -

        -!! end - -!! test -Magic Word: {{SUBJECTSPACE}}, main namespace -!! options -title=[[Parser Test]] -!! input -{{SUBJECTSPACE}} -!! result - -!! end - -!! test -Magic Word: {{SUBJECTSPACEE}} -!! options -title=[[User talk:Ævar Arnfjörð Bjarmason]] -!! input -{{SUBJECTSPACEE}} -!! result -

        User -

        -!! end - -!! test -Magic Word: {{NAMESPACE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{NAMESPACE}} -!! result -

        User -

        -!! end - -!! test -Magic Word: {{NAMESPACEE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{NAMESPACEE}} -!! result -

        User -

        -!! end - -!! test -Magic Word: {{NAMESPACENUMBER}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{NAMESPACENUMBER}} -!! result -

        2 -

        -!! end - -!! test -Magic Word: {{SUBPAGENAME}} -!! options -title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage -!! input -{{SUBPAGENAME}} -!! result -

        sub ö -

        -!! end - -!! test -Magic Word: {{SUBPAGENAMEE}} -!! options -title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage -!! input -{{SUBPAGENAMEE}} -!! result -

        sub_%C3%B6 -

        -!! end - -!! test -Magic Word: {{ROOTPAGENAME}} -!! options -title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage -!! input -{{ROOTPAGENAME}} -!! result -

        Ævar Arnfjörð Bjarmason -

        -!! end - -!! test -Magic Word: {{ROOTPAGENAMEE}} -!! options -title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage -!! input -{{ROOTPAGENAMEE}} -!! result -

        %C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason -

        -!! end - -!! test -Magic Word: {{BASEPAGENAME}} -!! options -title=[[Ævar Arnfjörð Bjarmason/sub]] subpage -!! input -{{BASEPAGENAME}} -!! result -

        Ævar Arnfjörð Bjarmason -

        -!! end - -!! test -Magic Word: {{BASEPAGENAMEE}} -!! options -title=[[Ævar Arnfjörð Bjarmason/sub]] subpage -!! input -{{BASEPAGENAMEE}} -!! result -

        %C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason -

        -!! end - -!! test -Magic Word: {{TALKPAGENAME}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{TALKPAGENAME}} -!! result -

        User talk:Ævar Arnfjörð Bjarmason -

        -!! end - -!! test -Magic Word: {{TALKPAGENAMEE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{TALKPAGENAMEE}} -!! result -

        User_talk:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason -

        -!! end - -!! test -Magic Word: {{SUBJECTPAGENAME}} -!! options -title=[[User talk:Ævar Arnfjörð Bjarmason]] -!! input -{{SUBJECTPAGENAME}} -!! result -

        User:Ævar Arnfjörð Bjarmason -

        -!! end - -!! test -Magic Word: {{SUBJECTPAGENAMEE}} -!! options -title=[[User talk:Ævar Arnfjörð Bjarmason]] -!! input -{{SUBJECTPAGENAMEE}} -!! result -

        User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason -

        -!! end - -!! test -Magic Word: {{NUMBEROFFILES}} -!! input -{{NUMBEROFFILES}} -!! result -

        4 -

        -!! end - -!! test -Magic Word: {{PAGENAME}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{PAGENAME}} -!! result -

        Ævar Arnfjörð Bjarmason -

        -!! end - -!! test -Magic Word: {{PAGENAME}} with metacharacters -!! options -title=[['foo & bar = baz']] -!! input -''{{PAGENAME}}'' -!! result -

        'foo & bar = baz' -

        -!! end - -!! test -Magic Word: {{PAGENAME}} with metacharacters (bug 26781) -!! options -title=[[*RFC 1234 http://example.com/]] -!! input -{{PAGENAME}} -!! result -

        *RFC 1234 http://example.com/ -

        -!! end - -!! test -Magic Word: {{PAGENAMEE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] -!! input -{{PAGENAMEE}} -!! result -

        %C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason -

        -!! end - -!! test -Magic Word: {{PAGENAMEE}} with metacharacters (bug 26781) -!! options -title=[[*RFC 1234 http://example.com/]] -!! input -{{PAGENAMEE}} -!! result -

        *RFC_1234_http://example.com/ -

        -!! end - -!! test -Magic Word: {{REVISIONID}} -!! input -{{REVISIONID}} -!! result -

        1337 -

        -!! end - -!! test -Magic Word: {{SCRIPTPATH}} -!! input -{{SCRIPTPATH}} -!! result -

        / -

        -!! end - -!! test -Magic Word: {{STYLEPATH}} -!! input -{{STYLEPATH}} -!! result -

        /skins -

        -!! end - -!! test -Magic Word: {{SERVER}} -!! input -{{SERVER}} -!! result -

        http://example.org -

        -!! end - -!! test -Magic Word: {{SERVERNAME}} -!! input -{{SERVERNAME}} -!! result -

        example.org -

        -!! end - -!! test -Magic Word: {{SITENAME}} -!! input -{{SITENAME}} -!! result -

        MediaWiki -

        -!! end - -!! test -Case-sensitive magic words, when cased differently, should just be template transclusions -!! input -{{CurrentMonth}} -{{currentday}} -{{cURreNTweEK}} -{{currentHour}} -!! result -

        Template:CurrentMonth -Template:Currentday -Template:CURreNTweEK -Template:CurrentHour -

        -!! end - -!! test -Case-insensitive magic words should still work with weird casing. -!! input -{{sErVeRNaMe}} -{{LCFirst:AOEU}} -{{ucFIRST:aoeu}} -{{SERver}} -!! result -

        example.org -aOEU -Aoeu -http://example.org -

        -!! end - -!! test -Namespace 1 {{ns:1}} -!! input -{{ns:1}} -!! result -

        Talk -

        -!! end - -!! test -Namespace 1 {{ns:01}} -!! input -{{ns:01}} -!! result -

        Talk -

        -!! end - -!! test -Namespace 0 {{ns:0}} (bug 4783) -!! input -{{ns:0}} -!! result - -!! end - -!! test -Namespace 0 {{ns:00}} (bug 4783) -!! input -{{ns:00}} -!! result - -!! end - -!! test -Namespace -1 {{ns:-1}} -!! input -{{ns:-1}} -!! result -

        Special -

        -!! end - -!! test -Namespace User {{ns:User}} -!! input -{{ns:User}} -!! result -

        User -

        -!! end - -!! test -Namespace User talk {{ns:User_talk}} -!! input -{{ns:User_talk}} -!! result -

        User talk -

        -!! end - -!! test -Namespace User talk {{ns:uSeR tAlK}} -!! input -{{ns:uSeR tAlK}} -!! result -

        User talk -

        -!! end - -!! test -Namespace File {{ns:File}} -!! input -{{ns:File}} -!! result -

        File -

        -!! end - -!! test -Namespace File {{ns:Image}} -!! input -{{ns:Image}} -!! result -

        File -

        -!! end - -!! test -Namespace (lang=de) Benutzer {{ns:User}} -!! options -language=de -!! input -{{ns:User}} -!! result -

        Benutzer -

        -!! end - -!! test -Namespace (lang=de) Benutzer Diskussion {{ns:3}} -!! options -language=de -!! input -{{ns:3}} -!! result -

        Benutzer Diskussion -

        -!! end - - -!! test -Urlencode -!! input -{{urlencode:hi world?!}} -{{urlencode:hi world?!|WIKI}} -{{urlencode:hi world?!|PATH}} -{{urlencode:hi world?!|QUERY}} -!! result -

        hi+world%3F%21 -hi_world%3F! -hi%20world%3F%21 -hi+world%3F%21 -

        -!! end - -### -### Magic links -### -!! test -Magic links: internal link to RFC (bug 479) -!! input -[[RFC 123]] -!! result -

        RFC 123 -

        -!! end - -!! test -Magic links: RFC (bug 479) -!! input -RFC 822 -!! result -

        RFC 822 -

        -!! end - -!! test -Magic links: ISBN (bug 1937) -!! input -ISBN 0-306-40615-2 -!! result -

        ISBN 0-306-40615-2 -

        -!! end - -!! test -Magic links: PMID incorrectly converts space to underscore -!! input -PMID 1234 -!! result -

        PMID 1234 -

        -!! end - -### -### Templates -#### - -!! test -Nonexistent template -!! input -{{thistemplatedoesnotexist}} -!! result -

        Template:Thistemplatedoesnotexist -

        -!! end - -!! test -Template with invalid target containing tags -!! input -{{ab|{{echo|foo}}|{{echo|a}}={{echo|b}}|a = b}} -!! result -

        {{ab|foo|a=b|a = b}} -

        -!! end - -!! test -Template with invalid target containing unclosed tag -!! input -{{a|{{echo|foo}}|{{echo|a}}={{echo|b}}|a = b}} -!! result -

        {{a|foo|a=b|a = b}} -

        -!! end - -!! article -Template:test -!! text -This is a test template -!! endarticle - -!! test -Simple template -!! input -{{test}} -!! result -

        This is a test template -

        -!! end - -!! test -Template with explicit namespace -!! input -{{Template:test}} -!! result -

        This is a test template -

        -!! end - - -!! article -Template:paramtest -!! text -This is a test template with parameter {{{param}}} -!! endarticle - -!! test -Template parameter -!! input -{{paramtest|param=foo}} -!! result -

        This is a test template with parameter foo -

        -!! end - -!! article -Template:paramtestnum -!! text -[[{{{1}}}|{{{2}}}]] -!! endarticle - -!! test -Template unnamed parameter -!! input -{{paramtestnum|Main Page|the main page}} -!! result -

        the main page -

        -!! end - -!! article -Template:templatesimple -!! text -(test) -!! endarticle - -!! article -Template:templateredirect -!! text -#redirect [[Template:templatesimple]] -!! endarticle - -!! article -Template:templateasargtestnum -!! text -{{{{{1}}}}} -!! endarticle - -!! article -Template:templateasargtest -!! text -{{template{{{templ}}}}} -!! endarticle - -!! article -Template:templateasargtest2 -!! text -{{{{{templ}}}}} -!! endarticle - -!! test -Template with template name as unnamed argument -!! input -{{templateasargtestnum|templatesimple}} -!! result -

        (test) -

        -!! end - -!! test -Template with template name as argument -!! input -{{templateasargtest|templ=simple}} -!! result -

        (test) -

        -!! end - -!! test -Template with template name as argument (2) -!! input -{{templateasargtest2|templ=templatesimple}} -!! result -

        (test) -

        -!! end - -!! article -Template:templateasargtestdefault -!! text -{{{{{templ|templatesimple}}}}} -!! endarticle - -!! article -Template:templa -!! text -'''templ''' -!! endarticle - -!! test -Template with default value -!! input -{{templateasargtestdefault}} -!! result -

        (test) -

        -!! end - -!! test -Template with default value (value set) -!! input -{{templateasargtestdefault|templ=templa}} -!! result -

        templ -

        -!! end - -!! test -Template redirect -!! input -{{templateredirect}} -!! result -

        (test) -

        -!! end - -!! test -Template with argument in separate line -!! input -{{ templateasargtest | - templ = simple }} -!! result -

        (test) -

        -!! end - -!! test -Template with complex template as argument -!! input -{{paramtest| - param ={{ templateasargtest | - templ = simple }}}} -!! result -

        This is a test template with parameter (test) -

        -!! end - -!! test -Template with thumb image (with link in description) -!! input -{{paramtest| - param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}} -!! result -This is a test template with parameter - -!! end - -!! article -Template:complextemplate -!! text -{{{1}}} {{paramtest| - param ={{{param}}}}} -!! endarticle - -!! test -Template with complex arguments -!! input -{{complextemplate| - param ={{ templateasargtest | - templ = simple }}|[[Template:complextemplate|link]]}} -!! result -

        link This is a test template with parameter (test) -

        -!! end - -!! test -BUG 553: link with two variables in a piped link -!! input -{| -|[[{{{1}}}|{{{2}}}]] -|} -!! result - - -
        [[{{{1}}}|{{{2}}}]] -
        - -!! end - -!! test -Magic variable as template parameter -!! input -{{paramtest|param={{SITENAME}}}} -!! result -

        This is a test template with parameter MediaWiki -

        -!! end - -!! article -Template:linktest -!! text -[[{{{param}}}|link]] -!! endarticle - -!! test -Template parameter as link source -!! input -{{linktest|param=Main Page}} -!! result -

        link -

        -!! end - -!!test -Template-generated attribute string (k='v') -!!input -bar -!!result -

        bar -

        -!!end - -!!article -Template:paramtest2 -!! text -including another template, {{paramtest|param={{{arg}}}}} -!! endarticle - -!! test -Template passing argument to another template -!! input -{{paramtest2|arg='hmm'}} -!! result -

        including another template, This is a test template with parameter 'hmm' -

        -!! end - -!! article -Template:Linktest2 -!! text -Main Page -!! endarticle - -!! test -Template as link source -!! input -[[{{linktest2}}]] - -[[{{linktest2}}|Main Page]] - -[[{{linktest2}}]]Page -!! result -

        Main Page -

        Main Page -

        Main PagePage -

        -!! end - - -!! article -Template:loop1 -!! text -{{loop2}} -!! endarticle - -!! article -Template:loop2 -!! text -{{loop1}} -!! endarticle - -!! test -Template infinite loop -!! input -{{loop1}} -!! result -

        Template loop detected: Template:Loop1 -

        -!! end - -!! test -Template from main namespace -!! input -{{:Main Page}} -!! result -

        blah blah -

        -!! end - -!! article -Template:table -!! text -{| -| 1 || 2 -|- -| 3 || 4 -|} -!! endarticle - -!! test -BUG 529: Template with table, not included at beginning of line -!! input -foo {{table}} -!! result -

        foo -

        - - - - - - -
        1 2 -
        3 4 -
        - -!! end - -!! test -BUG 523: Template shouldn't eat newline (or add an extra one before table) -!! input -foo -{{table}} -!! result -

        foo -

        - - - - - - -
        1 2 -
        3 4 -
        - -!! end - -!! test -BUG 41: Template parameters shown as broken links -!! input -{{{parameter}}} -!! result -

        {{{parameter}}} -

        -!! end - -!! test -Template with targets containing wikilinks -!! input -{{[[foo]]}} - -{{[[{{echo|foo}}]]}} - -{{{{echo|[[foo}}]]}} -!! result -

        {{foo}} -

        {{foo}} -

        {{[[foo}}]] -

        -!! end - -!! article -Template:MSGNW test -!! text -''None'' of '''this''' should be -* interpreted - but rather passed unmodified -{{test}} -!! endarticle - -# hmm, fix this or just deprecate msgnw and document its behavior? -!! test -msgnw keyword -!! options -disabled -!! input -{{msgnw:MSGNW test}} -!! result -

        ''None'' of '''this''' should be -* interpreted - but rather passed unmodified -{{test}} -

        -!! end - -!! test -int keyword -!! input -{{int:youhavenewmessages|lots of money|not!}} -!! result -

        You have lots of money (not!). -

        -!! end - -!! article -Template:Includes -!! text -Foozarbar -!! endarticle - -!! test - and being included -!! input -{{Includes}} -!! result -

        Foobar -

        -!! end - -!! article -Template:Includes2 -!! text -Foobar -!! endarticle - -!! test - being included -!! input -{{Includes2}} -!! result -

        Foo -

        -!! end - - -!! article -Template:Includes3 -!! text -Foobarzar -!! endarticle - -!! test - and being included -!! input -{{Includes3}} -!! result -

        Foo -

        -!! end - -!! test - and on a page -!! input -Foozarbar -!! result -

        Foozar -

        -!! end - -!! test -Un-closed -!! input - -!! result -!! end - -!! test - on a page -!! input -Foobar -!! result -

        Foobar -

        -!! end - -!! test -Un-closed -!! input - -!! result -!! end - -!!test -Self-closed noinclude, includeonly, onlyinclude tags -!!input - - - -!!result -


        -

        -!!end - -!!test -Unbalanced includeonly and noinclude tags -!!input -{| -|a
        -|b
        -|c
        -|d
        -|} -!!result - - - - - -
        a -b -c</includeonly> -d</includeonly></includeonly> -
        - -!!end - -!! article -Template:Includeonly section -!! text - -==Includeonly section== - -==Section T-1== -!!endarticle - -!! test -Bug 6563: Edit link generation for section shown by -!! input -{{includeonly section}} -!! result -

        Includeonly section[edit]

        -

        Section T-1[edit]

        - -!! end - -# Uses same input as the contents of [[Template:Includeonly section]] -!! test -Bug 6563: Section extraction for section shown by -!! options -section=T-2 -!! input - -==Includeonly section== - -==Section T-2== -!! result -==Section T-2== -!! end - -!! test -Bug 6563: Edit link generation for section suppressed by -!! input - -==Includeonly section== - -==Section 1== -!! result -

        Section 1[edit]

        - -!! end - -!! test -Bug 6563: Section extraction for section suppressed by -!! options -section=1 -!! input - -==Includeonly section== - -==Section 1== -!! result -==Section 1== -!! end - -!! test -Un-closed -!! input - -!! result -!! end - -# TODO: test with DOM fragment reuse! -!! test -Parsoid: DOM fragment reuse -!! options -parsoid=wt2wt,wt2html -!! input -a{{echo|b
        c}}d - -a{{echo|b -
        -c}}d - -{{echo|a - -
        - -b}} -!! result -ab -
        cd - - -

        ab

        - -
        - -

        cd

        - - -

        a

        - - -
        - - -

        b

        -!! end - -!! test -Parsoid: Merge double tds (bug 50603) -!! options -parsoid -!! input -{| -|{{echo|{{!}} foo}} -|} -!! result - - -
        foo
        -!! end - -!! test -Parsoid: Merge double tds in nested transclusion content (bug 50603) -!! options -parsoid -!! input -{{echo|
        }} -{| -|{{echo|{{!}} foo}} -|} -{{echo|
        }} -!! result -
        - - -
        foo
        -
        -!! end - -### -### and in attributes -### -!!test -0. includeonly around the entire attribute -!!input -id="v1"id="v2">bar -!!result -

        bar -

        -!!end - -!!test -1. includeonly in html attr key -!!input -idabout="foo">bar -!!result -

        bar -

        -!!end - -!!test -2. includeonly in html attr value -!!input -bar -"v1""v2">bar -!!result -

        bar -bar -

        -!!end - -!!test -3. includeonly in part of an attr value -!!input -bar -!!result -

        bar -

        -!!end - -### -### Testing parsing of templates where a template arg -### has the same name as the template itself. -### - -!! article -Template:quote -!! text -{{{quote|{{{1}}}}}} -!! endarticle - -!!test -Templates: Template Name/Arg clash: 1. Use of positional param -!!input -{{quote|foo}} -!!result -

        foo -

        -!!end - -!!test -Templates: Template Name/Arg clash: 2. Use of named param -!!input -{{quote|quote=foo}} -!!result -

        foo -

        -!!end - -!!test -Templates: Template Name/Arg clash: 3. Use of named param with empty input -!!input -{{quote|quote}} -!!result -

        quote -

        -!!end - -### -### Parsoid-centric tests to stress Parsoid's ability to RT them unchanged -### - -!!test -Templates: 1. Simple use -!!input -{{echo|Foo}} -!!result -

        Foo -

        -!!end - -!!test -Templates: 2. Inside a block tag -!!input -
        {{echo|Foo}}
        -
        {{echo|Foo}}
        -!!result -
        Foo
        -
        Foo
        - -!!end - -!!test -Templates: P-wrapping: 1a. Templates on consecutive lines -!!input -{{echo|Foo}} -{{echo|bar}} -!!result -

        Foo -bar -

        -!!end - -!!test -Templates: P-wrapping: 1b. Templates on consecutive lines -!!input -Foo - -{{echo|bar}} -{{echo|baz}} -!!result -

        Foo -

        bar -baz -

        -!!end - -!!test -Templates: P-wrapping: 1c. Templates on consecutive lines -!!input -{{echo|Foo}} -{{echo|bar}}
        baz
        -!!result -

        Foo -

        -bar
        baz
        - -!!end - -!!test -Templates: P-wrapping: 1d. Template preceded by comment-only line -!!options -parsoid -!!input - -{{echo|Bar}} -!!result - - -

        Bar

        -!!end - -!!test -Templates: Inline Text: 1. Multiple tmeplate uses -!!input -{{echo|Foo}}bar{{echo|baz}} -!!result -

        Foobarbaz -

        -!!end - -!!test -Templates: Inline Text: 2. Back-to-back template uses -!!input -{{echo|Foo}}{{echo|bar}} -!!result -

        Foobar -

        -!!end - -!!test -Templates: Block Tags: 1. Multiple template uses -!!input -{{echo|
        Foo
        }}
        bar
        {{echo|
        baz
        }} -!!result -
        Foo
        bar
        baz
        - -!!end - -!!test -Templates: Block Tags: 2. Back-to-back template uses -!!input -{{echo|
        Foo
        }}{{echo|
        bar
        }} -!!result -
        Foo
        bar
        - -!!end - -!!test -Templates: Links: 1. Simple example -!!input -{{echo|[[Foo|bar]]}} -!!result -

        bar -

        -!!end - -!!test -Templates: Links: 2. Generation of link href -!!input -[[{{echo|Foo}}|bar]] -!!result -

        bar -

        -!!end - -!!test -Templates: Links: 3. Generation of part of a link href -!!input -[[Fo{{echo|o}}|bar]] - -[[Foo{{echo|bar}}]] - -[[Foo{{echo|bar}}baz]] - -[[Foo{{echo|bar}}|bar]] - -[[:Foo{{echo|bar}}]] - -[[:Foo{{echo|bar}}|bar]] -!!result -

        bar -

        Foobar -

        Foobarbaz -

        bar -

        Foobar -

        bar -

        -!!end - -!!test -Templates: Links: 4. Multiple templates generating link href -!!input -[[{{echo|F}}{{echo|o}}ob{{echo|ar}}]] -!!result -

        Foobar -

        -!!end - -!!test -Templates: Links: 5. Generation of link text -!!input -[[Foo|{{echo|bar}}]] -!!result -

        bar -

        -!!end - -!!test -Templates: Links: 5. Nested templates (only outermost template should be marked) -!!input -{{echo|[[{{echo|Foo}}|bar]]}} -!!result -

        bar -

        -!!end - -!!test -Templates: HTML Tag: 1. Generation of HTML attr. key -!!input -
        foo
        -!!result -
        foo
        - -!!end - -!!test -Templates: HTML Tag: 2. Generation of HTML attr. value -!!input -
        foo
        -!!result -
        foo
        - -!!end - -!!test -Templates: HTML Tag: 3. Generation of HTML attr key and value -!!input -
        foo
        -!!result -
        foo
        - -!!end - -!!test -Templates: HTML Tag: 4. Generation of starting piece of HTML attr value -!!input -
        foo
        -!!result -
        foo
        - -!!end - -!!test -Templates: HTML Tag: 5. Generation of middle piece of HTML attr value -!!input -
        foo
        -!!result -
        foo
        - -!!end - -!!test -Templates: HTML Tag: 6. Generation of end piece of HTML attr value -!!input -
        foo
        -!!result -
        foo
        - -!!end - -!!test -Templates: HTML Tag: 7. Generation of partial attribute key string -!!input -
        foo
        -!!result -
        foo
        - -!!end - -!!test -Templates: HTML Tables: 1. Generating start of a HTML table -!!input -{{echo|}}
        foo
        -!!result -
        foo
        - -!!end - -!!test -Templates: HTML Tables: 2a. Generating middle of a HTML table -!!input -{{echo|}}
        foo
        -!!result -
        foo
        - -!!end - -!!test -Templates: HTML Tables: 2b. Generating middle of a HTML table -!!input -{{echo|}}
        foo
        -!!result -
        foo
        - -!!end - -!!test -Templates: HTML Tables: 3. Generating end of a HTML table -!!input -{{echo|
        foo
        }} -!!result -
        foo
        - -!!end - -!!test -Templates: HTML Tables: 4a. Generating a single tag of a HTML table -!!input -{{echo|}}
        foo
        -!!result -
        foo
        - -!!end - -!!test -Templates: HTML Tables: 4b. Generating a single tag of a HTML table -!!input -{{echo|}}
        foo
        -!!result -
        foo
        - -!!end - -!!test -Templates: HTML Tables: 4c. Generating a single tag of a HTML table -!!input -{{echo|
        }}foo
        -!!result -
        foo
        - -!!end - -!!test -Templates: HTML Tables: 4d. Generating a single tag of a HTML table -!!input -}}
        foo{{echo|
        -!!result -
        foo
        - -!!end - -!!test -Templates: HTML Tables: 4e. Generating a single tag of a HTML table -!!input -{{echo|}}
        foo
        -!!result -
        foo
        - -!!end - -!!test -Templates: HTML Tables: 4f. Generating a single tag of a HTML table -!!input -{{echo|
        foo
        }} -!!result -
        foo
        - -!!end - -!!test -Templates: HTML Tables: 5. Proper fostering of categories from inside -!!options -parsoid=wt2html,wt2wt -!!input -[[Category:foo1]]
        foo
        - -[[Category:bar1]][[Category:bar2]]
        foo
        -!!result -
        foo
        - -
        foo
        -!!end - -!!test -Templates: Wiki Tables: 1a. Fostering of entire template content -!!input -{| -{{echo|a}} -|} -!!result - -a -
        - -!!end - -!!test -Templates: Wiki Tables: 1b. Fostering of entire template content -!!input -{| -{{echo|
        }} -foo -{{echo|
        }} -|} -!!result - -
        -

        foo -

        -
        -
        - -!!end - -!!test -Templates: Wiki Tables: 2. Fostering of partial template content -!!input -{| -{{echo|a -
        b
        }} -|} -!!result - -a -
        b
        -
        - -!!end - -!!test -Templates: Wiki Tables: 3. td-content via multiple templates -!!input -{| -{{echo|{{pipe}}a}}{{echo|b}} -|} -!!result - - -
        ab -
        - -!!end - -!!test -Templates: Wiki Tables: 4. Templated tags, no content -!!input -{{tbl-start}} -{{tbl-end}} -!!result - -
        - -!!end - -!!test -Templates: Wiki Tables: 5. Templated tags, regular td-tags -!!input -{{tbl-start}} -|foo -{{tbl-end}} -!!result - - -
        foo -
        - -!!end - -!!test -Templates: Wiki Tables: 6. Templated tags, templated td-tags -!!input -{{tbl-start}} -{{!}}foo -{{tbl-end}} -!!result - - -
        foo -
        - -!!end - -!!test -Templates: Lists: Multi-line list-items via templates -!!input -*{{echo|a {{nonexistent| -unused}}}} -*{{echo|b {{nonexistent| -unused}}}} -!!result - - -!!end - -!!test -Templates: Ugly nesting: 1. Quotes opened/closed across templates (echo) -!!input -{{echo|''a}}{{echo|b''c''d}}{{echo|''e}} -!!result -

        abcde -

        -!!end - -!!test -Templates: Ugly nesting: 2. Quotes opened/closed across templates (echo_with_span) -(PHP parser generates misnested html) -!! options -parsoid -!!input -{{echo_with_span|''a}}{{echo_with_span|b''c''d}}{{echo_with_span|''e}} -!!result -

        abcde

        -!!end - -!!test -Templates: Ugly nesting: 3. Quotes opened/closed across templates (echo_with_div) -(PHP parser generates misnested html; Parsoid html2wt mode adds newlines between {{echo}}s) -!! options -parsoid=wt2html,wt2wt -!!input -{{echo_with_div|''a}}{{echo_with_div|b''c''d}}{{echo_with_div|''e}} -!!result -
        a
        -
        bcd
        -
        e
        -!!end - -!!test -Templates: Ugly nesting: 4. Divs opened/closed across templates -!!input -a
        b{{echo|c
        d}}e -!!result -a
        bc
        de - -!!end - -!!test -Templates: Ugly templates: 1. Navbox template parses badly leading to table misnesting -(Parsoid-centric) -!! options -parsoid -!!input -{| -|{{echo|foo}} -|bar -|} -!!result - - - - -
        foo
        -bar - -!!end - -!!test -Templates: Ugly templates: 2. Navbox template parses badly leading to table misnesting -(Parsoid-centric) -!! options -parsoid -!!input - - - - -
        - - -
        1. {{echo|foo
        }}
        bar 2. {{echo|baz
        }} - - - abc - - - - - - xyz - - -!!result - - - - -
        - - -
        1. foo
        bar 2. baz
        - - - abc - - - - - - xyz - - -!!end - -!! test -Templates: Ugly templates: 3. newline-only template parameter -!! input -foo {{echo| -}} -!! result -

        foo -

        -!! end - -# This looks like a bug: a single newline triggers p/br for some reason. -!! test -Templates: Ugly templates: 4. newline-only template parameter inconsistency -!! input -{{echo| -}} -!! result -


        -

        -!! end - - -!!test -Parser Functions: 1. Simple example -!!input -{{uc:foo}} -!!result -

        FOO -

        -!!end - -!!test -Parser Functions: 2. Nested use (only outermost should be marked up) -!!input -{{uc:{{lc:FOO}}}} -!!result -

        FOO -

        -!!end - -### -### Pre-save transform tests -### -!! test -pre-save transform: subst: -!! options -PST -!! input -{{subst:test}} -!! result -This is a test template -!! end - -!! test -pre-save transform: normal template -!! options -PST -!! input -{{test}} -!! result -{{test}} -!! end - -!! test -pre-save transform: nonexistent template -!! options -PST -!! input -{{thistemplatedoesnotexist}} -!! result -{{thistemplatedoesnotexist}} -!! end - - -!! test -pre-save transform: subst magic variables -!! options -PST -!! input -{{subst:SITENAME}} -!! result -MediaWiki -!! end - -# This is bug 89, which I fixed. -- wtm -!! test -pre-save transform: subst: templates with parameters -!! options -pst -!! input -{{subst:paramtest|param="something else"}} -!! result -This is a test template with parameter "something else" -!! end - -!! article -Template:nowikitest -!! text -'''not wiki''' -!! endarticle - -!! test -pre-save transform: nowiki in subst (bug 1188) -!! options -pst -!! input -{{subst:nowikitest}} -!! result -'''not wiki''' -!! end - - -!! article -Template:commenttest -!! text -This template has in it. -!! endarticle - -!! test -pre-save transform: comment in subst (bug 1936) -!! options -pst -!! input -{{subst:commenttest}} -!! result -This template has in it. -!! end - -!! test -pre-save transform: unclosed tag -!! options -pst noxml -!! input -'''not wiki''' -!! result -'''not wiki''' -!! end - -!! test -pre-save transform: mixed tag case -!! options -pst noxml -!! input -'''not wiki''' -!! result -'''not wiki''' -!! end - -!! test -pre-save transform: unclosed comment in -!! options -pst noxml -!! input -wikinowiki -!!result - -!!end - -!! test -pre-save transform: comment containing extension -!! options -pst -!! input - -!!result - -!!end - -!! test -pre-save transform: comment containing nowiki -!! options -pst -!! input - -!!result - -!!end - -!! test -pre-save transform: in subst (bug 3298) -!! options -pst -!! input -{{subst:Includes}} -!! result -Foobar -!! end - -!! test -pre-save transform: in subst (bug 3298) -!! options -pst -!! input -{{subst:Includes2}} -!! result -Foo -!! end - -!! article -Template:SubstTest -!!text -{{subst:Includes}} -!! endarticle - -!! article -Template:SafeSubstTest -!! text -{{safesubst:Includes}} -!! endarticle - -!! test -bug 22297: safesubst: works during PST -!! options -pst -!! input -{{subst:SafeSubstTest}}{{safesubst:SubstTest}} -!! result -FoobarFoobar -!! end - -!! test -bug 22297: safesubst: works during normal parse -!! input -{{SafeSubstTest}} -!! result -

        Foobar -

        -!! end - -!! test: -subst: does not work during normal parse -!! input -{{SubstTest}} -!! result -

        {{subst:Includes}} -

        -!! end - -!! test -pre-save transform: context links ("pipe trick") -!! options -pst -!! input -[[Article (context)|]] -[[Bar:Article|]] -[[:Bar:Article|]] -[[Bar:Article (context)|]] -[[:Bar:Article (context)|]] -[[|Article]] -[[|Article (context)]] -[[Bar:X (Y) Z|]] -[[:Bar:X (Y) Z|]] -!! result -[[Article (context)|Article]] -[[Bar:Article|Article]] -[[:Bar:Article|Article]] -[[Bar:Article (context)|Article]] -[[:Bar:Article (context)|Article]] -[[Article]] -[[Article (context)]] -[[Bar:X (Y) Z|X (Y) Z]] -[[:Bar:X (Y) Z|X (Y) Z]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with interwiki prefix -!! options -pst -!! input -[[interwiki:Article|]] -[[:interwiki:Article|]] -[[interwiki:Bar:Article|]] -[[:interwiki:Bar:Article|]] -!! result -[[interwiki:Article|Article]] -[[:interwiki:Article|Article]] -[[interwiki:Bar:Article|Bar:Article]] -[[:interwiki:Bar:Article|Bar:Article]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with parens in title -!! options -pst title=[[Somearticle (context)]] -!! input -[[|Article]] -!! result -[[Article (context)|Article]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with comma in title -!! options -pst title=[[Someplace, Somewhere]] -!! input -[[|Otherplace]] -[[Otherplace, Elsewhere|]] -[[Otherplace, Elsewhere, Anywhere|]] -!! result -[[Otherplace, Somewhere|Otherplace]] -[[Otherplace, Elsewhere|Otherplace]] -[[Otherplace, Elsewhere, Anywhere|Otherplace]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with parens and comma -!! options -pst title=[[Someplace (IGNORED), Somewhere]] -!! input -[[|Otherplace]] -[[Otherplace (place), Elsewhere|]] -!! result -[[Otherplace, Somewhere|Otherplace]] -[[Otherplace (place), Elsewhere|Otherplace]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with comma and parens -!! options -pst title=[[Who, me? (context)]] -!! input -[[|Yes, you.]] -[[Me, Myself, and I (1937 song)|]] -!! result -[[Yes, you. (context)|Yes, you.]] -[[Me, Myself, and I (1937 song)|Me, Myself, and I]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with namespace -!! options -pst title=[[Ns:Somearticle]] -!! input -[[|Article]] -!! result -[[Ns:Article|Article]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with namespace and parens -!! options -pst title=[[Ns:Somearticle (context)]] -!! input -[[|Article]] -!! result -[[Ns:Article (context)|Article]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with namespace and comma -!! options -pst title=[[Ns:Somearticle, Context, Whatever]] -!! input -[[|Article]] -!! result -[[Ns:Article, Context, Whatever|Article]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with namespace, comma and parens -!! options -pst title=[[Ns:Somearticle, Context (context)]] -!! input -[[|Article]] -!! result -[[Ns:Article (context)|Article]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with namespace, parens and comma -!! options -pst title=[[Ns:Somearticle (IGNORED), Context]] -!! input -[[|Article]] -!! result -[[Ns:Article, Context|Article]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with full-width parens and no space (Japanese and Chinese style, bug 30149) -!! options -pst -!! input -[[Article(context)|]] -[[Bar:Article(context)|]] -[[:Bar:Article(context)|]] -[[|Article(context)]] -[[Bar:X(Y)Z|]] -[[:Bar:X(Y)Z|]] -!! result -[[Article(context)|Article]] -[[Bar:Article(context)|Article]] -[[:Bar:Article(context)|Article]] -[[Article(context)]] -[[Bar:X(Y)Z|X(Y)Z]] -[[:Bar:X(Y)Z|X(Y)Z]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with full-width parens and space (Japanese and Chinese style, bug 30149) -!! options -pst -!! input -[[Article (context)|]] -[[Bar:Article (context)|]] -[[:Bar:Article (context)|]] -[[|Article (context)]] -[[Bar:X (Y) Z|]] -[[:Bar:X (Y) Z|]] -!! result -[[Article (context)|Article]] -[[Bar:Article (context)|Article]] -[[:Bar:Article (context)|Article]] -[[Article (context)]] -[[Bar:X (Y) Z|X (Y) Z]] -[[:Bar:X (Y) Z|X (Y) Z]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with parens and no space (Korean style, bug 30149) -!! options -pst -!! input -[[Article(context)|]] -[[Bar:Article(context)|]] -[[:Bar:Article(context)|]] -[[|Article(context)]] -[[Bar:X(Y)Z|]] -[[:Bar:X(Y)Z|]] -!! result -[[Article(context)|Article]] -[[Bar:Article(context)|Article]] -[[:Bar:Article(context)|Article]] -[[Article(context)]] -[[Bar:X(Y)Z|X(Y)Z]] -[[:Bar:X(Y)Z|X(Y)Z]] -!! end - -!! test -pre-save transform: context links ("pipe trick") with commas (bug 21660) -!! options -pst -!! input -[[Article (context), context|]] -[[Article (context),context|]] -[[Bar:Article (context), context|]] -[[Bar:Article (context),context|]] -[[:Bar:Article (context), context|]] -[[:Bar:Article (context),context|]] -!! result -[[Article (context), context|Article]] -[[Article (context),context|Article]] -[[Bar:Article (context), context|Article]] -[[Bar:Article (context),context|Article]] -[[:Bar:Article (context), context|Article]] -[[:Bar:Article (context),context|Article]] -!! end - -!! test -pre-save transform: trim trailing empty lines -!! options -pst -!! input -Empty lines are trimmed - - - - -!! result -Empty lines are trimmed -!! end - -!! test -pre-save transform: Signature expansion -!! options -pst -!! input -* ~~~ -* ~~~ -* ~~~ -* ~~~ -!! result -* [[Special:Contributions/127.0.0.1|127.0.0.1]] -* [[Special:Contributions/127.0.0.1|127.0.0.1]] -* [[Special:Contributions/127.0.0.1|127.0.0.1]] -* [[Special:Contributions/127.0.0.1|127.0.0.1]] -!! end - - -!! test -pre-save transform: Signature expansion in nowiki tags (bug 93) -!! options -pst disabled -!! input -Shall not expand: - -~~~~ - -~~~~ - -~~~~ - -~~~~ - -{{subst:Foo}} shall be converted to FOO - -As well as inside noinclude/onlyinclude -{{subst:Foo}} -{{subst:Foo}} - -But not inside includeonly -{{subst:Foo}} -!! result -Shall not expand: - -~~~~ - -~~~~ - -~~~~ - -~~~~ - -FOO shall be converted to FOO - -As well as inside noinclude/onlyinclude -FOO -FOO - -But not inside includeonly -{{subst:Foo}} -!! end - -!! test -Parsoid: Recognize nowiki with trailing space in tags -!! options -parsoid=wt2html -!! input -
        [[foo]] - -ab - -cd - -ef -!! result -

        <div>[[foo]]

        -

        ab

        -

        cd

        -

        ef

        -!! end - -!! test -Parsoid: Recognize nowiki with odd capitalization -!! options -parsoid=wt2html -!! input -
        [[foo]] -!! result -

        <div>[[foo]]

        -!! end - - -!! test -Parsoid: Escape nowiki with trailing space in tags -!! options -parsoid=html2wt -!! input -<nowiki > foo </nowiki > - -a<nowiki />b - -c<nowiki/ >d -!! result -

        <nowiki > foo </nowiki >

        -

        a<nowiki />b

        -

        c<nowiki/ >d

        -!! end - -!! test -Parsoid: Escape weird noWikI capitalizations -!! options -parsoid=html2wt -!! input -<noWikI > foo </NoWikI > -!! result -

        <noWikI > foo </NoWikI >

        -!! end - -### -### Message transform tests -### -!! test -message transform: magic variables -!! options -msg -!! input -{{SITENAME}} -!! result -MediaWiki -!! end - -!! test -message transform: should not transform wiki markup -!! options -msg -!! input -''test'' -!! result -''test'' -!! end - -!! test -message transform: in transcluded template (bug 4926) -!! options -msg -!! input -{{Includes}} -!! result -Foobar -!! end - -!! test -message transform: in transcluded template (bug 4926) -!! options -msg -!! input -{{Includes2}} -!! result -Foo -!! end - -!! test -{{#special:}} page name, known -!! options -msg -!! input -{{#special:Recentchanges}} -!! result -Special:RecentChanges -!! end - -!! test -{{#special:}} page name with subpage, known -!! options -msg -!! input -{{#special:Recentchanges/param}} -!! result -Special:RecentChanges/param -!! end - -!! test -{{#special:}} page name, unknown -!! options -msg -!! input -{{#special:foobar nonexistent}} -!! result -Special:Foobar nonexistent -!! end - -!! test -{{#speciale:}} page name, known -!! options -msg -!! input -{{#speciale:Recentchanges}} -!! result -Special:RecentChanges -!! end - -!! test -{{#speciale:}} page name with subpage, known -!! options -msg -!! input -{{#speciale:Recentchanges/param}} -!! result -Special:RecentChanges/param -!! end - -!! test -{{#speciale:}} page name, unknown -!! options -msg -!! input -{{#speciale:foobar nonexistent}} -!! result -Special:Foobar_nonexistent -!! end - -### -### Images -### -### For Parsoid-specific tests, see -#### http://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Images - -!! test -Simple image (php) -!! options -php -!! input -[[Image:foobar.jpg]] -!! result -

        Foobar.jpg -

        -!! end - -!! test -Simple image (parsoid) -!! options -parsoid=wt2html -!! input -[[Image:foobar.jpg]] -!! result -

        -

        -!! end - -!! test -Simple image (using File: namespace, now canonical) (php) -!! options -php -!! input -[[File:foobar.jpg]] -!! result -

        Foobar.jpg -

        -!! end - -!! test -Simple image (using File: namespace, now canonical) (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg]] -!! result -

        -

        -!! end - -!! test -Right-aligned image (php) -!! options -php -!! input -[[Image:foobar.jpg|right]] -!! result -
        Foobar.jpg
        - -!! end - -!! test -Right-aligned image (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|right]] -!! result -
        -!! end - -!! test -Image with caption (php) -!! options -php -!! input -[[File:Foobar.jpg|right|Caption text]] -!! result -
        Caption text
        - -!! end - -!! test -Image with caption (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|right|Caption text]] -!! result -
        Caption text
        -!! end - -!! test -Image with empty attribute (php) -!! options -php -!! input -[[File:Foobar.jpg|right||Caption text]] -!! result -
        Caption text
        - -!! end - -!! test -Image with empty attribute (parsoid) -!! options -parsoid=wt2html -!! input -[[File:Foobar.jpg|right||Caption text]] -!! result -
        Caption text
        -!! end - -!! test -Image with attributes from template (php) -!! options -php -!! input -[[File:Foobar.jpg|{{image_attribs}}]] -!! result -
        Caption text
        - -!! end - -!! test -Image with attributes from template (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|{{image_attribs}}]] -!! result -
        Caption text
        -!! end - -!! test -Image with link tails (php) -!! options -php -!! input -123[[File:Foobar.jpg]]456 -123[[File:Foobar.jpg|right]]456 -123[[File:Foobar.jpg|thumb]]456 -!! result -

        123Foobar.jpg456 -

        -123
        Foobar.jpg
        456 -123
        Foobar.jpg
        456 - -!! end - -!! test -Image with link tails (parsoid) -!! options -parsoid -!! input -123[[File:Foobar.jpg]]456 -123[[File:Foobar.jpg|right]]456 -123[[File:Foobar.jpg|thumb]]456 -!! result -

        123456

        -123
        456 -123
        456 -!! end - -!! test -Image with multiple captions -- only last one is accepted (php) -!! options -php -!! input -[[File:Foobar.jpg|right|Caption1 - ignored|[[Caption2]] - ignored|Caption3 - accepted]] -!! result -
        Caption3 - accepted
        - -!! end - -!! test -Image with multiple captions -- only last one is accepted (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|right|Caption1 - ignored|[[Caption2]] - ignored|Caption3 - accepted]] -!! result -
        Caption3 - accepted
        -!! end - -!! test -Image with width attribute at different positions (php) -!! options -php -!! input -[[File:Foobar.jpg|200px|right|Caption]] -[[File:Foobar.jpg|right|200px|Caption]] -[[File:Foobar.jpg|right|Caption|200px]] -!! result -
        Caption
        -
        Caption
        -
        Caption
        - -!! end - -!! test -Image with width attribute at different positions (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|200px|right|Caption]] -[[File:Foobar.jpg|right|200px|Caption]] -[[File:Foobar.jpg|right|Caption|200px]] -!! result -
        Caption
        -
        Caption
        -
        Caption
        -!! end - -!! test -Image with link parameter, wiki target (php) -!! options -php -!! input -[[File:Foobar.jpg|link=Main Page]] -!! result -

        Foobar.jpg -

        -!! end - -!! test -Image with link parameter, wiki target (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|link=Main Page]] -!! result -

        -!! end - -!! test -Image with link parameter, URL target (php) -!! options -php -!! input -[[File:Foobar.jpg|link=http://example.com/]] -!! result -

        Foobar.jpg -

        -!! end - -# parsoid bug 49293 (part 1) -!! test -Image with link parameter, URL target (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|link=http://example.com/]] -!! result -

        -!! end - -!! test -Image with link parameter, protocol-less URL target (php) -!! options -php -!! input -[[File:Foobar.jpg|link=//example.com/]] -!! result -

        Foobar.jpg -

        -!! end - -# parsoid bug 49293 (part 2) -!! test -Image with link parameter, protocol-less URL target (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|link=//example.com/]] -!! result -

        -!! end - -!! test -Image with link parameter, wgExternalLinkTarget -!! input -[[Image:foobar.jpg|link=http://example.com/]] -!! config -wgExternalLinkTarget='foobar' -!! result -

        Foobar.jpg -

        -!! end - -!! test -Image with link parameter, wgNoFollowLinks set to false -!! input -[[Image:foobar.jpg|link=http://example.com/]] -!! config -wgNoFollowLinks=false -!! result -

        Foobar.jpg -

        -!! end - -!! test -Image with link parameter, wgNoFollowDomainExceptions -!! input -[[Image:foobar.jpg|link=http://example.com/]] -!! config -wgNoFollowDomainExceptions='example.com' -!! result -

        Foobar.jpg -

        -!! end - -!! test -Image with link parameter, wgExternalLinkTarget, unnamed parameter -!! input -[[Image:foobar.jpg|link=http://example.com/|Title]] -!! config -wgExternalLinkTarget='foobar' -!! result -

        Title -

        -!! end - -!! test -Image with empty link parameter (php) -!! options -php -!! input -[[File:Foobar.jpg|link=]] -!! result -

        Foobar.jpg -

        -!! end - -!! test -Image with empty link parameter (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|link=]] -!! result -

        -!! end - -!! test -Image with link parameter (wiki target) and unnamed parameter (php) -!! options -php -!! input -[[File:Foobar.jpg|link=Main Page|Title]] -!! result -

        Title -

        -!! end - -!! test -Image with link parameter (wiki target) and unnamed parameter (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|link=Main Page|Title]] -!! result -

        -!! end - -!! test -Image with link parameter (URL target) and unnamed parameter (php) -!! options -php -!! input -[[File:Foobar.jpg|link=http://example.com/|Title]] -!! result -

        Title -

        -!! end - -!! test -Image with link parameter (URL target) and unnamed parameter (parsoid) -!! options -parsoid -!! input -[[File:Foobar.jpg|link=http://example.com/|Title]] -!! result -

        -!! end - -!! test -Thumbnail image with link parameter -!! options -php -!! input -[[Image:foobar.jpg|thumb|link=http://example.com/|Title]] -!! result -
        Title
        - -!! end - -!! test -Manually-specified thumbnail image -!! options -php -!! input -[[Image:Foobar.jpg|thumb=Thumb.png|Title]] -!! result -
        Title
        - -!! end - -!! test -Manually-specified thumbnail image with explicit link to wiki page -!! options -php -!! input -[[Image:Foobar.jpg|thumb=Thumb.png|link=Main Page|Title]] -!! result -
        Title
        - -!! end - -!! test -Manually-specified thumbnail image with explicit link to url -!! options -php -!! input -[[Image:Foobar.jpg|thumb=Thumb.png|link=http://example.com|Title]] -!! result -
        Title
        - -!! end - -!! test -Manually-specified thumbnail image with explicit no link -!! options -php -!! input -[[Image:Foobar.jpg|thumb=Thumb.png|link=|Title]] -!! result -
        Title
        - -!! end - -!! test -Manually-specified thumbnail image with explicit link and alt text -!! options -php -!! input -[[Image:Foobar.jpg|thumb=Thumb.png|link=Main Page|alt=alttext|Title]] -!! result -
        alttext
        Title
        - -!! end - -!! test -Image with frame and link -!! input -[[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]] -!! result -
        This is a test image Main Page
        - -!! end - -!! test -Image with frame and link and explicit alt -!! input -[[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]|alt=Altitude]] -!! result -
        Altitude
        This is a test image Main Page
        - -!! end - -!! test -Image with wiki markup in implicit alt -!! input -[[Image:Foobar.jpg|testing '''bold''' in alt]] -!! result -

        testing bold in alt -

        -!! end - -!! test -Image with wiki markup in explicit alt -!! input -[[Image:Foobar.jpg|alt=testing '''bold''' in alt]] -!! result -

        testing bold in alt -

        -!! end - -!! test -Link to image page- image page normally doesn't exists, hence edit link -Add test with existing image page -#

        Image:test -!! input -[[:Image:test]] -!! result -

        Image:test -

        -!! end - -!! test -bug 18784 Link to non-existent image page with caption should use caption as link text -!! input -[[:Image:test|caption]] -!! result -

        caption -

        -!! end - -!! test -Frameless image caption with a free URL -!! input -[[Image:foobar.jpg|http://example.com]] -!! result -

        http://example.com -

        -!! end - -!! test -Thumbnail image caption with a free URL -!! input -[[Image:foobar.jpg|thumb|http://example.com]] -!! result - - -!! end - -!! test -Thumbnail image caption with a free URL and explicit alt -!! input -[[Image:foobar.jpg|thumb|http://example.com|alt=Alteration]] -!! result - - -!! end - -!! test -SVG thumbnails with no language set -!! options -!! input -[[File:Foobar.svg|thumb|width=200]] -!! result -
        width=200
        - -!! end - -!! test -SVG thumbnails with language de -!! options -!! input -[[File:Foobar.svg|thumb|width=200|lang=de]] -!! result -
        width=200
        - -!! end - -!! test -SVG thumbnails with invalid language code -!! options -!! input -[[File:Foobar.svg|thumb|width=200|lang=invalid.language.code]] -!! result -
        lang=invalid.language.code
        - -!! end - -!! test -BUG 1887: A ISBN with a thumbnail -!! input -[[Image:foobar.jpg|thumb|ISBN 1235467890]] -!! result - - -!! end - -!! test -BUG 1887: A RFC with a thumbnail -!! input -[[Image:foobar.jpg|thumb|This is RFC 12354]] -!! result -
        This is RFC 12354
        - -!! end - -!! test -BUG 1887: A mailto link with a thumbnail -!! input -[[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]] -!! result - - -!! end - -# Pending resolution to bug 368 -!! test -BUG 648: Frameless image caption with a link -!! input -[[Image:foobar.jpg|text with a [[link]] in it]] -!! result -

        text with a link in it -

        -!! end - -!! test -BUG 648: Frameless image caption with a link (suffix) -!! input -[[Image:foobar.jpg|text with a [[link]]foo in it]] -!! result -

        text with a linkfoo in it -

        -!! end - -!! test -BUG 648: Frameless image caption with an interwiki link -!! input -[[Image:foobar.jpg|text with a [[MeatBall:Link]] in it]] -!! result -

        text with a MeatBall:Link in it -

        -!! end - -!! test -BUG 648: Frameless image caption with a piped interwiki link -!! input -[[Image:foobar.jpg|text with a [[MeatBall:Link|link]] in it]] -!! result -

        text with a link in it -

        -!! end - -!! test -Escape HTML special chars in image alt text -!! input -[[Image:foobar.jpg|& < > "]] -!! result -

        & < > " -

        -!! end - -!! test -BUG 499: Alt text should have Ӓ, not &1234; -!! input -[[Image:foobar.jpg|♀]] -!! result -

        ♀ -

        -!! end - -!! test -Broken image caption with link -!! input -[[Image:Foobar.jpg|thumb|This is a broken caption. But [[Main Page|this]] is just an ordinary link. -!! result -

        [[Image:Foobar.jpg|thumb|This is a broken caption. But this is just an ordinary link. -

        -!! end - -!! test -Image caption containing another image -!! input -[[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]] -!! result -
        This is a caption with another image inside it!
        - -!! end - -!! test -Image caption containing a newline -!! input -[[Image:Foobar.jpg|This -*is some text]] -!! result -

        This *is some text -

        -!!end - -!!test -Parsoid: Image caption containing leading space -(The leading space should not trigger nowiki escaping in wt2wt mode) -!! input -[[Image:Foobar.jpg|thumb| bar]] -!! result -
        bar
        - -!!end - -!! test -Bug 3090: External links other than http: in image captions -!! input -[[Image:Foobar.jpg|thumb|200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]] -!! result -
        This caption has irc and Secure ext links in it.
        - -!! end - -!! test -Custom class -!! input -[[Image:foobar.jpg|a|class=b]] -!! result -

        a -

        -!! end - -!! test -Localized image handling (1). -!! options -language=es -!! input -[[Archivo:Foobar.jpg|izquierda|enlace=foo|caption]] -!! result -
        caption
        - -!! end - -!! test -Localized image handling (2). -!! options -language=es -!! input -[[Archivo:Foobar.jpg|miniatura|izquierda|enlace=foo|caption]] -!! result -
        caption
        - -!! end - -!! test -"border", "frameless" and "class" attributes on an image. -!! input -[[File:Foobar.jpg|frameless|border|class=extra|caption]] -!! result -

        caption -

        -!! end - -!! article -File:Barfoo.jpg -!! text -#REDIRECT [[File:Barfoo.jpg]] -!! endarticle - -!! test -Redirected image -!! input -[[Image:Barfoo.jpg]] -!! result -

        File:Barfoo.jpg -

        -!! end - -!! test -Missing image with uploads disabled -!! options -wgEnableUploads=0 -!! input -[[Image:Foobaz.jpg]] -!! result -

        File:Foobaz.jpg -

        -!! end - -# Parsoid-specific testing for images -# http://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Images -# Currently imperfect due to a flaw in the Parsoid testrunner -# Work in progress -# THESE TESTS SHOULD BE MOVED UP and merged with the php-specific -# image tests. - -!! test -Parsoid-specific image handling - simple image with size and middle alignment -!! options -parsoid -!! input -[[Image:Foobar.jpg|50px|middle]] -!! result -

        - - - - - -

        -!! end - -!! test -Parsoid-specific image handling - simple image with both sizes, a baseline alignment, and a caption -!! options -parsoid -!! input -[[Image:Foobar.jpg|500x10px|baseline|caption]] -!! result -

        - - - - - -

        -!! end - -!! test -Parsoid-specific image handling - simple image with border and size spec -!! options -parsoid -!! input -[[Image:Foobar.jpg|50px|border|caption]] -!! result -

        - - - - - -

        -!! end - -!! test -Parsoid-specific image handling - thumbnail with halign, valign, and caption -!! options -parsoid -!! input -[[Image:Foobar.jpg|thumb|left|baseline|caption content]] -!! result -
        - - - -
        caption content
        -
        -!! end - -!! test -Parsoid-specific image handling - thumbnail with specific size, halign, valign, and caption -!! options -parsoid -!! input -[[Image:Foobar.jpg|thumb|50x50px|right|middle|caption]] -!! result -
        - - - -
        caption
        -
        -!! end - -!! test -Parsoid-specific image handling - framed image with specific size and caption -!! options -parsoid -!! input -[[Image:Foobar.jpg|500x50px|frame|caption]] -!! result -
        - - - -
        caption
        -
        -!! end - -!! test -Parsoid-specific image handling - framed image with specific size, halign, valign, and caption -!! options -parsoid -!! input -[[Image:Foobar.jpg|500x50px|frame|left|baseline|caption]] -!! result -
        - - - -
        caption
        -
        -!! end - -!! test -Parsoid-specific image handling - frameless image with specific size, border, and caption -!! options -parsoid -!! input -[[Image:Foobar.jpg|frameless|500x50px|border|caption]] -!! result -

        - - - - -

        -!! end - -#!! test -#Parsoid-specific image handling - simple image with a formatted caption -#!! options -#parsoid -#!! input -#[[Image:Foobar.jpg|
        ab
        c
        ]] -#!! result -#

        -# -# -#Foobar.jpg -# -#abc -# -#

        - - -### -### Subpages -### -!! article -Subpage test/subpage -!! text -foo -!! endarticle - -!! test -Subpage link -!! options -subpage title=[[Subpage test]] -!! input -[[/subpage]] -!! result -

        /subpage -

        -!! end - -!! test -Subpage noslash link -!! options -subpage title=[[Subpage test]] -!!input -[[/subpage/]] -!! result -

        subpage -

        -!! end - -# TODO: make this PHP-parser compatible! -!! test -Relative subpage noslash link -!! options -parsoid=wt2wt,wt2html,html2html -subpage title=[[Subpage test/1/2/3/4]] -!!input -[[../../subpage/]] - -[[../../subpage]] -!! result -

        subpage

        -

        Subpage_test/1/2/subpage

        -!! end - -# TODO: make this PHP-parser compatible! -!! test -Parsoid: dot-slash prefixed wikilinks -!! options -parsoid=wt2wt,wt2html,html2html -!!input -[[./foo]] - -[[././bar]] - -[[././baz/]] -!! result -

        foo

        -

        bar

        -

        baz/

        -!! end - -!! test -Disabled subpages -!! input -[[/subpage]] -!! result -

        /subpage -

        -!! end - -!! test -BUG 561: {{/Subpage}} -!! options -subpage title=[[Page]] -!! input -{{/Subpage}} -!! result -

        Page/Subpage -

        -!! end - -### -### Categories -### -!! article -Category:MediaWiki User's Guide -!! text -blah -!! endarticle - -!! test -Link to category -!! input -[[:Category:MediaWiki User's Guide]] -!! result -

        Category:MediaWiki User's Guide -

        -!! end - -!! test -Simple category -!! options -cat -!! input -[[Category:MediaWiki User's Guide]] -!! result -MediaWiki User's Guide -!! end - -!! test -PAGESINCATEGORY invalid title fatal (r33546 fix) -!! input -{{PAGESINCATEGORY:}} -!! result -

        0 -

        -!! end - -!! test -Category with different sort key -!! options -cat -!! input -[[Category:MediaWiki User's Guide|Foo]] -!! result -MediaWiki User's Guide -!! end - -!! test -Category with identical sort key -!! options -cat -!! input -[[Category:MediaWiki User's Guide|MediaWiki User's Guide]] -!! result -MediaWiki User's Guide -!! end - -!! test -Category with empty sort key -!! options -cat -pst -!! input -[[Category:MediaWiki User's Guide|]] -!! result -[[Category:MediaWiki User's Guide|MediaWiki User's Guide]] -!! end - -!! test -Category with empty sort key and parentheses -!! options -cat -pst -!! input -[[Category:Foo (bar)|]] -!! result -[[Category:Foo (bar)|Foo]] -!! end - -!! test -Category with link tail -!! options -cat -pst -!! input -123[[Category:Foo]]456 -!! result -123[[Category:Foo]]456 -!! end - -!! test -Category with template -!! options -cat -pst -!! input -[[Category:{{echo|Foo}}]] -!! result -[[Category:{{echo|Foo}}]] -!! end - -!! test -Category with template in sort key -!! options -cat -pst -!! input -[[Category:Foo|{{echo|Bar}}]] -!! result -[[Category:Foo|{{echo|Bar}}]] -!! end - -!! test -Category with template in sort key and title -!! options -cat -pst -!! input -[[Category:{{echo|Foo}}|{{echo|Bar}}]] -!! result -[[Category:{{echo|Foo}}|{{echo|Bar}}]] -!! end - -!! test -Category / paragraph interactions -!! input -Foo [[Category:Baz]] Bar - -Foo [[Category:Baz]] -Bar - -Foo -[[Category:Baz]] -Bar - -Foo -[[Category:Baz]] Bar - -Foo -[[Category:Baz]] - [[Category:Baz]] -[[Category:Baz]] -Bar - -[[Category:Baz]] - [[Category:Baz]] -[[Category:Baz]] - -[[Category:Baz]] - {{echo|[[Category:Baz]]}} -[[Category:Baz]] -!! result -

        Foo Bar -

        Foo -Bar -

        Foo -Bar -

        Foo Bar -

        Foo -Bar -

        -!! end - -!! test -Parsoid: Serialize link to category page with colon escape -!! options -parsoid -!! input - -[[:Category:Foo]] -[[:Category:Foo|Bar]] -!! result -

        -Category:Foo -Bar -

        -!! end - -!! test -Parsoid: Link prefix/suffixes aren't applied to category links -!! options -parsoid=wt2html,wt2wt,html2html -language=is -!! input -x[[Category:Foo]]y -!! result -

        xy

        -!! end - -!! test -Parsoid: Serialize link to file page with colon escape -!! options -parsoid -!! input - -[[:File:Foo.png]] -[[:File:Foo.png|Bar]] -!! result -

        -File:Foo.png -Bar -

        -!! end - -!! test -Parsoid: Serialize a genuine category link without colon escape -!! options -parsoid -!! input -[[Category:Foo]] -[[Category:Foo|Bar]] -!! result - - -!! end - -### -### Inter-language links -### -!! test -Inter-language links -!! options -ill -!! input -[[es:Alimento]] -[[fr:Nourriture]] -[[zh:食品]] -!! result -es:Alimento fr:Nourriture zh:食品 -!! end - -!! test -Duplicate interlanguage links (bug 24502) -!! options -ill -!! input -[[es:1]] -[[es:2]] -[[fr:1]] -[[fr:2]] -!! result -es:1 fr:1 -!! end - -### -### Sections -### -!! test -Basic section headings -!! input -== Headline 1 == -Some text - -==Headline 2== -More -===Smaller headline=== -Blah blah -!! result -

        Headline 1[edit]

        -

        Some text -

        -

        Headline 2[edit]

        -

        More -

        -

        Smaller headline[edit]

        -

        Blah blah -

        -!! end - -!! test -Section headings with TOC -!! input -== Headline 1 == -=== Subheadline 1 === -===== Skipping a level ===== -====== Skipping a level ====== - -== Headline 2 == -Some text -===Another headline=== -!! result - - -

        Headline 1[edit]

        -

        Subheadline 1[edit]

        -
        Skipping a level[edit]
        -
        Skipping a level[edit]
        -

        Headline 2[edit]

        -

        Some text -

        -

        Another headline[edit]

        - -!! end - -# perl -e 'print "="x$_," Level $_ heading","="x$_,"\n" for 1..10' -!! test -Handling of sections up to level 6 and beyond -!! input -= Level 1 Heading= -== Level 2 Heading== -=== Level 3 Heading=== -==== Level 4 Heading==== -===== Level 5 Heading===== -====== Level 6 Heading====== -======= Level 7 Heading======= -======== Level 8 Heading======== -========= Level 9 Heading========= -========== Level 10 Heading========== -!! result - - -

        Level 1 Heading[edit]

        -

        Level 2 Heading[edit]

        -

        Level 3 Heading[edit]

        -

        Level 4 Heading[edit]

        -
        Level 5 Heading[edit]
        -
        Level 6 Heading[edit]
        -
        = Level 7 Heading=[edit]
        -
        == Level 8 Heading==[edit]
        -
        === Level 9 Heading===[edit]
        -
        ==== Level 10 Heading====[edit]
        - -!! end - -!! test -TOC regression (bug 9764) -!! input -== title 1 == -=== title 1.1 === -==== title 1.1.1 ==== -=== title 1.2 === -== title 2 == -=== title 2.1 === -!! result - - -

        title 1[edit]

        -

        title 1.1[edit]

        -

        title 1.1.1[edit]

        -

        title 1.2[edit]

        -

        title 2[edit]

        -

        title 2.1[edit]

        - -!! end - -!! test -TOC with wgMaxTocLevel=3 (bug 6204) -!! options -wgMaxTocLevel=3 -!! input -== title 1 == -=== title 1.1 === -==== title 1.1.1 ==== -=== title 1.2 === -== title 2 == -=== title 2.1 === -!! result - - -

        title 1[edit]

        -

        title 1.1[edit]

        -

        title 1.1.1[edit]

        -

        title 1.2[edit]

        -

        title 2[edit]

        -

        title 2.1[edit]

        - -!! end - -!! test -TOC with wgMaxTocLevel=3 and two level four headings (bug 6204) -!! options -wgMaxTocLevel=3 -!! input -==Section 1== -===Section 1.1=== -====Section 1.1.1==== -====Section 1.1.1.1==== -==Section 2== -!! result -

        Contents

        - -
        - -

        Section 1[edit]

        -

        Section 1.1[edit]

        -

        Section 1.1.1[edit]

        -

        Section 1.1.1.1[edit]

        -

        Section 2[edit]

        - -!! end - - -!! test -Resolving duplicate section names -!! input -== Foo bar == -== Foo bar == -!! result -

        Foo bar[edit]

        -

        Foo bar[edit]

        - -!! end - -!! test -Resolving duplicate section names with differing case (bug 10721) -!! input -== Foo bar == -== Foo Bar == -!! result -

        Foo bar[edit]

        -

        Foo Bar[edit]

        - -!! end - -!! article -Template:sections -!! text -===Section 1=== -==Section 2== -!! endarticle - -!! test -Template with sections, __NOTOC__ -!! input -__NOTOC__ -==Section 0== -{{sections}} -==Section 4== -!! result -

        Section 0[edit]

        -

        Section 1[edit]

        -

        Section 2[edit]

        -

        Section 4[edit]

        - -!! end - -!! test -__NOEDITSECTION__ keyword -!! input -__NOEDITSECTION__ -==Section 1== -==Section 2== -!! result -

        Section 1

        -

        Section 2

        - -!! end - -!! test -Link inside a section heading -!! input -==Section with a [[Main Page|link]] in it== -!! result -

        Section with a link in it[edit]

        - -!! end - -!! test -TOC regression (bug 12077) -!! input -__TOC__ -== title 1 == -=== title 1.1 === -== title 2 == -!! result -

        Contents

        - -
        - -

        title 1[edit]

        -

        title 1.1[edit]

        -

        title 2[edit]

        - -!! end - -!! test -BUG 1219 URL next to image (good) -!! input -http://example.com [[Image:foobar.jpg]] -!! result -

        http://example.com Foobar.jpg -

        -!!end - -!! test -Short headings with trailing space should match behavior of Parser::doHeadings (bug 19910) -!! input -=== -The line above must have a trailing space! -=== -But just in case it doesn't... -!! result -

        =[edit]

        -

        The line above must have a trailing space! -

        -

        =[edit]

        -

        But just in case it doesn't... -

        -!! end - -!! test -Header with special characters (bug 25462) -!! input -The tooltips shall not show entities to the user (ie. be double escaped) - -== text > text == -section 1 - -== text < text == -section 2 - -== text & text == -section 3 - -== text ' text == -section 4 - -== text " text == -section 5 -!! result -

        The tooltips shall not show entities to the user (ie. be double escaped) -

        - - -

        text > text[edit]

        -

        section 1 -

        -

        text < text[edit]

        -

        section 2 -

        -

        text & text[edit]

        -

        section 3 -

        -

        text ' text[edit]

        -

        section 4 -

        -

        text " text[edit]

        -

        section 5 -

        -!! end - -!! test -Headers with excess '=' characters -(Are similar tests necessary beyond the 1st level?) -!! input -=foo== -==foo= -=''italic'' heading== -==''italic'' heading= -!! result - - -

        foo=[edit]

        -

        =foo[edit]

        -

        italic heading=[edit]

        -

        =italic heading[edit]

        - -!! end - -!! test -HTML headers vs TOC (bug 23393) -(__NOEDITSECTION__ for clearer output, doesn't matter here) -!! input -

        Header 1

        -== Header 1.1 == -== Header 1.2 == - -

        Header 2 -

        -== Header 2.1 == -== Header 2.2 == -__NOEDITSECTION__ -!! result - - -

        Header 1

        -

        Header 1.1

        -

        Header 1.2

        -

        Header 2

        -

        Header 2.1

        -

        Header 2.2

        - -!! end - -!! test -BUG 1219 URL next to image (broken) -!! input -http://example.com[[Image:foobar.jpg]] -!! result -

        http://example.comFoobar.jpg -

        -!!end - -!! test -Bug 1186 news: in the middle of text -!! input -http://en.wikinews.org/wiki/Wikinews:Workplace -!! result -

        http://en.wikinews.org/wiki/Wikinews:Workplace -

        -!!end - - -!! test -Namespaced link must have a title -!! input -[[Project:]] -!! result -

        [[Project:]] -

        -!!end - -!! test -Namespaced link must have a title (bad fragment version) -!! input -[[Project:#fragment]] -!! result -

        [[Project:#fragment]] -

        -!!end - - -### -### HTML tags and HTML attributes -### - -!! test -div with no attributes -!! input -
        HTML rocks
        -!! result -
        HTML rocks
        - -!! end - -!! test -div with double-quoted attribute -!! input -
        HTML rocks
        -!! result -
        HTML rocks
        - -!! end - -!! test -div with single-quoted attribute -!! input -
        HTML rocks
        -!! result -
        HTML rocks
        - -!! end - -!! test -div with unquoted attribute -!! input -
        HTML rocks
        -!! result -
        HTML rocks
        - -!! end - -!! test -div with illegal double attributes -!! input -
        HTML rocks
        -!! result -
        HTML rocks
        - -!!end - -# FIXME: produce empty string instead of "class" in the PHP parser, following -# the HTML5 spec. -!! test -div with empty attribute value, space before equals -!! options -parsoid -!! input -
        HTML rocks
        -!! result -
        HTML rocks
        - -!! end - -# The PHP parser escapes the opening brace to { for some reason, so -# disabled this test for it. -!! test -div with braces in attribute value -!! options -parsoid -!! input -
        Foo
        -!! result -
        Foo
        -!! end - -# This it very inconsistent in the PHP parser: it returns -# class="class" if there is a space between the name and the equal sign (see -# 'div with empty attribute value, space before equals'), but strips the -# attribute completely if the space is missing. We hope that not much content -# depends on this, so are implementing the behavior below in Parsoid for -# consistencies' sake. Disabled for the PHP parser. -# FIXME: fix this behavior in the PHP parser? -!! test -div with empty attribute value, no space before equals -!! options -parsoid -!! input -
        HTML rocks
        -!! result -
        HTML rocks
        - -!! end - -!! test -HTML multiple attributes correction -!! input -

        Awesome!

        -!! result -

        Awesome!

        - -!!end - -!! test -Table multiple attributes correction -!! input -{| -!+ class="error" class="awesome"| status -|} -!! result - - -
        status -
        - -!!end - -!! test -DIV IN UPPERCASE -!! input -
        HTML ROCKS
        -!! result -
        HTML ROCKS
        - -!!end - -!! test -Non-ASCII pseudo-tags are rendered as text -!! input - -!! result -

        <khyô> -

        -!! end - -!! test -Pseudo-tag with URL 'name' renders as url link -!! input - -!! result -

        <http://example.com/> -

        -!! end - -!! test -text with amp in the middle of nowhere -!! input -Remember AT&T? -!!result -

        Remember AT&T? -

        -!! end - -!! test -text with character entity: eacute -!! input -I always thought é was a cute letter. -!! result -

        I always thought é was a cute letter. -

        -!! end - -!! test -text with entity-escaped character entity-like string: eacute -!! input -I always thought &eacute; was a cute letter. -!! result -

        I always thought &eacute; was a cute letter. -

        -!! end - -!! test -text with undefined character entity: xacute -!! input -I always thought &xacute; was a cute letter. -!! result -

        I always thought &xacute; was a cute letter. -

        -!! end - - -### -### Nesting tests (see bug 41545, 50604, 51081) -### - -# This test case is fixed in Parsoid by domino 1.0.12. (bug 50604) -# Note that html2wt is considerably more difficult if we use in -# the test case, instead of -!! test -Ensure that HTML adoption agency algorithm is properly implemented. -!! input -XYZ -!! result -

        XYZ -

        -!! end - -# This was bug 41545 in the PHP parser. -!! test -Nesting of -!! input -XYZ -!! result -

        XYZ -

        -!! end - -# The following cases were bug 51081 in the PHP parser. -# Note that there are some other nestable tags (b, i, etc) which are -# not covered; see bug 51081 for discussion. -!! test -Nesting of -!! input -XYZ -!! result -

        XYZ -

        -!! end - -!! test -Nesting of -!! input -XYZ -!! result -

        XYZ -

        -!! end - -!! test -Nesting of -!! input -XYZ -!! result -

        XYZ -

        -!! end - -!! test -Nesting of -!! input -XYZ -!! result -

        XYZ -

        -!! end - -!! test -Nesting of -!! input -XYZ -!! result -

        XYZ -

        -!! end - - -### -### Media links -### - -!! test -Media link -!! input -[[Media:Foobar.jpg]] -!! result -

        Media:Foobar.jpg -

        -!! end - -!! test -Media link with text -!! input -[[Media:Foobar.jpg|A neat file to look at]] -!! result -

        A neat file to look at -

        -!! end - -# FIXME: this is still bad HTML tag nesting -!! test -Media link with nasty text -fixme: doBlockLevels won't wrap this in a paragraph because it contains a div -!! input -[[Media:Foobar.jpg|Safe Link
        " onmouseover="alert(document.cookie)" onfoo="
        ]] -!! result -Safe Link<div style="display:none">" onmouseover="alert(document.cookie)" onfoo="</div> - -!! end - -!! test -Media link to nonexistent file (bug 1702) -!! input -[[Media:No such.jpg]] -!! result -

        Media:No such.jpg -

        -!! end - -!! test -Image link to nonexistent file (bug 1850 - good) -!! input -[[Image:No such.jpg]] -!! result -

        File:No such.jpg -

        -!! end - -!! test -:Image link to nonexistent file (bug 1850 - bad) -!! input -[[:Image:No such.jpg]] -!! result -

        Image:No such.jpg -

        -!! end - - - -!! test -Character reference normalization in link text (bug 1938) -!! input -[[Main Page|this&that]] -!! result -

        this&that -

        -!!end - -!! article -אַ -!! text -Test for unicode normalization - -The page's name is U+05d0 U+05b7, with non-canonical form U+FB2E -!! endarticle - -!! test -(bug 19451) Links should refer to the normalized form. -!! input -[[אַ]] -[[אַ]] -[[אַ]] -[[אַ]] -[[אַ]] -!! result -

        -אַ -אַ -אַ -אַ -

        -!! end - -!! test -Empty attribute crash test (bug 2067) -!! input -foo -!! result -

        foo -

        -!! end - -!! test -Empty attribute crash test single-quotes (bug 2067) -!! input -foo -!! result -

        foo -

        -!! end - -!! test -Attribute test: equals, then nothing -!! input -foo -!! result -

        foo -

        -!! end - -!! test -Attribute test: unquoted value -!! input -foo -!! result -

        foo -

        -!! end - -!! test -Attribute test: unquoted but illegal value (hash) -!! input -foo -!! result -

        foo -

        -!! end - -!! test -Attribute test: no value -!! input -foo -!! result -

        foo -

        -!! end - -!! test -Bug 2095: link with three closing brackets -!! input -[[Main Page]]] -!! result -

        Main Page] -

        -!! end - -!! test -Bug 2095: link with pipe and three closing brackets -!! input -[[Main Page|link]]] -!! result -

        link] -

        -!! end - -!! test -Bug 2095: link with pipe and three closing brackets, version 2 -!! input -[[Main Page|[http://example.com/]]] -!! result -

        [http://example.com/] -

        -!! end - - -### -### Safety -### - -!! article -Template:Dangerous attribute -!! text -" onmouseover="alert(document.cookie) -!! endarticle - -!! article -Template:Dangerous style attribute -!! text -border-size: expression(alert(document.cookie)) -!! endarticle - -!! article -Template:Div style -!! text -
        Magic div
        -!! endarticle - -!! test -Bug 2304: HTML attribute safety (safe template; regression bug 2309) -!! input -
        -!! result -
        - -!! end - -!! test -Bug 2304: HTML attribute safety (dangerous template; 2309) -!! input -
        -!! result -
        - -!! end - -!! test -Bug 2304: HTML attribute safety (dangerous style template; 2309) -!! input -
        -!! result -
        - -!! end - -!! test -Bug 2304: HTML attribute safety (safe parameter; 2309) -!! input -{{div style|width: 200px}} -!! result -
        Magic div
        - -!! end - -!! test -Bug 2304: HTML attribute safety (unsafe parameter; 2309) -!! input -{{div style|width: expression(alert(document.cookie))}} -!! result -
        Magic div
        - -!! end - -!! test -Bug 2304: HTML attribute safety (unsafe breakout parameter; 2309) -!! input -{{div style|">}} -!! result -
        <script>alert(document.cookie)</script>">Magic div
        - -!! end - -!! test -Bug 2304: HTML attribute safety (unsafe breakout parameter 2; 2309) -!! input -{{div style|" >}} -!! result -
        <script>alert(document.cookie)</script>">Magic div
        - -!! end - -!! test -Bug 2304: HTML attribute safety (link) -!! input -
        -!! result -
        - -!! end - -!! test -Bug 2304: HTML attribute safety (italics) -!! input -
        -!! result -
        - -!! end - -!! test -Bug 2304: HTML attribute safety (bold) -!! input -
        -!! result -
        - -!! end - - -!! test -Bug 2304: HTML attribute safety (ISBN) -!! input -
        -!! result -
        - -!! end - -!! test -Bug 2304: HTML attribute safety (RFC) -!! input -
        -!! result -
        - -!! end - -!! test -Bug 2304: HTML attribute safety (PMID) -!! input -
        -!! result -
        - -!! end - -!! test -Bug 2304: HTML attribute safety (web link) -!! input -
        -!! result -
        - -!! end - -!! test -Bug 2304: HTML attribute safety (named web link) -!! input -
        -!! result -
        - -!! end - -!! test -Bug 3244: HTML attribute safety (extension; safe) -!! input -
        -!! result -
        - -!! end - -!! test -Bug 3244: HTML attribute safety (extension; unsafe) -!! input -
        -!! result -
        - -!! end - -!! test -Opera -o-link CSS -!! input -
        X
        -!! result -
        X
        - -!! end - -# More MSIE fun discovered by Tom Gilder - -!! test -MSIE CSS safety test: spurious slash -!! input -
        evil
        -!! result -
        evil
        - -!! end - -!! test -MSIE CSS safety test: hex code -!! input -
        evil
        -!! result -
        evil
        - -!! end - -!! test -MSIE CSS safety test: comment in url -!! input -
        evil
        -!! result -
        evil
        - -!! end - -!! test -MSIE CSS safety test: comment in expression -!! input -
        evil4
        -!! result -
        evil4
        - -!! end - -!! test -CSS safety test: vertical tab -!! input -

        A

        -!! result -

        A

        - -!! end - -!! test -MSIE CSS safety test: Fullwidth -!! input -

        A

        -
        B
        -!! result -

        A

        -
        B
        - -!! end - -!! test -MSIE CSS safety test: IPA extensions -!! input -
        A
        -

        B

        -!! result -
        A
        -

        B

        - -!! end - -!! test -MSIE CSS safety test: sup/sub script -!! input -
        A
        -
        B
        -

        C

        -!! result -
        A
        -
        B
        -

        C

        - -!! end - -!! test -MSIE CSS safety test: Repetition markers -!! input -

        A

        -

        B

        -

        C

        -

        D

        -

        E

        -

        F

        -

        G

        -!! result -

        A

        -

        B

        -

        C

        -

        D

        -

        E

        -

        F

        -

        G

        - -!! end - -!! test -Table attribute legitimate extension -!! input -{| -!+ style="color:blue"| status -|} -!! result - - -
        status -
        - -!!end - -!! test -Table attribute safety -!! input -{| -!+ style="border-width:expression(0+alert(document.cookie))"| status -|} -!! result - - -
        status -
        - -!! end - -!! test -CSS line continuation 1 -!! input -
        -!! result -
        - -!! end - -!! test -CSS line continuation 2 -!! input -
        -!! result -
        - -!! end - -!! article -Template:Identity -!! text -{{{1}}} -!! endarticle - -!! test -Expansion of multi-line templates in attribute values (bug 6255) -!! input -
        -
        -!! result -
        -
        - -!! end - - -!! test -Expansion of multi-line templates in attribute values (bug 6255 sanity check) -!! input -
        -
        -!! result -
        -
        - -!! end - -!! test -Expansion of multi-line templates in attribute values (bug 6255 sanity check 2) -!! input -
        -
        -!! result -
        -
        - -!! end - -### -### Parser hooks (see tests/parser/parserTestsParserHook.php for the extension) -### -!! test -Parser hook: empty input -!! input - -!! result -
        -''
        -array (
        -)
        -
        - -!! end - -!! test -Parser hook: empty input using terminated empty elements -!! input - -!! result -
        -NULL
        -array (
        -)
        -
        - -!! end - -!! test -Parser hook: empty input using terminated empty elements (space before) -!! input - -!! result -
        -NULL
        -array (
        -)
        -
        - -!! end - -!! test -Parser hook: basic input -!! input -input -!! result -
        -'input'
        -array (
        -)
        -
        - -!! end - - -!! test -Parser hook: case insensitive -!! input -input -!! result -
        -'input'
        -array (
        -)
        -
        - -!! end - - -!! test -Parser hook: case insensitive, redux -!! input -input -!! result -
        -'input'
        -array (
        -)
        -
        - -!! end - -!! test -Parser hook: nested tags -!! options -noxml -!! input - -!! result -
        -''
        -array (
        -)
        -
        </tag> - -!! end - -!! test -Parser hook: basic arguments -!! input - -!! result -
        -''
        -array (
        -  'width' => '200',
        -  'height' => '100',
        -  'depth' => '50',
        -  'square' => 'square',
        -)
        -
        - -!! end - -!! test -Parser hook: argument containing a forward slash (bug 5344) -!! input - -!! result -
        -''
        -array (
        -  'filename' => '/tmp/bla',
        -)
        -
        - -!! end - -!! test -Parser hook: empty input using terminated empty elements (bug 2374) -!! input -text -!! result -
        -NULL
        -array (
        -  'foo' => 'bar',
        -)
        -
        text - -!! end - -#
        should be output literally since there is no matching tag that begins it -!! test -Parser hook: basic arguments using terminated empty elements (bug 2374) -!! input - -other stuff - -!! result -
        -NULL
        -array (
        -  'width' => '200',
        -  'height' => '100',
        -  'depth' => '50',
        -  'square' => 'square',
        -)
        -
        -

        other stuff -</tag> -

        -!! end - -### -### (see tests/parser/parserTestsParserHook.php for the extension) -### - -!! test -Parser hook: static parser hook not inside a comment -!! input -hello, world - -!! result -

        hello, world -

        -!! end - - -!! test -Parser hook: static parser hook inside a comment -!! input - - -!! result -


        -

        -!! end - -# Nested template calls; this case was broken by Parser.php rev 1.506, -# since reverted. - -!! article -Template:One-parameter -!! text -(My parameter is: {{{1}}}) -!! endarticle - -!! article -Template:Map-one-parameter -!! text -{{{{{1}}}|{{{2}}}}} -!! endarticle - -!! test -Nested template calls -!! input -{{Map-one-parameter|One-parameter|param}} -!! result -

        (My parameter is: param) -

        -!! end - - -### -### Sanitizer -### -!! test -Sanitizer: Closing of open tags -!! input -
        -!! result -
        - -!! end - -!! test -Sanitizer: Closing of open but not closed tags -!! input -foo -!! result -

        foo -

        -!! end - -!! test -Sanitizer: Closing of closed but not open tags -!! input -
        -!! result -

        </s> -

        -!! end - -!! test -Sanitizer: Closing of closed but not open table tags -!! input -Table not started -!! result -

        Table not started</td></tr></table> -

        -!! end - -!! test -Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id="" -!! input -byte[[#æ: v|backlink]] -!! result -

        bytebacklink -

        -!! end - -!! test -Sanitizer: Validating the contents of the id attribute (bug 4515) -!! options -disabled -!! input -
        -!! result -Something, but definitely not
        ... -!! end - -!! test -Sanitizer: Validating id attribute uniqueness (bug 4515, bug 6301) -!! options -disabled -!! input -

        -!! result -Something need to be done. foo-2 ? -!! end - -!! test -Sanitizer: Validating that and work, but only for Microdata -!! input -
        - - - - - - -
        -!! result -
        -

        - <meta http-equiv="refresh" content="5"> - -

        - - <link rel="stylesheet" href="http://example.org"> - -
        - -!! end - -!! test -Language converter: output gets cut off unexpectedly (bug 5757) -!! options -language=zh -!! input -this bit is safe: }- - -but if we add a conversion instance: -{zh-cn:xxx;zh-tw:yyy}- - -then we get cut off here: }- - -all additional text is vanished -!! result -

        this bit is safe: }- -

        but if we add a conversion instance: xxx -

        then we get cut off here: }- -

        all additional text is vanished -

        -!! end - -!! test -Self closed html pairs (bug 5487) -!! options -!! input -
        Centered text
        -
        In div text
        -!! result -
        <font id="bug" />Centered text
        -
        <font id="bug2" />In div text
        - -!! end - -# -# -# - -!! test -Punctuation: nbsp before exclamation -!! input -C'est grave ! -!! result -

        C'est grave ! -

        -!! end - -!! test -Punctuation: CSS !important (bug 11874) -!! input -
        important
        -!! result -
        important
        - -!!end - -!! test -Punctuation: CSS ! important (bug 11874; with space after) -!! input -
        important
        -!! result -
        important
        - -!!end - - -!! test -HTML bullet list, closed tags (bug 5497) -!! input -
          -
        • One
        • -
        • Two
        • -
        -!! result -
          -
        • One
        • -
        • Two
        • -
        - -!! end - -!! test -HTML bullet list, unclosed tags (bug 5497) -!! options -disabled -!! input -
          -
        • One -
        • Two -
        -!! result -
          -
        • One -
        • -
        • Two -
        • -
        - -!! end - -!! test -HTML ordered list, closed tags (bug 5497) -!! input -
          -
        1. One
        2. -
        3. Two
        4. -
        -!! result -
          -
        1. One
        2. -
        3. Two
        4. -
        - -!! end - -!! test -HTML ordered list, unclosed tags (bug 5497) -!! options -disabled -!! input -
          -
        1. One -
        2. Two -
        -!! result -
          -
        1. One -
        2. -
        3. Two -
        4. -
        - -!! end - -!! test -HTML nested bullet list, closed tags (bug 5497) -!! input -
          -
        • One
        • -
        • Two: -
            -
          • Sub-one
          • -
          • Sub-two
          • -
          -
        • -
        -!! result -
          -
        • One
        • -
        • Two: -
            -
          • Sub-one
          • -
          • Sub-two
          • -
          -
        • -
        - -!! end - -!! test -HTML nested bullet list, open tags (bug 5497) -!! options -disabled -!! input -
          -
        • One -
        • Two: -
            -
          • Sub-one -
          • Sub-two -
          -
        -!! result -
          -
        • One -
        • -
        • Two: -
            -
          • Sub-one -
          • -
          • Sub-two -
          • -
          -
        • -
        - -!! end - -!! test -HTML nested ordered list, closed tags (bug 5497) -!! input -
          -
        1. One
        2. -
        3. Two: -
            -
          1. Sub-one
          2. -
          3. Sub-two
          4. -
          -
        4. -
        -!! result -
          -
        1. One
        2. -
        3. Two: -
            -
          1. Sub-one
          2. -
          3. Sub-two
          4. -
          -
        4. -
        - -!! end - -!! test -HTML nested ordered list, open tags (bug 5497) -!! options -disabled -!! input -
          -
        1. One -
        2. Two: -
            -
          1. Sub-one -
          2. Sub-two -
          -
        -!! result -
          -
        1. One -
        2. -
        3. Two: -
            -
          1. Sub-one -
          2. -
          3. Sub-two -
          4. -
          -
        4. -
        - -!! end - -!! test -HTML ordered list item with parameters oddity -!! input -
        1. One
        2. -
        -!! result -
        1. One
        2. -
        - -!! end - -!!test -bug 5918: autonumbering -!! input -[http://first/] [http://second] [ftp://ftp] - -ftp://inlineftp - -[mailto:enclosed@mail.tld With target] - -[mailto:enclosed@mail.tld] - -mailto:inline@mail.tld -!! result -

        [1] [2] [3] -

        ftp://inlineftp -

        With target -

        [4] -

        mailto:inline@mail.tld -

        -!! end - - -# -# Security and HTML correctness -# From Nick Jenkins' fuzz testing -# - -!! test -Fuzz testing: Parser13 -!! input -{| -| http://a| -!! result - - - - -
        -
        - -!! end - -!! test -Fuzz testing: Parser14 -!! input -== onmouseover= == -http://__TOC__ -!! result -

        onmouseover=[edit]

        -http://

        Contents

        - -
        - - -!! end - -!! test -Fuzz testing: Parser14-table -!! input -==a== -{| STYLE=__TOC__ -!! result -

        a[edit]

        - - -
        - -!! end - -# Known to produce bogus xml (extra ) -!! test -Fuzz testing: Parser16 -!! options -noxml -!! input -{| -!https://|||||| -!! result - - - - - - -
        https:// - -
        - -!! end - -!! test -Fuzz testing: Parser21 -!! input -{| -! irc://{{ftp://a" onmouseover="alert('hello world');" -| -!! result - - - - - -
        irc://{{ftp://a" onmouseover="alert('hello world');" - -
        - -!! end - -!! test -Fuzz testing: Parser22 -!! input -http://===r:::https://b - -{| -!!result -

        http://===r:::https://b -

        - - -
        - -!! end - -# Known to produce bad XML for now -!! test -Fuzz testing: Parser24 -!! options -noxml -!! input -{| -{{{| -}}}} > -
        - -MOVE YOUR MOUSE CURSOR OVER THIS TEXT -| -!! result - -{{{| -}}}} > -
        - -MOVE YOUR MOUSE CURSOR OVER THIS TEXT -
        - - -
        -
        - -!! end - -# Note: the current result listed for this is not what the original one was, -# but the original bug was JavaScript injection, which is fixed in any case. -# It's not clear that the original result listed was any more correct than the -# current one. Original result: -#

        {{{| -#

        -#
      16. -# }}}blah" onmouseover="alert('hello world');" align="left"MOVE MOUSE CURSOR OVER HERE -!!test -Fuzz testing: Parser25 (bug 6055) -!! input -{{{ -| -
      17. -}}}blah" onmouseover="alert('hello world');" align="left"'''MOVE MOUSE CURSOR OVER HERE -!! result -

        <LI CLASS=blah" onmouseover="alert('hello world');" align="left"MOVE MOUSE CURSOR OVER HERE -

        -!! end - -!!test -Fuzz testing: URL adjacent extension (with space, clean) -!! options -!! input -http://example.com junk -!! result -

        http://example.com junk -

        -!!end - -!!test -Fuzz testing: URL adjacent extension (no space, dirty; nowiki) -!! options -!! input -http://example.comjunk -!! result -

        http://example.comjunk -

        -!!end - -!!test -Fuzz testing: URL adjacent extension (no space, dirty; pre) -!! options -!! input -http://example.com
        junk
        -!! result -http://example.com
        junk
        - -!!end - -!!test -Fuzz testing: image with bogus manual thumbnail -!!input -[[Image:foobar.jpg|thumbnail= ]] -!!result -
        Error creating thumbnail:
        - -!!end - -!! test -Fuzz testing: encoded newline in generated HTML replacements (bug 6577) -!! input -
        
        -!! result
        -
        
        -
        -!! end
        -
        -!! test
        -Parsing optional HTML elements (Bug 6171)
        -!! options
        -!! input
        -
        -  
        -    
        -    
        -  
        -
        Some tabular data More tabular data ... - And yet som tabular data
        -!! result - - - - - -
        Some tabular data More tabular data ... - And yet som tabular data
        - -!! end - -!! test -Correct handling of , (Bug 6171) -!! options -!! input - - - - - - -
        Some tabular data More tabular data ... And yet som tabular data
        -!! result - - - - - - -
        Some tabular data More tabular data ... And yet som tabular data
        - -!! end - - -!! test -Parsing crashing regression (fr:JavaScript) -!! input - -!! result -

        </body></x> -

        -!! end - -!! test -Inline wiki vs wiki block nesting -!! input -'''Bold paragraph - -New wiki paragraph -!! result -

        Bold paragraph -

        New wiki paragraph -

        -!! end - -!! test -Inline HTML vs wiki block nesting -!! options -disabled -!! input -Bold paragraph - -New wiki paragraph -!! result -

        Bold paragraph -

        New wiki paragraph -

        -!! end - -# Original result was this: -#

        boldboldbolditalics -#

        -# While that might be marginally more intuitive, maybe, the six-apostrophe -# construct is clearly pathological and the result stated here (which is what -# the parser actually does) is about as reasonable as anything. -!!test -Mixing markup for italics and bold -!! options -!! input -'''bold''''''bold''bolditalics''''' -!! result -

        'bold'boldbolditalics -

        -!! end - - -!! article -Xyzzyx -!! text -Article for special page transclusion test -!! endarticle - -!! test -Special page transclusion -!! options -!! input -{{Special:Prefixindex/Xyzzyx}} -!! result -
        Xyzzyx
        - -!! end - -!! test -Special page transclusion twice (bug 5021) -!! options -!! input -{{Special:Prefixindex/Xyzzyx}} -{{Special:Prefixindex/Xyzzyx}} -!! result -
        Xyzzyx
        -
        Xyzzyx
        - -!! end - -!! test -Transclusion of default MediaWiki message -!! input -{{MediaWiki:Mainpage}} -!!result -

        Main Page -

        -!! end - -!! test -Transclusion of nonexistent MediaWiki message -!! input -{{MediaWiki:Mainpagexxx}} -!!result -

        MediaWiki:Mainpagexxx -

        -!! end - -!! test -Transclusion of MediaWiki message with underscore -!! input -{{MediaWiki:history_short}} -!! result -

        History -

        -!! end - -!! test -Transclusion of MediaWiki message with space -!! input -{{MediaWiki:history short}} -!! result -

        History -

        -!! end - -!! test -Invalid header with following text -!! input -= x = y -!! result -

        = x = y -

        -!! end - - -!! test -Section extraction test (section 0) -!! options -section=0 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -!! end - -!! test -Section extraction test (section 1) -!! options -section=1 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -==a== -===aa=== -====aaa==== -!! end - -!! test -Section extraction test (section 2) -!! options -section=2 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -===aa=== -====aaa==== -!! end - -!! test -Section extraction test (section 3) -!! options -section=3 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -====aaa==== -!! end - -!! test -Section extraction test (section 4) -!! options -section=4 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -==b== -===ba=== -===bb=== -====bba==== -===bc=== -!! end - -!! test -Section extraction test (section 5) -!! options -section=5 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -===ba=== -!! end - -!! test -Section extraction test (section 6) -!! options -section=6 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -===bb=== -====bba==== -!! end - -!! test -Section extraction test (section 7) -!! options -section=7 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -====bba==== -!! end - -!! test -Section extraction test (section 8) -!! options -section=8 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -===bc=== -!! end - -!! test -Section extraction test (section 9) -!! options -section=9 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -==c== -===ca=== -!! end - -!! test -Section extraction test (section 10) -!! options -section=10 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -===ca=== -!! end - -!! test -Section extraction test (nonexistent section 11) -!! options -section=11 -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -!! end - -!! test -Section extraction test with bogus heading (section 1) -!! options -section=1 -!! input -==a== -==bogus== not a legal section -==b== -!! result -==a== -==bogus== not a legal section -!! end - -!! test -Section extraction test with bogus heading (section 2) -!! options -section=2 -!! input -==a== -==bogus== not a legal section -==b== -!! result -==b== -!! end - -!! test -Section extraction test with comment after heading (section 1) -!! options -section=1 -!! input -==a== -==b== -==c== -!! result -==a== -!! end - -!! test -Section extraction test with comment after heading (section 2) -!! options -section=2 -!! input -==a== -==b== -==c== -!! result -==b== -!! end - -!! test -Section extraction test with bogus heading (section 1) -!! options -section=1 -!! input -==a== -==bogus== not a legal section -==b== -!! result -==a== -==bogus== not a legal section -!! end - -!! test -Section extraction test with bogus heading (section 2) -!! options -section=2 -!! input -==a== -==bogus== not a legal section -==b== -!! result -==b== -!! end - - -# Formerly testing for bug 2587, now resolved by the use of unmarked sections -# instead of respecting commented sections -!! test -Section extraction prefixed by comment (section 1) -!! options -section=1 -!! input -==sec1== -==sec2== -!!result -==sec2== -!!end - -!! test -Section extraction prefixed by comment (section 2) -!! options -section=2 -!! input -==sec1== -==sec2== -!!result - -!!end - - -# Formerly testing for bug 2607, now resolved by the use of unmarked sections -# instead of respecting HTML-style headings -!! test -Section extraction, mixed wiki and html (section 1) -!! options -section=1 -!! input -

        unmarked

        -unmarked -==1== -one -==2== -two -!! result -==1== -one -!! end - -!! test -Section extraction, mixed wiki and html (section 2) -!! options -section=2 -!! input -

        unmarked

        -unmarked -==1== -one -==2== -two -!! result -==2== -two -!! end - - -# Formerly testing for bug 3342 -!! test -Section extraction, heading surrounded by -!! options -section=1 -!! input -==unmarked== -==marked== -!! result -==marked== -!!end - -# Test behavior of bug 19910 -!! test -Sectiion with all-equals -!! options -section=2 -!! input -=== -The line above must have a trailing space -=== -But just in case it doesn't... -!! result -=== -But just in case it doesn't... -!! end - -!! test -Section replacement test (section 0) -!! options -replace=0,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -xxx - -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! end - -!! test -Section replacement test (section 1) -!! options -replace=1,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -xxx - -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! end - -!! test -Section replacement test (section 2) -!! options -replace=2,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -xxx - -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! end - -!! test -Section replacement test (section 3) -!! options -replace=3,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -===aa=== -xxx - -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! end - -!! test -Section replacement test (section 4) -!! options -replace=4,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -===aa=== -====aaa==== -xxx - -==c== -===ca=== -!! end - -!! test -Section replacement test (section 5) -!! options -replace=5,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -===aa=== -====aaa==== -==b== -xxx - -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! end - -!! test -Section replacement test (section 6) -!! options -replace=6,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -xxx - -===bc=== -==c== -===ca=== -!! end - -!! test -Section replacement test (section 7) -!! options -replace=7,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -xxx - -===bc=== -==c== -===ca=== -!! end - -!! test -Section replacement test (section 8) -!! options -replace=8,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -xxx - -==c== -===ca=== -!!end - -!! test -Section replacement test (section 9) -!! options -replace=9,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -xxx -!! end - -!! test -Section replacement test (section 10) -!! options -replace=10,"xxx" -!! input -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -===ca=== -!! result -start -==a== -===aa=== -====aaa==== -==b== -===ba=== -===bb=== -====bba==== -===bc=== -==c== -xxx -!! end - -!! test -Section replacement test with initial whitespace (bug 13728) -!! options -replace=2,"xxx" -!! input - Preformatted initial line -==a== -===a=== -!! result - Preformatted initial line -==a== -xxx -!! end - - -!! test -Section extraction, heading followed by pre with 20 spaces (bug 6398) -!! options -section=1 -!! input -==a== - a -!! result -==a== - a -!! end - -!! test -Section extraction, heading followed by pre with 19 spaces (bug 6398 sanity check) -!! options -section=1 -!! input -==a== - a -!! result -==a== - a -!! end - - -!! test -Section extraction,
         around bogus header (bug 10309)
        -!! options
        -noxml section=2
        -!! input
        -== Section One ==
        -
        -=======
        -
        - -== Section Two == -stuff -!! result -== Section Two == -stuff -!! end - -!! test -Section replacement,
         around bogus header (bug 10309)
        -!! options
        -noxml replace=2,"xxx"
        -!! input
        -== Section One ==
        -
        -=======
        -
        - -== Section Two == -stuff -!! result -== Section One == -
        -=======
        -
        - -xxx -!! end - - - -!! test -Handling of in URLs -!! input -**irc:// a -!! result - - -!!end - -!! test -5 quotes, code coverage +1 line (php) -!! options -php -!! input -''''' -!! result -!! end -# The PHP parser strips the empty tags out for giggles; parsoid doesn't. -!! test -5 quotes, code coverage +1 line (parsoid) -!! options -parsoid -!! input -''''' -!! result -

        -!! end - -!! test -Special:Search page linking. -!! input -{{Special:search}} -!! result -

        Special:Search -

        -!! end - -!! test -Say the magic word -!! options -title=[[Parser test]] -!! input -* {{PAGENAME}} -* {{PAGENAMEE}} -* {{FULLPAGENAME}} -* {{FULLPAGENAMEE}} -* {{BASEPAGENAME}} -* {{BASEPAGENAMEE}} -* {{SUBPAGENAME}} -* {{SUBPAGENAMEE}} -* {{ROOTPAGENAME}} -* {{ROOTPAGENAMEE}} -* {{TALKPAGENAME}} -* {{TALKPAGENAMEE}} -* {{SUBJECTPAGENAME}} -* {{SUBJECTPAGENAMEE}} -* {{NAMESPACEE}} -* {{NAMESPACE}} -* {{NAMESPACENUMBER}} -* {{TALKSPACE}} -* {{TALKSPACEE}} -* {{SUBJECTSPACE}} -* {{SUBJECTSPACEE}} -* {{Dynamic|{{NUMBEROFUSERS}}|{{NUMBEROFPAGES}}|{{CURRENTVERSION}}|{{CONTENTLANGUAGE}}|{{DIRECTIONMARK}}|{{CURRENTTIMESTAMP}}|{{NUMBEROFARTICLES}}}} -!! result -
          -
        • Parser test -
        • -
        • Parser_test -
        • -
        • Parser test -
        • -
        • Parser_test -
        • -
        • Parser test -
        • -
        • Parser_test -
        • -
        • Parser test -
        • -
        • Parser_test -
        • -
        • Parser test -
        • -
        • Parser_test -
        • -
        • Talk:Parser test -
        • -
        • Talk:Parser_test -
        • -
        • Parser test -
        • -
        • Parser_test -
        • -
        • -
        • -
        • -
        • -
        • 0 -
        • -
        • Talk -
        • -
        • Talk -
        • -
        • -
        • -
        • -
        • -
        • Template:Dynamic -
        • -
        - -!! end -### Note: Above tests excludes the "{{NUMBEROFADMINS}}" magic word because it generates a MySQL error when included. - -!! test -Gallery -!! input - -image1.png | -image2.gif||||| - -image3| -image4 |300px| centre - image5.svg| http:///////// -[[x|xx]]]] -* image6 - -!! result - - -!! end - -!! test -Gallery (with options) -!! input - -File:Nonexistant.jpg|caption -File:Nonexistant.jpg -image:foobar.jpg|some '''caption''' [[Main Page]] -image:foobar.jpg -image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla. - -!! result - - -!! end - -!! test -Gallery with wikitext inside caption -!! input - -File:foobar.jpg|[[File:foobar.jpg|20px|desc|alt=inneralt]]|alt=galleryalt -File:foobar.jpg|{{Test|unamedParam|alt=param}}|alt=galleryalt - -!! result - - -!! end - -!! test -gallery (with showfilename option) -!! input - -File:Nonexistant.jpg|caption -File:Nonexistant.jpg -image:foobar.jpg|some '''caption''' [[Main Page]] -File:Foobar.jpg - -!! result - - -!! end - -!! test -Gallery (with namespace-less filenames) -!! input - -File:Nonexistant.jpg -Nonexistant.jpg -image:foobar.jpg -foobar.jpg - -!! result - - -!! end - -!! test -HTML Hex character encoding (spells the word "JavaScript") -!! input -JavaScript -!! result -

        JavaScript -

        -!! end - -!! test -HTML Hex character encoding bogus encoding (bug 26437 regression check) -!! input -&#xsee;&#XSEE; -!! result -

        &#xsee;&#XSEE; -

        -!! end - -!! test -HTML Hex character encoding mixed case -!! input -îî -!! result -

        îî -

        -!! end - -!! test -__FORCETOC__ override -!! input -__NEWSECTIONLINK__ -__FORCETOC__ -!! result -


        -

        -!! end - -!! test -ISBN code coverage -!! input -ISBN 978-0-1234-56 789 -!! result -

        ISBN 978-0-1234-56 789 -

        -!! end - -!! test -ISBN followed by 5 spaces -!! input -ISBN -!! result -

        ISBN -

        -!! end - -!! test -Double ISBN -!! input -ISBN ISBN 1234567890 -!! result -

        ISBN ISBN 1234567890 -

        -!! end - -!! test -Bug 22905: followed by ISBN followed by -!! input -(fr) ISBN 2753300917 [http://www.example.com example.com] -!! result -

        (fr) ISBN 2753300917 example.com -

        -!! end - -!! test -Double RFC -!! input -RFC RFC 1234 -!! result -

        RFC RFC 1234 -

        -!! end - -!! test -Double RFC with a wiki link -!! input -RFC [[RFC 1234]] -!! result -

        RFC RFC 1234 -

        -!! end - -!! test -RFC code coverage -!! input -RFC 983 987 -!! result -

        RFC 983 987 -

        -!! end - -!! test -Centre-aligned image -!! input -[[Image:foobar.jpg|centre]] -!! result -
        Foobar.jpg
        - -!!end - -!! test -None-aligned image -!! input -[[Image:foobar.jpg|none]] -!! result -
        Foobar.jpg
        - -!!end - -!! test -Width + Height sized image (using px) (height is ignored) -!! input -[[Image:foobar.jpg|640x480px]] -!! result -

        Foobar.jpg -

        -!!end - -!! test -Width-sized image (using px, no following whitespace) -!! input -[[Image:foobar.jpg|640px]] -!! result -

        Foobar.jpg -

        -!!end - -!! test -Width-sized image (using px, with following whitespace - test regression from r39467) -!! input -[[Image:foobar.jpg|640px ]] -!! result -

        Foobar.jpg -

        -!!end - -!! test -Width-sized image (using px, with preceding whitespace - test regression from r39467) -!! input -[[Image:foobar.jpg| 640px]] -!! result -

        Foobar.jpg -

        -!!end - -!! test -Another italics / bold test -!! input - ''' ''x' -!! result -
        ' x'
        -
        -!!end - -# Note the results may be incorrect, as parserTest output included this: -# XML error: Mismatched tag at byte 6120: -# ...
        -
        -
        -
        -
        -
        -
        -
        -
        -
        -
        -
        -
        -
        -
        -
        -
        -
        - - -!!end - - -# Images with the "|" character in external URLs in comment tags; Eats half the comment, leaves unmatched "" tag. -!! test -Images with the "|" character in the comment -!! input -[[image:Foobar.jpg|thumb|An [http://test/?param1=|left|¶m2=|x external] URL]] -!! result -
        An external URL
        - -!!end - -!! test -[Before] HTML without raw HTML enabled ($wgRawHtml==false) -!! input - -!! result -

        <html><script>alert(1);</script></html> -

        -!! end - -!! test -HTML with raw HTML ($wgRawHtml==true) -!! options -wgRawHtml=1 -!! input - -!! result -

        -

        -!! end - -!! test -Parents of subpages, one level up -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -[[../|L2]] -!! result -

        L2 -

        -!! end - - -!! test -Parents of subpages, one level up, not named -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -[[../]] -!! result -

        Subpage test/L1/L2 -

        -!! end - - - -!! test -Parents of subpages, two levels up -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -[[../../|L1]]2 - -[[../../|L1]]l -!! result -

        L12 -

        L1l -

        -!! end - -!! test -Parents of subpages, two levels up, without trailing slash or name. -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -[[../..]] -!! result -

        [[../..]] -

        -!! end - -!! test -Parents of subpages, two levels up, with lots of extra trailing slashes. -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -[[../../////]] -!! result -

        /// -

        -!! end - -!! article -Subpage test/L1/L2/L3Sibling -!! text -Sibling article -!! endarticle - -!! test -Transclusion of a sibling page (one level up) -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -{{../L3Sibling}} -!! result -

        Sibling article -

        -!! end - -!! test -Transclusion of a child page -!! options -subpage title=[[Subpage test/L1/L2]] -!! input -{{/L3Sibling}} -!! result -

        Sibling article -

        -!! end - -!! test -Non-transclusion because of too many up levels -!! options -subpage title=[[Subpage test/L1/L2/L3]] -!! input -{{../../../../More than parent}} -!! result -

        {{../../../../More than parent}} -

        -!! end - -!! test -Definition list code coverage -!! input -; title : def -; title : def -;title: def -!! result -
        -
        title  
        -
        def -
        -
        title 
        -
        def -
        -
        title
        -
        def -
        -
        - -!! end - -!! test -Don't fall for the self-closing div -!! input -
        hello world
        -!! result -
        hello world
        - -!! end - -!! test -MSGNW magic word -!! input -{{MSGNW:msg}} -!! result -

        [[:Template:Msg]] -

        -!! end - -!! test -RAW magic word -!! input -{{RAW:QUERTY}} -!! result -

        Template:QUERTY -

        -!! end - -# This isn't needed for XHTML conformance, but would be handy as a fallback security measure -!! test -Always escape literal '>' in output, not just after '<' -!! input -><> -!! result -

        ><> -

        -!! end - -!! test -Template caching -!! input -{{Test}} -{{Test}} -!! result -

        This is a test template -This is a test template -

        -!! end - - -!! article -MediaWiki:Fake -!! text -==header== -!! endarticle - -!! test -Inclusion of !userCanEdit() content -!! input -{{MediaWiki:Fake}} -!! result -

        header[edit]

        - -!! end - - -!! test -Out-of-order TOC heading levels -!! input -==2== -======6====== -===3=== -=1= -=====5===== -==2== -!! result -

        Contents

        - -
        - -

        2[edit]

        -
        6[edit]
        -

        3[edit]

        -

        1[edit]

        -
        5[edit]
        -

        2[edit]

        - -!! end - - -!! test -ISBN with a dummy number -!! input -ISBN --- -!! result -

        ISBN --- -

        -!! end - - -!! test -ISBN with space-delimited number -!! input -ISBN 92 9017 032 8 -!! result -

        ISBN 92 9017 032 8 -

        -!! end - - -!! test -ISBN with multiple spaces, no number -!! input -ISBN foo -!! result -

        ISBN foo -

        -!! end - - -!! test -ISBN length -!! input -ISBN 123456789 - -ISBN 1234567890 - -ISBN 12345678901 -!! result -

        ISBN 123456789 -

        ISBN 1234567890 -

        ISBN 12345678901 -

        -!! end - - -!! test -ISBN with trailing year (bug 8110) -!! input -ISBN 1-234-56789-0 - 2006 - -ISBN 1 234 56789 0 - 2006 -!! result -

        ISBN 1-234-56789-0 - 2006 -

        ISBN 1 234 56789 0 - 2006 -

        -!! end - - -!! test -anchorencode -!! input -{{anchorencode:foo bar©#%n}} -!! result -

        foo_bar.C2.A9.23.25n -

        -!! end - -!! test -anchorencode trims spaces -!! input -{{anchorencode: __pretty__please__}} -!! result -

        pretty_please -

        -!! end - -!! test -anchorencode deals with links -!! input -{{anchorencode: [[hello|world]] [[hi]]}} -!! result -

        world_hi -

        -!! end - -!! test -anchorencode deals with templates -!! input -{{anchorencode: {{Foo}} }} -!! result -

        FOO -

        -!! end - -!! test -anchorencode encodes like the TOC generator: (bug 18431) -!! input -=== _ +:.3A%3A&&]] === -{{anchorencode: _ +:.3A%3A&&]] }} -__NOEDITSECTION__ -!! result -

        _ +:.3A%3A&&]]

        -

        .2B:.3A.253A.26.26.5D.5D -

        -!! end - -!! test -Bug 6200: blockquotes and paragraph formatting -!! input -
        -foo -
        - -bar - - baz -!! result -
        -

        foo -

        -
        -

        bar -

        -
        baz
        -
        -!! end - -!! test -Bug 8293: Use of center tag ruins paragraph formatting -!! input -
        -foo -
        - -bar - - baz -!! result -
        -

        foo -

        -
        -

        bar -

        -
        baz
        -
        -!! end - -!!test -Parsing of overlapping (improperly nested) inline html tags (PHP parser) -!!options -php -!!input -x -!!result -

        x</span> -

        -!!end - -!!test -Parsing of overlapping (improperly nested) inline html tags (Parsoid) -!!options -parsoid -!!input -x -!!result -

        x -

        -!!end - -### -### Language variants related tests -### -!! test -Self-link in language variants -!! options -title=[[Dunav]] language=sr -!! input -Both [[Dunav]] and [[Дунав]] are names for this river. -!! result -

        Both Dunav and Дунав are names for this river. -

        -!!end - -!! article -Дуна -!! text -content -!! endarticle - -!! test -Link to another existing title shouldn't be parsed as self-link even if it's a variant of this title -!! options -title=[[Duna]] language=sr -!! input -[[Дуна]] is not a self-link while [[Duna]] and [[Dуна]] are still self-links. -!! result -

        Дуна is not a self-link while Duna and Dуна are still self-links. -

        -!! end - -!! test -Link to a section of a variant of this title shouldn't be parsed as self-link -!! options -title=[[Duna]] language=sr -!! input -[[Dуна]] is a self-link while [[Dunа#Foo]] and [[Dуна#Foo]] are not self-links. -!! result -

        Dуна is a self-link while Dunа#Foo and Dуна#Foo are not self-links. -

        -!! end - -!! test -Link to pages in language variants -!! options -language=sr -!! input -Main Page can be written as [[Маин Паге]] -!! result -

        Main Page can be written as Маин Паге -

        -!!end - - -!! test -Multiple links to pages in language variants -!! options -language=sr -!! input -[[Main Page]] can be written as [[Маин Паге]] same as [[Маин Паге]]. -!! result -

        Main Page can be written as Маин Паге same as Маин Паге. -

        -!!end - - -!! test -Simple template in language variants -!! options -language=sr -!! input -{{тест}} -!! result -

        This is a test template -

        -!! end - - -!! test -Template with explicit namespace in language variants -!! options -language=sr -!! input -{{Template:тест}} -!! result -

        This is a test template -

        -!! end - - -!! test -Basic test for template parameter in language variants -!! options -language=sr -!! input -{{парамтест|param=foo}} -!! result -

        This is a test template with parameter foo -

        -!! end - - -!! test -Simple category in language variants -!! options -language=sr cat -!! input -[[Category:МедиаWики Усер'с Гуиде]] -!! result -MediaWiki User's Guide -!! end - - -!! article -Category:分类 -!! text -blah -!! endarticle - -!! article -Category:分類 -!! text -blah -!! endarticle - -!! test -Don't convert blue categorylinks to another variant (bug 33210) -!! options -language=zh cat -!! input -[[A]][[Category:分类]] -!! result -分类 -!! end - - -!! test -Stripping -{}- tags (language variants) -!! options -language=sr -!! input -Latin proverb: -{Ne nuntium necare}- -!! result -

        Latin proverb: Ne nuntium necare -

        -!! end - - -!! test -Prevent conversion with -{}- tags (language variants) -!! options -language=sr variant=sr-ec -!! input -Latinski: -{Ne nuntium necare}- -!! result -

        Латински: Ne nuntium necare -

        -!! end - - -!! test -Prevent conversion of text with -{}- tags (language variants) -!! options -language=sr variant=sr-ec -!! input -Latinski: -{Ne nuntium necare}- -!! result -

        Латински: Ne nuntium necare -

        -!! end - - -!! test -Prevent conversion of links with -{}- tags (language variants) -!! options -language=sr variant=sr-ec -!! input --{[[Main Page]]}- -!! result -

        Main Page -

        -!! end - - -!! test --{}- tags within headlines (within html for parserConvert()) -!! options -language=sr variant=sr-ec -!! input -== -{Naslov}- == -!! result -

        Naslov[уреди]

        - -!! end - - -!! test -Explicit definition of language variant alternatives -!! options -language=zh variant=zh-tw -!! input --{zh:China;zh-tw:Taiwan}-, not China -!! result -

        Taiwan, not China -

        -!! end - - -!! test -Conversion around HTML tags -!! options -language=sr variant=sr-ec -!! input --{H|span=>sr-ec:script;title=>sr-ec:src;}- -ski -!! result -

        -ски -

        -!! end - - -!! test -Explicit session-wise language variant mapping (A flag and - flag) -!! options -language=zh variant=zh-tw -!! input -Taiwan is not China. -But -{A|zh:China;zh-tw:Taiwan}- is China, -(This-{-|zh:China;zh-tw:Taiwan}- should be stripped!) -and -{China}- is China. -!! result -

        Taiwan is not China. -But Taiwan is Taiwan, -(This should be stripped!) -and China is China. -

        -!! end - -!! test -Explicit session-wise language variant mapping (H flag for hide) -!! options -language=zh variant=zh-tw -!! input -(This-{H|zh:China;zh-tw:Taiwan}- should be stripped!) -Taiwan is China. -!! result -

        (This should be stripped!) -Taiwan is Taiwan. -

        -!! end - -!! test -Adding explicit conversion rule for title (T flag) -!! options -language=zh variant=zh-tw showtitle -!! input -Should be stripped-{T|zh:China;zh-tw:Taiwan}-! -!! result -Taiwan -

        Should be stripped! -

        -!! end - -!! test -Testing that changing the language variant here in the tests actually works -!! options -language=zh variant=zh showtitle -!! input -Should be stripped-{T|zh:China;zh-tw:Taiwan}-! -!! result -China -

        Should be stripped! -

        -!! end - -!! test -Recursive conversion of alt and title attrs shouldn't clear converter state -!! options -language=zh variant=zh-cn showtitle -!! input --{H|zh-cn:Exclamation;zh-tw:exclamation;}- -Should be stripped-{T|zh-cn:China;zh-tw:Taiwan}-! -!! result -China -

        -Should be stripped! -

        -!! end - -!! test -Bug 24072: more test on conversion rule for title -!! options -language=zh variant=zh-tw showtitle -!! input -This should be stripped-{T|zh:China;zh-tw:Taiwan}-! -This won't take interferes with the title rule-{H|zh:Beijing;zh-tw:Taipei}-. -!! result -Taiwan -

        This should be stripped! -This won't take interferes with the title rule. -

        -!! end - -!! test -Partly disable title conversion if variant == main language code -!! options -language=zh variant=zh title=[[ZH]] showtitle -!! input --{T|zh-cn:CN;zh-tw:TW}- -!! result -ZH -

        -

        -!! end - -!! test -Partly disable title conversion if variant == main language code, more -!! options -language=zh variant=zh title=[[ZH]] showtitle -!! input --{T|TW}- -!! result -ZH -

        -

        -!! end - -!! test -Raw output of variant escape tags (R flag) -!! options -language=zh variant=zh-tw -!! input -Raw: -{R|zh:China;zh-tw:Taiwan}- -!! result -

        Raw: zh:China;zh-tw:Taiwan -

        -!! end - -!! test -Nested using of manual convert syntax -!! options -language=zh variant=zh-hk -!! input -Nested: -{zh-hans:Hi -{zh-cn:China;zh-sg:Singapore;}-;zh-hant:Hello -{zh-tw:Taiwan;zh-hk:H-{ong}- K-{}-ong;}-;}-! -!! result -

        Nested: Hello Hong Kong! -

        -!! end - -!! test -Proper conversion of text in external links -!! options -language=sr variant=sr-ec -!! input -http://www.google.com -gopher://www.google.com -[http://www.google.com http://www.google.com] -[gopher://www.google.com gopher://www.google.com] -[https://www.google.com irc://www.google.com] -[ftp://www.google.com www.google.com/ftp://dir] -[//www.google.com www.google.com] -!! result -

        http://www.google.com -gopher://www.google.com -http://www.google.com -gopher://www.google.com -irc://www.google.com -www.гоогле.цом/фтп://дир -www.гоогле.цом -

        -!! end - -!! test -Do not convert roman numbers to language variants -!! options -language=sr variant=sr-ec -!! input -Fridrih IV je car. -!! result -

        Фридрих IV је цар. -

        -!! end - -!! test -Unclosed language converter markup "-{" -!! options -language=sr -!! input --{T|hello -!! result -

        -{T|hello -

        -!! end - -!! test -Don't convert raw rule "-{R|=>}-" to "=>" -!! options -language=sr -!! input --{R|=>}- -!! result -

        => -

        -!!end - -!! test -Bug 529: Uncovered bullet -!! input -* Foo {{bullet}} -!! result -
          -
        • Foo -
        • -
        • Bar -
        • -
        - -!! end - -# Plain MediaWiki does not remove empty lists, but tidy actually does. -# Templates in Wikipedia rely on this behavior, as tidy has always been -# enabled there. These tests are normally run *without* tidy, so specify the -# full output here. -# To test realistic parsing behavior, apply a tidy-like transformation to both -# the expected output and your parser's output. -!! test -Bug 529: Uncovered bullet leaving empty list, normally removed by tidy -!! input -******* Foo {{bullet}} -!! result -
          -
          • -
            • -
              • -
                • -
                  • -
                    • -
                    • Foo -
                    • -
                    -
                  • -
                  -
                • -
                -
              • -
              -
            • -
            -
          • -
          -
        • -
        • Bar -
        • -
        - -!! end - -!! test -Bug 529: Uncovered table already at line-start -!! input -x - -{{table}} -y -!! result -

        x -

        - - - - - - -
        1 2 -
        3 4 -
        -

        y -

        -!! end - -!! test -Bug 529: Uncovered bullet in parser function result -!! input -* Foo {{lc:{{bullet}} }} -!! result -
          -
        • Foo -
        • -
        • bar -
        • -
        - -!! end - -!! test -Bug 5678: Double-parsed template argument -!! input -{{lc:{{{1}}}|hello}} -!! result -

        {{{1}}} -

        -!! end - -!! test -Bug 5678: Double-parsed template invocation -!! input -{{lc:{{paramtest {{!}} param = hello }} }} -!! result -

        {{paramtest | param = hello }} -

        -!! end - -!! test -Case insensitivity of parser functions for non-ASCII characters (bug 8143) -!! options -language=cs -title=[[Main Page]] -!! input -{{PRVNÍVELKÉ:ěščř}} -{{prvnívelké:ěščř}} -{{PRVNÍMALÉ:ěščř}} -{{prvnímalé:ěščř}} -{{MALÁ:ěščř}} -{{malá:ěščř}} -{{VELKÁ:ěščř}} -{{velká:ěščř}} -!! result -

        Ěščř -Ěščř -ěščř -ěščř -ěščř -ěščř -ĚŠČŘ -ĚŠČŘ -

        -!! end - -!! test -Morwen/13: Unclosed link followed by heading -!! input -[[link -==heading== -!! result -

        [[link -

        -

        heading[edit]

        - -!! end - -!! test -HHP2.1: Heuristics for headings in preprocessor parenthetical structures -!! input -{{foo| -=heading= -!! result -

        {{foo| -

        -

        heading

        - -!! end - -!! test -HHP2.2: Heuristics for headings in preprocessor parenthetical structures -!! input -{{foo| -==heading== -!! result -

        {{foo| -

        -

        heading[edit]

        - -!! end - -!! test -Tildes in comments -!! options -pst -!! input - -!! result - -!! end - -!! test -Paragraphs inside divs (no extra line breaks) -!! input -
        Line one - -Line two
        -!! result -
        Line one -Line two
        - -!! end - -!! test -Paragraphs inside divs (extra line break on open) -!! input -
        -Line one - -Line two
        -!! result -
        -

        Line one -

        -Line two
        - -!! end - -!! test -Paragraphs inside divs (extra line break on close) -!! input -
        Line one - -Line two -
        -!! result -
        Line one -

        Line two -

        -
        - -!! end - -!! test -Paragraphs inside divs (extra line break on open and close) -!! input -
        -Line one - -Line two -
        -!! result -
        -

        Line one -

        Line two -

        -
        - -!! end - -!! test -Nesting tags, paragraphs on lines which begin with
        -!! options -disabled -!! input -
        A -B -!! result -
        -

        A -B -

        -!! end - -# Bug 6200:
        should behave like
        with respect to line breaks -!! test -Bug 6200: paragraphs inside blockquotes (no extra line breaks) -!! input -
        Line one - -Line two
        -!! result -
        Line one -Line two
        - -!! end - -!! test -Bug 6200: paragraphs inside blockquotes (extra line break on open) -!! input -
        -Line one - -Line two
        -!! result -
        -

        Line one -

        -Line two
        - -!! end - -!! test -Bug 6200: paragraphs inside blockquotes (extra line break on close) -!! input -
        Line one - -Line two -
        -!! result -
        Line one -

        Line two -

        -
        - -!! end - -!! test -Bug 6200: paragraphs inside blockquotes (extra line break on open and close) -!! input -
        -Line one - -Line two -
        -!! result -
        -

        Line one -

        Line two -

        -
        - -!! end - -!! test -Paragraphs inside blockquotes/divs (no extra line breaks) -!! input -
        Line one - -Line two
        -!! result -
        Line one -Line two
        - -!! end - -!! test -Paragraphs inside blockquotes/divs (extra line break on open) -!! input -
        -Line one - -Line two
        -!! result -
        -

        Line one -

        -Line two
        - -!! end - -!! test -Paragraphs inside blockquotes/divs (extra line break on close) -!! input -
        Line one - -Line two -
        -!! result -
        Line one -

        Line two -

        -
        - -!! end - -!! test -Paragraphs inside blockquotes/divs (extra line break on open and close) -!! input -
        -Line one - -Line two -
        -!! result -
        -

        Line one -

        Line two -

        -
        - -!! end - -!! test -Interwiki links trounced by replaceExternalLinks after early LinkHolderArray expansion -!! options -wgLinkHolderBatchSize=0 -!! input -[[meatball:1]] -[[meatball:2]] -[[meatball:3]] -!! result -

        meatball:1 -meatball:2 -meatball:3 -

        -!! end - -!! test -Free external link invading image caption -!! input -[[Image:Foobar.jpg|thumb|http://x|hello]] -!! result -
        hello
        - -!! end - -!! test -Bug 15196: localised external link numbers -!! options -language=fa -!! input -[http://en.wikipedia.org/] -!! result -

        [۱] -

        -!! end - -!! test -Multibyte character in padleft -!! input -{{padleft:-Hello|7|Æ}} -!! result -

        Æ-Hello -

        -!! end - -!! test -Multibyte character in padright -!! input -{{padright:Hello-|7|Æ}} -!! result -

        Hello-Æ -

        -!! end - -!!test -formatdate parser function -!!input -{{#formatdate:2009-03-24}} -!! result -

        2009-03-24 -

        -!! end - -!!test -formatdate parser function, with default format -!!input -{{#formatdate:2009-03-24|mdy}} -!! result -

        March 24, 2009 -

        -!! end - -!! test -Spacing of numbers in formatted dates -!! input -{{#formatdate:January 15}} -!! result -

        January 15 -

        -!! end - -!! test -formatdate parser function, with default format and on a page of which the content language is always English and different from the wiki content language -!! options -language=nl title=[[MediaWiki:Common.css]] -!! input -{{#formatdate:2009-03-24|dmy}} -!! result -

        24 March 2009 -

        -!! end - -# -# -# - -# -# Edit comments -# - -!! test -Edit comment with link -!! options -comment -!! input -I like the [[Main Page]] a lot -!! result -I like the Main Page a lot -!!end - -!! test -Edit comment with link and link text -!! options -comment -!! input -I like the [[Main Page|best pages]] a lot -!! result -I like the best pages a lot -!!end - -!! test -Edit comment with link and link text with suffix -!! options -comment -!! input -I like the [[Main Page|best page]]s a lot -!! result -I like the best pages a lot -!!end - -!! test -Edit comment with section link (non-local, eg in history list) -!! options -comment title=[[Main Page]] -!! input -/* External links */ removed bogus entries -!! result -External links: removed bogus entries -!!end - -!! test -Edit comment with section link and text before it (non-local, eg in history list) -!! options -comment title=[[Main Page]] -!! input -pre-comment text /* External links */ removed bogus entries -!! result -pre-comment text External links: removed bogus entries -!!end - -!! test -Edit comment with section link (local, eg in diff view) -!! options -comment local title=[[Main Page]] -!! input -/* External links */ removed bogus entries -!! result -External links: removed bogus entries -!!end - -!! test -Edit comment with subpage link (bug 14080) -!! options -comment -subpage -title=[[Subpage test]] -!! input -Poked at a [[/subpage]] here... -!! result -Poked at a /subpage here... -!!end - -!! test -Edit comment with subpage link and link text (bug 14080) -!! options -comment -subpage -title=[[Subpage test]] -!! input -Poked at a [[/subpage|neat little page]] here... -!! result -Poked at a neat little page here... -!!end - -!! test -Edit comment with bogus subpage link in non-subpage NS (bug 14080) -!! options -comment -title=[[Subpage test]] -!! input -Poked at a [[/subpage]] here... -!! result -Poked at a /subpage here... -!!end - -!! test -Edit comment with bare anchor link (local, as on diff) -!! options -comment -local -title=[[Main Page]] -!!input -[[#section]] -!! result -#section -!! end - -!! test -Edit comment with bare anchor link (non-local, as on history) -!! options -comment -title=[[Main Page]] -!!input -[[#section]] -!! result -#section -!! end - -!! test -Anchor starting with underscore -!!input -[[#_ref|One]] -!! result -

        One -

        -!! end - -!! test -Id starting with underscore -!!input -
        -!! result -
        - -!! end - -!! test -Space normalisation on autocomment (bug 22784) -!! options -comment -title=[[Main Page]] -!!input -/* __hello__world__ */ -!! result -__hello__world__ -!! end - -!! test -percent-encoding and + signs in comments (Bug 26410) -!! options -comment -!!input -[[ABC%33D% ++]] [[ABC%33D% ++|+%20]] -!! result -ABC3D% ++ +%20 -!! end - -!! test -Bad images - basic functionality -!! options -disabled -!! input -[[File:Bad.jpg]] -!! result -!! end - -!! test -Bad images - bug 16039: text after bad image disappears -!! options -disabled -!! input -Foo bar -[[File:Bad.jpg]] -Bar foo -!! result -

        Foo bar -

        Bar foo -

        -!! end - -!! test -Verify that displaytitle works (bug #22501) no displaytitle -!! options -showtitle -!! config -wgAllowDisplayTitle=true -wgRestrictDisplayTitle=false -!! input -this is not the the title -!! result -Parser test -

        this is not the the title -

        -!! end - -!! test -Verify that displaytitle works (bug #22501) RestrictDisplayTitle=false -!! options -showtitle -title=[[Screen]] -!! config -wgAllowDisplayTitle=true -wgRestrictDisplayTitle=false -!! input -this is not the the title -{{DISPLAYTITLE:whatever}} -!! result -whatever -

        this is not the the title -

        -!! end - -!! test -Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true mismatch -!! options -showtitle -title=[[Screen]] -!! config -wgAllowDisplayTitle=true -wgRestrictDisplayTitle=true -!! input -this is not the the title -{{DISPLAYTITLE:whatever}} -!! result -Screen -

        this is not the the title -

        -!! end - -!! test -Verify that displaytitle works (bug #22501) RestrictDisplayTitle=true matching -!! options -showtitle -title=[[Screen]] -!! config -wgAllowDisplayTitle=true -wgRestrictDisplayTitle=true -!! input -this is not the the title -{{DISPLAYTITLE:screen}} -!! result -screen -

        this is not the the title -

        -!! end - -!! test -Verify that displaytitle works (bug #22501) AllowDisplayTitle=false -!! options -showtitle -title=[[Screen]] -!! config -wgAllowDisplayTitle=false -!! input -this is not the the title -{{DISPLAYTITLE:screen}} -!! result -Screen -

        this is not the the title -Template:DISPLAYTITLE:screen -

        -!! end - -!! test -Verify that displaytitle works (bug #22501) AllowDisplayTitle=false no DISPLAYTITLE -!! options -showtitle -title=[[Screen]] -!! config -wgAllowDisplayTitle=false -!! input -this is not the the title -!! result -Screen -

        this is not the the title -

        -!! end - -!! test -Verify that displaytitle handles inline CSS styles (bug 26547) - rejected value -!! options -showtitle -title=[[Screen]] -!! config -wgAllowDisplayTitle=true -wgRestrictDisplayTitle=true -!! input -this is not the the title -{{DISPLAYTITLE:screen}} -!! result -screen -

        this is not the the title -

        -!! end - -!! test -Verify that displaytitle handles inline CSS styles (bug 26547) - accepted value -!! options -showtitle -title=[[Screen]] -!! config -wgAllowDisplayTitle=true -wgRestrictDisplayTitle=true -!! input -this is not the the title -{{DISPLAYTITLE:screen}} -!! result -screen -

        this is not the the title -

        -!! end - -!! test -preload: check and -!! options -preload -!! input -Hello cruelkind world. -!! result -Hello kind world. -!! end - -!! test -preload: check -!! options -preload -!! input -Goodbye Hello world -!! result -Hello world -!! end - -!! test -preload: can pass tags through if we want to -!! options -preload -!! input -<includeonly>Hello world</includeonly> -!! result -Hello world -!! end - -!! test -preload: check that it doesn't try to do tricks -!! options -preload -!! input -* ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}} -!! result -* ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}} -!! end - -!! test -Play a bit with r67090 and bug 3158 -!! options -disabled -!! input -
         
        -
         
        -
         
        -
         
        -!! result -
         
        -
         
        -
         
        -
         
        - -!! end - -!! test -HTML5 data attributes -!! input -Baz -

        Quuz

        -!! result -

        Baz -

        -

        Quuz

        - -!! end - -!! test -percent-encoding and + signs in internal links (Bug 26410) -!! input -[[User:+%]] [[Page+title%]] -[[%+]] [[%+|%20]] [[%+ ]] [[%+r]] -[[%]] [[+]] [[image:%+abc%39|foo|[[bar]]]] -[[%33%45]] [[%33%45+]] -!! result -

        User:+% Page+title% -%+ %20 %+ %+r -% + bar -3E 3E+ -

        -!! end - -!! test -Special characters in embedded file links (bug 27679) -!! input -[[File:Contains & ampersand.jpg]] -[[File:Does not exist.jpg|Title with & ampersand]] -!! result -

        File:Contains & ampersand.jpg -Title with & ampersand -

        -!! end - - -!! test -Confirm that 'apos' named character reference doesn't make it to output (not legal in HTML 4) -!! input -Text's been normalized? -!! result -

        Text's been normalized? -

        -!! end - -!! test -Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate free external links -!! input -http://www.example.org/ <-- U+3000 (vim: ^Vu3000) -!! result -

        http://www.example.org/ <-- U+3000 (vim: ^Vu3000) -

        -!! end - -!! test -Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate bracketed external links -!! input -[http://www.example.org/ ideograms] -!! result -

        ideograms -

        -!! end - -!! test -Bug 19052 U+3000 IDEOGRAPHIC SPACE should terminate external images links -!! input -http://www.example.org/pic.png <-- U+3000 (vim: ^Vu3000) -!! result -

        pic.png <-- U+3000 (vim: ^Vu3000) -

        -!! end - -!! article -Mediawiki:loop1 -!! text -{{Identical|A}} -!! endarticle - -!! article -Mediawiki:loop2 -!! text -{{Identical|B}} -!! endarticle - -!! article -Template:Identical -!! text -{{int:loop1}} -{{int:loop2}} -!! endarticle - -!! test -Bug 31098 Template which includes system messages which includes the template -!! input -{{Identical}} -!! result -

        Template loop detected: Template:Identical -Template loop detected: Template:Identical -

        -!! end - -!! test -Bug31490 Turkish: ucfirst 'blah' -!! options -language=tr -!! input -{{ucfirst:blah}} -!! result -

        Blah -

        -!! end - -!! test -Bug31490 Turkish: ucfirst 'ix' -!! options -language=tr -!! input -{{ucfirst:ix}} -!! result -

        İx -

        -!! end - -!! test -Bug31490 Turkish: lcfirst 'BLAH' -!! options -language=tr -!! input -{{lcfirst:BLAH}} -!! result -

        bLAH -

        -!! end - -!! test -Bug31490 Turkish: ucfırst (with a dotless i) -!! options -language=tr -!! input -{{ucfırst:blah}} -!! result -

        Şablon:Ucfırst:blah -

        -!! end - -!! test -Bug31490 ucfırst (with a dotless i) with English language -!! options -language=en -!! input -{{ucfırst:blah}} -!! result -

        Template:Ucfırst:blah -

        -!! end - -!! test -Bug 26375: TOC with italics -!! options -title=[[Main Page]] -!! input -__TOC__ -== ''Lost'' episodes == -!! result -

        Contents

        - -
        - -

        Lost episodes[edit]

        - -!! end - -!! test -Bug 26375: TOC with bold -!! options -title=[[Main Page]] -!! input -__TOC__ -== '''should be bold''' then normal text == -!! result - - -

        should be bold then normal text[edit]

        - -!! end - -!! test -Bug 33845: Headings become cursive in TOC when they contain an image -!! options -title=[[Main Page]] -!! input -__TOC__ -== Image [[Image:foobar.jpg]] == -!! result -

        Contents

        - -
        - -

        Image Foobar.jpg[edit]

        - -!! end - -!! test -Bug 33845 (2): Headings become bold in TOC when they contain a blockquote -!! options -title=[[Main Page]] -!! input -__TOC__ -==
        Quote
        == -!! result -

        Contents

        - -
        - -

        Quote
        [edit]

        - -!! end - -!! test -Unclosed tags in TOC -!! options -title=[[Main Page]] -!! input -__TOC__ -== Proof: 2 < 3 == -Hanc marginis exiguitas non caperet. -QED -!! result -

        Contents

        - -
        - -

        Proof: 2 < 3[edit]

        -

        Hanc marginis exiguitas non caperet. -QED -

        -!! end - -!! test -Multiple tags in TOC -!! input -__TOC__ -== Foo Bar == - -== Foo
        Bar
        == -!! result -

        Contents

        - -
        - -

        Foo Bar[edit]

        -

        Foo
        Bar
        [edit]

        - -!! end - -!! test -Tags with parameters in TOC -!! input -__TOC__ -== Hello == - -== Evilbye == -!! result -

        Contents

        - -
        - -

        Hello[edit]

        -

        b">Evilbye[edit]

        - -!! end - -!! test -span tags with directionality in TOC -!! input -__TOC__ -== C++ == - -== זבנג! == - -== The attributes on these span tags must be deleted from the TOC == - -== All attributes on these span tags must be deleted from the TOC == - -== Attributes after dir on these span tags must be deleted from the TOC == -!! result - - -

        C++[edit]

        -

        זבנג![edit]

        -

        The attributes on these span tags must be deleted from the TOC[edit]

        -

        All attributes on these span tags must be deleted from the TOC[edit]

        -

        Attributes after dir on these span tags must be deleted from the TOC[edit]

        - -!! end - -!! article -MediaWiki:Bug32057 -!! text -== {{int:headline_sample}} == -!! endarticle - -!! test -Bug 32057: Title needed when expanding nodes. -!! options -title=[[Main Page]] -!! input -{{int:Bug32057}} -!! result -

        Headline text[edit]

        - -!! end - -!! test -Strip marker in urlencode -!! input -{{urlencode:xy}} -{{urlencode:xy|wiki}} -{{urlencode:xy|path}} -!! result -

        xy -xy -xy -

        -!! end - -!! test -Strip marker in lc -!! input -{{lc:xy}} -!! result -

        xy -

        -!! end - -!! test -Strip marker in uc -!! input -{{uc:xy}} -!! result -

        XY -

        -!! end - -!! test -Strip marker in formatNum -!! input -{{formatnum:12}} -{{formatnum:12|R}} -!! result -

        12 -12 -

        -!! end - -!! test -Check noCommafy in formatNum -!! options -language=be-tarask -!! input -{{formatnum:123456.78}} -{{formatnum:123456.78|NOSEP}} -!! result -

        123 456,78 -123456.78 -

        -!! end - -!! test -Strip marker in grammar -!! options -language=fi -!! input -{{grammar:elative|foobar}} -!! result -

        foobarista -

        -!! end - -!! test -Strip marker in padleft -!! input -{{padleft:|2|xy}} -!! result -

        xy -

        -!! end - -!! test -Strip marker in padright -!! input -{{padright:|2|xy}} -!! result -

        xy -

        -!! end - -!! test -Strip marker in anchorencode -!! input -{{anchorencode:xy}} -!! result -

        xy -

        -!! end - -!! test -nowiki inside link inside heading (bug 18295) -!! input -==[[foo|xyz]]== -!! result -

        xyz[edit]

        - -!! end - -!! test -new support for bdi element (bug 31817) -!! input -

        ולדימיר לנין (ברוסית: Владимир Ленин, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.

        -!! result -

        ולדימיר לנין (ברוסית: Владимир Ленин, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.

        - -!!end - -!! test -Ignore pipe between table row attributes -!! input -{| -| quux -|- id=foo | style='color: red' -| bar -|} -!! result - - - - -
        quux -
        bar -
        - -!! end - -!!test -Gallery override link with WikiLink (bug 34852) -!! input - -File:foobar.jpg|caption|alt=galleryalt|link=InterWikiLink - -!! result - - -!! end - -!!test -Gallery override link with absolute external link (bug 34852) -!! input - -File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org - -!! result - - -!! end - -!!test -Gallery override link with malicious javascript (bug 34852) -!! input - -File:foobar.jpg|caption|alt=galleryalt|link=" onclick="alert('malicious javascript code!'); - -!! result - - -!! end - -!!test -Gallery with invalid title as link (bug 43964) -!! input - -File:foobar.jpg|link=< - -!! result - - -!! end - -!!test -Language parser function -!! input -{{#language:ar}} -!! result -

        العربية -

        -!! end - -!!test -Padleft and padright as substr -!! input -{{padleft:|3|abcde}} -{{padright:|3|abcde}} -!! result -

        abc -abc -

        -!! end - -!!test -Special parser function -!! input -{{#special:RandomPage}} -{{#special:BaDtItLe}} -{{#special:Foobar}} -!! result -

        Special:Random -Special:Badtitle -Special:Foobar -

        -!! end - -!!test -Bug 34939 - Case insensitive link parsing ([HttP://]) -!! input -[HttP://MediaWiki.Org/] -!! result -

        [1] -

        -!! end - -!!test -Bug 34939 - Case insensitive link parsing ([HttP:// title]) -!! input -[HttP://MediaWiki.Org/ MediaWiki] -!! result -

        MediaWiki -

        -!! end - -!!test -Bug 34939 - Case insensitive link parsing (HttP://) -!! input -HttP://MediaWiki.Org/ -!! result -

        HttP://MediaWiki.Org/ -

        -!! end - -!!test -Disable TOC -!! options -notoc -!! input -Lead -== Section 1 == -== Section 2 == -== Section 3 == -== Section 4 == -== Section 5 == -!! result -

        Lead -

        - -

        Section 1[edit]

        -

        Section 2[edit]

        -

        Section 3[edit]

        -

        Section 4[edit]

        -

        Section 5[edit]

        - -!! end - - -### -### Parsoids-specific tests -### Parsoid-PHP parser incompatibilities -### -!!test -1. SOL-sensitive wikitext tokens as template-args -!!options -parsoid=wt2html,wt2wt -!!input -{{echo|*a}} -{{echo|#a}} -{{echo|:a}} -!!result - -
        • a
        • -
        - -
        1. a
        2. -
        - -
        a
        -
        -!!end - -#### ---------------------------------------------------------------- -#### Parsoid-only testing of Parsoid's impl of and -#### tags. Parsoid's output for these tags differs from that of the -#### PHP parser. -#### ---------------------------------------------------------------- - -!!test -Ref: 1. ref-location should be replaced with an index span -!!options -parsoid -!!input -A foo -B foo -C -!!result -

        A [1] -B [2] -C [3]

        -!!end - -!!test -Ref: 2. ref-tags with identical names should all get the same index -!!options -parsoid -!!input -A foo -B -!!result -

        A [1] -B [1]

        -!!end - -!!test -Ref: 3. spaces in ref-names should be ignored -!!options -parsoid -!!input -A foo -B -C -!!result -

        A [1] -B [1] -C [1]

        -!!end - -!!test -Ref: 4. 'constructor' should be accepted as a valid ref-name -(NOTE: constructor is a predefined property in JS and constructor as a ref-name can clash with it if not handled properly) -!!options -parsoid -!!input -A foo -!!result -

        A [1]

        -!!end - -!!test -Ref: 5. body should accept generic wikitext -!!options -parsoid -!!input -A - This is a '''[[bolded link]]''' and this is a {{echo|transclusion}} - - - -!!result -

        A [1]

        - -
          -
        1. This is a bolded link and this is a transclusion -
        2. -
        -!!end - -!!test -Ref: 6. indent-pres should not be output in ref-body -!!options -parsoid -!!input -A - foo - bar - baz - - - -!!result -

        A [1]

        - -
          -
        1. foo - bar - baz -
        2. -
        -!!end - -!!test -Ref: 7. No p-wrapping in ref-body -!!options -parsoid -!!input -A -foo - -bar - - -baz - - - -booz - - - -!!result -

        A [1]

        - -
          -
        1. foo - -bar - - -baz - - - -booz -
        2. -
        -!!end - -!!test -Ref: 8. transclusion wikitext has lower precedence -!!options -parsoid -!!input -A foo {{echo| B C}} - - -!!result -

        A [1] B C}}

        - -
          -
        1. foo {{echo|
        2. -
        -!!end - -!!test -Ref: 9. unclosed comments should not leak out of ref-body -!!options -parsoid -!!input -A foo "},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref">[1] B C

        - -
          -
        1. foo
        2. -
        -!!end - -!!test -Ref: 10. Unclosed HTML tags should not leak out of ref-body -!!options -parsoid -!!input -A foo B C - - -!!result -

        A [1] B C

        - -
          -
        1. foo
        2. -
        -!!end - -!!test -Ref: 11. ref-tags acts like an inline element wrt P-wrapping -!!options -parsoid -!!input -A foo B -C bar D -!!result -

        A [1] B -C [2] D

        -!!end - -!!test -Ref: 12. ref-tags act as trailing newline migration barrier -!!options -parsoid -!!input -a - -b - - -c -!!result -

        a

        - - -

        b [1] -[2]

        - - -

        c

        -!!end - -!!test -Ref: 13. ref-tags are not SOL-transparent and block indent-pres -!!options -parsoid -!!input -foo A -bar - B -!!result -

        [1] A -[2] B

        -!!end - -!!test -Ref: 14. A nested ref-tag should be emitted as plain text -!!options -parsoid -!!input -foo bar baz - - -!!result -

        [1]

        - -
          -
        1. foo <ref>bar</ref> baz
        2. -
        -!!end - -!!test -Ref: 15. ref-tags with identical names should get identical indexes -!!options -parsoid -!!input -A1 foo A2 -B1 B2 bar - - -!!result -

        A1 [1] A2 [1] -B1 [2] B2 [2]

        - -
        1. 1.0 1.1 foo
        2. 2.0 2.1 bar
        3. -
        -!!end - -!!test -References: 1. references tag without any refs should be handled properly -!!options -parsoid -!!input - -!!result -
          -!!end - -!!test -References: 2. references tag with group only outputs references from that group -!!options -parsoid -!!input -A foo -B bar - - -!!result -

          A [a 1] -B [b 1]

          - -
          1. foo
          2. -
          -!!end - -!!test -References: 3. ref list should be cleared after processing references -!!options -parsoid -!!input -A foo - - - -B bar - - -!!result -

          A [1]

          - -
          1. foo
          2. -
          - -

          B [1]

          - -
          1. bar
          2. -
          -!!end - -!!test -References: 4. only referenced group should be cleared after processing references -!!options -parsoid -!!input -A afoo -B bfoo - - - -C cfoo - - -!!result -

          A [a 1] -B [1]

          - -
          1. afoo
          2. -
          - -

          C [2]

          - -
          1. bfoo
          2. cfoo
          3. -
          -!!end - -!!test -References: 5. ref tags in references should be processed while ignoring all other content -!!options -parsoid -!!input -A -B bar - - -foo -This should just get lost. - -!!result -

          A [1] -B [2]

          - -
          1. foo
          2. bar
          3. -
          -!!end - -!!test -References: 6. from a transclusion -!!options -parsoid -!!input -{{echo|}} -!!result -
            -!!end - -!! test -References: 7. Multiple references tags (one without and one with nested refs) should be correctly handled -!! options -parsoid -!! input -A foo bar for a -B - - - - -foo - -!! result -

            A [1] -B [2]

            - -
              -
            1. foo bar for a
            2. -
            3. -
            - -
              -
            1. foo
            2. -
            -!! end - -#### ---------------------------------------------------------------- -#### The following section of tests are primarily to test -#### wikitext escaping capabilities of Parsoid. Given that -#### escaping can be done any number of ways, the wikitext (input) -#### is always adjusted to reflect how Parsoid adds nowiki -#### escape tags. -#### -#### We are marking several tests as parsoid-only since the -#### HTML in the result section is different from what the -#### PHP parser generates for it. -#### ---------------------------------------------------------------- - - -#### --------------- Headings --------------- -#### 0. Unnested -#### 1. Nested inside html

            =foo=

            -#### 2. Outside heading nest on a single line

            foo

            *bar -#### 3. Nested inside html with wikitext split by html tags -#### 4. No escape needed -#### 5. Empty headings

            -#### 6. Heading chars in SOL context -#### ---------------------------------------- -!! test -Headings: 0. Unnested -!! options -parsoid -!! input -=foo= - - =foo= - -=foo= - -=foo''a''= -!! result -

            =foo=

            - -

            =foo= - -=foo=

            - -

            =fooa=

            -!!end - -!! test -Headings: 1. Nested inside html -!! options -parsoid -!! input -==foo== - -===foo=== - -====foo==== - -=====foo===== - -======foo====== - -=======foo======= -!! result -

            =foo=

            -

            =foo=

            -

            =foo=

            -

            =foo=

            -
            =foo=
            -
            =foo=
            -!!end - -!! test -Headings: 2. Outside heading nest on a single line

            foo

            *bar -!! options -parsoid -!! input -=foo= -*bar - -=foo= -=bar - -=foo= -=bar= -!! result -

            foo

            *bar -

            foo

            =bar -

            foo

            =bar= -!!end - -!! test -Headings: 3. Nested inside html with wikitext split by html tags -!! options -parsoid -!! input -=='''bold'''foo== -!! result -

            =boldfoo=

            -!!end - -!! test -Headings: 4a. No escaping needed (testing just h1 and h2) -!! options -parsoid -!! input -==foo= - -=foo== - -= =foo= = - -==foo= bar= - -===foo== - -==foo=== - -=''=''foo== - -=== -!! result -

            =foo

            -

            foo=

            -

            =foo=

            -

            =foo= bar

            -

            =foo

            -

            foo=

            -

            =foo=

            -

            =

            -!!end - -!! test -Headings: 4b. No escaping needed (inside p-tags) -!! options -parsoid -!! input -=== -=foo= x -=foo= -!! result -

            === -=foo= x -=foo= -

            -!!end - -!! test -Headings: 5. Empty headings -!! options -parsoid -!! input -== - -==== - -====== - -======== - -========== - -============ -!! result -

            -

            -

            -

            -
            -
            -!!end - -!! test -Headings: 6a. Heading chars in SOL context (with trailing spaces) -!! options -parsoid -!! input -=a= - -=a= - -=a= - -=a= -!! result -

            =a=

            -

            =a=

            -

            =a=

            -

            =a=

            -!!end - -!! test -Headings: 6b. Heading chars in SOL context (with trailing newlines) -!! options -parsoid -!! input -=a= -b - -=a= -b - -=a= -b - -=a= -b -!! result -

            =a= -b

            -

            =a= -b

            -

            =a= -b

            -

            =a= -b

            -

            -!!end - -!! test -Headings: 6c. Heading chars in SOL context (leading newline break) -!! options -parsoid -!! input -a -=b= -!! result -

            a -=b=

            -!!end - -!! test -Headings: 6d. Heading chars in SOL context (with interspersed comments) -!! options -parsoid -!! input -=a= - -=a= -!! result -

            =a=

            -

            =a=

            -!!end - -!! test -Headings: 6d. Heading chars in SOL context (No escaping needed) -!! options -parsoid=html2wt -!! input -=a=
            b
            -!! result -=a=
            b
            -!!end - -#### --------------- Lists --------------- -#### 0. Outside nests (*foo, etc.) -#### 1. Nested inside html
            • *foo
            -#### 2. Inside definition lists -#### 3. Only bullets at start should be escaped -#### 4. No escapes needed -#### 5. No unnecessary escapes -#### 6. Escape bullets in SOL position -#### 7. Escape bullets in a multi-line context -#### ---------------------------------------- - -!! test -Lists: 0. Outside nests -!! input -*foo - -#foo -!! result -

            *foo -

            #foo -

            -!!end - -!! test -Lists: 1. Nested inside html -!! input -**foo - -*#foo - -*:foo - -*;foo - -#*foo - -##foo - -#:foo - -#;foo -!! result -
              -
            • *foo -
            • -
            -
              -
            • #foo -
            • -
            -
              -
            • :foo -
            • -
            -
              -
            • ;foo -
            • -
            -
              -
            1. *foo -
            2. -
            -
              -
            1. #foo -
            2. -
            -
              -
            1. :foo -
            2. -
            -
              -
            1. ;foo -
            2. -
            - -!!end - -!! test -Lists: 2. Inside definition lists -!! input -;;foo - -;:foo - -;:foo -:bar - -::foo -!! result -
            -
            ;foo -
            -
            -
            -
            :foo -
            -
            -
            -
            :foo -
            -
            bar -
            -
            -
            -
            :foo -
            -
            - -!!end - -!! test -Lists: 3. Only bullets at start of text should be escaped -!! input -**foo*bar - -**foo''it''*bar -!! result -
              -
            • *foo*bar -
            • -
            -
              -
            • *fooit*bar -
            • -
            - -!!end - -!! test -Lists: 4. No escapes needed -!! options -parsoid -!! input -*foo*bar - -*''foo''*bar - -*[[Foo]]: bar -!! result -
              -
            • foo*bar -
            • -
            -
              -
            • foo*bar -
            • -
            - -!!end - -!! test -Lists: 5. No unnecessary escapes -!! input -* bar [[foo]] - -*=bar [[foo]] - -*[[bar [[foo]] - -*]]bar [[foo]] - -*=bar foo]]= - -* : a -!! result -
              -
            • bar [[foo]] -
            • -
            -
              -
            • =bar [[foo]] -
            • -
            -
              -
            • [[bar [[foo]] -
            • -
            -
              -
            • ]]bar [[foo]] -
            • -
            -
              -
            • =bar foo]]= -
            • -
            -
              -
            • : a -
            • -
            - -!!end - -!! test -Lists: 6. Escape bullets in SOL position -!! options -parsoid -!! input -*foo -!! result -

            *foo

            -!!end - -!! test -Lists: 7. Escape bullets in a multi-line context -!! input -a -*b -!! result -

            a -*b -

            -!!end - -#### --------------- HRs --------------- -#### 1. Single line -#### ----------------------------------- - -!! test -HRs: 1. Single line -!! options -parsoid -!! input --------- -----=foo= -----*foo -!! result -
            ---- -
            =foo= -
            *foo -!! end - -#### --------------- Tables --------------- -#### 1a. Simple example -#### 1b. No escaping needed (!foo) -#### 1c. No escaping needed (|foo) -#### 1d. No escaping needed (|}foo) -#### -#### 2a. Nested in td (foo|bar) -#### 2b. Nested in td (foo||bar) -#### 2c. Nested in td -- no escaping needed(foo!!bar) -#### -#### 3a. Nested in th (foo!bar) -#### 3b. Nested in th (foo!!bar) -#### 3c. Nested in th -- no escaping needed(foo||bar) -#### -#### 4a. Escape - -#### 4b. Escape + -#### 4c. No escaping needed -#### -------------------------------------- - -!! test -Tables: 1a. Simple example -!! input -{| -|} -!! result -

            {| -|} -

            -!! end - -!! test -Tables: 1b. No escaping needed -!! input -!foo -!! result -

            !foo -

            -!! end - -!! test -Tables: 1c. No escaping needed -!! input -|foo -!! result -

            |foo -

            -!! end - -!! test -Tables: 1d. No escaping needed -!! input -|}foo -!! result -

            |}foo -

            -!! end - -!! test -Tables: 2a. Nested in td -!! options -parsoid -!! input -{| -|foo|bar -|} -!! result - -
            foo|bar
            -!! end - -!! test -Tables: 2b. Nested in td -!! options -parsoid -!! input -{| -|foo||bar -|''it''foo||bar -|} -!! result - - -
            foo||baritfoo||bar
            -!! end - -!! test -Tables: 2c. Nested in td -- no escaping needed -!! options -parsoid -!! input -{| -|foo!!bar -|} -!! result -
            foo!!bar -
            - -!! end - -!! test -Tables: 3a. Nested in th -!! options -parsoid -!! input -{| -!foo!bar -|} -!! result -
            foo!bar -
            - -!! end - -!! test -Tables: 3b. Nested in th -!! options -parsoid -!! input -{| -!foo!!bar -|} -!! result - - -
            foo!!bar
            -!! end - -!! test -Tables: 3c. Nested in th -- no escaping needed -!! options -parsoid -!! input -{| -!foo||bar -|} -!! result - -
            foo||bar
            -!! end - -!! test -Tables: 4a. Escape - -!! options -parsoid -!! input -{| -!-bar -|- -|-bar -|} -!! result - - - -
            -bar
            -bar
            -!! end - -!! test -Tables: 4b. Escape + -!! options -parsoid -!! input -{| -!+bar -|- -|+bar -|} -!! result - - - -
            +bar
            +bar
            -!! end - -!! test -Tables: 4c. No escaping needed -!! options -parsoid -!! input -{| -|foo-bar -|foo+bar -|- -|''foo''-bar -|''foo''+bar -|- -|foo -bar|baz -+bar --bar -|} -!! result - - - - -
            foo-barfoo+bar
            foo-barfoo+bar
            foo -

            bar|baz -+bar --bar

            -!! end - -### SSS FIXME: Disabled right now because accurate html2wt -### on this snippet requires data-parsoid flags that we've -### stripped out of these tests. We should scheme how we -### we want to handle these kind of tests that require -### data-parsoid flags for accurate html2wt serialization - -!! test -Tables: 4d. No escaping needed -!! options -disabled -!! input -{| -||+1 -||-2 -|} -!! result - - - -
            +1 --2 -
            - -!! end - -#### --------------- Links ---------------- -#### 1. Quote marks in link text -#### 2. Wikilinks: Escapes needed -#### 3. Wikilinks: No escapes needed -#### 4. Extlinks: Escapes needed -#### 5. Extlinks: No escapes needed -#### -------------------------------------- -!! test -Links 1. Quote marks in link text -!! options -parsoid -!! input -[[Foo|Foo''boo'']] -!! result -Foo''boo'' -!! end - -!! test -Links 2. WikiLinks: Escapes needed -!! options -parsoid -!! input -[[Foo|[Foobar]]] -[[Foo|Foobar]]] -[[Foo|x [Foobar] x]] -[[Foo|x [http://google.com g] x]] -[[Foo|[[Bar]]]] -[[Foo|x [[Bar]] x]] -[[Foo||Bar]] -[[Foo|]]bar]] -[[Foo|[[bar]] -[[Foo|x ]] y [[ z]] -!! result -[Foobar] -Foobar] -x [Foobar] x -x [http://google.com g] x -[[Bar]] -x [[Bar]] x -|Bar -]]bar -[[bar -x ]] y [[ z -!! end - -!! test -Links 3. WikiLinks: No escapes needed -!! options -parsoid -!! input -[[Foo|[Foobar]] -[[Foo|foo|bar]] -!! result -[Foobar -foo|bar -!! end - -!! test -Links 4. ExtLinks: Escapes needed -!! options -parsoid -!! input -[http://google.com [google]] -[http://google.com google]] -!! result -[google] -google] -!! end - -!! test -Links 5. ExtLinks: No escapes needed -!! options -parsoid -!! input -[http://google.com [google] -!! result -[google -!! end - -#### --------------- Quotes --------------- -#### 1. Quotes inside and -#### 2. Link fragments separated by and tags -#### 3. Link fragments inside and -#### 4. No escaping needed -#### -------------------------------------- -!! test -1. Quotes inside and -!! options -parsoid=html2wt,wt2wt -!! input -'''foo''' -''''foo'''' -'''''foo''''' -''foo'''s -''''foo'''' -'''''foo''''' -''''''foo'''''' -'''foo'''bar'''baz''' -'''foo''''s -'''foo'' -''foo''' -'''foo''' -''''foo''' -'''foo'''' -''''foo'''' -!! result -

            'foo' -''foo'' -'''foo''' -foo's -'foo' -''foo'' -'''foo''' -foo'bar'baz -foo's -'foo -foo' -'foo' -'foo -foo' -'foo'

            -!! end - -!! test -2. Link fragments separated by and tags -!! input -[[''foo''hello]] - -[['''foo'''hello]] -!! result -

            [[foohello]] -

            [[foohello]] -

            -!! end - -!! test -3. Link fragments inside and -(FIXME: Escaping one or both of [[ and ]] is also acceptable -- - this is one of the shortcomings of this format) -!! input -''[[foo'']] - -'''[[foo''']] -!! result -

            [[foo]] -

            [[foo]] -

            -!! end - -!! test -4. No escaping needed -!! input -'''bar''' -''''bar'''' -!! result -

            'bar' -'bar' -

            -!! end - -#### ----------- Paragraphs --------------- -#### 1. No unnecessary escapes -#### -------------------------------------- - -!! test -1. No unnecessary escapes -!! input -bar [[foo]] - -=bar [[foo]] - -[[bar [[foo]] - -]]bar [[foo]] - -=bar foo]]= -!! result -

            bar [[foo]] -

            =bar [[foo]] -

            [[bar [[foo]] -

            ]]bar [[foo]] -

            =bar foo]]= -

            -!!end - -#### ----------------------- PRE -------------------------- -#### 1. Leading whitespace in SOL context should be escaped -#### ------------------------------------------------------ -!! test -1. Leading whitespace in SOL context should be escaped -!! options -parsoid -!! input - a - - a - - a(tab) - - a - - a - -a - b - -a - b - -a - b -!! result -

            a

            -

            a

            -

            a(tab)

            -

            a

            -

            a

            -

            a - b

            -

            a - b

            -

            a - b

            -!! end - -#### --------------- Behavior Switches -------------------- -!! test -1. Valid behavior switches should be escaped -!! options -parsoid=html2wt -!! input -__TOC__ -!! result -__TOC__ -!! end - -!! test -2. Invalid behavior switches should not be escaped -!! options -parsoid=html2wt -!! input -__TOO__ -__|__ -!! result -__TOO__ -__|__ -!! end - -#### --------------- HTML tags --------------- -#### 1. a tags -#### 2. other tags -#### 3. multi-line html tag -#### ----------------------------------------- -!! test -1. a tags -!! options -parsoid -!! input -google -!! result -<a href="http://google.com">google</a> -!! end - -!! test -2. other tags -!! input -
            foo
            -
            foo
            -!! result -

            <div>foo</div> -<div style="color:red">foo</div> -

            -!! end - -!! test -3. multi-line html tag -!! input -
            foo
            -!! result -

            <div ->foo</div -> -

            -!! end - -!! test -4. extension tags -!! input -foo -!! result -

            <ref>foo</ref> -

            -!! end - -#### --------------- Others --------------- -!! test -Escaping nowikis -!! input -<nowiki>foo</nowiki> -!! result -

            <nowiki>foo</nowiki> -

            -!! end - -## The quote-char in the input is necessary for triggering the bug -!! test -(Bug 52035) Nowiki-escaping should not get tripped by " :" in text -!! options -parsoid=wt2wt,html2wt -!! input -foo's bar : -!! result -

            foo's bar :

            -!! end - -!! test - -Tag-like HTML structures are passed through as text -!! input - - - - - - -1>2 - -xb - -1f -!! result -

            <x y> -

            <x.y> -

            <x-y> -

            1>2 -

            x<y -

            a>b -

            1<d e>f -

            -!! end - - -# This was a bug in the PHP parser (see bug 17663 and its dups, -# https://bugzilla.wikimedia.org/show_bug.cgi?id=17663) -!! test -Tag names followed by punctuation should not be recognized as tags -!! input - text -!! result -

            <s.ome> text -

            -!! end - -!! test -HTML tag with necessary entities in attributes -!! input -foo -!! result -

            foo -

            -!! end - -!! test -HTML tag with 'unnecessary' entity encoding in attributes -!! input -foo -!! result -

            foo -

            -!! end - -!! test -HTML tag with broken attribute value quoting -!! input -Foo -!! result -

            Foo -

            -!! end - -!! test -Table with broken attribute value quoting -!! input -{| -| title="Hello world|Foo -|} -!! result - - -
            Foo -
            - -!! end - -!! test -Table with broken attribute value quoting on consecutive lines -!! input -{| -| title="Hello world|Foo -| style="color:red|Bar -|} -!! result - - - -
            Foo -Bar -
            - -!! end - -!! test -Parsoid-only: Table with broken attribute value quoting on consecutive lines -!! options -parsoid -!! input -{| -| title="Hello world|Foo -| style="color:red|Bar -|} -!! result - - -
            Foo -Bar -
            - -!! end - -!! test -Parsoid-only: Don't wrap broken template tags in on wt2wt (Bug 42353) -!! options -parsoid -!! input -{{}} -!! result -{{}} -!! end - -!! test -Parsoid-only: Don't wrap broken template tags in on wt2wt (Bug 42353) -!! options -parsoid -!! input -}}{{ -!! result -}}{{ -!! end - -!!test -Accept empty td cell attribute -!!input -{| -| align="center" | foo || | -|} -!!result - - - -
            foo -
            - -!!end - -!!test -Non-empty attributes in th-cells -!!input -{| -! Foo !! style="color: red" | Bar -|} -!!result - - - -
            Foo Bar -
            - -!!end - -!!test -Accept empty attributes in th-cells -!!input -{| -!| foo !!| bar -|} -!!result - - - -
            foo bar -
            - -!!end - -!!test -Empty table rows go away -!!input -{| -| Hello -| there -|- class="foo" -|- -|} -!! result - - - - - -
            Hello - there -
            - -!! end - -### -### Parsoid-centric tests for testing RTing of inter-element separators -### Edge cases not tested by existing parser tests and specific to -### Parsoid-specific serialization strategies. -### - -!!test -RT-ed inter-element separators should be valid separators -!!input -{| -|- [[foo]] -|} -!!result - - -
            - -!!end - -!!test -Trailing newlines in a deep dom-subtree that ends a wikitext line should be migrated out -(Parsoid-only since PHP parser relies on Tidy for correct output) -!!options -parsoid -!!input -{| -|foo -bar -|} - -{| -|foo -|} -!!result -!!end - -!!test -Empty TD followed by TD with tpl-generated attribute -!!input -{| -|- -| -|{{echo|style='color:red'}}|foo -|} -!!result - - - - -
            -foo -
            - -!!end - -!!test -Indented table with an empty td -!!input - {| - |- - | - |foo - |} -!!result - - - - -
            -foo -
            - -!!end - -!!test -Empty TR followed by a template-generated TR -(Parsoid-specific since PHP parser doesn't handle this mixed tbl-wikitext) -!!options -parsoid -!!input -{| -|- -{{echo|foo}} -|} -!!result - - - - - -
            foo
            -!!end - -## PHP and parsoid output differ for this, and since this is primarily -## for testing Parsoid's serializer, marking this Parsoid only -!!test -Empty TR followed by mixed-ws-comment line should RT correctly -!!options -parsoid -!!input -{| -|- - -|- - -|} -!!result - - - - - - -
            - -!!end - -!!test -Multi-line image caption generated by templates with/without trailing newlines -!!options -parsoid -!!input -[[File:foo.jpg|thumb|300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}]] -[[File:foo.jpg|thumb|300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}\n\n]] -!!result -
            File:Foo.jpg
            foo\nA\nB\nC
            -
            File:Foo.jpg
            foo\nA\nB\nC\n\n
            - -!!end - -## PHP emits broken html for this, and since this is primarily -## a Parsoid serializer test, marking this Parsoid only -!!test -Improperly nested inline or quotes tags with whitespace in between -!!options -parsoid -!!input - x -''' ''x''' '' -!!result -

            x - x -

            -!!end - -!!test -Encapsulate protected attributes from wt -!!options -parsoid -!!input -
            foo
            -!!result -
            foo
            - -!!end - -## Currently the p-wrapper is fragile in how adds / removes transformations. -## Having nested or stray pre tags results in the attempt to add duplicates, -## causing an assertion fail. This test tries to prevent that situation. -!!test -Ensure ParagraphWrapper can deal with stray closing pre tags -!!options -parsoid=wt2html -!!input -plain text
            -!!result -plain text -!!end - -!!test -Ensure fostered text content is wrapped in spans -!!options -parsoid=wt2html -!!input -hi
            ho
            -!!result -hi -
            -ho -
            -!!end - -!!test -Encapsulation properly handles null DSR information from foster box -!!options -parsoid=wt2html,wt2wt -!!input -{{echo|foo
            bar
            }} -!!result -foo - - - -
            bar
            -!!end - -!!test -1. Encapsulate foster-parented transclusion content -!!options -parsoid=wt2wt,wt2html -!!input -{{echo|foo}}
            bar
            -!!result -foo - - - -
            bar
            -!!end - -!!test -2. Encapsulate foster-parented transclusion content -!!options -parsoid=wt2wt,wt2html -!!input -
            {{echo|foo}}
            bar
            -!!result -
            foo
            - - - -
            bar
            -!!end - -!!test -3. Encapsulate foster-parented transclusion content -!!options -parsoid=wt2wt,wt2html -!!input -

            {{echo|foo

            }}bar
            -!!result -
            -

            foo

            - - - -
            bar
            -!!end - -!!test -4. Encapsulate foster-parented transclusion content -!!options -parsoid=wt2wt,wt2html -!!input -

            {{echo|foo

            }}bar
            -!!result -
            -

            foo

            - - - -
            bar
            -!!end - -!!test -5. Encapsulate foster-parented transclusion content -!!options -parsoid=wt2wt,wt2html -!!input -foo}}

            {{echo|foo

            -!!result -foo - - - -
            -
            -

            foo

            -!!end - -!!test -6. Encapsulate foster-parented transclusion content -!!options -parsoid=wt2wt,wt2html -!!input -foo

            {{echo|foo

            }}

            ok

            -!!result -foo - - - -
            -
            -

            foo

            -

            ok

            -!!end - -!!test -7. Encapsulate foster-parented transclusion content -!!options -parsoid=wt2wt,wt2html -!!input -{{echo|

            foo

            }}
            bar
            -!!result -

            foo

            - - - -
            bar
            -!!end - -!!test -8. Encapsulate foster-parented transclusion content -!!options -parsoid=wt2wt,wt2html -!!input -{{echo|a -}}{|{{echo|style='color:red'}} -|- -|b -|} -!!result -

            a

            {{{1}}} - - - -
            b
            -!!end - -# ----------------------------------------------------------------- -# The following section of tests are primarily to spec requirements -# around serialization of new/edited content. -# -# All these tests are marked Parsoid html2wt and html2html only -# ---------------------------------------------------------------- - -!! test -Image: Modifying size of an image -!! options -parsoid=html2wt -!! input -[[Image:Wiki.png|230x230px]] -!! result -

            -!!end - -!! test -Image: New block level image should have \n before and after -!! options -parsoid=html2wt -!! input -123 -[[File:Wiki.png|right|thumb|150x150px]] -456 -!! result -

            123

            456

            -!!end - -# Wacky -- the leading newline in input is required because -# that is what the serializer emits. To be fixed. Not fixing -# the test because this test is required to test serialization of -# new content and preferred whitespace style. -!! test -Lists: Serialize correctly even when list content is wrapped in p-tags (like VE does) -!! options -parsoid=html2wt -!! input - -* foo -!! result -
              -
            • foo

            • -
            -!! end - -# Wacky -- the leading newline in input is required because -# that is what the serializer emits. To be fixed. Not fixing -# the test because this test is required to test serialization of -# new content and preferred whitespace style. -!! test -Lists: Add space after bullets -!! options -parsoid=html2wt -!! input - -* foo -* bar -* baz -!! result -
              -
            • foo
            • -
            • bar
            • -
            • baz
            • -
            -!! end - -!! test -Parsoid: Serialize positional parameters with = in them as named parameter -!! options -parsoid=html2wt -!! input -{{echo|1 = f=oo}} - -{{echo|1 = f=oo|2 = bar}} - - - -{{echo|f=oo|bar}} -!! result -

            foo

            - -

            foo

            - - - -

            foo

            -!! end - -!! test -Parsoid: Correctly serialize block-node children when they are a combination of text and p-nodes -!! options -parsoid=html2wt -!! input -
            a -b -
            -
            a -b -
            -
            -a - -b -
            -!! result -
            a

            b

            -
            a -

            b

            -
            -a -

            b

            -!! end - -#----------------------------- -# I/B quote minimization tests -#----------------------------- - -!! test -1. I/B quote minimization: wikitext-only tags should be combined -!! options -parsoid=html2wt -!! input -''AB'' - -'''AB''' - -''A'''B''''' - -'''A''B''''' - -'''A''BC''D''' - -'''''AB''''' - -'''''AB''''' - -'''''AB''''' -!! result -

            AB

            -

            AB

            -

            AB

            -

            AB

            -

            ABCD

            -

            AB

            -

            AB

            -

            AB

            -!! end - -!! test -2. I/B quote minimization: wikitext and html tags should not be combined -!! options -parsoid=html2wt -!! input -''A''B - -''A'''''B''' -!! result -

            AB

            -

            AB

            -!! end - -!! test -3. I/B quote minimization: templated content stops minimization -!! options -parsoid=html2wt -!! input -''A''{{echo|''B''}} - -''A''{{echo|'''''B'''''}} -!! result -

            AB -

            AB -!! end - -!! test -4. I/B quote minimization: new content should be mimimized with adjacent old content -!! options -parsoid=html2wt -!! input -''AB'' - -'''AB''' - -''A'''B''''' -!! result -

            AB

            -

            AB

            -

            AB

            -!! end - -# ----------------------------------------------------------------- -# End of section for Parsoid-only html2wt tests for serialization -# of new content -# ----------------------------------------------------------------- - -TODO: -more images -more tables -character entities -and much more -Try for 100% code coverage diff --git a/tests/parser/parserTestsParserHook.php b/tests/parser/parserTestsParserHook.php deleted file mode 100644 index c8b3e897..00000000 --- a/tests/parser/parserTestsParserHook.php +++ /dev/null @@ -1,66 +0,0 @@ - - */ - -class ParserTestParserHook { - - static function setup( &$parser ) { - $parser->setHook( 'tag', array( __CLASS__, 'dumpHook' ) ); - $parser->setHook( 'statictag', array( __CLASS__, 'staticTagHook' ) ); - return true; - } - - static function dumpHook( $in, $argv ) { - return "
            \n" .
            -			var_export( $in, true ) . "\n" .
            -			var_export( $argv, true ) . "\n" .
            -			"
            "; - } - - static function staticTagHook( $in, $argv, $parser ) { - if ( !count( $argv ) ) { - $parser->static_tag_buf = $in; - return ''; - } elseif ( count( $argv ) === 1 && isset( $argv['action'] ) - && $argv['action'] === 'flush' && $in === null - ) { - // Clear the buffer, we probably don't need to - if ( isset( $parser->static_tag_buf ) ) { - $tmp = $parser->static_tag_buf; - } else { - $tmp = ''; - } - $parser->static_tag_buf = null; - return $tmp; - } else { // wtf? - return - "\nCall this extension as string or as" . - " , not in any other way.\n" . - "text: " . var_export( $in, true ) . "\n" . - "argv: " . var_export( $argv, true ) . "\n"; - } - } -} diff --git a/tests/parser/preprocess/All_system_messages.expected b/tests/parser/preprocess/All_system_messages.expected deleted file mode 100644 index 078d8f0d..00000000 --- a/tests/parser/preprocess/All_system_messages.expected +++ /dev/null @@ -1,5625 +0,0 @@ - - -<table border=1 width=100%><tr><td> -'''Name''' -</td><td> -'''Default text''' -</td><td> -'''Current text''' -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:1movedto2&action=edit 1movedto2]<br> -[[MediaWiki_talk:1movedto2|Talk]] -</td><td> -$1 moved to $2 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Monobook.css&action=edit Monobook.css]<br> -[[MediaWiki_talk:Monobook.css|Talk]] -</td><td> -/* edit this file to customize the monobook skin for the entire site */ -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:About&action=edit about]<br> -[[MediaWiki_talk:About|Talk]] -</td><td> -About -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Aboutpage&action=edit aboutpage]<br> -[[MediaWiki_talk:Aboutpage|Talk]] -</td><td> -Wiktionary:About -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Aboutwikipedia&action=edit aboutwikipedia]<br> -[[MediaWiki_talk:Aboutwikipedia|Talk]] -</td><td> -About Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-addsection&action=edit accesskey-addsection]<br> -[[MediaWiki_talk:Accesskey-addsection|Talk]] -</td><td> -+ -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-anontalk&action=edit accesskey-anontalk]<br> -[[MediaWiki_talk:Accesskey-anontalk|Talk]] -</td><td> -n -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-anonuserpage&action=edit accesskey-anonuserpage]<br> -[[MediaWiki_talk:Accesskey-anonuserpage|Talk]] -</td><td> -. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-article&action=edit accesskey-article]<br> -[[MediaWiki_talk:Accesskey-article|Talk]] -</td><td> -a -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-compareselectedversions&action=edit accesskey-compareselectedversions]<br> -[[MediaWiki_talk:Accesskey-compareselectedversions|Talk]] -</td><td> -v -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-contributions&action=edit accesskey-contributions]<br> -[[MediaWiki_talk:Accesskey-contributions|Talk]] -</td><td> -&amp;lt;accesskey-contributions&amp;gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-currentevents&action=edit accesskey-currentevents]<br> -[[MediaWiki_talk:Accesskey-currentevents|Talk]] -</td><td> -&amp;lt;accesskey-currentevents&amp;gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-delete&action=edit accesskey-delete]<br> -[[MediaWiki_talk:Accesskey-delete|Talk]] -</td><td> -d -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-edit&action=edit accesskey-edit]<br> -[[MediaWiki_talk:Accesskey-edit|Talk]] -</td><td> -e -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-emailuser&action=edit accesskey-emailuser]<br> -[[MediaWiki_talk:Accesskey-emailuser|Talk]] -</td><td> -&amp;lt;accesskey-emailuser&amp;gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-help&action=edit accesskey-help]<br> -[[MediaWiki_talk:Accesskey-help|Talk]] -</td><td> -&amp;lt;accesskey-help&amp;gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-history&action=edit accesskey-history]<br> -[[MediaWiki_talk:Accesskey-history|Talk]] -</td><td> -h -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-login&action=edit accesskey-login]<br> -[[MediaWiki_talk:Accesskey-login|Talk]] -</td><td> -o -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-logout&action=edit accesskey-logout]<br> -[[MediaWiki_talk:Accesskey-logout|Talk]] -</td><td> -o -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-mainpage&action=edit accesskey-mainpage]<br> -[[MediaWiki_talk:Accesskey-mainpage|Talk]] -</td><td> -z -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-minoredit&action=edit accesskey-minoredit]<br> -[[MediaWiki_talk:Accesskey-minoredit|Talk]] -</td><td> -i -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-move&action=edit accesskey-move]<br> -[[MediaWiki_talk:Accesskey-move|Talk]] -</td><td> -m -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-mycontris&action=edit accesskey-mycontris]<br> -[[MediaWiki_talk:Accesskey-mycontris|Talk]] -</td><td> -y -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-mytalk&action=edit accesskey-mytalk]<br> -[[MediaWiki_talk:Accesskey-mytalk|Talk]] -</td><td> -n -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-portal&action=edit accesskey-portal]<br> -[[MediaWiki_talk:Accesskey-portal|Talk]] -</td><td> -&amp;lt;accesskey-portal&amp;gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-preferences&action=edit accesskey-preferences]<br> -[[MediaWiki_talk:Accesskey-preferences|Talk]] -</td><td> -&amp;lt;accesskey-preferences&amp;gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-preview&action=edit accesskey-preview]<br> -[[MediaWiki_talk:Accesskey-preview|Talk]] -</td><td> -p -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-protect&action=edit accesskey-protect]<br> -[[MediaWiki_talk:Accesskey-protect|Talk]] -</td><td> -= -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-randompage&action=edit accesskey-randompage]<br> -[[MediaWiki_talk:Accesskey-randompage|Talk]] -</td><td> -x -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-recentchanges&action=edit accesskey-recentchanges]<br> -[[MediaWiki_talk:Accesskey-recentchanges|Talk]] -</td><td> -r -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-recentchangeslinked&action=edit accesskey-recentchangeslinked]<br> -[[MediaWiki_talk:Accesskey-recentchangeslinked|Talk]] -</td><td> -c -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-save&action=edit accesskey-save]<br> -[[MediaWiki_talk:Accesskey-save|Talk]] -</td><td> -s -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-search&action=edit accesskey-search]<br> -[[MediaWiki_talk:Accesskey-search|Talk]] -</td><td> -f -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-sitesupport&action=edit accesskey-sitesupport]<br> -[[MediaWiki_talk:Accesskey-sitesupport|Talk]] -</td><td> -&amp;lt;accesskey-sitesupport&amp;gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-specialpage&action=edit accesskey-specialpage]<br> -[[MediaWiki_talk:Accesskey-specialpage|Talk]] -</td><td> -&amp;lt;accesskey-specialpage&amp;gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-specialpages&action=edit accesskey-specialpages]<br> -[[MediaWiki_talk:Accesskey-specialpages|Talk]] -</td><td> -q -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-talk&action=edit accesskey-talk]<br> -[[MediaWiki_talk:Accesskey-talk|Talk]] -</td><td> -t -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-undelete&action=edit accesskey-undelete]<br> -[[MediaWiki_talk:Accesskey-undelete|Talk]] -</td><td> -d -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-unwatch&action=edit accesskey-unwatch]<br> -[[MediaWiki_talk:Accesskey-unwatch|Talk]] -</td><td> -w -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-upload&action=edit accesskey-upload]<br> -[[MediaWiki_talk:Accesskey-upload|Talk]] -</td><td> -u -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-userpage&action=edit accesskey-userpage]<br> -[[MediaWiki_talk:Accesskey-userpage|Talk]] -</td><td> -. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-viewsource&action=edit accesskey-viewsource]<br> -[[MediaWiki_talk:Accesskey-viewsource|Talk]] -</td><td> -e -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-watch&action=edit accesskey-watch]<br> -[[MediaWiki_talk:Accesskey-watch|Talk]] -</td><td> -w -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-watchlist&action=edit accesskey-watchlist]<br> -[[MediaWiki_talk:Accesskey-watchlist|Talk]] -</td><td> -l -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-whatlinkshere&action=edit accesskey-whatlinkshere]<br> -[[MediaWiki_talk:Accesskey-whatlinkshere|Talk]] -</td><td> -b -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accmailtext&action=edit accmailtext]<br> -[[MediaWiki_talk:Accmailtext|Talk]] -</td><td> -The Password for &#39;$1&#39; has been sent to $2. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accmailtitle&action=edit accmailtitle]<br> -[[MediaWiki_talk:Accmailtitle|Talk]] -</td><td> -Password sent. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Actioncomplete&action=edit actioncomplete]<br> -[[MediaWiki_talk:Actioncomplete|Talk]] -</td><td> -Action complete -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Addedwatch&action=edit addedwatch]<br> -[[MediaWiki_talk:Addedwatch|Talk]] -</td><td> -Added to watchlist -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Addedwatchtext&action=edit addedwatchtext]<br> -[[MediaWiki_talk:Addedwatchtext|Talk]] -</td><td> -The page &quot;$1&quot; has been added to your &#91;&#91;Special:Watchlist&#124;watchlist]]. -Future changes to this page and its associated Talk page will be listed there, -and the page will appear &#39;&#39;&#39;bolded&#39;&#39;&#39; in the &#91;&#91;Special:Recentchanges&#124;list of recent changes]] to -make it easier to pick out. - -&lt;p&gt;If you want to remove the page from your watchlist later, click &quot;Stop watching&quot; in the sidebar. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Addsection&action=edit addsection]<br> -[[MediaWiki_talk:Addsection|Talk]] -</td><td> -+ -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Administrators&action=edit administrators]<br> -[[MediaWiki_talk:Administrators|Talk]] -</td><td> -Wiktionary:Administrators -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Affirmation&action=edit affirmation]<br> -[[MediaWiki_talk:Affirmation|Talk]] -</td><td> -I affirm that the copyright holder of this file -agrees to license it under the terms of the $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:All&action=edit all]<br> -[[MediaWiki_talk:All|Talk]] -</td><td> -all -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Allmessages&action=edit allmessages]<br> -[[MediaWiki_talk:Allmessages|Talk]] -</td><td> -All system messages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Allmessagestext&action=edit allmessagestext]<br> -[[MediaWiki_talk:Allmessagestext|Talk]] -</td><td> -This is a list of all system messages available in the MediaWiki: namespace. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Allpages&action=edit allpages]<br> -[[MediaWiki_talk:Allpages|Talk]] -</td><td> -All pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Alphaindexline&action=edit alphaindexline]<br> -[[MediaWiki_talk:Alphaindexline|Talk]] -</td><td> -$1 to $2 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Alreadyloggedin&action=edit alreadyloggedin]<br> -[[MediaWiki_talk:Alreadyloggedin|Talk]] -</td><td> -&lt;font color=red&gt;&lt;b&gt;User $1, you are already logged in!&lt;/b&gt;&lt;/font&gt;&lt;br /&gt; - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Alreadyrolled&action=edit alreadyrolled]<br> -[[MediaWiki_talk:Alreadyrolled|Talk]] -</td><td> -Cannot rollback last edit of &#91;&#91;$1]] -by &#91;&#91;User:$2&#124;$2]] (&#91;&#91;User talk:$2&#124;Talk]]); someone else has edited or rolled back the page already. - -Last edit was by &#91;&#91;User:$3&#124;$3]] (&#91;&#91;User talk:$3&#124;Talk]]). -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ancientpages&action=edit ancientpages]<br> -[[MediaWiki_talk:Ancientpages|Talk]] -</td><td> -Oldest pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:And&action=edit and]<br> -[[MediaWiki_talk:And|Talk]] -</td><td> -and -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Anontalk&action=edit anontalk]<br> -[[MediaWiki_talk:Anontalk|Talk]] -</td><td> -Talk for this IP -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Anontalkpagetext&action=edit anontalkpagetext]<br> -[[MediaWiki_talk:Anontalkpagetext|Talk]] -</td><td> -----&#39;&#39;This is the discussion page for an anonymous user who has not created an account yet or who does not use it. We therefore have to use the numerical &#91;&#91;IP address]] to identify him/her. Such an IP address can be shared by several users. If you are an anonymous user and feel that irrelevant comments have been directed at you, please &#91;&#91;Special:Userlogin&#124;create an account or log in]] to avoid future confusion with other anonymous users.&#39;&#39; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Anonymous&action=edit anonymous]<br> -[[MediaWiki_talk:Anonymous|Talk]] -</td><td> -Anonymous user(s) of Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Article&action=edit article]<br> -[[MediaWiki_talk:Article|Talk]] -</td><td> -Content page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Articleexists&action=edit articleexists]<br> -[[MediaWiki_talk:Articleexists|Talk]] -</td><td> -A page of that name already exists, or the -name you have chosen is not valid. -Please choose another name. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Articlepage&action=edit articlepage]<br> -[[MediaWiki_talk:Articlepage|Talk]] -</td><td> -View content page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Asksql&action=edit asksql]<br> -[[MediaWiki_talk:Asksql|Talk]] -</td><td> -SQL query -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Asksqltext&action=edit asksqltext]<br> -[[MediaWiki_talk:Asksqltext|Talk]] -</td><td> -Use the form below to make a direct query of the -database. -Use single quotes (&#39;like this&#39;) to delimit string literals. -This can often add considerable load to the server, so please use -this function sparingly. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Autoblocker&action=edit autoblocker]<br> -[[MediaWiki_talk:Autoblocker|Talk]] -</td><td> -Autoblocked because you share an IP address with &quot;$1&quot;. Reason &quot;$2&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badarticleerror&action=edit badarticleerror]<br> -[[MediaWiki_talk:Badarticleerror|Talk]] -</td><td> -This action cannot be performed on this page. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badfilename&action=edit badfilename]<br> -[[MediaWiki_talk:Badfilename|Talk]] -</td><td> -Image name has been changed to &quot;$1&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badfiletype&action=edit badfiletype]<br> -[[MediaWiki_talk:Badfiletype|Talk]] -</td><td> -&quot;.$1&quot; is not a recommended image file format. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badipaddress&action=edit badipaddress]<br> -[[MediaWiki_talk:Badipaddress|Talk]] -</td><td> -Invalid IP address -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badquery&action=edit badquery]<br> -[[MediaWiki_talk:Badquery|Talk]] -</td><td> -Badly formed search query -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badquerytext&action=edit badquerytext]<br> -[[MediaWiki_talk:Badquerytext|Talk]] -</td><td> -We could not process your query. -This is probably because you have attempted to search for a -word fewer than three letters long, which is not yet supported. -It could also be that you have mistyped the expression, for -example &quot;fish and and scales&quot;. -Please try another query. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badretype&action=edit badretype]<br> -[[MediaWiki_talk:Badretype|Talk]] -</td><td> -The passwords you entered do not match. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badtitle&action=edit badtitle]<br> -[[MediaWiki_talk:Badtitle|Talk]] -</td><td> -Bad title -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badtitletext&action=edit badtitletext]<br> -[[MediaWiki_talk:Badtitletext|Talk]] -</td><td> -The requested page title was invalid, empty, or -an incorrectly linked inter-language or inter-wiki title. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blanknamespace&action=edit blanknamespace]<br> -[[MediaWiki_talk:Blanknamespace|Talk]] -</td><td> -(Main) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockedtext&action=edit blockedtext]<br> -[[MediaWiki_talk:Blockedtext|Talk]] -</td><td> -Your user name or IP address has been blocked by $1. -The reason given is this:&lt;br /&gt;&#39;&#39;$2&#39;&#39;&lt;p&gt;You may contact $1 or one of the other -&#91;&#91;Wiktionary:Administrators&#124;administrators]] to discuss the block. - -Note that you may not use the &quot;email this user&quot; feature unless you have a valid email address registered in your &#91;&#91;Special:Preferences&#124;user preferences]]. - -Your IP address is $3. Please include this address in any queries you make. - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockedtitle&action=edit blockedtitle]<br> -[[MediaWiki_talk:Blockedtitle|Talk]] -</td><td> -User is blocked -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockip&action=edit blockip]<br> -[[MediaWiki_talk:Blockip|Talk]] -</td><td> -Block user -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockipsuccesssub&action=edit blockipsuccesssub]<br> -[[MediaWiki_talk:Blockipsuccesssub|Talk]] -</td><td> -Block succeeded -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockipsuccesstext&action=edit blockipsuccesstext]<br> -[[MediaWiki_talk:Blockipsuccesstext|Talk]] -</td><td> -&quot;$1&quot; has been blocked. -&lt;br /&gt;See &#91;&#91;Special:Ipblocklist&#124;IP block list]] to review blocks. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockiptext&action=edit blockiptext]<br> -[[MediaWiki_talk:Blockiptext|Talk]] -</td><td> -Use the form below to block write access -from a specific IP address or username. -This should be done only only to prevent vandalism, and in -accordance with &#91;&#91;Wiktionary:Policy&#124;policy]]. -Fill in a specific reason below (for example, citing particular -pages that were vandalized). -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklink&action=edit blocklink]<br> -[[MediaWiki_talk:Blocklink|Talk]] -</td><td> -block -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklistline&action=edit blocklistline]<br> -[[MediaWiki_talk:Blocklistline|Talk]] -</td><td> -$1, $2 blocked $3 (expires $4) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklogentry&action=edit blocklogentry]<br> -[[MediaWiki_talk:Blocklogentry|Talk]] -</td><td> -blocked &quot;$1&quot; with an expiry time of $2 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklogpage&action=edit blocklogpage]<br> -[[MediaWiki_talk:Blocklogpage|Talk]] -</td><td> -Block_log -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklogtext&action=edit blocklogtext]<br> -[[MediaWiki_talk:Blocklogtext|Talk]] -</td><td> -This is a log of user blocking and unblocking actions. Automatically -blocked IP addresses are not be listed. See the &#91;&#91;Special:Ipblocklist&#124;IP block list]] for -the list of currently operational bans and blocks. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bold_sample&action=edit bold_sample]<br> -[[MediaWiki_talk:Bold_sample|Talk]] -</td><td> -Bold text -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bold_tip&action=edit bold_tip]<br> -[[MediaWiki_talk:Bold_tip|Talk]] -</td><td> -Bold text -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Booksources&action=edit booksources]<br> -[[MediaWiki_talk:Booksources|Talk]] -</td><td> -Book sources -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Booksourcetext&action=edit booksourcetext]<br> -[[MediaWiki_talk:Booksourcetext|Talk]] -</td><td> -Below is a list of links to other sites that -sell new and used books, and may also have further information -about books you are looking for.Wiktionary is not affiliated with any of these businesses, and -this list should not be construed as an endorsement. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Brokenredirects&action=edit brokenredirects]<br> -[[MediaWiki_talk:Brokenredirects|Talk]] -</td><td> -Broken Redirects -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Brokenredirectstext&action=edit brokenredirectstext]<br> -[[MediaWiki_talk:Brokenredirectstext|Talk]] -</td><td> -The following redirects link to a non-existing pages. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bugreports&action=edit bugreports]<br> -[[MediaWiki_talk:Bugreports|Talk]] -</td><td> -Bug reports -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bugreportspage&action=edit bugreportspage]<br> -[[MediaWiki_talk:Bugreportspage|Talk]] -</td><td> -Wiktionary:Bug_reports -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bureaucratlog&action=edit bureaucratlog]<br> -[[MediaWiki_talk:Bureaucratlog|Talk]] -</td><td> -Bureaucrat_log -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bureaucratlogentry&action=edit bureaucratlogentry]<br> -[[MediaWiki_talk:Bureaucratlogentry|Talk]] -</td><td> -Rights for user &quot;$1&quot; set &quot;$2&quot; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bureaucrattext&action=edit bureaucrattext]<br> -[[MediaWiki_talk:Bureaucrattext|Talk]] -</td><td> -The action you have requested can only be -performed by sysops with &quot;bureaucrat&quot; status. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bureaucrattitle&action=edit bureaucrattitle]<br> -[[MediaWiki_talk:Bureaucrattitle|Talk]] -</td><td> -Bureaucrat access required -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bydate&action=edit bydate]<br> -[[MediaWiki_talk:Bydate|Talk]] -</td><td> -by date -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Byname&action=edit byname]<br> -[[MediaWiki_talk:Byname|Talk]] -</td><td> -by name -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bysize&action=edit bysize]<br> -[[MediaWiki_talk:Bysize|Talk]] -</td><td> -by size -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cachederror&action=edit cachederror]<br> -[[MediaWiki_talk:Cachederror|Talk]] -</td><td> -The following is a cached copy of the requested page, and may not be up to date. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cancel&action=edit cancel]<br> -[[MediaWiki_talk:Cancel|Talk]] -</td><td> -Cancel -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cannotdelete&action=edit cannotdelete]<br> -[[MediaWiki_talk:Cannotdelete|Talk]] -</td><td> -Could not delete the page or image specified. (It may have already been deleted by someone else.) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cantrollback&action=edit cantrollback]<br> -[[MediaWiki_talk:Cantrollback|Talk]] -</td><td> -Cannot revert edit; last contributor is only author of this page. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Categories&action=edit categories]<br> -[[MediaWiki_talk:Categories|Talk]] -</td><td> -Categories -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Category&action=edit category]<br> -[[MediaWiki_talk:Category|Talk]] -</td><td> -category -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Category_header&action=edit category_header]<br> -[[MediaWiki_talk:Category_header|Talk]] -</td><td> -Articles in category &quot;$1&quot; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Changepassword&action=edit changepassword]<br> -[[MediaWiki_talk:Changepassword|Talk]] -</td><td> -Change password -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Changes&action=edit changes]<br> -[[MediaWiki_talk:Changes|Talk]] -</td><td> -changes -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Columns&action=edit columns]<br> -[[MediaWiki_talk:Columns|Talk]] -</td><td> -Columns -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Commentedit&action=edit commentedit]<br> -[[MediaWiki_talk:Commentedit|Talk]] -</td><td> - (comment) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Compareselectedversions&action=edit compareselectedversions]<br> -[[MediaWiki_talk:Compareselectedversions|Talk]] -</td><td> -Compare selected versions -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirm&action=edit confirm]<br> -[[MediaWiki_talk:Confirm|Talk]] -</td><td> -Confirm -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmcheck&action=edit confirmcheck]<br> -[[MediaWiki_talk:Confirmcheck|Talk]] -</td><td> -Yes, I really want to delete this. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmdelete&action=edit confirmdelete]<br> -[[MediaWiki_talk:Confirmdelete|Talk]] -</td><td> -Confirm delete -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmdeletetext&action=edit confirmdeletetext]<br> -[[MediaWiki_talk:Confirmdeletetext|Talk]] -</td><td> -You are about to permanently delete a page -or image along with all of its history from the database. -Please confirm that you intend to do this, that you understand the -consequences, and that you are doing this in accordance with -&#91;&#91;Wiktionary:Policy]]. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmprotect&action=edit confirmprotect]<br> -[[MediaWiki_talk:Confirmprotect|Talk]] -</td><td> -Confirm protection -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmprotecttext&action=edit confirmprotecttext]<br> -[[MediaWiki_talk:Confirmprotecttext|Talk]] -</td><td> -Do you really want to protect this page? -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmunprotect&action=edit confirmunprotect]<br> -[[MediaWiki_talk:Confirmunprotect|Talk]] -</td><td> -Confirm unprotection -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmunprotecttext&action=edit confirmunprotecttext]<br> -[[MediaWiki_talk:Confirmunprotecttext|Talk]] -</td><td> -Do you really want to unprotect this page? -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contextchars&action=edit contextchars]<br> -[[MediaWiki_talk:Contextchars|Talk]] -</td><td> -Characters of context per line -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contextlines&action=edit contextlines]<br> -[[MediaWiki_talk:Contextlines|Talk]] -</td><td> -Lines to show per hit -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contribslink&action=edit contribslink]<br> -[[MediaWiki_talk:Contribslink|Talk]] -</td><td> -contribs -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contribsub&action=edit contribsub]<br> -[[MediaWiki_talk:Contribsub|Talk]] -</td><td> -For $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contributions&action=edit contributions]<br> -[[MediaWiki_talk:Contributions|Talk]] -</td><td> -User contributions -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Copyright&action=edit copyright]<br> -[[MediaWiki_talk:Copyright|Talk]] -</td><td> -Content is available under $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Copyrightpage&action=edit copyrightpage]<br> -[[MediaWiki_talk:Copyrightpage|Talk]] -</td><td> -Wiktionary:Copyrights -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Copyrightpagename&action=edit copyrightpagename]<br> -[[MediaWiki_talk:Copyrightpagename|Talk]] -</td><td> -Wiktionary copyright -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Copyrightwarning&action=edit copyrightwarning]<br> -[[MediaWiki_talk:Copyrightwarning|Talk]] -</td><td> -Please note that all contributions to Wiktionary are -considered to be released under the GNU Free Documentation License -(see $1 for details). -If you don&#39;t want your writing to be edited mercilessly and redistributed -at will, then don&#39;t submit it here.&lt;br /&gt; -You are also promising us that you wrote this yourself, or copied it from a -public domain or similar free resource. -&lt;strong&gt;DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!&lt;/strong&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Couldntremove&action=edit couldntremove]<br> -[[MediaWiki_talk:Couldntremove|Talk]] -</td><td> -Couldn&#39;t remove item &#39;$1&#39;... -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Createaccount&action=edit createaccount]<br> -[[MediaWiki_talk:Createaccount|Talk]] -</td><td> -Create new account -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Createaccountmail&action=edit createaccountmail]<br> -[[MediaWiki_talk:Createaccountmail|Talk]] -</td><td> -by email -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cur&action=edit cur]<br> -[[MediaWiki_talk:Cur|Talk]] -</td><td> -cur -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Currentevents&action=edit currentevents]<br> -[[MediaWiki_talk:Currentevents|Talk]] -</td><td> -Current events -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Currentrev&action=edit currentrev]<br> -[[MediaWiki_talk:Currentrev|Talk]] -</td><td> -Current revision -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Databaseerror&action=edit databaseerror]<br> -[[MediaWiki_talk:Databaseerror|Talk]] -</td><td> -Database error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dateformat&action=edit dateformat]<br> -[[MediaWiki_talk:Dateformat|Talk]] -</td><td> -Date format -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dberrortext&action=edit dberrortext]<br> -[[MediaWiki_talk:Dberrortext|Talk]] -</td><td> -A database query syntax error has occurred. -This could be because of an illegal search query (see $5), -or it may indicate a bug in the software. -The last attempted database query was: -&lt;blockquote&gt;&lt;tt&gt;$1&lt;/tt&gt;&lt;/blockquote&gt; -from within function &quot;&lt;tt&gt;$2&lt;/tt&gt;&quot;. -MySQL returned error &quot;&lt;tt&gt;$3: $4&lt;/tt&gt;&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dberrortextcl&action=edit dberrortextcl]<br> -[[MediaWiki_talk:Dberrortextcl|Talk]] -</td><td> -A database query syntax error has occurred. -The last attempted database query was: -&quot;$1&quot; -from within function &quot;$2&quot;. -MySQL returned error &quot;$3: $4&quot;. - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deadendpages&action=edit deadendpages]<br> -[[MediaWiki_talk:Deadendpages|Talk]] -</td><td> -Dead-end pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Debug&action=edit debug]<br> -[[MediaWiki_talk:Debug|Talk]] -</td><td> -Debug -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Defaultns&action=edit defaultns]<br> -[[MediaWiki_talk:Defaultns|Talk]] -</td><td> -Search in these namespaces by default: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Defemailsubject&action=edit defemailsubject]<br> -[[MediaWiki_talk:Defemailsubject|Talk]] -</td><td> -Wiktionary e-mail -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Delete&action=edit delete]<br> -[[MediaWiki_talk:Delete|Talk]] -</td><td> -Delete -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletecomment&action=edit deletecomment]<br> -[[MediaWiki_talk:Deletecomment|Talk]] -</td><td> -Reason for deletion -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletedarticle&action=edit deletedarticle]<br> -[[MediaWiki_talk:Deletedarticle|Talk]] -</td><td> -deleted &quot;$1&quot; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletedtext&action=edit deletedtext]<br> -[[MediaWiki_talk:Deletedtext|Talk]] -</td><td> -&quot;$1&quot; has been deleted. -See $2 for a record of recent deletions. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deleteimg&action=edit deleteimg]<br> -[[MediaWiki_talk:Deleteimg|Talk]] -</td><td> -del -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletepage&action=edit deletepage]<br> -[[MediaWiki_talk:Deletepage|Talk]] -</td><td> -Delete page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletesub&action=edit deletesub]<br> -[[MediaWiki_talk:Deletesub|Talk]] -</td><td> -(Deleting &quot;$1&quot;) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletethispage&action=edit deletethispage]<br> -[[MediaWiki_talk:Deletethispage|Talk]] -</td><td> -Delete this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletionlog&action=edit deletionlog]<br> -[[MediaWiki_talk:Deletionlog|Talk]] -</td><td> -deletion log -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dellogpage&action=edit dellogpage]<br> -[[MediaWiki_talk:Dellogpage|Talk]] -</td><td> -Deletion_log -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dellogpagetext&action=edit dellogpagetext]<br> -[[MediaWiki_talk:Dellogpagetext|Talk]] -</td><td> -Below is a list of the most recent deletions. -All times shown are server time (UTC). -&lt;ul&gt; -&lt;/ul&gt; - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Developerspheading&action=edit developerspheading]<br> -[[MediaWiki_talk:Developerspheading|Talk]] -</td><td> -For developer use only -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Developertext&action=edit developertext]<br> -[[MediaWiki_talk:Developertext|Talk]] -</td><td> -The action you have requested can only be -performed by users with &quot;developer&quot; status. -See $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Developertitle&action=edit developertitle]<br> -[[MediaWiki_talk:Developertitle|Talk]] -</td><td> -Developer access required -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Diff&action=edit diff]<br> -[[MediaWiki_talk:Diff|Talk]] -</td><td> -diff -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Difference&action=edit difference]<br> -[[MediaWiki_talk:Difference|Talk]] -</td><td> -(Difference between revisions) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Disclaimerpage&action=edit disclaimerpage]<br> -[[MediaWiki_talk:Disclaimerpage|Talk]] -</td><td> -Wiktionary:General_disclaimer -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Disclaimers&action=edit disclaimers]<br> -[[MediaWiki_talk:Disclaimers|Talk]] -</td><td> -Disclaimers -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Doubleredirects&action=edit doubleredirects]<br> -[[MediaWiki_talk:Doubleredirects|Talk]] -</td><td> -Double Redirects -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Doubleredirectstext&action=edit doubleredirectstext]<br> -[[MediaWiki_talk:Doubleredirectstext|Talk]] -</td><td> -&lt;b&gt;Attention:&lt;/b&gt; This list may contain false positives. That usually means there is additional text with links below the first #REDIRECT.&lt;br /&gt; -Each row contains links to the first and second redirect, as well as the first line of the second redirect text, usually giving the &quot;real&quot; target page, which the first redirect should point to. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Edit&action=edit edit]<br> -[[MediaWiki_talk:Edit|Talk]] -</td><td> -Edit -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editcomment&action=edit editcomment]<br> -[[MediaWiki_talk:Editcomment|Talk]] -</td><td> -The edit comment was: &quot;&lt;i&gt;$1&lt;/i&gt;&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editconflict&action=edit editconflict]<br> -[[MediaWiki_talk:Editconflict|Talk]] -</td><td> -Edit conflict: $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editcurrent&action=edit editcurrent]<br> -[[MediaWiki_talk:Editcurrent|Talk]] -</td><td> -Edit the current version of this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Edithelp&action=edit edithelp]<br> -[[MediaWiki_talk:Edithelp|Talk]] -</td><td> -Editing help -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Edithelppage&action=edit edithelppage]<br> -[[MediaWiki_talk:Edithelppage|Talk]] -</td><td> -Help:Editing -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editing&action=edit editing]<br> -[[MediaWiki_talk:Editing|Talk]] -</td><td> -Editing $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editingold&action=edit editingold]<br> -[[MediaWiki_talk:Editingold|Talk]] -</td><td> -&lt;strong&gt;WARNING: You are editing an out-of-date -revision of this page. -If you save it, any changes made since this revision will be lost.&lt;/strong&gt; - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editsection&action=edit editsection]<br> -[[MediaWiki_talk:Editsection|Talk]] -</td><td> -edit -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editthispage&action=edit editthispage]<br> -[[MediaWiki_talk:Editthispage|Talk]] -</td><td> -Edit this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailflag&action=edit emailflag]<br> -[[MediaWiki_talk:Emailflag|Talk]] -</td><td> -Disable e-mail from other users -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailforlost&action=edit emailforlost]<br> -[[MediaWiki_talk:Emailforlost|Talk]] -</td><td> -Fields marked with a star (*) are optional. Storing an email address enables people to contact you through the website without you having to reveal your -email address to them, and it can be used to send you a new password if you forget it.&lt;br /&gt;&lt;br /&gt;Your real name, if you choose to provide it, will be used for giving you attribution for your work. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailfrom&action=edit emailfrom]<br> -[[MediaWiki_talk:Emailfrom|Talk]] -</td><td> -From -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailmessage&action=edit emailmessage]<br> -[[MediaWiki_talk:Emailmessage|Talk]] -</td><td> -Message -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailpage&action=edit emailpage]<br> -[[MediaWiki_talk:Emailpage|Talk]] -</td><td> -E-mail user -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailpagetext&action=edit emailpagetext]<br> -[[MediaWiki_talk:Emailpagetext|Talk]] -</td><td> -If this user has entered a valid e-mail address in -his or her user preferences, the form below will send a single message. -The e-mail address you entered in your user preferences will appear -as the &quot;From&quot; address of the mail, so the recipient will be able -to reply. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailsend&action=edit emailsend]<br> -[[MediaWiki_talk:Emailsend|Talk]] -</td><td> -Send -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailsent&action=edit emailsent]<br> -[[MediaWiki_talk:Emailsent|Talk]] -</td><td> -E-mail sent -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailsenttext&action=edit emailsenttext]<br> -[[MediaWiki_talk:Emailsenttext|Talk]] -</td><td> -Your e-mail message has been sent. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailsubject&action=edit emailsubject]<br> -[[MediaWiki_talk:Emailsubject|Talk]] -</td><td> -Subject -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailto&action=edit emailto]<br> -[[MediaWiki_talk:Emailto|Talk]] -</td><td> -To -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailuser&action=edit emailuser]<br> -[[MediaWiki_talk:Emailuser|Talk]] -</td><td> -E-mail this user -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Enterlockreason&action=edit enterlockreason]<br> -[[MediaWiki_talk:Enterlockreason|Talk]] -</td><td> -Enter a reason for the lock, including an estimate -of when the lock will be released -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Error&action=edit error]<br> -[[MediaWiki_talk:Error|Talk]] -</td><td> -Error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Errorpagetitle&action=edit errorpagetitle]<br> -[[MediaWiki_talk:Errorpagetitle|Talk]] -</td><td> -Error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Exbeforeblank&action=edit exbeforeblank]<br> -[[MediaWiki_talk:Exbeforeblank|Talk]] -</td><td> -content before blanking was: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Exblank&action=edit exblank]<br> -[[MediaWiki_talk:Exblank|Talk]] -</td><td> -page was empty -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Excontent&action=edit excontent]<br> -[[MediaWiki_talk:Excontent|Talk]] -</td><td> -content was: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Explainconflict&action=edit explainconflict]<br> -[[MediaWiki_talk:Explainconflict|Talk]] -</td><td> -Someone else has changed this page since you -started editing it. -The upper text area contains the page text as it currently exists. -Your changes are shown in the lower text area. -You will have to merge your changes into the existing text. -&lt;b&gt;Only&lt;/b&gt; the text in the upper text area will be saved when you -press &quot;Save page&quot;. -&lt;p&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Export&action=edit export]<br> -[[MediaWiki_talk:Export|Talk]] -</td><td> -Export pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Exportcuronly&action=edit exportcuronly]<br> -[[MediaWiki_talk:Exportcuronly|Talk]] -</td><td> -Include only the current revision, not the full history -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Exporttext&action=edit exporttext]<br> -[[MediaWiki_talk:Exporttext|Talk]] -</td><td> -You can export the text and editing history of a particular -page or set of pages wrapped in some XML; this can then be imported into another -wiki running MediaWiki software, transformed, or just kept for your private -amusement. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Extlink_sample&action=edit extlink_sample]<br> -[[MediaWiki_talk:Extlink_sample|Talk]] -</td><td> -http&#58;//www.example.com link title -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Extlink_tip&action=edit extlink_tip]<br> -[[MediaWiki_talk:Extlink_tip|Talk]] -</td><td> -External link (remember http&#58;// prefix) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Faq&action=edit faq]<br> -[[MediaWiki_talk:Faq|Talk]] -</td><td> -FAQ -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Faqpage&action=edit faqpage]<br> -[[MediaWiki_talk:Faqpage|Talk]] -</td><td> -Wiktionary:FAQ -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Feedlinks&action=edit feedlinks]<br> -[[MediaWiki_talk:Feedlinks|Talk]] -</td><td> -Feed: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filecopyerror&action=edit filecopyerror]<br> -[[MediaWiki_talk:Filecopyerror|Talk]] -</td><td> -Could not copy file &quot;$1&quot; to &quot;$2&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filedeleteerror&action=edit filedeleteerror]<br> -[[MediaWiki_talk:Filedeleteerror|Talk]] -</td><td> -Could not delete file &quot;$1&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filedesc&action=edit filedesc]<br> -[[MediaWiki_talk:Filedesc|Talk]] -</td><td> -Summary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filename&action=edit filename]<br> -[[MediaWiki_talk:Filename|Talk]] -</td><td> -Filename -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filenotfound&action=edit filenotfound]<br> -[[MediaWiki_talk:Filenotfound|Talk]] -</td><td> -Could not find file &quot;$1&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filerenameerror&action=edit filerenameerror]<br> -[[MediaWiki_talk:Filerenameerror|Talk]] -</td><td> -Could not rename file &quot;$1&quot; to &quot;$2&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filesource&action=edit filesource]<br> -[[MediaWiki_talk:Filesource|Talk]] -</td><td> -Source -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filestatus&action=edit filestatus]<br> -[[MediaWiki_talk:Filestatus|Talk]] -</td><td> -Copyright status -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Fileuploaded&action=edit fileuploaded]<br> -[[MediaWiki_talk:Fileuploaded|Talk]] -</td><td> -File &quot;$1&quot; uploaded successfully. -Please follow this link: $2 to the description page and fill -in information about the file, such as where it came from, when it was -created and by whom, and anything else you may know about it. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Formerror&action=edit formerror]<br> -[[MediaWiki_talk:Formerror|Talk]] -</td><td> -Error: could not submit form -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Fromwikipedia&action=edit fromwikipedia]<br> -[[MediaWiki_talk:Fromwikipedia|Talk]] -</td><td> -From Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Getimagelist&action=edit getimagelist]<br> -[[MediaWiki_talk:Getimagelist|Talk]] -</td><td> -fetching image list -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Go&action=edit go]<br> -[[MediaWiki_talk:Go|Talk]] -</td><td> -Go -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Googlesearch&action=edit googlesearch]<br> -[[MediaWiki_talk:Googlesearch|Talk]] -</td><td> - -&lt;!-- SiteSearch Google --&gt; -&lt;FORM method=GET action=&quot;http&#58;//www.google.com/search&quot;&gt; -&lt;TABLE bgcolor=&quot;#FFFFFF&quot;&gt;&lt;tr&gt;&lt;td&gt; -&lt;A HREF=&quot;http&#58;//www.google.com/&quot;&gt; -&lt;IMG SRC=&quot;http&#58;//www.google.com/logos/Logo_40wht.gif&quot; -border=&quot;0&quot; ALT=&quot;Google&quot;&gt;&lt;/A&gt; -&lt;/td&gt; -&lt;td&gt; -&lt;INPUT TYPE=text name=q size=31 maxlength=255 value=&quot;$1&quot;&gt; -&lt;INPUT type=submit name=btnG VALUE=&quot;Google Search&quot;&gt; -&lt;font size=-1&gt; -&lt;input type=hidden name=domains value=&quot;http&#58;//tl.wiktionary.org&quot;&gt;&lt;br /&gt;&lt;input type=radio name=sitesearch value=&quot;&quot;&gt; WWW &lt;input type=radio name=sitesearch value=&quot;http&#58;//tl.wiktionary.org&quot; checked&gt; http&#58;//tl.wiktionary.org &lt;br /&gt; -&lt;input type=&#39;hidden&#39; name=&#39;ie&#39; value=&#39;$2&#39;&gt; -&lt;input type=&#39;hidden&#39; name=&#39;oe&#39; value=&#39;$2&#39;&gt; -&lt;/font&gt; -&lt;/td&gt;&lt;/tr&gt;&lt;/TABLE&gt; -&lt;/FORM&gt; -&lt;!-- SiteSearch Google --&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Guesstimezone&action=edit guesstimezone]<br> -[[MediaWiki_talk:Guesstimezone|Talk]] -</td><td> -Fill in from browser -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Headline_sample&action=edit headline_sample]<br> -[[MediaWiki_talk:Headline_sample|Talk]] -</td><td> -Headline text -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Headline_tip&action=edit headline_tip]<br> -[[MediaWiki_talk:Headline_tip|Talk]] -</td><td> -Level 2 headline -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Help&action=edit help]<br> -[[MediaWiki_talk:Help|Talk]] -</td><td> -Help -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Helppage&action=edit helppage]<br> -[[MediaWiki_talk:Helppage|Talk]] -</td><td> -Help:Contents -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Hide&action=edit hide]<br> -[[MediaWiki_talk:Hide|Talk]] -</td><td> -hide -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Hidetoc&action=edit hidetoc]<br> -[[MediaWiki_talk:Hidetoc|Talk]] -</td><td> -hide -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Hist&action=edit hist]<br> -[[MediaWiki_talk:Hist|Talk]] -</td><td> -hist -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Histlegend&action=edit histlegend]<br> -[[MediaWiki_talk:Histlegend|Talk]] -</td><td> -Diff selection: mark the radio boxes of the versions to compare and hit enter or the button at the bottom.&lt;br/&gt; -Legend: (cur) = difference with current version, -(last) = difference with preceding version, M = minor edit. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:History&action=edit history]<br> -[[MediaWiki_talk:History|Talk]] -</td><td> -Page history -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:History_short&action=edit history_short]<br> -[[MediaWiki_talk:History_short|Talk]] -</td><td> -History -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Historywarning&action=edit historywarning]<br> -[[MediaWiki_talk:Historywarning|Talk]] -</td><td> -Warning: The page you are about to delete has a history: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Hr_tip&action=edit hr_tip]<br> -[[MediaWiki_talk:Hr_tip|Talk]] -</td><td> -Horizontal line (use sparingly) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ignorewarning&action=edit ignorewarning]<br> -[[MediaWiki_talk:Ignorewarning|Talk]] -</td><td> -Ignore warning and save file anyway. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ilshowmatch&action=edit ilshowmatch]<br> -[[MediaWiki_talk:Ilshowmatch|Talk]] -</td><td> -Show all images with names matching -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ilsubmit&action=edit ilsubmit]<br> -[[MediaWiki_talk:Ilsubmit|Talk]] -</td><td> -Search -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Image_sample&action=edit image_sample]<br> -[[MediaWiki_talk:Image_sample|Talk]] -</td><td> -Example.jpg -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Image_tip&action=edit image_tip]<br> -[[MediaWiki_talk:Image_tip|Talk]] -</td><td> -Embedded image -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagelinks&action=edit imagelinks]<br> -[[MediaWiki_talk:Imagelinks|Talk]] -</td><td> -Image links -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagelist&action=edit imagelist]<br> -[[MediaWiki_talk:Imagelist|Talk]] -</td><td> -Image list -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagelisttext&action=edit imagelisttext]<br> -[[MediaWiki_talk:Imagelisttext|Talk]] -</td><td> -Below is a list of $1 images sorted $2. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagepage&action=edit imagepage]<br> -[[MediaWiki_talk:Imagepage|Talk]] -</td><td> -View image page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagereverted&action=edit imagereverted]<br> -[[MediaWiki_talk:Imagereverted|Talk]] -</td><td> -Revert to earlier version was successful. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imgdelete&action=edit imgdelete]<br> -[[MediaWiki_talk:Imgdelete|Talk]] -</td><td> -del -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imgdesc&action=edit imgdesc]<br> -[[MediaWiki_talk:Imgdesc|Talk]] -</td><td> -desc -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imghistlegend&action=edit imghistlegend]<br> -[[MediaWiki_talk:Imghistlegend|Talk]] -</td><td> -Legend: (cur) = this is the current image, (del) = delete -this old version, (rev) = revert to this old version. -&lt;br /&gt;&lt;i&gt;Click on date to see image uploaded on that date&lt;/i&gt;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imghistory&action=edit imghistory]<br> -[[MediaWiki_talk:Imghistory|Talk]] -</td><td> -Image history -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imglegend&action=edit imglegend]<br> -[[MediaWiki_talk:Imglegend|Talk]] -</td><td> -Legend: (desc) = show/edit image description. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Import&action=edit import]<br> -[[MediaWiki_talk:Import|Talk]] -</td><td> -Import pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importfailed&action=edit importfailed]<br> -[[MediaWiki_talk:Importfailed|Talk]] -</td><td> -Import failed: $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importhistoryconflict&action=edit importhistoryconflict]<br> -[[MediaWiki_talk:Importhistoryconflict|Talk]] -</td><td> -Conflicting history revision exists (may have imported this page before) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importnotext&action=edit importnotext]<br> -[[MediaWiki_talk:Importnotext|Talk]] -</td><td> -Empty or no text -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importsuccess&action=edit importsuccess]<br> -[[MediaWiki_talk:Importsuccess|Talk]] -</td><td> -Import succeeded! -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importtext&action=edit importtext]<br> -[[MediaWiki_talk:Importtext|Talk]] -</td><td> -Please export the file from the source wiki using the Special:Export utility, save it to your disk and upload it here. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Infobox&action=edit infobox]<br> -[[MediaWiki_talk:Infobox|Talk]] -</td><td> -Click a button to get an example text -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Infobox_alert&action=edit infobox_alert]<br> -[[MediaWiki_talk:Infobox_alert|Talk]] -</td><td> -Please enter the text you want to be formatted.\n It will be shown in the infobox for copy and pasting.\nExample:\n$1\nwill become:\n$2 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Internalerror&action=edit internalerror]<br> -[[MediaWiki_talk:Internalerror|Talk]] -</td><td> -Internal error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Intl&action=edit intl]<br> -[[MediaWiki_talk:Intl|Talk]] -</td><td> -Interlanguage links -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ip_range_invalid&action=edit ip_range_invalid]<br> -[[MediaWiki_talk:Ip_range_invalid|Talk]] -</td><td> -Invalid IP range. - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipaddress&action=edit ipaddress]<br> -[[MediaWiki_talk:Ipaddress|Talk]] -</td><td> -IP Address/username -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipb_expiry_invalid&action=edit ipb_expiry_invalid]<br> -[[MediaWiki_talk:Ipb_expiry_invalid|Talk]] -</td><td> -Expiry time invalid. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipbexpiry&action=edit ipbexpiry]<br> -[[MediaWiki_talk:Ipbexpiry|Talk]] -</td><td> -Expiry -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipblocklist&action=edit ipblocklist]<br> -[[MediaWiki_talk:Ipblocklist|Talk]] -</td><td> -List of blocked IP addresses and usernames -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipbreason&action=edit ipbreason]<br> -[[MediaWiki_talk:Ipbreason|Talk]] -</td><td> -Reason -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipbsubmit&action=edit ipbsubmit]<br> -[[MediaWiki_talk:Ipbsubmit|Talk]] -</td><td> -Block this user -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipusubmit&action=edit ipusubmit]<br> -[[MediaWiki_talk:Ipusubmit|Talk]] -</td><td> -Unblock this address -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipusuccess&action=edit ipusuccess]<br> -[[MediaWiki_talk:Ipusuccess|Talk]] -</td><td> -&quot;$1&quot; unblocked -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Isbn&action=edit isbn]<br> -[[MediaWiki_talk:Isbn|Talk]] -</td><td> -ISBN -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Isredirect&action=edit isredirect]<br> -[[MediaWiki_talk:Isredirect|Talk]] -</td><td> -redirect page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Italic_sample&action=edit italic_sample]<br> -[[MediaWiki_talk:Italic_sample|Talk]] -</td><td> -Italic text -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Italic_tip&action=edit italic_tip]<br> -[[MediaWiki_talk:Italic_tip|Talk]] -</td><td> -Italic text -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Iteminvalidname&action=edit iteminvalidname]<br> -[[MediaWiki_talk:Iteminvalidname|Talk]] -</td><td> -Problem with item &#39;$1&#39;, invalid name... -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Largefile&action=edit largefile]<br> -[[MediaWiki_talk:Largefile|Talk]] -</td><td> -It is recommended that images not exceed 100k in size. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Last&action=edit last]<br> -[[MediaWiki_talk:Last|Talk]] -</td><td> -last -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lastmodified&action=edit lastmodified]<br> -[[MediaWiki_talk:Lastmodified|Talk]] -</td><td> -This page was last modified $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lastmodifiedby&action=edit lastmodifiedby]<br> -[[MediaWiki_talk:Lastmodifiedby|Talk]] -</td><td> -This page was last modified $1 by $2. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lineno&action=edit lineno]<br> -[[MediaWiki_talk:Lineno|Talk]] -</td><td> -Line $1: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Link_sample&action=edit link_sample]<br> -[[MediaWiki_talk:Link_sample|Talk]] -</td><td> -Link title -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Link_tip&action=edit link_tip]<br> -[[MediaWiki_talk:Link_tip|Talk]] -</td><td> -Internal link -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Linklistsub&action=edit linklistsub]<br> -[[MediaWiki_talk:Linklistsub|Talk]] -</td><td> -(List of links) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Linkshere&action=edit linkshere]<br> -[[MediaWiki_talk:Linkshere|Talk]] -</td><td> -The following pages link to here: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Linkstoimage&action=edit linkstoimage]<br> -[[MediaWiki_talk:Linkstoimage|Talk]] -</td><td> -The following pages link to this image: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Linktrail&action=edit linktrail]<br> -[[MediaWiki_talk:Linktrail|Talk]] -</td><td> -/^(&#91;a-z]+)(.*)$/sD -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Listform&action=edit listform]<br> -[[MediaWiki_talk:Listform|Talk]] -</td><td> -list -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Listusers&action=edit listusers]<br> -[[MediaWiki_talk:Listusers|Talk]] -</td><td> -User list -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loadhist&action=edit loadhist]<br> -[[MediaWiki_talk:Loadhist|Talk]] -</td><td> -Loading page history -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loadingrev&action=edit loadingrev]<br> -[[MediaWiki_talk:Loadingrev|Talk]] -</td><td> -loading revision for diff -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Localtime&action=edit localtime]<br> -[[MediaWiki_talk:Localtime|Talk]] -</td><td> -Local time display -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockbtn&action=edit lockbtn]<br> -[[MediaWiki_talk:Lockbtn|Talk]] -</td><td> -Lock database -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockconfirm&action=edit lockconfirm]<br> -[[MediaWiki_talk:Lockconfirm|Talk]] -</td><td> -Yes, I really want to lock the database. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockdb&action=edit lockdb]<br> -[[MediaWiki_talk:Lockdb|Talk]] -</td><td> -Lock database -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockdbsuccesssub&action=edit lockdbsuccesssub]<br> -[[MediaWiki_talk:Lockdbsuccesssub|Talk]] -</td><td> -Database lock succeeded -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockdbsuccesstext&action=edit lockdbsuccesstext]<br> -[[MediaWiki_talk:Lockdbsuccesstext|Talk]] -</td><td> -The database has been locked. -&lt;br /&gt;Remember to remove the lock after your maintenance is complete. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockdbtext&action=edit lockdbtext]<br> -[[MediaWiki_talk:Lockdbtext|Talk]] -</td><td> -Locking the database will suspend the ability of all -users to edit pages, change their preferences, edit their watchlists, and -other things requiring changes in the database. -Please confirm that this is what you intend to do, and that you will -unlock the database when your maintenance is done. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Locknoconfirm&action=edit locknoconfirm]<br> -[[MediaWiki_talk:Locknoconfirm|Talk]] -</td><td> -You did not check the confirmation box. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Login&action=edit login]<br> -[[MediaWiki_talk:Login|Talk]] -</td><td> -Log in -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginend&action=edit loginend]<br> -[[MediaWiki_talk:Loginend|Talk]] -</td><td> -&amp;nbsp; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginerror&action=edit loginerror]<br> -[[MediaWiki_talk:Loginerror|Talk]] -</td><td> -Login error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginpagetitle&action=edit loginpagetitle]<br> -[[MediaWiki_talk:Loginpagetitle|Talk]] -</td><td> -User login -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginproblem&action=edit loginproblem]<br> -[[MediaWiki_talk:Loginproblem|Talk]] -</td><td> -&lt;b&gt;There has been a problem with your login.&lt;/b&gt;&lt;br /&gt;Try again! -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginprompt&action=edit loginprompt]<br> -[[MediaWiki_talk:Loginprompt|Talk]] -</td><td> -You must have cookies enabled to log in to Wiktionary. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginreqtext&action=edit loginreqtext]<br> -[[MediaWiki_talk:Loginreqtext|Talk]] -</td><td> -You must &#91;&#91;special:Userlogin&#124;login]] to view other pages. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginreqtitle&action=edit loginreqtitle]<br> -[[MediaWiki_talk:Loginreqtitle|Talk]] -</td><td> -Login Required -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginsuccess&action=edit loginsuccess]<br> -[[MediaWiki_talk:Loginsuccess|Talk]] -</td><td> -You are now logged in to Wiktionary as &quot;$1&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginsuccesstitle&action=edit loginsuccesstitle]<br> -[[MediaWiki_talk:Loginsuccesstitle|Talk]] -</td><td> -Login successful -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Logout&action=edit logout]<br> -[[MediaWiki_talk:Logout|Talk]] -</td><td> -Log out -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Logouttext&action=edit logouttext]<br> -[[MediaWiki_talk:Logouttext|Talk]] -</td><td> -You are now logged out. -You can continue to use Wiktionary anonymously, or you can log in -again as the same or as a different user. Note that some pages may -continue to be displayed as if you were still logged in, until you clear -your browser cache - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Logouttitle&action=edit logouttitle]<br> -[[MediaWiki_talk:Logouttitle|Talk]] -</td><td> -User logout -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lonelypages&action=edit lonelypages]<br> -[[MediaWiki_talk:Lonelypages|Talk]] -</td><td> -Orphaned pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Longpages&action=edit longpages]<br> -[[MediaWiki_talk:Longpages|Talk]] -</td><td> -Long pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Longpagewarning&action=edit longpagewarning]<br> -[[MediaWiki_talk:Longpagewarning|Talk]] -</td><td> -WARNING: This page is $1 kilobytes long; some -browsers may have problems editing pages approaching or longer than 32kb. -Please consider breaking the page into smaller sections. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mailerror&action=edit mailerror]<br> -[[MediaWiki_talk:Mailerror|Talk]] -</td><td> -Error sending mail: $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mailmypassword&action=edit mailmypassword]<br> -[[MediaWiki_talk:Mailmypassword|Talk]] -</td><td> -Mail me a new password -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mailnologin&action=edit mailnologin]<br> -[[MediaWiki_talk:Mailnologin|Talk]] -</td><td> -No send address -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mailnologintext&action=edit mailnologintext]<br> -[[MediaWiki_talk:Mailnologintext|Talk]] -</td><td> -You must be &lt;a href=&quot;{{localurl:Special:Userlogin&quot;&gt;logged in&lt;/a&gt; -and have a valid e-mail address in your &lt;a href=&quot;/wiki/Special:Preferences&quot;&gt;preferences&lt;/a&gt; -to send e-mail to other users. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mainpage&action=edit mainpage]<br> -[[MediaWiki_talk:Mainpage|Talk]] -</td><td> -Main Page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mainpagedocfooter&action=edit mainpagedocfooter]<br> -[[MediaWiki_talk:Mainpagedocfooter|Talk]] -</td><td> -Please see &#91;http&#58;//meta.wikipedia.org/wiki/MediaWiki_i18n documentation on customizing the interface] -and the &#91;http&#58;//meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User&#39;s Guide] for usage and configuration help. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mainpagetext&action=edit mainpagetext]<br> -[[MediaWiki_talk:Mainpagetext|Talk]] -</td><td> -Wiki software successfully installed. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Maintenance&action=edit maintenance]<br> -[[MediaWiki_talk:Maintenance|Talk]] -</td><td> -Maintenance page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Maintenancebacklink&action=edit maintenancebacklink]<br> -[[MediaWiki_talk:Maintenancebacklink|Talk]] -</td><td> -Back to Maintenance Page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Maintnancepagetext&action=edit maintnancepagetext]<br> -[[MediaWiki_talk:Maintnancepagetext|Talk]] -</td><td> -This page includes several handy tools for everyday maintenance. Some of these functions tend to stress the database, so please do not hit reload after every item you fixed ;-) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysop&action=edit makesysop]<br> -[[MediaWiki_talk:Makesysop|Talk]] -</td><td> -Make a user into a sysop -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysopfail&action=edit makesysopfail]<br> -[[MediaWiki_talk:Makesysopfail|Talk]] -</td><td> -&lt;b&gt;User &quot;$1&quot; could not be made into a sysop. (Did you enter the name correctly?)&lt;/b&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysopname&action=edit makesysopname]<br> -[[MediaWiki_talk:Makesysopname|Talk]] -</td><td> -Name of the user: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysopok&action=edit makesysopok]<br> -[[MediaWiki_talk:Makesysopok|Talk]] -</td><td> -&lt;b&gt;User &quot;$1&quot; is now a sysop&lt;/b&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysopsubmit&action=edit makesysopsubmit]<br> -[[MediaWiki_talk:Makesysopsubmit|Talk]] -</td><td> -Make this user into a sysop -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysoptext&action=edit makesysoptext]<br> -[[MediaWiki_talk:Makesysoptext|Talk]] -</td><td> -This form is used by bureaucrats to turn ordinary users into administrators. -Type the name of the user in the box and press the button to make the user an administrator -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysoptitle&action=edit makesysoptitle]<br> -[[MediaWiki_talk:Makesysoptitle|Talk]] -</td><td> -Make a user into a sysop -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Matchtotals&action=edit matchtotals]<br> -[[MediaWiki_talk:Matchtotals|Talk]] -</td><td> -The query &quot;$1&quot; matched $2 page titles -and the text of $3 pages. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math&action=edit math]<br> -[[MediaWiki_talk:Math|Talk]] -</td><td> -Rendering math -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_bad_output&action=edit math_bad_output]<br> -[[MediaWiki_talk:Math_bad_output|Talk]] -</td><td> -Can&#39;t write to or create math output directory -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_bad_tmpdir&action=edit math_bad_tmpdir]<br> -[[MediaWiki_talk:Math_bad_tmpdir|Talk]] -</td><td> -Can&#39;t write to or create math temp directory -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_failure&action=edit math_failure]<br> -[[MediaWiki_talk:Math_failure|Talk]] -</td><td> -Failed to parse -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_image_error&action=edit math_image_error]<br> -[[MediaWiki_talk:Math_image_error|Talk]] -</td><td> -PNG conversion failed; check for correct installation of latex, dvips, gs, and convert -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_lexing_error&action=edit math_lexing_error]<br> -[[MediaWiki_talk:Math_lexing_error|Talk]] -</td><td> -lexing error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_notexvc&action=edit math_notexvc]<br> -[[MediaWiki_talk:Math_notexvc|Talk]] -</td><td> -Missing texvc executable; please see math/README to configure. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_sample&action=edit math_sample]<br> -[[MediaWiki_talk:Math_sample|Talk]] -</td><td> -Insert formula here -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_syntax_error&action=edit math_syntax_error]<br> -[[MediaWiki_talk:Math_syntax_error|Talk]] -</td><td> -syntax error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_tip&action=edit math_tip]<br> -[[MediaWiki_talk:Math_tip|Talk]] -</td><td> -Mathematical formula (LaTeX) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_unknown_error&action=edit math_unknown_error]<br> -[[MediaWiki_talk:Math_unknown_error|Talk]] -</td><td> -unknown error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_unknown_function&action=edit math_unknown_function]<br> -[[MediaWiki_talk:Math_unknown_function|Talk]] -</td><td> -unknown function -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Media_sample&action=edit media_sample]<br> -[[MediaWiki_talk:Media_sample|Talk]] -</td><td> -Example.mp3 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Media_tip&action=edit media_tip]<br> -[[MediaWiki_talk:Media_tip|Talk]] -</td><td> -Media file link -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Minlength&action=edit minlength]<br> -[[MediaWiki_talk:Minlength|Talk]] -</td><td> -Image names must be at least three letters. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Minoredit&action=edit minoredit]<br> -[[MediaWiki_talk:Minoredit|Talk]] -</td><td> -This is a minor edit -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Minoreditletter&action=edit minoreditletter]<br> -[[MediaWiki_talk:Minoreditletter|Talk]] -</td><td> -M -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mispeelings&action=edit mispeelings]<br> -[[MediaWiki_talk:Mispeelings|Talk]] -</td><td> -Pages with misspellings -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mispeelingspage&action=edit mispeelingspage]<br> -[[MediaWiki_talk:Mispeelingspage|Talk]] -</td><td> -List of common misspellings -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mispeelingstext&action=edit mispeelingstext]<br> -[[MediaWiki_talk:Mispeelingstext|Talk]] -</td><td> -The following pages contain a common misspelling, which are listed on $1. The correct spelling might be given (like this). -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missingarticle&action=edit missingarticle]<br> -[[MediaWiki_talk:Missingarticle|Talk]] -</td><td> -The database did not find the text of a page -that it should have found, named &quot;$1&quot;. - -&lt;p&gt;This is usually caused by following an outdated diff or history link to a -page that has been deleted. - -&lt;p&gt;If this is not the case, you may have found a bug in the software. -Please report this to an administrator, making note of the URL. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missingimage&action=edit missingimage]<br> -[[MediaWiki_talk:Missingimage|Talk]] -</td><td> -&lt;b&gt;Missing image&lt;/b&gt;&lt;br /&gt;&lt;i&gt;$1&lt;/i&gt; - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missinglanguagelinks&action=edit missinglanguagelinks]<br> -[[MediaWiki_talk:Missinglanguagelinks|Talk]] -</td><td> -Missing Language Links -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missinglanguagelinksbutton&action=edit missinglanguagelinksbutton]<br> -[[MediaWiki_talk:Missinglanguagelinksbutton|Talk]] -</td><td> -Find missing language links for -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missinglanguagelinkstext&action=edit missinglanguagelinkstext]<br> -[[MediaWiki_talk:Missinglanguagelinkstext|Talk]] -</td><td> -These pages do &lt;i&gt;not&lt;/i&gt; link to their counterpart in $1. Redirects and subpages are &lt;i&gt;not&lt;/i&gt; shown. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Moredotdotdot&action=edit moredotdotdot]<br> -[[MediaWiki_talk:Moredotdotdot|Talk]] -</td><td> -More... -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Move&action=edit move]<br> -[[MediaWiki_talk:Move|Talk]] -</td><td> -Move -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movearticle&action=edit movearticle]<br> -[[MediaWiki_talk:Movearticle|Talk]] -</td><td> -Move page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movedto&action=edit movedto]<br> -[[MediaWiki_talk:Movedto|Talk]] -</td><td> -moved to -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movenologin&action=edit movenologin]<br> -[[MediaWiki_talk:Movenologin|Talk]] -</td><td> -Not logged in -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movenologintext&action=edit movenologintext]<br> -[[MediaWiki_talk:Movenologintext|Talk]] -</td><td> -You must be a registered user and &lt;a href=&quot;/wiki/Special:Userlogin&quot;&gt;logged in&lt;/a&gt; -to move a page. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movepage&action=edit movepage]<br> -[[MediaWiki_talk:Movepage|Talk]] -</td><td> -Move page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movepagebtn&action=edit movepagebtn]<br> -[[MediaWiki_talk:Movepagebtn|Talk]] -</td><td> -Move page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movepagetalktext&action=edit movepagetalktext]<br> -[[MediaWiki_talk:Movepagetalktext|Talk]] -</td><td> -The associated talk page, if any, will be automatically moved along with it &#39;&#39;&#39;unless:&#39;&#39;&#39; -*You are moving the page across namespaces, -*A non-empty talk page already exists under the new name, or -*You uncheck the box below. - -In those cases, you will have to move or merge the page manually if desired. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movepagetext&action=edit movepagetext]<br> -[[MediaWiki_talk:Movepagetext|Talk]] -</td><td> -Using the form below will rename a page, moving all -of its history to the new name. -The old title will become a redirect page to the new title. -Links to the old page title will not be changed; be sure to -&#91;&#91;Special:Maintenance&#124;check]] for double or broken redirects. -You are responsible for making sure that links continue to -point where they are supposed to go. - -Note that the page will &#39;&#39;&#39;not&#39;&#39;&#39; be moved if there is already -a page at the new title, unless it is empty or a redirect and has no -past edit history. This means that you can rename a page back to where -it was just renamed from if you make a mistake, and you cannot overwrite -an existing page. - -&lt;b&gt;WARNING!&lt;/b&gt; -This can be a drastic and unexpected change for a popular page; -please be sure you understand the consequences of this before -proceeding. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movetalk&action=edit movetalk]<br> -[[MediaWiki_talk:Movetalk|Talk]] -</td><td> -Move &quot;talk&quot; page as well, if applicable. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movethispage&action=edit movethispage]<br> -[[MediaWiki_talk:Movethispage|Talk]] -</td><td> -Move this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mycontris&action=edit mycontris]<br> -[[MediaWiki_talk:Mycontris|Talk]] -</td><td> -My contributions -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mypage&action=edit mypage]<br> -[[MediaWiki_talk:Mypage|Talk]] -</td><td> -My page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mytalk&action=edit mytalk]<br> -[[MediaWiki_talk:Mytalk|Talk]] -</td><td> -My talk -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Navigation&action=edit navigation]<br> -[[MediaWiki_talk:Navigation|Talk]] -</td><td> -Navigation -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nbytes&action=edit nbytes]<br> -[[MediaWiki_talk:Nbytes|Talk]] -</td><td> -$1 bytes -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nchanges&action=edit nchanges]<br> -[[MediaWiki_talk:Nchanges|Talk]] -</td><td> -$1 changes -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newarticle&action=edit newarticle]<br> -[[MediaWiki_talk:Newarticle|Talk]] -</td><td> -(New) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newarticletext&action=edit newarticletext]<br> -[[MediaWiki_talk:Newarticletext|Talk]] -</td><td> -You&#39;ve followed a link to a page that doesn&#39;t exist yet. -To create the page, start typing in the box below -(see the &#91;&#91;Wiktionary:Help&#124;help page]] for more info). -If you are here by mistake, just click your browser&#39;s &#39;&#39;&#39;back&#39;&#39;&#39; button. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newmessages&action=edit newmessages]<br> -[[MediaWiki_talk:Newmessages|Talk]] -</td><td> -You have $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newmessageslink&action=edit newmessageslink]<br> -[[MediaWiki_talk:Newmessageslink|Talk]] -</td><td> -new messages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newpage&action=edit newpage]<br> -[[MediaWiki_talk:Newpage|Talk]] -</td><td> -New page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newpageletter&action=edit newpageletter]<br> -[[MediaWiki_talk:Newpageletter|Talk]] -</td><td> -N -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newpages&action=edit newpages]<br> -[[MediaWiki_talk:Newpages|Talk]] -</td><td> -New pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newpassword&action=edit newpassword]<br> -[[MediaWiki_talk:Newpassword|Talk]] -</td><td> -New password -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newtitle&action=edit newtitle]<br> -[[MediaWiki_talk:Newtitle|Talk]] -</td><td> -To new title -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newusersonly&action=edit newusersonly]<br> -[[MediaWiki_talk:Newusersonly|Talk]] -</td><td> - (new users only) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Next&action=edit next]<br> -[[MediaWiki_talk:Next|Talk]] -</td><td> -next -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nextn&action=edit nextn]<br> -[[MediaWiki_talk:Nextn|Talk]] -</td><td> -next $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nlinks&action=edit nlinks]<br> -[[MediaWiki_talk:Nlinks|Talk]] -</td><td> -$1 links -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noaffirmation&action=edit noaffirmation]<br> -[[MediaWiki_talk:Noaffirmation|Talk]] -</td><td> -You must affirm that your upload does not violate -any copyrights. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noarticletext&action=edit noarticletext]<br> -[[MediaWiki_talk:Noarticletext|Talk]] -</td><td> -(There is currently no text in this page) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noblockreason&action=edit noblockreason]<br> -[[MediaWiki_talk:Noblockreason|Talk]] -</td><td> -You must supply a reason for the block. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noconnect&action=edit noconnect]<br> -[[MediaWiki_talk:Noconnect|Talk]] -</td><td> -Sorry! The wiki is experiencing some technical difficulties, and cannot contact the database server. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nocontribs&action=edit nocontribs]<br> -[[MediaWiki_talk:Nocontribs|Talk]] -</td><td> -No changes were found matching these criteria. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nocookieslogin&action=edit nocookieslogin]<br> -[[MediaWiki_talk:Nocookieslogin|Talk]] -</td><td> -Wiktionary uses cookies to log in users. You have cookies disabled. Please enable them and try again. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nocookiesnew&action=edit nocookiesnew]<br> -[[MediaWiki_talk:Nocookiesnew|Talk]] -</td><td> -The user account was created, but you are not logged in. Wiktionary uses cookies to log in users. You have cookies disabled. Please enable them, then log in with your new username and password. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nocreativecommons&action=edit nocreativecommons]<br> -[[MediaWiki_talk:Nocreativecommons|Talk]] -</td><td> -Creative Commons RDF metadata disabled for this server. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nodb&action=edit nodb]<br> -[[MediaWiki_talk:Nodb|Talk]] -</td><td> -Could not select database $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nodublincore&action=edit nodublincore]<br> -[[MediaWiki_talk:Nodublincore|Talk]] -</td><td> -Dublin Core RDF metadata disabled for this server. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noemail&action=edit noemail]<br> -[[MediaWiki_talk:Noemail|Talk]] -</td><td> -There is no e-mail address recorded for user &quot;$1&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noemailtext&action=edit noemailtext]<br> -[[MediaWiki_talk:Noemailtext|Talk]] -</td><td> -This user has not specified a valid e-mail address, -or has chosen not to receive e-mail from other users. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noemailtitle&action=edit noemailtitle]<br> -[[MediaWiki_talk:Noemailtitle|Talk]] -</td><td> -No e-mail address -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nogomatch&action=edit nogomatch]<br> -[[MediaWiki_talk:Nogomatch|Talk]] -</td><td> -No page with this exact title exists, trying full text search. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nohistory&action=edit nohistory]<br> -[[MediaWiki_talk:Nohistory|Talk]] -</td><td> -There is no edit history for this page. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nolinkshere&action=edit nolinkshere]<br> -[[MediaWiki_talk:Nolinkshere|Talk]] -</td><td> -No pages link to here. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nolinkstoimage&action=edit nolinkstoimage]<br> -[[MediaWiki_talk:Nolinkstoimage|Talk]] -</td><td> -There are no pages that link to this image. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noname&action=edit noname]<br> -[[MediaWiki_talk:Noname|Talk]] -</td><td> -You have not specified a valid user name. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nonefound&action=edit nonefound]<br> -[[MediaWiki_talk:Nonefound|Talk]] -</td><td> -&lt;strong&gt;Note&lt;/strong&gt;: unsuccessful searches are -often caused by searching for common words like &quot;have&quot; and &quot;from&quot;, -which are not indexed, or by specifying more than one search term (only pages -containing all of the search terms will appear in the result). -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nospecialpagetext&action=edit nospecialpagetext]<br> -[[MediaWiki_talk:Nospecialpagetext|Talk]] -</td><td> -You have requested a special page that is not -recognized by the wiki. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nosuchaction&action=edit nosuchaction]<br> -[[MediaWiki_talk:Nosuchaction|Talk]] -</td><td> -No such action -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nosuchactiontext&action=edit nosuchactiontext]<br> -[[MediaWiki_talk:Nosuchactiontext|Talk]] -</td><td> -The action specified by the URL is not -recognized by the wiki -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nosuchspecialpage&action=edit nosuchspecialpage]<br> -[[MediaWiki_talk:Nosuchspecialpage|Talk]] -</td><td> -No such special page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nosuchuser&action=edit nosuchuser]<br> -[[MediaWiki_talk:Nosuchuser|Talk]] -</td><td> -There is no user by the name &quot;$1&quot;. -Check your spelling, or use the form below to create a new user account. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notacceptable&action=edit notacceptable]<br> -[[MediaWiki_talk:Notacceptable|Talk]] -</td><td> -The wiki server can&#39;t provide data in a format your client can read. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notanarticle&action=edit notanarticle]<br> -[[MediaWiki_talk:Notanarticle|Talk]] -</td><td> -Not a content page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notargettext&action=edit notargettext]<br> -[[MediaWiki_talk:Notargettext|Talk]] -</td><td> -You have not specified a target page or user -to perform this function on. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notargettitle&action=edit notargettitle]<br> -[[MediaWiki_talk:Notargettitle|Talk]] -</td><td> -No target -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Note&action=edit note]<br> -[[MediaWiki_talk:Note|Talk]] -</td><td> -&lt;strong&gt;Note:&lt;/strong&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notextmatches&action=edit notextmatches]<br> -[[MediaWiki_talk:Notextmatches|Talk]] -</td><td> -No page text matches -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notitlematches&action=edit notitlematches]<br> -[[MediaWiki_talk:Notitlematches|Talk]] -</td><td> -No page title matches -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notloggedin&action=edit notloggedin]<br> -[[MediaWiki_talk:Notloggedin|Talk]] -</td><td> -Not logged in -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nowatchlist&action=edit nowatchlist]<br> -[[MediaWiki_talk:Nowatchlist|Talk]] -</td><td> -You have no items on your watchlist. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nowiki_sample&action=edit nowiki_sample]<br> -[[MediaWiki_talk:Nowiki_sample|Talk]] -</td><td> -Insert non-formatted text here -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nowiki_tip&action=edit nowiki_tip]<br> -[[MediaWiki_talk:Nowiki_tip|Talk]] -</td><td> -Ignore wiki formatting -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-category&action=edit nstab-category]<br> -[[MediaWiki_talk:Nstab-category|Talk]] -</td><td> -Category -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-help&action=edit nstab-help]<br> -[[MediaWiki_talk:Nstab-help|Talk]] -</td><td> -Help -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-image&action=edit nstab-image]<br> -[[MediaWiki_talk:Nstab-image|Talk]] -</td><td> -Image -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-main&action=edit nstab-main]<br> -[[MediaWiki_talk:Nstab-main|Talk]] -</td><td> -Article -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-media&action=edit nstab-media]<br> -[[MediaWiki_talk:Nstab-media|Talk]] -</td><td> -Media -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-mediawiki&action=edit nstab-mediawiki]<br> -[[MediaWiki_talk:Nstab-mediawiki|Talk]] -</td><td> -Message -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-special&action=edit nstab-special]<br> -[[MediaWiki_talk:Nstab-special|Talk]] -</td><td> -Special -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-template&action=edit nstab-template]<br> -[[MediaWiki_talk:Nstab-template|Talk]] -</td><td> -Template -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-user&action=edit nstab-user]<br> -[[MediaWiki_talk:Nstab-user|Talk]] -</td><td> -User page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-wp&action=edit nstab-wp]<br> -[[MediaWiki_talk:Nstab-wp|Talk]] -</td><td> -About -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nviews&action=edit nviews]<br> -[[MediaWiki_talk:Nviews|Talk]] -</td><td> -$1 views -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ok&action=edit ok]<br> -[[MediaWiki_talk:Ok|Talk]] -</td><td> -OK -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Oldpassword&action=edit oldpassword]<br> -[[MediaWiki_talk:Oldpassword|Talk]] -</td><td> -Old password -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Orig&action=edit orig]<br> -[[MediaWiki_talk:Orig|Talk]] -</td><td> -orig -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Orphans&action=edit orphans]<br> -[[MediaWiki_talk:Orphans|Talk]] -</td><td> -Orphaned pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Othercontribs&action=edit othercontribs]<br> -[[MediaWiki_talk:Othercontribs|Talk]] -</td><td> -Based on work by $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Otherlanguages&action=edit otherlanguages]<br> -[[MediaWiki_talk:Otherlanguages|Talk]] -</td><td> -Other languages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Pagemovedsub&action=edit pagemovedsub]<br> -[[MediaWiki_talk:Pagemovedsub|Talk]] -</td><td> -Move succeeded -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Pagemovedtext&action=edit pagemovedtext]<br> -[[MediaWiki_talk:Pagemovedtext|Talk]] -</td><td> -Page &quot;&#91;&#91;$1]]&quot; moved to &quot;&#91;&#91;$2]]&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Pagetitle&action=edit pagetitle]<br> -[[MediaWiki_talk:Pagetitle|Talk]] -</td><td> -$1 - Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Passwordremindertext&action=edit passwordremindertext]<br> -[[MediaWiki_talk:Passwordremindertext|Talk]] -</td><td> -Someone (probably you, from IP address $1) -requested that we send you a new Wiktionary login password. -The password for user &quot;$2&quot; is now &quot;$3&quot;. -You should log in and change your password now. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Passwordremindertitle&action=edit passwordremindertitle]<br> -[[MediaWiki_talk:Passwordremindertitle|Talk]] -</td><td> -Password reminder from Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Passwordsent&action=edit passwordsent]<br> -[[MediaWiki_talk:Passwordsent|Talk]] -</td><td> -A new password has been sent to the e-mail address -registered for &quot;$1&quot;. -Please log in again after you receive it. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Perfcached&action=edit perfcached]<br> -[[MediaWiki_talk:Perfcached|Talk]] -</td><td> -The following data is cached and may not be completely up to date: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Perfdisabled&action=edit perfdisabled]<br> -[[MediaWiki_talk:Perfdisabled|Talk]] -</td><td> -Sorry! This feature has been temporarily disabled -because it slows the database down to the point that no one can use -the wiki. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Perfdisabledsub&action=edit perfdisabledsub]<br> -[[MediaWiki_talk:Perfdisabledsub|Talk]] -</td><td> -Here&#39;s a saved copy from $1: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Personaltools&action=edit personaltools]<br> -[[MediaWiki_talk:Personaltools|Talk]] -</td><td> -Personal tools -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Popularpages&action=edit popularpages]<br> -[[MediaWiki_talk:Popularpages|Talk]] -</td><td> -Popular pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Portal&action=edit portal]<br> -[[MediaWiki_talk:Portal|Talk]] -</td><td> -Community portal -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Portal-url&action=edit portal-url]<br> -[[MediaWiki_talk:Portal-url|Talk]] -</td><td> -Wiktionary:Community Portal -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Postcomment&action=edit postcomment]<br> -[[MediaWiki_talk:Postcomment|Talk]] -</td><td> -Post a comment -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Poweredby&action=edit poweredby]<br> -[[MediaWiki_talk:Poweredby|Talk]] -</td><td> -Wiktionary is powered by &#91;http&#58;//www.mediawiki.org/ MediaWiki], an open source wiki engine. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Powersearch&action=edit powersearch]<br> -[[MediaWiki_talk:Powersearch|Talk]] -</td><td> -Search -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Powersearchtext&action=edit powersearchtext]<br> -[[MediaWiki_talk:Powersearchtext|Talk]] -</td><td> - -Search in namespaces :&lt;br /&gt; -$1&lt;br /&gt; -$2 List redirects &amp;nbsp; Search for $3 $9 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Preferences&action=edit preferences]<br> -[[MediaWiki_talk:Preferences|Talk]] -</td><td> -Preferences -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefs-help-userdata&action=edit prefs-help-userdata]<br> -[[MediaWiki_talk:Prefs-help-userdata|Talk]] -</td><td> -* &lt;strong&gt;Real name&lt;/strong&gt; (optional): if you choose to provide it this will be used for giving you attribution for your work.&lt;br/&gt; -* &lt;strong&gt;Email&lt;/strong&gt; (optional): Enables people to contact you through the website without you having to reveal your -email address to them, and it can be used to send you a new password if you forget it. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefs-misc&action=edit prefs-misc]<br> -[[MediaWiki_talk:Prefs-misc|Talk]] -</td><td> -Misc settings -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefs-personal&action=edit prefs-personal]<br> -[[MediaWiki_talk:Prefs-personal|Talk]] -</td><td> -User data -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefs-rc&action=edit prefs-rc]<br> -[[MediaWiki_talk:Prefs-rc|Talk]] -</td><td> -Recent changes and stub display -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefslogintext&action=edit prefslogintext]<br> -[[MediaWiki_talk:Prefslogintext|Talk]] -</td><td> -You are logged in as &quot;$1&quot;. -Your internal ID number is $2. - -See &#91;&#91;Wiktionary:User preferences help]] for help deciphering the options. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefsnologin&action=edit prefsnologin]<br> -[[MediaWiki_talk:Prefsnologin|Talk]] -</td><td> -Not logged in -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefsnologintext&action=edit prefsnologintext]<br> -[[MediaWiki_talk:Prefsnologintext|Talk]] -</td><td> -You must be &lt;a href=&quot;/wiki/Special:Userlogin&quot;&gt;logged in&lt;/a&gt; -to set user preferences. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefsreset&action=edit prefsreset]<br> -[[MediaWiki_talk:Prefsreset|Talk]] -</td><td> -Preferences have been reset from storage. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Preview&action=edit preview]<br> -[[MediaWiki_talk:Preview|Talk]] -</td><td> -Preview -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Previewconflict&action=edit previewconflict]<br> -[[MediaWiki_talk:Previewconflict|Talk]] -</td><td> -This preview reflects the text in the upper -text editing area as it will appear if you choose to save. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Previewnote&action=edit previewnote]<br> -[[MediaWiki_talk:Previewnote|Talk]] -</td><td> -Remember that this is only a preview, and has not yet been saved! -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prevn&action=edit prevn]<br> -[[MediaWiki_talk:Prevn|Talk]] -</td><td> -previous $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Printableversion&action=edit printableversion]<br> -[[MediaWiki_talk:Printableversion|Talk]] -</td><td> -Printable version -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Printsubtitle&action=edit printsubtitle]<br> -[[MediaWiki_talk:Printsubtitle|Talk]] -</td><td> -(From http&#58;//tl.wiktionary.org) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protect&action=edit protect]<br> -[[MediaWiki_talk:Protect|Talk]] -</td><td> -Protect -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectcomment&action=edit protectcomment]<br> -[[MediaWiki_talk:Protectcomment|Talk]] -</td><td> -Reason for protecting -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectedarticle&action=edit protectedarticle]<br> -[[MediaWiki_talk:Protectedarticle|Talk]] -</td><td> -protected &#91;&#91;$1]] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectedpage&action=edit protectedpage]<br> -[[MediaWiki_talk:Protectedpage|Talk]] -</td><td> -Protected page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectedpagewarning&action=edit protectedpagewarning]<br> -[[MediaWiki_talk:Protectedpagewarning|Talk]] -</td><td> -WARNING: This page has been locked so that only -users with sysop privileges can edit it. Be sure you are following the -&lt;a href=&#39;/w/wiki.phtml/Wiktionary:Protected_page_guidelines&#39;&gt;protected page -guidelines&lt;/a&gt;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectedtext&action=edit protectedtext]<br> -[[MediaWiki_talk:Protectedtext|Talk]] -</td><td> -This page has been locked to prevent editing; there are -a number of reasons why this may be so, please see -&#91;&#91;Wiktionary:Protected page]]. - -You can view and copy the source of this page: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectlogpage&action=edit protectlogpage]<br> -[[MediaWiki_talk:Protectlogpage|Talk]] -</td><td> -Protection_log -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectlogtext&action=edit protectlogtext]<br> -[[MediaWiki_talk:Protectlogtext|Talk]] -</td><td> -Below is a list of page locks/unlocks. -See &#91;&#91;Wiktionary:Protected page]] for more information. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectpage&action=edit protectpage]<br> -[[MediaWiki_talk:Protectpage|Talk]] -</td><td> -Protect page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectreason&action=edit protectreason]<br> -[[MediaWiki_talk:Protectreason|Talk]] -</td><td> -(give a reason) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectsub&action=edit protectsub]<br> -[[MediaWiki_talk:Protectsub|Talk]] -</td><td> -(Protecting &quot;$1&quot;) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectthispage&action=edit protectthispage]<br> -[[MediaWiki_talk:Protectthispage|Talk]] -</td><td> -Protect this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Proxyblocker&action=edit proxyblocker]<br> -[[MediaWiki_talk:Proxyblocker|Talk]] -</td><td> -Proxy blocker -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Proxyblockreason&action=edit proxyblockreason]<br> -[[MediaWiki_talk:Proxyblockreason|Talk]] -</td><td> -Your IP address has been blocked because it is an open proxy. Please contact your Internet service provider or tech support and inform them of this serious security problem. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Proxyblocksuccess&action=edit proxyblocksuccess]<br> -[[MediaWiki_talk:Proxyblocksuccess|Talk]] -</td><td> -Done. - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbbrowse&action=edit qbbrowse]<br> -[[MediaWiki_talk:Qbbrowse|Talk]] -</td><td> -Browse -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbedit&action=edit qbedit]<br> -[[MediaWiki_talk:Qbedit|Talk]] -</td><td> -Edit -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbfind&action=edit qbfind]<br> -[[MediaWiki_talk:Qbfind|Talk]] -</td><td> -Find -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbmyoptions&action=edit qbmyoptions]<br> -[[MediaWiki_talk:Qbmyoptions|Talk]] -</td><td> -My pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbpageinfo&action=edit qbpageinfo]<br> -[[MediaWiki_talk:Qbpageinfo|Talk]] -</td><td> -Context -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbpageoptions&action=edit qbpageoptions]<br> -[[MediaWiki_talk:Qbpageoptions|Talk]] -</td><td> -This page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbsettings&action=edit qbsettings]<br> -[[MediaWiki_talk:Qbsettings|Talk]] -</td><td> -Quickbar settings -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbspecialpages&action=edit qbspecialpages]<br> -[[MediaWiki_talk:Qbspecialpages|Talk]] -</td><td> -Special pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Querybtn&action=edit querybtn]<br> -[[MediaWiki_talk:Querybtn|Talk]] -</td><td> -Submit query -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Querysuccessful&action=edit querysuccessful]<br> -[[MediaWiki_talk:Querysuccessful|Talk]] -</td><td> -Query successful -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Randompage&action=edit randompage]<br> -[[MediaWiki_talk:Randompage|Talk]] -</td><td> -Random page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Range_block_disabled&action=edit range_block_disabled]<br> -[[MediaWiki_talk:Range_block_disabled|Talk]] -</td><td> -The sysop ability to create range blocks is disabled. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rchide&action=edit rchide]<br> -[[MediaWiki_talk:Rchide|Talk]] -</td><td> -in $4 form; $1 minor edits; $2 secondary namespaces; $3 multiple edits. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rclinks&action=edit rclinks]<br> -[[MediaWiki_talk:Rclinks|Talk]] -</td><td> -Show last $1 changes in last $2 days&lt;br /&gt;$3 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rclistfrom&action=edit rclistfrom]<br> -[[MediaWiki_talk:Rclistfrom|Talk]] -</td><td> -Show new changes starting from $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rcliu&action=edit rcliu]<br> -[[MediaWiki_talk:Rcliu|Talk]] -</td><td> -; $1 edits from logged in users -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rcloaderr&action=edit rcloaderr]<br> -[[MediaWiki_talk:Rcloaderr|Talk]] -</td><td> -Loading recent changes -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rclsub&action=edit rclsub]<br> -[[MediaWiki_talk:Rclsub|Talk]] -</td><td> -(to pages linked from &quot;$1&quot;) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rcnote&action=edit rcnote]<br> -[[MediaWiki_talk:Rcnote|Talk]] -</td><td> -Below are the last &lt;strong&gt;$1&lt;/strong&gt; changes in last &lt;strong&gt;$2&lt;/strong&gt; days. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rcnotefrom&action=edit rcnotefrom]<br> -[[MediaWiki_talk:Rcnotefrom|Talk]] -</td><td> -Below are the changes since &lt;b&gt;$2&lt;/b&gt; (up to &lt;b&gt;$1&lt;/b&gt; shown). -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Readonly&action=edit readonly]<br> -[[MediaWiki_talk:Readonly|Talk]] -</td><td> -Database locked -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Readonlytext&action=edit readonlytext]<br> -[[MediaWiki_talk:Readonlytext|Talk]] -</td><td> -The database is currently locked to new -entries and other modifications, probably for routine database maintenance, -after which it will be back to normal. -The administrator who locked it offered this explanation: -&lt;p&gt;$1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Readonlywarning&action=edit readonlywarning]<br> -[[MediaWiki_talk:Readonlywarning|Talk]] -</td><td> -WARNING: The database has been locked for maintenance, -so you will not be able to save your edits right now. You may wish to cut-n-paste -the text into a text file and save it for later. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Recentchanges&action=edit recentchanges]<br> -[[MediaWiki_talk:Recentchanges|Talk]] -</td><td> -Recent changes -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Recentchangescount&action=edit recentchangescount]<br> -[[MediaWiki_talk:Recentchangescount|Talk]] -</td><td> -Number of titles in recent changes -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Recentchangeslinked&action=edit recentchangeslinked]<br> -[[MediaWiki_talk:Recentchangeslinked|Talk]] -</td><td> -Related changes -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Recentchangestext&action=edit recentchangestext]<br> -[[MediaWiki_talk:Recentchangestext|Talk]] -</td><td> -Track the most recent changes to the wiki on this page. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Redirectedfrom&action=edit redirectedfrom]<br> -[[MediaWiki_talk:Redirectedfrom|Talk]] -</td><td> -(Redirected from $1) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Remembermypassword&action=edit remembermypassword]<br> -[[MediaWiki_talk:Remembermypassword|Talk]] -</td><td> -Remember my password across sessions. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Removechecked&action=edit removechecked]<br> -[[MediaWiki_talk:Removechecked|Talk]] -</td><td> -Remove checked items from watchlist -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Removedwatch&action=edit removedwatch]<br> -[[MediaWiki_talk:Removedwatch|Talk]] -</td><td> -Removed from watchlist -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Removedwatchtext&action=edit removedwatchtext]<br> -[[MediaWiki_talk:Removedwatchtext|Talk]] -</td><td> -The page &quot;$1&quot; has been removed from your watchlist. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Removingchecked&action=edit removingchecked]<br> -[[MediaWiki_talk:Removingchecked|Talk]] -</td><td> -Removing requested items from watchlist... -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Resetprefs&action=edit resetprefs]<br> -[[MediaWiki_talk:Resetprefs|Talk]] -</td><td> -Reset preferences -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Restorelink&action=edit restorelink]<br> -[[MediaWiki_talk:Restorelink|Talk]] -</td><td> -$1 deleted edits -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Resultsperpage&action=edit resultsperpage]<br> -[[MediaWiki_talk:Resultsperpage|Talk]] -</td><td> -Hits to show per page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Retrievedfrom&action=edit retrievedfrom]<br> -[[MediaWiki_talk:Retrievedfrom|Talk]] -</td><td> -Retrieved from &quot;$1&quot; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Returnto&action=edit returnto]<br> -[[MediaWiki_talk:Returnto|Talk]] -</td><td> -Return to $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Retypenew&action=edit retypenew]<br> -[[MediaWiki_talk:Retypenew|Talk]] -</td><td> -Retype new password -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Reupload&action=edit reupload]<br> -[[MediaWiki_talk:Reupload|Talk]] -</td><td> -Re-upload -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Reuploaddesc&action=edit reuploaddesc]<br> -[[MediaWiki_talk:Reuploaddesc|Talk]] -</td><td> -Return to the upload form. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Reverted&action=edit reverted]<br> -[[MediaWiki_talk:Reverted|Talk]] -</td><td> -Reverted to earlier revision -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revertimg&action=edit revertimg]<br> -[[MediaWiki_talk:Revertimg|Talk]] -</td><td> -rev -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revertpage&action=edit revertpage]<br> -[[MediaWiki_talk:Revertpage|Talk]] -</td><td> -Reverted edit of $2, changed back to last version by $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revhistory&action=edit revhistory]<br> -[[MediaWiki_talk:Revhistory|Talk]] -</td><td> -Revision history -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revisionasof&action=edit revisionasof]<br> -[[MediaWiki_talk:Revisionasof|Talk]] -</td><td> -Revision as of $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revnotfound&action=edit revnotfound]<br> -[[MediaWiki_talk:Revnotfound|Talk]] -</td><td> -Revision not found -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revnotfoundtext&action=edit revnotfoundtext]<br> -[[MediaWiki_talk:Revnotfoundtext|Talk]] -</td><td> -The old revision of the page you asked for could not be found. -Please check the URL you used to access this page. - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rfcurl&action=edit rfcurl]<br> -[[MediaWiki_talk:Rfcurl|Talk]] -</td><td> -http&#58;//www.faqs.org/rfcs/rfc$1.html -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rights&action=edit rights]<br> -[[MediaWiki_talk:Rights|Talk]] -</td><td> -Rights: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rollback&action=edit rollback]<br> -[[MediaWiki_talk:Rollback|Talk]] -</td><td> -Roll back edits -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rollback_short&action=edit rollback_short]<br> -[[MediaWiki_talk:Rollback_short|Talk]] -</td><td> -Rollback -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rollbackfailed&action=edit rollbackfailed]<br> -[[MediaWiki_talk:Rollbackfailed|Talk]] -</td><td> -Rollback failed -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rollbacklink&action=edit rollbacklink]<br> -[[MediaWiki_talk:Rollbacklink|Talk]] -</td><td> -rollback -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rows&action=edit rows]<br> -[[MediaWiki_talk:Rows|Talk]] -</td><td> -Rows -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Savearticle&action=edit savearticle]<br> -[[MediaWiki_talk:Savearticle|Talk]] -</td><td> -Save page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Savedprefs&action=edit savedprefs]<br> -[[MediaWiki_talk:Savedprefs|Talk]] -</td><td> -Your preferences have been saved. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Savefile&action=edit savefile]<br> -[[MediaWiki_talk:Savefile|Talk]] -</td><td> -Save file -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Saveprefs&action=edit saveprefs]<br> -[[MediaWiki_talk:Saveprefs|Talk]] -</td><td> -Save preferences -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Search&action=edit search]<br> -[[MediaWiki_talk:Search|Talk]] -</td><td> -Search -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchdisabled&action=edit searchdisabled]<br> -[[MediaWiki_talk:Searchdisabled|Talk]] -</td><td> -&lt;p&gt;Sorry! Full text search has been disabled temporarily, for performance reasons. In the meantime, you can use the Google search below, which may be out of date.&lt;/p&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchhelppage&action=edit searchhelppage]<br> -[[MediaWiki_talk:Searchhelppage|Talk]] -</td><td> -Wiktionary:Searching -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchingwikipedia&action=edit searchingwikipedia]<br> -[[MediaWiki_talk:Searchingwikipedia|Talk]] -</td><td> -Searching Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchquery&action=edit searchquery]<br> -[[MediaWiki_talk:Searchquery|Talk]] -</td><td> -For query &quot;$1&quot; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchresults&action=edit searchresults]<br> -[[MediaWiki_talk:Searchresults|Talk]] -</td><td> -Search results -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchresultshead&action=edit searchresultshead]<br> -[[MediaWiki_talk:Searchresultshead|Talk]] -</td><td> -Search result settings -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchresulttext&action=edit searchresulttext]<br> -[[MediaWiki_talk:Searchresulttext|Talk]] -</td><td> -For more information about searching Wiktionary, see $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sectionedit&action=edit sectionedit]<br> -[[MediaWiki_talk:Sectionedit|Talk]] -</td><td> - (section) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selectnewerversionfordiff&action=edit selectnewerversionfordiff]<br> -[[MediaWiki_talk:Selectnewerversionfordiff|Talk]] -</td><td> -Select a newer version for comparison -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selectolderversionfordiff&action=edit selectolderversionfordiff]<br> -[[MediaWiki_talk:Selectolderversionfordiff|Talk]] -</td><td> -Select an older version for comparison -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selectonly&action=edit selectonly]<br> -[[MediaWiki_talk:Selectonly|Talk]] -</td><td> -Only read-only queries are allowed. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selflinks&action=edit selflinks]<br> -[[MediaWiki_talk:Selflinks|Talk]] -</td><td> -Pages with Self Links -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selflinkstext&action=edit selflinkstext]<br> -[[MediaWiki_talk:Selflinkstext|Talk]] -</td><td> -The following pages contain a link to themselves, which they should not. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Seriousxhtmlerrors&action=edit seriousxhtmlerrors]<br> -[[MediaWiki_talk:Seriousxhtmlerrors|Talk]] -</td><td> -There were serious xhtml markup errors detected by tidy. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Servertime&action=edit servertime]<br> -[[MediaWiki_talk:Servertime|Talk]] -</td><td> -Server time is now -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Set_rights_fail&action=edit set_rights_fail]<br> -[[MediaWiki_talk:Set_rights_fail|Talk]] -</td><td> -&lt;b&gt;User rights for &quot;$1&quot; could not be set. (Did you enter the name correctly?)&lt;/b&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Set_user_rights&action=edit set_user_rights]<br> -[[MediaWiki_talk:Set_user_rights|Talk]] -</td><td> -Set user rights -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Setbureaucratflag&action=edit setbureaucratflag]<br> -[[MediaWiki_talk:Setbureaucratflag|Talk]] -</td><td> -Set bureaucrat flag -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Shortpages&action=edit shortpages]<br> -[[MediaWiki_talk:Shortpages|Talk]] -</td><td> -Short pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Show&action=edit show]<br> -[[MediaWiki_talk:Show|Talk]] -</td><td> -show -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showhideminor&action=edit showhideminor]<br> -[[MediaWiki_talk:Showhideminor|Talk]] -</td><td> -$1 minor edits &#124; $2 bots &#124; $3 logged in users -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showingresults&action=edit showingresults]<br> -[[MediaWiki_talk:Showingresults|Talk]] -</td><td> -Showing below &lt;b&gt;$1&lt;/b&gt; results starting with #&lt;b&gt;$2&lt;/b&gt;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showingresultsnum&action=edit showingresultsnum]<br> -[[MediaWiki_talk:Showingresultsnum|Talk]] -</td><td> -Showing below &lt;b&gt;$3&lt;/b&gt; results starting with #&lt;b&gt;$2&lt;/b&gt;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showlast&action=edit showlast]<br> -[[MediaWiki_talk:Showlast|Talk]] -</td><td> -Show last $1 images sorted $2. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showpreview&action=edit showpreview]<br> -[[MediaWiki_talk:Showpreview|Talk]] -</td><td> -Show preview -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showtoc&action=edit showtoc]<br> -[[MediaWiki_talk:Showtoc|Talk]] -</td><td> -show -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sig_tip&action=edit sig_tip]<br> -[[MediaWiki_talk:Sig_tip|Talk]] -</td><td> -Your signature with timestamp -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitestats&action=edit sitestats]<br> -[[MediaWiki_talk:Sitestats|Talk]] -</td><td> -Site statistics -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitestatstext&action=edit sitestatstext]<br> -[[MediaWiki_talk:Sitestatstext|Talk]] -</td><td> -There are &#39;&#39;&#39;$1&#39;&#39;&#39; total pages in the database. -This includes &quot;talk&quot; pages, pages about Wiktionary, minimal &quot;stub&quot; -pages, redirects, and others that probably don&#39;t qualify as content pages. -Excluding those, there are &#39;&#39;&#39;$2&#39;&#39;&#39; pages that are probably legitimate -content pages. - -There have been a total of &#39;&#39;&#39;$3&#39;&#39;&#39; page views, and &#39;&#39;&#39;$4&#39;&#39;&#39; page edits -since the wiki was setup. -That comes to &#39;&#39;&#39;$5&#39;&#39;&#39; average edits per page, and &#39;&#39;&#39;$6&#39;&#39;&#39; views per edit. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitesubtitle&action=edit sitesubtitle]<br> -[[MediaWiki_talk:Sitesubtitle|Talk]] -</td><td> -The Free Encyclopedia -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitesupport&action=edit sitesupport]<br> -[[MediaWiki_talk:Sitesupport|Talk]] -</td><td> -Donations -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitetitle&action=edit sitetitle]<br> -[[MediaWiki_talk:Sitetitle|Talk]] -</td><td> -Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Siteuser&action=edit siteuser]<br> -[[MediaWiki_talk:Siteuser|Talk]] -</td><td> -Wiktionary user $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Siteusers&action=edit siteusers]<br> -[[MediaWiki_talk:Siteusers|Talk]] -</td><td> -Wiktionary user(s) $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Skin&action=edit skin]<br> -[[MediaWiki_talk:Skin|Talk]] -</td><td> -Skin -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Spamprotectiontext&action=edit spamprotectiontext]<br> -[[MediaWiki_talk:Spamprotectiontext|Talk]] -</td><td> -The page you wanted to save was blocked by the spam filter. This is probably caused by a link to an external site. - -You might want to check the following regular expression for patterns that are currently blocked: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Spamprotectiontitle&action=edit spamprotectiontitle]<br> -[[MediaWiki_talk:Spamprotectiontitle|Talk]] -</td><td> -Spam protection filter -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Specialpage&action=edit specialpage]<br> -[[MediaWiki_talk:Specialpage|Talk]] -</td><td> -Special Page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Specialpages&action=edit specialpages]<br> -[[MediaWiki_talk:Specialpages|Talk]] -</td><td> -Special pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Spheading&action=edit spheading]<br> -[[MediaWiki_talk:Spheading|Talk]] -</td><td> -Special pages for all users -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sqlislogged&action=edit sqlislogged]<br> -[[MediaWiki_talk:Sqlislogged|Talk]] -</td><td> -Please note that all queries are logged. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sqlquery&action=edit sqlquery]<br> -[[MediaWiki_talk:Sqlquery|Talk]] -</td><td> -Enter query -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Statistics&action=edit statistics]<br> -[[MediaWiki_talk:Statistics|Talk]] -</td><td> -Statistics -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Storedversion&action=edit storedversion]<br> -[[MediaWiki_talk:Storedversion|Talk]] -</td><td> -Stored version -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Stubthreshold&action=edit stubthreshold]<br> -[[MediaWiki_talk:Stubthreshold|Talk]] -</td><td> -Threshold for stub display -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Subcategories&action=edit subcategories]<br> -[[MediaWiki_talk:Subcategories|Talk]] -</td><td> -Subcategories -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Subject&action=edit subject]<br> -[[MediaWiki_talk:Subject|Talk]] -</td><td> -Subject/headline -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Subjectpage&action=edit subjectpage]<br> -[[MediaWiki_talk:Subjectpage|Talk]] -</td><td> -View subject -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Successfulupload&action=edit successfulupload]<br> -[[MediaWiki_talk:Successfulupload|Talk]] -</td><td> -Successful upload -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Summary&action=edit summary]<br> -[[MediaWiki_talk:Summary|Talk]] -</td><td> -Summary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sysopspheading&action=edit sysopspheading]<br> -[[MediaWiki_talk:Sysopspheading|Talk]] -</td><td> -For sysop use only -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sysoptext&action=edit sysoptext]<br> -[[MediaWiki_talk:Sysoptext|Talk]] -</td><td> -The action you have requested can only be -performed by users with &quot;sysop&quot; status. -See $1. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sysoptitle&action=edit sysoptitle]<br> -[[MediaWiki_talk:Sysoptitle|Talk]] -</td><td> -Sysop access required -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tableform&action=edit tableform]<br> -[[MediaWiki_talk:Tableform|Talk]] -</td><td> -table -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talk&action=edit talk]<br> -[[MediaWiki_talk:Talk|Talk]] -</td><td> -Discussion -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkexists&action=edit talkexists]<br> -[[MediaWiki_talk:Talkexists|Talk]] -</td><td> -The page itself was moved successfully, but the -talk page could not be moved because one already exists at the new -title. Please merge them manually. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkpage&action=edit talkpage]<br> -[[MediaWiki_talk:Talkpage|Talk]] -</td><td> -Discuss this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkpagemoved&action=edit talkpagemoved]<br> -[[MediaWiki_talk:Talkpagemoved|Talk]] -</td><td> -The corresponding talk page was also moved. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkpagenotmoved&action=edit talkpagenotmoved]<br> -[[MediaWiki_talk:Talkpagenotmoved|Talk]] -</td><td> -The corresponding talk page was &lt;strong&gt;not&lt;/strong&gt; moved. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkpagetext&action=edit talkpagetext]<br> -[[MediaWiki_talk:Talkpagetext|Talk]] -</td><td> -&lt;!-- MediaWiki:talkpagetext --&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Textboxsize&action=edit textboxsize]<br> -[[MediaWiki_talk:Textboxsize|Talk]] -</td><td> -Textbox dimensions -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Textmatches&action=edit textmatches]<br> -[[MediaWiki_talk:Textmatches|Talk]] -</td><td> -Page text matches -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Thisisdeleted&action=edit thisisdeleted]<br> -[[MediaWiki_talk:Thisisdeleted|Talk]] -</td><td> -View or restore $1? -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Thumbnail-more&action=edit thumbnail-more]<br> -[[MediaWiki_talk:Thumbnail-more|Talk]] -</td><td> -Enlarge -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Timezonelegend&action=edit timezonelegend]<br> -[[MediaWiki_talk:Timezonelegend|Talk]] -</td><td> -Time zone -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Timezoneoffset&action=edit timezoneoffset]<br> -[[MediaWiki_talk:Timezoneoffset|Talk]] -</td><td> -Offset -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Timezonetext&action=edit timezonetext]<br> -[[MediaWiki_talk:Timezonetext|Talk]] -</td><td> -Enter number of hours your local time differs -from server time (UTC). -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Titlematches&action=edit titlematches]<br> -[[MediaWiki_talk:Titlematches|Talk]] -</td><td> -Article title matches -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Toc&action=edit toc]<br> -[[MediaWiki_talk:Toc|Talk]] -</td><td> -Table of contents -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Toolbox&action=edit toolbox]<br> -[[MediaWiki_talk:Toolbox|Talk]] -</td><td> -Toolbox -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-addsection&action=edit tooltip-addsection]<br> -[[MediaWiki_talk:Tooltip-addsection|Talk]] -</td><td> -Add a comment to this page. &#91;alt-+] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-anontalk&action=edit tooltip-anontalk]<br> -[[MediaWiki_talk:Tooltip-anontalk|Talk]] -</td><td> -Discussion about edits from this ip address &#91;alt-n] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-anonuserpage&action=edit tooltip-anonuserpage]<br> -[[MediaWiki_talk:Tooltip-anonuserpage|Talk]] -</td><td> -The user page for the ip you&#39;re editing as &#91;alt-.] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-article&action=edit tooltip-article]<br> -[[MediaWiki_talk:Tooltip-article|Talk]] -</td><td> -View the content page &#91;alt-a] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-atom&action=edit tooltip-atom]<br> -[[MediaWiki_talk:Tooltip-atom|Talk]] -</td><td> -Atom feed for this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-compareselectedversions&action=edit tooltip-compareselectedversions]<br> -[[MediaWiki_talk:Tooltip-compareselectedversions|Talk]] -</td><td> -See the differences between the two selected versions of this page. &#91;alt-v] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-contributions&action=edit tooltip-contributions]<br> -[[MediaWiki_talk:Tooltip-contributions|Talk]] -</td><td> -View the list of contributions of this user -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-currentevents&action=edit tooltip-currentevents]<br> -[[MediaWiki_talk:Tooltip-currentevents|Talk]] -</td><td> -Find background information on current events -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-delete&action=edit tooltip-delete]<br> -[[MediaWiki_talk:Tooltip-delete|Talk]] -</td><td> -Delete this page &#91;alt-d] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-edit&action=edit tooltip-edit]<br> -[[MediaWiki_talk:Tooltip-edit|Talk]] -</td><td> -You can edit this page. Please use the preview button before saving. &#91;alt-e] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-emailuser&action=edit tooltip-emailuser]<br> -[[MediaWiki_talk:Tooltip-emailuser|Talk]] -</td><td> -Send a mail to this user -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-help&action=edit tooltip-help]<br> -[[MediaWiki_talk:Tooltip-help|Talk]] -</td><td> -The place to find out. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-history&action=edit tooltip-history]<br> -[[MediaWiki_talk:Tooltip-history|Talk]] -</td><td> -Past versions of this page, &#91;alt-h] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-login&action=edit tooltip-login]<br> -[[MediaWiki_talk:Tooltip-login|Talk]] -</td><td> -You are encouraged to log in, it is not mandatory however. &#91;alt-o] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-logout&action=edit tooltip-logout]<br> -[[MediaWiki_talk:Tooltip-logout|Talk]] -</td><td> -Log out &#91;alt-o] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-mainpage&action=edit tooltip-mainpage]<br> -[[MediaWiki_talk:Tooltip-mainpage|Talk]] -</td><td> -Visit the Main Page &#91;alt-z] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-minoredit&action=edit tooltip-minoredit]<br> -[[MediaWiki_talk:Tooltip-minoredit|Talk]] -</td><td> -Mark this as a minor edit &#91;alt-i] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-move&action=edit tooltip-move]<br> -[[MediaWiki_talk:Tooltip-move|Talk]] -</td><td> -Move this page &#91;alt-m] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-mycontris&action=edit tooltip-mycontris]<br> -[[MediaWiki_talk:Tooltip-mycontris|Talk]] -</td><td> -List of my contributions &#91;alt-y] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-mytalk&action=edit tooltip-mytalk]<br> -[[MediaWiki_talk:Tooltip-mytalk|Talk]] -</td><td> -My talk page &#91;alt-n] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-nomove&action=edit tooltip-nomove]<br> -[[MediaWiki_talk:Tooltip-nomove|Talk]] -</td><td> -You don&#39;t have the permissions to move this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-portal&action=edit tooltip-portal]<br> -[[MediaWiki_talk:Tooltip-portal|Talk]] -</td><td> -About the project, what you can do, where to find things -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-preferences&action=edit tooltip-preferences]<br> -[[MediaWiki_talk:Tooltip-preferences|Talk]] -</td><td> -My preferences -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-preview&action=edit tooltip-preview]<br> -[[MediaWiki_talk:Tooltip-preview|Talk]] -</td><td> -Preview your changes, please use this before saving! &#91;alt-p] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-protect&action=edit tooltip-protect]<br> -[[MediaWiki_talk:Tooltip-protect|Talk]] -</td><td> -Protect this page &#91;alt-=] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-randompage&action=edit tooltip-randompage]<br> -[[MediaWiki_talk:Tooltip-randompage|Talk]] -</td><td> -Load a random page &#91;alt-x] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-recentchanges&action=edit tooltip-recentchanges]<br> -[[MediaWiki_talk:Tooltip-recentchanges|Talk]] -</td><td> -The list of recent changes in the wiki. &#91;alt-r] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-recentchangeslinked&action=edit tooltip-recentchangeslinked]<br> -[[MediaWiki_talk:Tooltip-recentchangeslinked|Talk]] -</td><td> -Recent changes in pages linking to this page &#91;alt-c] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-rss&action=edit tooltip-rss]<br> -[[MediaWiki_talk:Tooltip-rss|Talk]] -</td><td> -RSS feed for this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-save&action=edit tooltip-save]<br> -[[MediaWiki_talk:Tooltip-save|Talk]] -</td><td> -Save your changes &#91;alt-s] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-search&action=edit tooltip-search]<br> -[[MediaWiki_talk:Tooltip-search|Talk]] -</td><td> -Search this wiki &#91;alt-f] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-sitesupport&action=edit tooltip-sitesupport]<br> -[[MediaWiki_talk:Tooltip-sitesupport|Talk]] -</td><td> -Support Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-specialpage&action=edit tooltip-specialpage]<br> -[[MediaWiki_talk:Tooltip-specialpage|Talk]] -</td><td> -This is a special page, you can&#39;t edit the page itself. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-specialpages&action=edit tooltip-specialpages]<br> -[[MediaWiki_talk:Tooltip-specialpages|Talk]] -</td><td> -List of all special pages &#91;alt-q] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-talk&action=edit tooltip-talk]<br> -[[MediaWiki_talk:Tooltip-talk|Talk]] -</td><td> -Discussion about the content page &#91;alt-t] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-undelete&action=edit tooltip-undelete]<br> -[[MediaWiki_talk:Tooltip-undelete|Talk]] -</td><td> -Restore the $1 edits done to this page before it was deleted &#91;alt-d] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-unwatch&action=edit tooltip-unwatch]<br> -[[MediaWiki_talk:Tooltip-unwatch|Talk]] -</td><td> -Remove this page from your watchlist &#91;alt-w] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-upload&action=edit tooltip-upload]<br> -[[MediaWiki_talk:Tooltip-upload|Talk]] -</td><td> -Upload images or media files &#91;alt-u] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-userpage&action=edit tooltip-userpage]<br> -[[MediaWiki_talk:Tooltip-userpage|Talk]] -</td><td> -My user page &#91;alt-.] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-viewsource&action=edit tooltip-viewsource]<br> -[[MediaWiki_talk:Tooltip-viewsource|Talk]] -</td><td> -This page is protected. You can view its source. &#91;alt-e] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-watch&action=edit tooltip-watch]<br> -[[MediaWiki_talk:Tooltip-watch|Talk]] -</td><td> -Add this page to your watchlist &#91;alt-w] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-watchlist&action=edit tooltip-watchlist]<br> -[[MediaWiki_talk:Tooltip-watchlist|Talk]] -</td><td> -The list of pages you&#39;re monitoring for changes. &#91;alt-l] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-whatlinkshere&action=edit tooltip-whatlinkshere]<br> -[[MediaWiki_talk:Tooltip-whatlinkshere|Talk]] -</td><td> -List of all wiki pages that link here &#91;alt-b] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uclinks&action=edit uclinks]<br> -[[MediaWiki_talk:Uclinks|Talk]] -</td><td> -View the last $1 changes; view the last $2 days. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ucnote&action=edit ucnote]<br> -[[MediaWiki_talk:Ucnote|Talk]] -</td><td> -Below are this user&#39;s last &lt;b&gt;$1&lt;/b&gt; changes in the last &lt;b&gt;$2&lt;/b&gt; days. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uctop&action=edit uctop]<br> -[[MediaWiki_talk:Uctop|Talk]] -</td><td> - (top) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unblockip&action=edit unblockip]<br> -[[MediaWiki_talk:Unblockip|Talk]] -</td><td> -Unblock user -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unblockiptext&action=edit unblockiptext]<br> -[[MediaWiki_talk:Unblockiptext|Talk]] -</td><td> -Use the form below to restore write access -to a previously blocked IP address or username. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unblocklink&action=edit unblocklink]<br> -[[MediaWiki_talk:Unblocklink|Talk]] -</td><td> -unblock -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unblocklogentry&action=edit unblocklogentry]<br> -[[MediaWiki_talk:Unblocklogentry|Talk]] -</td><td> -unblocked &quot;$1&quot; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undelete&action=edit undelete]<br> -[[MediaWiki_talk:Undelete|Talk]] -</td><td> -Restore deleted page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undelete_short&action=edit undelete_short]<br> -[[MediaWiki_talk:Undelete_short|Talk]] -</td><td> -Undelete $1 edits -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletearticle&action=edit undeletearticle]<br> -[[MediaWiki_talk:Undeletearticle|Talk]] -</td><td> -Restore deleted page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletebtn&action=edit undeletebtn]<br> -[[MediaWiki_talk:Undeletebtn|Talk]] -</td><td> -Restore! -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletedarticle&action=edit undeletedarticle]<br> -[[MediaWiki_talk:Undeletedarticle|Talk]] -</td><td> -restored &quot;$1&quot; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletedtext&action=edit undeletedtext]<br> -[[MediaWiki_talk:Undeletedtext|Talk]] -</td><td> -&#91;&#91;$1]] has been successfully restored. -See &#91;&#91;Wiktionary:Deletion_log]] for a record of recent deletions and restorations. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletehistory&action=edit undeletehistory]<br> -[[MediaWiki_talk:Undeletehistory|Talk]] -</td><td> -If you restore the page, all revisions will be restored to the history. -If a new page with the same name has been created since the deletion, the restored -revisions will appear in the prior history, and the current revision of the live page -will not be automatically replaced. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletepage&action=edit undeletepage]<br> -[[MediaWiki_talk:Undeletepage|Talk]] -</td><td> -View and restore deleted pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletepagetext&action=edit undeletepagetext]<br> -[[MediaWiki_talk:Undeletepagetext|Talk]] -</td><td> -The following pages have been deleted but are still in the archive and -can be restored. The archive may be periodically cleaned out. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeleterevision&action=edit undeleterevision]<br> -[[MediaWiki_talk:Undeleterevision|Talk]] -</td><td> -Deleted revision as of $1 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeleterevisions&action=edit undeleterevisions]<br> -[[MediaWiki_talk:Undeleterevisions|Talk]] -</td><td> -$1 revisions archived -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unexpected&action=edit unexpected]<br> -[[MediaWiki_talk:Unexpected|Talk]] -</td><td> -Unexpected value: &quot;$1&quot;=&quot;$2&quot;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockbtn&action=edit unlockbtn]<br> -[[MediaWiki_talk:Unlockbtn|Talk]] -</td><td> -Unlock database -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockconfirm&action=edit unlockconfirm]<br> -[[MediaWiki_talk:Unlockconfirm|Talk]] -</td><td> -Yes, I really want to unlock the database. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockdb&action=edit unlockdb]<br> -[[MediaWiki_talk:Unlockdb|Talk]] -</td><td> -Unlock database -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockdbsuccesssub&action=edit unlockdbsuccesssub]<br> -[[MediaWiki_talk:Unlockdbsuccesssub|Talk]] -</td><td> -Database lock removed -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockdbsuccesstext&action=edit unlockdbsuccesstext]<br> -[[MediaWiki_talk:Unlockdbsuccesstext|Talk]] -</td><td> -The database has been unlocked. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockdbtext&action=edit unlockdbtext]<br> -[[MediaWiki_talk:Unlockdbtext|Talk]] -</td><td> -Unlocking the database will restore the ability of all -users to edit pages, change their preferences, edit their watchlists, and -other things requiring changes in the database. -Please confirm that this is what you intend to do. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotect&action=edit unprotect]<br> -[[MediaWiki_talk:Unprotect|Talk]] -</td><td> -Unprotect -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotectcomment&action=edit unprotectcomment]<br> -[[MediaWiki_talk:Unprotectcomment|Talk]] -</td><td> -Reason for unprotecting -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotectedarticle&action=edit unprotectedarticle]<br> -[[MediaWiki_talk:Unprotectedarticle|Talk]] -</td><td> -unprotected &#91;&#91;$1]] -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotectsub&action=edit unprotectsub]<br> -[[MediaWiki_talk:Unprotectsub|Talk]] -</td><td> -(Unprotecting &quot;$1&quot;) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotectthispage&action=edit unprotectthispage]<br> -[[MediaWiki_talk:Unprotectthispage|Talk]] -</td><td> -Unprotect this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unusedimages&action=edit unusedimages]<br> -[[MediaWiki_talk:Unusedimages|Talk]] -</td><td> -Unused images -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unusedimagestext&action=edit unusedimagestext]<br> -[[MediaWiki_talk:Unusedimagestext|Talk]] -</td><td> -&lt;p&gt;Please note that other web sites may link to an image with -a direct URL, and so may still be listed here despite being -in active use. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unwatch&action=edit unwatch]<br> -[[MediaWiki_talk:Unwatch|Talk]] -</td><td> -Unwatch -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unwatchthispage&action=edit unwatchthispage]<br> -[[MediaWiki_talk:Unwatchthispage|Talk]] -</td><td> -Stop watching -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Updated&action=edit updated]<br> -[[MediaWiki_talk:Updated|Talk]] -</td><td> -(Updated) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Upload&action=edit upload]<br> -[[MediaWiki_talk:Upload|Talk]] -</td><td> -Upload file -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadbtn&action=edit uploadbtn]<br> -[[MediaWiki_talk:Uploadbtn|Talk]] -</td><td> -Upload file -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploaddisabled&action=edit uploaddisabled]<br> -[[MediaWiki_talk:Uploaddisabled|Talk]] -</td><td> -Sorry, uploading is disabled. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadedfiles&action=edit uploadedfiles]<br> -[[MediaWiki_talk:Uploadedfiles|Talk]] -</td><td> -Uploaded files -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadedimage&action=edit uploadedimage]<br> -[[MediaWiki_talk:Uploadedimage|Talk]] -</td><td> -uploaded &quot;$1&quot; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploaderror&action=edit uploaderror]<br> -[[MediaWiki_talk:Uploaderror|Talk]] -</td><td> -Upload error -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadfile&action=edit uploadfile]<br> -[[MediaWiki_talk:Uploadfile|Talk]] -</td><td> -Upload images, sounds, documents etc. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadlink&action=edit uploadlink]<br> -[[MediaWiki_talk:Uploadlink|Talk]] -</td><td> -Upload images -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadlog&action=edit uploadlog]<br> -[[MediaWiki_talk:Uploadlog|Talk]] -</td><td> -upload log -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadlogpage&action=edit uploadlogpage]<br> -[[MediaWiki_talk:Uploadlogpage|Talk]] -</td><td> -Upload_log -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadlogpagetext&action=edit uploadlogpagetext]<br> -[[MediaWiki_talk:Uploadlogpagetext|Talk]] -</td><td> -Below is a list of the most recent file uploads. -All times shown are server time (UTC). -&lt;ul&gt; -&lt;/ul&gt; - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadnologin&action=edit uploadnologin]<br> -[[MediaWiki_talk:Uploadnologin|Talk]] -</td><td> -Not logged in -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadnologintext&action=edit uploadnologintext]<br> -[[MediaWiki_talk:Uploadnologintext|Talk]] -</td><td> -You must be &lt;a href=&quot;/wiki/Special:Userlogin&quot;&gt;logged in&lt;/a&gt; -to upload files. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadtext&action=edit uploadtext]<br> -[[MediaWiki_talk:Uploadtext|Talk]] -</td><td> -&lt;strong&gt;STOP!&lt;/strong&gt; Before you upload here, -make sure to read and follow the &lt;a href=&quot;/wiki/Special:Image_use_policy&quot;&gt;image use policy&lt;/a&gt;. -&lt;p&gt;If a file with the name you are specifying already -exists on the wiki, it&#39;ll be replaced without warning. -So unless you mean to update a file, it&#39;s a good idea -to first check if such a file exists. -&lt;p&gt;To view or search previously uploaded images, -go to the &lt;a href=&quot;/wiki/Special:Imagelist&quot;&gt;list of uploaded images&lt;/a&gt;. -Uploads and deletions are logged on the &lt;a href=&quot;/wiki/Wiktionary:Upload_log&quot;&gt;upload log&lt;/a&gt;. -&lt;/p&gt;&lt;p&gt;Use the form below to upload new image files for use in -illustrating your pages. -On most browsers, you will see a &quot;Browse...&quot; button, which will -bring up your operating system&#39;s standard file open dialog. -Choosing a file will fill the name of that file into the text -field next to the button. -You must also check the box affirming that you are not -violating any copyrights by uploading the file. -Press the &quot;Upload&quot; button to finish the upload. -This may take some time if you have a slow internet connection. -&lt;p&gt;The preferred formats are JPEG for photographic images, PNG -for drawings and other iconic images, and OGG for sounds. -Please name your files descriptively to avoid confusion. -To include the image in a page, use a link in the form -&lt;b&gt;&#91;&#91;Image:file.jpg]]&lt;/b&gt; or &lt;b&gt;&#91;&#91;Image:file.png&#124;alt text]]&lt;/b&gt; -or &lt;b&gt;&#91;&#91;Media:file.ogg]]&lt;/b&gt; for sounds. -&lt;p&gt;Please note that as with wiki pages, others may edit or -delete your uploads if they think it serves the project, and -you may be blocked from uploading if you abuse the system. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadwarning&action=edit uploadwarning]<br> -[[MediaWiki_talk:Uploadwarning|Talk]] -</td><td> -Upload warning -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:User_rights_set&action=edit user_rights_set]<br> -[[MediaWiki_talk:User_rights_set|Talk]] -</td><td> -&lt;b&gt;User rights for &quot;$1&quot; updated&lt;/b&gt; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Usercssjs&action=edit usercssjs]<br> -[[MediaWiki_talk:Usercssjs|Talk]] -</td><td> -&#39;&#39;&#39;Note:&#39;&#39;&#39; After saving, you have to tell your bowser to get the new version: &#39;&#39;&#39;Mozilla:&#39;&#39;&#39; click &#39;&#39;reload&#39;&#39;(or &#39;&#39;ctrl-r&#39;&#39;), &#39;&#39;&#39;IE / Opera:&#39;&#39;&#39; &#39;&#39;ctrl-f5&#39;&#39;, &#39;&#39;&#39;Safari:&#39;&#39;&#39; &#39;&#39;cmd-r&#39;&#39;, &#39;&#39;&#39;Konqueror&#39;&#39;&#39; &#39;&#39;ctrl-r&#39;&#39;. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Usercssjsyoucanpreview&action=edit usercssjsyoucanpreview]<br> -[[MediaWiki_talk:Usercssjsyoucanpreview|Talk]] -</td><td> -&lt;strong&gt;Tip:&lt;/strong&gt; Use the &#39;Show preview&#39; button to test your new css/js before saving. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Usercsspreview&action=edit usercsspreview]<br> -[[MediaWiki_talk:Usercsspreview|Talk]] -</td><td> -&#39;&#39;&#39;Remember that you are only previewing your user css, it has not yet been saved!&#39;&#39;&#39; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userexists&action=edit userexists]<br> -[[MediaWiki_talk:Userexists|Talk]] -</td><td> -The user name you entered is already in use. Please choose a different name. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userjspreview&action=edit userjspreview]<br> -[[MediaWiki_talk:Userjspreview|Talk]] -</td><td> -&#39;&#39;&#39;Remember that you are only testing/previewing your user javascript, it has not yet been saved!&#39;&#39;&#39; -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userlogin&action=edit userlogin]<br> -[[MediaWiki_talk:Userlogin|Talk]] -</td><td> -Log in -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userlogout&action=edit userlogout]<br> -[[MediaWiki_talk:Userlogout|Talk]] -</td><td> -Log out -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Usermailererror&action=edit usermailererror]<br> -[[MediaWiki_talk:Usermailererror|Talk]] -</td><td> -Mail object returned error: -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userpage&action=edit userpage]<br> -[[MediaWiki_talk:Userpage|Talk]] -</td><td> -View user page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userstats&action=edit userstats]<br> -[[MediaWiki_talk:Userstats|Talk]] -</td><td> -User statistics -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userstatstext&action=edit userstatstext]<br> -[[MediaWiki_talk:Userstatstext|Talk]] -</td><td> -There are &#39;&#39;&#39;$1&#39;&#39;&#39; registered users. -&#39;&#39;&#39;$2&#39;&#39;&#39; of these are administrators (see $3). -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Version&action=edit version]<br> -[[MediaWiki_talk:Version|Talk]] -</td><td> -Version -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Viewcount&action=edit viewcount]<br> -[[MediaWiki_talk:Viewcount|Talk]] -</td><td> -This page has been accessed $1 times. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Viewprevnext&action=edit viewprevnext]<br> -[[MediaWiki_talk:Viewprevnext|Talk]] -</td><td> -View ($1) ($2) ($3). -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Viewsource&action=edit viewsource]<br> -[[MediaWiki_talk:Viewsource|Talk]] -</td><td> -View source -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Viewtalkpage&action=edit viewtalkpage]<br> -[[MediaWiki_talk:Viewtalkpage|Talk]] -</td><td> -View discussion -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wantedpages&action=edit wantedpages]<br> -[[MediaWiki_talk:Wantedpages|Talk]] -</td><td> -Wanted pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watch&action=edit watch]<br> -[[MediaWiki_talk:Watch|Talk]] -</td><td> -Watch -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchdetails&action=edit watchdetails]<br> -[[MediaWiki_talk:Watchdetails|Talk]] -</td><td> -($1 pages watched not counting talk pages; -$2 total pages edited since cutoff; -$3... -&lt;a href=&#39;$4&#39;&gt;show and edit complete list&lt;/a&gt;.) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watcheditlist&action=edit watcheditlist]<br> -[[MediaWiki_talk:Watcheditlist|Talk]] -</td><td> -Here&#39;s an alphabetical list of your -watched pages. Check the boxes of pages you want to remove -from your watchlist and click the &#39;remove checked&#39; button -at the bottom of the screen. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchlist&action=edit watchlist]<br> -[[MediaWiki_talk:Watchlist|Talk]] -</td><td> -My watchlist -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchlistcontains&action=edit watchlistcontains]<br> -[[MediaWiki_talk:Watchlistcontains|Talk]] -</td><td> -Your watchlist contains $1 pages. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchlistsub&action=edit watchlistsub]<br> -[[MediaWiki_talk:Watchlistsub|Talk]] -</td><td> -(for user &quot;$1&quot;) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchmethod-list&action=edit watchmethod-list]<br> -[[MediaWiki_talk:Watchmethod-list|Talk]] -</td><td> -checking watched pages for recent edits -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchmethod-recent&action=edit watchmethod-recent]<br> -[[MediaWiki_talk:Watchmethod-recent|Talk]] -</td><td> -checking recent edits for watched pages -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchnochange&action=edit watchnochange]<br> -[[MediaWiki_talk:Watchnochange|Talk]] -</td><td> -None of your watched items were edited in the time period displayed. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchnologin&action=edit watchnologin]<br> -[[MediaWiki_talk:Watchnologin|Talk]] -</td><td> -Not logged in -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchnologintext&action=edit watchnologintext]<br> -[[MediaWiki_talk:Watchnologintext|Talk]] -</td><td> -You must be &lt;a href=&quot;/wiki/Special:Userlogin&quot;&gt;logged in&lt;/a&gt; -to modify your watchlist. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchthis&action=edit watchthis]<br> -[[MediaWiki_talk:Watchthis|Talk]] -</td><td> -Watch this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchthispage&action=edit watchthispage]<br> -[[MediaWiki_talk:Watchthispage|Talk]] -</td><td> -Watch this page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Welcomecreation&action=edit welcomecreation]<br> -[[MediaWiki_talk:Welcomecreation|Talk]] -</td><td> -&lt;h2&gt;Welcome, $1!&lt;/h2&gt;&lt;p&gt;Your account has been created. -Don&#39;t forget to change your Wiktionary preferences. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whatlinkshere&action=edit whatlinkshere]<br> -[[MediaWiki_talk:Whatlinkshere|Talk]] -</td><td> -What links here -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistacctext&action=edit whitelistacctext]<br> -[[MediaWiki_talk:Whitelistacctext|Talk]] -</td><td> -To be allowed to create accounts in this Wiki you have to &#91;&#91;Special:Userlogin&#124;log]] in and have the appropriate permissions. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistacctitle&action=edit whitelistacctitle]<br> -[[MediaWiki_talk:Whitelistacctitle|Talk]] -</td><td> -You are not allowed to create an account -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistedittext&action=edit whitelistedittext]<br> -[[MediaWiki_talk:Whitelistedittext|Talk]] -</td><td> -You have to &#91;&#91;Special:Userlogin&#124;login]] to edit pages. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistedittitle&action=edit whitelistedittitle]<br> -[[MediaWiki_talk:Whitelistedittitle|Talk]] -</td><td> -Login required to edit -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistreadtext&action=edit whitelistreadtext]<br> -[[MediaWiki_talk:Whitelistreadtext|Talk]] -</td><td> -You have to &#91;&#91;Special:Userlogin&#124;login]] to read pages. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistreadtitle&action=edit whitelistreadtitle]<br> -[[MediaWiki_talk:Whitelistreadtitle|Talk]] -</td><td> -Login required to read -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wikipediapage&action=edit wikipediapage]<br> -[[MediaWiki_talk:Wikipediapage|Talk]] -</td><td> -View project page -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wikititlesuffix&action=edit wikititlesuffix]<br> -[[MediaWiki_talk:Wikititlesuffix|Talk]] -</td><td> -Wiktionary -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wlnote&action=edit wlnote]<br> -[[MediaWiki_talk:Wlnote|Talk]] -</td><td> -Below are the last $1 changes in the last &lt;b&gt;$2&lt;/b&gt; hours. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wlsaved&action=edit wlsaved]<br> -[[MediaWiki_talk:Wlsaved|Talk]] -</td><td> -This is a saved version of your watchlist. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wlshowlast&action=edit wlshowlast]<br> -[[MediaWiki_talk:Wlshowlast|Talk]] -</td><td> -Show last $1 hours $2 days $3 -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wrong_wfQuery_params&action=edit wrong_wfQuery_params]<br> -[[MediaWiki_talk:Wrong_wfQuery_params|Talk]] -</td><td> -Incorrect parameters to wfQuery()&lt;br /&gt; -Function: $1&lt;br /&gt; -Query: $2 - -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wrongpassword&action=edit wrongpassword]<br> -[[MediaWiki_talk:Wrongpassword|Talk]] -</td><td> -The password you entered is incorrect. Please try again. -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourdiff&action=edit yourdiff]<br> -[[MediaWiki_talk:Yourdiff|Talk]] -</td><td> -Differences -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Youremail&action=edit youremail]<br> -[[MediaWiki_talk:Youremail|Talk]] -</td><td> -Your email* -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourname&action=edit yourname]<br> -[[MediaWiki_talk:Yourname|Talk]] -</td><td> -Your user name -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yournick&action=edit yournick]<br> -[[MediaWiki_talk:Yournick|Talk]] -</td><td> -Your nickname (for signatures) -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourpassword&action=edit yourpassword]<br> -[[MediaWiki_talk:Yourpassword|Talk]] -</td><td> -Your password -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourpasswordagain&action=edit yourpasswordagain]<br> -[[MediaWiki_talk:Yourpasswordagain|Talk]] -</td><td> -Retype password -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourrealname&action=edit yourrealname]<br> -[[MediaWiki_talk:Yourrealname|Talk]] -</td><td> -Your real name* -</td><td> - -</td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourtext&action=edit yourtext]<br> -[[MediaWiki_talk:Yourtext|Talk]] -</td><td> -Your text -</td><td> - -</td></tr></table> - - \ No newline at end of file diff --git a/tests/parser/preprocess/All_system_messages.txt b/tests/parser/preprocess/All_system_messages.txt deleted file mode 100644 index 3c30da94..00000000 --- a/tests/parser/preprocess/All_system_messages.txt +++ /dev/null @@ -1,5624 +0,0 @@ -{{int:allmessagestext}} - -
            -'''Name''' - -'''Default text''' - -'''Current text''' -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:1movedto2&action=edit 1movedto2]
            -[[MediaWiki_talk:1movedto2|Talk]] -
            -$1 moved to $2 - -{{int:1movedto2}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Monobook.css&action=edit Monobook.css]
            -[[MediaWiki_talk:Monobook.css|Talk]] -
            -/* edit this file to customize the monobook skin for the entire site */ - -{{int:Monobook.css}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:About&action=edit about]
            -[[MediaWiki_talk:About|Talk]] -
            -About - -{{int:About}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Aboutpage&action=edit aboutpage]
            -[[MediaWiki_talk:Aboutpage|Talk]] -
            -Wiktionary:About - -{{int:Aboutpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Aboutwikipedia&action=edit aboutwikipedia]
            -[[MediaWiki_talk:Aboutwikipedia|Talk]] -
            -About Wiktionary - -{{int:Aboutwikipedia}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-addsection&action=edit accesskey-addsection]
            -[[MediaWiki_talk:Accesskey-addsection|Talk]] -
            -+ - -{{int:Accesskey-addsection}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-anontalk&action=edit accesskey-anontalk]
            -[[MediaWiki_talk:Accesskey-anontalk|Talk]] -
            -n - -{{int:Accesskey-anontalk}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-anonuserpage&action=edit accesskey-anonuserpage]
            -[[MediaWiki_talk:Accesskey-anonuserpage|Talk]] -
            -. - -{{int:Accesskey-anonuserpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-article&action=edit accesskey-article]
            -[[MediaWiki_talk:Accesskey-article|Talk]] -
            -a - -{{int:Accesskey-article}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-compareselectedversions&action=edit accesskey-compareselectedversions]
            -[[MediaWiki_talk:Accesskey-compareselectedversions|Talk]] -
            -v - -{{int:Accesskey-compareselectedversions}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-contributions&action=edit accesskey-contributions]
            -[[MediaWiki_talk:Accesskey-contributions|Talk]] -
            -&lt;accesskey-contributions&gt; - -{{int:Accesskey-contributions}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-currentevents&action=edit accesskey-currentevents]
            -[[MediaWiki_talk:Accesskey-currentevents|Talk]] -
            -&lt;accesskey-currentevents&gt; - -{{int:Accesskey-currentevents}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-delete&action=edit accesskey-delete]
            -[[MediaWiki_talk:Accesskey-delete|Talk]] -
            -d - -{{int:Accesskey-delete}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-edit&action=edit accesskey-edit]
            -[[MediaWiki_talk:Accesskey-edit|Talk]] -
            -e - -{{int:Accesskey-edit}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-emailuser&action=edit accesskey-emailuser]
            -[[MediaWiki_talk:Accesskey-emailuser|Talk]] -
            -&lt;accesskey-emailuser&gt; - -{{int:Accesskey-emailuser}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-help&action=edit accesskey-help]
            -[[MediaWiki_talk:Accesskey-help|Talk]] -
            -&lt;accesskey-help&gt; - -{{int:Accesskey-help}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-history&action=edit accesskey-history]
            -[[MediaWiki_talk:Accesskey-history|Talk]] -
            -h - -{{int:Accesskey-history}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-login&action=edit accesskey-login]
            -[[MediaWiki_talk:Accesskey-login|Talk]] -
            -o - -{{int:Accesskey-login}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-logout&action=edit accesskey-logout]
            -[[MediaWiki_talk:Accesskey-logout|Talk]] -
            -o - -{{int:Accesskey-logout}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-mainpage&action=edit accesskey-mainpage]
            -[[MediaWiki_talk:Accesskey-mainpage|Talk]] -
            -z - -{{int:Accesskey-mainpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-minoredit&action=edit accesskey-minoredit]
            -[[MediaWiki_talk:Accesskey-minoredit|Talk]] -
            -i - -{{int:Accesskey-minoredit}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-move&action=edit accesskey-move]
            -[[MediaWiki_talk:Accesskey-move|Talk]] -
            -m - -{{int:Accesskey-move}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-mycontris&action=edit accesskey-mycontris]
            -[[MediaWiki_talk:Accesskey-mycontris|Talk]] -
            -y - -{{int:Accesskey-mycontris}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-mytalk&action=edit accesskey-mytalk]
            -[[MediaWiki_talk:Accesskey-mytalk|Talk]] -
            -n - -{{int:Accesskey-mytalk}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-portal&action=edit accesskey-portal]
            -[[MediaWiki_talk:Accesskey-portal|Talk]] -
            -&lt;accesskey-portal&gt; - -{{int:Accesskey-portal}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-preferences&action=edit accesskey-preferences]
            -[[MediaWiki_talk:Accesskey-preferences|Talk]] -
            -&lt;accesskey-preferences&gt; - -{{int:Accesskey-preferences}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-preview&action=edit accesskey-preview]
            -[[MediaWiki_talk:Accesskey-preview|Talk]] -
            -p - -{{int:Accesskey-preview}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-protect&action=edit accesskey-protect]
            -[[MediaWiki_talk:Accesskey-protect|Talk]] -
            -= - -{{int:Accesskey-protect}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-randompage&action=edit accesskey-randompage]
            -[[MediaWiki_talk:Accesskey-randompage|Talk]] -
            -x - -{{int:Accesskey-randompage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-recentchanges&action=edit accesskey-recentchanges]
            -[[MediaWiki_talk:Accesskey-recentchanges|Talk]] -
            -r - -{{int:Accesskey-recentchanges}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-recentchangeslinked&action=edit accesskey-recentchangeslinked]
            -[[MediaWiki_talk:Accesskey-recentchangeslinked|Talk]] -
            -c - -{{int:Accesskey-recentchangeslinked}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-save&action=edit accesskey-save]
            -[[MediaWiki_talk:Accesskey-save|Talk]] -
            -s - -{{int:Accesskey-save}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-search&action=edit accesskey-search]
            -[[MediaWiki_talk:Accesskey-search|Talk]] -
            -f - -{{int:Accesskey-search}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-sitesupport&action=edit accesskey-sitesupport]
            -[[MediaWiki_talk:Accesskey-sitesupport|Talk]] -
            -&lt;accesskey-sitesupport&gt; - -{{int:Accesskey-sitesupport}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-specialpage&action=edit accesskey-specialpage]
            -[[MediaWiki_talk:Accesskey-specialpage|Talk]] -
            -&lt;accesskey-specialpage&gt; - -{{int:Accesskey-specialpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-specialpages&action=edit accesskey-specialpages]
            -[[MediaWiki_talk:Accesskey-specialpages|Talk]] -
            -q - -{{int:Accesskey-specialpages}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-talk&action=edit accesskey-talk]
            -[[MediaWiki_talk:Accesskey-talk|Talk]] -
            -t - -{{int:Accesskey-talk}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-undelete&action=edit accesskey-undelete]
            -[[MediaWiki_talk:Accesskey-undelete|Talk]] -
            -d - -{{int:Accesskey-undelete}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-unwatch&action=edit accesskey-unwatch]
            -[[MediaWiki_talk:Accesskey-unwatch|Talk]] -
            -w - -{{int:Accesskey-unwatch}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-upload&action=edit accesskey-upload]
            -[[MediaWiki_talk:Accesskey-upload|Talk]] -
            -u - -{{int:Accesskey-upload}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-userpage&action=edit accesskey-userpage]
            -[[MediaWiki_talk:Accesskey-userpage|Talk]] -
            -. - -{{int:Accesskey-userpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-viewsource&action=edit accesskey-viewsource]
            -[[MediaWiki_talk:Accesskey-viewsource|Talk]] -
            -e - -{{int:Accesskey-viewsource}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-watch&action=edit accesskey-watch]
            -[[MediaWiki_talk:Accesskey-watch|Talk]] -
            -w - -{{int:Accesskey-watch}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-watchlist&action=edit accesskey-watchlist]
            -[[MediaWiki_talk:Accesskey-watchlist|Talk]] -
            -l - -{{int:Accesskey-watchlist}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accesskey-whatlinkshere&action=edit accesskey-whatlinkshere]
            -[[MediaWiki_talk:Accesskey-whatlinkshere|Talk]] -
            -b - -{{int:Accesskey-whatlinkshere}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accmailtext&action=edit accmailtext]
            -[[MediaWiki_talk:Accmailtext|Talk]] -
            -The Password for '$1' has been sent to $2. - -{{int:Accmailtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Accmailtitle&action=edit accmailtitle]
            -[[MediaWiki_talk:Accmailtitle|Talk]] -
            -Password sent. - -{{int:Accmailtitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Actioncomplete&action=edit actioncomplete]
            -[[MediaWiki_talk:Actioncomplete|Talk]] -
            -Action complete - -{{int:Actioncomplete}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Addedwatch&action=edit addedwatch]
            -[[MediaWiki_talk:Addedwatch|Talk]] -
            -Added to watchlist - -{{int:Addedwatch}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Addedwatchtext&action=edit addedwatchtext]
            -[[MediaWiki_talk:Addedwatchtext|Talk]] -
            -The page "$1" has been added to your [[Special:Watchlist|watchlist]]. -Future changes to this page and its associated Talk page will be listed there, -and the page will appear '''bolded''' in the [[Special:Recentchanges|list of recent changes]] to -make it easier to pick out. - -<p>If you want to remove the page from your watchlist later, click "Stop watching" in the sidebar. - -{{int:Addedwatchtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Addsection&action=edit addsection]
            -[[MediaWiki_talk:Addsection|Talk]] -
            -+ - -{{int:Addsection}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Administrators&action=edit administrators]
            -[[MediaWiki_talk:Administrators|Talk]] -
            -Wiktionary:Administrators - -{{int:Administrators}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Affirmation&action=edit affirmation]
            -[[MediaWiki_talk:Affirmation|Talk]] -
            -I affirm that the copyright holder of this file -agrees to license it under the terms of the $1. - -{{int:Affirmation}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:All&action=edit all]
            -[[MediaWiki_talk:All|Talk]] -
            -all - -{{int:All}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Allmessages&action=edit allmessages]
            -[[MediaWiki_talk:Allmessages|Talk]] -
            -All system messages - -{{int:Allmessages}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Allmessagestext&action=edit allmessagestext]
            -[[MediaWiki_talk:Allmessagestext|Talk]] -
            -This is a list of all system messages available in the MediaWiki: namespace. - -{{int:Allmessagestext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Allpages&action=edit allpages]
            -[[MediaWiki_talk:Allpages|Talk]] -
            -All pages - -{{int:Allpages}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Alphaindexline&action=edit alphaindexline]
            -[[MediaWiki_talk:Alphaindexline|Talk]] -
            -$1 to $2 - -{{int:Alphaindexline}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Alreadyloggedin&action=edit alreadyloggedin]
            -[[MediaWiki_talk:Alreadyloggedin|Talk]] -
            -<font color=red><b>User $1, you are already logged in!</b></font><br /> - - -{{int:Alreadyloggedin}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Alreadyrolled&action=edit alreadyrolled]
            -[[MediaWiki_talk:Alreadyrolled|Talk]] -
            -Cannot rollback last edit of [[$1]] -by [[User:$2|$2]] ([[User talk:$2|Talk]]); someone else has edited or rolled back the page already. - -Last edit was by [[User:$3|$3]] ([[User talk:$3|Talk]]). - -{{int:Alreadyrolled}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ancientpages&action=edit ancientpages]
            -[[MediaWiki_talk:Ancientpages|Talk]] -
            -Oldest pages - -{{int:Ancientpages}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:And&action=edit and]
            -[[MediaWiki_talk:And|Talk]] -
            -and - -{{int:And}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Anontalk&action=edit anontalk]
            -[[MediaWiki_talk:Anontalk|Talk]] -
            -Talk for this IP - -{{int:Anontalk}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Anontalkpagetext&action=edit anontalkpagetext]
            -[[MediaWiki_talk:Anontalkpagetext|Talk]] -
            -----''This is the discussion page for an anonymous user who has not created an account yet or who does not use it. We therefore have to use the numerical [[IP address]] to identify him/her. Such an IP address can be shared by several users. If you are an anonymous user and feel that irrelevant comments have been directed at you, please [[Special:Userlogin|create an account or log in]] to avoid future confusion with other anonymous users.'' - -{{int:Anontalkpagetext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Anonymous&action=edit anonymous]
            -[[MediaWiki_talk:Anonymous|Talk]] -
            -Anonymous user(s) of Wiktionary - -{{int:Anonymous}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Article&action=edit article]
            -[[MediaWiki_talk:Article|Talk]] -
            -Content page - -{{int:Article}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Articleexists&action=edit articleexists]
            -[[MediaWiki_talk:Articleexists|Talk]] -
            -A page of that name already exists, or the -name you have chosen is not valid. -Please choose another name. - -{{int:Articleexists}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Articlepage&action=edit articlepage]
            -[[MediaWiki_talk:Articlepage|Talk]] -
            -View content page - -{{int:Articlepage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Asksql&action=edit asksql]
            -[[MediaWiki_talk:Asksql|Talk]] -
            -SQL query - -{{int:Asksql}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Asksqltext&action=edit asksqltext]
            -[[MediaWiki_talk:Asksqltext|Talk]] -
            -Use the form below to make a direct query of the -database. -Use single quotes ('like this') to delimit string literals. -This can often add considerable load to the server, so please use -this function sparingly. - -{{int:Asksqltext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Autoblocker&action=edit autoblocker]
            -[[MediaWiki_talk:Autoblocker|Talk]] -
            -Autoblocked because you share an IP address with "$1". Reason "$2". - -{{int:Autoblocker}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badarticleerror&action=edit badarticleerror]
            -[[MediaWiki_talk:Badarticleerror|Talk]] -
            -This action cannot be performed on this page. - -{{int:Badarticleerror}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badfilename&action=edit badfilename]
            -[[MediaWiki_talk:Badfilename|Talk]] -
            -Image name has been changed to "$1". - -{{int:Badfilename}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badfiletype&action=edit badfiletype]
            -[[MediaWiki_talk:Badfiletype|Talk]] -
            -".$1" is not a recommended image file format. - -{{int:Badfiletype}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badipaddress&action=edit badipaddress]
            -[[MediaWiki_talk:Badipaddress|Talk]] -
            -Invalid IP address - -{{int:Badipaddress}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badquery&action=edit badquery]
            -[[MediaWiki_talk:Badquery|Talk]] -
            -Badly formed search query - -{{int:Badquery}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badquerytext&action=edit badquerytext]
            -[[MediaWiki_talk:Badquerytext|Talk]] -
            -We could not process your query. -This is probably because you have attempted to search for a -word fewer than three letters long, which is not yet supported. -It could also be that you have mistyped the expression, for -example "fish and and scales". -Please try another query. - -{{int:Badquerytext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badretype&action=edit badretype]
            -[[MediaWiki_talk:Badretype|Talk]] -
            -The passwords you entered do not match. - -{{int:Badretype}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badtitle&action=edit badtitle]
            -[[MediaWiki_talk:Badtitle|Talk]] -
            -Bad title - -{{int:Badtitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Badtitletext&action=edit badtitletext]
            -[[MediaWiki_talk:Badtitletext|Talk]] -
            -The requested page title was invalid, empty, or -an incorrectly linked inter-language or inter-wiki title. - -{{int:Badtitletext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blanknamespace&action=edit blanknamespace]
            -[[MediaWiki_talk:Blanknamespace|Talk]] -
            -(Main) - -{{int:Blanknamespace}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockedtext&action=edit blockedtext]
            -[[MediaWiki_talk:Blockedtext|Talk]] -
            -Your user name or IP address has been blocked by $1. -The reason given is this:<br />''$2''<p>You may contact $1 or one of the other -[[Wiktionary:Administrators|administrators]] to discuss the block. - -Note that you may not use the "email this user" feature unless you have a valid email address registered in your [[Special:Preferences|user preferences]]. - -Your IP address is $3. Please include this address in any queries you make. - - -{{int:Blockedtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockedtitle&action=edit blockedtitle]
            -[[MediaWiki_talk:Blockedtitle|Talk]] -
            -User is blocked - -{{int:Blockedtitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockip&action=edit blockip]
            -[[MediaWiki_talk:Blockip|Talk]] -
            -Block user - -{{int:Blockip}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockipsuccesssub&action=edit blockipsuccesssub]
            -[[MediaWiki_talk:Blockipsuccesssub|Talk]] -
            -Block succeeded - -{{int:Blockipsuccesssub}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockipsuccesstext&action=edit blockipsuccesstext]
            -[[MediaWiki_talk:Blockipsuccesstext|Talk]] -
            -"$1" has been blocked. -<br />See [[Special:Ipblocklist|IP block list]] to review blocks. - -{{int:Blockipsuccesstext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blockiptext&action=edit blockiptext]
            -[[MediaWiki_talk:Blockiptext|Talk]] -
            -Use the form below to block write access -from a specific IP address or username. -This should be done only only to prevent vandalism, and in -accordance with [[Wiktionary:Policy|policy]]. -Fill in a specific reason below (for example, citing particular -pages that were vandalized). - -{{int:Blockiptext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklink&action=edit blocklink]
            -[[MediaWiki_talk:Blocklink|Talk]] -
            -block - -{{int:Blocklink}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklistline&action=edit blocklistline]
            -[[MediaWiki_talk:Blocklistline|Talk]] -
            -$1, $2 blocked $3 (expires $4) - -{{int:Blocklistline}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklogentry&action=edit blocklogentry]
            -[[MediaWiki_talk:Blocklogentry|Talk]] -
            -blocked "$1" with an expiry time of $2 - -{{int:Blocklogentry}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklogpage&action=edit blocklogpage]
            -[[MediaWiki_talk:Blocklogpage|Talk]] -
            -Block_log - -{{int:Blocklogpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Blocklogtext&action=edit blocklogtext]
            -[[MediaWiki_talk:Blocklogtext|Talk]] -
            -This is a log of user blocking and unblocking actions. Automatically -blocked IP addresses are not be listed. See the [[Special:Ipblocklist|IP block list]] for -the list of currently operational bans and blocks. - -{{int:Blocklogtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bold_sample&action=edit bold_sample]
            -[[MediaWiki_talk:Bold_sample|Talk]] -
            -Bold text - -{{int:Bold_sample}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bold_tip&action=edit bold_tip]
            -[[MediaWiki_talk:Bold_tip|Talk]] -
            -Bold text - -{{int:Bold_tip}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Booksources&action=edit booksources]
            -[[MediaWiki_talk:Booksources|Talk]] -
            -Book sources - -{{int:Booksources}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Booksourcetext&action=edit booksourcetext]
            -[[MediaWiki_talk:Booksourcetext|Talk]] -
            -Below is a list of links to other sites that -sell new and used books, and may also have further information -about books you are looking for.Wiktionary is not affiliated with any of these businesses, and -this list should not be construed as an endorsement. - -{{int:Booksourcetext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Brokenredirects&action=edit brokenredirects]
            -[[MediaWiki_talk:Brokenredirects|Talk]] -
            -Broken Redirects - -{{int:Brokenredirects}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Brokenredirectstext&action=edit brokenredirectstext]
            -[[MediaWiki_talk:Brokenredirectstext|Talk]] -
            -The following redirects link to a non-existing pages. - -{{int:Brokenredirectstext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bugreports&action=edit bugreports]
            -[[MediaWiki_talk:Bugreports|Talk]] -
            -Bug reports - -{{int:Bugreports}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bugreportspage&action=edit bugreportspage]
            -[[MediaWiki_talk:Bugreportspage|Talk]] -
            -Wiktionary:Bug_reports - -{{int:Bugreportspage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bureaucratlog&action=edit bureaucratlog]
            -[[MediaWiki_talk:Bureaucratlog|Talk]] -
            -Bureaucrat_log - -{{int:Bureaucratlog}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bureaucratlogentry&action=edit bureaucratlogentry]
            -[[MediaWiki_talk:Bureaucratlogentry|Talk]] -
            -Rights for user "$1" set "$2" - -{{int:Bureaucratlogentry}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bureaucrattext&action=edit bureaucrattext]
            -[[MediaWiki_talk:Bureaucrattext|Talk]] -
            -The action you have requested can only be -performed by sysops with "bureaucrat" status. - -{{int:Bureaucrattext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bureaucrattitle&action=edit bureaucrattitle]
            -[[MediaWiki_talk:Bureaucrattitle|Talk]] -
            -Bureaucrat access required - -{{int:Bureaucrattitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bydate&action=edit bydate]
            -[[MediaWiki_talk:Bydate|Talk]] -
            -by date - -{{int:Bydate}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Byname&action=edit byname]
            -[[MediaWiki_talk:Byname|Talk]] -
            -by name - -{{int:Byname}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Bysize&action=edit bysize]
            -[[MediaWiki_talk:Bysize|Talk]] -
            -by size - -{{int:Bysize}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cachederror&action=edit cachederror]
            -[[MediaWiki_talk:Cachederror|Talk]] -
            -The following is a cached copy of the requested page, and may not be up to date. - -{{int:Cachederror}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cancel&action=edit cancel]
            -[[MediaWiki_talk:Cancel|Talk]] -
            -Cancel - -{{int:Cancel}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cannotdelete&action=edit cannotdelete]
            -[[MediaWiki_talk:Cannotdelete|Talk]] -
            -Could not delete the page or image specified. (It may have already been deleted by someone else.) - -{{int:Cannotdelete}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cantrollback&action=edit cantrollback]
            -[[MediaWiki_talk:Cantrollback|Talk]] -
            -Cannot revert edit; last contributor is only author of this page. - -{{int:Cantrollback}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Categories&action=edit categories]
            -[[MediaWiki_talk:Categories|Talk]] -
            -Categories - -{{int:Categories}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Category&action=edit category]
            -[[MediaWiki_talk:Category|Talk]] -
            -category - -{{int:Category}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Category_header&action=edit category_header]
            -[[MediaWiki_talk:Category_header|Talk]] -
            -Articles in category "$1" - -{{int:Category_header}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Changepassword&action=edit changepassword]
            -[[MediaWiki_talk:Changepassword|Talk]] -
            -Change password - -{{int:Changepassword}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Changes&action=edit changes]
            -[[MediaWiki_talk:Changes|Talk]] -
            -changes - -{{int:Changes}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Columns&action=edit columns]
            -[[MediaWiki_talk:Columns|Talk]] -
            -Columns - -{{int:Columns}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Commentedit&action=edit commentedit]
            -[[MediaWiki_talk:Commentedit|Talk]] -
            - (comment) - -{{int:Commentedit}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Compareselectedversions&action=edit compareselectedversions]
            -[[MediaWiki_talk:Compareselectedversions|Talk]] -
            -Compare selected versions - -{{int:Compareselectedversions}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirm&action=edit confirm]
            -[[MediaWiki_talk:Confirm|Talk]] -
            -Confirm - -{{int:Confirm}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmcheck&action=edit confirmcheck]
            -[[MediaWiki_talk:Confirmcheck|Talk]] -
            -Yes, I really want to delete this. - -{{int:Confirmcheck}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmdelete&action=edit confirmdelete]
            -[[MediaWiki_talk:Confirmdelete|Talk]] -
            -Confirm delete - -{{int:Confirmdelete}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmdeletetext&action=edit confirmdeletetext]
            -[[MediaWiki_talk:Confirmdeletetext|Talk]] -
            -You are about to permanently delete a page -or image along with all of its history from the database. -Please confirm that you intend to do this, that you understand the -consequences, and that you are doing this in accordance with -[[Wiktionary:Policy]]. - -{{int:Confirmdeletetext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmprotect&action=edit confirmprotect]
            -[[MediaWiki_talk:Confirmprotect|Talk]] -
            -Confirm protection - -{{int:Confirmprotect}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmprotecttext&action=edit confirmprotecttext]
            -[[MediaWiki_talk:Confirmprotecttext|Talk]] -
            -Do you really want to protect this page? - -{{int:Confirmprotecttext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmunprotect&action=edit confirmunprotect]
            -[[MediaWiki_talk:Confirmunprotect|Talk]] -
            -Confirm unprotection - -{{int:Confirmunprotect}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Confirmunprotecttext&action=edit confirmunprotecttext]
            -[[MediaWiki_talk:Confirmunprotecttext|Talk]] -
            -Do you really want to unprotect this page? - -{{int:Confirmunprotecttext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contextchars&action=edit contextchars]
            -[[MediaWiki_talk:Contextchars|Talk]] -
            -Characters of context per line - -{{int:Contextchars}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contextlines&action=edit contextlines]
            -[[MediaWiki_talk:Contextlines|Talk]] -
            -Lines to show per hit - -{{int:Contextlines}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contribslink&action=edit contribslink]
            -[[MediaWiki_talk:Contribslink|Talk]] -
            -contribs - -{{int:Contribslink}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contribsub&action=edit contribsub]
            -[[MediaWiki_talk:Contribsub|Talk]] -
            -For $1 - -{{int:Contribsub}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Contributions&action=edit contributions]
            -[[MediaWiki_talk:Contributions|Talk]] -
            -User contributions - -{{int:Contributions}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Copyright&action=edit copyright]
            -[[MediaWiki_talk:Copyright|Talk]] -
            -Content is available under $1. - -{{int:Copyright}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Copyrightpage&action=edit copyrightpage]
            -[[MediaWiki_talk:Copyrightpage|Talk]] -
            -Wiktionary:Copyrights - -{{int:Copyrightpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Copyrightpagename&action=edit copyrightpagename]
            -[[MediaWiki_talk:Copyrightpagename|Talk]] -
            -Wiktionary copyright - -{{int:Copyrightpagename}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Copyrightwarning&action=edit copyrightwarning]
            -[[MediaWiki_talk:Copyrightwarning|Talk]] -
            -Please note that all contributions to Wiktionary are -considered to be released under the GNU Free Documentation License -(see $1 for details). -If you don't want your writing to be edited mercilessly and redistributed -at will, then don't submit it here.<br /> -You are also promising us that you wrote this yourself, or copied it from a -public domain or similar free resource. -<strong>DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!</strong> - -{{int:Copyrightwarning}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Couldntremove&action=edit couldntremove]
            -[[MediaWiki_talk:Couldntremove|Talk]] -
            -Couldn't remove item '$1'... - -{{int:Couldntremove}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Createaccount&action=edit createaccount]
            -[[MediaWiki_talk:Createaccount|Talk]] -
            -Create new account - -{{int:Createaccount}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Createaccountmail&action=edit createaccountmail]
            -[[MediaWiki_talk:Createaccountmail|Talk]] -
            -by email - -{{int:Createaccountmail}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Cur&action=edit cur]
            -[[MediaWiki_talk:Cur|Talk]] -
            -cur - -{{int:Cur}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Currentevents&action=edit currentevents]
            -[[MediaWiki_talk:Currentevents|Talk]] -
            -Current events - -{{int:Currentevents}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Currentrev&action=edit currentrev]
            -[[MediaWiki_talk:Currentrev|Talk]] -
            -Current revision - -{{int:Currentrev}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Databaseerror&action=edit databaseerror]
            -[[MediaWiki_talk:Databaseerror|Talk]] -
            -Database error - -{{int:Databaseerror}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dateformat&action=edit dateformat]
            -[[MediaWiki_talk:Dateformat|Talk]] -
            -Date format - -{{int:Dateformat}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dberrortext&action=edit dberrortext]
            -[[MediaWiki_talk:Dberrortext|Talk]] -
            -A database query syntax error has occurred. -This could be because of an illegal search query (see $5), -or it may indicate a bug in the software. -The last attempted database query was: -<blockquote><tt>$1</tt></blockquote> -from within function "<tt>$2</tt>". -MySQL returned error "<tt>$3: $4</tt>". - -{{int:Dberrortext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dberrortextcl&action=edit dberrortextcl]
            -[[MediaWiki_talk:Dberrortextcl|Talk]] -
            -A database query syntax error has occurred. -The last attempted database query was: -"$1" -from within function "$2". -MySQL returned error "$3: $4". - - -{{int:Dberrortextcl}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deadendpages&action=edit deadendpages]
            -[[MediaWiki_talk:Deadendpages|Talk]] -
            -Dead-end pages - -{{int:Deadendpages}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Debug&action=edit debug]
            -[[MediaWiki_talk:Debug|Talk]] -
            -Debug - -{{int:Debug}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Defaultns&action=edit defaultns]
            -[[MediaWiki_talk:Defaultns|Talk]] -
            -Search in these namespaces by default: - -{{int:Defaultns}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Defemailsubject&action=edit defemailsubject]
            -[[MediaWiki_talk:Defemailsubject|Talk]] -
            -Wiktionary e-mail - -{{int:Defemailsubject}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Delete&action=edit delete]
            -[[MediaWiki_talk:Delete|Talk]] -
            -Delete - -{{int:Delete}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletecomment&action=edit deletecomment]
            -[[MediaWiki_talk:Deletecomment|Talk]] -
            -Reason for deletion - -{{int:Deletecomment}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletedarticle&action=edit deletedarticle]
            -[[MediaWiki_talk:Deletedarticle|Talk]] -
            -deleted "$1" - -{{int:Deletedarticle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletedtext&action=edit deletedtext]
            -[[MediaWiki_talk:Deletedtext|Talk]] -
            -"$1" has been deleted. -See $2 for a record of recent deletions. - -{{int:Deletedtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deleteimg&action=edit deleteimg]
            -[[MediaWiki_talk:Deleteimg|Talk]] -
            -del - -{{int:Deleteimg}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletepage&action=edit deletepage]
            -[[MediaWiki_talk:Deletepage|Talk]] -
            -Delete page - -{{int:Deletepage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletesub&action=edit deletesub]
            -[[MediaWiki_talk:Deletesub|Talk]] -
            -(Deleting "$1") - -{{int:Deletesub}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletethispage&action=edit deletethispage]
            -[[MediaWiki_talk:Deletethispage|Talk]] -
            -Delete this page - -{{int:Deletethispage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Deletionlog&action=edit deletionlog]
            -[[MediaWiki_talk:Deletionlog|Talk]] -
            -deletion log - -{{int:Deletionlog}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dellogpage&action=edit dellogpage]
            -[[MediaWiki_talk:Dellogpage|Talk]] -
            -Deletion_log - -{{int:Dellogpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Dellogpagetext&action=edit dellogpagetext]
            -[[MediaWiki_talk:Dellogpagetext|Talk]] -
            -Below is a list of the most recent deletions. -All times shown are server time (UTC). -<ul> -</ul> - - -{{int:Dellogpagetext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Developerspheading&action=edit developerspheading]
            -[[MediaWiki_talk:Developerspheading|Talk]] -
            -For developer use only - -{{int:Developerspheading}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Developertext&action=edit developertext]
            -[[MediaWiki_talk:Developertext|Talk]] -
            -The action you have requested can only be -performed by users with "developer" status. -See $1. - -{{int:Developertext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Developertitle&action=edit developertitle]
            -[[MediaWiki_talk:Developertitle|Talk]] -
            -Developer access required - -{{int:Developertitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Diff&action=edit diff]
            -[[MediaWiki_talk:Diff|Talk]] -
            -diff - -{{int:Diff}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Difference&action=edit difference]
            -[[MediaWiki_talk:Difference|Talk]] -
            -(Difference between revisions) - -{{int:Difference}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Disclaimerpage&action=edit disclaimerpage]
            -[[MediaWiki_talk:Disclaimerpage|Talk]] -
            -Wiktionary:General_disclaimer - -{{int:Disclaimerpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Disclaimers&action=edit disclaimers]
            -[[MediaWiki_talk:Disclaimers|Talk]] -
            -Disclaimers - -{{int:Disclaimers}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Doubleredirects&action=edit doubleredirects]
            -[[MediaWiki_talk:Doubleredirects|Talk]] -
            -Double Redirects - -{{int:Doubleredirects}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Doubleredirectstext&action=edit doubleredirectstext]
            -[[MediaWiki_talk:Doubleredirectstext|Talk]] -
            -<b>Attention:</b> This list may contain false positives. That usually means there is additional text with links below the first #REDIRECT.<br /> -Each row contains links to the first and second redirect, as well as the first line of the second redirect text, usually giving the "real" target page, which the first redirect should point to. - -{{int:Doubleredirectstext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Edit&action=edit edit]
            -[[MediaWiki_talk:Edit|Talk]] -
            -Edit - -{{int:Edit}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editcomment&action=edit editcomment]
            -[[MediaWiki_talk:Editcomment|Talk]] -
            -The edit comment was: "<i>$1</i>". - -{{int:Editcomment}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editconflict&action=edit editconflict]
            -[[MediaWiki_talk:Editconflict|Talk]] -
            -Edit conflict: $1 - -{{int:Editconflict}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editcurrent&action=edit editcurrent]
            -[[MediaWiki_talk:Editcurrent|Talk]] -
            -Edit the current version of this page - -{{int:Editcurrent}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Edithelp&action=edit edithelp]
            -[[MediaWiki_talk:Edithelp|Talk]] -
            -Editing help - -{{int:Edithelp}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Edithelppage&action=edit edithelppage]
            -[[MediaWiki_talk:Edithelppage|Talk]] -
            -Help:Editing - -{{int:Edithelppage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editing&action=edit editing]
            -[[MediaWiki_talk:Editing|Talk]] -
            -Editing $1 - -{{int:Editing}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editingold&action=edit editingold]
            -[[MediaWiki_talk:Editingold|Talk]] -
            -<strong>WARNING: You are editing an out-of-date -revision of this page. -If you save it, any changes made since this revision will be lost.</strong> - - -{{int:Editingold}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editsection&action=edit editsection]
            -[[MediaWiki_talk:Editsection|Talk]] -
            -edit - -{{int:Editsection}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Editthispage&action=edit editthispage]
            -[[MediaWiki_talk:Editthispage|Talk]] -
            -Edit this page - -{{int:Editthispage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailflag&action=edit emailflag]
            -[[MediaWiki_talk:Emailflag|Talk]] -
            -Disable e-mail from other users - -{{int:Emailflag}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailforlost&action=edit emailforlost]
            -[[MediaWiki_talk:Emailforlost|Talk]] -
            -Fields marked with a star (*) are optional. Storing an email address enables people to contact you through the website without you having to reveal your -email address to them, and it can be used to send you a new password if you forget it.<br /><br />Your real name, if you choose to provide it, will be used for giving you attribution for your work. - -{{int:Emailforlost}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailfrom&action=edit emailfrom]
            -[[MediaWiki_talk:Emailfrom|Talk]] -
            -From - -{{int:Emailfrom}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailmessage&action=edit emailmessage]
            -[[MediaWiki_talk:Emailmessage|Talk]] -
            -Message - -{{int:Emailmessage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailpage&action=edit emailpage]
            -[[MediaWiki_talk:Emailpage|Talk]] -
            -E-mail user - -{{int:Emailpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailpagetext&action=edit emailpagetext]
            -[[MediaWiki_talk:Emailpagetext|Talk]] -
            -If this user has entered a valid e-mail address in -his or her user preferences, the form below will send a single message. -The e-mail address you entered in your user preferences will appear -as the "From" address of the mail, so the recipient will be able -to reply. - -{{int:Emailpagetext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailsend&action=edit emailsend]
            -[[MediaWiki_talk:Emailsend|Talk]] -
            -Send - -{{int:Emailsend}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailsent&action=edit emailsent]
            -[[MediaWiki_talk:Emailsent|Talk]] -
            -E-mail sent - -{{int:Emailsent}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailsenttext&action=edit emailsenttext]
            -[[MediaWiki_talk:Emailsenttext|Talk]] -
            -Your e-mail message has been sent. - -{{int:Emailsenttext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailsubject&action=edit emailsubject]
            -[[MediaWiki_talk:Emailsubject|Talk]] -
            -Subject - -{{int:Emailsubject}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailto&action=edit emailto]
            -[[MediaWiki_talk:Emailto|Talk]] -
            -To - -{{int:Emailto}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Emailuser&action=edit emailuser]
            -[[MediaWiki_talk:Emailuser|Talk]] -
            -E-mail this user - -{{int:Emailuser}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Enterlockreason&action=edit enterlockreason]
            -[[MediaWiki_talk:Enterlockreason|Talk]] -
            -Enter a reason for the lock, including an estimate -of when the lock will be released - -{{int:Enterlockreason}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Error&action=edit error]
            -[[MediaWiki_talk:Error|Talk]] -
            -Error - -{{int:Error}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Errorpagetitle&action=edit errorpagetitle]
            -[[MediaWiki_talk:Errorpagetitle|Talk]] -
            -Error - -{{int:Errorpagetitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Exbeforeblank&action=edit exbeforeblank]
            -[[MediaWiki_talk:Exbeforeblank|Talk]] -
            -content before blanking was: - -{{int:Exbeforeblank}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Exblank&action=edit exblank]
            -[[MediaWiki_talk:Exblank|Talk]] -
            -page was empty - -{{int:Exblank}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Excontent&action=edit excontent]
            -[[MediaWiki_talk:Excontent|Talk]] -
            -content was: - -{{int:Excontent}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Explainconflict&action=edit explainconflict]
            -[[MediaWiki_talk:Explainconflict|Talk]] -
            -Someone else has changed this page since you -started editing it. -The upper text area contains the page text as it currently exists. -Your changes are shown in the lower text area. -You will have to merge your changes into the existing text. -<b>Only</b> the text in the upper text area will be saved when you -press "Save page". -<p> - -{{int:Explainconflict}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Export&action=edit export]
            -[[MediaWiki_talk:Export|Talk]] -
            -Export pages - -{{int:Export}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Exportcuronly&action=edit exportcuronly]
            -[[MediaWiki_talk:Exportcuronly|Talk]] -
            -Include only the current revision, not the full history - -{{int:Exportcuronly}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Exporttext&action=edit exporttext]
            -[[MediaWiki_talk:Exporttext|Talk]] -
            -You can export the text and editing history of a particular -page or set of pages wrapped in some XML; this can then be imported into another -wiki running MediaWiki software, transformed, or just kept for your private -amusement. - -{{int:Exporttext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Extlink_sample&action=edit extlink_sample]
            -[[MediaWiki_talk:Extlink_sample|Talk]] -
            -http://www.example.com link title - -{{int:Extlink_sample}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Extlink_tip&action=edit extlink_tip]
            -[[MediaWiki_talk:Extlink_tip|Talk]] -
            -External link (remember http:// prefix) - -{{int:Extlink_tip}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Faq&action=edit faq]
            -[[MediaWiki_talk:Faq|Talk]] -
            -FAQ - -{{int:Faq}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Faqpage&action=edit faqpage]
            -[[MediaWiki_talk:Faqpage|Talk]] -
            -Wiktionary:FAQ - -{{int:Faqpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Feedlinks&action=edit feedlinks]
            -[[MediaWiki_talk:Feedlinks|Talk]] -
            -Feed: - -{{int:Feedlinks}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filecopyerror&action=edit filecopyerror]
            -[[MediaWiki_talk:Filecopyerror|Talk]] -
            -Could not copy file "$1" to "$2". - -{{int:Filecopyerror}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filedeleteerror&action=edit filedeleteerror]
            -[[MediaWiki_talk:Filedeleteerror|Talk]] -
            -Could not delete file "$1". - -{{int:Filedeleteerror}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filedesc&action=edit filedesc]
            -[[MediaWiki_talk:Filedesc|Talk]] -
            -Summary - -{{int:Filedesc}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filename&action=edit filename]
            -[[MediaWiki_talk:Filename|Talk]] -
            -Filename - -{{int:Filename}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filenotfound&action=edit filenotfound]
            -[[MediaWiki_talk:Filenotfound|Talk]] -
            -Could not find file "$1". - -{{int:Filenotfound}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filerenameerror&action=edit filerenameerror]
            -[[MediaWiki_talk:Filerenameerror|Talk]] -
            -Could not rename file "$1" to "$2". - -{{int:Filerenameerror}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filesource&action=edit filesource]
            -[[MediaWiki_talk:Filesource|Talk]] -
            -Source - -{{int:Filesource}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Filestatus&action=edit filestatus]
            -[[MediaWiki_talk:Filestatus|Talk]] -
            -Copyright status - -{{int:Filestatus}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Fileuploaded&action=edit fileuploaded]
            -[[MediaWiki_talk:Fileuploaded|Talk]] -
            -File "$1" uploaded successfully. -Please follow this link: $2 to the description page and fill -in information about the file, such as where it came from, when it was -created and by whom, and anything else you may know about it. - -{{int:Fileuploaded}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Formerror&action=edit formerror]
            -[[MediaWiki_talk:Formerror|Talk]] -
            -Error: could not submit form - -{{int:Formerror}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Fromwikipedia&action=edit fromwikipedia]
            -[[MediaWiki_talk:Fromwikipedia|Talk]] -
            -From Wiktionary - -{{int:Fromwikipedia}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Getimagelist&action=edit getimagelist]
            -[[MediaWiki_talk:Getimagelist|Talk]] -
            -fetching image list - -{{int:Getimagelist}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Go&action=edit go]
            -[[MediaWiki_talk:Go|Talk]] -
            -Go - -{{int:Go}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Googlesearch&action=edit googlesearch]
            -[[MediaWiki_talk:Googlesearch|Talk]] -
            - -<!-- SiteSearch Google --> -<FORM method=GET action="http://www.google.com/search"> -<TABLE bgcolor="#FFFFFF"><tr><td> -<A HREF="http://www.google.com/"> -<IMG SRC="http://www.google.com/logos/Logo_40wht.gif" -border="0" ALT="Google"></A> -</td> -<td> -<INPUT TYPE=text name=q size=31 maxlength=255 value="$1"> -<INPUT type=submit name=btnG VALUE="Google Search"> -<font size=-1> -<input type=hidden name=domains value="http://tl.wiktionary.org"><br /><input type=radio name=sitesearch value=""> WWW <input type=radio name=sitesearch value="http://tl.wiktionary.org" checked> http://tl.wiktionary.org <br /> -<input type='hidden' name='ie' value='$2'> -<input type='hidden' name='oe' value='$2'> -</font> -</td></tr></TABLE> -</FORM> -<!-- SiteSearch Google --> - -{{int:Googlesearch}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Guesstimezone&action=edit guesstimezone]
            -[[MediaWiki_talk:Guesstimezone|Talk]] -
            -Fill in from browser - -{{int:Guesstimezone}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Headline_sample&action=edit headline_sample]
            -[[MediaWiki_talk:Headline_sample|Talk]] -
            -Headline text - -{{int:Headline_sample}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Headline_tip&action=edit headline_tip]
            -[[MediaWiki_talk:Headline_tip|Talk]] -
            -Level 2 headline - -{{int:Headline_tip}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Help&action=edit help]
            -[[MediaWiki_talk:Help|Talk]] -
            -Help - -{{int:Help}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Helppage&action=edit helppage]
            -[[MediaWiki_talk:Helppage|Talk]] -
            -Help:Contents - -{{int:Helppage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Hide&action=edit hide]
            -[[MediaWiki_talk:Hide|Talk]] -
            -hide - -{{int:Hide}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Hidetoc&action=edit hidetoc]
            -[[MediaWiki_talk:Hidetoc|Talk]] -
            -hide - -{{int:Hidetoc}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Hist&action=edit hist]
            -[[MediaWiki_talk:Hist|Talk]] -
            -hist - -{{int:Hist}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Histlegend&action=edit histlegend]
            -[[MediaWiki_talk:Histlegend|Talk]] -
            -Diff selection: mark the radio boxes of the versions to compare and hit enter or the button at the bottom.<br/> -Legend: (cur) = difference with current version, -(last) = difference with preceding version, M = minor edit. - -{{int:Histlegend}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:History&action=edit history]
            -[[MediaWiki_talk:History|Talk]] -
            -Page history - -{{int:History}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:History_short&action=edit history_short]
            -[[MediaWiki_talk:History_short|Talk]] -
            -History - -{{int:History_short}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Historywarning&action=edit historywarning]
            -[[MediaWiki_talk:Historywarning|Talk]] -
            -Warning: The page you are about to delete has a history: - -{{int:Historywarning}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Hr_tip&action=edit hr_tip]
            -[[MediaWiki_talk:Hr_tip|Talk]] -
            -Horizontal line (use sparingly) - -{{int:Hr_tip}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ignorewarning&action=edit ignorewarning]
            -[[MediaWiki_talk:Ignorewarning|Talk]] -
            -Ignore warning and save file anyway. - -{{int:Ignorewarning}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ilshowmatch&action=edit ilshowmatch]
            -[[MediaWiki_talk:Ilshowmatch|Talk]] -
            -Show all images with names matching - -{{int:Ilshowmatch}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ilsubmit&action=edit ilsubmit]
            -[[MediaWiki_talk:Ilsubmit|Talk]] -
            -Search - -{{int:Ilsubmit}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Image_sample&action=edit image_sample]
            -[[MediaWiki_talk:Image_sample|Talk]] -
            -Example.jpg - -{{int:Image_sample}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Image_tip&action=edit image_tip]
            -[[MediaWiki_talk:Image_tip|Talk]] -
            -Embedded image - -{{int:Image_tip}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagelinks&action=edit imagelinks]
            -[[MediaWiki_talk:Imagelinks|Talk]] -
            -Image links - -{{int:Imagelinks}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagelist&action=edit imagelist]
            -[[MediaWiki_talk:Imagelist|Talk]] -
            -Image list - -{{int:Imagelist}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagelisttext&action=edit imagelisttext]
            -[[MediaWiki_talk:Imagelisttext|Talk]] -
            -Below is a list of $1 images sorted $2. - -{{int:Imagelisttext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagepage&action=edit imagepage]
            -[[MediaWiki_talk:Imagepage|Talk]] -
            -View image page - -{{int:Imagepage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imagereverted&action=edit imagereverted]
            -[[MediaWiki_talk:Imagereverted|Talk]] -
            -Revert to earlier version was successful. - -{{int:Imagereverted}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imgdelete&action=edit imgdelete]
            -[[MediaWiki_talk:Imgdelete|Talk]] -
            -del - -{{int:Imgdelete}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imgdesc&action=edit imgdesc]
            -[[MediaWiki_talk:Imgdesc|Talk]] -
            -desc - -{{int:Imgdesc}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imghistlegend&action=edit imghistlegend]
            -[[MediaWiki_talk:Imghistlegend|Talk]] -
            -Legend: (cur) = this is the current image, (del) = delete -this old version, (rev) = revert to this old version. -<br /><i>Click on date to see image uploaded on that date</i>. - -{{int:Imghistlegend}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imghistory&action=edit imghistory]
            -[[MediaWiki_talk:Imghistory|Talk]] -
            -Image history - -{{int:Imghistory}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Imglegend&action=edit imglegend]
            -[[MediaWiki_talk:Imglegend|Talk]] -
            -Legend: (desc) = show/edit image description. - -{{int:Imglegend}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Import&action=edit import]
            -[[MediaWiki_talk:Import|Talk]] -
            -Import pages - -{{int:Import}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importfailed&action=edit importfailed]
            -[[MediaWiki_talk:Importfailed|Talk]] -
            -Import failed: $1 - -{{int:Importfailed}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importhistoryconflict&action=edit importhistoryconflict]
            -[[MediaWiki_talk:Importhistoryconflict|Talk]] -
            -Conflicting history revision exists (may have imported this page before) - -{{int:Importhistoryconflict}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importnotext&action=edit importnotext]
            -[[MediaWiki_talk:Importnotext|Talk]] -
            -Empty or no text - -{{int:Importnotext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importsuccess&action=edit importsuccess]
            -[[MediaWiki_talk:Importsuccess|Talk]] -
            -Import succeeded! - -{{int:Importsuccess}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Importtext&action=edit importtext]
            -[[MediaWiki_talk:Importtext|Talk]] -
            -Please export the file from the source wiki using the Special:Export utility, save it to your disk and upload it here. - -{{int:Importtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Infobox&action=edit infobox]
            -[[MediaWiki_talk:Infobox|Talk]] -
            -Click a button to get an example text - -{{int:Infobox}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Infobox_alert&action=edit infobox_alert]
            -[[MediaWiki_talk:Infobox_alert|Talk]] -
            -Please enter the text you want to be formatted.\n It will be shown in the infobox for copy and pasting.\nExample:\n$1\nwill become:\n$2 - -{{int:Infobox_alert}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Internalerror&action=edit internalerror]
            -[[MediaWiki_talk:Internalerror|Talk]] -
            -Internal error - -{{int:Internalerror}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Intl&action=edit intl]
            -[[MediaWiki_talk:Intl|Talk]] -
            -Interlanguage links - -{{int:Intl}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ip_range_invalid&action=edit ip_range_invalid]
            -[[MediaWiki_talk:Ip_range_invalid|Talk]] -
            -Invalid IP range. - - -{{int:Ip_range_invalid}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipaddress&action=edit ipaddress]
            -[[MediaWiki_talk:Ipaddress|Talk]] -
            -IP Address/username - -{{int:Ipaddress}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipb_expiry_invalid&action=edit ipb_expiry_invalid]
            -[[MediaWiki_talk:Ipb_expiry_invalid|Talk]] -
            -Expiry time invalid. - -{{int:Ipb_expiry_invalid}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipbexpiry&action=edit ipbexpiry]
            -[[MediaWiki_talk:Ipbexpiry|Talk]] -
            -Expiry - -{{int:Ipbexpiry}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipblocklist&action=edit ipblocklist]
            -[[MediaWiki_talk:Ipblocklist|Talk]] -
            -List of blocked IP addresses and usernames - -{{int:Ipblocklist}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipbreason&action=edit ipbreason]
            -[[MediaWiki_talk:Ipbreason|Talk]] -
            -Reason - -{{int:Ipbreason}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipbsubmit&action=edit ipbsubmit]
            -[[MediaWiki_talk:Ipbsubmit|Talk]] -
            -Block this user - -{{int:Ipbsubmit}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipusubmit&action=edit ipusubmit]
            -[[MediaWiki_talk:Ipusubmit|Talk]] -
            -Unblock this address - -{{int:Ipusubmit}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ipusuccess&action=edit ipusuccess]
            -[[MediaWiki_talk:Ipusuccess|Talk]] -
            -"$1" unblocked - -{{int:Ipusuccess}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Isbn&action=edit isbn]
            -[[MediaWiki_talk:Isbn|Talk]] -
            -ISBN - -{{int:Isbn}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Isredirect&action=edit isredirect]
            -[[MediaWiki_talk:Isredirect|Talk]] -
            -redirect page - -{{int:Isredirect}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Italic_sample&action=edit italic_sample]
            -[[MediaWiki_talk:Italic_sample|Talk]] -
            -Italic text - -{{int:Italic_sample}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Italic_tip&action=edit italic_tip]
            -[[MediaWiki_talk:Italic_tip|Talk]] -
            -Italic text - -{{int:Italic_tip}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Iteminvalidname&action=edit iteminvalidname]
            -[[MediaWiki_talk:Iteminvalidname|Talk]] -
            -Problem with item '$1', invalid name... - -{{int:Iteminvalidname}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Largefile&action=edit largefile]
            -[[MediaWiki_talk:Largefile|Talk]] -
            -It is recommended that images not exceed 100k in size. - -{{int:Largefile}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Last&action=edit last]
            -[[MediaWiki_talk:Last|Talk]] -
            -last - -{{int:Last}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lastmodified&action=edit lastmodified]
            -[[MediaWiki_talk:Lastmodified|Talk]] -
            -This page was last modified $1. - -{{int:Lastmodified}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lastmodifiedby&action=edit lastmodifiedby]
            -[[MediaWiki_talk:Lastmodifiedby|Talk]] -
            -This page was last modified $1 by $2. - -{{int:Lastmodifiedby}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lineno&action=edit lineno]
            -[[MediaWiki_talk:Lineno|Talk]] -
            -Line $1: - -{{int:Lineno}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Link_sample&action=edit link_sample]
            -[[MediaWiki_talk:Link_sample|Talk]] -
            -Link title - -{{int:Link_sample}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Link_tip&action=edit link_tip]
            -[[MediaWiki_talk:Link_tip|Talk]] -
            -Internal link - -{{int:Link_tip}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Linklistsub&action=edit linklistsub]
            -[[MediaWiki_talk:Linklistsub|Talk]] -
            -(List of links) - -{{int:Linklistsub}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Linkshere&action=edit linkshere]
            -[[MediaWiki_talk:Linkshere|Talk]] -
            -The following pages link to here: - -{{int:Linkshere}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Linkstoimage&action=edit linkstoimage]
            -[[MediaWiki_talk:Linkstoimage|Talk]] -
            -The following pages link to this image: - -{{int:Linkstoimage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Linktrail&action=edit linktrail]
            -[[MediaWiki_talk:Linktrail|Talk]] -
            -/^([a-z]+)(.*)$/sD - -{{int:Linktrail}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Listform&action=edit listform]
            -[[MediaWiki_talk:Listform|Talk]] -
            -list - -{{int:Listform}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Listusers&action=edit listusers]
            -[[MediaWiki_talk:Listusers|Talk]] -
            -User list - -{{int:Listusers}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loadhist&action=edit loadhist]
            -[[MediaWiki_talk:Loadhist|Talk]] -
            -Loading page history - -{{int:Loadhist}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loadingrev&action=edit loadingrev]
            -[[MediaWiki_talk:Loadingrev|Talk]] -
            -loading revision for diff - -{{int:Loadingrev}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Localtime&action=edit localtime]
            -[[MediaWiki_talk:Localtime|Talk]] -
            -Local time display - -{{int:Localtime}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockbtn&action=edit lockbtn]
            -[[MediaWiki_talk:Lockbtn|Talk]] -
            -Lock database - -{{int:Lockbtn}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockconfirm&action=edit lockconfirm]
            -[[MediaWiki_talk:Lockconfirm|Talk]] -
            -Yes, I really want to lock the database. - -{{int:Lockconfirm}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockdb&action=edit lockdb]
            -[[MediaWiki_talk:Lockdb|Talk]] -
            -Lock database - -{{int:Lockdb}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockdbsuccesssub&action=edit lockdbsuccesssub]
            -[[MediaWiki_talk:Lockdbsuccesssub|Talk]] -
            -Database lock succeeded - -{{int:Lockdbsuccesssub}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockdbsuccesstext&action=edit lockdbsuccesstext]
            -[[MediaWiki_talk:Lockdbsuccesstext|Talk]] -
            -The database has been locked. -<br />Remember to remove the lock after your maintenance is complete. - -{{int:Lockdbsuccesstext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lockdbtext&action=edit lockdbtext]
            -[[MediaWiki_talk:Lockdbtext|Talk]] -
            -Locking the database will suspend the ability of all -users to edit pages, change their preferences, edit their watchlists, and -other things requiring changes in the database. -Please confirm that this is what you intend to do, and that you will -unlock the database when your maintenance is done. - -{{int:Lockdbtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Locknoconfirm&action=edit locknoconfirm]
            -[[MediaWiki_talk:Locknoconfirm|Talk]] -
            -You did not check the confirmation box. - -{{int:Locknoconfirm}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Login&action=edit login]
            -[[MediaWiki_talk:Login|Talk]] -
            -Log in - -{{int:Login}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginend&action=edit loginend]
            -[[MediaWiki_talk:Loginend|Talk]] -
            -&nbsp; - -{{int:Loginend}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginerror&action=edit loginerror]
            -[[MediaWiki_talk:Loginerror|Talk]] -
            -Login error - -{{int:Loginerror}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginpagetitle&action=edit loginpagetitle]
            -[[MediaWiki_talk:Loginpagetitle|Talk]] -
            -User login - -{{int:Loginpagetitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginproblem&action=edit loginproblem]
            -[[MediaWiki_talk:Loginproblem|Talk]] -
            -<b>There has been a problem with your login.</b><br />Try again! - -{{int:Loginproblem}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginprompt&action=edit loginprompt]
            -[[MediaWiki_talk:Loginprompt|Talk]] -
            -You must have cookies enabled to log in to Wiktionary. - -{{int:Loginprompt}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginreqtext&action=edit loginreqtext]
            -[[MediaWiki_talk:Loginreqtext|Talk]] -
            -You must [[special:Userlogin|login]] to view other pages. - -{{int:Loginreqtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginreqtitle&action=edit loginreqtitle]
            -[[MediaWiki_talk:Loginreqtitle|Talk]] -
            -Login Required - -{{int:Loginreqtitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginsuccess&action=edit loginsuccess]
            -[[MediaWiki_talk:Loginsuccess|Talk]] -
            -You are now logged in to Wiktionary as "$1". - -{{int:Loginsuccess}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginsuccesstitle&action=edit loginsuccesstitle]
            -[[MediaWiki_talk:Loginsuccesstitle|Talk]] -
            -Login successful - -{{int:Loginsuccesstitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Logout&action=edit logout]
            -[[MediaWiki_talk:Logout|Talk]] -
            -Log out - -{{int:Logout}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Logouttext&action=edit logouttext]
            -[[MediaWiki_talk:Logouttext|Talk]] -
            -You are now logged out. -You can continue to use Wiktionary anonymously, or you can log in -again as the same or as a different user. Note that some pages may -continue to be displayed as if you were still logged in, until you clear -your browser cache - - -{{int:Logouttext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Logouttitle&action=edit logouttitle]
            -[[MediaWiki_talk:Logouttitle|Talk]] -
            -User logout - -{{int:Logouttitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Lonelypages&action=edit lonelypages]
            -[[MediaWiki_talk:Lonelypages|Talk]] -
            -Orphaned pages - -{{int:Lonelypages}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Longpages&action=edit longpages]
            -[[MediaWiki_talk:Longpages|Talk]] -
            -Long pages - -{{int:Longpages}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Longpagewarning&action=edit longpagewarning]
            -[[MediaWiki_talk:Longpagewarning|Talk]] -
            -WARNING: This page is $1 kilobytes long; some -browsers may have problems editing pages approaching or longer than 32kb. -Please consider breaking the page into smaller sections. - -{{int:Longpagewarning}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mailerror&action=edit mailerror]
            -[[MediaWiki_talk:Mailerror|Talk]] -
            -Error sending mail: $1 - -{{int:Mailerror}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mailmypassword&action=edit mailmypassword]
            -[[MediaWiki_talk:Mailmypassword|Talk]] -
            -Mail me a new password - -{{int:Mailmypassword}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mailnologin&action=edit mailnologin]
            -[[MediaWiki_talk:Mailnologin|Talk]] -
            -No send address - -{{int:Mailnologin}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mailnologintext&action=edit mailnologintext]
            -[[MediaWiki_talk:Mailnologintext|Talk]] -
            -You must be <a href="{{localurl:Special:Userlogin">logged in</a> -and have a valid e-mail address in your <a href="/wiki/Special:Preferences">preferences</a> -to send e-mail to other users. - -{{int:Mailnologintext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mainpage&action=edit mainpage]
            -[[MediaWiki_talk:Mainpage|Talk]] -
            -Main Page - -{{int:Mainpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mainpagedocfooter&action=edit mainpagedocfooter]
            -[[MediaWiki_talk:Mainpagedocfooter|Talk]] -
            -Please see [http://meta.wikipedia.org/wiki/MediaWiki_i18n documentation on customizing the interface] -and the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide] for usage and configuration help. - -{{int:Mainpagedocfooter}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mainpagetext&action=edit mainpagetext]
            -[[MediaWiki_talk:Mainpagetext|Talk]] -
            -Wiki software successfully installed. - -{{int:Mainpagetext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Maintenance&action=edit maintenance]
            -[[MediaWiki_talk:Maintenance|Talk]] -
            -Maintenance page - -{{int:Maintenance}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Maintenancebacklink&action=edit maintenancebacklink]
            -[[MediaWiki_talk:Maintenancebacklink|Talk]] -
            -Back to Maintenance Page - -{{int:Maintenancebacklink}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Maintnancepagetext&action=edit maintnancepagetext]
            -[[MediaWiki_talk:Maintnancepagetext|Talk]] -
            -This page includes several handy tools for everyday maintenance. Some of these functions tend to stress the database, so please do not hit reload after every item you fixed ;-) - -{{int:Maintnancepagetext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysop&action=edit makesysop]
            -[[MediaWiki_talk:Makesysop|Talk]] -
            -Make a user into a sysop - -{{int:Makesysop}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysopfail&action=edit makesysopfail]
            -[[MediaWiki_talk:Makesysopfail|Talk]] -
            -<b>User "$1" could not be made into a sysop. (Did you enter the name correctly?)</b> - -{{int:Makesysopfail}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysopname&action=edit makesysopname]
            -[[MediaWiki_talk:Makesysopname|Talk]] -
            -Name of the user: - -{{int:Makesysopname}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysopok&action=edit makesysopok]
            -[[MediaWiki_talk:Makesysopok|Talk]] -
            -<b>User "$1" is now a sysop</b> - -{{int:Makesysopok}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysopsubmit&action=edit makesysopsubmit]
            -[[MediaWiki_talk:Makesysopsubmit|Talk]] -
            -Make this user into a sysop - -{{int:Makesysopsubmit}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysoptext&action=edit makesysoptext]
            -[[MediaWiki_talk:Makesysoptext|Talk]] -
            -This form is used by bureaucrats to turn ordinary users into administrators. -Type the name of the user in the box and press the button to make the user an administrator - -{{int:Makesysoptext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Makesysoptitle&action=edit makesysoptitle]
            -[[MediaWiki_talk:Makesysoptitle|Talk]] -
            -Make a user into a sysop - -{{int:Makesysoptitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Matchtotals&action=edit matchtotals]
            -[[MediaWiki_talk:Matchtotals|Talk]] -
            -The query "$1" matched $2 page titles -and the text of $3 pages. - -{{int:Matchtotals}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math&action=edit math]
            -[[MediaWiki_talk:Math|Talk]] -
            -Rendering math - -{{int:Math}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_bad_output&action=edit math_bad_output]
            -[[MediaWiki_talk:Math_bad_output|Talk]] -
            -Can't write to or create math output directory - -{{int:Math_bad_output}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_bad_tmpdir&action=edit math_bad_tmpdir]
            -[[MediaWiki_talk:Math_bad_tmpdir|Talk]] -
            -Can't write to or create math temp directory - -{{int:Math_bad_tmpdir}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_failure&action=edit math_failure]
            -[[MediaWiki_talk:Math_failure|Talk]] -
            -Failed to parse - -{{int:Math_failure}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_image_error&action=edit math_image_error]
            -[[MediaWiki_talk:Math_image_error|Talk]] -
            -PNG conversion failed; check for correct installation of latex, dvips, gs, and convert - -{{int:Math_image_error}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_lexing_error&action=edit math_lexing_error]
            -[[MediaWiki_talk:Math_lexing_error|Talk]] -
            -lexing error - -{{int:Math_lexing_error}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_notexvc&action=edit math_notexvc]
            -[[MediaWiki_talk:Math_notexvc|Talk]] -
            -Missing texvc executable; please see math/README to configure. - -{{int:Math_notexvc}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_sample&action=edit math_sample]
            -[[MediaWiki_talk:Math_sample|Talk]] -
            -Insert formula here - -{{int:Math_sample}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_syntax_error&action=edit math_syntax_error]
            -[[MediaWiki_talk:Math_syntax_error|Talk]] -
            -syntax error - -{{int:Math_syntax_error}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_tip&action=edit math_tip]
            -[[MediaWiki_talk:Math_tip|Talk]] -
            -Mathematical formula (LaTeX) - -{{int:Math_tip}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_unknown_error&action=edit math_unknown_error]
            -[[MediaWiki_talk:Math_unknown_error|Talk]] -
            -unknown error - -{{int:Math_unknown_error}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Math_unknown_function&action=edit math_unknown_function]
            -[[MediaWiki_talk:Math_unknown_function|Talk]] -
            -unknown function - -{{int:Math_unknown_function}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Media_sample&action=edit media_sample]
            -[[MediaWiki_talk:Media_sample|Talk]] -
            -Example.mp3 - -{{int:Media_sample}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Media_tip&action=edit media_tip]
            -[[MediaWiki_talk:Media_tip|Talk]] -
            -Media file link - -{{int:Media_tip}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Minlength&action=edit minlength]
            -[[MediaWiki_talk:Minlength|Talk]] -
            -Image names must be at least three letters. - -{{int:Minlength}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Minoredit&action=edit minoredit]
            -[[MediaWiki_talk:Minoredit|Talk]] -
            -This is a minor edit - -{{int:Minoredit}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Minoreditletter&action=edit minoreditletter]
            -[[MediaWiki_talk:Minoreditletter|Talk]] -
            -M - -{{int:Minoreditletter}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mispeelings&action=edit mispeelings]
            -[[MediaWiki_talk:Mispeelings|Talk]] -
            -Pages with misspellings - -{{int:Mispeelings}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mispeelingspage&action=edit mispeelingspage]
            -[[MediaWiki_talk:Mispeelingspage|Talk]] -
            -List of common misspellings - -{{int:Mispeelingspage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mispeelingstext&action=edit mispeelingstext]
            -[[MediaWiki_talk:Mispeelingstext|Talk]] -
            -The following pages contain a common misspelling, which are listed on $1. The correct spelling might be given (like this). - -{{int:Mispeelingstext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missingarticle&action=edit missingarticle]
            -[[MediaWiki_talk:Missingarticle|Talk]] -
            -The database did not find the text of a page -that it should have found, named "$1". - -<p>This is usually caused by following an outdated diff or history link to a -page that has been deleted. - -<p>If this is not the case, you may have found a bug in the software. -Please report this to an administrator, making note of the URL. - -{{int:Missingarticle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missingimage&action=edit missingimage]
            -[[MediaWiki_talk:Missingimage|Talk]] -
            -<b>Missing image</b><br /><i>$1</i> - - -{{int:Missingimage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missinglanguagelinks&action=edit missinglanguagelinks]
            -[[MediaWiki_talk:Missinglanguagelinks|Talk]] -
            -Missing Language Links - -{{int:Missinglanguagelinks}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missinglanguagelinksbutton&action=edit missinglanguagelinksbutton]
            -[[MediaWiki_talk:Missinglanguagelinksbutton|Talk]] -
            -Find missing language links for - -{{int:Missinglanguagelinksbutton}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Missinglanguagelinkstext&action=edit missinglanguagelinkstext]
            -[[MediaWiki_talk:Missinglanguagelinkstext|Talk]] -
            -These pages do <i>not</i> link to their counterpart in $1. Redirects and subpages are <i>not</i> shown. - -{{int:Missinglanguagelinkstext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Moredotdotdot&action=edit moredotdotdot]
            -[[MediaWiki_talk:Moredotdotdot|Talk]] -
            -More... - -{{int:Moredotdotdot}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Move&action=edit move]
            -[[MediaWiki_talk:Move|Talk]] -
            -Move - -{{int:Move}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movearticle&action=edit movearticle]
            -[[MediaWiki_talk:Movearticle|Talk]] -
            -Move page - -{{int:Movearticle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movedto&action=edit movedto]
            -[[MediaWiki_talk:Movedto|Talk]] -
            -moved to - -{{int:Movedto}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movenologin&action=edit movenologin]
            -[[MediaWiki_talk:Movenologin|Talk]] -
            -Not logged in - -{{int:Movenologin}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movenologintext&action=edit movenologintext]
            -[[MediaWiki_talk:Movenologintext|Talk]] -
            -You must be a registered user and <a href="/wiki/Special:Userlogin">logged in</a> -to move a page. - -{{int:Movenologintext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movepage&action=edit movepage]
            -[[MediaWiki_talk:Movepage|Talk]] -
            -Move page - -{{int:Movepage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movepagebtn&action=edit movepagebtn]
            -[[MediaWiki_talk:Movepagebtn|Talk]] -
            -Move page - -{{int:Movepagebtn}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movepagetalktext&action=edit movepagetalktext]
            -[[MediaWiki_talk:Movepagetalktext|Talk]] -
            -The associated talk page, if any, will be automatically moved along with it '''unless:''' -*You are moving the page across namespaces, -*A non-empty talk page already exists under the new name, or -*You uncheck the box below. - -In those cases, you will have to move or merge the page manually if desired. - -{{int:Movepagetalktext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movepagetext&action=edit movepagetext]
            -[[MediaWiki_talk:Movepagetext|Talk]] -
            -Using the form below will rename a page, moving all -of its history to the new name. -The old title will become a redirect page to the new title. -Links to the old page title will not be changed; be sure to -[[Special:Maintenance|check]] for double or broken redirects. -You are responsible for making sure that links continue to -point where they are supposed to go. - -Note that the page will '''not''' be moved if there is already -a page at the new title, unless it is empty or a redirect and has no -past edit history. This means that you can rename a page back to where -it was just renamed from if you make a mistake, and you cannot overwrite -an existing page. - -<b>WARNING!</b> -This can be a drastic and unexpected change for a popular page; -please be sure you understand the consequences of this before -proceeding. - -{{int:Movepagetext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movetalk&action=edit movetalk]
            -[[MediaWiki_talk:Movetalk|Talk]] -
            -Move "talk" page as well, if applicable. - -{{int:Movetalk}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Movethispage&action=edit movethispage]
            -[[MediaWiki_talk:Movethispage|Talk]] -
            -Move this page - -{{int:Movethispage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mycontris&action=edit mycontris]
            -[[MediaWiki_talk:Mycontris|Talk]] -
            -My contributions - -{{int:Mycontris}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mypage&action=edit mypage]
            -[[MediaWiki_talk:Mypage|Talk]] -
            -My page - -{{int:Mypage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Mytalk&action=edit mytalk]
            -[[MediaWiki_talk:Mytalk|Talk]] -
            -My talk - -{{int:Mytalk}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Navigation&action=edit navigation]
            -[[MediaWiki_talk:Navigation|Talk]] -
            -Navigation - -{{int:Navigation}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nbytes&action=edit nbytes]
            -[[MediaWiki_talk:Nbytes|Talk]] -
            -$1 bytes - -{{int:Nbytes}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nchanges&action=edit nchanges]
            -[[MediaWiki_talk:Nchanges|Talk]] -
            -$1 changes - -{{int:Nchanges}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newarticle&action=edit newarticle]
            -[[MediaWiki_talk:Newarticle|Talk]] -
            -(New) - -{{int:Newarticle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newarticletext&action=edit newarticletext]
            -[[MediaWiki_talk:Newarticletext|Talk]] -
            -You've followed a link to a page that doesn't exist yet. -To create the page, start typing in the box below -(see the [[Wiktionary:Help|help page]] for more info). -If you are here by mistake, just click your browser's '''back''' button. - -{{int:Newarticletext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newmessages&action=edit newmessages]
            -[[MediaWiki_talk:Newmessages|Talk]] -
            -You have $1. - -{{int:Newmessages}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newmessageslink&action=edit newmessageslink]
            -[[MediaWiki_talk:Newmessageslink|Talk]] -
            -new messages - -{{int:Newmessageslink}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newpage&action=edit newpage]
            -[[MediaWiki_talk:Newpage|Talk]] -
            -New page - -{{int:Newpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newpageletter&action=edit newpageletter]
            -[[MediaWiki_talk:Newpageletter|Talk]] -
            -N - -{{int:Newpageletter}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newpages&action=edit newpages]
            -[[MediaWiki_talk:Newpages|Talk]] -
            -New pages - -{{int:Newpages}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newpassword&action=edit newpassword]
            -[[MediaWiki_talk:Newpassword|Talk]] -
            -New password - -{{int:Newpassword}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newtitle&action=edit newtitle]
            -[[MediaWiki_talk:Newtitle|Talk]] -
            -To new title - -{{int:Newtitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Newusersonly&action=edit newusersonly]
            -[[MediaWiki_talk:Newusersonly|Talk]] -
            - (new users only) - -{{int:Newusersonly}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Next&action=edit next]
            -[[MediaWiki_talk:Next|Talk]] -
            -next - -{{int:Next}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nextn&action=edit nextn]
            -[[MediaWiki_talk:Nextn|Talk]] -
            -next $1 - -{{int:Nextn}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nlinks&action=edit nlinks]
            -[[MediaWiki_talk:Nlinks|Talk]] -
            -$1 links - -{{int:Nlinks}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noaffirmation&action=edit noaffirmation]
            -[[MediaWiki_talk:Noaffirmation|Talk]] -
            -You must affirm that your upload does not violate -any copyrights. - -{{int:Noaffirmation}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noarticletext&action=edit noarticletext]
            -[[MediaWiki_talk:Noarticletext|Talk]] -
            -(There is currently no text in this page) - -{{int:Noarticletext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noblockreason&action=edit noblockreason]
            -[[MediaWiki_talk:Noblockreason|Talk]] -
            -You must supply a reason for the block. - -{{int:Noblockreason}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noconnect&action=edit noconnect]
            -[[MediaWiki_talk:Noconnect|Talk]] -
            -Sorry! The wiki is experiencing some technical difficulties, and cannot contact the database server. - -{{int:Noconnect}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nocontribs&action=edit nocontribs]
            -[[MediaWiki_talk:Nocontribs|Talk]] -
            -No changes were found matching these criteria. - -{{int:Nocontribs}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nocookieslogin&action=edit nocookieslogin]
            -[[MediaWiki_talk:Nocookieslogin|Talk]] -
            -Wiktionary uses cookies to log in users. You have cookies disabled. Please enable them and try again. - -{{int:Nocookieslogin}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nocookiesnew&action=edit nocookiesnew]
            -[[MediaWiki_talk:Nocookiesnew|Talk]] -
            -The user account was created, but you are not logged in. Wiktionary uses cookies to log in users. You have cookies disabled. Please enable them, then log in with your new username and password. - -{{int:Nocookiesnew}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nocreativecommons&action=edit nocreativecommons]
            -[[MediaWiki_talk:Nocreativecommons|Talk]] -
            -Creative Commons RDF metadata disabled for this server. - -{{int:Nocreativecommons}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nodb&action=edit nodb]
            -[[MediaWiki_talk:Nodb|Talk]] -
            -Could not select database $1 - -{{int:Nodb}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nodublincore&action=edit nodublincore]
            -[[MediaWiki_talk:Nodublincore|Talk]] -
            -Dublin Core RDF metadata disabled for this server. - -{{int:Nodublincore}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noemail&action=edit noemail]
            -[[MediaWiki_talk:Noemail|Talk]] -
            -There is no e-mail address recorded for user "$1". - -{{int:Noemail}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noemailtext&action=edit noemailtext]
            -[[MediaWiki_talk:Noemailtext|Talk]] -
            -This user has not specified a valid e-mail address, -or has chosen not to receive e-mail from other users. - -{{int:Noemailtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noemailtitle&action=edit noemailtitle]
            -[[MediaWiki_talk:Noemailtitle|Talk]] -
            -No e-mail address - -{{int:Noemailtitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nogomatch&action=edit nogomatch]
            -[[MediaWiki_talk:Nogomatch|Talk]] -
            -No page with this exact title exists, trying full text search. - -{{int:Nogomatch}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nohistory&action=edit nohistory]
            -[[MediaWiki_talk:Nohistory|Talk]] -
            -There is no edit history for this page. - -{{int:Nohistory}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nolinkshere&action=edit nolinkshere]
            -[[MediaWiki_talk:Nolinkshere|Talk]] -
            -No pages link to here. - -{{int:Nolinkshere}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nolinkstoimage&action=edit nolinkstoimage]
            -[[MediaWiki_talk:Nolinkstoimage|Talk]] -
            -There are no pages that link to this image. - -{{int:Nolinkstoimage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Noname&action=edit noname]
            -[[MediaWiki_talk:Noname|Talk]] -
            -You have not specified a valid user name. - -{{int:Noname}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nonefound&action=edit nonefound]
            -[[MediaWiki_talk:Nonefound|Talk]] -
            -<strong>Note</strong>: unsuccessful searches are -often caused by searching for common words like "have" and "from", -which are not indexed, or by specifying more than one search term (only pages -containing all of the search terms will appear in the result). - -{{int:Nonefound}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nospecialpagetext&action=edit nospecialpagetext]
            -[[MediaWiki_talk:Nospecialpagetext|Talk]] -
            -You have requested a special page that is not -recognized by the wiki. - -{{int:Nospecialpagetext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nosuchaction&action=edit nosuchaction]
            -[[MediaWiki_talk:Nosuchaction|Talk]] -
            -No such action - -{{int:Nosuchaction}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nosuchactiontext&action=edit nosuchactiontext]
            -[[MediaWiki_talk:Nosuchactiontext|Talk]] -
            -The action specified by the URL is not -recognized by the wiki - -{{int:Nosuchactiontext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nosuchspecialpage&action=edit nosuchspecialpage]
            -[[MediaWiki_talk:Nosuchspecialpage|Talk]] -
            -No such special page - -{{int:Nosuchspecialpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nosuchuser&action=edit nosuchuser]
            -[[MediaWiki_talk:Nosuchuser|Talk]] -
            -There is no user by the name "$1". -Check your spelling, or use the form below to create a new user account. - -{{int:Nosuchuser}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notacceptable&action=edit notacceptable]
            -[[MediaWiki_talk:Notacceptable|Talk]] -
            -The wiki server can't provide data in a format your client can read. - -{{int:Notacceptable}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notanarticle&action=edit notanarticle]
            -[[MediaWiki_talk:Notanarticle|Talk]] -
            -Not a content page - -{{int:Notanarticle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notargettext&action=edit notargettext]
            -[[MediaWiki_talk:Notargettext|Talk]] -
            -You have not specified a target page or user -to perform this function on. - -{{int:Notargettext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notargettitle&action=edit notargettitle]
            -[[MediaWiki_talk:Notargettitle|Talk]] -
            -No target - -{{int:Notargettitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Note&action=edit note]
            -[[MediaWiki_talk:Note|Talk]] -
            -<strong>Note:</strong> - -{{int:Note}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notextmatches&action=edit notextmatches]
            -[[MediaWiki_talk:Notextmatches|Talk]] -
            -No page text matches - -{{int:Notextmatches}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notitlematches&action=edit notitlematches]
            -[[MediaWiki_talk:Notitlematches|Talk]] -
            -No page title matches - -{{int:Notitlematches}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Notloggedin&action=edit notloggedin]
            -[[MediaWiki_talk:Notloggedin|Talk]] -
            -Not logged in - -{{int:Notloggedin}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nowatchlist&action=edit nowatchlist]
            -[[MediaWiki_talk:Nowatchlist|Talk]] -
            -You have no items on your watchlist. - -{{int:Nowatchlist}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nowiki_sample&action=edit nowiki_sample]
            -[[MediaWiki_talk:Nowiki_sample|Talk]] -
            -Insert non-formatted text here - -{{int:Nowiki_sample}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nowiki_tip&action=edit nowiki_tip]
            -[[MediaWiki_talk:Nowiki_tip|Talk]] -
            -Ignore wiki formatting - -{{int:Nowiki_tip}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-category&action=edit nstab-category]
            -[[MediaWiki_talk:Nstab-category|Talk]] -
            -Category - -{{int:Nstab-category}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-help&action=edit nstab-help]
            -[[MediaWiki_talk:Nstab-help|Talk]] -
            -Help - -{{int:Nstab-help}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-image&action=edit nstab-image]
            -[[MediaWiki_talk:Nstab-image|Talk]] -
            -Image - -{{int:Nstab-image}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-main&action=edit nstab-main]
            -[[MediaWiki_talk:Nstab-main|Talk]] -
            -Article - -{{int:Nstab-main}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-media&action=edit nstab-media]
            -[[MediaWiki_talk:Nstab-media|Talk]] -
            -Media - -{{int:Nstab-media}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-mediawiki&action=edit nstab-mediawiki]
            -[[MediaWiki_talk:Nstab-mediawiki|Talk]] -
            -Message - -{{int:Nstab-mediawiki}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-special&action=edit nstab-special]
            -[[MediaWiki_talk:Nstab-special|Talk]] -
            -Special - -{{int:Nstab-special}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-template&action=edit nstab-template]
            -[[MediaWiki_talk:Nstab-template|Talk]] -
            -Template - -{{int:Nstab-template}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-user&action=edit nstab-user]
            -[[MediaWiki_talk:Nstab-user|Talk]] -
            -User page - -{{int:Nstab-user}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nstab-wp&action=edit nstab-wp]
            -[[MediaWiki_talk:Nstab-wp|Talk]] -
            -About - -{{int:Nstab-wp}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Nviews&action=edit nviews]
            -[[MediaWiki_talk:Nviews|Talk]] -
            -$1 views - -{{int:Nviews}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ok&action=edit ok]
            -[[MediaWiki_talk:Ok|Talk]] -
            -OK - -{{int:Ok}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Oldpassword&action=edit oldpassword]
            -[[MediaWiki_talk:Oldpassword|Talk]] -
            -Old password - -{{int:Oldpassword}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Orig&action=edit orig]
            -[[MediaWiki_talk:Orig|Talk]] -
            -orig - -{{int:Orig}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Orphans&action=edit orphans]
            -[[MediaWiki_talk:Orphans|Talk]] -
            -Orphaned pages - -{{int:Orphans}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Othercontribs&action=edit othercontribs]
            -[[MediaWiki_talk:Othercontribs|Talk]] -
            -Based on work by $1. - -{{int:Othercontribs}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Otherlanguages&action=edit otherlanguages]
            -[[MediaWiki_talk:Otherlanguages|Talk]] -
            -Other languages - -{{int:Otherlanguages}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Pagemovedsub&action=edit pagemovedsub]
            -[[MediaWiki_talk:Pagemovedsub|Talk]] -
            -Move succeeded - -{{int:Pagemovedsub}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Pagemovedtext&action=edit pagemovedtext]
            -[[MediaWiki_talk:Pagemovedtext|Talk]] -
            -Page "[[$1]]" moved to "[[$2]]". - -{{int:Pagemovedtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Pagetitle&action=edit pagetitle]
            -[[MediaWiki_talk:Pagetitle|Talk]] -
            -$1 - Wiktionary - -{{int:Pagetitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Passwordremindertext&action=edit passwordremindertext]
            -[[MediaWiki_talk:Passwordremindertext|Talk]] -
            -Someone (probably you, from IP address $1) -requested that we send you a new Wiktionary login password. -The password for user "$2" is now "$3". -You should log in and change your password now. - -{{int:Passwordremindertext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Passwordremindertitle&action=edit passwordremindertitle]
            -[[MediaWiki_talk:Passwordremindertitle|Talk]] -
            -Password reminder from Wiktionary - -{{int:Passwordremindertitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Passwordsent&action=edit passwordsent]
            -[[MediaWiki_talk:Passwordsent|Talk]] -
            -A new password has been sent to the e-mail address -registered for "$1". -Please log in again after you receive it. - -{{int:Passwordsent}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Perfcached&action=edit perfcached]
            -[[MediaWiki_talk:Perfcached|Talk]] -
            -The following data is cached and may not be completely up to date: - -{{int:Perfcached}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Perfdisabled&action=edit perfdisabled]
            -[[MediaWiki_talk:Perfdisabled|Talk]] -
            -Sorry! This feature has been temporarily disabled -because it slows the database down to the point that no one can use -the wiki. - -{{int:Perfdisabled}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Perfdisabledsub&action=edit perfdisabledsub]
            -[[MediaWiki_talk:Perfdisabledsub|Talk]] -
            -Here's a saved copy from $1: - -{{int:Perfdisabledsub}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Personaltools&action=edit personaltools]
            -[[MediaWiki_talk:Personaltools|Talk]] -
            -Personal tools - -{{int:Personaltools}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Popularpages&action=edit popularpages]
            -[[MediaWiki_talk:Popularpages|Talk]] -
            -Popular pages - -{{int:Popularpages}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Portal&action=edit portal]
            -[[MediaWiki_talk:Portal|Talk]] -
            -Community portal - -{{int:Portal}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Portal-url&action=edit portal-url]
            -[[MediaWiki_talk:Portal-url|Talk]] -
            -Wiktionary:Community Portal - -{{int:Portal-url}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Postcomment&action=edit postcomment]
            -[[MediaWiki_talk:Postcomment|Talk]] -
            -Post a comment - -{{int:Postcomment}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Poweredby&action=edit poweredby]
            -[[MediaWiki_talk:Poweredby|Talk]] -
            -Wiktionary is powered by [http://www.mediawiki.org/ MediaWiki], an open source wiki engine. - -{{int:Poweredby}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Powersearch&action=edit powersearch]
            -[[MediaWiki_talk:Powersearch|Talk]] -
            -Search - -{{int:Powersearch}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Powersearchtext&action=edit powersearchtext]
            -[[MediaWiki_talk:Powersearchtext|Talk]] -
            - -Search in namespaces :<br /> -$1<br /> -$2 List redirects &nbsp; Search for $3 $9 - -{{int:Powersearchtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Preferences&action=edit preferences]
            -[[MediaWiki_talk:Preferences|Talk]] -
            -Preferences - -{{int:Preferences}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefs-help-userdata&action=edit prefs-help-userdata]
            -[[MediaWiki_talk:Prefs-help-userdata|Talk]] -
            -* <strong>Real name</strong> (optional): if you choose to provide it this will be used for giving you attribution for your work.<br/> -* <strong>Email</strong> (optional): Enables people to contact you through the website without you having to reveal your -email address to them, and it can be used to send you a new password if you forget it. - -{{int:Prefs-help-userdata}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefs-misc&action=edit prefs-misc]
            -[[MediaWiki_talk:Prefs-misc|Talk]] -
            -Misc settings - -{{int:Prefs-misc}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefs-personal&action=edit prefs-personal]
            -[[MediaWiki_talk:Prefs-personal|Talk]] -
            -User data - -{{int:Prefs-personal}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefs-rc&action=edit prefs-rc]
            -[[MediaWiki_talk:Prefs-rc|Talk]] -
            -Recent changes and stub display - -{{int:Prefs-rc}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefslogintext&action=edit prefslogintext]
            -[[MediaWiki_talk:Prefslogintext|Talk]] -
            -You are logged in as "$1". -Your internal ID number is $2. - -See [[Wiktionary:User preferences help]] for help deciphering the options. - -{{int:Prefslogintext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefsnologin&action=edit prefsnologin]
            -[[MediaWiki_talk:Prefsnologin|Talk]] -
            -Not logged in - -{{int:Prefsnologin}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefsnologintext&action=edit prefsnologintext]
            -[[MediaWiki_talk:Prefsnologintext|Talk]] -
            -You must be <a href="/wiki/Special:Userlogin">logged in</a> -to set user preferences. - -{{int:Prefsnologintext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prefsreset&action=edit prefsreset]
            -[[MediaWiki_talk:Prefsreset|Talk]] -
            -Preferences have been reset from storage. - -{{int:Prefsreset}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Preview&action=edit preview]
            -[[MediaWiki_talk:Preview|Talk]] -
            -Preview - -{{int:Preview}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Previewconflict&action=edit previewconflict]
            -[[MediaWiki_talk:Previewconflict|Talk]] -
            -This preview reflects the text in the upper -text editing area as it will appear if you choose to save. - -{{int:Previewconflict}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Previewnote&action=edit previewnote]
            -[[MediaWiki_talk:Previewnote|Talk]] -
            -Remember that this is only a preview, and has not yet been saved! - -{{int:Previewnote}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Prevn&action=edit prevn]
            -[[MediaWiki_talk:Prevn|Talk]] -
            -previous $1 - -{{int:Prevn}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Printableversion&action=edit printableversion]
            -[[MediaWiki_talk:Printableversion|Talk]] -
            -Printable version - -{{int:Printableversion}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Printsubtitle&action=edit printsubtitle]
            -[[MediaWiki_talk:Printsubtitle|Talk]] -
            -(From http://tl.wiktionary.org) - -{{int:Printsubtitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protect&action=edit protect]
            -[[MediaWiki_talk:Protect|Talk]] -
            -Protect - -{{int:Protect}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectcomment&action=edit protectcomment]
            -[[MediaWiki_talk:Protectcomment|Talk]] -
            -Reason for protecting - -{{int:Protectcomment}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectedarticle&action=edit protectedarticle]
            -[[MediaWiki_talk:Protectedarticle|Talk]] -
            -protected [[$1]] - -{{int:Protectedarticle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectedpage&action=edit protectedpage]
            -[[MediaWiki_talk:Protectedpage|Talk]] -
            -Protected page - -{{int:Protectedpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectedpagewarning&action=edit protectedpagewarning]
            -[[MediaWiki_talk:Protectedpagewarning|Talk]] -
            -WARNING: This page has been locked so that only -users with sysop privileges can edit it. Be sure you are following the -<a href='/w/wiki.phtml/Wiktionary:Protected_page_guidelines'>protected page -guidelines</a>. - -{{int:Protectedpagewarning}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectedtext&action=edit protectedtext]
            -[[MediaWiki_talk:Protectedtext|Talk]] -
            -This page has been locked to prevent editing; there are -a number of reasons why this may be so, please see -[[Wiktionary:Protected page]]. - -You can view and copy the source of this page: - -{{int:Protectedtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectlogpage&action=edit protectlogpage]
            -[[MediaWiki_talk:Protectlogpage|Talk]] -
            -Protection_log - -{{int:Protectlogpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectlogtext&action=edit protectlogtext]
            -[[MediaWiki_talk:Protectlogtext|Talk]] -
            -Below is a list of page locks/unlocks. -See [[Wiktionary:Protected page]] for more information. - -{{int:Protectlogtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectpage&action=edit protectpage]
            -[[MediaWiki_talk:Protectpage|Talk]] -
            -Protect page - -{{int:Protectpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectreason&action=edit protectreason]
            -[[MediaWiki_talk:Protectreason|Talk]] -
            -(give a reason) - -{{int:Protectreason}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectsub&action=edit protectsub]
            -[[MediaWiki_talk:Protectsub|Talk]] -
            -(Protecting "$1") - -{{int:Protectsub}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Protectthispage&action=edit protectthispage]
            -[[MediaWiki_talk:Protectthispage|Talk]] -
            -Protect this page - -{{int:Protectthispage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Proxyblocker&action=edit proxyblocker]
            -[[MediaWiki_talk:Proxyblocker|Talk]] -
            -Proxy blocker - -{{int:Proxyblocker}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Proxyblockreason&action=edit proxyblockreason]
            -[[MediaWiki_talk:Proxyblockreason|Talk]] -
            -Your IP address has been blocked because it is an open proxy. Please contact your Internet service provider or tech support and inform them of this serious security problem. - -{{int:Proxyblockreason}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Proxyblocksuccess&action=edit proxyblocksuccess]
            -[[MediaWiki_talk:Proxyblocksuccess|Talk]] -
            -Done. - - -{{int:Proxyblocksuccess}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbbrowse&action=edit qbbrowse]
            -[[MediaWiki_talk:Qbbrowse|Talk]] -
            -Browse - -{{int:Qbbrowse}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbedit&action=edit qbedit]
            -[[MediaWiki_talk:Qbedit|Talk]] -
            -Edit - -{{int:Qbedit}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbfind&action=edit qbfind]
            -[[MediaWiki_talk:Qbfind|Talk]] -
            -Find - -{{int:Qbfind}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbmyoptions&action=edit qbmyoptions]
            -[[MediaWiki_talk:Qbmyoptions|Talk]] -
            -My pages - -{{int:Qbmyoptions}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbpageinfo&action=edit qbpageinfo]
            -[[MediaWiki_talk:Qbpageinfo|Talk]] -
            -Context - -{{int:Qbpageinfo}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbpageoptions&action=edit qbpageoptions]
            -[[MediaWiki_talk:Qbpageoptions|Talk]] -
            -This page - -{{int:Qbpageoptions}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbsettings&action=edit qbsettings]
            -[[MediaWiki_talk:Qbsettings|Talk]] -
            -Quickbar settings - -{{int:Qbsettings}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Qbspecialpages&action=edit qbspecialpages]
            -[[MediaWiki_talk:Qbspecialpages|Talk]] -
            -Special pages - -{{int:Qbspecialpages}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Querybtn&action=edit querybtn]
            -[[MediaWiki_talk:Querybtn|Talk]] -
            -Submit query - -{{int:Querybtn}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Querysuccessful&action=edit querysuccessful]
            -[[MediaWiki_talk:Querysuccessful|Talk]] -
            -Query successful - -{{int:Querysuccessful}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Randompage&action=edit randompage]
            -[[MediaWiki_talk:Randompage|Talk]] -
            -Random page - -{{int:Randompage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Range_block_disabled&action=edit range_block_disabled]
            -[[MediaWiki_talk:Range_block_disabled|Talk]] -
            -The sysop ability to create range blocks is disabled. - -{{int:Range_block_disabled}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rchide&action=edit rchide]
            -[[MediaWiki_talk:Rchide|Talk]] -
            -in $4 form; $1 minor edits; $2 secondary namespaces; $3 multiple edits. - -{{int:Rchide}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rclinks&action=edit rclinks]
            -[[MediaWiki_talk:Rclinks|Talk]] -
            -Show last $1 changes in last $2 days<br />$3 - -{{int:Rclinks}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rclistfrom&action=edit rclistfrom]
            -[[MediaWiki_talk:Rclistfrom|Talk]] -
            -Show new changes starting from $1 - -{{int:Rclistfrom}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rcliu&action=edit rcliu]
            -[[MediaWiki_talk:Rcliu|Talk]] -
            -; $1 edits from logged in users - -{{int:Rcliu}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rcloaderr&action=edit rcloaderr]
            -[[MediaWiki_talk:Rcloaderr|Talk]] -
            -Loading recent changes - -{{int:Rcloaderr}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rclsub&action=edit rclsub]
            -[[MediaWiki_talk:Rclsub|Talk]] -
            -(to pages linked from "$1") - -{{int:Rclsub}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rcnote&action=edit rcnote]
            -[[MediaWiki_talk:Rcnote|Talk]] -
            -Below are the last <strong>$1</strong> changes in last <strong>$2</strong> days. - -{{int:Rcnote}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rcnotefrom&action=edit rcnotefrom]
            -[[MediaWiki_talk:Rcnotefrom|Talk]] -
            -Below are the changes since <b>$2</b> (up to <b>$1</b> shown). - -{{int:Rcnotefrom}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Readonly&action=edit readonly]
            -[[MediaWiki_talk:Readonly|Talk]] -
            -Database locked - -{{int:Readonly}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Readonlytext&action=edit readonlytext]
            -[[MediaWiki_talk:Readonlytext|Talk]] -
            -The database is currently locked to new -entries and other modifications, probably for routine database maintenance, -after which it will be back to normal. -The administrator who locked it offered this explanation: -<p>$1 - -{{int:Readonlytext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Readonlywarning&action=edit readonlywarning]
            -[[MediaWiki_talk:Readonlywarning|Talk]] -
            -WARNING: The database has been locked for maintenance, -so you will not be able to save your edits right now. You may wish to cut-n-paste -the text into a text file and save it for later. - -{{int:Readonlywarning}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Recentchanges&action=edit recentchanges]
            -[[MediaWiki_talk:Recentchanges|Talk]] -
            -Recent changes - -{{int:Recentchanges}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Recentchangescount&action=edit recentchangescount]
            -[[MediaWiki_talk:Recentchangescount|Talk]] -
            -Number of titles in recent changes - -{{int:Recentchangescount}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Recentchangeslinked&action=edit recentchangeslinked]
            -[[MediaWiki_talk:Recentchangeslinked|Talk]] -
            -Related changes - -{{int:Recentchangeslinked}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Recentchangestext&action=edit recentchangestext]
            -[[MediaWiki_talk:Recentchangestext|Talk]] -
            -Track the most recent changes to the wiki on this page. - -{{int:Recentchangestext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Redirectedfrom&action=edit redirectedfrom]
            -[[MediaWiki_talk:Redirectedfrom|Talk]] -
            -(Redirected from $1) - -{{int:Redirectedfrom}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Remembermypassword&action=edit remembermypassword]
            -[[MediaWiki_talk:Remembermypassword|Talk]] -
            -Remember my password across sessions. - -{{int:Remembermypassword}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Removechecked&action=edit removechecked]
            -[[MediaWiki_talk:Removechecked|Talk]] -
            -Remove checked items from watchlist - -{{int:Removechecked}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Removedwatch&action=edit removedwatch]
            -[[MediaWiki_talk:Removedwatch|Talk]] -
            -Removed from watchlist - -{{int:Removedwatch}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Removedwatchtext&action=edit removedwatchtext]
            -[[MediaWiki_talk:Removedwatchtext|Talk]] -
            -The page "$1" has been removed from your watchlist. - -{{int:Removedwatchtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Removingchecked&action=edit removingchecked]
            -[[MediaWiki_talk:Removingchecked|Talk]] -
            -Removing requested items from watchlist... - -{{int:Removingchecked}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Resetprefs&action=edit resetprefs]
            -[[MediaWiki_talk:Resetprefs|Talk]] -
            -Reset preferences - -{{int:Resetprefs}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Restorelink&action=edit restorelink]
            -[[MediaWiki_talk:Restorelink|Talk]] -
            -$1 deleted edits - -{{int:Restorelink}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Resultsperpage&action=edit resultsperpage]
            -[[MediaWiki_talk:Resultsperpage|Talk]] -
            -Hits to show per page - -{{int:Resultsperpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Retrievedfrom&action=edit retrievedfrom]
            -[[MediaWiki_talk:Retrievedfrom|Talk]] -
            -Retrieved from "$1" - -{{int:Retrievedfrom}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Returnto&action=edit returnto]
            -[[MediaWiki_talk:Returnto|Talk]] -
            -Return to $1. - -{{int:Returnto}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Retypenew&action=edit retypenew]
            -[[MediaWiki_talk:Retypenew|Talk]] -
            -Retype new password - -{{int:Retypenew}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Reupload&action=edit reupload]
            -[[MediaWiki_talk:Reupload|Talk]] -
            -Re-upload - -{{int:Reupload}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Reuploaddesc&action=edit reuploaddesc]
            -[[MediaWiki_talk:Reuploaddesc|Talk]] -
            -Return to the upload form. - -{{int:Reuploaddesc}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Reverted&action=edit reverted]
            -[[MediaWiki_talk:Reverted|Talk]] -
            -Reverted to earlier revision - -{{int:Reverted}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revertimg&action=edit revertimg]
            -[[MediaWiki_talk:Revertimg|Talk]] -
            -rev - -{{int:Revertimg}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revertpage&action=edit revertpage]
            -[[MediaWiki_talk:Revertpage|Talk]] -
            -Reverted edit of $2, changed back to last version by $1 - -{{int:Revertpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revhistory&action=edit revhistory]
            -[[MediaWiki_talk:Revhistory|Talk]] -
            -Revision history - -{{int:Revhistory}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revisionasof&action=edit revisionasof]
            -[[MediaWiki_talk:Revisionasof|Talk]] -
            -Revision as of $1 - -{{int:Revisionasof}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revnotfound&action=edit revnotfound]
            -[[MediaWiki_talk:Revnotfound|Talk]] -
            -Revision not found - -{{int:Revnotfound}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Revnotfoundtext&action=edit revnotfoundtext]
            -[[MediaWiki_talk:Revnotfoundtext|Talk]] -
            -The old revision of the page you asked for could not be found. -Please check the URL you used to access this page. - - -{{int:Revnotfoundtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rfcurl&action=edit rfcurl]
            -[[MediaWiki_talk:Rfcurl|Talk]] -
            -http://www.faqs.org/rfcs/rfc$1.html - -{{int:Rfcurl}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rights&action=edit rights]
            -[[MediaWiki_talk:Rights|Talk]] -
            -Rights: - -{{int:Rights}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rollback&action=edit rollback]
            -[[MediaWiki_talk:Rollback|Talk]] -
            -Roll back edits - -{{int:Rollback}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rollback_short&action=edit rollback_short]
            -[[MediaWiki_talk:Rollback_short|Talk]] -
            -Rollback - -{{int:Rollback_short}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rollbackfailed&action=edit rollbackfailed]
            -[[MediaWiki_talk:Rollbackfailed|Talk]] -
            -Rollback failed - -{{int:Rollbackfailed}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rollbacklink&action=edit rollbacklink]
            -[[MediaWiki_talk:Rollbacklink|Talk]] -
            -rollback - -{{int:Rollbacklink}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Rows&action=edit rows]
            -[[MediaWiki_talk:Rows|Talk]] -
            -Rows - -{{int:Rows}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Savearticle&action=edit savearticle]
            -[[MediaWiki_talk:Savearticle|Talk]] -
            -Save page - -{{int:Savearticle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Savedprefs&action=edit savedprefs]
            -[[MediaWiki_talk:Savedprefs|Talk]] -
            -Your preferences have been saved. - -{{int:Savedprefs}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Savefile&action=edit savefile]
            -[[MediaWiki_talk:Savefile|Talk]] -
            -Save file - -{{int:Savefile}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Saveprefs&action=edit saveprefs]
            -[[MediaWiki_talk:Saveprefs|Talk]] -
            -Save preferences - -{{int:Saveprefs}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Search&action=edit search]
            -[[MediaWiki_talk:Search|Talk]] -
            -Search - -{{int:Search}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchdisabled&action=edit searchdisabled]
            -[[MediaWiki_talk:Searchdisabled|Talk]] -
            -<p>Sorry! Full text search has been disabled temporarily, for performance reasons. In the meantime, you can use the Google search below, which may be out of date.</p> - -{{int:Searchdisabled}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchhelppage&action=edit searchhelppage]
            -[[MediaWiki_talk:Searchhelppage|Talk]] -
            -Wiktionary:Searching - -{{int:Searchhelppage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchingwikipedia&action=edit searchingwikipedia]
            -[[MediaWiki_talk:Searchingwikipedia|Talk]] -
            -Searching Wiktionary - -{{int:Searchingwikipedia}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchquery&action=edit searchquery]
            -[[MediaWiki_talk:Searchquery|Talk]] -
            -For query "$1" - -{{int:Searchquery}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchresults&action=edit searchresults]
            -[[MediaWiki_talk:Searchresults|Talk]] -
            -Search results - -{{int:Searchresults}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchresultshead&action=edit searchresultshead]
            -[[MediaWiki_talk:Searchresultshead|Talk]] -
            -Search result settings - -{{int:Searchresultshead}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Searchresulttext&action=edit searchresulttext]
            -[[MediaWiki_talk:Searchresulttext|Talk]] -
            -For more information about searching Wiktionary, see $1. - -{{int:Searchresulttext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sectionedit&action=edit sectionedit]
            -[[MediaWiki_talk:Sectionedit|Talk]] -
            - (section) - -{{int:Sectionedit}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selectnewerversionfordiff&action=edit selectnewerversionfordiff]
            -[[MediaWiki_talk:Selectnewerversionfordiff|Talk]] -
            -Select a newer version for comparison - -{{int:Selectnewerversionfordiff}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selectolderversionfordiff&action=edit selectolderversionfordiff]
            -[[MediaWiki_talk:Selectolderversionfordiff|Talk]] -
            -Select an older version for comparison - -{{int:Selectolderversionfordiff}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selectonly&action=edit selectonly]
            -[[MediaWiki_talk:Selectonly|Talk]] -
            -Only read-only queries are allowed. - -{{int:Selectonly}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selflinks&action=edit selflinks]
            -[[MediaWiki_talk:Selflinks|Talk]] -
            -Pages with Self Links - -{{int:Selflinks}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Selflinkstext&action=edit selflinkstext]
            -[[MediaWiki_talk:Selflinkstext|Talk]] -
            -The following pages contain a link to themselves, which they should not. - -{{int:Selflinkstext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Seriousxhtmlerrors&action=edit seriousxhtmlerrors]
            -[[MediaWiki_talk:Seriousxhtmlerrors|Talk]] -
            -There were serious xhtml markup errors detected by tidy. - -{{int:Seriousxhtmlerrors}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Servertime&action=edit servertime]
            -[[MediaWiki_talk:Servertime|Talk]] -
            -Server time is now - -{{int:Servertime}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Set_rights_fail&action=edit set_rights_fail]
            -[[MediaWiki_talk:Set_rights_fail|Talk]] -
            -<b>User rights for "$1" could not be set. (Did you enter the name correctly?)</b> - -{{int:Set_rights_fail}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Set_user_rights&action=edit set_user_rights]
            -[[MediaWiki_talk:Set_user_rights|Talk]] -
            -Set user rights - -{{int:Set_user_rights}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Setbureaucratflag&action=edit setbureaucratflag]
            -[[MediaWiki_talk:Setbureaucratflag|Talk]] -
            -Set bureaucrat flag - -{{int:Setbureaucratflag}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Shortpages&action=edit shortpages]
            -[[MediaWiki_talk:Shortpages|Talk]] -
            -Short pages - -{{int:Shortpages}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Show&action=edit show]
            -[[MediaWiki_talk:Show|Talk]] -
            -show - -{{int:Show}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showhideminor&action=edit showhideminor]
            -[[MediaWiki_talk:Showhideminor|Talk]] -
            -$1 minor edits | $2 bots | $3 logged in users - -{{int:Showhideminor}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showingresults&action=edit showingresults]
            -[[MediaWiki_talk:Showingresults|Talk]] -
            -Showing below <b>$1</b> results starting with #<b>$2</b>. - -{{int:Showingresults}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showingresultsnum&action=edit showingresultsnum]
            -[[MediaWiki_talk:Showingresultsnum|Talk]] -
            -Showing below <b>$3</b> results starting with #<b>$2</b>. - -{{int:Showingresultsnum}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showlast&action=edit showlast]
            -[[MediaWiki_talk:Showlast|Talk]] -
            -Show last $1 images sorted $2. - -{{int:Showlast}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showpreview&action=edit showpreview]
            -[[MediaWiki_talk:Showpreview|Talk]] -
            -Show preview - -{{int:Showpreview}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Showtoc&action=edit showtoc]
            -[[MediaWiki_talk:Showtoc|Talk]] -
            -show - -{{int:Showtoc}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sig_tip&action=edit sig_tip]
            -[[MediaWiki_talk:Sig_tip|Talk]] -
            -Your signature with timestamp - -{{int:Sig_tip}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitestats&action=edit sitestats]
            -[[MediaWiki_talk:Sitestats|Talk]] -
            -Site statistics - -{{int:Sitestats}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitestatstext&action=edit sitestatstext]
            -[[MediaWiki_talk:Sitestatstext|Talk]] -
            -There are '''$1''' total pages in the database. -This includes "talk" pages, pages about Wiktionary, minimal "stub" -pages, redirects, and others that probably don't qualify as content pages. -Excluding those, there are '''$2''' pages that are probably legitimate -content pages. - -There have been a total of '''$3''' page views, and '''$4''' page edits -since the wiki was setup. -That comes to '''$5''' average edits per page, and '''$6''' views per edit. - -{{int:Sitestatstext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitesubtitle&action=edit sitesubtitle]
            -[[MediaWiki_talk:Sitesubtitle|Talk]] -
            -The Free Encyclopedia - -{{int:Sitesubtitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitesupport&action=edit sitesupport]
            -[[MediaWiki_talk:Sitesupport|Talk]] -
            -Donations - -{{int:Sitesupport}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sitetitle&action=edit sitetitle]
            -[[MediaWiki_talk:Sitetitle|Talk]] -
            -Wiktionary - -{{int:Sitetitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Siteuser&action=edit siteuser]
            -[[MediaWiki_talk:Siteuser|Talk]] -
            -Wiktionary user $1 - -{{int:Siteuser}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Siteusers&action=edit siteusers]
            -[[MediaWiki_talk:Siteusers|Talk]] -
            -Wiktionary user(s) $1 - -{{int:Siteusers}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Skin&action=edit skin]
            -[[MediaWiki_talk:Skin|Talk]] -
            -Skin - -{{int:Skin}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Spamprotectiontext&action=edit spamprotectiontext]
            -[[MediaWiki_talk:Spamprotectiontext|Talk]] -
            -The page you wanted to save was blocked by the spam filter. This is probably caused by a link to an external site. - -You might want to check the following regular expression for patterns that are currently blocked: - -{{int:Spamprotectiontext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Spamprotectiontitle&action=edit spamprotectiontitle]
            -[[MediaWiki_talk:Spamprotectiontitle|Talk]] -
            -Spam protection filter - -{{int:Spamprotectiontitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Specialpage&action=edit specialpage]
            -[[MediaWiki_talk:Specialpage|Talk]] -
            -Special Page - -{{int:Specialpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Specialpages&action=edit specialpages]
            -[[MediaWiki_talk:Specialpages|Talk]] -
            -Special pages - -{{int:Specialpages}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Spheading&action=edit spheading]
            -[[MediaWiki_talk:Spheading|Talk]] -
            -Special pages for all users - -{{int:Spheading}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sqlislogged&action=edit sqlislogged]
            -[[MediaWiki_talk:Sqlislogged|Talk]] -
            -Please note that all queries are logged. - -{{int:Sqlislogged}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sqlquery&action=edit sqlquery]
            -[[MediaWiki_talk:Sqlquery|Talk]] -
            -Enter query - -{{int:Sqlquery}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Statistics&action=edit statistics]
            -[[MediaWiki_talk:Statistics|Talk]] -
            -Statistics - -{{int:Statistics}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Storedversion&action=edit storedversion]
            -[[MediaWiki_talk:Storedversion|Talk]] -
            -Stored version - -{{int:Storedversion}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Stubthreshold&action=edit stubthreshold]
            -[[MediaWiki_talk:Stubthreshold|Talk]] -
            -Threshold for stub display - -{{int:Stubthreshold}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Subcategories&action=edit subcategories]
            -[[MediaWiki_talk:Subcategories|Talk]] -
            -Subcategories - -{{int:Subcategories}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Subject&action=edit subject]
            -[[MediaWiki_talk:Subject|Talk]] -
            -Subject/headline - -{{int:Subject}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Subjectpage&action=edit subjectpage]
            -[[MediaWiki_talk:Subjectpage|Talk]] -
            -View subject - -{{int:Subjectpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Successfulupload&action=edit successfulupload]
            -[[MediaWiki_talk:Successfulupload|Talk]] -
            -Successful upload - -{{int:Successfulupload}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Summary&action=edit summary]
            -[[MediaWiki_talk:Summary|Talk]] -
            -Summary - -{{int:Summary}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sysopspheading&action=edit sysopspheading]
            -[[MediaWiki_talk:Sysopspheading|Talk]] -
            -For sysop use only - -{{int:Sysopspheading}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sysoptext&action=edit sysoptext]
            -[[MediaWiki_talk:Sysoptext|Talk]] -
            -The action you have requested can only be -performed by users with "sysop" status. -See $1. - -{{int:Sysoptext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Sysoptitle&action=edit sysoptitle]
            -[[MediaWiki_talk:Sysoptitle|Talk]] -
            -Sysop access required - -{{int:Sysoptitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tableform&action=edit tableform]
            -[[MediaWiki_talk:Tableform|Talk]] -
            -table - -{{int:Tableform}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talk&action=edit talk]
            -[[MediaWiki_talk:Talk|Talk]] -
            -Discussion - -{{int:Talk}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkexists&action=edit talkexists]
            -[[MediaWiki_talk:Talkexists|Talk]] -
            -The page itself was moved successfully, but the -talk page could not be moved because one already exists at the new -title. Please merge them manually. - -{{int:Talkexists}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkpage&action=edit talkpage]
            -[[MediaWiki_talk:Talkpage|Talk]] -
            -Discuss this page - -{{int:Talkpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkpagemoved&action=edit talkpagemoved]
            -[[MediaWiki_talk:Talkpagemoved|Talk]] -
            -The corresponding talk page was also moved. - -{{int:Talkpagemoved}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkpagenotmoved&action=edit talkpagenotmoved]
            -[[MediaWiki_talk:Talkpagenotmoved|Talk]] -
            -The corresponding talk page was <strong>not</strong> moved. - -{{int:Talkpagenotmoved}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Talkpagetext&action=edit talkpagetext]
            -[[MediaWiki_talk:Talkpagetext|Talk]] -
            -<!-- MediaWiki:talkpagetext --> - -{{int:Talkpagetext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Textboxsize&action=edit textboxsize]
            -[[MediaWiki_talk:Textboxsize|Talk]] -
            -Textbox dimensions - -{{int:Textboxsize}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Textmatches&action=edit textmatches]
            -[[MediaWiki_talk:Textmatches|Talk]] -
            -Page text matches - -{{int:Textmatches}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Thisisdeleted&action=edit thisisdeleted]
            -[[MediaWiki_talk:Thisisdeleted|Talk]] -
            -View or restore $1? - -{{int:Thisisdeleted}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Thumbnail-more&action=edit thumbnail-more]
            -[[MediaWiki_talk:Thumbnail-more|Talk]] -
            -Enlarge - -{{int:Thumbnail-more}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Timezonelegend&action=edit timezonelegend]
            -[[MediaWiki_talk:Timezonelegend|Talk]] -
            -Time zone - -{{int:Timezonelegend}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Timezoneoffset&action=edit timezoneoffset]
            -[[MediaWiki_talk:Timezoneoffset|Talk]] -
            -Offset - -{{int:Timezoneoffset}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Timezonetext&action=edit timezonetext]
            -[[MediaWiki_talk:Timezonetext|Talk]] -
            -Enter number of hours your local time differs -from server time (UTC). - -{{int:Timezonetext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Titlematches&action=edit titlematches]
            -[[MediaWiki_talk:Titlematches|Talk]] -
            -Article title matches - -{{int:Titlematches}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Toc&action=edit toc]
            -[[MediaWiki_talk:Toc|Talk]] -
            -Table of contents - -{{int:Toc}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Toolbox&action=edit toolbox]
            -[[MediaWiki_talk:Toolbox|Talk]] -
            -Toolbox - -{{int:Toolbox}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-addsection&action=edit tooltip-addsection]
            -[[MediaWiki_talk:Tooltip-addsection|Talk]] -
            -Add a comment to this page. [alt-+] - -{{int:Tooltip-addsection}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-anontalk&action=edit tooltip-anontalk]
            -[[MediaWiki_talk:Tooltip-anontalk|Talk]] -
            -Discussion about edits from this ip address [alt-n] - -{{int:Tooltip-anontalk}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-anonuserpage&action=edit tooltip-anonuserpage]
            -[[MediaWiki_talk:Tooltip-anonuserpage|Talk]] -
            -The user page for the ip you're editing as [alt-.] - -{{int:Tooltip-anonuserpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-article&action=edit tooltip-article]
            -[[MediaWiki_talk:Tooltip-article|Talk]] -
            -View the content page [alt-a] - -{{int:Tooltip-article}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-atom&action=edit tooltip-atom]
            -[[MediaWiki_talk:Tooltip-atom|Talk]] -
            -Atom feed for this page - -{{int:Tooltip-atom}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-compareselectedversions&action=edit tooltip-compareselectedversions]
            -[[MediaWiki_talk:Tooltip-compareselectedversions|Talk]] -
            -See the differences between the two selected versions of this page. [alt-v] - -{{int:Tooltip-compareselectedversions}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-contributions&action=edit tooltip-contributions]
            -[[MediaWiki_talk:Tooltip-contributions|Talk]] -
            -View the list of contributions of this user - -{{int:Tooltip-contributions}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-currentevents&action=edit tooltip-currentevents]
            -[[MediaWiki_talk:Tooltip-currentevents|Talk]] -
            -Find background information on current events - -{{int:Tooltip-currentevents}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-delete&action=edit tooltip-delete]
            -[[MediaWiki_talk:Tooltip-delete|Talk]] -
            -Delete this page [alt-d] - -{{int:Tooltip-delete}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-edit&action=edit tooltip-edit]
            -[[MediaWiki_talk:Tooltip-edit|Talk]] -
            -You can edit this page. Please use the preview button before saving. [alt-e] - -{{int:Tooltip-edit}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-emailuser&action=edit tooltip-emailuser]
            -[[MediaWiki_talk:Tooltip-emailuser|Talk]] -
            -Send a mail to this user - -{{int:Tooltip-emailuser}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-help&action=edit tooltip-help]
            -[[MediaWiki_talk:Tooltip-help|Talk]] -
            -The place to find out. - -{{int:Tooltip-help}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-history&action=edit tooltip-history]
            -[[MediaWiki_talk:Tooltip-history|Talk]] -
            -Past versions of this page, [alt-h] - -{{int:Tooltip-history}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-login&action=edit tooltip-login]
            -[[MediaWiki_talk:Tooltip-login|Talk]] -
            -You are encouraged to log in, it is not mandatory however. [alt-o] - -{{int:Tooltip-login}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-logout&action=edit tooltip-logout]
            -[[MediaWiki_talk:Tooltip-logout|Talk]] -
            -Log out [alt-o] - -{{int:Tooltip-logout}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-mainpage&action=edit tooltip-mainpage]
            -[[MediaWiki_talk:Tooltip-mainpage|Talk]] -
            -Visit the Main Page [alt-z] - -{{int:Tooltip-mainpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-minoredit&action=edit tooltip-minoredit]
            -[[MediaWiki_talk:Tooltip-minoredit|Talk]] -
            -Mark this as a minor edit [alt-i] - -{{int:Tooltip-minoredit}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-move&action=edit tooltip-move]
            -[[MediaWiki_talk:Tooltip-move|Talk]] -
            -Move this page [alt-m] - -{{int:Tooltip-move}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-mycontris&action=edit tooltip-mycontris]
            -[[MediaWiki_talk:Tooltip-mycontris|Talk]] -
            -List of my contributions [alt-y] - -{{int:Tooltip-mycontris}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-mytalk&action=edit tooltip-mytalk]
            -[[MediaWiki_talk:Tooltip-mytalk|Talk]] -
            -My talk page [alt-n] - -{{int:Tooltip-mytalk}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-nomove&action=edit tooltip-nomove]
            -[[MediaWiki_talk:Tooltip-nomove|Talk]] -
            -You don't have the permissions to move this page - -{{int:Tooltip-nomove}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-portal&action=edit tooltip-portal]
            -[[MediaWiki_talk:Tooltip-portal|Talk]] -
            -About the project, what you can do, where to find things - -{{int:Tooltip-portal}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-preferences&action=edit tooltip-preferences]
            -[[MediaWiki_talk:Tooltip-preferences|Talk]] -
            -My preferences - -{{int:Tooltip-preferences}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-preview&action=edit tooltip-preview]
            -[[MediaWiki_talk:Tooltip-preview|Talk]] -
            -Preview your changes, please use this before saving! [alt-p] - -{{int:Tooltip-preview}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-protect&action=edit tooltip-protect]
            -[[MediaWiki_talk:Tooltip-protect|Talk]] -
            -Protect this page [alt-=] - -{{int:Tooltip-protect}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-randompage&action=edit tooltip-randompage]
            -[[MediaWiki_talk:Tooltip-randompage|Talk]] -
            -Load a random page [alt-x] - -{{int:Tooltip-randompage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-recentchanges&action=edit tooltip-recentchanges]
            -[[MediaWiki_talk:Tooltip-recentchanges|Talk]] -
            -The list of recent changes in the wiki. [alt-r] - -{{int:Tooltip-recentchanges}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-recentchangeslinked&action=edit tooltip-recentchangeslinked]
            -[[MediaWiki_talk:Tooltip-recentchangeslinked|Talk]] -
            -Recent changes in pages linking to this page [alt-c] - -{{int:Tooltip-recentchangeslinked}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-rss&action=edit tooltip-rss]
            -[[MediaWiki_talk:Tooltip-rss|Talk]] -
            -RSS feed for this page - -{{int:Tooltip-rss}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-save&action=edit tooltip-save]
            -[[MediaWiki_talk:Tooltip-save|Talk]] -
            -Save your changes [alt-s] - -{{int:Tooltip-save}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-search&action=edit tooltip-search]
            -[[MediaWiki_talk:Tooltip-search|Talk]] -
            -Search this wiki [alt-f] - -{{int:Tooltip-search}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-sitesupport&action=edit tooltip-sitesupport]
            -[[MediaWiki_talk:Tooltip-sitesupport|Talk]] -
            -Support Wiktionary - -{{int:Tooltip-sitesupport}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-specialpage&action=edit tooltip-specialpage]
            -[[MediaWiki_talk:Tooltip-specialpage|Talk]] -
            -This is a special page, you can't edit the page itself. - -{{int:Tooltip-specialpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-specialpages&action=edit tooltip-specialpages]
            -[[MediaWiki_talk:Tooltip-specialpages|Talk]] -
            -List of all special pages [alt-q] - -{{int:Tooltip-specialpages}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-talk&action=edit tooltip-talk]
            -[[MediaWiki_talk:Tooltip-talk|Talk]] -
            -Discussion about the content page [alt-t] - -{{int:Tooltip-talk}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-undelete&action=edit tooltip-undelete]
            -[[MediaWiki_talk:Tooltip-undelete|Talk]] -
            -Restore the $1 edits done to this page before it was deleted [alt-d] - -{{int:Tooltip-undelete}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-unwatch&action=edit tooltip-unwatch]
            -[[MediaWiki_talk:Tooltip-unwatch|Talk]] -
            -Remove this page from your watchlist [alt-w] - -{{int:Tooltip-unwatch}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-upload&action=edit tooltip-upload]
            -[[MediaWiki_talk:Tooltip-upload|Talk]] -
            -Upload images or media files [alt-u] - -{{int:Tooltip-upload}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-userpage&action=edit tooltip-userpage]
            -[[MediaWiki_talk:Tooltip-userpage|Talk]] -
            -My user page [alt-.] - -{{int:Tooltip-userpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-viewsource&action=edit tooltip-viewsource]
            -[[MediaWiki_talk:Tooltip-viewsource|Talk]] -
            -This page is protected. You can view its source. [alt-e] - -{{int:Tooltip-viewsource}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-watch&action=edit tooltip-watch]
            -[[MediaWiki_talk:Tooltip-watch|Talk]] -
            -Add this page to your watchlist [alt-w] - -{{int:Tooltip-watch}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-watchlist&action=edit tooltip-watchlist]
            -[[MediaWiki_talk:Tooltip-watchlist|Talk]] -
            -The list of pages you're monitoring for changes. [alt-l] - -{{int:Tooltip-watchlist}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Tooltip-whatlinkshere&action=edit tooltip-whatlinkshere]
            -[[MediaWiki_talk:Tooltip-whatlinkshere|Talk]] -
            -List of all wiki pages that link here [alt-b] - -{{int:Tooltip-whatlinkshere}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uclinks&action=edit uclinks]
            -[[MediaWiki_talk:Uclinks|Talk]] -
            -View the last $1 changes; view the last $2 days. - -{{int:Uclinks}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Ucnote&action=edit ucnote]
            -[[MediaWiki_talk:Ucnote|Talk]] -
            -Below are this user's last <b>$1</b> changes in the last <b>$2</b> days. - -{{int:Ucnote}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uctop&action=edit uctop]
            -[[MediaWiki_talk:Uctop|Talk]] -
            - (top) - -{{int:Uctop}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unblockip&action=edit unblockip]
            -[[MediaWiki_talk:Unblockip|Talk]] -
            -Unblock user - -{{int:Unblockip}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unblockiptext&action=edit unblockiptext]
            -[[MediaWiki_talk:Unblockiptext|Talk]] -
            -Use the form below to restore write access -to a previously blocked IP address or username. - -{{int:Unblockiptext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unblocklink&action=edit unblocklink]
            -[[MediaWiki_talk:Unblocklink|Talk]] -
            -unblock - -{{int:Unblocklink}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unblocklogentry&action=edit unblocklogentry]
            -[[MediaWiki_talk:Unblocklogentry|Talk]] -
            -unblocked "$1" - -{{int:Unblocklogentry}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undelete&action=edit undelete]
            -[[MediaWiki_talk:Undelete|Talk]] -
            -Restore deleted page - -{{int:Undelete}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undelete_short&action=edit undelete_short]
            -[[MediaWiki_talk:Undelete_short|Talk]] -
            -Undelete $1 edits - -{{int:Undelete_short}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletearticle&action=edit undeletearticle]
            -[[MediaWiki_talk:Undeletearticle|Talk]] -
            -Restore deleted page - -{{int:Undeletearticle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletebtn&action=edit undeletebtn]
            -[[MediaWiki_talk:Undeletebtn|Talk]] -
            -Restore! - -{{int:Undeletebtn}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletedarticle&action=edit undeletedarticle]
            -[[MediaWiki_talk:Undeletedarticle|Talk]] -
            -restored "$1" - -{{int:Undeletedarticle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletedtext&action=edit undeletedtext]
            -[[MediaWiki_talk:Undeletedtext|Talk]] -
            -[[$1]] has been successfully restored. -See [[Wiktionary:Deletion_log]] for a record of recent deletions and restorations. - -{{int:Undeletedtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletehistory&action=edit undeletehistory]
            -[[MediaWiki_talk:Undeletehistory|Talk]] -
            -If you restore the page, all revisions will be restored to the history. -If a new page with the same name has been created since the deletion, the restored -revisions will appear in the prior history, and the current revision of the live page -will not be automatically replaced. - -{{int:Undeletehistory}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletepage&action=edit undeletepage]
            -[[MediaWiki_talk:Undeletepage|Talk]] -
            -View and restore deleted pages - -{{int:Undeletepage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeletepagetext&action=edit undeletepagetext]
            -[[MediaWiki_talk:Undeletepagetext|Talk]] -
            -The following pages have been deleted but are still in the archive and -can be restored. The archive may be periodically cleaned out. - -{{int:Undeletepagetext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeleterevision&action=edit undeleterevision]
            -[[MediaWiki_talk:Undeleterevision|Talk]] -
            -Deleted revision as of $1 - -{{int:Undeleterevision}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Undeleterevisions&action=edit undeleterevisions]
            -[[MediaWiki_talk:Undeleterevisions|Talk]] -
            -$1 revisions archived - -{{int:Undeleterevisions}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unexpected&action=edit unexpected]
            -[[MediaWiki_talk:Unexpected|Talk]] -
            -Unexpected value: "$1"="$2". - -{{int:Unexpected}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockbtn&action=edit unlockbtn]
            -[[MediaWiki_talk:Unlockbtn|Talk]] -
            -Unlock database - -{{int:Unlockbtn}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockconfirm&action=edit unlockconfirm]
            -[[MediaWiki_talk:Unlockconfirm|Talk]] -
            -Yes, I really want to unlock the database. - -{{int:Unlockconfirm}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockdb&action=edit unlockdb]
            -[[MediaWiki_talk:Unlockdb|Talk]] -
            -Unlock database - -{{int:Unlockdb}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockdbsuccesssub&action=edit unlockdbsuccesssub]
            -[[MediaWiki_talk:Unlockdbsuccesssub|Talk]] -
            -Database lock removed - -{{int:Unlockdbsuccesssub}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockdbsuccesstext&action=edit unlockdbsuccesstext]
            -[[MediaWiki_talk:Unlockdbsuccesstext|Talk]] -
            -The database has been unlocked. - -{{int:Unlockdbsuccesstext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unlockdbtext&action=edit unlockdbtext]
            -[[MediaWiki_talk:Unlockdbtext|Talk]] -
            -Unlocking the database will restore the ability of all -users to edit pages, change their preferences, edit their watchlists, and -other things requiring changes in the database. -Please confirm that this is what you intend to do. - -{{int:Unlockdbtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotect&action=edit unprotect]
            -[[MediaWiki_talk:Unprotect|Talk]] -
            -Unprotect - -{{int:Unprotect}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotectcomment&action=edit unprotectcomment]
            -[[MediaWiki_talk:Unprotectcomment|Talk]] -
            -Reason for unprotecting - -{{int:Unprotectcomment}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotectedarticle&action=edit unprotectedarticle]
            -[[MediaWiki_talk:Unprotectedarticle|Talk]] -
            -unprotected [[$1]] - -{{int:Unprotectedarticle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotectsub&action=edit unprotectsub]
            -[[MediaWiki_talk:Unprotectsub|Talk]] -
            -(Unprotecting "$1") - -{{int:Unprotectsub}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unprotectthispage&action=edit unprotectthispage]
            -[[MediaWiki_talk:Unprotectthispage|Talk]] -
            -Unprotect this page - -{{int:Unprotectthispage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unusedimages&action=edit unusedimages]
            -[[MediaWiki_talk:Unusedimages|Talk]] -
            -Unused images - -{{int:Unusedimages}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unusedimagestext&action=edit unusedimagestext]
            -[[MediaWiki_talk:Unusedimagestext|Talk]] -
            -<p>Please note that other web sites may link to an image with -a direct URL, and so may still be listed here despite being -in active use. - -{{int:Unusedimagestext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unwatch&action=edit unwatch]
            -[[MediaWiki_talk:Unwatch|Talk]] -
            -Unwatch - -{{int:Unwatch}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Unwatchthispage&action=edit unwatchthispage]
            -[[MediaWiki_talk:Unwatchthispage|Talk]] -
            -Stop watching - -{{int:Unwatchthispage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Updated&action=edit updated]
            -[[MediaWiki_talk:Updated|Talk]] -
            -(Updated) - -{{int:Updated}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Upload&action=edit upload]
            -[[MediaWiki_talk:Upload|Talk]] -
            -Upload file - -{{int:Upload}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadbtn&action=edit uploadbtn]
            -[[MediaWiki_talk:Uploadbtn|Talk]] -
            -Upload file - -{{int:Uploadbtn}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploaddisabled&action=edit uploaddisabled]
            -[[MediaWiki_talk:Uploaddisabled|Talk]] -
            -Sorry, uploading is disabled. - -{{int:Uploaddisabled}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadedfiles&action=edit uploadedfiles]
            -[[MediaWiki_talk:Uploadedfiles|Talk]] -
            -Uploaded files - -{{int:Uploadedfiles}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadedimage&action=edit uploadedimage]
            -[[MediaWiki_talk:Uploadedimage|Talk]] -
            -uploaded "$1" - -{{int:Uploadedimage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploaderror&action=edit uploaderror]
            -[[MediaWiki_talk:Uploaderror|Talk]] -
            -Upload error - -{{int:Uploaderror}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadfile&action=edit uploadfile]
            -[[MediaWiki_talk:Uploadfile|Talk]] -
            -Upload images, sounds, documents etc. - -{{int:Uploadfile}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadlink&action=edit uploadlink]
            -[[MediaWiki_talk:Uploadlink|Talk]] -
            -Upload images - -{{int:Uploadlink}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadlog&action=edit uploadlog]
            -[[MediaWiki_talk:Uploadlog|Talk]] -
            -upload log - -{{int:Uploadlog}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadlogpage&action=edit uploadlogpage]
            -[[MediaWiki_talk:Uploadlogpage|Talk]] -
            -Upload_log - -{{int:Uploadlogpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadlogpagetext&action=edit uploadlogpagetext]
            -[[MediaWiki_talk:Uploadlogpagetext|Talk]] -
            -Below is a list of the most recent file uploads. -All times shown are server time (UTC). -<ul> -</ul> - - -{{int:Uploadlogpagetext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadnologin&action=edit uploadnologin]
            -[[MediaWiki_talk:Uploadnologin|Talk]] -
            -Not logged in - -{{int:Uploadnologin}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadnologintext&action=edit uploadnologintext]
            -[[MediaWiki_talk:Uploadnologintext|Talk]] -
            -You must be <a href="/wiki/Special:Userlogin">logged in</a> -to upload files. - -{{int:Uploadnologintext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadtext&action=edit uploadtext]
            -[[MediaWiki_talk:Uploadtext|Talk]] -
            -<strong>STOP!</strong> Before you upload here, -make sure to read and follow the <a href="/wiki/Special:Image_use_policy">image use policy</a>. -<p>If a file with the name you are specifying already -exists on the wiki, it'll be replaced without warning. -So unless you mean to update a file, it's a good idea -to first check if such a file exists. -<p>To view or search previously uploaded images, -go to the <a href="/wiki/Special:Imagelist">list of uploaded images</a>. -Uploads and deletions are logged on the <a href="/wiki/Wiktionary:Upload_log">upload log</a>. -</p><p>Use the form below to upload new image files for use in -illustrating your pages. -On most browsers, you will see a "Browse..." button, which will -bring up your operating system's standard file open dialog. -Choosing a file will fill the name of that file into the text -field next to the button. -You must also check the box affirming that you are not -violating any copyrights by uploading the file. -Press the "Upload" button to finish the upload. -This may take some time if you have a slow internet connection. -<p>The preferred formats are JPEG for photographic images, PNG -for drawings and other iconic images, and OGG for sounds. -Please name your files descriptively to avoid confusion. -To include the image in a page, use a link in the form -<b>[[Image:file.jpg]]</b> or <b>[[Image:file.png|alt text]]</b> -or <b>[[Media:file.ogg]]</b> for sounds. -<p>Please note that as with wiki pages, others may edit or -delete your uploads if they think it serves the project, and -you may be blocked from uploading if you abuse the system. - -{{int:Uploadtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Uploadwarning&action=edit uploadwarning]
            -[[MediaWiki_talk:Uploadwarning|Talk]] -
            -Upload warning - -{{int:Uploadwarning}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:User_rights_set&action=edit user_rights_set]
            -[[MediaWiki_talk:User_rights_set|Talk]] -
            -<b>User rights for "$1" updated</b> - -{{int:User_rights_set}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Usercssjs&action=edit usercssjs]
            -[[MediaWiki_talk:Usercssjs|Talk]] -
            -'''Note:''' After saving, you have to tell your bowser to get the new version: '''Mozilla:''' click ''reload''(or ''ctrl-r''), '''IE / Opera:''' ''ctrl-f5'', '''Safari:''' ''cmd-r'', '''Konqueror''' ''ctrl-r''. - -{{int:Usercssjs}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Usercssjsyoucanpreview&action=edit usercssjsyoucanpreview]
            -[[MediaWiki_talk:Usercssjsyoucanpreview|Talk]] -
            -<strong>Tip:</strong> Use the 'Show preview' button to test your new css/js before saving. - -{{int:Usercssjsyoucanpreview}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Usercsspreview&action=edit usercsspreview]
            -[[MediaWiki_talk:Usercsspreview|Talk]] -
            -'''Remember that you are only previewing your user css, it has not yet been saved!''' - -{{int:Usercsspreview}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userexists&action=edit userexists]
            -[[MediaWiki_talk:Userexists|Talk]] -
            -The user name you entered is already in use. Please choose a different name. - -{{int:Userexists}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userjspreview&action=edit userjspreview]
            -[[MediaWiki_talk:Userjspreview|Talk]] -
            -'''Remember that you are only testing/previewing your user javascript, it has not yet been saved!''' - -{{int:Userjspreview}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userlogin&action=edit userlogin]
            -[[MediaWiki_talk:Userlogin|Talk]] -
            -Log in - -{{int:Userlogin}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userlogout&action=edit userlogout]
            -[[MediaWiki_talk:Userlogout|Talk]] -
            -Log out - -{{int:Userlogout}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Usermailererror&action=edit usermailererror]
            -[[MediaWiki_talk:Usermailererror|Talk]] -
            -Mail object returned error: - -{{int:Usermailererror}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userpage&action=edit userpage]
            -[[MediaWiki_talk:Userpage|Talk]] -
            -View user page - -{{int:Userpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userstats&action=edit userstats]
            -[[MediaWiki_talk:Userstats|Talk]] -
            -User statistics - -{{int:Userstats}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Userstatstext&action=edit userstatstext]
            -[[MediaWiki_talk:Userstatstext|Talk]] -
            -There are '''$1''' registered users. -'''$2''' of these are administrators (see $3). - -{{int:Userstatstext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Version&action=edit version]
            -[[MediaWiki_talk:Version|Talk]] -
            -Version - -{{int:Version}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Viewcount&action=edit viewcount]
            -[[MediaWiki_talk:Viewcount|Talk]] -
            -This page has been accessed $1 times. - -{{int:Viewcount}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Viewprevnext&action=edit viewprevnext]
            -[[MediaWiki_talk:Viewprevnext|Talk]] -
            -View ($1) ($2) ($3). - -{{int:Viewprevnext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Viewsource&action=edit viewsource]
            -[[MediaWiki_talk:Viewsource|Talk]] -
            -View source - -{{int:Viewsource}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Viewtalkpage&action=edit viewtalkpage]
            -[[MediaWiki_talk:Viewtalkpage|Talk]] -
            -View discussion - -{{int:Viewtalkpage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wantedpages&action=edit wantedpages]
            -[[MediaWiki_talk:Wantedpages|Talk]] -
            -Wanted pages - -{{int:Wantedpages}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watch&action=edit watch]
            -[[MediaWiki_talk:Watch|Talk]] -
            -Watch - -{{int:Watch}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchdetails&action=edit watchdetails]
            -[[MediaWiki_talk:Watchdetails|Talk]] -
            -($1 pages watched not counting talk pages; -$2 total pages edited since cutoff; -$3... -<a href='$4'>show and edit complete list</a>.) - -{{int:Watchdetails}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watcheditlist&action=edit watcheditlist]
            -[[MediaWiki_talk:Watcheditlist|Talk]] -
            -Here's an alphabetical list of your -watched pages. Check the boxes of pages you want to remove -from your watchlist and click the 'remove checked' button -at the bottom of the screen. - -{{int:Watcheditlist}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchlist&action=edit watchlist]
            -[[MediaWiki_talk:Watchlist|Talk]] -
            -My watchlist - -{{int:Watchlist}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchlistcontains&action=edit watchlistcontains]
            -[[MediaWiki_talk:Watchlistcontains|Talk]] -
            -Your watchlist contains $1 pages. - -{{int:Watchlistcontains}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchlistsub&action=edit watchlistsub]
            -[[MediaWiki_talk:Watchlistsub|Talk]] -
            -(for user "$1") - -{{int:Watchlistsub}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchmethod-list&action=edit watchmethod-list]
            -[[MediaWiki_talk:Watchmethod-list|Talk]] -
            -checking watched pages for recent edits - -{{int:Watchmethod-list}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchmethod-recent&action=edit watchmethod-recent]
            -[[MediaWiki_talk:Watchmethod-recent|Talk]] -
            -checking recent edits for watched pages - -{{int:Watchmethod-recent}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchnochange&action=edit watchnochange]
            -[[MediaWiki_talk:Watchnochange|Talk]] -
            -None of your watched items were edited in the time period displayed. - -{{int:Watchnochange}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchnologin&action=edit watchnologin]
            -[[MediaWiki_talk:Watchnologin|Talk]] -
            -Not logged in - -{{int:Watchnologin}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchnologintext&action=edit watchnologintext]
            -[[MediaWiki_talk:Watchnologintext|Talk]] -
            -You must be <a href="/wiki/Special:Userlogin">logged in</a> -to modify your watchlist. - -{{int:Watchnologintext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchthis&action=edit watchthis]
            -[[MediaWiki_talk:Watchthis|Talk]] -
            -Watch this page - -{{int:Watchthis}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Watchthispage&action=edit watchthispage]
            -[[MediaWiki_talk:Watchthispage|Talk]] -
            -Watch this page - -{{int:Watchthispage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Welcomecreation&action=edit welcomecreation]
            -[[MediaWiki_talk:Welcomecreation|Talk]] -
            -<h2>Welcome, $1!</h2><p>Your account has been created. -Don't forget to change your Wiktionary preferences. - -{{int:Welcomecreation}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whatlinkshere&action=edit whatlinkshere]
            -[[MediaWiki_talk:Whatlinkshere|Talk]] -
            -What links here - -{{int:Whatlinkshere}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistacctext&action=edit whitelistacctext]
            -[[MediaWiki_talk:Whitelistacctext|Talk]] -
            -To be allowed to create accounts in this Wiki you have to [[Special:Userlogin|log]] in and have the appropriate permissions. - -{{int:Whitelistacctext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistacctitle&action=edit whitelistacctitle]
            -[[MediaWiki_talk:Whitelistacctitle|Talk]] -
            -You are not allowed to create an account - -{{int:Whitelistacctitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistedittext&action=edit whitelistedittext]
            -[[MediaWiki_talk:Whitelistedittext|Talk]] -
            -You have to [[Special:Userlogin|login]] to edit pages. - -{{int:Whitelistedittext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistedittitle&action=edit whitelistedittitle]
            -[[MediaWiki_talk:Whitelistedittitle|Talk]] -
            -Login required to edit - -{{int:Whitelistedittitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistreadtext&action=edit whitelistreadtext]
            -[[MediaWiki_talk:Whitelistreadtext|Talk]] -
            -You have to [[Special:Userlogin|login]] to read pages. - -{{int:Whitelistreadtext}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Whitelistreadtitle&action=edit whitelistreadtitle]
            -[[MediaWiki_talk:Whitelistreadtitle|Talk]] -
            -Login required to read - -{{int:Whitelistreadtitle}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wikipediapage&action=edit wikipediapage]
            -[[MediaWiki_talk:Wikipediapage|Talk]] -
            -View project page - -{{int:Wikipediapage}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wikititlesuffix&action=edit wikititlesuffix]
            -[[MediaWiki_talk:Wikititlesuffix|Talk]] -
            -Wiktionary - -{{int:Wikititlesuffix}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wlnote&action=edit wlnote]
            -[[MediaWiki_talk:Wlnote|Talk]] -
            -Below are the last $1 changes in the last <b>$2</b> hours. - -{{int:Wlnote}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wlsaved&action=edit wlsaved]
            -[[MediaWiki_talk:Wlsaved|Talk]] -
            -This is a saved version of your watchlist. - -{{int:Wlsaved}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wlshowlast&action=edit wlshowlast]
            -[[MediaWiki_talk:Wlshowlast|Talk]] -
            -Show last $1 hours $2 days $3 - -{{int:Wlshowlast}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wrong_wfQuery_params&action=edit wrong_wfQuery_params]
            -[[MediaWiki_talk:Wrong_wfQuery_params|Talk]] -
            -Incorrect parameters to wfQuery()<br /> -Function: $1<br /> -Query: $2 - - -{{int:Wrong_wfQuery_params}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Wrongpassword&action=edit wrongpassword]
            -[[MediaWiki_talk:Wrongpassword|Talk]] -
            -The password you entered is incorrect. Please try again. - -{{int:Wrongpassword}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourdiff&action=edit yourdiff]
            -[[MediaWiki_talk:Yourdiff|Talk]] -
            -Differences - -{{int:Yourdiff}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Youremail&action=edit youremail]
            -[[MediaWiki_talk:Youremail|Talk]] -
            -Your email* - -{{int:Youremail}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourname&action=edit yourname]
            -[[MediaWiki_talk:Yourname|Talk]] -
            -Your user name - -{{int:Yourname}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yournick&action=edit yournick]
            -[[MediaWiki_talk:Yournick|Talk]] -
            -Your nickname (for signatures) - -{{int:Yournick}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourpassword&action=edit yourpassword]
            -[[MediaWiki_talk:Yourpassword|Talk]] -
            -Your password - -{{int:Yourpassword}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourpasswordagain&action=edit yourpasswordagain]
            -[[MediaWiki_talk:Yourpasswordagain|Talk]] -
            -Retype password - -{{int:Yourpasswordagain}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourrealname&action=edit yourrealname]
            -[[MediaWiki_talk:Yourrealname|Talk]] -
            -Your real name* - -{{int:Yourrealname}} -
            -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Yourtext&action=edit yourtext]
            -[[MediaWiki_talk:Yourtext|Talk]] -
            -Your text - -{{int:Yourtext}} -
            - diff --git a/tests/parser/preprocess/Factorial.expected b/tests/parser/preprocess/Factorial.expected deleted file mode 100644 index a10fd6ca..00000000 --- a/tests/parser/preprocess/Factorial.expected +++ /dev/null @@ -1,17 +0,0 @@ -1011*011*021*031*041*051*061*071*081*091*101*111*121*131*141*151*161*171*181*191*201*211*221*231*241*251*261*271*281*291*301*311*321*331*341*351*361*371*381*391*401*411*421*431*441*451*461*471*481*491*501*511*521*531*541*551*561*571*581*591*601*611*621*631*641*651*661*671*681*691*701*711*721*731*741*751*761*771*781*791*801*811*821*831*841*851*861*871*881*891*901*911*921*931*941*951*961*971*981*99<noinclude> - -This template finds the [[factorial]] of a number. To use it, enter:<br /> -<code><nowiki></nowiki></code><br /> -The input must be a positive interger smaller than 100 (better than most calculators, which go up to only 69). This template works by repeating conditional multiplications. Examples:<br /> -*<nowiki></nowiki> gives -*<nowiki></nowiki> gives -*<nowiki></nowiki> gives -*<nowiki></nowiki> gives -*<nowiki></nowiki> gives -*<nowiki></nowiki> gives (invalid input) -*<nowiki></nowiki> gives (invalid input) - -[[Category:Mathematical templates|]] -</noinclude> - - \ No newline at end of file diff --git a/tests/parser/preprocess/Factorial.txt b/tests/parser/preprocess/Factorial.txt deleted file mode 100644 index 316f0792..00000000 --- a/tests/parser/preprocess/Factorial.txt +++ /dev/null @@ -1,16 +0,0 @@ -{{#expr:{{#ifeq:{{#expr:{{{1}}}>=00}}|1|01{{#ifeq:{{#expr:{{{1}}}>=01}}|1|*01{{#ifeq:{{#expr:{{{1}}}>=02}}|1|*02{{#ifeq:{{#expr:{{{1}}}>=03}}|1|*03{{#ifeq:{{#expr:{{{1}}}>=04}}|1|*04{{#ifeq:{{#expr:{{{1}}}>=05}}|1|*05{{#ifeq:{{#expr:{{{1}}}>=06}}|1|*06{{#ifeq:{{#expr:{{{1}}}>=07}}|1|*07{{#ifeq:{{#expr:{{{1}}}>=08}}|1|*08{{#ifeq:{{#expr:{{{1}}}>=09}}|1|*09{{#ifeq:{{#expr:{{{1}}}>=10}}|1|*10{{#ifeq:{{#expr:{{{1}}}>=11}}|1|*11{{#ifeq:{{#expr:{{{1}}}>=12}}|1|*12{{#ifeq:{{#expr:{{{1}}}>=13}}|1|*13{{#ifeq:{{#expr:{{{1}}}>=14}}|1|*14{{#ifeq:{{#expr:{{{1}}}>=15}}|1|*15{{#ifeq:{{#expr:{{{1}}}>=16}}|1|*16{{#ifeq:{{#expr:{{{1}}}>=17}}|1|*17{{#ifeq:{{#expr:{{{1}}}>=18}}|1|*18{{#ifeq:{{#expr:{{{1}}}>=19}}|1|*19{{#ifeq:{{#expr:{{{1}}}>=20}}|1|*20{{#ifeq:{{#expr:{{{1}}}>=21}}|1|*21{{#ifeq:{{#expr:{{{1}}}>=22}}|1|*22{{#ifeq:{{#expr:{{{1}}}>=23}}|1|*23{{#ifeq:{{#expr:{{{1}}}>=24}}|1|*24{{#ifeq:{{#expr:{{{1}}}>=25}}|1|*25{{#ifeq:{{#expr:{{{1}}}>=26}}|1|*26{{#ifeq:{{#expr:{{{1}}}>=27}}|1|*27{{#ifeq:{{#expr:{{{1}}}>=28}}|1|*28{{#ifeq:{{#expr:{{{1}}}>=29}}|1|*29{{#ifeq:{{#expr:{{{1}}}>=30}}|1|*30{{#ifeq:{{#expr:{{{1}}}>=31}}|1|*31{{#ifeq:{{#expr:{{{1}}}>=32}}|1|*32{{#ifeq:{{#expr:{{{1}}}>=33}}|1|*33{{#ifeq:{{#expr:{{{1}}}>=34}}|1|*34{{#ifeq:{{#expr:{{{1}}}>=35}}|1|*35{{#ifeq:{{#expr:{{{1}}}>=36}}|1|*36{{#ifeq:{{#expr:{{{1}}}>=37}}|1|*37{{#ifeq:{{#expr:{{{1}}}>=38}}|1|*38{{#ifeq:{{#expr:{{{1}}}>=39}}|1|*39{{#ifeq:{{#expr:{{{1}}}>=40}}|1|*40{{#ifeq:{{#expr:{{{1}}}>=41}}|1|*41{{#ifeq:{{#expr:{{{1}}}>=42}}|1|*42{{#ifeq:{{#expr:{{{1}}}>=43}}|1|*43{{#ifeq:{{#expr:{{{1}}}>=44}}|1|*44{{#ifeq:{{#expr:{{{1}}}>=45}}|1|*45{{#ifeq:{{#expr:{{{1}}}>=46}}|1|*46{{#ifeq:{{#expr:{{{1}}}>=47}}|1|*47{{#ifeq:{{#expr:{{{1}}}>=48}}|1|*48{{#ifeq:{{#expr:{{{1}}}>=49}}|1|*49{{#ifeq:{{#expr:{{{1}}}>=50}}|1|*50{{#ifeq:{{#expr:{{{1}}}>=51}}|1|*51{{#ifeq:{{#expr:{{{1}}}>=52}}|1|*52{{#ifeq:{{#expr:{{{1}}}>=53}}|1|*53{{#ifeq:{{#expr:{{{1}}}>=54}}|1|*54{{#ifeq:{{#expr:{{{1}}}>=55}}|1|*55{{#ifeq:{{#expr:{{{1}}}>=56}}|1|*56{{#ifeq:{{#expr:{{{1}}}>=57}}|1|*57{{#ifeq:{{#expr:{{{1}}}>=58}}|1|*58{{#ifeq:{{#expr:{{{1}}}>=59}}|1|*59{{#ifeq:{{#expr:{{{1}}}>=60}}|1|*60{{#ifeq:{{#expr:{{{1}}}>=61}}|1|*61{{#ifeq:{{#expr:{{{1}}}>=62}}|1|*62{{#ifeq:{{#expr:{{{1}}}>=63}}|1|*63{{#ifeq:{{#expr:{{{1}}}>=64}}|1|*64{{#ifeq:{{#expr:{{{1}}}>=65}}|1|*65{{#ifeq:{{#expr:{{{1}}}>=66}}|1|*66{{#ifeq:{{#expr:{{{1}}}>=67}}|1|*67{{#ifeq:{{#expr:{{{1}}}>=68}}|1|*68{{#ifeq:{{#expr:{{{1}}}>=69}}|1|*69{{#ifeq:{{#expr:{{{1}}}>=70}}|1|*70{{#ifeq:{{#expr:{{{1}}}>=71}}|1|*71{{#ifeq:{{#expr:{{{1}}}>=72}}|1|*72{{#ifeq:{{#expr:{{{1}}}>=73}}|1|*73{{#ifeq:{{#expr:{{{1}}}>=74}}|1|*74{{#ifeq:{{#expr:{{{1}}}>=75}}|1|*75{{#ifeq:{{#expr:{{{1}}}>=76}}|1|*76{{#ifeq:{{#expr:{{{1}}}>=77}}|1|*77{{#ifeq:{{#expr:{{{1}}}>=78}}|1|*78{{#ifeq:{{#expr:{{{1}}}>=79}}|1|*79{{#ifeq:{{#expr:{{{1}}}>=80}}|1|*80{{#ifeq:{{#expr:{{{1}}}>=81}}|1|*81{{#ifeq:{{#expr:{{{1}}}>=82}}|1|*82{{#ifeq:{{#expr:{{{1}}}>=83}}|1|*83{{#ifeq:{{#expr:{{{1}}}>=84}}|1|*84{{#ifeq:{{#expr:{{{1}}}>=85}}|1|*85{{#ifeq:{{#expr:{{{1}}}>=86}}|1|*86{{#ifeq:{{#expr:{{{1}}}>=87}}|1|*87{{#ifeq:{{#expr:{{{1}}}>=88}}|1|*88{{#ifeq:{{#expr:{{{1}}}>=89}}|1|*89{{#ifeq:{{#expr:{{{1}}}>=90}}|1|*90{{#ifeq:{{#expr:{{{1}}}>=91}}|1|*91{{#ifeq:{{#expr:{{{1}}}>=92}}|1|*92{{#ifeq:{{#expr:{{{1}}}>=93}}|1|*93{{#ifeq:{{#expr:{{{1}}}>=94}}|1|*94{{#ifeq:{{#expr:{{{1}}}>=95}}|1|*95{{#ifeq:{{#expr:{{{1}}}>=96}}|1|*96{{#ifeq:{{#expr:{{{1}}}>=97}}|1|*97{{#ifeq:{{#expr:{{{1}}}>=98}}|1|*98{{#ifeq:{{#expr:{{{1}}}>=99}}|1|*99}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -{{Template documentation}} -This template finds the [[factorial]] of a number. To use it, enter:
            -{{factorial|input}}
            -The input must be a positive interger smaller than 100 (better than most calculators, which go up to only 69). This template works by repeating conditional multiplications. Examples:
            -*{{factorial|2}} gives {{factorial|2}} -*{{factorial|3}} gives {{factorial|3}} -*{{factorial|5}} gives {{factorial|5}} -*{{factorial|10}} gives {{factorial|10}} -*{{factorial|80}} gives {{factorial|80}} -*{{factorial|0.5}} gives {{factorial|0.5}} (invalid input) -*{{factorial|-1}} gives {{factorial|-1}} (invalid input) -{{esoteric}} -[[Category:Mathematical templates|{{PAGENAME}}]] -
            - diff --git a/tests/parser/preprocess/Fundraising.expected b/tests/parser/preprocess/Fundraising.expected deleted file mode 100644 index f5b32cc5..00000000 --- a/tests/parser/preprocess/Fundraising.expected +++ /dev/null @@ -1,18 +0,0 @@ -<div name="fundraising" id="fundraising" class="plainlinks" style="margin-top:5px; text-align: center; background-color: #ffffe0; border: solid 1px #e0e0c0"> -'''Pwede kang [[Wikimedia:give the gift of knowledge|maghandog ng kaalaman]] sa paraan ng [[Wikimedia:Fundraising#Donation_methods|pagbibigay ng donasyon sa Pundasyong Wikimedia!]]''' -<br /> -<fundraising/> -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -<fundraisinglogo/> -<br /> -<b>Ngayon, ang iyong [[Wikimedia:Fundraising|kontribusyon]] ay [[Wikimedia:Fundraising FAQ|itatambal]] ng isang anonimong kaibigan.</b> -<br /> -<small> -[[Wikimedia:Deductibility of donations|Pagbabawas sa mga buwis ng donasyon]] -| -[[Wikimedia:Fundraising FAQ|FAQ]] -| -[http://upload.wikimedia.org/wikipedia/foundation/2/28/Wikimedia_2006_fs.pdf Mga pampananalaping pahayag] -</small> -</div> - \ No newline at end of file diff --git a/tests/parser/preprocess/Fundraising.txt b/tests/parser/preprocess/Fundraising.txt deleted file mode 100644 index b868b4d8..00000000 --- a/tests/parser/preprocess/Fundraising.txt +++ /dev/null @@ -1,17 +0,0 @@ - diff --git a/tests/parser/preprocess/NestedTemplates.expected b/tests/parser/preprocess/NestedTemplates.expected deleted file mode 100644 index 645626df..00000000 --- a/tests/parser/preprocess/NestedTemplates.expected +++ /dev/null @@ -1,90 +0,0 @@ - - -argument - -Nach [[:meta:Help:Expansion#XML parse tree]] -{vorlagenname} - - -erweiterung - - - <template><title>vorlagenname - -<template><title>vorlagenname - - -nur etwas erweitert -<tplarg><title>vorlagenname - <tplarg><title>vorlagenname -<tplarg><title>vorlagenname -} -{ <template><title>vorlagenname} - -{ <template><title>vorlagenname} -{ -{<template><title>vorlagenname } - - {<template><title>vorlagenname } - -{<tplarg><title> } - - -<tplarg><title><template><title> - -{{<tplarg><title> } } -<template><title><tplarg><title> - -{<template><title><template><title> } -{ } -{ - -<template><title><tplarg><title> -<tplarg><title><template><title> - - - - -argument - -Nach [[:meta:Help:Expansion#XML parse tree]] -{vorlagenname} - - -erweiterung - - - <template><title>vorlagenname - -<template><title>vorlagenname - - -nur etwas erweitert -<tplarg><title>vorlagenname - <tplarg><title>vorlagenname -<tplarg><title>vorlagenname -} -{ <template><title>vorlagenname} - -{ <template><title>vorlagenname} -{ -{<template><title>vorlagenname } - - {<template><title>vorlagenname } - -{<tplarg><title> } - - -<tplarg><title><template><title> - -{{<tplarg><title> } } -<template><title><tplarg><title> - -{<template><title><template><title> } -{ } -{ - -<template><title><tplarg><title> -<tplarg><title><template><title> - - \ No newline at end of file diff --git a/tests/parser/preprocess/NestedTemplates.txt b/tests/parser/preprocess/NestedTemplates.txt deleted file mode 100644 index aa9a472d..00000000 --- a/tests/parser/preprocess/NestedTemplates.txt +++ /dev/null @@ -1,89 +0,0 @@ -{{vorlage}} - -{{{argument}}} - -Nach [[:meta:Help:Expansion#XML parse tree]] -{{{{vorlagenname}}}} -{{ {{vorlagenname}}}} -{{{{vorlagenname}} }} -{{{{vorlagenname}}erweiterung}} - -{{{{{vorlagenname}}}}} -{{{ {{vorlagenname}}}}} -{{ {{{vorlagenname}}}}} -{{{{{vorlagenname}} }}} -{{{{{vorlagenname}}} }} - -nur etwas erweitert -{{{{{{vorlagenname}}}}}} -{{{ {{{vorlagenname}}}}}} -{{{{{{vorlagenname}}} }}} -{{ {{{{vorlagenname}}}}}} -{{{{ {{vorlagenname}}}}}} -{{ {{ {{vorlagenname}}}}}} -{{{{ {{vorlagenname}}} }}} -{{{{{{vorlagenname}}}} }} -{{{{{{vorlagenname}} }}}} -{{ {{{{vorlagenname}} }}}} -{{{ {{{vorlagenname}} }}}} - -{{{{{{{ }}}}}}} - -{{{{{{{{ }}}}}}}} -{{{{{{{{ }} }}}}}} -{{{{{{{{ }}} }}}}} -{{{{{{{{ }}}} }}}} -{{{{{{{{ }}}}} }}} -{{{{{{{{ }}}}}} }} -{{{{{{{{ }} }} }}}} -{{{{{{{{ }} }}}} }} -{{{{{{{{ }}}} }} }} -{{{{{{{{ }}} }}} }} -{{{{{{{{ }}} }} }}} -{{{{{{{{ }} }}} }}} -{{{{{{{{ }} }} }} }} - -{{vorlage}} - -{{{argument}}} - -Nach [[:meta:Help:Expansion#XML parse tree]] -{{{{vorlagenname}}}} -{{ {{vorlagenname}}}} -{{{{vorlagenname}} }} -{{{{vorlagenname}}erweiterung}} - -{{{{{vorlagenname}}}}} -{{{ {{vorlagenname}}}}} -{{ {{{vorlagenname}}}}} -{{{{{vorlagenname}} }}} -{{{{{vorlagenname}}} }} - -nur etwas erweitert -{{{{{{vorlagenname}}}}}} -{{{ {{{vorlagenname}}}}}} -{{{{{{vorlagenname}}} }}} -{{ {{{{vorlagenname}}}}}} -{{{{ {{vorlagenname}}}}}} -{{ {{ {{vorlagenname}}}}}} -{{{{ {{vorlagenname}}} }}} -{{{{{{vorlagenname}}}} }} -{{{{{{vorlagenname}} }}}} -{{ {{{{vorlagenname}} }}}} -{{{ {{{vorlagenname}} }}}} - -{{{{{{{ }}}}}}} - -{{{{{{{{ }}}}}}}} -{{{{{{{{ }} }}}}}} -{{{{{{{{ }}} }}}}} -{{{{{{{{ }}}} }}}} -{{{{{{{{ }}}}} }}} -{{{{{{{{ }}}}}} }} -{{{{{{{{ }} }} }}}} -{{{{{{{{ }} }}}} }} -{{{{{{{{ }}}} }} }} -{{{{{{{{ }}} }}} }} -{{{{{{{{ }}} }} }}} -{{{{{{{{ }} }}} }}} -{{{{{{{{ }} }} }} }} diff --git a/tests/parser/preprocess/QuoteQuran.expected b/tests/parser/preprocess/QuoteQuran.expected deleted file mode 100644 index e9a78e46..00000000 --- a/tests/parser/preprocess/QuoteQuran.expected +++ /dev/null @@ -1,140 +0,0 @@ -<noinclude></noinclude> -<div class="boilerplate metadata rfa" style="background-color:#FFFFF5; margin: 2em 0 0 0; padding: 0 10px 0 10px; border: 1px solid #AAAAAA;">The [[Qur'an]], [[sura|chapter]] , [[ayat|verse]] [http://www.usc.edu/dept/MSA/quran/.qmt.html#. 21]''':'''</font></div> - - \ No newline at end of file diff --git a/tests/parser/preprocess/QuoteQuran.txt b/tests/parser/preprocess/QuoteQuran.txt deleted file mode 100644 index 3cfac5b2..00000000 --- a/tests/parser/preprocess/QuoteQuran.txt +++ /dev/null @@ -1,139 +0,0 @@ -{{Template sandbox notice}} -
            - diff --git a/tests/parserTests.php b/tests/parserTests.php deleted file mode 100644 index debb3575..00000000 --- a/tests/parserTests.php +++ /dev/null @@ -1,94 +0,0 @@ - - * http://www.mediawiki.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @file - * @ingroup Testing - */ - -$otions = array( 'quick', 'color', 'quiet', 'help', 'show-output', 'record', 'run-disabled', 'run-parsoid' ); -$optionsWithArgs = array( 'regex', 'filter', 'seed', 'setversion' ); - -require_once __DIR__ . '/../maintenance/commandLine.inc'; -require_once __DIR__ . '/TestsAutoLoader.php'; - -if ( isset( $options['help'] ) ) { - echo << Run test cases from a custom file instead of parserTests.txt - --record Record tests in database - --compare Compare with recorded results, without updating the database. - --setversion When using --record, set the version string to use (useful - with git-svn so that you can get the exact revision) - --keep-uploads Re-use the same upload directory for each test, don't delete it - --fuzz Do a fuzz test instead of a normal test - --seed Start the fuzz test from the specified seed - --help Show this help message - --run-disabled run disabled tests - --run-parsoid run parsoid tests (normally disabled) - -ENDS; - exit( 0 ); -} - -# Cases of weird db corruption were encountered when running tests on earlyish -# versions of SQLite -if ( $wgDBtype == 'sqlite' ) { - $db = wfGetDB( DB_MASTER ); - $version = $db->getServerVersion(); - if ( version_compare( $version, '3.6' ) < 0 ) { - die( "Parser tests require SQLite version 3.6 or later, you have $version\n" ); - } -} - -# There is a convention that the parser should never -# refer to $wgTitle directly, but instead use the title -# passed to it. -$wgTitle = Title::newFromText( 'Parser test script do not use' ); -$tester = new ParserTest( $options ); - -if ( isset( $options['file'] ) ) { - $files = array( $options['file'] ); -} else { - // Default parser tests and any set from extensions or local config - $files = $wgParserTestFiles; -} - -# Print out software version to assist with locating regressions -$version = SpecialVersion::getVersion(); -echo "This is MediaWiki version {$version}.\n\n"; - -if ( isset( $options['fuzz'] ) ) { - $tester->fuzzTest( $files ); -} else { - $ok = $tester->runTestsFromFiles( $files ); - exit( $ok ? 0 : 1 ); -} diff --git a/tests/phpunit/Makefile b/tests/phpunit/Makefile deleted file mode 100644 index c3e2a303..00000000 --- a/tests/phpunit/Makefile +++ /dev/null @@ -1,91 +0,0 @@ -.PHONY: help test phpunit install coverage warning destructive parser noparser safe databaseless list-groups -.DEFAULT: warning - -SHELL = /bin/sh -CONFIG_FILE = ${PWD}/suite.xml -PHP = php -PU = ${PHP} phpunit.php --configuration ${CONFIG_FILE} ${FLAGS} - -all test: warning - -warning: - @echo "Run 'make help' to get usage" - @echo "" - @echo "WARNING -- some tests are DESTRUCTIVE and will alter your wiki." - @echo "DO NOT RUN THESE TESTS on a production wiki." - @echo "" - @echo "Until the default tests are made non-destructive, you can run" - @echo "the destructive tests like so:" - @echo "" - @echo " make destructive" - @echo "" - @echo "Some tests are expected to be safe, you can run them with" - @echo "" - @echo " make safe" - @echo "" - @echo "You are recommended to run the tests with read-only credentials." - @echo "" - @echo "If you don't have a database running, you can still run" - @echo "" - @echo " make databaseless" - @echo "" - -destructive: phpunit - -phpunit: - ${PU} - -install: - ./install-phpunit.sh - -tap: - ${PU} --tap - -coverage: - ${PU} --coverage-html ../../docs/code-coverage - -parser: - ${PU} --group Parser -parserfuzz: - @echo "******************************************************************" - @echo "* This WILL kill your computer by eating all memory AND all swap *" - @echo "* *" - @echo "* If you are on a production machine. ABORT NOW!! *" - @echo "* Press control+C to stop *" - @echo "* *" - @echo "******************************************************************" - ${PU} --group Parser,ParserFuzz -noparser: - ${PU} --exclude-group Parser,Broken,ParserFuzz,Stub - -safe: - ${PU} --exclude-group Broken,ParserFuzz,Destructive,Stub - -databaseless: - ${PU} --exclude-group Broken,ParserFuzz,Destructive,Database,Stub - -database: - ${PU} --exclude-group Broken,ParserFuzz,Destructive,Stub --group Database - -list-groups: - ${PU} --list-groups - -help: - # Usage: - # make [OPTION=value] - # - # Targets: - # phpunit (default) Run all the tests with phpunit - # install Install PHPUnit from phpunit.de - # tap Run the tests individually through Test::Harness's prove(1) - # help You're looking at it! - # coverage Run the tests and generates an HTML code coverage report - # You will need the Xdebug PHP extension for the later. - # [no]parser Skip or only run Parser tests - # - # list-groups List availabe Tests groups. - # - # Options: - # CONFIG_FILE Path to a PHPUnit configuration file (default: suite.xml) - # FLAGS Additional flags to pass to PHPUnit - # PHP Path to php diff --git a/tests/phpunit/MediaWikiLangTestCase.php b/tests/phpunit/MediaWikiLangTestCase.php deleted file mode 100644 index 1131385f..00000000 --- a/tests/phpunit/MediaWikiLangTestCase.php +++ /dev/null @@ -1,33 +0,0 @@ -getCode() ) { - throw new MWException( "Error in MediaWikiLangTestCase::setUp(): " . - "\$wgLanguageCode ('$wgLanguageCode') is different from " . - "\$wgContLang->getCode() (" . $wgContLang->getCode() . ")" ); - } - - // HACK: Call getLanguage() so the real $wgContLang is cached as the user language - // rather than our fake one. This is to avoid breaking other, unrelated tests. - RequestContext::getMain()->getLanguage(); - - $langCode = 'en'; # For mainpage to be 'Main Page' - $langObj = Language::factory( $langCode ); - - $this->setMwGlobals( array( - 'wgLanguageCode' => $langCode, - 'wgLang' => $langObj, - 'wgContLang' => $langObj, - ) ); - - MessageCache::singleton()->disable(); - } -} diff --git a/tests/phpunit/MediaWikiPHPUnitCommand.php b/tests/phpunit/MediaWikiPHPUnitCommand.php deleted file mode 100644 index 042956a9..00000000 --- a/tests/phpunit/MediaWikiPHPUnitCommand.php +++ /dev/null @@ -1,119 +0,0 @@ - false, - 'file=' => false, - 'use-filebackend=' => false, - 'use-bagostuff=' => false, - 'use-jobqueue=' => false, - 'keep-uploads' => false, - 'use-normal-tables' => false, - 'reuse-db' => false, - 'wiki=' => false, - 'debug-tests' => false, - ); - - public function __construct() { - foreach ( self::$additionalOptions as $option => $default ) { - $this->longOptions[$option] = $option . 'Handler'; - } - } - - protected function handleArguments( array $argv ) { - parent::handleArguments( $argv ); - - if ( !isset( $this->arguments['listeners'] ) ) { - $this->arguments['listeners'] = array(); - } - - foreach ( $this->options[0] as $option ) { - switch ( $option[0] ) { - case '--debug-tests': - $this->arguments['listeners'][] = new MediaWikiPHPUnitTestListener( 'PHPUnitCommand' ); - break; - } - } - } - - public static function main( $exit = true ) { - $command = new self; - - if ( wfIsWindows() ) { - # Windows does not come anymore with ANSI.SYS loaded by default - # PHPUnit uses the suite.xml parameters to enable/disable colors - # which can be then forced to be enabled with --colors. - # The below code inject a parameter just like if the user called - # phpunit with a --no-color option (which does not exist). It - # overrides the suite.xml setting. - # Probably fix bug 29226 - $command->arguments['colors'] = false; - } - - # Makes MediaWiki PHPUnit directory includable so the PHPUnit will - # be able to resolve relative files inclusion such as suites/* - # PHPUnit uses stream_resolve_include_path() internally - # See bug 32022 - set_include_path( - __DIR__ - . PATH_SEPARATOR - . get_include_path() - ); - - $command->run( $_SERVER['argv'], $exit ); - } - - public function __call( $func, $args ) { - - if ( substr( $func, -7 ) == 'Handler' ) { - if ( is_null( $args[0] ) ) { - $args[0] = true; - } //Booleans - self::$additionalOptions[substr( $func, 0, -7 )] = $args[0]; - } - } - - public function run( array $argv, $exit = true ) { - wfProfileIn( __METHOD__ ); - - $ret = parent::run( $argv, false ); - - wfProfileOut( __METHOD__ ); - - // Return to real wiki db, so profiling data is preserved - MediaWikiTestCase::teardownTestDB(); - - // Log profiling data, e.g. in the database or UDP - wfLogProfilingData(); - - if ( $exit ) { - exit( $ret ); - } else { - return $ret; - } - } - - public function showHelp() { - parent::showHelp(); - - print <<logChannel = $logChannel; - } - - protected function getTestName( PHPUnit_Framework_Test $test ) { - $name = get_class( $test ); - - if ( $test instanceof PHPUnit_Framework_TestCase ) { - $name .= '::' . $test->getName( true ); - } - - return $name; - } - - protected function getErrorName( Exception $exception ) { - $name = get_class( $exception ); - $name = "[$name] " . $exception->getMessage(); - - return $name; - } - - /** - * An error occurred. - * - * @param PHPUnit_Framework_Test $test - * @param Exception $e - * @param float $time - */ - public function addError( PHPUnit_Framework_Test $test, Exception $e, $time ) { - wfDebugLog( $this->logChannel, 'ERROR in ' . $this->getTestName( $test ) . ': ' . $this->getErrorName( $e ) ); - } - - /** - * A failure occurred. - * - * @param PHPUnit_Framework_Test $test - * @param PHPUnit_Framework_AssertionFailedError $e - * @param float $time - */ - public function addFailure( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time ) { - wfDebugLog( $this->logChannel, 'FAILURE in ' . $this->getTestName( $test ) . ': ' . $this->getErrorName( $e ) ); - } - - /** - * Incomplete test. - * - * @param PHPUnit_Framework_Test $test - * @param Exception $e - * @param float $time - */ - public function addIncompleteTest( PHPUnit_Framework_Test $test, Exception $e, $time ) { - wfDebugLog( $this->logChannel, 'Incomplete test ' . $this->getTestName( $test ) . ': ' . $this->getErrorName( $e ) ); - } - - /** - * Skipped test. - * - * @param PHPUnit_Framework_Test $test - * @param Exception $e - * @param float $time - * - * @since Method available since Release 3.0.0 - */ - public function addSkippedTest( PHPUnit_Framework_Test $test, Exception $e, $time ) { - wfDebugLog( $this->logChannel, 'Skipped test ' . $this->getTestName( $test ) . ': ' . $this->getErrorName( $e ) ); - } - - /** - * A test suite started. - * - * @param PHPUnit_Framework_TestSuite $suite - * @since Method available since Release 2.2.0 - */ - public function startTestSuite( PHPUnit_Framework_TestSuite $suite ) { - wfDebugLog( $this->logChannel, 'START suite ' . $suite->getName() ); - } - - /** - * A test suite ended. - * - * @param PHPUnit_Framework_TestSuite $suite - * @since Method available since Release 2.2.0 - */ - public function endTestSuite( PHPUnit_Framework_TestSuite $suite ) { - wfDebugLog( $this->logChannel, 'END suite ' . $suite->getName() ); - } - - /** - * A test started. - * - * @param PHPUnit_Framework_Test $test - */ - public function startTest( PHPUnit_Framework_Test $test ) { - wfDebugLog( $this->logChannel, 'Start test ' . $this->getTestName( $test ) ); - } - - /** - * A test ended. - * - * @param PHPUnit_Framework_Test $test - * @param float $time - */ - public function endTest( PHPUnit_Framework_Test $test, $time ) { - wfDebugLog( $this->logChannel, 'End test ' . $this->getTestName( $test ) ); - } -} diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php deleted file mode 100644 index 6ce78b56..00000000 --- a/tests/phpunit/MediaWikiTestCase.php +++ /dev/null @@ -1,948 +0,0 @@ -backupGlobals = false; - $this->backupStaticAttributes = false; - } - - function run( PHPUnit_Framework_TestResult $result = null ) { - /* Some functions require some kind of caching, and will end up using the db, - * which we can't allow, as that would open a new connection for mysql. - * Replace with a HashBag. They would not be going to persist anyway. - */ - ObjectCache::$instances[CACHE_DB] = new HashBagOStuff; - - $needsResetDB = false; - $logName = get_class( $this ) . '::' . $this->getName( false ); - - if ( $this->needsDB() ) { - // set up a DB connection for this test to use - - self::$useTemporaryTables = !$this->getCliArg( 'use-normal-tables' ); - self::$reuseDB = $this->getCliArg( 'reuse-db' ); - - $this->db = wfGetDB( DB_MASTER ); - - $this->checkDbIsSupported(); - - if ( !self::$dbSetup ) { - wfProfileIn( $logName . ' (clone-db)' ); - - // switch to a temporary clone of the database - self::setupTestDB( $this->db, $this->dbPrefix() ); - - if ( ( $this->db->getType() == 'oracle' || !self::$useTemporaryTables ) && self::$reuseDB ) { - $this->resetDB(); - } - - wfProfileOut( $logName . ' (clone-db)' ); - } - - wfProfileIn( $logName . ' (prepare-db)' ); - $this->addCoreDBData(); - $this->addDBData(); - wfProfileOut( $logName . ' (prepare-db)' ); - - $needsResetDB = true; - } - - wfProfileIn( $logName ); - parent::run( $result ); - wfProfileOut( $logName ); - - if ( $needsResetDB ) { - wfProfileIn( $logName . ' (reset-db)' ); - $this->resetDB(); - wfProfileOut( $logName . ' (reset-db)' ); - } - } - - function usesTemporaryTables() { - return self::$useTemporaryTables; - } - - /** - * obtains a new temporary file name - * - * The obtained filename is enlisted to be removed upon tearDown - * - * @return string: absolute name of the temporary file - */ - protected function getNewTempFile() { - $fname = tempnam( wfTempDir(), 'MW_PHPUnit_' . get_class( $this ) . '_' ); - $this->tmpfiles[] = $fname; - - return $fname; - } - - /** - * obtains a new temporary directory - * - * The obtained directory is enlisted to be removed (recursively with all its contained - * files) upon tearDown. - * - * @return string: absolute name of the temporary directory - */ - protected function getNewTempDirectory() { - // Starting of with a temporary /file/. - $fname = $this->getNewTempFile(); - - // Converting the temporary /file/ to a /directory/ - // - // The following is not atomic, but at least we now have a single place, - // where temporary directory creation is bundled and can be improved - unlink( $fname ); - $this->assertTrue( wfMkdirParents( $fname ) ); - - return $fname; - } - - /** - * setUp and tearDown should (where significant) - * happen in reverse order. - */ - protected function setUp() { - wfProfileIn( __METHOD__ ); - parent::setUp(); - $this->called['setUp'] = 1; - - /* - // @todo global variables to restore for *every* test - array( - 'wgLang', - 'wgContLang', - 'wgLanguageCode', - 'wgUser', - 'wgTitle', - ); - */ - - // Cleaning up temporary files - foreach ( $this->tmpfiles as $fname ) { - if ( is_file( $fname ) || ( is_link( $fname ) ) ) { - unlink( $fname ); - } elseif ( is_dir( $fname ) ) { - wfRecursiveRemoveDir( $fname ); - } - } - - if ( $this->needsDB() && $this->db ) { - // Clean up open transactions - while ( $this->db->trxLevel() > 0 ) { - $this->db->rollback(); - } - - // don't ignore DB errors - $this->db->ignoreErrors( false ); - } - - wfProfileOut( __METHOD__ ); - } - - protected function tearDown() { - wfProfileIn( __METHOD__ ); - - // Cleaning up temporary files - foreach ( $this->tmpfiles as $fname ) { - if ( is_file( $fname ) || ( is_link( $fname ) ) ) { - unlink( $fname ); - } elseif ( is_dir( $fname ) ) { - wfRecursiveRemoveDir( $fname ); - } - } - - if ( $this->needsDB() && $this->db ) { - // Clean up open transactions - while ( $this->db->trxLevel() > 0 ) { - $this->db->rollback(); - } - - // don't ignore DB errors - $this->db->ignoreErrors( false ); - } - - // Restore mw globals - foreach ( $this->mwGlobals as $key => $value ) { - $GLOBALS[$key] = $value; - } - $this->mwGlobals = array(); - - parent::tearDown(); - wfProfileOut( __METHOD__ ); - } - - /** - * Make sure MediaWikiTestCase extending classes have called their - * parent setUp method - */ - final public function testMediaWikiTestCaseParentSetupCalled() { - $this->assertArrayHasKey( 'setUp', $this->called, - get_called_class() . "::setUp() must call parent::setUp()" - ); - } - - /** - * Individual test functions may override globals (either directly or through this - * setMwGlobals() function), however one must call this method at least once for - * each key within the setUp(). - * That way the key is added to the array of globals that will be reset afterwards - * in the tearDown(). And, equally important, that way all other tests are executed - * with the same settings (instead of using the unreliable local settings for most - * tests and fix it only for some tests). - * - * @example - * - * protected function setUp() { - * $this->setMwGlobals( 'wgRestrictStuff', true ); - * } - * - * function testFoo() {} - * - * function testBar() {} - * $this->assertTrue( self::getX()->doStuff() ); - * - * $this->setMwGlobals( 'wgRestrictStuff', false ); - * $this->assertTrue( self::getX()->doStuff() ); - * } - * - * function testQuux() {} - * - * - * @param array|string $pairs Key to the global variable, or an array - * of key/value pairs. - * @param mixed $value Value to set the global to (ignored - * if an array is given as first argument). - */ - protected function setMwGlobals( $pairs, $value = null ) { - - // Normalize (string, value) to an array - if ( is_string( $pairs ) ) { - $pairs = array( $pairs => $value ); - } - - foreach ( $pairs as $key => $value ) { - // NOTE: make sure we only save the global once or a second call to - // setMwGlobals() on the same global would override the original - // value. - if ( !array_key_exists( $key, $this->mwGlobals ) ) { - $this->mwGlobals[$key] = $GLOBALS[$key]; - } - - // Override the global - $GLOBALS[$key] = $value; - } - } - - /** - * Merges the given values into a MW global array variable. - * Useful for setting some entries in a configuration array, instead of - * setting the entire array. - * - * @param String $name The name of the global, as in wgFooBar - * @param Array $values The array containing the entries to set in that global - * - * @throws MWException if the designated global is not an array. - */ - protected function mergeMwGlobalArrayValue( $name, $values ) { - if ( !isset( $GLOBALS[$name] ) ) { - $merged = $values; - } else { - if ( !is_array( $GLOBALS[$name] ) ) { - throw new MWException( "MW global $name is not an array." ); - } - - // NOTE: do not use array_merge, it screws up for numeric keys. - $merged = $GLOBALS[$name]; - foreach ( $values as $k => $v ) { - $merged[$k] = $v; - } - } - - $this->setMwGlobals( $name, $merged ); - } - - function dbPrefix() { - return $this->db->getType() == 'oracle' ? self::ORA_DB_PREFIX : self::DB_PREFIX; - } - - function needsDB() { - # if the test says it uses database tables, it needs the database - if ( $this->tablesUsed ) { - return true; - } - - # if the test says it belongs to the Database group, it needs the database - $rc = new ReflectionClass( $this ); - if ( preg_match( '/@group +Database/im', $rc->getDocComment() ) ) { - return true; - } - - return false; - } - - /** - * Stub. If a test needs to add additional data to the database, it should - * implement this method and do so - */ - function addDBData() { - } - - private function addCoreDBData() { - # disabled for performance - #$this->tablesUsed[] = 'page'; - #$this->tablesUsed[] = 'revision'; - - if ( $this->db->getType() == 'oracle' ) { - - # Insert 0 user to prevent FK violations - # Anonymous user - $this->db->insert( 'user', array( - 'user_id' => 0, - 'user_name' => 'Anonymous' ), __METHOD__, array( 'IGNORE' ) ); - - # Insert 0 page to prevent FK violations - # Blank page - $this->db->insert( 'page', array( - 'page_id' => 0, - 'page_namespace' => 0, - 'page_title' => ' ', - 'page_restrictions' => null, - 'page_counter' => 0, - 'page_is_redirect' => 0, - 'page_is_new' => 0, - 'page_random' => 0, - 'page_touched' => $this->db->timestamp(), - 'page_latest' => 0, - 'page_len' => 0 ), __METHOD__, array( 'IGNORE' ) ); - } - - User::resetIdByNameCache(); - - //Make sysop user - $user = User::newFromName( 'UTSysop' ); - - if ( $user->idForName() == 0 ) { - $user->addToDatabase(); - $user->setPassword( 'UTSysopPassword' ); - - $user->addGroup( 'sysop' ); - $user->addGroup( 'bureaucrat' ); - $user->saveSettings(); - } - - //Make 1 page with 1 revision - $page = WikiPage::factory( Title::newFromText( 'UTPage' ) ); - if ( !$page->getId() == 0 ) { - $page->doEditContent( - new WikitextContent( 'UTContent' ), - 'UTPageSummary', - EDIT_NEW, - false, - User::newFromName( 'UTSysop' ) ); - } - } - - /** - * Restores MediaWiki to using the table set (table prefix) it was using before - * setupTestDB() was called. Useful if we need to perform database operations - * after the test run has finished (such as saving logs or profiling info). - */ - public static function teardownTestDB() { - if ( !self::$dbSetup ) { - return; - } - - CloneDatabase::changePrefix( self::$oldTablePrefix ); - - self::$oldTablePrefix = false; - self::$dbSetup = false; - } - - /** - * Creates an empty skeleton of the wiki database by cloning its structure - * to equivalent tables using the given $prefix. Then sets MediaWiki to - * use the new set of tables (aka schema) instead of the original set. - * - * This is used to generate a dummy table set, typically consisting of temporary - * tables, that will be used by tests instead of the original wiki database tables. - * - * @note: the original table prefix is stored in self::$oldTablePrefix. This is used - * by teardownTestDB() to return the wiki to using the original table set. - * - * @note: this method only works when first called. Subsequent calls have no effect, - * even if using different parameters. - * - * @param DatabaseBase $db The database connection - * @param String $prefix The prefix to use for the new table set (aka schema). - * - * @throws MWException if the database table prefix is already $prefix - */ - public static function setupTestDB( DatabaseBase $db, $prefix ) { - global $wgDBprefix; - if ( $wgDBprefix === $prefix ) { - throw new MWException( 'Cannot run unit tests, the database prefix is already "' . $prefix . '"' ); - } - - if ( self::$dbSetup ) { - return; - } - - $tablesCloned = self::listTables( $db ); - $dbClone = new CloneDatabase( $db, $tablesCloned, $prefix ); - $dbClone->useTemporaryTables( self::$useTemporaryTables ); - - self::$dbSetup = true; - self::$oldTablePrefix = $wgDBprefix; - - if ( ( $db->getType() == 'oracle' || !self::$useTemporaryTables ) && self::$reuseDB ) { - CloneDatabase::changePrefix( $prefix ); - - return; - } else { - $dbClone->cloneTableStructure(); - } - - if ( $db->getType() == 'oracle' ) { - $db->query( 'BEGIN FILL_WIKI_INFO; END;' ); - } - } - - /** - * Empty all tables so they can be repopulated for tests - */ - private function resetDB() { - if ( $this->db ) { - if ( $this->db->getType() == 'oracle' ) { - if ( self::$useTemporaryTables ) { - wfGetLB()->closeAll(); - $this->db = wfGetDB( DB_MASTER ); - } else { - foreach ( $this->tablesUsed as $tbl ) { - if ( $tbl == 'interwiki' ) { - continue; - } - $this->db->query( 'TRUNCATE TABLE ' . $this->db->tableName( $tbl ), __METHOD__ ); - } - } - } else { - foreach ( $this->tablesUsed as $tbl ) { - if ( $tbl == 'interwiki' || $tbl == 'user' ) { - continue; - } - $this->db->delete( $tbl, '*', __METHOD__ ); - } - } - } - } - - function __call( $func, $args ) { - static $compatibility = array( - 'assertInternalType' => 'assertType', - 'assertNotInternalType' => 'assertNotType', - 'assertInstanceOf' => 'assertType', - 'assertEmpty' => 'assertEmpty2', - ); - - if ( method_exists( $this->suite, $func ) ) { - return call_user_func_array( array( $this->suite, $func ), $args ); - } elseif ( isset( $compatibility[$func] ) ) { - return call_user_func_array( array( $this, $compatibility[$func] ), $args ); - } else { - throw new MWException( "Called non-existant $func method on " - . get_class( $this ) ); - } - } - - private function assertEmpty2( $value, $msg ) { - return $this->assertTrue( $value == '', $msg ); - } - - private static function unprefixTable( $tableName ) { - global $wgDBprefix; - - return substr( $tableName, strlen( $wgDBprefix ) ); - } - - private static function isNotUnittest( $table ) { - return strpos( $table, 'unittest_' ) !== 0; - } - - public static function listTables( $db ) { - global $wgDBprefix; - - $tables = $db->listTables( $wgDBprefix, __METHOD__ ); - - if ( $db->getType() === 'mysql' ) { - # bug 43571: cannot clone VIEWs under MySQL - $views = $db->listViews( $wgDBprefix, __METHOD__ ); - $tables = array_diff( $tables, $views ); - } - $tables = array_map( array( __CLASS__, 'unprefixTable' ), $tables ); - - // Don't duplicate test tables from the previous fataled run - $tables = array_filter( $tables, array( __CLASS__, 'isNotUnittest' ) ); - - if ( $db->getType() == 'sqlite' ) { - $tables = array_flip( $tables ); - // these are subtables of searchindex and don't need to be duped/dropped separately - unset( $tables['searchindex_content'] ); - unset( $tables['searchindex_segdir'] ); - unset( $tables['searchindex_segments'] ); - $tables = array_flip( $tables ); - } - - return $tables; - } - - protected function checkDbIsSupported() { - if ( !in_array( $this->db->getType(), $this->supportedDBs ) ) { - throw new MWException( $this->db->getType() . " is not currently supported for unit testing." ); - } - } - - public function getCliArg( $offset ) { - - if ( isset( MediaWikiPHPUnitCommand::$additionalOptions[$offset] ) ) { - return MediaWikiPHPUnitCommand::$additionalOptions[$offset]; - } - } - - public function setCliArg( $offset, $value ) { - - MediaWikiPHPUnitCommand::$additionalOptions[$offset] = $value; - } - - /** - * Don't throw a warning if $function is deprecated and called later - * - * @param $function String - * @return null - */ - function hideDeprecated( $function ) { - wfSuppressWarnings(); - wfDeprecated( $function ); - wfRestoreWarnings(); - } - - /** - * Asserts that the given database query yields the rows given by $expectedRows. - * The expected rows should be given as indexed (not associative) arrays, with - * the values given in the order of the columns in the $fields parameter. - * Note that the rows are sorted by the columns given in $fields. - * - * @since 1.20 - * - * @param $table String|Array the table(s) to query - * @param $fields String|Array the columns to include in the result (and to sort by) - * @param $condition String|Array "where" condition(s) - * @param $expectedRows Array - an array of arrays giving the expected rows. - * - * @throws MWException if this test cases's needsDB() method doesn't return true. - * Test cases can use "@group Database" to enable database test support, - * or list the tables under testing in $this->tablesUsed, or override the - * needsDB() method. - */ - protected function assertSelect( $table, $fields, $condition, array $expectedRows ) { - if ( !$this->needsDB() ) { - throw new MWException( 'When testing database state, the test cases\'s needDB()' . - ' method should return true. Use @group Database or $this->tablesUsed.' ); - } - - $db = wfGetDB( DB_SLAVE ); - - $res = $db->select( $table, $fields, $condition, wfGetCaller(), array( 'ORDER BY' => $fields ) ); - $this->assertNotEmpty( $res, "query failed: " . $db->lastError() ); - - $i = 0; - - foreach ( $expectedRows as $expected ) { - $r = $res->fetchRow(); - self::stripStringKeys( $r ); - - $i += 1; - $this->assertNotEmpty( $r, "row #$i missing" ); - - $this->assertEquals( $expected, $r, "row #$i mismatches" ); - } - - $r = $res->fetchRow(); - self::stripStringKeys( $r ); - - $this->assertFalse( $r, "found extra row (after #$i)" ); - } - - /** - * Utility method taking an array of elements and wrapping - * each element in it's own array. Useful for data providers - * that only return a single argument. - * - * @since 1.20 - * - * @param array $elements - * - * @return array - */ - protected function arrayWrap( array $elements ) { - return array_map( - function ( $element ) { - return array( $element ); - }, - $elements - ); - } - - /** - * Assert that two arrays are equal. By default this means that both arrays need to hold - * the same set of values. Using additional arguments, order and associated key can also - * be set as relevant. - * - * @since 1.20 - * - * @param array $expected - * @param array $actual - * @param boolean $ordered If the order of the values should match - * @param boolean $named If the keys should match - */ - protected function assertArrayEquals( array $expected, array $actual, $ordered = false, $named = false ) { - if ( !$ordered ) { - $this->objectAssociativeSort( $expected ); - $this->objectAssociativeSort( $actual ); - } - - if ( !$named ) { - $expected = array_values( $expected ); - $actual = array_values( $actual ); - } - - call_user_func_array( - array( $this, 'assertEquals' ), - array_merge( array( $expected, $actual ), array_slice( func_get_args(), 4 ) ) - ); - } - - /** - * Put each HTML element on its own line and then equals() the results - * - * Use for nicely formatting of PHPUnit diff output when comparing very - * simple HTML - * - * @since 1.20 - * - * @param String $expected HTML on oneline - * @param String $actual HTML on oneline - * @param String $msg Optional message - */ - protected function assertHTMLEquals( $expected, $actual, $msg = '' ) { - $expected = str_replace( '>', ">\n", $expected ); - $actual = str_replace( '>', ">\n", $actual ); - - $this->assertEquals( $expected, $actual, $msg ); - } - - /** - * Does an associative sort that works for objects. - * - * @since 1.20 - * - * @param array $array - */ - protected function objectAssociativeSort( array &$array ) { - uasort( - $array, - function ( $a, $b ) { - return serialize( $a ) > serialize( $b ) ? 1 : -1; - } - ); - } - - /** - * Utility function for eliminating all string keys from an array. - * Useful to turn a database result row as returned by fetchRow() into - * a pure indexed array. - * - * @since 1.20 - * - * @param $r mixed the array to remove string keys from. - */ - protected static function stripStringKeys( &$r ) { - if ( !is_array( $r ) ) { - return; - } - - foreach ( $r as $k => $v ) { - if ( is_string( $k ) ) { - unset( $r[$k] ); - } - } - } - - /** - * Asserts that the provided variable is of the specified - * internal type or equals the $value argument. This is useful - * for testing return types of functions that return a certain - * type or *value* when not set or on error. - * - * @since 1.20 - * - * @param string $type - * @param mixed $actual - * @param mixed $value - * @param string $message - */ - protected function assertTypeOrValue( $type, $actual, $value = false, $message = '' ) { - if ( $actual === $value ) { - $this->assertTrue( true, $message ); - } else { - $this->assertType( $type, $actual, $message ); - } - } - - /** - * Asserts the type of the provided value. This can be either - * in internal type such as boolean or integer, or a class or - * interface the value extends or implements. - * - * @since 1.20 - * - * @param string $type - * @param mixed $actual - * @param string $message - */ - protected function assertType( $type, $actual, $message = '' ) { - if ( class_exists( $type ) || interface_exists( $type ) ) { - $this->assertInstanceOf( $type, $actual, $message ); - } else { - $this->assertInternalType( $type, $actual, $message ); - } - } - - /** - * Returns true if the given namespace defaults to Wikitext - * according to $wgNamespaceContentModels - * - * @param int $ns The namespace ID to check - * - * @return bool - * @since 1.21 - */ - protected function isWikitextNS( $ns ) { - global $wgNamespaceContentModels; - - if ( isset( $wgNamespaceContentModels[$ns] ) ) { - return $wgNamespaceContentModels[$ns] === CONTENT_MODEL_WIKITEXT; - } - - return true; - } - - /** - * Returns the ID of a namespace that defaults to Wikitext. - * Throws an MWException if there is none. - * - * @return int the ID of the wikitext Namespace - * @since 1.21 - */ - protected function getDefaultWikitextNS() { - global $wgNamespaceContentModels; - - static $wikitextNS = null; // this is not going to change - if ( $wikitextNS !== null ) { - return $wikitextNS; - } - - // quickly short out on most common case: - if ( !isset( $wgNamespaceContentModels[NS_MAIN] ) ) { - return NS_MAIN; - } - - // NOTE: prefer content namespaces - $namespaces = array_unique( array_merge( - MWNamespace::getContentNamespaces(), - array( NS_MAIN, NS_HELP, NS_PROJECT ), // prefer these - MWNamespace::getValidNamespaces() - ) ); - - $namespaces = array_diff( $namespaces, array( - NS_FILE, NS_CATEGORY, NS_MEDIAWIKI, NS_USER // don't mess with magic namespaces - ) ); - - $talk = array_filter( $namespaces, function ( $ns ) { - return MWNamespace::isTalk( $ns ); - } ); - - // prefer non-talk pages - $namespaces = array_diff( $namespaces, $talk ); - $namespaces = array_merge( $namespaces, $talk ); - - // check default content model of each namespace - foreach ( $namespaces as $ns ) { - if ( !isset( $wgNamespaceContentModels[$ns] ) || - $wgNamespaceContentModels[$ns] === CONTENT_MODEL_WIKITEXT - ) { - - $wikitextNS = $ns; - - return $wikitextNS; - } - } - - // give up - // @todo Inside a test, we could skip the test as incomplete. - // But frequently, this is used in fixture setup. - throw new MWException( "No namespace defaults to wikitext!" ); - } - - /** - * Check, if $wgDiff3 is set and ready to merge - * Will mark the calling test as skipped, if not ready - * - * @since 1.21 - */ - protected function checkHasDiff3() { - global $wgDiff3; - - # This check may also protect against code injection in - # case of broken installations. - wfSuppressWarnings(); - $haveDiff3 = $wgDiff3 && file_exists( $wgDiff3 ); - wfRestoreWarnings(); - - if ( !$haveDiff3 ) { - $this->markTestSkipped( "Skip test, since diff3 is not configured" ); - } - } - - /** - * Check whether we have the 'gzip' commandline utility, will skip - * the test whenever "gzip -V" fails. - * - * Result is cached at the process level. - * - * @return bool - * - * @since 1.21 - */ - protected function checkHasGzip() { - static $haveGzip; - - if ( $haveGzip === null ) { - $retval = null; - wfShellExec( 'gzip -V', $retval ); - $haveGzip = ( $retval === 0 ); - } - - if ( !$haveGzip ) { - $this->markTestSkipped( "Skip test, requires the gzip utility in PATH" ); - } - - return $haveGzip; - } - - /** - * Check if $extName is a loaded PHP extension, will skip the - * test whenever it is not loaded. - * - * @since 1.21 - */ - protected function checkPHPExtension( $extName ) { - $loaded = extension_loaded( $extName ); - if ( !$loaded ) { - $this->markTestSkipped( "PHP extension '$extName' is not loaded, skipping." ); - } - - return $loaded; - } - - /** - * Asserts that an exception of the specified type occurs when running - * the provided code. - * - * @since 1.21 - * @deprecated since 1.22 Use setExpectedException - * - * @param callable $code - * @param string $expected - * @param string $message - */ - protected function assertException( $code, $expected = 'Exception', $message = '' ) { - $pokemons = null; - - try { - call_user_func( $code ); - } catch ( Exception $pokemons ) { - // Gotta Catch 'Em All! - } - - if ( $message === '' ) { - $message = 'An exception of type "' . $expected . '" should have been thrown'; - } - - $this->assertInstanceOf( $expected, $pokemons, $message ); - } -} diff --git a/tests/phpunit/README b/tests/phpunit/README deleted file mode 100644 index 0a32ba17..00000000 --- a/tests/phpunit/README +++ /dev/null @@ -1,53 +0,0 @@ -== MediaWiki PHPUnit Tests == - -The unit tests for MediaWiki are implemented using the PHPUnit testing -framework and require PHPUnit to run. - - -=== WARNING === - -Some of the unit tests are DESTRUCTIVE and WILL ALTER YOUR WIKI'S CONTENTS. - -DO NOT RUN THESE TESTS ON A PRODUCTION SYSTEM OR ON ANY SYSTEM WHERE YOU NEED -TO RETAIN YOUR DATA. - - -== Installation == - -If PHPUnit is not installed, follow the installation instructions in the -PHPUnit Manual at: - - http://www.phpunit.de/manual/current/en/installation.html - -- or - - -On Unix-like operating systems, run: - - make install - - -== Running tests == - -The tests are run from your operating system's command line. - -Ensure that you are in the tests/phpunit directory of your MediaWiki -installation. - - -On Unix-like operating systems, the tests runs are controlled with a makefile. -Run command: - - make help - -for a full list of options for running tests. - - -On Windows-family operating systems, run the 'run-tests.bat' batch file. - - -=== Writing tests === - -A guide to writing unit tests for MediaWiki can be found at: - - http://mediawiki.org/wiki/Unit_Testing - diff --git a/tests/phpunit/TODO b/tests/phpunit/TODO deleted file mode 100644 index b2fa7fb6..00000000 --- a/tests/phpunit/TODO +++ /dev/null @@ -1,10 +0,0 @@ -== Things To Do == -* Most of the tests are named poorly; naming should describe a use case in story-like language, not simply identify the -unit under test. An example would be the difference between testCalculate and testAddingIntegersTogetherWorks. -* Many of the tests make multiple assertions, and are thus not unitary tests. By using data-providers and more use-case -oriented test selection nearly all of these cases can be easily resolved. -* Some of the test files are either incorrectly named or in the wrong folder. Tests should be organized in a mirrored -structure to the source they are testing, and named the same, with the exception of the word "Test" at the end. -* Shared set-up code or base classes are present, but usually named improperly or appear to be poorly factored. Support -code should share as much of the same naming as the code it's supporting, and test and test-case depenencies should be -considered to resolve other shared needs. diff --git a/tests/phpunit/bootstrap.php b/tests/phpunit/bootstrap.php deleted file mode 100644 index d929b79d..00000000 --- a/tests/phpunit/bootstrap.php +++ /dev/null @@ -1,15 +0,0 @@ - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/phpunit/data/media/Png-native-test.png b/tests/phpunit/data/media/Png-native-test.png deleted file mode 100644 index a0b81ca9..00000000 Binary files a/tests/phpunit/data/media/Png-native-test.png and /dev/null differ diff --git a/tests/phpunit/data/media/QA_icon.svg b/tests/phpunit/data/media/QA_icon.svg deleted file mode 100644 index 6b5d86e4..00000000 --- a/tests/phpunit/data/media/QA_icon.svg +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ? - - - - - - - - \ No newline at end of file diff --git a/tests/phpunit/data/media/README b/tests/phpunit/data/media/README deleted file mode 100644 index fe3bc682..00000000 --- a/tests/phpunit/data/media/README +++ /dev/null @@ -1,38 +0,0 @@ -This directory contains media files for use with the -tests in includes/media directory. - -Image credits: - -QA_icon.svg: -http://es.wikipedia.org/wiki/Archivo:QA_icon.svg -GNU Lesser General Public License -~~helix84 (16.4.2007), Philverney (6.12.2005) David Vignoni - -Gtk-media-play-ltr.svg -http://commons.wikimedia.org/wiki/File:Gtk-media-play-ltr.svg -GNU Lesser General Public License -http://ftp.gnome.org/pub/GNOME/sources/gnome-themes-extras/0.9/gnome-themes-extras-0.9.0.tar.gz -David Vignoni - -US_states_by_total_state_tax_revenue.svg -http://commons.wikimedia.org/wiki/File:US_states_by_total_state_tax_revenue.svg -CC-BY 3.0 -TastyCakes on English Wikipedia - -greyscale-na-png.png, rgb-png.png, Xmp-exif-multilingual_test.jpg -greyscale-png.png, 1bit-png.png, Png-native-test.png, rgb-na-png.png, -test.tiff, test.jpg, jpeg-comment-multiple.jpg, jpeg-comment-utf.jpg, -jpeg-comment-iso8859-1.jpg, jpeg-comment-binary.jpg, jpeg-xmp-psir.jpg, -jpeg-xmp-alt.jpg, animated.gif, exif-user-comment.jpg, animated-xmp.gif, -iptc-timetest-invalid.jpg, jpeg-iptc-bad-hash.jpg, iptc-timetest.jpg, -xmp.png, nonanimated.gif, exif-gps.jpg, jpeg-xmp-psir.xmp, jpeg-iptc-good-hash.jpg, -jpeg-padding-even.jpg, jpeg-padding-odd.jpg -Are all by Bawolff. I don't think they contain enough originality to -claim copyright, but on the off chance they do, feel free to use them -however you feel fit, without restriction. - -Animated_PNG_example_bouncing_beach_ball.png -http://commons.wikimedia.org/wiki/File:Animated_PNG_example_bouncing_beach_ball.png (originally http://www.treebuilder.de/default.asp?file=89031.xml ) -Public Domain -Holger Will - diff --git a/tests/phpunit/data/media/Toll_Texas_1.svg b/tests/phpunit/data/media/Toll_Texas_1.svg deleted file mode 100644 index 73004e3e..00000000 --- a/tests/phpunit/data/media/Toll_Texas_1.svg +++ /dev/null @@ -1,150 +0,0 @@ - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/phpunit/data/media/US_states_by_total_state_tax_revenue.svg b/tests/phpunit/data/media/US_states_by_total_state_tax_revenue.svg deleted file mode 100644 index 9afea859..00000000 --- a/tests/phpunit/data/media/US_states_by_total_state_tax_revenue.svg +++ /dev/null @@ -1,248 +0,0 @@ - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/phpunit/data/media/Wikimedia-logo.svg b/tests/phpunit/data/media/Wikimedia-logo.svg deleted file mode 100644 index 1e17acbe..00000000 --- a/tests/phpunit/data/media/Wikimedia-logo.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - \ No newline at end of file diff --git a/tests/phpunit/data/media/Xmp-exif-multilingual_test.jpg b/tests/phpunit/data/media/Xmp-exif-multilingual_test.jpg deleted file mode 100644 index f7b23025..00000000 Binary files a/tests/phpunit/data/media/Xmp-exif-multilingual_test.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/animated-xmp.gif b/tests/phpunit/data/media/animated-xmp.gif deleted file mode 100644 index fcba079d..00000000 Binary files a/tests/phpunit/data/media/animated-xmp.gif and /dev/null differ diff --git a/tests/phpunit/data/media/animated.gif b/tests/phpunit/data/media/animated.gif deleted file mode 100644 index a8f248b3..00000000 Binary files a/tests/phpunit/data/media/animated.gif and /dev/null differ diff --git a/tests/phpunit/data/media/broken_exif_date.jpg b/tests/phpunit/data/media/broken_exif_date.jpg deleted file mode 100644 index 82f62f57..00000000 Binary files a/tests/phpunit/data/media/broken_exif_date.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/exif-gps.jpg b/tests/phpunit/data/media/exif-gps.jpg deleted file mode 100644 index 40137340..00000000 Binary files a/tests/phpunit/data/media/exif-gps.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/exif-user-comment.jpg b/tests/phpunit/data/media/exif-user-comment.jpg deleted file mode 100644 index 9f23966a..00000000 Binary files a/tests/phpunit/data/media/exif-user-comment.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/greyscale-na-png.png b/tests/phpunit/data/media/greyscale-na-png.png deleted file mode 100644 index 4a4b7452..00000000 Binary files a/tests/phpunit/data/media/greyscale-na-png.png and /dev/null differ diff --git a/tests/phpunit/data/media/greyscale-png.png b/tests/phpunit/data/media/greyscale-png.png deleted file mode 100644 index 340a67b4..00000000 Binary files a/tests/phpunit/data/media/greyscale-png.png and /dev/null differ diff --git a/tests/phpunit/data/media/iptc-invalid-psir.jpg b/tests/phpunit/data/media/iptc-invalid-psir.jpg deleted file mode 100644 index 01b9acf3..00000000 Binary files a/tests/phpunit/data/media/iptc-invalid-psir.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/iptc-timetest-invalid.jpg b/tests/phpunit/data/media/iptc-timetest-invalid.jpg deleted file mode 100644 index b03e192a..00000000 Binary files a/tests/phpunit/data/media/iptc-timetest-invalid.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/iptc-timetest.jpg b/tests/phpunit/data/media/iptc-timetest.jpg deleted file mode 100644 index db9932ba..00000000 Binary files a/tests/phpunit/data/media/iptc-timetest.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-comment-binary.jpg b/tests/phpunit/data/media/jpeg-comment-binary.jpg deleted file mode 100644 index b467fe43..00000000 Binary files a/tests/phpunit/data/media/jpeg-comment-binary.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-comment-iso8859-1.jpg b/tests/phpunit/data/media/jpeg-comment-iso8859-1.jpg deleted file mode 100644 index d9ffbac1..00000000 Binary files a/tests/phpunit/data/media/jpeg-comment-iso8859-1.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-comment-multiple.jpg b/tests/phpunit/data/media/jpeg-comment-multiple.jpg deleted file mode 100644 index 363c7385..00000000 Binary files a/tests/phpunit/data/media/jpeg-comment-multiple.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-comment-utf.jpg b/tests/phpunit/data/media/jpeg-comment-utf.jpg deleted file mode 100644 index d6d35b4b..00000000 Binary files a/tests/phpunit/data/media/jpeg-comment-utf.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-iptc-bad-hash.jpg b/tests/phpunit/data/media/jpeg-iptc-bad-hash.jpg deleted file mode 100644 index 6464c5b8..00000000 Binary files a/tests/phpunit/data/media/jpeg-iptc-bad-hash.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-iptc-good-hash.jpg b/tests/phpunit/data/media/jpeg-iptc-good-hash.jpg deleted file mode 100644 index ef970854..00000000 Binary files a/tests/phpunit/data/media/jpeg-iptc-good-hash.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-padding-even.jpg b/tests/phpunit/data/media/jpeg-padding-even.jpg deleted file mode 100644 index c83c66bd..00000000 Binary files a/tests/phpunit/data/media/jpeg-padding-even.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-padding-odd.jpg b/tests/phpunit/data/media/jpeg-padding-odd.jpg deleted file mode 100644 index 25b93308..00000000 Binary files a/tests/phpunit/data/media/jpeg-padding-odd.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-xmp-alt.jpg b/tests/phpunit/data/media/jpeg-xmp-alt.jpg deleted file mode 100644 index 0e2c3f63..00000000 Binary files a/tests/phpunit/data/media/jpeg-xmp-alt.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-xmp-psir.jpg b/tests/phpunit/data/media/jpeg-xmp-psir.jpg deleted file mode 100644 index 4d19fcbe..00000000 Binary files a/tests/phpunit/data/media/jpeg-xmp-psir.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/jpeg-xmp-psir.xmp b/tests/phpunit/data/media/jpeg-xmp-psir.xmp deleted file mode 100644 index fee6ee18..00000000 --- a/tests/phpunit/data/media/jpeg-xmp-psir.xmp +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - jpeg-xmp-psir.jpg - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/phpunit/data/media/landscape-plain.jpg b/tests/phpunit/data/media/landscape-plain.jpg deleted file mode 100644 index cf296555..00000000 Binary files a/tests/phpunit/data/media/landscape-plain.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/nonanimated.gif b/tests/phpunit/data/media/nonanimated.gif deleted file mode 100644 index 9e52a7f0..00000000 Binary files a/tests/phpunit/data/media/nonanimated.gif and /dev/null differ diff --git a/tests/phpunit/data/media/portrait-rotated.jpg b/tests/phpunit/data/media/portrait-rotated.jpg deleted file mode 100644 index 445feaed..00000000 Binary files a/tests/phpunit/data/media/portrait-rotated.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/rgb-na-png.png b/tests/phpunit/data/media/rgb-na-png.png deleted file mode 100644 index 2f2a5ca0..00000000 Binary files a/tests/phpunit/data/media/rgb-na-png.png and /dev/null differ diff --git a/tests/phpunit/data/media/rgb-png.png b/tests/phpunit/data/media/rgb-png.png deleted file mode 100644 index 6f40cc92..00000000 Binary files a/tests/phpunit/data/media/rgb-png.png and /dev/null differ diff --git a/tests/phpunit/data/media/test.jpg b/tests/phpunit/data/media/test.jpg deleted file mode 100644 index cb084253..00000000 Binary files a/tests/phpunit/data/media/test.jpg and /dev/null differ diff --git a/tests/phpunit/data/media/test.tiff b/tests/phpunit/data/media/test.tiff deleted file mode 100644 index 6a36f760..00000000 Binary files a/tests/phpunit/data/media/test.tiff and /dev/null differ diff --git a/tests/phpunit/data/media/xmp.png b/tests/phpunit/data/media/xmp.png deleted file mode 100644 index 6b9f7a87..00000000 Binary files a/tests/phpunit/data/media/xmp.png and /dev/null differ diff --git a/tests/phpunit/data/xmp/1.result.php b/tests/phpunit/data/xmp/1.result.php deleted file mode 100644 index beead1bd..00000000 --- a/tests/phpunit/data/xmp/1.result.php +++ /dev/null @@ -1,8 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => '9' - ) -); diff --git a/tests/phpunit/data/xmp/1.xmp b/tests/phpunit/data/xmp/1.xmp deleted file mode 100644 index 66e15427..00000000 --- a/tests/phpunit/data/xmp/1.xmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - -True 0 1 False False - - diff --git a/tests/phpunit/data/xmp/2.result.php b/tests/phpunit/data/xmp/2.result.php deleted file mode 100644 index beead1bd..00000000 --- a/tests/phpunit/data/xmp/2.result.php +++ /dev/null @@ -1,8 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => '9' - ) -); diff --git a/tests/phpunit/data/xmp/2.xmp b/tests/phpunit/data/xmp/2.xmp deleted file mode 100644 index 0fa6a894..00000000 --- a/tests/phpunit/data/xmp/2.xmp +++ /dev/null @@ -1,12 +0,0 @@ - - - - - -True 1 False False - - diff --git a/tests/phpunit/data/xmp/3-invalid.result.php b/tests/phpunit/data/xmp/3-invalid.result.php deleted file mode 100644 index 5741b2c9..00000000 --- a/tests/phpunit/data/xmp/3-invalid.result.php +++ /dev/null @@ -1,7 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - ) -); diff --git a/tests/phpunit/data/xmp/3-invalid.xmp b/tests/phpunit/data/xmp/3-invalid.xmp deleted file mode 100644 index 2425e254..00000000 --- a/tests/phpunit/data/xmp/3-invalid.xmp +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - -0/10 - -fred - - - - - - - - -1 -False - - False False - - diff --git a/tests/phpunit/data/xmp/3.result.php b/tests/phpunit/data/xmp/3.result.php deleted file mode 100644 index beead1bd..00000000 --- a/tests/phpunit/data/xmp/3.result.php +++ /dev/null @@ -1,8 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => '9' - ) -); diff --git a/tests/phpunit/data/xmp/3.xmp b/tests/phpunit/data/xmp/3.xmp deleted file mode 100644 index 2cf19883..00000000 --- a/tests/phpunit/data/xmp/3.xmp +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - -0/10 - -fred - - - - - - - -True - -1 -False - - False False - - diff --git a/tests/phpunit/data/xmp/4.result.php b/tests/phpunit/data/xmp/4.result.php deleted file mode 100644 index 5741b2c9..00000000 --- a/tests/phpunit/data/xmp/4.result.php +++ /dev/null @@ -1,7 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - ) -); diff --git a/tests/phpunit/data/xmp/4.xmp b/tests/phpunit/data/xmp/4.xmp deleted file mode 100644 index 29eb614b..00000000 --- a/tests/phpunit/data/xmp/4.xmp +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - -0/10 - - -True 0 1 False False - - - - - - diff --git a/tests/phpunit/data/xmp/5.result.php b/tests/phpunit/data/xmp/5.result.php deleted file mode 100644 index 5741b2c9..00000000 --- a/tests/phpunit/data/xmp/5.result.php +++ /dev/null @@ -1,7 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - ) -); diff --git a/tests/phpunit/data/xmp/5.xmp b/tests/phpunit/data/xmp/5.xmp deleted file mode 100644 index 3cc61d68..00000000 --- a/tests/phpunit/data/xmp/5.xmp +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - -True 0 1 False False - - - - - - diff --git a/tests/phpunit/data/xmp/6.result.php b/tests/phpunit/data/xmp/6.result.php deleted file mode 100644 index beead1bd..00000000 --- a/tests/phpunit/data/xmp/6.result.php +++ /dev/null @@ -1,8 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => '9' - ) -); diff --git a/tests/phpunit/data/xmp/6.xmp b/tests/phpunit/data/xmp/6.xmp deleted file mode 100644 index f435ab23..00000000 --- a/tests/phpunit/data/xmp/6.xmp +++ /dev/null @@ -1,18 +0,0 @@ - - - - -0/10 - - - - - -True 0 1 False False - - diff --git a/tests/phpunit/data/xmp/7.result.php b/tests/phpunit/data/xmp/7.result.php deleted file mode 100644 index 115cdc92..00000000 --- a/tests/phpunit/data/xmp/7.result.php +++ /dev/null @@ -1,52 +0,0 @@ - - array( - 'CameraOwnerName' => 'Me!', - ), - 'xmp-general' => - array( - 'LicenseUrl' => 'http://creativecommons.com/cc-by-2.9', - 'ImageDescription' => - array( - 'x-default' => 'Test image for the cc: xmp: xmpRights: namespaces in xmp', - '_type' => 'lang', - ), - 'ObjectName' => - array( - 'x-default' => 'xmp core/xmp rights/cc ns test', - '_type' => 'lang', - ), - 'DateTimeDigitized' => '2005:04:03', - 'Software' => 'The one true editor: Vi (ok i used gimp)', - 'Identifier' => - array( - 0 => 'http://example.com/identifierurl', - 1 => 'urn:sha1:342524abcdef', - '_type' => 'ul', - ), - 'Label' => 'Test image', - 'DateTimeMetadata' => '2011:05:12', - 'DateTime' => '2007:03:04 06:34:10', - 'Nickname' => 'My little xmp test image', - 'Rating' => '5', - 'RightsCertificate' => 'http://example.com/rights-certificate/', - 'Copyrighted' => 'True', - 'CopyrightOwner' => - array( - 0 => 'Bawolff is copyright owner', - '_type' => 'ul', - ), - 'UsageTerms' => - array( - 'x-default' => 'do whatever you want', - 'en-gb' => 'Do whatever you want in british english', - '_type' => 'lang', - ), - 'WebStatement' => 'http://example.com/web_statement', - ), - 'xmp-deprecated' => - array( - 'Identifier' => 'http://example.com/identifierurl/wrong', - ), -); diff --git a/tests/phpunit/data/xmp/7.xmp b/tests/phpunit/data/xmp/7.xmp deleted file mode 100644 index e18e13d9..00000000 --- a/tests/phpunit/data/xmp/7.xmp +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - Me! - - - - http://creativecommons.com/cc-by-2.9 - - - - - - Test image for the cc: xmp: xmpRights: namespaces in xmp - - - http://example.com/identifierurl/wrong - - - xmp core/xmp rights/cc ns test - - - - - - 2005-04-03 - The one true editor: Vi (ok i used gimp) - - - http://example.com/identifierurl - - urn:sha1:342524abcdef - - - Test image - 2011-05-12 - 2007-03-04T12:34:10-06:00 - My little xmp test image - 7 - - - - http://example.com/rights-certificate/ - True - - - Bawolff is copyright owner - - - - - do whatever you want - Do whatever you want in british english - - - http://example.com/web_statement - - - - diff --git a/tests/phpunit/data/xmp/README b/tests/phpunit/data/xmp/README deleted file mode 100644 index bd949176..00000000 --- a/tests/phpunit/data/xmp/README +++ /dev/null @@ -1,3 +0,0 @@ -This directory contains a bunch of XMP files -as well as a bunch of php files containing what the -parsed version of the XMP looks like. diff --git a/tests/phpunit/data/xmp/bag-for-seq.result.php b/tests/phpunit/data/xmp/bag-for-seq.result.php deleted file mode 100644 index b5244f88..00000000 --- a/tests/phpunit/data/xmp/bag-for-seq.result.php +++ /dev/null @@ -1,10 +0,0 @@ - array( - 'Artist' => array( - '_type' => 'ul', - 0 => 'The author', - ) - ) -); diff --git a/tests/phpunit/data/xmp/bag-for-seq.xmp b/tests/phpunit/data/xmp/bag-for-seq.xmp deleted file mode 100644 index c6ed5b7c..00000000 --- a/tests/phpunit/data/xmp/bag-for-seq.xmp +++ /dev/null @@ -1 +0,0 @@ - The author diff --git a/tests/phpunit/data/xmp/flash.result.php b/tests/phpunit/data/xmp/flash.result.php deleted file mode 100644 index 018c0ac1..00000000 --- a/tests/phpunit/data/xmp/flash.result.php +++ /dev/null @@ -1,8 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => '127' - ) -); diff --git a/tests/phpunit/data/xmp/flash.xmp b/tests/phpunit/data/xmp/flash.xmp deleted file mode 100644 index b1373cc2..00000000 --- a/tests/phpunit/data/xmp/flash.xmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - -True 3 3 True True - - diff --git a/tests/phpunit/data/xmp/gps.result.php b/tests/phpunit/data/xmp/gps.result.php deleted file mode 100644 index 8ea9c68c..00000000 --- a/tests/phpunit/data/xmp/gps.result.php +++ /dev/null @@ -1,11 +0,0 @@ - - array( - 'GPSAltitude' => -3.14159265301, - 'GPSDOP' => '5/1', - 'GPSLatitude' => 88.51805555, - 'GPSLongitude' => -21.12356945, - 'GPSVersionID' => '2.2.0.0' - ) -); diff --git a/tests/phpunit/data/xmp/gps.xmp b/tests/phpunit/data/xmp/gps.xmp deleted file mode 100644 index e52d2c8a..00000000 --- a/tests/phpunit/data/xmp/gps.xmp +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - 103993/33102 - 1 - 5/1 - 88,31.083333N - 21,7.414167W - 2.2.0.0 - - - - - diff --git a/tests/phpunit/data/xmp/invalid-child-not-struct.result.php b/tests/phpunit/data/xmp/invalid-child-not-struct.result.php deleted file mode 100644 index 5741b2c9..00000000 --- a/tests/phpunit/data/xmp/invalid-child-not-struct.result.php +++ /dev/null @@ -1,7 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - ) -); diff --git a/tests/phpunit/data/xmp/invalid-child-not-struct.xmp b/tests/phpunit/data/xmp/invalid-child-not-struct.xmp deleted file mode 100644 index 6aa0c10b..00000000 --- a/tests/phpunit/data/xmp/invalid-child-not-struct.xmp +++ /dev/null @@ -1,12 +0,0 @@ - - - -True 0 1 False False - - - - diff --git a/tests/phpunit/data/xmp/no-namespace.result.php b/tests/phpunit/data/xmp/no-namespace.result.php deleted file mode 100644 index 3ff69201..00000000 --- a/tests/phpunit/data/xmp/no-namespace.result.php +++ /dev/null @@ -1,7 +0,0 @@ - - array( - 'FNumber' => '28/10', - ) -); diff --git a/tests/phpunit/data/xmp/no-namespace.xmp b/tests/phpunit/data/xmp/no-namespace.xmp deleted file mode 100644 index 7d6cdb2f..00000000 --- a/tests/phpunit/data/xmp/no-namespace.xmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/tests/phpunit/data/xmp/no-recognized-props.result.php b/tests/phpunit/data/xmp/no-recognized-props.result.php deleted file mode 100644 index b3ca9f5a..00000000 --- a/tests/phpunit/data/xmp/no-recognized-props.result.php +++ /dev/null @@ -1,2 +0,0 @@ - - - - - diff --git a/tests/phpunit/data/xmp/utf16BE.result.php b/tests/phpunit/data/xmp/utf16BE.result.php deleted file mode 100644 index ac7ea506..00000000 --- a/tests/phpunit/data/xmp/utf16BE.result.php +++ /dev/null @@ -1,12 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - ), - 'xmp-general' => - array( - 'Label' => '􊯍' - ), -); diff --git a/tests/phpunit/data/xmp/utf16BE.xmp b/tests/phpunit/data/xmp/utf16BE.xmp deleted file mode 100644 index 0cf60d60..00000000 Binary files a/tests/phpunit/data/xmp/utf16BE.xmp and /dev/null differ diff --git a/tests/phpunit/data/xmp/utf16LE.result.php b/tests/phpunit/data/xmp/utf16LE.result.php deleted file mode 100644 index ac7ea506..00000000 --- a/tests/phpunit/data/xmp/utf16LE.result.php +++ /dev/null @@ -1,12 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - ), - 'xmp-general' => - array( - 'Label' => '􊯍' - ), -); diff --git a/tests/phpunit/data/xmp/utf16LE.xmp b/tests/phpunit/data/xmp/utf16LE.xmp deleted file mode 100644 index 66d71f4c..00000000 Binary files a/tests/phpunit/data/xmp/utf16LE.xmp and /dev/null differ diff --git a/tests/phpunit/data/xmp/utf32BE.result.php b/tests/phpunit/data/xmp/utf32BE.result.php deleted file mode 100644 index ac7ea506..00000000 --- a/tests/phpunit/data/xmp/utf32BE.result.php +++ /dev/null @@ -1,12 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - ), - 'xmp-general' => - array( - 'Label' => '􊯍' - ), -); diff --git a/tests/phpunit/data/xmp/utf32BE.xmp b/tests/phpunit/data/xmp/utf32BE.xmp deleted file mode 100644 index 06afdf92..00000000 Binary files a/tests/phpunit/data/xmp/utf32BE.xmp and /dev/null differ diff --git a/tests/phpunit/data/xmp/utf32LE.result.php b/tests/phpunit/data/xmp/utf32LE.result.php deleted file mode 100644 index ac7ea506..00000000 --- a/tests/phpunit/data/xmp/utf32LE.result.php +++ /dev/null @@ -1,12 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - ), - 'xmp-general' => - array( - 'Label' => '􊯍' - ), -); diff --git a/tests/phpunit/data/xmp/utf32LE.xmp b/tests/phpunit/data/xmp/utf32LE.xmp deleted file mode 100644 index bf2097fe..00000000 Binary files a/tests/phpunit/data/xmp/utf32LE.xmp and /dev/null differ diff --git a/tests/phpunit/data/xmp/xmpExt.result.php b/tests/phpunit/data/xmp/xmpExt.result.php deleted file mode 100644 index beead1bd..00000000 --- a/tests/phpunit/data/xmp/xmpExt.result.php +++ /dev/null @@ -1,8 +0,0 @@ - - array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => '9' - ) -); diff --git a/tests/phpunit/data/xmp/xmpExt.xmp b/tests/phpunit/data/xmp/xmpExt.xmp deleted file mode 100644 index da0383f8..00000000 --- a/tests/phpunit/data/xmp/xmpExt.xmp +++ /dev/null @@ -1,13 +0,0 @@ - - - - -True 0 1 False False - - diff --git a/tests/phpunit/data/xmp/xmpExt2.xmp b/tests/phpunit/data/xmp/xmpExt2.xmp deleted file mode 100644 index 060abb2c..00000000 --- a/tests/phpunit/data/xmp/xmpExt2.xmp +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/tests/phpunit/data/zip/cd-gap.zip b/tests/phpunit/data/zip/cd-gap.zip deleted file mode 100644 index b5ae6ccd..00000000 Binary files a/tests/phpunit/data/zip/cd-gap.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/cd-truncated.zip b/tests/phpunit/data/zip/cd-truncated.zip deleted file mode 100644 index 4d40d7d4..00000000 Binary files a/tests/phpunit/data/zip/cd-truncated.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/class-trailing-null.zip b/tests/phpunit/data/zip/class-trailing-null.zip deleted file mode 100644 index 31dcf3d8..00000000 Binary files a/tests/phpunit/data/zip/class-trailing-null.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/class-trailing-slash.zip b/tests/phpunit/data/zip/class-trailing-slash.zip deleted file mode 100644 index 9eb1f037..00000000 Binary files a/tests/phpunit/data/zip/class-trailing-slash.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/class.zip b/tests/phpunit/data/zip/class.zip deleted file mode 100644 index 98a625b7..00000000 Binary files a/tests/phpunit/data/zip/class.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/empty.zip b/tests/phpunit/data/zip/empty.zip deleted file mode 100644 index 15cb0ecb..00000000 Binary files a/tests/phpunit/data/zip/empty.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/looks-like-zip64.zip b/tests/phpunit/data/zip/looks-like-zip64.zip deleted file mode 100644 index 7428cddd..00000000 Binary files a/tests/phpunit/data/zip/looks-like-zip64.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/nosig.zip b/tests/phpunit/data/zip/nosig.zip deleted file mode 100644 index a22c73a4..00000000 Binary files a/tests/phpunit/data/zip/nosig.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/split.zip b/tests/phpunit/data/zip/split.zip deleted file mode 100644 index 6984ae6d..00000000 Binary files a/tests/phpunit/data/zip/split.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/trail.zip b/tests/phpunit/data/zip/trail.zip deleted file mode 100644 index 50bcea12..00000000 Binary files a/tests/phpunit/data/zip/trail.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/wrong-cd-start-disk.zip b/tests/phpunit/data/zip/wrong-cd-start-disk.zip deleted file mode 100644 index 59b45938..00000000 Binary files a/tests/phpunit/data/zip/wrong-cd-start-disk.zip and /dev/null differ diff --git a/tests/phpunit/data/zip/wrong-central-entry-sig.zip b/tests/phpunit/data/zip/wrong-central-entry-sig.zip deleted file mode 100644 index 05329b43..00000000 Binary files a/tests/phpunit/data/zip/wrong-central-entry-sig.zip and /dev/null differ diff --git a/tests/phpunit/docs/ExportDemoTest.php b/tests/phpunit/docs/ExportDemoTest.php deleted file mode 100644 index b09487a6..00000000 --- a/tests/phpunit/docs/ExportDemoTest.php +++ /dev/null @@ -1,39 +0,0 @@ -validateXmlFileAgainstXsd( "../../docs/export-demo.xml" ); - } - - /** - * Validates a xml file against the xsd. - * - * The validation is slow, because php has to read the xsd on each call. - * - * @param $fname string: name of file to validate - */ - protected function validateXmlFileAgainstXsd( $fname ) { - $version = WikiExporter::schemaVersion(); - - $dom = new DomDocument(); - $dom->load( $fname ); - - // Ensure, the demo is for the current version - $this->assertEquals( $dom->documentElement->getAttribute( 'version' ), $version, 'export-demo.xml should have the current version' ); - - try { - $this->assertTrue( $dom->schemaValidate( "../../docs/export-" . $version . ".xsd" ), - "schemaValidate has found an error" ); - } catch ( Exception $e ) { - $this->fail( "xml not valid against xsd: " . $e->getMessage() ); - } - } -} diff --git a/tests/phpunit/includes/ArticleTablesTest.php b/tests/phpunit/includes/ArticleTablesTest.php deleted file mode 100644 index 469d1d19..00000000 --- a/tests/phpunit/includes/ArticleTablesTest.php +++ /dev/null @@ -1,32 +0,0 @@ -mRights = array( 'createpage', 'edit', 'purge' ); - $wgLanguageCode = 'es'; - $wgContLang = Language::factory( 'es' ); - - $wgLang = Language::factory( 'fr' ); - $page->doEditContent( new WikitextContent( '{{:{{int:history}}}}' ), 'Test code for bug 14404', 0, false, $user ); - $templates1 = $title->getTemplateLinksFrom(); - - $wgLang = Language::factory( 'de' ); - $page = WikiPage::factory( $title ); // In order to force the rerendering of the same wikitext - - // We need an edit, a purge is not enough to regenerate the tables - $page->doEditContent( new WikitextContent( '{{:{{int:history}}}}' ), 'Test code for bug 14404', EDIT_UPDATE, false, $user ); - $templates2 = $title->getTemplateLinksFrom(); - - $this->assertEquals( $templates1, $templates2 ); - $this->assertEquals( $templates1[0]->getFullText(), 'Historial' ); - } -} diff --git a/tests/phpunit/includes/ArticleTest.php b/tests/phpunit/includes/ArticleTest.php deleted file mode 100644 index b4d6dca6..00000000 --- a/tests/phpunit/includes/ArticleTest.php +++ /dev/null @@ -1,92 +0,0 @@ -title = Title::makeTitle( NS_MAIN, 'SomePage' ); - $this->article = new Article( $this->title ); - } - - /** cleanup title object and its article object */ - protected function tearDown() { - parent::tearDown(); - $this->title = null; - $this->article = null; - } - - public function testImplementsGetMagic() { - $this->assertEquals( false, $this->article->mLatest, "Article __get magic" ); - } - - /** - * @depends testImplementsGetMagic - */ - public function testImplementsSetMagic() { - $this->article->mLatest = 2; - $this->assertEquals( 2, $this->article->mLatest, "Article __set magic" ); - } - - /** - * @depends testImplementsSetMagic - */ - public function testImplementsCallMagic() { - $this->article->mLatest = 33; - $this->article->mDataLoaded = true; - $this->assertEquals( 33, $this->article->getLatest(), "Article __call magic" ); - } - - public function testGetOrSetOnNewProperty() { - $this->article->ext_someNewProperty = 12; - $this->assertEquals( 12, $this->article->ext_someNewProperty, - "Article get/set magic on new field" ); - - $this->article->ext_someNewProperty = -8; - $this->assertEquals( -8, $this->article->ext_someNewProperty, - "Article get/set magic on update to new field" ); - } - - /** - * Checks for the existence of the backwards compatibility static functions (forwarders to WikiPage class) - */ - public function testStaticFunctions() { - $this->hideDeprecated( 'Article::getAutosummary' ); - $this->hideDeprecated( 'WikiPage::getAutosummary' ); - $this->hideDeprecated( 'CategoryPage::getAutosummary' ); // Inherited from Article - - $this->assertEquals( WikiPage::selectFields(), Article::selectFields(), - "Article static functions" ); - $this->assertEquals( true, is_callable( "Article::onArticleCreate" ), - "Article static functions" ); - $this->assertEquals( true, is_callable( "Article::onArticleDelete" ), - "Article static functions" ); - $this->assertEquals( true, is_callable( "ImagePage::onArticleEdit" ), - "Article static functions" ); - $this->assertTrue( is_string( CategoryPage::getAutosummary( '', '', 0 ) ), - "Article static functions" ); - } - - public function testWikiPageFactory() { - $title = Title::makeTitle( NS_FILE, 'Someimage.png' ); - $page = WikiPage::factory( $title ); - $this->assertEquals( 'WikiFilePage', get_class( $page ) ); - - $title = Title::makeTitle( NS_CATEGORY, 'SomeCategory' ); - $page = WikiPage::factory( $title ); - $this->assertEquals( 'WikiCategoryPage', get_class( $page ) ); - - $title = Title::makeTitle( NS_MAIN, 'SomePage' ); - $page = WikiPage::factory( $title ); - $this->assertEquals( 'WikiPage', get_class( $page ) ); - } -} diff --git a/tests/phpunit/includes/BlockTest.php b/tests/phpunit/includes/BlockTest.php deleted file mode 100644 index 21de0985..00000000 --- a/tests/phpunit/includes/BlockTest.php +++ /dev/null @@ -1,354 +0,0 @@ -setMwGlobals( array( - 'wgLanguageCode' => 'en', - 'wgContLang' => Language::factory( 'en' ) - ) ); - } - - function addDBData() { - - $user = User::newFromName( 'UTBlockee' ); - if ( $user->getID() == 0 ) { - $user->addToDatabase(); - $user->setPassword( 'UTBlockeePassword' ); - - $user->saveSettings(); - } - - // Delete the last round's block if it's still there - $oldBlock = Block::newFromTarget( 'UTBlockee' ); - if ( $oldBlock ) { - // An old block will prevent our new one from saving. - $oldBlock->delete(); - } - - $this->block = new Block( 'UTBlockee', $user->getID(), 0, - 'Parce que', 0, false, time() + 100500 - ); - $this->madeAt = wfTimestamp( TS_MW ); - - $this->block->insert(); - // save up ID for use in assertion. Since ID is an autoincrement, - // its value might change depending on the order the tests are run. - // ApiBlockTest insert its own blocks! - $newBlockId = $this->block->getId(); - if ( $newBlockId ) { - $this->blockId = $newBlockId; - } else { - throw new MWException( "Failed to insert block for BlockTest; old leftover block remaining?" ); - } - - $this->addXffBlocks(); - } - - /** - * debug function : dump the ipblocks table - */ - function dumpBlocks() { - $v = $this->db->select( 'ipblocks', '*' ); - print "Got " . $v->numRows() . " rows. Full dump follow:\n"; - foreach ( $v as $row ) { - print_r( $row ); - } - } - - public function testInitializerFunctionsReturnCorrectBlock() { - // $this->dumpBlocks(); - - $this->assertTrue( $this->block->equals( Block::newFromTarget( 'UTBlockee' ) ), "newFromTarget() returns the same block as the one that was made" ); - - $this->assertTrue( $this->block->equals( Block::newFromID( $this->blockId ) ), "newFromID() returns the same block as the one that was made" ); - } - - /** - * per bug 26425 - */ - public function testBug26425BlockTimestampDefaultsToTime() { - // delta to stop one-off errors when things happen to go over a second mark. - $delta = abs( $this->madeAt - $this->block->mTimestamp ); - $this->assertLessThan( 2, $delta, "If no timestamp is specified, the block is recorded as time()" ); - } - - /** - * This is the method previously used to load block info in CheckUser etc - * passing an empty value (empty string, null, etc) as the ip parameter bypasses IP lookup checks. - * - * This stopped working with r84475 and friends: regression being fixed for bug 29116. - * - * @dataProvider provideBug29116Data - */ - public function testBug29116LoadWithEmptyIp( $vagueTarget ) { - $this->hideDeprecated( 'Block::load' ); - - $uid = User::idFromName( 'UTBlockee' ); - $this->assertTrue( ( $uid > 0 ), 'Must be able to look up the target user during tests' ); - - $block = new Block(); - $ok = $block->load( $vagueTarget, $uid ); - $this->assertTrue( $ok, "Block->load() with empty IP and user ID '$uid' should return a block" ); - - $this->assertTrue( $this->block->equals( $block ), "Block->load() returns the same block as the one that was made when given empty ip param " . var_export( $vagueTarget, true ) ); - } - - /** - * CheckUser since being changed to use Block::newFromTarget started failing - * because the new function didn't accept empty strings like Block::load() - * had. Regression bug 29116. - * - * @dataProvider provideBug29116Data - */ - public function testBug29116NewFromTargetWithEmptyIp( $vagueTarget ) { - $block = Block::newFromTarget( 'UTBlockee', $vagueTarget ); - $this->assertTrue( $this->block->equals( $block ), "newFromTarget() returns the same block as the one that was made when given empty vagueTarget param " . var_export( $vagueTarget, true ) ); - } - - public static function provideBug29116Data() { - return array( - array( null ), - array( '' ), - array( false ) - ); - } - - public function testBlockedUserCanNotCreateAccount() { - $username = 'BlockedUserToCreateAccountWith'; - $u = User::newFromName( $username ); - $u->setPassword( 'NotRandomPass' ); - $u->addToDatabase(); - unset( $u ); - - // Sanity check - $this->assertNull( - Block::newFromTarget( $username ), - "$username should not be blocked" - ); - - // Reload user - $u = User::newFromName( $username ); - $this->assertFalse( - $u->isBlockedFromCreateAccount(), - "Our sandbox user should be able to create account before being blocked" - ); - - // Foreign perspective (blockee not on current wiki)... - $block = new Block( - /* $address */ $username, - /* $user */ 14146, - /* $by */ 0, - /* $reason */ 'crosswiki block...', - /* $timestamp */ wfTimestampNow(), - /* $auto */ false, - /* $expiry */ $this->db->getInfinity(), - /* anonOnly */ false, - /* $createAccount */ true, - /* $enableAutoblock */ true, - /* $hideName (ipb_deleted) */ true, - /* $blockEmail */ true, - /* $allowUsertalk */ false, - /* $byName */ 'MetaWikiUser' - ); - $block->insert(); - - // Reload block from DB - $userBlock = Block::newFromTarget( $username ); - $this->assertTrue( - (bool)$block->prevents( 'createaccount' ), - "Block object in DB should prevents 'createaccount'" - ); - - $this->assertInstanceOf( - 'Block', - $userBlock, - "'$username' block block object should be existent" - ); - - // Reload user - $u = User::newFromName( $username ); - $this->assertTrue( - (bool)$u->isBlockedFromCreateAccount(), - "Our sandbox user '$username' should NOT be able to create account" - ); - } - - public function testCrappyCrossWikiBlocks() { - // Delete the last round's block if it's still there - $oldBlock = Block::newFromTarget( 'UserOnForeignWiki' ); - if ( $oldBlock ) { - // An old block will prevent our new one from saving. - $oldBlock->delete(); - } - - // Foreign perspective (blockee not on current wiki)... - $block = new Block( - /* $address */ 'UserOnForeignWiki', - /* $user */ 14146, - /* $by */ 0, - /* $reason */ 'crosswiki block...', - /* $timestamp */ wfTimestampNow(), - /* $auto */ false, - /* $expiry */ $this->db->getInfinity(), - /* anonOnly */ false, - /* $createAccount */ true, - /* $enableAutoblock */ true, - /* $hideName (ipb_deleted) */ true, - /* $blockEmail */ true, - /* $allowUsertalk */ false, - /* $byName */ 'MetaWikiUser' - ); - - $res = $block->insert( $this->db ); - $this->assertTrue( (bool)$res['id'], 'Block succeeded' ); - - // Local perspective (blockee on current wiki)... - $user = User::newFromName( 'UserOnForeignWiki' ); - $user->addToDatabase(); - // Set user ID to match the test value - $this->db->update( 'user', array( 'user_id' => 14146 ), array( 'user_id' => $user->getId() ) ); - $user = null; // clear - - $block = Block::newFromID( $res['id'] ); - $this->assertEquals( 'UserOnForeignWiki', $block->getTarget()->getName(), 'Correct blockee name' ); - $this->assertEquals( '14146', $block->getTarget()->getId(), 'Correct blockee id' ); - $this->assertEquals( 'MetaWikiUser', $block->getBlocker(), 'Correct blocker name' ); - $this->assertEquals( 'MetaWikiUser', $block->getByName(), 'Correct blocker name' ); - $this->assertEquals( 0, $block->getBy(), 'Correct blocker id' ); - } - - protected function addXffBlocks() { - static $inited = false; - - if ( $inited ) { - return; - } - - $inited = true; - - $blockList = array( - array( 'target' => '70.2.0.0/16', - 'type' => Block::TYPE_RANGE, - 'desc' => 'Range Hardblock', - 'ACDisable' => false, - 'isHardblock' => true, - 'isAutoBlocking' => false, - ), - array( 'target' => '2001:4860:4001::/48', - 'type' => Block::TYPE_RANGE, - 'desc' => 'Range6 Hardblock', - 'ACDisable' => false, - 'isHardblock' => true, - 'isAutoBlocking' => false, - ), - array( 'target' => '60.2.0.0/16', - 'type' => Block::TYPE_RANGE, - 'desc' => 'Range Softblock with AC Disabled', - 'ACDisable' => true, - 'isHardblock' => false, - 'isAutoBlocking' => false, - ), - array( 'target' => '50.2.0.0/16', - 'type' => Block::TYPE_RANGE, - 'desc' => 'Range Softblock', - 'ACDisable' => false, - 'isHardblock' => false, - 'isAutoBlocking' => false, - ), - array( 'target' => '50.1.1.1', - 'type' => Block::TYPE_IP, - 'desc' => 'Exact Softblock', - 'ACDisable' => false, - 'isHardblock' => false, - 'isAutoBlocking' => false, - ), - ); - - foreach ( $blockList as $insBlock ) { - $target = $insBlock['target']; - - if ( $insBlock['type'] === Block::TYPE_IP ) { - $target = User::newFromName( IP::sanitizeIP( $target ), false )->getName(); - } elseif ( $insBlock['type'] === Block::TYPE_RANGE ) { - $target = IP::sanitizeRange( $target ); - } - - $block = new Block(); - $block->setTarget( $target ); - $block->setBlocker( 'testblocker@global' ); - $block->mReason = $insBlock['desc']; - $block->mExpiry = 'infinity'; - $block->prevents( 'createaccount', $insBlock['ACDisable'] ); - $block->isHardblock( $insBlock['isHardblock'] ); - $block->isAutoblocking( $insBlock['isAutoBlocking'] ); - $block->insert(); - } - } - - public static function providerXff() { - return array( - array( 'xff' => '1.2.3.4, 70.2.1.1, 60.2.1.1, 2.3.4.5', - 'count' => 2, - 'result' => 'Range Hardblock' - ), - array( 'xff' => '1.2.3.4, 50.2.1.1, 60.2.1.1, 2.3.4.5', - 'count' => 2, - 'result' => 'Range Softblock with AC Disabled' - ), - array( 'xff' => '1.2.3.4, 70.2.1.1, 50.1.1.1, 2.3.4.5', - 'count' => 2, - 'result' => 'Exact Softblock' - ), - array( 'xff' => '1.2.3.4, 70.2.1.1, 50.2.1.1, 50.1.1.1, 2.3.4.5', - 'count' => 3, - 'result' => 'Exact Softblock' - ), - array( 'xff' => '1.2.3.4, 70.2.1.1, 50.2.1.1, 2.3.4.5', - 'count' => 2, - 'result' => 'Range Hardblock' - ), - array( 'xff' => '1.2.3.4, 70.2.1.1, 60.2.1.1, 2.3.4.5', - 'count' => 2, - 'result' => 'Range Hardblock' - ), - array( 'xff' => '50.2.1.1, 60.2.1.1, 2.3.4.5', - 'count' => 2, - 'result' => 'Range Softblock with AC Disabled' - ), - array( 'xff' => '1.2.3.4, 50.1.1.1, 60.2.1.1, 2.3.4.5', - 'count' => 2, - 'result' => 'Exact Softblock' - ), - array( 'xff' => '1.2.3.4, <$A_BUNCH-OF{INVALID}TEXT\>, 60.2.1.1, 2.3.4.5', - 'count' => 1, - 'result' => 'Range Softblock with AC Disabled' - ), - array( 'xff' => '1.2.3.4, 50.2.1.1, 2001:4860:4001:802::1003, 2.3.4.5', - 'count' => 2, - 'result' => 'Range6 Hardblock' - ), - ); - } - - /** - * @dataProvider providerXff - */ - public function testBlocksOnXff( $xff, $exCount, $exResult ) { - $list = array_map( 'trim', explode( ',', $xff ) ); - $xffblocks = Block::getBlocksForIPList( $list, true ); - $this->assertEquals( $exCount, count( $xffblocks ), 'Number of blocks for ' . $xff ); - $block = Block::chooseBlock( $xffblocks, $list ); - $this->assertEquals( $exResult, $block->mReason, 'Correct block type for XFF header ' . $xff ); - } -} diff --git a/tests/phpunit/includes/CdbTest.php b/tests/phpunit/includes/CdbTest.php deleted file mode 100644 index e3d9da7c..00000000 --- a/tests/phpunit/includes/CdbTest.php +++ /dev/null @@ -1,88 +0,0 @@ -markTestSkipped( 'Native CDB support is not available' ); - } - } - - /** - * @group medium - */ - public function testCdb() { - $dir = wfTempDir(); - if ( !is_writable( $dir ) ) { - $this->markTestSkipped( "Temp dir isn't writable" ); - } - - $phpcdbfile = $this->getNewTempFile(); - $dbacdbfile = $this->getNewTempFile(); - - $w1 = new CdbWriter_PHP( $phpcdbfile ); - $w2 = new CdbWriter_DBA( $dbacdbfile ); - - $data = array(); - for ( $i = 0; $i < 1000; $i++ ) { - $key = $this->randomString(); - $value = $this->randomString(); - $w1->set( $key, $value ); - $w2->set( $key, $value ); - - if ( !isset( $data[$key] ) ) { - $data[$key] = $value; - } - } - - $w1->close(); - $w2->close(); - - $this->assertEquals( - md5_file( $phpcdbfile ), - md5_file( $dbacdbfile ), - 'same hash' - ); - - $r1 = new CdbReader_PHP( $phpcdbfile ); - $r2 = new CdbReader_DBA( $dbacdbfile ); - - foreach ( $data as $key => $value ) { - if ( $key === '' ) { - // Known bug - continue; - } - $v1 = $r1->get( $key ); - $v2 = $r2->get( $key ); - - $v1 = $v1 === false ? '(not found)' : $v1; - $v2 = $v2 === false ? '(not found)' : $v2; - - # cdbAssert( 'Mismatch', $key, $v1, $v2 ); - $this->cdbAssert( "PHP error", $key, $v1, $value ); - $this->cdbAssert( "DBA error", $key, $v2, $value ); - } - } - - private function randomString() { - $len = mt_rand( 0, 10 ); - $s = ''; - for ( $j = 0; $j < $len; $j++ ) { - $s .= chr( mt_rand( 0, 255 ) ); - } - - return $s; - } - - private function cdbAssert( $msg, $key, $v1, $v2 ) { - $this->assertEquals( - $v2, - $v1, - $msg . ', k=' . bin2hex( $key ) - ); - } -} diff --git a/tests/phpunit/includes/CollationTest.php b/tests/phpunit/includes/CollationTest.php deleted file mode 100644 index 43bb3941..00000000 --- a/tests/phpunit/includes/CollationTest.php +++ /dev/null @@ -1,111 +0,0 @@ -markTestSkipped( 'These tests require intl extension' ); - } - } - - /** - * Test to make sure, that if you - * have "X" and "XY", the binary - * sortkey also has "X" being a - * prefix of "XY". Our collation - * code makes this assumption. - * - * @param $lang String Language code for collator - * @param $base String Base string - * @param $extended String String containing base as a prefix. - * - * @dataProvider prefixDataProvider - */ - public function testIsPrefix( $lang, $base, $extended ) { - $cp = Collator::create( $lang ); - $cp->setStrength( Collator::PRIMARY ); - $baseBin = $cp->getSortKey( $base ); - // Remove sortkey terminator - $baseBin = rtrim( $baseBin, "\0" ); - $extendedBin = $cp->getSortKey( $extended ); - $this->assertStringStartsWith( $baseBin, $extendedBin, "$base is not a prefix of $extended" ); - } - - function prefixDataProvider() { - return array( - array( 'en', 'A', 'AA' ), - array( 'en', 'A', 'AAA' ), - array( 'en', 'Д', 'ДЂ' ), - array( 'en', 'Д', 'ДA' ), - // 'Ʒ' should expand to 'Z ' (note space). - array( 'fi', 'Z', 'Ʒ' ), - // 'Þ' should expand to 'th' - array( 'sv', 't', 'Þ' ), - // Javanese is a limited use alphabet, so should have 3 bytes - // per character, so do some tests with it. - array( 'en', 'ꦲ', 'ꦲꦤ' ), - array( 'en', 'ꦲ', 'ꦲД' ), - array( 'en', 'A', 'Aꦲ' ), - ); - } - - /** - * Opposite of testIsPrefix - * - * @dataProvider notPrefixDataProvider - */ - public function testNotIsPrefix( $lang, $base, $extended ) { - $cp = Collator::create( $lang ); - $cp->setStrength( Collator::PRIMARY ); - $baseBin = $cp->getSortKey( $base ); - // Remove sortkey terminator - $baseBin = rtrim( $baseBin, "\0" ); - $extendedBin = $cp->getSortKey( $extended ); - $this->assertStringStartsNotWith( $baseBin, $extendedBin, "$base is a prefix of $extended" ); - } - - function notPrefixDataProvider() { - return array( - array( 'en', 'A', 'B' ), - array( 'en', 'AC', 'ABC' ), - array( 'en', 'Z', 'Ʒ' ), - array( 'en', 'A', 'ꦲ' ), - ); - } - - /** - * Test correct first letter is fetched. - * - * @param $collation String Collation name (aka uca-en) - * @param $string String String to get first letter of - * @param $firstLetter String Expected first letter. - * - * @dataProvider firstLetterProvider - */ - public function testGetFirstLetter( $collation, $string, $firstLetter ) { - $col = Collation::factory( $collation ); - $this->assertEquals( $firstLetter, $col->getFirstLetter( $string ) ); - } - - function firstLetterProvider() { - return array( - array( 'uppercase', 'Abc', 'A' ), - array( 'uppercase', 'abc', 'A' ), - array( 'identity', 'abc', 'a' ), - array( 'uca-en', 'abc', 'A' ), - array( 'uca-en', ' ', ' ' ), - array( 'uca-en', 'Êveryone', 'E' ), - array( 'uca-vi', 'Êveryone', 'Ê' ), - // Make sure thorn is not a first letter. - array( 'uca-sv', 'The', 'T' ), - array( 'uca-sv', 'Å', 'Å' ), - array( 'uca-hu', 'dzsdo', 'Dzs' ), - array( 'uca-hu', 'dzdso', 'Dz' ), - array( 'uca-hu', 'CSD', 'Cs' ), - array( 'uca-root', 'CSD', 'C' ), - array( 'uca-fi', 'Ǥ', 'G' ), - array( 'uca-fi', 'Ŧ', 'T' ), - array( 'uca-fi', 'Ʒ', 'Z' ), - array( 'uca-fi', 'Ŋ', 'N' ), - ); - } -} diff --git a/tests/phpunit/includes/DiffHistoryBlobTest.php b/tests/phpunit/includes/DiffHistoryBlobTest.php deleted file mode 100644 index a4d5b91a..00000000 --- a/tests/phpunit/includes/DiffHistoryBlobTest.php +++ /dev/null @@ -1,44 +0,0 @@ -markTestSkipped( 'The xdiff extension is not available' ); - - return; - } - if ( !function_exists( 'xdiff_string_rabdiff' ) ) { - $this->markTestSkipped( 'The version of xdiff extension is lower than 1.5.0' ); - - return; - } - if ( !extension_loaded( 'hash' ) ) { - $this->markTestSkipped( 'The hash extension is not available' ); - - return; - } - parent::setUp(); - } - - /** - * Test for DiffHistoryBlob::xdiffAdler32() - * @dataProvider provideXdiffAdler32 - */ - public function testXdiffAdler32( $input ) { - $xdiffHash = substr( xdiff_string_rabdiff( $input, '' ), 0, 4 ); - $dhb = new DiffHistoryBlob; - $myHash = $dhb->xdiffAdler32( $input ); - $this->assertSame( bin2hex( $xdiffHash ), bin2hex( $myHash ), - "Hash of " . addcslashes( $input, "\0..\37!@\@\177..\377" ) ); - } - - public static function provideXdiffAdler32() { - return array( - array( '', 'Empty string' ), - array( "\0", 'Null' ), - array( "\0\0\0", "Several nulls" ), - array( "Hello", "An ASCII string" ), - array( str_repeat( "x", 6000 ), "A string larger than xdiff's NMAX (5552)" ) - ); - } -} diff --git a/tests/phpunit/includes/EditPageTest.php b/tests/phpunit/includes/EditPageTest.php deleted file mode 100644 index 87272a4c..00000000 --- a/tests/phpunit/includes/EditPageTest.php +++ /dev/null @@ -1,491 +0,0 @@ -assertEquals( $title, $extracted ); - } - - public static function provideExtractSectionTitle() { - return array( - array( - "== Test ==\n\nJust a test section.", - "Test" - ), - array( - "An initial section, no header.", - false - ), - array( - "An initial section with a fake heder (bug 32617)\n\n== Test == ??\nwtf", - false - ), - array( - "== Section ==\nfollowed by a fake == Non-section == ??\nnoooo", - "Section" - ), - array( - "== Section== \t\r\n followed by whitespace (bug 35051)", - 'Section', - ), - ); - } - - protected function forceRevisionDate( WikiPage $page, $timestamp ) { - $dbw = wfGetDB( DB_MASTER ); - - $dbw->update( 'revision', - array( 'rev_timestamp' => $dbw->timestamp( $timestamp ) ), - array( 'rev_id' => $page->getLatest() ) ); - - $page->clear(); - } - - /** - * User input text is passed to rtrim() by edit page. This is a simple - * wrapper around assertEquals() which calls rrtrim() to normalize the - * expected and actual texts. - */ - function assertEditedTextEquals( $expected, $actual, $msg = '' ) { - return $this->assertEquals( rtrim( $expected ), rtrim( $actual ), $msg ); - } - - /** - * Performs an edit and checks the result. - * - * @param String|Title $title The title of the page to edit - * @param String|null $baseText Some text to create the page with before attempting the edit. - * @param User|String|null $user The user to perform the edit as. - * @param array $edit An array of request parameters used to define the edit to perform. - * Some well known fields are: - * * wpTextbox1: the text to submit - * * wpSummary: the edit summary - * * wpEditToken: the edit token (will be inserted if not provided) - * * wpEdittime: timestamp of the edit's base revision (will be inserted if not provided) - * * wpStarttime: timestamp when the edit started (will be inserted if not provided) - * * wpSectionTitle: the section to edit - * * wpMinorEdit: mark as minor edit - * * wpWatchthis: whether to watch the page - * @param int|null $expectedCode The expected result code (EditPage::AS_XXX constants). - * Set to null to skip the check. Defaults to EditPage::AS_OK. - * @param String|null $expectedText The text expected to be on the page after the edit. - * Set to null to skip the check. - * @param String|null $message An optional message to show along with any error message. - * - * @return WikiPage The page that was just edited, useful for getting the edit's rev_id, etc. - */ - protected function assertEdit( $title, $baseText, $user = null, array $edit, - $expectedCode = EditPage::AS_OK, $expectedText = null, $message = null - ) { - if ( is_string( $title ) ) { - $ns = $this->getDefaultWikitextNS(); - $title = Title::newFromText( $title, $ns ); - } - - if ( is_string( $user ) ) { - $user = User::newFromName( $user ); - - if ( $user->getId() === 0 ) { - $user->addToDatabase(); - } - } - - $page = WikiPage::factory( $title ); - - if ( $baseText !== null ) { - $content = ContentHandler::makeContent( $baseText, $title ); - $page->doEditContent( $content, "base text for test" ); - $this->forceRevisionDate( $page, '20120101000000' ); - - //sanity check - $page->clear(); - $currentText = ContentHandler::getContentText( $page->getContent() ); - - # EditPage rtrim() the user input, so we alter our expected text - # to reflect that. - $this->assertEditedTextEquals( $baseText, $currentText ); - } - - if ( $user == null ) { - $user = $GLOBALS['wgUser']; - } else { - $this->setMwGlobals( 'wgUser', $user ); - } - - if ( !isset( $edit['wpEditToken'] ) ) { - $edit['wpEditToken'] = $user->getEditToken(); - } - - if ( !isset( $edit['wpEdittime'] ) ) { - $edit['wpEdittime'] = $page->exists() ? $page->getTimestamp() : ''; - } - - if ( !isset( $edit['wpStarttime'] ) ) { - $edit['wpStarttime'] = wfTimestampNow(); - } - - $req = new FauxRequest( $edit, true ); // session ?? - - $ep = new EditPage( new Article( $title ) ); - $ep->setContextTitle( $title ); - $ep->importFormData( $req ); - - $bot = isset( $edit['bot'] ) ? (bool)$edit['bot'] : false; - - // this is where the edit happens! - // Note: don't want to use EditPage::AttemptSave, because it messes with $wgOut - // and throws exceptions like PermissionsError - $status = $ep->internalAttemptSave( $result, $bot ); - - if ( $expectedCode !== null ) { - // check edit code - $this->assertEquals( $expectedCode, $status->value, - "Expected result code mismatch. $message" ); - } - - $page = WikiPage::factory( $title ); - - if ( $expectedText !== null ) { - // check resulting page text - $content = $page->getContent(); - $text = ContentHandler::getContentText( $content ); - - # EditPage rtrim() the user input, so we alter our expected text - # to reflect that. - $this->assertEditedTextEquals( $expectedText, $text, - "Expected article text mismatch. $message" ); - } - - return $page; - } - - public function testCreatePage() { - $this->assertEdit( - 'EditPageTest_testCreatePage', - null, - null, - array( - 'wpTextbox1' => "Hello World!", - ), - EditPage::AS_SUCCESS_NEW_ARTICLE, - "Hello World!", - "expected article being created" - )->doDeleteArticleReal( 'EditPageTest_testCreatePage' ); - - $this->assertEdit( - 'EditPageTest_testCreatePage', - null, - null, - array( - 'wpTextbox1' => "", - ), - EditPage::AS_BLANK_ARTICLE, - null, - "expected article not being created if empty" - ); - - - $this->assertEdit( - 'MediaWiki:January', - null, - 'UTSysop', - array( - 'wpTextbox1' => "Not January", - ), - EditPage::AS_SUCCESS_NEW_ARTICLE, - "Not January", - "expected MediaWiki: page being created" - )->doDeleteArticleReal( 'EditPageTest_testCreatePage' ); - - $this->assertEdit( - 'MediaWiki:EditPageTest_testCreatePage', - null, - 'UTSysop', - array( - 'wpTextbox1' => "", - ), - EditPage::AS_BLANK_ARTICLE, - null, - "expected not-registered MediaWiki: page not being created if empty" - ); - - $this->assertEdit( - 'MediaWiki:January', - null, - 'UTSysop', - array( - 'wpTextbox1' => "", - ), - EditPage::AS_SUCCESS_NEW_ARTICLE, - "", - "expected registered MediaWiki: page being created even if empty" - )->doDeleteArticleReal( 'EditPageTest_testCreatePage' ); - - $this->assertEdit( - 'MediaWiki:Ipb-default-expiry', - null, - 'UTSysop', - array( - 'wpTextbox1' => "", - ), - EditPage::AS_BLANK_ARTICLE, - "", - "expected registered MediaWiki: page whose default content is empty not being created if empty" - ); - - $this->assertEdit( - 'MediaWiki:January', - null, - 'UTSysop', - array( - 'wpTextbox1' => "January", - ), - EditPage::AS_BLANK_ARTICLE, - null, - "expected MediaWiki: page not being created if text equals default message" - ); - } - - public function testUpdatePage() { - $text = "one"; - $edit = array( - 'wpTextbox1' => $text, - 'wpSummary' => 'first update', - ); - - $page = $this->assertEdit( 'EditPageTest_testUpdatePage', "zero", null, $edit, - EditPage::AS_SUCCESS_UPDATE, $text, - "expected successfull update with given text" ); - - $this->forceRevisionDate( $page, '20120101000000' ); - - $text = "two"; - $edit = array( - 'wpTextbox1' => $text, - 'wpSummary' => 'second update', - ); - - $this->assertEdit( 'EditPageTest_testUpdatePage', null, null, $edit, - EditPage::AS_SUCCESS_UPDATE, $text, - "expected successfull update with given text" ); - } - - public static function provideSectionEdit() { - $text = 'Intro - -== one == -first section. - -== two == -second section. -'; - - $sectionOne = '== one == -hello -'; - - $newSection = '== new section == - -hello -'; - - $textWithNewSectionOne = preg_replace( - '/== one ==.*== two ==/ms', - "$sectionOne\n== two ==", $text - ); - - $textWithNewSectionAdded = "$text\n$newSection"; - - return array( - array( #0 - $text, - '', - 'hello', - 'replace all', - 'hello' - ), - - array( #1 - $text, - '1', - $sectionOne, - 'replace first section', - $textWithNewSectionOne, - ), - - array( #2 - $text, - 'new', - 'hello', - 'new section', - $textWithNewSectionAdded, - ), - ); - } - - /** - * @dataProvider provideSectionEdit - */ - public function testSectionEdit( $base, $section, $text, $summary, $expected ) { - $edit = array( - 'wpTextbox1' => $text, - 'wpSummary' => $summary, - 'wpSection' => $section, - ); - - $this->assertEdit( 'EditPageTest_testSectionEdit', $base, null, $edit, - EditPage::AS_SUCCESS_UPDATE, $expected, - "expected successfull update of section" ); - } - - public static function provideAutoMerge() { - $tests = array(); - - $tests[] = array( #0: plain conflict - "Elmo", # base edit user - "one\n\ntwo\n\nthree\n", - array( #adam's edit - 'wpStarttime' => 1, - 'wpTextbox1' => "ONE\n\ntwo\n\nthree\n", - ), - array( #berta's edit - 'wpStarttime' => 2, - 'wpTextbox1' => "(one)\n\ntwo\n\nthree\n", - ), - EditPage::AS_CONFLICT_DETECTED, # expected code - "ONE\n\ntwo\n\nthree\n", # expected text - 'expected edit conflict', # message - ); - - $tests[] = array( #1: successful merge - "Elmo", # base edit user - "one\n\ntwo\n\nthree\n", - array( #adam's edit - 'wpStarttime' => 1, - 'wpTextbox1' => "ONE\n\ntwo\n\nthree\n", - ), - array( #berta's edit - 'wpStarttime' => 2, - 'wpTextbox1' => "one\n\ntwo\n\nTHREE\n", - ), - EditPage::AS_SUCCESS_UPDATE, # expected code - "ONE\n\ntwo\n\nTHREE\n", # expected text - 'expected automatic merge', # message - ); - - $text = "Intro\n\n"; - $text .= "== first section ==\n\n"; - $text .= "one\n\ntwo\n\nthree\n\n"; - $text .= "== second section ==\n\n"; - $text .= "four\n\nfive\n\nsix\n\n"; - - // extract the first section. - $section = preg_replace( '/.*(== first section ==.*)== second section ==.*/sm', '$1', $text ); - - // generate expected text after merge - $expected = str_replace( 'one', 'ONE', str_replace( 'three', 'THREE', $text ) ); - - $tests[] = array( #2: merge in section - "Elmo", # base edit user - $text, - array( #adam's edit - 'wpStarttime' => 1, - 'wpTextbox1' => str_replace( 'one', 'ONE', $section ), - 'wpSection' => '1' - ), - array( #berta's edit - 'wpStarttime' => 2, - 'wpTextbox1' => str_replace( 'three', 'THREE', $section ), - 'wpSection' => '1' - ), - EditPage::AS_SUCCESS_UPDATE, # expected code - $expected, # expected text - 'expected automatic section merge', # message - ); - - // see whether it makes a difference who did the base edit - $testsWithAdam = array_map( function ( $test ) { - $test[0] = 'Adam'; // change base edit user - return $test; - }, $tests ); - - $testsWithBerta = array_map( function ( $test ) { - $test[0] = 'Berta'; // change base edit user - return $test; - }, $tests ); - - return array_merge( $tests, $testsWithAdam, $testsWithBerta ); - } - - /** - * @dataProvider provideAutoMerge - */ - public function testAutoMerge( $baseUser, $text, $adamsEdit, $bertasEdit, - $expectedCode, $expectedText, $message = null - ) { - $this->checkHasDiff3(); - - //create page - $ns = $this->getDefaultWikitextNS(); - $title = Title::newFromText( 'EditPageTest_testAutoMerge', $ns ); - $page = WikiPage::factory( $title ); - - if ( $page->exists() ) { - $page->doDeleteArticle( "clean slate for testing" ); - } - - $baseEdit = array( - 'wpTextbox1' => $text, - ); - - $page = $this->assertEdit( 'EditPageTest_testAutoMerge', null, - $baseUser, $baseEdit, null, null, __METHOD__ ); - - $this->forceRevisionDate( $page, '20120101000000' ); - - $edittime = $page->getTimestamp(); - - // start timestamps for conflict detection - if ( !isset( $adamsEdit['wpStarttime'] ) ) { - $adamsEdit['wpStarttime'] = 1; - } - - if ( !isset( $bertasEdit['wpStarttime'] ) ) { - $bertasEdit['wpStarttime'] = 2; - } - - $starttime = wfTimestampNow(); - $adamsTime = wfTimestamp( TS_MW, (int)wfTimestamp( TS_UNIX, $starttime ) + (int)$adamsEdit['wpStarttime'] ); - $bertasTime = wfTimestamp( TS_MW, (int)wfTimestamp( TS_UNIX, $starttime ) + (int)$bertasEdit['wpStarttime'] ); - - $adamsEdit['wpStarttime'] = $adamsTime; - $bertasEdit['wpStarttime'] = $bertasTime; - - $adamsEdit['wpSummary'] = 'Adam\'s edit'; - $bertasEdit['wpSummary'] = 'Bertas\'s edit'; - - $adamsEdit['wpEdittime'] = $edittime; - $bertasEdit['wpEdittime'] = $edittime; - - // first edit - $this->assertEdit( 'EditPageTest_testAutoMerge', null, 'Adam', $adamsEdit, - EditPage::AS_SUCCESS_UPDATE, null, "expected successfull update" ); - - // second edit - $this->assertEdit( 'EditPageTest_testAutoMerge', null, 'Berta', $bertasEdit, - $expectedCode, $expectedText, $message ); - } -} diff --git a/tests/phpunit/includes/ExternalStoreTest.php b/tests/phpunit/includes/ExternalStoreTest.php deleted file mode 100644 index fcffcbc2..00000000 --- a/tests/phpunit/includes/ExternalStoreTest.php +++ /dev/null @@ -1,81 +0,0 @@ -setMwGlobals( 'wgExternalStores', false ); - - $this->assertFalse( - ExternalStore::fetchFromURL( 'FOO://cluster1/200' ), - 'Deny if wgExternalStores is not set to a non-empty array' - ); - - $this->setMwGlobals( 'wgExternalStores', array( 'FOO' ) ); - - $this->assertEquals( - ExternalStore::fetchFromURL( 'FOO://cluster1/200' ), - 'Hello', - 'Allow FOO://cluster1/200' - ); - $this->assertEquals( - ExternalStore::fetchFromURL( 'FOO://cluster1/300/0' ), - 'Hello', - 'Allow FOO://cluster1/300/0' - ); - # Assertions for r68900 - $this->assertFalse( - ExternalStore::fetchFromURL( 'ftp.example.org' ), - 'Deny domain ftp.example.org' - ); - $this->assertFalse( - ExternalStore::fetchFromURL( '/example.txt' ), - 'Deny path /example.txt' - ); - $this->assertFalse( - ExternalStore::fetchFromURL( 'http://' ), - 'Deny protocol http://' - ); - } -} - -class ExternalStoreFOO { - - protected $data = array( - 'cluster1' => array( - '200' => 'Hello', - '300' => array( - 'Hello', 'World', - ), - ), - ); - - /** - * Fetch data from given URL - * @param $url String: an url of the form FOO://cluster/id or FOO://cluster/id/itemid. - * @return mixed - */ - function fetchFromURL( $url ) { - // Based on ExternalStoreDB - $path = explode( '/', $url ); - $cluster = $path[2]; - $id = $path[3]; - if ( isset( $path[4] ) ) { - $itemID = $path[4]; - } else { - $itemID = false; - } - - if ( !isset( $this->data[$cluster][$id] ) ) { - return null; - } - - if ( $itemID !== false && is_array( $this->data[$cluster][$id] ) && isset( $this->data[$cluster][$id][$itemID] ) ) { - return $this->data[$cluster][$id][$itemID]; - } - - return $this->data[$cluster][$id]; - } -} diff --git a/tests/phpunit/includes/ExtraParserTest.php b/tests/phpunit/includes/ExtraParserTest.php deleted file mode 100644 index 6c67beb1..00000000 --- a/tests/phpunit/includes/ExtraParserTest.php +++ /dev/null @@ -1,157 +0,0 @@ -setMwGlobals( array( - 'wgShowDBErrorBacktrace' => true, - 'wgLanguageCode' => 'en', - 'wgContLang' => $contLang, - 'wgLang' => Language::factory( 'en' ), - 'wgMemc' => new EmptyBagOStuff, - 'wgAlwaysUseTidy' => false, - 'wgCleanSignatures' => true, - ) ); - - $this->options = ParserOptions::newFromUserAndLang( new User, $contLang ); - $this->options->setTemplateCallback( array( __CLASS__, 'statelessFetchTemplate' ) ); - $this->parser = new Parser; - - MagicWord::clearCache(); - } - - // Bug 8689 - Long numeric lines kill the parser - public function testBug8689() { - global $wgUser; - $longLine = '1.' . str_repeat( '1234567890', 100000 ) . "\n"; - - $t = Title::newFromText( 'Unit test' ); - $options = ParserOptions::newFromUser( $wgUser ); - $this->assertEquals( "

            $longLine

            ", - $this->parser->parse( $longLine, $t, $options )->getText() ); - } - - /* Test the parser entry points */ - public function testParse() { - $title = Title::newFromText( __FUNCTION__ ); - $parserOutput = $this->parser->parse( "Test\n{{Foo}}\n{{Bar}}", $title, $this->options ); - $this->assertEquals( "

            Test\nContent of Template:Foo\nContent of Template:Bar\n

            ", $parserOutput->getText() ); - } - - public function testPreSaveTransform() { - global $wgUser; - $title = Title::newFromText( __FUNCTION__ ); - $outputText = $this->parser->preSaveTransform( "Test\r\n{{subst:Foo}}\n{{Bar}}", $title, $wgUser, $this->options ); - - $this->assertEquals( "Test\nContent of ''Template:Foo''\n{{Bar}}", $outputText ); - } - - public function testPreprocess() { - $title = Title::newFromText( __FUNCTION__ ); - $outputText = $this->parser->preprocess( "Test\n{{Foo}}\n{{Bar}}", $title, $this->options ); - - $this->assertEquals( "Test\nContent of ''Template:Foo''\nContent of ''Template:Bar''", $outputText ); - } - - /** - * cleanSig() makes all templates substs and removes tildes - */ - public function testCleanSig() { - $title = Title::newFromText( __FUNCTION__ ); - $outputText = $this->parser->cleanSig( "{{Foo}} ~~~~" ); - - $this->assertEquals( "{{SUBST:Foo}} ", $outputText ); - } - - /** - * cleanSig() should do nothing if disabled - */ - public function testCleanSigDisabled() { - $this->setMwGlobals( 'wgCleanSignatures', false ); - - $title = Title::newFromText( __FUNCTION__ ); - $outputText = $this->parser->cleanSig( "{{Foo}} ~~~~" ); - - $this->assertEquals( "{{Foo}} ~~~~", $outputText ); - } - - /** - * cleanSigInSig() just removes tildes - * @dataProvider provideStringsForCleanSigInSig - */ - public function testCleanSigInSig( $in, $out ) { - $this->assertEquals( Parser::cleanSigInSig( $in ), $out ); - } - - public static function provideStringsForCleanSigInSig() { - return array( - array( "{{Foo}} ~~~~", "{{Foo}} " ), - array( "~~~", "" ), - array( "~~~~~", "" ), - ); - } - - public function testGetSection() { - $outputText2 = $this->parser->getSection( "Section 0\n== Heading 1 ==\nSection 1\n=== Heading 2 ===\nSection 2\n== Heading 3 ==\nSection 3\n", 2 ); - $outputText1 = $this->parser->getSection( "Section 0\n== Heading 1 ==\nSection 1\n=== Heading 2 ===\nSection 2\n== Heading 3 ==\nSection 3\n", 1 ); - - $this->assertEquals( "=== Heading 2 ===\nSection 2", $outputText2 ); - $this->assertEquals( "== Heading 1 ==\nSection 1\n=== Heading 2 ===\nSection 2", $outputText1 ); - } - - public function testReplaceSection() { - $outputText = $this->parser->replaceSection( "Section 0\n== Heading 1 ==\nSection 1\n=== Heading 2 ===\nSection 2\n== Heading 3 ==\nSection 3\n", 1, "New section 1" ); - - $this->assertEquals( "Section 0\nNew section 1\n\n== Heading 3 ==\nSection 3", $outputText ); - } - - /** - * Templates and comments are not affected, but noinclude/onlyinclude is. - */ - public function testGetPreloadText() { - $title = Title::newFromText( __FUNCTION__ ); - $outputText = $this->parser->getPreloadText( "{{Foo}} censored information ", $title, $this->options ); - - $this->assertEquals( "{{Foo}} information ", $outputText ); - } - - static function statelessFetchTemplate( $title, $parser = false ) { - $text = "Content of ''" . $title->getFullText() . "''"; - $deps = array(); - - return array( - 'text' => $text, - 'finalTitle' => $title, - 'deps' => $deps ); - } - - /** - * @group Database - */ - public function testTrackingCategory() { - $title = Title::newFromText( __FUNCTION__ ); - $catName = wfMessage( 'broken-file-category' )->inContentLanguage()->text(); - $cat = Title::makeTitleSafe( NS_CATEGORY, $catName ); - $expected = array( $cat->getDBkey() ); - $parserOutput = $this->parser->parse( "[[file:nonexistent]]", $title, $this->options ); - $result = $parserOutput->getCategoryLinks(); - $this->assertEquals( $expected, $result ); - } - - /** - * @group Database - */ - public function testTrackingCategorySpecial() { - // Special pages shouldn't have tracking cats. - $title = SpecialPage::getTitleFor( 'Contributions' ); - $parserOutput = $this->parser->parse( "[[file:nonexistent]]", $title, $this->options ); - $result = $parserOutput->getCategoryLinks(); - $this->assertEmpty( $result ); - } -} diff --git a/tests/phpunit/includes/FallbackTest.php b/tests/phpunit/includes/FallbackTest.php deleted file mode 100644 index f408f471..00000000 --- a/tests/phpunit/includes/FallbackTest.php +++ /dev/null @@ -1,73 +0,0 @@ -markTestSkipped( "The mb_string functions must be installed to test the fallback functions" ); - } - - $sampleUTF = "Östergötland_coat_of_arms.png"; - - //mb_substr - $substr_params = array( - array( 0, 0 ), - array( 5, -4 ), - array( 33 ), - array( 100, -5 ), - array( -8, 10 ), - array( 1, 1 ), - array( 2, -1 ) - ); - - foreach ( $substr_params as $param_set ) { - $old_param_set = $param_set; - array_unshift( $param_set, $sampleUTF ); - - $this->assertEquals( - call_user_func_array( 'mb_substr', $param_set ), - call_user_func_array( 'Fallback::mb_substr', $param_set ), - 'Fallback mb_substr with params ' . implode( ', ', $old_param_set ) - ); - } - - //mb_strlen - $this->assertEquals( - mb_strlen( $sampleUTF ), - Fallback::mb_strlen( $sampleUTF ), - 'Fallback mb_strlen' - ); - - //mb_str(r?)pos - $strpos_params = array( - //array( 'ter' ), - //array( 'Ö' ), - //array( 'Ö', 3 ), - //array( 'oat_', 100 ), - //array( 'c', -10 ), - //Broken for now - ); - - foreach ( $strpos_params as $param_set ) { - $old_param_set = $param_set; - array_unshift( $param_set, $sampleUTF ); - - $this->assertEquals( - call_user_func_array( 'mb_strpos', $param_set ), - call_user_func_array( 'Fallback::mb_strpos', $param_set ), - 'Fallback mb_strpos with params ' . implode( ', ', $old_param_set ) - ); - - $this->assertEquals( - call_user_func_array( 'mb_strrpos', $param_set ), - call_user_func_array( 'Fallback::mb_strrpos', $param_set ), - 'Fallback mb_strrpos with params ' . implode( ', ', $old_param_set ) - ); - } - } - -} \ No newline at end of file diff --git a/tests/phpunit/includes/FauxRequestTest.php b/tests/phpunit/includes/FauxRequestTest.php deleted file mode 100644 index 9f3aa11d..00000000 --- a/tests/phpunit/includes/FauxRequestTest.php +++ /dev/null @@ -1,15 +0,0 @@ -setHeader( 'Content-Type', $value ); - - $this->assertEquals( $request->getHeader( 'Content-Type' ), $value ); - $this->assertEquals( $request->getHeader( 'CONTENT-TYPE' ), $value ); - $this->assertEquals( $request->getHeader( 'content-type' ), $value ); - } -} diff --git a/tests/phpunit/includes/FauxResponseTest.php b/tests/phpunit/includes/FauxResponseTest.php deleted file mode 100644 index f9ba1b3b..00000000 --- a/tests/phpunit/includes/FauxResponseTest.php +++ /dev/null @@ -1,74 +0,0 @@ -response = new FauxResponse; - } - - public function testCookie() { - $this->assertEquals( null, $this->response->getcookie( 'key' ), 'Non-existing cookie' ); - $this->response->setcookie( 'key', 'val' ); - $this->assertEquals( 'val', $this->response->getcookie( 'key' ), 'Existing cookie' ); - } - - public function testHeader() { - $this->assertEquals( null, $this->response->getheader( 'Location' ), 'Non-existing header' ); - - $this->response->header( 'Location: http://localhost/' ); - $this->assertEquals( 'http://localhost/', $this->response->getheader( 'Location' ), 'Set header' ); - - $this->response->header( 'Location: http://127.0.0.1/' ); - $this->assertEquals( 'http://127.0.0.1/', $this->response->getheader( 'Location' ), 'Same header' ); - - $this->response->header( 'Location: http://127.0.0.2/', false ); - $this->assertEquals( 'http://127.0.0.1/', $this->response->getheader( 'Location' ), 'Same header with override disabled' ); - - $this->response->header( 'Location: http://localhost/' ); - $this->assertEquals( 'http://localhost/', $this->response->getheader( 'LOCATION' ), 'Get header case insensitive' ); - } - - public function testResponseCode() { - $this->response->header( 'HTTP/1.1 200' ); - $this->assertEquals( 200, $this->response->getStatusCode(), 'Header with no message' ); - - $this->response->header( 'HTTP/1.x 201' ); - $this->assertEquals( 201, $this->response->getStatusCode(), 'Header with no message and protocol 1.x' ); - - $this->response->header( 'HTTP/1.1 202 OK' ); - $this->assertEquals( 202, $this->response->getStatusCode(), 'Normal header' ); - - $this->response->header( 'HTTP/1.x 203 OK' ); - $this->assertEquals( 203, $this->response->getStatusCode(), 'Normal header with no message and protocol 1.x' ); - - $this->response->header( 'HTTP/1.x 204 OK', false, 205 ); - $this->assertEquals( 205, $this->response->getStatusCode(), 'Third parameter overrides the HTTP/... header' ); - - $this->response->header( 'Location: http://localhost/', false, 206 ); - $this->assertEquals( 206, $this->response->getStatusCode(), 'Third parameter with another header' ); - } -} diff --git a/tests/phpunit/includes/FormOptionsInitializationTest.php b/tests/phpunit/includes/FormOptionsInitializationTest.php deleted file mode 100644 index fb2304dc..00000000 --- a/tests/phpunit/includes/FormOptionsInitializationTest.php +++ /dev/null @@ -1,84 +0,0 @@ -options; - } -} - -/** - * Test class for FormOptions initialization - * Ensure the FormOptions::add() does what we want it to do. - * - * Generated by PHPUnit on 2011-02-28 at 20:46:27. - * - * Copyright © 2011, Antoine Musso - * - * @author Antoine Musso - */ -class FormOptionsInitializationTest extends MediaWikiTestCase { - /** - * @var FormOptions - */ - protected $object; - - - /** - * A new fresh and empty FormOptions object to test initialization - * with. - */ - protected function setUp() { - parent::setUp(); - $this->object = new FormOptionsExposed(); - } - - public function testAddStringOption() { - $this->object->add( 'foo', 'string value' ); - $this->assertEquals( - array( - 'foo' => array( - 'default' => 'string value', - 'consumed' => false, - 'type' => FormOptions::STRING, - 'value' => null, - ) - ), - $this->object->getOptions() - ); - } - - public function testAddIntegers() { - $this->object->add( 'one', 1 ); - $this->object->add( 'negone', -1 ); - $this->assertEquals( - array( - 'negone' => array( - 'default' => -1, - 'value' => null, - 'consumed' => false, - 'type' => FormOptions::INT, - ), - 'one' => array( - 'default' => 1, - 'value' => null, - 'consumed' => false, - 'type' => FormOptions::INT, - ) - ), - $this->object->getOptions() - ); - } -} diff --git a/tests/phpunit/includes/FormOptionsTest.php b/tests/phpunit/includes/FormOptionsTest.php deleted file mode 100644 index 0a13cfec..00000000 --- a/tests/phpunit/includes/FormOptionsTest.php +++ /dev/null @@ -1,91 +0,0 @@ -object = new FormOptions; - $this->object->add( 'string1', 'string one' ); - $this->object->add( 'string2', 'string two' ); - $this->object->add( 'integer', 0 ); - $this->object->add( 'intnull', 0, FormOptions::INTNULL ); - } - - /** Helpers for testGuessType() */ - /* @{ */ - private function assertGuessBoolean( $data ) { - $this->guess( FormOptions::BOOL, $data ); - } - private function assertGuessInt( $data ) { - $this->guess( FormOptions::INT, $data ); - } - private function assertGuessString( $data ) { - $this->guess( FormOptions::STRING, $data ); - } - - /** Generic helper */ - private function guess( $expected, $data ) { - $this->assertEquals( - $expected, - FormOptions::guessType( $data ) - ); - } - /* @} */ - - /** - * Reuse helpers above assertGuessBoolean assertGuessInt assertGuessString - */ - public function testGuessTypeDetection() { - $this->assertGuessBoolean( true ); - $this->assertGuessBoolean( false ); - - $this->assertGuessInt( 0 ); - $this->assertGuessInt( -5 ); - $this->assertGuessInt( 5 ); - $this->assertGuessInt( 0x0F ); - - $this->assertGuessString( 'true' ); - $this->assertGuessString( 'false' ); - $this->assertGuessString( '5' ); - $this->assertGuessString( '0' ); - } - - /** - * @expectedException MWException - */ - public function testGuessTypeOnArrayThrowException() { - $this->object->guessType( array( 'foo' ) ); - } - /** - * @expectedException MWException - */ - public function testGuessTypeOnNullThrowException() { - $this->object->guessType( null ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php deleted file mode 100644 index 6154df1d..00000000 --- a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php +++ /dev/null @@ -1,652 +0,0 @@ -setMwGlobals( array( - 'wgReadOnlyFile' => $readOnlyFile, - 'wgUrlProtocols' => array( - 'http://', - 'https://', - 'mailto:', - '//', - 'file://', # Non-default - ), - ) ); - } - - protected function tearDown() { - global $wgReadOnlyFile; - - if ( file_exists( $wgReadOnlyFile ) ) { - unlink( $wgReadOnlyFile ); - } - - parent::tearDown(); - } - - /** - * @dataProvider provideForWfArrayDiff2 - * @covers ::wfArrayDiff2 - */ - public function testWfArrayDiff2( $a, $b, $expected ) { - $this->assertEquals( - wfArrayDiff2( $a, $b ), $expected - ); - } - - // @todo Provide more tests - public static function provideForWfArrayDiff2() { - // $a $b $expected - return array( - array( - array( 'a', 'b' ), - array( 'a', 'b' ), - array(), - ), - array( - array( array( 'a' ), array( 'a', 'b', 'c' ) ), - array( array( 'a' ), array( 'a', 'b' ) ), - array( 1 => array( 'a', 'b', 'c' ) ), - ), - ); - } - - /** - * @covers ::wfRandom - */ - public function testRandom() { - # This could hypothetically fail, but it shouldn't ;) - $this->assertFalse( - wfRandom() == wfRandom() ); - } - - /** - * @covers ::wfUrlencode - */ - public function testUrlencode() { - $this->assertEquals( - "%E7%89%B9%E5%88%A5:Contributions/Foobar", - wfUrlencode( "\xE7\x89\xB9\xE5\x88\xA5:Contributions/Foobar" ) ); - } - - /** - * @covers ::wfExpandIRI - */ - public function testExpandIRI() { - $this->assertEquals( - "https://te.wikibooks.org/wiki/ఉబుంటు_వాడుకరి_మార్గదర్శని", - wfExpandIRI( "https://te.wikibooks.org/wiki/%E0%B0%89%E0%B0%AC%E0%B1%81%E0%B0%82%E0%B0%9F%E0%B1%81_%E0%B0%B5%E0%B0%BE%E0%B0%A1%E0%B1%81%E0%B0%95%E0%B0%B0%E0%B0%BF_%E0%B0%AE%E0%B0%BE%E0%B0%B0%E0%B1%8D%E0%B0%97%E0%B0%A6%E0%B0%B0%E0%B1%8D%E0%B0%B6%E0%B0%A8%E0%B0%BF" ) ); - } - - /** - * @covers ::wfReadOnly - */ - public function testReadOnlyEmpty() { - global $wgReadOnly; - $wgReadOnly = null; - - $this->assertFalse( wfReadOnly() ); - $this->assertFalse( wfReadOnly() ); - } - - /** - * @covers ::wfReadOnly - */ - public function testReadOnlySet() { - global $wgReadOnly, $wgReadOnlyFile; - - $f = fopen( $wgReadOnlyFile, "wt" ); - fwrite( $f, 'Message' ); - fclose( $f ); - $wgReadOnly = null; # Check on $wgReadOnlyFile - - $this->assertTrue( wfReadOnly() ); - $this->assertTrue( wfReadOnly() ); # Check cached - - unlink( $wgReadOnlyFile ); - $wgReadOnly = null; # Clean cache - - $this->assertFalse( wfReadOnly() ); - $this->assertFalse( wfReadOnly() ); - } - - public static function provideArrayToCGI() { - return array( - array( array(), '' ), // empty - array( array( 'foo' => 'bar' ), 'foo=bar' ), // string test - array( array( 'foo' => '' ), 'foo=' ), // empty string test - array( array( 'foo' => 1 ), 'foo=1' ), // number test - array( array( 'foo' => true ), 'foo=1' ), // true test - array( array( 'foo' => false ), '' ), // false test - array( array( 'foo' => null ), '' ), // null test - array( array( 'foo' => 'A&B=5+6@!"\'' ), 'foo=A%26B%3D5%2B6%40%21%22%27' ), // urlencoding test - array( array( 'foo' => 'bar', 'baz' => 'is', 'asdf' => 'qwerty' ), 'foo=bar&baz=is&asdf=qwerty' ), // multi-item test - array( array( 'foo' => array( 'bar' => 'baz' ) ), 'foo%5Bbar%5D=baz' ), - array( array( 'foo' => array( 'bar' => 'baz', 'qwerty' => 'asdf' ) ), 'foo%5Bbar%5D=baz&foo%5Bqwerty%5D=asdf' ), - array( array( 'foo' => array( 'bar', 'baz' ) ), 'foo%5B0%5D=bar&foo%5B1%5D=baz' ), - array( array( 'foo' => array( 'bar' => array( 'bar' => 'baz' ) ) ), 'foo%5Bbar%5D%5Bbar%5D=baz' ), - ); - } - - /** - * @dataProvider provideArrayToCGI - * @covers ::wfArrayToCgi - */ - public function testArrayToCGI( $array, $result ) { - $this->assertEquals( $result, wfArrayToCgi( $array ) ); - } - - - /** - * @covers ::testWfArrayDiff2 - */ - public function testArrayToCGI2() { - $this->assertEquals( - "baz=bar&foo=bar", - wfArrayToCgi( - array( 'baz' => 'bar' ), - array( 'foo' => 'bar', 'baz' => 'overridden value' ) ) ); - } - - public static function provideCgiToArray() { - return array( - array( '', array() ), // empty - array( 'foo=bar', array( 'foo' => 'bar' ) ), // string - array( 'foo=', array( 'foo' => '' ) ), // empty string - array( 'foo', array( 'foo' => '' ) ), // missing = - array( 'foo=bar&qwerty=asdf', array( 'foo' => 'bar', 'qwerty' => 'asdf' ) ), // multiple value - array( 'foo=A%26B%3D5%2B6%40%21%22%27', array( 'foo' => 'A&B=5+6@!"\'' ) ), // urldecoding test - array( 'foo%5Bbar%5D=baz', array( 'foo' => array( 'bar' => 'baz' ) ) ), - array( 'foo%5Bbar%5D=baz&foo%5Bqwerty%5D=asdf', array( 'foo' => array( 'bar' => 'baz', 'qwerty' => 'asdf' ) ) ), - array( 'foo%5B0%5D=bar&foo%5B1%5D=baz', array( 'foo' => array( 0 => 'bar', 1 => 'baz' ) ) ), - array( 'foo%5Bbar%5D%5Bbar%5D=baz', array( 'foo' => array( 'bar' => array( 'bar' => 'baz' ) ) ) ), - ); - } - - /** - * @dataProvider provideCgiToArray - * @covers ::wfCgiToArray - */ - public function testCgiToArray( $cgi, $result ) { - $this->assertEquals( $result, wfCgiToArray( $cgi ) ); - } - - public static function provideCgiRoundTrip() { - return array( - array( '' ), - array( 'foo=bar' ), - array( 'foo=' ), - array( 'foo=bar&baz=biz' ), - array( 'foo=A%26B%3D5%2B6%40%21%22%27' ), - array( 'foo%5Bbar%5D=baz' ), - array( 'foo%5B0%5D=bar&foo%5B1%5D=baz' ), - array( 'foo%5Bbar%5D%5Bbar%5D=baz' ), - ); - } - - /** - * @dataProvider provideCgiRoundTrip - * @covers ::wfArrayToCgi - */ - public function testCgiRoundTrip( $cgi ) { - $this->assertEquals( $cgi, wfArrayToCgi( wfCgiToArray( $cgi ) ) ); - } - - /** - * @covers ::mimeTypeMatch - */ - public function testMimeTypeMatch() { - $this->assertEquals( - 'text/html', - mimeTypeMatch( 'text/html', - array( 'application/xhtml+xml' => 1.0, - 'text/html' => 0.7, - 'text/plain' => 0.3 ) ) ); - $this->assertEquals( - 'text/*', - mimeTypeMatch( 'text/html', - array( 'image/*' => 1.0, - 'text/*' => 0.5 ) ) ); - $this->assertEquals( - '*/*', - mimeTypeMatch( 'text/html', - array( '*/*' => 1.0 ) ) ); - $this->assertNull( - mimeTypeMatch( 'text/html', - array( 'image/png' => 1.0, - 'image/svg+xml' => 0.5 ) ) ); - } - - /** - * @covers ::wfNegotiateType - */ - public function testNegotiateType() { - $this->assertEquals( - 'text/html', - wfNegotiateType( - array( 'application/xhtml+xml' => 1.0, - 'text/html' => 0.7, - 'text/plain' => 0.5, - 'text/*' => 0.2 ), - array( 'text/html' => 1.0 ) ) ); - $this->assertEquals( - 'application/xhtml+xml', - wfNegotiateType( - array( 'application/xhtml+xml' => 1.0, - 'text/html' => 0.7, - 'text/plain' => 0.5, - 'text/*' => 0.2 ), - array( 'application/xhtml+xml' => 1.0, - 'text/html' => 0.5 ) ) ); - $this->assertEquals( - 'text/html', - wfNegotiateType( - array( 'text/html' => 1.0, - 'text/plain' => 0.5, - 'text/*' => 0.5, - 'application/xhtml+xml' => 0.2 ), - array( 'application/xhtml+xml' => 1.0, - 'text/html' => 0.5 ) ) ); - $this->assertEquals( - 'text/html', - wfNegotiateType( - array( 'text/*' => 1.0, - 'image/*' => 0.7, - '*/*' => 0.3 ), - array( 'application/xhtml+xml' => 1.0, - 'text/html' => 0.5 ) ) ); - $this->assertNull( - wfNegotiateType( - array( 'text/*' => 1.0 ), - array( 'application/xhtml+xml' => 1.0 ) ) ); - } - - /** - * @covers ::wfDebug - * @covers ::wfDebugMem - */ - public function testDebugFunctionTest() { - - global $wgDebugLogFile, $wgDebugTimestamps; - - $old_log_file = $wgDebugLogFile; - $wgDebugLogFile = tempnam( wfTempDir(), 'mw-' ); - # @todo FIXME: $wgDebugTimestamps should be tested - $old_wgDebugTimestamps = $wgDebugTimestamps; - $wgDebugTimestamps = false; - - wfDebug( "This is a normal string" ); - $this->assertEquals( "This is a normal string", file_get_contents( $wgDebugLogFile ) ); - unlink( $wgDebugLogFile ); - - wfDebug( "This is nöt an ASCII string" ); - $this->assertEquals( "This is nöt an ASCII string", file_get_contents( $wgDebugLogFile ) ); - unlink( $wgDebugLogFile ); - - wfDebug( "\00305This has böth UTF and control chars\003" ); - $this->assertEquals( " 05This has böth UTF and control chars ", file_get_contents( $wgDebugLogFile ) ); - unlink( $wgDebugLogFile ); - - wfDebugMem(); - $this->assertGreaterThan( 5000, preg_replace( '/\D/', '', file_get_contents( $wgDebugLogFile ) ) ); - unlink( $wgDebugLogFile ); - - wfDebugMem( true ); - $this->assertGreaterThan( 5000000, preg_replace( '/\D/', '', file_get_contents( $wgDebugLogFile ) ) ); - unlink( $wgDebugLogFile ); - - $wgDebugLogFile = $old_log_file; - $wgDebugTimestamps = $old_wgDebugTimestamps; - } - - /** - * @covers ::wfClientAcceptsGzip - */ - public function testClientAcceptsGzipTest() { - - $settings = array( - 'gzip' => true, - 'bzip' => false, - '*' => false, - 'compress, gzip' => true, - 'gzip;q=1.0' => true, - 'foozip' => false, - 'foo*zip' => false, - 'gzip;q=abcde' => true, //is this REALLY valid? - 'gzip;q=12345678.9' => true, - ' gzip' => true, - ); - - if ( isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) { - $old_server_setting = $_SERVER['HTTP_ACCEPT_ENCODING']; - } - - foreach ( $settings as $encoding => $expect ) { - $_SERVER['HTTP_ACCEPT_ENCODING'] = $encoding; - - $this->assertEquals( $expect, wfClientAcceptsGzip( true ), - "'$encoding' => " . wfBoolToStr( $expect ) ); - } - - if ( isset( $old_server_setting ) ) { - $_SERVER['HTTP_ACCEPT_ENCODING'] = $old_server_setting; - } - } - - /** - * @covers ::swap - */ - public function testSwapVarsTest() { - $var1 = 1; - $var2 = 2; - - $this->assertEquals( $var1, 1, 'var1 is set originally' ); - $this->assertEquals( $var2, 2, 'var1 is set originally' ); - - swap( $var1, $var2 ); - - $this->assertEquals( $var1, 2, 'var1 is swapped' ); - $this->assertEquals( $var2, 1, 'var2 is swapped' ); - } - - /** - * @covers ::wfPercent - */ - public function testWfPercentTest() { - - $pcts = array( - array( 6 / 7, '0.86%', 2, false ), - array( 3 / 3, '1%' ), - array( 22 / 7, '3.14286%', 5 ), - array( 3 / 6, '0.5%' ), - array( 1 / 3, '0%', 0 ), - array( 10 / 3, '0%', -1 ), - array( 3 / 4 / 5, '0.1%', 1 ), - array( 6 / 7 * 8, '6.8571428571%', 10 ), - ); - - foreach ( $pcts as $pct ) { - if ( !isset( $pct[2] ) ) { - $pct[2] = 2; - } - if ( !isset( $pct[3] ) ) { - $pct[3] = true; - } - - $this->assertEquals( wfPercent( $pct[0], $pct[2], $pct[3] ), $pct[1], $pct[1] ); - } - } - - /** - * test @see wfShorthandToInteger() - * @dataProvider provideShorthand - * @covers ::wfShorthandToInteger - */ - public function testWfShorthandToInteger( $shorthand, $expected ) { - $this->assertEquals( $expected, - wfShorthandToInteger( $shorthand ) - ); - } - - /** array( shorthand, expected integer ) */ - public static function provideShorthand() { - return array( - # Null, empty ... - array( '', -1 ), - array( ' ', -1 ), - array( null, -1 ), - - # Failures returns 0 :( - array( 'ABCDEFG', 0 ), - array( 'Ak', 0 ), - - # Int, strings with spaces - array( 1, 1 ), - array( ' 1 ', 1 ), - array( 1023, 1023 ), - array( ' 1023 ', 1023 ), - - # kilo, Mega, Giga - array( '1k', 1024 ), - array( '1K', 1024 ), - array( '1m', 1024 * 1024 ), - array( '1M', 1024 * 1024 ), - array( '1g', 1024 * 1024 * 1024 ), - array( '1G', 1024 * 1024 * 1024 ), - - # Negatives - array( -1, -1 ), - array( -500, -500 ), - array( '-500', -500 ), - array( '-1k', -1024 ), - - # Zeroes - array( '0', 0 ), - array( '0k', 0 ), - array( '0M', 0 ), - array( '0G', 0 ), - array( '-0', 0 ), - array( '-0k', 0 ), - array( '-0M', 0 ), - array( '-0G', 0 ), - ); - } - - /** - * @param String $old: Text as it was in the database - * @param String $mine: Text submitted while user was editing - * @param String $yours: Text submitted by the user - * @param Boolean $expectedMergeResult Whether the merge should be a success - * @param String $expectedText: Text after merge has been completed - * - * @dataProvider provideMerge() - * @group medium - * @covers ::wfMerge - */ - public function testMerge( $old, $mine, $yours, $expectedMergeResult, $expectedText ) { - $this->checkHasDiff3(); - - $mergedText = null; - $isMerged = wfMerge( $old, $mine, $yours, $mergedText ); - - $msg = 'Merge should be a '; - $msg .= $expectedMergeResult ? 'success' : 'failure'; - $this->assertEquals( $expectedMergeResult, $isMerged, $msg ); - - if ( $isMerged ) { - // Verify the merged text - $this->assertEquals( $expectedText, $mergedText, - 'is merged text as expected?' ); - } - } - - public static function provideMerge() { - $EXPECT_MERGE_SUCCESS = true; - $EXPECT_MERGE_FAILURE = false; - - return array( - // #0: clean merge - array( - // old: - "one one one\n" . // trimmed - "\n" . - "two two two", - - // mine: - "one one one ONE ONE\n" . - "\n" . - "two two two\n", // with tailing whitespace - - // yours: - "one one one\n" . - "\n" . - "two two TWO TWO", // trimmed - - // ok: - $EXPECT_MERGE_SUCCESS, - - // result: - "one one one ONE ONE\n" . - "\n" . - "two two TWO TWO\n", // note: will always end in a newline - ), - - // #1: conflict, fail - array( - // old: - "one one one", // trimmed - - // mine: - "one one one ONE ONE\n" . - "\n" . - "bla bla\n" . - "\n", // with tailing whitespace - - // yours: - "one one one\n" . - "\n" . - "two two", // trimmed - - $EXPECT_MERGE_FAILURE, - - // result: - null, - ), - ); - } - - /** - * @dataProvider provideMakeUrlIndexes() - * @covers ::wfMakeUrlIndexes - */ - public function testMakeUrlIndexes( $url, $expected ) { - $index = wfMakeUrlIndexes( $url ); - $this->assertEquals( $expected, $index, "wfMakeUrlIndexes(\"$url\")" ); - } - - public static function provideMakeUrlIndexes() { - return array( - array( - // just a regular :) - 'https://bugzilla.wikimedia.org/show_bug.cgi?id=28627', - array( 'https://org.wikimedia.bugzilla./show_bug.cgi?id=28627' ) - ), - array( - // mailtos are handled special - // is this really right though? that final . probably belongs earlier? - 'mailto:wiki@wikimedia.org', - array( 'mailto:org.wikimedia@wiki.' ) - ), - - // file URL cases per bug 28627... - array( - // three slashes: local filesystem path Unix-style - 'file:///whatever/you/like.txt', - array( 'file://./whatever/you/like.txt' ) - ), - array( - // three slashes: local filesystem path Windows-style - 'file:///c:/whatever/you/like.txt', - array( 'file://./c:/whatever/you/like.txt' ) - ), - array( - // two slashes: UNC filesystem path Windows-style - 'file://intranet/whatever/you/like.txt', - array( 'file://intranet./whatever/you/like.txt' ) - ), - // Multiple-slash cases that can sorta work on Mozilla - // if you hack it just right are kinda pathological, - // and unreliable cross-platform or on IE which means they're - // unlikely to appear on intranets. - // - // Those will survive the algorithm but with results that - // are less consistent. - - // protocol-relative URL cases per bug 29854... - array( - '//bugzilla.wikimedia.org/show_bug.cgi?id=28627', - array( - 'http://org.wikimedia.bugzilla./show_bug.cgi?id=28627', - 'https://org.wikimedia.bugzilla./show_bug.cgi?id=28627' - ) - ), - ); - } - - /** - * @dataProvider provideWfMatchesDomainList - * @covers ::wfMatchesDomainList - */ - public function testWfMatchesDomainList( $url, $domains, $expected, $description ) { - $actual = wfMatchesDomainList( $url, $domains ); - $this->assertEquals( $expected, $actual, $description ); - } - - public static function provideWfMatchesDomainList() { - $a = array(); - $protocols = array( 'HTTP' => 'http:', 'HTTPS' => 'https:', 'protocol-relative' => '' ); - foreach ( $protocols as $pDesc => $p ) { - $a = array_merge( $a, array( - array( "$p//www.example.com", array(), false, "No matches for empty domains array, $pDesc URL" ), - array( "$p//www.example.com", array( 'www.example.com' ), true, "Exact match in domains array, $pDesc URL" ), - array( "$p//www.example.com", array( 'example.com' ), true, "Match without subdomain in domains array, $pDesc URL" ), - array( "$p//www.example2.com", array( 'www.example.com', 'www.example2.com', 'www.example3.com' ), true, "Exact match with other domains in array, $pDesc URL" ), - array( "$p//www.example2.com", array( 'example.com', 'example2.com', 'example3,com' ), true, "Match without subdomain with other domains in array, $pDesc URL" ), - array( "$p//www.example4.com", array( 'example.com', 'example2.com', 'example3,com' ), false, "Domain not in array, $pDesc URL" ), - array( "$p//nds-nl.wikipedia.org", array( 'nl.wikipedia.org' ), false, "Non-matching substring of domain, $pDesc URL" ), - ) ); - } - - return $a; - } - - /** - * @covers ::wfMkdirParents - */ - public function testWfMkdirParents() { - // Should not return true if file exists instead of directory - $fname = $this->getNewTempFile(); - wfSuppressWarnings(); - $ok = wfMkdirParents( $fname ); - wfRestoreWarnings(); - $this->assertFalse( $ok ); - } - - /** - * @dataProvider provideWfShellMaintenanceCmdList - * @covers ::wfShellMaintenanceCmd - */ - public function testWfShellMaintenanceCmd( $script, $parameters, $options, $expected, $description ) { - if ( wfIsWindows() ) { - // Approximation that's good enough for our purposes just now - $expected = str_replace( "'", '"', $expected ); - } - $actual = wfShellMaintenanceCmd( $script, $parameters, $options ); - $this->assertEquals( $expected, $actual, $description ); - } - - public static function provideWfShellMaintenanceCmdList() { - global $wgPhpCli; - - return array( - array( 'eval.php', array( '--help', '--test' ), array(), - "'$wgPhpCli' 'eval.php' '--help' '--test'", - "Called eval.php --help --test" ), - array( 'eval.php', array( '--help', '--test space' ), array( 'php' => 'php5' ), - "'php5' 'eval.php' '--help' '--test space'", - "Called eval.php --help --test with php option" ), - array( 'eval.php', array( '--help', '--test', 'X' ), array( 'wrapper' => 'MWScript.php' ), - "'$wgPhpCli' 'MWScript.php' 'eval.php' '--help' '--test' 'X'", - "Called eval.php --help --test with wrapper option" ), - array( 'eval.php', array( '--help', '--test', 'y' ), array( 'php' => 'php5', 'wrapper' => 'MWScript.php' ), - "'php5' 'MWScript.php' 'eval.php' '--help' '--test' 'y'", - "Called eval.php --help --test with wrapper and php option" ), - ); - } - /* @TODO many more! */ -} diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php deleted file mode 100644 index cf891e7b..00000000 --- a/tests/phpunit/includes/GlobalFunctions/GlobalWithDBTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertEquals( $expected, wfIsBadImage( $name, $title, $blacklist ), $desc ); - } - - public static function provideWfIsBadImageList() { - $blacklist = '* [[File:Bad.jpg]] except [[Nasty page]]'; - - return array( - array( 'Bad.jpg', false, $blacklist, true, - 'Called on a bad image' ), - array( 'Bad.jpg', Title::makeTitle( NS_MAIN, 'A page' ), $blacklist, true, - 'Called on a bad image' ), - array( 'NotBad.jpg', false, $blacklist, false, - 'Called on a non-bad image' ), - array( 'Bad.jpg', Title::makeTitle( NS_MAIN, 'Nasty page' ), $blacklist, false, - 'Called on a bad image but is on a whitelisted page' ), - array( 'File:Bad.jpg', false, $blacklist, false, - 'Called on a bad image with File:' ), - ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/README b/tests/phpunit/includes/GlobalFunctions/README deleted file mode 100644 index 0042bdac..00000000 --- a/tests/phpunit/includes/GlobalFunctions/README +++ /dev/null @@ -1,2 +0,0 @@ -This directory hold tests for includes/GlobalFunctions.php file -which is a pile of functions. diff --git a/tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php b/tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php deleted file mode 100644 index 9bb74873..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfAssembleUrlTest.php +++ /dev/null @@ -1,111 +0,0 @@ -assertEquals( - $output, - wfAssembleUrl( $parts ), - "Testing $partsDump assembles to $output" - ); - } - - /** - * Provider of URL parts for testing wfAssembleUrl() - * - * @return array - */ - public static function provideURLParts() { - $schemes = array( - '' => array(), - '//' => array( - 'delimiter' => '//', - ), - 'http://' => array( - 'scheme' => 'http', - 'delimiter' => '://', - ), - ); - - $hosts = array( - '' => array(), - 'example.com' => array( - 'host' => 'example.com', - ), - 'example.com:123' => array( - 'host' => 'example.com', - 'port' => 123, - ), - 'id@example.com' => array( - 'user' => 'id', - 'host' => 'example.com', - ), - 'id@example.com:123' => array( - 'user' => 'id', - 'host' => 'example.com', - 'port' => 123, - ), - 'id:key@example.com' => array( - 'user' => 'id', - 'pass' => 'key', - 'host' => 'example.com', - ), - 'id:key@example.com:123' => array( - 'user' => 'id', - 'pass' => 'key', - 'host' => 'example.com', - 'port' => 123, - ), - ); - - $cases = array(); - foreach ( $schemes as $scheme => $schemeParts ) { - foreach ( $hosts as $host => $hostParts ) { - foreach ( array( '', '/path' ) as $path ) { - foreach ( array( '', 'query' ) as $query ) { - foreach ( array( '', 'fragment' ) as $fragment ) { - $parts = array_merge( - $schemeParts, - $hostParts - ); - $url = $scheme . - $host . - $path; - - if ( $path ) { - $parts['path'] = $path; - } - if ( $query ) { - $parts['query'] = $query; - $url .= '?' . $query; - } - if ( $fragment ) { - $parts['fragment'] = $fragment; - $url .= '#' . $fragment; - } - - $cases[] = array( - $parts, - $url, - ); - } - } - } - } - } - - $complexURL = 'http://id:key@example.org:321' . - '/over/there?name=ferret&foo=bar#nose'; - $cases[] = array( - wfParseUrl( $complexURL ), - $complexURL, - ); - - return $cases; - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php b/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php deleted file mode 100644 index a01c0d49..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php +++ /dev/null @@ -1,120 +0,0 @@ -assertEquals( $expected, wfBCP47( $code ), - "Applying BCP47 standard to lower case '$code'" - ); - - $code = strtoupper( $code ); - $this->assertEquals( $expected, wfBCP47( $code ), - "Applying BCP47 standard to upper case '$code'" - ); - } - - /** - * Array format is ($code, $expected) - */ - public static function provideLanguageCodes() { - return array( - // Extracted from BCP47 (list not exhaustive) - # 2.1.1 - array( 'en-ca-x-ca', 'en-CA-x-ca' ), - array( 'sgn-be-fr', 'sgn-BE-FR' ), - array( 'az-latn-x-latn', 'az-Latn-x-latn' ), - # 2.2 - array( 'sr-Latn-RS', 'sr-Latn-RS' ), - array( 'az-arab-ir', 'az-Arab-IR' ), - - # 2.2.5 - array( 'sl-nedis', 'sl-nedis' ), - array( 'de-ch-1996', 'de-CH-1996' ), - - # 2.2.6 - array( - 'en-latn-gb-boont-r-extended-sequence-x-private', - 'en-Latn-GB-boont-r-extended-sequence-x-private' - ), - - // Examples from BCP47 Appendix A - # Simple language subtag: - array( 'DE', 'de' ), - array( 'fR', 'fr' ), - array( 'ja', 'ja' ), - - # Language subtag plus script subtag: - array( 'zh-hans', 'zh-Hans' ), - array( 'sr-cyrl', 'sr-Cyrl' ), - array( 'sr-latn', 'sr-Latn' ), - - # Extended language subtags and their primary language subtag - # counterparts: - array( 'zh-cmn-hans-cn', 'zh-cmn-Hans-CN' ), - array( 'cmn-hans-cn', 'cmn-Hans-CN' ), - array( 'zh-yue-hk', 'zh-yue-HK' ), - array( 'yue-hk', 'yue-HK' ), - - # Language-Script-Region: - array( 'zh-hans-cn', 'zh-Hans-CN' ), - array( 'sr-latn-RS', 'sr-Latn-RS' ), - - # Language-Variant: - array( 'sl-rozaj', 'sl-rozaj' ), - array( 'sl-rozaj-biske', 'sl-rozaj-biske' ), - array( 'sl-nedis', 'sl-nedis' ), - - # Language-Region-Variant: - array( 'de-ch-1901', 'de-CH-1901' ), - array( 'sl-it-nedis', 'sl-IT-nedis' ), - - # Language-Script-Region-Variant: - array( 'hy-latn-it-arevela', 'hy-Latn-IT-arevela' ), - - # Language-Region: - array( 'de-de', 'de-DE' ), - array( 'en-us', 'en-US' ), - array( 'es-419', 'es-419' ), - - # Private use subtags: - array( 'de-ch-x-phonebk', 'de-CH-x-phonebk' ), - array( 'az-arab-x-aze-derbend', 'az-Arab-x-aze-derbend' ), - /** - * Previous test does not reflect the BCP which states: - * az-Arab-x-AZE-derbend - * AZE being private, it should be lower case, hence the test above - * should probably be: - #array( 'az-arab-x-aze-derbend', 'az-Arab-x-AZE-derbend' ), - */ - - # Private use registry values: - array( 'x-whatever', 'x-whatever' ), - array( 'qaa-qaaa-qm-x-southern', 'qaa-Qaaa-QM-x-southern' ), - array( 'de-qaaa', 'de-Qaaa' ), - array( 'sr-latn-qm', 'sr-Latn-QM' ), - array( 'sr-qaaa-rs', 'sr-Qaaa-RS' ), - - # Tags that use extensions - array( 'en-us-u-islamcal', 'en-US-u-islamcal' ), - array( 'zh-cn-a-myext-x-private', 'zh-CN-a-myext-x-private' ), - array( 'en-a-myext-b-another', 'en-a-myext-b-another' ), - - # Invalid: - // de-419-DE - // a-DE - // ar-a-aaa-b-bbb-a-ccc - ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php b/tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php deleted file mode 100644 index 7da804e6..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php +++ /dev/null @@ -1,182 +0,0 @@ -assertSame( $base2, wfBaseConvert( $base3, '3', '2' ) ); - $this->assertSame( $base2, wfBaseConvert( $base5, '5', '2' ) ); - $this->assertSame( $base2, wfBaseConvert( $base8, '8', '2' ) ); - $this->assertSame( $base2, wfBaseConvert( $base10, '10', '2' ) ); - $this->assertSame( $base2, wfBaseConvert( $base16, '16', '2' ) ); - $this->assertSame( $base2, wfBaseConvert( $base36, '36', '2' ) ); - } - - /** - * @dataProvider provideSingleDigitConversions - */ - public function testDigitToBase3( $base2, $base3, $base5, $base8, $base10, $base16, $base36 ) { - $this->assertSame( $base3, wfBaseConvert( $base2, '2', '3' ) ); - $this->assertSame( $base3, wfBaseConvert( $base5, '5', '3' ) ); - $this->assertSame( $base3, wfBaseConvert( $base8, '8', '3' ) ); - $this->assertSame( $base3, wfBaseConvert( $base10, '10', '3' ) ); - $this->assertSame( $base3, wfBaseConvert( $base16, '16', '3' ) ); - $this->assertSame( $base3, wfBaseConvert( $base36, '36', '3' ) ); - } - - /** - * @dataProvider provideSingleDigitConversions - */ - public function testDigitToBase5( $base2, $base3, $base5, $base8, $base10, $base16, $base36 ) { - $this->assertSame( $base5, wfBaseConvert( $base2, '2', '5' ) ); - $this->assertSame( $base5, wfBaseConvert( $base3, '3', '5' ) ); - $this->assertSame( $base5, wfBaseConvert( $base8, '8', '5' ) ); - $this->assertSame( $base5, wfBaseConvert( $base10, '10', '5' ) ); - $this->assertSame( $base5, wfBaseConvert( $base16, '16', '5' ) ); - $this->assertSame( $base5, wfBaseConvert( $base36, '36', '5' ) ); - } - - /** - * @dataProvider provideSingleDigitConversions - */ - public function testDigitToBase8( $base2, $base3, $base5, $base8, $base10, $base16, $base36 ) { - $this->assertSame( $base8, wfBaseConvert( $base2, '2', '8' ) ); - $this->assertSame( $base8, wfBaseConvert( $base3, '3', '8' ) ); - $this->assertSame( $base8, wfBaseConvert( $base5, '5', '8' ) ); - $this->assertSame( $base8, wfBaseConvert( $base10, '10', '8' ) ); - $this->assertSame( $base8, wfBaseConvert( $base16, '16', '8' ) ); - $this->assertSame( $base8, wfBaseConvert( $base36, '36', '8' ) ); - } - - /** - * @dataProvider provideSingleDigitConversions - */ - public function testDigitToBase10( $base2, $base3, $base5, $base8, $base10, $base16, $base36 ) { - $this->assertSame( $base10, wfBaseConvert( $base2, '2', '10' ) ); - $this->assertSame( $base10, wfBaseConvert( $base3, '3', '10' ) ); - $this->assertSame( $base10, wfBaseConvert( $base5, '5', '10' ) ); - $this->assertSame( $base10, wfBaseConvert( $base8, '8', '10' ) ); - $this->assertSame( $base10, wfBaseConvert( $base16, '16', '10' ) ); - $this->assertSame( $base10, wfBaseConvert( $base36, '36', '10' ) ); - } - - /** - * @dataProvider provideSingleDigitConversions - */ - public function testDigitToBase16( $base2, $base3, $base5, $base8, $base10, $base16, $base36 ) { - $this->assertSame( $base16, wfBaseConvert( $base2, '2', '16' ) ); - $this->assertSame( $base16, wfBaseConvert( $base3, '3', '16' ) ); - $this->assertSame( $base16, wfBaseConvert( $base5, '5', '16' ) ); - $this->assertSame( $base16, wfBaseConvert( $base8, '8', '16' ) ); - $this->assertSame( $base16, wfBaseConvert( $base10, '10', '16' ) ); - $this->assertSame( $base16, wfBaseConvert( $base36, '36', '16' ) ); - } - - /** - * @dataProvider provideSingleDigitConversions - */ - public function testDigitToBase36( $base2, $base3, $base5, $base8, $base10, $base16, $base36 ) { - $this->assertSame( $base36, wfBaseConvert( $base2, '2', '36' ) ); - $this->assertSame( $base36, wfBaseConvert( $base3, '3', '36' ) ); - $this->assertSame( $base36, wfBaseConvert( $base5, '5', '36' ) ); - $this->assertSame( $base36, wfBaseConvert( $base8, '8', '36' ) ); - $this->assertSame( $base36, wfBaseConvert( $base10, '10', '36' ) ); - $this->assertSame( $base36, wfBaseConvert( $base16, '16', '36' ) ); - } - - public function testLargeNumber() { - $this->assertSame( '1100110001111010000000101110100', wfBaseConvert( 'sd89ys', 36, 2 ) ); - $this->assertSame( '11102112120221201101', wfBaseConvert( 'sd89ys', 36, 3 ) ); - $this->assertSame( '12003102232400', wfBaseConvert( 'sd89ys', 36, 5 ) ); - $this->assertSame( '14617200564', wfBaseConvert( 'sd89ys', 36, 8 ) ); - $this->assertSame( '1715274100', wfBaseConvert( 'sd89ys', 36, 10 ) ); - $this->assertSame( '663d0174', wfBaseConvert( 'sd89ys', 36, 16 ) ); - } - - public static function provideNumbers() { - $x = array(); - $chars = '0123456789abcdefghijklmnopqrstuvwxyz'; - for ( $i = 0; $i < 50; $i++ ) { - $base = mt_rand( 2, 36 ); - $len = mt_rand( 10, 100 ); - - $str = ''; - for ( $j = 0; $j < $len; $j++ ) { - $str .= $chars[mt_rand( 0, $base - 1 )]; - } - - $x[] = array( $base, $str ); - } - - return $x; - } - - /** - * @dataProvider provideNumbers - */ - public function testIdentity( $base, $number ) { - $this->assertSame( $number, wfBaseConvert( $number, $base, $base, strlen( $number ) ) ); - } - - public function testInvalid() { - $this->assertFalse( wfBaseConvert( '101', 1, 15 ) ); - $this->assertFalse( wfBaseConvert( '101', 15, 1 ) ); - $this->assertFalse( wfBaseConvert( '101', 37, 15 ) ); - $this->assertFalse( wfBaseConvert( '101', 15, 37 ) ); - $this->assertFalse( wfBaseConvert( 'abcde', 10, 11 ) ); - $this->assertFalse( wfBaseConvert( '12930', 2, 10 ) ); - $this->assertFalse( wfBaseConvert( '101', 'abc', 15 ) ); - $this->assertFalse( wfBaseConvert( '101', 15, 'abc' ) ); - } - - public function testPadding() { - $number = "10101010101"; - $this->assertSame( strlen( $number ) + 5, strlen( wfBaseConvert( $number, 2, 2, strlen( $number ) + 5 ) ) ); - $this->assertSame( strlen( $number ), strlen( wfBaseConvert( $number, 2, 2, strlen( $number ) - 5 ) ) ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php b/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php deleted file mode 100644 index 8c548040..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfBaseNameTest.php +++ /dev/null @@ -1,36 +0,0 @@ -assertEquals( $basename, wfBaseName( $fullpath ), - "wfBaseName('$fullpath') => '$basename'" ); - } - - public static function providePaths() { - return array( - array( '', '' ), - array( '/', '' ), - array( '\\', '' ), - array( '//', '' ), - array( '\\\\', '' ), - array( 'a', 'a' ), - array( 'aaaa', 'aaaa' ), - array( '/a', 'a' ), - array( '\\a', 'a' ), - array( '/aaaa', 'aaaa' ), - array( '\\aaaa', 'aaaa' ), - array( '/aaaa/', 'aaaa' ), - array( '\\aaaa\\', 'aaaa' ), - array( '\\aaaa\\', 'aaaa' ), - array( '/mnt/upload3/wikipedia/en/thumb/8/8b/Zork_Grand_Inquisitor_box_cover.jpg/93px-Zork_Grand_Inquisitor_box_cover.jpg', - '93px-Zork_Grand_Inquisitor_box_cover.jpg' ), - array( 'C:\\Progra~1\\Wikime~1\\Wikipe~1\\VIEWER.EXE', 'VIEWER.EXE' ), - array( 'Östergötland_coat_of_arms.png', 'Östergötland_coat_of_arms.png' ), - ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php b/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php deleted file mode 100644 index 41230a1e..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php +++ /dev/null @@ -1,111 +0,0 @@ -setMwGlobals( array( - 'wgServer' => $server, - 'wgCanonicalServer' => $canServer, - ) ); - - // Fake $_SERVER['HTTPS'] if needed - if ( $httpsMode ) { - $_SERVER['HTTPS'] = 'on'; - } else { - unset( $_SERVER['HTTPS'] ); - } - - $this->assertEquals( $fullUrl, wfExpandUrl( $shortUrl, $defaultProto ), $message ); - } - - /** - * Provider of URL examples for testing wfExpandUrl() - * - * @return array - */ - public static function provideExpandableUrls() { - $modes = array( 'http', 'https' ); - $servers = array( - 'http' => 'http://example.com', - 'https' => 'https://example.com', - 'protocol-relative' => '//example.com' - ); - $defaultProtos = array( - 'http' => PROTO_HTTP, - 'https' => PROTO_HTTPS, - 'protocol-relative' => PROTO_RELATIVE, - 'current' => PROTO_CURRENT, - 'canonical' => PROTO_CANONICAL - ); - - $retval = array(); - foreach ( $modes as $mode ) { - $httpsMode = $mode == 'https'; - foreach ( $servers as $serverDesc => $server ) { - foreach ( $modes as $canServerMode ) { - $canServer = "$canServerMode://example2.com"; - foreach ( $defaultProtos as $protoDesc => $defaultProto ) { - $retval[] = array( - 'http://example.com', 'http://example.com', - $defaultProto, $server, $canServer, $httpsMode, - "Testing fully qualified http URLs (no need to expand) ' . - '(defaultProto: $protoDesc , wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" - ); - $retval[] = array( - 'https://example.com', 'https://example.com', - $defaultProto, $server, $canServer, $httpsMode, - "Testing fully qualified https URLs (no need to expand) ' . - '(defaultProto: $protoDesc , wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" - ); - # Would be nice to support this, see fixme on wfExpandUrl() - $retval[] = array( - "wiki/FooBar", 'wiki/FooBar', - $defaultProto, $server, $canServer, $httpsMode, - "Test non-expandable relative URLs ' . - '(defaultProto: $protoDesc , wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" - ); - - // Determine expected protocol - if ( $protoDesc == 'protocol-relative' ) { - $p = ''; - } elseif ( $protoDesc == 'current' ) { - $p = "$mode:"; - } elseif ( $protoDesc == 'canonical' ) { - $p = "$canServerMode:"; - } else { - $p = $protoDesc . ':'; - } - // Determine expected server name - if ( $protoDesc == 'canonical' ) { - $srv = $canServer; - } elseif ( $serverDesc == 'protocol-relative' ) { - $srv = $p . $server; - } else { - $srv = $server; - } - - $retval[] = array( - "$p//wikipedia.org", '//wikipedia.org', - $defaultProto, $server, $canServer, $httpsMode, - "Test protocol-relative URL ' . - '(defaultProto: $protoDesc, wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" - ); - $retval[] = array( - "$srv/wiki/FooBar", '/wiki/FooBar', - $defaultProto, $server, $canServer, $httpsMode, - "Testing expanding URL beginning with / ' . - '(defaultProto: $protoDesc , wgServer: $server, wgCanonicalServer: $canServer, current request protocol: $mode )" - ); - } - } - } - } - - return $retval; - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php b/tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php deleted file mode 100644 index 62296245..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php +++ /dev/null @@ -1,40 +0,0 @@ -assertEquals( __METHOD__, wfGetCaller( 1 ) ); - } - - function callerOne() { - return wfGetCaller(); - } - - public function testOne() { - $this->assertEquals( 'WfGetCallerTest::testOne', self::callerOne() ); - } - - function intermediateFunction( $level = 2, $n = 0 ) { - if ( $n > 0 ) { - return self::intermediateFunction( $level, $n - 1 ); - } - - return wfGetCaller( $level ); - } - - public function testTwo() { - $this->assertEquals( 'WfGetCallerTest::testTwo', self::intermediateFunction() ); - } - - public function testN() { - $this->assertEquals( 'WfGetCallerTest::testN', self::intermediateFunction( 2, 0 ) ); - $this->assertEquals( 'WfGetCallerTest::intermediateFunction', self::intermediateFunction( 1, 0 ) ); - - for ( $i = 0; $i < 10; $i++ ) { - $this->assertEquals( 'WfGetCallerTest::intermediateFunction', self::intermediateFunction( $i + 1, $i ) ); - } - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php b/tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php deleted file mode 100644 index 5032dc11..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php +++ /dev/null @@ -1,146 +0,0 @@ -setMwGlobals( 'wgUrlProtocols', array( - '//', 'http://', 'file://', 'mailto:', - ) ); - } - - /** - * @dataProvider provideURLs - */ - public function testWfParseUrl( $url, $parts ) { - $partsDump = var_export( $parts, true ); - $this->assertEquals( - $parts, - wfParseUrl( $url ), - "Testing $url parses to $partsDump" - ); - } - - /** - * Provider of URLs for testing wfParseUrl() - * - * @return array - */ - public static function provideURLs() { - return array( - array( - '//example.org', - array( - 'scheme' => '', - 'delimiter' => '//', - 'host' => 'example.org', - ) - ), - array( - 'http://example.org', - array( - 'scheme' => 'http', - 'delimiter' => '://', - 'host' => 'example.org', - ) - ), - array( - 'http://id:key@example.org:123/path?foo=bar#baz', - array( - 'scheme' => 'http', - 'delimiter' => '://', - 'user' => 'id', - 'pass' => 'key', - 'host' => 'example.org', - 'port' => 123, - 'path' => '/path', - 'query' => 'foo=bar', - 'fragment' => 'baz', - ) - ), - array( - 'file://example.org/etc/php.ini', - array( - 'scheme' => 'file', - 'delimiter' => '://', - 'host' => 'example.org', - 'path' => '/etc/php.ini', - ) - ), - array( - 'file:///etc/php.ini', - array( - 'scheme' => 'file', - 'delimiter' => '://', - 'host' => '', - 'path' => '/etc/php.ini', - ) - ), - array( - 'file:///c:/', - array( - 'scheme' => 'file', - 'delimiter' => '://', - 'host' => '', - 'path' => '/c:/', - ) - ), - array( - 'mailto:id@example.org', - array( - 'scheme' => 'mailto', - 'delimiter' => ':', - 'host' => 'id@example.org', - 'path' => '', - ) - ), - array( - 'mailto:id@example.org?subject=Foo', - array( - 'scheme' => 'mailto', - 'delimiter' => ':', - 'host' => 'id@example.org', - 'path' => '', - 'query' => 'subject=Foo', - ) - ), - array( - 'mailto:?subject=Foo', - array( - 'scheme' => 'mailto', - 'delimiter' => ':', - 'host' => '', - 'path' => '', - 'query' => 'subject=Foo', - ) - ), - array( - 'invalid://test/', - false - ), - ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php b/tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php deleted file mode 100644 index 238a2c9c..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php +++ /dev/null @@ -1,91 +0,0 @@ -assertEquals( - $outputPath, - wfRemoveDotSegments( $inputPath ), - "Testing $inputPath expands to $outputPath" - ); - } - - /** - * Provider of URL paths for testing wfRemoveDotSegments() - * - * @return array - */ - public static function providePaths() { - return array( - array( '/a/b/c/./../../g', '/a/g' ), - array( 'mid/content=5/../6', 'mid/6' ), - array( '/a//../b', '/a/b' ), - array( '/.../a', '/.../a' ), - array( '.../a', '.../a' ), - array( '', '' ), - array( '/', '/' ), - array( '//', '//' ), - array( '.', '' ), - array( '..', '' ), - array( '...', '...' ), - array( '/.', '/' ), - array( '/..', '/' ), - array( './', '' ), - array( '../', '' ), - array( './a', 'a' ), - array( '../a', 'a' ), - array( '../../a', 'a' ), - array( '.././a', 'a' ), - array( './../a', 'a' ), - array( '././a', 'a' ), - array( '../../', '' ), - array( '.././', '' ), - array( './../', '' ), - array( '././', '' ), - array( '../..', '' ), - array( '../.', '' ), - array( './..', '' ), - array( './.', '' ), - array( '/../../a', '/a' ), - array( '/.././a', '/a' ), - array( '/./../a', '/a' ), - array( '/././a', '/a' ), - array( '/../../', '/' ), - array( '/.././', '/' ), - array( '/./../', '/' ), - array( '/././', '/' ), - array( '/../..', '/' ), - array( '/../.', '/' ), - array( '/./..', '/' ), - array( '/./.', '/' ), - array( 'b/../../a', '/a' ), - array( 'b/.././a', '/a' ), - array( 'b/./../a', '/a' ), - array( 'b/././a', 'b/a' ), - array( 'b/../../', '/' ), - array( 'b/.././', '/' ), - array( 'b/./../', '/' ), - array( 'b/././', 'b/' ), - array( 'b/../..', '/' ), - array( 'b/../.', '/' ), - array( 'b/./..', '/' ), - array( 'b/./.', 'b/' ), - array( '/b/../../a', '/a' ), - array( '/b/.././a', '/a' ), - array( '/b/./../a', '/a' ), - array( '/b/././a', '/b/a' ), - array( '/b/../../', '/' ), - array( '/b/.././', '/' ), - array( '/b/./../', '/' ), - array( '/b/././', '/b/' ), - array( '/b/../..', '/' ), - array( '/b/../.', '/' ), - array( '/b/./..', '/' ), - array( '/b/./.', '/b/' ), - ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php b/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php deleted file mode 100644 index aadec87f..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfShorthandToIntegerTest.php +++ /dev/null @@ -1,30 +0,0 @@ -assertEquals( - wfShorthandToInteger( $input ), - $output, - $description - ); - } - - public static function provideABunchOfShorthands() { - return array( - array( '', -1, 'Empty string' ), - array( ' ', -1, 'String of spaces' ), - array( '1G', 1024 * 1024 * 1024, 'One gig uppercased' ), - array( '1g', 1024 * 1024 * 1024, 'One gig lowercased' ), - array( '1M', 1024 * 1024, 'One meg uppercased' ), - array( '1m', 1024 * 1024, 'One meg lowercased' ), - array( '1K', 1024, 'One kb uppercased' ), - array( '1k', 1024, 'One kb lowercased' ), - ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php b/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php deleted file mode 100644 index 5998f186..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php +++ /dev/null @@ -1,134 +0,0 @@ -assertEquals( $output, wfTimestamp( $format, $input ), $desc ); - } - - public static function provideNormalTimestamps() { - $t = gmmktime( 12, 34, 56, 1, 15, 2001 ); - - return array( - // TS_UNIX - array( $t, TS_MW, '20010115123456', 'TS_UNIX to TS_MW' ), - array( -30281104, TS_MW, '19690115123456', 'Negative TS_UNIX to TS_MW' ), - array( $t, TS_UNIX, 979562096, 'TS_UNIX to TS_UNIX' ), - array( $t, TS_DB, '2001-01-15 12:34:56', 'TS_UNIX to TS_DB' ), - - array( $t, TS_ISO_8601_BASIC, '20010115T123456Z', 'TS_ISO_8601_BASIC to TS_DB' ), - - // TS_MW - array( '20010115123456', TS_MW, '20010115123456', 'TS_MW to TS_MW' ), - array( '20010115123456', TS_UNIX, 979562096, 'TS_MW to TS_UNIX' ), - array( '20010115123456', TS_DB, '2001-01-15 12:34:56', 'TS_MW to TS_DB' ), - array( '20010115123456', TS_ISO_8601_BASIC, '20010115T123456Z', 'TS_MW to TS_ISO_8601_BASIC' ), - - // TS_DB - array( '2001-01-15 12:34:56', TS_MW, '20010115123456', 'TS_DB to TS_MW' ), - array( '2001-01-15 12:34:56', TS_UNIX, 979562096, 'TS_DB to TS_UNIX' ), - array( '2001-01-15 12:34:56', TS_DB, '2001-01-15 12:34:56', 'TS_DB to TS_DB' ), - array( '2001-01-15 12:34:56', TS_ISO_8601_BASIC, '20010115T123456Z', 'TS_DB to TS_ISO_8601_BASIC' ), - - # rfc2822 section 3.3 - array( '20010115123456', TS_RFC2822, 'Mon, 15 Jan 2001 12:34:56 GMT', 'TS_MW to TS_RFC2822' ), - array( 'Mon, 15 Jan 2001 12:34:56 GMT', TS_MW, '20010115123456', 'TS_RFC2822 to TS_MW' ), - array( ' Mon, 15 Jan 2001 12:34:56 GMT', TS_MW, '20010115123456', 'TS_RFC2822 with leading space to TS_MW' ), - array( '15 Jan 2001 12:34:56 GMT', TS_MW, '20010115123456', 'TS_RFC2822 without optional day-of-week to TS_MW' ), - - # FWS = ([*WSP CRLF] 1*WSP) / obs-FWS ; Folding white space - # obs-FWS = 1*WSP *(CRLF 1*WSP) ; Section 4.2 - array( 'Mon, 15 Jan 2001 12:34:56 GMT', TS_MW, '20010115123456', 'TS_RFC2822 to TS_MW' ), - - # WSP = SP / HTAB ; rfc2234 - array( "Mon, 15 Jan\x092001 12:34:56 GMT", TS_MW, '20010115123456', 'TS_RFC2822 with HTAB to TS_MW' ), - array( "Mon, 15 Jan\x09 \x09 2001 12:34:56 GMT", TS_MW, '20010115123456', 'TS_RFC2822 with HTAB and SP to TS_MW' ), - array( 'Sun, 6 Nov 94 08:49:37 GMT', TS_MW, '19941106084937', 'TS_RFC2822 with obsolete year to TS_MW' ), - ); - } - - /** - * This test checks wfTimestamp() with values outside. - * It needs PHP 64 bits or PHP > 5.1. - * See r74778 and bug 25451 - * @dataProvider provideOldTimestamps - */ - public function testOldTimestamps( $input, $format, $output, $desc ) { - $this->assertEquals( $output, wfTimestamp( $format, $input ), $desc ); - } - - public static function provideOldTimestamps() { - return array( - array( '19011213204554', TS_RFC2822, 'Fri, 13 Dec 1901 20:45:54 GMT', 'Earliest time according to php documentation' ), - array( '20380119031407', TS_RFC2822, 'Tue, 19 Jan 2038 03:14:07 GMT', 'Latest 32 bit time' ), - array( '19011213204552', TS_UNIX, '-2147483648', 'Earliest 32 bit unix time' ), - array( '20380119031407', TS_UNIX, '2147483647', 'Latest 32 bit unix time' ), - array( '19011213204552', TS_RFC2822, 'Fri, 13 Dec 1901 20:45:52 GMT', 'Earliest 32 bit time' ), - array( '19011213204551', TS_RFC2822, 'Fri, 13 Dec 1901 20:45:51 GMT', 'Earliest 32 bit time - 1' ), - array( '20380119031408', TS_RFC2822, 'Tue, 19 Jan 2038 03:14:08 GMT', 'Latest 32 bit time + 1' ), - array( '19011212000000', TS_MW, '19011212000000', 'Convert to itself r74778#c10645' ), - array( '19011213204551', TS_UNIX, '-2147483649', 'Earliest 32 bit unix time - 1' ), - array( '20380119031408', TS_UNIX, '2147483648', 'Latest 32 bit unix time + 1' ), - array( '-2147483649', TS_MW, '19011213204551', '1901 negative unix time to MediaWiki' ), - array( '-5331871504', TS_MW, '18010115123456', '1801 negative unix time to MediaWiki' ), - array( '0117-08-09 12:34:56', TS_RFC2822, 'Tue, 09 Aug 0117 12:34:56 GMT', 'Death of Roman Emperor [[Trajan]]' ), - - /* @todo FIXME: 00 to 101 years are taken as being in [1970-2069] */ - array( '-58979923200', TS_RFC2822, 'Sun, 01 Jan 0101 00:00:00 GMT', '1/1/101' ), - array( '-62135596800', TS_RFC2822, 'Mon, 01 Jan 0001 00:00:00 GMT', 'Year 1' ), - - /* It is not clear if we should generate a year 0 or not - * We are completely off RFC2822 requirement of year being - * 1900 or later. - */ - array( '-62142076800', TS_RFC2822, 'Wed, 18 Oct 0000 00:00:00 GMT', 'ISO 8601:2004 [[year 0]], also called [[1 BC]]' ), - ); - } - - /** - * The Resource Loader uses wfTimestamp() to convert timestamps - * from If-Modified-Since header. Thus it must be able to parse all - * rfc2616 date formats - * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 - * @dataProvider provideHttpDates - */ - public function testHttpDate( $input, $output, $desc ) { - $this->assertEquals( $output, wfTimestamp( TS_MW, $input ), $desc ); - } - - public static function provideHttpDates() { - return array( - array( 'Sun, 06 Nov 1994 08:49:37 GMT', '19941106084937', 'RFC 822 date' ), - array( 'Sunday, 06-Nov-94 08:49:37 GMT', '19941106084937', 'RFC 850 date' ), - array( 'Sun Nov 6 08:49:37 1994', '19941106084937', "ANSI C's asctime() format" ), - // See http://www.squid-cache.org/mail-archive/squid-users/200307/0122.html and r77171 - array( 'Mon, 22 Nov 2010 14:12:42 GMT; length=52626', '20101122141242', 'Netscape extension to HTTP/1.0' ), - ); - } - - /** - * There are a number of assumptions in our codebase where wfTimestamp() - * should give the current date but it is not given a 0 there. See r71751 CR - */ - public function testTimestampParameter() { - $now = wfTimestamp( TS_UNIX ); - // We check that wfTimestamp doesn't return false (error) and use a LessThan assert - // for the cases where the test is run in a second boundary. - - $zero = wfTimestamp( TS_UNIX, 0 ); - $this->assertNotEquals( false, $zero ); - $this->assertLessThan( 5, $zero - $now ); - - $empty = wfTimestamp( TS_UNIX, '' ); - $this->assertNotEquals( false, $empty ); - $this->assertLessThan( 5, $empty - $now ); - - $null = wfTimestamp( TS_UNIX, null ); - $this->assertNotEquals( false, $null ); - $this->assertLessThan( 5, $null - $now ); - } -} diff --git a/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php b/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php deleted file mode 100644 index ce6c82c5..00000000 --- a/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php +++ /dev/null @@ -1,119 +0,0 @@ -verifyEncodingFor( 'Apache', $input, $expected ); - } - - /** - * @dataProvider provideURLS - */ - public function testEncodingUrlWithMicrosoftIis7( $input, $expected ) { - $this->verifyEncodingFor( 'Microsoft-IIS/7', $input, $expected ); - } - - #### HELPERS ############################################################# - - /** - * Internal helper that actually run the test. - * Called by the public methods testEncodingUrlWith...() - * - */ - private function verifyEncodingFor( $server, $input, $expectations ) { - $expected = $this->extractExpect( $server, $expectations ); - - // save up global - $old = isset( $_SERVER['SERVER_SOFTWARE'] ) - ? $_SERVER['SERVER_SOFTWARE'] - : null; - $_SERVER['SERVER_SOFTWARE'] = $server; - wfUrlencode( null ); - - // do the requested test - $this->assertEquals( - $expected, - wfUrlencode( $input ), - "Encoding '$input' for server '$server' should be '$expected'" - ); - - // restore global - if ( $old === null ) { - unset( $_SERVER['SERVER_SOFTWARE'] ); - } else { - $_SERVER['SERVER_SOFTWARE'] = $old; - } - wfUrlencode( null ); - } - - /** - * Interprets the provider array. Return expected value depending - * the HTTP server name. - */ - private function extractExpect( $server, $expectations ) { - if ( is_string( $expectations ) ) { - return $expectations; - } elseif ( is_array( $expectations ) ) { - if ( !array_key_exists( $server, $expectations ) ) { - throw new MWException( __METHOD__ . " expectation does not have any value for server name $server. Check the provider array.\n" ); - } else { - return $expectations[$server]; - } - } else { - throw new MWException( __METHOD__ . " given invalid expectation for '$server'. Should be a string or an array( => ).\n" ); - } - } - - #### PROVIDERS ########################################################### - - /** - * Format is either: - * array( 'input', 'expected' ); - * Or: - * array( 'input', - * array( 'Apache', 'expected' ), - * array( 'Microsoft-IIS/7', 'expected' ), - * ), - * If you want to add other HTTP server name, you will have to add a new - * testing method much like the testEncodingUrlWith() method above. - */ - public static function provideURLS() { - return array( - ### RFC 1738 chars - // + is not safe - array( '+', '%2B' ), - // & and = not safe in queries - array( '&', '%26' ), - array( '=', '%3D' ), - - array( ':', array( - 'Apache' => ':', - 'Microsoft-IIS/7' => '%3A', - ) ), - - // remaining chars do not need encoding - array( - ';@$-_.!*', - ';@$-_.!*', - ), - - ### Other tests - // slash remain unchanged. %2F seems to break things - array( '/', '/' ), - - // Other 'funnies' chars - array( '[]', '%5B%5D' ), - array( '<>', '%3C%3E' ), - - // Apostrophe is encoded - array( '\'', '%27' ), - ); - } -} diff --git a/tests/phpunit/includes/HTMLCheckMatrixTest.php b/tests/phpunit/includes/HTMLCheckMatrixTest.php deleted file mode 100644 index 5bbafd37..00000000 --- a/tests/phpunit/includes/HTMLCheckMatrixTest.php +++ /dev/null @@ -1,102 +0,0 @@ - array( 'r1', 'r2' ), - 'columns' => array( 'c1', 'c2' ), - 'fieldname' => 'test', - ); - - public function testPlainInstantiation() { - try { - $form = new HTMLCheckMatrix( array() ); - } catch ( MWException $e ) { - $this->assertInstanceOf( 'HTMLFormFieldRequiredOptionsException', $e ); - return; - } - - $this->fail( 'Expected MWException indicating missing parameters but none was thrown.' ); - } - - public function testInstantiationWithMinimumRequiredParameters() { - $form = new HTMLCheckMatrix( self::$defaultOptions ); - $this->assertTrue( true ); // form instantiation must throw exception on failure - } - - public function testValidateCallsUserDefinedValidationCallback() { - $called = false; - $field = new HTMLCheckMatrix( self::$defaultOptions + array( - 'validation-callback' => function() use ( &$called ) { - $called = true; - return false; - }, - ) ); - $this->assertEquals( false, $this->validate( $field, array() ) ); - $this->assertTrue( $called ); - } - - public function testValidateRequiresArrayInput() { - $field = new HTMLCheckMatrix( self::$defaultOptions ); - $this->assertEquals( false, $this->validate( $field, null ) ); - $this->assertEquals( false, $this->validate( $field, true ) ); - $this->assertEquals( false, $this->validate( $field, 'abc' ) ); - $this->assertEquals( false, $this->validate( $field, new stdClass ) ); - $this->assertEquals( true, $this->validate( $field, array() ) ); - } - - public function testValidateAllowsOnlyKnownTags() { - $field = new HTMLCheckMatrix( self::$defaultOptions ); - $this->assertInternalType( 'string', $this->validate( $field, array( 'foo' ) ) ); - } - - public function testValidateAcceptsPartialTagList() { - $field = new HTMLCheckMatrix( self::$defaultOptions ); - $this->assertTrue( $this->validate( $field, array() ) ); - $this->assertTrue( $this->validate( $field, array( 'c1-r1' ) ) ); - $this->assertTrue( $this->validate( $field, array( 'c1-r1', 'c1-r2', 'c2-r1', 'c2-r2' ) ) ); - } - - /** - * This form object actually has no visibility into what happens later on, but essentially - * if the data submitted by the user passes validate the following is run: - * foreach ( $field->filterDataForSubmit( $data ) as $k => $v ) { - * $user->setOption( $k, $v ); - * } - */ - public function testValuesForcedOnRemainOn() { - $field = new HTMLCheckMatrix( self::$defaultOptions + array( - 'force-options-on' => array( 'c2-r1' ), - ) ); - $expected = array( - 'c1-r1' => false, - 'c1-r2' => false, - 'c2-r1' => true, - 'c2-r2' => false, - ); - $this->assertEquals( $expected, $field->filterDataForSubmit( array() ) ); - } - - public function testValuesForcedOffRemainOff() { - $field = new HTMLCheckMatrix( self::$defaultOptions + array( - 'force-options-off' => array( 'c1-r2', 'c2-r2' ), - ) ); - $expected = array( - 'c1-r1' => true, - 'c1-r2' => false, - 'c2-r1' => true, - 'c2-r2' => false, - ); - // array_keys on the result simulates submitting all fields checked - $this->assertEquals( $expected, $field->filterDataForSubmit( array_keys( $expected ) ) ); - } - - protected function validate( HTMLFormField $field, $submitted ) { - return $field->validate( - $submitted, - array( self::$defaultOptions['fieldname'] => $submitted ) - ); - } -} diff --git a/tests/phpunit/includes/HashRingTest.php b/tests/phpunit/includes/HashRingTest.php deleted file mode 100644 index 65f13696..00000000 --- a/tests/phpunit/includes/HashRingTest.php +++ /dev/null @@ -1,53 +0,0 @@ - 1, 's2' => 1, 's3' => 2, 's4' => 2, 's5' => 2, 's6' => 3 ) ); - - $locations = array(); - for ( $i = 0; $i < 20; $i++ ) { - $locations[ "hello$i"] = $ring->getLocation( "hello$i" ); - } - $expectedLocations = array( - "hello0" => "s5", - "hello1" => "s6", - "hello2" => "s2", - "hello3" => "s5", - "hello4" => "s6", - "hello5" => "s4", - "hello6" => "s5", - "hello7" => "s4", - "hello8" => "s5", - "hello9" => "s5", - "hello10" => "s3", - "hello11" => "s6", - "hello12" => "s1", - "hello13" => "s3", - "hello14" => "s3", - "hello15" => "s5", - "hello16" => "s4", - "hello17" => "s6", - "hello18" => "s6", - "hello19" => "s3" - ); - - $this->assertEquals( $expectedLocations, $locations, 'Items placed at proper locations' ); - - $locations = array(); - for ( $i = 0; $i < 5; $i++ ) { - $locations[ "hello$i"] = $ring->getLocations( "hello$i", 2 ); - } - - $expectedLocations = array( - "hello0" => array( "s5", "s6" ), - "hello1" => array( "s6", "s4" ), - "hello2" => array( "s2", "s1" ), - "hello3" => array( "s5", "s6" ), - "hello4" => array( "s6", "s4" ), - ); - $this->assertEquals( $expectedLocations, $locations, 'Items placed at proper locations' ); - } -} diff --git a/tests/phpunit/includes/HooksTest.php b/tests/phpunit/includes/HooksTest.php deleted file mode 100644 index 81dd4870..00000000 --- a/tests/phpunit/includes/HooksTest.php +++ /dev/null @@ -1,158 +0,0 @@ -assertSame( $expectedFoo, $foo, $msg ); - $this->assertSame( $expectedBar, $bar, $msg ); - } - - /** - * @dataProvider provideHooks - */ - public function testNewStyleHooks( $msg, $hook, $expectedFoo, $expectedBar ) { - $foo = $bar = 'original'; - - Hooks::register( 'MediaWikiHooksTest001', $hook ); - Hooks::run( 'MediaWikiHooksTest001', array( &$foo, &$bar ) ); - - $this->assertSame( $expectedFoo, $foo, $msg ); - $this->assertSame( $expectedBar, $bar, $msg ); - } - - public function testNewStyleHookInteraction() { - global $wgHooks; - - $a = new NothingClass(); - $b = new NothingClass(); - - $wgHooks['MediaWikiHooksTest001'][] = $a; - $this->assertTrue( Hooks::isRegistered( 'MediaWikiHooksTest001' ), 'Hook registered via $wgHooks should be noticed by Hooks::isRegistered' ); - - Hooks::register( 'MediaWikiHooksTest001', $b ); - $this->assertEquals( 2, count( Hooks::getHandlers( 'MediaWikiHooksTest001' ) ), 'Hooks::getHandlers() should return hooks registered via wgHooks as well as Hooks::register' ); - - $foo = 'quux'; - $bar = 'qaax'; - - Hooks::run( 'MediaWikiHooksTest001', array( &$foo, &$bar ) ); - $this->assertEquals( 1, $a->calls, 'Hooks::run() should run hooks registered via wgHooks as well as Hooks::register' ); - $this->assertEquals( 1, $b->calls, 'Hooks::run() should run hooks registered via wgHooks as well as Hooks::register' ); - } - - /** - * @expectedException MWException - */ - public function testUncallableFunction() { - Hooks::register( 'MediaWikiHooksTest001', 'ThisFunctionDoesntExist' ); - Hooks::run( 'MediaWikiHooksTest001', array() ); - } - - public function testFalseReturn() { - Hooks::register( 'MediaWikiHooksTest001', function ( &$foo ) { - return false; - } ); - Hooks::register( 'MediaWikiHooksTest001', function ( &$foo ) { - $foo = 'test'; - - return true; - } ); - $foo = 'original'; - Hooks::run( 'MediaWikiHooksTest001', array( &$foo ) ); - $this->assertSame( 'original', $foo, 'Hooks continued processing after a false return.' ); - } - - /** - * @expectedException FatalError - */ - public function testFatalError() { - Hooks::register( 'MediaWikiHooksTest001', function () { - return 'test'; - } ); - Hooks::run( 'MediaWikiHooksTest001', array() ); - } -} - -function NothingFunction( &$foo, &$bar ) { - $foo = 'changed-func'; - - return true; -} - -function NothingFunctionData( $data, &$foo, &$bar ) { - $foo = $data; - - return true; -} - -class NothingClass { - public $calls = 0; - - public static function someStatic( &$foo, &$bar ) { - $foo = 'changed-static'; - - return true; - } - - public function someNonStatic( &$foo, &$bar ) { - $this->calls++; - $foo = 'changed-nonstatic'; - $bar = 'changed-nonstatic'; - - return true; - } - - public function onMediaWikiHooksTest001( &$foo, &$bar ) { - $this->calls++; - $foo = 'changed-onevent'; - - return true; - } - - public function someNonStaticWithData( $data, &$foo, &$bar ) { - $this->calls++; - $foo = $data; - - return true; - } -} diff --git a/tests/phpunit/includes/HtmlFormatterTest.php b/tests/phpunit/includes/HtmlFormatterTest.php deleted file mode 100644 index a37df74f..00000000 --- a/tests/phpunit/includes/HtmlFormatterTest.php +++ /dev/null @@ -1,81 +0,0 @@ -filterContent(); - $html = $formatter->getText(); - $this->assertEquals( self::normalize( $expected ), self::normalize( $html ) ); - } - - private static function normalize( $s ) { - return str_replace( "\n", '', - str_replace( "\r", '', $s ) // "yay" to Windows! - ); - } - - public function getHtmlData() { - $removeImages = function( HtmlFormatter $f ) { - $f->setRemoveMedia(); - }; - $removeTags = function( HtmlFormatter $f ) { - $f->remove( array( 'table', '.foo', '#bar', 'div.baz' ) ); - }; - $flattenSomeStuff = function( HtmlFormatter $f ) { - $f->flatten( array( 's', 'div' ) ); - }; - $flattenEverything = function( HtmlFormatter $f ) { - $f->flattenAllTags(); - }; - return array( - // remove images if asked - array( - 'Blah', - '', - $removeImages, - ), - // basic tag removal - array( - '
            foo
            foo
            foo
            bar -foobar
            test
            -baz', - - '
            test
            -baz', - $removeTags, - ), - // don't flatten tags that start like chosen ones - array( - '
            foo bar
            ', - 'foo bar', - $flattenSomeStuff, - ), - // total flattening - array( - '
            bar2
            ', - 'bar2', - $flattenEverything, - ), - // UTF-8 preservation and security - array( - '<Тест!> &<&&&&', - '<Тест!> &<&&&&', - ), - // https://bugzilla.wikimedia.org/show_bug.cgi?id=53086 - array( - 'Foo[1] Bar', - 'Foo[1] Bar', - ), - ); - } -} diff --git a/tests/phpunit/includes/HtmlTest.php b/tests/phpunit/includes/HtmlTest.php deleted file mode 100644 index 1c62d032..00000000 --- a/tests/phpunit/includes/HtmlTest.php +++ /dev/null @@ -1,631 +0,0 @@ -setNamespaces( array( - -2 => 'Media', - -1 => 'Special', - 0 => '', - 1 => 'Talk', - 2 => 'User', - 3 => 'User_talk', - 4 => 'MyWiki', - 5 => 'MyWiki_Talk', - 6 => 'File', - 7 => 'File_talk', - 8 => 'MediaWiki', - 9 => 'MediaWiki_talk', - 10 => 'Template', - 11 => 'Template_talk', - 14 => 'Category', - 15 => 'Category_talk', - 100 => 'Custom', - 101 => 'Custom_talk', - ) ); - - $this->setMwGlobals( array( - 'wgLanguageCode' => $langCode, - 'wgContLang' => $langObj, - 'wgLang' => $langObj, - 'wgWellFormedXml' => false, - ) ); - } - - public function testElementBasics() { - $this->assertEquals( - '', - Html::element( 'img', null, '' ), - 'No close tag for short-tag elements' - ); - - $this->assertEquals( - '', - Html::element( 'element', null, null ), - 'Close tag for empty element (null, null)' - ); - - $this->assertEquals( - '', - Html::element( 'element', array(), '' ), - 'Close tag for empty element (array, string)' - ); - - $this->setMwGlobals( 'wgWellFormedXml', true ); - - $this->assertEquals( - '', - Html::element( 'img', null, '' ), - 'Self-closing tag for short-tag elements (wgWellFormedXml = true)' - ); - } - - public function dataXmlMimeType() { - return array( - // ( $mimetype, $isXmlMimeType ) - # HTML is not an XML MimeType - array( 'text/html', false ), - # XML is an XML MimeType - array( 'text/xml', true ), - array( 'application/xml', true ), - # XHTML is an XML MimeType - array( 'application/xhtml+xml', true ), - # Make sure other +xml MimeTypes are supported - # SVG is another random MimeType even though we don't use it - array( 'image/svg+xml', true ), - # Complete random other MimeTypes are not XML - array( 'text/plain', false ), - ); - } - - /** - * @dataProvider dataXmlMimeType - */ - public function testXmlMimeType( $mimetype, $isXmlMimeType ) { - $this->assertEquals( $isXmlMimeType, Html::isXmlMimeType( $mimetype ) ); - } - - public function testExpandAttributesSkipsNullAndFalse() { - - ### EMPTY ######## - $this->assertEmpty( - Html::expandAttributes( array( 'foo' => null ) ), - 'skip keys with null value' - ); - $this->assertEmpty( - Html::expandAttributes( array( 'foo' => false ) ), - 'skip keys with false value' - ); - $this->assertNotEmpty( - Html::expandAttributes( array( 'foo' => '' ) ), - 'keep keys with an empty string' - ); - } - - public function testExpandAttributesForBooleans() { - $this->assertEquals( - '', - Html::expandAttributes( array( 'selected' => false ) ), - 'Boolean attributes do not generates output when value is false' - ); - $this->assertEquals( - '', - Html::expandAttributes( array( 'selected' => null ) ), - 'Boolean attributes do not generates output when value is null' - ); - - $this->assertEquals( - ' selected', - Html::expandAttributes( array( 'selected' => true ) ), - 'Boolean attributes have no value when value is true' - ); - $this->assertEquals( - ' selected', - Html::expandAttributes( array( 'selected' ) ), - 'Boolean attributes have no value when value is true (passed as numerical array)' - ); - - $this->setMwGlobals( 'wgWellFormedXml', true ); - - $this->assertEquals( - ' selected=""', - Html::expandAttributes( array( 'selected' => true ) ), - 'Boolean attributes have empty string value when value is true (wgWellFormedXml)' - ); - } - - /** - * Test for Html::expandAttributes() - * Please note it output a string prefixed with a space! - */ - public function testExpandAttributesVariousExpansions() { - ### NOT EMPTY #### - $this->assertEquals( - ' empty_string=""', - Html::expandAttributes( array( 'empty_string' => '' ) ), - 'Empty string is always quoted' - ); - $this->assertEquals( - ' key=value', - Html::expandAttributes( array( 'key' => 'value' ) ), - 'Simple string value needs no quotes' - ); - $this->assertEquals( - ' one=1', - Html::expandAttributes( array( 'one' => 1 ) ), - 'Number 1 value needs no quotes' - ); - $this->assertEquals( - ' zero=0', - Html::expandAttributes( array( 'zero' => 0 ) ), - 'Number 0 value needs no quotes' - ); - - $this->setMwGlobals( 'wgWellFormedXml', true ); - - $this->assertEquals( - ' empty_string=""', - Html::expandAttributes( array( 'empty_string' => '' ) ), - 'Attribute values are always quoted (wgWellFormedXml): Empty string' - ); - $this->assertEquals( - ' key="value"', - Html::expandAttributes( array( 'key' => 'value' ) ), - 'Attribute values are always quoted (wgWellFormedXml): Simple string' - ); - $this->assertEquals( - ' one="1"', - Html::expandAttributes( array( 'one' => 1 ) ), - 'Attribute values are always quoted (wgWellFormedXml): Number 1' - ); - $this->assertEquals( - ' zero="0"', - Html::expandAttributes( array( 'zero' => 0 ) ), - 'Attribute values are always quoted (wgWellFormedXml): Number 0' - ); - } - - /** - * Html::expandAttributes has special features for HTML - * attributes that use space separated lists and also - * allows arrays to be used as values. - */ - public function testExpandAttributesListValueAttributes() { - ### STRING VALUES - $this->assertEquals( - ' class="redundant spaces here"', - Html::expandAttributes( array( 'class' => ' redundant spaces here ' ) ), - 'Normalization should strip redundant spaces' - ); - $this->assertEquals( - ' class="foo bar"', - Html::expandAttributes( array( 'class' => 'foo bar foo bar bar' ) ), - 'Normalization should remove duplicates in string-lists' - ); - ### "EMPTY" ARRAY VALUES - $this->assertEquals( - ' class=""', - Html::expandAttributes( array( 'class' => array() ) ), - 'Value with an empty array' - ); - $this->assertEquals( - ' class=""', - Html::expandAttributes( array( 'class' => array( null, '', ' ', ' ' ) ) ), - 'Array with null, empty string and spaces' - ); - ### NON-EMPTY ARRAY VALUES - $this->assertEquals( - ' class="foo bar"', - Html::expandAttributes( array( 'class' => array( - 'foo', - 'bar', - 'foo', - 'bar', - 'bar', - ) ) ), - 'Normalization should remove duplicates in the array' - ); - $this->assertEquals( - ' class="foo bar"', - Html::expandAttributes( array( 'class' => array( - 'foo bar', - 'bar foo', - 'foo', - 'bar bar', - ) ) ), - 'Normalization should remove duplicates in string-lists in the array' - ); - } - - /** - * Test feature added by r96188, let pass attributes values as - * a PHP array. Restricted to class,rel, accesskey. - */ - public function testExpandAttributesSpaceSeparatedAttributesWithBoolean() { - $this->assertEquals( - ' class="booltrue one"', - Html::expandAttributes( array( 'class' => array( - 'booltrue' => true, - 'one' => 1, - - # Method use isset() internally, make sure we do discard - # attributes values which have been assigned well known values - 'emptystring' => '', - 'boolfalse' => false, - 'zero' => 0, - 'null' => null, - ) ) ) - ); - } - - /** - * How do we handle duplicate keys in HTML attributes expansion? - * We could pass a "class" the values: 'GREEN' and array( 'GREEN' => false ) - * The later will take precedence. - * - * Feature added by r96188 - */ - public function testValueIsAuthoritativeInSpaceSeparatedAttributesArrays() { - $this->assertEquals( - ' class=""', - Html::expandAttributes( array( 'class' => array( - 'GREEN', - 'GREEN' => false, - 'GREEN', - ) ) ) - ); - } - - public function testNamespaceSelector() { - $this->assertEquals( - '', - Html::namespaceSelector(), - 'Basic namespace selector without custom options' - ); - - $this->assertEquals( - ' ' . - '', - Html::namespaceSelector( - array( 'selected' => '2', 'all' => 'all', 'label' => 'Select a namespace:' ), - array( 'name' => 'wpNamespace', 'id' => 'mw-test-namespace' ) - ), - 'Basic namespace selector with custom values' - ); - - $this->assertEquals( - ' ' . - '', - Html::namespaceSelector( - array( 'label' => 'Select a namespace:' ) - ), - 'Basic namespace selector with a custom label but no id attribtue for the ' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '', - Html::namespaceSelector( - array( 'exclude' => array( 0, 1, 3, 100, 101 ) ) - ), - 'Namespace selector namespace filtering.' - ); - } - - public function testCanDisableANamespaces() { - $this->assertEquals( - '', - Html::namespaceSelector( array( - 'disable' => array( 0, 1, 2, 3, 4 ) - ) ), - 'Namespace selector namespace disabling' - ); - } - - /** - * @dataProvider provideHtml5InputTypes - */ - public function testHtmlElementAcceptsNewHtml5TypesInHtml5Mode( $HTML5InputType ) { - $this->assertEquals( - '', - Html::element( 'input', array( 'type' => $HTML5InputType ) ), - 'In HTML5, HTML::element() should accept type="' . $HTML5InputType . '"' - ); - } - - /** - * List of input element types values introduced by HTML5 - * Full list at http://www.w3.org/TR/html-markup/input.html - */ - public static function provideHtml5InputTypes() { - $types = array( - 'datetime', - 'datetime-local', - 'date', - 'month', - 'time', - 'week', - 'number', - 'range', - 'email', - 'url', - 'search', - 'tel', - 'color', - ); - $cases = array(); - foreach ( $types as $type ) { - $cases[] = array( $type ); - } - - return $cases; - } - - /** - * Test out Html::element drops or enforces default value - * @covers Html::dropDefaults - * @dataProvider provideElementsWithAttributesHavingDefaultValues - */ - public function testDropDefaults( $expected, $element, $attribs, $message = '' ) { - $this->assertEquals( $expected, Html::element( $element, $attribs ), $message ); - } - - public static function provideElementsWithAttributesHavingDefaultValues() { - # Use cases in a concise format: - # , , [, ] - # Will be mapped to Html::element() - $cases = array(); - - ### Generic cases, match $attribDefault static array - $cases[] = array( '', - 'area', array( 'shape' => 'rect' ) - ); - - $cases[] = array( '', - 'button', array( 'formaction' => 'GET' ) - ); - $cases[] = array( '', - 'button', array( 'formenctype' => 'application/x-www-form-urlencoded' ) - ); - - $cases[] = array( '', - 'canvas', array( 'height' => '150' ) - ); - $cases[] = array( '', - 'canvas', array( 'width' => '300' ) - ); - # Also check with numeric values - $cases[] = array( '', - 'canvas', array( 'height' => 150 ) - ); - $cases[] = array( '', - 'canvas', array( 'width' => 300 ) - ); - - $cases[] = array( '', - 'command', array( 'type' => 'command' ) - ); - - $cases[] = array( '
            ', - 'form', array( 'action' => 'GET' ) - ); - $cases[] = array( '
            ', - 'form', array( 'autocomplete' => 'on' ) - ); - $cases[] = array( '
            ', - 'form', array( 'enctype' => 'application/x-www-form-urlencoded' ) - ); - - $cases[] = array( '', - 'input', array( 'formaction' => 'GET' ) - ); - $cases[] = array( '', - 'input', array( 'type' => 'text' ) - ); - - $cases[] = array( '', - 'keygen', array( 'keytype' => 'rsa' ) - ); - - $cases[] = array( '', - 'link', array( 'media' => 'all' ) - ); - - $cases[] = array( '', - 'menu', array( 'type' => 'list' ) - ); - - $cases[] = array( '', - 'script', array( 'type' => 'text/javascript' ) - ); - - $cases[] = array( '', - 'style', array( 'media' => 'all' ) - ); - $cases[] = array( '', - 'style', array( 'type' => 'text/css' ) - ); - - $cases[] = array( '', - 'textarea', array( 'wrap' => 'soft' ) - ); - - ### SPECIFIC CASES - - # - $cases[] = array( '', - 'link', array( 'type' => 'text/css' ) - ); - - # specific handling - $cases[] = array( '', - 'input', array( 'type' => 'checkbox', 'value' => 'on' ), - 'Default value "on" is stripped of checkboxes', - ); - $cases[] = array( '', - 'input', array( 'type' => 'radio', 'value' => 'on' ), - 'Default value "on" is stripped of radio buttons', - ); - $cases[] = array( '', - 'input', array( 'type' => 'submit', 'value' => 'Submit' ), - 'Default value "Submit" is kept on submit buttons (for possible l10n issues)', - ); - $cases[] = array( '', - 'input', array( 'type' => 'color', 'value' => '' ), - ); - $cases[] = array( '', - 'input', array( 'type' => 'range', 'value' => '' ), - ); - - # ', - 'button', array( 'type' => 'submit' ), - 'According to standard the default type is "submit". Depending on compatibility mode IE might use "button", instead.', - ); - - # ', - 'select', array( 'size' => '4', 'multiple' => true ), - ); - # .. with numeric value - $cases[] = array( '', - 'select', array( 'size' => 4, 'multiple' => true ), - ); - $cases[] = array( '', - 'select', array( 'size' => '1', 'multiple' => false ), - ); - # .. with numeric value - $cases[] = array( '', - 'select', array( 'size' => 1, 'multiple' => false ), - ); - - # Passing an array as value - $cases[] = array( '', - 'a', array( 'class' => array( 'css-class-one', 'css-class-two' ) ), - "dropDefaults accepts values given as an array" - ); - - # FIXME: doDropDefault should remove defaults given in an array - # Expected should be '' - $cases[] = array( '', - 'a', array( 'class' => array( '', '' ) ), - "dropDefaults accepts values given as an array" - ); - - # Craft the Html elements - $ret = array(); - foreach ( $cases as $case ) { - $ret[] = array( - $case[0], - $case[1], $case[2], - isset( $case[3] ) ? $case[3] : '' - ); - } - - return $ret; - } - - public function testFormValidationBlacklist() { - $this->assertEmpty( - Html::expandAttributes( array( 'min' => 1, 'max' => 100, 'pattern' => 'abc', 'required' => true, 'step' => 2 ) ), - 'Blacklist form validation attributes.' - ); - $this->assertEquals( - ' step=any', - Html::expandAttributes( array( 'min' => 1, 'max' => 100, 'pattern' => 'abc', 'required' => true, 'step' => 'any' ) ), - 'Allow special case "step=any".' - ); - } -} diff --git a/tests/phpunit/includes/HttpTest.php b/tests/phpunit/includes/HttpTest.php deleted file mode 100644 index 11d8ed60..00000000 --- a/tests/phpunit/includes/HttpTest.php +++ /dev/null @@ -1,216 +0,0 @@ -assertEquals( $expected, $ok, $msg ); - } - - public static function cookieDomains() { - return array( - array( false, "org" ), - array( false, ".org" ), - array( true, "wikipedia.org" ), - array( true, ".wikipedia.org" ), - array( false, "co.uk" ), - array( false, ".co.uk" ), - array( false, "gov.uk" ), - array( false, ".gov.uk" ), - array( true, "supermarket.uk" ), - array( false, "uk" ), - array( false, ".uk" ), - array( false, "127.0.0." ), - array( false, "127." ), - array( false, "127.0.0.1." ), - array( true, "127.0.0.1" ), - array( false, "333.0.0.1" ), - array( true, "example.com" ), - array( false, "example.com." ), - array( true, ".example.com" ), - - array( true, ".example.com", "www.example.com" ), - array( false, "example.com", "www.example.com" ), - array( true, "127.0.0.1", "127.0.0.1" ), - array( false, "127.0.0.1", "localhost" ), - ); - } - - /** - * Test Http::isValidURI() - * @bug 27854 : Http::isValidURI is too lax - * @dataProvider provideURI - * @covers Http::isValidURI - */ - public function testIsValidUri( $expect, $URI, $message = '' ) { - $this->assertEquals( - $expect, - (bool)Http::isValidURI( $URI ), - $message - ); - } - - /** - * Feeds URI to test a long regular expression in Http::isValidURI - */ - public static function provideURI() { - /** Format: 'boolean expectation', 'URI to test', 'Optional message' */ - return array( - array( false, '¿non sens before!! http://a', 'Allow anything before URI' ), - - # (http|https) - only two schemes allowed - array( true, 'http://www.example.org/' ), - array( true, 'https://www.example.org/' ), - array( true, 'http://www.example.org', 'URI without directory' ), - array( true, 'http://a', 'Short name' ), - array( true, 'http://étoile', 'Allow UTF-8 in hostname' ), # 'étoile' is french for 'star' - array( false, '\\host\directory', 'CIFS share' ), - array( false, 'gopher://host/dir', 'Reject gopher scheme' ), - array( false, 'telnet://host', 'Reject telnet scheme' ), - - # :\/\/ - double slashes - array( false, 'http//example.org', 'Reject missing colon in protocol' ), - array( false, 'http:/example.org', 'Reject missing slash in protocol' ), - array( false, 'http:example.org', 'Must have two slashes' ), - # Following fail since hostname can be made of anything - array( false, 'http:///example.org', 'Must have exactly two slashes, not three' ), - - # (\w+:{0,1}\w*@)? - optional user:pass - array( true, 'http://user@host', 'Username provided' ), - array( true, 'http://user:@host', 'Username provided, no password' ), - array( true, 'http://user:pass@host', 'Username and password provided' ), - - # (\S+) - host part is made of anything not whitespaces - array( false, 'http://!"èèè¿¿¿~~\'', 'hostname is made of any non whitespace' ), - array( false, 'http://exam:ple.org/', 'hostname can not use colons!' ), - - # (:[0-9]+)? - port number - array( true, 'http://example.org:80/' ), - array( true, 'https://example.org:80/' ), - array( true, 'http://example.org:443/' ), - array( true, 'https://example.org:443/' ), - - # Part after the hostname is / or / with something else - array( true, 'http://example/#' ), - array( true, 'http://example/!' ), - array( true, 'http://example/:' ), - array( true, 'http://example/.' ), - array( true, 'http://example/?' ), - array( true, 'http://example/+' ), - array( true, 'http://example/=' ), - array( true, 'http://example/&' ), - array( true, 'http://example/%' ), - array( true, 'http://example/@' ), - array( true, 'http://example/-' ), - array( true, 'http://example//' ), - array( true, 'http://example/&' ), - - # Fragment - array( true, 'http://exam#ple.org', ), # This one is valid, really! - array( true, 'http://example.org:80#anchor' ), - array( true, 'http://example.org/?id#anchor' ), - array( true, 'http://example.org/?#anchor' ), - - array( false, 'http://a ¿non !!sens after', 'Allow anything after URI' ), - ); - } - - /** - * Warning: - * - * These tests are for code that makes use of an artifact of how CURL - * handles header reporting on redirect pages, and will need to be - * rewritten when bug 29232 is taken care of (high-level handling of - * HTTP redirects). - */ - public function testRelativeRedirections() { - $h = MWHttpRequestTester::factory( 'http://oldsite/file.ext' ); - - # Forge a Location header - $h->setRespHeaders( 'location', array( - 'http://newsite/file.ext', - '/newfile.ext', - ) - ); - # Verify we correctly fix the Location - $this->assertEquals( - 'http://newsite/newfile.ext', - $h->getFinalUrl(), - "Relative file path Location: interpreted as full URL" - ); - - $h->setRespHeaders( 'location', array( - 'https://oldsite/file.ext' - ) - ); - $this->assertEquals( - 'https://oldsite/file.ext', - $h->getFinalUrl(), - "Location to the HTTPS version of the site" - ); - - $h->setRespHeaders( 'location', array( - '/anotherfile.ext', - 'http://anotherfile/hoster.ext', - 'https://anotherfile/hoster.ext' - ) - ); - $this->assertEquals( - 'https://anotherfile/hoster.ext', - $h->getFinalUrl( "Relative file path Location: should keep the latest host and scheme!" ) - ); - } -} - -/** - * Class to let us overwrite MWHttpRequest respHeaders variable - */ -class MWHttpRequestTester extends MWHttpRequest { - - // function derived from the MWHttpRequest factory function but - // returns appropriate tester class here - public static function factory( $url, $options = null ) { - if ( !Http::$httpEngine ) { - Http::$httpEngine = function_exists( 'curl_init' ) ? 'curl' : 'php'; - } elseif ( Http::$httpEngine == 'curl' && !function_exists( 'curl_init' ) ) { - throw new MWException( __METHOD__ . ': curl (http://php.net/curl) is not installed, but' . - 'Http::$httpEngine is set to "curl"' ); - } - - switch ( Http::$httpEngine ) { - case 'curl': - return new CurlHttpRequestTester( $url, $options ); - case 'php': - if ( !wfIniGetBool( 'allow_url_fopen' ) ) { - throw new MWException( __METHOD__ . ': allow_url_fopen needs to be enabled for pure PHP' . - ' http requests to work. If possible, curl should be used instead. See http://php.net/curl.' ); - } - - return new PhpHttpRequestTester( $url, $options ); - default: - } - } -} - -class CurlHttpRequestTester extends CurlHttpRequest { - function setRespHeaders( $name, $value ) { - $this->respHeaders[$name] = $value; - } -} - -class PhpHttpRequestTester extends PhpHttpRequest { - function setRespHeaders( $name, $value ) { - $this->respHeaders[$name] = $value; - } -} diff --git a/tests/phpunit/includes/IPTest.php b/tests/phpunit/includes/IPTest.php deleted file mode 100644 index c074eea6..00000000 --- a/tests/phpunit/includes/IPTest.php +++ /dev/null @@ -1,595 +0,0 @@ -assertFalse( IP::isIPAddress( false ), 'Boolean false is not an IP' ); - $this->assertFalse( IP::isIPAddress( true ), 'Boolean true is not an IP' ); - $this->assertFalse( IP::isIPAddress( "" ), 'Empty string is not an IP' ); - $this->assertFalse( IP::isIPAddress( 'abc' ), 'Garbage IP string' ); - $this->assertFalse( IP::isIPAddress( ':' ), 'Single ":" is not an IP' ); - $this->assertFalse( IP::isIPAddress( '2001:0DB8::A:1::1' ), 'IPv6 with a double :: occurrence' ); - $this->assertFalse( IP::isIPAddress( '2001:0DB8::A:1::' ), 'IPv6 with a double :: occurrence, last at end' ); - $this->assertFalse( IP::isIPAddress( '::2001:0DB8::5:1' ), 'IPv6 with a double :: occurrence, firt at beginning' ); - $this->assertFalse( IP::isIPAddress( '124.24.52' ), 'IPv4 not enough quads' ); - $this->assertFalse( IP::isIPAddress( '24.324.52.13' ), 'IPv4 out of range' ); - $this->assertFalse( IP::isIPAddress( '.24.52.13' ), 'IPv4 starts with period' ); - $this->assertFalse( IP::isIPAddress( 'fc:100:300' ), 'IPv6 with only 3 words' ); - - $this->assertTrue( IP::isIPAddress( '::' ), 'RFC 4291 IPv6 Unspecified Address' ); - $this->assertTrue( IP::isIPAddress( '::1' ), 'RFC 4291 IPv6 Loopback Address' ); - $this->assertTrue( IP::isIPAddress( '74.24.52.13/20', 'IPv4 range' ) ); - $this->assertTrue( IP::isIPAddress( 'fc:100:a:d:1:e:ac:0/24' ), 'IPv6 range' ); - $this->assertTrue( IP::isIPAddress( 'fc::100:a:d:1:e:ac/96' ), 'IPv6 range with "::"' ); - - $validIPs = array( 'fc:100::', 'fc:100:a:d:1:e:ac::', 'fc::100', '::fc:100:a:d:1:e:ac', - '::fc', 'fc::100:a:d:1:e:ac', 'fc:100:a:d:1:e:ac:0', '124.24.52.13', '1.24.52.13' ); - foreach ( $validIPs as $ip ) { - $this->assertTrue( IP::isIPAddress( $ip ), "$ip is a valid IP address" ); - } - } - - /** - * @covers IP::isIPv6 - */ - public function testisIPv6() { - $this->assertFalse( IP::isIPv6( ':fc:100::' ), 'IPv6 starting with lone ":"' ); - $this->assertFalse( IP::isIPv6( 'fc:100:::' ), 'IPv6 ending with a ":::"' ); - $this->assertFalse( IP::isIPv6( 'fc:300' ), 'IPv6 with only 2 words' ); - $this->assertFalse( IP::isIPv6( 'fc:100:300' ), 'IPv6 with only 3 words' ); - - $this->assertTrue( IP::isIPv6( 'fc:100::' ) ); - $this->assertTrue( IP::isIPv6( 'fc:100:a::' ) ); - $this->assertTrue( IP::isIPv6( 'fc:100:a:d::' ) ); - $this->assertTrue( IP::isIPv6( 'fc:100:a:d:1::' ) ); - $this->assertTrue( IP::isIPv6( 'fc:100:a:d:1:e::' ) ); - $this->assertTrue( IP::isIPv6( 'fc:100:a:d:1:e:ac::' ) ); - - $this->assertFalse( IP::isIPv6( 'fc:100:a:d:1:e:ac:0::' ), 'IPv6 with 8 words ending with "::"' ); - $this->assertFalse( IP::isIPv6( 'fc:100:a:d:1:e:ac:0:1::' ), 'IPv6 with 9 words ending with "::"' ); - - $this->assertFalse( IP::isIPv6( ':::' ) ); - $this->assertFalse( IP::isIPv6( '::0:' ), 'IPv6 ending in a lone ":"' ); - - $this->assertTrue( IP::isIPv6( '::' ), 'IPv6 zero address' ); - $this->assertTrue( IP::isIPv6( '::0' ) ); - $this->assertTrue( IP::isIPv6( '::fc' ) ); - $this->assertTrue( IP::isIPv6( '::fc:100' ) ); - $this->assertTrue( IP::isIPv6( '::fc:100:a' ) ); - $this->assertTrue( IP::isIPv6( '::fc:100:a:d' ) ); - $this->assertTrue( IP::isIPv6( '::fc:100:a:d:1' ) ); - $this->assertTrue( IP::isIPv6( '::fc:100:a:d:1:e' ) ); - $this->assertTrue( IP::isIPv6( '::fc:100:a:d:1:e:ac' ) ); - - $this->assertFalse( IP::isIPv6( '::fc:100:a:d:1:e:ac:0' ), 'IPv6 with "::" and 8 words' ); - $this->assertFalse( IP::isIPv6( '::fc:100:a:d:1:e:ac:0:1' ), 'IPv6 with 9 words' ); - - $this->assertFalse( IP::isIPv6( ':fc::100' ), 'IPv6 starting with lone ":"' ); - $this->assertFalse( IP::isIPv6( 'fc::100:' ), 'IPv6 ending with lone ":"' ); - $this->assertFalse( IP::isIPv6( 'fc:::100' ), 'IPv6 with ":::" in the middle' ); - - $this->assertTrue( IP::isIPv6( 'fc::100' ), 'IPv6 with "::" and 2 words' ); - $this->assertTrue( IP::isIPv6( 'fc::100:a' ), 'IPv6 with "::" and 3 words' ); - $this->assertTrue( IP::isIPv6( 'fc::100:a:d', 'IPv6 with "::" and 4 words' ) ); - $this->assertTrue( IP::isIPv6( 'fc::100:a:d:1' ), 'IPv6 with "::" and 5 words' ); - $this->assertTrue( IP::isIPv6( 'fc::100:a:d:1:e' ), 'IPv6 with "::" and 6 words' ); - $this->assertTrue( IP::isIPv6( 'fc::100:a:d:1:e:ac' ), 'IPv6 with "::" and 7 words' ); - $this->assertTrue( IP::isIPv6( '2001::df' ), 'IPv6 with "::" and 2 words' ); - $this->assertTrue( IP::isIPv6( '2001:5c0:1400:a::df' ), 'IPv6 with "::" and 5 words' ); - $this->assertTrue( IP::isIPv6( '2001:5c0:1400:a::df:2' ), 'IPv6 with "::" and 6 words' ); - - $this->assertFalse( IP::isIPv6( 'fc::100:a:d:1:e:ac:0' ), 'IPv6 with "::" and 8 words' ); - $this->assertFalse( IP::isIPv6( 'fc::100:a:d:1:e:ac:0:1' ), 'IPv6 with 9 words' ); - - $this->assertTrue( IP::isIPv6( 'fc:100:a:d:1:e:ac:0' ) ); - } - - /** - * @covers IP::isIPv4 - */ - public function testisIPv4() { - $this->assertFalse( IP::isIPv4( false ), 'Boolean false is not an IP' ); - $this->assertFalse( IP::isIPv4( true ), 'Boolean true is not an IP' ); - $this->assertFalse( IP::isIPv4( "" ), 'Empty string is not an IP' ); - $this->assertFalse( IP::isIPv4( 'abc' ) ); - $this->assertFalse( IP::isIPv4( ':' ) ); - $this->assertFalse( IP::isIPv4( '124.24.52' ), 'IPv4 not enough quads' ); - $this->assertFalse( IP::isIPv4( '24.324.52.13' ), 'IPv4 out of range' ); - $this->assertFalse( IP::isIPv4( '.24.52.13' ), 'IPv4 starts with period' ); - - $this->assertTrue( IP::isIPv4( '124.24.52.13' ) ); - $this->assertTrue( IP::isIPv4( '1.24.52.13' ) ); - $this->assertTrue( IP::isIPv4( '74.24.52.13/20', 'IPv4 range' ) ); - } - - /** - * @covers IP::isValid - */ - public function testValidIPs() { - foreach ( range( 0, 255 ) as $i ) { - $a = sprintf( "%03d", $i ); - $b = sprintf( "%02d", $i ); - $c = sprintf( "%01d", $i ); - foreach ( array_unique( array( $a, $b, $c ) ) as $f ) { - $ip = "$f.$f.$f.$f"; - $this->assertTrue( IP::isValid( $ip ), "$ip is a valid IPv4 address" ); - } - } - foreach ( range( 0x0, 0xFFFF, 0xF ) as $i ) { - $a = sprintf( "%04x", $i ); - $b = sprintf( "%03x", $i ); - $c = sprintf( "%02x", $i ); - foreach ( array_unique( array( $a, $b, $c ) ) as $f ) { - $ip = "$f:$f:$f:$f:$f:$f:$f:$f"; - $this->assertTrue( IP::isValid( $ip ), "$ip is a valid IPv6 address" ); - } - } - // test with some abbreviations - $this->assertFalse( IP::isValid( ':fc:100::' ), 'IPv6 starting with lone ":"' ); - $this->assertFalse( IP::isValid( 'fc:100:::' ), 'IPv6 ending with a ":::"' ); - $this->assertFalse( IP::isValid( 'fc:300' ), 'IPv6 with only 2 words' ); - $this->assertFalse( IP::isValid( 'fc:100:300' ), 'IPv6 with only 3 words' ); - - $this->assertTrue( IP::isValid( 'fc:100::' ) ); - $this->assertTrue( IP::isValid( 'fc:100:a:d:1:e::' ) ); - $this->assertTrue( IP::isValid( 'fc:100:a:d:1:e:ac::' ) ); - - $this->assertTrue( IP::isValid( 'fc::100' ), 'IPv6 with "::" and 2 words' ); - $this->assertTrue( IP::isValid( 'fc::100:a' ), 'IPv6 with "::" and 3 words' ); - $this->assertTrue( IP::isValid( '2001::df' ), 'IPv6 with "::" and 2 words' ); - $this->assertTrue( IP::isValid( '2001:5c0:1400:a::df' ), 'IPv6 with "::" and 5 words' ); - $this->assertTrue( IP::isValid( '2001:5c0:1400:a::df:2' ), 'IPv6 with "::" and 6 words' ); - $this->assertTrue( IP::isValid( 'fc::100:a:d:1' ), 'IPv6 with "::" and 5 words' ); - $this->assertTrue( IP::isValid( 'fc::100:a:d:1:e:ac' ), 'IPv6 with "::" and 7 words' ); - - $this->assertFalse( IP::isValid( 'fc:100:a:d:1:e:ac:0::' ), 'IPv6 with 8 words ending with "::"' ); - $this->assertFalse( IP::isValid( 'fc:100:a:d:1:e:ac:0:1::' ), 'IPv6 with 9 words ending with "::"' ); - } - - /** - * @covers IP::isValid - */ - public function testInvalidIPs() { - // Out of range... - foreach ( range( 256, 999 ) as $i ) { - $a = sprintf( "%03d", $i ); - $b = sprintf( "%02d", $i ); - $c = sprintf( "%01d", $i ); - foreach ( array_unique( array( $a, $b, $c ) ) as $f ) { - $ip = "$f.$f.$f.$f"; - $this->assertFalse( IP::isValid( $ip ), "$ip is not a valid IPv4 address" ); - } - } - foreach ( range( 'g', 'z' ) as $i ) { - $a = sprintf( "%04s", $i ); - $b = sprintf( "%03s", $i ); - $c = sprintf( "%02s", $i ); - foreach ( array_unique( array( $a, $b, $c ) ) as $f ) { - $ip = "$f:$f:$f:$f:$f:$f:$f:$f"; - $this->assertFalse( IP::isValid( $ip ), "$ip is not a valid IPv6 address" ); - } - } - // Have CIDR - $ipCIDRs = array( - '212.35.31.121/32', - '212.35.31.121/18', - '212.35.31.121/24', - '::ff:d:321:5/96', - 'ff::d3:321:5/116', - 'c:ff:12:1:ea:d:321:5/120', - ); - foreach ( $ipCIDRs as $i ) { - $this->assertFalse( IP::isValid( $i ), - "$i is an invalid IP address because it is a block" ); - } - // Incomplete/garbage - $invalid = array( - 'www.xn--var-xla.net', - '216.17.184.G', - '216.17.184.1.', - '216.17.184', - '216.17.184.', - '256.17.184.1' - ); - foreach ( $invalid as $i ) { - $this->assertFalse( IP::isValid( $i ), "$i is an invalid IP address" ); - } - } - - /** - * @covers IP::isValidBlock - */ - public function testValidBlocks() { - $valid = array( - '116.17.184.5/32', - '0.17.184.5/30', - '16.17.184.1/24', - '30.242.52.14/1', - '10.232.52.13/8', - '30.242.52.14/0', - '::e:f:2001/96', - '::c:f:2001/128', - '::10:f:2001/70', - '::fe:f:2001/1', - '::6d:f:2001/8', - '::fe:f:2001/0', - ); - foreach ( $valid as $i ) { - $this->assertTrue( IP::isValidBlock( $i ), "$i is a valid IP block" ); - } - } - - /** - * @covers IP::isValidBlock - */ - public function testInvalidBlocks() { - $invalid = array( - '116.17.184.5/33', - '0.17.184.5/130', - '16.17.184.1/-1', - '10.232.52.13/*', - '7.232.52.13/ab', - '11.232.52.13/', - '::e:f:2001/129', - '::c:f:2001/228', - '::10:f:2001/-1', - '::6d:f:2001/*', - '::86:f:2001/ab', - '::23:f:2001/', - ); - foreach ( $invalid as $i ) { - $this->assertFalse( IP::isValidBlock( $i ), "$i is not a valid IP block" ); - } - } - - /** - * Improve IP::sanitizeIP() code coverage - * @todo Most probably incomplete - */ - public function testSanitizeIP() { - $this->assertNull( IP::sanitizeIP( '' ) ); - $this->assertNull( IP::sanitizeIP( ' ' ) ); - } - - /** - * @covers IP::toUnsigned - * @dataProvider provideToUnsigned - */ - public function testToUnsigned( $expected, $input ) { - $result = IP::toUnsigned( $input ); - $this->assertTrue( $result === false || is_string( $result ) || is_int( $result ) ); - $this->assertEquals( $expected, $result ); - } - - /** - * Provider for IP::testToUnsigned() - */ - public static function provideToUnsigned() { - return array( - array( 1, '0.0.0.1' ), - array( 16909060, '1.2.3.4' ), - array( 2130706433, '127.0.0.1' ), - array( '2147483648', '128.0.0.0' ), - array( '3735931646', '222.173.202.254' ), - array( pow( 2, 32 ) - 1, '255.255.255.255' ), - array( false, 'IN.VA.LI.D' ), - array( 1, '::1' ), - array( '42540766452641154071740215577757643572', '2001:0db8:85a3:0000:0000:8a2e:0370:7334' ), - array( '42540766452641154071740215577757643572', '2001:db8:85a3::8a2e:0370:7334' ), - array( false, 'IN:VA::LI:D' ), - array( false, ':::1' ) - ); - } - - /** - * @covers IP::toHex - * @dataProvider provideToHex - */ - public function testToHex( $expected, $input ) { - $result = IP::toHex( $input ); - $this->assertTrue( $result === false || is_string( $result ) ); - $this->assertEquals( $expected, $result ); - } - - /** - * Provider for IP::testToHex() - */ - public static function provideToHex() { - return array( - array( '00000001', '0.0.0.1' ), - array( '01020304', '1.2.3.4' ), - array( '7F000001', '127.0.0.1' ), - array( '80000000', '128.0.0.0' ), - array( 'DEADCAFE', '222.173.202.254' ), - array( 'FFFFFFFF', '255.255.255.255' ), - array( false, 'IN.VA.LI.D' ), - array( 'v6-00000000000000000000000000000001', '::1' ), - array( 'v6-20010DB885A3000000008A2E03707334', '2001:0db8:85a3:0000:0000:8a2e:0370:7334' ), - array( 'v6-20010DB885A3000000008A2E03707334', '2001:db8:85a3::8a2e:0370:7334' ), - array( false, 'IN:VA::LI:D' ), - array( false, ':::1' ) - ); - } - - /** - * @covers IP::isPublic - */ - public function testPrivateIPs() { - $private = array( 'fc00::3', 'fc00::ff', '::1', '10.0.0.1', '172.16.0.1', '192.168.0.1' ); - foreach ( $private as $p ) { - $this->assertFalse( IP::isPublic( $p ), "$p is not a public IP address" ); - } - $public = array( '2001:5c0:1000:a::133', 'fc::3', '00FC::' ); - foreach ( $public as $p ) { - $this->assertTrue( IP::isPublic( $p ), "$p is a public IP address" ); - } - } - - // Private wrapper used to test CIDR Parsing. - private function assertFalseCIDR( $CIDR, $msg = '' ) { - $ff = array( false, false ); - $this->assertEquals( $ff, IP::parseCIDR( $CIDR ), $msg ); - } - - // Private wrapper to test network shifting using only dot notation - private function assertNet( $expected, $CIDR ) { - $parse = IP::parseCIDR( $CIDR ); - $this->assertEquals( $expected, long2ip( $parse[0] ), "network shifting $CIDR" ); - } - - /** - * @covers IP::hexToQuad - */ - public function testHexToQuad() { - $this->assertEquals( '0.0.0.1', IP::hexToQuad( '00000001' ) ); - $this->assertEquals( '255.0.0.0', IP::hexToQuad( 'FF000000' ) ); - $this->assertEquals( '255.255.255.255', IP::hexToQuad( 'FFFFFFFF' ) ); - $this->assertEquals( '10.188.222.255', IP::hexToQuad( '0ABCDEFF' ) ); - // hex not left-padded... - $this->assertEquals( '0.0.0.0', IP::hexToQuad( '0' ) ); - $this->assertEquals( '0.0.0.1', IP::hexToQuad( '1' ) ); - $this->assertEquals( '0.0.0.255', IP::hexToQuad( 'FF' ) ); - $this->assertEquals( '0.0.255.0', IP::hexToQuad( 'FF00' ) ); - } - - /** - * @covers IP::hexToOctet - */ - public function testHexToOctet() { - $this->assertEquals( '0:0:0:0:0:0:0:1', - IP::hexToOctet( '00000000000000000000000000000001' ) ); - $this->assertEquals( '0:0:0:0:0:0:FF:3', - IP::hexToOctet( '00000000000000000000000000FF0003' ) ); - $this->assertEquals( '0:0:0:0:0:0:FF00:6', - IP::hexToOctet( '000000000000000000000000FF000006' ) ); - $this->assertEquals( '0:0:0:0:0:0:FCCF:FAFF', - IP::hexToOctet( '000000000000000000000000FCCFFAFF' ) ); - $this->assertEquals( 'FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF', - IP::hexToOctet( 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF' ) ); - // hex not left-padded... - $this->assertEquals( '0:0:0:0:0:0:0:0', IP::hexToOctet( '0' ) ); - $this->assertEquals( '0:0:0:0:0:0:0:1', IP::hexToOctet( '1' ) ); - $this->assertEquals( '0:0:0:0:0:0:0:FF', IP::hexToOctet( 'FF' ) ); - $this->assertEquals( '0:0:0:0:0:0:0:FFD0', IP::hexToOctet( 'FFD0' ) ); - $this->assertEquals( '0:0:0:0:0:0:FA00:0', IP::hexToOctet( 'FA000000' ) ); - $this->assertEquals( '0:0:0:0:0:0:FCCF:FAFF', IP::hexToOctet( 'FCCFFAFF' ) ); - } - - /** - * IP::parseCIDR() returns an array containing a signed IP address - * representing the network mask and the bit mask. - * @covers IP::parseCIDR - */ - public function testCIDRParsing() { - $this->assertFalseCIDR( '192.0.2.0', "missing mask" ); - $this->assertFalseCIDR( '192.0.2.0/', "missing bitmask" ); - - // Verify if statement - $this->assertFalseCIDR( '256.0.0.0/32', "invalid net" ); - $this->assertFalseCIDR( '192.0.2.0/AA', "mask not numeric" ); - $this->assertFalseCIDR( '192.0.2.0/-1', "mask < 0" ); - $this->assertFalseCIDR( '192.0.2.0/33', "mask > 32" ); - - // Check internal logic - # 0 mask always result in array(0,0) - $this->assertEquals( array( 0, 0 ), IP::parseCIDR( '192.0.0.2/0' ) ); - $this->assertEquals( array( 0, 0 ), IP::parseCIDR( '0.0.0.0/0' ) ); - $this->assertEquals( array( 0, 0 ), IP::parseCIDR( '255.255.255.255/0' ) ); - - // @todo FIXME: Add more tests. - - # This part test network shifting - $this->assertNet( '192.0.0.0', '192.0.0.2/24' ); - $this->assertNet( '192.168.5.0', '192.168.5.13/24' ); - $this->assertNet( '10.0.0.160', '10.0.0.161/28' ); - $this->assertNet( '10.0.0.0', '10.0.0.3/28' ); - $this->assertNet( '10.0.0.0', '10.0.0.3/30' ); - $this->assertNet( '10.0.0.4', '10.0.0.4/30' ); - $this->assertNet( '172.17.32.0', '172.17.35.48/21' ); - $this->assertNet( '10.128.0.0', '10.135.0.0/9' ); - $this->assertNet( '134.0.0.0', '134.0.5.1/8' ); - } - - /** - * @covers IP::canonicalize - */ - public function testIPCanonicalizeOnValidIp() { - $this->assertEquals( '192.0.2.152', IP::canonicalize( '192.0.2.152' ), - 'Canonicalization of a valid IP returns it unchanged' ); - } - - /** - * @covers IP::canonicalize - */ - public function testIPCanonicalizeMappedAddress() { - $this->assertEquals( - '192.0.2.152', - IP::canonicalize( '::ffff:192.0.2.152' ) - ); - $this->assertEquals( - '192.0.2.152', - IP::canonicalize( '::192.0.2.152' ) - ); - } - - /** - * Issues there are most probably from IP::toHex() or IP::parseRange() - * @covers IP::isInRange - * @dataProvider provideIPsAndRanges - */ - public function testIPIsInRange( $expected, $addr, $range, $message = '' ) { - $this->assertEquals( - $expected, - IP::isInRange( $addr, $range ), - $message - ); - } - - /** Provider for testIPIsInRange() */ - public static function provideIPsAndRanges() { - # Format: (expected boolean, address, range, optional message) - return array( - # IPv4 - array( true, '192.0.2.0', '192.0.2.0/24', 'Network address' ), - array( true, '192.0.2.77', '192.0.2.0/24', 'Simple address' ), - array( true, '192.0.2.255', '192.0.2.0/24', 'Broadcast address' ), - - array( false, '0.0.0.0', '192.0.2.0/24' ), - array( false, '255.255.255', '192.0.2.0/24' ), - - # IPv6 - array( false, '::1', '2001:DB8::/32' ), - array( false, '::', '2001:DB8::/32' ), - array( false, 'FE80::1', '2001:DB8::/32' ), - - array( true, '2001:DB8::', '2001:DB8::/32' ), - array( true, '2001:0DB8::', '2001:DB8::/32' ), - array( true, '2001:DB8::1', '2001:DB8::/32' ), - array( true, '2001:0DB8::1', '2001:DB8::/32' ), - array( true, '2001:0DB8:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF', - '2001:DB8::/32' ), - - array( false, '2001:0DB8:F::', '2001:DB8::/96' ), - ); - } - - /** - * Test for IP::splitHostAndPort(). - * @dataProvider provideSplitHostAndPort - */ - public function testSplitHostAndPort( $expected, $input, $description ) { - $this->assertEquals( $expected, IP::splitHostAndPort( $input ), $description ); - } - - /** - * Provider for IP::splitHostAndPort() - */ - public static function provideSplitHostAndPort() { - return array( - array( false, '[', 'Unclosed square bracket' ), - array( false, '[::', 'Unclosed square bracket 2' ), - array( array( '::', false ), '::', 'Bare IPv6 0' ), - array( array( '::1', false ), '::1', 'Bare IPv6 1' ), - array( array( '::', false ), '[::]', 'Bracketed IPv6 0' ), - array( array( '::1', false ), '[::1]', 'Bracketed IPv6 1' ), - array( array( '::1', 80 ), '[::1]:80', 'Bracketed IPv6 with port' ), - array( false, '::x', 'Double colon but no IPv6' ), - array( array( 'x', 80 ), 'x:80', 'Hostname and port' ), - array( false, 'x:x', 'Hostname and invalid port' ), - array( array( 'x', false ), 'x', 'Plain hostname' ) - ); - } - - /** - * Test for IP::combineHostAndPort() - * @dataProvider provideCombineHostAndPort - */ - public function testCombineHostAndPort( $expected, $input, $description ) { - list( $host, $port, $defaultPort ) = $input; - $this->assertEquals( - $expected, - IP::combineHostAndPort( $host, $port, $defaultPort ), - $description ); - } - - /** - * Provider for IP::combineHostAndPort() - */ - public static function provideCombineHostAndPort() { - return array( - array( '[::1]', array( '::1', 2, 2 ), 'IPv6 default port' ), - array( '[::1]:2', array( '::1', 2, 3 ), 'IPv6 non-default port' ), - array( 'x', array( 'x', 2, 2 ), 'Normal default port' ), - array( 'x:2', array( 'x', 2, 3 ), 'Normal non-default port' ), - ); - } - - /** - * Test for IP::sanitizeRange() - * @dataProvider provideIPCIDRs - */ - public function testSanitizeRange( $input, $expected, $description ) { - $this->assertEquals( $expected, IP::sanitizeRange( $input ), $description ); - } - - /** - * Provider for IP::testSanitizeRange() - */ - public static function provideIPCIDRs() { - return array( - array( '35.56.31.252/16', '35.56.0.0/16', 'IPv4 range' ), - array( '135.16.21.252/24', '135.16.21.0/24', 'IPv4 range' ), - array( '5.36.71.252/32', '5.36.71.252/32', 'IPv4 silly range' ), - array( '5.36.71.252', '5.36.71.252', 'IPv4 non-range' ), - array( '0:1:2:3:4:c5:f6:7/96', '0:1:2:3:4:C5:0:0/96', 'IPv6 range' ), - array( '0:1:2:3:4:5:6:7/120', '0:1:2:3:4:5:6:0/120', 'IPv6 range' ), - array( '0:e1:2:3:4:5:e6:7/128', '0:E1:2:3:4:5:E6:7/128', 'IPv6 silly range' ), - array( '0:c1:A2:3:4:5:c6:7', '0:C1:A2:3:4:5:C6:7', 'IPv6 non range' ), - ); - } - - /** - * Test for IP::prettifyIP() - * @dataProvider provideIPsToPrettify - */ - public function testPrettifyIP( $ip, $prettified ) { - $this->assertEquals( $prettified, IP::prettifyIP( $ip ), "Prettify of $ip" ); - } - - /** - * Provider for IP::testPrettifyIP() - */ - public static function provideIPsToPrettify() { - return array( - array( '0:0:0:0:0:0:0:0', '::' ), - array( '0:0:0::0:0:0', '::' ), - array( '0:0:0:1:0:0:0:0', '0:0:0:1::' ), - array( '0:0::f', '::f' ), - array( '0::0:0:0:33:fef:b', '::33:fef:b' ), - array( '3f:535:0:0:0:0:e:fbb', '3f:535::e:fbb' ), - array( '0:0:fef:0:0:0:e:fbb', '0:0:fef::e:fbb' ), - array( 'abbc:2004::0:0:0:0', 'abbc:2004::' ), - array( 'cebc:2004:f:0:0:0:0:0', 'cebc:2004:f::' ), - array( '0:0:0:0:0:0:0:0/16', '::/16' ), - array( '0:0:0::0:0:0/64', '::/64' ), - array( '0:0::f/52', '::f/52' ), - array( '::0:0:33:fef:b/52', '::33:fef:b/52' ), - array( '3f:535:0:0:0:0:e:fbb/48', '3f:535::e:fbb/48' ), - array( '0:0:fef:0:0:0:e:fbb/96', '0:0:fef::e:fbb/96' ), - array( 'abbc:2004:0:0::0:0/40', 'abbc:2004::/40' ), - array( 'aebc:2004:f:0:0:0:0:0/80', 'aebc:2004:f::/80' ), - ); - } -} diff --git a/tests/phpunit/includes/LanguageConverterTest.php b/tests/phpunit/includes/LanguageConverterTest.php deleted file mode 100644 index 7c2134b9..00000000 --- a/tests/phpunit/includes/LanguageConverterTest.php +++ /dev/null @@ -1,148 +0,0 @@ -setMwGlobals( array( - 'wgContLang' => Language::factory( 'tg' ), - 'wgLanguageCode' => 'tg', - 'wgDefaultLanguageVariant' => false, - 'wgMemc' => new EmptyBagOStuff, - 'wgRequest' => new FauxRequest( array() ), - 'wgUser' => new User, - ) ); - - $this->lang = new LanguageToTest(); - $this->lc = new TestConverter( - $this->lang, 'tg', - array( 'tg', 'tg-latn' ) - ); - } - - protected function tearDown() { - unset( $this->lc ); - unset( $this->lang ); - - parent::tearDown(); - } - - public function testGetPreferredVariantDefaults() { - $this->assertEquals( 'tg', $this->lc->getPreferredVariant() ); - } - - public function testGetPreferredVariantHeaders() { - global $wgRequest; - $wgRequest->setHeader( 'Accept-Language', 'tg-latn' ); - - $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); - } - - public function testGetPreferredVariantHeaderWeight() { - global $wgRequest; - $wgRequest->setHeader( 'Accept-Language', 'tg;q=1' ); - - $this->assertEquals( 'tg', $this->lc->getPreferredVariant() ); - } - - public function testGetPreferredVariantHeaderWeight2() { - global $wgRequest; - $wgRequest->setHeader( 'Accept-Language', 'tg-latn;q=1' ); - - $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); - } - - public function testGetPreferredVariantHeaderMulti() { - global $wgRequest; - $wgRequest->setHeader( 'Accept-Language', 'en, tg-latn;q=1' ); - - $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); - } - - public function testGetPreferredVariantUserOption() { - global $wgUser; - - $wgUser = new User; - $wgUser->load(); // from 'defaults' - $wgUser->mId = 1; - $wgUser->mDataLoaded = true; - $wgUser->mOptionsLoaded = true; - $wgUser->setOption( 'variant', 'tg-latn' ); - - $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); - } - - public function testGetPreferredVariantUserOptionForForeignLanguage() { - global $wgContLang, $wgUser; - - $wgContLang = Language::factory( 'en' ); - $wgUser = new User; - $wgUser->load(); // from 'defaults' - $wgUser->mId = 1; - $wgUser->mDataLoaded = true; - $wgUser->mOptionsLoaded = true; - $wgUser->setOption( 'variant-tg', 'tg-latn' ); - - $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); - } - - public function testGetPreferredVariantHeaderUserVsUrl() { - global $wgContLang, $wgRequest, $wgUser; - - $wgContLang = Language::factory( 'tg-latn' ); - $wgRequest->setVal( 'variant', 'tg' ); - $wgUser = User::newFromId( "admin" ); - $wgUser->setId( 1 ); - $wgUser->mFrom = 'defaults'; - $wgUser->mOptionsLoaded = true; - // The user's data is ignored because the variant is set in the URL. - $wgUser->setOption( 'variant', 'tg-latn' ); - $this->assertEquals( 'tg', $this->lc->getPreferredVariant() ); - } - - - public function testGetPreferredVariantDefaultLanguageVariant() { - global $wgDefaultLanguageVariant; - - $wgDefaultLanguageVariant = 'tg-latn'; - $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() ); - } - - public function testGetPreferredVariantDefaultLanguageVsUrlVariant() { - global $wgDefaultLanguageVariant, $wgRequest, $wgContLang; - - $wgContLang = Language::factory( 'tg-latn' ); - $wgDefaultLanguageVariant = 'tg'; - $wgRequest->setVal( 'variant', null ); - $this->assertEquals( 'tg', $this->lc->getPreferredVariant() ); - } -} - -/** - * Test converter (from Tajiki to latin orthography) - */ -class TestConverter extends LanguageConverter { - private $table = array( - 'б' => 'b', - 'в' => 'v', - 'г' => 'g', - ); - - function loadDefaultTables() { - $this->mTables = array( - 'tg-latn' => new ReplacementArray( $this->table ), - 'tg' => new ReplacementArray() - ); - } -} - -class LanguageToTest extends Language { - function __construct() { - parent::__construct(); - $variants = array( 'tg', 'tg-latn' ); - $this->mConverter = new TestConverter( $this, 'tg', $variants ); - } -} diff --git a/tests/phpunit/includes/LicensesTest.php b/tests/phpunit/includes/LicensesTest.php deleted file mode 100644 index 478a2ffc..00000000 --- a/tests/phpunit/includes/LicensesTest.php +++ /dev/null @@ -1,22 +0,0 @@ - 'FooField', - 'type' => 'select', - 'section' => 'description', - 'id' => 'wpLicense', - 'label' => 'A label text', # Note can't test label-message because $wgOut is not defined - 'name' => 'AnotherName', - 'licenses' => $str, - ) ); - $this->assertThat( $lc, $this->isInstanceOf( 'Licenses' ) ); - } -} diff --git a/tests/phpunit/includes/LinkerTest.php b/tests/phpunit/includes/LinkerTest.php deleted file mode 100644 index b605f08f..00000000 --- a/tests/phpunit/includes/LinkerTest.php +++ /dev/null @@ -1,71 +0,0 @@ -setMwGlobals( array( - 'wgArticlePath' => '/wiki/$1', - 'wgWellFormedXml' => true, - ) ); - - $this->assertEquals( $expected, - Linker::userLink( $userId, $userName, $altUserName, $msg ) - ); - } - - public static function provideCasesForUserLink() { - # Format: - # - expected - # - userid - # - username - # - optional altUserName - # - optional message - return array( - - ### ANONYMOUS USER ######################################## - array( - 'JohnDoe', - 0, 'JohnDoe', false, - ), - array( - '::1', - 0, '::1', false, - 'Anonymous with pretty IPv6' - ), - array( - '::1', - 0, '0:0:0:0:0:0:0:1', false, - 'Anonymous with almost pretty IPv6' - ), - array( - '::1', - 0, '0000:0000:0000:0000:0000:0000:0000:0001', false, - 'Anonymous with full IPv6' - ), - array( - 'AlternativeUsername', - 0, '::1', 'AlternativeUsername', - 'Anonymous with pretty IPv6 and an alternative username' - ), - - # IPV4 - array( - '127.0.0.1', - 0, '127.0.0.1', false, - 'Anonymous with IPv4' - ), - array( - 'AlternativeUsername', - 0, '127.0.0.1', 'AlternativeUsername', - 'Anonymous with IPv4 and an alternative username' - ), - - ### Regular user ########################################## - # TODO! - ); - } -} diff --git a/tests/phpunit/includes/LinksUpdateTest.php b/tests/phpunit/includes/LinksUpdateTest.php deleted file mode 100644 index 5ade250e..00000000 --- a/tests/phpunit/includes/LinksUpdateTest.php +++ /dev/null @@ -1,175 +0,0 @@ -tablesUsed = array_merge( $this->tablesUsed, - array( - 'interwiki', - 'page_props', - 'pagelinks', - 'categorylinks', - 'langlinks', - 'externallinks', - 'imagelinks', - 'templatelinks', - 'iwlinks' - ) - ); - } - - protected function setUp() { - parent::setUp(); - $dbw = wfGetDB( DB_MASTER ); - $dbw->replace( - 'interwiki', - array( 'iw_prefix' ), - array( - 'iw_prefix' => 'linksupdatetest', - 'iw_url' => 'http://testing.com/wiki/$1', - 'iw_api' => 'http://testing.com/w/api.php', - 'iw_local' => 0, - 'iw_trans' => 0, - 'iw_wikiid' => 'linksupdatetest', - ) - ); - } - - protected function makeTitleAndParserOutput( $name, $id ) { - $t = Title::newFromText( $name ); - $t->mArticleID = $id; # XXX: this is fugly - - $po = new ParserOutput(); - $po->setTitleText( $t->getPrefixedText() ); - - return array( $t, $po ); - } - - public function testUpdate_pagelinks() { - list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 ); - - $po->addLink( Title::newFromText( "Foo" ) ); - $po->addLink( Title::newFromText( "Special:Foo" ) ); // special namespace should be ignored - $po->addLink( Title::newFromText( "linksupdatetest:Foo" ) ); // interwiki link should be ignored - $po->addLink( Title::newFromText( "#Foo" ) ); // hash link should be ignored - - $update = $this->assertLinksUpdate( $t, $po, 'pagelinks', 'pl_namespace, pl_title', 'pl_from = 111', array( - array( NS_MAIN, 'Foo' ), - ) ); - $this->assertArrayEquals( array( - Title::makeTitle( NS_MAIN, 'Foo' ), // newFromText doesn't yield the same internal state.... - ), $update->getAddedLinks() ); - - $po = new ParserOutput(); - $po->setTitleText( $t->getPrefixedText() ); - - $po->addLink( Title::newFromText( "Bar" ) ); - $po->addLink( Title::newFromText( "Talk:Bar" ) ); - - $update = $this->assertLinksUpdate( $t, $po, 'pagelinks', 'pl_namespace, pl_title', 'pl_from = 111', array( - array( NS_MAIN, 'Bar' ), - array( NS_TALK, 'Bar' ), - ) ); - $this->assertArrayEquals( array( - Title::makeTitle( NS_MAIN, 'Bar' ), - Title::makeTitle( NS_TALK, 'Bar' ), - ), $update->getAddedLinks() ); - $this->assertArrayEquals( array( - Title::makeTitle( NS_MAIN, 'Foo' ), - ), $update->getRemovedLinks() ); - } - - public function testUpdate_externallinks() { - list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 ); - - $po->addExternalLink( "http://testing.com/wiki/Foo" ); - - $this->assertLinksUpdate( $t, $po, 'externallinks', 'el_to, el_index', 'el_from = 111', array( - array( 'http://testing.com/wiki/Foo', 'http://com.testing./wiki/Foo' ), - ) ); - } - - public function testUpdate_categorylinks() { - $this->setMwGlobals( 'wgCategoryCollation', 'uppercase' ); - - list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 ); - - $po->addCategory( "Foo", "FOO" ); - - $this->assertLinksUpdate( $t, $po, 'categorylinks', 'cl_to, cl_sortkey', 'cl_from = 111', array( - array( 'Foo', "FOO\nTESTING" ), - ) ); - } - - public function testUpdate_iwlinks() { - list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 ); - - $target = Title::makeTitleSafe( NS_MAIN, "Foo", '', 'linksupdatetest' ); - $po->addInterwikiLink( $target ); - - $this->assertLinksUpdate( $t, $po, 'iwlinks', 'iwl_prefix, iwl_title', 'iwl_from = 111', array( - array( 'linksupdatetest', 'Foo' ), - ) ); - } - - public function testUpdate_templatelinks() { - list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 ); - - $po->addTemplate( Title::newFromText( "Template:Foo" ), 23, 42 ); - - $this->assertLinksUpdate( $t, $po, 'templatelinks', 'tl_namespace, tl_title', 'tl_from = 111', array( - array( NS_TEMPLATE, 'Foo' ), - ) ); - } - - public function testUpdate_imagelinks() { - list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 ); - - $po->addImage( "Foo.png" ); - - $this->assertLinksUpdate( $t, $po, 'imagelinks', 'il_to', 'il_from = 111', array( - array( 'Foo.png' ), - ) ); - } - - public function testUpdate_langlinks() { - list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 ); - - $po->addLanguageLink( Title::newFromText( "en:Foo" )->getFullText() ); - - $this->assertLinksUpdate( $t, $po, 'langlinks', 'll_lang, ll_title', 'll_from = 111', array( - array( 'En', 'Foo' ), - ) ); - } - - public function testUpdate_page_props() { - list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 ); - - $po->setProperty( "foo", "bar" ); - - $this->assertLinksUpdate( $t, $po, 'page_props', 'pp_propname, pp_value', 'pp_page = 111', array( - array( 'foo', 'bar' ), - ) ); - } - - // @todo test recursive, too! - - protected function assertLinksUpdate( Title $title, ParserOutput $parserOutput, $table, $fields, $condition, array $expectedRows ) { - $update = new LinksUpdate( $title, $parserOutput ); - - //NOTE: make sure LinksUpdate does not generate warnings when called inside a transaction. - $update->beginTransaction(); - $update->doUpdate(); - $update->commitTransaction(); - - $this->assertSelect( $table, $fields, $condition, $expectedRows ); - return $update; - } -} diff --git a/tests/phpunit/includes/LocalFileTest.php b/tests/phpunit/includes/LocalFileTest.php deleted file mode 100644 index 2501c783..00000000 --- a/tests/phpunit/includes/LocalFileTest.php +++ /dev/null @@ -1,107 +0,0 @@ -setMwGlobals( 'wgCapitalLinks', true ); - - $info = array( - 'name' => 'test', - 'directory' => '/testdir', - 'url' => '/testurl', - 'hashLevels' => 2, - 'transformVia404' => false, - 'backend' => new FSFileBackend( array( - 'name' => 'local-backend', - 'lockManager' => 'fsLockManager', - 'containerPaths' => array( - 'cont1' => "/testdir/local-backend/tempimages/cont1", - 'cont2' => "/testdir/local-backend/tempimages/cont2" - ) - ) ) - ); - $this->repo_hl0 = new LocalRepo( array( 'hashLevels' => 0 ) + $info ); - $this->repo_hl2 = new LocalRepo( array( 'hashLevels' => 2 ) + $info ); - $this->repo_lc = new LocalRepo( array( 'initialCapital' => false ) + $info ); - $this->file_hl0 = $this->repo_hl0->newFile( 'test!' ); - $this->file_hl2 = $this->repo_hl2->newFile( 'test!' ); - $this->file_lc = $this->repo_lc->newFile( 'test!' ); - } - - public function testGetHashPath() { - $this->assertEquals( '', $this->file_hl0->getHashPath() ); - $this->assertEquals( 'a/a2/', $this->file_hl2->getHashPath() ); - $this->assertEquals( 'c/c4/', $this->file_lc->getHashPath() ); - } - - public function testGetRel() { - $this->assertEquals( 'Test!', $this->file_hl0->getRel() ); - $this->assertEquals( 'a/a2/Test!', $this->file_hl2->getRel() ); - $this->assertEquals( 'c/c4/test!', $this->file_lc->getRel() ); - } - - public function testGetUrlRel() { - $this->assertEquals( 'Test%21', $this->file_hl0->getUrlRel() ); - $this->assertEquals( 'a/a2/Test%21', $this->file_hl2->getUrlRel() ); - $this->assertEquals( 'c/c4/test%21', $this->file_lc->getUrlRel() ); - } - - public function testGetArchivePath() { - $this->assertEquals( 'mwstore://local-backend/test-public/archive', $this->file_hl0->getArchivePath() ); - $this->assertEquals( 'mwstore://local-backend/test-public/archive/a/a2', $this->file_hl2->getArchivePath() ); - $this->assertEquals( 'mwstore://local-backend/test-public/archive/!', $this->file_hl0->getArchivePath( '!' ) ); - $this->assertEquals( 'mwstore://local-backend/test-public/archive/a/a2/!', $this->file_hl2->getArchivePath( '!' ) ); - } - - public function testGetThumbPath() { - $this->assertEquals( 'mwstore://local-backend/test-thumb/Test!', $this->file_hl0->getThumbPath() ); - $this->assertEquals( 'mwstore://local-backend/test-thumb/a/a2/Test!', $this->file_hl2->getThumbPath() ); - $this->assertEquals( 'mwstore://local-backend/test-thumb/Test!/x', $this->file_hl0->getThumbPath( 'x' ) ); - $this->assertEquals( 'mwstore://local-backend/test-thumb/a/a2/Test!/x', $this->file_hl2->getThumbPath( 'x' ) ); - } - - public function testGetArchiveUrl() { - $this->assertEquals( '/testurl/archive', $this->file_hl0->getArchiveUrl() ); - $this->assertEquals( '/testurl/archive/a/a2', $this->file_hl2->getArchiveUrl() ); - $this->assertEquals( '/testurl/archive/%21', $this->file_hl0->getArchiveUrl( '!' ) ); - $this->assertEquals( '/testurl/archive/a/a2/%21', $this->file_hl2->getArchiveUrl( '!' ) ); - } - - public function testGetThumbUrl() { - $this->assertEquals( '/testurl/thumb/Test%21', $this->file_hl0->getThumbUrl() ); - $this->assertEquals( '/testurl/thumb/a/a2/Test%21', $this->file_hl2->getThumbUrl() ); - $this->assertEquals( '/testurl/thumb/Test%21/x', $this->file_hl0->getThumbUrl( 'x' ) ); - $this->assertEquals( '/testurl/thumb/a/a2/Test%21/x', $this->file_hl2->getThumbUrl( 'x' ) ); - } - - public function testGetArchiveVirtualUrl() { - $this->assertEquals( 'mwrepo://test/public/archive', $this->file_hl0->getArchiveVirtualUrl() ); - $this->assertEquals( 'mwrepo://test/public/archive/a/a2', $this->file_hl2->getArchiveVirtualUrl() ); - $this->assertEquals( 'mwrepo://test/public/archive/%21', $this->file_hl0->getArchiveVirtualUrl( '!' ) ); - $this->assertEquals( 'mwrepo://test/public/archive/a/a2/%21', $this->file_hl2->getArchiveVirtualUrl( '!' ) ); - } - - public function testGetThumbVirtualUrl() { - $this->assertEquals( 'mwrepo://test/thumb/Test%21', $this->file_hl0->getThumbVirtualUrl() ); - $this->assertEquals( 'mwrepo://test/thumb/a/a2/Test%21', $this->file_hl2->getThumbVirtualUrl() ); - $this->assertEquals( 'mwrepo://test/thumb/Test%21/%21', $this->file_hl0->getThumbVirtualUrl( '!' ) ); - $this->assertEquals( 'mwrepo://test/thumb/a/a2/Test%21/%21', $this->file_hl2->getThumbVirtualUrl( '!' ) ); - } - - public function testGetUrl() { - $this->assertEquals( '/testurl/Test%21', $this->file_hl0->getUrl() ); - $this->assertEquals( '/testurl/a/a2/Test%21', $this->file_hl2->getUrl() ); - } - - public function testWfLocalFile() { - $file = wfLocalFile( "File:Some_file_that_probably_doesn't exist.png" ); - $this->assertThat( $file, $this->isInstanceOf( 'LocalFile' ), 'wfLocalFile() returns LocalFile for valid Titles' ); - } -} diff --git a/tests/phpunit/includes/LocalisationCacheTest.php b/tests/phpunit/includes/LocalisationCacheTest.php deleted file mode 100644 index b34847aa..00000000 --- a/tests/phpunit/includes/LocalisationCacheTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertEquals( - $cache->getItem( 'ar', 'pluralRules' ), - $cache->getItem( 'arz', 'pluralRules' ), - 'arz plural rules (undefined) fallback to ar (defined)' - ); - - $this->assertEquals( - $cache->getItem( 'ar', 'compiledPluralRules' ), - $cache->getItem( 'arz', 'compiledPluralRules' ), - 'arz compiled plural rules (undefined) fallback to ar (defined)' - ); - - $this->assertNotEquals( - $cache->getItem( 'ksh', 'pluralRules' ), - $cache->getItem( 'de', 'pluralRules' ), - 'ksh plural rules (defined) dont fallback to de (defined)' - ); - - $this->assertNotEquals( - $cache->getItem( 'ksh', 'compiledPluralRules' ), - $cache->getItem( 'de', 'compiledPluralRules' ), - 'ksh compiled plural rules (defined) dont fallback to de (defined)' - ); - } -} diff --git a/tests/phpunit/includes/MWExceptionHandlerTest.php b/tests/phpunit/includes/MWExceptionHandlerTest.php deleted file mode 100644 index 987dfa83..00000000 --- a/tests/phpunit/includes/MWExceptionHandlerTest.php +++ /dev/null @@ -1,73 +0,0 @@ -getTrace(); - $hasObject = false; - $hasArray = false; - foreach ( $trace as $frame ) { - if ( ! isset( $frame['args'] ) ) { - continue; - } - foreach ( $frame['args'] as $arg ) { - $hasObject = $hasObject || is_object( $arg ); - $hasArray = $hasArray || is_array( $arg ); - } - - if( $hasObject && $hasArray ) { - break; - } - } - $this->assertTrue( $hasObject, - "The stacktrace must have a function having an object has parameter" ); - $this->assertTrue( $hasArray, - "The stacktrace must have a function having an array has parameter" ); - - # Now we redact the trace.. and make sure no function arguments are - # arrays or objects. - $redacted = MWExceptionHandler::getRedactedTrace( $e ); - - foreach ( $redacted as $frame ) { - if ( ! isset( $frame['args'] ) ) { - continue; - } - foreach ( $frame['args'] as $arg ) { - $this->assertNotInternalType( 'array', $arg); - $this->assertNotInternalType( 'object', $arg); - } - } - } - - /** - * Helper function for testExpandArgumentsInCall - * - * Pass it an object and an array :-) - * - * @throws Exception - */ - protected static function helperThrowAnException( $a, $b ) { - throw new Exception(); - } -} diff --git a/tests/phpunit/includes/MWFunctionTest.php b/tests/phpunit/includes/MWFunctionTest.php deleted file mode 100644 index d86f2c9b..00000000 --- a/tests/phpunit/includes/MWFunctionTest.php +++ /dev/null @@ -1,30 +0,0 @@ -assertEquals( - MWFunction::newObj( 'MWBlankClass', $args )->args, - $newObject->args - ); - } -} - -class MWBlankClass { - - public $args = array(); - - function __construct( $arg1, $arg2, $arg3, $arg4 ) { - $this->args = array( $arg1, $arg2, $arg3, $arg4 ); - } -} - -class ExampleObject { -} diff --git a/tests/phpunit/includes/MWNamespaceTest.php b/tests/phpunit/includes/MWNamespaceTest.php deleted file mode 100644 index 10e9db61..00000000 --- a/tests/phpunit/includes/MWNamespaceTest.php +++ /dev/null @@ -1,571 +0,0 @@ -setMwGlobals( array( - 'wgContentNamespaces' => array( NS_MAIN ), - 'wgNamespacesWithSubpages' => array( - NS_TALK => true, - NS_USER => true, - NS_USER_TALK => true, - ), - 'wgCapitalLinks' => true, - 'wgCapitalLinkOverrides' => array(), - 'wgNonincludableNamespaces' => array(), - ) ); - } - -#### START OF TESTS ######################################################### - - /** - * @todo Write more texts, handle $wgAllowImageMoving setting - */ - public function testIsMovable() { - $this->assertFalse( MWNamespace::isMovable( NS_CATEGORY ) ); - # @todo FIXME: Write more tests!! - } - - /** - * Please make sure to change testIsTalk() if you change the assertions below - */ - public function testIsSubject() { - // Special namespaces - $this->assertIsSubject( NS_MEDIA ); - $this->assertIsSubject( NS_SPECIAL ); - - // Subject pages - $this->assertIsSubject( NS_MAIN ); - $this->assertIsSubject( NS_USER ); - $this->assertIsSubject( 100 ); # user defined - - // Talk pages - $this->assertIsNotSubject( NS_TALK ); - $this->assertIsNotSubject( NS_USER_TALK ); - $this->assertIsNotSubject( 101 ); # user defined - } - - /** - * Reverse of testIsSubject(). - * Please update testIsSubject() if you change assertions below - */ - public function testIsTalk() { - // Special namespaces - $this->assertIsNotTalk( NS_MEDIA ); - $this->assertIsNotTalk( NS_SPECIAL ); - - // Subject pages - $this->assertIsNotTalk( NS_MAIN ); - $this->assertIsNotTalk( NS_USER ); - $this->assertIsNotTalk( 100 ); # user defined - - // Talk pages - $this->assertIsTalk( NS_TALK ); - $this->assertIsTalk( NS_USER_TALK ); - $this->assertIsTalk( 101 ); # user defined - } - - /** - */ - public function testGetSubject() { - // Special namespaces are their own subjects - $this->assertEquals( NS_MEDIA, MWNamespace::getSubject( NS_MEDIA ) ); - $this->assertEquals( NS_SPECIAL, MWNamespace::getSubject( NS_SPECIAL ) ); - - $this->assertEquals( NS_MAIN, MWNamespace::getSubject( NS_TALK ) ); - $this->assertEquals( NS_USER, MWNamespace::getSubject( NS_USER_TALK ) ); - } - - /** - * Regular getTalk() calls - * Namespaces without a talk page (NS_MEDIA, NS_SPECIAL) are tested in - * the function testGetTalkExceptions() - */ - public function testGetTalk() { - $this->assertEquals( NS_TALK, MWNamespace::getTalk( NS_MAIN ) ); - $this->assertEquals( NS_TALK, MWNamespace::getTalk( NS_TALK ) ); - $this->assertEquals( NS_USER_TALK, MWNamespace::getTalk( NS_USER ) ); - $this->assertEquals( NS_USER_TALK, MWNamespace::getTalk( NS_USER_TALK ) ); - } - - /** - * Exceptions with getTalk() - * NS_MEDIA does not have talk pages. MediaWiki raise an exception for them. - * @expectedException MWException - */ - public function testGetTalkExceptionsForNsMedia() { - $this->assertNull( MWNamespace::getTalk( NS_MEDIA ) ); - } - - /** - * Exceptions with getTalk() - * NS_SPECIAL does not have talk pages. MediaWiki raise an exception for them. - * @expectedException MWException - */ - public function testGetTalkExceptionsForNsSpecial() { - $this->assertNull( MWNamespace::getTalk( NS_SPECIAL ) ); - } - - /** - * Regular getAssociated() calls - * Namespaces without an associated page (NS_MEDIA, NS_SPECIAL) are tested in - * the function testGetAssociatedExceptions() - */ - public function testGetAssociated() { - $this->assertEquals( NS_TALK, MWNamespace::getAssociated( NS_MAIN ) ); - $this->assertEquals( NS_MAIN, MWNamespace::getAssociated( NS_TALK ) ); - } - - ### Exceptions with getAssociated() - ### NS_MEDIA and NS_SPECIAL do not have talk pages. MediaWiki raises - ### an exception for them. - /** - * @expectedException MWException - */ - public function testGetAssociatedExceptionsForNsMedia() { - $this->assertNull( MWNamespace::getAssociated( NS_MEDIA ) ); - } - - /** - * @expectedException MWException - */ - public function testGetAssociatedExceptionsForNsSpecial() { - $this->assertNull( MWNamespace::getAssociated( NS_SPECIAL ) ); - } - - /** - * @todo Implement testExists(). - */ - /* - public function testExists() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.' - ); - } - */ - - /** - * Test MWNamespace::equals - * Note if we add a namespace registration system with keys like 'MAIN' - * we should add tests here for equivilance on things like 'MAIN' == 0 - * and 'MAIN' == NS_MAIN. - */ - public function testEquals() { - $this->assertTrue( MWNamespace::equals( NS_MAIN, NS_MAIN ) ); - $this->assertTrue( MWNamespace::equals( NS_MAIN, 0 ) ); // In case we make NS_MAIN 'MAIN' - $this->assertTrue( MWNamespace::equals( NS_USER, NS_USER ) ); - $this->assertTrue( MWNamespace::equals( NS_USER, 2 ) ); - $this->assertTrue( MWNamespace::equals( NS_USER_TALK, NS_USER_TALK ) ); - $this->assertTrue( MWNamespace::equals( NS_SPECIAL, NS_SPECIAL ) ); - $this->assertFalse( MWNamespace::equals( NS_MAIN, NS_TALK ) ); - $this->assertFalse( MWNamespace::equals( NS_USER, NS_USER_TALK ) ); - $this->assertFalse( MWNamespace::equals( NS_PROJECT, NS_TEMPLATE ) ); - } - - /** - * Test MWNamespace::subjectEquals - */ - public function testSubjectEquals() { - $this->assertSameSubject( NS_MAIN, NS_MAIN ); - $this->assertSameSubject( NS_MAIN, 0 ); // In case we make NS_MAIN 'MAIN' - $this->assertSameSubject( NS_USER, NS_USER ); - $this->assertSameSubject( NS_USER, 2 ); - $this->assertSameSubject( NS_USER_TALK, NS_USER_TALK ); - $this->assertSameSubject( NS_SPECIAL, NS_SPECIAL ); - $this->assertSameSubject( NS_MAIN, NS_TALK ); - $this->assertSameSubject( NS_USER, NS_USER_TALK ); - - $this->assertDifferentSubject( NS_PROJECT, NS_TEMPLATE ); - $this->assertDifferentSubject( NS_SPECIAL, NS_MAIN ); - } - - public function testSpecialAndMediaAreDifferentSubjects() { - $this->assertDifferentSubject( - NS_MEDIA, NS_SPECIAL, - "NS_MEDIA and NS_SPECIAL are different subject namespaces" - ); - $this->assertDifferentSubject( - NS_SPECIAL, NS_MEDIA, - "NS_SPECIAL and NS_MEDIA are different subject namespaces" - ); - } - - /** - * @todo Implement testGetCanonicalNamespaces(). - */ - /* - public function testGetCanonicalNamespaces() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.' - ); - } - */ - /** - * @todo Implement testGetCanonicalName(). - */ - /* - public function testGetCanonicalName() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.' - ); - } - */ - /** - * @todo Implement testGetCanonicalIndex(). - */ - /* - public function testGetCanonicalIndex() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.' - ); - } - */ - - /** - * @todo Implement testGetValidNamespaces(). - */ - /* - public function testGetValidNamespaces() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.' - ); - } - */ - - /** - */ - public function testCanTalk() { - $this->assertCanNotTalk( NS_MEDIA ); - $this->assertCanNotTalk( NS_SPECIAL ); - - $this->assertCanTalk( NS_MAIN ); - $this->assertCanTalk( NS_TALK ); - $this->assertCanTalk( NS_USER ); - $this->assertCanTalk( NS_USER_TALK ); - - // User defined namespaces - $this->assertCanTalk( 100 ); - $this->assertCanTalk( 101 ); - } - - /** - */ - public function testIsContent() { - // NS_MAIN is a content namespace per DefaultSettings.php - // and per function definition. - - $this->assertIsContent( NS_MAIN ); - - // Other namespaces which are not expected to be content - - $this->assertIsNotContent( NS_MEDIA ); - $this->assertIsNotContent( NS_SPECIAL ); - $this->assertIsNotContent( NS_TALK ); - $this->assertIsNotContent( NS_USER ); - $this->assertIsNotContent( NS_CATEGORY ); - $this->assertIsNotContent( 100 ); - } - - /** - * Similar to testIsContent() but alters the $wgContentNamespaces - * global variable. - */ - public function testIsContentAdvanced() { - global $wgContentNamespaces; - - // Test that user defined namespace #252 is not content - $this->assertIsNotContent( 252 ); - - // Bless namespace # 252 as a content namespace - $wgContentNamespaces[] = 252; - - $this->assertIsContent( 252 ); - - // Makes sure NS_MAIN was not impacted - $this->assertIsContent( NS_MAIN ); - } - - public function testIsWatchable() { - // Specials namespaces are not watchable - $this->assertIsNotWatchable( NS_MEDIA ); - $this->assertIsNotWatchable( NS_SPECIAL ); - - // Core defined namespaces are watchables - $this->assertIsWatchable( NS_MAIN ); - $this->assertIsWatchable( NS_TALK ); - - // Additional, user defined namespaces are watchables - $this->assertIsWatchable( 100 ); - $this->assertIsWatchable( 101 ); - } - - public function testHasSubpages() { - global $wgNamespacesWithSubpages; - - // Special namespaces: - $this->assertHasNotSubpages( NS_MEDIA ); - $this->assertHasNotSubpages( NS_SPECIAL ); - - // Namespaces without subpages - $this->assertHasNotSubpages( NS_MAIN ); - - $wgNamespacesWithSubpages[NS_MAIN] = true; - $this->assertHasSubpages( NS_MAIN ); - - $wgNamespacesWithSubpages[NS_MAIN] = false; - $this->assertHasNotSubpages( NS_MAIN ); - - // Some namespaces with subpages - $this->assertHasSubpages( NS_TALK ); - $this->assertHasSubpages( NS_USER ); - $this->assertHasSubpages( NS_USER_TALK ); - } - - /** - */ - public function testGetContentNamespaces() { - global $wgContentNamespaces; - - $this->assertEquals( - array( NS_MAIN ), - MWNamespace::getContentNamespaces(), - '$wgContentNamespaces is an array with only NS_MAIN by default' - ); - - # test !is_array( $wgcontentNamespaces ) - $wgContentNamespaces = ''; - $this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() ); - - $wgContentNamespaces = false; - $this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() ); - - $wgContentNamespaces = null; - $this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() ); - - $wgContentNamespaces = 5; - $this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() ); - - # test $wgContentNamespaces === array() - $wgContentNamespaces = array(); - $this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() ); - - # test !in_array( NS_MAIN, $wgContentNamespaces ) - $wgContentNamespaces = array( NS_USER, NS_CATEGORY ); - $this->assertEquals( - array( NS_MAIN, NS_USER, NS_CATEGORY ), - MWNamespace::getContentNamespaces(), - 'NS_MAIN is forced in $wgContentNamespaces even if unwanted' - ); - - # test other cases, return $wgcontentNamespaces as is - $wgContentNamespaces = array( NS_MAIN ); - $this->assertEquals( - array( NS_MAIN ), - MWNamespace::getContentNamespaces() - ); - - $wgContentNamespaces = array( NS_MAIN, NS_USER, NS_CATEGORY ); - $this->assertEquals( - array( NS_MAIN, NS_USER, NS_CATEGORY ), - MWNamespace::getContentNamespaces() - ); - } - - /** - */ - public function testGetSubjectNamespaces() { - $subjectsNS = MWNamespace::getSubjectNamespaces(); - $this->assertContains( NS_MAIN, $subjectsNS, - "Talk namespaces should have NS_MAIN" ); - $this->assertNotContains( NS_TALK, $subjectsNS, - "Talk namespaces should have NS_TALK" ); - - $this->assertNotContains( NS_MEDIA, $subjectsNS, - "Talk namespaces should not have NS_MEDIA" ); - $this->assertNotContains( NS_SPECIAL, $subjectsNS, - "Talk namespaces should not have NS_SPECIAL" ); - } - - /** - */ - public function testGetTalkNamespaces() { - $talkNS = MWNamespace::getTalkNamespaces(); - $this->assertContains( NS_TALK, $talkNS, - "Subject namespaces should have NS_TALK" ); - $this->assertNotContains( NS_MAIN, $talkNS, - "Subject namespaces should not have NS_MAIN" ); - - $this->assertNotContains( NS_MEDIA, $talkNS, - "Subject namespaces should not have NS_MEDIA" ); - $this->assertNotContains( NS_SPECIAL, $talkNS, - "Subject namespaces should not have NS_SPECIAL" ); - } - - /** - * Some namespaces are always capitalized per code definition - * in MWNamespace::$alwaysCapitalizedNamespaces - */ - public function testIsCapitalizedHardcodedAssertions() { - // NS_MEDIA and NS_FILE are treated the same - $this->assertEquals( - MWNamespace::isCapitalized( NS_MEDIA ), - MWNamespace::isCapitalized( NS_FILE ), - 'NS_MEDIA and NS_FILE have same capitalization rendering' - ); - - // Boths are capitalized by default - $this->assertIsCapitalized( NS_MEDIA ); - $this->assertIsCapitalized( NS_FILE ); - - // Always capitalized namespaces - // @see MWNamespace::$alwaysCapitalizedNamespaces - $this->assertIsCapitalized( NS_SPECIAL ); - $this->assertIsCapitalized( NS_USER ); - $this->assertIsCapitalized( NS_MEDIAWIKI ); - } - - /** - * Follows up for testIsCapitalizedHardcodedAssertions() but alter the - * global $wgCapitalLink setting to have extended coverage. - * - * MWNamespace::isCapitalized() rely on two global settings: - * $wgCapitalLinkOverrides = array(); by default - * $wgCapitalLinks = true; by default - * This function test $wgCapitalLinks - * - * Global setting correctness is tested against the NS_PROJECT and - * NS_PROJECT_TALK namespaces since they are not hardcoded nor specials - */ - public function testIsCapitalizedWithWgCapitalLinks() { - global $wgCapitalLinks; - - $this->assertIsCapitalized( NS_PROJECT ); - $this->assertIsCapitalized( NS_PROJECT_TALK ); - - $wgCapitalLinks = false; - - // hardcoded namespaces (see above function) are still capitalized: - $this->assertIsCapitalized( NS_SPECIAL ); - $this->assertIsCapitalized( NS_USER ); - $this->assertIsCapitalized( NS_MEDIAWIKI ); - - // setting is correctly applied - $this->assertIsNotCapitalized( NS_PROJECT ); - $this->assertIsNotCapitalized( NS_PROJECT_TALK ); - } - - /** - * Counter part for MWNamespace::testIsCapitalizedWithWgCapitalLinks() now - * testing the $wgCapitalLinkOverrides global. - * - * @todo split groups of assertions in autonomous testing functions - */ - public function testIsCapitalizedWithWgCapitalLinkOverrides() { - global $wgCapitalLinkOverrides; - - // Test default settings - $this->assertIsCapitalized( NS_PROJECT ); - $this->assertIsCapitalized( NS_PROJECT_TALK ); - - // hardcoded namespaces (see above function) are capitalized: - $this->assertIsCapitalized( NS_SPECIAL ); - $this->assertIsCapitalized( NS_USER ); - $this->assertIsCapitalized( NS_MEDIAWIKI ); - - // Hardcoded namespaces remains capitalized - $wgCapitalLinkOverrides[NS_SPECIAL] = false; - $wgCapitalLinkOverrides[NS_USER] = false; - $wgCapitalLinkOverrides[NS_MEDIAWIKI] = false; - - $this->assertIsCapitalized( NS_SPECIAL ); - $this->assertIsCapitalized( NS_USER ); - $this->assertIsCapitalized( NS_MEDIAWIKI ); - - $wgCapitalLinkOverrides[NS_PROJECT] = false; - $this->assertIsNotCapitalized( NS_PROJECT ); - - $wgCapitalLinkOverrides[NS_PROJECT] = true; - $this->assertIsCapitalized( NS_PROJECT ); - - unset( $wgCapitalLinkOverrides[NS_PROJECT] ); - $this->assertIsCapitalized( NS_PROJECT ); - } - - public function testHasGenderDistinction() { - // Namespaces with gender distinctions - $this->assertTrue( MWNamespace::hasGenderDistinction( NS_USER ) ); - $this->assertTrue( MWNamespace::hasGenderDistinction( NS_USER_TALK ) ); - - // Other ones, "genderless" - $this->assertFalse( MWNamespace::hasGenderDistinction( NS_MEDIA ) ); - $this->assertFalse( MWNamespace::hasGenderDistinction( NS_SPECIAL ) ); - $this->assertFalse( MWNamespace::hasGenderDistinction( NS_MAIN ) ); - $this->assertFalse( MWNamespace::hasGenderDistinction( NS_TALK ) ); - } - - public function testIsNonincludable() { - global $wgNonincludableNamespaces; - - $wgNonincludableNamespaces = array( NS_USER ); - - $this->assertTrue( MWNamespace::isNonincludable( NS_USER ) ); - $this->assertFalse( MWNamespace::isNonincludable( NS_TEMPLATE ) ); - } - - ####### HELPERS ########################################################### - function __call( $method, $args ) { - // Call the real method if it exists - if ( method_exists( $this, $method ) ) { - return $this->$method( $args ); - } - - if ( preg_match( '/^assert(Has|Is|Can)(Not|)(Subject|Talk|Watchable|Content|Subpages|Capitalized)$/', $method, $m ) ) { - # Interprets arguments: - $ns = $args[0]; - $msg = isset( $args[1] ) ? $args[1] : " dummy message"; - - # Forge the namespace constant name: - if ( $ns === 0 ) { - $ns_name = "NS_MAIN"; - } else { - $ns_name = "NS_" . strtoupper( MWNamespace::getCanonicalName( $ns ) ); - } - # ... and the MWNamespace method name - $nsMethod = strtolower( $m[1] ) . $m[3]; - - $expect = ( $m[2] === '' ); - $expect_name = $expect ? 'TRUE' : 'FALSE'; - - return $this->assertEquals( $expect, - MWNamespace::$nsMethod( $ns, $msg ), - "MWNamespace::$nsMethod( $ns_name ) should returns $expect_name" - ); - } - - throw new Exception( __METHOD__ . " could not find a method named $method\n" ); - } - - function assertSameSubject( $ns1, $ns2, $msg = '' ) { - $this->assertTrue( MWNamespace::subjectEquals( $ns1, $ns2, $msg ) ); - } - - function assertDifferentSubject( $ns1, $ns2, $msg = '' ) { - $this->assertFalse( MWNamespace::subjectEquals( $ns1, $ns2, $msg ) ); - } -} diff --git a/tests/phpunit/includes/MessageTest.php b/tests/phpunit/includes/MessageTest.php deleted file mode 100644 index 1e18f975..00000000 --- a/tests/phpunit/includes/MessageTest.php +++ /dev/null @@ -1,130 +0,0 @@ -setMwGlobals( array( - 'wgLang' => Language::factory( 'en' ), - 'wgForceUIMsgAsContentMsg' => array(), - ) ); - } - - public function testExists() { - $this->assertTrue( wfMessage( 'mainpage' )->exists() ); - $this->assertTrue( wfMessage( 'mainpage' )->params( array() )->exists() ); - $this->assertTrue( wfMessage( 'mainpage' )->rawParams( 'foo', 123 )->exists() ); - $this->assertFalse( wfMessage( 'i-dont-exist-evar' )->exists() ); - $this->assertFalse( wfMessage( 'i-dont-exist-evar' )->params( array() )->exists() ); - $this->assertFalse( wfMessage( 'i-dont-exist-evar' )->rawParams( 'foo', 123 )->exists() ); - } - - public function testKey() { - $this->assertInstanceOf( 'Message', wfMessage( 'mainpage' ) ); - $this->assertInstanceOf( 'Message', wfMessage( 'i-dont-exist-evar' ) ); - $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->text() ); - $this->assertEquals( '<i-dont-exist-evar>', wfMessage( 'i-dont-exist-evar' )->text() ); - $this->assertEquals( '', wfMessage( 'i-dont-exist-evar' )->plain() ); - $this->assertEquals( '<i-dont-exist-evar>', wfMessage( 'i-dont-exist-evar' )->escaped() ); - } - - public function testInLanguage() { - $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inLanguage( 'en' )->text() ); - $this->assertEquals( 'Заглавная страница', wfMessage( 'mainpage' )->inLanguage( 'ru' )->text() ); - $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inLanguage( Language::factory( 'en' ) )->text() ); - $this->assertEquals( 'Заглавная страница', wfMessage( 'mainpage' )->inLanguage( Language::factory( 'ru' ) )->text() ); - } - - public function testMessageParams() { - $this->assertEquals( 'Return to $1.', wfMessage( 'returnto' )->text() ); - $this->assertEquals( 'Return to $1.', wfMessage( 'returnto', array() )->text() ); - $this->assertEquals( 'You have foo (bar).', wfMessage( 'youhavenewmessages', 'foo', 'bar' )->text() ); - $this->assertEquals( 'You have foo (bar).', wfMessage( 'youhavenewmessages', array( 'foo', 'bar' ) )->text() ); - } - - public function testMessageParamSubstitution() { - $this->assertEquals( '(Заглавная страница)', wfMessage( 'parentheses', 'Заглавная страница' )->plain() ); - $this->assertEquals( '(Заглавная страница $1)', wfMessage( 'parentheses', 'Заглавная страница $1' )->plain() ); - $this->assertEquals( '(Заглавная страница)', wfMessage( 'parentheses' )->rawParams( 'Заглавная страница' )->plain() ); - $this->assertEquals( '(Заглавная страница $1)', wfMessage( 'parentheses' )->rawParams( 'Заглавная страница $1' )->plain() ); - } - - public function testDeliciouslyManyParams() { - $msg = new RawMessage( '$1$2$3$4$5$6$7$8$9$10$11$12' ); - // One less than above has placeholders - $params = array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k' ); - $this->assertEquals( 'abcdefghijka2', $msg->params( $params )->plain(), 'Params > 9 are replaced correctly' ); - } - - /** - * FIXME: This should not need database, but Language#formatExpiry does (bug 55912) - * @group Database - */ - public function testMessageParamTypes() { - $lang = Language::factory( 'en' ); - - $msg = new RawMessage( '$1' ); - $this->assertEquals( - $lang->formatNum( 123456.789 ), - $msg->inLanguage( $lang )->numParams( 123456.789 )->plain(), - 'numParams is handled correctly' - ); - - $msg = new RawMessage( '$1' ); - $this->assertEquals( - $lang->formatDuration( 1234 ), - $msg->inLanguage( $lang )->durationParams( 1234 )->plain(), - 'durationParams is handled correctly' - ); - - $msg = new RawMessage( '$1' ); - $this->assertEquals( - $lang->formatExpiry( wfTimestampNow() ), - $msg->inLanguage( $lang )->expiryParams( wfTimestampNow() )->plain(), - 'expiryParams is handled correctly' - ); - - $msg = new RawMessage( '$1' ); - $this->assertEquals( - $lang->formatTimePeriod( 1234 ), - $msg->inLanguage( $lang )->timeperiodParams( 1234 )->plain(), - 'timeperiodParams is handled correctly' - ); - - $msg = new RawMessage( '$1' ); - $this->assertEquals( - $lang->formatSize( 123456 ), - $msg->inLanguage( $lang )->sizeParams( 123456 )->plain(), - 'sizeParams is handled correctly' - ); - - $msg = new RawMessage( '$1' ); - $this->assertEquals( - $lang->formatBitrate( 123456 ), - $msg->inLanguage( $lang )->bitrateParams( 123456 )->plain(), - 'bitrateParams is handled correctly' - ); - } - - public function testInContentLanguageDisabled() { - $this->setMwGlobals( 'wgLang', Language::factory( 'fr' ) ); - - $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inContentLanguage()->plain(), 'ForceUIMsg disabled' ); - } - - public function testInContentLanguageEnabled() { - $this->setMwGlobals( array( - 'wgLang' => Language::factory( 'fr' ), - 'wgForceUIMsgAsContentMsg' => array( 'mainpage' ), - ) ); - - $this->assertEquals( 'Accueil', wfMessage( 'mainpage' )->inContentLanguage()->plain(), 'ForceUIMsg enabled' ); - } - - /** - * @expectedException MWException - */ - public function testInLanguageThrows() { - wfMessage( 'foo' )->inLanguage( 123 ); - } -} diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php deleted file mode 100644 index 56bb0fce..00000000 --- a/tests/phpunit/includes/OutputPageTest.php +++ /dev/null @@ -1,133 +0,0 @@ -setMWGlobals( array( - 'wgRequest' => $fauxRequest, - ) ); - - $actualReturn = OutputPage::transformCssMedia( $args['media'] ); - $this->assertSame( $args['expectedReturn'], $actualReturn, $args['message'] ); - } - - /** - * Tests print requests - */ - public function testPrintRequests() { - $this->assertTransformCssMediaCase( array( - 'printableQuery' => '1', - 'media' => 'screen', - 'expectedReturn' => null, - 'message' => 'On printable request, screen returns null' - ) ); - - $this->assertTransformCssMediaCase( array( - 'printableQuery' => '1', - 'media' => self::SCREEN_MEDIA_QUERY, - 'expectedReturn' => null, - 'message' => 'On printable request, screen media query returns null' - ) ); - - $this->assertTransformCssMediaCase( array( - 'printableQuery' => '1', - 'media' => self::SCREEN_ONLY_MEDIA_QUERY, - 'expectedReturn' => null, - 'message' => 'On printable request, screen media query with only returns null' - ) ); - - $this->assertTransformCssMediaCase( array( - 'printableQuery' => '1', - 'media' => 'print', - 'expectedReturn' => '', - 'message' => 'On printable request, media print returns empty string' - ) ); - } - - /** - * Tests screen requests, without either query parameter set - */ - public function testScreenRequests() { - $this->assertTransformCssMediaCase( array( - 'media' => 'screen', - 'expectedReturn' => 'screen', - 'message' => 'On screen request, screen media type is preserved' - ) ); - - $this->assertTransformCssMediaCase( array( - 'media' => 'handheld', - 'expectedReturn' => 'handheld', - 'message' => 'On screen request, handheld media type is preserved' - ) ); - - $this->assertTransformCssMediaCase( array( - 'media' => self::SCREEN_MEDIA_QUERY, - 'expectedReturn' => self::SCREEN_MEDIA_QUERY, - 'message' => 'On screen request, screen media query is preserved.' - ) ); - - $this->assertTransformCssMediaCase( array( - 'media' => self::SCREEN_ONLY_MEDIA_QUERY, - 'expectedReturn' => self::SCREEN_ONLY_MEDIA_QUERY, - 'message' => 'On screen request, screen media query with only is preserved.' - ) ); - - $this->assertTransformCssMediaCase( array( - 'media' => 'print', - 'expectedReturn' => 'print', - 'message' => 'On screen request, print media type is preserved' - ) ); - } - - /** - * Tests handheld behavior - */ - public function testHandheld() { - $this->assertTransformCssMediaCase( array( - 'handheldQuery' => '1', - 'media' => 'handheld', - 'expectedReturn' => '', - 'message' => 'On request with handheld querystring and media is handheld, returns empty string' - ) ); - - $this->assertTransformCssMediaCase( array( - 'handheldQuery' => '1', - 'media' => 'screen', - 'expectedReturn' => null, - 'message' => 'On request with handheld querystring and media is screen, returns null' - ) ); - } -} diff --git a/tests/phpunit/includes/PathRouterTest.php b/tests/phpunit/includes/PathRouterTest.php deleted file mode 100644 index adfb215a..00000000 --- a/tests/phpunit/includes/PathRouterTest.php +++ /dev/null @@ -1,263 +0,0 @@ -add( "/wiki/$1" ); - $this->basicRouter = $router; - } - - /** - * Test basic path parsing - */ - public function testBasic() { - $matches = $this->basicRouter->parse( "/wiki/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo" ) ); - } - - /** - * Test loose path auto-$1 - */ - public function testLoose() { - $router = new PathRouter; - $router->add( "/" ); # Should be the same as "/$1" - $matches = $router->parse( "/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo" ) ); - - $router = new PathRouter; - $router->add( "/wiki" ); # Should be the same as /wiki/$1 - $matches = $router->parse( "/wiki/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo" ) ); - - $router = new PathRouter; - $router->add( "/wiki/" ); # Should be the same as /wiki/$1 - $matches = $router->parse( "/wiki/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo" ) ); - } - - /** - * Test to ensure that path is based on specifity, not order - */ - public function testOrder() { - $router = new PathRouter; - $router->add( "/$1" ); - $router->add( "/a/$1" ); - $router->add( "/b/$1" ); - $matches = $router->parse( "/a/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo" ) ); - - $router = new PathRouter; - $router->add( "/b/$1" ); - $router->add( "/a/$1" ); - $router->add( "/$1" ); - $matches = $router->parse( "/a/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo" ) ); - } - - /** - * Test the handling of key based arrays with a url parameter - */ - public function testKeyParameter() { - $router = new PathRouter; - $router->add( array( 'edit' => "/edit/$1" ), array( 'action' => '$key' ) ); - $matches = $router->parse( "/edit/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo", 'action' => 'edit' ) ); - } - - /** - * Test the handling of $2 inside paths - */ - public function testAdditionalParameter() { - // Basic $2 - $router = new PathRouter; - $router->add( '/$2/$1', array( 'test' => '$2' ) ); - $matches = $router->parse( "/asdf/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo", 'test' => 'asdf' ) ); - } - - /** - * Test additional restricted value parameter - */ - public function testRestrictedValue() { - $router = new PathRouter; - $router->add( '/$2/$1', - array( 'test' => '$2' ), - array( '$2' => array( 'a', 'b' ) ) - ); - $router->add( '/$2/$1', - array( 'test2' => '$2' ), - array( '$2' => 'c' ) - ); - $router->add( '/$1' ); - - $matches = $router->parse( "/asdf/Foo" ); - $this->assertEquals( $matches, array( 'title' => "asdf/Foo" ) ); - - $matches = $router->parse( "/a/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo", 'test' => 'a' ) ); - - $matches = $router->parse( "/c/Foo" ); - $this->assertEquals( $matches, array( 'title' => "Foo", 'test2' => 'c' ) ); - } - - public function callbackForTest( &$matches, $data ) { - $matches['x'] = $data['$1']; - $matches['foo'] = $data['foo']; - } - - public function testCallback() { - $router = new PathRouter; - $router->add( "/$1", - array( 'a' => 'b', 'data:foo' => 'bar' ), - array( 'callback' => array( $this, 'callbackForTest' ) ) - ); - $matches = $router->parse( '/Foo' ); - $this->assertEquals( $matches, array( - 'title' => "Foo", - 'x' => 'Foo', - 'a' => 'b', - 'foo' => 'bar' - ) ); - } - - /** - * Test to ensure that matches are not made if a parameter expects nonexistent input - */ - public function testFail() { - $router = new PathRouter; - $router->add( "/wiki/$1", array( 'title' => "$1$2" ) ); - $matches = $router->parse( "/wiki/A" ); - $this->assertEquals( array(), $matches ); - } - - /** - * Test to ensure weight of paths is handled correctly - */ - public function testWeight() { - $router = new PathRouter; - $router->addStrict( "/Bar", array( 'ping' => 'pong' ) ); - $router->add( "/asdf-$1", array( 'title' => 'qwerty-$1' ) ); - $router->add( "/$1" ); - $router->add( "/qwerty-$1", array( 'title' => 'asdf-$1' ) ); - $router->addStrict( "/Baz", array( 'marco' => 'polo' ) ); - $router->add( "/a/$1" ); - $router->add( "/asdf/$1" ); - $router->add( "/$2/$1", array( 'unrestricted' => '$2' ) ); - $router->add( array( 'qwerty' => "/qwerty/$1" ), array( 'qwerty' => '$key' ) ); - $router->add( "/$2/$1", array( 'restricted-to-y' => '$2' ), array( '$2' => 'y' ) ); - - foreach ( - array( - '/Foo' => array( 'title' => 'Foo' ), - '/Bar' => array( 'ping' => 'pong' ), - '/Baz' => array( 'marco' => 'polo' ), - '/asdf-foo' => array( 'title' => 'qwerty-foo' ), - '/qwerty-bar' => array( 'title' => 'asdf-bar' ), - '/a/Foo' => array( 'title' => 'Foo' ), - '/asdf/Foo' => array( 'title' => 'Foo' ), - '/qwerty/Foo' => array( 'title' => 'Foo', 'qwerty' => 'qwerty' ), - '/baz/Foo' => array( 'title' => 'Foo', 'unrestricted' => 'baz' ), - '/y/Foo' => array( 'title' => 'Foo', 'restricted-to-y' => 'y' ), - ) as $path => $result - ) { - $this->assertEquals( $router->parse( $path ), $result ); - } - } - - /** - * Make sure the router handles titles like Special:Recentchanges correctly - */ - public function testSpecial() { - $matches = $this->basicRouter->parse( "/wiki/Special:Recentchanges" ); - $this->assertEquals( $matches, array( 'title' => "Special:Recentchanges" ) ); - } - - /** - * Make sure the router decodes urlencoding properly - */ - public function testUrlencoding() { - $matches = $this->basicRouter->parse( "/wiki/Title_With%20Space" ); - $this->assertEquals( $matches, array( 'title' => "Title_With Space" ) ); - } - - public static function provideRegexpChars() { - return array( - array( "$" ), - array( "$1" ), - array( "\\" ), - array( "\\$1" ), - ); - } - - /** - * Make sure the router doesn't break on special characters like $ used in regexp replacements - * @dataProvider provideRegexpChars - */ - public function testRegexpChars( $char ) { - $matches = $this->basicRouter->parse( "/wiki/$char" ); - $this->assertEquals( $matches, array( 'title' => "$char" ) ); - } - - /** - * Make sure the router handles characters like +&() properly - */ - public function testCharacters() { - $matches = $this->basicRouter->parse( "/wiki/Plus+And&Dollar\\Stuff();[]{}*" ); - $this->assertEquals( $matches, array( 'title' => "Plus+And&Dollar\\Stuff();[]{}*" ) ); - } - - /** - * Make sure the router handles unicode characters correctly - * @depends testSpecial - * @depends testUrlencoding - * @depends testCharacters - */ - public function testUnicode() { - $matches = $this->basicRouter->parse( "/wiki/Spécial:Modifications_récentes" ); - $this->assertEquals( $matches, array( 'title' => "Spécial:Modifications_récentes" ) ); - - $matches = $this->basicRouter->parse( "/wiki/Sp%C3%A9cial:Modifications_r%C3%A9centes" ); - $this->assertEquals( $matches, array( 'title' => "Spécial:Modifications_récentes" ) ); - } - - /** - * Ensure the router doesn't choke on long paths. - */ - public function testLength() { - $matches = $this->basicRouter->parse( "/wiki/Lorem_ipsum_dolor_sit_amet,_consectetur_adipisicing_elit,_sed_do_eiusmod_tempor_incididunt_ut_labore_et_dolore_magna_aliqua._Ut_enim_ad_minim_veniam,_quis_nostrud_exercitation_ullamco_laboris_nisi_ut_aliquip_ex_ea_commodo_consequat._Duis_aute_irure_dolor_in_reprehenderit_in_voluptate_velit_esse_cillum_dolore_eu_fugiat_nulla_pariatur._Excepteur_sint_occaecat_cupidatat_non_proident,_sunt_in_culpa_qui_officia_deserunt_mollit_anim_id_est_laborum." ); - $this->assertEquals( $matches, array( 'title' => "Lorem_ipsum_dolor_sit_amet,_consectetur_adipisicing_elit,_sed_do_eiusmod_tempor_incididunt_ut_labore_et_dolore_magna_aliqua._Ut_enim_ad_minim_veniam,_quis_nostrud_exercitation_ullamco_laboris_nisi_ut_aliquip_ex_ea_commodo_consequat._Duis_aute_irure_dolor_in_reprehenderit_in_voluptate_velit_esse_cillum_dolore_eu_fugiat_nulla_pariatur._Excepteur_sint_occaecat_cupidatat_non_proident,_sunt_in_culpa_qui_officia_deserunt_mollit_anim_id_est_laborum." ) ); - } - - - /** - * Ensure that the php passed site of parameter values are not urldecoded - */ - public function testPatternUrlencoding() { - $router = new PathRouter; - $router->add( "/wiki/$1", array( 'title' => '%20:$1' ) ); - $matches = $router->parse( "/wiki/Foo" ); - $this->assertEquals( $matches, array( 'title' => '%20:Foo' ) ); - } - - /** - * Ensure that raw parameter values do not have any variable replacements or urldecoding - */ - public function testRawParamValue() { - $router = new PathRouter; - $router->add( "/wiki/$1", array( 'title' => array( 'value' => 'bar%20$1' ) ) ); - $matches = $router->parse( "/wiki/Foo" ); - $this->assertEquals( $matches, array( 'title' => 'bar%20$1' ) ); - } -} diff --git a/tests/phpunit/includes/PreferencesTest.php b/tests/phpunit/includes/PreferencesTest.php deleted file mode 100644 index 3dec2da0..00000000 --- a/tests/phpunit/includes/PreferencesTest.php +++ /dev/null @@ -1,91 +0,0 @@ -prefUsers['noemail'] = new User; - - $this->prefUsers['notauth'] = new User; - $this->prefUsers['notauth'] - ->setEmail( 'noauth@example.org' ); - - $this->prefUsers['auth'] = new User; - $this->prefUsers['auth'] - ->setEmail( 'noauth@example.org' ); - $this->prefUsers['auth'] - ->setEmailAuthenticationTimestamp( 1330946623 ); - - $this->context = new RequestContext; - $this->context->setTitle( Title::newFromText( 'PreferencesTest' ) ); - } - - protected function setUp() { - parent::setUp(); - - $this->setMwGlobals( array( - 'wgEnableEmail' => true, - 'wgEmailAuthentication' => true, - ) ); - } - - /** - * Placeholder to verify bug 34302 - * @covers Preferences::profilePreferences - */ - public function testEmailFieldsWhenUserHasNoEmail() { - $prefs = $this->prefsFor( 'noemail' ); - $this->assertArrayHasKey( 'cssclass', - $prefs['emailaddress'] - ); - $this->assertEquals( 'mw-email-none', $prefs['emailaddress']['cssclass'] ); - } - - /** - * Placeholder to verify bug 34302 - * @covers Preferences::profilePreferences - */ - public function testEmailFieldsWhenUserEmailNotAuthenticated() { - $prefs = $this->prefsFor( 'notauth' ); - $this->assertArrayHasKey( 'cssclass', - $prefs['emailaddress'] - ); - $this->assertEquals( 'mw-email-not-authenticated', $prefs['emailaddress']['cssclass'] ); - } - - /** - * Placeholder to verify bug 34302 - * @covers Preferences::profilePreferences - */ - public function testEmailFieldsWhenUserEmailIsAuthenticated() { - $prefs = $this->prefsFor( 'auth' ); - $this->assertArrayHasKey( 'cssclass', - $prefs['emailaddress'] - ); - $this->assertEquals( 'mw-email-authenticated', $prefs['emailaddress']['cssclass'] ); - } - - /** Helper */ - protected function prefsFor( $user_key ) { - $preferences = array(); - Preferences::profilePreferences( - $this->prefUsers[$user_key] - , $this->context - , $preferences - ); - - return $preferences; - } -} diff --git a/tests/phpunit/includes/RecentChangeTest.php b/tests/phpunit/includes/RecentChangeTest.php deleted file mode 100644 index cfa3e777..00000000 --- a/tests/phpunit/includes/RecentChangeTest.php +++ /dev/null @@ -1,280 +0,0 @@ -title = Title::newFromText( 'SomeTitle' ); - $this->target = Title::newFromText( 'TestTarget' ); - $this->user = User::newFromName( 'UserName' ); - - $this->user_comment = ''; - $this->context = RequestContext::newExtraneousContext( $this->title ); - } - - /** - * The testIrcMsgForAction* tests are supposed to cover the hacky - * LogFormatter::getIRCActionText / bug 34508 - * - * Third parties bots listen to those messages. They are clever enough - * to fetch the i18n messages from the wiki and then analyze the IRC feed - * to reverse engineer the $1, $2 messages. - * One thing bots can not detect is when MediaWiki change the meaning of - * a message like what happened when we deployed 1.19. $1 became the user - * performing the action which broke basically all bots around. - * - * Should cover the following log actions (which are most commonly used by bots): - * - block/block - * - block/unblock - * - delete/delete - * - delete/restore - * - newusers/create - * - newusers/create2 - * - newusers/autocreate - * - move/move - * - move/move_redir - * - protect/protect - * - protect/modifyprotect - * - protect/unprotect - * - upload/upload - * - * As well as the following Auto Edit Summaries: - * - blank - * - replace - * - rollback - * - undo - */ - - /** - * @covers LogFormatter::getIRCActionText - */ - public function testIrcMsgForLogTypeBlock() { - $sep = $this->context->msg( 'colon-separator' )->text(); - - # block/block - $this->assertIRCComment( - $this->context->msg( 'blocklogentry', 'SomeTitle' )->plain() . $sep . $this->user_comment, - 'block', 'block', - array(), - $this->user_comment - ); - # block/unblock - $this->assertIRCComment( - $this->context->msg( 'unblocklogentry', 'SomeTitle' )->plain() . $sep . $this->user_comment, - 'block', 'unblock', - array(), - $this->user_comment - ); - } - - /** - * @covers LogFormatter::getIRCActionText - */ - public function testIrcMsgForLogTypeDelete() { - $sep = $this->context->msg( 'colon-separator' )->text(); - - # delete/delete - $this->assertIRCComment( - $this->context->msg( 'deletedarticle', 'SomeTitle' )->plain() . $sep . $this->user_comment, - 'delete', 'delete', - array(), - $this->user_comment - ); - - # delete/restore - $this->assertIRCComment( - $this->context->msg( 'undeletedarticle', 'SomeTitle' )->plain() . $sep . $this->user_comment, - 'delete', 'restore', - array(), - $this->user_comment - ); - } - - /** - * @covers LogFormatter::getIRCActionText - */ - public function testIrcMsgForLogTypeNewusers() { - $this->assertIRCComment( - 'New user account', - 'newusers', 'newusers', - array() - ); - $this->assertIRCComment( - 'New user account', - 'newusers', 'create', - array() - ); - $this->assertIRCComment( - 'created new account SomeTitle', - 'newusers', 'create2', - array() - ); - $this->assertIRCComment( - 'Account created automatically', - 'newusers', 'autocreate', - array() - ); - } - - /** - * @covers LogFormatter::getIRCActionText - */ - public function testIrcMsgForLogTypeMove() { - $move_params = array( - '4::target' => $this->target->getPrefixedText(), - '5::noredir' => 0, - ); - $sep = $this->context->msg( 'colon-separator' )->text(); - - # move/move - $this->assertIRCComment( - $this->context->msg( '1movedto2', 'SomeTitle', 'TestTarget' )->plain() . $sep . $this->user_comment, - 'move', 'move', - $move_params, - $this->user_comment - ); - - # move/move_redir - $this->assertIRCComment( - $this->context->msg( '1movedto2_redir', 'SomeTitle', 'TestTarget' )->plain() . $sep . $this->user_comment, - 'move', 'move_redir', - $move_params, - $this->user_comment - ); - } - - /** - * @covers LogFormatter::getIRCActionText - */ - public function testIrcMsgForLogTypePatrol() { - # patrol/patrol - $this->assertIRCComment( - $this->context->msg( 'patrol-log-line', 'revision 777', '[[SomeTitle]]', '' )->plain(), - 'patrol', 'patrol', - array( - '4::curid' => '777', - '5::previd' => '666', - '6::auto' => 0, - ) - ); - } - - /** - * @covers LogFormatter::getIRCActionText - */ - public function testIrcMsgForLogTypeProtect() { - $protectParams = array( - '[edit=sysop] (indefinite) ‎[move=sysop] (indefinite)' - ); - $sep = $this->context->msg( 'colon-separator' )->text(); - - # protect/protect - $this->assertIRCComment( - $this->context->msg( 'protectedarticle', 'SomeTitle ' . $protectParams[0] )->plain() . $sep . $this->user_comment, - 'protect', 'protect', - $protectParams, - $this->user_comment - ); - - # protect/unprotect - $this->assertIRCComment( - $this->context->msg( 'unprotectedarticle', 'SomeTitle' )->plain() . $sep . $this->user_comment, - 'protect', 'unprotect', - array(), - $this->user_comment - ); - - # protect/modify - $this->assertIRCComment( - $this->context->msg( 'modifiedarticleprotection', 'SomeTitle ' . $protectParams[0] )->plain() . $sep . $this->user_comment, - 'protect', 'modify', - $protectParams, - $this->user_comment - ); - } - - /** - * @covers LogFormatter::getIRCActionText - */ - public function testIrcMsgForLogTypeUpload() { - $sep = $this->context->msg( 'colon-separator' )->text(); - - # upload/upload - $this->assertIRCComment( - $this->context->msg( 'uploadedimage', 'SomeTitle' )->plain() . $sep . $this->user_comment, - 'upload', 'upload', - array(), - $this->user_comment - ); - - # upload/overwrite - $this->assertIRCComment( - $this->context->msg( 'overwroteimage', 'SomeTitle' )->plain() . $sep . $this->user_comment, - 'upload', 'overwrite', - array(), - $this->user_comment - ); - } - - /** - * @todo Emulate these edits somehow and extract - * raw edit summary from RecentChange object - * -- - */ - /* - public function testIrcMsgForBlankingAES() { - // $this->context->msg( 'autosumm-blank', .. ); - } - - public function testIrcMsgForReplaceAES() { - // $this->context->msg( 'autosumm-replace', .. ); - } - - public function testIrcMsgForRollbackAES() { - // $this->context->msg( 'revertpage', .. ); - } - - public function testIrcMsgForUndoAES() { - // $this->context->msg( 'undo-summary', .. ); - } - */ - - /** - * @param $expected String Expected IRC text without colors codes - * @param $type String Log type (move, delete, suppress, patrol ...) - * @param $action String A log type action - * @param $params - * @param $comment String (optional) A comment for the log action - * @param $msg String (optional) A message for PHPUnit :-) - */ - protected function assertIRCComment( $expected, $type, $action, $params, $comment = null, $msg = '' ) { - - $logEntry = new ManualLogEntry( $type, $action ); - $logEntry->setPerformer( $this->user ); - $logEntry->setTarget( $this->title ); - if ( $comment !== null ) { - $logEntry->setComment( $comment ); - } - $logEntry->setParameters( $params ); - - $formatter = LogFormatter::newFromEntry( $logEntry ); - $formatter->setContext( $this->context ); - - // Apply the same transformation as done in IRCColourfulRCFeedFormatter::getLine for rc_comment - $ircRcComment = IRCColourfulRCFeedFormatter::cleanupForIRC( $formatter->getIRCActionComment() ); - - $this->assertEquals( - $expected, - $ircRcComment, - $msg - ); - } -} diff --git a/tests/phpunit/includes/RequestContextTest.php b/tests/phpunit/includes/RequestContextTest.php deleted file mode 100644 index 1776b5d5..00000000 --- a/tests/phpunit/includes/RequestContextTest.php +++ /dev/null @@ -1,73 +0,0 @@ -setTitle( $curTitle ); - $this->assertTrue( $curTitle->equals( $context->getWikiPage()->getTitle() ), - "When a title is first set WikiPage should be created on-demand for that title." ); - - $curTitle = Title::newFromText( "B" ); - $context->setWikiPage( WikiPage::factory( $curTitle ) ); - $this->assertTrue( $curTitle->equals( $context->getTitle() ), - "Title must be updated when a new WikiPage is provided." ); - - $curTitle = Title::newFromText( "C" ); - $context->setTitle( $curTitle ); - $this->assertTrue( $curTitle->equals( $context->getWikiPage()->getTitle() ), - "When a title is updated the WikiPage should be purged and recreated on-demand with the new title." ); - } - - /** - * @covers RequestContext::importScopedSession - */ - public function testImportScopedSession() { - $context = RequestContext::getMain(); - - $oInfo = $context->exportSession(); - $this->assertEquals( '127.0.0.1', $oInfo['ip'], "Correct initial IP address." ); - $this->assertEquals( 0, $oInfo['userId'], "Correct initial user ID." ); - - $user = User::newFromName( 'UnitTestContextUser' ); - $user->addToDatabase(); - - $sinfo = array( - 'sessionId' => 'd612ee607c87e749ef14da4983a702cd', - 'userId' => $user->getId(), - 'ip' => '192.0.2.0', - 'headers' => array( 'USER-AGENT' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0' ) - ); - $sc = RequestContext::importScopedSession( $sinfo ); // load new context - - $info = $context->exportSession(); - $this->assertEquals( $sinfo['ip'], $info['ip'], "Correct IP address." ); - $this->assertEquals( $sinfo['headers'], $info['headers'], "Correct headers." ); - $this->assertEquals( $sinfo['sessionId'], $info['sessionId'], "Correct session ID." ); - $this->assertEquals( $sinfo['userId'], $info['userId'], "Correct user ID." ); - $this->assertEquals( $sinfo['ip'], $context->getRequest()->getIP(), "Correct context IP address." ); - $this->assertEquals( $sinfo['headers'], $context->getRequest()->getAllHeaders(), "Correct context headers." ); - $this->assertEquals( $sinfo['sessionId'], session_id(), "Correct context session ID." ); - $this->assertEquals( true, $context->getUser()->isLoggedIn(), "Correct context user." ); - $this->assertEquals( $sinfo['userId'], $context->getUser()->getId(), "Correct context user ID." ); - $this->assertEquals( 'UnitTestContextUser', $context->getUser()->getName(), "Correct context user name." ); - - unset( $sc ); // restore previous context - - $info = $context->exportSession(); - $this->assertEquals( $oInfo['ip'], $info['ip'], "Correct initial IP address." ); - $this->assertEquals( $oInfo['headers'], $info['headers'], "Correct initial headers." ); - $this->assertEquals( $oInfo['sessionId'], $info['sessionId'], "Correct initial session ID." ); - $this->assertEquals( $oInfo['userId'], $info['userId'], "Correct initial user ID." ); - } -} diff --git a/tests/phpunit/includes/ResourceLoaderTest.php b/tests/phpunit/includes/ResourceLoaderTest.php deleted file mode 100644 index ca8b2b6e..00000000 --- a/tests/phpunit/includes/ResourceLoaderTest.php +++ /dev/null @@ -1,149 +0,0 @@ -setMwGlobals( array( - 'wgResourceLoaderLESSFunctions' => array( - 'test-sum' => function ( $frame, $less ) { - $sum = 0; - foreach ( $frame[2] as $arg ) { - $sum += (int)$arg[1]; - } - return $sum; - }, - ), - 'wgResourceLoaderLESSImportPaths' => array( - dirname( __DIR__ ) . '/data/less/common', - ), - 'wgResourceLoaderLESSVars' => array( - 'foo' => '2px', - 'Foo' => '#eeeeee', - 'bar' => 5, - ), - ) ); - } - - /* Hook Methods */ - - /** - * ResourceLoaderRegisterModules hook - */ - public static function resourceLoaderRegisterModules( &$resourceLoader ) { - self::$resourceLoaderRegisterModulesHook = true; - - return true; - } - - /* Provider Methods */ - public static function provideValidModules() { - return array( - array( 'TEST.validModule1', new ResourceLoaderTestModule() ), - ); - } - - public static function provideResourceLoaderContext() { - $resourceLoader = new ResourceLoader(); - $request = new FauxRequest(); - return array( - array( new ResourceLoaderContext( $resourceLoader, $request ) ), - ); - } - - /* Test Methods */ - - /** - * Ensures that the ResourceLoaderRegisterModules hook is called when a new ResourceLoader object is constructed - * @covers ResourceLoader::__construct - */ - public function testCreatingNewResourceLoaderCallsRegistrationHook() { - self::$resourceLoaderRegisterModulesHook = false; - $resourceLoader = new ResourceLoader(); - $this->assertTrue( self::$resourceLoaderRegisterModulesHook ); - - return $resourceLoader; - } - - /** - * @dataProvider provideValidModules - * @depends testCreatingNewResourceLoaderCallsRegistrationHook - * @covers ResourceLoader::register - * @covers ResourceLoader::getModule - */ - public function testRegisteredValidModulesAreAccessible( - $name, ResourceLoaderModule $module, ResourceLoader $resourceLoader - ) { - $resourceLoader->register( $name, $module ); - $this->assertEquals( $module, $resourceLoader->getModule( $name ) ); - } - - /** - * @dataProvider provideResourceLoaderContext - * @covers ResourceLoaderFileModule::compileLessFile - */ - public function testLessFileCompilation( $context ) { - $basePath = __DIR__ . '/../data/less/module'; - $module = new ResourceLoaderFileModule( array( - 'localBasePath' => $basePath, - 'styles' => array( 'styles.less' ), - ) ); - $styles = $module->getStyles( $context ); - $this->assertStringEqualsFile( $basePath . '/styles.css', $styles['all'] ); - } - - /** - * @dataProvider providePackedModules - * @covers ResourceLoader::makePackedModulesString - */ - public function testMakePackedModulesString( $desc, $modules, $packed ) { - $this->assertEquals( $packed, ResourceLoader::makePackedModulesString( $modules ), $desc ); - } - - /** - * @dataProvider providePackedModules - * @covers ResourceLoaderContext::expandModuleNames - */ - public function testexpandModuleNames( $desc, $modules, $packed ) { - $this->assertEquals( $modules, ResourceLoaderContext::expandModuleNames( $packed ), $desc ); - } - - public static function providePackedModules() { - return array( - array( - 'Example from makePackedModulesString doc comment', - array( 'foo.bar', 'foo.baz', 'bar.baz', 'bar.quux' ), - 'foo.bar,baz|bar.baz,quux', - ), - array( - 'Example from expandModuleNames doc comment', - array( 'jquery.foo', 'jquery.bar', 'jquery.ui.baz', 'jquery.ui.quux' ), - 'jquery.foo,bar|jquery.ui.baz,quux', - ), - array( - 'Regression fixed in r88706 with dotless names', - array( 'foo', 'bar', 'baz' ), - 'foo,bar,baz', - ), - array( - 'Prefixless modules after a prefixed module', - array( 'single.module', 'foobar', 'foobaz' ), - 'single.module|foobar,foobaz', - ), - ); - } -} - -/* Stubs */ - -class ResourceLoaderTestModule extends ResourceLoaderModule { -} - -/* Hooks */ -global $wgHooks; -$wgHooks['ResourceLoaderRegisterModules'][] = 'ResourceLoaderTest::resourceLoaderRegisterModules'; diff --git a/tests/phpunit/includes/RevisionStorageTest.php b/tests/phpunit/includes/RevisionStorageTest.php deleted file mode 100644 index e17c7b0f..00000000 --- a/tests/phpunit/includes/RevisionStorageTest.php +++ /dev/null @@ -1,546 +0,0 @@ -tablesUsed = array_merge( $this->tablesUsed, - array( 'page', - 'revision', - 'text', - - 'recentchanges', - 'logging', - - 'page_props', - 'pagelinks', - 'categorylinks', - 'langlinks', - 'externallinks', - 'imagelinks', - 'templatelinks', - 'iwlinks' ) ); - } - - protected function setUp() { - global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang; - - parent::setUp(); - - $wgExtraNamespaces[12312] = 'Dummy'; - $wgExtraNamespaces[12313] = 'Dummy_talk'; - - $wgNamespaceContentModels[12312] = 'DUMMY'; - $wgContentHandlers['DUMMY'] = 'DummyContentHandlerForTesting'; - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - if ( !$this->the_page ) { - $this->the_page = $this->createPage( 'RevisionStorageTest_the_page', "just a dummy page", CONTENT_MODEL_WIKITEXT ); - } - } - - public function tearDown() { - global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang; - - parent::tearDown(); - - unset( $wgExtraNamespaces[12312] ); - unset( $wgExtraNamespaces[12313] ); - - unset( $wgNamespaceContentModels[12312] ); - unset( $wgContentHandlers['DUMMY'] ); - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - } - - protected function makeRevision( $props = null ) { - if ( $props === null ) { - $props = array(); - } - - if ( !isset( $props['content'] ) && !isset( $props['text'] ) ) { - $props['text'] = 'Lorem Ipsum'; - } - - if ( !isset( $props['comment'] ) ) { - $props['comment'] = 'just a test'; - } - - if ( !isset( $props['page'] ) ) { - $props['page'] = $this->the_page->getId(); - } - - $rev = new Revision( $props ); - - $dbw = wfgetDB( DB_MASTER ); - $rev->insertOn( $dbw ); - - return $rev; - } - - protected function createPage( $page, $text, $model = null ) { - if ( is_string( $page ) ) { - if ( !preg_match( '/:/', $page ) && - ( $model === null || $model === CONTENT_MODEL_WIKITEXT ) - ) { - $ns = $this->getDefaultWikitextNS(); - $page = MWNamespace::getCanonicalName( $ns ) . ':' . $page; - } - - $page = Title::newFromText( $page ); - } - - if ( $page instanceof Title ) { - $page = new WikiPage( $page ); - } - - if ( $page->exists() ) { - $page->doDeleteArticle( "done" ); - } - - $content = ContentHandler::makeContent( $text, $page->getTitle(), $model ); - $page->doEditContent( $content, "testing", EDIT_NEW ); - - return $page; - } - - protected function assertRevEquals( Revision $orig, Revision $rev = null ) { - $this->assertNotNull( $rev, 'missing revision' ); - - $this->assertEquals( $orig->getId(), $rev->getId() ); - $this->assertEquals( $orig->getPage(), $rev->getPage() ); - $this->assertEquals( $orig->getTimestamp(), $rev->getTimestamp() ); - $this->assertEquals( $orig->getUser(), $rev->getUser() ); - $this->assertEquals( $orig->getContentModel(), $rev->getContentModel() ); - $this->assertEquals( $orig->getContentFormat(), $rev->getContentFormat() ); - $this->assertEquals( $orig->getSha1(), $rev->getSha1() ); - } - - /** - * @covers Revision::__construct - */ - public function testConstructFromRow() { - $orig = $this->makeRevision(); - - $dbr = wfgetDB( DB_SLAVE ); - $res = $dbr->select( 'revision', '*', array( 'rev_id' => $orig->getId() ) ); - $this->assertTrue( is_object( $res ), 'query failed' ); - - $row = $res->fetchObject(); - $res->free(); - - $rev = new Revision( $row ); - - $this->assertRevEquals( $orig, $rev ); - } - - /** - * @covers Revision::newFromRow - */ - public function testNewFromRow() { - $orig = $this->makeRevision(); - - $dbr = wfgetDB( DB_SLAVE ); - $res = $dbr->select( 'revision', '*', array( 'rev_id' => $orig->getId() ) ); - $this->assertTrue( is_object( $res ), 'query failed' ); - - $row = $res->fetchObject(); - $res->free(); - - $rev = Revision::newFromRow( $row ); - - $this->assertRevEquals( $orig, $rev ); - } - - - /** - * @covers Revision::newFromArchiveRow - */ - public function testNewFromArchiveRow() { - $page = $this->createPage( 'RevisionStorageTest_testNewFromArchiveRow', 'Lorem Ipsum', CONTENT_MODEL_WIKITEXT ); - $orig = $page->getRevision(); - $page->doDeleteArticle( 'test Revision::newFromArchiveRow' ); - - $dbr = wfgetDB( DB_SLAVE ); - $res = $dbr->select( 'archive', '*', array( 'ar_rev_id' => $orig->getId() ) ); - $this->assertTrue( is_object( $res ), 'query failed' ); - - $row = $res->fetchObject(); - $res->free(); - - $rev = Revision::newFromArchiveRow( $row ); - - $this->assertRevEquals( $orig, $rev ); - } - - /** - * @covers Revision::newFromId - */ - public function testNewFromId() { - $orig = $this->makeRevision(); - - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertRevEquals( $orig, $rev ); - } - - /** - * @covers Revision::fetchRevision - */ - public function testFetchRevision() { - $page = $this->createPage( 'RevisionStorageTest_testFetchRevision', 'one', CONTENT_MODEL_WIKITEXT ); - $id1 = $page->getRevision()->getId(); - - $page->doEditContent( new WikitextContent( 'two' ), 'second rev' ); - $id2 = $page->getRevision()->getId(); - - $res = Revision::fetchRevision( $page->getTitle() ); - - #note: order is unspecified - $rows = array(); - while ( ( $row = $res->fetchObject() ) ) { - $rows[$row->rev_id] = $row; - } - - $row = $res->fetchObject(); - $this->assertEquals( 1, count( $rows ), 'expected exactly one revision' ); - $this->assertArrayHasKey( $id2, $rows, 'missing revision with id ' . $id2 ); - } - - /** - * @covers Revision::selectFields - */ - public function testSelectFields() { - global $wgContentHandlerUseDB; - - $fields = Revision::selectFields(); - - $this->assertTrue( in_array( 'rev_id', $fields ), 'missing rev_id in list of fields' ); - $this->assertTrue( in_array( 'rev_page', $fields ), 'missing rev_page in list of fields' ); - $this->assertTrue( in_array( 'rev_timestamp', $fields ), 'missing rev_timestamp in list of fields' ); - $this->assertTrue( in_array( 'rev_user', $fields ), 'missing rev_user in list of fields' ); - - if ( $wgContentHandlerUseDB ) { - $this->assertTrue( in_array( 'rev_content_model', $fields ), - 'missing rev_content_model in list of fields' ); - $this->assertTrue( in_array( 'rev_content_format', $fields ), - 'missing rev_content_format in list of fields' ); - } - } - - /** - * @covers Revision::getPage - */ - public function testGetPage() { - $page = $this->the_page; - - $orig = $this->makeRevision( array( 'page' => $page->getId() ) ); - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertEquals( $page->getId(), $rev->getPage() ); - } - - /** - * @covers Revision::getText - */ - public function testGetText() { - $this->hideDeprecated( 'Revision::getText' ); - - $orig = $this->makeRevision( array( 'text' => 'hello hello.' ) ); - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertEquals( 'hello hello.', $rev->getText() ); - } - - /** - * @covers Revision::getContent - */ - public function testGetContent_failure() { - $rev = new Revision( array( - 'page' => $this->the_page->getId(), - 'content_model' => $this->the_page->getContentModel(), - 'text_id' => 123456789, // not in the test DB - ) ); - - $this->assertNull( $rev->getContent(), - "getContent() should return null if the revision's text blob could not be loaded." ); - - //NOTE: check this twice, once for lazy initialization, and once with the cached value. - $this->assertNull( $rev->getContent(), - "getContent() should return null if the revision's text blob could not be loaded." ); - } - - /** - * @covers Revision::getContent - */ - public function testGetContent() { - $orig = $this->makeRevision( array( 'text' => 'hello hello.' ) ); - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertEquals( 'hello hello.', $rev->getContent()->getNativeData() ); - } - - /** - * @covers Revision::revText - */ - public function testRevText() { - $this->hideDeprecated( 'Revision::revText' ); - $orig = $this->makeRevision( array( 'text' => 'hello hello rev.' ) ); - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertEquals( 'hello hello rev.', $rev->revText() ); - } - - /** - * @covers Revision::getRawText - */ - public function testGetRawText() { - $this->hideDeprecated( 'Revision::getRawText' ); - - $orig = $this->makeRevision( array( 'text' => 'hello hello raw.' ) ); - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertEquals( 'hello hello raw.', $rev->getRawText() ); - } - - /** - * @covers Revision::getContentModel - */ - public function testGetContentModel() { - global $wgContentHandlerUseDB; - - if ( !$wgContentHandlerUseDB ) { - $this->markTestSkipped( '$wgContentHandlerUseDB is disabled' ); - } - - $orig = $this->makeRevision( array( 'text' => 'hello hello.', - 'content_model' => CONTENT_MODEL_JAVASCRIPT ) ); - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContentModel() ); - } - - /** - * @covers Revision::getContentFormat - */ - public function testGetContentFormat() { - global $wgContentHandlerUseDB; - - if ( !$wgContentHandlerUseDB ) { - $this->markTestSkipped( '$wgContentHandlerUseDB is disabled' ); - } - - $orig = $this->makeRevision( array( - 'text' => 'hello hello.', - 'content_model' => CONTENT_MODEL_JAVASCRIPT, - 'content_format' => CONTENT_FORMAT_JAVASCRIPT - ) ); - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertEquals( CONTENT_FORMAT_JAVASCRIPT, $rev->getContentFormat() ); - } - - /** - * @covers Revision::isCurrent - */ - public function testIsCurrent() { - $page = $this->createPage( 'RevisionStorageTest_testIsCurrent', 'Lorem Ipsum', CONTENT_MODEL_WIKITEXT ); - $rev1 = $page->getRevision(); - - # @todo find out if this should be true - # $this->assertTrue( $rev1->isCurrent() ); - - $rev1x = Revision::newFromId( $rev1->getId() ); - $this->assertTrue( $rev1x->isCurrent() ); - - $page->doEditContent( ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ), 'second rev' ); - $rev2 = $page->getRevision(); - - # @todo find out if this should be true - # $this->assertTrue( $rev2->isCurrent() ); - - $rev1x = Revision::newFromId( $rev1->getId() ); - $this->assertFalse( $rev1x->isCurrent() ); - - $rev2x = Revision::newFromId( $rev2->getId() ); - $this->assertTrue( $rev2x->isCurrent() ); - } - - /** - * @covers Revision::getPrevious - */ - public function testGetPrevious() { - $page = $this->createPage( 'RevisionStorageTest_testGetPrevious', 'Lorem Ipsum testGetPrevious', CONTENT_MODEL_WIKITEXT ); - $rev1 = $page->getRevision(); - - $this->assertNull( $rev1->getPrevious() ); - - $page->doEditContent( ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ), - 'second rev testGetPrevious' ); - $rev2 = $page->getRevision(); - - $this->assertNotNull( $rev2->getPrevious() ); - $this->assertEquals( $rev1->getId(), $rev2->getPrevious()->getId() ); - } - - /** - * @covers Revision::getNext - */ - public function testGetNext() { - $page = $this->createPage( 'RevisionStorageTest_testGetNext', 'Lorem Ipsum testGetNext', CONTENT_MODEL_WIKITEXT ); - $rev1 = $page->getRevision(); - - $this->assertNull( $rev1->getNext() ); - - $page->doEditContent( ContentHandler::makeContent( 'Bla bla', $page->getTitle(), CONTENT_MODEL_WIKITEXT ), - 'second rev testGetNext' ); - $rev2 = $page->getRevision(); - - $this->assertNotNull( $rev1->getNext() ); - $this->assertEquals( $rev2->getId(), $rev1->getNext()->getId() ); - } - - /** - * @covers Revision::newNullRevision - */ - public function testNewNullRevision() { - $page = $this->createPage( 'RevisionStorageTest_testNewNullRevision', 'some testing text', CONTENT_MODEL_WIKITEXT ); - $orig = $page->getRevision(); - - $dbw = wfGetDB( DB_MASTER ); - $rev = Revision::newNullRevision( $dbw, $page->getId(), 'a null revision', false ); - - $this->assertNotEquals( $orig->getId(), $rev->getId(), - 'new null revision shold have a different id from the original revision' ); - $this->assertEquals( $orig->getTextId(), $rev->getTextId(), - 'new null revision shold have the same text id as the original revision' ); - $this->assertEquals( 'some testing text', $rev->getContent()->getNativeData() ); - } - - public static function provideUserWasLastToEdit() { - return array( - array( #0 - 3, true, # actually the last edit - ), - array( #1 - 2, true, # not the current edit, but still by this user - ), - array( #2 - 1, false, # edit by another user - ), - array( #3 - 0, false, # first edit, by this user, but another user edited in the mean time - ), - ); - } - - /** - * @dataProvider provideUserWasLastToEdit - */ - public function testUserWasLastToEdit( $sinceIdx, $expectedLast ) { - $userA = User::newFromName( "RevisionStorageTest_userA" ); - $userB = User::newFromName( "RevisionStorageTest_userB" ); - - if ( $userA->getId() === 0 ) { - $userA = User::createNew( $userA->getName() ); - } - - if ( $userB->getId() === 0 ) { - $userB = User::createNew( $userB->getName() ); - } - - $ns = $this->getDefaultWikitextNS(); - - $dbw = wfGetDB( DB_MASTER ); - $revisions = array(); - - // create revisions ----------------------------- - $page = WikiPage::factory( Title::newFromText( - 'RevisionStorageTest_testUserWasLastToEdit', $ns ) ); - - # zero - $revisions[0] = new Revision( array( - 'page' => $page->getId(), - 'title' => $page->getTitle(), // we need the title to determine the page's default content model - 'timestamp' => '20120101000000', - 'user' => $userA->getId(), - 'text' => 'zero', - 'content_model' => CONTENT_MODEL_WIKITEXT, - 'summary' => 'edit zero' - ) ); - $revisions[0]->insertOn( $dbw ); - - # one - $revisions[1] = new Revision( array( - 'page' => $page->getId(), - 'title' => $page->getTitle(), // still need the title, because $page->getId() is 0 (there's no entry in the page table) - 'timestamp' => '20120101000100', - 'user' => $userA->getId(), - 'text' => 'one', - 'content_model' => CONTENT_MODEL_WIKITEXT, - 'summary' => 'edit one' - ) ); - $revisions[1]->insertOn( $dbw ); - - # two - $revisions[2] = new Revision( array( - 'page' => $page->getId(), - 'title' => $page->getTitle(), - 'timestamp' => '20120101000200', - 'user' => $userB->getId(), - 'text' => 'two', - 'content_model' => CONTENT_MODEL_WIKITEXT, - 'summary' => 'edit two' - ) ); - $revisions[2]->insertOn( $dbw ); - - # three - $revisions[3] = new Revision( array( - 'page' => $page->getId(), - 'title' => $page->getTitle(), - 'timestamp' => '20120101000300', - 'user' => $userA->getId(), - 'text' => 'three', - 'content_model' => CONTENT_MODEL_WIKITEXT, - 'summary' => 'edit three' - ) ); - $revisions[3]->insertOn( $dbw ); - - # four - $revisions[4] = new Revision( array( - 'page' => $page->getId(), - 'title' => $page->getTitle(), - 'timestamp' => '20120101000200', - 'user' => $userA->getId(), - 'text' => 'zero', - 'content_model' => CONTENT_MODEL_WIKITEXT, - 'summary' => 'edit four' - ) ); - $revisions[4]->insertOn( $dbw ); - - // test it --------------------------------- - $since = $revisions[$sinceIdx]->getTimestamp(); - - $wasLast = Revision::userWasLastToEdit( $dbw, $page->getId(), $userA->getId(), $since ); - - $this->assertEquals( $expectedLast, $wasLast ); - } -} diff --git a/tests/phpunit/includes/RevisionStorageTest_ContentHandlerUseDB.php b/tests/phpunit/includes/RevisionStorageTest_ContentHandlerUseDB.php deleted file mode 100644 index 4e83e355..00000000 --- a/tests/phpunit/includes/RevisionStorageTest_ContentHandlerUseDB.php +++ /dev/null @@ -1,81 +0,0 @@ -setMwGlobals( 'wgContentHandlerUseDB', false ); - - $dbw = wfGetDB( DB_MASTER ); - - $page_table = $dbw->tableName( 'page' ); - $revision_table = $dbw->tableName( 'revision' ); - $archive_table = $dbw->tableName( 'archive' ); - - if ( $dbw->fieldExists( $page_table, 'page_content_model' ) ) { - $dbw->query( "alter table $page_table drop column page_content_model" ); - $dbw->query( "alter table $revision_table drop column rev_content_model" ); - $dbw->query( "alter table $revision_table drop column rev_content_format" ); - $dbw->query( "alter table $archive_table drop column ar_content_model" ); - $dbw->query( "alter table $archive_table drop column ar_content_format" ); - } - - parent::setUp(); - } - - /** - * @covers Revision::selectFields - */ - public function testSelectFields() { - $fields = Revision::selectFields(); - - $this->assertTrue( in_array( 'rev_id', $fields ), 'missing rev_id in list of fields' ); - $this->assertTrue( in_array( 'rev_page', $fields ), 'missing rev_page in list of fields' ); - $this->assertTrue( in_array( 'rev_timestamp', $fields ), 'missing rev_timestamp in list of fields' ); - $this->assertTrue( in_array( 'rev_user', $fields ), 'missing rev_user in list of fields' ); - - $this->assertFalse( in_array( 'rev_content_model', $fields ), 'missing rev_content_model in list of fields' ); - $this->assertFalse( in_array( 'rev_content_format', $fields ), 'missing rev_content_format in list of fields' ); - } - - /** - * @covers Revision::getContentModel - */ - public function testGetContentModel() { - try { - $this->makeRevision( array( 'text' => 'hello hello.', - 'content_model' => CONTENT_MODEL_JAVASCRIPT ) ); - - $this->fail( "Creating JavaScript content on a wikitext page should fail with " - . "\$wgContentHandlerUseDB disabled" ); - } catch ( MWException $ex ) { - $this->assertTrue( true ); // ok - } - } - - - /** - * @covers Revision::getContentFormat - */ - public function testGetContentFormat() { - try { - // @todo change this to test failure on using a non-standard (but supported) format - // for a content model supported in the given location. As of 1.21, there are - // no alternative formats for any of the standard content models that could be - // used for this though. - - $this->makeRevision( array( 'text' => 'hello hello.', - 'content_model' => CONTENT_MODEL_JAVASCRIPT, - 'content_format' => 'text/javascript' ) ); - - $this->fail( "Creating JavaScript content on a wikitext page should fail with " - . "\$wgContentHandlerUseDB disabled" ); - } catch ( MWException $ex ) { - $this->assertTrue( true ); // ok - } - } -} diff --git a/tests/phpunit/includes/RevisionTest.php b/tests/phpunit/includes/RevisionTest.php deleted file mode 100644 index b5819ff6..00000000 --- a/tests/phpunit/includes/RevisionTest.php +++ /dev/null @@ -1,481 +0,0 @@ -setMwGlobals( array( - 'wgContLang' => Language::factory( 'en' ), - 'wgLanguageCode' => 'en', - 'wgLegacyEncoding' => false, - 'wgCompressRevisions' => false, - - 'wgContentHandlerTextFallback' => 'ignore', - ) ); - - $this->mergeMwGlobalArrayValue( - 'wgExtraNamespaces', - array( - 12312 => 'Dummy', - 12313 => 'Dummy_talk', - ) - ); - - $this->mergeMwGlobalArrayValue( - 'wgNamespaceContentModels', - array( - 12312 => 'testing', - ) - ); - - $this->mergeMwGlobalArrayValue( - 'wgContentHandlers', - array( - 'testing' => 'DummyContentHandlerForTesting', - 'RevisionTestModifyableContent' => 'RevisionTestModifyableContentHandler', - ) - ); - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - } - - function tearDown() { - global $wgContLang; - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - - parent::tearDown(); - } - - /** - * @covers Revision::getRevisionText - */ - public function testGetRevisionText() { - $row = new stdClass; - $row->old_flags = ''; - $row->old_text = 'This is a bunch of revision text.'; - $this->assertEquals( - 'This is a bunch of revision text.', - Revision::getRevisionText( $row ) ); - } - - /** - * @covers Revision::getRevisionText - */ - public function testGetRevisionTextGzip() { - $this->checkPHPExtension( 'zlib' ); - - $row = new stdClass; - $row->old_flags = 'gzip'; - $row->old_text = gzdeflate( 'This is a bunch of revision text.' ); - $this->assertEquals( - 'This is a bunch of revision text.', - Revision::getRevisionText( $row ) ); - } - - /** - * @covers Revision::getRevisionText - */ - public function testGetRevisionTextUtf8Native() { - $row = new stdClass; - $row->old_flags = 'utf-8'; - $row->old_text = "Wiki est l'\xc3\xa9cole superieur !"; - $GLOBALS['wgLegacyEncoding'] = 'iso-8859-1'; - $this->assertEquals( - "Wiki est l'\xc3\xa9cole superieur !", - Revision::getRevisionText( $row ) ); - } - - /** - * @covers Revision::getRevisionText - */ - public function testGetRevisionTextUtf8Legacy() { - $row = new stdClass; - $row->old_flags = ''; - $row->old_text = "Wiki est l'\xe9cole superieur !"; - $GLOBALS['wgLegacyEncoding'] = 'iso-8859-1'; - $this->assertEquals( - "Wiki est l'\xc3\xa9cole superieur !", - Revision::getRevisionText( $row ) ); - } - - /** - * @covers Revision::getRevisionText - */ - public function testGetRevisionTextUtf8NativeGzip() { - $this->checkPHPExtension( 'zlib' ); - - $row = new stdClass; - $row->old_flags = 'gzip,utf-8'; - $row->old_text = gzdeflate( "Wiki est l'\xc3\xa9cole superieur !" ); - $GLOBALS['wgLegacyEncoding'] = 'iso-8859-1'; - $this->assertEquals( - "Wiki est l'\xc3\xa9cole superieur !", - Revision::getRevisionText( $row ) ); - } - - /** - * @covers Revision::getRevisionText - */ - public function testGetRevisionTextUtf8LegacyGzip() { - $this->checkPHPExtension( 'zlib' ); - - $row = new stdClass; - $row->old_flags = 'gzip'; - $row->old_text = gzdeflate( "Wiki est l'\xe9cole superieur !" ); - $GLOBALS['wgLegacyEncoding'] = 'iso-8859-1'; - $this->assertEquals( - "Wiki est l'\xc3\xa9cole superieur !", - Revision::getRevisionText( $row ) ); - } - - /** - * @covers Revision::compressRevisionText - */ - public function testCompressRevisionTextUtf8() { - $row = new stdClass; - $row->old_text = "Wiki est l'\xc3\xa9cole superieur !"; - $row->old_flags = Revision::compressRevisionText( $row->old_text ); - $this->assertTrue( false !== strpos( $row->old_flags, 'utf-8' ), - "Flags should contain 'utf-8'" ); - $this->assertFalse( false !== strpos( $row->old_flags, 'gzip' ), - "Flags should not contain 'gzip'" ); - $this->assertEquals( "Wiki est l'\xc3\xa9cole superieur !", - $row->old_text, "Direct check" ); - $this->assertEquals( "Wiki est l'\xc3\xa9cole superieur !", - Revision::getRevisionText( $row ), "getRevisionText" ); - } - - /** - * @covers Revision::compressRevisionText - */ - public function testCompressRevisionTextUtf8Gzip() { - $this->checkPHPExtension( 'zlib' ); - $this->setMwGlobals( 'wgCompressRevisions', true ); - - $row = new stdClass; - $row->old_text = "Wiki est l'\xc3\xa9cole superieur !"; - $row->old_flags = Revision::compressRevisionText( $row->old_text ); - $this->assertTrue( false !== strpos( $row->old_flags, 'utf-8' ), - "Flags should contain 'utf-8'" ); - $this->assertTrue( false !== strpos( $row->old_flags, 'gzip' ), - "Flags should contain 'gzip'" ); - $this->assertEquals( "Wiki est l'\xc3\xa9cole superieur !", - gzinflate( $row->old_text ), "Direct check" ); - $this->assertEquals( "Wiki est l'\xc3\xa9cole superieur !", - Revision::getRevisionText( $row ), "getRevisionText" ); - } - - # ================================================================================================================= - - /** - * @param string $text - * @param string $title - * @param string $model - * @param null $format - * - * @return Revision - */ - function newTestRevision( $text, $title = "Test", $model = CONTENT_MODEL_WIKITEXT, $format = null ) { - if ( is_string( $title ) ) { - $title = Title::newFromText( $title ); - } - - $content = ContentHandler::makeContent( $text, $title, $model, $format ); - - $rev = new Revision( - array( - 'id' => 42, - 'page' => 23, - 'title' => $title, - - 'content' => $content, - 'length' => $content->getSize(), - 'comment' => "testing", - 'minor_edit' => false, - - 'content_format' => $format, - ) - ); - - return $rev; - } - - function dataGetContentModel() { - //NOTE: we expect the help namespace to always contain wikitext - return array( - array( 'hello world', 'Help:Hello', null, null, CONTENT_MODEL_WIKITEXT ), - array( 'hello world', 'User:hello/there.css', null, null, CONTENT_MODEL_CSS ), - array( serialize( 'hello world' ), 'Dummy:Hello', null, null, "testing" ), - ); - } - - /** - * @group Database - * @dataProvider dataGetContentModel - * @covers Revision::getContentModel - */ - public function testGetContentModel( $text, $title, $model, $format, $expectedModel ) { - $rev = $this->newTestRevision( $text, $title, $model, $format ); - - $this->assertEquals( $expectedModel, $rev->getContentModel() ); - } - - function dataGetContentFormat() { - //NOTE: we expect the help namespace to always contain wikitext - return array( - array( 'hello world', 'Help:Hello', null, null, CONTENT_FORMAT_WIKITEXT ), - array( 'hello world', 'Help:Hello', CONTENT_MODEL_CSS, null, CONTENT_FORMAT_CSS ), - array( 'hello world', 'User:hello/there.css', null, null, CONTENT_FORMAT_CSS ), - array( serialize( 'hello world' ), 'Dummy:Hello', null, null, "testing" ), - ); - } - - /** - * @group Database - * @dataProvider dataGetContentFormat - * @covers Revision::getContentFormat - */ - public function testGetContentFormat( $text, $title, $model, $format, $expectedFormat ) { - $rev = $this->newTestRevision( $text, $title, $model, $format ); - - $this->assertEquals( $expectedFormat, $rev->getContentFormat() ); - } - - function dataGetContentHandler() { - //NOTE: we expect the help namespace to always contain wikitext - return array( - array( 'hello world', 'Help:Hello', null, null, 'WikitextContentHandler' ), - array( 'hello world', 'User:hello/there.css', null, null, 'CssContentHandler' ), - array( serialize( 'hello world' ), 'Dummy:Hello', null, null, 'DummyContentHandlerForTesting' ), - ); - } - - /** - * @group Database - * @dataProvider dataGetContentHandler - * @covers Revision::getContentHandler - */ - public function testGetContentHandler( $text, $title, $model, $format, $expectedClass ) { - $rev = $this->newTestRevision( $text, $title, $model, $format ); - - $this->assertEquals( $expectedClass, get_class( $rev->getContentHandler() ) ); - } - - function dataGetContent() { - //NOTE: we expect the help namespace to always contain wikitext - return array( - array( 'hello world', 'Help:Hello', null, null, Revision::FOR_PUBLIC, 'hello world' ), - array( serialize( 'hello world' ), 'Hello', "testing", null, Revision::FOR_PUBLIC, serialize( 'hello world' ) ), - array( serialize( 'hello world' ), 'Dummy:Hello', null, null, Revision::FOR_PUBLIC, serialize( 'hello world' ) ), - ); - } - - /** - * @group Database - * @dataProvider dataGetContent - * @covers Revision::getContent - */ - public function testGetContent( $text, $title, $model, $format, $audience, $expectedSerialization ) { - $rev = $this->newTestRevision( $text, $title, $model, $format ); - $content = $rev->getContent( $audience ); - - $this->assertEquals( $expectedSerialization, is_null( $content ) ? null : $content->serialize( $format ) ); - } - - function dataGetText() { - //NOTE: we expect the help namespace to always contain wikitext - return array( - array( 'hello world', 'Help:Hello', null, null, Revision::FOR_PUBLIC, 'hello world' ), - array( serialize( 'hello world' ), 'Hello', "testing", null, Revision::FOR_PUBLIC, null ), - array( serialize( 'hello world' ), 'Dummy:Hello', null, null, Revision::FOR_PUBLIC, null ), - ); - } - - /** - * @group Database - * @dataProvider dataGetText - * @covers Revision::getText - */ - public function testGetText( $text, $title, $model, $format, $audience, $expectedText ) { - $this->hideDeprecated( 'Revision::getText' ); - - $rev = $this->newTestRevision( $text, $title, $model, $format ); - - $this->assertEquals( $expectedText, $rev->getText( $audience ) ); - } - - /** - * @group Database - * @dataProvider dataGetText - * @covers Revision::getRawText - */ - public function testGetRawText( $text, $title, $model, $format, $audience, $expectedText ) { - $this->hideDeprecated( 'Revision::getRawText' ); - - $rev = $this->newTestRevision( $text, $title, $model, $format ); - - $this->assertEquals( $expectedText, $rev->getRawText( $audience ) ); - } - - - public function dataGetSize() { - return array( - array( "hello world.", CONTENT_MODEL_WIKITEXT, 12 ), - array( serialize( "hello world." ), "testing", 12 ), - ); - } - - /** - * @covers Revision::getSize - * @group Database - * @dataProvider dataGetSize - */ - public function testGetSize( $text, $model, $expected_size ) { - $rev = $this->newTestRevision( $text, 'RevisionTest_testGetSize', $model ); - $this->assertEquals( $expected_size, $rev->getSize() ); - } - - public function dataGetSha1() { - return array( - array( "hello world.", CONTENT_MODEL_WIKITEXT, Revision::base36Sha1( "hello world." ) ), - array( serialize( "hello world." ), "testing", Revision::base36Sha1( serialize( "hello world." ) ) ), - ); - } - - /** - * @covers Revision::getSha1 - * @group Database - * @dataProvider dataGetSha1 - */ - public function testGetSha1( $text, $model, $expected_hash ) { - $rev = $this->newTestRevision( $text, 'RevisionTest_testGetSha1', $model ); - $this->assertEquals( $expected_hash, $rev->getSha1() ); - } - - /** - * @covers Revision::__construct - */ - public function testConstructWithText() { - $this->hideDeprecated( "Revision::getText" ); - - $rev = new Revision( array( - 'text' => 'hello world.', - 'content_model' => CONTENT_MODEL_JAVASCRIPT - ) ); - - $this->assertNotNull( $rev->getText(), 'no content text' ); - $this->assertNotNull( $rev->getContent(), 'no content object available' ); - $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContent()->getModel() ); - $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContentModel() ); - } - - /** - * @covers Revision::__construct - */ - public function testConstructWithContent() { - $this->hideDeprecated( "Revision::getText" ); - - $title = Title::newFromText( 'RevisionTest_testConstructWithContent' ); - - $rev = new Revision( array( - 'content' => ContentHandler::makeContent( 'hello world.', $title, CONTENT_MODEL_JAVASCRIPT ), - ) ); - - $this->assertNotNull( $rev->getText(), 'no content text' ); - $this->assertNotNull( $rev->getContent(), 'no content object available' ); - $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContent()->getModel() ); - $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $rev->getContentModel() ); - } - - /** - * Tests whether $rev->getContent() returns a clone when needed. - * - * @group Database - * @covers Revision::getContent - */ - public function testGetContentClone() { - $content = new RevisionTestModifyableContent( "foo" ); - - $rev = new Revision( - array( - 'id' => 42, - 'page' => 23, - 'title' => Title::newFromText( "testGetContentClone_dummy" ), - - 'content' => $content, - 'length' => $content->getSize(), - 'comment' => "testing", - 'minor_edit' => false, - ) - ); - - $content = $rev->getContent( Revision::RAW ); - $content->setText( "bar" ); - - $content2 = $rev->getContent( Revision::RAW ); - $this->assertNotSame( $content, $content2, "expected a clone" ); // content is mutable, expect clone - $this->assertEquals( "foo", $content2->getText() ); // clone should contain the original text - - $content2->setText( "bla bla" ); - $this->assertEquals( "bar", $content->getText() ); // clones should be independent - } - - - /** - * Tests whether $rev->getContent() returns the same object repeatedly if appropriate. - * - * @group Database - * @covers Revision::getContent - */ - public function testGetContentUncloned() { - $rev = $this->newTestRevision( "hello", "testGetContentUncloned_dummy", CONTENT_MODEL_WIKITEXT ); - $content = $rev->getContent( Revision::RAW ); - $content2 = $rev->getContent( Revision::RAW ); - - // for immutable content like wikitext, this should be the same object - $this->assertSame( $content, $content2 ); - } -} - -class RevisionTestModifyableContent extends TextContent { - public function __construct( $text ) { - parent::__construct( $text, "RevisionTestModifyableContent" ); - } - - public function copy() { - return new RevisionTestModifyableContent( $this->mText ); - } - - public function getText() { - return $this->mText; - } - - public function setText( $text ) { - $this->mText = $text; - } -} - -class RevisionTestModifyableContentHandler extends TextContentHandler { - - public function __construct() { - parent::__construct( "RevisionTestModifyableContent", array( CONTENT_FORMAT_TEXT ) ); - } - - public function unserializeContent( $text, $format = null ) { - $this->checkFormat( $format ); - - return new RevisionTestModifyableContent( $text ); - } - - public function makeEmptyContent() { - return new RevisionTestModifyableContent( '' ); - } -} diff --git a/tests/phpunit/includes/SampleTest.php b/tests/phpunit/includes/SampleTest.php deleted file mode 100644 index 8516a4ce..00000000 --- a/tests/phpunit/includes/SampleTest.php +++ /dev/null @@ -1,105 +0,0 @@ -setMwGlobals( array( - 'wgContLang' => Language::factory( 'en' ), - 'wgLanguageCode' => 'en', - ) ); - } - - /** - * Anything cleanup you need to do should go here. - */ - protected function tearDown() { - parent::tearDown(); - } - - /** - * Name tests so that PHPUnit can turn them into sentences when - * they run. While MediaWiki isn't strictly an Agile Programming - * project, you are encouraged to use the naming described under - * "Agile Documentation" at - * http://www.phpunit.de/manual/3.4/en/other-uses-for-tests.html - */ - public function testTitleObjectStringConversion() { - $title = Title::newFromText( "text" ); - $this->assertInstanceOf( 'Title', $title, "Title creation" ); - $this->assertEquals( "Text", $title, "Automatic string conversion" ); - - $title = Title::newFromText( "text", NS_MEDIA ); - $this->assertEquals( "Media:Text", $title, "Title creation with namespace" ); - } - - /** - * If you want to run a the same test with a variety of data. use a data provider. - * see: http://www.phpunit.de/manual/3.4/en/writing-tests-for-phpunit.html - * - * Note: Data providers are always called statically and outside setUp/tearDown! - */ - public static function provideTitles() { - return array( - array( 'Text', NS_MEDIA, 'Media:Text' ), - array( 'Text', null, 'Text' ), - array( 'text', null, 'Text' ), - array( 'Text', NS_USER, 'User:Text' ), - array( 'Photo.jpg', NS_FILE, 'File:Photo.jpg' ) - ); - } - - /** - * @dataProvider provideTitles - * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.dataProvider - */ - public function testCreateBasicListOfTitles( $titleName, $ns, $text ) { - $title = Title::newFromText( $titleName, $ns ); - $this->assertEquals( $text, "$title", "see if '$titleName' matches '$text'" ); - } - - public function testSetUpMainPageTitleForNextTest() { - $title = Title::newMainPage(); - $this->assertEquals( "Main Page", "$title", "Test initial creation of a title" ); - - return $title; - } - - /** - * Instead of putting a bunch of tests in a single test method, - * you should put only one or two tests in each test method. This - * way, the test method names can remain descriptive. - * - * If you want to make tests depend on data created in another - * method, you can create dependencies feed whatever you return - * from the dependant method (e.g. testInitialCreation in this - * example) as arguments to the next method (e.g. $title in - * testTitleDepends is whatever testInitialCreatiion returned.) - */ - - /** - * @depends testSetUpMainPageTitleForNextTest - * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.depends - */ - public function testCheckMainPageTitleIsConsideredLocal( $title ) { - $this->assertTrue( $title->isLocal() ); - } - - /** - * @expectedException MWException object - * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.expectedException - */ - public function testTitleObjectFromObject() { - $title = Title::newFromText( Title::newFromText( "test" ) ); - $this->assertEquals( "Test", $title->isLocal() ); - } -} diff --git a/tests/phpunit/includes/SanitizerTest.php b/tests/phpunit/includes/SanitizerTest.php deleted file mode 100644 index 81246d33..00000000 --- a/tests/phpunit/includes/SanitizerTest.php +++ /dev/null @@ -1,302 +0,0 @@ -assertEquals( - "\xc3\xa9cole", - Sanitizer::decodeCharReferences( 'école' ), - 'decode named entities' - ); - } - - /** - * @covers Sanitizer::decodeCharReferences - */ - public function testDecodeNumericEntities() { - $this->assertEquals( - "\xc4\x88io bonas dans l'\xc3\xa9cole!", - Sanitizer::decodeCharReferences( "Ĉio bonas dans l'école!" ), - 'decode numeric entities' - ); - } - - /** - * @covers Sanitizer::decodeCharReferences - */ - public function testDecodeMixedEntities() { - $this->assertEquals( - "\xc4\x88io bonas dans l'\xc3\xa9cole!", - Sanitizer::decodeCharReferences( "Ĉio bonas dans l'école!" ), - 'decode mixed numeric/named entities' - ); - } - - /** - * @covers Sanitizer::decodeCharReferences - */ - public function testDecodeMixedComplexEntities() { - $this->assertEquals( - "\xc4\x88io bonas dans l'\xc3\xa9cole! (mais pas Ĉio dans l'école)", - Sanitizer::decodeCharReferences( - "Ĉio bonas dans l'école! (mais pas &#x108;io dans l'&eacute;cole)" - ), - 'decode mixed complex entities' - ); - } - - /** - * @covers Sanitizer::decodeCharReferences - */ - public function testInvalidAmpersand() { - $this->assertEquals( - 'a & b', - Sanitizer::decodeCharReferences( 'a & b' ), - 'Invalid ampersand' - ); - } - - /** - * @covers Sanitizer::decodeCharReferences - */ - public function testInvalidEntities() { - $this->assertEquals( - '&foo;', - Sanitizer::decodeCharReferences( '&foo;' ), - 'Invalid named entity' - ); - } - - /** - * @covers Sanitizer::decodeCharReferences - */ - public function testInvalidNumberedEntities() { - $this->assertEquals( UTF8_REPLACEMENT, Sanitizer::decodeCharReferences( "�" ), 'Invalid numbered entity' ); - } - - /** - * @covers Sanitizer::removeHTMLtags - * @dataProvider provideHtml5Tags - * - * @param String $tag Name of an HTML5 element (ie: 'video') - * @param Boolean $escaped Wheter sanitizer let the tag in or escape it (ie: '<video>') - */ - public function testRemovehtmltagsOnHtml5Tags( $tag, $escaped ) { - $this->setMwGlobals( array( - 'wgUseTidy' => false - ) ); - - if ( $escaped ) { - $this->assertEquals( "<$tag>", - Sanitizer::removeHTMLtags( "<$tag>" ) - ); - } else { - $this->assertEquals( "<$tag>\n", - Sanitizer::removeHTMLtags( "<$tag>" ) - ); - } - } - - /** - * Provide HTML5 tags - */ - public static function provideHtml5Tags() { - $ESCAPED = true; # We want tag to be escaped - $VERBATIM = false; # We want to keep the tag - return array( - array( 'data', $VERBATIM ), - array( 'mark', $VERBATIM ), - array( 'time', $VERBATIM ), - array( 'video', $ESCAPED ), - ); - } - - function dataRemoveHTMLtags() { - return array( - // former testSelfClosingTag - array( - '
            Hello world
            ', - '
            Hello world
            ', - 'Self-closing closing div' - ), - // Make sure special nested HTML5 semantics are not broken - // http://www.whatwg.org/html/text-level-semantics.html#the-kbd-element - array( - 'Shift+F3', - 'Shift+F3', - 'Nested .' - ), - // http://www.whatwg.org/html/text-level-semantics.html#the-sub-and-sup-elements - array( - 'xi, yi', - 'xi, yi', - 'Nested .' - ), - // http://www.whatwg.org/html/text-level-semantics.html#the-dfn-element - array( - 'GDO', - 'GDO', - ' inside ', - ), - ); - } - - /** - * @dataProvider dataRemoveHTMLtags - * @covers Sanitizer::removeHTMLtags - */ - public function testRemoveHTMLtags( $input, $output, $msg = null ) { - $GLOBALS['wgUseTidy'] = false; - $this->assertEquals( $output, Sanitizer::removeHTMLtags( $input ), $msg ); - } - - /** - * @dataProvider provideTagAttributesToDecode - * @covers Sanitizer::decodeTagAttributes - */ - public function testDecodeTagAttributes( $expected, $attributes, $message = '' ) { - $this->assertEquals( $expected, - Sanitizer::decodeTagAttributes( $attributes ), - $message - ); - } - - public static function provideTagAttributesToDecode() { - return array( - array( array( 'foo' => 'bar' ), 'foo=bar', 'Unquoted attribute' ), - array( array( 'foo' => 'bar' ), ' foo = bar ', 'Spaced attribute' ), - array( array( 'foo' => 'bar' ), 'foo="bar"', 'Double-quoted attribute' ), - array( array( 'foo' => 'bar' ), 'foo=\'bar\'', 'Single-quoted attribute' ), - array( array( 'foo' => 'bar', 'baz' => 'foo' ), 'foo=\'bar\' baz="foo"', 'Several attributes' ), - array( array( 'foo' => 'bar', 'baz' => 'foo' ), 'foo=\'bar\' baz="foo"', 'Several attributes' ), - array( array( 'foo' => 'bar', 'baz' => 'foo' ), 'foo=\'bar\' baz="foo"', 'Several attributes' ), - array( array( ':foo' => 'bar' ), ':foo=\'bar\'', 'Leading :' ), - array( array( '_foo' => 'bar' ), '_foo=\'bar\'', 'Leading _' ), - array( array( 'foo' => 'bar' ), 'Foo=\'bar\'', 'Leading capital' ), - array( array( 'foo' => 'BAR' ), 'FOO=BAR', 'Attribute keys are normalized to lowercase' ), - - # Invalid beginning - array( array(), '-foo=bar', 'Leading - is forbidden' ), - array( array(), '.foo=bar', 'Leading . is forbidden' ), - array( array( 'foo-bar' => 'bar' ), 'foo-bar=bar', 'A - is allowed inside the attribute' ), - array( array( 'foo-' => 'bar' ), 'foo-=bar', 'A - is allowed inside the attribute' ), - array( array( 'foo.bar' => 'baz' ), 'foo.bar=baz', 'A . is allowed inside the attribute' ), - array( array( 'foo.' => 'baz' ), 'foo.=baz', 'A . is allowed as last character' ), - array( array( 'foo6' => 'baz' ), 'foo6=baz', 'Numbers are allowed' ), - - # This bit is more relaxed than XML rules, but some extensions use - # it, like ProofreadPage (see bug 27539) - array( array( '1foo' => 'baz' ), '1foo=baz', 'Leading numbers are allowed' ), - array( array(), 'foo$=baz', 'Symbols are not allowed' ), - array( array(), 'foo@=baz', 'Symbols are not allowed' ), - array( array(), 'foo~=baz', 'Symbols are not allowed' ), - array( array( 'foo' => '1[#^`*%w/(' ), 'foo=1[#^`*%w/(', 'All kind of characters are allowed as values' ), - array( array( 'foo' => '1[#^`*%\'w/(' ), 'foo="1[#^`*%\'w/("', 'Double quotes are allowed if quoted by single quotes' ), - array( array( 'foo' => '1[#^`*%"w/(' ), 'foo=\'1[#^`*%"w/(\'', 'Single quotes are allowed if quoted by double quotes' ), - array( array( 'foo' => '&"' ), 'foo=&"', 'Special chars can be provided as entities' ), - array( array( 'foo' => '&foobar;' ), 'foo=&foobar;', 'Entity-like items are accepted' ), - ); - } - - /** - * @dataProvider provideDeprecatedAttributes - * @covers Sanitizer::fixTagAttributes - */ - public function testDeprecatedAttributesUnaltered( $inputAttr, $inputEl, $message = '' ) { - $this->assertEquals( " $inputAttr", - Sanitizer::fixTagAttributes( $inputAttr, $inputEl ), - $message - ); - } - - public static function provideDeprecatedAttributes() { - /** array( , , [message] ) */ - return array( - array( 'clear="left"', 'br' ), - array( 'clear="all"', 'br' ), - array( 'width="100"', 'td' ), - array( 'nowrap="true"', 'td' ), - array( 'nowrap=""', 'td' ), - array( 'align="right"', 'td' ), - array( 'align="center"', 'table' ), - array( 'align="left"', 'tr' ), - array( 'align="center"', 'div' ), - array( 'align="left"', 'h1' ), - array( 'align="left"', 'span' ), - ); - } - - /** - * @dataProvider provideCssCommentsFixtures - * @covers Sanitizer::checkCss - */ - public function testCssCommentsChecking( $expected, $css, $message = '' ) { - $this->assertEquals( $expected, - Sanitizer::checkCss( $css ), - $message - ); - } - - public static function provideCssCommentsFixtures() { - /** array( , , [message] ) */ - return array( - // Valid comments spanning entire input - array( '/**/', '/**/' ), - array( '/* comment */', '/* comment */' ), - // Weird stuff - array( ' ', '/****/' ), - array( ' ', '/* /* */' ), - array( 'display: block;', "display:/* foo */block;" ), - array( 'display: block;', "display:\\2f\\2a foo \\2a\\2f block;", - 'Backslash-escaped comments must be stripped (bug 28450)' ), - array( '', '/* unfinished comment structure', - 'Remove anything after a comment-start token' ), - array( '', "\\2f\\2a unifinished comment'", - 'Remove anything after a backslash-escaped comment-start token' ), - array( '/* insecure input */', 'filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'asdf.png\',sizingMethod=\'scale\');' ), - array( '/* insecure input */', '-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'asdf.png\',sizingMethod=\'scale\')";' ), - array( '/* insecure input */', 'width: expression(1+1);' ), - array( '/* insecure input */', 'background-image: image(asdf.png);' ), - array( '/* insecure input */', 'background-image: -webkit-image(asdf.png);' ), - array( '/* insecure input */', 'background-image: -moz-image(asdf.png);' ), - array( '/* insecure input */', 'background-image: image-set("asdf.png" 1x, "asdf.png" 2x);' ), - array( '/* insecure input */', 'background-image: -webkit-image-set("asdf.png" 1x, "asdf.png" 2x);' ), - array( '/* insecure input */', 'background-image: -moz-image-set("asdf.png" 1x, "asdf.png" 2x);' ), - ); - } - - /** - * Test for support or lack of support for specific attributes in the attribute whitelist. - */ - public static function provideAttributeSupport() { - /** array( , , ) */ - return array( - array( 'div', ' role="presentation"', ' role="presentation"', 'Support for WAI-ARIA\'s role="presentation".' ), - array( 'div', ' role="main"', '', "Other WAI-ARIA roles are currently not supported." ), - ); - } - - /** - * @dataProvider provideAttributeSupport - * @covers Sanitizer::fixTagAttributes - */ - public function testAttributeSupport( $tag, $attributes, $expected, $message ) { - $this->assertEquals( $expected, - Sanitizer::fixTagAttributes( $attributes, $tag ), - $message - ); - } -} diff --git a/tests/phpunit/includes/SanitizerValidateEmailTest.php b/tests/phpunit/includes/SanitizerValidateEmailTest.php deleted file mode 100644 index f13e8382..00000000 --- a/tests/phpunit/includes/SanitizerValidateEmailTest.php +++ /dev/null @@ -1,103 +0,0 @@ -assertEquals( - $expected, - Sanitizer::validateEmail( $addr ), - $msg - ); - } - - private function valid( $addr, $msg = '' ) { - $this->checkEmail( $addr, true, $msg ); - } - - private function invalid( $addr, $msg = '' ) { - $this->checkEmail( $addr, false, $msg ); - } - - public function testEmailWellKnownUserAtHostDotTldAreValid() { - $this->valid( 'user@example.com' ); - $this->valid( 'user@example.museum' ); - } - - public function testEmailWithUpperCaseCharactersAreValid() { - $this->valid( 'USER@example.com' ); - $this->valid( 'user@EXAMPLE.COM' ); - $this->valid( 'user@Example.com' ); - $this->valid( 'USER@eXAMPLE.com' ); - } - - public function testEmailWithAPlusInUserName() { - $this->valid( 'user+sub@example.com' ); - $this->valid( 'user+@example.com' ); - } - - public function testEmailDoesNotNeedATopLevelDomain() { - $this->valid( "user@localhost" ); - $this->valid( "FooBar@localdomain" ); - $this->valid( "nobody@mycompany" ); - } - - public function testEmailWithWhiteSpacesBeforeOrAfterAreInvalids() { - $this->invalid( " user@host.com" ); - $this->invalid( "user@host.com " ); - $this->invalid( "\tuser@host.com" ); - $this->invalid( "user@host.com\t" ); - } - - public function testEmailWithWhiteSpacesAreInvalids() { - $this->invalid( "User user@host" ); - $this->invalid( "first last@mycompany" ); - $this->invalid( "firstlast@my company" ); - } - - /** - * bug 26948 : comma were matched by an incorrect regexp range - */ - public function testEmailWithCommasAreInvalids() { - $this->invalid( "user,foo@example.org" ); - $this->invalid( "userfoo@ex,ample.org" ); - } - - public function testEmailWithHyphens() { - $this->valid( "user-foo@example.org" ); - $this->valid( "userfoo@ex-ample.org" ); - } - - public function testEmailDomainCanNotBeginWithDot() { - $this->invalid( "user@." ); - $this->invalid( "user@.localdomain" ); - $this->invalid( "user@localdomain." ); - $this->valid( "user.@localdomain" ); - $this->valid( ".@localdomain" ); - $this->invalid( ".@a............" ); - } - - public function testEmailWithFunnyCharacters() { - $this->valid( "\$user!ex{this}@123.com" ); - } - - public function testEmailTopLevelDomainCanBeNumerical() { - $this->valid( "user@example.1234" ); - } - - public function testEmailWithoutAtSignIsInvalid() { - $this->invalid( 'useràexample.com' ); - } - - public function testEmailWithOneCharacterDomainIsValid() { - $this->valid( 'user@a' ); - } -} diff --git a/tests/phpunit/includes/SiteConfigurationTest.php b/tests/phpunit/includes/SiteConfigurationTest.php deleted file mode 100644 index 053d8a7d..00000000 --- a/tests/phpunit/includes/SiteConfigurationTest.php +++ /dev/null @@ -1,335 +0,0 @@ -suffixes as $suffix ) { - if ( substr( $wiki, -strlen( $suffix ) ) == $suffix ) { - $site = $suffix; - $lang = substr( $wiki, 0, -strlen( $suffix ) ); - break; - } - } - - return array( - 'suffix' => $site, - 'lang' => $lang, - 'params' => array( - 'lang' => $lang, - 'site' => $site, - 'wiki' => $wiki, - ), - 'tags' => array( 'tag' ), - ); -} - -class SiteConfigurationTest extends MediaWikiTestCase { - - /** - * @var SiteConfiguration - */ - protected $mConf; - - protected function setUp() { - parent::setUp(); - - $this->mConf = new SiteConfiguration; - - $this->mConf->suffixes = array( 'wikipedia' => 'wiki' ); - $this->mConf->wikis = array( 'enwiki', 'dewiki', 'frwiki' ); - $this->mConf->settings = array( - 'simple' => array( - 'wiki' => 'wiki', - 'tag' => 'tag', - 'enwiki' => 'enwiki', - 'dewiki' => 'dewiki', - 'frwiki' => 'frwiki', - ), - - 'fallback' => array( - 'default' => 'default', - 'wiki' => 'wiki', - 'tag' => 'tag', - ), - - 'params' => array( - 'default' => '$lang $site $wiki', - ), - - '+global' => array( - 'wiki' => array( - 'wiki' => 'wiki', - ), - 'tag' => array( - 'tag' => 'tag', - ), - 'enwiki' => array( - 'enwiki' => 'enwiki', - ), - 'dewiki' => array( - 'dewiki' => 'dewiki', - ), - 'frwiki' => array( - 'frwiki' => 'frwiki', - ), - ), - - 'merge' => array( - '+wiki' => array( - 'wiki' => 'wiki', - ), - '+tag' => array( - 'tag' => 'tag', - ), - 'default' => array( - 'default' => 'default', - ), - '+enwiki' => array( - 'enwiki' => 'enwiki', - ), - '+dewiki' => array( - 'dewiki' => 'dewiki', - ), - '+frwiki' => array( - 'frwiki' => 'frwiki', - ), - ), - ); - - $GLOBALS['global'] = array( 'global' => 'global' ); - } - - /** - * @covers SiteConfiguration::siteFromDB - */ - public function testSiteFromDb() { - $this->assertEquals( - array( 'wikipedia', 'en' ), - $this->mConf->siteFromDB( 'enwiki' ), - 'siteFromDB()' - ); - $this->assertEquals( - array( 'wikipedia', '' ), - $this->mConf->siteFromDB( 'wiki' ), - 'siteFromDB() on a suffix' - ); - $this->assertEquals( - array( null, null ), - $this->mConf->siteFromDB( 'wikien' ), - 'siteFromDB() on a non-existing wiki' - ); - - $this->mConf->suffixes = array( 'wiki', '' ); - $this->assertEquals( - array( '', 'wikien' ), - $this->mConf->siteFromDB( 'wikien' ), - 'siteFromDB() on a non-existing wiki (2)' - ); - } - - /** - * @covers SiteConfiguration::getLocalDatabases - */ - public function testGetLocalDatabases() { - $this->assertEquals( - array( 'enwiki', 'dewiki', 'frwiki' ), - $this->mConf->getLocalDatabases(), - 'getLocalDatabases()' - ); - } - - /** - * @covers SiteConfiguration::get - */ - public function testGetConfVariables() { - $this->assertEquals( - 'enwiki', - $this->mConf->get( 'simple', 'enwiki', 'wiki' ), - 'get(): simple setting on an existing wiki' - ); - $this->assertEquals( - 'dewiki', - $this->mConf->get( 'simple', 'dewiki', 'wiki' ), - 'get(): simple setting on an existing wiki (2)' - ); - $this->assertEquals( - 'frwiki', - $this->mConf->get( 'simple', 'frwiki', 'wiki' ), - 'get(): simple setting on an existing wiki (3)' - ); - $this->assertEquals( - 'wiki', - $this->mConf->get( 'simple', 'wiki', 'wiki' ), - 'get(): simple setting on an suffix' - ); - $this->assertEquals( - 'wiki', - $this->mConf->get( 'simple', 'eswiki', 'wiki' ), - 'get(): simple setting on an non-existing wiki' - ); - - $this->assertEquals( - 'wiki', - $this->mConf->get( 'fallback', 'enwiki', 'wiki' ), - 'get(): fallback setting on an existing wiki' - ); - $this->assertEquals( - 'tag', - $this->mConf->get( 'fallback', 'dewiki', 'wiki', array(), array( 'tag' ) ), - 'get(): fallback setting on an existing wiki (with wiki tag)' - ); - $this->assertEquals( - 'wiki', - $this->mConf->get( 'fallback', 'wiki', 'wiki' ), - 'get(): fallback setting on an suffix' - ); - $this->assertEquals( - 'wiki', - $this->mConf->get( 'fallback', 'wiki', 'wiki', array(), array( 'tag' ) ), - 'get(): fallback setting on an suffix (with wiki tag)' - ); - $this->assertEquals( - 'wiki', - $this->mConf->get( 'fallback', 'eswiki', 'wiki' ), - 'get(): fallback setting on an non-existing wiki' - ); - $this->assertEquals( - 'tag', - $this->mConf->get( 'fallback', 'eswiki', 'wiki', array(), array( 'tag' ) ), - 'get(): fallback setting on an non-existing wiki (with wiki tag)' - ); - - $common = array( 'wiki' => 'wiki', 'default' => 'default' ); - $commonTag = array( 'tag' => 'tag', 'wiki' => 'wiki', 'default' => 'default' ); - $this->assertEquals( - array( 'enwiki' => 'enwiki' ) + $common, - $this->mConf->get( 'merge', 'enwiki', 'wiki' ), - 'get(): merging setting on an existing wiki' - ); - $this->assertEquals( - array( 'enwiki' => 'enwiki' ) + $commonTag, - $this->mConf->get( 'merge', 'enwiki', 'wiki', array(), array( 'tag' ) ), - 'get(): merging setting on an existing wiki (with tag)' - ); - $this->assertEquals( - array( 'dewiki' => 'dewiki' ) + $common, - $this->mConf->get( 'merge', 'dewiki', 'wiki' ), - 'get(): merging setting on an existing wiki (2)' - ); - $this->assertEquals( - array( 'dewiki' => 'dewiki' ) + $commonTag, - $this->mConf->get( 'merge', 'dewiki', 'wiki', array(), array( 'tag' ) ), - 'get(): merging setting on an existing wiki (2) (with tag)' - ); - $this->assertEquals( - array( 'frwiki' => 'frwiki' ) + $common, - $this->mConf->get( 'merge', 'frwiki', 'wiki' ), - 'get(): merging setting on an existing wiki (3)' - ); - $this->assertEquals( - array( 'frwiki' => 'frwiki' ) + $commonTag, - $this->mConf->get( 'merge', 'frwiki', 'wiki', array(), array( 'tag' ) ), - 'get(): merging setting on an existing wiki (3) (with tag)' - ); - $this->assertEquals( - array( 'wiki' => 'wiki' ) + $common, - $this->mConf->get( 'merge', 'wiki', 'wiki' ), - 'get(): merging setting on an suffix' - ); - $this->assertEquals( - array( 'wiki' => 'wiki' ) + $commonTag, - $this->mConf->get( 'merge', 'wiki', 'wiki', array(), array( 'tag' ) ), - 'get(): merging setting on an suffix (with tag)' - ); - $this->assertEquals( - $common, - $this->mConf->get( 'merge', 'eswiki', 'wiki' ), - 'get(): merging setting on an non-existing wiki' - ); - $this->assertEquals( - $commonTag, - $this->mConf->get( 'merge', 'eswiki', 'wiki', array(), array( 'tag' ) ), - 'get(): merging setting on an non-existing wiki (with tag)' - ); - } - - /** - * @covers SiteConfiguration::siteFromDB - */ - public function testSiteFromDbWithCallback() { - $this->mConf->siteParamsCallback = 'getSiteParams'; - - $this->assertEquals( - array( 'wiki', 'en' ), - $this->mConf->siteFromDB( 'enwiki' ), - 'siteFromDB() with callback' - ); - $this->assertEquals( - array( 'wiki', '' ), - $this->mConf->siteFromDB( 'wiki' ), - 'siteFromDB() with callback on a suffix' - ); - $this->assertEquals( - array( null, null ), - $this->mConf->siteFromDB( 'wikien' ), - 'siteFromDB() with callback on a non-existing wiki' - ); - } - - /** - * @covers SiteConfiguration::get - */ - public function testParameterReplacement() { - $this->mConf->siteParamsCallback = 'getSiteParams'; - - $this->assertEquals( - 'en wiki enwiki', - $this->mConf->get( 'params', 'enwiki', 'wiki' ), - 'get(): parameter replacement on an existing wiki' - ); - $this->assertEquals( - 'de wiki dewiki', - $this->mConf->get( 'params', 'dewiki', 'wiki' ), - 'get(): parameter replacement on an existing wiki (2)' - ); - $this->assertEquals( - 'fr wiki frwiki', - $this->mConf->get( 'params', 'frwiki', 'wiki' ), - 'get(): parameter replacement on an existing wiki (3)' - ); - $this->assertEquals( - ' wiki wiki', - $this->mConf->get( 'params', 'wiki', 'wiki' ), - 'get(): parameter replacement on an suffix' - ); - $this->assertEquals( - 'es wiki eswiki', - $this->mConf->get( 'params', 'eswiki', 'wiki' ), - 'get(): parameter replacement on an non-existing wiki' - ); - } - - /** - * @covers SiteConfiguration::getAll - */ - public function testGetAllGlobals() { - $this->mConf->siteParamsCallback = 'getSiteParams'; - - $getall = array( - 'simple' => 'enwiki', - 'fallback' => 'tag', - 'params' => 'en wiki enwiki', - 'global' => array( 'enwiki' => 'enwiki' ) + $GLOBALS['global'], - 'merge' => array( 'enwiki' => 'enwiki', 'tag' => 'tag', 'wiki' => 'wiki', 'default' => 'default' ), - ); - $this->assertEquals( $getall, $this->mConf->getAll( 'enwiki' ), 'getAll()' ); - - $this->mConf->extractAllGlobals( 'enwiki', 'wiki' ); - - $this->assertEquals( $getall['simple'], $GLOBALS['simple'], 'extractAllGlobals(): simple setting' ); - $this->assertEquals( $getall['fallback'], $GLOBALS['fallback'], 'extractAllGlobals(): fallback setting' ); - $this->assertEquals( $getall['params'], $GLOBALS['params'], 'extractAllGlobals(): parameter replacement' ); - $this->assertEquals( $getall['global'], $GLOBALS['global'], 'extractAllGlobals(): merging with global' ); - $this->assertEquals( $getall['merge'], $GLOBALS['merge'], 'extractAllGlobals(): merging setting' ); - } -} diff --git a/tests/phpunit/includes/StringUtilsTest.php b/tests/phpunit/includes/StringUtilsTest.php deleted file mode 100644 index 89759e5c..00000000 --- a/tests/phpunit/includes/StringUtilsTest.php +++ /dev/null @@ -1,147 +0,0 @@ -markTestSkipped( 'Test requires the mbstring PHP extension' ); - } - $this->assertEquals( $expected, - StringUtils::isUtf8( $string ), - 'Testing string "' . $this->escaped( $string ) . '" with mb_check_encoding' - ); - } - - /** - * This tests StringUtils::isUtf8 making sure we use the pure PHP - * implementation used as a fallback when mb_check_encoding() is - * not available. - * - * @covers StringUtils::isUtf8 - * @dataProvider provideStringsForIsUtf8Check - */ - public function testIsUtf8WithPhpFallbackImplementation( $expected, $string ) { - $this->assertEquals( $expected, - StringUtils::isUtf8( $string, /** disable mbstring: */true ), - 'Testing string "' . $this->escaped( $string ) . '" with pure PHP implementation' - ); - } - - /** - * Print high range characters as an hexadecimal - */ - function escaped( $string ) { - $escaped = ''; - $length = strlen( $string ); - for ( $i = 0; $i < $length; $i++ ) { - $char = $string[$i]; - $val = ord( $char ); - if ( $val > 127 ) { - $escaped .= '\x' . dechex( $val ); - } else { - $escaped .= $char; - } - } - - return $escaped; - } - - /** - * See also "UTF-8 decoder capability and stress test" by - * Markus Kuhn: - * http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt - */ - public static function provideStringsForIsUtf8Check() { - // Expected return values for StringUtils::isUtf8() - $PASS = true; - $FAIL = false; - - return array( - 'some ASCII' => array( $PASS, 'Some ASCII' ), - 'euro sign' => array( $PASS, "Euro sign €" ), - - 'first possible sequence 1 byte' => array( $PASS, "\x00" ), - 'first possible sequence 2 bytes' => array( $PASS, "\xc2\x80" ), - 'first possible sequence 3 bytes' => array( $PASS, "\xe0\xa0\x80" ), - 'first possible sequence 4 bytes' => array( $PASS, "\xf0\x90\x80\x80" ), - 'first possible sequence 5 bytes' => array( $FAIL, "\xf8\x88\x80\x80\x80" ), - 'first possible sequence 6 bytes' => array( $FAIL, "\xfc\x84\x80\x80\x80\x80" ), - - 'last possible sequence 1 byte' => array( $PASS, "\x7f" ), - 'last possible sequence 2 bytes' => array( $PASS, "\xdf\xbf" ), - 'last possible sequence 3 bytes' => array( $PASS, "\xef\xbf\xbf" ), - 'last possible sequence 4 bytes (U+1FFFFF)' => array( $FAIL, "\xf7\xbf\xbf\xbf" ), - 'last possible sequence 5 bytes' => array( $FAIL, "\xfb\xbf\xbf\xbf\xbf" ), - 'last possible sequence 6 bytes' => array( $FAIL, "\xfd\xbf\xbf\xbf\xbf\xbf" ), - - 'boundary 1' => array( $PASS, "\xed\x9f\xbf" ), - 'boundary 2' => array( $PASS, "\xee\x80\x80" ), - 'boundary 3' => array( $PASS, "\xef\xbf\xbd" ), - 'boundary 4' => array( $PASS, "\xf2\x80\x80\x80" ), - 'boundary 5 (U+FFFFF)' => array( $PASS, "\xf3\xbf\xbf\xbf" ), - 'boundary 6 (U+100000)' => array( $PASS, "\xf4\x80\x80\x80" ), - 'boundary 7 (U+10FFFF)' => array( $PASS, "\xf4\x8f\xbf\xbf" ), - 'boundary 8 (U+110000)' => array( $FAIL, "\xf4\x90\x80\x80" ), - - 'malformed 1' => array( $FAIL, "\x80" ), - 'malformed 2' => array( $FAIL, "\xbf" ), - 'malformed 3' => array( $FAIL, "\x80\xbf" ), - 'malformed 4' => array( $FAIL, "\x80\xbf\x80" ), - 'malformed 5' => array( $FAIL, "\x80\xbf\x80\xbf" ), - 'malformed 6' => array( $FAIL, "\x80\xbf\x80\xbf\x80" ), - 'malformed 7' => array( $FAIL, "\x80\xbf\x80\xbf\x80\xbf" ), - 'malformed 8' => array( $FAIL, "\x80\xbf\x80\xbf\x80\xbf\x80" ), - - 'last byte missing 1' => array( $FAIL, "\xc0" ), - 'last byte missing 2' => array( $FAIL, "\xe0\x80" ), - 'last byte missing 3' => array( $FAIL, "\xf0\x80\x80" ), - 'last byte missing 4' => array( $FAIL, "\xf8\x80\x80\x80" ), - 'last byte missing 5' => array( $FAIL, "\xfc\x80\x80\x80\x80" ), - 'last byte missing 6' => array( $FAIL, "\xdf" ), - 'last byte missing 7' => array( $FAIL, "\xef\xbf" ), - 'last byte missing 8' => array( $FAIL, "\xf7\xbf\xbf" ), - 'last byte missing 9' => array( $FAIL, "\xfb\xbf\xbf\xbf" ), - 'last byte missing 10' => array( $FAIL, "\xfd\xbf\xbf\xbf\xbf" ), - - 'extra continuation byte 1' => array( $FAIL, "e\xaf" ), - 'extra continuation byte 2' => array( $FAIL, "\xc3\x89\xaf" ), - 'extra continuation byte 3' => array( $FAIL, "\xef\xbc\xa5\xaf" ), - 'extra continuation byte 4' => array( $FAIL, "\xf0\x9d\x99\xb4\xaf" ), - - 'impossible bytes 1' => array( $FAIL, "\xfe" ), - 'impossible bytes 2' => array( $FAIL, "\xff" ), - 'impossible bytes 3' => array( $FAIL, "\xfe\xfe\xff\xff" ), - - 'overlong sequences 1' => array( $FAIL, "\xc0\xaf" ), - 'overlong sequences 2' => array( $FAIL, "\xc1\xaf" ), - 'overlong sequences 3' => array( $FAIL, "\xe0\x80\xaf" ), - 'overlong sequences 4' => array( $FAIL, "\xf0\x80\x80\xaf" ), - 'overlong sequences 5' => array( $FAIL, "\xf8\x80\x80\x80\xaf" ), - 'overlong sequences 6' => array( $FAIL, "\xfc\x80\x80\x80\x80\xaf" ), - - 'maximum overlong sequences 1' => array( $FAIL, "\xc1\xbf" ), - 'maximum overlong sequences 2' => array( $FAIL, "\xe0\x9f\xbf" ), - 'maximum overlong sequences 3' => array( $FAIL, "\xf0\x8f\xbf\xbf" ), - 'maximum overlong sequences 4' => array( $FAIL, "\xf8\x87\xbf\xbf" ), - 'maximum overlong sequences 5' => array( $FAIL, "\xfc\x83\xbf\xbf\xbf\xbf" ), - - 'surrogates 1 (U+D799)' => array( $PASS, "\xed\x9f\xbf" ), - 'surrogates 2 (U+E000)' => array( $PASS, "\xee\x80\x80" ), - 'surrogates 3 (U+D800)' => array( $FAIL, "\xed\xa0\x80" ), - 'surrogates 4 (U+DBFF)' => array( $FAIL, "\xed\xaf\xbf" ), - 'surrogates 5 (U+DC00)' => array( $FAIL, "\xed\xb0\x80" ), - 'surrogates 6 (U+DFFF)' => array( $FAIL, "\xed\xbf\xbf" ), - 'surrogates 7 (U+D800 U+DC00)' => array( $FAIL, "\xed\xa0\x80\xed\xb0\x80" ), - - 'noncharacters 1' => array( $PASS, "\xef\xbf\xbe" ), - 'noncharacters 2' => array( $PASS, "\xef\xbf\xbf" ), - ); - } -} diff --git a/tests/phpunit/includes/TemplateCategoriesTest.php b/tests/phpunit/includes/TemplateCategoriesTest.php deleted file mode 100644 index fb63a564..00000000 --- a/tests/phpunit/includes/TemplateCategoriesTest.php +++ /dev/null @@ -1,53 +0,0 @@ -mRights = array( 'createpage', 'edit', 'purge' ); - - $page->doEditContent( - new WikitextContent( '{{Categorising template}}' ), - 'Create a page with a template', - 0, - false, - $user - ); - - $this->assertEquals( - array() - , $title->getParentCategories() - ); - - $template = WikiPage::factory( Title::newFromText( 'Template:Categorising template' ) ); - - $template->doEditContent( - new WikitextContent( '[[Category:Solved bugs]]' ), - 'Add a category through a template', - 0, - false, - $user - ); - - // Run the job queue - JobQueueGroup::destroySingletons(); - $jobs = new RunJobs; - $jobs->loadParamsAndArgs( null, array( 'quiet' => true ), null ); - $jobs->execute(); - - $this->assertEquals( - array( 'Category:Solved_bugs' => $title->getPrefixedText() ) - , $title->getParentCategories() - ); - } -} diff --git a/tests/phpunit/includes/TestUser.php b/tests/phpunit/includes/TestUser.php deleted file mode 100644 index 23e65031..00000000 --- a/tests/phpunit/includes/TestUser.php +++ /dev/null @@ -1,59 +0,0 @@ -username = $username; - $this->realname = $realname; - $this->email = $email; - $this->groups = $groups; - - // don't allow user to hardcode or select passwords -- people sometimes run tests - // on live wikis. Sometimes we create sysop users in these tests. A sysop user with - // a known password would be a Bad Thing. - $this->password = User::randomPassword(); - - $this->user = User::newFromName( $this->username ); - $this->user->load(); - - // In an ideal world we'd have a new wiki (or mock data store) for every single test. - // But for now, we just need to create or update the user with the desired properties. - // we particularly need the new password, since we just generated it randomly. - // In core MediaWiki, there is no functionality to delete users, so this is the best we can do. - if ( !$this->user->getID() ) { - // create the user - $this->user = User::createNew( - $this->username, array( - "email" => $this->email, - "real_name" => $this->realname - ) - ); - if ( !$this->user ) { - throw new Exception( "error creating user" ); - } - } - - // update the user to use the new random password and other details - $this->user->setPassword( $this->password ); - $this->user->setEmail( $this->email ); - $this->user->setRealName( $this->realname ); - // remove all groups, replace with any groups specified - foreach ( $this->user->getGroups() as $group ) { - $this->user->removeGroup( $group ); - } - if ( count( $this->groups ) ) { - foreach ( $this->groups as $group ) { - $this->user->addGroup( $group ); - } - } - $this->user->saveSettings(); - } -} diff --git a/tests/phpunit/includes/TimeAdjustTest.php b/tests/phpunit/includes/TimeAdjustTest.php deleted file mode 100644 index 0b368c25..00000000 --- a/tests/phpunit/includes/TimeAdjustTest.php +++ /dev/null @@ -1,41 +0,0 @@ -iniSet( 'precision', 15 ); - } - - /** - * Test offset usage for a given Language::userAdjust - * @dataProvider dataUserAdjust - * @covers Language::userAdjust - */ - public function testUserAdjust( $date, $localTZoffset, $expected ) { - global $wgContLang; - - $this->setMwGlobals( 'wgLocalTZoffset', $localTZoffset ); - - $this->assertEquals( - strval( $expected ), - strval( $wgContLang->userAdjust( $date, '' ) ), - "User adjust {$date} by {$localTZoffset} minutes should give {$expected}" - ); - } - - public static function dataUserAdjust() { - return array( - array( 20061231235959, 0, 20061231235959 ), - array( 20061231235959, 5, 20070101000459 ), - array( 20061231235959, 15, 20070101001459 ), - array( 20061231235959, 60, 20070101005959 ), - array( 20061231235959, 90, 20070101012959 ), - array( 20061231235959, 120, 20070101015959 ), - array( 20061231235959, 540, 20070101085959 ), - array( 20061231235959, -5, 20061231235459 ), - array( 20061231235959, -30, 20061231232959 ), - array( 20061231235959, -60, 20061231225959 ), - ); - } -} diff --git a/tests/phpunit/includes/TimestampTest.php b/tests/phpunit/includes/TimestampTest.php deleted file mode 100644 index 53388392..00000000 --- a/tests/phpunit/includes/TimestampTest.php +++ /dev/null @@ -1,304 +0,0 @@ -setLanguage( Language::factory( 'en' ) ); - } - - /** - * Test parsing of valid timestamps and outputing to MW format. - * @dataProvider provideValidTimestamps - * @covers MWTimestamp::getTimestamp - */ - public function testValidParse( $format, $original, $expected ) { - $timestamp = new MWTimestamp( $original ); - $this->assertEquals( $expected, $timestamp->getTimestamp( TS_MW ) ); - } - - /** - * Test outputting valid timestamps to different formats. - * @dataProvider provideValidTimestamps - * @covers MWTimestamp::getTimestamp - */ - public function testValidOutput( $format, $expected, $original ) { - $timestamp = new MWTimestamp( $original ); - $this->assertEquals( $expected, (string)$timestamp->getTimestamp( $format ) ); - } - - /** - * Test an invalid timestamp. - * @expectedException TimestampException - * @covers MWTimestamp - */ - public function testInvalidParse() { - new MWTimestamp( "This is not a timestamp." ); - } - - /** - * Test requesting an invalid output format. - * @expectedException TimestampException - * @covers MWTimestamp::getTimestamp - */ - public function testInvalidOutput() { - $timestamp = new MWTimestamp( '1343761268' ); - $timestamp->getTimestamp( 98 ); - } - - /** - * Returns a list of valid timestamps in the format: - * array( type, timestamp_of_type, timestamp_in_MW ) - */ - public static function provideValidTimestamps() { - return array( - // Various formats - array( TS_UNIX, '1343761268', '20120731190108' ), - array( TS_MW, '20120731190108', '20120731190108' ), - array( TS_DB, '2012-07-31 19:01:08', '20120731190108' ), - array( TS_ISO_8601, '2012-07-31T19:01:08Z', '20120731190108' ), - array( TS_ISO_8601_BASIC, '20120731T190108Z', '20120731190108' ), - array( TS_EXIF, '2012:07:31 19:01:08', '20120731190108' ), - array( TS_RFC2822, 'Tue, 31 Jul 2012 19:01:08 GMT', '20120731190108' ), - array( TS_ORACLE, '31-07-2012 19:01:08.000000', '20120731190108' ), - array( TS_POSTGRES, '2012-07-31 19:01:08 GMT', '20120731190108' ), - // Some extremes and weird values - array( TS_ISO_8601, '9999-12-31T23:59:59Z', '99991231235959' ), - array( TS_UNIX, '-62135596801', '00001231235959' ) - ); - } - - /** - * @dataProvider provideHumanTimestampTests - * @covers MWTimestamp::getHumanTimestamp - */ - public function testHumanTimestamp( - $tsTime, // The timestamp to format - $currentTime, // The time to consider "now" - $timeCorrection, // The time offset to use - $dateFormat, // The date preference to use - $expectedOutput, // The expected output - $desc // Description - ) { - $user = $this->getMock( 'User' ); - $user->expects( $this->any() ) - ->method( 'getOption' ) - ->with( 'timecorrection' ) - ->will( $this->returnValue( $timeCorrection ) ); - - $user->expects( $this->any() ) - ->method( 'getDatePreference' ) - ->will( $this->returnValue( $dateFormat ) ); - - $tsTime = new MWTimestamp( $tsTime ); - $currentTime = new MWTimestamp( $currentTime ); - - $this->assertEquals( - $expectedOutput, - $tsTime->getHumanTimestamp( $currentTime, $user ), - $desc - ); - } - - public static function provideHumanTimestampTests() { - return array( - array( - '20111231170000', - '20120101000000', - 'Offset|0', - 'mdy', - 'Yesterday at 17:00', - '"Yesterday" across years', - ), - array( - '20120717190900', - '20120717190929', - 'Offset|0', - 'mdy', - 'just now', - '"Just now"', - ), - array( - '20120717190900', - '20120717191530', - 'Offset|0', - 'mdy', - '6 minutes ago', - 'X minutes ago', - ), - array( - '20121006173100', - '20121006173200', - 'Offset|0', - 'mdy', - '1 minute ago', - '"1 minute ago"', - ), - array( - '20120617190900', - '20120717190900', - 'Offset|0', - 'mdy', - 'June 17', - 'Another month' - ), - array( - '19910130151500', - '20120716193700', - 'Offset|0', - 'mdy', - '15:15, January 30, 1991', - 'Different year', - ), - array( - '20120101050000', - '20120101080000', - 'Offset|-360', - 'mdy', - 'Yesterday at 23:00', - '"Yesterday" across years with time correction', - ), - array( - '20120714184300', - '20120716184300', - 'Offset|-420', - 'mdy', - 'Saturday at 11:43', - 'Recent weekday with time correction', - ), - array( - '20120714184300', - '20120715040000', - 'Offset|-420', - 'mdy', - '11:43', - 'Today at another time with time correction', - ), - array( - '20120617190900', - '20120717190900', - 'Offset|0', - 'dmy', - '17 June', - 'Another month with dmy' - ), - array( - '20120617190900', - '20120717190900', - 'Offset|0', - 'ISO 8601', - '06-17', - 'Another month with ISO-8601' - ), - array( - '19910130151500', - '20120716193700', - 'Offset|0', - 'ISO 8601', - '1991-01-30T15:15:00', - 'Different year with ISO-8601', - ), - ); - } - - /** - * @dataProvider provideRelativeTimestampTests - * @covers MWTimestamp::getRelativeTimestamp - */ - public function testRelativeTimestamp( - $tsTime, // The timestamp to format - $currentTime, // The time to consider "now" - $timeCorrection, // The time offset to use - $dateFormat, // The date preference to use - $expectedOutput, // The expected output - $desc // Description - ) { - $user = $this->getMock( 'User' ); - $user->expects( $this->any() ) - ->method( 'getOption' ) - ->with( 'timecorrection' ) - ->will( $this->returnValue( $timeCorrection ) ); - - $tsTime = new MWTimestamp( $tsTime ); - $currentTime = new MWTimestamp( $currentTime ); - - $this->assertEquals( - $expectedOutput, - $tsTime->getRelativeTimestamp( $currentTime, $user ), - $desc - ); - } - - public static function provideRelativeTimestampTests() { - return array( - array( - '20111231170000', - '20120101000000', - 'Offset|0', - 'mdy', - '7 hours ago', - '"Yesterday" across years', - ), - array( - '20120717190900', - '20120717190929', - 'Offset|0', - 'mdy', - '29 seconds ago', - '"Just now"', - ), - array( - '20120717190900', - '20120717191530', - 'Offset|0', - 'mdy', - '6 minutes and 30 seconds ago', - 'Combination of multiple units', - ), - array( - '20121006173100', - '20121006173200', - 'Offset|0', - 'mdy', - '1 minute ago', - '"1 minute ago"', - ), - array( - '19910130151500', - '20120716193700', - 'Offset|0', - 'mdy', - '2 decades, 1 year, 168 days, 2 hours, 8 minutes and 48 seconds ago', - 'A long time ago', - ), - array( - '20120101050000', - '20120101080000', - 'Offset|-360', - 'mdy', - '3 hours ago', - '"Yesterday" across years with time correction', - ), - array( - '20120714184300', - '20120716184300', - 'Offset|-420', - 'mdy', - '2 days ago', - 'Recent weekday with time correction', - ), - array( - '20120714184300', - '20120715040000', - 'Offset|-420', - 'mdy', - '9 hours and 17 minutes ago', - 'Today at another time with time correction', - ), - ); - } -} diff --git a/tests/phpunit/includes/TitleMethodsTest.php b/tests/phpunit/includes/TitleMethodsTest.php deleted file mode 100644 index 3079d73a..00000000 --- a/tests/phpunit/includes/TitleMethodsTest.php +++ /dev/null @@ -1,300 +0,0 @@ -mergeMwGlobalArrayValue( - 'wgExtraNamespaces', - array( - 12302 => 'TEST-JS', - 12303 => 'TEST-JS_TALK', - ) - ); - - $this->mergeMwGlobalArrayValue( - 'wgNamespaceContentModels', - array( - 12302 => CONTENT_MODEL_JAVASCRIPT, - ) - ); - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - } - - public function tearDown() { - global $wgContLang; - - parent::tearDown(); - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - } - - public static function provideEquals() { - return array( - array( 'Main Page', 'Main Page', true ), - array( 'Main Page', 'Not The Main Page', false ), - array( 'Main Page', 'Project:Main Page', false ), - array( 'File:Example.png', 'Image:Example.png', true ), - array( 'Special:Version', 'Special:Version', true ), - array( 'Special:Version', 'Special:Recentchanges', false ), - array( 'Special:Version', 'Main Page', false ), - ); - } - - /** - * @dataProvider provideEquals - * @covers Title::equals - */ - public function testEquals( $titleA, $titleB, $expectedBool ) { - $titleA = Title::newFromText( $titleA ); - $titleB = Title::newFromText( $titleB ); - - $this->assertEquals( $expectedBool, $titleA->equals( $titleB ) ); - $this->assertEquals( $expectedBool, $titleB->equals( $titleA ) ); - } - - public static function provideInNamespace() { - return array( - array( 'Main Page', NS_MAIN, true ), - array( 'Main Page', NS_TALK, false ), - array( 'Main Page', NS_USER, false ), - array( 'User:Foo', NS_USER, true ), - array( 'User:Foo', NS_USER_TALK, false ), - array( 'User:Foo', NS_TEMPLATE, false ), - array( 'User_talk:Foo', NS_USER_TALK, true ), - array( 'User_talk:Foo', NS_USER, false ), - ); - } - - /** - * @dataProvider provideInNamespace - * @covers Title::inNamespace - */ - public function testInNamespace( $title, $ns, $expectedBool ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedBool, $title->inNamespace( $ns ) ); - } - - /** - * @covers Title::inNamespaces - */ - public function testInNamespaces() { - $mainpage = Title::newFromText( 'Main Page' ); - $this->assertTrue( $mainpage->inNamespaces( NS_MAIN, NS_USER ) ); - $this->assertTrue( $mainpage->inNamespaces( array( NS_MAIN, NS_USER ) ) ); - $this->assertTrue( $mainpage->inNamespaces( array( NS_USER, NS_MAIN ) ) ); - $this->assertFalse( $mainpage->inNamespaces( array( NS_PROJECT, NS_TEMPLATE ) ) ); - } - - public static function provideHasSubjectNamespace() { - return array( - array( 'Main Page', NS_MAIN, true ), - array( 'Main Page', NS_TALK, true ), - array( 'Main Page', NS_USER, false ), - array( 'User:Foo', NS_USER, true ), - array( 'User:Foo', NS_USER_TALK, true ), - array( 'User:Foo', NS_TEMPLATE, false ), - array( 'User_talk:Foo', NS_USER_TALK, true ), - array( 'User_talk:Foo', NS_USER, true ), - ); - } - - /** - * @dataProvider provideHasSubjectNamespace - * @covers Title::hasSubjectNamespace - */ - public function testHasSubjectNamespace( $title, $ns, $expectedBool ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedBool, $title->hasSubjectNamespace( $ns ) ); - } - - public function dataGetContentModel() { - return array( - array( 'Help:Foo', CONTENT_MODEL_WIKITEXT ), - array( 'Help:Foo.js', CONTENT_MODEL_WIKITEXT ), - array( 'Help:Foo/bar.js', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo.js', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo/bar.js', CONTENT_MODEL_JAVASCRIPT ), - array( 'User:Foo/bar.css', CONTENT_MODEL_CSS ), - array( 'User talk:Foo/bar.css', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo/bar.js.xxx', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo/bar.xxx', CONTENT_MODEL_WIKITEXT ), - array( 'MediaWiki:Foo.js', CONTENT_MODEL_JAVASCRIPT ), - array( 'MediaWiki:Foo.css', CONTENT_MODEL_CSS ), - array( 'MediaWiki:Foo/bar.css', CONTENT_MODEL_CSS ), - array( 'MediaWiki:Foo.JS', CONTENT_MODEL_WIKITEXT ), - array( 'MediaWiki:Foo.CSS', CONTENT_MODEL_WIKITEXT ), - array( 'MediaWiki:Foo.css.xxx', CONTENT_MODEL_WIKITEXT ), - array( 'TEST-JS:Foo', CONTENT_MODEL_JAVASCRIPT ), - array( 'TEST-JS:Foo.js', CONTENT_MODEL_JAVASCRIPT ), - array( 'TEST-JS:Foo/bar.js', CONTENT_MODEL_JAVASCRIPT ), - array( 'TEST-JS_TALK:Foo.js', CONTENT_MODEL_WIKITEXT ), - ); - } - - /** - * @dataProvider dataGetContentModel - * @covers Title::getContentModel - */ - public function testGetContentModel( $title, $expectedModelId ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedModelId, $title->getContentModel() ); - } - - /** - * @dataProvider dataGetContentModel - * @covers Title::hasContentModel - */ - public function testHasContentModel( $title, $expectedModelId ) { - $title = Title::newFromText( $title ); - $this->assertTrue( $title->hasContentModel( $expectedModelId ) ); - } - - public static function provideIsCssOrJsPage() { - return array( - array( 'Help:Foo', false ), - array( 'Help:Foo.js', false ), - array( 'Help:Foo/bar.js', false ), - array( 'User:Foo', false ), - array( 'User:Foo.js', false ), - array( 'User:Foo/bar.js', false ), - array( 'User:Foo/bar.css', false ), - array( 'User talk:Foo/bar.css', false ), - array( 'User:Foo/bar.js.xxx', false ), - array( 'User:Foo/bar.xxx', false ), - array( 'MediaWiki:Foo.js', true ), - array( 'MediaWiki:Foo.css', true ), - array( 'MediaWiki:Foo.JS', false ), - array( 'MediaWiki:Foo.CSS', false ), - array( 'MediaWiki:Foo.css.xxx', false ), - array( 'TEST-JS:Foo', false ), - array( 'TEST-JS:Foo.js', false ), - ); - } - - /** - * @dataProvider provideIsCssOrJsPage - * @covers Title::isCssOrJsPage - */ - public function testIsCssOrJsPage( $title, $expectedBool ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedBool, $title->isCssOrJsPage() ); - } - - public static function provideIsCssJsSubpage() { - return array( - array( 'Help:Foo', false ), - array( 'Help:Foo.js', false ), - array( 'Help:Foo/bar.js', false ), - array( 'User:Foo', false ), - array( 'User:Foo.js', false ), - array( 'User:Foo/bar.js', true ), - array( 'User:Foo/bar.css', true ), - array( 'User talk:Foo/bar.css', false ), - array( 'User:Foo/bar.js.xxx', false ), - array( 'User:Foo/bar.xxx', false ), - array( 'MediaWiki:Foo.js', false ), - array( 'User:Foo/bar.JS', false ), - array( 'User:Foo/bar.CSS', false ), - array( 'TEST-JS:Foo', false ), - array( 'TEST-JS:Foo.js', false ), - ); - } - - /** - * @dataProvider provideIsCssJsSubpage - * @covers Title::isCssJsSubpage - */ - public function testIsCssJsSubpage( $title, $expectedBool ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedBool, $title->isCssJsSubpage() ); - } - - public static function provideIsCssSubpage() { - return array( - array( 'Help:Foo', false ), - array( 'Help:Foo.css', false ), - array( 'User:Foo', false ), - array( 'User:Foo.js', false ), - array( 'User:Foo.css', false ), - array( 'User:Foo/bar.js', false ), - array( 'User:Foo/bar.css', true ), - ); - } - - /** - * @dataProvider provideIsCssSubpage - * @covers Title::isCssSubpage - */ - public function testIsCssSubpage( $title, $expectedBool ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedBool, $title->isCssSubpage() ); - } - - public static function provideIsJsSubpage() { - return array( - array( 'Help:Foo', false ), - array( 'Help:Foo.css', false ), - array( 'User:Foo', false ), - array( 'User:Foo.js', false ), - array( 'User:Foo.css', false ), - array( 'User:Foo/bar.js', true ), - array( 'User:Foo/bar.css', false ), - ); - } - - /** - * @dataProvider provideIsJsSubpage - * @covers Title::isJsSubpage - */ - public function testIsJsSubpage( $title, $expectedBool ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedBool, $title->isJsSubpage() ); - } - - public static function provideIsWikitextPage() { - return array( - array( 'Help:Foo', true ), - array( 'Help:Foo.js', true ), - array( 'Help:Foo/bar.js', true ), - array( 'User:Foo', true ), - array( 'User:Foo.js', true ), - array( 'User:Foo/bar.js', false ), - array( 'User:Foo/bar.css', false ), - array( 'User talk:Foo/bar.css', true ), - array( 'User:Foo/bar.js.xxx', true ), - array( 'User:Foo/bar.xxx', true ), - array( 'MediaWiki:Foo.js', false ), - array( 'MediaWiki:Foo.css', false ), - array( 'MediaWiki:Foo/bar.css', false ), - array( 'User:Foo/bar.JS', true ), - array( 'User:Foo/bar.CSS', true ), - array( 'TEST-JS:Foo', false ), - array( 'TEST-JS:Foo.js', false ), - array( 'TEST-JS_TALK:Foo.js', true ), - ); - } - - /** - * @dataProvider provideIsWikitextPage - * @covers Title::isWikitextPage - */ - public function testIsWikitextPage( $title, $expectedBool ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedBool, $title->isWikitextPage() ); - } -} diff --git a/tests/phpunit/includes/TitlePermissionTest.php b/tests/phpunit/includes/TitlePermissionTest.php deleted file mode 100644 index f15c1772..00000000 --- a/tests/phpunit/includes/TitlePermissionTest.php +++ /dev/null @@ -1,742 +0,0 @@ -setMwGlobals( array( - 'wgMemc' => new EmptyBagOStuff, - 'wgContLang' => $langObj, - 'wgLanguageCode' => 'en', - 'wgLang' => $langObj, - 'wgLocaltimezone' => $localZone, - 'wgLocalTZoffset' => $localOffset, - 'wgNamespaceProtection' => array( - NS_MEDIAWIKI => 'editinterface', - ), - ) ); - - $this->userName = 'Useruser'; - $this->altUserName = 'Altuseruser'; - date_default_timezone_set( $localZone ); - - $this->title = Title::makeTitle( NS_MAIN, "Main Page" ); - if ( !isset( $this->userUser ) || !( $this->userUser instanceOf User ) ) { - $this->userUser = User::newFromName( $this->userName ); - - if ( !$this->userUser->getID() ) { - $this->userUser = User::createNew( $this->userName, array( - "email" => "test@example.com", - "real_name" => "Test User" ) ); - $this->userUser->load(); - } - - $this->altUser = User::newFromName( $this->altUserName ); - if ( !$this->altUser->getID() ) { - $this->altUser = User::createNew( $this->altUserName, array( - "email" => "alttest@example.com", - "real_name" => "Test User Alt" ) ); - $this->altUser->load(); - } - - $this->anonUser = User::newFromId( 0 ); - - $this->user = $this->userUser; - } - } - - protected function setUserPerm( $perm ) { - // Setting member variables is evil!!! - - if ( is_array( $perm ) ) { - $this->user->mRights = $perm; - } else { - $this->user->mRights = array( $perm ); - } - } - - protected function setTitle( $ns, $title = "Main_Page" ) { - $this->title = Title::makeTitle( $ns, $title ); - } - - protected function setUser( $userName = null ) { - if ( $userName === 'anon' ) { - $this->user = $this->anonUser; - } elseif ( $userName === null || $userName === $this->userName ) { - $this->user = $this->userUser; - } else { - $this->user = $this->altUser; - } - } - - /** - * @todo This test method should be split up into separate test methods and - * data providers - */ - public function testQuickPermissions() { - global $wgContLang; - $prefix = $wgContLang->getFormattedNsText( NS_PROJECT ); - - $this->setUser( 'anon' ); - $this->setTitle( NS_TALK ); - $this->setUserPerm( "createtalk" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setTitle( NS_TALK ); - $this->setUserPerm( "createpage" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array( array( "nocreatetext" ) ), $res ); - - $this->setTitle( NS_TALK ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array( array( 'nocreatetext' ) ), $res ); - - $this->setTitle( NS_MAIN ); - $this->setUserPerm( "createpage" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setTitle( NS_MAIN ); - $this->setUserPerm( "createtalk" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array( array( 'nocreatetext' ) ), $res ); - - $this->setUser( $this->userName ); - $this->setTitle( NS_TALK ); - $this->setUserPerm( "createtalk" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setTitle( NS_TALK ); - $this->setUserPerm( "createpage" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array( array( 'nocreate-loggedin' ) ), $res ); - - $this->setTitle( NS_TALK ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array( array( 'nocreate-loggedin' ) ), $res ); - - $this->setTitle( NS_MAIN ); - $this->setUserPerm( "createpage" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setTitle( NS_MAIN ); - $this->setUserPerm( "createtalk" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array( array( 'nocreate-loggedin' ) ), $res ); - - $this->setTitle( NS_MAIN ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'create', $this->user ); - $this->assertEquals( array( array( 'nocreate-loggedin' ) ), $res ); - - $this->setUser( 'anon' ); - $this->setTitle( NS_USER, $this->userName . '' ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'cant-move-user-page' ), array( 'movenologintext' ) ), $res ); - - $this->setTitle( NS_USER, $this->userName . '/subpage' ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenologintext' ) ), $res ); - - $this->setTitle( NS_USER, $this->userName . '' ); - $this->setUserPerm( "move-rootuserpages" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenologintext' ) ), $res ); - - $this->setTitle( NS_USER, $this->userName . '/subpage' ); - $this->setUserPerm( "move-rootuserpages" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenologintext' ) ), $res ); - - $this->setTitle( NS_USER, $this->userName . '' ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'cant-move-user-page' ), array( 'movenologintext' ) ), $res ); - - $this->setTitle( NS_USER, $this->userName . '/subpage' ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenologintext' ) ), $res ); - - $this->setTitle( NS_USER, $this->userName . '' ); - $this->setUserPerm( "move-rootuserpages" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenologintext' ) ), $res ); - - $this->setTitle( NS_USER, $this->userName . '/subpage' ); - $this->setUserPerm( "move-rootuserpages" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenologintext' ) ), $res ); - - $this->setUser( $this->userName ); - $this->setTitle( NS_FILE, "img.png" ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenotallowedfile' ), array( 'movenotallowed' ) ), $res ); - - $this->setTitle( NS_FILE, "img.png" ); - $this->setUserPerm( "movefile" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenotallowed' ) ), $res ); - - $this->setUser( 'anon' ); - $this->setTitle( NS_FILE, "img.png" ); - $this->setUserPerm( "" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenotallowedfile' ), array( 'movenologintext' ) ), $res ); - - $this->setTitle( NS_FILE, "img.png" ); - $this->setUserPerm( "movefile" ); - $res = $this->title->getUserPermissionsErrors( 'move', $this->user ); - $this->assertEquals( array( array( 'movenologintext' ) ), $res ); - - $this->setUser( $this->userName ); - $this->setUserPerm( "move" ); - $this->runGroupPermissions( 'move', array( array( 'movenotallowedfile' ) ) ); - - $this->setUserPerm( "" ); - $this->runGroupPermissions( 'move', array( array( 'movenotallowedfile' ), array( 'movenotallowed' ) ) ); - - $this->setUser( 'anon' ); - $this->setUserPerm( "move" ); - $this->runGroupPermissions( 'move', array( array( 'movenotallowedfile' ) ) ); - - $this->setUserPerm( "" ); - $this->runGroupPermissions( 'move', array( array( 'movenotallowedfile' ), array( 'movenotallowed' ) ), - array( array( 'movenotallowedfile' ), array( 'movenologintext' ) ) ); - - if ( $this->isWikitextNS( NS_MAIN ) ) { - //NOTE: some content models don't allow moving - // @todo find a Wikitext namespace for testing - - $this->setTitle( NS_MAIN ); - $this->setUser( 'anon' ); - $this->setUserPerm( "move" ); - $this->runGroupPermissions( 'move', array() ); - - $this->setUserPerm( "" ); - $this->runGroupPermissions( 'move', array( array( 'movenotallowed' ) ), - array( array( 'movenologintext' ) ) ); - - $this->setUser( $this->userName ); - $this->setUserPerm( "" ); - $this->runGroupPermissions( 'move', array( array( 'movenotallowed' ) ) ); - - $this->setUserPerm( "move" ); - $this->runGroupPermissions( 'move', array() ); - - $this->setUser( 'anon' ); - $this->setUserPerm( 'move' ); - $res = $this->title->getUserPermissionsErrors( 'move-target', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setUserPerm( '' ); - $res = $this->title->getUserPermissionsErrors( 'move-target', $this->user ); - $this->assertEquals( array( array( 'movenotallowed' ) ), $res ); - } - - $this->setTitle( NS_USER ); - $this->setUser( $this->userName ); - $this->setUserPerm( array( "move", "move-rootuserpages" ) ); - $res = $this->title->getUserPermissionsErrors( 'move-target', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setUserPerm( "move" ); - $res = $this->title->getUserPermissionsErrors( 'move-target', $this->user ); - $this->assertEquals( array( array( 'cant-move-to-user-page' ) ), $res ); - - $this->setUser( 'anon' ); - $this->setUserPerm( array( "move", "move-rootuserpages" ) ); - $res = $this->title->getUserPermissionsErrors( 'move-target', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setTitle( NS_USER, "User/subpage" ); - $this->setUserPerm( array( "move", "move-rootuserpages" ) ); - $res = $this->title->getUserPermissionsErrors( 'move-target', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setUserPerm( "move" ); - $res = $this->title->getUserPermissionsErrors( 'move-target', $this->user ); - $this->assertEquals( array(), $res ); - - $this->setUser( 'anon' ); - $check = array( 'edit' => array( array( array( 'badaccess-groups', "*, [[$prefix:Users|Users]]", 2 ) ), - array( array( 'badaccess-group0' ) ), - array(), true ), - 'protect' => array( array( array( 'badaccess-groups', "[[$prefix:Administrators|Administrators]]", 1 ), array( 'protect-cantedit' ) ), - array( array( 'badaccess-group0' ), array( 'protect-cantedit' ) ), - array( array( 'protect-cantedit' ) ), false ), - '' => array( array(), array(), array(), true ) ); - - foreach ( array( "edit", "protect", "" ) as $action ) { - $this->setUserPerm( null ); - $this->assertEquals( $check[$action][0], - $this->title->getUserPermissionsErrors( $action, $this->user, true ) ); - - global $wgGroupPermissions; - $old = $wgGroupPermissions; - $wgGroupPermissions = array(); - - $this->assertEquals( $check[$action][1], - $this->title->getUserPermissionsErrors( $action, $this->user, true ) ); - $wgGroupPermissions = $old; - - $this->setUserPerm( $action ); - $this->assertEquals( $check[$action][2], - $this->title->getUserPermissionsErrors( $action, $this->user, true ) ); - - $this->setUserPerm( $action ); - $this->assertEquals( $check[$action][3], - $this->title->userCan( $action, $this->user, true ) ); - $this->assertEquals( $check[$action][3], - $this->title->quickUserCan( $action, $this->user ) ); - # count( User::getGroupsWithPermissions( $action ) ) < 1 - } - } - - protected function runGroupPermissions( $action, $result, $result2 = null ) { - global $wgGroupPermissions; - - if ( $result2 === null ) { - $result2 = $result; - } - - $wgGroupPermissions['autoconfirmed']['move'] = false; - $wgGroupPermissions['user']['move'] = false; - $res = $this->title->getUserPermissionsErrors( $action, $this->user ); - $this->assertEquals( $result, $res ); - - $wgGroupPermissions['autoconfirmed']['move'] = true; - $wgGroupPermissions['user']['move'] = false; - $res = $this->title->getUserPermissionsErrors( $action, $this->user ); - $this->assertEquals( $result2, $res ); - - $wgGroupPermissions['autoconfirmed']['move'] = true; - $wgGroupPermissions['user']['move'] = true; - $res = $this->title->getUserPermissionsErrors( $action, $this->user ); - $this->assertEquals( $result2, $res ); - - $wgGroupPermissions['autoconfirmed']['move'] = false; - $wgGroupPermissions['user']['move'] = true; - $res = $this->title->getUserPermissionsErrors( $action, $this->user ); - $this->assertEquals( $result2, $res ); - } - - /** - * @todo This test method should be split up into separate test methods and - * data providers - */ - public function testSpecialsAndNSPermissions() { - global $wgNamespaceProtection; - $this->setUser( $this->userName ); - - $this->setTitle( NS_SPECIAL ); - - $this->assertEquals( array( array( 'badaccess-group0' ), array( 'ns-specialprotected' ) ), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - - $this->setTitle( NS_MAIN ); - $this->setUserPerm( 'bogus' ); - $this->assertEquals( array(), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - - $this->setTitle( NS_MAIN ); - $this->setUserPerm( '' ); - $this->assertEquals( array( array( 'badaccess-group0' ) ), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - - $wgNamespaceProtection[NS_USER] = array( 'bogus' ); - - $this->setTitle( NS_USER ); - $this->setUserPerm( '' ); - $this->assertEquals( array( array( 'badaccess-group0' ), array( 'namespaceprotected', 'User' ) ), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - - $this->setTitle( NS_MEDIAWIKI ); - $this->setUserPerm( 'bogus' ); - $this->assertEquals( array( array( 'protectedinterface' ) ), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - - $this->setTitle( NS_MEDIAWIKI ); - $this->setUserPerm( 'bogus' ); - $this->assertEquals( array( array( 'protectedinterface' ) ), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - - $wgNamespaceProtection = null; - - $this->setUserPerm( 'bogus' ); - $this->assertEquals( array(), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - $this->assertEquals( true, - $this->title->userCan( 'bogus', $this->user ) ); - - $this->setUserPerm( '' ); - $this->assertEquals( array( array( 'badaccess-group0' ) ), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - $this->assertEquals( false, - $this->title->userCan( 'bogus', $this->user ) ); - } - - /** - * @todo This test method should be split up into separate test methods and - * data providers - */ - public function testCssAndJavascriptPermissions() { - $this->setUser( $this->userName ); - - $this->setTitle( NS_USER, $this->userName . '/test.js' ); - $this->runCSSandJSPermissions( - array( array( 'badaccess-group0' ), array( 'mycustomjsprotected' ) ), - array( array( 'badaccess-group0' ), array( 'mycustomjsprotected' ) ), - array( array( 'badaccess-group0' ) ), - array( array( 'badaccess-group0' ), array( 'mycustomjsprotected' ) ), - array( array( 'badaccess-group0' ) ) - ); - - $this->setTitle( NS_USER, $this->userName . '/test.css' ); - $this->runCSSandJSPermissions( - array( array( 'badaccess-group0' ), array( 'mycustomcssprotected' ) ), - array( array( 'badaccess-group0' ) ), - array( array( 'badaccess-group0' ), array( 'mycustomcssprotected' ) ), - array( array( 'badaccess-group0' ) ), - array( array( 'badaccess-group0' ), array( 'mycustomcssprotected' ) ) - ); - - $this->setTitle( NS_USER, $this->altUserName . '/test.js' ); - $this->runCSSandJSPermissions( - array( array( 'badaccess-group0' ), array( 'customjsprotected' ) ), - array( array( 'badaccess-group0' ), array( 'customjsprotected' ) ), - array( array( 'badaccess-group0' ), array( 'customjsprotected' ) ), - array( array( 'badaccess-group0' ), array( 'customjsprotected' ) ), - array( array( 'badaccess-group0' ) ) - ); - - $this->setTitle( NS_USER, $this->altUserName . '/test.css' ); - $this->runCSSandJSPermissions( - array( array( 'badaccess-group0' ), array( 'customcssprotected' ) ), - array( array( 'badaccess-group0' ), array( 'customcssprotected' ) ), - array( array( 'badaccess-group0' ), array( 'customcssprotected' ) ), - array( array( 'badaccess-group0' ) ), - array( array( 'badaccess-group0' ), array( 'customcssprotected' ) ) - ); - - $this->setTitle( NS_USER, $this->altUserName . '/tempo' ); - $this->runCSSandJSPermissions( - array( array( 'badaccess-group0' ) ), - array( array( 'badaccess-group0' ) ), - array( array( 'badaccess-group0' ) ), - array( array( 'badaccess-group0' ) ), - array( array( 'badaccess-group0' ) ) - ); - } - - protected function runCSSandJSPermissions( $result0, $result1, $result2, $result3, $result4 ) { - $this->setUserPerm( '' ); - $this->assertEquals( $result0, - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - - $this->setUserPerm( 'editmyusercss' ); - $this->assertEquals( $result1, - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - - $this->setUserPerm( 'editmyuserjs' ); - $this->assertEquals( $result2, - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - - $this->setUserPerm( 'editusercss' ); - $this->assertEquals( $result3, - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - - $this->setUserPerm( 'edituserjs' ); - $this->assertEquals( $result4, - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - - $this->setUserPerm( 'editusercssjs' ); - $this->assertEquals( array( array( 'badaccess-group0' ) ), - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - - $this->setUserPerm( array( 'edituserjs', 'editusercss' ) ); - $this->assertEquals( array( array( 'badaccess-group0' ) ), - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - } - - /** - * @todo This test method should be split up into separate test methods and - * data providers - */ - public function testPageRestrictions() { - global $wgContLang; - - $prefix = $wgContLang->getFormattedNsText( NS_PROJECT ); - - $this->setTitle( NS_MAIN ); - $this->title->mRestrictionsLoaded = true; - $this->setUserPerm( "edit" ); - $this->title->mRestrictions = array( "bogus" => array( 'bogus', "sysop", "protect", "" ) ); - - $this->assertEquals( array(), - $this->title->getUserPermissionsErrors( 'edit', - $this->user ) ); - - $this->assertEquals( true, - $this->title->quickUserCan( 'edit', $this->user ) ); - $this->title->mRestrictions = array( "edit" => array( 'bogus', "sysop", "protect", "" ), - "bogus" => array( 'bogus', "sysop", "protect", "" ) ); - - $this->assertEquals( array( array( 'badaccess-group0' ), - array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'editprotected' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - $this->assertEquals( array( array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'editprotected' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'edit', - $this->user ) ); - $this->setUserPerm( "" ); - $this->assertEquals( array( array( 'badaccess-group0' ), - array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'editprotected' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - $this->assertEquals( array( array( 'badaccess-groups', "*, [[$prefix:Users|Users]]", 2 ), - array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'editprotected' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'edit', - $this->user ) ); - $this->setUserPerm( array( "edit", "editprotected" ) ); - $this->assertEquals( array( array( 'badaccess-group0' ), - array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - $this->assertEquals( array( - array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'edit', - $this->user ) ); - - $this->title->mCascadeRestriction = true; - $this->setUserPerm( "edit" ); - $this->assertEquals( false, - $this->title->quickUserCan( 'bogus', $this->user ) ); - $this->assertEquals( false, - $this->title->quickUserCan( 'edit', $this->user ) ); - $this->assertEquals( array( array( 'badaccess-group0' ), - array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'editprotected' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - $this->assertEquals( array( array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'editprotected' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'edit', - $this->user ) ); - - $this->setUserPerm( array( "edit", "editprotected" ) ); - $this->assertEquals( false, - $this->title->quickUserCan( 'bogus', $this->user ) ); - $this->assertEquals( false, - $this->title->quickUserCan( 'edit', $this->user ) ); - $this->assertEquals( array( array( 'badaccess-group0' ), - array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'protect' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'bogus', - $this->user ) ); - $this->assertEquals( array( array( 'protectedpagetext', 'bogus' ), - array( 'protectedpagetext', 'protect' ), - array( 'protectedpagetext', 'protect' ) ), - $this->title->getUserPermissionsErrors( 'edit', - $this->user ) ); - } - - public function testCascadingSourcesRestrictions() { - $this->setTitle( NS_MAIN, "test page" ); - $this->setUserPerm( array( "edit", "bogus" ) ); - - $this->title->mCascadeSources = array( Title::makeTitle( NS_MAIN, "Bogus" ), Title::makeTitle( NS_MAIN, "UnBogus" ) ); - $this->title->mCascadingRestrictions = array( "bogus" => array( 'bogus', "sysop", "protect", "" ) ); - - $this->assertEquals( false, - $this->title->userCan( 'bogus', $this->user ) ); - $this->assertEquals( array( array( "cascadeprotected", 2, "* [[:Bogus]]\n* [[:UnBogus]]\n" ), - array( "cascadeprotected", 2, "* [[:Bogus]]\n* [[:UnBogus]]\n" ), - array( "cascadeprotected", 2, "* [[:Bogus]]\n* [[:UnBogus]]\n" ) ), - $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); - - $this->assertEquals( true, - $this->title->userCan( 'edit', $this->user ) ); - $this->assertEquals( array(), - $this->title->getUserPermissionsErrors( 'edit', $this->user ) ); - } - - /** - * @todo This test method should be split up into separate test methods and - * data providers - */ - public function testActionPermissions() { - $this->setUserPerm( array( "createpage" ) ); - $this->setTitle( NS_MAIN, "test page" ); - $this->title->mTitleProtection['pt_create_perm'] = ''; - $this->title->mTitleProtection['pt_user'] = $this->user->getID(); - $this->title->mTitleProtection['pt_expiry'] = wfGetDB( DB_SLAVE )->getInfinity(); - $this->title->mTitleProtection['pt_reason'] = 'test'; - $this->title->mCascadeRestriction = false; - - $this->assertEquals( array( array( 'titleprotected', 'Useruser', 'test' ) ), - $this->title->getUserPermissionsErrors( 'create', $this->user ) ); - $this->assertEquals( false, - $this->title->userCan( 'create', $this->user ) ); - - $this->title->mTitleProtection['pt_create_perm'] = 'sysop'; - $this->setUserPerm( array( 'createpage', 'protect' ) ); - $this->assertEquals( array( array( 'titleprotected', 'Useruser', 'test' ) ), - $this->title->getUserPermissionsErrors( 'create', $this->user ) ); - $this->assertEquals( false, - $this->title->userCan( 'create', $this->user ) ); - - $this->setUserPerm( array( 'createpage', 'editprotected' ) ); - $this->assertEquals( array(), - $this->title->getUserPermissionsErrors( 'create', $this->user ) ); - $this->assertEquals( true, - $this->title->userCan( 'create', $this->user ) ); - - $this->setUserPerm( array( 'createpage' ) ); - $this->assertEquals( array( array( 'titleprotected', 'Useruser', 'test' ) ), - $this->title->getUserPermissionsErrors( 'create', $this->user ) ); - $this->assertEquals( false, - $this->title->userCan( 'create', $this->user ) ); - - $this->setTitle( NS_MEDIA, "test page" ); - $this->setUserPerm( array( "move" ) ); - $this->assertEquals( false, - $this->title->userCan( 'move', $this->user ) ); - $this->assertEquals( array( array( 'immobile-source-namespace', 'Media' ) ), - $this->title->getUserPermissionsErrors( 'move', $this->user ) ); - - $this->setTitle( NS_HELP, "test page" ); - $this->assertEquals( array(), - $this->title->getUserPermissionsErrors( 'move', $this->user ) ); - $this->assertEquals( true, - $this->title->userCan( 'move', $this->user ) ); - - $this->title->mInterwiki = "no"; - $this->assertEquals( array( array( 'immobile-source-page' ) ), - $this->title->getUserPermissionsErrors( 'move', $this->user ) ); - $this->assertEquals( false, - $this->title->userCan( 'move', $this->user ) ); - - $this->setTitle( NS_MEDIA, "test page" ); - $this->assertEquals( false, - $this->title->userCan( 'move-target', $this->user ) ); - $this->assertEquals( array( array( 'immobile-target-namespace', 'Media' ) ), - $this->title->getUserPermissionsErrors( 'move-target', $this->user ) ); - - $this->setTitle( NS_HELP, "test page" ); - $this->assertEquals( array(), - $this->title->getUserPermissionsErrors( 'move-target', $this->user ) ); - $this->assertEquals( true, - $this->title->userCan( 'move-target', $this->user ) ); - - $this->title->mInterwiki = "no"; - $this->assertEquals( array( array( 'immobile-target-page' ) ), - $this->title->getUserPermissionsErrors( 'move-target', $this->user ) ); - $this->assertEquals( false, - $this->title->userCan( 'move-target', $this->user ) ); - } - - public function testUserBlock() { - global $wgEmailConfirmToEdit, $wgEmailAuthentication; - $wgEmailConfirmToEdit = true; - $wgEmailAuthentication = true; - - $this->setUserPerm( array( "createpage", "move" ) ); - $this->setTitle( NS_HELP, "test page" ); - - # $short - $this->assertEquals( array( array( 'confirmedittext' ) ), - $this->title->getUserPermissionsErrors( 'move-target', $this->user ) ); - $wgEmailConfirmToEdit = false; - $this->assertEquals( true, $this->title->userCan( 'move-target', $this->user ) ); - - # $wgEmailConfirmToEdit && !$user->isEmailConfirmed() && $action != 'createaccount' - $this->assertEquals( array(), - $this->title->getUserPermissionsErrors( 'move-target', - $this->user ) ); - - global $wgLang; - $prev = time(); - $now = time() + 120; - $this->user->mBlockedby = $this->user->getId(); - $this->user->mBlock = new Block( '127.0.8.1', 0, $this->user->getId(), - 'no reason given', $prev + 3600, 1, 0 ); - $this->user->mBlock->mTimestamp = 0; - $this->assertEquals( array( array( 'autoblockedtext', - '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1', - 'Useruser', null, 'infinite', '127.0.8.1', - $wgLang->timeanddate( wfTimestamp( TS_MW, $prev ), true ) ) ), - $this->title->getUserPermissionsErrors( 'move-target', - $this->user ) ); - - $this->assertEquals( false, $this->title->userCan( 'move-target', $this->user ) ); - // quickUserCan should ignore user blocks - $this->assertEquals( true, $this->title->quickUserCan( 'move-target', $this->user ) ); - - global $wgLocalTZoffset; - $wgLocalTZoffset = -60; - $this->user->mBlockedby = $this->user->getName(); - $this->user->mBlock = new Block( '127.0.8.1', 0, $this->user->getId(), - 'no reason given', $now, 0, 10 ); - $this->assertEquals( array( array( 'blockedtext', - '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1', - 'Useruser', null, '23:00, 31 December 1969', '127.0.8.1', - $wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ) ), - $this->title->getUserPermissionsErrors( 'move-target', $this->user ) ); - # $action != 'read' && $action != 'createaccount' && $user->isBlockedFrom( $this ) - # $user->blockedFor() == '' - # $user->mBlock->mExpiry == 'infinity' - } -} diff --git a/tests/phpunit/includes/TitleTest.php b/tests/phpunit/includes/TitleTest.php deleted file mode 100644 index 6bfe5453..00000000 --- a/tests/phpunit/includes/TitleTest.php +++ /dev/null @@ -1,485 +0,0 @@ -setMwGlobals( array( - 'wgLanguageCode' => 'en', - 'wgContLang' => Language::factory( 'en' ), - // User language - 'wgLang' => Language::factory( 'en' ), - 'wgAllowUserJs' => false, - 'wgDefaultLanguageVariant' => false, - ) ); - } - - /** - * @covers Title::legalChars - */ - public function testLegalChars() { - $titlechars = Title::legalChars(); - - foreach ( range( 1, 255 ) as $num ) { - $chr = chr( $num ); - if ( strpos( "#[]{}<>|", $chr ) !== false || preg_match( "/[\\x00-\\x1f\\x7f]/", $chr ) ) { - $this->assertFalse( (bool)preg_match( "/[$titlechars]/", $chr ), "chr($num) = $chr is not a valid titlechar" ); - } else { - $this->assertTrue( (bool)preg_match( "/[$titlechars]/", $chr ), "chr($num) = $chr is a valid titlechar" ); - } - } - } - - /** - * See also mediawiki.Title.test.js - * @covers Title::secureAndSplit - * @todo This method should be split into 2 separate tests each with a provider - */ - public function testSecureAndSplit() { - // Valid - foreach ( array( - 'Sandbox', - 'A "B"', - 'A \'B\'', - '.com', - '~', - '"', - '\'', - 'Talk:Sandbox', - 'Talk:Foo:Sandbox', - 'File:Example.svg', - 'File_talk:Example.svg', - 'Foo/.../Sandbox', - 'Sandbox/...', - 'A~~', - // Length is 256 total, but only title part matters - 'Category:' . str_repeat( 'x', 248 ), - str_repeat( 'x', 252 ) - ) as $text ) { - $this->assertInstanceOf( 'Title', Title::newFromText( $text ), "Valid: $text" ); - } - - // Invalid - foreach ( array( - '', - '__ __', - ' __ ', - // Bad characters forbidden regardless of wgLegalTitleChars - 'A [ B', - 'A ] B', - 'A { B', - 'A } B', - 'A < B', - 'A > B', - 'A | B', - // URL encoding - 'A%20B', - 'A%23B', - 'A%2523B', - // XML/HTML character entity references - // Note: Commented out because they are not marked invalid by the PHP test as - // Title::newFromText runs Sanitizer::decodeCharReferencesAndNormalize first. - //'A é B', - //'A é B', - //'A é B', - // Subject of NS_TALK does not roundtrip to NS_MAIN - 'Talk:File:Example.svg', - // Directory navigation - '.', - '..', - './Sandbox', - '../Sandbox', - 'Foo/./Sandbox', - 'Foo/../Sandbox', - 'Sandbox/.', - 'Sandbox/..', - // Tilde - 'A ~~~ Name', - 'A ~~~~ Signature', - 'A ~~~~~ Timestamp', - str_repeat( 'x', 256 ), - // Namespace prefix without actual title - // ':', // bug 54044 - 'Talk:', - 'Category: ', - 'Category: #bar' - ) as $text ) { - $this->assertNull( Title::newFromText( $text ), "Invalid: $text" ); - } - } - - public static function provideConvertByteClassToUnicodeClass() { - return array( - array( - ' %!"$&\'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF+', - ' %!"$&\'()*,\\-./0-9:;=?@A-Z\\\\\\^_`a-z~+\\u0080-\\uFFFF', - ), - array( - 'QWERTYf-\\xFF+', - 'QWERTYf-\\x7F+\\u0080-\\uFFFF', - ), - array( - 'QWERTY\\x66-\\xFD+', - 'QWERTYf-\\x7F+\\u0080-\\uFFFF', - ), - array( - 'QWERTYf-y+', - 'QWERTYf-y+', - ), - array( - 'QWERTYf-\\x80+', - 'QWERTYf-\\x7F+\\u0080-\\uFFFF', - ), - array( - 'QWERTY\\x66-\\x80+\\x23', - 'QWERTYf-\\x7F+#\\u0080-\\uFFFF', - ), - array( - 'QWERTY\\x66-\\x80+\\xD3', - 'QWERTYf-\\x7F+\\u0080-\\uFFFF', - ), - array( - '\\\\\\x99', - '\\\\\\u0080-\\uFFFF', - ), - array( - '-\\x99', - '\\-\\u0080-\\uFFFF', - ), - array( - 'QWERTY\\-\\x99', - 'QWERTY\\-\\u0080-\\uFFFF', - ), - array( - '\\\\x99', - '\\\\x99', - ), - array( - 'A-\\x9F', - 'A-\\x7F\\u0080-\\uFFFF', - ), - array( - '\\x66-\\x77QWERTY\\x88-\\x91FXZ', - 'f-wQWERTYFXZ\\u0080-\\uFFFF', - ), - array( - '\\x66-\\x99QWERTY\\xAA-\\xEEFXZ', - 'f-\\x7FQWERTYFXZ\\u0080-\\uFFFF', - ), - ); - } - - /** - * @dataProvider provideConvertByteClassToUnicodeClass - * @covers Title::convertByteClassToUnicodeClass - */ - public function testConvertByteClassToUnicodeClass( $byteClass, $unicodeClass ) { - $this->assertEquals( $unicodeClass, Title::convertByteClassToUnicodeClass( $byteClass ) ); - } - - /** - * @dataProvider provideBug31100 - * @covers Title::fixSpecialName - */ - public function testBug31100FixSpecialName( $text, $expectedParam ) { - $title = Title::newFromText( $text ); - $fixed = $title->fixSpecialName(); - $stuff = explode( '/', $fixed->getDBkey(), 2 ); - if ( count( $stuff ) == 2 ) { - $par = $stuff[1]; - } else { - $par = null; - } - $this->assertEquals( $expectedParam, $par, "Bug 31100 regression check: Title->fixSpecialName() should preserve parameter" ); - } - - public static function provideBug31100() { - return array( - array( 'Special:Version', null ), - array( 'Special:Version/', '' ), - array( 'Special:Version/param', 'param' ), - ); - } - - /** - * Auth-less test of Title::isValidMoveOperation - * - * @group Database - * @param string $source - * @param string $target - * @param array|string|bool $expected Required error - * @dataProvider provideTestIsValidMoveOperation - * @covers Title::isValidMoveOperation - */ - public function testIsValidMoveOperation( $source, $target, $expected ) { - $title = Title::newFromText( $source ); - $nt = Title::newFromText( $target ); - $errors = $title->isValidMoveOperation( $nt, false ); - if ( $expected === true ) { - $this->assertTrue( $errors ); - } else { - $errors = $this->flattenErrorsArray( $errors ); - foreach ( (array)$expected as $error ) { - $this->assertContains( $error, $errors ); - } - } - } - - /** - * Provides test parameter values for testIsValidMoveOperation() - */ - public function dataTestIsValidMoveOperation() { - return array( - array( 'Test', 'Test', 'selfmove' ), - array( 'File:Test.jpg', 'Page', 'imagenocrossnamespace' ) - ); - } - - /** - * Auth-less test of Title::userCan - * - * @param array $whitelistRegexp - * @param string $source - * @param string $action - * @param array|string|bool $expected Required error - * - * @covers Title::checkReadPermissions - * @dataProvider dataWgWhitelistReadRegexp - */ - public function testWgWhitelistReadRegexp( $whitelistRegexp, $source, $action, $expected ) { - // $wgWhitelistReadRegexp must be an array. Since the provided test cases - // usually have only one regex, it is more concise to write the lonely regex - // as a string. Thus we cast to an array() to honor $wgWhitelistReadRegexp - // type requisite. - if ( is_string( $whitelistRegexp ) ) { - $whitelistRegexp = array( $whitelistRegexp ); - } - - $title = Title::newFromDBkey( $source ); - - global $wgGroupPermissions; - $oldPermissions = $wgGroupPermissions; - // Disallow all so we can ensure our regex works - $wgGroupPermissions = array(); - $wgGroupPermissions['*']['read'] = false; - - global $wgWhitelistRead; - $oldWhitelist = $wgWhitelistRead; - // Undo any LocalSettings explicite whitelists so they won't cause a - // failing test to succeed. Set it to some random non sense just - // to make sure we properly test Title::checkReadPermissions() - $wgWhitelistRead = array( 'some random non sense title' ); - - global $wgWhitelistReadRegexp; - $oldWhitelistRegexp = $wgWhitelistReadRegexp; - $wgWhitelistReadRegexp = $whitelistRegexp; - - // Just use $wgUser which in test is a user object for '127.0.0.1' - global $wgUser; - // Invalidate user rights cache to take in account $wgGroupPermissions - // change above. - $wgUser->clearInstanceCache(); - $errors = $title->userCan( $action, $wgUser ); - - // Restore globals - $wgGroupPermissions = $oldPermissions; - $wgWhitelistRead = $oldWhitelist; - $wgWhitelistReadRegexp = $oldWhitelistRegexp; - - if ( is_bool( $expected ) ) { - # Forge the assertion message depending on the assertion expectation - $allowableness = $expected - ? " should be allowed" - : " should NOT be allowed"; - $this->assertEquals( $expected, $errors, "User action '$action' on [[$source]] $allowableness." ); - } else { - $errors = $this->flattenErrorsArray( $errors ); - foreach ( (array)$expected as $error ) { - $this->assertContains( $error, $errors ); - } - } - } - - /** - * Provides test parameter values for testWgWhitelistReadRegexp() - */ - public function dataWgWhitelistReadRegexp() { - $ALLOWED = true; - $DISALLOWED = false; - - return array( - // Everything, if this doesn't work, we're really in trouble - array( '/.*/', 'Main_Page', 'read', $ALLOWED ), - array( '/.*/', 'Main_Page', 'edit', $DISALLOWED ), - - // We validate against the title name, not the db key - array( '/^Main_Page$/', 'Main_Page', 'read', $DISALLOWED ), - // Main page - array( '/^Main/', 'Main_Page', 'read', $ALLOWED ), - array( '/^Main.*/', 'Main_Page', 'read', $ALLOWED ), - // With spaces - array( '/Mic\sCheck/', 'Mic Check', 'read', $ALLOWED ), - // Unicode multibyte - // ...without unicode modifier - array( '/Unicode Test . Yes/', 'Unicode Test Ñ Yes', 'read', $DISALLOWED ), - // ...with unicode modifier - array( '/Unicode Test . Yes/u', 'Unicode Test Ñ Yes', 'read', $ALLOWED ), - // Case insensitive - array( '/MiC ChEcK/', 'mic check', 'read', $DISALLOWED ), - array( '/MiC ChEcK/i', 'mic check', 'read', $ALLOWED ), - - // From DefaultSettings.php: - array( "@^UsEr.*@i", 'User is banned', 'read', $ALLOWED ), - array( "@^UsEr.*@i", 'User:John Doe', 'read', $ALLOWED ), - - // With namespaces: - array( '/^Special:NewPages$/', 'Special:NewPages', 'read', $ALLOWED ), - array( null, 'Special:Newpages', 'read', $DISALLOWED ), - - ); - } - - public function flattenErrorsArray( $errors ) { - $result = array(); - foreach ( $errors as $error ) { - $result[] = $error[0]; - } - - return $result; - } - - public static function provideTestIsValidMoveOperation() { - return array( - array( 'Test', 'Test', 'selfmove' ), - array( 'File:Test.jpg', 'Page', 'imagenocrossnamespace' ) - ); - } - - /** - * @dataProvider provideGetPageViewLanguage - * @covers Title::getPageViewLanguage - */ - public function testGetPageViewLanguage( $expected, $titleText, $contLang, $lang, $variant, $msg = '' ) { - global $wgLanguageCode, $wgContLang, $wgLang, $wgDefaultLanguageVariant, $wgAllowUserJs; - - // Setup environnement for this test - $wgLanguageCode = $contLang; - $wgContLang = Language::factory( $contLang ); - $wgLang = Language::factory( $lang ); - $wgDefaultLanguageVariant = $variant; - $wgAllowUserJs = true; - - $title = Title::newFromText( $titleText ); - $this->assertInstanceOf( 'Title', $title, - "Test must be passed a valid title text, you gave '$titleText'" - ); - $this->assertEquals( $expected, - $title->getPageViewLanguage()->getCode(), - $msg - ); - } - - public static function provideGetPageViewLanguage() { - # Format: - # - expected - # - Title name - # - wgContLang (expected in most case) - # - wgLang (on some specific pages) - # - wgDefaultLanguageVariant - # - Optional message - return array( - array( 'fr', 'Help:I_need_somebody', 'fr', 'fr', false ), - array( 'es', 'Help:I_need_somebody', 'es', 'zh-tw', false ), - array( 'zh', 'Help:I_need_somebody', 'zh', 'zh-tw', false ), - - array( 'es', 'Help:I_need_somebody', 'es', 'zh-tw', 'zh-cn' ), - array( 'es', 'MediaWiki:About', 'es', 'zh-tw', 'zh-cn' ), - array( 'es', 'MediaWiki:About/', 'es', 'zh-tw', 'zh-cn' ), - array( 'de', 'MediaWiki:About/de', 'es', 'zh-tw', 'zh-cn' ), - array( 'en', 'MediaWiki:Common.js', 'es', 'zh-tw', 'zh-cn' ), - array( 'en', 'MediaWiki:Common.css', 'es', 'zh-tw', 'zh-cn' ), - array( 'en', 'User:JohnDoe/Common.js', 'es', 'zh-tw', 'zh-cn' ), - array( 'en', 'User:JohnDoe/Monobook.css', 'es', 'zh-tw', 'zh-cn' ), - - array( 'zh-cn', 'Help:I_need_somebody', 'zh', 'zh-tw', 'zh-cn' ), - array( 'zh', 'MediaWiki:About', 'zh', 'zh-tw', 'zh-cn' ), - array( 'zh', 'MediaWiki:About/', 'zh', 'zh-tw', 'zh-cn' ), - array( 'de', 'MediaWiki:About/de', 'zh', 'zh-tw', 'zh-cn' ), - array( 'zh-cn', 'MediaWiki:About/zh-cn', 'zh', 'zh-tw', 'zh-cn' ), - array( 'zh-tw', 'MediaWiki:About/zh-tw', 'zh', 'zh-tw', 'zh-cn' ), - array( 'en', 'MediaWiki:Common.js', 'zh', 'zh-tw', 'zh-cn' ), - array( 'en', 'MediaWiki:Common.css', 'zh', 'zh-tw', 'zh-cn' ), - array( 'en', 'User:JohnDoe/Common.js', 'zh', 'zh-tw', 'zh-cn' ), - array( 'en', 'User:JohnDoe/Monobook.css', 'zh', 'zh-tw', 'zh-cn' ), - - array( 'zh-tw', 'Special:NewPages', 'es', 'zh-tw', 'zh-cn' ), - array( 'zh-tw', 'Special:NewPages', 'zh', 'zh-tw', 'zh-cn' ), - - ); - } - - /** - * @dataProvider provideBaseTitleCases - * @covers Title::getBaseText - */ - public function testGetBaseText( $title, $expected, $msg = '' ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expected, - $title->getBaseText(), - $msg - ); - } - - public static function provideBaseTitleCases() { - return array( - # Title, expected base, optional message - array( 'User:John_Doe/subOne/subTwo', 'John Doe/subOne' ), - array( 'User:Foo/Bar/Baz', 'Foo/Bar' ), - ); - } - - /** - * @dataProvider provideRootTitleCases - * @covers Title::getRootText - */ - public function testGetRootText( $title, $expected, $msg = '' ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expected, - $title->getRootText(), - $msg - ); - } - - public static function provideRootTitleCases() { - return array( - # Title, expected base, optional message - array( 'User:John_Doe/subOne/subTwo', 'John Doe' ), - array( 'User:Foo/Bar/Baz', 'Foo' ), - ); - } - - /** - * @todo Handle $wgNamespacesWithSubpages cases - * @dataProvider provideSubpageTitleCases - * @covers Title::getSubpageText - */ - public function testGetSubpageText( $title, $expected, $msg = '' ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expected, - $title->getSubpageText(), - $msg - ); - } - - public static function provideSubpageTitleCases() { - return array( - # Title, expected base, optional message - array( 'User:John_Doe/subOne/subTwo', 'subTwo' ), - array( 'User:John_Doe/subOne', 'subOne' ), - ); - } -} diff --git a/tests/phpunit/includes/UIDGeneratorTest.php b/tests/phpunit/includes/UIDGeneratorTest.php deleted file mode 100644 index 8f78ae51..00000000 --- a/tests/phpunit/includes/UIDGeneratorTest.php +++ /dev/null @@ -1,98 +0,0 @@ -assertEquals( true, ctype_digit( $id ), "UID made of digit characters" ); - $this->assertLessThanOrEqual( $digitlen, strlen( $id ), - "UID has the right number of digits" ); - $this->assertLessThanOrEqual( $bits, strlen( wfBaseConvert( $id, 10, 2 ) ), - "UID has the right number of bits" ); - - $ids = array(); - for ( $i = 0; $i < 300; $i++ ) { - $ids[] = call_user_func( array( 'UIDGenerator', $method ) ); - } - - $lastId = array_shift( $ids ); - if ( $hostbits ) { - $lastHost = substr( wfBaseConvert( $lastId, 10, 2, $bits ), -$hostbits ); - } - - $this->assertArrayEquals( array_unique( $ids ), $ids, "All generated IDs are unique." ); - - foreach ( $ids as $id ) { - $id_bin = wfBaseConvert( $id, 10, 2 ); - $lastId_bin = wfBaseConvert( $lastId, 10, 2 ); - - $this->assertGreaterThanOrEqual( - substr( $id_bin, 0, $tbits ), - substr( $lastId_bin, 0, $tbits ), - "New ID timestamp ($id_bin) >= prior one ($lastId_bin)." ); - - if ( $hostbits ) { - $this->assertEquals( - substr( $id_bin, 0, -$hostbits ), - substr( $lastId_bin, 0, -$hostbits ), - "Host ID of ($id_bin) is same as prior one ($lastId_bin)." ); - } - - $lastId = $id; - } - } - - /** - * array( method, length, bits, hostbits ) - * NOTE: When adding a new method name here please update the covers tags for the tests! - */ - public static function provider_testTimestampedUID() { - return array( - array( 'newTimestampedUID128', 39, 128, 46, 48 ), - array( 'newTimestampedUID128', 39, 128, 46, 48 ), - array( 'newTimestampedUID88', 27, 88, 46, 32 ), - ); - } - - /** - * @covers UIDGenerator::newUUIDv4 - */ - public function testUUIDv4() { - for ( $i = 0; $i < 100; $i++ ) { - $id = UIDGenerator::newUUIDv4(); - $this->assertEquals( true, - preg_match( '!^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$!', $id ), - "UID $id has the right format" ); - } - } - - /** - * @covers UIDGenerator::newRawUUIDv4 - */ - public function testRawUUIDv4() { - for ( $i = 0; $i < 100; $i++ ) { - $id = UIDGenerator::newRawUUIDv4(); - $this->assertEquals( true, - preg_match( '!^[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15}$!', $id ), - "UID $id has the right format" ); - } - } - - /** - * @covers UIDGenerator::newRawUUIDv4 - */ - public function testRawUUIDv4QuickRand() { - for ( $i = 0; $i < 100; $i++ ) { - $id = UIDGenerator::newRawUUIDv4( UIDGenerator::QUICK_RAND ); - $this->assertEquals( true, - preg_match( '!^[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15}$!', $id ), - "UID $id has the right format" ); - } - } - -} diff --git a/tests/phpunit/includes/UserMailerTest.php b/tests/phpunit/includes/UserMailerTest.php deleted file mode 100644 index 278edfaa..00000000 --- a/tests/phpunit/includes/UserMailerTest.php +++ /dev/null @@ -1,14 +0,0 @@ -assertEquals( - "=?UTF-8?Q?=C4=88u=20legebla=3F?=", - UserMailer::quotedPrintable( "\xc4\x88u legebla?", "UTF-8" ) ); - } - -} \ No newline at end of file diff --git a/tests/phpunit/includes/UserTest.php b/tests/phpunit/includes/UserTest.php deleted file mode 100644 index ff33e825..00000000 --- a/tests/phpunit/includes/UserTest.php +++ /dev/null @@ -1,237 +0,0 @@ -setMwGlobals( array( - 'wgGroupPermissions' => array(), - 'wgRevokePermissions' => array(), - ) ); - - $this->setUpPermissionGlobals(); - - $this->user = new User; - $this->user->addGroup( 'unittesters' ); - } - - private function setUpPermissionGlobals() { - global $wgGroupPermissions, $wgRevokePermissions; - - # Data for regular $wgGroupPermissions test - $wgGroupPermissions['unittesters'] = array( - 'test' => true, - 'runtest' => true, - 'writetest' => false, - 'nukeworld' => false, - ); - $wgGroupPermissions['testwriters'] = array( - 'test' => true, - 'writetest' => true, - 'modifytest' => true, - ); - - # Data for regular $wgRevokePermissions test - $wgRevokePermissions['formertesters'] = array( - 'runtest' => true, - ); - - # For the options test - $wgGroupPermissions['*'] = array( - 'editmyoptions' => true, - ); - } - - /** - * @covers User::getGroupPermissions - */ - public function testGroupPermissions() { - $rights = User::getGroupPermissions( array( 'unittesters' ) ); - $this->assertContains( 'runtest', $rights ); - $this->assertNotContains( 'writetest', $rights ); - $this->assertNotContains( 'modifytest', $rights ); - $this->assertNotContains( 'nukeworld', $rights ); - - $rights = User::getGroupPermissions( array( 'unittesters', 'testwriters' ) ); - $this->assertContains( 'runtest', $rights ); - $this->assertContains( 'writetest', $rights ); - $this->assertContains( 'modifytest', $rights ); - $this->assertNotContains( 'nukeworld', $rights ); - } - - /** - * @covers User::getGroupPermissions - */ - public function testRevokePermissions() { - $rights = User::getGroupPermissions( array( 'unittesters', 'formertesters' ) ); - $this->assertNotContains( 'runtest', $rights ); - $this->assertNotContains( 'writetest', $rights ); - $this->assertNotContains( 'modifytest', $rights ); - $this->assertNotContains( 'nukeworld', $rights ); - } - - /** - * @covers User::getRights - */ - public function testUserPermissions() { - $rights = $this->user->getRights(); - $this->assertContains( 'runtest', $rights ); - $this->assertNotContains( 'writetest', $rights ); - $this->assertNotContains( 'modifytest', $rights ); - $this->assertNotContains( 'nukeworld', $rights ); - } - - /** - * @dataProvider provideGetGroupsWithPermission - * @covers User::getGroupsWithPermission - */ - public function testGetGroupsWithPermission( $expected, $right ) { - $result = User::getGroupsWithPermission( $right ); - sort( $result ); - sort( $expected ); - - $this->assertEquals( $expected, $result, "Groups with permission $right" ); - } - - public static function provideGetGroupsWithPermission() { - return array( - array( - array( 'unittesters', 'testwriters' ), - 'test' - ), - array( - array( 'unittesters' ), - 'runtest' - ), - array( - array( 'testwriters' ), - 'writetest' - ), - array( - array( 'testwriters' ), - 'modifytest' - ), - ); - } - - /** - * @dataProvider provideUserNames - * @covers User::isValidUserName - */ - public function testIsValidUserName( $username, $result, $message ) { - $this->assertEquals( $this->user->isValidUserName( $username ), $result, $message ); - } - - public static function provideUserNames() { - return array( - array( '', false, 'Empty string' ), - array( ' ', false, 'Blank space' ), - array( 'abcd', false, 'Starts with small letter' ), - array( 'Ab/cd', false, 'Contains slash' ), - array( 'Ab cd', true, 'Whitespace' ), - array( '192.168.1.1', false, 'IP' ), - array( 'User:Abcd', false, 'Reserved Namespace' ), - array( '12abcd232', true, 'Starts with Numbers' ), - array( '?abcd', true, 'Start with ? mark' ), - array( '#abcd', false, 'Start with #' ), - array( 'Abcdകഖഗഘ', true, ' Mixed scripts' ), - array( 'ജോസ്‌തോമസ്', false, 'ZWNJ- Format control character' ), - array( 'Ab cd', false, ' Ideographic space' ), - ); - } - - /** - * Test, if for all rights a right- message exist, - * which is used on Special:ListGroupRights as help text - * Extensions and core - */ - public function testAllRightsWithMessage() { - //Getting all user rights, for core: User::$mCoreRights, for extensions: $wgAvailableRights - $allRights = User::getAllRights(); - $allMessageKeys = Language::getMessageKeysFor( 'en' ); - - $rightsWithMessage = array(); - foreach ( $allMessageKeys as $message ) { - // === 0: must be at beginning of string (position 0) - if ( strpos( $message, 'right-' ) === 0 ) { - $rightsWithMessage[] = substr( $message, strlen( 'right-' ) ); - } - } - - sort( $allRights ); - sort( $rightsWithMessage ); - - $this->assertEquals( - $allRights, - $rightsWithMessage, - 'Each user rights (core/extensions) has a corresponding right- message.' - ); - } - - /** - * Test User::editCount - * @group medium - * @covers User::getEditCount - */ - public function testEditCount() { - $user = User::newFromName( 'UnitTestUser' ); - $user->loadDefaults(); - $user->addToDatabase(); - - // let the user have a few (3) edits - $page = WikiPage::factory( Title::newFromText( 'Help:UserTest_EditCount' ) ); - for ( $i = 0; $i < 3; $i++ ) { - $page->doEdit( (string)$i, 'test', 0, false, $user ); - } - - $user->clearInstanceCache(); - $this->assertEquals( 3, $user->getEditCount(), 'After three edits, the user edit count should be 3' ); - - // increase the edit count and clear the cache - $user->incEditCount(); - - $user->clearInstanceCache(); - $this->assertEquals( 4, $user->getEditCount(), 'After increasing the edit count manually, the user edit count should be 4' ); - } - - /** - * Test changing user options. - * @covers User::setOption - * @covers User::getOption - */ - public function testOptions() { - $user = User::newFromName( 'UnitTestUser' ); - $user->addToDatabase(); - - $user->setOption( 'someoption', 'test' ); - $user->setOption( 'cols', 200 ); - $user->saveSettings(); - - $user = User::newFromName( 'UnitTestUser' ); - $this->assertEquals( 'test', $user->getOption( 'someoption' ) ); - $this->assertEquals( 200, $user->getOption( 'cols' ) ); - } - - /** - * Bug 37963 - * Make sure defaults are loaded when setOption is called. - * @covers User::loadOptions - */ - public function testAnonOptions() { - global $wgDefaultUserOptions; - $this->user->setOption( 'someoption', 'test' ); - $this->assertEquals( $wgDefaultUserOptions['cols'], $this->user->getOption( 'cols' ) ); - $this->assertEquals( 'test', $this->user->getOption( 'someoption' ) ); - } -} diff --git a/tests/phpunit/includes/WebRequestTest.php b/tests/phpunit/includes/WebRequestTest.php deleted file mode 100644 index f8ed14b6..00000000 --- a/tests/phpunit/includes/WebRequestTest.php +++ /dev/null @@ -1,310 +0,0 @@ -oldServer = $_SERVER; - } - - protected function tearDown() { - $_SERVER = $this->oldServer; - - parent::tearDown(); - } - - /** - * @dataProvider provideDetectServer - * @covers WebRequest::detectServer - */ - public function testDetectServer( $expected, $input, $description ) { - $_SERVER = $input; - $result = WebRequest::detectServer(); - $this->assertEquals( $expected, $result, $description ); - } - - public static function provideDetectServer() { - return array( - array( - 'http://x', - array( - 'HTTP_HOST' => 'x' - ), - 'Host header' - ), - array( - 'https://x', - array( - 'HTTP_HOST' => 'x', - 'HTTPS' => 'on', - ), - 'Host header with secure' - ), - array( - 'http://x', - array( - 'HTTP_HOST' => 'x', - 'SERVER_PORT' => 80, - ), - 'Default SERVER_PORT', - ), - array( - 'http://x', - array( - 'HTTP_HOST' => 'x', - 'HTTPS' => 'off', - ), - 'Secure off' - ), - array( - 'http://y', - array( - 'SERVER_NAME' => 'y', - ), - 'Server name' - ), - array( - 'http://x', - array( - 'HTTP_HOST' => 'x', - 'SERVER_NAME' => 'y', - ), - 'Host server name precedence' - ), - array( - 'http://[::1]:81', - array( - 'HTTP_HOST' => '[::1]', - 'SERVER_NAME' => '::1', - 'SERVER_PORT' => '81', - ), - 'Apache bug 26005' - ), - array( - 'http://localhost', - array( - 'SERVER_NAME' => '[2001' - ), - 'Kind of like lighttpd per commit message in MW r83847', - ), - array( - 'http://[2a01:e35:2eb4:1::2]:777', - array( - 'SERVER_NAME' => '[2a01:e35:2eb4:1::2]:777' - ), - 'Possible lighttpd environment per bug 14977 comment 13', - ), - ); - } - - /** - * @dataProvider provideGetIP - * @covers WebRequest::getIP - */ - public function testGetIP( $expected, $input, $squid, $xffList, $private, $description ) { - $_SERVER = $input; - $this->setMwGlobals( array( - 'wgSquidServersNoPurge' => $squid, - 'wgUsePrivateIPs' => $private, - 'wgHooks' => array( - 'IsTrustedProxy' => array( - function( &$ip, &$trusted ) use ( $xffList ) { - $trusted = $trusted || in_array( $ip, $xffList ); - return true; - } - ) - ) - ) ); - - $request = new WebRequest(); - $result = $request->getIP(); - $this->assertEquals( $expected, $result, $description ); - } - - public static function provideGetIP() { - return array( - array( - '127.0.0.1', - array( - 'REMOTE_ADDR' => '127.0.0.1' - ), - array(), - array(), - false, - 'Simple IPv4' - ), - array( - '::1', - array( - 'REMOTE_ADDR' => '::1' - ), - array(), - array(), - false, - 'Simple IPv6' - ), - array( - '12.0.0.1', - array( - 'REMOTE_ADDR' => 'abcd:0001:002:03:4:555:6666:7777', - 'HTTP_X_FORWARDED_FOR' => '12.0.0.1, abcd:0001:002:03:4:555:6666:7777', - ), - array( 'ABCD:1:2:3:4:555:6666:7777' ), - array(), - false, - 'IPv6 normalisation' - ), - array( - '12.0.0.3', - array( - 'REMOTE_ADDR' => '12.0.0.1', - 'HTTP_X_FORWARDED_FOR' => '12.0.0.3, 12.0.0.2' - ), - array( '12.0.0.1', '12.0.0.2' ), - array(), - false, - 'With X-Forwaded-For' - ), - array( - '12.0.0.1', - array( - 'REMOTE_ADDR' => '12.0.0.1', - 'HTTP_X_FORWARDED_FOR' => '12.0.0.3, 12.0.0.2' - ), - array(), - array(), - false, - 'With X-Forwaded-For and disallowed server' - ), - array( - '12.0.0.2', - array( - 'REMOTE_ADDR' => '12.0.0.1', - 'HTTP_X_FORWARDED_FOR' => '12.0.0.3, 12.0.0.2' - ), - array( '12.0.0.1' ), - array(), - false, - 'With multiple X-Forwaded-For and only one allowed server' - ), - array( - '10.0.0.3', - array( - 'REMOTE_ADDR' => '12.0.0.2', - 'HTTP_X_FORWARDED_FOR' => '10.0.0.4, 10.0.0.3, 12.0.0.2' - ), - array( '12.0.0.1', '12.0.0.2' ), - array(), - false, - 'With X-Forwaded-For and private IP (from cache proxy)' - ), - array( - '10.0.0.4', - array( - 'REMOTE_ADDR' => '12.0.0.2', - 'HTTP_X_FORWARDED_FOR' => '10.0.0.4, 10.0.0.3, 12.0.0.2' - ), - array( '12.0.0.1', '12.0.0.2', '10.0.0.3' ), - array(), - true, - 'With X-Forwaded-For and private IP (allowed)' - ), - array( - '10.0.0.4', - array( - 'REMOTE_ADDR' => '12.0.0.2', - 'HTTP_X_FORWARDED_FOR' => '10.0.0.4, 10.0.0.3, 12.0.0.2' - ), - array( '12.0.0.1', '12.0.0.2' ), - array( '10.0.0.3' ), - true, - 'With X-Forwaded-For and private IP (allowed)' - ), - array( - '10.0.0.3', - array( - 'REMOTE_ADDR' => '12.0.0.2', - 'HTTP_X_FORWARDED_FOR' => '10.0.0.4, 10.0.0.3, 12.0.0.2' - ), - array( '12.0.0.1', '12.0.0.2' ), - array( '10.0.0.3' ), - false, - 'With X-Forwaded-For and private IP (disallowed)' - ), - array( - '12.0.0.3', - array( - 'REMOTE_ADDR' => '12.0.0.1', - 'HTTP_X_FORWARDED_FOR' => '12.0.0.3, 12.0.0.2' - ), - array(), - array( '12.0.0.1', '12.0.0.2' ), - false, - 'With X-Forwaded-For' - ), - array( - '12.0.0.2', - array( - 'REMOTE_ADDR' => '12.0.0.1', - 'HTTP_X_FORWARDED_FOR' => '12.0.0.3, 12.0.0.2' - ), - array(), - array( '12.0.0.1' ), - false, - 'With multiple X-Forwaded-For and only one allowed server' - ), - array( - '12.0.0.2', - array( - 'REMOTE_ADDR' => '12.0.0.2', - 'HTTP_X_FORWARDED_FOR' => '10.0.0.3, 12.0.0.2' - ), - array(), - array( '12.0.0.2' ), - false, - 'With X-Forwaded-For and private IP and hook (disallowed)' - ), - ); - } - - /** - * @expectedException MWException - * @covers WebRequest::getIP - */ - public function testGetIpLackOfRemoteAddrThrowAnException() { - $request = new WebRequest(); - # Next call throw an exception about lacking an IP - $request->getIP(); - } - - public static function provideLanguageData() { - return array( - array( '', array(), 'Empty Accept-Language header' ), - array( 'en', array( 'en' => 1 ), 'One language' ), - array( 'en, ar', array( 'en' => 1, 'ar' => 1 ), 'Two languages listed in appearance order.' ), - array( 'zh-cn,zh-tw', array( 'zh-cn' => 1, 'zh-tw' => 1 ), 'Two equally prefered languages, listed in appearance order per rfc3282. Checks c9119' ), - array( 'es, en; q=0.5', array( 'es' => 1, 'en' => '0.5' ), 'Spanish as first language and English and second' ), - array( 'en; q=0.5, es', array( 'es' => 1, 'en' => '0.5' ), 'Less prefered language first' ), - array( 'fr, en; q=0.5, es', array( 'fr' => 1, 'es' => 1, 'en' => '0.5' ), 'Three languages' ), - array( 'en; q=0.5, es', array( 'es' => 1, 'en' => '0.5' ), 'Two languages' ), - array( 'en, zh;q=0', array( 'en' => 1 ), "It's Chinese to me" ), - array( 'es; q=1, pt;q=0.7, it; q=0.6, de; q=0.1, ru;q=0', array( 'es' => '1', 'pt' => '0.7', 'it' => '0.6', 'de' => '0.1' ), 'Preference for romance languages' ), - array( 'en-gb, en-us; q=1', array( 'en-gb' => 1, 'en-us' => '1' ), 'Two equally prefered English variants' ), - ); - } - - /** - * @dataProvider provideLanguageData - * @covers WebRequest::getAcceptLang - */ - public function testAcceptLang( $acceptLanguageHeader, $expectedLanguages, $description ) { - $_SERVER = array( 'HTTP_ACCEPT_LANGUAGE' => $acceptLanguageHeader ); - $request = new WebRequest(); - $this->assertSame( $request->getAcceptLang(), $expectedLanguages, $description ); - } -} diff --git a/tests/phpunit/includes/WikiPageTest.php b/tests/phpunit/includes/WikiPageTest.php deleted file mode 100644 index e0d786b9..00000000 --- a/tests/phpunit/includes/WikiPageTest.php +++ /dev/null @@ -1,1074 +0,0 @@ -tablesUsed = array_merge( - $this->tablesUsed, - array( 'page', - 'revision', - 'text', - - 'recentchanges', - 'logging', - - 'page_props', - 'pagelinks', - 'categorylinks', - 'langlinks', - 'externallinks', - 'imagelinks', - 'templatelinks', - 'iwlinks' ) ); - } - - protected function setUp() { - parent::setUp(); - $this->pages_to_delete = array(); - - LinkCache::singleton()->clear(); # avoid cached redirect status, etc - } - - protected function tearDown() { - foreach ( $this->pages_to_delete as $p ) { - /* @var $p WikiPage */ - - try { - if ( $p->exists() ) { - $p->doDeleteArticle( "testing done." ); - } - } catch ( MWException $ex ) { - // fail silently - } - } - parent::tearDown(); - } - - /** - * @param Title $title - * @param String $model - * @return WikiPage - */ - protected function newPage( $title, $model = null ) { - if ( is_string( $title ) ) { - $ns = $this->getDefaultWikitextNS(); - $title = Title::newFromText( $title, $ns ); - } - - $p = new WikiPage( $title ); - - $this->pages_to_delete[] = $p; - - return $p; - } - - /** - * @param String|Title|WikiPage $page - * @param String $text - * @param int $model - * - * @return WikiPage - */ - protected function createPage( $page, $text, $model = null ) { - if ( is_string( $page ) || $page instanceof Title ) { - $page = $this->newPage( $page, $model ); - } - - $content = ContentHandler::makeContent( $text, $page->getTitle(), $model ); - $page->doEditContent( $content, "testing", EDIT_NEW ); - - return $page; - } - - /** - * @covers WikiPage::doEditContent - */ - public function testDoEditContent() { - $page = $this->newPage( "WikiPageTest_testDoEditContent" ); - $title = $page->getTitle(); - - $content = ContentHandler::makeContent( "[[Lorem ipsum]] dolor sit amet, consetetur sadipscing elitr, sed diam " - . " nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.", - $title, CONTENT_MODEL_WIKITEXT ); - - $page->doEditContent( $content, "[[testing]] 1" ); - - $this->assertTrue( $title->getArticleID() > 0, "Title object should have new page id" ); - $this->assertTrue( $page->getId() > 0, "WikiPage should have new page id" ); - $this->assertTrue( $title->exists(), "Title object should indicate that the page now exists" ); - $this->assertTrue( $page->exists(), "WikiPage object should indicate that the page now exists" ); - - $id = $page->getId(); - - # ------------------------ - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) ); - $n = $res->numRows(); - $res->free(); - - $this->assertEquals( 1, $n, 'pagelinks should contain one link from the page' ); - - # ------------------------ - $page = new WikiPage( $title ); - - $retrieved = $page->getContent(); - $this->assertTrue( $content->equals( $retrieved ), 'retrieved content doesn\'t equal original' ); - - # ------------------------ - $content = ContentHandler::makeContent( "At vero eos et accusam et justo duo [[dolores]] et ea rebum. " - . "Stet clita kasd [[gubergren]], no sea takimata sanctus est.", - $title, CONTENT_MODEL_WIKITEXT ); - - $page->doEditContent( $content, "testing 2" ); - - # ------------------------ - $page = new WikiPage( $title ); - - $retrieved = $page->getContent(); - $this->assertTrue( $content->equals( $retrieved ), 'retrieved content doesn\'t equal original' ); - - # ------------------------ - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) ); - $n = $res->numRows(); - $res->free(); - - $this->assertEquals( 2, $n, 'pagelinks should contain two links from the page' ); - } - - /** - * @covers WikiPage::doEdit - */ - public function testDoEdit() { - $this->hideDeprecated( "WikiPage::doEdit" ); - $this->hideDeprecated( "WikiPage::getText" ); - $this->hideDeprecated( "Revision::getText" ); - - //NOTE: assume help namespace will default to wikitext - $title = Title::newFromText( "Help:WikiPageTest_testDoEdit" ); - - $page = $this->newPage( $title ); - - $text = "[[Lorem ipsum]] dolor sit amet, consetetur sadipscing elitr, sed diam " - . " nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat."; - - $page->doEdit( $text, "[[testing]] 1" ); - - $this->assertTrue( $title->getArticleID() > 0, "Title object should have new page id" ); - $this->assertTrue( $page->getId() > 0, "WikiPage should have new page id" ); - $this->assertTrue( $title->exists(), "Title object should indicate that the page now exists" ); - $this->assertTrue( $page->exists(), "WikiPage object should indicate that the page now exists" ); - - $id = $page->getId(); - - # ------------------------ - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) ); - $n = $res->numRows(); - $res->free(); - - $this->assertEquals( 1, $n, 'pagelinks should contain one link from the page' ); - - # ------------------------ - $page = new WikiPage( $title ); - - $retrieved = $page->getText(); - $this->assertEquals( $text, $retrieved, 'retrieved text doesn\'t equal original' ); - - # ------------------------ - $text = "At vero eos et accusam et justo duo [[dolores]] et ea rebum. " - . "Stet clita kasd [[gubergren]], no sea takimata sanctus est."; - - $page->doEdit( $text, "testing 2" ); - - # ------------------------ - $page = new WikiPage( $title ); - - $retrieved = $page->getText(); - $this->assertEquals( $text, $retrieved, 'retrieved text doesn\'t equal original' ); - - # ------------------------ - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) ); - $n = $res->numRows(); - $res->free(); - - $this->assertEquals( 2, $n, 'pagelinks should contain two links from the page' ); - } - - /** - * @covers WikiPage::doQuickEdit - */ - public function testDoQuickEdit() { - global $wgUser; - - $this->hideDeprecated( "WikiPage::doQuickEdit" ); - - //NOTE: assume help namespace will default to wikitext - $page = $this->createPage( "Help:WikiPageTest_testDoQuickEdit", "original text" ); - - $text = "quick text"; - $page->doQuickEdit( $text, $wgUser, "testing q" ); - - # --------------------- - $page = new WikiPage( $page->getTitle() ); - $this->assertEquals( $text, $page->getText() ); - } - - /** - * @covers WikiPage::doQuickEditContent - */ - public function testDoQuickEditContent() { - global $wgUser; - - $page = $this->createPage( "WikiPageTest_testDoQuickEditContent", "original text", CONTENT_MODEL_WIKITEXT ); - - $content = ContentHandler::makeContent( "quick text", $page->getTitle(), CONTENT_MODEL_WIKITEXT ); - $page->doQuickEditContent( $content, $wgUser, "testing q" ); - - # --------------------- - $page = new WikiPage( $page->getTitle() ); - $this->assertTrue( $content->equals( $page->getContent() ) ); - } - - /** - * @covers WikiPage::doDeleteArticle - */ - public function testDoDeleteArticle() { - $page = $this->createPage( "WikiPageTest_testDoDeleteArticle", "[[original text]] foo", CONTENT_MODEL_WIKITEXT ); - $id = $page->getId(); - - $page->doDeleteArticle( "testing deletion" ); - - $this->assertFalse( $page->getTitle()->getArticleID() > 0, "Title object should now have page id 0" ); - $this->assertFalse( $page->getId() > 0, "WikiPage should now have page id 0" ); - $this->assertFalse( $page->exists(), "WikiPage::exists should return false after page was deleted" ); - $this->assertNull( $page->getContent(), "WikiPage::getContent should return null after page was deleted" ); - $this->assertFalse( $page->getText(), "WikiPage::getText should return false after page was deleted" ); - - $t = Title::newFromText( $page->getTitle()->getPrefixedText() ); - $this->assertFalse( $t->exists(), "Title::exists should return false after page was deleted" ); - - # ------------------------ - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) ); - $n = $res->numRows(); - $res->free(); - - $this->assertEquals( 0, $n, 'pagelinks should contain no more links from the page' ); - } - - /** - * @covers WikiPage::doDeleteUpdates - */ - public function testDoDeleteUpdates() { - $page = $this->createPage( "WikiPageTest_testDoDeleteArticle", "[[original text]] foo", CONTENT_MODEL_WIKITEXT ); - $id = $page->getId(); - - $page->doDeleteUpdates( $id ); - - # ------------------------ - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'pagelinks', '*', array( 'pl_from' => $id ) ); - $n = $res->numRows(); - $res->free(); - - $this->assertEquals( 0, $n, 'pagelinks should contain no more links from the page' ); - } - - /** - * @covers WikiPage::getRevision - */ - public function testGetRevision() { - $page = $this->newPage( "WikiPageTest_testGetRevision" ); - - $rev = $page->getRevision(); - $this->assertNull( $rev ); - - # ----------------- - $this->createPage( $page, "some text", CONTENT_MODEL_WIKITEXT ); - - $rev = $page->getRevision(); - - $this->assertEquals( $page->getLatest(), $rev->getId() ); - $this->assertEquals( "some text", $rev->getContent()->getNativeData() ); - } - - /** - * @covers WikiPage::getContent - */ - public function testGetContent() { - $page = $this->newPage( "WikiPageTest_testGetContent" ); - - $content = $page->getContent(); - $this->assertNull( $content ); - - # ----------------- - $this->createPage( $page, "some text", CONTENT_MODEL_WIKITEXT ); - - $content = $page->getContent(); - $this->assertEquals( "some text", $content->getNativeData() ); - } - - /** - * @covers WikiPage::getText - */ - public function testGetText() { - $this->hideDeprecated( "WikiPage::getText" ); - - $page = $this->newPage( "WikiPageTest_testGetText" ); - - $text = $page->getText(); - $this->assertFalse( $text ); - - # ----------------- - $this->createPage( $page, "some text", CONTENT_MODEL_WIKITEXT ); - - $text = $page->getText(); - $this->assertEquals( "some text", $text ); - } - - /** - * @covers WikiPage::getRawText - */ - public function testGetRawText() { - $this->hideDeprecated( "WikiPage::getRawText" ); - - $page = $this->newPage( "WikiPageTest_testGetRawText" ); - - $text = $page->getRawText(); - $this->assertFalse( $text ); - - # ----------------- - $this->createPage( $page, "some text", CONTENT_MODEL_WIKITEXT ); - - $text = $page->getRawText(); - $this->assertEquals( "some text", $text ); - } - - /** - * @covers WikiPage::getContentModel - */ - public function testGetContentModel() { - global $wgContentHandlerUseDB; - - if ( !$wgContentHandlerUseDB ) { - $this->markTestSkipped( '$wgContentHandlerUseDB is disabled' ); - } - - $page = $this->createPage( "WikiPageTest_testGetContentModel", "some text", CONTENT_MODEL_JAVASCRIPT ); - - $page = new WikiPage( $page->getTitle() ); - $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $page->getContentModel() ); - } - - /** - * @covers WikiPage::getContentHandler - */ - public function testGetContentHandler() { - global $wgContentHandlerUseDB; - - if ( !$wgContentHandlerUseDB ) { - $this->markTestSkipped( '$wgContentHandlerUseDB is disabled' ); - } - - $page = $this->createPage( "WikiPageTest_testGetContentHandler", "some text", CONTENT_MODEL_JAVASCRIPT ); - - $page = new WikiPage( $page->getTitle() ); - $this->assertEquals( 'JavaScriptContentHandler', get_class( $page->getContentHandler() ) ); - } - - /** - * @covers WikiPage::exists - */ - public function testExists() { - $page = $this->newPage( "WikiPageTest_testExists" ); - $this->assertFalse( $page->exists() ); - - # ----------------- - $this->createPage( $page, "some text", CONTENT_MODEL_WIKITEXT ); - $this->assertTrue( $page->exists() ); - - $page = new WikiPage( $page->getTitle() ); - $this->assertTrue( $page->exists() ); - - # ----------------- - $page->doDeleteArticle( "done testing" ); - $this->assertFalse( $page->exists() ); - - $page = new WikiPage( $page->getTitle() ); - $this->assertFalse( $page->exists() ); - } - - public static function provideHasViewableContent() { - return array( - array( 'WikiPageTest_testHasViewableContent', false, true ), - array( 'Special:WikiPageTest_testHasViewableContent', false ), - array( 'MediaWiki:WikiPageTest_testHasViewableContent', false ), - array( 'Special:Userlogin', true ), - array( 'MediaWiki:help', true ), - ); - } - - /** - * @dataProvider provideHasViewableContent - * @covers WikiPage::hasViewableContent - */ - public function testHasViewableContent( $title, $viewable, $create = false ) { - $page = $this->newPage( $title ); - $this->assertEquals( $viewable, $page->hasViewableContent() ); - - if ( $create ) { - $this->createPage( $page, "some text", CONTENT_MODEL_WIKITEXT ); - $this->assertTrue( $page->hasViewableContent() ); - - $page = new WikiPage( $page->getTitle() ); - $this->assertTrue( $page->hasViewableContent() ); - } - } - - public static function provideGetRedirectTarget() { - return array( - array( 'WikiPageTest_testGetRedirectTarget_1', CONTENT_MODEL_WIKITEXT, "hello world", null ), - array( 'WikiPageTest_testGetRedirectTarget_2', CONTENT_MODEL_WIKITEXT, "#REDIRECT [[hello world]]", "Hello world" ), - ); - } - - /** - * @dataProvider provideGetRedirectTarget - * @covers WikiPage::getRedirectTarget - */ - public function testGetRedirectTarget( $title, $model, $text, $target ) { - $page = $this->createPage( $title, $text, $model ); - - # sanity check, because this test seems to fail for no reason for some people. - $c = $page->getContent(); - $this->assertEquals( 'WikitextContent', get_class( $c ) ); - - # now, test the actual redirect - $t = $page->getRedirectTarget(); - $this->assertEquals( $target, is_null( $t ) ? null : $t->getPrefixedText() ); - } - - /** - * @dataProvider provideGetRedirectTarget - * @covers WikiPage::isRedirect - */ - public function testIsRedirect( $title, $model, $text, $target ) { - $page = $this->createPage( $title, $text, $model ); - $this->assertEquals( !is_null( $target ), $page->isRedirect() ); - } - - public static function provideIsCountable() { - return array( - - // any - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - '', - 'any', - true - ), - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - 'Foo', - 'any', - true - ), - - // comma - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - 'Foo', - 'comma', - false - ), - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - 'Foo, bar', - 'comma', - true - ), - - // link - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - 'Foo', - 'link', - false - ), - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - 'Foo [[bar]]', - 'link', - true - ), - - // redirects - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - '#REDIRECT [[bar]]', - 'any', - false - ), - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - '#REDIRECT [[bar]]', - 'comma', - false - ), - array( 'WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - '#REDIRECT [[bar]]', - 'link', - false - ), - - // not a content namespace - array( 'Talk:WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - 'Foo', - 'any', - false - ), - array( 'Talk:WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - 'Foo, bar', - 'comma', - false - ), - array( 'Talk:WikiPageTest_testIsCountable', - CONTENT_MODEL_WIKITEXT, - 'Foo [[bar]]', - 'link', - false - ), - - // not a content namespace, different model - array( 'MediaWiki:WikiPageTest_testIsCountable.js', - null, - 'Foo', - 'any', - false - ), - array( 'MediaWiki:WikiPageTest_testIsCountable.js', - null, - 'Foo, bar', - 'comma', - false - ), - array( 'MediaWiki:WikiPageTest_testIsCountable.js', - null, - 'Foo [[bar]]', - 'link', - false - ), - ); - } - - - /** - * @dataProvider provideIsCountable - * @covers WikiPage::isCountable - */ - public function testIsCountable( $title, $model, $text, $mode, $expected ) { - global $wgContentHandlerUseDB; - - $this->setMwGlobals( 'wgArticleCountMethod', $mode ); - - $title = Title::newFromText( $title ); - - if ( !$wgContentHandlerUseDB && $model && ContentHandler::getDefaultModelFor( $title ) != $model ) { - $this->markTestSkipped( "Can not use non-default content model $model for " - . $title->getPrefixedDBkey() . " with \$wgContentHandlerUseDB disabled." ); - } - - $page = $this->createPage( $title, $text, $model ); - $hasLinks = wfGetDB( DB_SLAVE )->selectField( 'pagelinks', 1, - array( 'pl_from' => $page->getId() ), __METHOD__ ); - - $editInfo = $page->prepareContentForEdit( $page->getContent() ); - - $v = $page->isCountable(); - $w = $page->isCountable( $editInfo ); - - $this->assertEquals( $expected, $v, "isCountable( null ) returned unexpected value " . var_export( $v, true ) - . " instead of " . var_export( $expected, true ) . " in mode `$mode` for text \"$text\"" ); - - $this->assertEquals( $expected, $w, "isCountable( \$editInfo ) returned unexpected value " . var_export( $v, true ) - . " instead of " . var_export( $expected, true ) . " in mode `$mode` for text \"$text\"" ); - } - - public static function provideGetParserOutput() { - return array( - array( CONTENT_MODEL_WIKITEXT, "hello ''world''\n", "

            hello world

            " ), - // @todo more...? - ); - } - - /** - * @dataProvider provideGetParserOutput - * @covers WikiPage::getParserOutput - */ - public function testGetParserOutput( $model, $text, $expectedHtml ) { - $page = $this->createPage( 'WikiPageTest_testGetParserOutput', $text, $model ); - - $opt = $page->makeParserOptions( 'canonical' ); - $po = $page->getParserOutput( $opt ); - $text = $po->getText(); - - $text = trim( preg_replace( '//sm', '', $text ) ); # strip injected comments - $text = preg_replace( '!\s*(

            )!sm', '\1', $text ); # don't let tidy confuse us - - $this->assertEquals( $expectedHtml, $text ); - - return $po; - } - - /** - * @covers WikiPage::getParserOutput - */ - public function testGetParserOutput_nonexisting() { - static $count = 0; - $count++; - - $page = new WikiPage( new Title( "WikiPageTest_testGetParserOutput_nonexisting_$count" ) ); - - $opt = new ParserOptions(); - $po = $page->getParserOutput( $opt ); - - $this->assertFalse( $po, "getParserOutput() shall return false for non-existing pages." ); - } - - /** - * @covers WikiPage::getParserOutput - */ - public function testGetParserOutput_badrev() { - $page = $this->createPage( 'WikiPageTest_testGetParserOutput', "dummy", CONTENT_MODEL_WIKITEXT ); - - $opt = new ParserOptions(); - $po = $page->getParserOutput( $opt, $page->getLatest() + 1234 ); - - // @todo would be neat to also test deleted revision - - $this->assertFalse( $po, "getParserOutput() shall return false for non-existing revisions." ); - } - - static $sections = - - "Intro - -== stuff == -hello world - -== test == -just a test - -== foo == -more stuff -"; - - - public function dataReplaceSection() { - //NOTE: assume the Help namespace to contain wikitext - return array( - array( 'Help:WikiPageTest_testReplaceSection', - CONTENT_MODEL_WIKITEXT, - WikiPageTest::$sections, - "0", - "No more", - null, - trim( preg_replace( '/^Intro/sm', 'No more', WikiPageTest::$sections ) ) - ), - array( 'Help:WikiPageTest_testReplaceSection', - CONTENT_MODEL_WIKITEXT, - WikiPageTest::$sections, - "", - "No more", - null, - "No more" - ), - array( 'Help:WikiPageTest_testReplaceSection', - CONTENT_MODEL_WIKITEXT, - WikiPageTest::$sections, - "2", - "== TEST ==\nmore fun", - null, - trim( preg_replace( '/^== test ==.*== foo ==/sm', - "== TEST ==\nmore fun\n\n== foo ==", - WikiPageTest::$sections ) ) - ), - array( 'Help:WikiPageTest_testReplaceSection', - CONTENT_MODEL_WIKITEXT, - WikiPageTest::$sections, - "8", - "No more", - null, - trim( WikiPageTest::$sections ) - ), - array( 'Help:WikiPageTest_testReplaceSection', - CONTENT_MODEL_WIKITEXT, - WikiPageTest::$sections, - "new", - "No more", - "New", - trim( WikiPageTest::$sections ) . "\n\n== New ==\n\nNo more" - ), - ); - } - - /** - * @dataProvider dataReplaceSection - * @covers WikiPage::replaceSection - */ - public function testReplaceSection( $title, $model, $text, $section, $with, $sectionTitle, $expected ) { - $this->hideDeprecated( "WikiPage::replaceSection" ); - - $page = $this->createPage( $title, $text, $model ); - $text = $page->replaceSection( $section, $with, $sectionTitle ); - $text = trim( $text ); - - $this->assertEquals( $expected, $text ); - } - - /** - * @dataProvider dataReplaceSection - * @covers WikiPage::replaceSectionContent - */ - public function testReplaceSectionContent( $title, $model, $text, $section, $with, $sectionTitle, $expected ) { - $page = $this->createPage( $title, $text, $model ); - - $content = ContentHandler::makeContent( $with, $page->getTitle(), $page->getContentModel() ); - $c = $page->replaceSectionContent( $section, $content, $sectionTitle ); - - $this->assertEquals( $expected, is_null( $c ) ? null : trim( $c->getNativeData() ) ); - } - - /* @todo FIXME: fix this! - public function testGetUndoText() { - $this->checkHasDiff3(); - - $text = "one"; - $page = $this->createPage( "WikiPageTest_testGetUndoText", $text ); - $rev1 = $page->getRevision(); - - $text .= "\n\ntwo"; - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), "adding section two"); - $rev2 = $page->getRevision(); - - $text .= "\n\nthree"; - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), "adding section three"); - $rev3 = $page->getRevision(); - - $text .= "\n\nfour"; - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), "adding section four"); - $rev4 = $page->getRevision(); - - $text .= "\n\nfive"; - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), "adding section five"); - $rev5 = $page->getRevision(); - - $text .= "\n\nsix"; - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), "adding section six"); - $rev6 = $page->getRevision(); - - $undo6 = $page->getUndoText( $rev6 ); - if ( $undo6 === false ) $this->fail( "getUndoText failed for rev6" ); - $this->assertEquals( "one\n\ntwo\n\nthree\n\nfour\n\nfive", $undo6 ); - - $undo3 = $page->getUndoText( $rev4, $rev2 ); - if ( $undo3 === false ) $this->fail( "getUndoText failed for rev4..rev2" ); - $this->assertEquals( "one\n\ntwo\n\nfive", $undo3 ); - - $undo2 = $page->getUndoText( $rev2 ); - if ( $undo2 === false ) $this->fail( "getUndoText failed for rev2" ); - $this->assertEquals( "one\n\nfive", $undo2 ); - } - */ - - /** - * @todo FIXME: this is a better rollback test than the one below, but it keeps failing in jenkins for some reason. - */ - public function broken_testDoRollback() { - $admin = new User(); - $admin->setName( "Admin" ); - - $text = "one"; - $page = $this->newPage( "WikiPageTest_testDoRollback" ); - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), - "section one", EDIT_NEW, false, $admin ); - - $user1 = new User(); - $user1->setName( "127.0.1.11" ); - $text .= "\n\ntwo"; - $page = new WikiPage( $page->getTitle() ); - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), - "adding section two", 0, false, $user1 ); - - $user2 = new User(); - $user2->setName( "127.0.2.13" ); - $text .= "\n\nthree"; - $page = new WikiPage( $page->getTitle() ); - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), - "adding section three", 0, false, $user2 ); - - # we are having issues with doRollback spuriously failing. apparently the last revision somehow goes missing - # or not committed under some circumstances. so, make sure the last revision has the right user name. - $dbr = wfGetDB( DB_SLAVE ); - $this->assertEquals( 3, Revision::countByPageId( $dbr, $page->getId() ) ); - - $page = new WikiPage( $page->getTitle() ); - $rev3 = $page->getRevision(); - $this->assertEquals( '127.0.2.13', $rev3->getUserText() ); - - $rev2 = $rev3->getPrevious(); - $this->assertEquals( '127.0.1.11', $rev2->getUserText() ); - - $rev1 = $rev2->getPrevious(); - $this->assertEquals( 'Admin', $rev1->getUserText() ); - - # now, try the actual rollback - $admin->addGroup( "sysop" ); #XXX: make the test user a sysop... - $token = $admin->getEditToken( array( $page->getTitle()->getPrefixedText(), $user2->getName() ), null ); - $errors = $page->doRollback( $user2->getName(), "testing revert", $token, false, $details, $admin ); - - if ( $errors ) { - $this->fail( "Rollback failed:\n" . print_r( $errors, true ) . ";\n" . print_r( $details, true ) ); - } - - $page = new WikiPage( $page->getTitle() ); - $this->assertEquals( $rev2->getSha1(), $page->getRevision()->getSha1(), - "rollback did not revert to the correct revision" ); - $this->assertEquals( "one\n\ntwo", $page->getContent()->getNativeData() ); - } - - /** - * @todo FIXME: the above rollback test is better, but it keeps failing in jenkins for some reason. - * @covers WikiPage::doRollback - */ - public function testDoRollback() { - $admin = new User(); - $admin->setName( "Admin" ); - - $text = "one"; - $page = $this->newPage( "WikiPageTest_testDoRollback" ); - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle(), CONTENT_MODEL_WIKITEXT ), - "section one", EDIT_NEW, false, $admin ); - $rev1 = $page->getRevision(); - - $user1 = new User(); - $user1->setName( "127.0.1.11" ); - $text .= "\n\ntwo"; - $page = new WikiPage( $page->getTitle() ); - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle(), CONTENT_MODEL_WIKITEXT ), - "adding section two", 0, false, $user1 ); - - # now, try the rollback - $admin->addGroup( "sysop" ); #XXX: make the test user a sysop... - $token = $admin->getEditToken( array( $page->getTitle()->getPrefixedText(), $user1->getName() ), null ); - $errors = $page->doRollback( $user1->getName(), "testing revert", $token, false, $details, $admin ); - - if ( $errors ) { - $this->fail( "Rollback failed:\n" . print_r( $errors, true ) . ";\n" . print_r( $details, true ) ); - } - - $page = new WikiPage( $page->getTitle() ); - $this->assertEquals( $rev1->getSha1(), $page->getRevision()->getSha1(), - "rollback did not revert to the correct revision" ); - $this->assertEquals( "one", $page->getContent()->getNativeData() ); - } - - public static function provideGetAutosummary() { - return array( - array( - 'Hello there, world!', - '#REDIRECT [[Foo]]', - 0, - '/^Redirected page .*Foo/' - ), - - array( - null, - 'Hello world!', - EDIT_NEW, - '/^Created page .*Hello/' - ), - - array( - 'Hello there, world!', - '', - 0, - '/^Blanked/' - ), - - array( - 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut - labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et - ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.', - 'Hello world!', - 0, - '/^Replaced .*Hello/' - ), - - array( - 'foo', - 'bar', - 0, - '/^$/' - ), - ); - } - - /** - * @dataProvider provideGetAutoSummary - * @covers WikiPage::getAutosummary - */ - public function testGetAutosummary( $old, $new, $flags, $expected ) { - $this->hideDeprecated( "WikiPage::getAutosummary" ); - - $page = $this->newPage( "WikiPageTest_testGetAutosummary" ); - - $summary = $page->getAutosummary( $old, $new, $flags ); - - $this->assertTrue( (bool)preg_match( $expected, $summary ), - "Autosummary didn't match expected pattern $expected: $summary" ); - } - - public static function provideGetAutoDeleteReason() { - return array( - array( - array(), - false, - false - ), - - array( - array( - array( "first edit", null ), - ), - "/first edit.*only contributor/", - false - ), - - array( - array( - array( "first edit", null ), - array( "second edit", null ), - ), - "/second edit.*only contributor/", - true - ), - - array( - array( - array( "first edit", "127.0.2.22" ), - array( "second edit", "127.0.3.33" ), - ), - "/second edit/", - true - ), - - array( - array( - array( "first edit: " - . "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam " - . " nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. " - . "At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea " - . "takimata sanctus est Lorem ipsum dolor sit amet.'", null ), - ), - '/first edit:.*\.\.\."/', - false - ), - - array( - array( - array( "first edit", "127.0.2.22" ), - array( "", "127.0.3.33" ), - ), - "/before blanking.*first edit/", - true - ), - - ); - } - - /** - * @dataProvider provideGetAutoDeleteReason - * @covers WikiPage::getAutoDeleteReason - */ - public function testGetAutoDeleteReason( $edits, $expectedResult, $expectedHistory ) { - global $wgUser; - - //NOTE: assume Help namespace to contain wikitext - $page = $this->newPage( "Help:WikiPageTest_testGetAutoDeleteReason" ); - - $c = 1; - - foreach ( $edits as $edit ) { - $user = new User(); - - if ( !empty( $edit[1] ) ) { - $user->setName( $edit[1] ); - } else { - $user = $wgUser; - } - - $content = ContentHandler::makeContent( $edit[0], $page->getTitle(), $page->getContentModel() ); - - $page->doEditContent( $content, "test edit $c", $c < 2 ? EDIT_NEW : 0, false, $user ); - - $c += 1; - } - - $reason = $page->getAutoDeleteReason( $hasHistory ); - - if ( is_bool( $expectedResult ) || is_null( $expectedResult ) ) { - $this->assertEquals( $expectedResult, $reason ); - } else { - $this->assertTrue( (bool)preg_match( $expectedResult, $reason ), - "Autosummary didn't match expected pattern $expectedResult: $reason" ); - } - - $this->assertEquals( $expectedHistory, $hasHistory, - "expected \$hasHistory to be " . var_export( $expectedHistory, true ) ); - - $page->doDeleteArticle( "done" ); - } - - public static function providePreSaveTransform() { - return array( - array( 'hello this is ~~~', - "hello this is [[Special:Contributions/127.0.0.1|127.0.0.1]]", - ), - array( 'hello \'\'this\'\' is ~~~', - 'hello \'\'this\'\' is ~~~', - ), - ); - } - - /** - * @dataProvider providePreSaveTransform - * @covers WikiPage::preSaveTransform - */ - public function testPreSaveTransform( $text, $expected ) { - $this->hideDeprecated( 'WikiPage::preSaveTransform' ); - $user = new User(); - $user->setName( "127.0.0.1" ); - - //NOTE: assume Help namespace to contain wikitext - $page = $this->newPage( "Help:WikiPageTest_testPreloadTransform" ); - $text = $page->preSaveTransform( $text, $user ); - - $this->assertEquals( $expected, $text ); - } -} diff --git a/tests/phpunit/includes/WikiPageTest_ContentHandlerUseDB.php b/tests/phpunit/includes/WikiPageTest_ContentHandlerUseDB.php deleted file mode 100644 index 2a723e85..00000000 --- a/tests/phpunit/includes/WikiPageTest_ContentHandlerUseDB.php +++ /dev/null @@ -1,53 +0,0 @@ -setMwGlobals( 'wgContentHandlerUseDB', false ); - - $dbw = wfGetDB( DB_MASTER ); - - $page_table = $dbw->tableName( 'page' ); - $revision_table = $dbw->tableName( 'revision' ); - $archive_table = $dbw->tableName( 'archive' ); - - if ( $dbw->fieldExists( $page_table, 'page_content_model' ) ) { - $dbw->query( "alter table $page_table drop column page_content_model" ); - $dbw->query( "alter table $revision_table drop column rev_content_model" ); - $dbw->query( "alter table $revision_table drop column rev_content_format" ); - $dbw->query( "alter table $archive_table drop column ar_content_model" ); - $dbw->query( "alter table $archive_table drop column ar_content_format" ); - } - } - - /** - * @covers WikiPage::getContentModel - */ - public function testGetContentModel() { - $page = $this->createPage( "WikiPageTest_testGetContentModel", "some text", CONTENT_MODEL_JAVASCRIPT ); - - $page = new WikiPage( $page->getTitle() ); - - // NOTE: since the content model is not recorded in the database, - // we expect to get the default, namely CONTENT_MODEL_WIKITEXT - $this->assertEquals( CONTENT_MODEL_WIKITEXT, $page->getContentModel() ); - } - - /** - * @covers WikiPage::getContentHandler - */ - public function testGetContentHandler() { - $page = $this->createPage( "WikiPageTest_testGetContentHandler", "some text", CONTENT_MODEL_JAVASCRIPT ); - - // NOTE: since the content model is not recorded in the database, - // we expect to get the default, namely CONTENT_MODEL_WIKITEXT - $page = new WikiPage( $page->getTitle() ); - $this->assertEquals( 'WikitextContentHandler', get_class( $page->getContentHandler() ) ); - } -} diff --git a/tests/phpunit/includes/XmlJsTest.php b/tests/phpunit/includes/XmlJsTest.php deleted file mode 100644 index 161468e2..00000000 --- a/tests/phpunit/includes/XmlJsTest.php +++ /dev/null @@ -1,24 +0,0 @@ -assertEquals( $value, $obj->value ); - } - - public function provideConstruction(){ - return array( - array( null ), - array( '' ), - ); - } - -} diff --git a/tests/phpunit/includes/XmlSelectTest.php b/tests/phpunit/includes/XmlSelectTest.php deleted file mode 100644 index 56d28b54..00000000 --- a/tests/phpunit/includes/XmlSelectTest.php +++ /dev/null @@ -1,173 +0,0 @@ -setMwGlobals( array( - 'wgWellFormedXml' => true, - ) ); - $this->select = new XmlSelect(); - } - - protected function tearDown() { - parent::tearDown(); - $this->select = null; - } - - /** - * @covers XmlSelect::__construct - */ - public function testConstructWithoutParameters() { - $this->assertEquals( '', $this->select->getHTML() ); - } - - /** - * Parameters are $name (false), $id (false), $default (false) - * @dataProvider provideConstructionParameters - * @covers XmlSelect::__construct - */ - public function testConstructParameters( $name, $id, $default, $expected ) { - $this->select = new XmlSelect( $name, $id, $default ); - $this->assertEquals( $expected, $this->select->getHTML() ); - } - - /** - * Provide parameters for testConstructParameters() which use three - * parameters: - * - $name (default: false) - * - $id (default: false) - * - $default (default: false) - * Provides a fourth parameters representing the expected HTML output - */ - public static function provideConstructionParameters() { - return array( - /** - * Values are set following a 3-bit Gray code where two successive - * values differ by only one value. - * See http://en.wikipedia.org/wiki/Gray_code - */ - # $name $id $default - array( false, false, false, '' ), - array( false, false, 'foo', '' ), - array( false, 'id', 'foo', '' ), - array( false, 'id', false, '' ), - array( 'name', 'id', false, '' ), - array( 'name', 'id', 'foo', '' ), - array( 'name', false, 'foo', '' ), - array( 'name', false, false, '' ), - ); - } - - /** - * @covers XmlSelect::addOption - */ - public function testAddOption() { - $this->select->addOption( 'foo' ); - $this->assertEquals( '', $this->select->getHTML() ); - } - - /** - * @covers XmlSelect::addOption - */ - public function testAddOptionWithDefault() { - $this->select->addOption( 'foo', true ); - $this->assertEquals( '', $this->select->getHTML() ); - } - - /** - * @covers XmlSelect::addOption - */ - public function testAddOptionWithFalse() { - $this->select->addOption( 'foo', false ); - $this->assertEquals( '', $this->select->getHTML() ); - } - - /** - * @covers XmlSelect::addOption - */ - public function testAddOptionWithValueZero() { - $this->select->addOption( 'foo', 0 ); - $this->assertEquals( '', $this->select->getHTML() ); - } - - /** - * @covers XmlSelect::setDefault - */ - public function testSetDefault() { - $this->select->setDefault( 'bar1' ); - $this->select->addOption( 'foo1' ); - $this->select->addOption( 'bar1' ); - $this->select->addOption( 'foo2' ); - $this->assertEquals( - '', $this->select->getHTML() ); - } - - /** - * Adding default later on should set the correct selection or - * raise an exception. - * To handle this, we need to render the options in getHtml() - * @covers XmlSelect::setDefault - */ - public function testSetDefaultAfterAddingOptions() { - $this->select->addOption( 'foo1' ); - $this->select->addOption( 'bar1' ); - $this->select->addOption( 'foo2' ); - $this->select->setDefault( 'bar1' ); # setting default after adding options - $this->assertEquals( - '', $this->select->getHTML() ); - } - - /** - * @covers XmlSelect::setAttribute - * @covers XmlSelect::getAttribute - */ - public function testGetAttributes() { - # create some attributes - $this->select->setAttribute( 'dummy', 0x777 ); - $this->select->setAttribute( 'string', 'euro €' ); - $this->select->setAttribute( 1911, 'razor' ); - - # verify we can retrieve them - $this->assertEquals( - $this->select->getAttribute( 'dummy' ), - 0x777 - ); - $this->assertEquals( - $this->select->getAttribute( 'string' ), - 'euro €' - ); - $this->assertEquals( - $this->select->getAttribute( 1911 ), - 'razor' - ); - - # inexistant keys should give us 'null' - $this->assertEquals( - $this->select->getAttribute( 'I DO NOT EXIT' ), - null - ); - - # verify string / integer - $this->assertEquals( - $this->select->getAttribute( '1911' ), - 'razor' - ); - $this->assertEquals( - $this->select->getAttribute( 'dummy' ), - 0x777 - ); - } -} diff --git a/tests/phpunit/includes/XmlTest.php b/tests/phpunit/includes/XmlTest.php deleted file mode 100644 index 8205029f..00000000 --- a/tests/phpunit/includes/XmlTest.php +++ /dev/null @@ -1,402 +0,0 @@ -setNamespaces( array( - -2 => 'Media', - -1 => 'Special', - 0 => '', - 1 => 'Talk', - 2 => 'User', - 3 => 'User_talk', - 4 => 'MyWiki', - 5 => 'MyWiki_Talk', - 6 => 'File', - 7 => 'File_talk', - 8 => 'MediaWiki', - 9 => 'MediaWiki_talk', - 10 => 'Template', - 11 => 'Template_talk', - 100 => 'Custom', - 101 => 'Custom_talk', - ) ); - - $this->setMwGlobals( array( - 'wgLang' => $langObj, - 'wgWellFormedXml' => true, - ) ); - } - - /** - * @covers Xml::expandAttributes - */ - public function testExpandAttributes() { - $this->assertNull( Xml::expandAttributes( null ), - 'Converting a null list of attributes' - ); - $this->assertEquals( '', Xml::expandAttributes( array() ), - 'Converting an empty list of attributes' - ); - } - - /** - * @covers Xml::expandAttributes - */ - public function testExpandAttributesException() { - $this->setExpectedException( 'MWException' ); - Xml::expandAttributes( 'string' ); - } - - /** - * @covers Xml::element - */ - public function testElementOpen() { - $this->assertEquals( - '', - Xml::element( 'element', null, null ), - 'Opening element with no attributes' - ); - } - - /** - * @covers Xml::element - */ - public function testElementEmpty() { - $this->assertEquals( - '', - Xml::element( 'element', null, '' ), - 'Terminated empty element' - ); - } - - /** - * @covers Xml::input - */ - public function testElementInputCanHaveAValueOfZero() { - $this->assertEquals( - '', - Xml::input( 'name', false, 0 ), - 'Input with a value of 0 (bug 23797)' - ); - } - - /** - * @covers Xml::element - */ - public function testElementEscaping() { - $this->assertEquals( - 'hello <there> you & you', - Xml::element( 'element', null, 'hello you & you' ), - 'Element with no attributes and content that needs escaping' - ); - } - - /** - * @covers Xml::escapeTagsOnly - */ - public function testEscapeTagsOnly() { - $this->assertEquals( '"><', Xml::escapeTagsOnly( '"><' ), - 'replace " > and < with their HTML entitites' - ); - } - - /** - * @covers Xml::element - */ - public function testElementAttributes() { - $this->assertEquals( - '="<>">', - Xml::element( 'element', array( 'key' => 'value', '<>' => '<>' ), null ), - 'Element attributes, keys are not escaped' - ); - } - - /** - * @covers Xml::openElement - */ - public function testOpenElement() { - $this->assertEquals( - '', - Xml::openElement( 'element', array( 'k' => 'v' ) ), - 'openElement() shortcut' - ); - } - - /** - * @covers Xml::closeElement - */ - public function testCloseElement() { - $this->assertEquals( '', Xml::closeElement( 'element' ), 'closeElement() shortcut' ); - } - - /** - * @covers Xml::dateMenu - */ - public function testDateMenu() { - $curYear = intval( gmdate( 'Y' ) ); - $prevYear = $curYear - 1; - - $curMonth = intval( gmdate( 'n' ) ); - $prevMonth = $curMonth - 1; - if ( $prevMonth == 0 ) { - $prevMonth = 12; - } - $nextMonth = $curMonth + 1; - if ( $nextMonth == 13 ) { - $nextMonth = 1; - } - - $this->assertEquals( - ' ', - Xml::dateMenu( 2011, 02 ), - "Date menu for february 2011" - ); - $this->assertEquals( - ' ', - Xml::dateMenu( 2011, -1 ), - "Date menu with negative month for 'All'" - ); - $this->assertEquals( - Xml::dateMenu( $curYear, $curMonth ), - Xml::dateMenu( '', $curMonth ), - "Date menu year is the current one when not specified" - ); - - $wantedYear = $nextMonth == 1 ? $curYear : $prevYear; - $this->assertEquals( - Xml::dateMenu( $wantedYear, $nextMonth ), - Xml::dateMenu( '', $nextMonth ), - "Date menu next month is 11 months ago" - ); - - $this->assertEquals( - ' ', - Xml::dateMenu( '', '' ), - "Date menu with neither year or month" - ); - } - - /** - * @covers Xml::textarea - */ - public function testTextareaNoContent() { - $this->assertEquals( - '', - Xml::textarea( 'name', '' ), - 'textarea() with not content' - ); - } - - /** - * @covers Xml::textarea - */ - public function testTextareaAttribs() { - $this->assertEquals( - '', - Xml::textarea( 'name', '', 20, 10 ), - 'textarea() with custom attribs' - ); - } - - /** - * @covers Xml::label - */ - public function testLabelCreation() { - $this->assertEquals( - '', - Xml::label( 'name', 'id' ), - 'label() with no attribs' - ); - } - - /** - * @covers Xml::label - */ - public function testLabelAttributeCanOnlyBeClassOrTitle() { - $this->assertEquals( - '', - Xml::label( 'name', 'id', array( 'generated' => true ) ), - 'label() can not be given a generated attribute' - ); - $this->assertEquals( - '', - Xml::label( 'name', 'id', array( 'class' => 'nice' ) ), - 'label() can get a class attribute' - ); - $this->assertEquals( - '', - Xml::label( 'name', 'id', array( 'title' => 'nice tooltip' ) ), - 'label() can get a title attribute' - ); - $this->assertEquals( - '', - Xml::label( 'name', 'id', array( - 'generated' => true, - 'class' => 'nice', - 'title' => 'nice tooltip', - 'anotherattr' => 'value', - ) - ), - 'label() skip all attributes but "class" and "title"' - ); - } - - /** - * @covers Xml::languageSelector - */ - public function testLanguageSelector() { - $select = Xml::languageSelector( 'en', true, null, - array( 'id' => 'testlang' ), wfMessage( 'yourlanguage' ) ); - $this->assertEquals( - '', - $select[0] - ); - } - - /** - * @covers Xml::escapeJsString - */ - public function testEscapeJsStringSpecialChars() { - $this->assertEquals( - '\\\\\r\n', - Xml::escapeJsString( "\\\r\n" ), - 'escapeJsString() with special characters' - ); - } - - /** - * @covers Xml::encodeJsVar - */ - public function testEncodeJsVarBoolean() { - $this->assertEquals( - 'true', - Xml::encodeJsVar( true ), - 'encodeJsVar() with boolean' - ); - } - - /** - * @covers Xml::encodeJsVar - */ - public function testEncodeJsVarNull() { - $this->assertEquals( - 'null', - Xml::encodeJsVar( null ), - 'encodeJsVar() with null' - ); - } - - /** - * @covers Xml::encodeJsVar - */ - public function testEncodeJsVarArray() { - $this->assertEquals( - '["a",1]', - Xml::encodeJsVar( array( 'a', 1 ) ), - 'encodeJsVar() with array' - ); - $this->assertEquals( - '{"a":"a","b":1}', - Xml::encodeJsVar( array( 'a' => 'a', 'b' => 1 ) ), - 'encodeJsVar() with associative array' - ); - } - - /** - * @covers Xml::encodeJsVar - */ - public function testEncodeJsVarObject() { - $this->assertEquals( - '{"a":"a","b":1}', - Xml::encodeJsVar( (object)array( 'a' => 'a', 'b' => 1 ) ), - 'encodeJsVar() with object' - ); - } - - /** - * @covers Xml::encodeJsVar - */ - public function testEncodeJsVarInt() { - $this->assertEquals( - '123456', - Xml::encodeJsVar( 123456 ), - 'encodeJsVar() with int' - ); - } - - /** - * @covers Xml::encodeJsVar - */ - public function testEncodeJsVarFloat() { - $this->assertEquals( - '1.23456', - Xml::encodeJsVar( 1.23456 ), - 'encodeJsVar() with float' - ); - } - - /** - * @covers Xml::encodeJsVar - */ - public function testEncodeJsVarIntString() { - $this->assertEquals( - '"123456"', - Xml::encodeJsVar( '123456' ), - 'encodeJsVar() with int-like string' - ); - } - - /** - * @covers Xml::encodeJsVar - */ - public function testEncodeJsVarFloatString() { - $this->assertEquals( - '"1.23456"', - Xml::encodeJsVar( '1.23456' ), - 'encodeJsVar() with float-like string' - ); - } -} diff --git a/tests/phpunit/includes/XmlTypeCheckTest.php b/tests/phpunit/includes/XmlTypeCheckTest.php deleted file mode 100644 index 8d6f1ed7..00000000 --- a/tests/phpunit/includes/XmlTypeCheckTest.php +++ /dev/null @@ -1,30 +0,0 @@ -"; - const MAL_FORMED_XML = ""; - - /** - * @covers XMLTypeCheck::newFromString - * @covers XMLTypeCheck::getRootElement - */ - public function testWellFormedXML() { - $testXML = XmlTypeCheck::newFromString( self::WELL_FORMED_XML ); - $this->assertTrue( $testXML->wellFormed ); - $this->assertEquals( 'root', $testXML->getRootElement() ); - } - - /** - * @covers XMLTypeCheck::newFromString - */ - public function testMalFormedXML() { - $testXML = XmlTypeCheck::newFromString( self::MAL_FORMED_XML ); - $this->assertFalse( $testXML->wellFormed ); - } - -} diff --git a/tests/phpunit/includes/ZipDirectoryReaderTest.php b/tests/phpunit/includes/ZipDirectoryReaderTest.php deleted file mode 100644 index 2627a417..00000000 --- a/tests/phpunit/includes/ZipDirectoryReaderTest.php +++ /dev/null @@ -1,85 +0,0 @@ -zipDir = __DIR__ . '/../data/zip'; - } - - function zipCallback( $entry ) { - $this->entries[] = $entry; - } - - function readZipAssertError( $file, $error, $assertMessage ) { - $this->entries = array(); - $status = ZipDirectoryReader::read( "{$this->zipDir}/$file", array( $this, 'zipCallback' ) ); - $this->assertTrue( $status->hasMessage( $error ), $assertMessage ); - } - - function readZipAssertSuccess( $file, $assertMessage ) { - $this->entries = array(); - $status = ZipDirectoryReader::read( "{$this->zipDir}/$file", array( $this, 'zipCallback' ) ); - $this->assertTrue( $status->isOK(), $assertMessage ); - } - - public function testEmpty() { - $this->readZipAssertSuccess( 'empty.zip', 'Empty zip' ); - } - - public function testMultiDisk0() { - $this->readZipAssertError( 'split.zip', 'zip-unsupported', - 'Split zip error' ); - } - - public function testNoSignature() { - $this->readZipAssertError( 'nosig.zip', 'zip-wrong-format', - 'No signature should give "wrong format" error' ); - } - - public function testSimple() { - $this->readZipAssertSuccess( 'class.zip', 'Simple ZIP' ); - $this->assertEquals( $this->entries, array( array( - 'name' => 'Class.class', - 'mtime' => '20010115000000', - 'size' => 1, - ) ) ); - } - - public function testBadCentralEntrySignature() { - $this->readZipAssertError( 'wrong-central-entry-sig.zip', 'zip-bad', - 'Bad central entry error' ); - } - - public function testTrailingBytes() { - $this->readZipAssertError( 'trail.zip', 'zip-bad', - 'Trailing bytes error' ); - } - - public function testWrongCDStart() { - $this->readZipAssertError( 'wrong-cd-start-disk.zip', 'zip-unsupported', - 'Wrong CD start disk error' ); - } - - - public function testCentralDirectoryGap() { - $this->readZipAssertError( 'cd-gap.zip', 'zip-bad', - 'CD gap error' ); - } - - public function testCentralDirectoryTruncated() { - $this->readZipAssertError( 'cd-truncated.zip', 'zip-bad', - 'CD truncated error (should hit unpack() overrun)' ); - } - - public function testLooksLikeZip64() { - $this->readZipAssertError( 'looks-like-zip64.zip', 'zip-unsupported', - 'A file which looks like ZIP64 but isn\'t, should give error' ); - } -} diff --git a/tests/phpunit/includes/api/ApiAccountCreationTest.php b/tests/phpunit/includes/api/ApiAccountCreationTest.php deleted file mode 100644 index 68f80ac9..00000000 --- a/tests/phpunit/includes/api/ApiAccountCreationTest.php +++ /dev/null @@ -1,159 +0,0 @@ -setMwGlobals( array( 'wgEnableEmail' => true ) ); - } - - /** - * Test the account creation API with a valid request. Also - * make sure the new account can log in and is valid. - * - * This test does multiple API requests so it might end up being - * a bit slow. Raise the default timeout. - * @group medium - */ - public function testValid() { - global $wgServer; - - if ( !isset( $wgServer ) ) { - $this->markTestIncomplete( 'This test needs $wgServer to be set in LocalSettings.php' ); - } - - $password = User::randomPassword(); - - $ret = $this->doApiRequest( array( - 'action' => 'createaccount', - 'name' => 'Apitestnew', - 'password' => $password, - 'email' => 'test@domain.test', - 'realname' => 'Test Name' - ) ); - - $result = $ret[0]; - $this->assertNotInternalType( 'bool', $result ); - $this->assertNotInternalType( 'null', $result['createaccount'] ); - - // Should first ask for token. - $a = $result['createaccount']; - $this->assertEquals( 'needtoken', $a['result'] ); - $token = $a['token']; - - // Finally create the account - $ret = $this->doApiRequest( - array( - 'action' => 'createaccount', - 'name' => 'Apitestnew', - 'password' => $password, - 'token' => $token, - 'email' => 'test@domain.test', - 'realname' => 'Test Name' - ), - $ret[2] - ); - - $result = $ret[0]; - $this->assertNotInternalType( 'bool', $result ); - $this->assertEquals( 'success', $result['createaccount']['result'] ); - - // Try logging in with the new user. - $ret = $this->doApiRequest( array( - 'action' => 'login', - 'lgname' => 'Apitestnew', - 'lgpassword' => $password, - ) ); - - $result = $ret[0]; - $this->assertNotInternalType( 'bool', $result ); - $this->assertNotInternalType( 'null', $result['login'] ); - - $a = $result['login']['result']; - $this->assertEquals( 'NeedToken', $a ); - $token = $result['login']['token']; - - $ret = $this->doApiRequest( - array( - 'action' => 'login', - 'lgtoken' => $token, - 'lgname' => 'Apitestnew', - 'lgpassword' => $password, - ), - $ret[2] - ); - - $result = $ret[0]; - - $this->assertNotInternalType( 'bool', $result ); - $a = $result['login']['result']; - - $this->assertEquals( 'Success', $a ); - - // log out to destroy the session - $ret = $this->doApiRequest( - array( - 'action' => 'logout', - ), - $ret[2] - ); - $this->assertEquals( array(), $ret[0] ); - } - - /** - * Make sure requests with no names are invalid. - * @expectedException UsageException - */ - public function testNoName() { - $this->doApiRequest( array( - 'action' => 'createaccount', - 'token' => LoginForm::getCreateaccountToken(), - 'password' => 'password', - ) ); - } - - /** - * Make sure requests with no password are invalid. - * @expectedException UsageException - */ - public function testNoPassword() { - $this->doApiRequest( array( - 'action' => 'createaccount', - 'name' => 'testName', - 'token' => LoginForm::getCreateaccountToken(), - ) ); - } - - /** - * Make sure requests with existing users are invalid. - * @expectedException UsageException - */ - public function testExistingUser() { - $this->doApiRequest( array( - 'action' => 'createaccount', - 'name' => 'Apitestsysop', - 'token' => LoginForm::getCreateaccountToken(), - 'password' => 'password', - 'email' => 'test@domain.test', - ) ); - } - - /** - * Make sure requests with invalid emails are invalid. - * @expectedException UsageException - */ - public function testInvalidEmail() { - $this->doApiRequest( array( - 'action' => 'createaccount', - 'name' => 'Test User', - 'token' => LoginForm::getCreateaccountToken(), - 'password' => 'password', - 'email' => 'invalid', - ) ); - } -} diff --git a/tests/phpunit/includes/api/ApiBlockTest.php b/tests/phpunit/includes/api/ApiBlockTest.php deleted file mode 100644 index 8afb748a..00000000 --- a/tests/phpunit/includes/api/ApiBlockTest.php +++ /dev/null @@ -1,95 +0,0 @@ -doLogin(); - } - - function getTokens() { - return $this->getTokenList( self::$users['sysop'] ); - } - - function addDBData() { - $user = User::newFromName( 'UTApiBlockee' ); - - if ( $user->getId() == 0 ) { - $user->addToDatabase(); - $user->setPassword( 'UTApiBlockeePassword' ); - - $user->saveSettings(); - } - } - - /** - * This test has probably always been broken and use an invalid token - * Bug tracking brokenness is https://bugzilla.wikimedia.org/35646 - * - * Root cause is https://gerrit.wikimedia.org/r/3434 - * Which made the Block/Unblock API to actually verify the token - * previously always considered valid (bug 34212). - */ - public function testMakeNormalBlock() { - $tokens = $this->getTokens(); - - $user = User::newFromName( 'UTApiBlockee' ); - - if ( !$user->getId() ) { - $this->markTestIncomplete( "The user UTApiBlockee does not exist" ); - } - - if ( !array_key_exists( 'blocktoken', $tokens ) ) { - $this->markTestIncomplete( "No block token found" ); - } - - $this->doApiRequest( array( - 'action' => 'block', - 'user' => 'UTApiBlockee', - 'reason' => 'Some reason', - 'token' => $tokens['blocktoken'] ), null, false, self::$users['sysop']->user ); - - $block = Block::newFromTarget( 'UTApiBlockee' ); - - $this->assertTrue( !is_null( $block ), 'Block is valid' ); - - $this->assertEquals( 'UTApiBlockee', (string)$block->getTarget() ); - $this->assertEquals( 'Some reason', $block->mReason ); - $this->assertEquals( 'infinity', $block->mExpiry ); - } - - /** - * Attempting to block without a token should give a UsageException with - * error message: - * "The token parameter must be set" - * - * @dataProvider provideBlockUnblockAction - * @expectedException UsageException - */ - public function testBlockingActionWithNoToken( $action ) { - $this->doApiRequest( - array( - 'action' => $action, - 'user' => 'UTApiBlockee', - 'reason' => 'Some reason', - ), - null, - false, - self::$users['sysop']->user - ); - } - - /** - * Just provide the 'block' and 'unblock' action to test both API calls - */ - public static function provideBlockUnblockAction() { - return array( - array( 'block' ), - array( 'unblock' ), - ); - } -} diff --git a/tests/phpunit/includes/api/ApiEditPageTest.php b/tests/phpunit/includes/api/ApiEditPageTest.php deleted file mode 100644 index 0c49b12b..00000000 --- a/tests/phpunit/includes/api/ApiEditPageTest.php +++ /dev/null @@ -1,417 +0,0 @@ -resetNamespaces(); # reset namespace cache - - $this->doLogin(); - } - - public function tearDown() { - global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang; - - unset( $wgExtraNamespaces[12312] ); - unset( $wgExtraNamespaces[12313] ); - - unset( $wgNamespaceContentModels[12312] ); - unset( $wgContentHandlers["testing"] ); - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - - parent::tearDown(); - } - - public function testEdit() { - $name = 'Help:ApiEditPageTest_testEdit'; // assume Help namespace to default to wikitext - - // -- test new page -------------------------------------------- - $apiResult = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'text' => 'some text', - ) ); - $apiResult = $apiResult[0]; - - // Validate API result data - $this->assertArrayHasKey( 'edit', $apiResult ); - $this->assertArrayHasKey( 'result', $apiResult['edit'] ); - $this->assertEquals( 'Success', $apiResult['edit']['result'] ); - - $this->assertArrayHasKey( 'new', $apiResult['edit'] ); - $this->assertArrayNotHasKey( 'nochange', $apiResult['edit'] ); - - $this->assertArrayHasKey( 'pageid', $apiResult['edit'] ); - - // -- test existing page, no change ---------------------------- - $data = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'text' => 'some text', - ) ); - - $this->assertEquals( 'Success', $data[0]['edit']['result'] ); - - $this->assertArrayNotHasKey( 'new', $data[0]['edit'] ); - $this->assertArrayHasKey( 'nochange', $data[0]['edit'] ); - - // -- test existing page, with change -------------------------- - $data = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'text' => 'different text' - ) ); - - $this->assertEquals( 'Success', $data[0]['edit']['result'] ); - - $this->assertArrayNotHasKey( 'new', $data[0]['edit'] ); - $this->assertArrayNotHasKey( 'nochange', $data[0]['edit'] ); - - $this->assertArrayHasKey( 'oldrevid', $data[0]['edit'] ); - $this->assertArrayHasKey( 'newrevid', $data[0]['edit'] ); - $this->assertNotEquals( - $data[0]['edit']['newrevid'], - $data[0]['edit']['oldrevid'], - "revision id should change after edit" - ); - } - - public function testNonTextEdit() { - $name = 'Dummy:ApiEditPageTest_testNonTextEdit'; - $data = serialize( 'some bla bla text' ); - - // -- test new page -------------------------------------------- - $apiResult = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'text' => $data, ) ); - $apiResult = $apiResult[0]; - - // Validate API result data - $this->assertArrayHasKey( 'edit', $apiResult ); - $this->assertArrayHasKey( 'result', $apiResult['edit'] ); - $this->assertEquals( 'Success', $apiResult['edit']['result'] ); - - $this->assertArrayHasKey( 'new', $apiResult['edit'] ); - $this->assertArrayNotHasKey( 'nochange', $apiResult['edit'] ); - - $this->assertArrayHasKey( 'pageid', $apiResult['edit'] ); - - // validate resulting revision - $page = WikiPage::factory( Title::newFromText( $name ) ); - $this->assertEquals( "testing", $page->getContentModel() ); - $this->assertEquals( $data, $page->getContent()->serialize() ); - } - - public static function provideEditAppend() { - return array( - array( #0: append - 'foo', 'append', 'bar', "foobar" - ), - array( #1: prepend - 'foo', 'prepend', 'bar', "barfoo" - ), - array( #2: append to empty page - '', 'append', 'foo', "foo" - ), - array( #3: prepend to empty page - '', 'prepend', 'foo', "foo" - ), - array( #4: append to non-existing page - null, 'append', 'foo', "foo" - ), - array( #5: prepend to non-existing page - null, 'prepend', 'foo', "foo" - ), - ); - } - - /** - * @dataProvider provideEditAppend - */ - public function testEditAppend( $text, $op, $append, $expected ) { - static $count = 0; - $count++; - - // assume NS_HELP defaults to wikitext - $name = "Help:ApiEditPageTest_testEditAppend_$count"; - - // -- create page (or not) ----------------------------------------- - if ( $text !== null ) { - if ( $text === '' ) { - // can't create an empty page, so create it with some content - $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'text' => '(dummy)', ) ); - } - - list( $re ) = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'text' => $text, ) ); - - $this->assertEquals( 'Success', $re['edit']['result'] ); // sanity - } - - // -- try append/prepend -------------------------------------------- - list( $re ) = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - $op . 'text' => $append, ) ); - - $this->assertEquals( 'Success', $re['edit']['result'] ); - - // -- validate ----------------------------------------------------- - $page = new WikiPage( Title::newFromText( $name ) ); - $content = $page->getContent(); - $this->assertNotNull( $content, 'Page should have been created' ); - - $text = $content->getNativeData(); - - $this->assertEquals( $expected, $text ); - } - - /** - * Test editing of sections - */ - public function testEditSection() { - $name = 'Help:ApiEditPageTest_testEditSection'; - $page = WikiPage::factory( Title::newFromText( $name ) ); - $text = "==section 1==\ncontent 1\n==section 2==\ncontent2"; - // Preload the page with some text - $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), 'summary' ); - - list( $re ) = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'section' => '1', - 'text' => "==section 1==\nnew content 1", - ) ); - $this->assertEquals( 'Success', $re['edit']['result'] ); - $newtext = WikiPage::factory( Title::newFromText( $name) )->getContent( Revision::RAW )->getNativeData(); - $this->assertEquals( $newtext, "==section 1==\nnew content 1\n\n==section 2==\ncontent2" ); - - // Test that we raise a 'nosuchsection' error - try { - $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'section' => '9999', - 'text' => 'text', - ) ); - $this->fail( "Should have raised a UsageException" ); - } catch ( UsageException $e ) { - $this->assertEquals( $e->getCodeString(), 'nosuchsection' ); - } - } - - /** - * Test action=edit§ion=new - * Run it twice so we test adding a new section on a - * page that doesn't exist (bug 52830) and one that - * does exist - */ - public function testEditNewSection() { - $name = 'Help:ApiEditPageTest_testEditNewSection'; - - // Test on a page that does not already exist - $this->assertFalse( Title::newFromText( $name )->exists() ); - list( $re ) = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'section' => 'new', - 'text' => 'test', - 'summary' => 'header', - )); - - $this->assertEquals( 'Success', $re['edit']['result'] ); - // Check the page text is correct - $text = WikiPage::factory( Title::newFromText( $name ) )->getContent( Revision::RAW )->getNativeData(); - $this->assertEquals( $text, "== header ==\n\ntest" ); - - // Now on one that does - $this->assertTrue( Title::newFromText( $name )->exists() ); - list( $re2 ) = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'section' => 'new', - 'text' => 'test', - 'summary' => 'header', - )); - - $this->assertEquals( 'Success', $re2['edit']['result'] ); - $text = WikiPage::factory( Title::newFromText( $name ) )->getContent( Revision::RAW )->getNativeData(); - $this->assertEquals( $text, "== header ==\n\ntest\n\n== header ==\n\ntest" ); - } - - public function testEditConflict() { - static $count = 0; - $count++; - - // assume NS_HELP defaults to wikitext - $name = "Help:ApiEditPageTest_testEditConflict_$count"; - $title = Title::newFromText( $name ); - - $page = WikiPage::factory( $title ); - - // base edit - $page->doEditContent( new WikitextContent( "Foo" ), - "testing 1", EDIT_NEW, false, self::$users['sysop']->user ); - $this->forceRevisionDate( $page, '20120101000000' ); - $baseTime = $page->getRevision()->getTimestamp(); - - // conflicting edit - $page->doEditContent( new WikitextContent( "Foo bar" ), - "testing 2", EDIT_UPDATE, $page->getLatest(), self::$users['uploader']->user ); - $this->forceRevisionDate( $page, '20120101020202' ); - - // try to save edit, expect conflict - try { - $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $name, - 'text' => 'nix bar!', - 'basetimestamp' => $baseTime, - ), null, self::$users['sysop']->user ); - - $this->fail( 'edit conflict expected' ); - } catch ( UsageException $ex ) { - $this->assertEquals( 'editconflict', $ex->getCodeString() ); - } - } - - public function testEditConflict_redirect() { - static $count = 0; - $count++; - - // assume NS_HELP defaults to wikitext - $name = "Help:ApiEditPageTest_testEditConflict_redirect_$count"; - $title = Title::newFromText( $name ); - $page = WikiPage::factory( $title ); - - $rname = "Help:ApiEditPageTest_testEditConflict_redirect_r$count"; - $rtitle = Title::newFromText( $rname ); - $rpage = WikiPage::factory( $rtitle ); - - // base edit for content - $page->doEditContent( new WikitextContent( "Foo" ), - "testing 1", EDIT_NEW, false, self::$users['sysop']->user ); - $this->forceRevisionDate( $page, '20120101000000' ); - $baseTime = $page->getRevision()->getTimestamp(); - - // base edit for redirect - $rpage->doEditContent( new WikitextContent( "#REDIRECT [[$name]]" ), - "testing 1", EDIT_NEW, false, self::$users['sysop']->user ); - $this->forceRevisionDate( $rpage, '20120101000000' ); - - // conflicting edit to redirect - $rpage->doEditContent( new WikitextContent( "#REDIRECT [[$name]]\n\n[[Category:Test]]" ), - "testing 2", EDIT_UPDATE, $page->getLatest(), self::$users['uploader']->user ); - $this->forceRevisionDate( $rpage, '20120101020202' ); - - // try to save edit; should work, because we follow the redirect - list( $re, , ) = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $rname, - 'text' => 'nix bar!', - 'basetimestamp' => $baseTime, - 'redirect' => true, - ), null, self::$users['sysop']->user ); - - $this->assertEquals( 'Success', $re['edit']['result'], - "no edit conflict expected when following redirect" ); - - // try again, without following the redirect. Should fail. - try { - $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $rname, - 'text' => 'nix bar!', - 'basetimestamp' => $baseTime, - ), null, self::$users['sysop']->user ); - - $this->fail( 'edit conflict expected' ); - } catch ( UsageException $ex ) { - $this->assertEquals( 'editconflict', $ex->getCodeString() ); - } - } - - public function testEditConflict_bug41990() { - static $count = 0; - $count++; - - /* - * bug 41990: if the target page has a newer revision than the redirect, then editing the - * redirect while specifying 'redirect' and *not* specifying 'basetimestamp' erroneously - * caused an edit conflict to be detected. - */ - - // assume NS_HELP defaults to wikitext - $name = "Help:ApiEditPageTest_testEditConflict_redirect_bug41990_$count"; - $title = Title::newFromText( $name ); - $page = WikiPage::factory( $title ); - - $rname = "Help:ApiEditPageTest_testEditConflict_redirect_bug41990_r$count"; - $rtitle = Title::newFromText( $rname ); - $rpage = WikiPage::factory( $rtitle ); - - // base edit for content - $page->doEditContent( new WikitextContent( "Foo" ), - "testing 1", EDIT_NEW, false, self::$users['sysop']->user ); - $this->forceRevisionDate( $page, '20120101000000' ); - - // base edit for redirect - $rpage->doEditContent( new WikitextContent( "#REDIRECT [[$name]]" ), - "testing 1", EDIT_NEW, false, self::$users['sysop']->user ); - $this->forceRevisionDate( $rpage, '20120101000000' ); - $baseTime = $rpage->getRevision()->getTimestamp(); - - // new edit to content - $page->doEditContent( new WikitextContent( "Foo bar" ), - "testing 2", EDIT_UPDATE, $page->getLatest(), self::$users['uploader']->user ); - $this->forceRevisionDate( $rpage, '20120101020202' ); - - // try to save edit; should work, following the redirect. - list( $re, , ) = $this->doApiRequestWithToken( array( - 'action' => 'edit', - 'title' => $rname, - 'text' => 'nix bar!', - 'redirect' => true, - ), null, self::$users['sysop']->user ); - - $this->assertEquals( 'Success', $re['edit']['result'], - "no edit conflict expected here" ); - } - - protected function forceRevisionDate( WikiPage $page, $timestamp ) { - $dbw = wfGetDB( DB_MASTER ); - - $dbw->update( 'revision', - array( 'rev_timestamp' => $dbw->timestamp( $timestamp ) ), - array( 'rev_id' => $page->getLatest() ) ); - - $page->clear(); - } -} diff --git a/tests/phpunit/includes/api/ApiOptionsTest.php b/tests/phpunit/includes/api/ApiOptionsTest.php deleted file mode 100644 index ad1e73ab..00000000 --- a/tests/phpunit/includes/api/ApiOptionsTest.php +++ /dev/null @@ -1,420 +0,0 @@ - 'success' ); - - protected function setUp() { - parent::setUp(); - - $this->mUserMock = $this->getMockBuilder( 'User' ) - ->disableOriginalConstructor() - ->getMock(); - - // Set up groups and rights - $this->mUserMock->expects( $this->any() ) - ->method( 'getEffectiveGroups' )->will( $this->returnValue( array( '*', 'user' ) ) ); - $this->mUserMock->expects( $this->any() ) - ->method( 'isAllowed' )->will( $this->returnValue( true ) ); - - // Set up callback for User::getOptionKinds - $this->mUserMock->expects( $this->any() ) - ->method( 'getOptionKinds' )->will( $this->returnCallback( array( $this, 'getOptionKinds' ) ) ); - - // Create a new context - $this->mContext = new DerivativeContext( new RequestContext() ); - $this->mContext->getContext()->setTitle( Title::newFromText( 'Test' ) ); - $this->mContext->setUser( $this->mUserMock ); - - $main = new ApiMain( $this->mContext ); - - // Empty session - $this->mSession = array(); - - $this->mTested = new ApiOptions( $main, 'options' ); - - global $wgHooks; - if ( !isset( $wgHooks['GetPreferences'] ) ) { - $wgHooks['GetPreferences'] = array(); - } - $this->mOldGetPreferencesHooks = $wgHooks['GetPreferences']; - $wgHooks['GetPreferences'][] = array( $this, 'hookGetPreferences' ); - } - - protected function tearDown() { - global $wgHooks; - - if ( $this->mOldGetPreferencesHooks !== false ) { - $wgHooks['GetPreferences'] = $this->mOldGetPreferencesHooks; - $this->mOldGetPreferencesHooks = false; - } - - parent::tearDown(); - } - - public function hookGetPreferences( $user, &$preferences ) { - $preferences = array(); - - foreach ( array( 'name', 'willBeNull', 'willBeEmpty', 'willBeHappy' ) as $k ) { - $preferences[$k] = array( - 'type' => 'text', - 'section' => 'test', - 'label' => ' ', - ); - } - - $preferences['testmultiselect'] = array( - 'type' => 'multiselect', - 'options' => array( - 'Test' => array( - 'Some HTML here for option 1' => 'opt1', - 'Some HTML here for option 2' => 'opt2', - 'Some HTML here for option 3' => 'opt3', - 'Some HTML here for option 4' => 'opt4', - ), - ), - 'section' => 'test', - 'label' => ' ', - 'prefix' => 'testmultiselect-', - 'default' => array(), - ); - - return true; - } - - public function getOptionKinds( IContextSource $context, $options = null ) { - // Match with above. - $kinds = array( - 'name' => 'registered', - 'willBeNull' => 'registered', - 'willBeEmpty' => 'registered', - 'willBeHappy' => 'registered', - 'testmultiselect-opt1' => 'registered-multiselect', - 'testmultiselect-opt2' => 'registered-multiselect', - 'testmultiselect-opt3' => 'registered-multiselect', - 'testmultiselect-opt4' => 'registered-multiselect', - ); - - if ( $options === null ) { - return $kinds; - } - - $mapping = array(); - foreach ( $options as $key => $value ) { - if ( isset( $kinds[$key] ) ) { - $mapping[$key] = $kinds[$key]; - } elseif ( substr( $key, 0, 7 ) === 'userjs-' ) { - $mapping[$key] = 'userjs'; - } else { - $mapping[$key] = 'unused'; - } - } - - return $mapping; - } - - private function getSampleRequest( $custom = array() ) { - $request = array( - 'token' => '123ABC', - 'change' => null, - 'optionname' => null, - 'optionvalue' => null, - ); - - return array_merge( $request, $custom ); - } - - private function executeQuery( $request ) { - $this->mContext->setRequest( new FauxRequest( $request, true, $this->mSession ) ); - $this->mTested->execute(); - - return $this->mTested->getResult()->getData(); - } - - /** - * @expectedException UsageException - */ - public function testNoToken() { - $request = $this->getSampleRequest( array( 'token' => null ) ); - - $this->executeQuery( $request ); - } - - public function testAnon() { - $this->mUserMock->expects( $this->once() ) - ->method( 'isAnon' ) - ->will( $this->returnValue( true ) ); - - try { - $request = $this->getSampleRequest(); - - $this->executeQuery( $request ); - } catch ( UsageException $e ) { - $this->assertEquals( 'notloggedin', $e->getCodeString() ); - $this->assertEquals( 'Anonymous users cannot change preferences', $e->getMessage() ); - - return; - } - $this->fail( "UsageException was not thrown" ); - } - - public function testNoOptionname() { - try { - $request = $this->getSampleRequest( array( 'optionvalue' => '1' ) ); - - $this->executeQuery( $request ); - } catch ( UsageException $e ) { - $this->assertEquals( 'nooptionname', $e->getCodeString() ); - $this->assertEquals( 'The optionname parameter must be set', $e->getMessage() ); - - return; - } - $this->fail( "UsageException was not thrown" ); - } - - public function testNoChanges() { - $this->mUserMock->expects( $this->never() ) - ->method( 'resetOptions' ); - - $this->mUserMock->expects( $this->never() ) - ->method( 'setOption' ); - - $this->mUserMock->expects( $this->never() ) - ->method( 'saveSettings' ); - - try { - $request = $this->getSampleRequest(); - - $this->executeQuery( $request ); - } catch ( UsageException $e ) { - $this->assertEquals( 'nochanges', $e->getCodeString() ); - $this->assertEquals( 'No changes were requested', $e->getMessage() ); - - return; - } - $this->fail( "UsageException was not thrown" ); - } - - public function testReset() { - $this->mUserMock->expects( $this->once() ) - ->method( 'resetOptions' ) - ->with( $this->equalTo( array( 'all' ) ) ); - - $this->mUserMock->expects( $this->never() ) - ->method( 'setOption' ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'saveSettings' ); - - $request = $this->getSampleRequest( array( 'reset' => '' ) ); - - $response = $this->executeQuery( $request ); - - $this->assertEquals( self::$Success, $response ); - } - - public function testResetKinds() { - $this->mUserMock->expects( $this->once() ) - ->method( 'resetOptions' ) - ->with( $this->equalTo( array( 'registered' ) ) ); - - $this->mUserMock->expects( $this->never() ) - ->method( 'setOption' ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'saveSettings' ); - - $request = $this->getSampleRequest( array( 'reset' => '', 'resetkinds' => 'registered' ) ); - - $response = $this->executeQuery( $request ); - - $this->assertEquals( self::$Success, $response ); - } - - public function testOptionWithValue() { - $this->mUserMock->expects( $this->never() ) - ->method( 'resetOptions' ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'name' ), $this->equalTo( 'value' ) ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'saveSettings' ); - - $request = $this->getSampleRequest( array( 'optionname' => 'name', 'optionvalue' => 'value' ) ); - - $response = $this->executeQuery( $request ); - - $this->assertEquals( self::$Success, $response ); - } - - public function testOptionResetValue() { - $this->mUserMock->expects( $this->never() ) - ->method( 'resetOptions' ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'name' ), $this->identicalTo( null ) ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'saveSettings' ); - - $request = $this->getSampleRequest( array( 'optionname' => 'name' ) ); - $response = $this->executeQuery( $request ); - - $this->assertEquals( self::$Success, $response ); - } - - public function testChange() { - $this->mUserMock->expects( $this->never() ) - ->method( 'resetOptions' ); - - $this->mUserMock->expects( $this->at( 2 ) ) - ->method( 'getOptions' ); - - $this->mUserMock->expects( $this->at( 4 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'willBeNull' ), $this->identicalTo( null ) ); - - $this->mUserMock->expects( $this->at( 5 ) ) - ->method( 'getOptions' ); - - $this->mUserMock->expects( $this->at( 6 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'willBeEmpty' ), $this->equalTo( '' ) ); - - $this->mUserMock->expects( $this->at( 7 ) ) - ->method( 'getOptions' ); - - $this->mUserMock->expects( $this->at( 8 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'willBeHappy' ), $this->equalTo( 'Happy' ) ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'saveSettings' ); - - $request = $this->getSampleRequest( array( 'change' => 'willBeNull|willBeEmpty=|willBeHappy=Happy' ) ); - - $response = $this->executeQuery( $request ); - - $this->assertEquals( self::$Success, $response ); - } - - public function testResetChangeOption() { - $this->mUserMock->expects( $this->once() ) - ->method( 'resetOptions' ); - - $this->mUserMock->expects( $this->at( 4 ) ) - ->method( 'getOptions' ); - - $this->mUserMock->expects( $this->at( 5 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'willBeHappy' ), $this->equalTo( 'Happy' ) ); - - $this->mUserMock->expects( $this->at( 6 ) ) - ->method( 'getOptions' ); - - $this->mUserMock->expects( $this->at( 7 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'name' ), $this->equalTo( 'value' ) ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'saveSettings' ); - - $args = array( - 'reset' => '', - 'change' => 'willBeHappy=Happy', - 'optionname' => 'name', - 'optionvalue' => 'value' - ); - - $response = $this->executeQuery( $this->getSampleRequest( $args ) ); - - $this->assertEquals( self::$Success, $response ); - } - - public function testMultiSelect() { - $this->mUserMock->expects( $this->never() ) - ->method( 'resetOptions' ); - - $this->mUserMock->expects( $this->at( 3 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'testmultiselect-opt1' ), $this->identicalTo( true ) ); - - $this->mUserMock->expects( $this->at( 4 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'testmultiselect-opt2' ), $this->identicalTo( null ) ); - - $this->mUserMock->expects( $this->at( 5 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'testmultiselect-opt3' ), $this->identicalTo( false ) ); - - $this->mUserMock->expects( $this->at( 6 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'testmultiselect-opt4' ), $this->identicalTo( false ) ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'saveSettings' ); - - $request = $this->getSampleRequest( array( - 'change' => 'testmultiselect-opt1=1|testmultiselect-opt2|testmultiselect-opt3=|testmultiselect-opt4=0' - ) ); - - $response = $this->executeQuery( $request ); - - $this->assertEquals( self::$Success, $response ); - } - - public function testUnknownOption() { - $this->mUserMock->expects( $this->never() ) - ->method( 'resetOptions' ); - - $this->mUserMock->expects( $this->never() ) - ->method( 'saveSettings' ); - - $request = $this->getSampleRequest( array( - 'change' => 'unknownOption=1' - ) ); - - $response = $this->executeQuery( $request ); - - $this->assertEquals( array( - 'options' => 'success', - 'warnings' => array( - 'options' => array( - '*' => "Validation error for 'unknownOption': not a valid preference" - ) - ) - ), $response ); - } - - public function testUserjsOption() { - $this->mUserMock->expects( $this->never() ) - ->method( 'resetOptions' ); - - $this->mUserMock->expects( $this->at( 3 ) ) - ->method( 'setOption' ) - ->with( $this->equalTo( 'userjs-option' ), $this->equalTo( '1' ) ); - - $this->mUserMock->expects( $this->once() ) - ->method( 'saveSettings' ); - - $request = $this->getSampleRequest( array( - 'change' => 'userjs-option=1' - ) ); - - $response = $this->executeQuery( $request ); - - $this->assertEquals( self::$Success, $response ); - } -} diff --git a/tests/phpunit/includes/api/ApiParseTest.php b/tests/phpunit/includes/api/ApiParseTest.php deleted file mode 100644 index 2d714e65..00000000 --- a/tests/phpunit/includes/api/ApiParseTest.php +++ /dev/null @@ -1,29 +0,0 @@ -doLogin(); - } - - public function testParseNonexistentPage() { - $somePage = mt_rand(); - - try { - $this->doApiRequest( array( - 'action' => 'parse', - 'page' => $somePage ) ); - - $this->fail( "API did not return an error when parsing a nonexistent page" ); - } catch ( UsageException $ex ) { - $this->assertEquals( 'missingtitle', $ex->getCodeString(), - "Parse request for nonexistent page must give 'missingtitle' error: " . var_export( $ex->getMessageArray(), true ) ); - } - } -} diff --git a/tests/phpunit/includes/api/ApiPurgeTest.php b/tests/phpunit/includes/api/ApiPurgeTest.php deleted file mode 100644 index 28b5ff4d..00000000 --- a/tests/phpunit/includes/api/ApiPurgeTest.php +++ /dev/null @@ -1,40 +0,0 @@ -doLogin(); - } - - /** - * @group Broken - */ - public function testPurgeMainPage() { - if ( !Title::newFromText( 'UTPage' )->exists() ) { - $this->markTestIncomplete( "The article [[UTPage]] does not exist" ); - } - - $somePage = mt_rand(); - - $data = $this->doApiRequest( array( - 'action' => 'purge', - 'titles' => 'UTPage|' . $somePage . '|%5D' ) ); - - $this->assertArrayHasKey( 'purge', $data[0], - "Must receive a 'purge' result from API" ); - - $this->assertEquals( 3, count( $data[0]['purge'] ), - "Purge request for three articles should give back three results received: " . var_export( $data[0]['purge'], true ) ); - - $pages = array( 'UTPage' => 'purged', $somePage => 'missing', '%5D' => 'invalid' ); - foreach ( $data[0]['purge'] as $v ) { - $this->assertArrayHasKey( $pages[$v['title']], $v ); - } - } -} diff --git a/tests/phpunit/includes/api/ApiTest.php b/tests/phpunit/includes/api/ApiTest.php deleted file mode 100644 index 472f8c4a..00000000 --- a/tests/phpunit/includes/api/ApiTest.php +++ /dev/null @@ -1,259 +0,0 @@ -assertEquals( - null, $mock->requireOnlyOneParameter( array( "filename" => "foo.txt", - "enablechunks" => false ), "filename", "enablechunks" ) ); - } - - /** - * @expectedException UsageException - */ - public function testRequireOnlyOneParameterZero() { - $mock = new MockApi(); - - $this->assertEquals( - null, $mock->requireOnlyOneParameter( array( "filename" => "foo.txt", - "enablechunks" => 0 ), "filename", "enablechunks" ) ); - } - - /** - * @expectedException UsageException - */ - public function testRequireOnlyOneParameterTrue() { - $mock = new MockApi(); - - $this->assertEquals( - null, $mock->requireOnlyOneParameter( array( "filename" => "foo.txt", - "enablechunks" => true ), "filename", "enablechunks" ) ); - } - - /** - * Test that the API will accept a FauxRequest and execute. The help action - * (default) throws a UsageException. Just validate we're getting proper XML - * - * @expectedException UsageException - */ - public function testApi() { - $api = new ApiMain( - new FauxRequest( array( 'action' => 'help', 'format' => 'xml' ) ) - ); - $api->execute(); - $api->getPrinter()->setBufferResult( true ); - $api->printResult( false ); - $resp = $api->getPrinter()->getBuffer(); - - libxml_use_internal_errors( true ); - $sxe = simplexml_load_string( $resp ); - $this->assertNotInternalType( "bool", $sxe ); - $this->assertThat( $sxe, $this->isInstanceOf( "SimpleXMLElement" ) ); - } - - /** - * Test result of attempted login with an empty username - */ - public function testApiLoginNoName() { - $data = $this->doApiRequest( array( 'action' => 'login', - 'lgname' => '', 'lgpassword' => self::$users['sysop']->password, - ) ); - $this->assertEquals( 'NoName', $data[0]['login']['result'] ); - } - - public function testApiLoginBadPass() { - global $wgServer; - - $user = self::$users['sysop']; - $user->user->logOut(); - - if ( !isset( $wgServer ) ) { - $this->markTestIncomplete( 'This test needs $wgServer to be set in LocalSettings.php' ); - } - $ret = $this->doApiRequest( array( - "action" => "login", - "lgname" => $user->username, - "lgpassword" => "bad", - ) ); - - $result = $ret[0]; - - $this->assertNotInternalType( "bool", $result ); - $a = $result["login"]["result"]; - $this->assertEquals( "NeedToken", $a ); - - $token = $result["login"]["token"]; - - $ret = $this->doApiRequest( - array( - "action" => "login", - "lgtoken" => $token, - "lgname" => $user->username, - "lgpassword" => "badnowayinhell", - ), - $ret[2] - ); - - $result = $ret[0]; - - $this->assertNotInternalType( "bool", $result ); - $a = $result["login"]["result"]; - - $this->assertEquals( "WrongPass", $a ); - } - - public function testApiLoginGoodPass() { - global $wgServer; - - if ( !isset( $wgServer ) ) { - $this->markTestIncomplete( 'This test needs $wgServer to be set in LocalSettings.php' ); - } - - $user = self::$users['sysop']; - $user->user->logOut(); - - $ret = $this->doApiRequest( array( - "action" => "login", - "lgname" => $user->username, - "lgpassword" => $user->password, - ) - ); - - $result = $ret[0]; - $this->assertNotInternalType( "bool", $result ); - $this->assertNotInternalType( "null", $result["login"] ); - - $a = $result["login"]["result"]; - $this->assertEquals( "NeedToken", $a ); - $token = $result["login"]["token"]; - - $ret = $this->doApiRequest( - array( - "action" => "login", - "lgtoken" => $token, - "lgname" => $user->username, - "lgpassword" => $user->password, - ), - $ret[2] - ); - - $result = $ret[0]; - - $this->assertNotInternalType( "bool", $result ); - $a = $result["login"]["result"]; - - $this->assertEquals( "Success", $a ); - } - - /** - * @group Broken - */ - public function testApiGotCookie() { - $this->markTestIncomplete( "The server can't do external HTTP requests, and the internal one won't give cookies" ); - - global $wgServer, $wgScriptPath; - - if ( !isset( $wgServer ) ) { - $this->markTestIncomplete( 'This test needs $wgServer to be set in LocalSettings.php' ); - } - $user = self::$users['sysop']; - - $req = MWHttpRequest::factory( self::$apiUrl . "?action=login&format=xml", - array( "method" => "POST", - "postData" => array( - "lgname" => $user->username, - "lgpassword" => $user->password - ) - ) - ); - $req->execute(); - - libxml_use_internal_errors( true ); - $sxe = simplexml_load_string( $req->getContent() ); - $this->assertNotInternalType( "bool", $sxe ); - $this->assertThat( $sxe, $this->isInstanceOf( "SimpleXMLElement" ) ); - $this->assertNotInternalType( "null", $sxe->login[0] ); - - $a = $sxe->login[0]->attributes()->result[0]; - $this->assertEquals( ' result="NeedToken"', $a->asXML() ); - $token = (string)$sxe->login[0]->attributes()->token; - - $req->setData( array( - "lgtoken" => $token, - "lgname" => $user->username, - "lgpassword" => $user->password ) ); - $req->execute(); - - $cj = $req->getCookieJar(); - $serverName = parse_url( $wgServer, PHP_URL_HOST ); - $this->assertNotEquals( false, $serverName ); - $serializedCookie = $cj->serializeToHttpRequest( $wgScriptPath, $serverName ); - $this->assertNotEquals( '', $serializedCookie ); - $this->assertRegexp( '/_session=[^;]*; .*UserID=[0-9]*; .*UserName=' . $user->userName . '; .*Token=/', $serializedCookie ); - - return $cj; - } - - public function testRunLogin() { - $sysopUser = self::$users['sysop']; - $data = $this->doApiRequest( array( - 'action' => 'login', - 'lgname' => $sysopUser->username, - 'lgpassword' => $sysopUser->password ) ); - - $this->assertArrayHasKey( "login", $data[0] ); - $this->assertArrayHasKey( "result", $data[0]['login'] ); - $this->assertEquals( "NeedToken", $data[0]['login']['result'] ); - $token = $data[0]['login']['token']; - - $data = $this->doApiRequest( array( - 'action' => 'login', - "lgtoken" => $token, - "lgname" => $sysopUser->username, - "lgpassword" => $sysopUser->password ), $data[2] ); - - $this->assertArrayHasKey( "login", $data[0] ); - $this->assertArrayHasKey( "result", $data[0]['login'] ); - $this->assertEquals( "Success", $data[0]['login']['result'] ); - $this->assertArrayHasKey( 'lgtoken', $data[0]['login'] ); - - return $data; - } - - public function testGettingToken() { - foreach ( self::$users as $user ) { - $this->runTokenTest( $user ); - } - } - - function runTokenTest( $user ) { - $tokens = $this->getTokenList( $user ); - - $rights = $user->user->getRights(); - - $this->assertArrayHasKey( 'edittoken', $tokens ); - $this->assertArrayHasKey( 'movetoken', $tokens ); - - if ( isset( $rights['delete'] ) ) { - $this->assertArrayHasKey( 'deletetoken', $tokens ); - } - - if ( isset( $rights['block'] ) ) { - $this->assertArrayHasKey( 'blocktoken', $tokens ); - $this->assertArrayHasKey( 'unblocktoken', $tokens ); - } - - if ( isset( $rights['protect'] ) ) { - $this->assertArrayHasKey( 'protecttoken', $tokens ); - } - - return $tokens; - } -} diff --git a/tests/phpunit/includes/api/ApiTestCase.php b/tests/phpunit/includes/api/ApiTestCase.php deleted file mode 100644 index 94ef9c68..00000000 --- a/tests/phpunit/includes/api/ApiTestCase.php +++ /dev/null @@ -1,253 +0,0 @@ - new TestUser( - 'Apitestsysop', - 'Api Test Sysop', - 'api_test_sysop@example.com', - array( 'sysop' ) - ), - 'uploader' => new TestUser( - 'Apitestuser', - 'Api Test User', - 'api_test_user@example.com', - array() - ) - ); - - $this->setMwGlobals( array( - 'wgMemc' => new EmptyBagOStuff(), - 'wgAuth' => new StubObject( 'wgAuth', 'AuthPlugin' ), - 'wgRequest' => new FauxRequest( array() ), - 'wgUser' => self::$users['sysop']->user, - ) ); - - $this->apiContext = new ApiTestContext(); - } - - /** - * Edits or creates a page/revision - * @param $pageName string page title - * @param $text string content of the page - * @param $summary string optional summary string for the revision - * @param $defaultNs int optional namespace id - * @return array as returned by WikiPage::doEditContent() - */ - protected function editPage( $pageName, $text, $summary = '', $defaultNs = NS_MAIN ) { - $title = Title::newFromText( $pageName, $defaultNs ); - $page = WikiPage::factory( $title ); - - return $page->doEditContent( ContentHandler::makeContent( $text, $title ), $summary ); - } - - /** - * Does the API request and returns the result. - * - * The returned value is an array containing - * - the result data (array) - * - the request (WebRequest) - * - the session data of the request (array) - * - if $appendModule is true, the Api module $module - * - * @param array $params - * @param array|null $session - * @param bool $appendModule - * @param User|null $user - * - * @return array - */ - protected function doApiRequest( array $params, array $session = null, $appendModule = false, User $user = null ) { - global $wgRequest, $wgUser; - - if ( is_null( $session ) ) { - // re-use existing global session by default - $session = $wgRequest->getSessionArray(); - } - - // set up global environment - if ( $user ) { - $wgUser = $user; - } - - $wgRequest = new FauxRequest( $params, true, $session ); - RequestContext::getMain()->setRequest( $wgRequest ); - - // set up local environment - $context = $this->apiContext->newTestContext( $wgRequest, $wgUser ); - - $module = new ApiMain( $context, true ); - - // run it! - $module->execute(); - - // construct result - $results = array( - $module->getResultData(), - $context->getRequest(), - $context->getRequest()->getSessionArray() - ); - - if ( $appendModule ) { - $results[] = $module; - } - - return $results; - } - - /** - * Add an edit token to the API request - * This is cheating a bit -- we grab a token in the correct format and then add it to the pseudo-session and to the - * request, without actually requesting a "real" edit token - * @param $params Array: key-value API params - * @param $session Array|null: session array - * @param $user User|null A User object for the context - * @return result of the API call - * @throws Exception in case wsToken is not set in the session - */ - protected function doApiRequestWithToken( array $params, array $session = null, User $user = null ) { - global $wgRequest; - - if ( $session === null ) { - $session = $wgRequest->getSessionArray(); - } - - if ( $session['wsToken'] ) { - // add edit token to fake session - $session['wsEditToken'] = $session['wsToken']; - // add token to request parameters - $params['token'] = md5( $session['wsToken'] ) . User::EDIT_TOKEN_SUFFIX; - - return $this->doApiRequest( $params, $session, false, $user ); - } else { - throw new Exception( "request data not in right format" ); - } - } - - protected function doLogin( $user = 'sysop' ) { - if ( !array_key_exists( $user, self::$users ) ) { - throw new MWException( "Can not log in to undefined user $user" ); - } - - $data = $this->doApiRequest( array( - 'action' => 'login', - 'lgname' => self::$users[ $user ]->username, - 'lgpassword' => self::$users[ $user ]->password ) ); - - $token = $data[0]['login']['token']; - - $data = $this->doApiRequest( - array( - 'action' => 'login', - 'lgtoken' => $token, - 'lgname' => self::$users[ $user ]->username, - 'lgpassword' => self::$users[ $user ]->password, - ), - $data[2] - ); - - return $data; - } - - protected function getTokenList( $user, $session = null ) { - $data = $this->doApiRequest( array( - 'action' => 'tokens', - 'type' => 'edit|delete|protect|move|block|unblock|watch' - ), $session, false, $user->user ); - - if ( !array_key_exists( 'tokens', $data[0] ) ) { - throw new MWException( 'Api failed to return a token list' ); - } - - return $data[0]['tokens']; - } - - public function testApiTestGroup() { - $groups = PHPUnit_Util_Test::getGroups( get_class( $this ) ); - $constraint = PHPUnit_Framework_Assert::logicalOr( - $this->contains( 'medium' ), - $this->contains( 'large' ) - ); - $this->assertThat( $groups, $constraint, - 'ApiTestCase::setUp can be slow, tests must be "medium" or "large"' - ); - } -} - -class UserWrapper { - public $userName; - public $password; - public $user; - - public function __construct( $userName, $password, $group = '' ) { - $this->userName = $userName; - $this->password = $password; - - $this->user = User::newFromName( $this->userName ); - if ( !$this->user->getID() ) { - $this->user = User::createNew( $this->userName, array( - "email" => "test@example.com", - "real_name" => "Test User" ) ); - } - $this->user->setPassword( $this->password ); - - if ( $group !== '' ) { - $this->user->addGroup( $group ); - } - $this->user->saveSettings(); - } -} - -class MockApi extends ApiBase { - public function execute() { - } - - public function getVersion() { - } - - public function __construct() { - } - - public function getAllowedParams() { - return array( - 'filename' => null, - 'enablechunks' => false, - 'sessionkey' => null, - ); - } -} - -class ApiTestContext extends RequestContext { - - /** - * Returns a DerivativeContext with the request variables in place - * - * @param $request WebRequest request object including parameters and session - * @param $user User or null - * @return DerivativeContext - */ - public function newTestContext( WebRequest $request, User $user = null ) { - $context = new DerivativeContext( $this ); - $context->setRequest( $request ); - if ( $user !== null ) { - $context->setUser( $user ); - } - - return $context; - } -} diff --git a/tests/phpunit/includes/api/ApiTestCaseUpload.php b/tests/phpunit/includes/api/ApiTestCaseUpload.php deleted file mode 100644 index 7e18b6ed..00000000 --- a/tests/phpunit/includes/api/ApiTestCaseUpload.php +++ /dev/null @@ -1,149 +0,0 @@ -setMwGlobals( array( - 'wgEnableUploads' => true, - 'wgEnableAPI' => true, - ) ); - - wfSetupSession(); - - $this->clearFakeUploads(); - } - - protected function tearDown() { - $this->clearTempUpload(); - - parent::tearDown(); - } - - /** - * Helper function -- remove files and associated articles by Title - * @param $title Title: title to be removed - */ - public function deleteFileByTitle( $title ) { - if ( $title->exists() ) { - $file = wfFindFile( $title, array( 'ignoreRedirect' => true ) ); - $noOldArchive = ""; // yes this really needs to be set this way - $comment = "removing for test"; - $restrictDeletedVersions = false; - $status = FileDeleteForm::doDelete( $title, $file, $noOldArchive, $comment, $restrictDeletedVersions ); - if ( !$status->isGood() ) { - return false; - } - $page = WikiPage::factory( $title ); - $page->doDeleteArticle( "removing for test" ); - - // see if it now doesn't exist; reload - $title = Title::newFromText( $title->getText(), NS_FILE ); - } - - return !( $title && $title instanceof Title && $title->exists() ); - } - - /** - * Helper function -- remove files and associated articles with a particular filename - * @param $fileName String: filename to be removed - */ - public function deleteFileByFileName( $fileName ) { - return $this->deleteFileByTitle( Title::newFromText( $fileName, NS_FILE ) ); - } - - /** - * Helper function -- given a file on the filesystem, find matching content in the db (and associated articles) and remove them. - * @param $filePath String: path to file on the filesystem - */ - public function deleteFileByContent( $filePath ) { - $hash = FSFile::getSha1Base36FromPath( $filePath ); - $dupes = RepoGroup::singleton()->findBySha1( $hash ); - $success = true; - foreach ( $dupes as $dupe ) { - $success &= $this->deleteFileByTitle( $dupe->getTitle() ); - } - - return $success; - } - - /** - * Fake an upload by dumping the file into temp space, and adding info to $_FILES. - * (This is what PHP would normally do). - * @param $fieldName String: name this would have in the upload form - * @param $fileName String: name to title this - * @param $type String: mime type - * @param $filePath String: path where to find file contents - */ - function fakeUploadFile( $fieldName, $fileName, $type, $filePath ) { - $tmpName = tempnam( wfTempDir(), "" ); - if ( !file_exists( $filePath ) ) { - throw new Exception( "$filePath doesn't exist!" ); - } - - if ( !copy( $filePath, $tmpName ) ) { - throw new Exception( "couldn't copy $filePath to $tmpName" ); - } - - clearstatcache(); - $size = filesize( $tmpName ); - if ( $size === false ) { - throw new Exception( "couldn't stat $tmpName" ); - } - - $_FILES[$fieldName] = array( - 'name' => $fileName, - 'type' => $type, - 'tmp_name' => $tmpName, - 'size' => $size, - 'error' => null - ); - - return true; - } - - function fakeUploadChunk( $fieldName, $fileName, $type, & $chunkData ) { - $tmpName = tempnam( wfTempDir(), "" ); - // copy the chunk data to temp location: - if ( !file_put_contents( $tmpName, $chunkData ) ) { - throw new Exception( "couldn't copy chunk data to $tmpName" ); - } - - clearstatcache(); - $size = filesize( $tmpName ); - if ( $size === false ) { - throw new Exception( "couldn't stat $tmpName" ); - } - - $_FILES[$fieldName] = array( - 'name' => $fileName, - 'type' => $type, - 'tmp_name' => $tmpName, - 'size' => $size, - 'error' => null - ); - } - - function clearTempUpload() { - if ( isset( $_FILES['file']['tmp_name'] ) ) { - $tmp = $_FILES['file']['tmp_name']; - if ( file_exists( $tmp ) ) { - unlink( $tmp ); - } - } - } - - /** - * Remove traces of previous fake uploads - */ - function clearFakeUploads() { - $_FILES = array(); - } -} diff --git a/tests/phpunit/includes/api/ApiUploadTest.php b/tests/phpunit/includes/api/ApiUploadTest.php deleted file mode 100644 index 1540af55..00000000 --- a/tests/phpunit/includes/api/ApiUploadTest.php +++ /dev/null @@ -1,561 +0,0 @@ - 'login', - 'lgname' => $user->username, - 'lgpassword' => $user->password - ); - list( $result, , $session ) = $this->doApiRequest( $params ); - $this->assertArrayHasKey( "login", $result ); - $this->assertArrayHasKey( "result", $result['login'] ); - $this->assertEquals( "NeedToken", $result['login']['result'] ); - $token = $result['login']['token']; - - $params = array( - 'action' => 'login', - 'lgtoken' => $token, - 'lgname' => $user->username, - 'lgpassword' => $user->password - ); - list( $result, , $session ) = $this->doApiRequest( $params, $session ); - $this->assertArrayHasKey( "login", $result ); - $this->assertArrayHasKey( "result", $result['login'] ); - $this->assertEquals( "Success", $result['login']['result'] ); - $this->assertArrayHasKey( 'lgtoken', $result['login'] ); - - $this->assertNotEmpty( $session, 'API Login must return a session' ); - - return $session; - } - - /** - * @depends testLogin - */ - public function testUploadRequiresToken( $session ) { - $exception = false; - try { - $this->doApiRequest( array( - 'action' => 'upload' - ) ); - } catch ( UsageException $e ) { - $exception = true; - $this->assertEquals( "The token parameter must be set", $e->getMessage() ); - } - $this->assertTrue( $exception, "Got exception" ); - } - - /** - * @depends testLogin - */ - public function testUploadMissingParams( $session ) { - $exception = false; - try { - $this->doApiRequestWithToken( array( - 'action' => 'upload', - ), $session, self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $exception = true; - $this->assertEquals( "One of the parameters filekey, file, url, statuskey is required", - $e->getMessage() ); - } - $this->assertTrue( $exception, "Got exception" ); - } - - - /** - * @depends testLogin - */ - public function testUpload( $session ) { - $extension = 'png'; - $mimeType = 'image/png'; - - try { - $randomImageGenerator = new RandomImageGenerator(); - $filePaths = $randomImageGenerator->writeImages( 1, $extension, wfTempDir() ); - } catch ( Exception $e ) { - $this->markTestIncomplete( $e->getMessage() ); - } - - $filePath = $filePaths[0]; - $fileSize = filesize( $filePath ); - $fileName = basename( $filePath ); - - $this->deleteFileByFileName( $fileName ); - $this->deleteFileByContent( $filePath ); - - if ( !$this->fakeUploadFile( 'file', $fileName, $mimeType, $filePath ) ) { - $this->markTestIncomplete( "Couldn't upload file!\n" ); - } - - $params = array( - 'action' => 'upload', - 'filename' => $fileName, - 'file' => 'dummy content', - 'comment' => 'dummy comment', - 'text' => "This is the page text for $fileName", - ); - - $exception = false; - try { - list( $result, , ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $exception = true; - } - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertEquals( 'Success', $result['upload']['result'] ); - $this->assertEquals( $fileSize, (int)$result['upload']['imageinfo']['size'] ); - $this->assertEquals( $mimeType, $result['upload']['imageinfo']['mime'] ); - $this->assertFalse( $exception ); - - // clean up - $this->deleteFileByFilename( $fileName ); - unlink( $filePath ); - } - - - /** - * @depends testLogin - */ - public function testUploadZeroLength( $session ) { - $mimeType = 'image/png'; - - $filePath = tempnam( wfTempDir(), "" ); - $fileName = "apiTestUploadZeroLength.png"; - - $this->deleteFileByFileName( $fileName ); - - if ( !$this->fakeUploadFile( 'file', $fileName, $mimeType, $filePath ) ) { - $this->markTestIncomplete( "Couldn't upload file!\n" ); - } - - $params = array( - 'action' => 'upload', - 'filename' => $fileName, - 'file' => 'dummy content', - 'comment' => 'dummy comment', - 'text' => "This is the page text for $fileName", - ); - - $exception = false; - try { - $this->doApiRequestWithToken( $params, $session, self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $this->assertContains( 'The file you submitted was empty', $e->getMessage() ); - $exception = true; - } - $this->assertTrue( $exception ); - - // clean up - $this->deleteFileByFilename( $fileName ); - unlink( $filePath ); - } - - - /** - * @depends testLogin - */ - public function testUploadSameFileName( $session ) { - $extension = 'png'; - $mimeType = 'image/png'; - - try { - $randomImageGenerator = new RandomImageGenerator(); - $filePaths = $randomImageGenerator->writeImages( 2, $extension, wfTempDir() ); - } catch ( Exception $e ) { - $this->markTestIncomplete( $e->getMessage() ); - } - - // we'll reuse this filename - $fileName = basename( $filePaths[0] ); - - // clear any other files with the same name - $this->deleteFileByFileName( $fileName ); - - // we reuse these params - $params = array( - 'action' => 'upload', - 'filename' => $fileName, - 'file' => 'dummy content', - 'comment' => 'dummy comment', - 'text' => "This is the page text for $fileName", - ); - - // first upload .... should succeed - - if ( !$this->fakeUploadFile( 'file', $fileName, $mimeType, $filePaths[0] ) ) { - $this->markTestIncomplete( "Couldn't upload file!\n" ); - } - - $exception = false; - try { - list( $result, , $session ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $exception = true; - } - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertEquals( 'Success', $result['upload']['result'] ); - $this->assertFalse( $exception ); - - // second upload with the same name (but different content) - - if ( !$this->fakeUploadFile( 'file', $fileName, $mimeType, $filePaths[1] ) ) { - $this->markTestIncomplete( "Couldn't upload file!\n" ); - } - - $exception = false; - try { - list( $result, , ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); // FIXME: leaks a temporary file - } catch ( UsageException $e ) { - $exception = true; - } - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertEquals( 'Warning', $result['upload']['result'] ); - $this->assertTrue( isset( $result['upload']['warnings'] ) ); - $this->assertTrue( isset( $result['upload']['warnings']['exists'] ) ); - $this->assertFalse( $exception ); - - // clean up - $this->deleteFileByFilename( $fileName ); - unlink( $filePaths[0] ); - unlink( $filePaths[1] ); - } - - - /** - * @depends testLogin - */ - public function testUploadSameContent( $session ) { - $extension = 'png'; - $mimeType = 'image/png'; - - try { - $randomImageGenerator = new RandomImageGenerator(); - $filePaths = $randomImageGenerator->writeImages( 1, $extension, wfTempDir() ); - } catch ( Exception $e ) { - $this->markTestIncomplete( $e->getMessage() ); - } - - $fileNames[0] = basename( $filePaths[0] ); - $fileNames[1] = "SameContentAs" . $fileNames[0]; - - // clear any other files with the same name or content - $this->deleteFileByContent( $filePaths[0] ); - $this->deleteFileByFileName( $fileNames[0] ); - $this->deleteFileByFileName( $fileNames[1] ); - - // first upload .... should succeed - - $params = array( - 'action' => 'upload', - 'filename' => $fileNames[0], - 'file' => 'dummy content', - 'comment' => 'dummy comment', - 'text' => "This is the page text for " . $fileNames[0], - ); - - if ( !$this->fakeUploadFile( 'file', $fileNames[0], $mimeType, $filePaths[0] ) ) { - $this->markTestIncomplete( "Couldn't upload file!\n" ); - } - - $exception = false; - try { - list( $result, , $session ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $exception = true; - } - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertEquals( 'Success', $result['upload']['result'] ); - $this->assertFalse( $exception ); - - // second upload with the same content (but different name) - - if ( !$this->fakeUploadFile( 'file', $fileNames[1], $mimeType, $filePaths[0] ) ) { - $this->markTestIncomplete( "Couldn't upload file!\n" ); - } - - $params = array( - 'action' => 'upload', - 'filename' => $fileNames[1], - 'file' => 'dummy content', - 'comment' => 'dummy comment', - 'text' => "This is the page text for " . $fileNames[1], - ); - - $exception = false; - try { - list( $result ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); // FIXME: leaks a temporary file - } catch ( UsageException $e ) { - $exception = true; - } - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertEquals( 'Warning', $result['upload']['result'] ); - $this->assertTrue( isset( $result['upload']['warnings'] ) ); - $this->assertTrue( isset( $result['upload']['warnings']['duplicate'] ) ); - $this->assertFalse( $exception ); - - // clean up - $this->deleteFileByFilename( $fileNames[0] ); - $this->deleteFileByFilename( $fileNames[1] ); - unlink( $filePaths[0] ); - } - - /** - * @depends testLogin - */ - public function testUploadStash( $session ) { - $this->setMwGlobals( array( - 'wgUser' => self::$users['uploader']->user, // @todo FIXME: still used somewhere - ) ); - - $extension = 'png'; - $mimeType = 'image/png'; - - try { - $randomImageGenerator = new RandomImageGenerator(); - $filePaths = $randomImageGenerator->writeImages( 1, $extension, wfTempDir() ); - } catch ( Exception $e ) { - $this->markTestIncomplete( $e->getMessage() ); - } - - $filePath = $filePaths[0]; - $fileSize = filesize( $filePath ); - $fileName = basename( $filePath ); - - $this->deleteFileByFileName( $fileName ); - $this->deleteFileByContent( $filePath ); - - if ( !$this->fakeUploadFile( 'file', $fileName, $mimeType, $filePath ) ) { - $this->markTestIncomplete( "Couldn't upload file!\n" ); - } - - $params = array( - 'action' => 'upload', - 'stash' => 1, - 'filename' => $fileName, - 'file' => 'dummy content', - 'comment' => 'dummy comment', - 'text' => "This is the page text for $fileName", - ); - - $exception = false; - try { - list( $result, , $session ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); // FIXME: leaks a temporary file - } catch ( UsageException $e ) { - $exception = true; - } - $this->assertFalse( $exception ); - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertEquals( 'Success', $result['upload']['result'] ); - $this->assertEquals( $fileSize, (int)$result['upload']['imageinfo']['size'] ); - $this->assertEquals( $mimeType, $result['upload']['imageinfo']['mime'] ); - $this->assertTrue( isset( $result['upload']['filekey'] ) ); - $this->assertEquals( $result['upload']['sessionkey'], $result['upload']['filekey'] ); - $filekey = $result['upload']['filekey']; - - // it should be visible from Special:UploadStash - // XXX ...but how to test this, with a fake WebRequest with the session? - - // now we should try to release the file from stash - $params = array( - 'action' => 'upload', - 'filekey' => $filekey, - 'filename' => $fileName, - 'comment' => 'dummy comment', - 'text' => "This is the page text for $fileName, altered", - ); - - $this->clearFakeUploads(); - $exception = false; - try { - list( $result ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $exception = true; - } - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertEquals( 'Success', $result['upload']['result'] ); - $this->assertFalse( $exception, "No UsageException exception." ); - - // clean up - $this->deleteFileByFilename( $fileName ); - unlink( $filePath ); - } - - /** - * @depends testLogin - */ - public function testUploadChunks( $session ) { - $this->setMwGlobals( array( - 'wgUser' => self::$users['uploader']->user, // @todo FIXME: still used somewhere - ) ); - - $chunkSize = 1048576; - // Download a large image file - // ( using RandomImageGenerator for large files is not stable ) - $mimeType = 'image/jpeg'; - $url = 'http://upload.wikimedia.org/wikipedia/commons/e/ed/Oberaargletscher_from_Oberaar%2C_2010_07.JPG'; - $filePath = wfTempDir() . '/Oberaargletscher_from_Oberaar.jpg'; - try { - // Only download if the file is not avaliable in the temp location: - if ( !is_file( $filePath ) ) { - copy( $url, $filePath ); - } - } catch ( Exception $e ) { - $this->markTestIncomplete( $e->getMessage() ); - } - - $fileSize = filesize( $filePath ); - $fileName = basename( $filePath ); - - $this->deleteFileByFileName( $fileName ); - $this->deleteFileByContent( $filePath ); - - // Base upload params: - $params = array( - 'action' => 'upload', - 'stash' => 1, - 'filename' => $fileName, - 'filesize' => $fileSize, - 'offset' => 0, - ); - - // Upload chunks - $chunkSessionKey = false; - $resultOffset = 0; - // Open the file: - $handle = @fopen( $filePath, "r" ); - if ( $handle === false ) { - $this->markTestIncomplete( "could not open file: $filePath" ); - } - while ( !feof( $handle ) ) { - // Get the current chunk - $chunkData = @fread( $handle, $chunkSize ); - - // Upload the current chunk into the $_FILE object: - $this->fakeUploadChunk( 'chunk', 'blob', $mimeType, $chunkData ); - - // Check for chunkSessionKey - if ( !$chunkSessionKey ) { - // Upload fist chunk ( and get the session key ) - try { - list( $result, , $session ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $this->markTestIncomplete( $e->getMessage() ); - } - // Make sure we got a valid chunk continue: - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertTrue( isset( $result['upload']['filekey'] ) ); - // If we don't get a session key mark test incomplete. - if ( !isset( $result['upload']['filekey'] ) ) { - $this->markTestIncomplete( "no filekey provided" ); - } - $chunkSessionKey = $result['upload']['filekey']; - $this->assertEquals( 'Continue', $result['upload']['result'] ); - // First chunk should have chunkSize == offset - $this->assertEquals( $chunkSize, $result['upload']['offset'] ); - $resultOffset = $result['upload']['offset']; - continue; - } - // Filekey set to chunk session - $params['filekey'] = $chunkSessionKey; - // Update the offset ( always add chunkSize for subquent chunks should be in-sync with $result['upload']['offset'] ) - $params['offset'] += $chunkSize; - // Make sure param offset is insync with resultOffset: - $this->assertEquals( $resultOffset, $params['offset'] ); - // Upload current chunk - try { - list( $result, , $session ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $this->markTestIncomplete( $e->getMessage() ); - } - // Make sure we got a valid chunk continue: - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertTrue( isset( $result['upload']['filekey'] ) ); - - // Check if we were on the last chunk: - if ( $params['offset'] + $chunkSize >= $fileSize ) { - $this->assertEquals( 'Success', $result['upload']['result'] ); - break; - } else { - $this->assertEquals( 'Continue', $result['upload']['result'] ); - // update $resultOffset - $resultOffset = $result['upload']['offset']; - } - } - fclose( $handle ); - - // Check that we got a valid file result: - wfDebug( __METHOD__ . " hohoh filesize {$fileSize} info {$result['upload']['imageinfo']['size']}\n\n" ); - $this->assertEquals( $fileSize, $result['upload']['imageinfo']['size'] ); - $this->assertEquals( $mimeType, $result['upload']['imageinfo']['mime'] ); - $this->assertTrue( isset( $result['upload']['filekey'] ) ); - $filekey = $result['upload']['filekey']; - - // Now we should try to release the file from stash - $params = array( - 'action' => 'upload', - 'filekey' => $filekey, - 'filename' => $fileName, - 'comment' => 'dummy comment', - 'text' => "This is the page text for $fileName, altered", - ); - $this->clearFakeUploads(); - $exception = false; - try { - list( $result ) = $this->doApiRequestWithToken( $params, $session, - self::$users['uploader']->user ); - } catch ( UsageException $e ) { - $exception = true; - } - $this->assertTrue( isset( $result['upload'] ) ); - $this->assertEquals( 'Success', $result['upload']['result'] ); - $this->assertFalse( $exception ); - - // clean up - $this->deleteFileByFilename( $fileName ); - // don't remove downloaded temporary file for fast subquent tests. - //unlink( $filePath ); - } -} diff --git a/tests/phpunit/includes/api/ApiWatchTest.php b/tests/phpunit/includes/api/ApiWatchTest.php deleted file mode 100644 index 028ea9ff..00000000 --- a/tests/phpunit/includes/api/ApiWatchTest.php +++ /dev/null @@ -1,148 +0,0 @@ -doLogin(); - } - - function getTokens() { - return $this->getTokenList( self::$users['sysop'] ); - } - - /** - */ - public function testWatchEdit() { - $tokens = $this->getTokens(); - - $data = $this->doApiRequest( array( - 'action' => 'edit', - 'title' => 'Help:UTPage', // Help namespace is hopefully wikitext - 'text' => 'new text', - 'token' => $tokens['edittoken'], - 'watchlist' => 'watch' ) ); - $this->assertArrayHasKey( 'edit', $data[0] ); - $this->assertArrayHasKey( 'result', $data[0]['edit'] ); - $this->assertEquals( 'Success', $data[0]['edit']['result'] ); - - return $data; - } - - /** - * @depends testWatchEdit - */ - public function testWatchClear() { - $tokens = $this->getTokens(); - - $data = $this->doApiRequest( array( - 'action' => 'query', - 'list' => 'watchlist' ) ); - - if ( isset( $data[0]['query']['watchlist'] ) ) { - $wl = $data[0]['query']['watchlist']; - - foreach ( $wl as $page ) { - $data = $this->doApiRequest( array( - 'action' => 'watch', - 'title' => $page['title'], - 'unwatch' => true, - 'token' => $tokens['watchtoken'] ) ); - } - } - $data = $this->doApiRequest( array( - 'action' => 'query', - 'list' => 'watchlist' ), $data ); - $this->assertArrayHasKey( 'query', $data[0] ); - $this->assertArrayHasKey( 'watchlist', $data[0]['query'] ); - $this->assertEquals( 0, count( $data[0]['query']['watchlist'] ) ); - - return $data; - } - - /** - */ - public function testWatchProtect() { - $tokens = $this->getTokens(); - - $data = $this->doApiRequest( array( - 'action' => 'protect', - 'token' => $tokens['protecttoken'], - 'title' => 'Help:UTPage', - 'protections' => 'edit=sysop', - 'watchlist' => 'unwatch' ) ); - - $this->assertArrayHasKey( 'protect', $data[0] ); - $this->assertArrayHasKey( 'protections', $data[0]['protect'] ); - $this->assertEquals( 1, count( $data[0]['protect']['protections'] ) ); - $this->assertArrayHasKey( 'edit', $data[0]['protect']['protections'][0] ); - } - - /** - */ - public function testGetRollbackToken() { - $this->getTokens(); - - if ( !Title::newFromText( 'Help:UTPage' )->exists() ) { - $this->markTestSkipped( "The article [[Help:UTPage]] does not exist" ); //TODO: just create it? - } - - $data = $this->doApiRequest( array( - 'action' => 'query', - 'prop' => 'revisions', - 'titles' => 'Help:UTPage', - 'rvtoken' => 'rollback' ) ); - - $this->assertArrayHasKey( 'query', $data[0] ); - $this->assertArrayHasKey( 'pages', $data[0]['query'] ); - $keys = array_keys( $data[0]['query']['pages'] ); - $key = array_pop( $keys ); - - if ( isset( $data[0]['query']['pages'][$key]['missing'] ) ) { - $this->markTestSkipped( "Target page (Help:UTPage) doesn't exist" ); - } - - $this->assertArrayHasKey( 'pageid', $data[0]['query']['pages'][$key] ); - $this->assertArrayHasKey( 'revisions', $data[0]['query']['pages'][$key] ); - $this->assertArrayHasKey( 0, $data[0]['query']['pages'][$key]['revisions'] ); - $this->assertArrayHasKey( 'rollbacktoken', $data[0]['query']['pages'][$key]['revisions'][0] ); - - return $data; - } - - /** - * @group Broken - * Broken because there is currently no revision info in the $pageinfo - * - * @depends testGetRollbackToken - */ - public function testWatchRollback( $data ) { - $keys = array_keys( $data[0]['query']['pages'] ); - $key = array_pop( $keys ); - $pageinfo = $data[0]['query']['pages'][$key]; - $revinfo = $pageinfo['revisions'][0]; - - try { - $data = $this->doApiRequest( array( - 'action' => 'rollback', - 'title' => 'Help:UTPage', - 'user' => $revinfo['user'], - 'token' => $pageinfo['rollbacktoken'], - 'watchlist' => 'watch' ) ); - - $this->assertArrayHasKey( 'rollback', $data[0] ); - $this->assertArrayHasKey( 'title', $data[0]['rollback'] ); - } catch ( UsageException $ue ) { - if ( $ue->getCodeString() == 'onlyauthor' ) { - $this->markTestIncomplete( "Only one author to 'Help:UTPage', cannot test rollback" ); - } else { - $this->fail( "Received error '" . $ue->getCodeString() . "'" ); - } - } - } -} diff --git a/tests/phpunit/includes/api/PrefixUniquenessTest.php b/tests/phpunit/includes/api/PrefixUniquenessTest.php deleted file mode 100644 index d9be85e3..00000000 --- a/tests/phpunit/includes/api/PrefixUniquenessTest.php +++ /dev/null @@ -1,25 +0,0 @@ -getModuleManager()->getNamesWithClasses(); - $prefixes = array(); - - foreach ( $modules as $name => $class ) { - $module = new $class( $main, $name ); - $prefix = $module->getModulePrefix(); - if ( isset( $prefixes[$prefix] ) ) { - $this->fail( "Module prefix '{$prefix}' is shared between {$class} and {$prefixes[$prefix]}" ); - } - $prefixes[$module->getModulePrefix()] = $class; - } - $this->assertTrue( true ); // dummy call to make this test non-incomplete - } -} diff --git a/tests/phpunit/includes/api/RandomImageGenerator.php b/tests/phpunit/includes/api/RandomImageGenerator.php deleted file mode 100644 index 59756b21..00000000 --- a/tests/phpunit/includes/api/RandomImageGenerator.php +++ /dev/null @@ -1,468 +0,0 @@ - - */ - -/** - * RandomImageGenerator: does what it says on the tin. - * Can fetch a random image, or also write a number of them to disk with random filenames. - */ -class RandomImageGenerator { - - private $dictionaryFile; - private $minWidth = 400; - private $maxWidth = 800; - private $minHeight = 400; - private $maxHeight = 800; - private $shapesToDraw = 5; - - /** - * Orientations: 0th row, 0th column, Exif orientation code, rotation 2x2 matrix that is opposite of orientation - * n.b. we do not handle the 'flipped' orientations, which is why there is no entry for 2, 4, 5, or 7. Those - * seem to be rare in real images anyway - * (we also would need a non-symmetric shape for the images to test those, like a letter F) - */ - private static $orientations = array( - array( - '0thRow' => 'top', - '0thCol' => 'left', - 'exifCode' => 1, - 'counterRotation' => array( array( 1, 0 ), array( 0, 1 ) ) - ), - array( - '0thRow' => 'bottom', - '0thCol' => 'right', - 'exifCode' => 3, - 'counterRotation' => array( array( -1, 0 ), array( 0, -1 ) ) - ), - array( - '0thRow' => 'right', - '0thCol' => 'top', - 'exifCode' => 6, - 'counterRotation' => array( array( 0, 1 ), array( 1, 0 ) ) - ), - array( - '0thRow' => 'left', - '0thCol' => 'bottom', - 'exifCode' => 8, - 'counterRotation' => array( array( 0, -1 ), array( -1, 0 ) ) - ) - ); - - - public function __construct( $options = array() ) { - foreach ( array( 'dictionaryFile', 'minWidth', 'minHeight', 'maxWidth', 'maxHeight', 'shapesToDraw' ) as $property ) { - if ( isset( $options[$property] ) ) { - $this->$property = $options[$property]; - } - } - - // find the dictionary file, to generate random names - if ( !isset( $this->dictionaryFile ) ) { - foreach ( - array( - '/usr/share/dict/words', - '/usr/dict/words', - __DIR__ . '/words.txt' - ) as $dictionaryFile - ) { - if ( is_file( $dictionaryFile ) and is_readable( $dictionaryFile ) ) { - $this->dictionaryFile = $dictionaryFile; - break; - } - } - } - if ( !isset( $this->dictionaryFile ) ) { - throw new Exception( "RandomImageGenerator: dictionary file not found or not specified properly" ); - } - } - - /** - * Writes random images with random filenames to disk in the directory you specify, or current working directory - * - * @param $number Integer: number of filenames to write - * @param $format String: optional, must be understood by ImageMagick, such as 'jpg' or 'gif' - * @param $dir String: directory, optional (will default to current working directory) - * @return Array: filenames we just wrote - */ - function writeImages( $number, $format = 'jpg', $dir = null ) { - $filenames = $this->getRandomFilenames( $number, $format, $dir ); - $imageWriteMethod = $this->getImageWriteMethod( $format ); - foreach ( $filenames as $filename ) { - $this->{$imageWriteMethod}( $this->getImageSpec(), $format, $filename ); - } - - return $filenames; - } - - - /** - * Figure out how we write images. This is a factor of both format and the local system - * @param $format (a typical extension like 'svg', 'jpg', etc.) - */ - function getImageWriteMethod( $format ) { - global $wgUseImageMagick, $wgImageMagickConvertCommand; - if ( $format === 'svg' ) { - return 'writeSvg'; - } else { - // figure out how to write images - global $wgExiv2Command; - if ( class_exists( 'Imagick' ) && $wgExiv2Command && is_executable( $wgExiv2Command ) ) { - return 'writeImageWithApi'; - } elseif ( $wgUseImageMagick && $wgImageMagickConvertCommand && is_executable( $wgImageMagickConvertCommand ) ) { - return 'writeImageWithCommandLine'; - } - } - throw new Exception( "RandomImageGenerator: could not find a suitable method to write images in '$format' format" ); - } - - /** - * Return a number of randomly-generated filenames - * Each filename uses two words randomly drawn from the dictionary, like elephantine_spatula.jpg - * - * @param $number Integer: of filenames to generate - * @param $extension String: optional, defaults to 'jpg' - * @param $dir String: optional, defaults to current working directory - * @return Array: of filenames - */ - private function getRandomFilenames( $number, $extension = 'jpg', $dir = null ) { - if ( is_null( $dir ) ) { - $dir = getcwd(); - } - $filenames = array(); - foreach ( $this->getRandomWordPairs( $number ) as $pair ) { - $basename = $pair[0] . '_' . $pair[1]; - if ( !is_null( $extension ) ) { - $basename .= '.' . $extension; - } - $basename = preg_replace( '/\s+/', '', $basename ); - $filenames[] = "$dir/$basename"; - } - - return $filenames; - } - - - /** - * Generate data representing an image of random size (within limits), - * consisting of randomly colored and sized upward pointing triangles against a random background color - * (This data is used in the writeImage* methods). - * @return {Mixed} - */ - public function getImageSpec() { - $spec = array(); - - $spec['width'] = mt_rand( $this->minWidth, $this->maxWidth ); - $spec['height'] = mt_rand( $this->minHeight, $this->maxHeight ); - $spec['fill'] = $this->getRandomColor(); - - $diagonalLength = sqrt( pow( $spec['width'], 2 ) + pow( $spec['height'], 2 ) ); - - $draws = array(); - for ( $i = 0; $i <= $this->shapesToDraw; $i++ ) { - $radius = mt_rand( 0, $diagonalLength / 4 ); - if ( $radius == 0 ) { - continue; - } - $originX = mt_rand( -1 * $radius, $spec['width'] + $radius ); - $originY = mt_rand( -1 * $radius, $spec['height'] + $radius ); - $angle = mt_rand( 0, ( 3.141592 / 2 ) * $radius ) / $radius; - $legDeltaX = round( $radius * sin( $angle ) ); - $legDeltaY = round( $radius * cos( $angle ) ); - - $draw = array(); - $draw['fill'] = $this->getRandomColor(); - $draw['shape'] = array( - array( 'x' => $originX, 'y' => $originY - $radius ), - array( 'x' => $originX + $legDeltaX, 'y' => $originY + $legDeltaY ), - array( 'x' => $originX - $legDeltaX, 'y' => $originY + $legDeltaY ), - array( 'x' => $originX, 'y' => $originY - $radius ) - ); - $draws[] = $draw; - } - - $spec['draws'] = $draws; - - return $spec; - } - - /** - * Given array( array('x' => 10, 'y' => 20), array( 'x' => 30, y=> 5 ) ) - * returns "10,20 30,5" - * Useful for SVG and imagemagick command line arguments - * @param $shape: Array of arrays, each array containing x & y keys mapped to numeric values - * @return string - */ - static function shapePointsToString( $shape ) { - $points = array(); - foreach ( $shape as $point ) { - $points[] = $point['x'] . ',' . $point['y']; - } - - return join( " ", $points ); - } - - /** - * Based on image specification, write a very simple SVG file to disk. - * Ignores the background spec because transparency is cool. :) - * @param $spec: spec describing background and shapes to draw - * @param $format: file format to write (which is obviously always svg here) - * @param $filename: filename to write to - */ - public function writeSvg( $spec, $format, $filename ) { - $svg = new SimpleXmlElement( '' ); - $svg->addAttribute( 'xmlns', 'http://www.w3.org/2000/svg' ); - $svg->addAttribute( 'version', '1.1' ); - $svg->addAttribute( 'width', $spec['width'] ); - $svg->addAttribute( 'height', $spec['height'] ); - $g = $svg->addChild( 'g' ); - foreach ( $spec['draws'] as $drawSpec ) { - $shape = $g->addChild( 'polygon' ); - $shape->addAttribute( 'fill', $drawSpec['fill'] ); - $shape->addAttribute( 'points', self::shapePointsToString( $drawSpec['shape'] ) ); - } - - if ( !$fh = fopen( $filename, 'w' ) ) { - throw new Exception( "couldn't open $filename for writing" ); - } - fwrite( $fh, $svg->asXML() ); - if ( !fclose( $fh ) ) { - throw new Exception( "couldn't close $filename" ); - } - } - - /** - * Based on an image specification, write such an image to disk, using Imagick PHP extension - * @param $spec: spec describing background and circles to draw - * @param $format: file format to write - * @param $filename: filename to write to - */ - public function writeImageWithApi( $spec, $format, $filename ) { - // this is a hack because I can't get setImageOrientation() to work. See below. - global $wgExiv2Command; - - $image = new Imagick(); - /** - * If the format is 'jpg', will also add a random orientation -- the image will be drawn rotated with triangle points - * facing in some direction (0, 90, 180 or 270 degrees) and a countering rotation should turn the triangle points upward again - */ - $orientation = self::$orientations[0]; // default is normal orientation - if ( $format == 'jpg' ) { - $orientation = self::$orientations[array_rand( self::$orientations )]; - $spec = self::rotateImageSpec( $spec, $orientation['counterRotation'] ); - } - - $image->newImage( $spec['width'], $spec['height'], new ImagickPixel( $spec['fill'] ) ); - - foreach ( $spec['draws'] as $drawSpec ) { - $draw = new ImagickDraw(); - $draw->setFillColor( $drawSpec['fill'] ); - $draw->polygon( $drawSpec['shape'] ); - $image->drawImage( $draw ); - } - - $image->setImageFormat( $format ); - - // this doesn't work, even though it's documented to do so... - // $image->setImageOrientation( $orientation['exifCode'] ); - - $image->writeImage( $filename ); - - // because the above setImageOrientation call doesn't work... nor can I get an external imagemagick binary to do this either... - // hacking this for now (only works if you have exiv2 installed, a program to read and manipulate exif) - if ( $wgExiv2Command ) { - $cmd = wfEscapeShellArg( $wgExiv2Command ) - . " -M " - . wfEscapeShellArg( "set Exif.Image.Orientation " . $orientation['exifCode'] ) - . " " - . wfEscapeShellArg( $filename ); - - $retval = 0; - $err = wfShellExec( $cmd, $retval ); - if ( $retval !== 0 ) { - print "Error with $cmd: $retval, $err\n"; - } - } - } - - /** - * Given an image specification, produce rotated version - * This is used when simulating a rotated image capture with Exif orientation - * @param $spec Object returned by getImageSpec - * @param $matrix 2x2 transformation matrix - * @return transformed Spec - */ - private static function rotateImageSpec( &$spec, $matrix ) { - $tSpec = array(); - $dims = self::matrixMultiply2x2( $matrix, $spec['width'], $spec['height'] ); - $correctionX = 0; - $correctionY = 0; - if ( $dims['x'] < 0 ) { - $correctionX = abs( $dims['x'] ); - } - if ( $dims['y'] < 0 ) { - $correctionY = abs( $dims['y'] ); - } - $tSpec['width'] = abs( $dims['x'] ); - $tSpec['height'] = abs( $dims['y'] ); - $tSpec['fill'] = $spec['fill']; - $tSpec['draws'] = array(); - foreach ( $spec['draws'] as $draw ) { - $tDraw = array( - 'fill' => $draw['fill'], - 'shape' => array() - ); - foreach ( $draw['shape'] as $point ) { - $tPoint = self::matrixMultiply2x2( $matrix, $point['x'], $point['y'] ); - $tPoint['x'] += $correctionX; - $tPoint['y'] += $correctionY; - $tDraw['shape'][] = $tPoint; - } - $tSpec['draws'][] = $tDraw; - } - - return $tSpec; - } - - /** - * Given a matrix and a pair of images, return new position - * @param $matrix: 2x2 rotation matrix - * @param $x: x-coordinate number - * @param $y: y-coordinate number - * @return Array transformed with properties x, y - */ - private static function matrixMultiply2x2( $matrix, $x, $y ) { - return array( - 'x' => $x * $matrix[0][0] + $y * $matrix[0][1], - 'y' => $x * $matrix[1][0] + $y * $matrix[1][1] - ); - } - - - /** - * Based on an image specification, write such an image to disk, using the command line ImageMagick program ('convert'). - * - * Sample command line: - * $ convert -size 100x60 xc:rgb(90,87,45) \ - * -draw 'fill rgb(12,34,56) polygon 41,39 44,57 50,57 41,39' \ - * -draw 'fill rgb(99,123,231) circle 59,39 56,57' \ - * -draw 'fill rgb(240,12,32) circle 50,21 50,3' filename.png - * - * @param $spec: spec describing background and shapes to draw - * @param $format: file format to write (unused by this method but kept so it has the same signature as writeImageWithApi) - * @param $filename: filename to write to - */ - public function writeImageWithCommandLine( $spec, $format, $filename ) { - global $wgImageMagickConvertCommand; - $args = array(); - $args[] = "-size " . wfEscapeShellArg( $spec['width'] . 'x' . $spec['height'] ); - $args[] = wfEscapeShellArg( "xc:" . $spec['fill'] ); - foreach ( $spec['draws'] as $draw ) { - $fill = $draw['fill']; - $polygon = self::shapePointsToString( $draw['shape'] ); - $drawCommand = "fill $fill polygon $polygon"; - $args[] = '-draw ' . wfEscapeShellArg( $drawCommand ); - } - $args[] = wfEscapeShellArg( $filename ); - - $command = wfEscapeShellArg( $wgImageMagickConvertCommand ) . " " . implode( " ", $args ); - $retval = null; - wfShellExec( $command, $retval ); - - return ( $retval === 0 ); - } - - /** - * Generate a string of random colors for ImageMagick or SVG, like "rgb(12, 37, 98)" - * - * @return {String} - */ - public function getRandomColor() { - $components = array(); - for ( $i = 0; $i <= 2; $i++ ) { - $components[] = mt_rand( 0, 255 ); - } - - return 'rgb(' . join( ', ', $components ) . ')'; - } - - /** - * Get an array of random pairs of random words, like array( array( 'foo', 'bar' ), array( 'quux', 'baz' ) ); - * - * @param $number Integer: number of pairs - * @return Array: of two-element arrays - */ - private function getRandomWordPairs( $number ) { - $lines = $this->getRandomLines( $number * 2 ); - // construct pairs of words - $pairs = array(); - $count = count( $lines ); - for ( $i = 0; $i < $count; $i += 2 ) { - $pairs[] = array( $lines[$i], $lines[$i + 1] ); - } - - return $pairs; - } - - /** - * Return N random lines from a file - * - * Will throw exception if the file could not be read or if it had fewer lines than requested. - * - * @param $number_desired Integer: number of lines desired - * @return Array: of exactly n elements, drawn randomly from lines the file - */ - private function getRandomLines( $number_desired ) { - $filepath = $this->dictionaryFile; - - // initialize array of lines - $lines = array(); - for ( $i = 0; $i < $number_desired; $i++ ) { - $lines[] = null; - } - - /* - * This algorithm obtains N random lines from a file in one single pass. It does this by replacing elements of - * a fixed-size array of lines, less and less frequently as it reads the file. - */ - $fh = fopen( $filepath, "r" ); - if ( !$fh ) { - throw new Exception( "couldn't open $filepath" ); - } - $line_number = 0; - $max_index = $number_desired - 1; - while ( !feof( $fh ) ) { - $line = fgets( $fh ); - if ( $line !== false ) { - $line_number++; - $line = trim( $line ); - if ( mt_rand( 0, $line_number ) <= $max_index ) { - $lines[mt_rand( 0, $max_index )] = $line; - } - } - } - fclose( $fh ); - if ( $line_number < $number_desired ) { - throw new Exception( "not enough lines in $filepath" ); - } - - return $lines; - } -} diff --git a/tests/phpunit/includes/api/format/ApiFormatPhpTest.php b/tests/phpunit/includes/api/format/ApiFormatPhpTest.php deleted file mode 100644 index a0bbb2dc..00000000 --- a/tests/phpunit/includes/api/format/ApiFormatPhpTest.php +++ /dev/null @@ -1,17 +0,0 @@ -apiRequest( 'php', array( 'action' => 'query', 'meta' => 'siteinfo' ) ); - - $this->assertInternalType( 'array', unserialize( $data ) ); - $this->assertGreaterThan( 0, count( (array)$data ) ); - } -} diff --git a/tests/phpunit/includes/api/format/ApiFormatTestBase.php b/tests/phpunit/includes/api/format/ApiFormatTestBase.php deleted file mode 100644 index 153f2cf4..00000000 --- a/tests/phpunit/includes/api/format/ApiFormatTestBase.php +++ /dev/null @@ -1,22 +0,0 @@ -createPrinterByName( $format ); - $printer->setUnescapeAmps( false ); - - $printer->initPrinter( false ); - - ob_start(); - $printer->execute(); - $out = ob_get_clean(); - - $printer->closePrinter(); - - return $out; - } -} diff --git a/tests/phpunit/includes/api/generateRandomImages.php b/tests/phpunit/includes/api/generateRandomImages.php deleted file mode 100644 index 87f5c4c0..00000000 --- a/tests/phpunit/includes/api/generateRandomImages.php +++ /dev/null @@ -1,46 +0,0 @@ -writeImages( $number, $format ); - } -} - -$maintClass = 'GenerateRandomImages'; -require RUN_MAINTENANCE_IF_MAIN; diff --git a/tests/phpunit/includes/api/query/ApiQueryBasicTest.php b/tests/phpunit/includes/api/query/ApiQueryBasicTest.php deleted file mode 100644 index 1a2aa832..00000000 --- a/tests/phpunit/includes/api/query/ApiQueryBasicTest.php +++ /dev/null @@ -1,395 +0,0 @@ -@gmail.com" - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @file - */ - -require_once 'ApiQueryTestBase.php'; - -/** These tests validate basic functionality of the api query module - * - * @group API - * @group Database - * @group medium - */ -class ApiQueryBasicTest extends ApiQueryTestBase { - /** - * Create a set of pages. These must not change, otherwise the tests might give wrong results. - * @see MediaWikiTestCase::addDBData() - */ - function addDBData() { - try { - if ( Title::newFromText( 'AQBT-All' )->exists() ) { - return; - } - - // Ordering is important, as it will be returned in the same order as stored in the index - $this->editPage( 'AQBT-All', '[[Category:AQBT-Cat]] [[AQBT-Links]] {{AQBT-T}}' ); - $this->editPage( 'AQBT-Categories', '[[Category:AQBT-Cat]]' ); - $this->editPage( 'AQBT-Links', '[[AQBT-All]] [[AQBT-Categories]] [[AQBT-Templates]]' ); - $this->editPage( 'AQBT-Templates', '{{AQBT-T}}' ); - $this->editPage( 'AQBT-T', 'Content', '', NS_TEMPLATE ); - - // Refresh due to the bug with listing transclusions as links if they don't exist - $this->editPage( 'AQBT-All', '[[Category:AQBT-Cat]] [[AQBT-Links]] {{AQBT-T}}' ); - $this->editPage( 'AQBT-Templates', '{{AQBT-T}}' ); - } catch ( Exception $e ) { - $this->exceptionFromAddDBData = $e; - } - } - - private static $links = array( - array( 'prop' => 'links', 'titles' => 'AQBT-All' ), - array( 'pages' => array( - '1' => array( - 'pageid' => 1, - 'ns' => 0, - 'title' => 'AQBT-All', - 'links' => array( - array( 'ns' => 0, 'title' => 'AQBT-Links' ), - ) - ) - ) ) - ); - - private static $templates = array( - array( 'prop' => 'templates', 'titles' => 'AQBT-All' ), - array( 'pages' => array( - '1' => array( - 'pageid' => 1, - 'ns' => 0, - 'title' => 'AQBT-All', - 'templates' => array( - array( 'ns' => 10, 'title' => 'Template:AQBT-T' ), - ) - ) - ) ) - ); - - private static $categories = array( - array( 'prop' => 'categories', 'titles' => 'AQBT-All' ), - array( 'pages' => array( - '1' => array( - 'pageid' => 1, - 'ns' => 0, - 'title' => 'AQBT-All', - 'categories' => array( - array( 'ns' => 14, 'title' => 'Category:AQBT-Cat' ), - ) - ) - ) ) - ); - - private static $allpages = array( - array( 'list' => 'allpages', 'apprefix' => 'AQBT-' ), - array( 'allpages' => array( - array( 'pageid' => 1, 'ns' => 0, 'title' => 'AQBT-All' ), - array( 'pageid' => 2, 'ns' => 0, 'title' => 'AQBT-Categories' ), - array( 'pageid' => 3, 'ns' => 0, 'title' => 'AQBT-Links' ), - array( 'pageid' => 4, 'ns' => 0, 'title' => 'AQBT-Templates' ), - ) ) - ); - - private static $alllinks = array( - array( 'list' => 'alllinks', 'alprefix' => 'AQBT-' ), - array( 'alllinks' => array( - array( 'ns' => 0, 'title' => 'AQBT-All' ), - array( 'ns' => 0, 'title' => 'AQBT-Categories' ), - array( 'ns' => 0, 'title' => 'AQBT-Links' ), - array( 'ns' => 0, 'title' => 'AQBT-Templates' ), - ) ) - ); - - private static $alltransclusions = array( - array( 'list' => 'alltransclusions', 'atprefix' => 'AQBT-' ), - array( 'alltransclusions' => array( - array( 'ns' => 10, 'title' => 'Template:AQBT-T' ), - array( 'ns' => 10, 'title' => 'Template:AQBT-T' ), - ) ) - ); - - private static $allcategories = array( - array( 'list' => 'allcategories', 'acprefix' => 'AQBT-' ), - array( 'allcategories' => array( - array( '*' => 'AQBT-Cat' ), - ) ) - ); - - private static $backlinks = array( - array( 'list' => 'backlinks', 'bltitle' => 'AQBT-Links' ), - array( 'backlinks' => array( - array( 'pageid' => 1, 'ns' => 0, 'title' => 'AQBT-All' ), - ) ) - ); - - private static $embeddedin = array( - array( 'list' => 'embeddedin', 'eititle' => 'Template:AQBT-T' ), - array( 'embeddedin' => array( - array( 'pageid' => 1, 'ns' => 0, 'title' => 'AQBT-All' ), - array( 'pageid' => 4, 'ns' => 0, 'title' => 'AQBT-Templates' ), - ) ) - ); - - private static $categorymembers = array( - array( 'list' => 'categorymembers', 'cmtitle' => 'Category:AQBT-Cat' ), - array( 'categorymembers' => array( - array( 'pageid' => 1, 'ns' => 0, 'title' => 'AQBT-All' ), - array( 'pageid' => 2, 'ns' => 0, 'title' => 'AQBT-Categories' ), - ) ) - ); - - private static $generatorAllpages = array( - array( 'generator' => 'allpages', 'gapprefix' => 'AQBT-' ), - array( 'pages' => array( - '1' => array( - 'pageid' => 1, - 'ns' => 0, - 'title' => 'AQBT-All' ), - '2' => array( - 'pageid' => 2, - 'ns' => 0, - 'title' => 'AQBT-Categories' ), - '3' => array( - 'pageid' => 3, - 'ns' => 0, - 'title' => 'AQBT-Links' ), - '4' => array( - 'pageid' => 4, - 'ns' => 0, - 'title' => 'AQBT-Templates' ), - ) ) - ); - - private static $generatorLinks = array( - array( 'generator' => 'links', 'titles' => 'AQBT-Links' ), - array( 'pages' => array( - '1' => array( - 'pageid' => 1, - 'ns' => 0, - 'title' => 'AQBT-All' ), - '2' => array( - 'pageid' => 2, - 'ns' => 0, - 'title' => 'AQBT-Categories' ), - '4' => array( - 'pageid' => 4, - 'ns' => 0, - 'title' => 'AQBT-Templates' ), - ) ) - ); - - private static $generatorLinksPropLinks = array( - array( 'prop' => 'links' ), - array( 'pages' => array( - '1' => array( 'links' => array( - array( 'ns' => 0, 'title' => 'AQBT-Links' ), - ) ) - ) ) - ); - - private static $generatorLinksPropTemplates = array( - array( 'prop' => 'templates' ), - array( 'pages' => array( - '1' => array( 'templates' => array( - array( 'ns' => 10, 'title' => 'Template:AQBT-T' ) ) ), - '4' => array( 'templates' => array( - array( 'ns' => 10, 'title' => 'Template:AQBT-T' ) ) ), - ) ) - ); - - /** - * Test basic props - */ - public function testProps() { - $this->check( self::$links ); - $this->check( self::$templates ); - $this->check( self::$categories ); - } - - /** - * Test basic lists - */ - public function testLists() { - $this->check( self::$allpages ); - $this->check( self::$alllinks ); - $this->check( self::$alltransclusions ); - // This test is temporarily disabled until a sqlite bug is fixed - // $this->check( self::$allcategories ); - $this->check( self::$backlinks ); - $this->check( self::$embeddedin ); - $this->check( self::$categorymembers ); - } - - /** - * Test basic lists - */ - public function testAllTogether() { - - // All props together - $this->check( $this->merge( - self::$links, - self::$templates, - self::$categories - ) ); - - // All lists together - $this->check( $this->merge( - self::$allpages, - self::$alllinks, - self::$alltransclusions, - // This test is temporarily disabled until a sqlite bug is fixed - // self::$allcategories, - self::$backlinks, - self::$embeddedin, - self::$categorymembers - ) ); - - // All props+lists together - $this->check( $this->merge( - self::$links, - self::$templates, - self::$categories, - self::$allpages, - self::$alllinks, - self::$alltransclusions, - // This test is temporarily disabled until a sqlite bug is fixed - // self::$allcategories, - self::$backlinks, - self::$embeddedin, - self::$categorymembers - ) ); - } - - /** - * Test basic lists - */ - public function testGenerator() { - // generator=allpages - $this->check( self::$generatorAllpages ); - // generator=allpages & list=allpages - $this->check( $this->merge( - self::$generatorAllpages, - self::$allpages ) ); - // generator=links - $this->check( self::$generatorLinks ); - // generator=links & prop=links - $this->check( $this->merge( - self::$generatorLinks, - self::$generatorLinksPropLinks ) ); - // generator=links & prop=templates - $this->check( $this->merge( - self::$generatorLinks, - self::$generatorLinksPropTemplates ) ); - // generator=links & prop=links|templates - $this->check( $this->merge( - self::$generatorLinks, - self::$generatorLinksPropLinks, - self::$generatorLinksPropTemplates ) ); - // generator=links & prop=links|templates & list=allpages|... - $this->check( $this->merge( - self::$generatorLinks, - self::$generatorLinksPropLinks, - self::$generatorLinksPropTemplates, - self::$allpages, - self::$alllinks, - self::$alltransclusions, - // This test is temporarily disabled until a sqlite bug is fixed - // self::$allcategories, - self::$backlinks, - self::$embeddedin, - self::$categorymembers ) ); - } - - /** - * Test bug 51821 - */ - public function testGeneratorRedirects() { - $this->editPage( 'AQBT-Target', 'test' ); - $this->editPage( 'AQBT-Redir', '#REDIRECT [[AQBT-Target]]' ); - $this->check( array( - array( 'generator' => 'backlinks', 'gbltitle' => 'AQBT-Target', 'redirects' => '1' ), - array( - 'redirects' => array( - array( - 'from' => 'AQBT-Redir', - 'to' => 'AQBT-Target', - ) - ), - 'pages' => array( - '6' => array( - 'pageid' => 6, - 'ns' => 0, - 'title' => 'AQBT-Target', - ) - ), - ) - ) ); - } - - /** - * Recursively merges the expected values in the $item into the $all - */ - private function mergeExpected( &$all, $item ) { - foreach ( $item as $k => $v ) { - if ( array_key_exists( $k, $all ) ) { - if ( is_array( $all[$k] ) ) { - $this->mergeExpected( $all[$k], $v ); - } else { - $this->assertEquals( $all[$k], $v ); - } - } else { - $all[$k] = $v; - } - } - } - - /** - * Recursively compare arrays, ignoring mismatches in numeric key and pageids. - * @param $expected array expected values - * @param $result array returned values - */ - private function assertQueryResults( $expected, $result ) { - reset( $expected ); - reset( $result ); - while ( true ) { - $e = each( $expected ); - $r = each( $result ); - // If either of the arrays is shorter, abort. If both are done, success. - $this->assertEquals( (bool)$e, (bool)$r ); - if ( !$e ) { - break; // done - } - // continue only if keys are identical or both keys are numeric - $this->assertTrue( $e['key'] === $r['key'] || ( is_numeric( $e['key'] ) && is_numeric( $r['key'] ) ) ); - // don't compare pageids - if ( $e['key'] !== 'pageid' ) { - // If values are arrays, compare recursively, otherwise compare with === - if ( is_array( $e['value'] ) && is_array( $r['value'] ) ) { - $this->assertQueryResults( $e['value'], $r['value'] ); - } else { - $this->assertEquals( $e['value'], $r['value'] ); - } - } - } - } -} diff --git a/tests/phpunit/includes/api/query/ApiQueryContinue2Test.php b/tests/phpunit/includes/api/query/ApiQueryContinue2Test.php deleted file mode 100644 index 4d5ddbae..00000000 --- a/tests/phpunit/includes/api/query/ApiQueryContinue2Test.php +++ /dev/null @@ -1,68 +0,0 @@ -@gmail.com" - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - */ - -require_once 'ApiQueryContinueTestBase.php'; - -/** - * @group API - * @group Database - * @group medium - */ -class ApiQueryContinue2Test extends ApiQueryContinueTestBase { - /** - * Create a set of pages. These must not change, otherwise the tests might give wrong results. - * @see MediaWikiTestCase::addDBData() - */ - function addDBData() { - try { - $this->editPage( 'AQCT73462-A', '**AQCT73462-A** [[AQCT73462-B]] [[AQCT73462-C]]' ); - $this->editPage( 'AQCT73462-B', '[[AQCT73462-A]] **AQCT73462-B** [[AQCT73462-C]]' ); - $this->editPage( 'AQCT73462-C', '[[AQCT73462-A]] [[AQCT73462-B]] **AQCT73462-C**' ); - $this->editPage( 'AQCT73462-A', '**AQCT73462-A** [[AQCT73462-B]] [[AQCT73462-C]]' ); - $this->editPage( 'AQCT73462-B', '[[AQCT73462-A]] **AQCT73462-B** [[AQCT73462-C]]' ); - $this->editPage( 'AQCT73462-C', '[[AQCT73462-A]] [[AQCT73462-B]] **AQCT73462-C**' ); - } catch ( Exception $e ) { - $this->exceptionFromAddDBData = $e; - } - } - - /** - * @medium - */ - public function testA() { - $this->mVerbose = false; - $mk = function ( $g, $p, $gDir ) { - return array( - 'generator' => 'allpages', - 'gapprefix' => 'AQCT73462-', - 'prop' => 'links', - 'gaplimit' => "$g", - 'pllimit' => "$p", - 'gapdir' => $gDir ? "ascending" : "descending", - ); - }; - // generator + 1 prop + 1 list - $data = $this->query( $mk( 99, 99, true ), 1, 'g1p', false ); - $this->checkC( $data, $mk( 1, 1, true ), 6, 'g1p-11t' ); - $this->checkC( $data, $mk( 2, 2, true ), 3, 'g1p-22t' ); - $this->checkC( $data, $mk( 1, 1, false ), 6, 'g1p-11f' ); - $this->checkC( $data, $mk( 2, 2, false ), 3, 'g1p-22f' ); - } -} diff --git a/tests/phpunit/includes/api/query/ApiQueryContinueTest.php b/tests/phpunit/includes/api/query/ApiQueryContinueTest.php deleted file mode 100644 index f494e9ca..00000000 --- a/tests/phpunit/includes/api/query/ApiQueryContinueTest.php +++ /dev/null @@ -1,313 +0,0 @@ -@gmail.com" - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - */ - -require_once 'ApiQueryContinueTestBase.php'; - -/** - * These tests validate the new continue functionality of the api query module by - * doing multiple requests with varying parameters, merging the results, and checking - * that the result matches the full data received in one no-limits call. - * - * @group API - * @group Database - * @group medium - */ -class ApiQueryContinueTest extends ApiQueryContinueTestBase { - /** - * Create a set of pages. These must not change, otherwise the tests might give wrong results. - * @see MediaWikiTestCase::addDBData() - */ - function addDBData() { - try { - $this->editPage( 'Template:AQCT-T1', '**Template:AQCT-T1**' ); - $this->editPage( 'Template:AQCT-T2', '**Template:AQCT-T2**' ); - $this->editPage( 'Template:AQCT-T3', '**Template:AQCT-T3**' ); - $this->editPage( 'Template:AQCT-T4', '**Template:AQCT-T4**' ); - $this->editPage( 'Template:AQCT-T5', '**Template:AQCT-T5**' ); - - $this->editPage( 'AQCT-1', '**AQCT-1** {{AQCT-T2}} {{AQCT-T3}} {{AQCT-T4}} {{AQCT-T5}}' ); - $this->editPage( 'AQCT-2', '[[AQCT-1]] **AQCT-2** {{AQCT-T3}} {{AQCT-T4}} {{AQCT-T5}}' ); - $this->editPage( 'AQCT-3', '[[AQCT-1]] [[AQCT-2]] **AQCT-3** {{AQCT-T4}} {{AQCT-T5}}' ); - $this->editPage( 'AQCT-4', '[[AQCT-1]] [[AQCT-2]] [[AQCT-3]] **AQCT-4** {{AQCT-T5}}' ); - $this->editPage( 'AQCT-5', '[[AQCT-1]] [[AQCT-2]] [[AQCT-3]] [[AQCT-4]] **AQCT-5**' ); - } catch ( Exception $e ) { - $this->exceptionFromAddDBData = $e; - } - } - - /** - * Test smart continue - list=allpages - * @medium - */ - public function test1List() { - $this->mVerbose = false; - $mk = function ( $l ) { - return array( - 'list' => 'allpages', - 'apprefix' => 'AQCT-', - 'aplimit' => "$l", - ); - }; - $data = $this->query( $mk( 99 ), 1, '1L', false ); - - // 1 list - $this->checkC( $data, $mk( 1 ), 5, '1L-1' ); - $this->checkC( $data, $mk( 2 ), 3, '1L-2' ); - $this->checkC( $data, $mk( 3 ), 2, '1L-3' ); - $this->checkC( $data, $mk( 4 ), 2, '1L-4' ); - $this->checkC( $data, $mk( 5 ), 1, '1L-5' ); - } - - /** - * Test smart continue - list=allpages|alltransclusions - * @medium - */ - public function test2Lists() { - $this->mVerbose = false; - $mk = function ( $l1, $l2 ) { - return array( - 'list' => 'allpages|alltransclusions', - 'apprefix' => 'AQCT-', - 'atprefix' => 'AQCT-', - 'atunique' => '', - 'aplimit' => "$l1", - 'atlimit' => "$l2", - ); - }; - // 2 lists - $data = $this->query( $mk( 99, 99 ), 1, '2L', false ); - $this->checkC( $data, $mk( 1, 1 ), 5, '2L-11' ); - $this->checkC( $data, $mk( 2, 2 ), 3, '2L-22' ); - $this->checkC( $data, $mk( 3, 3 ), 2, '2L-33' ); - $this->checkC( $data, $mk( 4, 4 ), 2, '2L-44' ); - $this->checkC( $data, $mk( 5, 5 ), 1, '2L-55' ); - } - - /** - * Test smart continue - generator=allpages, prop=links - * @medium - */ - public function testGen1Prop() { - $this->mVerbose = false; - $mk = function ( $g, $p ) { - return array( - 'generator' => 'allpages', - 'gapprefix' => 'AQCT-', - 'gaplimit' => "$g", - 'prop' => 'links', - 'pllimit' => "$p", - ); - }; - // generator + 1 prop - $data = $this->query( $mk( 99, 99 ), 1, 'G1P', false ); - $this->checkC( $data, $mk( 1, 1 ), 11, 'G1P-11' ); - $this->checkC( $data, $mk( 2, 2 ), 6, 'G1P-22' ); - $this->checkC( $data, $mk( 3, 3 ), 4, 'G1P-33' ); - $this->checkC( $data, $mk( 4, 4 ), 3, 'G1P-44' ); - $this->checkC( $data, $mk( 5, 5 ), 2, 'G1P-55' ); - } - - /** - * Test smart continue - generator=allpages, prop=links|templates - * @medium - */ - public function testGen2Prop() { - $this->mVerbose = false; - $mk = function ( $g, $p1, $p2 ) { - return array( - 'generator' => 'allpages', - 'gapprefix' => 'AQCT-', - 'gaplimit' => "$g", - 'prop' => 'links|templates', - 'pllimit' => "$p1", - 'tllimit' => "$p2", - ); - }; - // generator + 2 props - $data = $this->query( $mk( 99, 99, 99 ), 1, 'G2P', false ); - $this->checkC( $data, $mk( 1, 1, 1 ), 16, 'G2P-111' ); - $this->checkC( $data, $mk( 2, 2, 2 ), 9, 'G2P-222' ); - $this->checkC( $data, $mk( 3, 3, 3 ), 6, 'G2P-333' ); - $this->checkC( $data, $mk( 4, 4, 4 ), 4, 'G2P-444' ); - $this->checkC( $data, $mk( 5, 5, 5 ), 2, 'G2P-555' ); - $this->checkC( $data, $mk( 5, 1, 1 ), 10, 'G2P-511' ); - $this->checkC( $data, $mk( 4, 2, 2 ), 7, 'G2P-422' ); - $this->checkC( $data, $mk( 2, 3, 3 ), 7, 'G2P-233' ); - $this->checkC( $data, $mk( 2, 4, 4 ), 5, 'G2P-244' ); - $this->checkC( $data, $mk( 1, 5, 5 ), 5, 'G2P-155' ); - } - - /** - * Test smart continue - generator=allpages, prop=links, list=alltransclusions - * @medium - */ - public function testGen1Prop1List() { - $this->mVerbose = false; - $mk = function ( $g, $p, $l ) { - return array( - 'generator' => 'allpages', - 'gapprefix' => 'AQCT-', - 'gaplimit' => "$g", - 'prop' => 'links', - 'pllimit' => "$p", - 'list' => 'alltransclusions', - 'atprefix' => 'AQCT-', - 'atunique' => '', - 'atlimit' => "$l", - ); - }; - // generator + 1 prop + 1 list - $data = $this->query( $mk( 99, 99, 99 ), 1, 'G1P1L', false ); - $this->checkC( $data, $mk( 1, 1, 1 ), 11, 'G1P1L-111' ); - $this->checkC( $data, $mk( 2, 2, 2 ), 6, 'G1P1L-222' ); - $this->checkC( $data, $mk( 3, 3, 3 ), 4, 'G1P1L-333' ); - $this->checkC( $data, $mk( 4, 4, 4 ), 3, 'G1P1L-444' ); - $this->checkC( $data, $mk( 5, 5, 5 ), 2, 'G1P1L-555' ); - $this->checkC( $data, $mk( 5, 5, 1 ), 4, 'G1P1L-551' ); - $this->checkC( $data, $mk( 5, 5, 2 ), 2, 'G1P1L-552' ); - } - - /** - * Test smart continue - generator=allpages, prop=links|templates, - * list=alllinks|alltransclusions, meta=siteinfo - * @medium - */ - public function testGen2Prop2List1Meta() { - $this->mVerbose = false; - $mk = function ( $g, $p1, $p2, $l1, $l2 ) { - return array( - 'generator' => 'allpages', - 'gapprefix' => 'AQCT-', - 'gaplimit' => "$g", - 'prop' => 'links|templates', - 'pllimit' => "$p1", - 'tllimit' => "$p2", - 'list' => 'alllinks|alltransclusions', - 'alprefix' => 'AQCT-', - 'alunique' => '', - 'allimit' => "$l1", - 'atprefix' => 'AQCT-', - 'atunique' => '', - 'atlimit' => "$l2", - 'meta' => 'siteinfo', - 'siprop' => 'namespaces', - ); - }; - // generator + 1 prop + 1 list - $data = $this->query( $mk( 99, 99, 99, 99, 99 ), 1, 'G2P2L1M', false ); - $this->checkC( $data, $mk( 1, 1, 1, 1, 1 ), 16, 'G2P2L1M-11111' ); - $this->checkC( $data, $mk( 2, 2, 2, 2, 2 ), 9, 'G2P2L1M-22222' ); - $this->checkC( $data, $mk( 3, 3, 3, 3, 3 ), 6, 'G2P2L1M-33333' ); - $this->checkC( $data, $mk( 4, 4, 4, 4, 4 ), 4, 'G2P2L1M-44444' ); - $this->checkC( $data, $mk( 5, 5, 5, 5, 5 ), 2, 'G2P2L1M-55555' ); - $this->checkC( $data, $mk( 5, 5, 5, 1, 1 ), 4, 'G2P2L1M-55511' ); - $this->checkC( $data, $mk( 5, 5, 5, 2, 2 ), 2, 'G2P2L1M-55522' ); - $this->checkC( $data, $mk( 5, 1, 1, 5, 5 ), 10, 'G2P2L1M-51155' ); - $this->checkC( $data, $mk( 5, 2, 2, 5, 5 ), 5, 'G2P2L1M-52255' ); - } - - /** - * Test smart continue - generator=templates, prop=templates - * @medium - */ - public function testSameGenAndProp() { - $this->mVerbose = false; - $mk = function ( $g, $gDir, $p, $pDir ) { - return array( - 'titles' => 'AQCT-1', - 'generator' => 'templates', - 'gtllimit' => "$g", - 'gtldir' => $gDir ? 'ascending' : 'descending', - 'prop' => 'templates', - 'tllimit' => "$p", - 'tldir' => $pDir ? 'ascending' : 'descending', - ); - }; - // generator + 1 prop - $data = $this->query( $mk( 99, true, 99, true ), 1, 'G=P', false ); - - $this->checkC( $data, $mk( 1, true, 1, true ), 4, 'G=P-1t1t' ); - $this->checkC( $data, $mk( 2, true, 2, true ), 2, 'G=P-2t2t' ); - $this->checkC( $data, $mk( 3, true, 3, true ), 2, 'G=P-3t3t' ); - $this->checkC( $data, $mk( 1, true, 3, true ), 4, 'G=P-1t3t' ); - $this->checkC( $data, $mk( 3, true, 1, true ), 2, 'G=P-3t1t' ); - - $this->checkC( $data, $mk( 1, true, 1, false ), 4, 'G=P-1t1f' ); - $this->checkC( $data, $mk( 2, true, 2, false ), 2, 'G=P-2t2f' ); - $this->checkC( $data, $mk( 3, true, 3, false ), 2, 'G=P-3t3f' ); - $this->checkC( $data, $mk( 1, true, 3, false ), 4, 'G=P-1t3f' ); - $this->checkC( $data, $mk( 3, true, 1, false ), 2, 'G=P-3t1f' ); - - $this->checkC( $data, $mk( 1, false, 1, true ), 4, 'G=P-1f1t' ); - $this->checkC( $data, $mk( 2, false, 2, true ), 2, 'G=P-2f2t' ); - $this->checkC( $data, $mk( 3, false, 3, true ), 2, 'G=P-3f3t' ); - $this->checkC( $data, $mk( 1, false, 3, true ), 4, 'G=P-1f3t' ); - $this->checkC( $data, $mk( 3, false, 1, true ), 2, 'G=P-3f1t' ); - - $this->checkC( $data, $mk( 1, false, 1, false ), 4, 'G=P-1f1f' ); - $this->checkC( $data, $mk( 2, false, 2, false ), 2, 'G=P-2f2f' ); - $this->checkC( $data, $mk( 3, false, 3, false ), 2, 'G=P-3f3f' ); - $this->checkC( $data, $mk( 1, false, 3, false ), 4, 'G=P-1f3f' ); - $this->checkC( $data, $mk( 3, false, 1, false ), 2, 'G=P-3f1f' ); - } - - /** - * Test smart continue - generator=allpages, list=allpages - * @medium - */ - public function testSameGenList() { - $this->mVerbose = false; - $mk = function ( $g, $gDir, $l, $pDir ) { - return array( - 'generator' => 'allpages', - 'gapprefix' => 'AQCT-', - 'gaplimit' => "$g", - 'gapdir' => $gDir ? 'ascending' : 'descending', - 'list' => 'allpages', - 'apprefix' => 'AQCT-', - 'aplimit' => "$l", - 'apdir' => $pDir ? 'ascending' : 'descending', - ); - }; - // generator + 1 list - $data = $this->query( $mk( 99, true, 99, true ), 1, 'G=L', false ); - - $this->checkC( $data, $mk( 1, true, 1, true ), 5, 'G=L-1t1t' ); - $this->checkC( $data, $mk( 2, true, 2, true ), 3, 'G=L-2t2t' ); - $this->checkC( $data, $mk( 3, true, 3, true ), 2, 'G=L-3t3t' ); - $this->checkC( $data, $mk( 1, true, 3, true ), 5, 'G=L-1t3t' ); - $this->checkC( $data, $mk( 3, true, 1, true ), 5, 'G=L-3t1t' ); - $this->checkC( $data, $mk( 1, true, 1, false ), 5, 'G=L-1t1f' ); - $this->checkC( $data, $mk( 2, true, 2, false ), 3, 'G=L-2t2f' ); - $this->checkC( $data, $mk( 3, true, 3, false ), 2, 'G=L-3t3f' ); - $this->checkC( $data, $mk( 1, true, 3, false ), 5, 'G=L-1t3f' ); - $this->checkC( $data, $mk( 3, true, 1, false ), 5, 'G=L-3t1f' ); - $this->checkC( $data, $mk( 1, false, 1, true ), 5, 'G=L-1f1t' ); - $this->checkC( $data, $mk( 2, false, 2, true ), 3, 'G=L-2f2t' ); - $this->checkC( $data, $mk( 3, false, 3, true ), 2, 'G=L-3f3t' ); - $this->checkC( $data, $mk( 1, false, 3, true ), 5, 'G=L-1f3t' ); - $this->checkC( $data, $mk( 3, false, 1, true ), 5, 'G=L-3f1t' ); - $this->checkC( $data, $mk( 1, false, 1, false ), 5, 'G=L-1f1f' ); - $this->checkC( $data, $mk( 2, false, 2, false ), 3, 'G=L-2f2f' ); - $this->checkC( $data, $mk( 3, false, 3, false ), 2, 'G=L-3f3f' ); - $this->checkC( $data, $mk( 1, false, 3, false ), 5, 'G=L-1f3f' ); - $this->checkC( $data, $mk( 3, false, 1, false ), 5, 'G=L-3f1f' ); - } -} diff --git a/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php b/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php deleted file mode 100644 index fbb1e640..00000000 --- a/tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php +++ /dev/null @@ -1,209 +0,0 @@ -@gmail.com" - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @file - */ - -require_once 'ApiQueryTestBase.php'; - -abstract class ApiQueryContinueTestBase extends ApiQueryTestBase { - - /** - * Enable to print in-depth debugging info during the test run - */ - protected $mVerbose = false; - - /** - * Run query() and compare against expected values - */ - protected function checkC( $expected, $params, $expectedCount, $id, $continue = true ) { - $result = $this->query( $params, $expectedCount, $id, $continue ); - $this->assertResult( $expected, $result, $id ); - } - - /** - * Run query in a loop until no more values are available - * @param array $params api parameters - * @param int $expectedCount max number of iterations - * @param string $id unit test id - * @param boolean $useContinue true to use smart continue - * @return mixed: merged results data array - * @throws Exception - */ - protected function query( $params, $expectedCount, $id, $useContinue = true ) { - if ( isset( $params['action'] ) ) { - $this->assertEquals( 'query', $params['action'], 'Invalid query action' ); - } else { - $params['action'] = 'query'; - } - if ( $useContinue && !isset( $params['continue'] ) ) { - $params['continue'] = ''; - } - $count = 0; - $result = array(); - $continue = array(); - do { - $request = array_merge( $params, $continue ); - uksort( $request, function ( $a, $b ) { - // put 'continue' params at the end - lazy method - $a = strpos( $a, 'continue' ) !== false ? 'zzz ' . $a : $a; - $b = strpos( $b, 'continue' ) !== false ? 'zzz ' . $b : $b; - - return strcmp( $a, $b ); - } ); - $reqStr = http_build_query( $request ); - //$reqStr = str_replace( '&', ' & ', $reqStr ); - $this->assertLessThan( $expectedCount, $count, "$id more data: $reqStr" ); - if ( $this->mVerbose ) { - print "$id (#$count): $reqStr\n"; - } - try { - $data = $this->doApiRequest( $request ); - } catch ( Exception $e ) { - throw new Exception( "$id on $count", 0, $e ); - } - $data = $data[0]; - if ( isset( $data['warnings'] ) ) { - $warnings = json_encode( $data['warnings'] ); - $this->fail( "$id Warnings on #$count in $reqStr\n$warnings" ); - } - $this->assertArrayHasKey( 'query', $data, "$id no 'query' on #$count in $reqStr" ); - if ( isset( $data['continue'] ) ) { - $continue = $data['continue']; - unset( $data['continue'] ); - } else { - $continue = array(); - } - if ( $this->mVerbose ) { - $this->printResult( $data ); - } - $this->mergeResult( $result, $data ); - $count++; - if ( empty( $continue ) ) { - // $this->assertEquals( $expectedCount, $count, "$id finished early" ); - if ( $expectedCount > $count ) { - print "***** $id Finished early in $count turns. $expectedCount was expected\n"; - } - - return $result; - } elseif ( !$useContinue ) { - $this->assertFalse( 'Non-smart query must be requested all at once' ); - } - } while ( true ); - } - - private function printResult( $data ) { - $q = $data['query']; - $print = array(); - if ( isset( $q['pages'] ) ) { - foreach ( $q['pages'] as $p ) { - $m = $p['title']; - if ( isset( $p['links'] ) ) { - $m .= '/[' . implode( ',', array_map( - function ( $v ) { - return $v['title']; - }, - $p['links'] ) ) . ']'; - } - if ( isset( $p['categories'] ) ) { - $m .= '/(' . implode( ',', array_map( - function ( $v ) { - return str_replace( 'Category:', '', $v['title'] ); - }, - $p['categories'] ) ) . ')'; - } - $print[] = $m; - } - } - if ( isset( $q['allcategories'] ) ) { - $print[] = '*Cats/(' . implode( ',', array_map( - function ( $v ) { - return $v['*']; - }, - $q['allcategories'] ) ) . ')'; - } - self::GetItems( $q, 'allpages', 'Pages', $print ); - self::GetItems( $q, 'alllinks', 'Links', $print ); - self::GetItems( $q, 'alltransclusions', 'Trnscl', $print ); - print ' ' . implode( ' ', $print ) . "\n"; - } - - private static function GetItems( $q, $moduleName, $name, &$print ) { - if ( isset( $q[$moduleName] ) ) { - $print[] = "*$name/[" . implode( ',', - array_map( function ( $v ) { - return $v['title']; - }, - $q[$moduleName] ) ) . ']'; - } - } - - /** - * Recursively merge the new result returned from the query to the previous results. - * @param mixed $results - * @param mixed $newResult - * @param bool $numericIds If true, treat keys as ids to be merged instead of appending - */ - protected function mergeResult( &$results, $newResult, $numericIds = false ) { - $this->assertEquals( is_array( $results ), is_array( $newResult ), 'Type of result and data do not match' ); - if ( !is_array( $results ) ) { - $this->assertEquals( $results, $newResult, 'Repeated result must be the same as before' ); - } else { - $sort = null; - foreach ( $newResult as $key => $value ) { - if ( !$numericIds && $sort === null ) { - if ( !is_array( $value ) ) { - $sort = false; - } elseif ( array_key_exists( 'title', $value ) ) { - $sort = function ( $a, $b ) { - return strcmp( $a['title'], $b['title'] ); - }; - } else { - $sort = false; - } - } - $keyExists = array_key_exists( $key, $results ); - if ( is_numeric( $key ) ) { - if ( $numericIds ) { - if ( !$keyExists ) { - $results[$key] = $value; - } else { - $this->mergeResult( $results[$key], $value ); - } - } else { - $results[] = $value; - } - } elseif ( !$keyExists ) { - $results[$key] = $value; - } else { - $this->mergeResult( $results[$key], $value, $key === 'pages' ); - } - } - if ( $numericIds ) { - ksort( $results, SORT_NUMERIC ); - } elseif ( $sort !== null && $sort !== false ) { - uasort( $results, $sort ); - } - } - } -} diff --git a/tests/phpunit/includes/api/query/ApiQueryRevisionsTest.php b/tests/phpunit/includes/api/query/ApiQueryRevisionsTest.php deleted file mode 100644 index 1bca2256..00000000 --- a/tests/phpunit/includes/api/query/ApiQueryRevisionsTest.php +++ /dev/null @@ -1,39 +0,0 @@ -doEdit( 'Some text', 'inserting content' ); - - $apiResult = $this->doApiRequest( array( - 'action' => 'query', - 'prop' => 'revisions', - 'titles' => $pageName, - 'rvprop' => 'content', - ) ); - $this->assertArrayHasKey( 'query', $apiResult[0] ); - $this->assertArrayHasKey( 'pages', $apiResult[0]['query'] ); - foreach ( $apiResult[0]['query']['pages'] as $page ) { - $this->assertArrayHasKey( 'revisions', $page ); - foreach ( $page['revisions'] as $revision ) { - $this->assertArrayHasKey( 'contentformat', $revision, - 'contentformat should be included when asking content so client knows how to interpret it' - ); - $this->assertArrayHasKey( 'contentmodel', $revision, - 'contentmodel should be included when asking content so client knows how to interpret it' - ); - } - } - } -} diff --git a/tests/phpunit/includes/api/query/ApiQueryTest.php b/tests/phpunit/includes/api/query/ApiQueryTest.php deleted file mode 100644 index f5645555..00000000 --- a/tests/phpunit/includes/api/query/ApiQueryTest.php +++ /dev/null @@ -1,66 +0,0 @@ -doLogin(); - } - - public function testTitlesGetNormalized() { - - global $wgMetaNamespace; - - $data = $this->doApiRequest( array( - 'action' => 'query', - 'titles' => 'Project:articleA|article_B' ) ); - - $this->assertArrayHasKey( 'query', $data[0] ); - $this->assertArrayHasKey( 'normalized', $data[0]['query'] ); - - // Forge a normalized title - $to = Title::newFromText( $wgMetaNamespace . ':ArticleA' ); - - $this->assertEquals( - array( - 'from' => 'Project:articleA', - 'to' => $to->getPrefixedText(), - ), - $data[0]['query']['normalized'][0] - ); - - $this->assertEquals( - array( - 'from' => 'article_B', - 'to' => 'Article B' - ), - $data[0]['query']['normalized'][1] - ); - } - - public function testTitlesAreRejectedIfInvalid() { - $title = false; - while ( !$title || Title::newFromText( $title )->exists() ) { - $title = md5( mt_rand( 0, 10000 ) + rand( 0, 999000 ) ); - } - - $data = $this->doApiRequest( array( - 'action' => 'query', - 'titles' => $title . '|Talk:' ) ); - - $this->assertArrayHasKey( 'query', $data[0] ); - $this->assertArrayHasKey( 'pages', $data[0]['query'] ); - $this->assertEquals( 2, count( $data[0]['query']['pages'] ) ); - - $this->assertArrayHasKey( -2, $data[0]['query']['pages'] ); - $this->assertArrayHasKey( -1, $data[0]['query']['pages'] ); - - $this->assertArrayHasKey( 'missing', $data[0]['query']['pages'][-2] ); - $this->assertArrayHasKey( 'invalid', $data[0]['query']['pages'][-1] ); - } -} diff --git a/tests/phpunit/includes/api/query/ApiQueryTestBase.php b/tests/phpunit/includes/api/query/ApiQueryTestBase.php deleted file mode 100644 index 8ee8ea96..00000000 --- a/tests/phpunit/includes/api/query/ApiQueryTestBase.php +++ /dev/null @@ -1,150 +0,0 @@ -@gmail.com" - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @file - */ - -/** This class has some common functionality for testing query module - */ -abstract class ApiQueryTestBase extends ApiTestCase { - - const PARAM_ASSERT = <<validateRequestExpectedPair( $v ); - $request = array_merge_recursive( $request, $req ); - $this->mergeExpected( $expected, $exp ); - } - - return array( $request, $expected ); - } - - /** - * Check that the parameter is a valid two element array, - * with the first element being API request and the second - expected result - */ - private function validateRequestExpectedPair( $v ) { - $this->assertType( 'array', $v, self::PARAM_ASSERT ); - $this->assertEquals( 2, count( $v ), self::PARAM_ASSERT ); - $this->assertArrayHasKey( 0, $v, self::PARAM_ASSERT ); - $this->assertArrayHasKey( 1, $v, self::PARAM_ASSERT ); - $this->assertType( 'array', $v[0], self::PARAM_ASSERT ); - $this->assertType( 'array', $v[1], self::PARAM_ASSERT ); - - return $v; - } - - /** - * Recursively merges the expected values in the $item into the $all - */ - private function mergeExpected( &$all, $item ) { - foreach ( $item as $k => $v ) { - if ( array_key_exists( $k, $all ) ) { - if ( is_array( $all[$k] ) ) { - $this->mergeExpected( $all[$k], $v ); - } else { - $this->assertEquals( $all[$k], $v ); - } - } else { - $all[$k] = $v; - } - } - } - - /** - * Checks that the request's result matches the expected results. - * @param $values array is a two element array( request, expected_results ) - * @throws Exception - */ - protected function check( $values ) { - list( $req, $exp ) = $this->validateRequestExpectedPair( $values ); - if ( !array_key_exists( 'action', $req ) ) { - $req['action'] = 'query'; - } - foreach ( $req as &$val ) { - if ( is_array( $val ) ) { - $val = implode( '|', array_unique( $val ) ); - } - } - $result = $this->doApiRequest( $req ); - $this->assertResult( array( 'query' => $exp ), $result[0], $req ); - } - - protected function assertResult( $exp, $result, $message = '' ) { - try { - $this->assertResultRecursive( $exp, $result ); - } catch ( Exception $e ) { - if ( is_array( $message ) ) { - $message = http_build_query( $message ); - } - print "\nRequest: $message\n"; - print "\nExpected:\n"; - print_r( $exp ); - print "\nResult:\n"; - print_r( $result ); - throw $e; // rethrow it - } - } - - /** - * Recursively compare arrays, ignoring mismatches in numeric key and pageids. - * @param $expected array expected values - * @param $result array returned values - */ - private function assertResultRecursive( $expected, $result ) { - reset( $expected ); - reset( $result ); - while ( true ) { - $e = each( $expected ); - $r = each( $result ); - // If either of the arrays is shorter, abort. If both are done, success. - $this->assertEquals( (bool)$e, (bool)$r ); - if ( !$e ) { - break; // done - } - // continue only if keys are identical or both keys are numeric - $this->assertTrue( $e['key'] === $r['key'] || ( is_numeric( $e['key'] ) && is_numeric( $r['key'] ) ) ); - // don't compare pageids - if ( $e['key'] !== 'pageid' ) { - // If values are arrays, compare recursively, otherwise compare with === - if ( is_array( $e['value'] ) && is_array( $r['value'] ) ) { - $this->assertResultRecursive( $e['value'], $r['value'] ); - } else { - $this->assertEquals( $e['value'], $r['value'] ); - } - } - } - } -} diff --git a/tests/phpunit/includes/api/words.txt b/tests/phpunit/includes/api/words.txt deleted file mode 100644 index 7ce23ee3..00000000 --- a/tests/phpunit/includes/api/words.txt +++ /dev/null @@ -1,1000 +0,0 @@ -Andaquian -Anoplanthus -Araquaju -Astrophyton -Avarish -Batonga -Bdellidae -Betoyan -Bismarck -Britishness -Carmen -Chatillon -Clement -Coryphaena -Croton -Cyrillianism -Dagomba -Decimus -Dichorisandra -Duculinae -Empusa -Escallonia -Fathometer -Fon -Fundulinae -Gadswoons -Gederathite -Gemini -Gerbera -Gregarinida -Gyracanthus -Halopsychidae -Hasidim -Hemerobius -Ichthyosauridae -Iscariot -Jeames -Jesuitry -Jovian -Judaization -Katie -Ladin -Langhian -Lapithaean -Lisette -Macrochira -Malaxis -Malvastrum -Maranhao -Marxian -Maurist -Metrosideros -Micky -Microsporon -Odacidae -Ophiuchid -Osmorhiza -Paguma -Palesman -Papayaceae -Pastinaca -Philoxenian -Pleurostigma -Rarotongan -Rhodoraceae -Rong -Saho -Sanyakoan -Sardanapalian -Sauropoda -Sedentaria -Shambu -Shukulumbwe -Solonian -Spaniardization -Spirochaetaceae -Stomatopoda -Stratiotes -Taiwanhemp -Titanically -Venetianed -Victrola -Yuman -abatis -abaton -abjoint -acanthoma -acari -acceptance -actinography -acuteness -addiment -adelite -adelomorphic -adelphogamy -adipocele -aelurophobia -affined -aflaunt -agathokakological -aischrolatreia -alarmedly -alebench -aleurone -allelotropic -allerion -alloplastic -allowable -alternacy -alternariose -altricial -ambitionist -amendment -amiableness -amicableness -ammo -amortizable -anchorate -anemometrically -angelocracy -angelological -anodal -anomalure -antedate -antiagglutinin -antirationalist -antiscorbutic -antisplasher -antithesize -antiunionist -antoecian -apolegamic -appropriation -archididascalian -archival -arteriophlebotomy -articulable -asseveration -assignation -atelo -atrienses -atrophy -atterminement -atypic -automower -aveloz -awrist -azteca -bairnteam -balsamweed -bannerman -beardy -becry -beek -beggarwise -bescab -bestness -bethel -bewildering -bibliophilism -bitterblain -blakeberyed -boccarella -bocedization -boobyalla -bourbon -bowbent -bowerbird -brachygnathous -brail -branchiferous -brelaw -brew -brideweed -bridgeable -brombenzamide -buddler -burbankian -burr -buskin -cacochymical -calefactory -caliper -canaliculus -candidature -canellaceous -canniness -canning -cantilene -carbonatation -carthamic -caseum -caudated -causationist -ceruleite -chalder -chalta -charmel -chekan -chillness -chirogymnast -chirpling -chlorinous -cholanthrene -chondroblast -chromatography -chromophilous -chronical -cicatrice -cinchonine -city -clubbing -coastal -coaxially -coercible -coeternity -coff -coinventor -collyba -combinator -complanation -comprehensibility -conchuela -congenital -context -contranatural -corallum -cordately -cornupete -corolliferous -coroneted -corticosterone -coseat -cottage -crocetin -crossleted -crottels -curvedness -cycadeous -cyclism -cylindrically -cynanche -cyrtoceratitic -cystospasm -danceress -dancette -dawny -daydreamy -debar -decarburization -decorousness -decrepitness -delirious -deozonizer -dermatosis -desma -deutencephalic -diacetate -diarthrodial -diathermy -dicolic -dimastigate -dimidiation -dipetto -disavowable -disintrench -disman -dismay -disorder -disoxygenation -dithionous -dogman -dragonfly -dramatical -drawspan -drubbly -drunk -duskly -ecderonic -ectocuniform -ectocyst -ehrwaldite -electrocute -elemicin -embracing -emotionality -enactment -enamor -enclave -endameba -endochylous -endocrinologist -endolymph -endothecal -entasia -epigeous -episcopicide -epitrichial -erminee -erraticalness -eruptivity -erythrocytoschisis -esperance -estuous -eucrystalline -eugeny -evacuant -everbloomer -evocation -exarchateship -exasperate -excorticate -excrementary -exile -expandedly -exponency -expressionist -expulsion -extemporary -extollation -extortive -extrabulbar -extraprostatic -facticide -fairer -fakery -fasibitikite -fatiscent -fearless -febrifuge -ferie -fibrousness -fingered -fisheye -flagpole -flagrantness -fleche -fluidism -folliculin -footbreadth -forceps -forecontrive -forthbring -foveated -fuchsin -fungicidal -funori -gamelang -gametically -garvanzo -gasoliner -gastrophile -germproof -gerontism -gigantical -glaciology -godmotherhood -gooseherd -gordunite -gove -gracilis -greathead -grieveship -guidable -gyromancy -gyrostat -habitus -hailweed -handhole -hangalai -haznadar -heliced -hemihypertrophy -hemimorphic -hemistrumectomy -heptavalent -heptite -herbalist -herpetology -hesperid -hexacarbon -hieromnemon -hobbyless -holodactylic -homoeoarchy -hopperings -hospitable -houseboat -huh -huntedly -hydroponics -hydrosomal -hyperdactylia -hyperperistalsis -hypogeocarpous -ideogram -idiopathical -illegitimate -imambarah -impotently -improvise -impuberal -inaccurately -incarnant -inchoation -incliner -incredulous -indiscriminateness -indulgenced -inebriation -inexpressiveness -infibulate -inflectedness -iniome -ink -inquietly -insaturable -insinuative -instiller -institutive -insultproof -interactionist -intercensal -interpenetrable -intertranspicuous -intrinsicality -inwards -iridiocyte -iridoparalysis -irreportable -isoprene -isosmotic -izard -jacuaru -jaculative -jerkined -joe -joyous -julienne -justicehood -kali -kalidium -katha -kathal -keelage -keratomycosis -khaki -khedival -kinkily -knife -kolo -kraken -kwarta -labba -labber -laboress -lacunar -latch -lauric -lawter -lectotype -leeches -legible -lepidosteoid -leucobasalt -leverer -libellate -limnimeter -lithography -lithotypic -locomotor -logarithmetically -logistician -lyncine -lysogenesis -machan -macromyelon -maharana -mandibulate -manganapatite -marchpane -mas -masochistic -mastaba -matching -meditatively -megalopolitan -melaniline -mentum -mercaptides -mestome -metasomatism -meterless -micronuclear -micropetalous -microreaction -microsporophore -mileway -milliarium -millisecond -misbind -miscollocation -misreader -modernicide -modification -modulant -monkfish -monoamino -monocarbide -monographical -morphinomaniac -mullein -munge -mutilate -mycophagist -myelosarcoma -myospasm -myriadly -nagaika -naphthionate -natant -naviculaeform -nayward -neallotype -necrophilia -nectared -neigher -neogamous -neurodynia -neurorthopteran -nidation -nieceship -nitrobacteria -nitrosification -nogheaded -nonassertive -noneuphonious -nonextant -nonincrease -nonintermittent -nonmetallic -nonprehensile -nonremunerative -nonsocial -nonvesting -noontime -noreaster -nounal -nub -nucleoplasm -nullisome -numero -numerous -oblongatal -observe -obtusilingual -obvert -occipitoatlantal -oceanside -ochlophobist -odontiasis -opalescence -opticon -oraculousness -orarium -organically -orthopedically -ostosis -overadvance -overbuilt -overdiscouragement -overdoer -overhardy -overjocular -overmagnify -overofficered -overpotent -overprizer -overrunner -overshrink -oversimply -oversplash -ovology -oxskin -oxychloride -oxygenant -ozokerite -pactional -palaeoanthropography -palaeographical -palaeopsychology -palliasse -palpebral -pandaric -pantelegraph -papicolist -papulate -parakinetic -parasitism -parochialic -parochialize -passionlike -patch -paucidentate -pawnbrokeress -pecite -pecky -pedipulation -pellitory -perfilograph -periblast -perigemmal -periost -periplus -perishable -periwig -permansive -persistingly -persymmetrical -phantom -phasmatrope -philocaly -philogyny -philosophister -philotherianism -phorology -phototrophic -phrator -phratral -phthisipneumony -physogastry -phytologic -phytoptid -pianograph -picqueter -piculet -pigeoner -pimaric -pinesap -pist -planometer -platano -playful -plea -pleuropneumonic -plowwoman -plump -pluviographical -pneumocele -podophthalmate -polyad -polythalamian -poppyhead -portamento -portmanteau -portraitlike -possible -potassamide -powderer -praepubis -preanesthetic -prebarbaric -predealer -predomination -prefactory -preirrigational -prelector -presbytership -presecure -preservable -prespecialist -preventionism -prewound -princely -priorship -proannexationist -proanthropos -probeable -probouleutic -profitless -proplasma -prosectorial -protecting -protochemistry -protosulphate -pseudoataxia -psilology -psychoneurotic -pterygial -publicist -purgation -purplishness -putatively -pyracene -pyrenomycete -pyromancy -pyrophone -quadroon -quailhead -qualifier -quaternal -rabblelike -rambunctious -rapidness -ratably -rationalism -razor -reannoy -recultivation -regulable -reimplant -reimposition -reimprison -reinjure -reinspiration -reintroduce -remantle -reprehensibility -reptant -require -resteal -restful -returnability -revisableness -rewash -rewhirl -reyield -rhizotomy -rhodamine -rigwiddie -rimester -ripper -rippet -rockish -rockwards -rollicky -roosters -rooted -rosal -rozum -saccharated -sagamore -sagy -salesmanship -salivous -sallet -salta -saprostomous -satiation -sauropsid -sawarra -sawback -scabish -scabrate -scampavia -scientificophilosophical -scirrosity -scoliometer -scolopendrelloid -secantly -seignioral -semibull -semic -seminarianism -semiped -semiprivate -semispherical -semispontaneous -seneschal -septendecimal -serotherapist -servation -sesquisulphuret -severish -sextipartite -sextubercular -shipyard -shuckpen -siderosis -silex -sillyhow -silverbelly -silverbelly -simulacrum -sisham -sixte -skeiner -skiapod -slopped -slubby -smalts -sockmaker -solute -somethingness -somnify -southwester -spathilla -spectrochemical -sphagnology -spinales -spiriting -spirling -spirochetemia -spreadboard -spurflower -squawdom -squeezing -staircase -staker -stamphead -statolith -stekan -stellulate -stinker -stomodaea -streamingly -strikingness -strouthocamelian -stuprum -subacutely -subboreal -subcontractor -subendorsement -subprofitable -subserviate -subsneer -subungual -sucuruju -sugan -sulphocarbolate -summerwood -superficialist -superinference -superregenerative -supplicate -suspendible -synchronizer -syntectic -tachyglossate -tailless -taintment -takingly -taletelling -tarpon -tasteful -taxeater -taxy -teache -teachless -teg -tegmen -teletyper -temperable -ten -tenent -teskere -testes -thallogen -thapsia -thewness -thickety -thiobacteria -thorniness -throwing -thyroprivic -tinnitus -tocalote -tolerationist -tonalamatl -torvous -totality -tottering -toug -tracheopathia -tragedical -translucent -trifoveolate -trilaurin -trophoplasmatic -trunkless -turbanless -turnpiker -twangle -twitterboned -ultraornate -umbilication -unabatingly -unabjured -unadequateness -unaffectedness -unarriving -unassorted -unattacked -unbenumbed -unboasted -unburning -uncensorious -uncongested -uncontemnedly -uncontemporary -uncrook -uncrystallizability -uncurb -uncustomariness -underbillow -undercanopy -underestimation -underhanging -underpetticoated -underpropped -undersole -understocking -underworld -undevout -undisappointing -undistinctive -unfiscal -unfluted -unfreckled -ungentilize -unglobe -unhelped -unhomogeneously -unifoliate -uninflammable -uninterrogated -unisonal -unkindled -unlikeableness -unlisty -unlocked -unmoving -unmultipliable -unnestled -unnoticed -unobservable -unobviated -unoffensively -unofficerlike -unpoetic -unpractically -unquestionableness -unrehearsed -unrevised -unrhetorical -unsadden -unsaluting -unscriptural -unseeking -unshowed -unsolicitous -unsprouted -unsubjective -unsubsidized -unsymbolic -untenant -unterrified -untranquil -untraversed -untrusty -untying -unwillful -unwinding -upspring -uptwist -urachovesical -uropygial -vagabondism -varicoid -varletess -vasal -ventrocaudal -verisimilitude -vermigerous -vibrometer -viminal -virus -vocationalism -voguey -vulnerability -waggle -wamblingly -warmus -waxer -waying -wedgeable -wellmaker -whomever -wigged -witchlike -wokas -woodrowel -woodsman -woolding -xanthelasmic -xiphosternum -yachtman -yachtsmanlike -yelp -zoophytal \ No newline at end of file diff --git a/tests/phpunit/includes/cache/GenderCacheTest.php b/tests/phpunit/includes/cache/GenderCacheTest.php deleted file mode 100644 index ce2db5d7..00000000 --- a/tests/phpunit/includes/cache/GenderCacheTest.php +++ /dev/null @@ -1,104 +0,0 @@ -getID() == 0 ) { - $user->addToDatabase(); - $user->setPassword( 'UTMalePassword' ); - } - //ensure the right gender - $user->setOption( 'gender', 'male' ); - $user->saveSettings(); - - $user = User::newFromName( 'UTFemale' ); - if ( $user->getID() == 0 ) { - $user->addToDatabase(); - $user->setPassword( 'UTFemalePassword' ); - } - //ensure the right gender - $user->setOption( 'gender', 'female' ); - $user->saveSettings(); - - $user = User::newFromName( 'UTDefaultGender' ); - if ( $user->getID() == 0 ) { - $user->addToDatabase(); - $user->setPassword( 'UTDefaultGenderPassword' ); - } - //ensure the default gender - $user->setOption( 'gender', null ); - $user->saveSettings(); - } - - /** - * test usernames - * - * @dataProvider provideUserGenders - * @covers GenderCache::getGenderOf - */ - public function testUserName( $username, $expectedGender ) { - $genderCache = GenderCache::singleton(); - $gender = $genderCache->getGenderOf( $username ); - $this->assertEquals( $gender, $expectedGender, "GenderCache normal" ); - } - - /** - * genderCache should work with user objects, too - * - * @dataProvider provideUserGenders - * @covers GenderCache::getGenderOf - */ - public function testUserObjects( $username, $expectedGender ) { - $genderCache = GenderCache::singleton(); - $user = User::newFromName( $username ); - $gender = $genderCache->getGenderOf( $user ); - $this->assertEquals( $gender, $expectedGender, "GenderCache normal" ); - } - - public static function provideUserGenders() { - return array( - array( 'UTMale', 'male' ), - array( 'UTFemale', 'female' ), - array( 'UTDefaultGender', 'unknown' ), - array( 'UTNotExist', 'unknown' ), - //some not valid user - array( '127.0.0.1', 'unknown' ), - array( 'user@test', 'unknown' ), - ); - } - - /** - * test strip of subpages to avoid unnecessary queries - * against the never existing username - * - * @dataProvider provideStripSubpages - * @covers GenderCache::getGenderOf - */ - public function testStripSubpages( $pageWithSubpage, $expectedGender ) { - $genderCache = GenderCache::singleton(); - $gender = $genderCache->getGenderOf( $pageWithSubpage ); - $this->assertEquals( $gender, $expectedGender, "GenderCache must strip of subpages" ); - } - - public static function provideStripSubpages() { - return array( - array( 'UTMale/subpage', 'male' ), - array( 'UTFemale/subpage', 'female' ), - array( 'UTDefaultGender/subpage', 'unknown' ), - array( 'UTNotExist/subpage', 'unknown' ), - array( '127.0.0.1/subpage', 'unknown' ), - ); - } -} diff --git a/tests/phpunit/includes/cache/MessageCacheTest.php b/tests/phpunit/includes/cache/MessageCacheTest.php deleted file mode 100644 index 803acf73..00000000 --- a/tests/phpunit/includes/cache/MessageCacheTest.php +++ /dev/null @@ -1,128 +0,0 @@ -configureLanguages(); - MessageCache::singleton()->enable(); - } - - /** - * Helper function -- setup site language for testing - */ - protected function configureLanguages() { - // for the test, we need the content language to be anything but English, - // let's choose e.g. German (de) - $langCode = 'de'; - $langObj = Language::factory( $langCode ); - - $this->setMwGlobals( array( - 'wgLanguageCode' => $langCode, - 'wgLang' => $langObj, - 'wgContLang' => $langObj, - ) ); - } - - function addDBData() { - $this->configureLanguages(); - - // Set up messages and fallbacks ab -> ru -> de - $this->makePage( 'FallbackLanguageTest-Full', 'ab' ); - $this->makePage( 'FallbackLanguageTest-Full', 'ru' ); - $this->makePage( 'FallbackLanguageTest-Full', 'de' ); - - // Fallbacks where ab does not exist - $this->makePage( 'FallbackLanguageTest-Partial', 'ru' ); - $this->makePage( 'FallbackLanguageTest-Partial', 'de' ); - - // Fallback to the content language - $this->makePage( 'FallbackLanguageTest-ContLang', 'de' ); - - // Add customizations for an existing message. - $this->makePage( 'sunday', 'ru' ); - - // Full key tests -- always want russian - $this->makePage( 'MessageCacheTest-FullKeyTest', 'ab' ); - $this->makePage( 'MessageCacheTest-FullKeyTest', 'ru' ); - - // In content language -- get base if no derivative - $this->makePage( 'FallbackLanguageTest-NoDervContLang', 'de', 'de/none', false ); - } - - /** - * Helper function for addDBData -- adds a simple page to the database - * - * @param string $title Title of page to be created - * @param string $lang Language and content of the created page - * @param string|null $content Content of the created page, or null for a generic string - * @param bool $createSubPage Set to false if a root page should be created - */ - protected function makePage( $title, $lang, $content = null, $createSubPage = true ) { - global $wgContLang; - - if ( $content === null ) { - $content = $lang; - } - if ( $lang !== $wgContLang->getCode() || $createSubPage ) { - $title = "$title/$lang"; - } - - $title = Title::newFromText( $title, NS_MEDIAWIKI ); - $wikiPage = new WikiPage( $title ); - $contentHandler = ContentHandler::makeContent( $content, $title ); - $wikiPage->doEditContent( $contentHandler, "$lang translation test case" ); - } - - /** - * Test message fallbacks, bug #1495 - * - * @dataProvider provideMessagesForFallback - */ - public function testMessageFallbacks( $message, $lang, $expectedContent ) { - $result = MessageCache::singleton()->get( $message, true, $lang ); - $this->assertEquals( $expectedContent, $result, "Message fallback failed." ); - } - - function provideMessagesForFallback() { - return array( - array( 'FallbackLanguageTest-Full', 'ab', 'ab' ), - array( 'FallbackLanguageTest-Partial', 'ab', 'ru' ), - array( 'FallbackLanguageTest-ContLang', 'ab', 'de' ), - array( 'FallbackLanguageTest-None', 'ab', false ), - - // Existing message with customizations on the fallbacks - array( 'sunday', 'ab', 'амҽыш' ), - - // bug 46579 - array( 'FallbackLanguageTest-NoDervContLang', 'de', 'de/none' ), - // UI language different from content language should only use de/none as last option - array( 'FallbackLanguageTest-NoDervContLang', 'fit', 'de/none' ), - ); - } - - /** - * There's a fallback case where the message key is given as fully qualified -- this - * should ignore the passed $lang and use the language from the key - * - * @dataProvider provideMessagesForFullKeys - */ - public function testFullKeyBehaviour( $message, $lang, $expectedContent ) { - $result = MessageCache::singleton()->get( $message, true, $lang, true ); - $this->assertEquals( $expectedContent, $result, "Full key message fallback failed." ); - } - - function provideMessagesForFullKeys() { - return array( - array( 'MessageCacheTest-FullKeyTest/ru', 'ru', 'ru' ), - array( 'MessageCacheTest-FullKeyTest/ru', 'ab', 'ru' ), - array( 'MessageCacheTest-FullKeyTest/ru/foo', 'ru', false ), - ); - } - -} diff --git a/tests/phpunit/includes/cache/ProcessCacheLRUTest.php b/tests/phpunit/includes/cache/ProcessCacheLRUTest.php deleted file mode 100644 index d3793d83..00000000 --- a/tests/phpunit/includes/cache/ProcessCacheLRUTest.php +++ /dev/null @@ -1,237 +0,0 @@ -assertAttributeEquals( array(), 'cache', $cache, $msg ); - } - - /** - * Helper to fill a cache object passed by reference - */ - function fillCache( &$cache, $numEntries ) { - // Fill cache with three values - for ( $i = 1; $i <= $numEntries; $i++ ) { - $cache->set( "cache-key-$i", "prop-$i", "value-$i" ); - } - } - - /** - * Generates an array of what would be expected in cache for a given cache - * size and a number of entries filled in sequentially - */ - function getExpectedCache( $cacheMaxEntries, $entryToFill ) { - $expected = array(); - - if ( $entryToFill === 0 ) { - # The cache is empty! - return array(); - } elseif ( $entryToFill <= $cacheMaxEntries ) { - # Cache is not fully filled - $firstKey = 1; - } else { - # Cache overflowed - $firstKey = 1 + $entryToFill - $cacheMaxEntries; - } - - $lastKey = $entryToFill; - - for ( $i = $firstKey; $i <= $lastKey; $i++ ) { - $expected["cache-key-$i"] = array( "prop-$i" => "value-$i" ); - } - - return $expected; - } - - /** - * Highlight diff between assertEquals and assertNotSame - */ - public function testPhpUnitArrayEquality() { - $one = array( 'A' => 1, 'B' => 2 ); - $two = array( 'B' => 2, 'A' => 1 ); - $this->assertEquals( $one, $two ); // == - $this->assertNotSame( $one, $two ); // === - } - - /** - * @dataProvider provideInvalidConstructorArg - * @expectedException MWException - */ - public function testConstructorGivenInvalidValue( $maxSize ) { - new ProcessCacheLRUTestable( $maxSize ); - } - - /** - * Value which are forbidden by the constructor - */ - public static function provideInvalidConstructorArg() { - return array( - array( null ), - array( array() ), - array( new stdClass() ), - array( 0 ), - array( '5' ), - array( -1 ), - ); - } - - public function testAddAndGetAKey() { - $oneCache = new ProcessCacheLRUTestable( 1 ); - $this->assertCacheEmpty( $oneCache ); - - // First set just one value - $oneCache->set( 'cache-key', 'prop1', 'value1' ); - $this->assertEquals( 1, $oneCache->getEntriesCount() ); - $this->assertTrue( $oneCache->has( 'cache-key', 'prop1' ) ); - $this->assertEquals( 'value1', $oneCache->get( 'cache-key', 'prop1' ) ); - } - - public function testDeleteOldKey() { - $oneCache = new ProcessCacheLRUTestable( 1 ); - $this->assertCacheEmpty( $oneCache ); - - $oneCache->set( 'cache-key', 'prop1', 'value1' ); - $oneCache->set( 'cache-key', 'prop1', 'value2' ); - $this->assertEquals( 'value2', $oneCache->get( 'cache-key', 'prop1' ) ); - } - - /** - * This test that we properly overflow when filling a cache with - * a sequence of always different cache-keys. Meant to verify we correclty - * delete the older key. - * - * @dataProvider provideCacheFilling - * @param $cacheMaxEntries Maximum entry the created cache will hold - * @param $entryToFill Number of entries to insert in the created cache. - */ - public function testFillingCache( $cacheMaxEntries, $entryToFill, $msg = '' ) { - $cache = new ProcessCacheLRUTestable( $cacheMaxEntries ); - $this->fillCache( $cache, $entryToFill ); - - $this->assertSame( - $this->getExpectedCache( $cacheMaxEntries, $entryToFill ), - $cache->getCache(), - "Filling a $cacheMaxEntries entries cache with $entryToFill entries" - ); - } - - /** - * Provider for testFillingCache - */ - public static function provideCacheFilling() { - // ($cacheMaxEntries, $entryToFill, $msg='') - return array( - array( 1, 0 ), - array( 1, 1 ), - array( 1, 2 ), # overflow - array( 5, 33 ), # overflow - ); - } - - /** - * Create a cache with only one remaining entry then update - * the first inserted entry. Should bump it to the top. - */ - public function testReplaceExistingKeyShouldBumpEntryToTop() { - $maxEntries = 3; - - $cache = new ProcessCacheLRUTestable( $maxEntries ); - // Fill cache leaving just one remaining slot - $this->fillCache( $cache, $maxEntries - 1 ); - - // Set an existing cache key - $cache->set( "cache-key-1", "prop-1", "new-value-for-1" ); - - $this->assertSame( - array( - 'cache-key-2' => array( 'prop-2' => 'value-2' ), - 'cache-key-1' => array( 'prop-1' => 'new-value-for-1' ), - ), - $cache->getCache() - ); - } - - public function testRecentlyAccessedKeyStickIn() { - $cache = new ProcessCacheLRUTestable( 2 ); - $cache->set( 'first', 'prop1', 'value1' ); - $cache->set( 'second', 'prop2', 'value2' ); - - // Get first - $cache->get( 'first', 'prop1' ); - // Cache a third value, should invalidate the least used one - $cache->set( 'third', 'prop3', 'value3' ); - - $this->assertFalse( $cache->has( 'second', 'prop2' ) ); - } - - /** - * This first create a full cache then update the value for the 2nd - * filled entry. - * Given a cache having 1,2,3 as key, updating 2 should bump 2 to - * the top of the queue with the new value: 1,3,2* (* = updated). - */ - public function testReplaceExistingKeyInAFullCacheShouldBumpToTop() { - $maxEntries = 3; - - $cache = new ProcessCacheLRUTestable( $maxEntries ); - $this->fillCache( $cache, $maxEntries ); - - // Set an existing cache key - $cache->set( "cache-key-2", "prop-2", "new-value-for-2" ); - $this->assertSame( - array( - 'cache-key-1' => array( 'prop-1' => 'value-1' ), - 'cache-key-3' => array( 'prop-3' => 'value-3' ), - 'cache-key-2' => array( 'prop-2' => 'new-value-for-2' ), - ), - $cache->getCache() - ); - $this->assertEquals( 'new-value-for-2', - $cache->get( 'cache-key-2', 'prop-2' ) - ); - } - - public function testBumpExistingKeyToTop() { - $cache = new ProcessCacheLRUTestable( 3 ); - $this->fillCache( $cache, 3 ); - - // Set the very first cache key to a new value - $cache->set( "cache-key-1", "prop-1", "new value for 1" ); - $this->assertEquals( - array( - 'cache-key-2' => array( 'prop-2' => 'value-2' ), - 'cache-key-3' => array( 'prop-3' => 'value-3' ), - 'cache-key-1' => array( 'prop-1' => 'new value for 1' ), - ), - $cache->getCache() - ); - } -} - -/** - * Overrides some ProcessCacheLRU methods and properties accessibility. - */ -class ProcessCacheLRUTestable extends ProcessCacheLRU { - public $cache = array(); - - public function getCache() { - return $this->cache; - } - - public function getEntriesCount() { - return count( $this->cache ); - } -} diff --git a/tests/phpunit/includes/content/ContentHandlerTest.php b/tests/phpunit/includes/content/ContentHandlerTest.php deleted file mode 100644 index aedf594d..00000000 --- a/tests/phpunit/includes/content/ContentHandlerTest.php +++ /dev/null @@ -1,451 +0,0 @@ -setMwGlobals( array( - 'wgExtraNamespaces' => array( - 12312 => 'Dummy', - 12313 => 'Dummy_talk', - ), - // The below tests assume that namespaces not mentioned here (Help, User, MediaWiki, ..) - // default to CONTENT_MODEL_WIKITEXT. - 'wgNamespaceContentModels' => array( - 12312 => 'testing', - ), - 'wgContentHandlers' => array( - CONTENT_MODEL_WIKITEXT => 'WikitextContentHandler', - CONTENT_MODEL_JAVASCRIPT => 'JavaScriptContentHandler', - CONTENT_MODEL_CSS => 'CssContentHandler', - CONTENT_MODEL_TEXT => 'TextContentHandler', - 'testing' => 'DummyContentHandlerForTesting', - ), - ) ); - - // Reset namespace cache - MWNamespace::getCanonicalNamespaces( true ); - $wgContLang->resetNamespaces(); - } - - public function tearDown() { - global $wgContLang; - - // Reset namespace cache - MWNamespace::getCanonicalNamespaces( true ); - $wgContLang->resetNamespaces(); - - parent::tearDown(); - } - - public static function dataGetDefaultModelFor() { - return array( - array( 'Help:Foo', CONTENT_MODEL_WIKITEXT ), - array( 'Help:Foo.js', CONTENT_MODEL_WIKITEXT ), - array( 'Help:Foo/bar.js', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo.js', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo/bar.js', CONTENT_MODEL_JAVASCRIPT ), - array( 'User:Foo/bar.css', CONTENT_MODEL_CSS ), - array( 'User talk:Foo/bar.css', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo/bar.js.xxx', CONTENT_MODEL_WIKITEXT ), - array( 'User:Foo/bar.xxx', CONTENT_MODEL_WIKITEXT ), - array( 'MediaWiki:Foo.js', CONTENT_MODEL_JAVASCRIPT ), - array( 'MediaWiki:Foo.css', CONTENT_MODEL_CSS ), - array( 'MediaWiki:Foo.JS', CONTENT_MODEL_WIKITEXT ), - array( 'MediaWiki:Foo.CSS', CONTENT_MODEL_WIKITEXT ), - array( 'MediaWiki:Foo.css.xxx', CONTENT_MODEL_WIKITEXT ), - ); - } - - /** - * @dataProvider dataGetDefaultModelFor - * @covers ContentHandler::getDefaultModelFor - */ - public function testGetDefaultModelFor( $title, $expectedModelId ) { - $title = Title::newFromText( $title ); - $this->assertEquals( $expectedModelId, ContentHandler::getDefaultModelFor( $title ) ); - } - - /** - * @dataProvider dataGetDefaultModelFor - * @covers ContentHandler::getForTitle - */ - public function testGetForTitle( $title, $expectedContentModel ) { - $title = Title::newFromText( $title ); - $handler = ContentHandler::getForTitle( $title ); - $this->assertEquals( $expectedContentModel, $handler->getModelID() ); - } - - public static function dataGetLocalizedName() { - return array( - array( null, null ), - array( "xyzzy", null ), - - // XXX: depends on content language - array( CONTENT_MODEL_JAVASCRIPT, '/javascript/i' ), - ); - } - - /** - * @dataProvider dataGetLocalizedName - * @covers ContentHandler::getLocalizedName - */ - public function testGetLocalizedName( $id, $expected ) { - $name = ContentHandler::getLocalizedName( $id ); - - if ( $expected ) { - $this->assertNotNull( $name, "no name found for content model $id" ); - $this->assertTrue( preg_match( $expected, $name ) > 0, - "content model name for #$id did not match pattern $expected" - ); - } else { - $this->assertEquals( $id, $name, "localization of unknown model $id should have " - . "fallen back to use the model id directly." - ); - } - } - - public static function dataGetPageLanguage() { - global $wgLanguageCode; - - return array( - array( "Main", $wgLanguageCode ), - array( "Dummy:Foo", $wgLanguageCode ), - array( "MediaWiki:common.js", 'en' ), - array( "User:Foo/common.js", 'en' ), - array( "MediaWiki:common.css", 'en' ), - array( "User:Foo/common.css", 'en' ), - array( "User:Foo", $wgLanguageCode ), - - array( CONTENT_MODEL_JAVASCRIPT, 'javascript' ), - ); - } - - /** - * @dataProvider dataGetPageLanguage - * @covers ContentHandler::getPageLanguage - */ - public function testGetPageLanguage( $title, $expected ) { - if ( is_string( $title ) ) { - $title = Title::newFromText( $title ); - } - - $expected = wfGetLangObj( $expected ); - - $handler = ContentHandler::getForTitle( $title ); - $lang = $handler->getPageLanguage( $title ); - - $this->assertEquals( $expected->getCode(), $lang->getCode() ); - } - - public static function dataGetContentText_Null() { - return array( - array( 'fail' ), - array( 'serialize' ), - array( 'ignore' ), - ); - } - - /** - * @dataProvider dataGetContentText_Null - * @covers ContentHandler::getContentText - */ - public function testGetContentText_Null( $contentHandlerTextFallback ) { - $this->setMwGlobals( 'wgContentHandlerTextFallback', $contentHandlerTextFallback ); - - $content = null; - - $text = ContentHandler::getContentText( $content ); - $this->assertEquals( '', $text ); - } - - public static function dataGetContentText_TextContent() { - return array( - array( 'fail' ), - array( 'serialize' ), - array( 'ignore' ), - ); - } - - /** - * @dataProvider dataGetContentText_TextContent - * @covers ContentHandler::getContentText - */ - public function testGetContentText_TextContent( $contentHandlerTextFallback ) { - $this->setMwGlobals( 'wgContentHandlerTextFallback', $contentHandlerTextFallback ); - - $content = new WikitextContent( "hello world" ); - - $text = ContentHandler::getContentText( $content ); - $this->assertEquals( $content->getNativeData(), $text ); - } - - /** - * ContentHandler::getContentText should have thrown an exception for non-text Content object - * @expectedException MWException - * @covers ContentHandler::getContentText - */ - public function testGetContentText_NonTextContent_fail() { - $this->setMwGlobals( 'wgContentHandlerTextFallback', 'fail' ); - - $content = new DummyContentForTesting( "hello world" ); - - ContentHandler::getContentText( $content ); - } - - /** - * @covers ContentHandler::getContentText - */ - public function testGetContentText_NonTextContent_serialize() { - $this->setMwGlobals( 'wgContentHandlerTextFallback', 'serialize' ); - - $content = new DummyContentForTesting( "hello world" ); - - $text = ContentHandler::getContentText( $content ); - $this->assertEquals( $content->serialize(), $text ); - } - - /** - * @covers ContentHandler::getContentText - */ - public function testGetContentText_NonTextContent_ignore() { - $this->setMwGlobals( 'wgContentHandlerTextFallback', 'ignore' ); - - $content = new DummyContentForTesting( "hello world" ); - - $text = ContentHandler::getContentText( $content ); - $this->assertNull( $text ); - } - - /* - public static function makeContent( $text, Title $title, $modelId = null, $format = null ) {} - */ - - public static function dataMakeContent() { - return array( - array( 'hallo', 'Help:Test', null, null, CONTENT_MODEL_WIKITEXT, 'hallo', false ), - array( 'hallo', 'MediaWiki:Test.js', null, null, CONTENT_MODEL_JAVASCRIPT, 'hallo', false ), - array( serialize( 'hallo' ), 'Dummy:Test', null, null, "testing", 'hallo', false ), - - array( 'hallo', 'Help:Test', null, CONTENT_FORMAT_WIKITEXT, CONTENT_MODEL_WIKITEXT, 'hallo', false ), - array( 'hallo', 'MediaWiki:Test.js', null, CONTENT_FORMAT_JAVASCRIPT, CONTENT_MODEL_JAVASCRIPT, 'hallo', false ), - array( serialize( 'hallo' ), 'Dummy:Test', null, "testing", "testing", 'hallo', false ), - - array( 'hallo', 'Help:Test', CONTENT_MODEL_CSS, null, CONTENT_MODEL_CSS, 'hallo', false ), - array( 'hallo', 'MediaWiki:Test.js', CONTENT_MODEL_CSS, null, CONTENT_MODEL_CSS, 'hallo', false ), - array( serialize( 'hallo' ), 'Dummy:Test', CONTENT_MODEL_CSS, null, CONTENT_MODEL_CSS, serialize( 'hallo' ), false ), - - array( 'hallo', 'Help:Test', CONTENT_MODEL_WIKITEXT, "testing", null, null, true ), - array( 'hallo', 'MediaWiki:Test.js', CONTENT_MODEL_CSS, "testing", null, null, true ), - array( 'hallo', 'Dummy:Test', CONTENT_MODEL_JAVASCRIPT, "testing", null, null, true ), - ); - } - - /** - * @dataProvider dataMakeContent - * @covers ContentHandler::makeContent - */ - public function testMakeContent( $data, $title, $modelId, $format, $expectedModelId, $expectedNativeData, $shouldFail ) { - $title = Title::newFromText( $title ); - - try { - $content = ContentHandler::makeContent( $data, $title, $modelId, $format ); - - if ( $shouldFail ) { - $this->fail( "ContentHandler::makeContent should have failed!" ); - } - - $this->assertEquals( $expectedModelId, $content->getModel(), 'bad model id' ); - $this->assertEquals( $expectedNativeData, $content->getNativeData(), 'bads native data' ); - } catch ( MWException $ex ) { - if ( !$shouldFail ) { - $this->fail( "ContentHandler::makeContent failed unexpectedly: " . $ex->getMessage() ); - } else { - // dummy, so we don't get the "test did not perform any assertions" message. - $this->assertTrue( true ); - } - } - } - - /* - public function testSupportsSections() { - $this->markTestIncomplete( "not yet implemented" ); - } - */ - - /** - * @covers ContentHandler::runLegacyHooks - */ - public function testRunLegacyHooks() { - Hooks::register( 'testRunLegacyHooks', __CLASS__ . '::dummyHookHandler' ); - - $content = new WikitextContent( 'test text' ); - $ok = ContentHandler::runLegacyHooks( 'testRunLegacyHooks', array( 'foo', &$content, 'bar' ), false ); - - $this->assertTrue( $ok, "runLegacyHooks should have returned true" ); - $this->assertEquals( "TEST TEXT", $content->getNativeData() ); - } - - public static function dummyHookHandler( $foo, &$text, $bar ) { - if ( $text === null || $text === false ) { - return false; - } - - $text = strtoupper( $text ); - - return true; - } -} - -class DummyContentHandlerForTesting extends ContentHandler { - - public function __construct( $dataModel ) { - parent::__construct( $dataModel, array( "testing" ) ); - } - - /** - * Serializes Content object of the type supported by this ContentHandler. - * - * @param Content $content the Content object to serialize - * @param null $format the desired serialization format - * @return String serialized form of the content - */ - public function serializeContent( Content $content, $format = null ) { - return $content->serialize(); - } - - /** - * Unserializes a Content object of the type supported by this ContentHandler. - * - * @param $blob String serialized form of the content - * @param null $format the format used for serialization - * @return Content the Content object created by deserializing $blob - */ - public function unserializeContent( $blob, $format = null ) { - $d = unserialize( $blob ); - - return new DummyContentForTesting( $d ); - } - - /** - * Creates an empty Content object of the type supported by this ContentHandler. - * - */ - public function makeEmptyContent() { - return new DummyContentForTesting( '' ); - } -} - -class DummyContentForTesting extends AbstractContent { - - public function __construct( $data ) { - parent::__construct( "testing" ); - - $this->data = $data; - } - - public function serialize( $format = null ) { - return serialize( $this->data ); - } - - /** - * @return String a string representing the content in a way useful for building a full text search index. - * If no useful representation exists, this method returns an empty string. - */ - public function getTextForSearchIndex() { - return ''; - } - - /** - * @return String the wikitext to include when another page includes this content, or false if the content is not - * includable in a wikitext page. - */ - public function getWikitextForTransclusion() { - return false; - } - - /** - * Returns a textual representation of the content suitable for use in edit summaries and log messages. - * - * @param int $maxlength Maximum length of the summary text. - * @return string The summary text. - */ - public function getTextForSummary( $maxlength = 250 ) { - return ''; - } - - /** - * Returns native represenation of the data. Interpretation depends on the data model used, - * as given by getDataModel(). - * - * @return mixed the native representation of the content. Could be a string, a nested array - * structure, an object, a binary blob... anything, really. - */ - public function getNativeData() { - return $this->data; - } - - /** - * returns the content's nominal size in bogo-bytes. - * - * @return int - */ - public function getSize() { - return strlen( $this->data ); - } - - /** - * Return a copy of this Content object. The following must be true for the object returned - * if $copy = $original->copy() - * - * * get_class($original) === get_class($copy) - * * $original->getModel() === $copy->getModel() - * * $original->equals( $copy ) - * - * If and only if the Content object is imutable, the copy() method can and should - * return $this. That is, $copy === $original may be true, but only for imutable content - * objects. - * - * @return Content. A copy of this object. - */ - public function copy() { - return $this; - } - - /** - * Returns true if this content is countable as a "real" wiki page, provided - * that it's also in a countable location (e.g. a current revision in the main namespace). - * - * @param boolean $hasLinks if it is known whether this content contains links, provide this information here, - * to avoid redundant parsing to find out. - * @return boolean - */ - public function isCountable( $hasLinks = null ) { - return false; - } - - /** - * @param Title $title - * @param null $revId - * @param null|ParserOptions $options - * @param boolean $generateHtml whether to generate Html (default: true). If false, - * the result of calling getText() on the ParserOutput object returned by - * this method is undefined. - * - * @return ParserOutput - */ - public function getParserOutput( Title $title, $revId = null, ParserOptions $options = null, $generateHtml = true ) { - return new ParserOutput( $this->getNativeData() ); - } -} diff --git a/tests/phpunit/includes/content/CssContentTest.php b/tests/phpunit/includes/content/CssContentTest.php deleted file mode 100644 index bd6d41fe..00000000 --- a/tests/phpunit/includes/content/CssContentTest.php +++ /dev/null @@ -1,87 +0,0 @@ -setName( '127.0.0.1' ); - - $this->setMwGlobals( array( - 'wgUser' => $user, - 'wgTextModelsToParse' => array( - CONTENT_MODEL_CSS, - ) - ) ); - } - - public function newContent( $text ) { - return new CssContent( $text ); - } - - public static function dataGetParserOutput() { - return array( - array( - 'MediaWiki:Test.css', - null, - "hello \n", - "
            \nhello <world>\n\n
            " - ), - array( - 'MediaWiki:Test.css', - null, - "/* hello [[world]] */\n", - "
            \n/* hello [[world]] */\n\n
            ", - array( - 'Links' => array( - array( 'World' => 0 ) - ) - ) - ), - - // TODO: more...? - ); - } - - /** - * @covers CssContent::getModel - */ - public function testGetModel() { - $content = $this->newContent( 'hello world.' ); - - $this->assertEquals( CONTENT_MODEL_CSS, $content->getModel() ); - } - - /** - * @covers CssContent::getContentHandler - */ - public function testGetContentHandler() { - $content = $this->newContent( 'hello world.' ); - - $this->assertEquals( CONTENT_MODEL_CSS, $content->getContentHandler()->getModelID() ); - } - - public static function dataEquals() { - return array( - array( new CssContent( 'hallo' ), null, false ), - array( new CssContent( 'hallo' ), new CssContent( 'hallo' ), true ), - array( new CssContent( 'hallo' ), new WikitextContent( 'hallo' ), false ), - array( new CssContent( 'hallo' ), new CssContent( 'HALLO' ), false ), - ); - } - - /** - * @dataProvider dataEquals - * @covers CssContent::equals - */ - public function testEquals( Content $a, Content $b = null, $equal = false ) { - $this->assertEquals( $equal, $a->equals( $b ) ); - } -} diff --git a/tests/phpunit/includes/content/JavaScriptContentTest.php b/tests/phpunit/includes/content/JavaScriptContentTest.php deleted file mode 100644 index c8616ff0..00000000 --- a/tests/phpunit/includes/content/JavaScriptContentTest.php +++ /dev/null @@ -1,287 +0,0 @@ -\n", - "
            \nhello <world>\n\n
            " - ), - array( - 'MediaWiki:Test.js', - null, - "hello(); // [[world]]\n", - "
            \nhello(); // [[world]]\n\n
            ", - array( - 'Links' => array( - array( 'World' => 0 ) - ) - ) - ), - - // TODO: more...? - ); - } - - // XXX: Unused function - public static function dataGetSection() { - return array( - array( WikitextContentTest::$sections, - '0', - null - ), - array( WikitextContentTest::$sections, - '2', - null - ), - array( WikitextContentTest::$sections, - '8', - null - ), - ); - } - - // XXX: Unused function - public static function dataReplaceSection() { - return array( - array( WikitextContentTest::$sections, - '0', - 'No more', - null, - null - ), - array( WikitextContentTest::$sections, - '', - 'No more', - null, - null - ), - array( WikitextContentTest::$sections, - '2', - "== TEST ==\nmore fun", - null, - null - ), - array( WikitextContentTest::$sections, - '8', - 'No more', - null, - null - ), - array( WikitextContentTest::$sections, - 'new', - 'No more', - 'New', - null - ), - ); - } - - /** - * @covers JavaScriptContent::addSectionHeader - */ - public function testAddSectionHeader() { - $content = $this->newContent( 'hello world' ); - $c = $content->addSectionHeader( 'test' ); - - $this->assertTrue( $content->equals( $c ) ); - } - - // XXX: currently, preSaveTransform is applied to scripts. this may change or become optional. - public static function dataPreSaveTransform() { - return array( - array( 'hello this is ~~~', - "hello this is [[Special:Contributions/127.0.0.1|127.0.0.1]]", - ), - array( 'hello \'\'this\'\' is ~~~', - 'hello \'\'this\'\' is ~~~', - ), - array( " Foo \n ", - " Foo", - ), - ); - } - - public static function dataPreloadTransform() { - return array( - array( 'hello this is ~~~', - 'hello this is ~~~', - ), - array( 'hello \'\'this\'\' is foobar', - 'hello \'\'this\'\' is foobar', - ), - ); - } - - public static function dataGetRedirectTarget() { - return array( - array( '#REDIRECT [[Test]]', - null, - ), - array( '#REDIRECT Test', - null, - ), - array( '* #REDIRECT [[Test]]', - null, - ), - ); - } - - /** - * @todo Test needs database! - */ - /* - public function getRedirectChain() { - $text = $this->getNativeData(); - return Title::newFromRedirectArray( $text ); - } - */ - - /** - * @todo Test needs database! - */ - /* - public function getUltimateRedirectTarget() { - $text = $this->getNativeData(); - return Title::newFromRedirectRecurse( $text ); - } - */ - - public static function dataIsCountable() { - return array( - array( '', - null, - 'any', - true - ), - array( 'Foo', - null, - 'any', - true - ), - array( 'Foo', - null, - 'comma', - false - ), - array( 'Foo, bar', - null, - 'comma', - false - ), - array( 'Foo', - null, - 'link', - false - ), - array( 'Foo [[bar]]', - null, - 'link', - false - ), - array( 'Foo', - true, - 'link', - false - ), - array( 'Foo [[bar]]', - false, - 'link', - false - ), - array( '#REDIRECT [[bar]]', - true, - 'any', - true - ), - array( '#REDIRECT [[bar]]', - true, - 'comma', - false - ), - array( '#REDIRECT [[bar]]', - true, - 'link', - false - ), - ); - } - - public static function dataGetTextForSummary() { - return array( - array( "hello\nworld.", - 16, - 'hello world.', - ), - array( 'hello world.', - 8, - 'hello...', - ), - array( '[[hello world]].', - 8, - '[[hel...', - ), - ); - } - - /** - * @covers JavaScriptContent::matchMagicWord - */ - public function testMatchMagicWord() { - $mw = MagicWord::get( "staticredirect" ); - - $content = $this->newContent( "#REDIRECT [[FOO]]\n__STATICREDIRECT__" ); - $this->assertFalse( $content->matchMagicWord( $mw ), "should not have matched magic word, since it's not wikitext" ); - } - - /** - * @covers JavaScriptContent::updateRedirect - */ - public function testUpdateRedirect() { - $target = Title::newFromText( "testUpdateRedirect_target" ); - - $content = $this->newContent( "#REDIRECT [[Someplace]]" ); - $newContent = $content->updateRedirect( $target ); - - $this->assertTrue( $content->equals( $newContent ), "content should be unchanged since it's not wikitext" ); - } - - /** - * @covers JavaScriptContent::getModel - */ - public function testGetModel() { - $content = $this->newContent( "hello world." ); - - $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $content->getModel() ); - } - - /** - * @covers JavaScriptContent::getContentHandler - */ - public function testGetContentHandler() { - $content = $this->newContent( "hello world." ); - - $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, $content->getContentHandler()->getModelID() ); - } - - public static function dataEquals() { - return array( - array( new JavaScriptContent( "hallo" ), null, false ), - array( new JavaScriptContent( "hallo" ), new JavaScriptContent( "hallo" ), true ), - array( new JavaScriptContent( "hallo" ), new CssContent( "hallo" ), false ), - array( new JavaScriptContent( "hallo" ), new JavaScriptContent( "HALLO" ), false ), - ); - } -} diff --git a/tests/phpunit/includes/content/TextContentTest.php b/tests/phpunit/includes/content/TextContentTest.php deleted file mode 100644 index a1f099f3..00000000 --- a/tests/phpunit/includes/content/TextContentTest.php +++ /dev/null @@ -1,458 +0,0 @@ -setName( '127.0.0.1' ); - - $this->setMwGlobals( array( - 'wgUser' => $user, - 'wgTextModelsToParse' => array( - CONTENT_MODEL_WIKITEXT, - CONTENT_MODEL_CSS, - CONTENT_MODEL_JAVASCRIPT, - ), - 'wgUseTidy' => false, - 'wgAlwaysUseTidy' => false, - ) ); - - $this->context = new RequestContext( new FauxRequest() ); - $this->context->setTitle( Title::newFromText( 'Test' ) ); - $this->context->setUser( $user ); - } - - public function newContent( $text ) { - return new TextContent( $text ); - } - - public static function dataGetParserOutput() { - return array( - array( - 'TextContentTest_testGetParserOutput', - CONTENT_MODEL_TEXT, - "hello ''world'' & [[stuff]]\n", "hello ''world'' & [[stuff]]", - array( - 'Links' => array() - ) - ), - // TODO: more...? - ); - } - - /** - * @dataProvider dataGetParserOutput - * @covers TextContent::getParserOutput - */ - public function testGetParserOutput( $title, $model, $text, $expectedHtml, $expectedFields = null ) { - $title = Title::newFromText( $title ); - $content = ContentHandler::makeContent( $text, $title, $model ); - - $po = $content->getParserOutput( $title ); - - $html = $po->getText(); - $html = preg_replace( '##sm', '', $html ); // strip comments - - $this->assertEquals( $expectedHtml, trim( $html ) ); - - if ( $expectedFields ) { - foreach ( $expectedFields as $field => $exp ) { - $f = 'get' . ucfirst( $field ); - $v = call_user_func( array( $po, $f ) ); - - if ( is_array( $exp ) ) { - $this->assertArrayEquals( $exp, $v ); - } else { - $this->assertEquals( $exp, $v ); - } - } - } - - // TODO: assert more properties - } - - public static function dataPreSaveTransform() { - return array( - array( - #0: no signature resolution - 'hello this is ~~~', - 'hello this is ~~~', - ), - array( - #1: rtrim - " Foo \n ", - ' Foo', - ), - ); - } - - /** - * @dataProvider dataPreSaveTransform - * @covers TextContent::preSaveTransform - */ - public function testPreSaveTransform( $text, $expected ) { - global $wgContLang; - - $options = ParserOptions::newFromUserAndLang( $this->context->getUser(), $wgContLang ); - - $content = $this->newContent( $text ); - $content = $content->preSaveTransform( $this->context->getTitle(), $this->context->getUser(), $options ); - - $this->assertEquals( $expected, $content->getNativeData() ); - } - - public static function dataPreloadTransform() { - return array( - array( - 'hello this is ~~~', - 'hello this is ~~~', - ), - ); - } - - /** - * @dataProvider dataPreloadTransform - * @covers TextContent::preloadTransform - */ - public function testPreloadTransform( $text, $expected ) { - global $wgContLang; - $options = ParserOptions::newFromUserAndLang( $this->context->getUser(), $wgContLang ); - - $content = $this->newContent( $text ); - $content = $content->preloadTransform( $this->context->getTitle(), $options ); - - $this->assertEquals( $expected, $content->getNativeData() ); - } - - public static function dataGetRedirectTarget() { - return array( - array( '#REDIRECT [[Test]]', - null, - ), - ); - } - - /** - * @dataProvider dataGetRedirectTarget - * @covers TextContent::getRedirectTarget - */ - public function testGetRedirectTarget( $text, $expected ) { - $content = $this->newContent( $text ); - $t = $content->getRedirectTarget(); - - if ( is_null( $expected ) ) { - $this->assertNull( $t, "text should not have generated a redirect target: $text" ); - } else { - $this->assertEquals( $expected, $t->getPrefixedText() ); - } - } - - /** - * @dataProvider dataGetRedirectTarget - * @covers TextContent::isRedirect - */ - public function testIsRedirect( $text, $expected ) { - $content = $this->newContent( $text ); - - $this->assertEquals( !is_null( $expected ), $content->isRedirect() ); - } - - /** - * @todo Test needs database! Should be done by a test class in the Database group. - */ - /* - public function getRedirectChain() { - $text = $this->getNativeData(); - return Title::newFromRedirectArray( $text ); - } - */ - - /** - * @todo Test needs database! Should be done by a test class in the Database group. - */ - /* - public function getUltimateRedirectTarget() { - $text = $this->getNativeData(); - return Title::newFromRedirectRecurse( $text ); - } - */ - - public static function dataIsCountable() { - return array( - array( '', - null, - 'any', - true - ), - array( 'Foo', - null, - 'any', - true - ), - array( 'Foo', - null, - 'comma', - false - ), - array( 'Foo, bar', - null, - 'comma', - false - ), - ); - } - - /** - * @dataProvider dataIsCountable - * @group Database - * @covers TextContent::isCountable - */ - public function testIsCountable( $text, $hasLinks, $mode, $expected ) { - $this->setMwGlobals( 'wgArticleCountMethod', $mode ); - - $content = $this->newContent( $text ); - - $v = $content->isCountable( $hasLinks, $this->context->getTitle() ); - - $this->assertEquals( $expected, $v, 'isCountable() returned unexpected value ' . var_export( $v, true ) - . ' instead of ' . var_export( $expected, true ) . " in mode `$mode` for text \"$text\"" ); - } - - public static function dataGetTextForSummary() { - return array( - array( "hello\nworld.", - 16, - 'hello world.', - ), - array( 'hello world.', - 8, - 'hello...', - ), - array( '[[hello world]].', - 8, - '[[hel...', - ), - ); - } - - /** - * @dataProvider dataGetTextForSummary - * @covers TextContent::getTextForSummary - */ - public function testGetTextForSummary( $text, $maxlength, $expected ) { - $content = $this->newContent( $text ); - - $this->assertEquals( $expected, $content->getTextForSummary( $maxlength ) ); - } - - /** - * @covers TextContent::getTextForSearchIndex - */ - public function testGetTextForSearchIndex() { - $content = $this->newContent( 'hello world.' ); - - $this->assertEquals( 'hello world.', $content->getTextForSearchIndex() ); - } - - /** - * @covers TextContent::copy - */ - public function testCopy() { - $content = $this->newContent( 'hello world.' ); - $copy = $content->copy(); - - $this->assertTrue( $content->equals( $copy ), 'copy must be equal to original' ); - $this->assertEquals( 'hello world.', $copy->getNativeData() ); - } - - /** - * @covers TextContent::getSize - */ - public function testGetSize() { - $content = $this->newContent( 'hello world.' ); - - $this->assertEquals( 12, $content->getSize() ); - } - - /** - * @covers TextContent::getNativeData - */ - public function testGetNativeData() { - $content = $this->newContent( 'hello world.' ); - - $this->assertEquals( 'hello world.', $content->getNativeData() ); - } - - /** - * @covers TextContent::getWikitextForTransclusion - */ - public function testGetWikitextForTransclusion() { - $content = $this->newContent( 'hello world.' ); - - $this->assertEquals( 'hello world.', $content->getWikitextForTransclusion() ); - } - - /** - * @covers TextContent::getModel - */ - public function testGetModel() { - $content = $this->newContent( "hello world." ); - - $this->assertEquals( CONTENT_MODEL_TEXT, $content->getModel() ); - } - - /** - * @covers TextContent::getContentHandler - */ - public function testGetContentHandler() { - $content = $this->newContent( "hello world." ); - - $this->assertEquals( CONTENT_MODEL_TEXT, $content->getContentHandler()->getModelID() ); - } - - public static function dataIsEmpty() { - return array( - array( '', true ), - array( ' ', false ), - array( '0', false ), - array( 'hallo welt.', false ), - ); - } - - /** - * @dataProvider dataIsEmpty - * @covers TextContent::isEmpty - */ - public function testIsEmpty( $text, $empty ) { - $content = $this->newContent( $text ); - - $this->assertEquals( $empty, $content->isEmpty() ); - } - - public static function dataEquals() { - return array( - array( new TextContent( "hallo" ), null, false ), - array( new TextContent( "hallo" ), new TextContent( "hallo" ), true ), - array( new TextContent( "hallo" ), new JavaScriptContent( "hallo" ), false ), - array( new TextContent( "hallo" ), new WikitextContent( "hallo" ), false ), - array( new TextContent( "hallo" ), new TextContent( "HALLO" ), false ), - ); - } - - /** - * @dataProvider dataEquals - * @covers TextContent::equals - */ - public function testEquals( Content $a, Content $b = null, $equal = false ) { - $this->assertEquals( $equal, $a->equals( $b ) ); - } - - public static function dataGetDeletionUpdates() { - return array( - array( "TextContentTest_testGetSecondaryDataUpdates_1", - CONTENT_MODEL_TEXT, "hello ''world''\n", - array() - ), - array( "TextContentTest_testGetSecondaryDataUpdates_2", - CONTENT_MODEL_TEXT, "hello [[world test 21344]]\n", - array() - ), - // TODO: more...? - ); - } - - /** - * @dataProvider dataGetDeletionUpdates - * @covers TextContent::getDeletionUpdates - */ - public function testDeletionUpdates( $title, $model, $text, $expectedStuff ) { - $ns = $this->getDefaultWikitextNS(); - $title = Title::newFromText( $title, $ns ); - - $content = ContentHandler::makeContent( $text, $title, $model ); - - $page = WikiPage::factory( $title ); - $page->doEditContent( $content, '' ); - - $updates = $content->getDeletionUpdates( $page ); - - // make updates accessible by class name - foreach ( $updates as $update ) { - $class = get_class( $update ); - $updates[$class] = $update; - } - - if ( !$expectedStuff ) { - $this->assertTrue( true ); // make phpunit happy - return; - } - - foreach ( $expectedStuff as $class => $fieldValues ) { - $this->assertArrayHasKey( $class, $updates, "missing an update of type $class" ); - - $update = $updates[$class]; - - foreach ( $fieldValues as $field => $value ) { - $v = $update->$field; #if the field doesn't exist, just crash and burn - $this->assertEquals( $value, $v, "unexpected value for field $field in instance of $class" ); - } - } - - $page->doDeleteArticle( '' ); - } - - public static function provideConvert() { - return array( - array( // #0 - 'Hallo Welt', - CONTENT_MODEL_WIKITEXT, - 'lossless', - 'Hallo Welt' - ), - array( // #1 - 'Hallo Welt', - CONTENT_MODEL_WIKITEXT, - 'lossless', - 'Hallo Welt' - ), - array( // #1 - 'Hallo Welt', - CONTENT_MODEL_CSS, - 'lossless', - 'Hallo Welt' - ), - array( // #1 - 'Hallo Welt', - CONTENT_MODEL_JAVASCRIPT, - 'lossless', - 'Hallo Welt' - ), - ); - } - - /** - * @dataProvider provideConvert - * @covers TextContent::convert - */ - public function testConvert( $text, $model, $lossy, $expectedNative ) { - $content = $this->newContent( $text ); - - $converted = $content->convert( $model, $lossy ); - - if ( $expectedNative === false ) { - $this->assertFalse( $converted, "conversion to $model was expected to fail!" ); - } else { - $this->assertInstanceOf( 'Content', $converted ); - $this->assertEquals( $expectedNative, $converted->getNativeData() ); - } - } -} diff --git a/tests/phpunit/includes/content/WikitextContentHandlerTest.php b/tests/phpunit/includes/content/WikitextContentHandlerTest.php deleted file mode 100644 index 75a72784..00000000 --- a/tests/phpunit/includes/content/WikitextContentHandlerTest.php +++ /dev/null @@ -1,227 +0,0 @@ -handler = ContentHandler::getForModelID( CONTENT_MODEL_WIKITEXT ); - } - - /** - * @covers WikitextContentHandler::serializeContent - */ - public function testSerializeContent() { - $content = new WikitextContent( 'hello world' ); - - $this->assertEquals( 'hello world', $this->handler->serializeContent( $content ) ); - $this->assertEquals( 'hello world', $this->handler->serializeContent( $content, CONTENT_FORMAT_WIKITEXT ) ); - - try { - $this->handler->serializeContent( $content, 'dummy/foo' ); - $this->fail( "serializeContent() should have failed on unknown format" ); - } catch ( MWException $e ) { - // ok, as expected - } - } - - /** - * @covers WikitextContentHandler::unserializeContent - */ - public function testUnserializeContent() { - $content = $this->handler->unserializeContent( 'hello world' ); - $this->assertEquals( 'hello world', $content->getNativeData() ); - - $content = $this->handler->unserializeContent( 'hello world', CONTENT_FORMAT_WIKITEXT ); - $this->assertEquals( 'hello world', $content->getNativeData() ); - - try { - $this->handler->unserializeContent( 'hello world', 'dummy/foo' ); - $this->fail( "unserializeContent() should have failed on unknown format" ); - } catch ( MWException $e ) { - // ok, as expected - } - } - - /** - * @covers WikitextContentHandler::makeEmptyContent - */ - public function testMakeEmptyContent() { - $content = $this->handler->makeEmptyContent(); - - $this->assertTrue( $content->isEmpty() ); - $this->assertEquals( '', $content->getNativeData() ); - } - - public static function dataIsSupportedFormat() { - return array( - array( null, true ), - array( CONTENT_FORMAT_WIKITEXT, true ), - array( 99887766, false ), - ); - } - - /** - * @dataProvider provideMakeRedirectContent - * @param Title|string $title Title object or string for Title::newFromText() - * @param string $expected Serialized form of the content object built - * @covers WikitextContentHandler::makeRedirectContent - */ - public function testMakeRedirectContent( $title, $expected ) { - global $wgContLang; - $wgContLang->resetNamespaces(); - - if ( is_string( $title ) ) { - $title = Title::newFromText( $title ); - } - $content = $this->handler->makeRedirectContent( $title ); - $this->assertEquals( $expected, $content->serialize() ); - } - - public static function provideMakeRedirectContent() { - return array( - array( 'Hello', '#REDIRECT [[Hello]]' ), - array( 'Template:Hello', '#REDIRECT [[Template:Hello]]' ), - array( 'Hello#section', '#REDIRECT [[Hello#section]]' ), - array( 'user:john_doe#section', '#REDIRECT [[User:John doe#section]]' ), - array( 'MEDIAWIKI:FOOBAR', '#REDIRECT [[MediaWiki:FOOBAR]]' ), - array( 'Category:Foo', '#REDIRECT [[:Category:Foo]]' ), - array( Title::makeTitle( NS_MAIN, 'en:Foo' ), '#REDIRECT [[en:Foo]]' ), - array( Title::makeTitle( NS_MAIN, 'Foo', '', 'en' ), '#REDIRECT [[:en:Foo]]' ), - array( Title::makeTitle( NS_MAIN, 'Bar', 'fragment', 'google' ), '#REDIRECT [[google:Bar#fragment]]' ), - ); - } - - /** - * @dataProvider dataIsSupportedFormat - * @covers WikitextContentHandler::isSupportedFormat - */ - public function testIsSupportedFormat( $format, $supported ) { - $this->assertEquals( $supported, $this->handler->isSupportedFormat( $format ) ); - } - - public static function dataMerge3() { - return array( - array( - "first paragraph - - second paragraph\n", - - "FIRST paragraph - - second paragraph\n", - - "first paragraph - - SECOND paragraph\n", - - "FIRST paragraph - - SECOND paragraph\n", - ), - - array( "first paragraph - second paragraph\n", - - "Bla bla\n", - - "Blubberdibla\n", - - false, - ), - ); - } - - /** - * @dataProvider dataMerge3 - * @covers WikitextContentHandler::merge3 - */ - public function testMerge3( $old, $mine, $yours, $expected ) { - $this->checkHasDiff3(); - - // test merge - $oldContent = new WikitextContent( $old ); - $myContent = new WikitextContent( $mine ); - $yourContent = new WikitextContent( $yours ); - - $merged = $this->handler->merge3( $oldContent, $myContent, $yourContent ); - - $this->assertEquals( $expected, $merged ? $merged->getNativeData() : $merged ); - } - - public static function dataGetAutosummary() { - return array( - array( - 'Hello there, world!', - '#REDIRECT [[Foo]]', - 0, - '/^Redirected page .*Foo/' - ), - - array( - null, - 'Hello world!', - EDIT_NEW, - '/^Created page .*Hello/' - ), - - array( - 'Hello there, world!', - '', - 0, - '/^Blanked/' - ), - - array( - 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut - labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et - ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.', - 'Hello world!', - 0, - '/^Replaced .*Hello/' - ), - - array( - 'foo', - 'bar', - 0, - '/^$/' - ), - ); - } - - /** - * @dataProvider dataGetAutosummary - * @covers WikitextContentHandler::getAutosummary - */ - public function testGetAutosummary( $old, $new, $flags, $expected ) { - $oldContent = is_null( $old ) ? null : new WikitextContent( $old ); - $newContent = is_null( $new ) ? null : new WikitextContent( $new ); - - $summary = $this->handler->getAutosummary( $oldContent, $newContent, $flags ); - - $this->assertTrue( (bool)preg_match( $expected, $summary ), "Autosummary didn't match expected pattern $expected: $summary" ); - } - - /** - * @todo Text case requires database, should be done by a test class in the Database group - */ - /* - public function testGetAutoDeleteReason( Title $title, &$hasHistory ) {} - */ - - /** - * @todo Text case requires database, should be done by a test class in the Database group - */ - /* - public function testGetUndoContent( Revision $current, Revision $undo, Revision $undoafter = null ) {} - */ -} diff --git a/tests/phpunit/includes/content/WikitextContentTest.php b/tests/phpunit/includes/content/WikitextContentTest.php deleted file mode 100644 index 9f20073d..00000000 --- a/tests/phpunit/includes/content/WikitextContentTest.php +++ /dev/null @@ -1,404 +0,0 @@ -hello world\n

            " - ), - // TODO: more...? - ); - } - - public static function dataGetSecondaryDataUpdates() { - return array( - array( "WikitextContentTest_testGetSecondaryDataUpdates_1", - CONTENT_MODEL_WIKITEXT, "hello ''world''\n", - array( - 'LinksUpdate' => array( - 'mRecursive' => true, - 'mLinks' => array() - ) - ) - ), - array( "WikitextContentTest_testGetSecondaryDataUpdates_2", - CONTENT_MODEL_WIKITEXT, "hello [[world test 21344]]\n", - array( - 'LinksUpdate' => array( - 'mRecursive' => true, - 'mLinks' => array( - array( 'World_test_21344' => 0 ) - ) - ) - ) - ), - // TODO: more...? - ); - } - - /** - * @dataProvider dataGetSecondaryDataUpdates - * @group Database - * @covers WikitextContent::getSecondaryDataUpdates - */ - public function testGetSecondaryDataUpdates( $title, $model, $text, $expectedStuff ) { - $ns = $this->getDefaultWikitextNS(); - $title = Title::newFromText( $title, $ns ); - - $content = ContentHandler::makeContent( $text, $title, $model ); - - $page = WikiPage::factory( $title ); - $page->doEditContent( $content, '' ); - - $updates = $content->getSecondaryDataUpdates( $title ); - - // make updates accessible by class name - foreach ( $updates as $update ) { - $class = get_class( $update ); - $updates[$class] = $update; - } - - foreach ( $expectedStuff as $class => $fieldValues ) { - $this->assertArrayHasKey( $class, $updates, "missing an update of type $class" ); - - $update = $updates[$class]; - - foreach ( $fieldValues as $field => $value ) { - $v = $update->$field; #if the field doesn't exist, just crash and burn - $this->assertEquals( $value, $v, "unexpected value for field $field in instance of $class" ); - } - } - - $page->doDeleteArticle( '' ); - } - - public static function dataGetSection() { - return array( - array( WikitextContentTest::$sections, - "0", - "Intro" - ), - array( WikitextContentTest::$sections, - "2", - "== test == -just a test" - ), - array( WikitextContentTest::$sections, - "8", - false - ), - ); - } - - /** - * @dataProvider dataGetSection - * @covers WikitextContent::getSection - */ - public function testGetSection( $text, $sectionId, $expectedText ) { - $content = $this->newContent( $text ); - - $sectionContent = $content->getSection( $sectionId ); - if ( is_object( $sectionContent ) ) { - $sectionText = $sectionContent->getNativeData(); - } else { - $sectionText = $sectionContent; - } - - $this->assertEquals( $expectedText, $sectionText ); - } - - public static function dataReplaceSection() { - return array( - array( WikitextContentTest::$sections, - "0", - "No more", - null, - trim( preg_replace( '/^Intro/sm', 'No more', WikitextContentTest::$sections ) ) - ), - array( WikitextContentTest::$sections, - "", - "No more", - null, - "No more" - ), - array( WikitextContentTest::$sections, - "2", - "== TEST ==\nmore fun", - null, - trim( preg_replace( '/^== test ==.*== foo ==/sm', "== TEST ==\nmore fun\n\n== foo ==", WikitextContentTest::$sections ) ) - ), - array( WikitextContentTest::$sections, - "8", - "No more", - null, - WikitextContentTest::$sections - ), - array( WikitextContentTest::$sections, - "new", - "No more", - "New", - trim( WikitextContentTest::$sections ) . "\n\n\n== New ==\n\nNo more" - ), - ); - } - - /** - * @dataProvider dataReplaceSection - * @covers WikitextContent::replaceSection - */ - public function testReplaceSection( $text, $section, $with, $sectionTitle, $expected ) { - $content = $this->newContent( $text ); - $c = $content->replaceSection( $section, $this->newContent( $with ), $sectionTitle ); - - $this->assertEquals( $expected, is_null( $c ) ? null : $c->getNativeData() ); - } - - /** - * @covers WikitextContent::addSectionHeader - */ - public function testAddSectionHeader() { - $content = $this->newContent( 'hello world' ); - $content = $content->addSectionHeader( 'test' ); - - $this->assertEquals( "== test ==\n\nhello world", $content->getNativeData() ); - } - - public static function dataPreSaveTransform() { - return array( - array( 'hello this is ~~~', - "hello this is [[Special:Contributions/127.0.0.1|127.0.0.1]]", - ), - array( 'hello \'\'this\'\' is ~~~', - 'hello \'\'this\'\' is ~~~', - ), - array( // rtrim - " Foo \n ", - " Foo", - ), - ); - } - - public static function dataPreloadTransform() { - return array( - array( 'hello this is ~~~', - "hello this is ~~~", - ), - array( 'hello \'\'this\'\' is foobar', - 'hello \'\'this\'\' is bar', - ), - ); - } - - public static function dataGetRedirectTarget() { - return array( - array( '#REDIRECT [[Test]]', - 'Test', - ), - array( '#REDIRECT Test', - null, - ), - array( '* #REDIRECT [[Test]]', - null, - ), - ); - } - - public static function dataGetTextForSummary() { - return array( - array( "hello\nworld.", - 16, - 'hello world.', - ), - array( 'hello world.', - 8, - 'hello...', - ), - array( '[[hello world]].', - 8, - 'hel...', - ), - ); - } - - /** - * @todo Test needs database! Should be done by a test class in the Database group. - */ - /* - public function getRedirectChain() { - $text = $this->getNativeData(); - return Title::newFromRedirectArray( $text ); - } - */ - - /** - * @todo Test needs database! Should be done by a test class in the Database group. - */ - /* - public function getUltimateRedirectTarget() { - $text = $this->getNativeData(); - return Title::newFromRedirectRecurse( $text ); - } - */ - - public static function dataIsCountable() { - return array( - array( '', - null, - 'any', - true - ), - array( 'Foo', - null, - 'any', - true - ), - array( 'Foo', - null, - 'comma', - false - ), - array( 'Foo, bar', - null, - 'comma', - true - ), - array( 'Foo', - null, - 'link', - false - ), - array( 'Foo [[bar]]', - null, - 'link', - true - ), - array( 'Foo', - true, - 'link', - true - ), - array( 'Foo [[bar]]', - false, - 'link', - false - ), - array( '#REDIRECT [[bar]]', - true, - 'any', - false - ), - array( '#REDIRECT [[bar]]', - true, - 'comma', - false - ), - array( '#REDIRECT [[bar]]', - true, - 'link', - false - ), - ); - } - - /** - * @covers WikitextContent::matchMagicWord - */ - public function testMatchMagicWord() { - $mw = MagicWord::get( "staticredirect" ); - - $content = $this->newContent( "#REDIRECT [[FOO]]\n__STATICREDIRECT__" ); - $this->assertTrue( $content->matchMagicWord( $mw ), "should have matched magic word" ); - - $content = $this->newContent( "#REDIRECT [[FOO]]" ); - $this->assertFalse( $content->matchMagicWord( $mw ), "should not have matched magic word" ); - } - - /** - * @covers WikitextContent::updateRedirect - */ - public function testUpdateRedirect() { - $target = Title::newFromText( "testUpdateRedirect_target" ); - - // test with non-redirect page - $content = $this->newContent( "hello world." ); - $newContent = $content->updateRedirect( $target ); - - $this->assertTrue( $content->equals( $newContent ), "content should be unchanged" ); - - // test with actual redirect - $content = $this->newContent( "#REDIRECT [[Someplace]]" ); - $newContent = $content->updateRedirect( $target ); - - $this->assertFalse( $content->equals( $newContent ), "content should have changed" ); - $this->assertTrue( $newContent->isRedirect(), "new content should be a redirect" ); - - $this->assertEquals( $target->getFullText(), $newContent->getRedirectTarget()->getFullText() ); - } - - /** - * @covers WikitextContent::getModel - */ - public function testGetModel() { - $content = $this->newContent( "hello world." ); - - $this->assertEquals( CONTENT_MODEL_WIKITEXT, $content->getModel() ); - } - - /** - * @covers WikitextContent::getContentHandler - */ - public function testGetContentHandler() { - $content = $this->newContent( "hello world." ); - - $this->assertEquals( CONTENT_MODEL_WIKITEXT, $content->getContentHandler()->getModelID() ); - } - - public static function dataEquals() { - return array( - array( new WikitextContent( "hallo" ), null, false ), - array( new WikitextContent( "hallo" ), new WikitextContent( "hallo" ), true ), - array( new WikitextContent( "hallo" ), new JavaScriptContent( "hallo" ), false ), - array( new WikitextContent( "hallo" ), new TextContent( "hallo" ), false ), - array( new WikitextContent( "hallo" ), new WikitextContent( "HALLO" ), false ), - ); - } - - public static function dataGetDeletionUpdates() { - return array( - array( "WikitextContentTest_testGetSecondaryDataUpdates_1", - CONTENT_MODEL_WIKITEXT, "hello ''world''\n", - array( 'LinksDeletionUpdate' => array() ) - ), - array( "WikitextContentTest_testGetSecondaryDataUpdates_2", - CONTENT_MODEL_WIKITEXT, "hello [[world test 21344]]\n", - array( 'LinksDeletionUpdate' => array() ) - ), - // @todo more...? - ); - } -} diff --git a/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php b/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php deleted file mode 100644 index ba63c091..00000000 --- a/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php +++ /dev/null @@ -1,209 +0,0 @@ -addIdentifierQuotes( $in ); - $this->assertEquals($expected, $quoted); - } - - - /** - * Feeds testAddIdentifierQuotes - * - * Named per bug 20281 convention. - */ - function provideDiapers() { - return array( - // Format: expected, input - array( '``', '' ), - - // Yeah I really hate loosely typed PHP idiocies nowadays - array( '``', null ), - - // Dear codereviewer, guess what addIdentifierQuotes() - // will return with thoses: - array( '``', false ), - array( '`1`', true ), - - // We never know what could happen - array( '`0`', 0 ), - array( '`1`', 1 ), - - // Whatchout! Should probably use something more meaningful - array( "`'`", "'" ), # single quote - array( '`"`', '"' ), # double quote - array( '````', '`' ), # backtick - array( '`’`', '’' ), # apostrophe (look at your encyclopedia) - - // sneaky NUL bytes are lurking everywhere - array( '``', "\0" ), - array( '`xyzzy`', "\0x\0y\0z\0z\0y\0" ), - - // unicode chars - array( - self::createUnicodeString( '`\u0001a\uFFFFb`' ), - self::createUnicodeString( '\u0001a\uFFFFb' ) - ), - array( - self::createUnicodeString( '`\u0001\uFFFF`' ), - self::createUnicodeString( '\u0001\u0000\uFFFF\u0000' ) - ), - array( '`☃`', '☃' ), - array( '`メインページ`', 'メインページ' ), - array( '`Басты_бет`', 'Басты_бет' ), - - // Real world: - array( '`Alix`', 'Alix' ), # while( ! $recovered ) { sleep(); } - array( '`Backtick: ```', 'Backtick: `' ), - array( '`This is a test`', 'This is a test' ), - ); - } - - private static function createUnicodeString($str) { - return json_decode( '"' . $str . '"' ); - } - - function getMockForViews() { - $db = $this->getMockBuilder( 'DatabaseMysql' ) - ->disableOriginalConstructor() - ->setMethods( array( 'fetchRow', 'query' ) ) - ->getMock(); - - $db->expects( $this->any() ) - ->method( 'query' ) - ->with( $this->anything() ) - ->will( - $this->returnValue( null ) - ); - - $db->expects( $this->any() ) - ->method( 'fetchRow' ) - ->with( $this->anything() ) - ->will( $this->onConsecutiveCalls( - array( 'Tables_in_' => 'view1' ), - array( 'Tables_in_' => 'view2' ), - array( 'Tables_in_' => 'myview' ), - false # no more rows - )); - return $db; - } - /** - * @covers DatabaseMysqlBase::listViews - */ - function testListviews() { - $db = $this->getMockForViews(); - - // The first call populate an internal cache of views - $this->assertEquals( array( 'view1', 'view2', 'myview'), - $db->listViews() ); - $this->assertEquals( array( 'view1', 'view2', 'myview'), - $db->listViews() ); - - // Prefix filtering - $this->assertEquals( array( 'view1', 'view2' ), - $db->listViews( 'view' ) ); - $this->assertEquals( array( 'myview' ), - $db->listViews( 'my' ) ); - $this->assertEquals( array(), - $db->listViews( 'UNUSED_PREFIX' ) ); - $this->assertEquals( array( 'view1', 'view2', 'myview'), - $db->listViews( '' ) ); - } - - /** - * @covers DatabaseMysqlBase::isView - * @dataProvider provideViewExistanceChecks - */ - function testIsView( $isView, $viewName ) { - $db = $this->getMockForViews(); - - switch( $isView ) { - case true: - $this->assertTrue( $db->isView( $viewName ), - "$viewName should be considered a view" ); - break; - - case false: - $this->assertFalse( $db->isView( $viewName ), - "$viewName has not been defined as a view" ); - break; - } - - } - - function provideViewExistanceChecks() { - return array( - // format: whether it is a view, view name - array( true, 'view1' ), - array( true, 'view2' ), - array( true, 'myview' ), - - array( false, 'user' ), - - array( false, 'view10' ), - array( false, 'my' ), - array( false, 'OH_MY_GOD' ), # they killed kenny! - ); - } - -} diff --git a/tests/phpunit/includes/db/DatabaseSQLTest.php b/tests/phpunit/includes/db/DatabaseSQLTest.php deleted file mode 100644 index bdd567e7..00000000 --- a/tests/phpunit/includes/db/DatabaseSQLTest.php +++ /dev/null @@ -1,721 +0,0 @@ -database = new DatabaseTestHelper( __CLASS__ ); - } - - protected function assertLastSql( $sqlText ) { - $this->assertEquals( - $this->database->getLastSqls(), - $sqlText - ); - } - - /** - * @dataProvider provideSelect - * @covers DatabaseBase::select - */ - public function testSelect( $sql, $sqlText ) { - $this->database->select( - $sql['tables'], - $sql['fields'], - isset( $sql['conds'] ) ? $sql['conds'] : array(), - __METHOD__, - isset( $sql['options'] ) ? $sql['options'] : array(), - isset( $sql['join_conds'] ) ? $sql['join_conds'] : array() - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideSelect() { - return array( - array( - array( - 'tables' => 'table', - 'fields' => array( 'field', 'alias' => 'field2' ), - 'conds' => array( 'alias' => 'text' ), - ), - "SELECT field,field2 AS alias " . - "FROM table " . - "WHERE alias = 'text'" - ), - array( - array( - 'tables' => 'table', - 'fields' => array( 'field', 'alias' => 'field2' ), - 'conds' => array( 'alias' => 'text' ), - 'options' => array( 'LIMIT' => 1, 'ORDER BY' => 'field' ), - ), - "SELECT field,field2 AS alias " . - "FROM table " . - "WHERE alias = 'text' " . - "ORDER BY field " . - "LIMIT 1" - ), - array( - array( - 'tables' => array( 'table', 't2' => 'table2' ), - 'fields' => array( 'tid', 'field', 'alias' => 'field2', 't2.id' ), - 'conds' => array( 'alias' => 'text' ), - 'options' => array( 'LIMIT' => 1, 'ORDER BY' => 'field' ), - 'join_conds' => array( 't2' => array( - 'LEFT JOIN', 'tid = t2.id' - ) ), - ), - "SELECT tid,field,field2 AS alias,t2.id " . - "FROM table LEFT JOIN table2 t2 ON ((tid = t2.id)) " . - "WHERE alias = 'text' " . - "ORDER BY field " . - "LIMIT 1" - ), - array( - array( - 'tables' => array( 'table', 't2' => 'table2' ), - 'fields' => array( 'tid', 'field', 'alias' => 'field2', 't2.id' ), - 'conds' => array( 'alias' => 'text' ), - 'options' => array( 'LIMIT' => 1, 'GROUP BY' => 'field', 'HAVING' => 'COUNT(*) > 1' ), - 'join_conds' => array( 't2' => array( - 'LEFT JOIN', 'tid = t2.id' - ) ), - ), - "SELECT tid,field,field2 AS alias,t2.id " . - "FROM table LEFT JOIN table2 t2 ON ((tid = t2.id)) " . - "WHERE alias = 'text' " . - "GROUP BY field HAVING COUNT(*) > 1 " . - "LIMIT 1" - ), - array( - array( - 'tables' => array( 'table', 't2' => 'table2' ), - 'fields' => array( 'tid', 'field', 'alias' => 'field2', 't2.id' ), - 'conds' => array( 'alias' => 'text' ), - 'options' => array( 'LIMIT' => 1, 'GROUP BY' => array( 'field', 'field2' ), 'HAVING' => array( 'COUNT(*) > 1', 'field' => 1 ) ), - 'join_conds' => array( 't2' => array( - 'LEFT JOIN', 'tid = t2.id' - ) ), - ), - "SELECT tid,field,field2 AS alias,t2.id " . - "FROM table LEFT JOIN table2 t2 ON ((tid = t2.id)) " . - "WHERE alias = 'text' " . - "GROUP BY field,field2 HAVING (COUNT(*) > 1) AND field = '1' " . - "LIMIT 1" - ), - array( - array( - 'tables' => array( 'table' ), - 'fields' => array( 'alias' => 'field' ), - 'conds' => array( 'alias' => array( 1, 2, 3, 4 ) ), - ), - "SELECT field AS alias " . - "FROM table " . - "WHERE alias IN ('1','2','3','4')" - ), - ); - } - - /** - * @dataProvider provideUpdate - * @covers DatabaseBase::update - */ - public function testUpdate( $sql, $sqlText ) { - $this->database->update( - $sql['table'], - $sql['values'], - $sql['conds'], - __METHOD__, - isset( $sql['options'] ) ? $sql['options'] : array() - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideUpdate() { - return array( - array( - array( - 'table' => 'table', - 'values' => array( 'field' => 'text', 'field2' => 'text2' ), - 'conds' => array( 'alias' => 'text' ), - ), - "UPDATE table " . - "SET field = 'text'" . - ",field2 = 'text2' " . - "WHERE alias = 'text'" - ), - array( - array( - 'table' => 'table', - 'values' => array( 'field = other', 'field2' => 'text2' ), - 'conds' => array( 'id' => '1' ), - ), - "UPDATE table " . - "SET field = other" . - ",field2 = 'text2' " . - "WHERE id = '1'" - ), - array( - array( - 'table' => 'table', - 'values' => array( 'field = other', 'field2' => 'text2' ), - 'conds' => '*', - ), - "UPDATE table " . - "SET field = other" . - ",field2 = 'text2'" - ), - ); - } - - /** - * @dataProvider provideDelete - * @covers DatabaseBase::delete - */ - public function testDelete( $sql, $sqlText ) { - $this->database->delete( - $sql['table'], - $sql['conds'], - __METHOD__ - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideDelete() { - return array( - array( - array( - 'table' => 'table', - 'conds' => array( 'alias' => 'text' ), - ), - "DELETE FROM table " . - "WHERE alias = 'text'" - ), - array( - array( - 'table' => 'table', - 'conds' => '*', - ), - "DELETE FROM table" - ), - ); - } - - /** - * @dataProvider provideUpsert - * @covers DatabaseBase::upsert - */ - public function testUpsert( $sql, $sqlText ) { - $this->database->upsert( - $sql['table'], - $sql['rows'], - $sql['uniqueIndexes'], - $sql['set'], - __METHOD__ - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideUpsert() { - return array( - array( - array( - 'table' => 'upsert_table', - 'rows' => array( 'field' => 'text', 'field2' => 'text2' ), - 'uniqueIndexes' => array( 'field' ), - 'set' => array( 'field' => 'set' ), - ), - "BEGIN; " . - "UPDATE upsert_table " . - "SET field = 'set' " . - "WHERE ((field = 'text')); " . - "INSERT IGNORE INTO upsert_table " . - "(field,field2) " . - "VALUES ('text','text2'); " . - "COMMIT" - ), - ); - } - - /** - * @dataProvider provideDeleteJoin - * @covers DatabaseBase::deleteJoin - */ - public function testDeleteJoin( $sql, $sqlText ) { - $this->database->deleteJoin( - $sql['delTable'], - $sql['joinTable'], - $sql['delVar'], - $sql['joinVar'], - $sql['conds'], - __METHOD__ - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideDeleteJoin() { - return array( - array( - array( - 'delTable' => 'table', - 'joinTable' => 'table_join', - 'delVar' => 'field', - 'joinVar' => 'field_join', - 'conds' => array( 'alias' => 'text' ), - ), - "DELETE FROM table " . - "WHERE field IN (" . - "SELECT field_join FROM table_join WHERE alias = 'text'" . - ")" - ), - array( - array( - 'delTable' => 'table', - 'joinTable' => 'table_join', - 'delVar' => 'field', - 'joinVar' => 'field_join', - 'conds' => '*', - ), - "DELETE FROM table " . - "WHERE field IN (" . - "SELECT field_join FROM table_join " . - ")" - ), - ); - } - - /** - * @dataProvider provideInsert - * @covers DatabaseBase::insert - */ - public function testInsert( $sql, $sqlText ) { - $this->database->insert( - $sql['table'], - $sql['rows'], - __METHOD__, - isset( $sql['options'] ) ? $sql['options'] : array() - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideInsert() { - return array( - array( - array( - 'table' => 'table', - 'rows' => array( 'field' => 'text', 'field2' => 2 ), - ), - "INSERT INTO table " . - "(field,field2) " . - "VALUES ('text','2')" - ), - array( - array( - 'table' => 'table', - 'rows' => array( 'field' => 'text', 'field2' => 2 ), - 'options' => 'IGNORE', - ), - "INSERT IGNORE INTO table " . - "(field,field2) " . - "VALUES ('text','2')" - ), - array( - array( - 'table' => 'table', - 'rows' => array( - array( 'field' => 'text', 'field2' => 2 ), - array( 'field' => 'multi', 'field2' => 3 ), - ), - 'options' => 'IGNORE', - ), - "INSERT IGNORE INTO table " . - "(field,field2) " . - "VALUES " . - "('text','2')," . - "('multi','3')" - ), - ); - } - - /** - * @dataProvider provideInsertSelect - * @covers DatabaseBase::insertSelect - */ - public function testInsertSelect( $sql, $sqlText ) { - $this->database->insertSelect( - $sql['destTable'], - $sql['srcTable'], - $sql['varMap'], - $sql['conds'], - __METHOD__, - isset( $sql['insertOptions'] ) ? $sql['insertOptions'] : array(), - isset( $sql['selectOptions'] ) ? $sql['selectOptions'] : array() - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideInsertSelect() { - return array( - array( - array( - 'destTable' => 'insert_table', - 'srcTable' => 'select_table', - 'varMap' => array( 'field_insert' => 'field_select', 'field' => 'field2' ), - 'conds' => '*', - ), - "INSERT INTO insert_table " . - "(field_insert,field) " . - "SELECT field_select,field2 " . - "FROM select_table" - ), - array( - array( - 'destTable' => 'insert_table', - 'srcTable' => 'select_table', - 'varMap' => array( 'field_insert' => 'field_select', 'field' => 'field2' ), - 'conds' => array( 'field' => 2 ), - ), - "INSERT INTO insert_table " . - "(field_insert,field) " . - "SELECT field_select,field2 " . - "FROM select_table " . - "WHERE field = '2'" - ), - array( - array( - 'destTable' => 'insert_table', - 'srcTable' => 'select_table', - 'varMap' => array( 'field_insert' => 'field_select', 'field' => 'field2' ), - 'conds' => array( 'field' => 2 ), - 'insertOptions' => 'IGNORE', - 'selectOptions' => array( 'ORDER BY' => 'field' ), - ), - "INSERT IGNORE INTO insert_table " . - "(field_insert,field) " . - "SELECT field_select,field2 " . - "FROM select_table " . - "WHERE field = '2' " . - "ORDER BY field" - ), - ); - } - - /** - * @dataProvider provideReplace - * @covers DatabaseBase::replace - */ - public function testReplace( $sql, $sqlText ) { - $this->database->replace( - $sql['table'], - $sql['uniqueIndexes'], - $sql['rows'], - __METHOD__ - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideReplace() { - return array( - array( - array( - 'table' => 'replace_table', - 'uniqueIndexes' => array( 'field' ), - 'rows' => array( 'field' => 'text', 'field2' => 'text2' ), - ), - "DELETE FROM replace_table " . - "WHERE ( field='text' ); " . - "INSERT INTO replace_table " . - "(field,field2) " . - "VALUES ('text','text2')" - ), - array( - array( - 'table' => 'module_deps', - 'uniqueIndexes' => array( array( 'md_module', 'md_skin' ) ), - 'rows' => array( - 'md_module' => 'module', - 'md_skin' => 'skin', - 'md_deps' => 'deps', - ), - ), - "DELETE FROM module_deps " . - "WHERE ( md_module='module' AND md_skin='skin' ); " . - "INSERT INTO module_deps " . - "(md_module,md_skin,md_deps) " . - "VALUES ('module','skin','deps')" - ), - array( - array( - 'table' => 'module_deps', - 'uniqueIndexes' => array( array( 'md_module', 'md_skin' ) ), - 'rows' => array( - array( - 'md_module' => 'module', - 'md_skin' => 'skin', - 'md_deps' => 'deps', - ), array( - 'md_module' => 'module2', - 'md_skin' => 'skin2', - 'md_deps' => 'deps2', - ), - ), - ), - "DELETE FROM module_deps " . - "WHERE ( md_module='module' AND md_skin='skin' ); " . - "INSERT INTO module_deps " . - "(md_module,md_skin,md_deps) " . - "VALUES ('module','skin','deps'); " . - "DELETE FROM module_deps " . - "WHERE ( md_module='module2' AND md_skin='skin2' ); " . - "INSERT INTO module_deps " . - "(md_module,md_skin,md_deps) " . - "VALUES ('module2','skin2','deps2')" - ), - array( - array( - 'table' => 'module_deps', - 'uniqueIndexes' => array( 'md_module', 'md_skin' ), - 'rows' => array( - array( - 'md_module' => 'module', - 'md_skin' => 'skin', - 'md_deps' => 'deps', - ), array( - 'md_module' => 'module2', - 'md_skin' => 'skin2', - 'md_deps' => 'deps2', - ), - ), - ), - "DELETE FROM module_deps " . - "WHERE ( md_module='module' ) OR ( md_skin='skin' ); " . - "INSERT INTO module_deps " . - "(md_module,md_skin,md_deps) " . - "VALUES ('module','skin','deps'); " . - "DELETE FROM module_deps " . - "WHERE ( md_module='module2' ) OR ( md_skin='skin2' ); " . - "INSERT INTO module_deps " . - "(md_module,md_skin,md_deps) " . - "VALUES ('module2','skin2','deps2')" - ), - array( - array( - 'table' => 'module_deps', - 'uniqueIndexes' => array(), - 'rows' => array( - 'md_module' => 'module', - 'md_skin' => 'skin', - 'md_deps' => 'deps', - ), - ), - "INSERT INTO module_deps " . - "(md_module,md_skin,md_deps) " . - "VALUES ('module','skin','deps')" - ), - ); - } - - /** - * @dataProvider provideNativeReplace - * @covers DatabaseBase::nativeReplace - */ - public function testNativeReplace( $sql, $sqlText ) { - $this->database->nativeReplace( - $sql['table'], - $sql['rows'], - __METHOD__ - ); - $this->assertLastSql( $sqlText ); - } - - public static function provideNativeReplace() { - return array( - array( - array( - 'table' => 'replace_table', - 'rows' => array( 'field' => 'text', 'field2' => 'text2' ), - ), - "REPLACE INTO replace_table " . - "(field,field2) " . - "VALUES ('text','text2')" - ), - ); - } - - /** - * @dataProvider provideConditional - * @covers DatabaseBase::conditional - */ - public function testConditional( $sql, $sqlText ) { - $this->assertEquals( trim( $this->database->conditional( - $sql['conds'], - $sql['true'], - $sql['false'] - ) ), $sqlText ); - } - - public static function provideConditional() { - return array( - array( - array( - 'conds' => array( 'field' => 'text' ), - 'true' => 1, - 'false' => 'NULL', - ), - "(CASE WHEN field = 'text' THEN 1 ELSE NULL END)" - ), - array( - array( - 'conds' => array( 'field' => 'text', 'field2' => 'anothertext' ), - 'true' => 1, - 'false' => 'NULL', - ), - "(CASE WHEN field = 'text' AND field2 = 'anothertext' THEN 1 ELSE NULL END)" - ), - array( - array( - 'conds' => 'field=1', - 'true' => 1, - 'false' => 'NULL', - ), - "(CASE WHEN field=1 THEN 1 ELSE NULL END)" - ), - ); - } - - /** - * @dataProvider provideBuildConcat - * @covers DatabaseBase::buildConcat - */ - public function testBuildConcat( $stringList, $sqlText ) { - $this->assertEquals( trim( $this->database->buildConcat( - $stringList - ) ), $sqlText ); - } - - public static function provideBuildConcat() { - return array( - array( - array( 'field', 'field2' ), - "CONCAT(field,field2)" - ), - array( - array( "'test'", 'field2' ), - "CONCAT('test',field2)" - ), - ); - } - - /** - * @dataProvider provideBuildLike - * @covers DatabaseBase::buildLike - */ - public function testBuildLike( $array, $sqlText ) { - $this->assertEquals( trim( $this->database->buildLike( - $array - ) ), $sqlText ); - } - - public static function provideBuildLike() { - return array( - array( - 'text', - "LIKE 'text'" - ), - array( - array( 'text', new LikeMatch( '%' ) ), - "LIKE 'text%'" - ), - array( - array( 'text', new LikeMatch( '%' ), 'text2' ), - "LIKE 'text%text2'" - ), - array( - array( 'text', new LikeMatch( '_' ) ), - "LIKE 'text_'" - ), - ); - } - - /** - * @dataProvider provideUnionQueries - * @covers DatabaseBase::unionQueries - */ - public function testUnionQueries( $sql, $sqlText ) { - $this->assertEquals( trim( $this->database->unionQueries( - $sql['sqls'], - $sql['all'] - ) ), $sqlText ); - } - - public static function provideUnionQueries() { - return array( - array( - array( - 'sqls' => array( 'RAW SQL', 'RAW2SQL' ), - 'all' => true, - ), - "(RAW SQL) UNION ALL (RAW2SQL)" - ), - array( - array( - 'sqls' => array( 'RAW SQL', 'RAW2SQL' ), - 'all' => false, - ), - "(RAW SQL) UNION (RAW2SQL)" - ), - array( - array( - 'sqls' => array( 'RAW SQL', 'RAW2SQL', 'RAW3SQL' ), - 'all' => false, - ), - "(RAW SQL) UNION (RAW2SQL) UNION (RAW3SQL)" - ), - ); - } - - /** - * @covers DatabaseBase::commit - */ - public function testTransactionCommit() { - $this->database->begin( __METHOD__ ); - $this->database->commit( __METHOD__ ); - $this->assertLastSql( 'BEGIN; COMMIT' ); - } - - /** - * @covers DatabaseBase::rollback - */ - public function testTransactionRollback() { - $this->database->begin( __METHOD__ ); - $this->database->rollback( __METHOD__ ); - $this->assertLastSql( 'BEGIN; ROLLBACK' ); - } - - /** - * @covers DatabaseBase::dropTable - */ - public function testDropTable() { - $this->database->setExistingTables( array( 'table' ) ); - $this->database->dropTable( 'table', __METHOD__ ); - $this->assertLastSql( 'DROP TABLE table' ); - } - - /** - * @covers DatabaseBase::dropTable - */ - public function testDropNonExistingTable() { - $this->assertFalse( - $this->database->dropTable( 'non_existing', __METHOD__ ) - ); - } -} diff --git a/tests/phpunit/includes/db/DatabaseSqliteTest.php b/tests/phpunit/includes/db/DatabaseSqliteTest.php deleted file mode 100644 index 70ee9465..00000000 --- a/tests/phpunit/includes/db/DatabaseSqliteTest.php +++ /dev/null @@ -1,421 +0,0 @@ -lastQuery = $sql; - - return true; - } - - /** - * Override parent visibility to public - */ - public function replaceVars( $s ) { - return parent::replaceVars( $s ); - } -} - -/** - * @group sqlite - * @group Database - * @group medium - */ -class DatabaseSqliteTest extends MediaWikiTestCase { - - /** - * @var MockDatabaseSqlite - */ - var $db; - - protected function setUp() { - parent::setUp(); - - if ( !Sqlite::isPresent() ) { - $this->markTestSkipped( 'No SQLite support detected' ); - } - $this->db = new MockDatabaseSqlite(); - if ( version_compare( $this->db->getServerVersion(), '3.6.0', '<' ) ) { - $this->markTestSkipped( "SQLite at least 3.6 required, {$this->db->getServerVersion()} found" ); - } - } - - private function replaceVars( $sql ) { - // normalize spacing to hide implementation details - return preg_replace( '/\s+/', ' ', $this->db->replaceVars( $sql ) ); - } - - private function assertResultIs( $expected, $res ) { - $this->assertNotNull( $res ); - $i = 0; - foreach ( $res as $row ) { - foreach ( $expected[$i] as $key => $value ) { - $this->assertTrue( isset( $row->$key ) ); - $this->assertEquals( $value, $row->$key ); - } - $i++; - } - $this->assertEquals( count( $expected ), $i, 'Unexpected number of rows' ); - } - - public static function provideAddQuotes() { - return array( - array( // #0: empty - '', "''" - ), - array( // #1: simple - 'foo bar', "'foo bar'" - ), - array( // #2: including quote - 'foo\'bar', "'foo''bar'" - ), - array( // #3: including \0 (must be represented as hex, per https://bugs.php.net/bug.php?id=63419) - "x\0y", - "x'780079'", - ), - array( // #4: blob object (must be represented as hex) - new Blob( "hello" ), - "x'68656c6c6f'", - ), - ); - } - - /** - * @dataProvider provideAddQuotes() - * @covers DatabaseSqlite::addQuotes - */ - public function testAddQuotes( $value, $expected ) { - // check quoting - $db = new DatabaseSqliteStandalone( ':memory:' ); - $this->assertEquals( $expected, $db->addQuotes( $value ), 'string not quoted as expected' ); - - // ok, quoting works as expected, now try a round trip. - $re = $db->query( 'select ' . $db->addQuotes( $value ) ); - - $this->assertTrue( $re !== false, 'query failed' ); - - if ( $row = $re->fetchRow() ) { - if ( $value instanceof Blob ) { - $value = $value->fetch(); - } - - $this->assertEquals( $value, $row[0], 'string mangled by the database' ); - } else { - $this->fail( 'query returned no result' ); - } - } - - /** - * @covers DatabaseSqlite::replaceVars - */ - public function testReplaceVars() { - $this->assertEquals( 'foo', $this->replaceVars( 'foo' ), "Don't break anything accidentally" ); - - $this->assertEquals( "CREATE TABLE /**/foo (foo_key INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, " - . "foo_bar TEXT, foo_name TEXT NOT NULL DEFAULT '', foo_int INTEGER, foo_int2 INTEGER );", - $this->replaceVars( "CREATE TABLE /**/foo (foo_key int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, - foo_bar char(13), foo_name varchar(255) binary NOT NULL DEFAULT '', foo_int tinyint ( 8 ), foo_int2 int(16) ) ENGINE=MyISAM;" ) - ); - - $this->assertEquals( "CREATE TABLE foo ( foo1 REAL, foo2 REAL, foo3 REAL );", - $this->replaceVars( "CREATE TABLE foo ( foo1 FLOAT, foo2 DOUBLE( 1,10), foo3 DOUBLE PRECISION );" ) - ); - - $this->assertEquals( "CREATE TABLE foo ( foo_binary1 BLOB, foo_binary2 BLOB );", - $this->replaceVars( "CREATE TABLE foo ( foo_binary1 binary(16), foo_binary2 varbinary(32) );" ) - ); - - $this->assertEquals( "CREATE TABLE text ( text_foo TEXT );", - $this->replaceVars( "CREATE TABLE text ( text_foo tinytext );" ), - 'Table name changed' - ); - - $this->assertEquals( "CREATE TABLE foo ( foobar INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL );", - $this->replaceVars( "CREATE TABLE foo ( foobar INT PRIMARY KEY NOT NULL AUTO_INCREMENT );" ) - ); - $this->assertEquals( "CREATE TABLE foo ( foobar INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL );", - $this->replaceVars( "CREATE TABLE foo ( foobar INT PRIMARY KEY AUTO_INCREMENT NOT NULL );" ) - ); - - $this->assertEquals( "CREATE TABLE enums( enum1 TEXT, myenum TEXT)", - $this->replaceVars( "CREATE TABLE enums( enum1 ENUM('A', 'B'), myenum ENUM ('X', 'Y'))" ) - ); - - $this->assertEquals( "ALTER TABLE foo ADD COLUMN foo_bar INTEGER DEFAULT 42", - $this->replaceVars( "ALTER TABLE foo\nADD COLUMN foo_bar int(10) unsigned DEFAULT 42" ) - ); - } - - /** - * @covers DatabaseSqlite::tableName - */ - public function testTableName() { - // @todo Moar! - $db = new DatabaseSqliteStandalone( ':memory:' ); - $this->assertEquals( 'foo', $db->tableName( 'foo' ) ); - $this->assertEquals( 'sqlite_master', $db->tableName( 'sqlite_master' ) ); - $db->tablePrefix( 'foo' ); - $this->assertEquals( 'sqlite_master', $db->tableName( 'sqlite_master' ) ); - $this->assertEquals( 'foobar', $db->tableName( 'bar' ) ); - } - - /** - * @covers DatabaseSqlite::duplicateTableStructure - */ - public function testDuplicateTableStructure() { - $db = new DatabaseSqliteStandalone( ':memory:' ); - $db->query( 'CREATE TABLE foo(foo, barfoo)' ); - - $db->duplicateTableStructure( 'foo', 'bar' ); - $this->assertEquals( 'CREATE TABLE "bar"(foo, barfoo)', - $db->selectField( 'sqlite_master', 'sql', array( 'name' => 'bar' ) ), - 'Normal table duplication' - ); - - $db->duplicateTableStructure( 'foo', 'baz', true ); - $this->assertEquals( 'CREATE TABLE "baz"(foo, barfoo)', - $db->selectField( 'sqlite_temp_master', 'sql', array( 'name' => 'baz' ) ), - 'Creation of temporary duplicate' - ); - $this->assertEquals( 0, - $db->selectField( 'sqlite_master', 'COUNT(*)', array( 'name' => 'baz' ) ), - 'Create a temporary duplicate only' - ); - } - - /** - * @covers DatabaseSqlite::duplicateTableStructure - */ - public function testDuplicateTableStructureVirtual() { - $db = new DatabaseSqliteStandalone( ':memory:' ); - if ( $db->getFulltextSearchModule() != 'FTS3' ) { - $this->markTestSkipped( 'FTS3 not supported, cannot create virtual tables' ); - } - $db->query( 'CREATE VIRTUAL TABLE "foo" USING FTS3(foobar)' ); - - $db->duplicateTableStructure( 'foo', 'bar' ); - $this->assertEquals( 'CREATE VIRTUAL TABLE "bar" USING FTS3(foobar)', - $db->selectField( 'sqlite_master', 'sql', array( 'name' => 'bar' ) ), - 'Duplication of virtual tables' - ); - - $db->duplicateTableStructure( 'foo', 'baz', true ); - $this->assertEquals( 'CREATE VIRTUAL TABLE "baz" USING FTS3(foobar)', - $db->selectField( 'sqlite_master', 'sql', array( 'name' => 'baz' ) ), - "Can't create temporary virtual tables, should fall back to non-temporary duplication" - ); - } - - /** - * @covers DatabaseSqlite::deleteJoin - */ - public function testDeleteJoin() { - $db = new DatabaseSqliteStandalone( ':memory:' ); - $db->query( 'CREATE TABLE a (a_1)', __METHOD__ ); - $db->query( 'CREATE TABLE b (b_1, b_2)', __METHOD__ ); - $db->insert( 'a', array( - array( 'a_1' => 1 ), - array( 'a_1' => 2 ), - array( 'a_1' => 3 ), - ), - __METHOD__ - ); - $db->insert( 'b', array( - array( 'b_1' => 2, 'b_2' => 'a' ), - array( 'b_1' => 3, 'b_2' => 'b' ), - ), - __METHOD__ - ); - $db->deleteJoin( 'a', 'b', 'a_1', 'b_1', array( 'b_2' => 'a' ), __METHOD__ ); - $res = $db->query( "SELECT * FROM a", __METHOD__ ); - $this->assertResultIs( array( - array( 'a_1' => 1 ), - array( 'a_1' => 3 ), - ), - $res - ); - } - - public function testEntireSchema() { - global $IP; - - $result = Sqlite::checkSqlSyntax( "$IP/maintenance/tables.sql" ); - if ( $result !== true ) { - $this->fail( $result ); - } - $this->assertTrue( true ); // avoid test being marked as incomplete due to lack of assertions - } - - /** - * Runs upgrades of older databases and compares results with current schema - * @todo Currently only checks list of tables - */ - public function testUpgrades() { - global $IP, $wgVersion, $wgProfileToDatabase; - - // Versions tested - $versions = array( - //'1.13', disabled for now, was totally screwed up - // SQLite wasn't included in 1.14 - '1.15', - '1.16', - '1.17', - '1.18', - ); - - // Mismatches for these columns we can safely ignore - $ignoredColumns = array( - 'user_newtalk.user_last_timestamp', // r84185 - ); - - $currentDB = new DatabaseSqliteStandalone( ':memory:' ); - $currentDB->sourceFile( "$IP/maintenance/tables.sql" ); - if ( $wgProfileToDatabase ) { - $currentDB->sourceFile( "$IP/maintenance/sqlite/archives/patch-profiling.sql" ); - } - $currentTables = $this->getTables( $currentDB ); - sort( $currentTables ); - - foreach ( $versions as $version ) { - $versions = "upgrading from $version to $wgVersion"; - $db = $this->prepareDB( $version ); - $tables = $this->getTables( $db ); - $this->assertEquals( $currentTables, $tables, "Different tables $versions" ); - foreach ( $tables as $table ) { - $currentCols = $this->getColumns( $currentDB, $table ); - $cols = $this->getColumns( $db, $table ); - $this->assertEquals( - array_keys( $currentCols ), - array_keys( $cols ), - "Mismatching columns for table \"$table\" $versions" - ); - foreach ( $currentCols as $name => $column ) { - $fullName = "$table.$name"; - $this->assertEquals( - (bool)$column->pk, - (bool)$cols[$name]->pk, - "PRIMARY KEY status does not match for column $fullName $versions" - ); - if ( !in_array( $fullName, $ignoredColumns ) ) { - $this->assertEquals( - (bool)$column->notnull, - (bool)$cols[$name]->notnull, - "NOT NULL status does not match for column $fullName $versions" - ); - $this->assertEquals( - $column->dflt_value, - $cols[$name]->dflt_value, - "Default values does not match for column $fullName $versions" - ); - } - } - $currentIndexes = $this->getIndexes( $currentDB, $table ); - $indexes = $this->getIndexes( $db, $table ); - $this->assertEquals( - array_keys( $currentIndexes ), - array_keys( $indexes ), - "mismatching indexes for table \"$table\" $versions" - ); - } - $db->close(); - } - } - - /** - * @covers DatabaseSqlite::insertId - */ - public function testInsertIdType() { - $db = new DatabaseSqliteStandalone( ':memory:' ); - - $databaseCreation = $db->query( 'CREATE TABLE a ( a_1 )', __METHOD__ ); - $this->assertInstanceOf( 'ResultWrapper', $databaseCreation, "Database creation" ); - - $insertion = $db->insert( 'a', array( 'a_1' => 10 ), __METHOD__ ); - $this->assertTrue( $insertion, "Insertion worked" ); - - $this->assertInternalType( 'integer', $db->insertId(), "Actual typecheck" ); - $this->assertTrue( $db->close(), "closing database" ); - } - - private function prepareDB( $version ) { - static $maint = null; - if ( $maint === null ) { - $maint = new FakeMaintenance(); - $maint->loadParamsAndArgs( null, array( 'quiet' => 1 ) ); - } - - global $IP; - $db = new DatabaseSqliteStandalone( ':memory:' ); - $db->sourceFile( "$IP/tests/phpunit/data/db/sqlite/tables-$version.sql" ); - $updater = DatabaseUpdater::newForDB( $db, false, $maint ); - $updater->doUpdates( array( 'core' ) ); - - return $db; - } - - private function getTables( $db ) { - $list = array_flip( $db->listTables() ); - $excluded = array( - 'external_user', // removed from core in 1.22 - 'math', // moved out of core in 1.18 - 'trackbacks', // removed from core in 1.19 - 'searchindex', - 'searchindex_content', - 'searchindex_segments', - 'searchindex_segdir', - // FTS4 ready!!1 - 'searchindex_docsize', - 'searchindex_stat', - ); - foreach ( $excluded as $t ) { - unset( $list[$t] ); - } - $list = array_flip( $list ); - sort( $list ); - - return $list; - } - - private function getColumns( $db, $table ) { - $cols = array(); - $res = $db->query( "PRAGMA table_info($table)" ); - $this->assertNotNull( $res ); - foreach ( $res as $col ) { - $cols[$col->name] = $col; - } - ksort( $cols ); - - return $cols; - } - - private function getIndexes( $db, $table ) { - $indexes = array(); - $res = $db->query( "PRAGMA index_list($table)" ); - $this->assertNotNull( $res ); - foreach ( $res as $index ) { - $res2 = $db->query( "PRAGMA index_info({$index->name})" ); - $this->assertNotNull( $res2 ); - $index->columns = array(); - foreach ( $res2 as $col ) { - $index->columns[] = $col; - } - $indexes[$index->name] = $index; - } - ksort( $indexes ); - - return $indexes; - } - - public function testCaseInsensitiveLike() { - // TODO: Test this for all databases - $db = new DatabaseSqliteStandalone( ':memory:' ); - $res = $db->query( 'SELECT "a" LIKE "A" AS a' ); - $row = $res->fetchRow(); - $this->assertFalse( (bool)$row['a'] ); - } -} diff --git a/tests/phpunit/includes/db/DatabaseTest.php b/tests/phpunit/includes/db/DatabaseTest.php deleted file mode 100644 index 301fc990..00000000 --- a/tests/phpunit/includes/db/DatabaseTest.php +++ /dev/null @@ -1,234 +0,0 @@ -db = wfGetDB( DB_MASTER ); - } - - protected function tearDown() { - parent::tearDown(); - if ( $this->functionTest ) { - $this->dropFunctions(); - $this->functionTest = false; - } - } - /** - * @covers DatabaseBase::dropTable - */ - public function testAddQuotesNull() { - $check = "NULL"; - if ( $this->db->getType() === 'sqlite' || $this->db->getType() === 'oracle' ) { - $check = "''"; - } - $this->assertEquals( $check, $this->db->addQuotes( null ) ); - } - - public function testAddQuotesInt() { - # returning just "1234" should be ok too, though... - # maybe - $this->assertEquals( - "'1234'", - $this->db->addQuotes( 1234 ) ); - } - - public function testAddQuotesFloat() { - # returning just "1234.5678" would be ok too, though - $this->assertEquals( - "'1234.5678'", - $this->db->addQuotes( 1234.5678 ) ); - } - - public function testAddQuotesString() { - $this->assertEquals( - "'string'", - $this->db->addQuotes( 'string' ) ); - } - - public function testAddQuotesStringQuote() { - $check = "'string''s cause trouble'"; - if ( $this->db->getType() === 'mysql' ) { - $check = "'string\'s cause trouble'"; - } - $this->assertEquals( - $check, - $this->db->addQuotes( "string's cause trouble" ) ); - } - - private function getSharedTableName( $table, $database, $prefix, $format = 'quoted' ) { - global $wgSharedDB, $wgSharedTables, $wgSharedPrefix; - - $oldName = $wgSharedDB; - $oldTables = $wgSharedTables; - $oldPrefix = $wgSharedPrefix; - - $wgSharedDB = $database; - $wgSharedTables = array( $table ); - $wgSharedPrefix = $prefix; - - $ret = $this->db->tableName( $table, $format ); - - $wgSharedDB = $oldName; - $wgSharedTables = $oldTables; - $wgSharedPrefix = $oldPrefix; - - return $ret; - } - - private function prefixAndQuote( $table, $database = null, $prefix = null, $format = 'quoted' ) { - if ( $this->db->getType() === 'sqlite' || $format !== 'quoted' ) { - $quote = ''; - } elseif ( $this->db->getType() === 'mysql' ) { - $quote = '`'; - } elseif ( $this->db->getType() === 'oracle' ) { - $quote = '/*Q*/'; - } else { - $quote = '"'; - } - - if ( $database !== null ) { - if ( $this->db->getType() === 'oracle' ) { - $database = $quote . $database . '.'; - } else { - $database = $quote . $database . $quote . '.'; - } - } - - if ( $prefix === null ) { - $prefix = $this->dbPrefix(); - } - - if ( $this->db->getType() === 'oracle' ) { - return strtoupper($database . $quote . $prefix . $table); - } else { - return $database . $quote . $prefix . $table . $quote; - } - } - - public function testTableNameLocal() { - $this->assertEquals( - $this->prefixAndQuote( 'tablename' ), - $this->db->tableName( 'tablename' ) - ); - } - - public function testTableNameRawLocal() { - $this->assertEquals( - $this->prefixAndQuote( 'tablename', null, null, 'raw' ), - $this->db->tableName( 'tablename', 'raw' ) - ); - } - - public function testTableNameShared() { - $this->assertEquals( - $this->prefixAndQuote( 'tablename', 'sharedatabase', 'sh_' ), - $this->getSharedTableName( 'tablename', 'sharedatabase', 'sh_' ) - ); - - $this->assertEquals( - $this->prefixAndQuote( 'tablename', 'sharedatabase', null ), - $this->getSharedTableName( 'tablename', 'sharedatabase', null ) - ); - } - - public function testTableNameRawShared() { - $this->assertEquals( - $this->prefixAndQuote( 'tablename', 'sharedatabase', 'sh_', 'raw' ), - $this->getSharedTableName( 'tablename', 'sharedatabase', 'sh_', 'raw' ) - ); - - $this->assertEquals( - $this->prefixAndQuote( 'tablename', 'sharedatabase', null, 'raw' ), - $this->getSharedTableName( 'tablename', 'sharedatabase', null, 'raw' ) - ); - } - - public function testTableNameForeign() { - $this->assertEquals( - $this->prefixAndQuote( 'tablename', 'databasename', '' ), - $this->db->tableName( 'databasename.tablename' ) - ); - } - - public function testTableNameRawForeign() { - $this->assertEquals( - $this->prefixAndQuote( 'tablename', 'databasename', '', 'raw' ), - $this->db->tableName( 'databasename.tablename', 'raw' ) - ); - } - - public function testFillPreparedEmpty() { - $sql = $this->db->fillPrepared( - 'SELECT * FROM interwiki', array() ); - $this->assertEquals( - "SELECT * FROM interwiki", - $sql ); - } - - public function testFillPreparedQuestion() { - $sql = $this->db->fillPrepared( - 'SELECT * FROM cur WHERE cur_namespace=? AND cur_title=?', - array( 4, "Snicker's_paradox" ) ); - - $check = "SELECT * FROM cur WHERE cur_namespace='4' AND cur_title='Snicker''s_paradox'"; - if ( $this->db->getType() === 'mysql' ) { - $check = "SELECT * FROM cur WHERE cur_namespace='4' AND cur_title='Snicker\'s_paradox'"; - } - $this->assertEquals( $check, $sql ); - } - - public function testFillPreparedBang() { - $sql = $this->db->fillPrepared( - 'SELECT user_id FROM ! WHERE user_name=?', - array( '"user"', "Slash's Dot" ) ); - - $check = "SELECT user_id FROM \"user\" WHERE user_name='Slash''s Dot'"; - if ( $this->db->getType() === 'mysql' ) { - $check = "SELECT user_id FROM \"user\" WHERE user_name='Slash\'s Dot'"; - } - $this->assertEquals( $check, $sql ); - } - - public function testFillPreparedRaw() { - $sql = $this->db->fillPrepared( - "SELECT * FROM cur WHERE cur_title='This_\\&_that,_WTF\\?\\!'", - array( '"user"', "Slash's Dot" ) ); - $this->assertEquals( - "SELECT * FROM cur WHERE cur_title='This_&_that,_WTF?!'", - $sql ); - } - - public function testStoredFunctions() { - if ( !in_array( wfGetDB( DB_MASTER )->getType(), array( 'mysql', 'postgres' ) ) ) { - $this->markTestSkipped( 'MySQL or Postgres required' ); - } - global $IP; - $this->dropFunctions(); - $this->functionTest = true; - $this->assertTrue( $this->db->sourceFile( "$IP/tests/phpunit/data/db/{$this->db->getType()}/functions.sql" ) ); - $res = $this->db->query( 'SELECT mw_test_function() AS test', __METHOD__ ); - $this->assertEquals( 42, $res->fetchObject()->test ); - } - - private function dropFunctions() { - $this->db->query( 'DROP FUNCTION IF EXISTS mw_test_function' - . ( $this->db->getType() == 'postgres' ? '()' : '' ) - ); - } - - public function testUnknownTableCorruptsResults() { - $res = $this->db->select( 'page', '*', array( 'page_id' => 1 ) ); - $this->assertFalse( $this->db->tableExists( 'foobarbaz' ) ); - $this->assertInternalType( 'int', $res->numRows() ); - } -} diff --git a/tests/phpunit/includes/db/DatabaseTestHelper.php b/tests/phpunit/includes/db/DatabaseTestHelper.php deleted file mode 100644 index 790f273c..00000000 --- a/tests/phpunit/includes/db/DatabaseTestHelper.php +++ /dev/null @@ -1,166 +0,0 @@ -testName = $testName; - } - - /** - * Returns SQL queries grouped by '; ' - * Clear the list of queries that have been done so far. - */ - public function getLastSqls() { - $lastSqls = implode( '; ', $this->lastSqls ); - $this->lastSqls = array(); - - return $lastSqls; - } - - public function setExistingTables( $tablesExists ) { - $this->tablesExists = (array)$tablesExists; - } - - protected function addSql( $sql ) { - // clean up spaces before and after some words and the whole string - $this->lastSqls[] = trim( preg_replace( - '/\s{2,}(?=FROM|WHERE|GROUP BY|ORDER BY|LIMIT)|(?<=SELECT|INSERT|UPDATE)\s{2,}/', - ' ', $sql - ) ); - } - - protected function checkFunctionName( $fname ) { - if ( substr( $fname, 0, strlen( $this->testName ) ) !== $this->testName ) { - throw new MWException( 'function name does not start with test class. ' . - $fname . ' vs. ' . $this->testName . '. ' . - 'Please provide __METHOD__ to database methods.' ); - } - } - - function strencode( $s ) { - // Choose apos to avoid handling of escaping double quotes in quoted text - return str_replace( "'", "\'", $s ); - } - - public function addIdentifierQuotes( $s ) { - // no escaping to avoid handling of double quotes in quoted text - return $s; - } - - public function query( $sql, $fname = '', $tempIgnore = false ) { - $this->checkFunctionName( $fname ); - $this->addSql( $sql ); - - return parent::query( $sql, $fname, $tempIgnore ); - } - - public function tableExists( $table, $fname = __METHOD__ ) { - $this->checkFunctionName( $fname ); - - return in_array( $table, (array)$this->tablesExists ); - } - - // Redeclare parent method to make it public - public function nativeReplace( $table, $rows, $fname ) { - return parent::nativeReplace( $table, $rows, $fname ); - } - - function getType() { - return 'test'; - } - - function open( $server, $user, $password, $dbName ) { - return false; - } - - function fetchObject( $res ) { - return false; - } - - function fetchRow( $res ) { - return false; - } - - function numRows( $res ) { - return -1; - } - - function numFields( $res ) { - return -1; - } - - function fieldName( $res, $n ) { - return 'test'; - } - - function insertId() { - return -1; - } - - function dataSeek( $res, $row ) { - /* nop */ - } - - function lastErrno() { - return -1; - } - - function lastError() { - return 'test'; - } - - function fieldInfo( $table, $field ) { - return false; - } - - function indexInfo( $table, $index, $fname = 'Database::indexInfo' ) { - return false; - } - - function affectedRows() { - return -1; - } - - function getSoftwareLink() { - return 'test'; - } - - function getServerVersion() { - return 'test'; - } - - function getServerInfo() { - return 'test'; - } - - protected function closeConnection() { - return false; - } - - protected function doQuery( $sql ) { - return array(); - } -} diff --git a/tests/phpunit/includes/db/ORMRowTest.php b/tests/phpunit/includes/db/ORMRowTest.php deleted file mode 100644 index 27d4d0e8..00000000 --- a/tests/phpunit/includes/db/ORMRowTest.php +++ /dev/null @@ -1,226 +0,0 @@ - - */ -abstract class ORMRowTest extends \MediaWikiTestCase { - - /** - * @since 1.20 - * @return string - */ - abstract protected function getRowClass(); - - /** - * @since 1.20 - * @return IORMTable - */ - abstract protected function getTableInstance(); - - /** - * @since 1.20 - * @return array - */ - abstract public function constructorTestProvider(); - - /** - * @since 1.20 - * @param IORMRow $row - * @param array $data - */ - protected function verifyFields( IORMRow $row, array $data ) { - foreach ( array_keys( $data ) as $fieldName ) { - $this->assertEquals( $data[$fieldName], $row->getField( $fieldName ) ); - } - } - - /** - * @since 1.20 - * @param array $data - * @param boolean $loadDefaults - * @return IORMRow - */ - protected function getRowInstance( array $data, $loadDefaults ) { - $class = $this->getRowClass(); - - return new $class( $this->getTableInstance(), $data, $loadDefaults ); - } - - /** - * @since 1.20 - * @return array - */ - protected function getMockValues() { - return array( - 'id' => 1, - 'str' => 'foobar4645645', - 'int' => 42, - 'float' => 4.2, - 'bool' => true, - 'array' => array( 42, 'foobar' ), - 'blob' => new stdClass() - ); - } - - /** - * @since 1.20 - * @return array - */ - protected function getMockFields() { - $mockValues = $this->getMockValues(); - $mockFields = array(); - - foreach ( $this->getTableInstance()->getFields() as $name => $type ) { - if ( $name !== 'id' ) { - $mockFields[$name] = $mockValues[$type]; - } - } - - return $mockFields; - } - - /** - * @since 1.20 - * @return array of IORMRow - */ - public function instanceProvider() { - $instances = array(); - - foreach ( $this->constructorTestProvider() as $arguments ) { - $instances[] = array( call_user_func_array( array( $this, 'getRowInstance' ), $arguments ) ); - } - - return $instances; - } - - /** - * @dataProvider constructorTestProvider - */ - public function testConstructor( array $data, $loadDefaults ) { - $this->verifyFields( $this->getRowInstance( $data, $loadDefaults ), $data ); - } - - /** - * @dataProvider constructorTestProvider - */ - public function testSaveAndRemove( array $data, $loadDefaults ) { - $item = $this->getRowInstance( $data, $loadDefaults ); - - $this->assertTrue( $item->save() ); - - $this->assertTrue( $item->hasIdField() ); - $this->assertTrue( is_integer( $item->getId() ) ); - - $id = $item->getId(); - - $this->assertTrue( $item->save() ); - - $this->assertEquals( $id, $item->getId() ); - - $this->verifyFields( $item, $data ); - - $this->assertTrue( $item->remove() ); - - $this->assertFalse( $item->hasIdField() ); - - $this->assertTrue( $item->save() ); - - $this->verifyFields( $item, $data ); - - $this->assertTrue( $item->remove() ); - - $this->assertFalse( $item->hasIdField() ); - - $this->verifyFields( $item, $data ); - } - - /** - * @dataProvider instanceProvider - */ - public function testSetField( IORMRow $item ) { - foreach ( $this->getMockFields() as $name => $value ) { - $item->setField( $name, $value ); - $this->assertEquals( $value, $item->getField( $name ) ); - } - } - - /** - * @since 1.20 - * @param array $expected - * @param IORMRow $item - */ - protected function assertFieldValues( array $expected, IORMRow $item ) { - foreach ( $expected as $name => $type ) { - if ( $name !== 'id' ) { - $this->assertEquals( $expected[$name], $item->getField( $name ) ); - } - } - } - - /** - * @dataProvider instanceProvider - */ - public function testSetFields( IORMRow $item ) { - $originalValues = $item->getFields(); - - $item->setFields( array(), false ); - - foreach ( $item->getTable()->getFields() as $name => $type ) { - $originalHas = array_key_exists( $name, $originalValues ); - $newHas = $item->hasField( $name ); - - $this->assertEquals( $originalHas, $newHas ); - - if ( $originalHas && $newHas ) { - $this->assertEquals( $originalValues[$name], $item->getField( $name ) ); - } - } - - $mockFields = $this->getMockFields(); - - $item->setFields( $mockFields, false ); - - $this->assertFieldValues( $originalValues, $item ); - - $item->setFields( $mockFields, true ); - - $this->assertFieldValues( $mockFields, $item ); - } - - // TODO: test all of the methods! - -} diff --git a/tests/phpunit/includes/db/ORMTableTest.php b/tests/phpunit/includes/db/ORMTableTest.php deleted file mode 100644 index e583d1bc..00000000 --- a/tests/phpunit/includes/db/ORMTableTest.php +++ /dev/null @@ -1,146 +0,0 @@ - - * @author Daniel Kinzler - */ -class ORMTableTest extends MediaWikiTestCase { - - /** - * @since 1.21 - * @return string - */ - protected function getTableClass() { - return 'PageORMTableForTesting'; - } - - /** - * @since 1.21 - * @return IORMTable - */ - public function getTable() { - $class = $this->getTableClass(); - - return $class::singleton(); - } - - /** - * @since 1.21 - * @return string - */ - public function getRowClass() { - return $this->getTable()->getRowClass(); - } - - /** - * @since 1.21 - */ - public function testSingleton() { - $class = $this->getTableClass(); - - $this->assertInstanceOf( $class, $class::singleton() ); - $this->assertTrue( $class::singleton() === $class::singleton() ); - } - - /** - * @since 1.21 - */ - public function testIgnoreErrorsOverride() { - $table = $this->getTable(); - - $db = $table->getReadDbConnection(); - $db->ignoreErrors( true ); - - try { - $table->rawSelect( "this is invalid" ); - $this->fail( "An invalid query should trigger a DBQueryError even if ignoreErrors is enabled." ); - } catch ( DBQueryError $ex ) { - $this->assertTrue( true, "just making phpunit happy" ); - } - - $db->ignoreErrors( false ); - } -} - -/** - * Dummy ORM table for testing, reading Title objects from the page table. - * - * @since 1.21 - */ - -class PageORMTableForTesting extends ORMTable { - - /** - * @see ORMTable::getName - * - * @return string - */ - public function getName() { - return 'page'; - } - - /** - * @see ORMTable::getRowClass - * - * @return string - */ - public function getRowClass() { - return 'Title'; - } - - /** - * @see ORMTable::newRow - * - * @return IORMRow - */ - public function newRow( array $data, $loadDefaults = false ) { - return Title::makeTitle( $data['namespace'], $data['title'] ); - } - - /** - * @see ORMTable::getFields - * - * @return array - */ - public function getFields() { - return array( - 'id' => 'int', - 'namespace' => 'int', - 'title' => 'str', - ); - } - - /** - * @see ORMTable::getFieldPrefix - * - * @return string - */ - protected function getFieldPrefix() { - return 'page_'; - } -} diff --git a/tests/phpunit/includes/db/TestORMRowTest.php b/tests/phpunit/includes/db/TestORMRowTest.php deleted file mode 100644 index f65642b8..00000000 --- a/tests/phpunit/includes/db/TestORMRowTest.php +++ /dev/null @@ -1,215 +0,0 @@ - - */ -require_once __DIR__ . "/ORMRowTest.php"; - -class TestORMRowTest extends ORMRowTest { - - /** - * @since 1.20 - * @return string - */ - protected function getRowClass() { - return 'TestORMRow'; - } - - /** - * @since 1.20 - * @return IORMTable - */ - protected function getTableInstance() { - return TestORMTable::singleton(); - } - - protected function setUp() { - parent::setUp(); - - $dbw = wfGetDB( DB_MASTER ); - - $isSqlite = $GLOBALS['wgDBtype'] === 'sqlite'; - $isPostgres = $GLOBALS['wgDBtype'] === 'postgres'; - - $idField = $isSqlite ? 'INTEGER' : 'INT unsigned'; - $primaryKey = $isSqlite ? 'PRIMARY KEY AUTOINCREMENT' : 'auto_increment PRIMARY KEY'; - - if ( $isPostgres ) { - $dbw->query( - 'CREATE TABLE IF NOT EXISTS ' . $dbw->tableName( 'orm_test' ) . "( - test_id serial PRIMARY KEY, - test_name TEXT NOT NULL DEFAULT '', - test_age INTEGER NOT NULL DEFAULT 0, - test_height REAL NOT NULL DEFAULT 0, - test_awesome INTEGER NOT NULL DEFAULT 0, - test_stuff BYTEA, - test_moarstuff BYTEA, - test_time TIMESTAMPTZ - );", - __METHOD__ - ); - } else { - $dbw->query( - 'CREATE TABLE IF NOT EXISTS ' . $dbw->tableName( 'orm_test' ) . '( - test_id ' . $idField . ' NOT NULL ' . $primaryKey . ', - test_name VARCHAR(255) NOT NULL, - test_age TINYINT unsigned NOT NULL, - test_height FLOAT NOT NULL, - test_awesome TINYINT unsigned NOT NULL, - test_stuff BLOB NOT NULL, - test_moarstuff BLOB NOT NULL, - test_time varbinary(14) NOT NULL - );', - __METHOD__ - ); - } - } - - protected function tearDown() { - $dbw = wfGetDB( DB_MASTER ); - $dbw->dropTable( 'orm_test', __METHOD__ ); - - parent::tearDown(); - } - - public function constructorTestProvider() { - $dbw = wfGetDB( DB_MASTER ); - return array( - array( - array( - 'name' => 'Foobar', - 'time' => $dbw->timestamp( '20120101020202' ), - 'age' => 42, - 'height' => 9000.1, - 'awesome' => true, - 'stuff' => array( 13, 11, 7, 5, 3, 2 ), - 'moarstuff' => (object)array( 'foo' => 'bar', 'bar' => array( 4, 2 ), 'baz' => true ) - ), - true - ), - ); - } - - /** - * @since 1.21 - * @return array - */ - protected function getMockValues() { - return array( - 'id' => 1, - 'str' => 'foobar4645645', - 'int' => 42, - 'float' => 4.2, - 'bool' => '', - 'array' => array( 42, 'foobar' ), - 'blob' => new stdClass() - ); - } -} - -class TestORMRow extends ORMRow { -} - -class TestORMTable extends ORMTable { - - /** - * Returns the name of the database table objects of this type are stored in. - * - * @since 1.20 - * - * @return string - */ - public function getName() { - return 'orm_test'; - } - - /** - * Returns the name of a IORMRow implementing class that - * represents single rows in this table. - * - * @since 1.20 - * - * @return string - */ - public function getRowClass() { - return 'TestORMRow'; - } - - /** - * Returns an array with the fields and their types this object contains. - * This corresponds directly to the fields in the database, without prefix. - * - * field name => type - * - * Allowed types: - * * id - * * str - * * int - * * float - * * bool - * * array - * * blob - * - * @since 1.20 - * - * @return array - */ - public function getFields() { - return array( - 'id' => 'id', - 'name' => 'str', - 'age' => 'int', - 'height' => 'float', - 'awesome' => 'bool', - 'stuff' => 'array', - 'moarstuff' => 'blob', - 'time' => 'str', // TS_MW - ); - } - - /** - * Gets the db field prefix. - * - * @since 1.20 - * - * @return string - */ - protected function getFieldPrefix() { - return 'test_'; - } -} diff --git a/tests/phpunit/includes/debug/MWDebugTest.php b/tests/phpunit/includes/debug/MWDebugTest.php deleted file mode 100644 index 6926b1c8..00000000 --- a/tests/phpunit/includes/debug/MWDebugTest.php +++ /dev/null @@ -1,72 +0,0 @@ -assertEquals( - array( array( - 'msg' => 'logging a string', - 'type' => 'log', - 'caller' => __METHOD__, - ) ), - MWDebug::getLog() - ); - } - - public function testAddWarning() { - MWDebug::warning( 'Warning message' ); - $this->assertEquals( - array( array( - 'msg' => 'Warning message', - 'type' => 'warn', - 'caller' => 'MWDebugTest::testAddWarning', - ) ), - MWDebug::getLog() - ); - } - - public function testAvoidDuplicateDeprecations() { - MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); - MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); - - // assertCount() not available on WMF integration server - $this->assertEquals( 1, - count( MWDebug::getLog() ), - "Only one deprecated warning per function should be kept" - ); - } - - public function testAvoidNonConsecutivesDuplicateDeprecations() { - MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); - MWDebug::warning( 'some warning' ); - MWDebug::log( 'we could have logged something too' ); - // Another deprecation - MWDebug::deprecated( 'wfOldFunction', '1.0', 'component' ); - - // assertCount() not available on WMF integration server - $this->assertEquals( 3, - count( MWDebug::getLog() ), - "Only one deprecated warning per function should be kept" - ); - } -} diff --git a/tests/phpunit/includes/filebackend/FileBackendTest.php b/tests/phpunit/includes/filebackend/FileBackendTest.php deleted file mode 100644 index fcfa724f..00000000 --- a/tests/phpunit/includes/filebackend/FileBackendTest.php +++ /dev/null @@ -1,2306 +0,0 @@ -getCliArg( 'use-filebackend=' ) ) { - if ( self::$backendToUse ) { - $this->singleBackend = self::$backendToUse; - } else { - $name = $this->getCliArg( 'use-filebackend=' ); - $useConfig = array(); - foreach ( $wgFileBackends as $conf ) { - if ( $conf['name'] == $name ) { - $useConfig = $conf; - break; - } - } - $useConfig['name'] = 'localtesting'; // swap name - $useConfig['shardViaHashLevels'] = array( // test sharding - 'unittest-cont1' => array( 'levels' => 1, 'base' => 16, 'repeat' => 1 ) - ); - $class = $useConfig['class']; - self::$backendToUse = new $class( $useConfig ); - $this->singleBackend = self::$backendToUse; - } - } else { - $this->singleBackend = new FSFileBackend( array( - 'name' => 'localtesting', - 'lockManager' => 'fsLockManager', - #'parallelize' => 'implicit', - 'wikiId' => wfWikiID() . $uniqueId, - 'containerPaths' => array( - 'unittest-cont1' => "{$tmpPrefix}-localtesting-cont1", - 'unittest-cont2' => "{$tmpPrefix}-localtesting-cont2" ) - ) ); - } - $this->multiBackend = new FileBackendMultiWrite( array( - 'name' => 'localtesting', - 'lockManager' => 'fsLockManager', - 'parallelize' => 'implicit', - 'wikiId' => wfWikiId() . $uniqueId, - 'backends' => array( - array( - 'name' => 'localmultitesting1', - 'class' => 'FSFileBackend', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array( - 'unittest-cont1' => "{$tmpPrefix}-localtestingmulti1-cont1", - 'unittest-cont2' => "{$tmpPrefix}-localtestingmulti1-cont2" ), - 'isMultiMaster' => false - ), - array( - 'name' => 'localmultitesting2', - 'class' => 'FSFileBackend', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array( - 'unittest-cont1' => "{$tmpPrefix}-localtestingmulti2-cont1", - 'unittest-cont2' => "{$tmpPrefix}-localtestingmulti2-cont2" ), - 'isMultiMaster' => true - ) - ) - ) ); - $this->filesToPrune = array(); - } - - private static function baseStorePath() { - return 'mwstore://localtesting'; - } - - private function backendClass() { - return get_class( $this->backend ); - } - - /** - * @dataProvider provider_testIsStoragePath - * @covers FileBackend::isStoragePath - */ - public function testIsStoragePath( $path, $isStorePath ) { - $this->assertEquals( $isStorePath, FileBackend::isStoragePath( $path ), - "FileBackend::isStoragePath on path '$path'" ); - } - - public static function provider_testIsStoragePath() { - return array( - array( 'mwstore://', true ), - array( 'mwstore://backend', true ), - array( 'mwstore://backend/container', true ), - array( 'mwstore://backend/container/', true ), - array( 'mwstore://backend/container/path', true ), - array( 'mwstore://backend//container/', true ), - array( 'mwstore://backend//container//', true ), - array( 'mwstore://backend//container//path', true ), - array( 'mwstore:///', true ), - array( 'mwstore:/', false ), - array( 'mwstore:', false ), - ); - } - - /** - * @dataProvider provider_testSplitStoragePath - * @covers FileBackend::splitStoragePath - */ - public function testSplitStoragePath( $path, $res ) { - $this->assertEquals( $res, FileBackend::splitStoragePath( $path ), - "FileBackend::splitStoragePath on path '$path'" ); - } - - public static function provider_testSplitStoragePath() { - return array( - array( 'mwstore://backend/container', array( 'backend', 'container', '' ) ), - array( 'mwstore://backend/container/', array( 'backend', 'container', '' ) ), - array( 'mwstore://backend/container/path', array( 'backend', 'container', 'path' ) ), - array( 'mwstore://backend/container//path', array( 'backend', 'container', '/path' ) ), - array( 'mwstore://backend//container/path', array( null, null, null ) ), - array( 'mwstore://backend//container//path', array( null, null, null ) ), - array( 'mwstore://', array( null, null, null ) ), - array( 'mwstore://backend', array( null, null, null ) ), - array( 'mwstore:///', array( null, null, null ) ), - array( 'mwstore:/', array( null, null, null ) ), - array( 'mwstore:', array( null, null, null ) ) - ); - } - - /** - * @dataProvider provider_normalizeStoragePath - * @covers FileBackend::normalizeStoragePath - */ - public function testNormalizeStoragePath( $path, $res ) { - $this->assertEquals( $res, FileBackend::normalizeStoragePath( $path ), - "FileBackend::normalizeStoragePath on path '$path'" ); - } - - public static function provider_normalizeStoragePath() { - return array( - array( 'mwstore://backend/container', 'mwstore://backend/container' ), - array( 'mwstore://backend/container/', 'mwstore://backend/container' ), - array( 'mwstore://backend/container/path', 'mwstore://backend/container/path' ), - array( 'mwstore://backend/container//path', 'mwstore://backend/container/path' ), - array( 'mwstore://backend/container///path', 'mwstore://backend/container/path' ), - array( 'mwstore://backend/container///path//to///obj', 'mwstore://backend/container/path/to/obj' ), - array( 'mwstore://', null ), - array( 'mwstore://backend', null ), - array( 'mwstore://backend//container/path', null ), - array( 'mwstore://backend//container//path', null ), - array( 'mwstore:///', null ), - array( 'mwstore:/', null ), - array( 'mwstore:', null ), - ); - } - - /** - * @dataProvider provider_testParentStoragePath - * @covers FileBackend::parentStoragePath - */ - public function testParentStoragePath( $path, $res ) { - $this->assertEquals( $res, FileBackend::parentStoragePath( $path ), - "FileBackend::parentStoragePath on path '$path'" ); - } - - public static function provider_testParentStoragePath() { - return array( - array( 'mwstore://backend/container/path/to/obj', 'mwstore://backend/container/path/to' ), - array( 'mwstore://backend/container/path/to', 'mwstore://backend/container/path' ), - array( 'mwstore://backend/container/path', 'mwstore://backend/container' ), - array( 'mwstore://backend/container', null ), - array( 'mwstore://backend/container/path/to/obj/', 'mwstore://backend/container/path/to' ), - array( 'mwstore://backend/container/path/to/', 'mwstore://backend/container/path' ), - array( 'mwstore://backend/container/path/', 'mwstore://backend/container' ), - array( 'mwstore://backend/container/', null ), - ); - } - - /** - * @dataProvider provider_testExtensionFromPath - * @covers FileBackend::extensionFromPath - */ - public function testExtensionFromPath( $path, $res ) { - $this->assertEquals( $res, FileBackend::extensionFromPath( $path ), - "FileBackend::extensionFromPath on path '$path'" ); - } - - public static function provider_testExtensionFromPath() { - return array( - array( 'mwstore://backend/container/path.txt', 'txt' ), - array( 'mwstore://backend/container/path.svg.png', 'png' ), - array( 'mwstore://backend/container/path', '' ), - array( 'mwstore://backend/container/path.', '' ), - ); - } - - /** - * @dataProvider provider_testStore - */ - public function testStore( $op ) { - $this->filesToPrune[] = $op['src']; - - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestStore( $op ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestStore( $op ); - $this->filesToPrune[] = $op['src']; # avoid file leaking - $this->tearDownFiles(); - } - - /** - * @covers FileBackend::doOperation - */ - private function doTestStore( $op ) { - $backendName = $this->backendClass(); - - $source = $op['src']; - $dest = $op['dst']; - $this->prepare( array( 'dir' => dirname( $dest ) ) ); - - file_put_contents( $source, "Unit test file" ); - - if ( isset( $op['overwrite'] ) || isset( $op['overwriteSame'] ) ) { - $this->backend->store( $op ); - } - - $status = $this->backend->doOperation( $op ); - - $this->assertGoodStatus( $status, - "Store from $source to $dest succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Store from $source to $dest succeeded ($backendName)." ); - $this->assertEquals( array( 0 => true ), $status->success, - "Store from $source to $dest has proper 'success' field in Status ($backendName)." ); - $this->assertEquals( true, file_exists( $source ), - "Source file $source still exists ($backendName)." ); - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $dest ) ), - "Destination file $dest exists ($backendName)." ); - - $this->assertEquals( filesize( $source ), - $this->backend->getFileSize( array( 'src' => $dest ) ), - "Destination file $dest has correct size ($backendName)." ); - - $props1 = FSFile::getPropsFromPath( $source ); - $props2 = $this->backend->getFileProps( array( 'src' => $dest ) ); - $this->assertEquals( $props1, $props2, - "Source and destination have the same props ($backendName)." ); - - $this->assertBackendPathsConsistent( array( $dest ) ); - } - - public static function provider_testStore() { - $cases = array(); - - $tmpName = TempFSFile::factory( "unittests_", 'txt' )->getPath(); - $toPath = self::baseStorePath() . '/unittest-cont1/e/fun/obj1.txt'; - $op = array( 'op' => 'store', 'src' => $tmpName, 'dst' => $toPath ); - $cases[] = array( - $op, // operation - $tmpName, // source - $toPath, // dest - ); - - $op2 = $op; - $op2['overwrite'] = true; - $cases[] = array( - $op2, // operation - $tmpName, // source - $toPath, // dest - ); - - $op2 = $op; - $op2['overwriteSame'] = true; - $cases[] = array( - $op2, // operation - $tmpName, // source - $toPath, // dest - ); - - return $cases; - } - - /** - * @dataProvider provider_testCopy - * @covers FileBackend::doOperation - */ - public function testCopy( $op ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestCopy( $op ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestCopy( $op ); - $this->tearDownFiles(); - } - - private function doTestCopy( $op ) { - $backendName = $this->backendClass(); - - $source = $op['src']; - $dest = $op['dst']; - $this->prepare( array( 'dir' => dirname( $source ) ) ); - $this->prepare( array( 'dir' => dirname( $dest ) ) ); - - if ( isset( $op['ignoreMissingSource'] ) ) { - $status = $this->backend->doOperation( $op ); - $this->assertGoodStatus( $status, - "Move from $source to $dest succeeded without warnings ($backendName)." ); - $this->assertEquals( array( 0 => true ), $status->success, - "Move from $source to $dest has proper 'success' field in Status ($backendName)." ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $source ) ), - "Source file $source does not exist ($backendName)." ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $dest ) ), - "Destination file $dest does not exist ($backendName)." ); - - return; // done - } - - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => 'blahblah', 'dst' => $source ) ); - $this->assertGoodStatus( $status, - "Creation of file at $source succeeded ($backendName)." ); - - if ( isset( $op['overwrite'] ) || isset( $op['overwriteSame'] ) ) { - $this->backend->copy( $op ); - } - - $status = $this->backend->doOperation( $op ); - - $this->assertGoodStatus( $status, - "Copy from $source to $dest succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Copy from $source to $dest succeeded ($backendName)." ); - $this->assertEquals( array( 0 => true ), $status->success, - "Copy from $source to $dest has proper 'success' field in Status ($backendName)." ); - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $source ) ), - "Source file $source still exists ($backendName)." ); - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $dest ) ), - "Destination file $dest exists after copy ($backendName)." ); - - $this->assertEquals( - $this->backend->getFileSize( array( 'src' => $source ) ), - $this->backend->getFileSize( array( 'src' => $dest ) ), - "Destination file $dest has correct size ($backendName)." ); - - $props1 = $this->backend->getFileProps( array( 'src' => $source ) ); - $props2 = $this->backend->getFileProps( array( 'src' => $dest ) ); - $this->assertEquals( $props1, $props2, - "Source and destination have the same props ($backendName)." ); - - $this->assertBackendPathsConsistent( array( $source, $dest ) ); - } - - public static function provider_testCopy() { - $cases = array(); - - $source = self::baseStorePath() . '/unittest-cont1/e/file.txt'; - $dest = self::baseStorePath() . '/unittest-cont2/a/fileMoved.txt'; - - $op = array( 'op' => 'copy', 'src' => $source, 'dst' => $dest ); - $cases[] = array( - $op, // operation - $source, // source - $dest, // dest - ); - - $op2 = $op; - $op2['overwrite'] = true; - $cases[] = array( - $op2, // operation - $source, // source - $dest, // dest - ); - - $op2 = $op; - $op2['overwriteSame'] = true; - $cases[] = array( - $op2, // operation - $source, // source - $dest, // dest - ); - - $op2 = $op; - $op2['ignoreMissingSource'] = true; - $cases[] = array( - $op2, // operation - $source, // source - $dest, // dest - ); - - $op2 = $op; - $op2['ignoreMissingSource'] = true; - $cases[] = array( - $op2, // operation - self::baseStorePath() . '/unittest-cont-bad/e/file.txt', // source - $dest, // dest - ); - - return $cases; - } - - /** - * @dataProvider provider_testMove - * @covers FileBackend::doOperation - */ - public function testMove( $op ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestMove( $op ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestMove( $op ); - $this->tearDownFiles(); - } - - private function doTestMove( $op ) { - $backendName = $this->backendClass(); - - $source = $op['src']; - $dest = $op['dst']; - $this->prepare( array( 'dir' => dirname( $source ) ) ); - $this->prepare( array( 'dir' => dirname( $dest ) ) ); - - if ( isset( $op['ignoreMissingSource'] ) ) { - $status = $this->backend->doOperation( $op ); - $this->assertGoodStatus( $status, - "Move from $source to $dest succeeded without warnings ($backendName)." ); - $this->assertEquals( array( 0 => true ), $status->success, - "Move from $source to $dest has proper 'success' field in Status ($backendName)." ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $source ) ), - "Source file $source does not exist ($backendName)." ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $dest ) ), - "Destination file $dest does not exist ($backendName)." ); - - return; // done - } - - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => 'blahblah', 'dst' => $source ) ); - $this->assertGoodStatus( $status, - "Creation of file at $source succeeded ($backendName)." ); - - if ( isset( $op['overwrite'] ) || isset( $op['overwriteSame'] ) ) { - $this->backend->copy( $op ); - } - - $status = $this->backend->doOperation( $op ); - $this->assertGoodStatus( $status, - "Move from $source to $dest succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Move from $source to $dest succeeded ($backendName)." ); - $this->assertEquals( array( 0 => true ), $status->success, - "Move from $source to $dest has proper 'success' field in Status ($backendName)." ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $source ) ), - "Source file $source does not still exists ($backendName)." ); - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $dest ) ), - "Destination file $dest exists after move ($backendName)." ); - - $this->assertNotEquals( - $this->backend->getFileSize( array( 'src' => $source ) ), - $this->backend->getFileSize( array( 'src' => $dest ) ), - "Destination file $dest has correct size ($backendName)." ); - - $props1 = $this->backend->getFileProps( array( 'src' => $source ) ); - $props2 = $this->backend->getFileProps( array( 'src' => $dest ) ); - $this->assertEquals( false, $props1['fileExists'], - "Source file does not exist accourding to props ($backendName)." ); - $this->assertEquals( true, $props2['fileExists'], - "Destination file exists accourding to props ($backendName)." ); - - $this->assertBackendPathsConsistent( array( $source, $dest ) ); - } - - public static function provider_testMove() { - $cases = array(); - - $source = self::baseStorePath() . '/unittest-cont1/e/file.txt'; - $dest = self::baseStorePath() . '/unittest-cont2/a/fileMoved.txt'; - - $op = array( 'op' => 'move', 'src' => $source, 'dst' => $dest ); - $cases[] = array( - $op, // operation - $source, // source - $dest, // dest - ); - - $op2 = $op; - $op2['overwrite'] = true; - $cases[] = array( - $op2, // operation - $source, // source - $dest, // dest - ); - - $op2 = $op; - $op2['overwriteSame'] = true; - $cases[] = array( - $op2, // operation - $source, // source - $dest, // dest - ); - - $op2 = $op; - $op2['ignoreMissingSource'] = true; - $cases[] = array( - $op2, // operation - $source, // source - $dest, // dest - ); - - $op2 = $op; - $op2['ignoreMissingSource'] = true; - $cases[] = array( - $op2, // operation - self::baseStorePath() . '/unittest-cont-bad/e/file.txt', // source - $dest, // dest - ); - - return $cases; - } - - /** - * @dataProvider provider_testDelete - * @covers FileBackend::doOperation - */ - public function testDelete( $op, $withSource, $okStatus ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestDelete( $op, $withSource, $okStatus ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestDelete( $op, $withSource, $okStatus ); - $this->tearDownFiles(); - } - - private function doTestDelete( $op, $withSource, $okStatus ) { - $backendName = $this->backendClass(); - - $source = $op['src']; - $this->prepare( array( 'dir' => dirname( $source ) ) ); - - if ( $withSource ) { - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => 'blahblah', 'dst' => $source ) ); - $this->assertGoodStatus( $status, - "Creation of file at $source succeeded ($backendName)." ); - } - - $status = $this->backend->doOperation( $op ); - if ( $okStatus ) { - $this->assertGoodStatus( $status, - "Deletion of file at $source succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Deletion of file at $source succeeded ($backendName)." ); - $this->assertEquals( array( 0 => true ), $status->success, - "Deletion of file at $source has proper 'success' field in Status ($backendName)." ); - } else { - $this->assertEquals( false, $status->isOK(), - "Deletion of file at $source failed ($backendName)." ); - } - - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $source ) ), - "Source file $source does not exist after move ($backendName)." ); - - $this->assertFalse( - $this->backend->getFileSize( array( 'src' => $source ) ), - "Source file $source has correct size (false) ($backendName)." ); - - $props1 = $this->backend->getFileProps( array( 'src' => $source ) ); - $this->assertFalse( $props1['fileExists'], - "Source file $source does not exist according to props ($backendName)." ); - - $this->assertBackendPathsConsistent( array( $source ) ); - } - - public static function provider_testDelete() { - $cases = array(); - - $source = self::baseStorePath() . '/unittest-cont1/e/myfacefile.txt'; - - $op = array( 'op' => 'delete', 'src' => $source ); - $cases[] = array( - $op, // operation - true, // with source - true // succeeds - ); - - $cases[] = array( - $op, // operation - false, // without source - false // fails - ); - - $op['ignoreMissingSource'] = true; - $cases[] = array( - $op, // operation - false, // without source - true // succeeds - ); - - $op['ignoreMissingSource'] = true; - $op['src'] = self::baseStorePath() . '/unittest-cont-bad/e/file.txt'; - $cases[] = array( - $op, // operation - false, // without source - true // succeeds - ); - - return $cases; - } - - /** - * @dataProvider provider_testDescribe - * @covers FileBackend::doOperation - */ - public function testDescribe( $op, $withSource, $okStatus ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestDescribe( $op, $withSource, $okStatus ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestDescribe( $op, $withSource, $okStatus ); - $this->tearDownFiles(); - } - - private function doTestDescribe( $op, $withSource, $okStatus ) { - $backendName = $this->backendClass(); - - $source = $op['src']; - $this->prepare( array( 'dir' => dirname( $source ) ) ); - - if ( $withSource ) { - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => 'blahblah', 'dst' => $source ) ); - $this->assertGoodStatus( $status, - "Creation of file at $source succeeded ($backendName)." ); - } - - $status = $this->backend->doOperation( $op ); - if ( $okStatus ) { - $this->assertGoodStatus( $status, - "Describe of file at $source succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Describe of file at $source succeeded ($backendName)." ); - $this->assertEquals( array( 0 => true ), $status->success, - "Describe of file at $source has proper 'success' field in Status ($backendName)." ); - } else { - $this->assertEquals( false, $status->isOK(), - "Describe of file at $source failed ($backendName)." ); - } - - $this->assertBackendPathsConsistent( array( $source ) ); - } - - public static function provider_testDescribe() { - $cases = array(); - - $source = self::baseStorePath() . '/unittest-cont1/e/myfacefile.txt'; - - $op = array( 'op' => 'describe', 'src' => $source, - 'headers' => array( 'X-Content-Length' => '91.3', 'Content-Old-Header' => '' ), - 'disposition' => 'inline' ); - $cases[] = array( - $op, // operation - true, // with source - true // succeeds - ); - - $cases[] = array( - $op, // operation - false, // without source - false // fails - ); - - return $cases; - } - - /** - * @dataProvider provider_testCreate - * @covers FileBackend::doOperation - */ - public function testCreate( $op, $alreadyExists, $okStatus, $newSize ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestCreate( $op, $alreadyExists, $okStatus, $newSize ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestCreate( $op, $alreadyExists, $okStatus, $newSize ); - $this->tearDownFiles(); - } - - private function doTestCreate( $op, $alreadyExists, $okStatus, $newSize ) { - $backendName = $this->backendClass(); - - $dest = $op['dst']; - $this->prepare( array( 'dir' => dirname( $dest ) ) ); - - $oldText = 'blah...blah...waahwaah'; - if ( $alreadyExists ) { - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => $oldText, 'dst' => $dest ) ); - $this->assertGoodStatus( $status, - "Creation of file at $dest succeeded ($backendName)." ); - } - - $status = $this->backend->doOperation( $op ); - if ( $okStatus ) { - $this->assertGoodStatus( $status, - "Creation of file at $dest succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Creation of file at $dest succeeded ($backendName)." ); - $this->assertEquals( array( 0 => true ), $status->success, - "Creation of file at $dest has proper 'success' field in Status ($backendName)." ); - } else { - $this->assertEquals( false, $status->isOK(), - "Creation of file at $dest failed ($backendName)." ); - } - - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $dest ) ), - "Destination file $dest exists after creation ($backendName)." ); - - $props1 = $this->backend->getFileProps( array( 'src' => $dest ) ); - $this->assertEquals( true, $props1['fileExists'], - "Destination file $dest exists according to props ($backendName)." ); - if ( $okStatus ) { // file content is what we saved - $this->assertEquals( $newSize, $props1['size'], - "Destination file $dest has expected size according to props ($backendName)." ); - $this->assertEquals( $newSize, - $this->backend->getFileSize( array( 'src' => $dest ) ), - "Destination file $dest has correct size ($backendName)." ); - } else { // file content is some other previous text - $this->assertEquals( strlen( $oldText ), $props1['size'], - "Destination file $dest has original size according to props ($backendName)." ); - $this->assertEquals( strlen( $oldText ), - $this->backend->getFileSize( array( 'src' => $dest ) ), - "Destination file $dest has original size according to props ($backendName)." ); - } - - $this->assertBackendPathsConsistent( array( $dest ) ); - } - - /** - * @dataProvider provider_testCreate - */ - public static function provider_testCreate() { - $cases = array(); - - $dest = self::baseStorePath() . '/unittest-cont2/a/myspacefile.txt'; - - $op = array( 'op' => 'create', 'content' => 'test test testing', 'dst' => $dest ); - $cases[] = array( - $op, // operation - false, // no dest already exists - true, // succeeds - strlen( $op['content'] ) - ); - - $op2 = $op; - $op2['content'] = "\n"; - $cases[] = array( - $op2, // operation - false, // no dest already exists - true, // succeeds - strlen( $op2['content'] ) - ); - - $op2 = $op; - $op2['content'] = "fsf\n waf 3kt"; - $cases[] = array( - $op2, // operation - true, // dest already exists - false, // fails - strlen( $op2['content'] ) - ); - - $op2 = $op; - $op2['content'] = "egm'g gkpe gpqg eqwgwqg"; - $op2['overwrite'] = true; - $cases[] = array( - $op2, // operation - true, // dest already exists - true, // succeeds - strlen( $op2['content'] ) - ); - - $op2 = $op; - $op2['content'] = "39qjmg3-qg"; - $op2['overwriteSame'] = true; - $cases[] = array( - $op2, // operation - true, // dest already exists - false, // succeeds - strlen( $op2['content'] ) - ); - - return $cases; - } - - /** - * @covers FileBackend::doQuickOperations - */ - public function testDoQuickOperations() { - $this->backend = $this->singleBackend; - $this->doTestDoQuickOperations(); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->doTestDoQuickOperations(); - $this->tearDownFiles(); - } - - private function doTestDoQuickOperations() { - $backendName = $this->backendClass(); - - $base = self::baseStorePath(); - $files = array( - "$base/unittest-cont1/e/fileA.a", - "$base/unittest-cont1/e/fileB.a", - "$base/unittest-cont1/e/fileC.a" - ); - $createOps = array(); - $purgeOps = array(); - foreach ( $files as $path ) { - $status = $this->prepare( array( 'dir' => dirname( $path ) ) ); - $this->assertGoodStatus( $status, - "Preparing $path succeeded without warnings ($backendName)." ); - $createOps[] = array( 'op' => 'create', 'dst' => $path, 'content' => mt_rand( 0, 50000 ) ); - $copyOps[] = array( 'op' => 'copy', 'src' => $path, 'dst' => "$path-2" ); - $moveOps[] = array( 'op' => 'move', 'src' => "$path-2", 'dst' => "$path-3" ); - $purgeOps[] = array( 'op' => 'delete', 'src' => $path ); - $purgeOps[] = array( 'op' => 'delete', 'src' => "$path-3" ); - } - $purgeOps[] = array( 'op' => 'null' ); - - $this->assertGoodStatus( - $this->backend->doQuickOperations( $createOps ), - "Creation of source files succeeded ($backendName)." ); - foreach ( $files as $file ) { - $this->assertTrue( $this->backend->fileExists( array( 'src' => $file ) ), - "File $file exists." ); - } - - $this->assertGoodStatus( - $this->backend->doQuickOperations( $copyOps ), - "Quick copy of source files succeeded ($backendName)." ); - foreach ( $files as $file ) { - $this->assertTrue( $this->backend->fileExists( array( 'src' => "$file-2" ) ), - "File $file-2 exists." ); - } - - $this->assertGoodStatus( - $this->backend->doQuickOperations( $moveOps ), - "Quick move of source files succeeded ($backendName)." ); - foreach ( $files as $file ) { - $this->assertTrue( $this->backend->fileExists( array( 'src' => "$file-3" ) ), - "File $file-3 move in." ); - $this->assertFalse( $this->backend->fileExists( array( 'src' => "$file-2" ) ), - "File $file-2 moved away." ); - } - - $this->assertGoodStatus( - $this->backend->quickCopy( array( 'src' => $files[0], 'dst' => $files[0] ) ), - "Copy of file {$files[0]} over itself succeeded ($backendName)." ); - $this->assertTrue( $this->backend->fileExists( array( 'src' => $files[0] ) ), - "File {$files[0]} still exists." ); - - $this->assertGoodStatus( - $this->backend->quickMove( array( 'src' => $files[0], 'dst' => $files[0] ) ), - "Move of file {$files[0]} over itself succeeded ($backendName)." ); - $this->assertTrue( $this->backend->fileExists( array( 'src' => $files[0] ) ), - "File {$files[0]} still exists." ); - - $this->assertGoodStatus( - $this->backend->doQuickOperations( $purgeOps ), - "Quick deletion of source files succeeded ($backendName)." ); - foreach ( $files as $file ) { - $this->assertFalse( $this->backend->fileExists( array( 'src' => $file ) ), - "File $file purged." ); - $this->assertFalse( $this->backend->fileExists( array( 'src' => "$file-3" ) ), - "File $file-3 purged." ); - } - } - - /** - * @dataProvider provider_testConcatenate - */ - public function testConcatenate( $op, $srcs, $srcsContent, $alreadyExists, $okStatus ) { - $this->filesToPrune[] = $op['dst']; - - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestConcatenate( $op, $srcs, $srcsContent, $alreadyExists, $okStatus ); - $this->filesToPrune[] = $op['dst']; # avoid file leaking - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestConcatenate( $op, $srcs, $srcsContent, $alreadyExists, $okStatus ); - $this->filesToPrune[] = $op['dst']; # avoid file leaking - $this->tearDownFiles(); - } - - private function doTestConcatenate( $params, $srcs, $srcsContent, $alreadyExists, $okStatus ) { - $backendName = $this->backendClass(); - - $expContent = ''; - // Create sources - $ops = array(); - foreach ( $srcs as $i => $source ) { - $this->prepare( array( 'dir' => dirname( $source ) ) ); - $ops[] = array( - 'op' => 'create', // operation - 'dst' => $source, // source - 'content' => $srcsContent[$i] - ); - $expContent .= $srcsContent[$i]; - } - $status = $this->backend->doOperations( $ops ); - - $this->assertGoodStatus( $status, - "Creation of source files succeeded ($backendName)." ); - - $dest = $params['dst']; - if ( $alreadyExists ) { - $ok = file_put_contents( $dest, 'blah...blah...waahwaah' ) !== false; - $this->assertEquals( true, $ok, - "Creation of file at $dest succeeded ($backendName)." ); - } else { - $ok = file_put_contents( $dest, '' ) !== false; - $this->assertEquals( true, $ok, - "Creation of 0-byte file at $dest succeeded ($backendName)." ); - } - - // Combine the files into one - $status = $this->backend->concatenate( $params ); - if ( $okStatus ) { - $this->assertGoodStatus( $status, - "Creation of concat file at $dest succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Creation of concat file at $dest succeeded ($backendName)." ); - } else { - $this->assertEquals( false, $status->isOK(), - "Creation of concat file at $dest failed ($backendName)." ); - } - - if ( $okStatus ) { - $this->assertEquals( true, is_file( $dest ), - "Dest concat file $dest exists after creation ($backendName)." ); - } else { - $this->assertEquals( true, is_file( $dest ), - "Dest concat file $dest exists after failed creation ($backendName)." ); - } - - $contents = file_get_contents( $dest ); - $this->assertNotEquals( false, $contents, "File at $dest exists ($backendName)." ); - - if ( $okStatus ) { - $this->assertEquals( $expContent, $contents, - "Concat file at $dest has correct contents ($backendName)." ); - } else { - $this->assertNotEquals( $expContent, $contents, - "Concat file at $dest has correct contents ($backendName)." ); - } - } - - public static function provider_testConcatenate() { - $cases = array(); - - $rand = mt_rand( 0, 2000000000 ) . time(); - $dest = wfTempDir() . "/randomfile!$rand.txt"; - $srcs = array( - self::baseStorePath() . '/unittest-cont1/e/file1.txt', - self::baseStorePath() . '/unittest-cont1/e/file2.txt', - self::baseStorePath() . '/unittest-cont1/e/file3.txt', - self::baseStorePath() . '/unittest-cont1/e/file4.txt', - self::baseStorePath() . '/unittest-cont1/e/file5.txt', - self::baseStorePath() . '/unittest-cont1/e/file6.txt', - self::baseStorePath() . '/unittest-cont1/e/file7.txt', - self::baseStorePath() . '/unittest-cont1/e/file8.txt', - self::baseStorePath() . '/unittest-cont1/e/file9.txt', - self::baseStorePath() . '/unittest-cont1/e/file10.txt' - ); - $content = array( - 'egfage', - 'ageageag', - 'rhokohlr', - 'shgmslkg', - 'kenga', - 'owagmal', - 'kgmae', - 'g eak;g', - 'lkaem;a', - 'legma' - ); - $params = array( 'srcs' => $srcs, 'dst' => $dest ); - - $cases[] = array( - $params, // operation - $srcs, // sources - $content, // content for each source - false, // no dest already exists - true, // succeeds - ); - - $cases[] = array( - $params, // operation - $srcs, // sources - $content, // content for each source - true, // dest already exists - false, // succeeds - ); - - return $cases; - } - - /** - * @dataProvider provider_testGetFileStat - * @covers FileBackend::getFileStat - */ - public function testGetFileStat( $path, $content, $alreadyExists ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestGetFileStat( $path, $content, $alreadyExists ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestGetFileStat( $path, $content, $alreadyExists ); - $this->tearDownFiles(); - } - - private function doTestGetFileStat( $path, $content, $alreadyExists ) { - $backendName = $this->backendClass(); - - if ( $alreadyExists ) { - $this->prepare( array( 'dir' => dirname( $path ) ) ); - $status = $this->create( array( 'dst' => $path, 'content' => $content ) ); - $this->assertGoodStatus( $status, - "Creation of file at $path succeeded ($backendName)." ); - - $size = $this->backend->getFileSize( array( 'src' => $path ) ); - $time = $this->backend->getFileTimestamp( array( 'src' => $path ) ); - $stat = $this->backend->getFileStat( array( 'src' => $path ) ); - - $this->assertEquals( strlen( $content ), $size, - "Correct file size of '$path'" ); - $this->assertTrue( abs( time() - wfTimestamp( TS_UNIX, $time ) ) < 10, - "Correct file timestamp of '$path'" ); - - $size = $stat['size']; - $time = $stat['mtime']; - $this->assertEquals( strlen( $content ), $size, - "Correct file size of '$path'" ); - $this->assertTrue( abs( time() - wfTimestamp( TS_UNIX, $time ) ) < 10, - "Correct file timestamp of '$path'" ); - - $this->backend->clearCache( array( $path ) ); - - $size = $this->backend->getFileSize( array( 'src' => $path ) ); - - $this->assertEquals( strlen( $content ), $size, - "Correct file size of '$path'" ); - - $this->backend->preloadCache( array( $path ) ); - - $size = $this->backend->getFileSize( array( 'src' => $path ) ); - - $this->assertEquals( strlen( $content ), $size, - "Correct file size of '$path'" ); - } else { - $size = $this->backend->getFileSize( array( 'src' => $path ) ); - $time = $this->backend->getFileTimestamp( array( 'src' => $path ) ); - $stat = $this->backend->getFileStat( array( 'src' => $path ) ); - - $this->assertFalse( $size, "Correct file size of '$path'" ); - $this->assertFalse( $time, "Correct file timestamp of '$path'" ); - $this->assertFalse( $stat, "Correct file stat of '$path'" ); - } - } - - public static function provider_testGetFileStat() { - $cases = array(); - - $base = self::baseStorePath(); - $cases[] = array( "$base/unittest-cont1/e/b/z/some_file.txt", "some file contents", true ); - $cases[] = array( "$base/unittest-cont1/e/b/some-other_file.txt", "", true ); - $cases[] = array( "$base/unittest-cont1/e/b/some-diff_file.txt", null, false ); - - return $cases; - } - - /** - * @dataProvider provider_testGetFileContents - * @covers FileBackend::getFileContents - * @covers FileBackend::getFileContentsMulti - */ - public function testGetFileContents( $source, $content ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestGetFileContents( $source, $content ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestGetFileContents( $source, $content ); - $this->tearDownFiles(); - } - - private function doTestGetFileContents( $source, $content ) { - $backendName = $this->backendClass(); - - $srcs = (array)$source; - $content = (array)$content; - foreach ( $srcs as $i => $src ) { - $this->prepare( array( 'dir' => dirname( $src ) ) ); - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => $content[$i], 'dst' => $src ) ); - $this->assertGoodStatus( $status, - "Creation of file at $src succeeded ($backendName)." ); - } - - if ( is_array( $source ) ) { - $contents = $this->backend->getFileContentsMulti( array( 'srcs' => $source ) ); - foreach ( $contents as $path => $data ) { - $this->assertNotEquals( false, $data, "Contents of $path exists ($backendName)." ); - $this->assertEquals( current( $content ), $data, "Contents of $path is correct ($backendName)." ); - next( $content ); - } - $this->assertEquals( $source, array_keys( $contents ), "Contents in right order ($backendName)." ); - $this->assertEquals( count( $source ), count( $contents ), "Contents array size correct ($backendName)." ); - } else { - $data = $this->backend->getFileContents( array( 'src' => $source ) ); - $this->assertNotEquals( false, $data, "Contents of $source exists ($backendName)." ); - $this->assertEquals( $content[0], $data, "Contents of $source is correct ($backendName)." ); - } - } - - public static function provider_testGetFileContents() { - $cases = array(); - - $base = self::baseStorePath(); - $cases[] = array( "$base/unittest-cont1/e/b/z/some_file.txt", "some file contents" ); - $cases[] = array( "$base/unittest-cont1/e/b/some-other_file.txt", "more file contents" ); - $cases[] = array( - array( "$base/unittest-cont1/e/a/x.txt", "$base/unittest-cont1/e/a/y.txt", - "$base/unittest-cont1/e/a/z.txt" ), - array( "contents xx", "contents xy", "contents xz" ) - ); - - return $cases; - } - - /** - * @dataProvider provider_testGetLocalCopy - * @covers FileBackend::getLocalCopy - */ - public function testGetLocalCopy( $source, $content ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestGetLocalCopy( $source, $content ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestGetLocalCopy( $source, $content ); - $this->tearDownFiles(); - } - - private function doTestGetLocalCopy( $source, $content ) { - $backendName = $this->backendClass(); - - $srcs = (array)$source; - $content = (array)$content; - foreach ( $srcs as $i => $src ) { - $this->prepare( array( 'dir' => dirname( $src ) ) ); - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => $content[$i], 'dst' => $src ) ); - $this->assertGoodStatus( $status, - "Creation of file at $src succeeded ($backendName)." ); - } - - if ( is_array( $source ) ) { - $tmpFiles = $this->backend->getLocalCopyMulti( array( 'srcs' => $source ) ); - foreach ( $tmpFiles as $path => $tmpFile ) { - $this->assertNotNull( $tmpFile, - "Creation of local copy of $path succeeded ($backendName)." ); - $contents = file_get_contents( $tmpFile->getPath() ); - $this->assertNotEquals( false, $contents, "Local copy of $path exists ($backendName)." ); - $this->assertEquals( current( $content ), $contents, "Local copy of $path is correct ($backendName)." ); - next( $content ); - } - $this->assertEquals( $source, array_keys( $tmpFiles ), "Local copies in right order ($backendName)." ); - $this->assertEquals( count( $source ), count( $tmpFiles ), "Local copies array size correct ($backendName)." ); - } else { - $tmpFile = $this->backend->getLocalCopy( array( 'src' => $source ) ); - $this->assertNotNull( $tmpFile, - "Creation of local copy of $source succeeded ($backendName)." ); - $contents = file_get_contents( $tmpFile->getPath() ); - $this->assertNotEquals( false, $contents, "Local copy of $source exists ($backendName)." ); - $this->assertEquals( $content[0], $contents, "Local copy of $source is correct ($backendName)." ); - } - - $obj = new stdClass(); - $tmpFile->bind( $obj ); - } - - public static function provider_testGetLocalCopy() { - $cases = array(); - - $base = self::baseStorePath(); - $cases[] = array( "$base/unittest-cont1/e/a/z/some_file.txt", "some file contents" ); - $cases[] = array( "$base/unittest-cont1/e/a/some-other_file.txt", "more file contents" ); - $cases[] = array( "$base/unittest-cont1/e/a/\$odd&.txt", "test file contents" ); - $cases[] = array( - array( "$base/unittest-cont1/e/a/x.txt", "$base/unittest-cont1/e/a/y.txt", - "$base/unittest-cont1/e/a/z.txt" ), - array( "contents xx", "contents xy", "contents xz" ) - ); - - return $cases; - } - - /** - * @dataProvider provider_testGetLocalReference - * @covers FileBackend::getLocalReference - */ - public function testGetLocalReference( $source, $content ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestGetLocalReference( $source, $content ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestGetLocalReference( $source, $content ); - $this->tearDownFiles(); - } - - private function doTestGetLocalReference( $source, $content ) { - $backendName = $this->backendClass(); - - $srcs = (array)$source; - $content = (array)$content; - foreach ( $srcs as $i => $src ) { - $this->prepare( array( 'dir' => dirname( $src ) ) ); - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => $content[$i], 'dst' => $src ) ); - $this->assertGoodStatus( $status, - "Creation of file at $src succeeded ($backendName)." ); - } - - if ( is_array( $source ) ) { - $tmpFiles = $this->backend->getLocalReferenceMulti( array( 'srcs' => $source ) ); - foreach ( $tmpFiles as $path => $tmpFile ) { - $this->assertNotNull( $tmpFile, - "Creation of local copy of $path succeeded ($backendName)." ); - $contents = file_get_contents( $tmpFile->getPath() ); - $this->assertNotEquals( false, $contents, "Local ref of $path exists ($backendName)." ); - $this->assertEquals( current( $content ), $contents, "Local ref of $path is correct ($backendName)." ); - next( $content ); - } - $this->assertEquals( $source, array_keys( $tmpFiles ), "Local refs in right order ($backendName)." ); - $this->assertEquals( count( $source ), count( $tmpFiles ), "Local refs array size correct ($backendName)." ); - } else { - $tmpFile = $this->backend->getLocalReference( array( 'src' => $source ) ); - $this->assertNotNull( $tmpFile, - "Creation of local copy of $source succeeded ($backendName)." ); - $contents = file_get_contents( $tmpFile->getPath() ); - $this->assertNotEquals( false, $contents, "Local ref of $source exists ($backendName)." ); - $this->assertEquals( $content[0], $contents, "Local ref of $source is correct ($backendName)." ); - } - } - - public static function provider_testGetLocalReference() { - $cases = array(); - - $base = self::baseStorePath(); - $cases[] = array( "$base/unittest-cont1/e/a/z/some_file.txt", "some file contents" ); - $cases[] = array( "$base/unittest-cont1/e/a/some-other_file.txt", "more file contents" ); - $cases[] = array( "$base/unittest-cont1/e/a/\$odd&.txt", "test file contents" ); - $cases[] = array( - array( "$base/unittest-cont1/e/a/x.txt", "$base/unittest-cont1/e/a/y.txt", - "$base/unittest-cont1/e/a/z.txt" ), - array( "contents xx", "contents xy", "contents xz" ) - ); - - return $cases; - } - - /** - * @covers FileBackend::getLocalCopy - * @covers FileBackend::getLocalReference - */ - public function testGetLocalCopyAndReference404() { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestGetLocalCopyAndReference404(); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestGetLocalCopyAndReference404(); - $this->tearDownFiles(); - } - - public function doTestGetLocalCopyAndReference404() { - $backendName = $this->backendClass(); - - $base = self::baseStorePath(); - - $tmpFile = $this->backend->getLocalCopy( array( - 'src' => "$base/unittest-cont1/not-there" ) ); - $this->assertEquals( null, $tmpFile, "Local copy of not existing file is null ($backendName)." ); - - $tmpFile = $this->backend->getLocalReference( array( - 'src' => "$base/unittest-cont1/not-there" ) ); - $this->assertEquals( null, $tmpFile, "Local ref of not existing file is null ($backendName)." ); - } - - /** - * @dataProvider provider_testGetFileHttpUrl - * @covers FileBackend::getFileHttpUrl - */ - public function testGetFileHttpUrl( $source, $content ) { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestGetFileHttpUrl( $source, $content ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestGetFileHttpUrl( $source, $content ); - $this->tearDownFiles(); - } - - private function doTestGetFileHttpUrl( $source, $content ) { - $backendName = $this->backendClass(); - - $this->prepare( array( 'dir' => dirname( $source ) ) ); - $status = $this->backend->doOperation( - array( 'op' => 'create', 'content' => $content, 'dst' => $source ) ); - $this->assertGoodStatus( $status, - "Creation of file at $source succeeded ($backendName)." ); - - $url = $this->backend->getFileHttpUrl( array( 'src' => $source ) ); - - if ( $url !== null ) { // supported - $data = Http::request( "GET", $url ); - $this->assertEquals( $content, $data, - "HTTP GET of URL has right contents ($backendName)." ); - } - } - - public static function provider_testGetFileHttpUrl() { - $cases = array(); - - $base = self::baseStorePath(); - $cases[] = array( "$base/unittest-cont1/e/a/z/some_file.txt", "some file contents" ); - $cases[] = array( "$base/unittest-cont1/e/a/some-other_file.txt", "more file contents" ); - $cases[] = array( "$base/unittest-cont1/e/a/\$odd&.txt", "test file contents" ); - - return $cases; - } - - /** - * @dataProvider provider_testPrepareAndClean - * @covers FileBackend::prepare - * @covers FileBackend::clean - */ - public function testPrepareAndClean( $path, $isOK ) { - $this->backend = $this->singleBackend; - $this->doTestPrepareAndClean( $path, $isOK ); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->doTestPrepareAndClean( $path, $isOK ); - $this->tearDownFiles(); - } - - public static function provider_testPrepareAndClean() { - $base = self::baseStorePath(); - - return array( - array( "$base/unittest-cont1/e/a/z/some_file1.txt", true ), - array( "$base/unittest-cont2/a/z/some_file2.txt", true ), - # Specific to FS backend with no basePath field set - #array( "$base/unittest-cont3/a/z/some_file3.txt", false ), - ); - } - - private function doTestPrepareAndClean( $path, $isOK ) { - $backendName = $this->backendClass(); - - $status = $this->prepare( array( 'dir' => dirname( $path ) ) ); - if ( $isOK ) { - $this->assertGoodStatus( $status, - "Preparing dir $path succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Preparing dir $path succeeded ($backendName)." ); - } else { - $this->assertEquals( false, $status->isOK(), - "Preparing dir $path failed ($backendName)." ); - } - - $status = $this->backend->clean( array( 'dir' => dirname( $path ) ) ); - if ( $isOK ) { - $this->assertGoodStatus( $status, - "Cleaning dir $path succeeded without warnings ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Cleaning dir $path succeeded ($backendName)." ); - } else { - $this->assertEquals( false, $status->isOK(), - "Cleaning dir $path failed ($backendName)." ); - } - } - - public function testRecursiveClean() { - $this->backend = $this->singleBackend; - $this->doTestRecursiveClean(); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->doTestRecursiveClean(); - $this->tearDownFiles(); - } - - /** - * @covers FileBackend::clean - */ - private function doTestRecursiveClean() { - $backendName = $this->backendClass(); - - $base = self::baseStorePath(); - $dirs = array( - "$base/unittest-cont1", - "$base/unittest-cont1/e", - "$base/unittest-cont1/e/a", - "$base/unittest-cont1/e/a/b", - "$base/unittest-cont1/e/a/b/c", - "$base/unittest-cont1/e/a/b/c/d0", - "$base/unittest-cont1/e/a/b/c/d1", - "$base/unittest-cont1/e/a/b/c/d2", - "$base/unittest-cont1/e/a/b/c/d0/1", - "$base/unittest-cont1/e/a/b/c/d0/2", - "$base/unittest-cont1/e/a/b/c/d1/3", - "$base/unittest-cont1/e/a/b/c/d1/4", - "$base/unittest-cont1/e/a/b/c/d2/5", - "$base/unittest-cont1/e/a/b/c/d2/6" - ); - foreach ( $dirs as $dir ) { - $status = $this->prepare( array( 'dir' => $dir ) ); - $this->assertGoodStatus( $status, - "Preparing dir $dir succeeded without warnings ($backendName)." ); - } - - if ( $this->backend instanceof FSFileBackend ) { - foreach ( $dirs as $dir ) { - $this->assertEquals( true, $this->backend->directoryExists( array( 'dir' => $dir ) ), - "Dir $dir exists ($backendName)." ); - } - } - - $status = $this->backend->clean( - array( 'dir' => "$base/unittest-cont1", 'recursive' => 1 ) ); - $this->assertGoodStatus( $status, - "Recursive cleaning of dir $dir succeeded without warnings ($backendName)." ); - - foreach ( $dirs as $dir ) { - $this->assertEquals( false, $this->backend->directoryExists( array( 'dir' => $dir ) ), - "Dir $dir no longer exists ($backendName)." ); - } - } - - // @todo testSecure - - /** - * @covers FileBackend::doOperations - */ - public function testDoOperations() { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestDoOperations(); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestDoOperations(); - $this->tearDownFiles(); - } - - private function doTestDoOperations() { - $base = self::baseStorePath(); - - $fileA = "$base/unittest-cont1/e/a/b/fileA.txt"; - $fileAContents = '3tqtmoeatmn4wg4qe-mg3qt3 tq'; - $fileB = "$base/unittest-cont1/e/a/b/fileB.txt"; - $fileBContents = 'g-jmq3gpqgt3qtg q3GT '; - $fileC = "$base/unittest-cont1/e/a/b/fileC.txt"; - $fileCContents = 'eigna[ogmewt 3qt g3qg flew[ag'; - $fileD = "$base/unittest-cont1/e/a/b/fileD.txt"; - - $this->prepare( array( 'dir' => dirname( $fileA ) ) ); - $this->create( array( 'dst' => $fileA, 'content' => $fileAContents ) ); - $this->prepare( array( 'dir' => dirname( $fileB ) ) ); - $this->create( array( 'dst' => $fileB, 'content' => $fileBContents ) ); - $this->prepare( array( 'dir' => dirname( $fileC ) ) ); - $this->create( array( 'dst' => $fileC, 'content' => $fileCContents ) ); - $this->prepare( array( 'dir' => dirname( $fileD ) ) ); - - $status = $this->backend->doOperations( array( - array( 'op' => 'describe', 'src' => $fileA, - 'headers' => array( 'X-Content-Length' => '91.3' ), 'disposition' => 'inline' ), - array( 'op' => 'copy', 'src' => $fileA, 'dst' => $fileC, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: (file:) - array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileA, 'overwriteSame' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileD, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileB, 'dst' => $fileC ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileD, 'dst' => $fileA, 'overwriteSame' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileA, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'copy', 'src' => $fileA, 'dst' => $fileC ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileA, 'dst' => $fileC, 'overwriteSame' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileC, 'overwrite' => 1 ), - // Does nothing - array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileC, 'overwriteSame' => 1 ), - // Does nothing - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileC, 'overwrite' => 1 ), - // Does nothing - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileC, 'overwriteSame' => 1 ), - // Does nothing - array( 'op' => 'null' ), - // Does nothing - ) ); - - $this->assertGoodStatus( $status, "Operation batch succeeded" ); - $this->assertEquals( true, $status->isOK(), "Operation batch succeeded" ); - $this->assertEquals( 14, count( $status->success ), - "Operation batch has correct success array" ); - - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $fileA ) ), - "File does not exist at $fileA" ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $fileB ) ), - "File does not exist at $fileB" ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $fileD ) ), - "File does not exist at $fileD" ); - - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $fileC ) ), - "File exists at $fileC" ); - $this->assertEquals( $fileBContents, - $this->backend->getFileContents( array( 'src' => $fileC ) ), - "Correct file contents of $fileC" ); - $this->assertEquals( strlen( $fileBContents ), - $this->backend->getFileSize( array( 'src' => $fileC ) ), - "Correct file size of $fileC" ); - $this->assertEquals( wfBaseConvert( sha1( $fileBContents ), 16, 36, 31 ), - $this->backend->getFileSha1Base36( array( 'src' => $fileC ) ), - "Correct file SHA-1 of $fileC" ); - } - - /** - * @covers FileBackend::doOperations - */ - public function testDoOperationsPipeline() { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestDoOperationsPipeline(); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestDoOperationsPipeline(); - $this->tearDownFiles(); - } - - // concurrency orientated - private function doTestDoOperationsPipeline() { - $base = self::baseStorePath(); - - $fileAContents = '3tqtmoeatmn4wg4qe-mg3qt3 tq'; - $fileBContents = 'g-jmq3gpqgt3qtg q3GT '; - $fileCContents = 'eigna[ogmewt 3qt g3qg flew[ag'; - - $tmpNameA = TempFSFile::factory( "unittests_", 'txt' )->getPath(); - file_put_contents( $tmpNameA, $fileAContents ); - $tmpNameB = TempFSFile::factory( "unittests_", 'txt' )->getPath(); - file_put_contents( $tmpNameB, $fileBContents ); - $tmpNameC = TempFSFile::factory( "unittests_", 'txt' )->getPath(); - file_put_contents( $tmpNameC, $fileCContents ); - - $this->filesToPrune[] = $tmpNameA; # avoid file leaking - $this->filesToPrune[] = $tmpNameB; # avoid file leaking - $this->filesToPrune[] = $tmpNameC; # avoid file leaking - - $fileA = "$base/unittest-cont1/e/a/b/fileA.txt"; - $fileB = "$base/unittest-cont1/e/a/b/fileB.txt"; - $fileC = "$base/unittest-cont1/e/a/b/fileC.txt"; - $fileD = "$base/unittest-cont1/e/a/b/fileD.txt"; - - $this->prepare( array( 'dir' => dirname( $fileA ) ) ); - $this->create( array( 'dst' => $fileA, 'content' => $fileAContents ) ); - $this->prepare( array( 'dir' => dirname( $fileB ) ) ); - $this->prepare( array( 'dir' => dirname( $fileC ) ) ); - $this->prepare( array( 'dir' => dirname( $fileD ) ) ); - - $status = $this->backend->doOperations( array( - array( 'op' => 'store', 'src' => $tmpNameA, 'dst' => $fileA, 'overwriteSame' => 1 ), - array( 'op' => 'store', 'src' => $tmpNameB, 'dst' => $fileB, 'overwrite' => 1 ), - array( 'op' => 'store', 'src' => $tmpNameC, 'dst' => $fileC, 'overwrite' => 1 ), - array( 'op' => 'copy', 'src' => $fileA, 'dst' => $fileC, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: (file:) - array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileA, 'overwriteSame' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileD, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileB, 'dst' => $fileC ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileD, 'dst' => $fileA, 'overwriteSame' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileA, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'copy', 'src' => $fileA, 'dst' => $fileC ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileA, 'dst' => $fileC, 'overwriteSame' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileC, 'overwrite' => 1 ), - // Does nothing - array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileC, 'overwriteSame' => 1 ), - // Does nothing - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileC, 'overwrite' => 1 ), - // Does nothing - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileC, 'overwriteSame' => 1 ), - // Does nothing - array( 'op' => 'null' ), - // Does nothing - ) ); - - $this->assertGoodStatus( $status, "Operation batch succeeded" ); - $this->assertEquals( true, $status->isOK(), "Operation batch succeeded" ); - $this->assertEquals( 16, count( $status->success ), - "Operation batch has correct success array" ); - - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $fileA ) ), - "File does not exist at $fileA" ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $fileB ) ), - "File does not exist at $fileB" ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $fileD ) ), - "File does not exist at $fileD" ); - - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $fileC ) ), - "File exists at $fileC" ); - $this->assertEquals( $fileBContents, - $this->backend->getFileContents( array( 'src' => $fileC ) ), - "Correct file contents of $fileC" ); - $this->assertEquals( strlen( $fileBContents ), - $this->backend->getFileSize( array( 'src' => $fileC ) ), - "Correct file size of $fileC" ); - $this->assertEquals( wfBaseConvert( sha1( $fileBContents ), 16, 36, 31 ), - $this->backend->getFileSha1Base36( array( 'src' => $fileC ) ), - "Correct file SHA-1 of $fileC" ); - } - - /** - * @covers FileBackend::doOperations - */ - public function testDoOperationsFailing() { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestDoOperationsFailing(); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestDoOperationsFailing(); - $this->tearDownFiles(); - } - - private function doTestDoOperationsFailing() { - $base = self::baseStorePath(); - - $fileA = "$base/unittest-cont2/a/b/fileA.txt"; - $fileAContents = '3tqtmoeatmn4wg4qe-mg3qt3 tq'; - $fileB = "$base/unittest-cont2/a/b/fileB.txt"; - $fileBContents = 'g-jmq3gpqgt3qtg q3GT '; - $fileC = "$base/unittest-cont2/a/b/fileC.txt"; - $fileCContents = 'eigna[ogmewt 3qt g3qg flew[ag'; - $fileD = "$base/unittest-cont2/a/b/fileD.txt"; - - $this->prepare( array( 'dir' => dirname( $fileA ) ) ); - $this->create( array( 'dst' => $fileA, 'content' => $fileAContents ) ); - $this->prepare( array( 'dir' => dirname( $fileB ) ) ); - $this->create( array( 'dst' => $fileB, 'content' => $fileBContents ) ); - $this->prepare( array( 'dir' => dirname( $fileC ) ) ); - $this->create( array( 'dst' => $fileC, 'content' => $fileCContents ) ); - - $status = $this->backend->doOperations( array( - array( 'op' => 'copy', 'src' => $fileA, 'dst' => $fileC, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: (file:) - array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileA, 'overwriteSame' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'copy', 'src' => $fileB, 'dst' => $fileD, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileD ), - // Now: A:, B:, C:, D: (failed) - array( 'op' => 'move', 'src' => $fileB, 'dst' => $fileC, 'overwriteSame' => 1 ), - // Now: A:, B:, C:, D: (failed) - array( 'op' => 'move', 'src' => $fileB, 'dst' => $fileA, 'overwrite' => 1 ), - // Now: A:, B:, C:, D: - array( 'op' => 'delete', 'src' => $fileD ), - // Now: A:, B:, C:, D: - array( 'op' => 'null' ), - // Does nothing - ), array( 'force' => 1 ) ); - - $this->assertNotEquals( array(), $status->errors, "Operation had warnings" ); - $this->assertEquals( true, $status->isOK(), "Operation batch succeeded" ); - $this->assertEquals( 8, count( $status->success ), - "Operation batch has correct success array" ); - - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $fileB ) ), - "File does not exist at $fileB" ); - $this->assertEquals( false, $this->backend->fileExists( array( 'src' => $fileD ) ), - "File does not exist at $fileD" ); - - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $fileA ) ), - "File does not exist at $fileA" ); - $this->assertEquals( true, $this->backend->fileExists( array( 'src' => $fileC ) ), - "File exists at $fileC" ); - $this->assertEquals( $fileBContents, - $this->backend->getFileContents( array( 'src' => $fileA ) ), - "Correct file contents of $fileA" ); - $this->assertEquals( strlen( $fileBContents ), - $this->backend->getFileSize( array( 'src' => $fileA ) ), - "Correct file size of $fileA" ); - $this->assertEquals( wfBaseConvert( sha1( $fileBContents ), 16, 36, 31 ), - $this->backend->getFileSha1Base36( array( 'src' => $fileA ) ), - "Correct file SHA-1 of $fileA" ); - } - - /** - * @covers FileBackend::getFileList - */ - public function testGetFileList() { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestGetFileList(); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestGetFileList(); - $this->tearDownFiles(); - } - - private function doTestGetFileList() { - $backendName = $this->backendClass(); - $base = self::baseStorePath(); - - // Should have no errors - $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont-notexists" ) ); - - $files = array( - "$base/unittest-cont1/e/test1.txt", - "$base/unittest-cont1/e/test2.txt", - "$base/unittest-cont1/e/test3.txt", - "$base/unittest-cont1/e/subdir1/test1.txt", - "$base/unittest-cont1/e/subdir1/test2.txt", - "$base/unittest-cont1/e/subdir2/test3.txt", - "$base/unittest-cont1/e/subdir2/test4.txt", - "$base/unittest-cont1/e/subdir2/subdir/test1.txt", - "$base/unittest-cont1/e/subdir2/subdir/test2.txt", - "$base/unittest-cont1/e/subdir2/subdir/test3.txt", - "$base/unittest-cont1/e/subdir2/subdir/test4.txt", - "$base/unittest-cont1/e/subdir2/subdir/test5.txt", - "$base/unittest-cont1/e/subdir2/subdir/sub/test0.txt", - "$base/unittest-cont1/e/subdir2/subdir/sub/120-px-file.txt", - ); - - // Add the files - $ops = array(); - foreach ( $files as $file ) { - $this->prepare( array( 'dir' => dirname( $file ) ) ); - $ops[] = array( 'op' => 'create', 'content' => 'xxy', 'dst' => $file ); - } - $status = $this->backend->doQuickOperations( $ops ); - $this->assertGoodStatus( $status, - "Creation of files succeeded ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Creation of files succeeded with OK status ($backendName)." ); - - // Expected listing at root - $expected = array( - "e/test1.txt", - "e/test2.txt", - "e/test3.txt", - "e/subdir1/test1.txt", - "e/subdir1/test2.txt", - "e/subdir2/test3.txt", - "e/subdir2/test4.txt", - "e/subdir2/subdir/test1.txt", - "e/subdir2/subdir/test2.txt", - "e/subdir2/subdir/test3.txt", - "e/subdir2/subdir/test4.txt", - "e/subdir2/subdir/test5.txt", - "e/subdir2/subdir/sub/test0.txt", - "e/subdir2/subdir/sub/120-px-file.txt", - ); - sort( $expected ); - - // Actual listing (no trailing slash) at root - $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont1" ) ); - $list = $this->listToArray( $iter ); - sort( $list ); - $this->assertEquals( $expected, $list, "Correct file listing ($backendName)." ); - - // Actual listing (no trailing slash) at root with advise - $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont1", 'adviseStat' => 1 ) ); - $list = $this->listToArray( $iter ); - sort( $list ); - $this->assertEquals( $expected, $list, "Correct file listing ($backendName)." ); - - // Actual listing (with trailing slash) at root - $list = array(); - $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont1/" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - $this->assertEquals( $expected, $list, "Correct file listing ($backendName)." ); - - // Expected listing at subdir - $expected = array( - "test1.txt", - "test2.txt", - "test3.txt", - "test4.txt", - "test5.txt", - "sub/test0.txt", - "sub/120-px-file.txt", - ); - sort( $expected ); - - // Actual listing (no trailing slash) at subdir - $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont1/e/subdir2/subdir" ) ); - $list = $this->listToArray( $iter ); - sort( $list ); - $this->assertEquals( $expected, $list, "Correct file listing ($backendName)." ); - - // Actual listing (no trailing slash) at subdir with advise - $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont1/e/subdir2/subdir", 'adviseStat' => 1 ) ); - $list = $this->listToArray( $iter ); - sort( $list ); - $this->assertEquals( $expected, $list, "Correct file listing ($backendName)." ); - - // Actual listing (with trailing slash) at subdir - $list = array(); - $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont1/e/subdir2/subdir/" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - $this->assertEquals( $expected, $list, "Correct file listing ($backendName)." ); - - // Actual listing (using iterator second time) - $list = $this->listToArray( $iter ); - sort( $list ); - $this->assertEquals( $expected, $list, "Correct file listing ($backendName), second iteration." ); - - // Actual listing (top files only) at root - $iter = $this->backend->getTopFileList( array( 'dir' => "$base/unittest-cont1" ) ); - $list = $this->listToArray( $iter ); - sort( $list ); - $this->assertEquals( array(), $list, "Correct top file listing ($backendName)." ); - - // Expected listing (top files only) at subdir - $expected = array( - "test1.txt", - "test2.txt", - "test3.txt", - "test4.txt", - "test5.txt" - ); - sort( $expected ); - - // Actual listing (top files only) at subdir - $iter = $this->backend->getTopFileList( array( 'dir' => "$base/unittest-cont1/e/subdir2/subdir" ) ); - $list = $this->listToArray( $iter ); - sort( $list ); - $this->assertEquals( $expected, $list, "Correct top file listing ($backendName)." ); - - // Actual listing (top files only) at subdir with advise - $iter = $this->backend->getTopFileList( array( 'dir' => "$base/unittest-cont1/e/subdir2/subdir", 'adviseStat' => 1 ) ); - $list = $this->listToArray( $iter ); - sort( $list ); - $this->assertEquals( $expected, $list, "Correct top file listing ($backendName)." ); - - foreach ( $files as $file ) { // clean up - $this->backend->doOperation( array( 'op' => 'delete', 'src' => $file ) ); - } - - $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont1/not/exists" ) ); - foreach ( $iter as $iter ) { - // no errors - } - } - - /** - * @covers FileBackend::getTopDirectoryList - * @covers FileBackend::getDirectoryList - */ - public function testGetDirectoryList() { - $this->backend = $this->singleBackend; - $this->tearDownFiles(); - $this->doTestGetDirectoryList(); - $this->tearDownFiles(); - - $this->backend = $this->multiBackend; - $this->tearDownFiles(); - $this->doTestGetDirectoryList(); - $this->tearDownFiles(); - } - - private function doTestGetDirectoryList() { - $backendName = $this->backendClass(); - - $base = self::baseStorePath(); - $files = array( - "$base/unittest-cont1/e/test1.txt", - "$base/unittest-cont1/e/test2.txt", - "$base/unittest-cont1/e/test3.txt", - "$base/unittest-cont1/e/subdir1/test1.txt", - "$base/unittest-cont1/e/subdir1/test2.txt", - "$base/unittest-cont1/e/subdir2/test3.txt", - "$base/unittest-cont1/e/subdir2/test4.txt", - "$base/unittest-cont1/e/subdir2/subdir/test1.txt", - "$base/unittest-cont1/e/subdir3/subdir/test2.txt", - "$base/unittest-cont1/e/subdir4/subdir/test3.txt", - "$base/unittest-cont1/e/subdir4/subdir/test4.txt", - "$base/unittest-cont1/e/subdir4/subdir/test5.txt", - "$base/unittest-cont1/e/subdir4/subdir/sub/test0.txt", - "$base/unittest-cont1/e/subdir4/subdir/sub/120-px-file.txt", - ); - - // Add the files - $ops = array(); - foreach ( $files as $file ) { - $this->prepare( array( 'dir' => dirname( $file ) ) ); - $ops[] = array( 'op' => 'create', 'content' => 'xxy', 'dst' => $file ); - } - $status = $this->backend->doQuickOperations( $ops ); - $this->assertGoodStatus( $status, - "Creation of files succeeded ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Creation of files succeeded with OK status ($backendName)." ); - - $this->assertEquals( true, - $this->backend->directoryExists( array( 'dir' => "$base/unittest-cont1/e/subdir1" ) ), - "Directory exists in ($backendName)." ); - $this->assertEquals( true, - $this->backend->directoryExists( array( 'dir' => "$base/unittest-cont1/e/subdir2/subdir" ) ), - "Directory exists in ($backendName)." ); - $this->assertEquals( false, - $this->backend->directoryExists( array( 'dir' => "$base/unittest-cont1/e/subdir2/test1.txt" ) ), - "Directory does not exists in ($backendName)." ); - - // Expected listing - $expected = array( - "e", - ); - sort( $expected ); - - // Actual listing (no trailing slash) - $list = array(); - $iter = $this->backend->getTopDirectoryList( array( 'dir' => "$base/unittest-cont1" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct top dir listing ($backendName)." ); - - // Expected listing - $expected = array( - "subdir1", - "subdir2", - "subdir3", - "subdir4", - ); - sort( $expected ); - - // Actual listing (no trailing slash) - $list = array(); - $iter = $this->backend->getTopDirectoryList( array( 'dir' => "$base/unittest-cont1/e" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct top dir listing ($backendName)." ); - - // Actual listing (with trailing slash) - $list = array(); - $iter = $this->backend->getTopDirectoryList( array( 'dir' => "$base/unittest-cont1/e/" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct top dir listing ($backendName)." ); - - // Expected listing - $expected = array( - "subdir", - ); - sort( $expected ); - - // Actual listing (no trailing slash) - $list = array(); - $iter = $this->backend->getTopDirectoryList( array( 'dir' => "$base/unittest-cont1/e/subdir2" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct top dir listing ($backendName)." ); - - // Actual listing (with trailing slash) - $list = array(); - $iter = $this->backend->getTopDirectoryList( array( 'dir' => "$base/unittest-cont1/e/subdir2/" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct top dir listing ($backendName)." ); - - // Actual listing (using iterator second time) - $list = array(); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct top dir listing ($backendName), second iteration." ); - - // Expected listing (recursive) - $expected = array( - "e", - "e/subdir1", - "e/subdir2", - "e/subdir3", - "e/subdir4", - "e/subdir2/subdir", - "e/subdir3/subdir", - "e/subdir4/subdir", - "e/subdir4/subdir/sub", - ); - sort( $expected ); - - // Actual listing (recursive) - $list = array(); - $iter = $this->backend->getDirectoryList( array( 'dir' => "$base/unittest-cont1/" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct dir listing ($backendName)." ); - - // Expected listing (recursive) - $expected = array( - "subdir", - "subdir/sub", - ); - sort( $expected ); - - // Actual listing (recursive) - $list = array(); - $iter = $this->backend->getDirectoryList( array( 'dir' => "$base/unittest-cont1/e/subdir4" ) ); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct dir listing ($backendName)." ); - - // Actual listing (recursive, second time) - $list = array(); - foreach ( $iter as $file ) { - $list[] = $file; - } - sort( $list ); - - $this->assertEquals( $expected, $list, "Correct dir listing ($backendName)." ); - - $iter = $this->backend->getDirectoryList( array( 'dir' => "$base/unittest-cont1/e/subdir1" ) ); - $items = $this->listToArray( $iter ); - $this->assertEquals( array(), $items, "Directory listing is empty." ); - - foreach ( $files as $file ) { // clean up - $this->backend->doOperation( array( 'op' => 'delete', 'src' => $file ) ); - } - - $iter = $this->backend->getDirectoryList( array( 'dir' => "$base/unittest-cont1/not/exists" ) ); - foreach ( $iter as $file ) { - // no errors - } - - $items = $this->listToArray( $iter ); - $this->assertEquals( array(), $items, "Directory listing is empty." ); - - $iter = $this->backend->getDirectoryList( array( 'dir' => "$base/unittest-cont1/e/not/exists" ) ); - $items = $this->listToArray( $iter ); - $this->assertEquals( array(), $items, "Directory listing is empty." ); - } - - /** - * @covers FileBackend::lockFiles - * @covers FileBackend::unlockFiles - */ - public function testLockCalls() { - $this->backend = $this->singleBackend; - $this->doTestLockCalls(); - } - - private function doTestLockCalls() { - $backendName = $this->backendClass(); - - $paths = array( - "test1.txt", - "test2.txt", - "test3.txt", - "subdir1", - "subdir1", // duplicate - "subdir1/test1.txt", - "subdir1/test2.txt", - "subdir2", - "subdir2", // duplicate - "subdir2/test3.txt", - "subdir2/test4.txt", - "subdir2/subdir", - "subdir2/subdir/test1.txt", - "subdir2/subdir/test2.txt", - "subdir2/subdir/test3.txt", - "subdir2/subdir/test4.txt", - "subdir2/subdir/test5.txt", - "subdir2/subdir/sub", - "subdir2/subdir/sub/test0.txt", - "subdir2/subdir/sub/120-px-file.txt", - ); - - for ( $i = 0; $i < 25; $i++ ) { - $status = $this->backend->lockFiles( $paths, LockManager::LOCK_EX ); - $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), - "Locking of files succeeded ($backendName) ($i)." ); - $this->assertEquals( true, $status->isOK(), - "Locking of files succeeded with OK status ($backendName) ($i)." ); - - $status = $this->backend->lockFiles( $paths, LockManager::LOCK_SH ); - $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), - "Locking of files succeeded ($backendName) ($i)." ); - $this->assertEquals( true, $status->isOK(), - "Locking of files succeeded with OK status ($backendName) ($i)." ); - - $status = $this->backend->unlockFiles( $paths, LockManager::LOCK_SH ); - $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), - "Locking of files succeeded ($backendName) ($i)." ); - $this->assertEquals( true, $status->isOK(), - "Locking of files succeeded with OK status ($backendName) ($i)." ); - - $status = $this->backend->unlockFiles( $paths, LockManager::LOCK_EX ); - $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), - "Locking of files succeeded ($backendName). ($i)" ); - $this->assertEquals( true, $status->isOK(), - "Locking of files succeeded with OK status ($backendName) ($i)." ); - - ## Flip the acquire/release ordering around ## - - $status = $this->backend->lockFiles( $paths, LockManager::LOCK_SH ); - $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), - "Locking of files succeeded ($backendName) ($i)." ); - $this->assertEquals( true, $status->isOK(), - "Locking of files succeeded with OK status ($backendName) ($i)." ); - - $status = $this->backend->lockFiles( $paths, LockManager::LOCK_EX ); - $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), - "Locking of files succeeded ($backendName) ($i)." ); - $this->assertEquals( true, $status->isOK(), - "Locking of files succeeded with OK status ($backendName) ($i)." ); - - $status = $this->backend->unlockFiles( $paths, LockManager::LOCK_EX ); - $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), - "Locking of files succeeded ($backendName). ($i)" ); - $this->assertEquals( true, $status->isOK(), - "Locking of files succeeded with OK status ($backendName) ($i)." ); - - $status = $this->backend->unlockFiles( $paths, LockManager::LOCK_SH ); - $this->assertEquals( print_r( array(), true ), print_r( $status->errors, true ), - "Locking of files succeeded ($backendName) ($i)." ); - $this->assertEquals( true, $status->isOK(), - "Locking of files succeeded with OK status ($backendName) ($i)." ); - } - - $status = Status::newGood(); - $sl = $this->backend->getScopedFileLocks( $paths, LockManager::LOCK_EX, $status ); - $this->assertType( 'ScopedLock', $sl, - "Scoped locking of files succeeded ($backendName)." ); - $this->assertEquals( array(), $status->errors, - "Scoped locking of files succeeded ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Scoped locking of files succeeded with OK status ($backendName)." ); - - ScopedLock::release( $sl ); - $this->assertEquals( null, $sl, - "Scoped unlocking of files succeeded ($backendName)." ); - $this->assertEquals( array(), $status->errors, - "Scoped unlocking of files succeeded ($backendName)." ); - $this->assertEquals( true, $status->isOK(), - "Scoped unlocking of files succeeded with OK status ($backendName)." ); - } - - // helper function - private function listToArray( $iter ) { - return is_array( $iter ) ? $iter : iterator_to_array( $iter ); - } - - // test helper wrapper for backend prepare() function - private function prepare( array $params ) { - return $this->backend->prepare( $params ); - } - - // test helper wrapper for backend prepare() function - private function create( array $params ) { - $params['op'] = 'create'; - - return $this->backend->doQuickOperations( array( $params ) ); - } - - function tearDownFiles() { - foreach ( $this->filesToPrune as $file ) { - if ( is_file( $file ) ) { - unlink( $file ); - } - } - $containers = array( 'unittest-cont1', 'unittest-cont2' ); - foreach ( $containers as $container ) { - $this->deleteFiles( $container ); - } - $this->filesToPrune = array(); - } - - private function deleteFiles( $container ) { - $base = self::baseStorePath(); - $iter = $this->backend->getFileList( array( 'dir' => "$base/$container" ) ); - if ( $iter ) { - foreach ( $iter as $file ) { - $this->backend->quickDelete( array( 'src' => "$base/$container/$file" ) ); - } - // free the directory, to avoid Permission denied under windows on rmdir - unset( $iter ); - } - $this->backend->clean( array( 'dir' => "$base/$container", 'recursive' => 1 ) ); - } - - function assertBackendPathsConsistent( array $paths ) { - if ( $this->backend instanceof FileBackendMultiWrite ) { - $status = $this->backend->consistencyCheck( $paths ); - $this->assertGoodStatus( $status, "Files synced: " . implode( ',', $paths ) ); - } - } - - function assertGoodStatus( $status, $msg ) { - $this->assertEquals( print_r( array(), 1 ), print_r( $status->errors, 1 ), $msg ); - } -} diff --git a/tests/phpunit/includes/filerepo/FileRepoTest.php b/tests/phpunit/includes/filerepo/FileRepoTest.php deleted file mode 100644 index e3a75567..00000000 --- a/tests/phpunit/includes/filerepo/FileRepoTest.php +++ /dev/null @@ -1,55 +0,0 @@ - 'foobar' - ) ); - } - - /** - * @expectedException MWException - * @covers FileRepo::__construct - */ - public function testFileRepoConstructionOptionNeedBackendKey() { - new FileRepo( array( - 'name' => 'foobar' - ) ); - } - - /** - * @covers FileRepo::__construct - */ - public function testFileRepoConstructionWithRequiredOptions() { - $f = new FileRepo( array( - 'name' => 'FileRepoTestRepository', - 'backend' => new FSFileBackend( array( - 'name' => 'local-testing', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array() - ) ) - ) ); - $this->assertInstanceOf( 'FileRepo', $f ); - } -} diff --git a/tests/phpunit/includes/filerepo/StoreBatchTest.php b/tests/phpunit/includes/filerepo/StoreBatchTest.php deleted file mode 100644 index b33c1bbb..00000000 --- a/tests/phpunit/includes/filerepo/StoreBatchTest.php +++ /dev/null @@ -1,134 +0,0 @@ -getCliArg( 'use-filebackend=' ) ) { - $name = $this->getCliArg( 'use-filebackend=' ); - $useConfig = array(); - foreach ( $wgFileBackends as $conf ) { - if ( $conf['name'] == $name ) { - $useConfig = $conf; - } - } - $useConfig['name'] = 'local-testing'; // swap name - $class = $useConfig['class']; - $backend = new $class( $useConfig ); - } else { - $backend = new FSFileBackend( array( - 'name' => 'local-testing', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array( - 'unittests-public' => "{$tmpPrefix}-public", - 'unittests-thumb' => "{$tmpPrefix}-thumb", - 'unittests-temp' => "{$tmpPrefix}-temp", - 'unittests-deleted' => "{$tmpPrefix}-deleted", - ) - ) ); - } - $this->repo = new FileRepo( array( - 'name' => 'unittests', - 'backend' => $backend - ) ); - - $this->date = gmdate( "YmdHis" ); - $this->createdFiles = array(); - } - - protected function tearDown() { - $this->repo->cleanupBatch( $this->createdFiles ); // delete files - foreach ( $this->createdFiles as $tmp ) { // delete dirs - $tmp = $this->repo->resolveVirtualUrl( $tmp ); - while ( $tmp = FileBackend::parentStoragePath( $tmp ) ) { - $this->repo->getBackend()->clean( array( 'dir' => $tmp ) ); - } - } - parent::tearDown(); - } - - /** - * Store a file or virtual URL source into a media file name. - * - * @param $originalName string The title of the image - * @param $srcPath string The filepath or virtual URL - * @param $flags integer Flags to pass into repo::store(). - * @return FileRepoStatus - */ - private function storeit( $originalName, $srcPath, $flags ) { - $hashPath = $this->repo->getHashPath( $originalName ); - $dstRel = "$hashPath{$this->date}!$originalName"; - $dstUrlRel = $hashPath . $this->date . '!' . rawurlencode( $originalName ); - - $result = $this->repo->store( $srcPath, 'temp', $dstRel, $flags ); - $result->value = $this->repo->getVirtualUrl( 'temp' ) . '/' . $dstUrlRel; - $this->createdFiles[] = $result->value; - - return $result; - } - - /** - * Test storing a file using different flags. - * - * @param $fn string The title of the image - * @param $infn string The name of the file (in the filesystem) - * @param $otherfn string The name of the different file (in the filesystem) - * @param $fromrepo bool 'true' if we want to copy from a virtual URL out of the Repo. - */ - private function storecohort( $fn, $infn, $otherfn, $fromrepo ) { - $f = $this->storeit( $fn, $infn, 0 ); - $this->assertTrue( $f->isOK(), 'failed to store a new file' ); - $this->assertEquals( $f->failCount, 0, "counts wrong {$f->successCount} {$f->failCount}" ); - $this->assertEquals( $f->successCount, 1, "counts wrong {$f->successCount} {$f->failCount}" ); - if ( $fromrepo ) { - $f = $this->storeit( "Other-$fn", $infn, FileRepo::OVERWRITE ); - $infn = $f->value; - } - // This should work because we're allowed to overwrite - $f = $this->storeit( $fn, $infn, FileRepo::OVERWRITE ); - $this->assertTrue( $f->isOK(), 'We should be allowed to overwrite' ); - $this->assertEquals( $f->failCount, 0, "counts wrong {$f->successCount} {$f->failCount}" ); - $this->assertEquals( $f->successCount, 1, "counts wrong {$f->successCount} {$f->failCount}" ); - // This should fail because we're overwriting. - $f = $this->storeit( $fn, $infn, 0 ); - $this->assertFalse( $f->isOK(), 'We should not be allowed to overwrite' ); - $this->assertEquals( $f->failCount, 1, "counts wrong {$f->successCount} {$f->failCount}" ); - $this->assertEquals( $f->successCount, 0, "counts wrong {$f->successCount} {$f->failCount}" ); - // This should succeed because we're overwriting the same content. - $f = $this->storeit( $fn, $infn, FileRepo::OVERWRITE_SAME ); - $this->assertTrue( $f->isOK(), 'We should be able to overwrite the same content' ); - $this->assertEquals( $f->failCount, 0, "counts wrong {$f->successCount} {$f->failCount}" ); - $this->assertEquals( $f->successCount, 1, "counts wrong {$f->successCount} {$f->failCount}" ); - // This should fail because we're overwriting different content. - if ( $fromrepo ) { - $f = $this->storeit( "Other-$fn", $otherfn, FileRepo::OVERWRITE ); - $otherfn = $f->value; - } - $f = $this->storeit( $fn, $otherfn, FileRepo::OVERWRITE_SAME ); - $this->assertFalse( $f->isOK(), 'We should not be allowed to overwrite different content' ); - $this->assertEquals( $f->failCount, 1, "counts wrong {$f->successCount} {$f->failCount}" ); - $this->assertEquals( $f->successCount, 0, "counts wrong {$f->successCount} {$f->failCount}" ); - } - - /** - * @covers FileRepo::store - */ - public function teststore() { - global $IP; - $this->storecohort( "Test1.png", "$IP/skins/monobook/wiki.png", "$IP/skins/monobook/video.png", false ); - $this->storecohort( "Test2.png", "$IP/skins/monobook/wiki.png", "$IP/skins/monobook/video.png", true ); - } -} diff --git a/tests/phpunit/includes/installer/InstallDocFormatterTest.php b/tests/phpunit/includes/installer/InstallDocFormatterTest.php deleted file mode 100644 index 0e5f2671..00000000 --- a/tests/phpunit/includes/installer/InstallDocFormatterTest.php +++ /dev/null @@ -1,65 +0,0 @@ -assertEquals( - $expected, - InstallDocFormatter::format( $unformattedText ), - $message - ); - } - - /** - * Provider for testFormat() - */ - public static function provideDocFormattingTests() { - # Format: (expected string, unformattedText string, optional message) - return array( - # Escape some wikitext - array( 'Install <tag>', 'Install ', 'Escaping <' ), - array( 'Install {{template}}', 'Install {{template}}', 'Escaping [[' ), - array( 'Install [[page]]', 'Install [[page]]', 'Escaping {{' ), - array( 'Install __TOC__', 'Install __TOC__', 'Escaping __' ), - array( 'Install ', "Install \r", 'Removing \r' ), - - # Transform \t{1,2} into :{1,2} - array( ':One indentation', "\tOne indentation", 'Replacing a single \t' ), - array( '::Two indentations', "\t\tTwo indentations", 'Replacing 2 x \t' ), - - # Transform 'bug 123' links - array( - '[https://bugzilla.wikimedia.org/123 bug 123]', - 'bug 123', 'Testing bug 123 links' ), - array( - '([https://bugzilla.wikimedia.org/987654 bug 987654])', - '(bug 987654)', 'Testing (bug 987654) links' ), - - # "bug abc" shouldn't work - array( 'bug foobar', 'bug foobar', "Don't match bug followed by non-digits" ), - array( 'bug !!fakefake!!', 'bug !!fakefake!!', "Don't match bug followed by non-digits" ), - - # Transform '$wgFooBar' links - array( - '[http://www.mediawiki.org/wiki/Manual:$wgFooBar $wgFooBar]', - '$wgFooBar', 'Testing basic $wgFooBar' ), - array( - '[http://www.mediawiki.org/wiki/Manual:$wgFooBar45 $wgFooBar45]', - '$wgFooBar45', 'Testing $wgFooBar45 (with numbers)' ), - array( - '[http://www.mediawiki.org/wiki/Manual:$wgFoo_Bar $wgFoo_Bar]', - '$wgFoo_Bar', 'Testing $wgFoo_Bar (with underscore)' ), - - # Icky variables that shouldn't link - array( '$myAwesomeVariable', '$myAwesomeVariable', 'Testing $myAwesomeVariable (not starting with $wg)' ), - array( '$()not!a&Var', '$()not!a&Var', 'Testing $()not!a&Var (obviously not a variable)' ), - ); - } -} diff --git a/tests/phpunit/includes/installer/OracleInstallerTest.php b/tests/phpunit/includes/installer/OracleInstallerTest.php deleted file mode 100644 index 66e65592..00000000 --- a/tests/phpunit/includes/installer/OracleInstallerTest.php +++ /dev/null @@ -1,48 +0,0 @@ -assertEquals( $expected, - OracleInstaller::checkConnectStringFormat( $connectString ), - $msg - ); - } - - /** - * Provider to test OracleInstaller::checkConnectStringFormat() - */ - function provideOracleConnectStrings() { - // expected result, connectString[, message] - return array( - array( true, 'simple_01', 'Simple TNS name' ), - array( true, 'simple_01.world', 'TNS name with domain' ), - array( true, 'simple_01.domain.net', 'TNS name with domain' ), - array( true, 'host123', 'Host only' ), - array( true, 'host123.domain.net', 'FQDN only' ), - array( true, '//host123.domain.net', 'FQDN URL only' ), - array( true, '123.223.213.132', 'Host IP only' ), - array( true, 'host:1521', 'Host and port' ), - array( true, 'host:1521/service', 'Host, port and service' ), - array( true, 'host:1521/service:shared', 'Host, port, service and shared server type' ), - array( true, 'host:1521/service:dedicated', 'Host, port, service and dedicated server type' ), - array( true, 'host:1521/service:pooled', 'Host, port, service and pooled server type' ), - array( true, 'host:1521/service:shared/instance1', 'Host, port, service, server type and instance' ), - array( true, 'host:1521//instance1', 'Host, port and instance' ), - ); - } - -} diff --git a/tests/phpunit/includes/jobqueue/JobQueueTest.php b/tests/phpunit/includes/jobqueue/JobQueueTest.php deleted file mode 100644 index 4e51c4fc..00000000 --- a/tests/phpunit/includes/jobqueue/JobQueueTest.php +++ /dev/null @@ -1,329 +0,0 @@ -tablesUsed[] = 'job'; - } - - protected function setUp() { - global $wgJobTypeConf; - parent::setUp(); - - $this->setMwGlobals( 'wgMemc', new HashBagOStuff() ); - - if ( $this->getCliArg( 'use-jobqueue=' ) ) { - $name = $this->getCliArg( 'use-jobqueue=' ); - if ( !isset( $wgJobTypeConf[$name] ) ) { - throw new MWException( "No \$wgJobTypeConf entry for '$name'." ); - } - $baseConfig = $wgJobTypeConf[$name]; - } else { - $baseConfig = array( 'class' => 'JobQueueDB' ); - } - $baseConfig['type'] = 'null'; - $baseConfig['wiki'] = wfWikiID(); - $variants = array( - 'queueRand' => array( 'order' => 'random', 'claimTTL' => 0 ), - 'queueRandTTL' => array( 'order' => 'random', 'claimTTL' => 10 ), - 'queueTimestamp' => array( 'order' => 'timestamp', 'claimTTL' => 0 ), - 'queueTimestampTTL' => array( 'order' => 'timestamp', 'claimTTL' => 10 ), - 'queueFifo' => array( 'order' => 'fifo', 'claimTTL' => 0 ), - 'queueFifoTTL' => array( 'order' => 'fifo', 'claimTTL' => 10 ), - ); - foreach ( $variants as $q => $settings ) { - try { - $this->$q = JobQueue::factory( $settings + $baseConfig ); - if ( !( $this->$q instanceof JobQueueDB ) ) { - $this->$q->setTestingPrefix( 'unittests-' . wfRandomString( 32 ) ); - } - } catch ( MWException $e ) { - // unsupported? - // @todo What if it was another error? - }; - } - } - - protected function tearDown() { - parent::tearDown(); - foreach ( - array( - 'queueRand', 'queueRandTTL', 'queueTimestamp', 'queueTimestampTTL', - 'queueFifo', 'queueFifoTTL' - ) as $q - ) { - if ( $this->$q ) { - $this->$q->delete(); - } - $this->$q = null; - } - } - - /** - * @dataProvider provider_queueLists - */ - public function testProperties( $queue, $recycles, $desc ) { - $queue = $this->$queue; - if ( !$queue ) { - $this->markTestSkipped( $desc ); - } - - $this->assertEquals( wfWikiID(), $queue->getWiki(), "Proper wiki ID ($desc)" ); - $this->assertEquals( 'null', $queue->getType(), "Proper job type ($desc)" ); - } - - /** - * @dataProvider provider_queueLists - */ - public function testBasicOperations( $queue, $recycles, $desc ) { - $queue = $this->$queue; - if ( !$queue ) { - $this->markTestSkipped( $desc ); - } - - $this->assertTrue( $queue->isEmpty(), "Queue is empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "Queue is empty ($desc)" ); - - $this->assertTrue( $queue->push( $this->newJob() ), "Push worked ($desc)" ); - $this->assertTrue( $queue->batchPush( array( $this->newJob() ) ), "Push worked ($desc)" ); - - $this->assertFalse( $queue->isEmpty(), "Queue is not empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 2, $queue->getSize(), "Queue size is correct ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "No jobs active ($desc)" ); - $jobs = iterator_to_array( $queue->getAllQueuedJobs() ); - $this->assertEquals( 2, count( $jobs ), "Queue iterator size is correct ($desc)" ); - - $job1 = $queue->pop(); - $this->assertFalse( $queue->isEmpty(), "Queue is not empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 1, $queue->getSize(), "Queue size is correct ($desc)" ); - - $queue->flushCaches(); - if ( $recycles ) { - $this->assertEquals( 1, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } else { - $this->assertEquals( 0, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } - - $job2 = $queue->pop(); - $this->assertTrue( $queue->isEmpty(), "Queue is empty ($desc)" ); - $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" ); - - $queue->flushCaches(); - if ( $recycles ) { - $this->assertEquals( 2, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } else { - $this->assertEquals( 0, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } - - $queue->ack( $job1 ); - - $queue->flushCaches(); - if ( $recycles ) { - $this->assertEquals( 1, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } else { - $this->assertEquals( 0, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } - - $queue->ack( $job2 ); - - $queue->flushCaches(); - $this->assertEquals( 0, $queue->getAcquiredCount(), "Active job count ($desc)" ); - - $this->assertTrue( $queue->batchPush( array( $this->newJob(), $this->newJob() ) ), - "Push worked ($desc)" ); - $this->assertFalse( $queue->isEmpty(), "Queue is not empty ($desc)" ); - - $queue->delete(); - $queue->flushCaches(); - $this->assertTrue( $queue->isEmpty(), "Queue is empty ($desc)" ); - $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" ); - } - - /** - * @dataProvider provider_queueLists - */ - public function testBasicDeduplication( $queue, $recycles, $desc ) { - $queue = $this->$queue; - if ( !$queue ) { - $this->markTestSkipped( $desc ); - } - - $this->assertTrue( $queue->isEmpty(), "Queue is empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "Queue is empty ($desc)" ); - - $this->assertTrue( - $queue->batchPush( - array( $this->newDedupedJob(), $this->newDedupedJob(), $this->newDedupedJob() ) - ), - "Push worked ($desc)" ); - - $this->assertFalse( $queue->isEmpty(), "Queue is not empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 1, $queue->getSize(), "Queue size is correct ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "No jobs active ($desc)" ); - - $this->assertTrue( - $queue->batchPush( - array( $this->newDedupedJob(), $this->newDedupedJob(), $this->newDedupedJob() ) - ), - "Push worked ($desc)" - ); - - $this->assertFalse( $queue->isEmpty(), "Queue is not empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 1, $queue->getSize(), "Queue size is correct ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "No jobs active ($desc)" ); - - $job1 = $queue->pop(); - $this->assertTrue( $queue->isEmpty(), "Queue is empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" ); - if ( $recycles ) { - $this->assertEquals( 1, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } else { - $this->assertEquals( 0, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } - - $queue->ack( $job1 ); - - $queue->flushCaches(); - $this->assertEquals( 0, $queue->getAcquiredCount(), "Active job count ($desc)" ); - } - - /** - * @dataProvider provider_queueLists - */ - public function testRootDeduplication( $queue, $recycles, $desc ) { - $queue = $this->$queue; - if ( !$queue ) { - $this->markTestSkipped( $desc ); - } - - $this->assertTrue( $queue->isEmpty(), "Queue is empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "Queue is empty ($desc)" ); - - $id = wfRandomString( 32 ); - $root1 = Job::newRootJobParams( "nulljobspam:$id" ); // task ID/timestamp - for ( $i = 0; $i < 5; ++$i ) { - $this->assertTrue( $queue->push( $this->newJob( 0, $root1 ) ), "Push worked ($desc)" ); - } - $queue->deduplicateRootJob( $this->newJob( 0, $root1 ) ); - sleep( 1 ); // roo job timestamp will increase - $root2 = Job::newRootJobParams( "nulljobspam:$id" ); // task ID/timestamp - $this->assertNotEquals( $root1['rootJobTimestamp'], $root2['rootJobTimestamp'], - "Root job signatures have different timestamps." ); - for ( $i = 0; $i < 5; ++$i ) { - $this->assertTrue( $queue->push( $this->newJob( 0, $root2 ) ), "Push worked ($desc)" ); - } - $queue->deduplicateRootJob( $this->newJob( 0, $root2 ) ); - - $this->assertFalse( $queue->isEmpty(), "Queue is not empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 10, $queue->getSize(), "Queue size is correct ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "No jobs active ($desc)" ); - - $dupcount = 0; - $jobs = array(); - do { - $job = $queue->pop(); - if ( $job ) { - $jobs[] = $job; - $queue->ack( $job ); - } - if ( $job instanceof DuplicateJob ) { - ++$dupcount; - } - } while ( $job ); - - $this->assertEquals( 10, count( $jobs ), "Correct number of jobs popped ($desc)" ); - $this->assertEquals( 5, $dupcount, "Correct number of duplicate jobs popped ($desc)" ); - } - - /** - * @dataProvider provider_fifoQueueLists - */ - public function testJobOrder( $queue, $recycles, $desc ) { - $queue = $this->$queue; - if ( !$queue ) { - $this->markTestSkipped( $desc ); - } - - $this->assertTrue( $queue->isEmpty(), "Queue is empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "Queue is empty ($desc)" ); - - for ( $i = 0; $i < 10; ++$i ) { - $this->assertTrue( $queue->push( $this->newJob( $i ) ), "Push worked ($desc)" ); - } - - for ( $i = 0; $i < 10; ++$i ) { - $job = $queue->pop(); - $this->assertTrue( $job instanceof Job, "Jobs popped from queue ($desc)" ); - $params = $job->getParams(); - $this->assertEquals( $i, $params['i'], "Job popped from queue is FIFO ($desc)" ); - $queue->ack( $job ); - } - - $this->assertFalse( $queue->pop(), "Queue is not empty ($desc)" ); - - $queue->flushCaches(); - $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" ); - $this->assertEquals( 0, $queue->getAcquiredCount(), "No jobs active ($desc)" ); - } - - public static function provider_queueLists() { - return array( - array( 'queueRand', false, 'Random queue without ack()' ), - array( 'queueRandTTL', true, 'Random queue with ack()' ), - array( 'queueTimestamp', false, 'Time ordered queue without ack()' ), - array( 'queueTimestampTTL', true, 'Time ordered queue with ack()' ), - array( 'queueFifo', false, 'FIFO ordered queue without ack()' ), - array( 'queueFifoTTL', true, 'FIFO ordered queue with ack()' ) - ); - } - - public static function provider_fifoQueueLists() { - return array( - array( 'queueFifo', false, 'Ordered queue without ack()' ), - array( 'queueFifoTTL', true, 'Ordered queue with ack()' ) - ); - } - - function newJob( $i = 0, $rootJob = array() ) { - return new NullJob( Title::newMainPage(), - array( 'lives' => 0, 'usleep' => 0, 'removeDuplicates' => 0, 'i' => $i ) + $rootJob ); - } - - function newDedupedJob( $i = 0, $rootJob = array() ) { - return new NullJob( Title::newMainPage(), - array( 'lives' => 0, 'usleep' => 0, 'removeDuplicates' => 1, 'i' => $i ) + $rootJob ); - } -} diff --git a/tests/phpunit/includes/json/FormatJsonTest.php b/tests/phpunit/includes/json/FormatJsonTest.php deleted file mode 100644 index 149be05b..00000000 --- a/tests/phpunit/includes/json/FormatJsonTest.php +++ /dev/null @@ -1,161 +0,0 @@ - new stdClass, - 'emptyArray' => array(), - 'string' => 'foobar\\', - 'filledArray' => array( - array( - 123, - 456, - ), - // Nested json works without problems - '"7":["8",{"9":"10"}]', - // Whitespace clean up doesn't touch strings that look alike - "{\n\t\"emptyObject\": {\n\t},\n\t\"emptyArray\": [ ]\n}", - ), - ); - - // 4 space indent, no trailing whitespace, no trailing linefeed - $json = '{ - "emptyObject": {}, - "emptyArray": [], - "string": "foobar\\\\", - "filledArray": [ - [ - 123, - 456 - ], - "\"7\":[\"8\",{\"9\":\"10\"}]", - "{\n\t\"emptyObject\": {\n\t},\n\t\"emptyArray\": [ ]\n}" - ] -}'; - - $json = str_replace( "\r", '', $json ); // Windows compat - $this->assertSame( $json, FormatJson::encode( $obj, true ) ); - } - - public static function provideEncodeDefault() { - return self::getEncodeTestCases( array() ); - } - - /** - * @dataProvider provideEncodeDefault - */ - public function testEncodeDefault( $from, $to ) { - $this->assertSame( $to, FormatJson::encode( $from ) ); - } - - public static function provideEncodeUtf8() { - return self::getEncodeTestCases( array( 'unicode' ) ); - } - - /** - * @dataProvider provideEncodeUtf8 - */ - public function testEncodeUtf8( $from, $to ) { - $this->assertSame( $to, FormatJson::encode( $from, false, FormatJson::UTF8_OK ) ); - } - - public static function provideEncodeXmlMeta() { - return self::getEncodeTestCases( array( 'xmlmeta' ) ); - } - - /** - * @dataProvider provideEncodeXmlMeta - */ - public function testEncodeXmlMeta( $from, $to ) { - $this->assertSame( $to, FormatJson::encode( $from, false, FormatJson::XMLMETA_OK ) ); - } - - public static function provideEncodeAllOk() { - return self::getEncodeTestCases( array( 'unicode', 'xmlmeta' ) ); - } - - /** - * @dataProvider provideEncodeAllOk - */ - public function testEncodeAllOk( $from, $to ) { - $this->assertSame( $to, FormatJson::encode( $from, false, FormatJson::ALL_OK ) ); - } - - public function testEncodePhpBug46944() { - $this->assertNotEquals( - '\ud840\udc00', - strtolower( FormatJson::encode( "\xf0\xa0\x80\x80" ) ), - 'Test encoding an broken json_encode character (U+20000)' - ); - } - - public function testDecodeReturnType() { - $this->assertInternalType( - 'object', - FormatJson::decode( '{"Name": "Cheeso", "Rank": 7}' ), - 'Default to object' - ); - - $this->assertInternalType( - 'array', - FormatJson::decode( '{"Name": "Cheeso", "Rank": 7}', true ), - 'Optional array' - ); - } - - /** - * Generate a set of test cases for a particular combination of encoder options. - * - * @param array $unescapedGroups List of character groups to leave unescaped - * @return array: Arrays of unencoded strings and corresponding encoded strings - */ - private static function getEncodeTestCases( array $unescapedGroups ) { - $groups = array( - 'always' => array( - // Forward slash (always unescaped) - '/' => '/', - - // Control characters - "\0" => '\u0000', - "\x08" => '\b', - "\t" => '\t', - "\n" => '\n', - "\r" => '\r', - "\f" => '\f', - "\x1f" => '\u001f', // representative example - - // Double quotes - '"' => '\"', - - // Backslashes - '\\' => '\\\\', - '\\\\' => '\\\\\\\\', - '\\u00e9' => '\\\u00e9', // security check for Unicode unescaping - - // Line terminators - "\xe2\x80\xa8" => '\u2028', - "\xe2\x80\xa9" => '\u2029', - ), - 'unicode' => array( - "\xc3\xa9" => '\u00e9', - "\xf0\x9d\x92\x9e" => '\ud835\udc9e', // U+1D49E, outside the BMP - ), - 'xmlmeta' => array( - '<' => '\u003C', // JSON_HEX_TAG uses uppercase hex digits - '>' => '\u003E', - '&' => '\u0026', - ), - ); - - $cases = array(); - foreach ( $groups as $name => $rules ) { - $leaveUnescaped = in_array( $name, $unescapedGroups ); - foreach ( $rules as $from => $to ) { - $cases[] = array( $from, '"' . ( $leaveUnescaped ? $from : $to ) . '"' ); - } - } - - return $cases; - } -} diff --git a/tests/phpunit/includes/libs/CSSJanusTest.php b/tests/phpunit/includes/libs/CSSJanusTest.php deleted file mode 100644 index 5a3c1619..00000000 --- a/tests/phpunit/includes/libs/CSSJanusTest.php +++ /dev/null @@ -1,606 +0,0 @@ -assertEquals( $transformedA, $cssB, 'Test A-B transformation' ); - - $transformedB = CSSJanus::transform( $cssB ); - $this->assertEquals( $transformedB, $cssA, 'Test B-A transformation' ); - } else { - // If no B version is provided, it means - // the output should equal the input. - $transformedA = CSSJanus::transform( $cssA ); - $this->assertEquals( $transformedA, $cssA, 'Nothing was flipped' ); - } - } - - /** - * @dataProvider provideTransformAdvancedCases - */ - public function testTransformAdvanced( $code, $expectedOutput, $options = array() ) { - $swapLtrRtlInURL = isset( $options['swapLtrRtlInURL'] ) ? $options['swapLtrRtlInURL'] : false; - $swapLeftRightInURL = isset( $options['swapLeftRightInURL'] ) ? $options['swapLeftRightInURL'] : false; - - $flipped = CSSJanus::transform( $code, $swapLtrRtlInURL, $swapLeftRightInURL ); - - $this->assertEquals( $expectedOutput, $flipped, - 'Test flipping, options: url-ltr-rtl=' . ( $swapLtrRtlInURL ? 'true' : 'false' ) - . ' url-left-right=' . ( $swapLeftRightInURL ? 'true' : 'false' ) - ); - } - - /** - * @dataProvider provideTransformBrokenCases - * @group Broken - */ - public function testTransformBroken( $code, $expectedOutput ) { - $flipped = CSSJanus::transform( $code ); - - $this->assertEquals( $expectedOutput, $flipped, 'Test flipping' ); - } - - /** - * These transform cases are tested *in both directions* - * No need to declare a principle twice in both directions here. - */ - public static function provideTransformCases() { - return array( - // Property keys - array( - '.foo { left: 0; }', - '.foo { right: 0; }' - ), - // Guard against partial keys - // (CSS currently doesn't have flippable properties - // that contain the direction as part of the key without - // dash separation) - array( - '.foo { alright: 0; }' - ), - array( - '.foo { balleft: 0; }' - ), - - // Dashed property keys - array( - '.foo { padding-left: 0; }', - '.foo { padding-right: 0; }' - ), - array( - '.foo { margin-left: 0; }', - '.foo { margin-right: 0; }' - ), - array( - '.foo { border-left: 0; }', - '.foo { border-right: 0; }' - ), - - // Double-dashed property keys - array( - '.foo { border-left-color: red; }', - '.foo { border-right-color: red; }' - ), - array( - // Includes unknown properties? - '.foo { x-left-y: 0; }', - '.foo { x-right-y: 0; }' - ), - - // Multi-value properties - array( - '.foo { padding: 0; }' - ), - array( - '.foo { padding: 0 1px; }' - ), - array( - '.foo { padding: 0 1px 2px; }' - ), - array( - '.foo { padding: 0 1px 2px 3px; }', - '.foo { padding: 0 3px 2px 1px; }' - ), - - // Shorthand / Four notation - array( - '.foo { padding: .25em 15px 0pt 0ex; }', - '.foo { padding: .25em 0ex 0pt 15px; }' - ), - array( - '.foo { margin: 1px -4px 3px 2px; }', - '.foo { margin: 1px 2px 3px -4px; }' - ), - array( - '.foo { padding: 0 15px .25em 0; }', - '.foo { padding: 0 0 .25em 15px; }' - ), - array( - '.foo { padding: 1px 4.1grad 3px 2%; }', - '.foo { padding: 1px 2% 3px 4.1grad; }' - ), - array( - '.foo { padding: 1px 2px 3px auto; }', - '.foo { padding: 1px auto 3px 2px; }' - ), - array( - '.foo { padding: 1px inherit 3px auto; }', - '.foo { padding: 1px auto 3px inherit; }' - ), - // border-radius assigns different meanings to the values - array( - '.foo { border-radius: .25em 15px 0pt 0ex; }', - '.foo { border-radius: 15px .25em 0ex 0pt; }' - ), - array( - '.foo { border-radius: 0px 0px 5px 5px; }', - ), - // Ensure the rule doesn't break other stuff - array( - '.foo { x-unknown: a b c d; }' - ), - array( - '.foo barpx 0 2% { opacity: 0; }' - ), - array( - '#settings td p strong' - ), - array( - // Color names - '.foo { border-color: red green blue white }', - '.foo { border-color: red white blue green }', - ), - array( - // Color name, hexdecimal, RGB & RGBA - '.foo { border-color: red #f00 rgb(255, 0, 0) rgba(255, 0, 0, 0.5) }', - '.foo { border-color: red rgba(255, 0, 0, 0.5) rgb(255, 0, 0) #f00 }', - ), - array( - // Color name, hexdecimal, HSL & HSLA - '.foo { border-color: red #f00 hsl(0, 100%, 50%) hsla(0, 100%, 50%, 0.5) }', - '.foo { border-color: red hsla(0, 100%, 50%, 0.5) hsl(0, 100%, 50%) #f00 }', - ), - array( - // Do not mangle 5 or more values - '.foo { -x-unknown: 1 2 3 4 5; }' - ), - array( - '.foo { -x-unknown: 1 2 3 4 5 6; }' - ), - - // Shorthand / Three notation - array( - '.foo { margin: 1em 0 .25em; }' - ), - array( - '.foo { margin:-1.5em 0 -.75em; }' - ), - - // Shorthand / Two notation - array( - '.foo { padding: 1px 2px; }' - ), - - // Shorthand / One notation - array( - '.foo { padding: 1px; }' - ), - - // text-shadow and box-shadow - array( - '.foo { box-shadow: -6px 3px 8px 5px rgba(0, 0, 0, 0.25); }', - '.foo { box-shadow: 6px 3px 8px 5px rgba(0, 0, 0, 0.25); }', - ), - array( - '.foo { box-shadow: inset -6px 3px 8px 5px rgba(0, 0, 0, 0.25); }', - '.foo { box-shadow: inset 6px 3px 8px 5px rgba(0, 0, 0, 0.25); }', - ), - array( - '.foo { text-shadow: orange 2px 0; }', - '.foo { text-shadow: orange -2px 0; }', - ), - array( - '.foo { text-shadow: 2px 0 orange; }', - '.foo { text-shadow: -2px 0 orange; }', - ), - array( - // Don't mangle zeroes - '.foo { text-shadow: orange 0 2px; }' - ), - - // Direction - // Note: This differs from the Python implementation, - // see also CSSJanus::fixDirection for more info. - array( - '.foo { direction: ltr; }', - '.foo { direction: rtl; }' - ), - array( - '.foo { direction: rtl; }', - '.foo { direction: ltr; }' - ), - array( - 'input { direction: ltr; }', - 'input { direction: rtl; }' - ), - array( - 'input { direction: rtl; }', - 'input { direction: ltr; }' - ), - array( - 'body { direction: ltr; }', - 'body { direction: rtl; }' - ), - array( - '.foo, body, input { direction: ltr; }', - '.foo, body, input { direction: rtl; }' - ), - array( - 'body { padding: 10px; direction: ltr; }', - 'body { padding: 10px; direction: rtl; }' - ), - array( - 'body { direction: ltr } .myClass { direction: ltr }', - 'body { direction: rtl } .myClass { direction: rtl }' - ), - - // Left/right values - array( - '.foo { float: left; }', - '.foo { float: right; }' - ), - array( - '.foo { text-align: left; }', - '.foo { text-align: right; }' - ), - array( - '.foo { -x-unknown: left; }', - '.foo { -x-unknown: right; }' - ), - // Guard against selectors that look flippable - array( - '.column-left { width: 0; }' - ), - array( - 'a.left { width: 0; }' - ), - array( - 'a.leftification { width: 0; }' - ), - array( - 'a.ltr { width: 0; }' - ), - array( - #
            - '.a-ltr.png { width: 0; }' - ), - array( - # - 'foo-ltr[attr="x"] { width: 0; }' - ), - array( - 'div.left > span.right+span.left { width: 0; }' - ), - array( - '.thisclass .left .myclass { width: 0; }' - ), - array( - '.thisclass .left .myclass #myid { width: 0; }' - ), - - // Cursor values (east/west) - array( - '.foo { cursor: e-resize; }', - '.foo { cursor: w-resize; }' - ), - array( - '.foo { cursor: se-resize; }', - '.foo { cursor: sw-resize; }' - ), - array( - '.foo { cursor: ne-resize; }', - '.foo { cursor: nw-resize; }' - ), - - // Background - array( - '.foo { background-position: top left; }', - '.foo { background-position: top right; }' - ), - array( - '.foo { background: url(/foo/bar.png) top left; }', - '.foo { background: url(/foo/bar.png) top right; }' - ), - array( - '.foo { background: url(/foo/bar.png) top left no-repeat; }', - '.foo { background: url(/foo/bar.png) top right no-repeat; }' - ), - array( - '.foo { background: url(/foo/bar.png) no-repeat top left; }', - '.foo { background: url(/foo/bar.png) no-repeat top right; }' - ), - array( - '.foo { background: #fff url(/foo/bar.png) no-repeat top left; }', - '.foo { background: #fff url(/foo/bar.png) no-repeat top right; }' - ), - array( - '.foo { background-position: 100% 40%; }', - '.foo { background-position: 0% 40%; }' - ), - array( - '.foo { background-position: 23% 0; }', - '.foo { background-position: 77% 0; }' - ), - array( - '.foo { background-position: 23% auto; }', - '.foo { background-position: 77% auto; }' - ), - array( - '.foo { background-position-x: 23%; }', - '.foo { background-position-x: 77%; }' - ), - array( - '.foo { background-position-y: 23%; }', - '.foo { background-position-y: 23%; }' - ), - array( - '.foo { background:url(../foo.png) no-repeat 75% 50%; }', - '.foo { background:url(../foo.png) no-repeat 25% 50%; }' - ), - array( - '.foo { background: 10% 20% } .bar { background: 40% 30% }', - '.foo { background: 90% 20% } .bar { background: 60% 30% }' - ), - - // Multiple rules - array( - 'body { direction: rtl; float: right; } .foo { direction: ltr; float: right; }', - 'body { direction: ltr; float: left; } .foo { direction: rtl; float: left; }', - ), - - // Duplicate properties - array( - '.foo { float: left; float: right; float: left; }', - '.foo { float: right; float: left; float: right; }', - ), - - // Preserve comments - array( - '/* left /* right */left: 10px', - '/* left /* right */right: 10px' - ), - array( - '/*left*//*left*/left: 10px', - '/*left*//*left*/right: 10px' - ), - array( - '/* Going right is cool */ .foo { width: 0 }', - ), - array( - "/* padding-right 1 2 3 4 */\n#test { width: 0}\n/*right*/" - ), - array( - "/** Two line comment\n * left\n \*/\n#test {width: 0}" - ), - - // @noflip annotation - array( - // before selector (single) - '/* @noflip */ div { float: left; }' - ), - array( - // before selector (multiple) - '/* @noflip */ div, .notme { float: left; }' - ), - array( - // inside selector - 'div, /* @noflip */ .foo { float: left; }' - ), - array( - // after selector - 'div, .notme /* @noflip */ { float: left; }' - ), - array( - // before multiple rules - '/* @noflip */ div { float: left; } .foo { float: left; }', - '/* @noflip */ div { float: left; } .foo { float: right; }' - ), - array( - // support parentheses in selector - '/* @noflip */ .test:not(:first) { margin-right: -0.25em; margin-left: 0.25em; }', - '/* @noflip */ .test:not(:first) { margin-right: -0.25em; margin-left: 0.25em; }' - ), - array( - // after multiple rules - '.foo { float: left; } /* @noflip */ div { float: left; }', - '.foo { float: right; } /* @noflip */ div { float: left; }' - ), - array( - // before multiple properties - 'div { /* @noflip */ float: left; text-align: left; }', - 'div { /* @noflip */ float: left; text-align: right; }' - ), - array( - // after multiple properties - 'div { float: left; /* @noflip */ text-align: left; }', - 'div { float: right; /* @noflip */ text-align: left; }' - ), - - // Guard against css3 stuff - array( - 'background-image: -moz-linear-gradient(#326cc1, #234e8c);' - ), - array( - 'background-image: -webkit-gradient(linear, 100% 0%, 0% 0%, from(#666666), to(#ffffff));' - ), - - // CSS syntax / white-space variations - // spaces, no spaces, tabs, new lines, omitting semi-colons - array( - ".foo { left: 0; }", - ".foo { right: 0; }" - ), - array( - ".foo{ left: 0; }", - ".foo{ right: 0; }" - ), - array( - ".foo{ left: 0 }", - ".foo{ right: 0 }" - ), - array( - ".foo{left:0 }", - ".foo{right:0 }" - ), - array( - ".foo{left:0}", - ".foo{right:0}" - ), - array( - ".foo { left : 0 ; }", - ".foo { right : 0 ; }" - ), - array( - ".foo\n { left : 0 ; }", - ".foo\n { right : 0 ; }" - ), - array( - ".foo\n { \nleft : 0 ; }", - ".foo\n { \nright : 0 ; }" - ), - array( - ".foo\n { \n left : 0 ; }", - ".foo\n { \n right : 0 ; }" - ), - array( - ".foo\n { \n left\n : 0; }", - ".foo\n { \n right\n : 0; }" - ), - array( - ".foo \n { \n left\n : 0; }", - ".foo \n { \n right\n : 0; }" - ), - array( - ".foo\n{\nleft\n:\n0;}", - ".foo\n{\nright\n:\n0;}" - ), - array( - ".foo\n.bar {\n\tleft: 0;\n}", - ".foo\n.bar {\n\tright: 0;\n}" - ), - array( - ".foo\t{\tleft\t:\t0;}", - ".foo\t{\tright\t:\t0;}" - ), - - // Guard against partial keys - array( - '.foo { leftxx: 0; }', - '.foo { leftxx: 0; }' - ), - array( - '.foo { rightxx: 0; }', - '.foo { rightxx: 0; }' - ), - ); - } - - /** - * These cases are tested in one way only (format: actual, expected, msg). - * If both ways can be tested, either put both versions in here or move - * it to provideTransformCases(). - */ - public static function provideTransformAdvancedCases() { - $bgPairs = array( - # [ - _ . ] <-> [ left right ltr rtl ] - 'foo.jpg' => 'foo.jpg', - 'left.jpg' => 'right.jpg', - 'ltr.jpg' => 'rtl.jpg', - - 'foo-left.png' => 'foo-right.png', - 'foo_left.png' => 'foo_right.png', - 'foo.left.png' => 'foo.right.png', - - 'foo-ltr.png' => 'foo-rtl.png', - 'foo_ltr.png' => 'foo_rtl.png', - 'foo.ltr.png' => 'foo.rtl.png', - - 'left-foo.png' => 'right-foo.png', - 'left_foo.png' => 'right_foo.png', - 'left.foo.png' => 'right.foo.png', - - 'ltr-foo.png' => 'rtl-foo.png', - 'ltr_foo.png' => 'rtl_foo.png', - 'ltr.foo.png' => 'rtl.foo.png', - - 'foo-ltr-left.gif' => 'foo-rtl-right.gif', - 'foo_ltr_left.gif' => 'foo_rtl_right.gif', - 'foo.ltr.left.gif' => 'foo.rtl.right.gif', - 'foo-ltr_left.gif' => 'foo-rtl_right.gif', - 'foo_ltr.left.gif' => 'foo_rtl.right.gif', - ); - $provider = array(); - foreach ( $bgPairs as $left => $right ) { - # By default '-rtl' and '-left' etc. are not touched, - # Only when the appropiate parameter is set. - $provider[] = array( - ".foo { background: url(images/$left); }", - ".foo { background: url(images/$left); }" - ); - $provider[] = array( - ".foo { background: url(images/$right); }", - ".foo { background: url(images/$right); }" - ); - $provider[] = array( - ".foo { background: url(images/$left); }", - ".foo { background: url(images/$right); }", - array( - 'swapLtrRtlInURL' => true, - 'swapLeftRightInURL' => true, - ) - ); - $provider[] = array( - ".foo { background: url(images/$right); }", - ".foo { background: url(images/$left); }", - array( - 'swapLtrRtlInURL' => true, - 'swapLeftRightInURL' => true, - ) - ); - } - - return $provider; - } - - /** - * Cases that are currently failing, but - * should be looked at in the future as enhancements and/or bug fix - */ - public static function provideTransformBrokenCases() { - return array( - // Guard against selectors that look flippable - array( - # - 'foo-left-x[attr="x"] { width: 0; }', - 'foo-left-x[attr="x"] { width: 0; }' - ), - array( - #
            - '.foo[data-left="x"] { width: 0; }', - '.foo[data-left="x"] { width: 0; }' - ), - ); - } -} diff --git a/tests/phpunit/includes/libs/CSSMinTest.php b/tests/phpunit/includes/libs/CSSMinTest.php deleted file mode 100644 index 951dd7b9..00000000 --- a/tests/phpunit/includes/libs/CSSMinTest.php +++ /dev/null @@ -1,133 +0,0 @@ -setMwGlobals( array( - 'wgServer' => $server, - 'wgCanonicalServer' => $server, - ) ); - } - - /** - * @dataProvider provideMinifyCases - */ - public function testMinify( $code, $expectedOutput ) { - $minified = CSSMin::minify( $code ); - - $this->assertEquals( $expectedOutput, $minified, 'Minified output should be in the form expected.' ); - } - - public static function provideMinifyCases() { - return array( - // Whitespace - array( "\r\t\f \v\n\r", "" ), - array( "foo, bar {\n\tprop: value;\n}", "foo,bar{prop:value}" ), - - // Loose comments - array( "/* foo */", "" ), - array( "/*******\n foo\n *******/", "" ), - array( "/*!\n foo\n */", "" ), - - // Inline comments in various different places - array( "/* comment */foo, bar {\n\tprop: value;\n}", "foo,bar{prop:value}" ), - array( "foo/* comment */, bar {\n\tprop: value;\n}", "foo,bar{prop:value}" ), - array( "foo,/* comment */ bar {\n\tprop: value;\n}", "foo,bar{prop:value}" ), - array( "foo, bar/* comment */ {\n\tprop: value;\n}", "foo,bar{prop:value}" ), - array( "foo, bar {\n\t/* comment */prop: value;\n}", "foo,bar{prop:value}" ), - array( "foo, bar {\n\tprop: /* comment */value;\n}", "foo,bar{prop:value}" ), - array( "foo, bar {\n\tprop: value /* comment */;\n}", "foo,bar{prop:value }" ), - array( "foo, bar {\n\tprop: value; /* comment */\n}", "foo,bar{prop:value; }" ), - - // Keep track of things that aren't as minified as much as they - // could be (bug 35493) - array( 'foo { prop: value ;}', 'foo{prop:value }' ), - array( 'foo { prop : value; }', 'foo{prop :value}' ), - array( 'foo { prop: value ; }', 'foo{prop:value }' ), - array( 'foo { font-family: "foo" , "bar"; }', 'foo{font-family:"foo" ,"bar"}' ), - array( "foo { src:\n\turl('foo') ,\n\turl('bar') ; }", "foo{src:url('foo') ,url('bar') }" ), - - // Interesting cases with string values - // - Double quotes, single quotes - array( 'foo { content: ""; }', 'foo{content:""}' ), - array( "foo { content: ''; }", "foo{content:''}" ), - array( 'foo { content: "\'"; }', 'foo{content:"\'"}' ), - array( "foo { content: '\"'; }", "foo{content:'\"'}" ), - // - Whitespace in string values - array( 'foo { content: " "; }', 'foo{content:" "}' ), - ); - } - - /** - * @dataProvider provideRemapCases - */ - public function testRemap( $message, $params, $expectedOutput ) { - $remapped = call_user_func_array( 'CSSMin::remap', $params ); - - $messageAdd = " Case: $message"; - $this->assertEquals( $expectedOutput, $remapped, 'CSSMin::remap should return the expected url form.' . $messageAdd ); - } - - public static function provideRemapCases() { - // Parameter signature: - // CSSMin::remap( $code, $local, $remote, $embedData = true ) - return array( - array( - 'Simple case', - array( 'foo { prop: url(bar.png); }', false, 'http://example.org', false ), - 'foo { prop: url(http://example.org/bar.png); }', - ), - array( - 'Without trailing slash', - array( 'foo { prop: url(../bar.png); }', false, 'http://example.org/quux', false ), - 'foo { prop: url(http://example.org/quux/../bar.png); }', - ), - array( - 'With trailing slash on remote (bug 27052)', - array( 'foo { prop: url(../bar.png); }', false, 'http://example.org/quux/', false ), - 'foo { prop: url(http://example.org/quux/../bar.png); }', - ), - array( - 'Guard against stripping double slashes from query', - array( 'foo { prop: url(bar.png?corge=//grault); }', false, 'http://example.org/quux/', false ), - 'foo { prop: url(http://example.org/quux/bar.png?corge=//grault); }', - ), - array( - 'Expand absolute paths', - array( 'foo { prop: url(/w/skin/images/bar.png); }', false, 'http://example.org/quux', false ), - 'foo { prop: url(http://doc.example.org/w/skin/images/bar.png); }', - ), - ); - } - - /** - * Seperated because they are currently broken (bug 35492) - * - * @group Broken - * @dataProvider provideStringCases - */ - public function testMinifyWithCSSStringValues( $code, $expectedOutput ) { - $this->testMinifyOutput( $code, $expectedOutput ); - } - - public static function provideStringCases() { - return array( - // String values should be respected - // - More than one space in a string value - array( 'foo { content: " "; }', 'foo{content:" "}' ), - // - Using a tab in a string value (turns into a space) - array( "foo { content: '\t'; }", "foo{content:'\t'}" ), - // - Using css-like syntax in string values - array( 'foo::after { content: "{;}"; position: absolute; }', 'foo::after{content:"{;}";position:absolute}' ), - ); - } -} diff --git a/tests/phpunit/includes/libs/GenericArrayObjectTest.php b/tests/phpunit/includes/libs/GenericArrayObjectTest.php deleted file mode 100644 index 7436c43c..00000000 --- a/tests/phpunit/includes/libs/GenericArrayObjectTest.php +++ /dev/null @@ -1,263 +0,0 @@ - - */ -abstract class GenericArrayObjectTest extends MediaWikiTestCase { - - /** - * Returns objects that can serve as elements in the concrete GenericArrayObject deriving class being tested. - * - * @since 1.20 - * - * @return array - */ - abstract public function elementInstancesProvider(); - - /** - * Returns the name of the concrete class being tested. - * - * @since 1.20 - * - * @return string - */ - abstract public function getInstanceClass(); - - /** - * Provides instances of the concrete class being tested. - * - * @since 1.20 - * - * @return array - */ - public function instanceProvider() { - $instances = array(); - - foreach ( $this->elementInstancesProvider() as $elementInstances ) { - $instances[] = $this->getNew( $elementInstances[0] ); - } - - return $this->arrayWrap( $instances ); - } - - /** - * @since 1.20 - * - * @param array $elements - * - * @return GenericArrayObject - */ - protected function getNew( array $elements = array() ) { - $class = $this->getInstanceClass(); - - return new $class( $elements ); - } - - /** - * @dataProvider elementInstancesProvider - * - * @since 1.20 - * - * @param array $elements - */ - public function testConstructor( array $elements ) { - $arrayObject = $this->getNew( $elements ); - - $this->assertEquals( count( $elements ), $arrayObject->count() ); - } - - /** - * @dataProvider elementInstancesProvider - * - * @since 1.20 - * - * @param array $elements - */ - public function testIsEmpty( array $elements ) { - $arrayObject = $this->getNew( $elements ); - - $this->assertEquals( $elements === array(), $arrayObject->isEmpty() ); - } - - /** - * @dataProvider instanceProvider - * - * @since 1.20 - * - * @param GenericArrayObject $list - */ - public function testUnset( GenericArrayObject $list ) { - if ( $list->isEmpty() ) { - $this->assertTrue( true ); // We cannot test unset if there are no elements - } else { - $offset = $list->getIterator()->key(); - $count = $list->count(); - $list->offsetUnset( $offset ); - $this->assertEquals( $count - 1, $list->count() ); - } - - if ( !$list->isEmpty() ) { - $offset = $list->getIterator()->key(); - $count = $list->count(); - unset( $list[$offset] ); - $this->assertEquals( $count - 1, $list->count() ); - } - } - - /** - * @dataProvider elementInstancesProvider - * - * @since 1.20 - * - * @param array $elements - */ - public function testAppend( array $elements ) { - $list = $this->getNew(); - - $listSize = count( $elements ); - - foreach ( $elements as $element ) { - $list->append( $element ); - } - - $this->assertEquals( $listSize, $list->count() ); - - $list = $this->getNew(); - - foreach ( $elements as $element ) { - $list[] = $element; - } - - $this->assertEquals( $listSize, $list->count() ); - - $this->checkTypeChecks( function ( GenericArrayObject $list, $element ) { - $list->append( $element ); - } ); - } - - /** - * @since 1.20 - * - * @param callback $function - */ - protected function checkTypeChecks( $function ) { - $excption = null; - $list = $this->getNew(); - - $elementClass = $list->getObjectType(); - - foreach ( array( 42, 'foo', array(), new stdClass(), 4.2 ) as $element ) { - $validValid = $element instanceof $elementClass; - - try { - call_user_func( $function, $list, $element ); - $valid = true; - } catch ( InvalidArgumentException $exception ) { - $valid = false; - } - - $this->assertEquals( - $validValid, - $valid, - 'Object of invalid type got successfully added to a GenericArrayObject' - ); - } - } - - /** - * @dataProvider elementInstancesProvider - * - * @since 1.20 - * - * @param array $elements - */ - public function testOffsetSet( array $elements ) { - if ( $elements === array() ) { - $this->assertTrue( true ); - - return; - } - - $list = $this->getNew(); - - $element = reset( $elements ); - $list->offsetSet( 42, $element ); - $this->assertEquals( $element, $list->offsetGet( 42 ) ); - - $list = $this->getNew(); - - $element = reset( $elements ); - $list['oHai'] = $element; - $this->assertEquals( $element, $list['oHai'] ); - - $list = $this->getNew(); - - $element = reset( $elements ); - $list->offsetSet( 9001, $element ); - $this->assertEquals( $element, $list[9001] ); - - $list = $this->getNew(); - - $element = reset( $elements ); - $list->offsetSet( null, $element ); - $this->assertEquals( $element, $list[0] ); - - $list = $this->getNew(); - $offset = 0; - - foreach ( $elements as $element ) { - $list->offsetSet( null, $element ); - $this->assertEquals( $element, $list[$offset++] ); - } - - $this->assertEquals( count( $elements ), $list->count() ); - - $this->checkTypeChecks( function ( GenericArrayObject $list, $element ) { - $list->offsetSet( mt_rand(), $element ); - } ); - } - - /** - * @dataProvider instanceProvider - * - * @since 1.21 - * - * @param GenericArrayObject $list - */ - public function testSerialization( GenericArrayObject $list ) { - $serialization = serialize( $list ); - $copy = unserialize( $serialization ); - - $this->assertEquals( $serialization, serialize( $copy ) ); - $this->assertEquals( count( $list ), count( $copy ) ); - - $list = $list->getArrayCopy(); - $copy = $copy->getArrayCopy(); - - $this->assertArrayEquals( $list, $copy, true, true ); - } -} diff --git a/tests/phpunit/includes/libs/IEUrlExtensionTest.php b/tests/phpunit/includes/libs/IEUrlExtensionTest.php deleted file mode 100644 index 66fe915a..00000000 --- a/tests/phpunit/includes/libs/IEUrlExtensionTest.php +++ /dev/null @@ -1,126 +0,0 @@ -assertEquals( - 'y', - IEUrlExtension::findIE6Extension( 'x.y' ), - 'Simple extension' - ); - } - - public function testSimpleNoExt() { - $this->assertEquals( - '', - IEUrlExtension::findIE6Extension( 'x' ), - 'No extension' - ); - } - - public function testEmpty() { - $this->assertEquals( - '', - IEUrlExtension::findIE6Extension( '' ), - 'Empty string' - ); - } - - public function testQuestionMark() { - $this->assertEquals( - '', - IEUrlExtension::findIE6Extension( '?' ), - 'Question mark only' - ); - } - - public function testExtQuestionMark() { - $this->assertEquals( - 'x', - IEUrlExtension::findIE6Extension( '.x?' ), - 'Extension then question mark' - ); - } - - public function testQuestionMarkExt() { - $this->assertEquals( - 'x', - IEUrlExtension::findIE6Extension( '?.x' ), - 'Question mark then extension' - ); - } - - public function testInvalidChar() { - $this->assertEquals( - '', - IEUrlExtension::findIE6Extension( '.x*' ), - 'Extension with invalid character' - ); - } - - public function testInvalidCharThenExtension() { - $this->assertEquals( - 'x', - IEUrlExtension::findIE6Extension( '*.x' ), - 'Invalid character followed by an extension' - ); - } - - public function testMultipleQuestionMarks() { - $this->assertEquals( - 'c', - IEUrlExtension::findIE6Extension( 'a?b?.c?.d?e?f' ), - 'Multiple question marks' - ); - } - - public function testExeException() { - $this->assertEquals( - 'd', - IEUrlExtension::findIE6Extension( 'a?b?.exe?.d?.e' ), - '.exe exception' - ); - } - - public function testExeException2() { - $this->assertEquals( - 'exe', - IEUrlExtension::findIE6Extension( 'a?b?.exe' ), - '.exe exception 2' - ); - } - - public function testHash() { - $this->assertEquals( - '', - IEUrlExtension::findIE6Extension( 'a#b.c' ), - 'Hash character preceding extension' - ); - } - - public function testHash2() { - $this->assertEquals( - '', - IEUrlExtension::findIE6Extension( 'a?#b.c' ), - 'Hash character preceding extension 2' - ); - } - - public function testDotAtEnd() { - $this->assertEquals( - '', - IEUrlExtension::findIE6Extension( '.' ), - 'Dot at end of string' - ); - } - - public function testTwoDots() { - $this->assertEquals( - 'z', - IEUrlExtension::findIE6Extension( 'x.y.z' ), - 'Two dots' - ); - } -} diff --git a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php deleted file mode 100644 index ab72e361..00000000 --- a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php +++ /dev/null @@ -1,170 +0,0 @@ - bar", "" ), - array( "--> Foo", "" ), - array( "x --> y", "x-->y" ), - - // Semicolon insertion - array( "(function(){return\nx;})", "(function(){return\nx;})" ), - array( "throw\nx;", "throw\nx;" ), - array( "while(p){continue\nx;}", "while(p){continue\nx;}" ), - array( "while(p){break\nx;}", "while(p){break\nx;}" ), - array( "var\nx;", "var x;" ), - array( "x\ny;", "x\ny;" ), - array( "x\n++y;", "x\n++y;" ), - array( "x\n!y;", "x\n!y;" ), - array( "x\n{y}", "x\n{y}" ), - array( "x\n+y;", "x+y;" ), - array( "x\n(y);", "x(y);" ), - array( "5.\nx;", "5.\nx;" ), - array( "0xFF.\nx;", "0xFF.x;" ), - array( "5.3.\nx;", "5.3.x;" ), - - // Semicolon insertion between an expression having an inline - // comment after it, and a statement on the next line (bug 27046). - array( "var a = this //foo bar \n for ( b = 0; c < d; b++ ) {}", "var a=this\nfor(b=0;cparse( $minified, 'minify-test.js', 1 ); - - $this->assertEquals( $expectedOutput, $minified, "Minified output should be in the form expected." ); - } - - public static function provideBug32548() { - return array( - array( - // This one gets interpreted all together by the prior code; - // no break at the 'E' happens. - '1.23456789E55', - ), - array( - // This one breaks under the bad code; splits between 'E' and '+' - '1.23456789E+5', - ), - array( - // This one breaks under the bad code; splits between 'E' and '-' - '1.23456789E-5', - ), - ); - } - - /** - * @dataProvider provideBug32548 - */ - public function testBug32548Exponent( $num ) { - // Long line breaking was being incorrectly done between the base and - // exponent part of a number, causing a syntax error. The line should - // instead break at the start of the number. - $prefix = 'var longVarName' . str_repeat( '_', 973 ) . '='; - $suffix = ',shortVarName=0;'; - - $input = $prefix . $num . $suffix; - $expected = $prefix . "\n" . $num . $suffix; - - $minified = JavaScriptMinifier::minify( $input ); - - $this->assertEquals( $expected, $minified, "Line breaks must not occur in middle of exponent" ); - } -} diff --git a/tests/phpunit/includes/logging/LogFormatterTest.php b/tests/phpunit/includes/logging/LogFormatterTest.php deleted file mode 100644 index e8ccf433..00000000 --- a/tests/phpunit/includes/logging/LogFormatterTest.php +++ /dev/null @@ -1,207 +0,0 @@ -setMwGlobals( array( - 'wgLogTypes' => array( 'phpunit' ), - 'wgLogActionsHandlers' => array( 'phpunit/test' => 'LogFormatter', - 'phpunit/param' => 'LogFormatter' ), - 'wgUser' => User::newFromName( 'Testuser' ), - 'wgExtensionMessagesFiles' => array( 'LogTests' => __DIR__ . '/LogTests.i18n.php' ), - ) ); - - $wgLang->getLocalisationCache()->recache( $wgLang->getCode() ); - - $this->user = User::newFromName( 'Testuser' ); - $this->title = Title::newMainPage(); - - $this->context = new RequestContext(); - $this->context->setUser( $this->user ); - $this->context->setTitle( $this->title ); - $this->context->setLanguage( $wgLang ); - } - - protected function tearDown() { - parent::tearDown(); - - global $wgLang; - $wgLang->getLocalisationCache()->recache( $wgLang->getCode() ); - } - - public function newLogEntry( $action, $params ) { - $logEntry = new ManualLogEntry( 'phpunit', $action ); - $logEntry->setPerformer( $this->user ); - $logEntry->setTarget( $this->title ); - $logEntry->setComment( 'A very good reason' ); - - $logEntry->setParameters( $params ); - - return $logEntry; - } - - public function testNormalLogParams() { - $entry = $this->newLogEntry( 'test', array() ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $formatter->setShowUserToolLinks( false ); - $paramsWithoutTools = $formatter->getMessageParametersForTesting(); - unset( $formatter->parsedParameters ); - - $formatter->setShowUserToolLinks( true ); - $paramsWithTools = $formatter->getMessageParametersForTesting(); - - $userLink = Linker::userLink( - $this->user->getId(), - $this->user->getName() - ); - - $userTools = Linker::userToolLinksRedContribs( - $this->user->getId(), - $this->user->getName(), - $this->user->getEditCount() - ); - - $titleLink = Linker::link( $this->title, null, array(), array() ); - - // $paramsWithoutTools and $paramsWithTools should be only different - // in index 0 - $this->assertEquals( $paramsWithoutTools[1], $paramsWithTools[1] ); - $this->assertEquals( $paramsWithoutTools[2], $paramsWithTools[2] ); - - $this->assertEquals( $userLink, $paramsWithoutTools[0]['raw'] ); - $this->assertEquals( $userLink . $userTools, $paramsWithTools[0]['raw'] ); - - $this->assertEquals( $this->user->getName(), $paramsWithoutTools[1] ); - - $this->assertEquals( $titleLink, $paramsWithoutTools[2]['raw'] ); - } - - public function testLogParamsTypeRaw() { - $params = array( '4:raw:raw' => Linker::link( $this->title, null, array(), array() ) ); - $expected = Linker::link( $this->title, null, array(), array() ); - - $entry = $this->newLogEntry( 'param', $params ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $logParam = $formatter->getActionText(); - - $this->assertEquals( $expected, $logParam ); - } - - public function testLogParamsTypeMsg() { - $params = array( '4:msg:msg' => 'log-description-phpunit' ); - $expected = wfMessage( 'log-description-phpunit' )->text(); - - $entry = $this->newLogEntry( 'param', $params ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $logParam = $formatter->getActionText(); - - $this->assertEquals( $expected, $logParam ); - } - - public function testLogParamsTypeMsgContent() { - $params = array( '4:msg-content:msgContent' => 'log-description-phpunit' ); - $expected = wfMessage( 'log-description-phpunit' )->inContentLanguage()->text(); - - $entry = $this->newLogEntry( 'param', $params ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $logParam = $formatter->getActionText(); - - $this->assertEquals( $expected, $logParam ); - } - - public function testLogParamsTypeNumber() { - global $wgLang; - - $params = array( '4:number:number' => 123456789 ); - $expected = $wgLang->formatNum( 123456789 ); - - $entry = $this->newLogEntry( 'param', $params ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $logParam = $formatter->getActionText(); - - $this->assertEquals( $expected, $logParam ); - } - - public function testLogParamsTypeUserLink() { - $params = array( '4:user-link:userLink' => $this->user->getName() ); - $expected = Linker::userLink( - $this->user->getId(), - $this->user->getName() - ); - - $entry = $this->newLogEntry( 'param', $params ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $logParam = $formatter->getActionText(); - - $this->assertEquals( $expected, $logParam ); - } - - public function testLogParamsTypeTitleLink() { - $params = array( '4:title-link:titleLink' => $this->title->getText() ); - $expected = Linker::link( $this->title, null, array(), array() ); - - $entry = $this->newLogEntry( 'param', $params ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $logParam = $formatter->getActionText(); - - $this->assertEquals( $expected, $logParam ); - } - - public function testLogParamsTypePlain() { - $params = array( '4:plain:plain' => 'Some plain text' ); - $expected = 'Some plain text'; - - $entry = $this->newLogEntry( 'param', $params ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $logParam = $formatter->getActionText(); - - $this->assertEquals( $expected, $logParam ); - } - - public function testLogComment() { - $entry = $this->newLogEntry( 'test', array() ); - $formatter = LogFormatter::newFromEntry( $entry ); - $formatter->setContext( $this->context ); - - $comment = ltrim( Linker::commentBlock( $entry->getComment() ) ); - - $this->assertEquals( $comment, $formatter->getComment() ); - } -} diff --git a/tests/phpunit/includes/logging/LogTests.i18n.php b/tests/phpunit/includes/logging/LogTests.i18n.php deleted file mode 100644 index 78787ba1..00000000 --- a/tests/phpunit/includes/logging/LogTests.i18n.php +++ /dev/null @@ -1,15 +0,0 @@ - 'PHPUnit-log', - 'log-description-phpunit' => 'Log for PHPUnit-tests', - 'logentry-phpunit-test' => '$1 {{GENDER:$2|tests}} with page $3', - 'logentry-phpunit-param' => '$4', -); diff --git a/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php b/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php deleted file mode 100644 index a0e63a8a..00000000 --- a/tests/phpunit/includes/media/BitmapMetadataHandlerTest.php +++ /dev/null @@ -1,167 +0,0 @@ -setMwGlobals( 'wgShowEXIF', false ); - - $this->filePath = __DIR__ . '/../../data/media/'; - } - - /** - * Test if having conflicting metadata values from different - * types of metadata, that the right one takes precedence. - * - * Basically the file has IPTC and XMP metadata, the - * IPTC should override the XMP, except for the multilingual - * translation (to en) where XMP should win. - * @covers BitmapMetadataHandler::Jpeg - */ - public function testMultilingualCascade() { - if ( !extension_loaded( 'exif' ) ) { - $this->markTestSkipped( "This test needs the exif extension." ); - } - if ( !extension_loaded( 'xml' ) ) { - $this->markTestSkipped( "This test needs the xml extension." ); - } - - $this->setMwGlobals( 'wgShowEXIF', true ); - - $meta = BitmapMetadataHandler::Jpeg( $this->filePath . - '/Xmp-exif-multilingual_test.jpg' ); - - $expected = array( - 'x-default' => 'right(iptc)', - 'en' => 'right translation', - '_type' => 'lang' - ); - - $this->assertArrayHasKey( 'ImageDescription', $meta, - 'Did not extract any ImageDescription info?!' ); - - $this->assertEquals( $expected, $meta['ImageDescription'] ); - } - - /** - * Test for jpeg comments are being handled by - * BitmapMetadataHandler correctly. - * - * There's more extensive tests of comment extraction in - * JpegMetadataExtractorTests.php - * @covers BitmapMetadataHandler::Jpeg - */ - public function testJpegComment() { - $meta = BitmapMetadataHandler::Jpeg( $this->filePath . - 'jpeg-comment-utf.jpg' ); - - $this->assertEquals( 'UTF-8 JPEG Comment — ¼', - $meta['JPEGFileComment'][0] ); - } - - /** - * Make sure a bad iptc block doesn't stop the other metadata - * from being extracted. - * @covers BitmapMetadataHandler::Jpeg - */ - public function testBadIPTC() { - $meta = BitmapMetadataHandler::Jpeg( $this->filePath . - 'iptc-invalid-psir.jpg' ); - $this->assertEquals( 'Created with GIMP', $meta['JPEGFileComment'][0] ); - } - - /** - * @covers BitmapMetadataHandler::Jpeg - */ - public function testIPTCDates() { - $meta = BitmapMetadataHandler::Jpeg( $this->filePath . - 'iptc-timetest.jpg' ); - - $this->assertEquals( '2020:07:14 01:36:05', $meta['DateTimeDigitized'] ); - $this->assertEquals( '1997:03:02 00:01:02', $meta['DateTimeOriginal'] ); - } - - /** - * File has an invalid time (+ one valid but really weird time) - * that shouldn't be included - * @covers BitmapMetadataHandler::Jpeg - */ - public function testIPTCDatesInvalid() { - $meta = BitmapMetadataHandler::Jpeg( $this->filePath . - 'iptc-timetest-invalid.jpg' ); - - $this->assertEquals( '1845:03:02 00:01:02', $meta['DateTimeOriginal'] ); - $this->assertFalse( isset( $meta['DateTimeDigitized'] ) ); - } - - /** - * XMP data should take priority over iptc data - * when hash has been updated, but not when - * the hash is wrong. - * @covers BitmapMetadataHandler::addMetadata - * @covers BitmapMetadataHandler::getMetadataArray - */ - public function testMerging() { - $merger = new BitmapMetadataHandler(); - $merger->addMetadata( array( 'foo' => 'xmp' ), 'xmp-general' ); - $merger->addMetadata( array( 'bar' => 'xmp' ), 'xmp-general' ); - $merger->addMetadata( array( 'baz' => 'xmp' ), 'xmp-general' ); - $merger->addMetadata( array( 'fred' => 'xmp' ), 'xmp-general' ); - $merger->addMetadata( array( 'foo' => 'iptc (hash)' ), 'iptc-good-hash' ); - $merger->addMetadata( array( 'bar' => 'iptc (bad hash)' ), 'iptc-bad-hash' ); - $merger->addMetadata( array( 'baz' => 'iptc (bad hash)' ), 'iptc-bad-hash' ); - $merger->addMetadata( array( 'fred' => 'iptc (no hash)' ), 'iptc-no-hash' ); - $merger->addMetadata( array( 'baz' => 'exif' ), 'exif' ); - - $actual = $merger->getMetadataArray(); - $expected = array( - 'foo' => 'xmp', - 'bar' => 'iptc (bad hash)', - 'baz' => 'exif', - 'fred' => 'xmp', - ); - $this->assertEquals( $expected, $actual ); - } - - /** - * @covers BitmapMetadataHandler::png - */ - public function testPNGXMP() { - if ( !extension_loaded( 'xml' ) ) { - $this->markTestSkipped( "This test needs the xml extension." ); - } - $handler = new BitmapMetadataHandler(); - $result = $handler->png( $this->filePath . 'xmp.png' ); - $expected = array( - 'frameCount' => 0, - 'loopCount' => 1, - 'duration' => 0, - 'bitDepth' => 1, - 'colorType' => 'index-coloured', - 'metadata' => array( - 'SerialNumber' => '123456789', - '_MW_PNG_VERSION' => 1, - ), - ); - $this->assertEquals( $expected, $result ); - } - - /** - * @covers BitmapMetadataHandler::png - */ - public function testPNGNative() { - $handler = new BitmapMetadataHandler(); - $result = $handler->png( $this->filePath . 'Png-native-test.png' ); - $expected = 'http://example.com/url'; - $this->assertEquals( $expected, $result['metadata']['Identifier']['x-default'] ); - } - - /** - * @covers BitmapMetadataHandler::getTiffByteOrder - */ - public function testTiffByteOrder() { - $handler = new BitmapMetadataHandler(); - $res = $handler->getTiffByteOrder( $this->filePath . 'test.tiff' ); - $this->assertEquals( 'LE', $res ); - } -} diff --git a/tests/phpunit/includes/media/BitmapScalingTest.php b/tests/phpunit/includes/media/BitmapScalingTest.php deleted file mode 100644 index 9395b660..00000000 --- a/tests/phpunit/includes/media/BitmapScalingTest.php +++ /dev/null @@ -1,137 +0,0 @@ -setMwGlobals( array( - 'wgMaxImageArea' => 1.25e7, // 3500x3500 - 'wgCustomConvertCommand' => 'dummy', // Set so that we don't get client side rendering - ) ); - } - - /** - * @dataProvider provideNormaliseParams - * @covers BitmapHandler::normaliseParams - */ - public function testNormaliseParams( $fileDimensions, $expectedParams, $params, $msg ) { - $file = new FakeDimensionFile( $fileDimensions ); - $handler = new BitmapHandler; - $valid = $handler->normaliseParams( $file, $params ); - $this->assertTrue( $valid ); - $this->assertEquals( $expectedParams, $params, $msg ); - } - - public static function provideNormaliseParams() { - return array( - /* Regular resize operations */ - array( - array( 1024, 768 ), - array( - 'width' => 512, 'height' => 384, - 'physicalWidth' => 512, 'physicalHeight' => 384, - 'page' => 1, - ), - array( 'width' => 512 ), - 'Resizing with width set', - ), - array( - array( 1024, 768 ), - array( - 'width' => 512, 'height' => 384, - 'physicalWidth' => 512, 'physicalHeight' => 384, - 'page' => 1, - ), - array( 'width' => 512, 'height' => 768 ), - 'Resizing with height set too high', - ), - array( - array( 1024, 768 ), - array( - 'width' => 512, 'height' => 384, - 'physicalWidth' => 512, 'physicalHeight' => 384, - 'page' => 1, - ), - array( 'width' => 1024, 'height' => 384 ), - 'Resizing with height set', - ), - - /* Very tall images */ - array( - array( 1000, 100 ), - array( - 'width' => 5, 'height' => 1, - 'physicalWidth' => 5, 'physicalHeight' => 1, - 'page' => 1, - ), - array( 'width' => 5 ), - 'Very wide image', - ), - - array( - array( 100, 1000 ), - array( - 'width' => 1, 'height' => 10, - 'physicalWidth' => 1, 'physicalHeight' => 10, - 'page' => 1, - ), - array( 'width' => 1 ), - 'Very high image', - ), - array( - array( 100, 1000 ), - array( - 'width' => 1, 'height' => 5, - 'physicalWidth' => 1, 'physicalHeight' => 10, - 'page' => 1, - ), - array( 'width' => 10, 'height' => 5 ), - 'Very high image with height set', - ), - /* Max image area */ - array( - array( 4000, 4000 ), - array( - 'width' => 5000, 'height' => 5000, - 'physicalWidth' => 4000, 'physicalHeight' => 4000, - 'page' => 1, - ), - array( 'width' => 5000 ), - 'Bigger than max image size but doesn\'t need scaling', - ), - ); - } - - /** - * @covers BitmapHandler::doTransform - */ - public function testTooBigImage() { - $file = new FakeDimensionFile( array( 4000, 4000 ) ); - $handler = new BitmapHandler; - $params = array( 'width' => '3700' ); // Still bigger than max size. - $this->assertEquals( 'TransformParameterError', - get_class( $handler->doTransform( $file, 'dummy path', '', $params ) ) ); - } - - /** - * @covers BitmapHandler::doTransform - */ - public function testTooBigMustRenderImage() { - $file = new FakeDimensionFile( array( 4000, 4000 ) ); - $file->mustRender = true; - $handler = new BitmapHandler; - $params = array( 'width' => '5000' ); // Still bigger than max size. - $this->assertEquals( 'TransformParameterError', - get_class( $handler->doTransform( $file, 'dummy path', '', $params ) ) ); - } - - /** - * @covers BitmapHandler::getImageArea - */ - public function testImageArea() { - $file = new FakeDimensionFile( array( 7, 9 ) ); - $handler = new BitmapHandler; - $this->assertEquals( 63, $handler->getImageArea( $file ) ); - } -} diff --git a/tests/phpunit/includes/media/ExifBitmapTest.php b/tests/phpunit/includes/media/ExifBitmapTest.php deleted file mode 100644 index a2e0eb62..00000000 --- a/tests/phpunit/includes/media/ExifBitmapTest.php +++ /dev/null @@ -1,139 +0,0 @@ -markTestSkipped( "This test needs the exif extension." ); - } - - $this->setMwGlobals( 'wgShowEXIF', true ); - - $this->handler = new ExifBitmapHandler; - - } - - /** - * @covers ExifBitmapHandler::isMetadataValid - */ - public function testIsOldBroken() { - $res = $this->handler->isMetadataValid( null, ExifBitmapHandler::OLD_BROKEN_FILE ); - $this->assertEquals( ExifBitmapHandler::METADATA_COMPATIBLE, $res ); - } - - /** - * @covers ExifBitmapHandler::isMetadataValid - */ - public function testIsBrokenFile() { - $res = $this->handler->isMetadataValid( null, ExifBitmapHandler::BROKEN_FILE ); - $this->assertEquals( ExifBitmapHandler::METADATA_GOOD, $res ); - } - - /** - * @covers ExifBitmapHandler::isMetadataValid - */ - public function testIsInvalid() { - $res = $this->handler->isMetadataValid( null, 'Something Invalid Here.' ); - $this->assertEquals( ExifBitmapHandler::METADATA_BAD, $res ); - } - - /** - * @covers ExifBitmapHandler::isMetadataValid - */ - public function testGoodMetadata() { - $meta = 'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:2;}'; - $res = $this->handler->isMetadataValid( null, $meta ); - $this->assertEquals( ExifBitmapHandler::METADATA_GOOD, $res ); - } - - /** - * @covers ExifBitmapHandler::isMetadataValid - */ - public function testIsOldGood() { - $meta = 'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:1;}'; - $res = $this->handler->isMetadataValid( null, $meta ); - $this->assertEquals( ExifBitmapHandler::METADATA_COMPATIBLE, $res ); - } - - /** - * Handle metadata from paged tiff handler (gotten via instant commons) gracefully. - * @covers ExifBitmapHandler::isMetadataValid - */ - public function testPagedTiffHandledGracefully() { - $meta = 'a:6:{s:9:"page_data";a:1:{i:1;a:5:{s:5:"width";i:643;s:6:"height";i:448;s:5:"alpha";s:4:"true";s:4:"page";i:1;s:6:"pixels";i:288064;}}s:10:"page_count";i:1;s:10:"first_page";i:1;s:9:"last_page";i:1;s:4:"exif";a:9:{s:10:"ImageWidth";i:643;s:11:"ImageLength";i:448;s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:4;s:12:"RowsPerStrip";i:50;s:19:"PlanarConfiguration";i:1;s:22:"MEDIAWIKI_EXIF_VERSION";i:1;}s:21:"TIFF_METADATA_VERSION";s:3:"1.4";}'; - $res = $this->handler->isMetadataValid( null, $meta ); - $this->assertEquals( ExifBitmapHandler::METADATA_BAD, $res ); - } - - /** - * @covers ExifBitmapHandler::convertMetadataVersion - */ - public function testConvertMetadataLatest() { - $metadata = array( - 'foo' => array( 'First', 'Second', '_type' => 'ol' ), - 'MEDIAWIKI_EXIF_VERSION' => 2 - ); - $res = $this->handler->convertMetadataVersion( $metadata, 2 ); - $this->assertEquals( $metadata, $res ); - } - - /** - * @covers ExifBitmapHandler::convertMetadataVersion - */ - public function testConvertMetadataToOld() { - $metadata = array( - 'foo' => array( 'First', 'Second', '_type' => 'ol' ), - 'bar' => array( 'First', 'Second', '_type' => 'ul' ), - 'baz' => array( 'First', 'Second' ), - 'fred' => 'Single', - 'MEDIAWIKI_EXIF_VERSION' => 2, - ); - $expected = array( - 'foo' => "\n#First\n#Second", - 'bar' => "\n*First\n*Second", - 'baz' => "\n*First\n*Second", - 'fred' => 'Single', - 'MEDIAWIKI_EXIF_VERSION' => 1, - ); - $res = $this->handler->convertMetadataVersion( $metadata, 1 ); - $this->assertEquals( $expected, $res ); - } - - /** - * @covers ExifBitmapHandler::convertMetadataVersion - */ - public function testConvertMetadataSoftware() { - $metadata = array( - 'Software' => array( array( 'GIMP', '1.1' ) ), - 'MEDIAWIKI_EXIF_VERSION' => 2, - ); - $expected = array( - 'Software' => 'GIMP (Version 1.1)', - 'MEDIAWIKI_EXIF_VERSION' => 1, - ); - $res = $this->handler->convertMetadataVersion( $metadata, 1 ); - $this->assertEquals( $expected, $res ); - } - - /** - * @covers ExifBitmapHandler::convertMetadataVersion - */ - public function testConvertMetadataSoftwareNormal() { - $metadata = array( - 'Software' => array( "GIMP 1.2", "vim" ), - 'MEDIAWIKI_EXIF_VERSION' => 2, - ); - $expected = array( - 'Software' => "\n*GIMP 1.2\n*vim", - 'MEDIAWIKI_EXIF_VERSION' => 1, - ); - $res = $this->handler->convertMetadataVersion( $metadata, 1 ); - $this->assertEquals( $expected, $res ); - } -} diff --git a/tests/phpunit/includes/media/ExifRotationTest.php b/tests/phpunit/includes/media/ExifRotationTest.php deleted file mode 100644 index 64276d92..00000000 --- a/tests/phpunit/includes/media/ExifRotationTest.php +++ /dev/null @@ -1,248 +0,0 @@ -markTestSkipped( "This test needs the exif extension." ); - } - - $this->handler = new BitmapHandler(); - $filePath = __DIR__ . '/../../data/media'; - - $tmpDir = $this->getNewTempDirectory(); - - $this->repo = new FSRepo( array( - 'name' => 'temp', - 'url' => 'http://localhost/thumbtest', - 'backend' => new FSFileBackend( array( - 'name' => 'localtesting', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array( 'temp-thumb' => $tmpDir, 'data' => $filePath ) - ) ) - ) ); - - $this->setMwGlobals( array( - 'wgShowEXIF' => true, - 'wgEnableAutoRotation' => true, - ) ); - } - - /** - * @dataProvider provideFiles - */ - public function testMetadata( $name, $type, $info ) { - if ( !BitmapHandler::canRotate() ) { - $this->markTestSkipped( "This test needs a rasterizer that can auto-rotate." ); - } - $file = $this->dataFile( $name, $type ); - $this->assertEquals( $info['width'], $file->getWidth(), "$name: width check" ); - $this->assertEquals( $info['height'], $file->getHeight(), "$name: height check" ); - } - - /** - * - * @dataProvider provideFiles - */ - public function testRotationRendering( $name, $type, $info, $thumbs ) { - if ( !BitmapHandler::canRotate() ) { - $this->markTestSkipped( "This test needs a rasterizer that can auto-rotate." ); - } - foreach ( $thumbs as $size => $out ) { - if ( preg_match( '/^(\d+)px$/', $size, $matches ) ) { - $params = array( - 'width' => $matches[1], - ); - } elseif ( preg_match( '/^(\d+)x(\d+)px$/', $size, $matches ) ) { - $params = array( - 'width' => $matches[1], - 'height' => $matches[2] - ); - } else { - throw new MWException( 'bogus test data format ' . $size ); - } - - $file = $this->dataFile( $name, $type ); - $thumb = $file->transform( $params, File::RENDER_NOW | File::RENDER_FORCE ); - - $this->assertEquals( $out[0], $thumb->getWidth(), "$name: thumb reported width check for $size" ); - $this->assertEquals( $out[1], $thumb->getHeight(), "$name: thumb reported height check for $size" ); - - $gis = getimagesize( $thumb->getLocalCopyPath() ); - if ( $out[0] > $info['width'] ) { - // Physical image won't be scaled bigger than the original. - $this->assertEquals( $info['width'], $gis[0], "$name: thumb actual width check for $size" ); - $this->assertEquals( $info['height'], $gis[1], "$name: thumb actual height check for $size" ); - } else { - $this->assertEquals( $out[0], $gis[0], "$name: thumb actual width check for $size" ); - $this->assertEquals( $out[1], $gis[1], "$name: thumb actual height check for $size" ); - } - } - } - - /* Utility function */ - private function dataFile( $name, $type ) { - return new UnregisteredLocalFile( false, $this->repo, - "mwstore://localtesting/data/$name", $type ); - } - - public static function provideFiles() { - return array( - array( - 'landscape-plain.jpg', - 'image/jpeg', - array( - 'width' => 1024, - 'height' => 768, - ), - array( - '800x600px' => array( 800, 600 ), - '9999x800px' => array( 1067, 800 ), - '800px' => array( 800, 600 ), - '600px' => array( 600, 450 ), - ) - ), - array( - 'portrait-rotated.jpg', - 'image/jpeg', - array( - 'width' => 768, // as rotated - 'height' => 1024, // as rotated - ), - array( - '800x600px' => array( 450, 600 ), - '9999x800px' => array( 600, 800 ), - '800px' => array( 800, 1067 ), - '600px' => array( 600, 800 ), - ) - ) - ); - } - - /** - * Same as before, but with auto-rotation disabled. - * @dataProvider provideFilesNoAutoRotate - */ - public function testMetadataNoAutoRotate( $name, $type, $info ) { - $this->setMwGlobals( 'wgEnableAutoRotation', false ); - - $file = $this->dataFile( $name, $type ); - $this->assertEquals( $info['width'], $file->getWidth(), "$name: width check" ); - $this->assertEquals( $info['height'], $file->getHeight(), "$name: height check" ); - } - - /** - * - * @dataProvider provideFilesNoAutoRotate - */ - public function testRotationRenderingNoAutoRotate( $name, $type, $info, $thumbs ) { - $this->setMwGlobals( 'wgEnableAutoRotation', false ); - - foreach ( $thumbs as $size => $out ) { - if ( preg_match( '/^(\d+)px$/', $size, $matches ) ) { - $params = array( - 'width' => $matches[1], - ); - } elseif ( preg_match( '/^(\d+)x(\d+)px$/', $size, $matches ) ) { - $params = array( - 'width' => $matches[1], - 'height' => $matches[2] - ); - } else { - throw new MWException( 'bogus test data format ' . $size ); - } - - $file = $this->dataFile( $name, $type ); - $thumb = $file->transform( $params, File::RENDER_NOW | File::RENDER_FORCE ); - - $this->assertEquals( $out[0], $thumb->getWidth(), "$name: thumb reported width check for $size" ); - $this->assertEquals( $out[1], $thumb->getHeight(), "$name: thumb reported height check for $size" ); - - $gis = getimagesize( $thumb->getLocalCopyPath() ); - if ( $out[0] > $info['width'] ) { - // Physical image won't be scaled bigger than the original. - $this->assertEquals( $info['width'], $gis[0], "$name: thumb actual width check for $size" ); - $this->assertEquals( $info['height'], $gis[1], "$name: thumb actual height check for $size" ); - } else { - $this->assertEquals( $out[0], $gis[0], "$name: thumb actual width check for $size" ); - $this->assertEquals( $out[1], $gis[1], "$name: thumb actual height check for $size" ); - } - } - } - - public static function provideFilesNoAutoRotate() { - return array( - array( - 'landscape-plain.jpg', - 'image/jpeg', - array( - 'width' => 1024, - 'height' => 768, - ), - array( - '800x600px' => array( 800, 600 ), - '9999x800px' => array( 1067, 800 ), - '800px' => array( 800, 600 ), - '600px' => array( 600, 450 ), - ) - ), - array( - 'portrait-rotated.jpg', - 'image/jpeg', - array( - 'width' => 1024, // since not rotated - 'height' => 768, // since not rotated - ), - array( - '800x600px' => array( 800, 600 ), - '9999x800px' => array( 1067, 800 ), - '800px' => array( 800, 600 ), - '600px' => array( 600, 450 ), - ) - ) - ); - } - - - const TEST_WIDTH = 100; - const TEST_HEIGHT = 200; - - /** - * @dataProvider provideBitmapExtractPreRotationDimensions - */ - public function testBitmapExtractPreRotationDimensions( $rotation, $expected ) { - $result = $this->handler->extractPreRotationDimensions( array( - 'physicalWidth' => self::TEST_WIDTH, - 'physicalHeight' => self::TEST_HEIGHT, - ), $rotation ); - $this->assertEquals( $expected, $result ); - } - - public static function provideBitmapExtractPreRotationDimensions() { - return array( - array( - 0, - array( self::TEST_WIDTH, self::TEST_HEIGHT ) - ), - array( - 90, - array( self::TEST_HEIGHT, self::TEST_WIDTH ) - ), - array( - 180, - array( self::TEST_WIDTH, self::TEST_HEIGHT ) - ), - array( - 270, - array( self::TEST_HEIGHT, self::TEST_WIDTH ) - ), - ); - } -} diff --git a/tests/phpunit/includes/media/ExifTest.php b/tests/phpunit/includes/media/ExifTest.php deleted file mode 100644 index dea36b03..00000000 --- a/tests/phpunit/includes/media/ExifTest.php +++ /dev/null @@ -1,46 +0,0 @@ -markTestSkipped( "This test needs the exif extension." ); - } - - $this->mediaPath = __DIR__ . '/../../data/media/'; - - - - $this->setMwGlobals( 'wgShowEXIF', true ); - } - - public function testGPSExtraction() { - $filename = $this->mediaPath . 'exif-gps.jpg'; - $seg = JpegMetadataExtractor::segmentSplitter( $filename ); - $exif = new Exif( $filename, $seg['byteOrder'] ); - $data = $exif->getFilteredData(); - $expected = array( - 'GPSLatitude' => 88.5180555556, - 'GPSLongitude' => -21.12357, - 'GPSAltitude' => -3.141592653, - 'GPSDOP' => '5/1', - 'GPSVersionID' => '2.2.0.0', - ); - $this->assertEquals( $expected, $data, '', 0.0000000001 ); - } - - public function testUnicodeUserComment() { - $filename = $this->mediaPath . 'exif-user-comment.jpg'; - $seg = JpegMetadataExtractor::segmentSplitter( $filename ); - $exif = new Exif( $filename, $seg['byteOrder'] ); - $data = $exif->getFilteredData(); - - $expected = array( - 'UserComment' => 'test⁔comment' - ); - $this->assertEquals( $expected, $data ); - } -} diff --git a/tests/phpunit/includes/media/FakeDimensionFile.php b/tests/phpunit/includes/media/FakeDimensionFile.php deleted file mode 100644 index 7926000b..00000000 --- a/tests/phpunit/includes/media/FakeDimensionFile.php +++ /dev/null @@ -1,28 +0,0 @@ -dimensions = $dimensions; - } - - public function getWidth( $page = 1 ) { - return $this->dimensions[0]; - } - - public function getHeight( $page = 1 ) { - return $this->dimensions[1]; - } - - public function mustRender() { - return $this->mustRender; - } - - public function getPath() { - return ''; - } -} \ No newline at end of file diff --git a/tests/phpunit/includes/media/FormatMetadataTest.php b/tests/phpunit/includes/media/FormatMetadataTest.php deleted file mode 100644 index a073e4ca..00000000 --- a/tests/phpunit/includes/media/FormatMetadataTest.php +++ /dev/null @@ -1,59 +0,0 @@ -markTestSkipped( "This test needs the exif extension." ); - } - $filePath = __DIR__ . '/../../data/media'; - $this->backend = new FSFileBackend( array( - 'name' => 'localtesting', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array( 'data' => $filePath ) - ) ); - $this->repo = new FSRepo( array( - 'name' => 'temp', - 'url' => 'http://localhost/thumbtest', - 'backend' => $this->backend - ) ); - - $this->setMwGlobals( 'wgShowEXIF', true ); - } - - public function testInvalidDate() { - $file = $this->dataFile( 'broken_exif_date.jpg', 'image/jpeg' ); - - // Throws an error if bug hit - $meta = $file->formatMetadata(); - $this->assertNotEquals( false, $meta, 'Valid metadata extracted' ); - - // Find date exif entry - $this->assertArrayHasKey( 'visible', $meta ); - $dateIndex = null; - foreach ( $meta['visible'] as $i => $data ) { - if ( $data['id'] == 'exif-datetimeoriginal' ) { - $dateIndex = $i; - } - } - $this->assertNotNull( $dateIndex, 'Date entry exists in metadata' ); - $this->assertEquals( '0000:01:00 00:02:27', - $meta['visible'][$dateIndex]['value'], - 'File with invalid date metadata (bug 29471)' ); - } - - private function dataFile( $name, $type ) { - return new UnregisteredLocalFile( false, $this->repo, - "mwstore://localtesting/data/$name", $type ); - } -} diff --git a/tests/phpunit/includes/media/GIFMetadataExtractorTest.php b/tests/phpunit/includes/media/GIFMetadataExtractorTest.php deleted file mode 100644 index 9e3f9244..00000000 --- a/tests/phpunit/includes/media/GIFMetadataExtractorTest.php +++ /dev/null @@ -1,107 +0,0 @@ -mediaPath = __DIR__ . '/../../data/media/'; - } - - /** - * Put in a file, and see if the metadata coming out is as expected. - * @param $filename String - * @param $expected Array The extracted metadata. - * @dataProvider provideGetMetadata - * @covers GIFMetadataExtractor::getMetadata - */ - public function testGetMetadata( $filename, $expected ) { - $actual = GIFMetadataExtractor::getMetadata( $this->mediaPath . $filename ); - $this->assertEquals( $expected, $actual ); - } - - public static function provideGetMetadata() { - - $xmpNugget = << - - - - - The interwebs - - - - Bawolff - - - A file to test GIF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -EOF; - $xmpNugget = str_replace( "\r", '', $xmpNugget ); // Windows compat - - return array( - array( - 'nonanimated.gif', - array( - 'comment' => array( 'GIF test file ⁕ Created with GIMP' ), - 'duration' => 0.1, - 'frameCount' => 1, - 'looped' => false, - 'xmp' => '', - ) - ), - array( - 'animated.gif', - array( - 'comment' => array( 'GIF test file . Created with GIMP' ), - 'duration' => 2.4, - 'frameCount' => 4, - 'looped' => true, - 'xmp' => '', - ) - ), - - array( - 'animated-xmp.gif', - array( - 'xmp' => $xmpNugget, - 'duration' => 2.4, - 'frameCount' => 4, - 'looped' => true, - 'comment' => array( 'GIƒ·test·file' ), - ) - ), - ); - } -} diff --git a/tests/phpunit/includes/media/GIFTest.php b/tests/phpunit/includes/media/GIFTest.php deleted file mode 100644 index c8e729c8..00000000 --- a/tests/phpunit/includes/media/GIFTest.php +++ /dev/null @@ -1,120 +0,0 @@ -filePath = __DIR__ . '/../../data/media'; - $this->backend = new FSFileBackend( array( - 'name' => 'localtesting', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array( 'data' => $this->filePath ) - ) ); - $this->repo = new FSRepo( array( - 'name' => 'temp', - 'url' => 'http://localhost/thumbtest', - 'backend' => $this->backend - ) ); - $this->handler = new GIFHandler(); - } - - /** - * @covers GIFHandler::getMetadata - */ - public function testInvalidFile() { - $res = $this->handler->getMetadata( null, $this->filePath . '/README' ); - $this->assertEquals( GIFHandler::BROKEN_FILE, $res ); - } - - /** - * @param $filename String basename of the file to check - * @param $expected boolean Expected result. - * @dataProvider provideIsAnimated - * @covers GIFHandler::isAnimatedImage - */ - public function testIsAnimanted( $filename, $expected ) { - $file = $this->dataFile( $filename, 'image/gif' ); - $actual = $this->handler->isAnimatedImage( $file ); - $this->assertEquals( $expected, $actual ); - } - - public static function provideIsAnimated() { - return array( - array( 'animated.gif', true ), - array( 'nonanimated.gif', false ), - ); - } - - /** - * @param $filename String - * @param $expected Integer Total image area - * @dataProvider provideGetImageArea - * @covers GIFHandler::getImageArea - */ - public function testGetImageArea( $filename, $expected ) { - $file = $this->dataFile( $filename, 'image/gif' ); - $actual = $this->handler->getImageArea( $file, $file->getWidth(), $file->getHeight() ); - $this->assertEquals( $expected, $actual ); - } - - public static function provideGetImageArea() { - return array( - array( 'animated.gif', 5400 ), - array( 'nonanimated.gif', 1350 ), - ); - } - - /** - * @param $metadata String Serialized metadata - * @param $expected Integer One of the class constants of GIFHandler - * @dataProvider provideIsMetadataValid - * @covers GIFHandler::isMetadataValid - */ - public function testIsMetadataValid( $metadata, $expected ) { - $actual = $this->handler->isMetadataValid( null, $metadata ); - $this->assertEquals( $expected, $actual ); - } - - public static function provideIsMetadataValid() { - return array( - array( GIFHandler::BROKEN_FILE, GIFHandler::METADATA_GOOD ), - array( '', GIFHandler::METADATA_BAD ), - array( null, GIFHandler::METADATA_BAD ), - array( 'Something invalid!', GIFHandler::METADATA_BAD ), - array( 'a:4:{s:10:"frameCount";i:1;s:6:"looped";b:0;s:8:"duration";d:0.1000000000000000055511151231257827021181583404541015625;s:8:"metadata";a:2:{s:14:"GIFFileComment";a:1:{i:0;s:35:"GIF test file ⁕ Created with GIMP";}s:15:"_MW_GIF_VERSION";i:1;}}', GIFHandler::METADATA_GOOD ), - ); - } - - /** - * @param $filename String - * @param $expected String Serialized array - * @dataProvider provideGetMetadata - * @covers GIFHandler::getMetadata - */ - public function testGetMetadata( $filename, $expected ) { - $file = $this->dataFile( $filename, 'image/gif' ); - $actual = $this->handler->getMetadata( $file, "$this->filePath/$filename" ); - $this->assertEquals( unserialize( $expected ), unserialize( $actual ) ); - } - - public static function provideGetMetadata() { - return array( - array( 'nonanimated.gif', 'a:4:{s:10:"frameCount";i:1;s:6:"looped";b:0;s:8:"duration";d:0.1000000000000000055511151231257827021181583404541015625;s:8:"metadata";a:2:{s:14:"GIFFileComment";a:1:{i:0;s:35:"GIF test file ⁕ Created with GIMP";}s:15:"_MW_GIF_VERSION";i:1;}}' ), - array( 'animated-xmp.gif', 'a:4:{s:10:"frameCount";i:4;s:6:"looped";b:1;s:8:"duration";d:2.399999999999999911182158029987476766109466552734375;s:8:"metadata";a:5:{s:6:"Artist";s:7:"Bawolff";s:16:"ImageDescription";a:2:{s:9:"x-default";s:18:"A file to test GIF";s:5:"_type";s:4:"lang";}s:15:"SublocationDest";s:13:"The interwebs";s:14:"GIFFileComment";a:1:{i:0;s:16:"GIƒ·test·file";}s:15:"_MW_GIF_VERSION";i:1;}}' ), - ); - } - - private function dataFile( $name, $type ) { - return new UnregisteredLocalFile( false, $this->repo, - "mwstore://localtesting/data/$name", $type ); - } -} diff --git a/tests/phpunit/includes/media/IPTCTest.php b/tests/phpunit/includes/media/IPTCTest.php deleted file mode 100644 index 81c1d287..00000000 --- a/tests/phpunit/includes/media/IPTCTest.php +++ /dev/null @@ -1,81 +0,0 @@ -assertEquals( 'UTF-8', $res ); - } - - /** - * @covers IPTC::Parse - */ - public function testIPTCParseNoCharset88591() { - // basically IPTC for keyword with value of 0xBC which is 1/4 in iso-8859-1 - // This data doesn't specify a charset. We're supposed to guess - // (which basically means utf-8 if valid, windows 1252 (iso 8859-1) if not) - $iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x06\x1c\x02\x19\x00\x01\xBC"; - $res = IPTC::Parse( $iptcData ); - $this->assertEquals( array( '¼' ), $res['Keywords'] ); - } - - /** - * @covers IPTC::Parse - */ - public function testIPTCParseNoCharset88591b() { - /* This one contains a sequence that's valid iso 8859-1 but not valid utf8 */ - /* \xC3 = Ã, \xB8 = ¸ */ - $iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x09\x1c\x02\x19\x00\x04\xC3\xC3\xC3\xB8"; - $res = IPTC::Parse( $iptcData ); - $this->assertEquals( array( 'ÃÃø' ), $res['Keywords'] ); - } - - /** - * Same as testIPTCParseNoCharset88591b, but forcing the charset to utf-8. - * What should happen is the first "\xC3\xC3" should be dropped as invalid, - * leaving \xC3\xB8, which is ø - * @covers IPTC::Parse - */ - public function testIPTCParseForcedUTFButInvalid() { - $iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x11\x1c\x02\x19\x00\x04\xC3\xC3\xC3\xB8" - . "\x1c\x01\x5A\x00\x03\x1B\x25\x47"; - $res = IPTC::Parse( $iptcData ); - $this->assertEquals( array( 'ø' ), $res['Keywords'] ); - } - - /** - * @covers IPTC::Parse - */ - public function testIPTCParseNoCharsetUTF8() { - $iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x07\x1c\x02\x19\x00\x02¼"; - $res = IPTC::Parse( $iptcData ); - $this->assertEquals( array( '¼' ), $res['Keywords'] ); - } - - /** - * Testing something that has 2 values for keyword - * @covers IPTC::Parse - */ - public function testIPTCParseMulti() { - $iptcData = /* identifier */ "Photoshop 3.0\08BIM\4\4" - /* length */ . "\0\0\0\0\0\x0D" - . "\x1c\x02\x19" . "\x00\x01" . "\xBC" - . "\x1c\x02\x19" . "\x00\x02" . "\xBC\xBD"; - $res = IPTC::Parse( $iptcData ); - $this->assertEquals( array( '¼', '¼½' ), $res['Keywords'] ); - } - - /** - * @covers IPTC::Parse - */ - public function testIPTCParseUTF8() { - // This has the magic "\x1c\x01\x5A\x00\x03\x1B\x25\x47" which marks content as UTF8. - $iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x0F\x1c\x02\x19\x00\x02¼\x1c\x01\x5A\x00\x03\x1B\x25\x47"; - $res = IPTC::Parse( $iptcData ); - $this->assertEquals( array( '¼' ), $res['Keywords'] ); - } -} diff --git a/tests/phpunit/includes/media/JpegMetadataExtractorTest.php b/tests/phpunit/includes/media/JpegMetadataExtractorTest.php deleted file mode 100644 index eafc8a2e..00000000 --- a/tests/phpunit/includes/media/JpegMetadataExtractorTest.php +++ /dev/null @@ -1,109 +0,0 @@ -filePath = __DIR__ . '/../../data/media/'; - } - - /** - * We also use this test to test padding bytes don't - * screw stuff up - * - * @param string $file filename - * - * @dataProvider provideUtf8Comment - */ - public function testUtf8Comment( $file ) { - $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . $file ); - $this->assertEquals( array( 'UTF-8 JPEG Comment — ¼' ), $res['COM'] ); - } - - public static function provideUtf8Comment() { - return array( - array( 'jpeg-comment-utf.jpg' ), - array( 'jpeg-padding-even.jpg' ), - array( 'jpeg-padding-odd.jpg' ), - ); - } - - /** The file is iso-8859-1, but it should get auto converted */ - public function testIso88591Comment() { - $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-comment-iso8859-1.jpg' ); - $this->assertEquals( array( 'ISO-8859-1 JPEG Comment - ¼' ), $res['COM'] ); - } - - /** Comment values that are non-textual (random binary junk) should not be shown. - * The example test file has a comment with a 0x5 byte in it which is a control character - * and considered binary junk for our purposes. - */ - public function testBinaryCommentStripped() { - $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-comment-binary.jpg' ); - $this->assertEmpty( $res['COM'] ); - } - - /* Very rarely a file can have multiple comments. - * Order of comments is based on order inside the file. - */ - public function testMultipleComment() { - $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-comment-multiple.jpg' ); - $this->assertEquals( array( 'foo', 'bar' ), $res['COM'] ); - } - - public function testXMPExtraction() { - $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-xmp-psir.jpg' ); - $expected = file_get_contents( $this->filePath . 'jpeg-xmp-psir.xmp' ); - $this->assertEquals( $expected, $res['XMP'] ); - } - - public function testPSIRExtraction() { - $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-xmp-psir.jpg' ); - $expected = '50686f746f73686f7020332e30003842494d04040000000000181c02190004746573741c02190003666f6f1c020000020004'; - $this->assertEquals( $expected, bin2hex( $res['PSIR'][0] ) ); - } - - public function testXMPExtractionAltAppId() { - $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-xmp-alt.jpg' ); - $expected = file_get_contents( $this->filePath . 'jpeg-xmp-psir.xmp' ); - $this->assertEquals( $expected, $res['XMP'] ); - } - - - public function testIPTCHashComparisionNoHash() { - $segments = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-xmp-psir.jpg' ); - $res = JpegMetadataExtractor::doPSIR( $segments['PSIR'][0] ); - - $this->assertEquals( 'iptc-no-hash', $res ); - } - - public function testIPTCHashComparisionBadHash() { - $segments = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-iptc-bad-hash.jpg' ); - $res = JpegMetadataExtractor::doPSIR( $segments['PSIR'][0] ); - - $this->assertEquals( 'iptc-bad-hash', $res ); - } - - public function testIPTCHashComparisionGoodHash() { - $segments = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-iptc-good-hash.jpg' ); - $res = JpegMetadataExtractor::doPSIR( $segments['PSIR'][0] ); - - $this->assertEquals( 'iptc-good-hash', $res ); - } - - public function testExifByteOrder() { - $res = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'exif-user-comment.jpg' ); - $expected = 'BE'; - $this->assertEquals( $expected, $res['byteOrder'] ); - } -} diff --git a/tests/phpunit/includes/media/JpegTest.php b/tests/phpunit/includes/media/JpegTest.php deleted file mode 100644 index 9af4f1e1..00000000 --- a/tests/phpunit/includes/media/JpegTest.php +++ /dev/null @@ -1,33 +0,0 @@ -markTestSkipped( "This test needs the exif extension." ); - } - - $this->filePath = __DIR__ . '/../../data/media/'; - - - $this->setMwGlobals( 'wgShowEXIF', true ); - } - - public function testInvalidFile() { - $jpeg = new JpegHandler; - $res = $jpeg->getMetadata( null, $this->filePath . 'README' ); - $this->assertEquals( ExifBitmapHandler::BROKEN_FILE, $res ); - } - - public function testJpegMetadataExtraction() { - $h = new JpegHandler; - $res = $h->getMetadata( null, $this->filePath . 'test.jpg' ); - $expected = 'a:7:{s:16:"ImageDescription";s:9:"Test file";s:11:"XResolution";s:4:"72/1";s:11:"YResolution";s:4:"72/1";s:14:"ResolutionUnit";i:2;s:16:"YCbCrPositioning";i:1;s:15:"JPEGFileComment";a:1:{i:0;s:17:"Created with GIMP";}s:22:"MEDIAWIKI_EXIF_VERSION";i:2;}'; - - // Unserialize in case serialization format ever changes. - $this->assertEquals( unserialize( $expected ), unserialize( $res ) ); - } -} diff --git a/tests/phpunit/includes/media/MediaHandlerTest.php b/tests/phpunit/includes/media/MediaHandlerTest.php deleted file mode 100644 index c28898bb..00000000 --- a/tests/phpunit/includes/media/MediaHandlerTest.php +++ /dev/null @@ -1,53 +0,0 @@ - 50, - 'height' => 50, - 'tests' => array( - 50 => 50, - 17 => 17, - 18 => 18 ) ), - array( - 'width' => 366, - 'height' => 300, - 'tests' => array( - 50 => 61, - 17 => 21, - 18 => 22 ) ), - array( - 'width' => 300, - 'height' => 366, - 'tests' => array( - 50 => 41, - 17 => 14, - 18 => 15 ) ), - array( - 'width' => 100, - 'height' => 400, - 'tests' => array( - 50 => 12, - 17 => 4, - 18 => 4 ) ) ); - foreach ( $vals as $row ) { - $tests = $row['tests']; - $height = $row['height']; - $width = $row['width']; - foreach ( $tests as $max => $expected ) { - $y = round( $expected * $height / $width ); - $result = MediaHandler::fitBoxWidth( $width, $height, $max ); - $y2 = round( $result * $height / $width ); - $this->assertEquals( $expected, - $result, - "($width, $height, $max) wanted: {$expected}x$y, got: {$result}x$y2" ); - } - } - } -} diff --git a/tests/phpunit/includes/media/PNGMetadataExtractorTest.php b/tests/phpunit/includes/media/PNGMetadataExtractorTest.php deleted file mode 100644 index 939f2cfc..00000000 --- a/tests/phpunit/includes/media/PNGMetadataExtractorTest.php +++ /dev/null @@ -1,155 +0,0 @@ -filePath = __DIR__ . '/../../data/media/'; - } - - /** - * Tests zTXt tag (compressed textual metadata) - */ - public function testPngNativetZtxt() { - $this->checkPHPExtension( 'zlib' ); - - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'Png-native-test.png' ); - $expected = "foo bar baz foo foo foo foof foo foo foo foo"; - $this->assertArrayHasKey( 'text', $meta ); - $meta = $meta['text']; - $this->assertArrayHasKey( 'Make', $meta ); - $this->assertArrayHasKey( 'x-default', $meta['Make'] ); - - $this->assertEquals( $expected, $meta['Make']['x-default'] ); - } - - /** - * Test tEXt tag (Uncompressed textual metadata) - */ - public function testPngNativeText() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'Png-native-test.png' ); - $expected = "Some long image desc"; - $this->assertArrayHasKey( 'text', $meta ); - $meta = $meta['text']; - $this->assertArrayHasKey( 'ImageDescription', $meta ); - $this->assertArrayHasKey( 'x-default', $meta['ImageDescription'] ); - $this->assertArrayHasKey( '_type', $meta['ImageDescription'] ); - - $this->assertEquals( $expected, $meta['ImageDescription']['x-default'] ); - } - - /** - * tEXt tags must be encoded iso-8859-1 (vs iTXt which are utf-8) - * Make sure non-ascii characters get converted properly - */ - public function testPngNativeTextNonAscii() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'Png-native-test.png' ); - - // Note the Copyright symbol here is a utf-8 one - // (aka \xC2\xA9) where in the file its iso-8859-1 - // encoded as just \xA9. - $expected = "© 2010 Bawolff"; - - $this->assertArrayHasKey( 'text', $meta ); - $meta = $meta['text']; - $this->assertArrayHasKey( 'Copyright', $meta ); - $this->assertArrayHasKey( 'x-default', $meta['Copyright'] ); - - $this->assertEquals( $expected, $meta['Copyright']['x-default'] ); - } - - /** - * Test extraction of pHYs tags, which can tell what the - * actual resolution of the image is (aka in dots per meter). - */ - /* - public function testPngPhysTag() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'Png-native-test.png' ); - - $this->assertArrayHasKey( 'text', $meta ); - $meta = $meta['text']; - - $this->assertEquals( '2835/100', $meta['XResolution'] ); - $this->assertEquals( '2835/100', $meta['YResolution'] ); - $this->assertEquals( 3, $meta['ResolutionUnit'] ); // 3 = cm - } - */ - - /** - * Given a normal static PNG, check the animation metadata returned. - */ - public function testStaticPngAnimationMetadata() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'Png-native-test.png' ); - - $this->assertEquals( 0, $meta['frameCount'] ); - $this->assertEquals( 1, $meta['loopCount'] ); - $this->assertEquals( 0, $meta['duration'] ); - } - - /** - * Given an animated APNG image file - * check it gets animated metadata right. - */ - public function testApngAnimationMetadata() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'Animated_PNG_example_bouncing_beach_ball.png' ); - - $this->assertEquals( 20, $meta['frameCount'] ); - // Note loop count of 0 = infinity - $this->assertEquals( 0, $meta['loopCount'] ); - $this->assertEquals( 1.5, $meta['duration'], '', 0.00001 ); - } - - public function testPngBitDepth8() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'Png-native-test.png' ); - - $this->assertEquals( 8, $meta['bitDepth'] ); - } - - public function testPngBitDepth1() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - '1bit-png.png' ); - $this->assertEquals( 1, $meta['bitDepth'] ); - } - - - public function testPngIndexColour() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'Png-native-test.png' ); - - $this->assertEquals( 'index-coloured', $meta['colorType'] ); - } - - public function testPngRgbColour() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'rgb-png.png' ); - $this->assertEquals( 'truecolour-alpha', $meta['colorType'] ); - } - - public function testPngRgbNoAlphaColour() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'rgb-na-png.png' ); - $this->assertEquals( 'truecolour', $meta['colorType'] ); - } - - public function testPngGreyscaleColour() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'greyscale-png.png' ); - $this->assertEquals( 'greyscale-alpha', $meta['colorType'] ); - } - - public function testPngGreyscaleNoAlphaColour() { - $meta = PNGMetadataExtractor::getMetadata( $this->filePath . - 'greyscale-na-png.png' ); - $this->assertEquals( 'greyscale', $meta['colorType'] ); - } -} diff --git a/tests/phpunit/includes/media/PNGTest.php b/tests/phpunit/includes/media/PNGTest.php deleted file mode 100644 index ad4c2493..00000000 --- a/tests/phpunit/includes/media/PNGTest.php +++ /dev/null @@ -1,123 +0,0 @@ -filePath = __DIR__ . '/../../data/media'; - $this->backend = new FSFileBackend( array( - 'name' => 'localtesting', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array( 'data' => $this->filePath ) - ) ); - $this->repo = new FSRepo( array( - 'name' => 'temp', - 'url' => 'http://localhost/thumbtest', - 'backend' => $this->backend - ) ); - $this->handler = new PNGHandler(); - } - - /** - * @covers PNGHandler::getMetadata - */ - public function testInvalidFile() { - $res = $this->handler->getMetadata( null, $this->filePath . '/README' ); - $this->assertEquals( PNGHandler::BROKEN_FILE, $res ); - } - - /** - * @param $filename String basename of the file to check - * @param $expected boolean Expected result. - * @dataProvider provideIsAnimated - * @covers PNGHandler::isAnimatedImage - */ - public function testIsAnimanted( $filename, $expected ) { - $file = $this->dataFile( $filename, 'image/png' ); - $actual = $this->handler->isAnimatedImage( $file ); - $this->assertEquals( $expected, $actual ); - } - - public static function provideIsAnimated() { - return array( - array( 'Animated_PNG_example_bouncing_beach_ball.png', true ), - array( '1bit-png.png', false ), - ); - } - - /** - * @param $filename String - * @param $expected Integer Total image area - * @dataProvider provideGetImageArea - * @covers PNGHandler::getImageArea - */ - public function testGetImageArea( $filename, $expected ) { - $file = $this->dataFile( $filename, 'image/png' ); - $actual = $this->handler->getImageArea( $file, $file->getWidth(), $file->getHeight() ); - $this->assertEquals( $expected, $actual ); - } - - public static function provideGetImageArea() { - return array( - array( '1bit-png.png', 2500 ), - array( 'greyscale-png.png', 2500 ), - array( 'Png-native-test.png', 126000 ), - array( 'Animated_PNG_example_bouncing_beach_ball.png', 10000 ), - ); - } - - /** - * @param $metadata String Serialized metadata - * @param $expected Integer One of the class constants of PNGHandler - * @dataProvider provideIsMetadataValid - * @covers PNGHandler::isMetadataValid - */ - public function testIsMetadataValid( $metadata, $expected ) { - $actual = $this->handler->isMetadataValid( null, $metadata ); - $this->assertEquals( $expected, $actual ); - } - - public static function provideIsMetadataValid() { - return array( - array( PNGHandler::BROKEN_FILE, PNGHandler::METADATA_GOOD ), - array( '', PNGHandler::METADATA_BAD ), - array( null, PNGHandler::METADATA_BAD ), - array( 'Something invalid!', PNGHandler::METADATA_BAD ), - array( 'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:8;s:9:"colorType";s:10:"truecolour";s:8:"metadata";a:1:{s:15:"_MW_PNG_VERSION";i:1;}}', PNGHandler::METADATA_GOOD ), - ); - } - - /** - * @param $filename String - * @param $expected String Serialized array - * @dataProvider provideGetMetadata - * @covers PNGHandler::getMetadata - */ - public function testGetMetadata( $filename, $expected ) { - $file = $this->dataFile( $filename, 'image/png' ); - $actual = $this->handler->getMetadata( $file, "$this->filePath/$filename" ); -// $this->assertEquals( unserialize( $expected ), unserialize( $actual ) ); - $this->assertEquals( ( $expected ), ( $actual ) ); - } - - public static function provideGetMetadata() { - return array( - array( 'rgb-na-png.png', 'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:8;s:9:"colorType";s:10:"truecolour";s:8:"metadata";a:1:{s:15:"_MW_PNG_VERSION";i:1;}}' ), - array( 'xmp.png', 'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:1;s:9:"colorType";s:14:"index-coloured";s:8:"metadata";a:2:{s:12:"SerialNumber";s:9:"123456789";s:15:"_MW_PNG_VERSION";i:1;}}' ), - ); - } - - private function dataFile( $name, $type ) { - return new UnregisteredLocalFile( false, $this->repo, - "mwstore://localtesting/data/$name", $type ); - } -} diff --git a/tests/phpunit/includes/media/SVGMetadataExtractorTest.php b/tests/phpunit/includes/media/SVGMetadataExtractorTest.php deleted file mode 100644 index 257009b0..00000000 --- a/tests/phpunit/includes/media/SVGMetadataExtractorTest.php +++ /dev/null @@ -1,112 +0,0 @@ -assertMetadata( $infile, $expected ); - } - - /** - * @dataProvider provideSvgFilesWithXMLMetadata - */ - public function testGetXMLMetadata( $infile, $expected ) { - $r = new XMLReader(); - if ( !method_exists( $r, 'readInnerXML' ) ) { - $this->markTestSkipped( 'XMLReader::readInnerXML() does not exist (libxml >2.6.20 needed).' ); - - return; - } - $this->assertMetadata( $infile, $expected ); - } - - function assertMetadata( $infile, $expected ) { - try { - $data = SVGMetadataExtractor::getMetadata( $infile ); - $this->assertEquals( $expected, $data, 'SVG metadata extraction test' ); - } catch ( MWException $e ) { - if ( $expected === false ) { - $this->assertTrue( true, 'SVG metadata extracted test (expected failure)' ); - } else { - throw $e; - } - } - } - - public static function provideSvgFiles() { - $base = __DIR__ . '/../../data/media'; - - return array( - array( - "$base/Wikimedia-logo.svg", - array( - 'width' => 1024, - 'height' => 1024, - 'originalWidth' => '1024', - 'originalHeight' => '1024', - ) - ), - array( - "$base/QA_icon.svg", - array( - 'width' => 60, - 'height' => 60, - 'originalWidth' => '60', - 'originalHeight' => '60', - ) - ), - array( - "$base/Gtk-media-play-ltr.svg", - array( - 'width' => 60, - 'height' => 60, - 'originalWidth' => '60.0000000', - 'originalHeight' => '60.0000000', - ) - ), - array( - "$base/Toll_Texas_1.svg", - // This file triggered bug 31719, needs entity expansion in the xmlns checks - array( - 'width' => 385, - 'height' => 385, - 'originalWidth' => '385', - 'originalHeight' => '385.0004883', - ) - ) - ); - } - - public static function provideSvgFilesWithXMLMetadata() { - $base = __DIR__ . '/../../data/media'; - $metadata = ' - - image/svg+xml - - - '; - $metadata = str_replace( "\r", '', $metadata ); // Windows compat - return array( - array( - "$base/US_states_by_total_state_tax_revenue.svg", - array( - 'height' => 593, - 'metadata' => $metadata, - 'width' => 959, - 'originalWidth' => '958.69', - 'originalHeight' => '592.78998', - ) - ), - ); - } -} diff --git a/tests/phpunit/includes/media/TiffTest.php b/tests/phpunit/includes/media/TiffTest.php deleted file mode 100644 index 8d74b98d..00000000 --- a/tests/phpunit/includes/media/TiffTest.php +++ /dev/null @@ -1,39 +0,0 @@ -markTestSkipped( "This test needs the exif extension." ); - } - - $this->setMwGlobals( 'wgShowEXIF', true ); - - $this->filePath = __DIR__ . '/../../data/media/'; - $this->handler = new TiffHandler; - } - - /** - * @covers TiffHandler::getMetadata - */ - public function testInvalidFile() { - $res = $this->handler->getMetadata( null, $this->filePath . 'README' ); - $this->assertEquals( ExifBitmapHandler::BROKEN_FILE, $res ); - } - - /** - * @covers TiffHandler::getMetadata - */ - public function testTiffMetadataExtraction() { - $res = $this->handler->getMetadata( null, $this->filePath . 'test.tiff' ); - $expected = 'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:2;}'; - // Re-unserialize in case there are subtle differences between how versions - // of php serialize stuff. - $this->assertEquals( unserialize( $expected ), unserialize( $res ) ); - } -} diff --git a/tests/phpunit/includes/media/XMPTest.php b/tests/phpunit/includes/media/XMPTest.php deleted file mode 100644 index d12e9b00..00000000 --- a/tests/phpunit/includes/media/XMPTest.php +++ /dev/null @@ -1,166 +0,0 @@ -markTestSkipped( 'Requires libxml to do XMP parsing' ); - } - } - - /** - * Put XMP in, compare what comes out... - * - * @param $xmp String the actual xml data. - * @param $expected Array expected result of parsing the xmp. - * @param $info String Short sentence on what's being tested. - * - * @throws Exception - * @dataProvider provideXMPParse - */ - public function testXMPParse( $xmp, $expected, $info ) { - if ( !is_string( $xmp ) || !is_array( $expected ) ) { - throw new Exception( "Invalid data provided to " . __METHOD__ ); - } - $reader = new XMPReader; - $reader->parse( $xmp ); - $this->assertEquals( $expected, $reader->getResults(), $info, 0.0000000001 ); - } - - public static function provideXMPParse() { - $xmpPath = __DIR__ . '/../../data/xmp/'; - $data = array(); - - // $xmpFiles format: array of arrays with first arg file base name, - // with the actual file having .xmp on the end for the xmp - // and .result.php on the end for a php file containing the result - // array. Second argument is some info on what's being tested. - $xmpFiles = array( - array( '1', 'parseType=Resource test' ), - array( '2', 'Structure with mixed attribute and element props' ), - array( '3', 'Extra qualifiers (that should be ignored)' ), - array( '3-invalid', 'Test ignoring qualifiers that look like normal props' ), - array( '4', 'Flash as qualifier' ), - array( '5', 'Flash as qualifier 2' ), - array( '6', 'Multiple rdf:Description' ), - array( '7', 'Generic test of several property types' ), - array( 'flash', 'Test of Flash property' ), - array( 'invalid-child-not-struct', 'Test child props not in struct or ignored' ), - array( 'no-recognized-props', 'Test namespace and no recognized props' ), - array( 'no-namespace', 'Test non-namespaced attributes are ignored' ), - array( 'bag-for-seq', "Allow bag's instead of seq's. (bug 27105)" ), - array( 'utf16BE', 'UTF-16BE encoding' ), - array( 'utf16LE', 'UTF-16LE encoding' ), - array( 'utf32BE', 'UTF-32BE encoding' ), - array( 'utf32LE', 'UTF-32LE encoding' ), - array( 'xmpExt', 'Extended XMP missing second part' ), - array( 'gps', 'Handling of exif GPS parameters in XMP' ), - ); - - foreach ( $xmpFiles as $file ) { - $xmp = file_get_contents( $xmpPath . $file[0] . '.xmp' ); - // I'm not sure if this is the best way to handle getting the - // result array, but it seems kind of big to put directly in the test - // file. - $result = null; - include $xmpPath . $file[0] . '.result.php'; - $data[] = array( $xmp, $result, '[' . $file[0] . '.xmp] ' . $file[1] ); - } - - return $data; - } - - /** Test ExtendedXMP block support. (Used when the XMP has to be split - * over multiple jpeg segments, due to 64k size limit on jpeg segments. - * - * @todo This is based on what the standard says. Need to find a real - * world example file to double check the support for this is right. - */ - public function testExtendedXMP() { - $xmpPath = __DIR__ . '/../../data/xmp/'; - $standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' ); - $extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' ); - - $md5sum = '28C74E0AC2D796886759006FBE2E57B7'; // of xmpExt2.xmp - $length = pack( 'N', strlen( $extendedXMP ) ); - $offset = pack( 'N', 0 ); - $extendedPacket = $md5sum . $length . $offset . $extendedXMP; - - $reader = new XMPReader(); - $reader->parse( $standardXMP ); - $reader->parseExtended( $extendedPacket ); - $actual = $reader->getResults(); - - $expected = array( - 'xmp-exif' => array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => 9, - 'FNumber' => '2/10', - ) - ); - - $this->assertEquals( $expected, $actual ); - } - - /** - * This test has an extended XMP block with a wrong guid (md5sum) - * and thus should only return the StandardXMP, not the ExtendedXMP. - */ - public function testExtendedXMPWithWrongGUID() { - $xmpPath = __DIR__ . '/../../data/xmp/'; - $standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' ); - $extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' ); - - $md5sum = '28C74E0AC2D796886759006FBE2E57B9'; // Note last digit. - $length = pack( 'N', strlen( $extendedXMP ) ); - $offset = pack( 'N', 0 ); - $extendedPacket = $md5sum . $length . $offset . $extendedXMP; - - $reader = new XMPReader(); - $reader->parse( $standardXMP ); - $reader->parseExtended( $extendedPacket ); - $actual = $reader->getResults(); - - $expected = array( - 'xmp-exif' => array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => 9, - ) - ); - - $this->assertEquals( $expected, $actual ); - } - - /** - * Have a high offset to simulate a missing packet, - * which should cause it to ignore the ExtendedXMP packet. - */ - public function testExtendedXMPMissingPacket() { - $xmpPath = __DIR__ . '/../../data/xmp/'; - $standardXMP = file_get_contents( $xmpPath . 'xmpExt.xmp' ); - $extendedXMP = file_get_contents( $xmpPath . 'xmpExt2.xmp' ); - - $md5sum = '28C74E0AC2D796886759006FBE2E57B7'; // of xmpExt2.xmp - $length = pack( 'N', strlen( $extendedXMP ) ); - $offset = pack( 'N', 2048 ); - $extendedPacket = $md5sum . $length . $offset . $extendedXMP; - - $reader = new XMPReader(); - $reader->parse( $standardXMP ); - $reader->parseExtended( $extendedPacket ); - $actual = $reader->getResults(); - - $expected = array( - 'xmp-exif' => array( - 'DigitalZoomRatio' => '0/10', - 'Flash' => 9, - ) - ); - - $this->assertEquals( $expected, $actual ); - } -} diff --git a/tests/phpunit/includes/media/XMPValidateTest.php b/tests/phpunit/includes/media/XMPValidateTest.php deleted file mode 100644 index 96bf5e47..00000000 --- a/tests/phpunit/includes/media/XMPValidateTest.php +++ /dev/null @@ -1,46 +0,0 @@ -assertEquals( $expected, $value ); - } - - public static function provideDates() { - /* For reference valid date formats are: - * YYYY - * YYYY-MM - * YYYY-MM-DD - * YYYY-MM-DDThh:mmTZD - * YYYY-MM-DDThh:mm:ssTZD - * YYYY-MM-DDThh:mm:ss.sTZD - * (Time zone is optional) - */ - return array( - array( '1992', '1992' ), - array( '1992-04', '1992:04' ), - array( '1992-02-01', '1992:02:01' ), - array( '2011-09-29', '2011:09:29' ), - array( '1982-12-15T20:12', '1982:12:15 20:12' ), - array( '1982-12-15T20:12Z', '1982:12:15 20:12' ), - array( '1982-12-15T20:12+02:30', '1982:12:15 22:42' ), - array( '1982-12-15T01:12-02:30', '1982:12:14 22:42' ), - array( '1982-12-15T20:12:11', '1982:12:15 20:12:11' ), - array( '1982-12-15T20:12:11Z', '1982:12:15 20:12:11' ), - array( '1982-12-15T20:12:11+01:10', '1982:12:15 21:22:11' ), - array( '2045-12-15T20:12:11', '2045:12:15 20:12:11' ), - array( '1867-06-01T15:00:00', '1867:06:01 15:00:00' ), - /* some invalid ones */ - array( '2001--12', null ), - array( '2001-5-12', null ), - array( '2001-5-12TZ', null ), - array( '2001-05-12T15', null ), - array( '2001-12T15:13', null ), - ); - } -} diff --git a/tests/phpunit/includes/normal/CleanUpTest.php b/tests/phpunit/includes/normal/CleanUpTest.php deleted file mode 100644 index 52dd2ef5..00000000 --- a/tests/phpunit/includes/normal/CleanUpTest.php +++ /dev/null @@ -1,409 +0,0 @@ - - * http://www.mediawiki.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @file - */ - -/** - * Additional tests for UtfNormal::cleanUp() function, inclusion - * regression checks for known problems. - * Requires PHPUnit. - * - * @ingroup UtfNormal - * @group Large - * - * We ignore code coverage for this test suite until they are rewritten - * to use data providers (bug 46561). - * @codeCoverageIgnore - */ -class CleanUpTest extends MediaWikiTestCase { - /** @todo document */ - public function testAscii() { - $text = 'This is plain ASCII text.'; - $this->assertEquals( $text, UtfNormal::cleanUp( $text ) ); - } - - /** @todo document */ - public function testNull() { - $text = "a \x00 null"; - $expect = "a \xef\xbf\xbd null"; - $this->assertEquals( - bin2hex( $expect ), - bin2hex( UtfNormal::cleanUp( $text ) ) ); - } - - /** @todo document */ - public function testLatin() { - $text = "L'\xc3\xa9cole"; - $this->assertEquals( $text, UtfNormal::cleanUp( $text ) ); - } - - /** @todo document */ - public function testLatinNormal() { - $text = "L'e\xcc\x81cole"; - $expect = "L'\xc3\xa9cole"; - $this->assertEquals( $expect, UtfNormal::cleanUp( $text ) ); - } - - /** - * This test is *very* expensive! - * @todo document - */ - function XtestAllChars() { - $rep = UTF8_REPLACEMENT; - for ( $i = 0x0; $i < UNICODE_MAX; $i++ ) { - $char = codepointToUtf8( $i ); - $clean = UtfNormal::cleanUp( $char ); - $x = sprintf( "%04X", $i ); - - if ( $i % 0x1000 == 0 ) { - echo "U+$x\n"; - } - - if ( $i == 0x0009 || - $i == 0x000a || - $i == 0x000d || - ( $i > 0x001f && $i < UNICODE_SURROGATE_FIRST ) || - ( $i > UNICODE_SURROGATE_LAST && $i < 0xfffe ) || - ( $i > 0xffff && $i <= UNICODE_MAX ) - ) { - if ( isset( UtfNormal::$utfCanonicalComp[$char] ) || isset( UtfNormal::$utfCanonicalDecomp[$char] ) ) { - $comp = UtfNormal::NFC( $char ); - $this->assertEquals( - bin2hex( $comp ), - bin2hex( $clean ), - "U+$x should be decomposed" ); - } else { - $this->assertEquals( - bin2hex( $char ), - bin2hex( $clean ), - "U+$x should be intact" ); - } - } else { - $this->assertEquals( bin2hex( $rep ), bin2hex( $clean ), $x ); - } - } - } - - /** @todo document */ - public function testAllBytes() { - $this->doTestBytes( '', '' ); - $this->doTestBytes( 'x', '' ); - $this->doTestBytes( '', 'x' ); - $this->doTestBytes( 'x', 'x' ); - } - - /** @todo document */ - function doTestBytes( $head, $tail ) { - for ( $i = 0x0; $i < 256; $i++ ) { - $char = $head . chr( $i ) . $tail; - $clean = UtfNormal::cleanUp( $char ); - $x = sprintf( "%02X", $i ); - - if ( $i == 0x0009 || - $i == 0x000a || - $i == 0x000d || - ( $i > 0x001f && $i < 0x80 ) - ) { - $this->assertEquals( - bin2hex( $char ), - bin2hex( $clean ), - "ASCII byte $x should be intact" ); - if ( $char != $clean ) { - return; - } - } else { - $norm = $head . UTF8_REPLACEMENT . $tail; - $this->assertEquals( - bin2hex( $norm ), - bin2hex( $clean ), - "Forbidden byte $x should be rejected" ); - if ( $norm != $clean ) { - return; - } - } - } - } - - /** @todo document */ - public function testDoubleBytes() { - $this->doTestDoubleBytes( '', '' ); - $this->doTestDoubleBytes( 'x', '' ); - $this->doTestDoubleBytes( '', 'x' ); - $this->doTestDoubleBytes( 'x', 'x' ); - } - - /** - * @todo document - */ - function doTestDoubleBytes( $head, $tail ) { - for ( $first = 0xc0; $first < 0x100; $first += 2 ) { - for ( $second = 0x80; $second < 0x100; $second += 2 ) { - $char = $head . chr( $first ) . chr( $second ) . $tail; - $clean = UtfNormal::cleanUp( $char ); - $x = sprintf( "%02X,%02X", $first, $second ); - if ( $first > 0xc1 && - $first < 0xe0 && - $second < 0xc0 - ) { - $norm = UtfNormal::NFC( $char ); - $this->assertEquals( - bin2hex( $norm ), - bin2hex( $clean ), - "Pair $x should be intact" ); - if ( $norm != $clean ) { - return; - } - } elseif ( $first > 0xfd || $second > 0xbf ) { - # fe and ff are not legal head bytes -- expect two replacement chars - $norm = $head . UTF8_REPLACEMENT . UTF8_REPLACEMENT . $tail; - $this->assertEquals( - bin2hex( $norm ), - bin2hex( $clean ), - "Forbidden pair $x should be rejected" ); - if ( $norm != $clean ) { - return; - } - } else { - $norm = $head . UTF8_REPLACEMENT . $tail; - $this->assertEquals( - bin2hex( $norm ), - bin2hex( $clean ), - "Forbidden pair $x should be rejected" ); - if ( $norm != $clean ) { - return; - } - } - } - } - } - - /** @todo document */ - public function testTripleBytes() { - $this->doTestTripleBytes( '', '' ); - $this->doTestTripleBytes( 'x', '' ); - $this->doTestTripleBytes( '', 'x' ); - $this->doTestTripleBytes( 'x', 'x' ); - } - - /** @todo document */ - function doTestTripleBytes( $head, $tail ) { - for ( $first = 0xc0; $first < 0x100; $first += 2 ) { - for ( $second = 0x80; $second < 0x100; $second += 2 ) { - #for( $third = 0x80; $third < 0x100; $third++ ) { - for ( $third = 0x80; $third < 0x81; $third++ ) { - $char = $head . chr( $first ) . chr( $second ) . chr( $third ) . $tail; - $clean = UtfNormal::cleanUp( $char ); - $x = sprintf( "%02X,%02X,%02X", $first, $second, $third ); - - if ( $first >= 0xe0 && - $first < 0xf0 && - $second < 0xc0 && - $third < 0xc0 - ) { - if ( $first == 0xe0 && $second < 0xa0 ) { - $this->assertEquals( - bin2hex( $head . UTF8_REPLACEMENT . $tail ), - bin2hex( $clean ), - "Overlong triplet $x should be rejected" ); - } elseif ( $first == 0xed && - ( chr( $first ) . chr( $second ) . chr( $third ) ) >= UTF8_SURROGATE_FIRST - ) { - $this->assertEquals( - bin2hex( $head . UTF8_REPLACEMENT . $tail ), - bin2hex( $clean ), - "Surrogate triplet $x should be rejected" ); - } else { - $this->assertEquals( - bin2hex( UtfNormal::NFC( $char ) ), - bin2hex( $clean ), - "Triplet $x should be intact" ); - } - } elseif ( $first > 0xc1 && $first < 0xe0 && $second < 0xc0 ) { - $this->assertEquals( - bin2hex( UtfNormal::NFC( $head . chr( $first ) . chr( $second ) ) . UTF8_REPLACEMENT . $tail ), - bin2hex( $clean ), - "Valid 2-byte $x + broken tail" ); - } elseif ( $second > 0xc1 && $second < 0xe0 && $third < 0xc0 ) { - $this->assertEquals( - bin2hex( $head . UTF8_REPLACEMENT . UtfNormal::NFC( chr( $second ) . chr( $third ) . $tail ) ), - bin2hex( $clean ), - "Broken head + valid 2-byte $x" ); - } elseif ( ( $first > 0xfd || $second > 0xfd ) && - ( ( $second > 0xbf && $third > 0xbf ) || - ( $second < 0xc0 && $third < 0xc0 ) || - ( $second > 0xfd ) || - ( $third > 0xfd ) ) - ) { - # fe and ff are not legal head bytes -- expect three replacement chars - $this->assertEquals( - bin2hex( $head . UTF8_REPLACEMENT . UTF8_REPLACEMENT . UTF8_REPLACEMENT . $tail ), - bin2hex( $clean ), - "Forbidden triplet $x should be rejected" ); - } elseif ( $first > 0xc2 && $second < 0xc0 && $third < 0xc0 ) { - $this->assertEquals( - bin2hex( $head . UTF8_REPLACEMENT . $tail ), - bin2hex( $clean ), - "Forbidden triplet $x should be rejected" ); - } else { - $this->assertEquals( - bin2hex( $head . UTF8_REPLACEMENT . UTF8_REPLACEMENT . $tail ), - bin2hex( $clean ), - "Forbidden triplet $x should be rejected" ); - } - } - } - } - } - - /** @todo document */ - public function testChunkRegression() { - # Check for regression against a chunking bug - $text = "\x46\x55\xb8" . - "\xdc\x96" . - "\xee" . - "\xe7" . - "\x44" . - "\xaa" . - "\x2f\x25"; - $expect = "\x46\x55\xef\xbf\xbd" . - "\xdc\x96" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\x44" . - "\xef\xbf\xbd" . - "\x2f\x25"; - - $this->assertEquals( - bin2hex( $expect ), - bin2hex( UtfNormal::cleanUp( $text ) ) ); - } - - /** @todo document */ - public function testInterposeRegression() { - $text = "\x4e\x30" . - "\xb1" . # bad tail - "\x3a" . - "\x92" . # bad tail - "\x62\x3a" . - "\x84" . # bad tail - "\x43" . - "\xc6" . # bad head - "\x3f" . - "\x92" . # bad tail - "\xad" . # bad tail - "\x7d" . - "\xd9\x95"; - - $expect = "\x4e\x30" . - "\xef\xbf\xbd" . - "\x3a" . - "\xef\xbf\xbd" . - "\x62\x3a" . - "\xef\xbf\xbd" . - "\x43" . - "\xef\xbf\xbd" . - "\x3f" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\x7d" . - "\xd9\x95"; - - $this->assertEquals( - bin2hex( $expect ), - bin2hex( UtfNormal::cleanUp( $text ) ) ); - } - - /** @todo document */ - public function testOverlongRegression() { - $text = "\x67" . - "\x1a" . # forbidden ascii - "\xea" . # bad head - "\xc1\xa6" . # overlong sequence - "\xad" . # bad tail - "\x1c" . # forbidden ascii - "\xb0" . # bad tail - "\x3c" . - "\x9e"; # bad tail - $expect = "\x67" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\x3c" . - "\xef\xbf\xbd"; - $this->assertEquals( - bin2hex( $expect ), - bin2hex( UtfNormal::cleanUp( $text ) ) ); - } - - /** @todo document */ - public function testSurrogateRegression() { - $text = "\xed\xb4\x96" . # surrogate 0xDD16 - "\x83" . # bad tail - "\xb4" . # bad tail - "\xac"; # bad head - $expect = "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd"; - $this->assertEquals( - bin2hex( $expect ), - bin2hex( UtfNormal::cleanUp( $text ) ) ); - } - - /** @todo document */ - public function testBomRegression() { - $text = "\xef\xbf\xbe" . # U+FFFE, illegal char - "\xb2" . # bad tail - "\xef" . # bad head - "\x59"; - $expect = "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\xef\xbf\xbd" . - "\x59"; - $this->assertEquals( - bin2hex( $expect ), - bin2hex( UtfNormal::cleanUp( $text ) ) ); - } - - /** @todo document */ - public function testForbiddenRegression() { - $text = "\xef\xbf\xbf"; # U+FFFF, illegal char - $expect = "\xef\xbf\xbd"; - $this->assertEquals( - bin2hex( $expect ), - bin2hex( UtfNormal::cleanUp( $text ) ) ); - } - - /** @todo document */ - public function testHangulRegression() { - $text = "\xed\x9c\xaf" . # Hangul char - "\xe1\x87\x81"; # followed by another final jamo - $expect = $text; # Should *not* change. - $this->assertEquals( - bin2hex( $expect ), - bin2hex( UtfNormal::cleanUp( $text ) ) ); - } -} diff --git a/tests/phpunit/includes/objectcache/BagOStuffTest.php b/tests/phpunit/includes/objectcache/BagOStuffTest.php deleted file mode 100644 index aa783943..00000000 --- a/tests/phpunit/includes/objectcache/BagOStuffTest.php +++ /dev/null @@ -1,149 +0,0 @@ - - */ -class BagOStuffTest extends MediaWikiTestCase { - private $cache; - - protected function setUp() { - parent::setUp(); - - // type defined through parameter - if ( $this->getCliArg( 'use-bagostuff=' ) ) { - $name = $this->getCliArg( 'use-bagostuff=' ); - - $this->cache = ObjectCache::newFromId( $name ); - } else { - // no type defined - use simple hash - $this->cache = new HashBagOStuff; - } - - $this->cache->delete( wfMemcKey( 'test' ) ); - } - - protected function tearDown() { - } - - public function testMerge() { - $key = wfMemcKey( 'test' ); - - $usleep = 0; - - /** - * Callback method: append "merged" to whatever is in cache. - * - * @param BagOStuff $cache - * @param string $key - * @param int $existingValue - * @use int $usleep - * @return int - */ - $callback = function ( BagOStuff $cache, $key, $existingValue ) use ( &$usleep ) { - // let's pretend this is an expensive callback to test concurrent merge attempts - usleep( $usleep ); - - if ( $existingValue === false ) { - return 'merged'; - } - - return $existingValue . 'merged'; - }; - - // merge on non-existing value - $merged = $this->cache->merge( $key, $callback, 0 ); - $this->assertTrue( $merged ); - $this->assertEquals( $this->cache->get( $key ), 'merged' ); - - // merge on existing value - $merged = $this->cache->merge( $key, $callback, 0 ); - $this->assertTrue( $merged ); - $this->assertEquals( $this->cache->get( $key ), 'mergedmerged' ); - - /* - * Test concurrent merges by forking this process, if: - * - not manually called with --use-bagostuff - * - pcntl_fork is supported by the system - * - cache type will correctly support calls over forks - */ - $fork = (bool)$this->getCliArg( 'use-bagostuff=' ); - $fork &= function_exists( 'pcntl_fork' ); - $fork &= !$this->cache instanceof HashBagOStuff; - $fork &= !$this->cache instanceof EmptyBagOStuff; - $fork &= !$this->cache instanceof MultiWriteBagOStuff; - if ( $fork ) { - // callback should take awhile now so that we can test concurrent merge attempts - $usleep = 5000; - - $pid = pcntl_fork(); - if ( $pid == -1 ) { - // can't fork, ignore this test... - } elseif ( $pid ) { - // wait a little, making sure that the child process is calling merge - usleep( 3000 ); - - // attempt a merge - this should fail - $merged = $this->cache->merge( $key, $callback, 0, 1 ); - - // merge has failed because child process was merging (and we only attempted once) - $this->assertFalse( $merged ); - - // make sure the child's merge is completed and verify - usleep( 3000 ); - $this->assertEquals( $this->cache->get( $key ), 'mergedmergedmerged' ); - } else { - $this->cache->merge( $key, $callback, 0, 1 ); - - // Note: I'm not even going to check if the merge worked, I'll - // compare values in the parent process to test if this merge worked. - // I'm just going to exit this child process, since I don't want the - // child to output any test results (would be rather confusing to - // have test output twice) - exit; - } - } - } - - public function testAdd() { - $key = wfMemcKey( 'test' ); - $this->assertTrue( $this->cache->add( $key, 'test' ) ); - } - - public function testGet() { - $value = array( 'this' => 'is', 'a' => 'test' ); - - $key = wfMemcKey( 'test' ); - $this->cache->add( $key, $value ); - $this->assertEquals( $this->cache->get( $key ), $value ); - } - - /** - * @covers BagOStuff::incr - */ - public function testIncr() { - $key = wfMemcKey( 'test' ); - $this->cache->add( $key, 0 ); - $this->cache->incr( $key ); - $expectedValue = 1; - $actualValue = $this->cache->get( $key ); - $this->assertEquals( $expectedValue, $actualValue, 'Value should be 1 after incrementing' ); - } - - public function testGetMulti() { - $value1 = array( 'this' => 'is', 'a' => 'test' ); - $value2 = array( 'this' => 'is', 'another' => 'test' ); - - $key1 = wfMemcKey( 'test1' ); - $key2 = wfMemcKey( 'test2' ); - - $this->cache->add( $key1, $value1 ); - $this->cache->add( $key2, $value2 ); - - $this->assertEquals( $this->cache->getMulti( array( $key1, $key2 ) ), array( $key1 => $value1, $key2 => $value2 ) ); - - // cleanup - $this->cache->delete( $key1 ); - $this->cache->delete( $key2 ); - } -} diff --git a/tests/phpunit/includes/parser/MagicVariableTest.php b/tests/phpunit/includes/parser/MagicVariableTest.php deleted file mode 100644 index c2c97c01..00000000 --- a/tests/phpunit/includes/parser/MagicVariableTest.php +++ /dev/null @@ -1,242 +0,0 @@ -setMwGlobals( array( - 'wgLanguageCode' => 'en', - 'wgContLang' => $contLang, - ) ); - - $this->testParser = new Parser(); - $this->testParser->Options( ParserOptions::newFromUserAndLang( new User, $contLang ) ); - - # initialize parser output - $this->testParser->clearState(); - - # Needs a title to do magic word stuff - $title = Title::newFromText( 'Tests' ); - $title->mRedirect = false; # Else it needs a db connection just to check if it's a redirect (when deciding the page language) - - $this->testParser->setTitle( $title ); - } - - /** - * @param int $num upper limit for numbers - * @return array of numbers from 1 up to $num - */ - private static function createProviderUpTo( $num ) { - $ret = array(); - for ( $i = 1; $i <= $num; $i++ ) { - $ret[] = array( $i ); - } - - return $ret; - } - - /** - * @return array of months numbers (as an integer) - */ - public static function provideMonths() { - return self::createProviderUpTo( 12 ); - } - - /** - * @return array of days numbers (as an integer) - */ - public static function provideDays() { - return self::createProviderUpTo( 31 ); - } - - ############### TESTS ############################################# - # @todo FIXME: - # - those got copy pasted, we can probably make them cleaner - # - tests are lacking useful messages - - # day - - /** @dataProvider provideDays */ - public function testCurrentdayIsUnPadded( $day ) { - $this->assertUnPadded( 'currentday', $day ); - } - - /** @dataProvider provideDays */ - public function testCurrentdaytwoIsZeroPadded( $day ) { - $this->assertZeroPadded( 'currentday2', $day ); - } - - /** @dataProvider provideDays */ - public function testLocaldayIsUnPadded( $day ) { - $this->assertUnPadded( 'localday', $day ); - } - - /** @dataProvider provideDays */ - public function testLocaldaytwoIsZeroPadded( $day ) { - $this->assertZeroPadded( 'localday2', $day ); - } - - # month - - /** @dataProvider provideMonths */ - public function testCurrentmonthIsZeroPadded( $month ) { - $this->assertZeroPadded( 'currentmonth', $month ); - } - - /** @dataProvider provideMonths */ - public function testCurrentmonthoneIsUnPadded( $month ) { - $this->assertUnPadded( 'currentmonth1', $month ); - } - - /** @dataProvider provideMonths */ - public function testLocalmonthIsZeroPadded( $month ) { - $this->assertZeroPadded( 'localmonth', $month ); - } - - /** @dataProvider provideMonths */ - public function testLocalmonthoneIsUnPadded( $month ) { - $this->assertUnPadded( 'localmonth1', $month ); - } - - # revision day - - /** @dataProvider provideDays */ - public function testRevisiondayIsUnPadded( $day ) { - $this->assertUnPadded( 'revisionday', $day ); - } - - /** @dataProvider provideDays */ - public function testRevisiondaytwoIsZeroPadded( $day ) { - $this->assertZeroPadded( 'revisionday2', $day ); - } - - # revision month - - /** @dataProvider provideMonths */ - public function testRevisionmonthIsZeroPadded( $month ) { - $this->assertZeroPadded( 'revisionmonth', $month ); - } - - /** @dataProvider provideMonths */ - public function testRevisionmonthoneIsUnPadded( $month ) { - $this->assertUnPadded( 'revisionmonth1', $month ); - } - - /** - * Rough tests for {{SERVERNAME}} magic word - * Bug 31176 - * @group Database - * @dataProvider provideDataServernameFromDifferentProtocols - */ - public function testServernameFromDifferentProtocols( $server ) { - $this->setMwGlobals( 'wgServer', $server ); - - $this->assertMagic( 'localhost', 'servername' ); - } - - public static function provideDataServernameFromDifferentProtocols() { - return array( - array( 'http://localhost/' ), - array( 'https://localhost/' ), - array( '//localhost/' ), # bug 31176 - ); - } - - ############### HELPERS ############################################ - - /** assertion helper expecting a magic output which is zero padded */ - public function assertZeroPadded( $magic, $value ) { - $this->assertMagicPadding( $magic, $value, '%02d' ); - } - - /** assertion helper expecting a magic output which is unpadded */ - public function assertUnPadded( $magic, $value ) { - $this->assertMagicPadding( $magic, $value, '%d' ); - } - - /** - * Main assertion helper for magic variables padding - * @param $magic string Magic variable name - * @param $value mixed Month or day - * @param $format string sprintf format for $value - */ - private function assertMagicPadding( $magic, $value, $format ) { - # Initialize parser timestamp as year 2010 at 12h34 56s. - # month and day are given by the caller ($value). Month < 12! - if ( $value > 12 ) { - $month = $value % 12; - } else { - $month = $value; - } - - $this->setParserTS( - sprintf( '2010%02d%02d123456', $month, $value ) - ); - - # please keep the following commented line of code. It helps debugging. - //print "\nDEBUG (value $value):" . sprintf( '2010%02d%02d123456', $value, $value ) . "\n"; - - # format expectation and test it - $expected = sprintf( $format, $value ); - $this->assertMagic( $expected, $magic ); - } - - /** helper to set the parser timestamp and revision timestamp */ - private function setParserTS( $ts ) { - $this->testParser->Options()->setTimestamp( $ts ); - $this->testParser->mRevisionTimestamp = $ts; - } - - /** - * Assertion helper to test a magic variable output - */ - private function assertMagic( $expected, $magic ) { - if ( in_array( $magic, $this->expectedAsInteger ) ) { - $expected = (int)$expected; - } - - # Generate a message for the assertion - $msg = sprintf( "Magic %s should be <%s:%s>", - $magic, - $expected, - gettype( $expected ) - ); - - $this->assertSame( - $expected, - $this->testParser->getVariableValue( $magic ), - $msg - ); - } -} diff --git a/tests/phpunit/includes/parser/MediaWikiParserTest.php b/tests/phpunit/includes/parser/MediaWikiParserTest.php deleted file mode 100644 index c120ca34..00000000 --- a/tests/phpunit/includes/parser/MediaWikiParserTest.php +++ /dev/null @@ -1,120 +0,0 @@ - "\\'", '\\' => '\\\\' ) ); - /* This used to be ucfirst( basename( dirname( $filename ) ) ) - * and then was ucfirst( basename( $filename, '.txt' ) - * but that didn't work with names like foo.tests.txt - */ - $parserTestClassName = str_replace( '.', '_', ucfirst( $testsName ) ); - $parserTestClassDefinition = <<addTestSuite( $parserTestClassName ); - } - return $suite; - } - - /** - * Write $msg under log group 'tests-parser' - * @param string $msg Message to log - */ - protected static function debug( $msg ) { - return wfDebugLog( 'tests-parser', wfGetCaller() . ' ' . $msg ); - } -} diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php deleted file mode 100644 index eac4de5c..00000000 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ /dev/null @@ -1,969 +0,0 @@ -getCliArg( 'regex=' ) ) { - $this->regex = $this->getCliArg( 'regex=' ); - } else { - # Matches anything - $this->regex = ''; - } - - $this->keepUploads = $this->getCliArg( 'keep-uploads' ); - - $tmpGlobals = array(); - - $tmpGlobals['wgLanguageCode'] = 'en'; - $tmpGlobals['wgContLang'] = Language::factory( 'en' ); - $tmpGlobals['wgSitename'] = 'MediaWiki'; - $tmpGlobals['wgServer'] = 'http://example.org'; - $tmpGlobals['wgScript'] = '/index.php'; - $tmpGlobals['wgScriptPath'] = '/'; - $tmpGlobals['wgArticlePath'] = '/wiki/$1'; - $tmpGlobals['wgActionPaths'] = array(); - $tmpGlobals['wgVariantArticlePath'] = false; - $tmpGlobals['wgExtensionAssetsPath'] = '/extensions'; - $tmpGlobals['wgStylePath'] = '/skins'; - $tmpGlobals['wgEnableUploads'] = true; - $tmpGlobals['wgThumbnailScriptPath'] = false; - $tmpGlobals['wgLocalFileRepo'] = array( - 'class' => 'LocalRepo', - 'name' => 'local', - 'url' => 'http://example.com/images', - 'hashLevels' => 2, - 'transformVia404' => false, - 'backend' => 'local-backend' - ); - $tmpGlobals['wgForeignFileRepos'] = array(); - $tmpGlobals['wgDefaultExternalStore'] = array(); - $tmpGlobals['wgEnableParserCache'] = false; - $tmpGlobals['wgCapitalLinks'] = true; - $tmpGlobals['wgNoFollowLinks'] = true; - $tmpGlobals['wgNoFollowDomainExceptions'] = array(); - $tmpGlobals['wgExternalLinkTarget'] = false; - $tmpGlobals['wgThumbnailScriptPath'] = false; - $tmpGlobals['wgUseImageResize'] = true; - $tmpGlobals['wgAllowExternalImages'] = true; - $tmpGlobals['wgRawHtml'] = false; - $tmpGlobals['wgUseTidy'] = false; - $tmpGlobals['wgAlwaysUseTidy'] = false; - $tmpGlobals['wgWellFormedXml'] = true; - $tmpGlobals['wgAllowMicrodataAttributes'] = true; - $tmpGlobals['wgExperimentalHtmlIds'] = false; - $tmpGlobals['wgAdaptiveMessageCache'] = true; - $tmpGlobals['wgUseDatabaseMessages'] = true; - $tmpGlobals['wgLocaltimezone'] = 'UTC'; - $tmpGlobals['wgDeferredUpdateList'] = array(); - $tmpGlobals['wgGroupPermissions'] = array( - '*' => array( - 'createaccount' => true, - 'read' => true, - 'edit' => true, - 'createpage' => true, - 'createtalk' => true, - ) ); - $tmpGlobals['wgNamespaceProtection'] = array( NS_MEDIAWIKI => 'editinterface' ); - - $tmpGlobals['wgParser'] = new StubObject( - 'wgParser', $GLOBALS['wgParserConf']['class'], - array( $GLOBALS['wgParserConf'] ) ); - - $tmpGlobals['wgFileExtensions'][] = 'svg'; - $tmpGlobals['wgSVGConverter'] = 'rsvg'; - $tmpGlobals['wgSVGConverters']['rsvg'] = - '$path/rsvg-convert -w $width -h $height $input -o $output'; - - if ( $GLOBALS['wgStyleDirectory'] === false ) { - $tmpGlobals['wgStyleDirectory'] = "$IP/skins"; - } - - # Replace all media handlers with a mock. We do not need to generate - # actual thumbnails to do parser testing, we only care about receiving - # a ThumbnailImage properly initialized. - global $wgMediaHandlers; - foreach ( $wgMediaHandlers as $type => $handler ) { - $tmpGlobals['wgMediaHandlers'][$type] = 'MockBitmapHandler'; - } - // Vector images have to be handled slightly differently - $tmpGlobals['wgMediaHandlers']['image/svg+xml'] = 'MockSvgHandler'; - - $tmpHooks = $wgHooks; - $tmpHooks['ParserTestParser'][] = 'ParserTestParserHook::setup'; - $tmpHooks['ParserGetVariableValueTs'][] = 'ParserTest::getFakeTimestamp'; - $tmpGlobals['wgHooks'] = $tmpHooks; - # add a namespace shadowing a interwiki link, to test - # proper precedence when resolving links. (bug 51680) - $tmpGlobals['wgExtraNamespaces'] = array( 100 => 'MemoryAlpha' ); - - $this->setMwGlobals( $tmpGlobals ); - - $this->savedWeirdGlobals['image_alias'] = $wgNamespaceAliases['Image']; - $this->savedWeirdGlobals['image_talk_alias'] = $wgNamespaceAliases['Image_talk']; - - $wgNamespaceAliases['Image'] = NS_FILE; - $wgNamespaceAliases['Image_talk'] = NS_FILE_TALK; - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - } - - protected function tearDown() { - global $wgNamespaceAliases, $wgContLang; - - $wgNamespaceAliases['Image'] = $this->savedWeirdGlobals['image_alias']; - $wgNamespaceAliases['Image_talk'] = $this->savedWeirdGlobals['image_talk_alias']; - - // Restore backends - RepoGroup::destroySingleton(); - FileBackendGroup::destroySingleton(); - - // Remove temporary pages from the link cache - LinkCache::singleton()->clear(); - - // Restore message cache (temporary pages and $wgUseDatabaseMessages) - MessageCache::destroyInstance(); - - parent::tearDown(); - - MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache - $wgContLang->resetNamespaces(); # reset namespace cache - } - - public static function tearDownAfterClass() { - ParserTest::tearDownInterwikis(); - parent::tearDownAfterClass(); - } - - function addDBData() { - $this->tablesUsed[] = 'site_stats'; - # disabled for performance - #$this->tablesUsed[] = 'image'; - - # Update certain things in site_stats - $this->db->insert( 'site_stats', - array( 'ss_row_id' => 1, 'ss_images' => 2, 'ss_good_articles' => 1 ), - __METHOD__ - ); - - $user = User::newFromId( 0 ); - LinkCache::singleton()->clear(); # Avoids the odd failure at creating the nullRevision - - # Upload DB table entries for files. - # We will upload the actual files later. Note that if anything causes LocalFile::load() - # to be triggered before then, it will break via maybeUpgrade() setting the fileExists - # member to false and storing it in cache. - # note that the size/width/height/bits/etc of the file - # are actually set by inspecting the file itself; the arguments - # to recordUpload2 have no effect. That said, we try to make things - # match up so it is less confusing to readers of the code & tests. - $image = wfLocalFile( Title::makeTitle( NS_FILE, 'Foobar.jpg' ) ); - if ( !$this->db->selectField( 'image', '1', array( 'img_name' => $image->getName() ) ) ) { - $image->recordUpload2( - '', // archive name - 'Upload of some lame file', - 'Some lame file', - array( - 'size' => 7881, - 'width' => 1941, - 'height' => 220, - 'bits' => 8, - 'media_type' => MEDIATYPE_BITMAP, - 'mime' => 'image/jpeg', - 'metadata' => serialize( array() ), - 'sha1' => wfBaseConvert( '1', 16, 36, 31 ), - 'fileExists' => true ), - $this->db->timestamp( '20010115123500' ), $user - ); - } - - $image = wfLocalFile( Title::makeTitle( NS_FILE, 'Thumb.png' ) ); - if ( !$this->db->selectField( 'image', '1', array( 'img_name' => $image->getName() ) ) ) { - $image->recordUpload2( - '', // archive name - 'Upload of some lame thumbnail', - 'Some lame thumbnail', - array( - 'size' => 22589, - 'width' => 135, - 'height' => 135, - 'bits' => 8, - 'media_type' => MEDIATYPE_BITMAP, - 'mime' => 'image/png', - 'metadata' => serialize( array() ), - 'sha1' => wfBaseConvert( '2', 16, 36, 31 ), - 'fileExists' => true ), - $this->db->timestamp( '20130225203040' ), $user - ); - } - - # This image will be blacklisted in [[MediaWiki:Bad image list]] - $image = wfLocalFile( Title::makeTitle( NS_FILE, 'Bad.jpg' ) ); - if ( !$this->db->selectField( 'image', '1', array( 'img_name' => $image->getName() ) ) ) { - $image->recordUpload2( - '', // archive name - 'zomgnotcensored', - 'Borderline image', - array( - 'size' => 12345, - 'width' => 320, - 'height' => 240, - 'bits' => 24, - 'media_type' => MEDIATYPE_BITMAP, - 'mime' => 'image/jpeg', - 'metadata' => serialize( array() ), - 'sha1' => wfBaseConvert( '3', 16, 36, 31 ), - 'fileExists' => true ), - $this->db->timestamp( '20010115123500' ), $user - ); - } - $image = wfLocalFile( Title::makeTitle( NS_FILE, 'Foobar.svg' ) ); - if ( !$this->db->selectField( 'image', '1', array( 'img_name' => $image->getName() ) ) ) { - $image->recordUpload2( '', 'Upload of some lame SVG', 'Some lame SVG', array( - 'size' => 12345, - 'width' => 200, - 'height' => 200, - 'bits' => 24, - 'media_type' => MEDIATYPE_DRAWING, - 'mime' => 'image/svg+xml', - 'metadata' => serialize( array() ), - 'sha1' => wfBaseConvert( '', 16, 36, 31 ), - 'fileExists' => true - ), $this->db->timestamp( '20010115123500' ), $user ); - } - } - - //ParserTest setup/teardown functions - - /** - * Set up the global variables for a consistent environment for each test. - * Ideally this should replace the global configuration entirely. - */ - protected function setupGlobals( $opts = array(), $config = '' ) { - global $wgFileBackends; - # Find out values for some special options. - $lang = - self::getOptionValue( 'language', $opts, 'en' ); - $variant = - self::getOptionValue( 'variant', $opts, false ); - $maxtoclevel = - self::getOptionValue( 'wgMaxTocLevel', $opts, 999 ); - $linkHolderBatchSize = - self::getOptionValue( 'wgLinkHolderBatchSize', $opts, 1000 ); - - $uploadDir = $this->getUploadDir(); - if ( $this->getCliArg( 'use-filebackend=' ) ) { - if ( self::$backendToUse ) { - $backend = self::$backendToUse; - } else { - $name = $this->getCliArg( 'use-filebackend=' ); - $useConfig = array(); - foreach ( $wgFileBackends as $conf ) { - if ( $conf['name'] == $name ) { - $useConfig = $conf; - } - } - $useConfig['name'] = 'local-backend'; // swap name - $class = $conf['class']; - self::$backendToUse = new $class( $useConfig ); - $backend = self::$backendToUse; - } - } else { - # Replace with a mock. We do not care about generating real - # files on the filesystem, just need to expose the file - # informations. - $backend = new MockFileBackend( array( - 'name' => 'local-backend', - 'lockManager' => 'nullLockManager', - 'containerPaths' => array( - 'local-public' => "$uploadDir", - 'local-thumb' => "$uploadDir/thumb", - ) - ) ); - } - - $settings = array( - 'wgLocalFileRepo' => array( - 'class' => 'LocalRepo', - 'name' => 'local', - 'url' => 'http://example.com/images', - 'hashLevels' => 2, - 'transformVia404' => false, - 'backend' => $backend - ), - 'wgEnableUploads' => self::getOptionValue( 'wgEnableUploads', $opts, true ), - 'wgLanguageCode' => $lang, - 'wgDBprefix' => $this->db->getType() != 'oracle' ? 'unittest_' : 'ut_', - 'wgRawHtml' => self::getOptionValue( 'wgRawHtml', $opts, false ), - 'wgNamespacesWithSubpages' => array( NS_MAIN => isset( $opts['subpage'] ) ), - 'wgAllowExternalImages' => self::getOptionValue( 'wgAllowExternalImages', $opts, true ), - 'wgMaxTocLevel' => $maxtoclevel, - 'wgUseTeX' => isset( $opts['math'] ) || isset( $opts['texvc'] ), - 'wgMathDirectory' => $uploadDir . '/math', - 'wgDefaultLanguageVariant' => $variant, - 'wgLinkHolderBatchSize' => $linkHolderBatchSize, - ); - - if ( $config ) { - $configLines = explode( "\n", $config ); - - foreach ( $configLines as $line ) { - list( $var, $value ) = explode( '=', $line, 2 ); - - $settings[$var] = eval( "return $value;" ); //??? - } - } - - $this->savedGlobals = array(); - - /** @since 1.20 */ - wfRunHooks( 'ParserTestGlobals', array( &$settings ) ); - - $langObj = Language::factory( $lang ); - $settings['wgContLang'] = $langObj; - $settings['wgLang'] = $langObj; - - $context = new RequestContext(); - $settings['wgOut'] = $context->getOutput(); - $settings['wgUser'] = $context->getUser(); - $settings['wgRequest'] = $context->getRequest(); - - foreach ( $settings as $var => $val ) { - if ( array_key_exists( $var, $GLOBALS ) ) { - $this->savedGlobals[$var] = $GLOBALS[$var]; - } - - $GLOBALS[$var] = $val; - } - - MagicWord::clearCache(); - - # The entries saved into RepoGroup cache with previous globals will be wrong. - RepoGroup::destroySingleton(); - FileBackendGroup::destroySingleton(); - - # Create dummy files in storage - $this->setupUploads(); - - # Publish the articles after we have the final language set - $this->publishTestArticles(); - - MessageCache::destroyInstance(); - - return $context; - } - - /** - * Get an FS upload directory (only applies to FSFileBackend) - * - * @return String: the directory - */ - protected function getUploadDir() { - if ( $this->keepUploads ) { - $dir = wfTempDir() . '/mwParser-images'; - - if ( is_dir( $dir ) ) { - return $dir; - } - } else { - $dir = wfTempDir() . "/mwParser-" . mt_rand() . "-images"; - } - - // wfDebug( "Creating upload directory $dir\n" ); - if ( file_exists( $dir ) ) { - wfDebug( "Already exists!\n" ); - - return $dir; - } - - return $dir; - } - - /** - * Create a dummy uploads directory which will contain a couple - * of files in order to pass existence tests. - * - * @return String: the directory - */ - protected function setupUploads() { - global $IP; - - $base = $this->getBaseDir(); - $backend = RepoGroup::singleton()->getLocalRepo()->getBackend(); - $backend->prepare( array( 'dir' => "$base/local-public/3/3a" ) ); - $backend->store( array( - 'src' => "$IP/skins/monobook/headbg.jpg", 'dst' => "$base/local-public/3/3a/Foobar.jpg" - ) ); - $backend->prepare( array( 'dir' => "$base/local-public/e/ea" ) ); - $backend->store( array( - 'src' => "$IP/skins/monobook/wiki.png", 'dst' => "$base/local-public/e/ea/Thumb.png" - ) ); - $backend->prepare( array( 'dir' => "$base/local-public/0/09" ) ); - $backend->store( array( - 'src' => "$IP/skins/monobook/headbg.jpg", 'dst' => "$base/local-public/0/09/Bad.jpg" - ) ); - - // No helpful SVG file to copy, so make one ourselves - $tmpDir = wfTempDir(); - $tempFsFile = new TempFSFile( "$tmpDir/Foobar.svg" ); - $tempFsFile->autocollect(); // destroy file when $tempFsFile leaves scope - file_put_contents( "$tmpDir/Foobar.svg", - '' . - 'Foo' ); - - $backend->prepare( array( 'dir' => "$base/local-public/f/ff" ) ); - $backend->quickStore( array( - 'src' => "$tmpDir/Foobar.svg", 'dst' => "$base/local-public/f/ff/Foobar.svg" - ) ); - } - - /** - * Restore default values and perform any necessary clean-up - * after each test runs. - */ - protected function teardownGlobals() { - $this->teardownUploads(); - - foreach ( $this->savedGlobals as $var => $val ) { - $GLOBALS[$var] = $val; - } - } - - /** - * Remove the dummy uploads directory - */ - private function teardownUploads() { - if ( $this->keepUploads ) { - return; - } - - $backend = RepoGroup::singleton()->getLocalRepo()->getBackend(); - if ( $backend instanceof MockFileBackend ) { - # In memory backend, so dont bother cleaning them up. - return; - } - - $base = $this->getBaseDir(); - // delete the files first, then the dirs. - self::deleteFiles( - array( - "$base/local-public/3/3a/Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/180px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/200px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/640px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/120px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/1280px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/20px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/270px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/300px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/30px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/360px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/400px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/40px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/70px-Foobar.jpg", - "$base/local-thumb/3/3a/Foobar.jpg/960px-Foobar.jpg", - - "$base/local-public/e/ea/Thumb.png", - - "$base/local-public/0/09/Bad.jpg", - - "$base/local-public/f/ff/Foobar.svg", - "$base/local-thumb/f/ff/Foobar.svg/180px-Foobar.svg.jpg", - "$base/local-thumb/f/ff/Foobar.svg/270px-Foobar.svg.jpg", - "$base/local-thumb/f/ff/Foobar.svg/360px-Foobar.svg.jpg", - "$base/local-thumb/f/ff/Foobar.svg/langde-180px-Foobar.svg.jpg", - "$base/local-thumb/f/ff/Foobar.svg/langde-270px-Foobar.svg.jpg", - "$base/local-thumb/f/ff/Foobar.svg/langde-360px-Foobar.svg.jpg", - - "$base/local-public/math/f/a/5/fa50b8b616463173474302ca3e63586b.png", - ) - ); - } - - /** - * Delete the specified files, if they exist. - * @param $files Array: full paths to files to delete. - */ - private static function deleteFiles( $files ) { - $backend = RepoGroup::singleton()->getLocalRepo()->getBackend(); - foreach ( $files as $file ) { - $backend->delete( array( 'src' => $file ), array( 'force' => 1 ) ); - } - foreach ( $files as $file ) { - $tmp = $file; - while ( $tmp = FileBackend::parentStoragePath( $tmp ) ) { - if ( !$backend->clean( array( 'dir' => $tmp ) )->isOK() ) { - break; - } - } - } - } - - protected function getBaseDir() { - return 'mwstore://local-backend'; - } - - public function parserTestProvider() { - if ( $this->file === false ) { - global $wgParserTestFiles; - $this->file = $wgParserTestFiles[0]; - } - - return new TestFileIterator( $this->file, $this ); - } - - /** - * Set the file from whose tests will be run by this instance - */ - public function setParserTestFile( $filename ) { - $this->file = $filename; - } - - /** - * @group medium - * @dataProvider parserTestProvider - */ - public function testParserTest( $desc, $input, $result, $opts, $config ) { - if ( $this->regex != '' && !preg_match( '/' . $this->regex . '/', $desc ) ) { - $this->assertTrue( true ); // XXX: don't flood output with "test made no assertions" - //$this->markTestSkipped( 'Filtered out by the user' ); - return; - } - - if ( !$this->isWikitextNS( NS_MAIN ) ) { - // parser tests frequently assume that the main namespace contains wikitext. - // @todo When setting up pages, force the content model. Only skip if - // $wgtContentModelUseDB is false. - $this->markTestSkipped( "Main namespace does not support wikitext," - . "skipping parser test: $desc" ); - } - - wfDebug( "Running parser test: $desc\n" ); - - $opts = $this->parseOptions( $opts ); - $context = $this->setupGlobals( $opts, $config ); - - $user = $context->getUser(); - $options = ParserOptions::newFromContext( $context ); - - if ( isset( $opts['title'] ) ) { - $titleText = $opts['title']; - } else { - $titleText = 'Parser test'; - } - - $local = isset( $opts['local'] ); - $preprocessor = isset( $opts['preprocessor'] ) ? $opts['preprocessor'] : null; - $parser = $this->getParser( $preprocessor ); - - $title = Title::newFromText( $titleText ); - - # Parser test requiring math. Make sure texvc is executable - # or just skip such tests. - if ( isset( $opts['math'] ) || isset( $opts['texvc'] ) ) { - global $wgTexvc; - - if ( !isset( $wgTexvc ) ) { - $this->markTestSkipped( "SKIPPED: \$wgTexvc is not set" ); - } elseif ( !is_executable( $wgTexvc ) ) { - $this->markTestSkipped( "SKIPPED: texvc binary does not exist" - . " or is not executable.\n" - . "Current configuration is:\n\$wgTexvc = '$wgTexvc'" ); - } - } - - if ( isset( $opts['pst'] ) ) { - $out = $parser->preSaveTransform( $input, $title, $user, $options ); - } elseif ( isset( $opts['msg'] ) ) { - $out = $parser->transformMsg( $input, $options, $title ); - } elseif ( isset( $opts['section'] ) ) { - $section = $opts['section']; - $out = $parser->getSection( $input, $section ); - } elseif ( isset( $opts['replace'] ) ) { - $section = $opts['replace'][0]; - $replace = $opts['replace'][1]; - $out = $parser->replaceSection( $input, $section, $replace ); - } elseif ( isset( $opts['comment'] ) ) { - $out = Linker::formatComment( $input, $title, $local ); - } elseif ( isset( $opts['preload'] ) ) { - $out = $parser->getPreloadText( $input, $title, $options ); - } else { - $output = $parser->parse( $input, $title, $options, true, true, 1337 ); - $output->setTOCEnabled( !isset( $opts['notoc'] ) ); - $out = $output->getText(); - - if ( isset( $opts['showtitle'] ) ) { - if ( $output->getTitleText() ) { - $title = $output->getTitleText(); - } - - $out = "$title\n$out"; - } - - if ( isset( $opts['ill'] ) ) { - $out = $this->tidy( implode( ' ', $output->getLanguageLinks() ) ); - } elseif ( isset( $opts['cat'] ) ) { - $outputPage = $context->getOutput(); - $outputPage->addCategoryLinks( $output->getCategories() ); - $cats = $outputPage->getCategoryLinks(); - - if ( isset( $cats['normal'] ) ) { - $out = $this->tidy( implode( ' ', $cats['normal'] ) ); - } else { - $out = ''; - } - } - $parser->mPreprocessor = null; - - $result = $this->tidy( $result ); - } - - $this->teardownGlobals(); - - $this->assertEquals( $result, $out, $desc ); - } - - /** - * Run a fuzz test series - * Draw input from a set of test files - * - * @todo fixme Needs some work to not eat memory until the world explodes - * - * @group ParserFuzz - */ - public function testFuzzTests() { - global $wgParserTestFiles; - - $files = $wgParserTestFiles; - - if ( $this->getCliArg( 'file=' ) ) { - $files = array( $this->getCliArg( 'file=' ) ); - } - - $dict = $this->getFuzzInput( $files ); - $dictSize = strlen( $dict ); - $logMaxLength = log( $this->maxFuzzTestLength ); - - ini_set( 'memory_limit', $this->memoryLimit * 1048576 ); - - $user = new User; - $opts = ParserOptions::newFromUser( $user ); - $title = Title::makeTitle( NS_MAIN, 'Parser_test' ); - - $id = 1; - - while ( true ) { - - // Generate test input - mt_srand( ++$this->fuzzSeed ); - $totalLength = mt_rand( 1, $this->maxFuzzTestLength ); - $input = ''; - - while ( strlen( $input ) < $totalLength ) { - $logHairLength = mt_rand( 0, 1000000 ) / 1000000 * $logMaxLength; - $hairLength = min( intval( exp( $logHairLength ) ), $dictSize ); - $offset = mt_rand( 0, $dictSize - $hairLength ); - $input .= substr( $dict, $offset, $hairLength ); - } - - $this->setupGlobals(); - $parser = $this->getParser(); - - // Run the test - try { - $parser->parse( $input, $title, $opts ); - $this->assertTrue( true, "Test $id, fuzz seed {$this->fuzzSeed}" ); - } catch ( Exception $exception ) { - $input_dump = sprintf( "string(%d) \"%s\"\n", strlen( $input ), $input ); - - $this->assertTrue( false, "Test $id, fuzz seed {$this->fuzzSeed}. \n\n" . - "Input: $input_dump\n\nError: {$exception->getMessage()}\n\n" . - "Backtrace: {$exception->getTraceAsString()}" ); - } - - $this->teardownGlobals(); - $parser->__destruct(); - - if ( $id % 100 == 0 ) { - $usage = intval( memory_get_usage( true ) / $this->memoryLimit / 1048576 * 100 ); - //echo "{$this->fuzzSeed}: $numSuccess/$numTotal (mem: $usage%)\n"; - if ( $usage > 90 ) { - $ret = "Out of memory:\n"; - $memStats = $this->getMemoryBreakdown(); - - foreach ( $memStats as $name => $usage ) { - $ret .= "$name: $usage\n"; - } - - throw new MWException( $ret ); - } - } - - $id++; - } - } - - //Various getter functions - - /** - * Get an input dictionary from a set of parser test files - */ - function getFuzzInput( $filenames ) { - $dict = ''; - - foreach ( $filenames as $filename ) { - $contents = file_get_contents( $filename ); - preg_match_all( '/!!\s*input\n(.*?)\n!!\s*result/s', $contents, $matches ); - - foreach ( $matches[1] as $match ) { - $dict .= $match . "\n"; - } - } - - return $dict; - } - - /** - * Get a memory usage breakdown - */ - function getMemoryBreakdown() { - $memStats = array(); - - foreach ( $GLOBALS as $name => $value ) { - $memStats['$' . $name] = strlen( serialize( $value ) ); - } - - $classes = get_declared_classes(); - - foreach ( $classes as $class ) { - $rc = new ReflectionClass( $class ); - $props = $rc->getStaticProperties(); - $memStats[$class] = strlen( serialize( $props ) ); - $methods = $rc->getMethods(); - - foreach ( $methods as $method ) { - $memStats[$class] += strlen( serialize( $method->getStaticVariables() ) ); - } - } - - $functions = get_defined_functions(); - - foreach ( $functions['user'] as $function ) { - $rf = new ReflectionFunction( $function ); - $memStats["$function()"] = strlen( serialize( $rf->getStaticVariables() ) ); - } - - asort( $memStats ); - - return $memStats; - } - - /** - * Get a Parser object - */ - function getParser( $preprocessor = null ) { - global $wgParserConf; - - $class = $wgParserConf['class']; - $parser = new $class( array( 'preprocessorClass' => $preprocessor ) + $wgParserConf ); - - wfRunHooks( 'ParserTestParser', array( &$parser ) ); - - return $parser; - } - - //Various action functions - - public function addArticle( $name, $text, $line ) { - self::$articles[$name] = array( $text, $line ); - } - - public function publishTestArticles() { - if ( empty( self::$articles ) ) { - return; - } - - foreach ( self::$articles as $name => $info ) { - list( $text, $line ) = $info; - ParserTest::addArticle( $name, $text, $line, 'ignoreduplicate' ); - } - } - - /** - * Steal a callback function from the primary parser, save it for - * application to our scary parser. If the hook is not installed, - * abort processing of this file. - * - * @param $name String - * @return Bool true if tag hook is present - */ - public function requireHook( $name ) { - global $wgParser; - $wgParser->firstCallInit(); // make sure hooks are loaded. - return isset( $wgParser->mTagHooks[$name] ); - } - - public function requireFunctionHook( $name ) { - global $wgParser; - $wgParser->firstCallInit(); // make sure hooks are loaded. - return isset( $wgParser->mFunctionHooks[$name] ); - } - - //Various "cleanup" functions - - /** - * Run the "tidy" command on text if the $wgUseTidy - * global is true - * - * @param $text String: the text to tidy - * @return String - */ - protected function tidy( $text ) { - global $wgUseTidy; - - if ( $wgUseTidy ) { - $text = MWTidy::tidy( $text ); - } - - return $text; - } - - /** - * Remove last character if it is a newline - */ - public function removeEndingNewline( $s ) { - if ( substr( $s, -1 ) === "\n" ) { - return substr( $s, 0, -1 ); - } else { - return $s; - } - } - - //Test options parser functions - - protected function parseOptions( $instring ) { - $opts = array(); - // foo - // foo=bar - // foo="bar baz" - // foo=[[bar baz]] - // foo=bar,"baz quux" - $regex = '/\b - ([\w-]+) # Key - \b - (?:\s* - = # First sub-value - \s* - ( - " - [^"]* # Quoted val - " - | - \[\[ - [^]]* # Link target - \]\] - | - [\w-]+ # Plain word - ) - (?:\s* - , # Sub-vals 1..N - \s* - ( - "[^"]*" # Quoted val - | - \[\[[^]]*\]\] # Link target - | - [\w-]+ # Plain word - ) - )* - )? - /x'; - - if ( preg_match_all( $regex, $instring, $matches, PREG_SET_ORDER ) ) { - foreach ( $matches as $bits ) { - array_shift( $bits ); - $key = strtolower( array_shift( $bits ) ); - if ( count( $bits ) == 0 ) { - $opts[$key] = true; - } elseif ( count( $bits ) == 1 ) { - $opts[$key] = $this->cleanupOption( array_shift( $bits ) ); - } else { - // Array! - $opts[$key] = array_map( array( $this, 'cleanupOption' ), $bits ); - } - } - } - - return $opts; - } - - protected function cleanupOption( $opt ) { - if ( substr( $opt, 0, 1 ) == '"' ) { - return substr( $opt, 1, -1 ); - } - - if ( substr( $opt, 0, 2 ) == '[[' ) { - return substr( $opt, 2, -2 ); - } - - return $opt; - } - - /** - * Use a regex to find out the value of an option - * @param $key String: name of option val to retrieve - * @param $opts Options array to look in - * @param $default Mixed: default value returned if not found - */ - protected static function getOptionValue( $key, $opts, $default ) { - $key = strtolower( $key ); - - if ( isset( $opts[$key] ) ) { - return $opts[$key]; - } else { - return $default; - } - } -} diff --git a/tests/phpunit/includes/parser/ParserMethodsTest.php b/tests/phpunit/includes/parser/ParserMethodsTest.php deleted file mode 100644 index e5c5cb21..00000000 --- a/tests/phpunit/includes/parser/ParserMethodsTest.php +++ /dev/null @@ -1,95 +0,0 @@ -~~~', - 'hello \'\'this\'\' is ~~~', - ), - ); - } - - /** - * @dataProvider providePreSaveTransform - * @covers Parser::preSaveTransform - */ - public function testPreSaveTransform( $text, $expected ) { - global $wgParser; - - $title = Title::newFromText( str_replace( '::', '__', __METHOD__ ) ); - $user = new User(); - $user->setName( "127.0.0.1" ); - $popts = ParserOptions::newFromUser( $user ); - $text = $wgParser->preSaveTransform( $text, $title, $user, $popts ); - - $this->assertEquals( $expected, $text ); - } - - /** - * @covers Parser::callParserFunction - */ - public function testCallParserFunction() { - global $wgParser; - - // Normal parses test passing PPNodes. Test passing an array. - $title = Title::newFromText( str_replace( '::', '__', __METHOD__ ) ); - $wgParser->startExternalParse( $title, new ParserOptions(), Parser::OT_HTML ); - $frame = $wgParser->getPreprocessor()->newFrame(); - $ret = $wgParser->callParserFunction( $frame, '#tag', - array( 'pre', 'foo', 'style' => 'margin-left: 1.6em' ) - ); - $ret['text'] = $wgParser->mStripState->unstripBoth( $ret['text'] ); - $this->assertSame( array( - 'found' => true, - 'text' => '
            foo
            ', - ), $ret, 'callParserFunction works for {{#tag:pre|foo|style=margin-left: 1.6em}}' ); - } - - /** - * @covers Parser::parse - * @covers ParserOutput::getSections - */ - public function testGetSections() { - global $wgParser; - - $title = Title::newFromText( str_replace( '::', '__', __METHOD__ ) ); - $out = $wgParser->parse( "==foo==\n

            bar

            \n==baz==\n", $title, new ParserOptions() ); - $this->assertSame( array( - array( - 'toclevel' => 1, - 'level' => '2', - 'line' => 'foo', - 'number' => '1', - 'index' => '1', - 'fromtitle' => $title->getPrefixedDBkey(), - 'byteoffset' => 0, - 'anchor' => 'foo', - ), - array( - 'toclevel' => 1, - 'level' => '2', - 'line' => 'bar', - 'number' => '2', - 'index' => '', - 'fromtitle' => false, - 'byteoffset' => null, - 'anchor' => 'bar', - ), - array( - 'toclevel' => 1, - 'level' => '2', - 'line' => 'baz', - 'number' => '3', - 'index' => '2', - 'fromtitle' => $title->getPrefixedDBkey(), - 'byteoffset' => 21, - 'anchor' => 'baz', - ), - ), $out->getSections(), 'getSections() with proper value when

            is used' ); - } - //@Todo Add tests for cleanSig() / cleanSigInSig(), getSection(), replaceSection(), getPreloadText() -} diff --git a/tests/phpunit/includes/parser/ParserOutputTest.php b/tests/phpunit/includes/parser/ParserOutputTest.php deleted file mode 100644 index c73666da..00000000 --- a/tests/phpunit/includes/parser/ParserOutputTest.php +++ /dev/null @@ -1,59 +0,0 @@ -assertEquals( $shouldMatch, ParserOutput::isLinkInternal( $server, $url ) ); - } - - /** - * @covers ParserOutput::setExtensionData - * @covers ParserOutput::getExtensionData - */ - public function testExtensionData() { - $po = new ParserOutput(); - - $po->setExtensionData( "one", "Foo" ); - - $this->assertEquals( "Foo", $po->getExtensionData( "one" ) ); - $this->assertNull( $po->getExtensionData( "spam" ) ); - - $po->setExtensionData( "two", "Bar" ); - $this->assertEquals( "Foo", $po->getExtensionData( "one" ) ); - $this->assertEquals( "Bar", $po->getExtensionData( "two" ) ); - - $po->setExtensionData( "one", null ); - $this->assertNull( $po->getExtensionData( "one" ) ); - $this->assertEquals( "Bar", $po->getExtensionData( "two" ) ); - } -} diff --git a/tests/phpunit/includes/parser/ParserPreloadTest.php b/tests/phpunit/includes/parser/ParserPreloadTest.php deleted file mode 100644 index d12fee36..00000000 --- a/tests/phpunit/includes/parser/ParserPreloadTest.php +++ /dev/null @@ -1,80 +0,0 @@ -testParserOptions = ParserOptions::newFromUserAndLang( new User, $wgContLang ); - - $this->testParser = new Parser(); - $this->testParser->Options( $this->testParserOptions ); - $this->testParser->clearState(); - - $this->title = Title::newFromText( 'Preload Test' ); - } - - protected function tearDown() { - parent::tearDown(); - - unset( $this->testParser ); - unset( $this->title ); - } - - /** - * @covers Parser::getPreloadText - */ - public function testPreloadSimpleText() { - $this->assertPreloaded( 'simple', 'simple' ); - } - - /** - * @covers Parser::getPreloadText - */ - public function testPreloadedPreIsUnstripped() { - $this->assertPreloaded( - '
            monospaced
            ', - '
            monospaced
            ', - '
             in preloaded text must be unstripped (bug 27467)'
            -		);
            -	}
            -
            -	/**
            -	 * @covers Parser::getPreloadText
            -	 */
            -	public function testPreloadedNowikiIsUnstripped() {
            -		$this->assertPreloaded(
            -			'[[Dummy title]]',
            -			'[[Dummy title]]',
            -			' in preloaded text must be unstripped (bug 27467)'
            -		);
            -	}
            -
            -	protected function assertPreloaded( $expected, $text, $msg = '' ) {
            -		$this->assertEquals(
            -			$expected,
            -			$this->testParser->getPreloadText(
            -				$text,
            -				$this->title,
            -				$this->testParserOptions
            -			),
            -			$msg
            -		);
            -	}
            -}
            diff --git a/tests/phpunit/includes/parser/PreprocessorTest.php b/tests/phpunit/includes/parser/PreprocessorTest.php
            deleted file mode 100644
            index 8aee937c..00000000
            --- a/tests/phpunit/includes/parser/PreprocessorTest.php
            +++ /dev/null
            @@ -1,239 +0,0 @@
            -mOptions = ParserOptions::newFromUserAndLang( new User, $wgContLang );
            -		$name = isset( $wgParserConf['preprocessorClass'] ) ? $wgParserConf['preprocessorClass'] : 'Preprocessor_DOM';
            -
            -		$this->mPreprocessor = new $name( $this );
            -	}
            -
            -	function getStripList() {
            -		return array( 'gallery', 'display map' /* Used by Maps, see r80025 CR */, '/foo' );
            -	}
            -
            -	public static function provideCases() {
            -		return array(
            -			array( "Foo", "Foo" ),
            -			array( "", "<!-- Foo -->" ),
            -			array( "", "<!-- Foo --><!-- Bar -->" ),
            -			array( "  ", "<!-- Foo -->  <!-- Bar -->" ),
            -			array( " \n ", "<!-- Foo --> \n <!-- Bar -->" ),
            -			array( " \n \n", "<!-- Foo --> \n <!-- Bar -->\n" ),
            -			array( "  \n", "<!-- Foo -->  <!-- Bar -->\n" ),
            -			array( "Bar", "<!-->Bar" ),
            -			array( "\n== Baz ==\n", "== Foo ==\n  <!-- Bar -->\n== Baz ==\n" ),
            -			array( "", "gallery" ),
            -			array( "Foo  Bar", "Foo gallery Bar" ),
            -			array( "", "gallery</gallery>" ),
            -			array( " ", "<foo> gallery</gallery>" ),
            -			array( " ", "<foo> gallery<gallery></gallery>" ),
            -			array( " Foo bar ", "<noinclude> Foo bar </noinclude>" ),
            -			array( "\n{{Foo}}\n", "<noinclude>\n\n</noinclude>" ),
            -			array( "\n{{Foo}}\n\n", "<noinclude>\n\n</noinclude>\n" ),
            -			array( "foo bar", "galleryfoo bar" ),
            -			array( "<{{foo}}>", "<>" ),
            -			array( "<{{{foo}}}>", "<foo>" ),
            -			array( "", "gallery</gallery</gallery>" ),
            -			array( "=== Foo === ", "=== Foo === " ),
            -			array( "=== Foo === ", "==<!-- -->= Foo === " ),
            -			array( "=== Foo === ", "=== Foo ==<!-- -->= " ),
            -			array( "=== Foo ===\n", "=== Foo ===<!-- -->\n" ),
            -			array( "=== Foo === \n", "=== Foo ===<!-- --> <!-- -->\n" ),
            -			array( "== Foo ==\n== Bar == \n", "== Foo ==\n== Bar == \n" ),
            -			array( "===========", "===========" ),
            -			array( "Foo\n=\n==\n=\n", "Foo\n=\n==\n=\n" ),
            -			array( "{{Foo}}", "" ),
            -			array( "\n{{Foo}}", "\n" ),
            -			array( "{{Foo|bar}}", "" ),
            -			array( "{{Foo|bar}}a", "a" ),
            -			array( "{{Foo|bar|baz}}", "" ),
            -			array( "{{Foo|1=bar}}", "" ),
            -			array( "{{Foo|=bar}}", "" ),
            -			array( "{{Foo|bar=baz}}", "" ),
            -			array( "{{Foo|{{bar}}=baz}}", "" ),
            -			array( "{{Foo|1=bar|baz}}", "" ),
            -			array( "{{Foo|1=bar|2=baz}}", "" ),
            -			array( "{{Foo|bar|foo=baz}}", "" ),
            -			array( "{{{1}}}", "1" ),
            -			array( "{{{1|}}}", "1" ),
            -			array( "{{{Foo}}}", "Foo" ),
            -			array( "{{{Foo|}}}", "Foo" ),
            -			array( "{{{Foo|bar|baz}}}", "Foobarbaz" ),
            -			array( "{{Foo}}", "{<!-- -->{Foo}}" ),
            -			array( "{{{{Foobar}}}}", "{Foobar}" ),
            -			array( "{{{ {{Foo}} }}}", " <template><title>Foo " ),
            -			array( "{{ {{{Foo}}} }}", "" ),
            -			array( "{{{{{Foo}}}}}", "" ),
            -			array( "{{{{{Foo}} }}}", "<template><title>Foo " ),
            -			array( "{{{{{{Foo}}}}}}", "<tplarg><title>Foo" ),
            -			array( "{{{{{{Foo}}}}}", "{" ),
            -			array( "[[[Foo]]", "[[[Foo]]" ),
            -			array( "{{Foo|[[[[bar]]|baz]]}}", "" ), // This test is important, since it means the difference between having the [[ rule stacked or not
            -			array( "{{Foo|[[[[bar]|baz]]}}", "{{Foo|[[[[bar]|baz]]}}" ),
            -			array( "{{Foo|Foo [[[[bar]|baz]]}}", "{{Foo|Foo [[[[bar]|baz]]}}" ),
            -			array( "Foo BarBaz", "Foo display mapBar</display map             >Baz" ),
            -			array( "Foo BarBaz", "Foo display map fooBar</display map             >Baz" ),
            -			array( "Foo ", "Foo gallery bar="baz" " ),
            -			array( "Foo ", "Foo gallery bar="1" baz=2 " ),
            -			array( "Foo", "/fooFoo<//foo>" ), # Worth blacklisting IMHO
            -			array( "{{#ifexpr: ({{{1|1}}} = 2) | Foo | Bar }}", "" ),
            -			array( "{{#if: {{{1|}}} | Foo | {{Bar}} }}", "" ),
            -			array( "{{#if: {{{1|}}} | Foo | [[Bar]] }}", "" ),
            -			array( "{{#if: {{{1|}}} | [[Foo]] | Bar }}", "" ),
            -			array( "{{#if: {{{1|}}} | 1 | {{#if: {{{1|}}} | 2 | 3 }} }}", "" ),
            -			array( "{{ {{Foo}}", "{{ " ),
            -			array( "{{Foobar {{Foo}} {{Bar}} {{Baz}} ", "{{Foobar    " ),
            -			array( "[[Foo]] |", "[[Foo]] |" ),
            -			array( "{{Foo|Bar|", "{{Foo|Bar|" ),
            -			array( "[[Foo]", "[[Foo]" ),
            -			array( "[[Foo|Bar]", "[[Foo|Bar]" ),
            -			array( "{{Foo| [[Bar] }}", "{{Foo| [[Bar] }}" ),
            -			array( "{{Foo| [[Bar|Baz] }}", "{{Foo| [[Bar|Baz] }}" ),
            -			array( "{{Foo|bar=[[baz]}}", "{{Foo|bar=[[baz]}}" ),
            -			array( "{{foo|", "{{foo|" ),
            -			array( "{{foo|}", "{{foo|}" ),
            -			array( "{{foo|} }}", "" ),
            -			array( "{{foo|bar=|}", "{{foo|bar=|}" ),
            -			array( "{{Foo|} Bar=", "{{Foo|} Bar=" ),
            -			array( "{{Foo|} Bar=}}", "" ),
            -			/* array( file_get_contents( __DIR__ . '/QuoteQuran.txt' ), file_get_contents( __DIR__ . '/QuoteQuranExpanded.txt' ) ), */
            -		);
            -	}
            -
            -	/**
            -	 * Get XML preprocessor tree from the preprocessor (which may not be the
            -	 * native XML-based one).
            -	 *
            -	 * @param string $wikiText
            -	 * @return string
            -	 */
            -	protected function preprocessToXml( $wikiText ) {
            -		if ( method_exists( $this->mPreprocessor, 'preprocessToXml' ) ) {
            -			return $this->normalizeXml( $this->mPreprocessor->preprocessToXml( $wikiText ) );
            -		}
            -
            -		$dom = $this->mPreprocessor->preprocessToObj( $wikiText );
            -		if ( is_callable( array( $dom, 'saveXML' ) ) ) {
            -			return $dom->saveXML();
            -		} else {
            -			return $this->normalizeXml( $dom->__toString() );
            -		}
            -	}
            -
            -	/**
            -	 * Normalize XML string to the form that a DOMDocument saves out.
            -	 *
            -	 * @param string $xml
            -	 * @return string
            -	 */
            -	protected function normalizeXml( $xml ) {
            -		return preg_replace( '!<([a-z]+)/>!', '<$1>', str_replace( ' />', '/>', $xml ) );
            -	}
            -
            -	/**
            -	 * @dataProvider provideCases
            -	 * @covers Preprocessor_DOM::preprocessToXml
            -	 */
            -	public function testPreprocessorOutput( $wikiText, $expectedXml ) {
            -		$this->assertEquals( $this->normalizeXml( $expectedXml ), $this->preprocessToXml( $wikiText ) );
            -	}
            -
            -	/**
            -	 * These are more complex test cases taken out of wiki articles.
            -	 */
            -	public static function provideFiles() {
            -		return array(
            -			array( "QuoteQuran" ), # http://en.wikipedia.org/w/index.php?title=Template:QuoteQuran/sandbox&oldid=237348988 GFDL + CC-BY-SA by Striver
            -			array( "Factorial" ), # http://en.wikipedia.org/w/index.php?title=Template:Factorial&oldid=98548758 GFDL + CC-BY-SA by Polonium
            -			array( "All_system_messages" ), # http://tl.wiktionary.org/w/index.php?title=Suleras:All_system_messages&oldid=2765 GPL text generated by MediaWiki
            -			array( "Fundraising" ), # http://tl.wiktionary.org/w/index.php?title=MediaWiki:Sitenotice&oldid=5716 GFDL + CC-BY-SA, copied there by Sky Harbor.
            -			array( "NestedTemplates" ), # bug 27936
            -		);
            -	}
            -
            -	/**
            -	 * @dataProvider provideFiles
            -	 * @covers Preprocessor_DOM::preprocessToXml
            -	 */
            -	public function testPreprocessorOutputFiles( $filename ) {
            -		$folder = __DIR__ . "/../../../parser/preprocess";
            -		$wikiText = file_get_contents( "$folder/$filename.txt" );
            -		$output = $this->preprocessToXml( $wikiText );
            -
            -		$expectedFilename = "$folder/$filename.expected";
            -		if ( file_exists( $expectedFilename ) ) {
            -			$expectedXml = $this->normalizeXml( file_get_contents( $expectedFilename ) );
            -			$this->assertEquals( $expectedXml, $output );
            -		} else {
            -			$tempFilename = tempnam( $folder, "$filename." );
            -			file_put_contents( $tempFilename, $output );
            -			$this->markTestIncomplete( "File $expectedFilename missing. Output stored as $tempFilename" );
            -		}
            -	}
            -
            -	/**
            -	 * Tests from Bug 28642 · https://bugzilla.wikimedia.org/28642
            -	 */
            -	public static function provideHeadings() {
            -		return array( /* These should become headings: */
            -			array( "== h ==", "== h ==<!--c1-->" ),
            -			array( "== h == 	", "== h == 	<!--c1-->" ),
            -			array( "== h == 	", "== h ==<!--c1--> 	" ),
            -			array( "== h == 	 	", "== h == 	<!--c1--> 	" ),
            -			array( "== h ==", "== h ==<!--c1--><!--c2-->" ),
            -			array( "== h == 	", "== h == 	<!--c1--><!--c2-->" ),
            -			array( "== h == 	", "== h ==<!--c1--><!--c2--> 	" ),
            -			array( "== h == 	 	", "== h == 	<!--c1--><!--c2--> 	" ),
            -			array( "== h == 	  ", "== h == 	<!--c1-->  <!--c2-->" ),
            -			array( "== h ==   	", "== h ==<!--c1-->  <!--c2--> 	" ),
            -			array( "== h == 	   	", "== h == 	<!--c1-->  <!--c2--> 	" ),
            -			array( "== h ==", "== h ==<!--c1--><!--c2--><!--c3-->" ),
            -			array( "== h ==  ", "== h ==<!--c1-->  <!--c2--><!--c3-->" ),
            -			array( "== h ==  ", "== h ==<!--c1--><!--c2-->  <!--c3-->" ),
            -			array( "== h ==    ", "== h ==<!--c1-->  <!--c2-->  <!--c3-->" ),
            -			array( "== h ==  ", "== h ==  <!--c1--><!--c2--><!--c3-->" ),
            -			array( "== h ==    ", "== h ==  <!--c1-->  <!--c2--><!--c3-->" ),
            -			array( "== h ==    ", "== h ==  <!--c1--><!--c2-->  <!--c3-->" ),
            -			array( "== h ==      ", "== h ==  <!--c1-->  <!--c2-->  <!--c3-->" ),
            -			array( "== h ==  ", "== h ==<!--c1--><!--c2--><!--c3-->  " ),
            -			array( "== h ==    ", "== h ==<!--c1-->  <!--c2--><!--c3-->  " ),
            -			array( "== h ==    ", "== h ==<!--c1--><!--c2-->  <!--c3-->  " ),
            -			array( "== h ==      ", "== h ==<!--c1-->  <!--c2-->  <!--c3-->  " ),
            -			array( "== h ==    ", "== h ==  <!--c1--><!--c2--><!--c3-->  " ),
            -			array( "== h ==      ", "== h ==  <!--c1-->  <!--c2--><!--c3-->  " ),
            -			array( "== h ==      ", "== h ==  <!--c1--><!--c2-->  <!--c3-->  " ),
            -			array( "== h ==        ", "== h ==  <!--c1-->  <!--c2-->  <!--c3-->  " ),
            -			array( "== h == 	", "== h ==<!--c1--> 	<!--c2-->" ),
            -			array( "== h == 	 	", "== h == 	<!--c1--> 	<!--c2-->" ),
            -			array( "== h == 	 	", "== h ==<!--c1--> 	<!--c2--> 	" ),
            -
            -			/* These are not working: */
            -			array( "== h == x   ", "== h == x <!--c1--><!--c2--><!--c3-->  " ),
            -			array( "== h == x   ", "== h ==<!--c1--> x <!--c2--><!--c3-->  " ),
            -			array( "== h == x ", "== h ==<!--c1--><!--c2--><!--c3--> x " ),
            -		);
            -	}
            -
            -	/**
            -	 * @dataProvider provideHeadings
            -	 * @covers Preprocessor_DOM::preprocessToXml
            -	 */
            -	public function testHeadings( $wikiText, $expectedXml ) {
            -		$this->assertEquals( $this->normalizeXml( $expectedXml ), $this->preprocessToXml( $wikiText ) );
            -	}
            -}
            diff --git a/tests/phpunit/includes/parser/TagHooksTest.php b/tests/phpunit/includes/parser/TagHooksTest.php
            deleted file mode 100644
            index 61cbe45d..00000000
            --- a/tests/phpunit/includes/parser/TagHooksTest.php
            +++ /dev/null
            @@ -1,82 +0,0 @@
            -bar" ), array( "foo\nbar" ), array( "foo\rbar" ) );
            -	}
            -
            -	protected function setUp() {
            -		parent::setUp();
            -
            -		$this->setMwGlobals( 'wgAlwaysUseTidy', false );
            -	}
            -
            -	/**
            -	 * @dataProvider provideValidNames
            -	 */
            -	public function testTagHooks( $tag ) {
            -		global $wgParserConf, $wgContLang;
            -		$parser = new Parser( $wgParserConf );
            -
            -		$parser->setHook( $tag, array( $this, 'tagCallback' ) );
            -		$parserOutput = $parser->parse( "Foo<$tag>BarBaz", Title::newFromText( 'Test' ), ParserOptions::newFromUserAndLang( new User, $wgContLang ) );
            -		$this->assertEquals( "

            FooOneBaz\n

            ", $parserOutput->getText() ); - - $parser->mPreprocessor = null; # Break the Parser <-> Preprocessor cycle - } - - /** - * @dataProvider provideBadNames - * @expectedException MWException - */ - public function testBadTagHooks( $tag ) { - global $wgParserConf, $wgContLang; - $parser = new Parser( $wgParserConf ); - - $parser->setHook( $tag, array( $this, 'tagCallback' ) ); - $parser->parse( "Foo<$tag>BarBaz", Title::newFromText( 'Test' ), ParserOptions::newFromUserAndLang( new User, $wgContLang ) ); - $this->fail( 'Exception not thrown.' ); - } - - /** - * @dataProvider provideValidNames - */ - public function testFunctionTagHooks( $tag ) { - global $wgParserConf, $wgContLang; - $parser = new Parser( $wgParserConf ); - - $parser->setFunctionTagHook( $tag, array( $this, 'functionTagCallback' ), 0 ); - $parserOutput = $parser->parse( "Foo<$tag>BarBaz", Title::newFromText( 'Test' ), ParserOptions::newFromUserAndLang( new User, $wgContLang ) ); - $this->assertEquals( "

            FooOneBaz\n

            ", $parserOutput->getText() ); - - $parser->mPreprocessor = null; # Break the Parser <-> Preprocessor cycle - } - - /** - * @dataProvider provideBadNames - * @expectedException MWException - */ - public function testBadFunctionTagHooks( $tag ) { - global $wgParserConf, $wgContLang; - $parser = new Parser( $wgParserConf ); - - $parser->setFunctionTagHook( $tag, array( $this, 'functionTagCallback' ), SFH_OBJECT_ARGS ); - $parser->parse( "Foo<$tag>BarBaz", Title::newFromText( 'Test' ), ParserOptions::newFromUserAndLang( new User, $wgContLang ) ); - $this->fail( 'Exception not thrown.' ); - } - - function tagCallback( $text, $params, $parser ) { - return str_rot13( $text ); - } - - function functionTagCallback( &$parser, $frame, $code, $attribs ) { - return str_rot13( $code ); - } -} diff --git a/tests/phpunit/includes/parser/TidyTest.php b/tests/phpunit/includes/parser/TidyTest.php deleted file mode 100644 index 57a88b9d..00000000 --- a/tests/phpunit/includes/parser/TidyTest.php +++ /dev/null @@ -1,44 +0,0 @@ -markTestSkipped( 'Tidy not found' ); - } - } - - /** - * @dataProvider provideTestWrapping - */ - public function testTidyWrapping( $expected, $text, $msg = '' ) { - $text = MWTidy::tidy( $text ); - // We don't care about where Tidy wants to stick is

            s - $text = trim( preg_replace( '##', '', $text ) ); - // Windows, we love you! - $text = str_replace( "\r", '', $text ); - $this->assertEquals( $expected, $text, $msg ); - } - - public function provideTestWrapping() { - return array( - array( - 'foo', - 'foo', - ' should survive tidy' - ), - array( - 'foo', - 'foo', - ' should survive tidy' - ), - array( 'foo', 'foo', ' should survive tidy' ), - array( "\nfoo", 'foo', ' should survive tidy' ), - array( "\nfoo", 'foo', ' should survive tidy' ), - ); - } -} \ No newline at end of file diff --git a/tests/phpunit/includes/search/SearchEngineTest.php b/tests/phpunit/includes/search/SearchEngineTest.php deleted file mode 100644 index 87067038..00000000 --- a/tests/phpunit/includes/search/SearchEngineTest.php +++ /dev/null @@ -1,176 +0,0 @@ -db->getType(); - $dbSupported = - ( $dbType === 'mysql' ) - || ( $dbType === 'sqlite' && $this->db->getFulltextSearchModule() == 'FTS3' ); - - if ( !$dbSupported ) { - $this->markTestSkipped( "MySQL or SQLite with FTS3 only" ); - } - - $searchType = $this->db->getSearchEngine(); - $this->search = new $searchType( $this->db ); - } - - protected function tearDown() { - unset( $this->search ); - - parent::tearDown(); - } - - function pageExists( $title ) { - return false; - } - - function addDBData() { - if ( $this->pageExists( 'Not_Main_Page' ) ) { - return; - } - - if ( !$this->isWikitextNS( NS_MAIN ) ) { - // @todo cover the case of non-wikitext content in the main namespace - return; - } - - $this->insertPage( "Not_Main_Page", "This is not a main page", 0 ); - $this->insertPage( 'Talk:Not_Main_Page', 'This is not a talk page to the main page, see [[smithee]]', 1 ); - $this->insertPage( 'Smithee', 'A smithee is one who smiths. See also [[Alan Smithee]]', 0 ); - $this->insertPage( 'Talk:Smithee', 'This article sucks.', 1 ); - $this->insertPage( 'Unrelated_page', 'Nothing in this page is about the S word.', 0 ); - $this->insertPage( 'Another_page', 'This page also is unrelated.', 0 ); - $this->insertPage( 'Help:Help', 'Help me!', 4 ); - $this->insertPage( 'Thppt', 'Blah blah', 0 ); - $this->insertPage( 'Alan_Smithee', 'yum', 0 ); - $this->insertPage( 'Pages', 'are\'food', 0 ); - $this->insertPage( 'HalfOneUp', 'AZ', 0 ); - $this->insertPage( 'FullOneUp', 'AZ', 0 ); - $this->insertPage( 'HalfTwoLow', 'az', 0 ); - $this->insertPage( 'FullTwoLow', 'az', 0 ); - $this->insertPage( 'HalfNumbers', '1234567890', 0 ); - $this->insertPage( 'FullNumbers', '1234567890', 0 ); - $this->insertPage( 'DomainName', 'example.com', 0 ); - } - - function fetchIds( $results ) { - if ( !$this->isWikitextNS( NS_MAIN ) ) { - $this->markTestIncomplete( __CLASS__ . " does no yet support non-wikitext content " - . "in the main namespace" ); - } - - $this->assertTrue( is_object( $results ) ); - - $matches = array(); - $row = $results->next(); - while ( $row ) { - $matches[] = $row->getTitle()->getPrefixedText(); - $row = $results->next(); - } - $results->free(); - # Search is not guaranteed to return results in a certain order; - # sort them numerically so we will compare simply that we received - # the expected matches. - sort( $matches ); - - return $matches; - } - - /** - * Insert a new page - * - * @param $pageName String: page name - * @param $text String: page's content - * @param $n Integer: unused - */ - function insertPage( $pageName, $text, $ns ) { - $title = Title::newFromText( $pageName, $ns ); - - $user = User::newFromName( 'WikiSysop' ); - $comment = 'Search Test'; - - // avoid memory leak...? - LinkCache::singleton()->clear(); - - $page = WikiPage::factory( $title ); - $page->doEditContent( ContentHandler::makeContent( $text, $title ), $comment, 0, false, $user ); - - $this->pageList[] = array( $title, $page->getId() ); - - return true; - } - - public function testFullWidth() { - $this->assertEquals( - array( 'FullOneUp', 'FullTwoLow', 'HalfOneUp', 'HalfTwoLow' ), - $this->fetchIds( $this->search->searchText( 'AZ' ) ), - "Search for normalized from Half-width Upper" ); - $this->assertEquals( - array( 'FullOneUp', 'FullTwoLow', 'HalfOneUp', 'HalfTwoLow' ), - $this->fetchIds( $this->search->searchText( 'az' ) ), - "Search for normalized from Half-width Lower" ); - $this->assertEquals( - array( 'FullOneUp', 'FullTwoLow', 'HalfOneUp', 'HalfTwoLow' ), - $this->fetchIds( $this->search->searchText( 'AZ' ) ), - "Search for normalized from Full-width Upper" ); - $this->assertEquals( - array( 'FullOneUp', 'FullTwoLow', 'HalfOneUp', 'HalfTwoLow' ), - $this->fetchIds( $this->search->searchText( 'az' ) ), - "Search for normalized from Full-width Lower" ); - } - - public function testTextSearch() { - $this->assertEquals( - array( 'Smithee' ), - $this->fetchIds( $this->search->searchText( 'smithee' ) ), - "Plain search failed" ); - } - - public function testTextPowerSearch() { - $this->search->setNamespaces( array( 0, 1, 4 ) ); - $this->assertEquals( - array( - 'Smithee', - 'Talk:Not Main Page', - ), - $this->fetchIds( $this->search->searchText( 'smithee' ) ), - "Power search failed" ); - } - - public function testTitleSearch() { - $this->assertEquals( - array( - 'Alan Smithee', - 'Smithee', - ), - $this->fetchIds( $this->search->searchTitle( 'smithee' ) ), - "Title search failed" ); - } - - public function testTextTitlePowerSearch() { - $this->search->setNamespaces( array( 0, 1, 4 ) ); - $this->assertEquals( - array( - 'Alan Smithee', - 'Smithee', - 'Talk:Smithee', - ), - $this->fetchIds( $this->search->searchTitle( 'smithee' ) ), - "Title power search failed" ); - } -} diff --git a/tests/phpunit/includes/search/SearchUpdateTest.php b/tests/phpunit/includes/search/SearchUpdateTest.php deleted file mode 100644 index 2f4fd501..00000000 --- a/tests/phpunit/includes/search/SearchUpdateTest.php +++ /dev/null @@ -1,74 +0,0 @@ -setMwGlobals( 'wgSearchType', 'MockSearch' ); - } - - function updateText( $text ) { - return trim( SearchUpdate::updateText( $text ) ); - } - - public function testUpdateText() { - $this->assertEquals( - 'test', - $this->updateText( '

            TeSt
            ' ), - 'HTML stripped, text lowercased' - ); - - $this->assertEquals( - 'foo bar boz quux', - $this->updateText( << -
            foo
            bar - bozquux - -EOT - ), 'Stripping HTML tables' ); - - $this->assertEquals( - 'a b', - $this->updateText( 'a > b' ), - 'Handle unclosed tags' - ); - - $text = str_pad( "foo assertNotEquals( - '', - $this->updateText( $text ), - 'Bug 18609' - ); - } - - public function testBug32712() { - $text = "text „http://example.com“ text"; - $result = $this->updateText( $text ); - $processed = preg_replace( '/Q/u', 'Q', $result ); - $this->assertTrue( - $processed != '', - 'Link surrounded by unicode quotes should not fail UTF-8 validation' - ); - } -} diff --git a/tests/phpunit/includes/site/MediaWikiSiteTest.php b/tests/phpunit/includes/site/MediaWikiSiteTest.php deleted file mode 100644 index c5d52d33..00000000 --- a/tests/phpunit/includes/site/MediaWikiSiteTest.php +++ /dev/null @@ -1,90 +0,0 @@ - - */ -class MediaWikiSiteTest extends SiteTest { - - public function testNormalizePageTitle() { - $site = new MediaWikiSite(); - $site->setGlobalId( 'enwiki' ); - - //NOTE: this does not actually call out to the enwiki site to perform the normalization, - // but uses a local Title object to do so. This is hardcoded on SiteLink::normalizePageTitle - // for the case that MW_PHPUNIT_TEST is set. - $this->assertEquals( 'Foo', $site->normalizePageName( ' foo ' ) ); - } - - public function fileUrlProvider() { - return array( - // url, filepath, path arg, expected - array( 'https://en.wikipedia.org', '/w/$1', 'api.php', 'https://en.wikipedia.org/w/api.php' ), - array( 'https://en.wikipedia.org', '/w/', 'api.php', 'https://en.wikipedia.org/w/' ), - array( 'https://en.wikipedia.org', '/foo/page.php?name=$1', 'api.php', 'https://en.wikipedia.org/foo/page.php?name=api.php' ), - array( 'https://en.wikipedia.org', '/w/$1', '', 'https://en.wikipedia.org/w/' ), - array( 'https://en.wikipedia.org', '/w/$1', 'foo/bar/api.php', 'https://en.wikipedia.org/w/foo/bar/api.php' ), - ); - } - - /** - * @dataProvider fileUrlProvider - * @covers MediaWikiSite::getFileUrl - */ - public function testGetFileUrl( $url, $filePath, $pathArgument, $expected ) { - $site = new MediaWikiSite(); - $site->setFilePath( $url . $filePath ); - - $this->assertEquals( $expected, $site->getFileUrl( $pathArgument ) ); - } - - public static function provideGetPageUrl() { - return array( - // path, page, expected substring - array( 'http://acme.test/wiki/$1', 'Berlin', '/wiki/Berlin' ), - array( 'http://acme.test/wiki/', 'Berlin', '/wiki/' ), - array( 'http://acme.test/w/index.php?title=$1', 'Berlin', '/w/index.php?title=Berlin' ), - array( 'http://acme.test/wiki/$1', '', '/wiki/' ), - array( 'http://acme.test/wiki/$1', 'Berlin/sub page', '/wiki/Berlin/sub_page' ), - array( 'http://acme.test/wiki/$1', 'Cork (city) ', '/Cork_(city)' ), - array( 'http://acme.test/wiki/$1', 'M&M', '/wiki/M%26M' ), - ); - } - - /** - * @dataProvider provideGetPageUrl - * @covers MediaWikiSite::getPageUrl - */ - public function testGetPageUrl( $path, $page, $expected ) { - $site = new MediaWikiSite(); - $site->setLinkPath( $path ); - - $this->assertContains( $path, $site->getPageUrl() ); - $this->assertContains( $expected, $site->getPageUrl( $page ) ); - } -} diff --git a/tests/phpunit/includes/site/SiteListTest.php b/tests/phpunit/includes/site/SiteListTest.php deleted file mode 100644 index 8af2fc1b..00000000 --- a/tests/phpunit/includes/site/SiteListTest.php +++ /dev/null @@ -1,197 +0,0 @@ - - */ -class SiteListTest extends MediaWikiTestCase { - - /** - * Returns instances of SiteList implementing objects. - * @return array - */ - public function siteListProvider() { - $sitesArrays = $this->siteArrayProvider(); - - $listInstances = array(); - - foreach ( $sitesArrays as $sitesArray ) { - $listInstances[] = new SiteList( $sitesArray[0] ); - } - - return $this->arrayWrap( $listInstances ); - } - - /** - * Returns arrays with instances of Site implementing objects. - * @return array - */ - public function siteArrayProvider() { - $sites = TestSites::getSites(); - - $siteArrays = array(); - - $siteArrays[] = $sites; - - $siteArrays[] = array( array_shift( $sites ) ); - - $siteArrays[] = array( array_shift( $sites ), array_shift( $sites ) ); - - return $this->arrayWrap( $siteArrays ); - } - - /** - * @dataProvider siteListProvider - * @param SiteList $sites - * @covers SiteList::isEmpty - */ - public function testIsEmpty( SiteList $sites ) { - $this->assertEquals( count( $sites ) === 0, $sites->isEmpty() ); - } - - /** - * @dataProvider siteListProvider - * @param SiteList $sites - * @covers SiteList::getSite - */ - public function testGetSiteByGlobalId( SiteList $sites ) { - if ( $sites->isEmpty() ) { - $this->assertTrue( true ); - } else { - /** - * @var Site $site - */ - foreach ( $sites as $site ) { - $this->assertEquals( $site, $sites->getSite( $site->getGlobalId() ) ); - } - } - } - - /** - * @dataProvider siteListProvider - * @param SiteList $sites - * @covers SiteList::getSiteByInternalId - */ - public function testGetSiteByInternalId( $sites ) { - /** - * @var Site $site - */ - foreach ( $sites as $site ) { - if ( is_integer( $site->getInternalId() ) ) { - $this->assertEquals( $site, $sites->getSiteByInternalId( $site->getInternalId() ) ); - } - } - - $this->assertTrue( true ); - } - - /** - * @dataProvider siteListProvider - * @param SiteList $sites - * @covers SiteList::hasSite - */ - public function testHasGlobalId( $sites ) { - $this->assertFalse( $sites->hasSite( 'non-existing-global-id' ) ); - $this->assertFalse( $sites->hasInternalId( 720101010 ) ); - - if ( !$sites->isEmpty() ) { - /** - * @var Site $site - */ - foreach ( $sites as $site ) { - $this->assertTrue( $sites->hasSite( $site->getGlobalId() ) ); - } - } - } - - /** - * @dataProvider siteListProvider - * @param SiteList $sites - * @covers SiteList::hasInternalId - */ - public function testHasInternallId( $sites ) { - /** - * @var Site $site - */ - foreach ( $sites as $site ) { - if ( is_integer( $site->getInternalId() ) ) { - $this->assertTrue( $site, $sites->hasInternalId( $site->getInternalId() ) ); - } - } - - $this->assertFalse( $sites->hasInternalId( -1 ) ); - } - - /** - * @dataProvider siteListProvider - * @param SiteList $sites - * @covers SiteList::getGlobalIdentifiers - */ - public function testGetGlobalIdentifiers( SiteList $sites ) { - $identifiers = $sites->getGlobalIdentifiers(); - - $this->assertTrue( is_array( $identifiers ) ); - - $expected = array(); - - /** - * @var Site $site - */ - foreach ( $sites as $site ) { - $expected[] = $site->getGlobalId(); - } - - $this->assertArrayEquals( $expected, $identifiers ); - } - - /** - * @dataProvider siteListProvider - * - * @since 1.21 - * - * @param SiteList $list - * @covers SiteList::getSerializationData - * @covers SiteList::unserialize - */ - public function testSerialization( SiteList $list ) { - $serialization = serialize( $list ); - /** - * @var SiteArray $copy - */ - $copy = unserialize( $serialization ); - - $this->assertArrayEquals( $list->getGlobalIdentifiers(), $copy->getGlobalIdentifiers() ); - - /** - * @var Site $site - */ - foreach ( $list as $site ) { - $this->assertTrue( $copy->hasInternalId( $site->getInternalId() ) ); - } - } -} diff --git a/tests/phpunit/includes/site/SiteSQLStoreTest.php b/tests/phpunit/includes/site/SiteSQLStoreTest.php deleted file mode 100644 index 6002c1a1..00000000 --- a/tests/phpunit/includes/site/SiteSQLStoreTest.php +++ /dev/null @@ -1,134 +0,0 @@ - - */ -class SiteSQLStoreTest extends MediaWikiTestCase { - - /** - * @covers SiteSQLStore::getSites - */ - public function testGetSites() { - $expectedSites = TestSites::getSites(); - TestSites::insertIntoDb(); - - $store = SiteSQLStore::newInstance(); - - $sites = $store->getSites(); - - $this->assertInstanceOf( 'SiteList', $sites ); - - /** - * @var Site $site - */ - foreach ( $sites as $site ) { - $this->assertInstanceOf( 'Site', $site ); - } - - foreach ( $expectedSites as $site ) { - if ( $site->getGlobalId() !== null ) { - $this->assertTrue( $sites->hasSite( $site->getGlobalId() ) ); - } - } - } - - /** - * @covers SiteSQLStore::saveSites - */ - public function testSaveSites() { - $store = SiteSQLStore::newInstance(); - - $sites = array(); - - $site = new Site(); - $site->setGlobalId( 'ertrywuutr' ); - $site->setLanguageCode( 'en' ); - $sites[] = $site; - - $site = new MediaWikiSite(); - $site->setGlobalId( 'sdfhxujgkfpth' ); - $site->setLanguageCode( 'nl' ); - $sites[] = $site; - - $this->assertTrue( $store->saveSites( $sites ) ); - - $site = $store->getSite( 'ertrywuutr' ); - $this->assertInstanceOf( 'Site', $site ); - $this->assertEquals( 'en', $site->getLanguageCode() ); - $this->assertTrue( is_integer( $site->getInternalId() ) ); - $this->assertTrue( $site->getInternalId() >= 0 ); - - $site = $store->getSite( 'sdfhxujgkfpth' ); - $this->assertInstanceOf( 'Site', $site ); - $this->assertEquals( 'nl', $site->getLanguageCode() ); - $this->assertTrue( is_integer( $site->getInternalId() ) ); - $this->assertTrue( $site->getInternalId() >= 0 ); - } - - /** - * @covers SiteSQLStore::reset - */ - public function testReset() { - $store1 = SiteSQLStore::newInstance(); - $store2 = SiteSQLStore::newInstance(); - - // initialize internal cache - $this->assertGreaterThan( 0, $store1->getSites()->count() ); - $this->assertGreaterThan( 0, $store2->getSites()->count() ); - - // Clear actual data. Will purge the external cache and reset the internal - // cache in $store1, but not the internal cache in store2. - $this->assertTrue( $store1->clear() ); - - // sanity check: $store2 should have a stale cache now - $this->assertNotNull( $store2->getSite( 'enwiki' ) ); - - // purge cache - $store2->reset(); - - // ...now the internal cache of $store2 should be updated and thus empty. - $site = $store2->getSite( 'enwiki' ); - $this->assertNull( $site ); - } - - /** - * @covers SiteSQLStore::clear - */ - public function testClear() { - $store = SiteSQLStore::newInstance(); - $this->assertTrue( $store->clear() ); - - $site = $store->getSite( 'enwiki' ); - $this->assertNull( $site ); - - $sites = $store->getSites(); - $this->assertEquals( 0, $sites->count() ); - } -} diff --git a/tests/phpunit/includes/site/SiteTest.php b/tests/phpunit/includes/site/SiteTest.php deleted file mode 100644 index 29c1ff33..00000000 --- a/tests/phpunit/includes/site/SiteTest.php +++ /dev/null @@ -1,296 +0,0 @@ - - */ -class SiteTest extends MediaWikiTestCase { - - public function instanceProvider() { - return $this->arrayWrap( TestSites::getSites() ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::getInterwikiIds - */ - public function testGetInterwikiIds( Site $site ) { - $this->assertInternalType( 'array', $site->getInterwikiIds() ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::getNavigationIds - */ - public function testGetNavigationIds( Site $site ) { - $this->assertInternalType( 'array', $site->getNavigationIds() ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::addNavigationId - */ - public function testAddNavigationId( Site $site ) { - $site->addNavigationId( 'foobar' ); - $this->assertTrue( in_array( 'foobar', $site->getNavigationIds(), true ) ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::addInterwikiId - */ - public function testAddInterwikiId( Site $site ) { - $site->addInterwikiId( 'foobar' ); - $this->assertTrue( in_array( 'foobar', $site->getInterwikiIds(), true ) ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::getLanguageCode - */ - public function testGetLanguageCode( Site $site ) { - $this->assertTypeOrValue( 'string', $site->getLanguageCode(), null ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::setLanguageCode - */ - public function testSetLanguageCode( Site $site ) { - $site->setLanguageCode( 'en' ); - $this->assertEquals( 'en', $site->getLanguageCode() ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::normalizePageName - */ - public function testNormalizePageName( Site $site ) { - $this->assertInternalType( 'string', $site->normalizePageName( 'Foobar' ) ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::getGlobalId - */ - public function testGetGlobalId( Site $site ) { - $this->assertTypeOrValue( 'string', $site->getGlobalId(), null ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::setGlobalId - */ - public function testSetGlobalId( Site $site ) { - $site->setGlobalId( 'foobar' ); - $this->assertEquals( 'foobar', $site->getGlobalId() ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::getType - */ - public function testGetType( Site $site ) { - $this->assertInternalType( 'string', $site->getType() ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::getPath - */ - public function testGetPath( Site $site ) { - $this->assertTypeOrValue( 'string', $site->getPath( 'page_path' ), null ); - $this->assertTypeOrValue( 'string', $site->getPath( 'file_path' ), null ); - $this->assertTypeOrValue( 'string', $site->getPath( 'foobar' ), null ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::getAllPaths - */ - public function testGetAllPaths( Site $site ) { - $this->assertInternalType( 'array', $site->getAllPaths() ); - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::setPath - * @covers Site::removePath - */ - public function testSetAndRemovePath( Site $site ) { - $count = count( $site->getAllPaths() ); - - $site->setPath( 'spam', 'http://www.wikidata.org/$1' ); - $site->setPath( 'spam', 'http://www.wikidata.org/foo/$1' ); - $site->setPath( 'foobar', 'http://www.wikidata.org/bar/$1' ); - - $this->assertEquals( $count + 2, count( $site->getAllPaths() ) ); - - $this->assertInternalType( 'string', $site->getPath( 'foobar' ) ); - $this->assertEquals( 'http://www.wikidata.org/foo/$1', $site->getPath( 'spam' ) ); - - $site->removePath( 'spam' ); - $site->removePath( 'foobar' ); - - $this->assertEquals( $count, count( $site->getAllPaths() ) ); - - $this->assertNull( $site->getPath( 'foobar' ) ); - $this->assertNull( $site->getPath( 'spam' ) ); - } - - /** - * @covers Site::setLinkPath - */ - public function testSetLinkPath() { - $site = new Site(); - $path = "TestPath/$1"; - - $site->setLinkPath( $path ); - $this->assertEquals( $path, $site->getLinkPath() ); - } - - /** - * @covers Site::getLinkPathType - */ - public function testGetLinkPathType() { - $site = new Site(); - - $path = 'TestPath/$1'; - $site->setLinkPath( $path ); - $this->assertEquals( $path, $site->getPath( $site->getLinkPathType() ) ); - - $path = 'AnotherPath/$1'; - $site->setPath( $site->getLinkPathType(), $path ); - $this->assertEquals( $path, $site->getLinkPath() ); - } - - /** - * @covers Site::setPath - */ - public function testSetPath() { - $site = new Site(); - - $path = 'TestPath/$1'; - $site->setPath( 'foo', $path ); - - $this->assertEquals( $path, $site->getPath( 'foo' ) ); - } - - /** - * @covers Site::setPath - * @covers Site::getProtocol - */ - public function testProtocolRelativePath() { - $site = new Site(); - - $type = $site->getLinkPathType(); - $path = '//acme.com/'; // protocol-relative URL - $site->setPath( $type, $path ); - - $this->assertEquals( '', $site->getProtocol() ); - } - - public static function provideGetPageUrl() { - //NOTE: the assumption that the URL is built by replacing $1 - // with the urlencoded version of $page - // is true for Site but not guaranteed for subclasses. - // Subclasses need to override this provider appropriately. - - return array( - array( #0 - 'http://acme.test/TestPath/$1', - 'Foo', - '/TestPath/Foo', - ), - array( #1 - 'http://acme.test/TestScript?x=$1&y=bla', - 'Foo', - 'TestScript?x=Foo&y=bla', - ), - array( #2 - 'http://acme.test/TestPath/$1', - 'foo & bar/xyzzy (quux-shmoox?)', - '/TestPath/foo%20%26%20bar%2Fxyzzy%20%28quux-shmoox%3F%29', - ), - ); - } - - /** - * @dataProvider provideGetPageUrl - * @covers Site::getPageUrl - */ - public function testGetPageUrl( $path, $page, $expected ) { - $site = new Site(); - - //NOTE: the assumption that getPageUrl is based on getLinkPath - // is true for Site but not guaranteed for subclasses. - // Subclasses need to override this test case appropriately. - $site->setLinkPath( $path ); - $this->assertContains( $path, $site->getPageUrl() ); - - $this->assertContains( $expected, $site->getPageUrl( $page ) ); - } - - protected function assertTypeOrFalse( $type, $value ) { - if ( $value === false ) { - $this->assertTrue( true ); - } else { - $this->assertInternalType( $type, $value ); - } - } - - /** - * @dataProvider instanceProvider - * @param Site $site - * @covers Site::serialize - * @covers Site::unserialize - */ - public function testSerialization( Site $site ) { - $this->assertInstanceOf( 'Serializable', $site ); - - $serialization = serialize( $site ); - $newInstance = unserialize( $serialization ); - - $this->assertInstanceOf( 'Site', $newInstance ); - - $this->assertEquals( $serialization, serialize( $newInstance ) ); - } -} diff --git a/tests/phpunit/includes/site/TestSites.php b/tests/phpunit/includes/site/TestSites.php deleted file mode 100644 index f224b7d7..00000000 --- a/tests/phpunit/includes/site/TestSites.php +++ /dev/null @@ -1,100 +0,0 @@ - - */ -class TestSites { - - /** - * @since 1.21 - * - * @return array - */ - public static function getSites() { - $sites = array(); - - $site = new Site(); - $site->setGlobalId( 'foobar' ); - $sites[] = $site; - - $site = new MediaWikiSite(); - $site->setGlobalId( 'enwiktionary' ); - $site->setGroup( 'wiktionary' ); - $site->setLanguageCode( 'en' ); - $site->addNavigationId( 'enwiktionary' ); - $site->setPath( MediaWikiSite::PATH_PAGE, "https://en.wiktionary.org/wiki/$1" ); - $site->setPath( MediaWikiSite::PATH_FILE, "https://en.wiktionary.org/w/$1" ); - $sites[] = $site; - - $site = new MediaWikiSite(); - $site->setGlobalId( 'dewiktionary' ); - $site->setGroup( 'wiktionary' ); - $site->setLanguageCode( 'de' ); - $site->addInterwikiId( 'dewiktionary' ); - $site->addInterwikiId( 'wiktionaryde' ); - $site->setPath( MediaWikiSite::PATH_PAGE, "https://de.wiktionary.org/wiki/$1" ); - $site->setPath( MediaWikiSite::PATH_FILE, "https://de.wiktionary.org/w/$1" ); - $sites[] = $site; - - $site = new Site(); - $site->setGlobalId( 'spam' ); - $site->setGroup( 'spam' ); - $site->setLanguageCode( 'en' ); - $site->addNavigationId( 'spam' ); - $site->addNavigationId( 'spamz' ); - $site->addInterwikiId( 'spamzz' ); - $site->setLinkPath( "http://spamzz.test/testing/" ); - $sites[] = $site; - - foreach ( array( 'en', 'de', 'nl', 'sv', 'sr', 'no', 'nn' ) as $langCode ) { - $site = new MediaWikiSite(); - $site->setGlobalId( $langCode . 'wiki' ); - $site->setGroup( 'wikipedia' ); - $site->setLanguageCode( $langCode ); - $site->addInterwikiId( $langCode ); - $site->addNavigationId( $langCode ); - $site->setPath( MediaWikiSite::PATH_PAGE, "https://$langCode.wikipedia.org/wiki/$1" ); - $site->setPath( MediaWikiSite::PATH_FILE, "https://$langCode.wikipedia.org/w/$1" ); - $sites[] = $site; - } - - return $sites; - } - - /** - * Inserts sites into the database for the unit tests that need them. - * - * @since 0.1 - */ - public static function insertIntoDb() { - $sitesTable = SiteSQLStore::newInstance(); - $sitesTable->clear(); - $sitesTable->saveSites( TestSites::getSites() ); - } -} diff --git a/tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php b/tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php deleted file mode 100644 index a806b4ac..00000000 --- a/tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php +++ /dev/null @@ -1,79 +0,0 @@ -manualTest ) ) { - $this->queryPages[$class] = new $class; - } - } - } - - /** - * Test SQL for each of our QueryPages objects - * @group Database - */ - public function testQuerypageSqlQuery() { - global $wgDBtype; - - foreach ( $this->queryPages as $page ) { - - // With MySQL, skips special pages reopening a temporary table - // See http://bugs.mysql.com/bug.php?id=10327 - if ( - $wgDBtype === 'mysql' - && in_array( $page->getName(), $this->reopensTempTable ) - ) { - $this->markTestSkipped( "SQL query for page {$page->getName()} can not be tested on MySQL backend (it reopens a temporary table)" ); - continue; - } - - $msg = "SQL query for page {$page->getName()} should give a result wrapper object"; - - $result = $page->reallyDoQuery( 50 ); - if ( $result instanceof ResultWrapper ) { - $this->assertTrue( true, $msg ); - } else { - $this->assertFalse( false, $msg ); - } - } - } -} diff --git a/tests/phpunit/includes/specials/SpecialPreferencesTest.php b/tests/phpunit/includes/specials/SpecialPreferencesTest.php deleted file mode 100644 index 6c637c65..00000000 --- a/tests/phpunit/includes/specials/SpecialPreferencesTest.php +++ /dev/null @@ -1,60 +0,0 @@ -setMwGlobals( 'wgMaxSigChars', 2 ); - - $user = $this->getMock( 'User' ); - $user->expects( $this->any() ) - ->method( 'isAnon' ) - ->will( $this->returnValue( false ) ); - - # Yeah foreach requires an array, not NULL =( - $user->expects( $this->any() ) - ->method( 'getEffectiveGroups' ) - ->will( $this->returnValue( array() ) ); - - # The mocked user has a long nickname - $user->expects( $this->any() ) - ->method( 'getOption' ) - ->will( $this->returnValueMap( array( - array( 'nickname', null, false, 'superlongnickname' ), - ) - ) ); - - # Validate the mock (FIXME should probably be removed) - $this->assertFalse( $user->isAnon() ); - $this->assertEquals( array(), - $user->getEffectiveGroups() ); - $this->assertEquals( 'superlongnickname', - $user->getOption( 'nickname' ) ); - - # Forge a request to call the special page - $context = new RequestContext(); - $context->setRequest( new FauxRequest() ); - $context->setUser( $user ); - $context->setTitle( Title::newFromText( 'Test' ) ); - - # Do the call, should not spurt a fatal error. - $special = new SpecialPreferences(); - $special->setContext( $context ); - $special->execute( array() ); - } - -} diff --git a/tests/phpunit/includes/specials/SpecialRecentchangesTest.php b/tests/phpunit/includes/specials/SpecialRecentchangesTest.php deleted file mode 100644 index 436eb2e2..00000000 --- a/tests/phpunit/includes/specials/SpecialRecentchangesTest.php +++ /dev/null @@ -1,125 +0,0 @@ -setRequest( new FauxRequest( $requestOptions ) ); - - # setup the rc object - $this->rc = new SpecialRecentChanges(); - $this->rc->setContext( $context ); - $formOptions = $this->rc->setup( null ); - - # Filter out rc_timestamp conditions which depends on the test runtime - # This condition is not needed as of march 2, 2011 -- hashar - # @todo FIXME: Find a way to generate the correct rc_timestamp - $queryConditions = array_filter( - $this->rc->buildMainQueryConds( $formOptions ), - 'SpecialRecentchangesTest::filterOutRcTimestampCondition' - ); - - $this->assertEquals( - $expected, - $queryConditions, - $message - ); - } - - /** return false if condition begin with 'rc_timestamp ' */ - private static function filterOutRcTimestampCondition( $var ) { - return ( false === strpos( $var, 'rc_timestamp ' ) ); - } - - public function testRcNsFilter() { - $this->assertConditions( - array( # expected - 'rc_bot' => 0, - #0 => "rc_timestamp >= '20110223000000'", - 1 => "rc_namespace = '0'", - ), - array( - 'namespace' => NS_MAIN, - ), - "rc conditions with no options (aka default setting)" - ); - } - - public function testRcNsFilterInversion() { - $this->assertConditions( - array( # expected - #0 => "rc_timestamp >= '20110223000000'", - 'rc_bot' => 0, - 1 => sprintf( "rc_namespace != '%s'", NS_MAIN ), - ), - array( - 'namespace' => NS_MAIN, - 'invert' => 1, - ), - "rc conditions with namespace inverted" - ); - } - - /** - * @bug 2429 - * @dataProvider provideNamespacesAssociations - */ - public function testRcNsFilterAssociation( $ns1, $ns2 ) { - $this->assertConditions( - array( # expected - #0 => "rc_timestamp >= '20110223000000'", - 'rc_bot' => 0, - 1 => sprintf( "(rc_namespace = '%s' OR rc_namespace = '%s')", $ns1, $ns2 ), - ), - array( - 'namespace' => $ns1, - 'associated' => 1, - ), - "rc conditions with namespace inverted" - ); - } - - /** - * @bug 2429 - * @dataProvider provideNamespacesAssociations - */ - public function testRcNsFilterAssociationWithInversion( $ns1, $ns2 ) { - $this->assertConditions( - array( # expected - #0 => "rc_timestamp >= '20110223000000'", - 'rc_bot' => 0, - 1 => sprintf( "(rc_namespace != '%s' AND rc_namespace != '%s')", $ns1, $ns2 ), - ), - array( - 'namespace' => $ns1, - 'associated' => 1, - 'invert' => 1, - ), - "rc conditions with namespace inverted" - ); - } - - /** - * Provides associated namespaces to test recent changes - * namespaces association filtering. - */ - public static function provideNamespacesAssociations() { - return array( # (NS => Associated_NS) - array( NS_MAIN, NS_TALK ), - array( NS_TALK, NS_MAIN ), - ); - } -} diff --git a/tests/phpunit/includes/specials/SpecialSearchTest.php b/tests/phpunit/includes/specials/SpecialSearchTest.php deleted file mode 100644 index 17e883fd..00000000 --- a/tests/phpunit/includes/specials/SpecialSearchTest.php +++ /dev/null @@ -1,139 +0,0 @@ - true, 'ns6' => true). NULL to use default options. - * @param $userOptions Array User options to test with. For example array('searchNs5' => 1 );. NULL to use default options. - * @param $expectedProfile An expected search profile name - * @param $expectedNs Array Expected namespaces - */ - public function testProfileAndNamespaceLoading( - $requested, $userOptions, $expectedProfile, $expectedNS, - $message = 'Profile name and namespaces mismatches!' - ) { - $context = new RequestContext; - $context->setUser( - $this->newUserWithSearchNS( $userOptions ) - ); - /* - $context->setRequest( new FauxRequest( array( - 'ns5'=>true, - 'ns6'=>true, - ) )); - */ - $context->setRequest( new FauxRequest( $requested ) ); - $search = new SpecialSearch(); - $search->setContext( $context ); - $search->load(); - - /** - * Verify profile name and namespace in the same assertion to make - * sure we will be able to fully compare the above code. PHPUnit stop - * after an assertion fail. - */ - $this->assertEquals( - array( /** Expected: */ - 'ProfileName' => $expectedProfile, - 'Namespaces' => $expectedNS, - ) - , array( /** Actual: */ - 'ProfileName' => $search->getProfile(), - 'Namespaces' => $search->getNamespaces(), - ) - , $message - ); - } - - public static function provideSearchOptionsTests() { - $defaultNS = SearchEngine::defaultNamespaces(); - $EMPTY_REQUEST = array(); - $NO_USER_PREF = null; - - return array( - /** - * Parameters: - * , - * Followed by expected values: - * , - * Then an optional message. - */ - array( - $EMPTY_REQUEST, $NO_USER_PREF, - 'default', $defaultNS, - 'Bug 33270: No request nor user preferences should give default profile' - ), - array( - array( 'ns5' => 1 ), $NO_USER_PREF, - 'advanced', array( 5 ), - 'Web request with specific NS should override user preference' - ), - array( - $EMPTY_REQUEST, array( - 'searchNs2' => 1, - 'searchNs14' => 1, - ) + array_fill_keys( array_map( function ( $ns ) { - return "searchNs$ns"; - }, $defaultNS ), 0 ), - 'advanced', array( 2, 14 ), - 'Bug 33583: search with no option should honor User search preferences' - . ' and have all other namespace disabled' - ), - ); - } - - /** - * Helper to create a new User object with given options - * User remains anonymous though - */ - function newUserWithSearchNS( $opt = null ) { - $u = User::newFromId( 0 ); - if ( $opt === null ) { - return $u; - } - foreach ( $opt as $name => $value ) { - $u->setOption( $name, $value ); - } - - return $u; - } - - /** - * Verify we do not expand search term in on search result page - * https://gerrit.wikimedia.org/r/4841 - */ - public function testSearchTermIsNotExpanded() { - - # Initialize [[Special::Search]] - $search = new SpecialSearch(); - $search->getContext()->setTitle( Title::newFromText( 'Special:Search' ) ); - $search->load(); - - # Simulate a user searching for a given term - $term = '{{SITENAME}}'; - $search->showResults( $term ); - - # Lookup the HTML page title set for that page - $pageTitle = $search - ->getContext() - ->getOutput() - ->getHTMLTitle(); - - # Compare :-] - $this->assertRegExp( - '/' . preg_quote( $term ) . '/', - $pageTitle, - "Search term '{$term}' should not be expanded in Special:Search <title>" - ); - } -} diff --git a/tests/phpunit/includes/upload/UploadBaseTest.php b/tests/phpunit/includes/upload/UploadBaseTest.php deleted file mode 100644 index 982b46b2..00000000 --- a/tests/phpunit/includes/upload/UploadBaseTest.php +++ /dev/null @@ -1,147 +0,0 @@ -<?php - -/** - * @group Upload - */ -class UploadBaseTest extends MediaWikiTestCase { - - /** @var UploadTestHandler */ - protected $upload; - - protected function setUp() { - global $wgHooks; - parent::setUp(); - - $this->upload = new UploadTestHandler; - $this->hooks = $wgHooks; - $wgHooks['InterwikiLoadPrefix'][] = function ( $prefix, &$data ) { - return false; - }; - } - - protected function tearDown() { - global $wgHooks; - $wgHooks = $this->hooks; - - parent::tearDown(); - } - - - /** - * First checks the return code - * of UploadBase::getTitle() and then the actual returned title - * - * @dataProvider provideTestTitleValidation - * @covers UploadBase::getTitle - */ - public function testTitleValidation( $srcFilename, $dstFilename, $code, $msg ) { - /* Check the result code */ - $this->assertEquals( $code, - $this->upload->testTitleValidation( $srcFilename ), - "$msg code" ); - - /* If we expect a valid title, check the title itself. */ - if ( $code == UploadBase::OK ) { - $this->assertEquals( $dstFilename, - $this->upload->getTitle()->getText(), - "$msg text" ); - } - } - - /** - * Test various forms of valid and invalid titles that can be supplied. - */ - public static function provideTestTitleValidation() { - return array( - /* Test a valid title */ - array( 'ValidTitle.jpg', 'ValidTitle.jpg', UploadBase::OK, - 'upload valid title' ), - /* A title with a slash */ - array( 'A/B.jpg', 'B.jpg', UploadBase::OK, - 'upload title with slash' ), - /* A title with illegal char */ - array( 'A:B.jpg', 'A-B.jpg', UploadBase::OK, - 'upload title with colon' ), - /* Stripping leading File: prefix */ - array( 'File:C.jpg', 'C.jpg', UploadBase::OK, - 'upload title with File prefix' ), - /* Test illegal suggested title (r94601) */ - array( '%281%29.JPG', null, UploadBase::ILLEGAL_FILENAME, - 'illegal title for upload' ), - /* A title without extension */ - array( 'A', null, UploadBase::FILETYPE_MISSING, - 'upload title without extension' ), - /* A title with no basename */ - array( '.jpg', null, UploadBase::MIN_LENGTH_PARTNAME, - 'upload title without basename' ), - /* A title that is longer than 255 bytes */ - array( str_repeat( 'a', 255 ) . '.jpg', null, UploadBase::FILENAME_TOO_LONG, - 'upload title longer than 255 bytes' ), - /* A title that is longer than 240 bytes */ - array( str_repeat( 'a', 240 ) . '.jpg', null, UploadBase::FILENAME_TOO_LONG, - 'upload title longer than 240 bytes' ), - ); - } - - /** - * Test the upload verification functions - * @covers UploadBase::verifyUpload - */ - public function testVerifyUpload() { - /* Setup with zero file size */ - $this->upload->initializePathInfo( '', '', 0 ); - $result = $this->upload->verifyUpload(); - $this->assertEquals( UploadBase::EMPTY_FILE, - $result['status'], - 'upload empty file' ); - } - - // Helper used to create an empty file of size $size. - private function createFileOfSize( $size ) { - $filename = tempnam( wfTempDir(), "mwuploadtest" ); - - $fh = fopen( $filename, 'w' ); - ftruncate( $fh, $size ); - fclose( $fh ); - - return $filename; - } - - /** - * test uploading a 100 bytes file with $wgMaxUploadSize = 100 - * - * This method should be abstracted so we can test different settings. - */ - public function testMaxUploadSize() { - global $wgMaxUploadSize; - $savedGlobal = $wgMaxUploadSize; // save global - global $wgFileExtensions; - $wgFileExtensions[] = 'txt'; - - $wgMaxUploadSize = 100; - - $filename = $this->createFileOfSize( $wgMaxUploadSize ); - $this->upload->initializePathInfo( basename( $filename ) . '.txt', $filename, 100 ); - $result = $this->upload->verifyUpload(); - unlink( $filename ); - - $this->assertEquals( - array( 'status' => UploadBase::OK ), $result ); - - $wgMaxUploadSize = $savedGlobal; // restore global - } -} - -class UploadTestHandler extends UploadBase { - public function initializeFromRequest( &$request ) { - } - - public function testTitleValidation( $name ) { - $this->mTitle = false; - $this->mDesiredDestName = $name; - $this->mTitleError = UploadBase::OK; - $this->getTitle(); - - return $this->mTitleError; - } -} diff --git a/tests/phpunit/includes/upload/UploadFromUrlTest.php b/tests/phpunit/includes/upload/UploadFromUrlTest.php deleted file mode 100644 index a75fba69..00000000 --- a/tests/phpunit/includes/upload/UploadFromUrlTest.php +++ /dev/null @@ -1,350 +0,0 @@ -<?php - -/** - * @group Broken - * @group Upload - * @group Database - */ -class UploadFromUrlTest extends ApiTestCase { - protected function setUp() { - parent::setUp(); - - $this->setMwGlobals( array( - 'wgEnableUploads' => true, - 'wgAllowCopyUploads' => true, - 'wgAllowAsyncCopyUploads' => true, - ) ); - wfSetupSession(); - - if ( wfLocalFile( 'UploadFromUrlTest.png' )->exists() ) { - $this->deleteFile( 'UploadFromUrlTest.png' ); - } - } - - protected function doApiRequest( array $params, array $unused = null, $appendModule = false, User $user = null ) { - $sessionId = session_id(); - session_write_close(); - - $req = new FauxRequest( $params, true, $_SESSION ); - $module = new ApiMain( $req, true ); - $module->execute(); - - wfSetupSession( $sessionId ); - - return array( $module->getResultData(), $req ); - } - - /** - * Ensure that the job queue is empty before continuing - */ - public function testClearQueue() { - $job = JobQueueGroup::singleton()->pop(); - while ( $job ) { - $job = JobQueueGroup::singleton()->pop(); - } - $this->assertFalse( $job ); - } - - /** - * @todo Document why we test login, since the $wgUser hack used doesn't - * require login - */ - public function testLogin() { - $data = $this->doApiRequest( array( - 'action' => 'login', - 'lgname' => $this->user->userName, - 'lgpassword' => $this->user->passWord ) ); - $this->assertArrayHasKey( "login", $data[0] ); - $this->assertArrayHasKey( "result", $data[0]['login'] ); - $this->assertEquals( "NeedToken", $data[0]['login']['result'] ); - $token = $data[0]['login']['token']; - - $data = $this->doApiRequest( array( - 'action' => 'login', - "lgtoken" => $token, - 'lgname' => $this->user->userName, - 'lgpassword' => $this->user->passWord ) ); - - $this->assertArrayHasKey( "login", $data[0] ); - $this->assertArrayHasKey( "result", $data[0]['login'] ); - $this->assertEquals( "Success", $data[0]['login']['result'] ); - $this->assertArrayHasKey( 'lgtoken', $data[0]['login'] ); - - return $data; - } - - /** - * @depends testLogin - * @depends testClearQueue - */ - public function testSetupUrlDownload( $data ) { - $token = $this->user->getEditToken(); - $exception = false; - - try { - $this->doApiRequest( array( - 'action' => 'upload', - ) ); - } catch ( UsageException $e ) { - $exception = true; - $this->assertEquals( "The token parameter must be set", $e->getMessage() ); - } - $this->assertTrue( $exception, "Got exception" ); - - $exception = false; - try { - $this->doApiRequest( array( - 'action' => 'upload', - 'token' => $token, - ), $data ); - } catch ( UsageException $e ) { - $exception = true; - $this->assertEquals( "One of the parameters sessionkey, file, url, statuskey is required", - $e->getMessage() ); - } - $this->assertTrue( $exception, "Got exception" ); - - $exception = false; - try { - $this->doApiRequest( array( - 'action' => 'upload', - 'url' => 'http://www.example.com/test.png', - 'token' => $token, - ), $data ); - } catch ( UsageException $e ) { - $exception = true; - $this->assertEquals( "The filename parameter must be set", $e->getMessage() ); - } - $this->assertTrue( $exception, "Got exception" ); - - $this->user->removeGroup( 'sysop' ); - $exception = false; - try { - $this->doApiRequest( array( - 'action' => 'upload', - 'url' => 'http://www.example.com/test.png', - 'filename' => 'UploadFromUrlTest.png', - 'token' => $token, - ), $data ); - } catch ( UsageException $e ) { - $exception = true; - $this->assertEquals( "Permission denied", $e->getMessage() ); - } - $this->assertTrue( $exception, "Got exception" ); - - $this->user->addGroup( 'sysop' ); - $data = $this->doApiRequest( array( - 'action' => 'upload', - 'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png', - 'asyncdownload' => 1, - 'filename' => 'UploadFromUrlTest.png', - 'token' => $token, - ), $data ); - - $this->assertEquals( $data[0]['upload']['result'], 'Queued', 'Queued upload' ); - - $job = JobQueueGroup::singleton()->pop(); - $this->assertThat( $job, $this->isInstanceOf( 'UploadFromUrlJob' ), 'Queued upload inserted' ); - } - - /** - * @depends testLogin - * @depends testClearQueue - */ - public function testAsyncUpload( $data ) { - $token = $this->user->getEditToken(); - - $this->user->addGroup( 'users' ); - - $data = $this->doAsyncUpload( $token, true ); - $this->assertEquals( $data[0]['upload']['result'], 'Success' ); - $this->assertEquals( $data[0]['upload']['filename'], 'UploadFromUrlTest.png' ); - $this->assertTrue( wfLocalFile( $data[0]['upload']['filename'] )->exists() ); - - $this->deleteFile( 'UploadFromUrlTest.png' ); - - return $data; - } - - /** - * @depends testLogin - * @depends testClearQueue - */ - public function testAsyncUploadWarning( $data ) { - $token = $this->user->getEditToken(); - - $this->user->addGroup( 'users' ); - - $data = $this->doAsyncUpload( $token ); - - $this->assertEquals( $data[0]['upload']['result'], 'Warning' ); - $this->assertTrue( isset( $data[0]['upload']['sessionkey'] ) ); - - $data = $this->doApiRequest( array( - 'action' => 'upload', - 'sessionkey' => $data[0]['upload']['sessionkey'], - 'filename' => 'UploadFromUrlTest.png', - 'ignorewarnings' => 1, - 'token' => $token, - ) ); - $this->assertEquals( $data[0]['upload']['result'], 'Success' ); - $this->assertEquals( $data[0]['upload']['filename'], 'UploadFromUrlTest.png' ); - $this->assertTrue( wfLocalFile( $data[0]['upload']['filename'] )->exists() ); - - $this->deleteFile( 'UploadFromUrlTest.png' ); - - return $data; - } - - /** - * @depends testLogin - * @depends testClearQueue - */ - public function testSyncDownload( $data ) { - $token = $this->user->getEditToken(); - - $job = JobQueueGroup::singleton()->pop(); - $this->assertFalse( $job, 'Starting with an empty jobqueue' ); - - $this->user->addGroup( 'users' ); - $data = $this->doApiRequest( array( - 'action' => 'upload', - 'filename' => 'UploadFromUrlTest.png', - 'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png', - 'ignorewarnings' => true, - 'token' => $token, - ), $data ); - - $job = JobQueueGroup::singleton()->pop(); - $this->assertFalse( $job ); - - $this->assertEquals( 'Success', $data[0]['upload']['result'] ); - $this->deleteFile( 'UploadFromUrlTest.png' ); - - return $data; - } - - public function testLeaveMessage() { - $token = $this->user->user->getEditToken(); - - $talk = $this->user->user->getTalkPage(); - if ( $talk->exists() ) { - $page = WikiPage::factory( $talk ); - $page->doDeleteArticle( '' ); - } - - $this->assertFalse( (bool)$talk->getArticleID( Title::GAID_FOR_UPDATE ), 'User talk does not exist' ); - - $this->doApiRequest( array( - 'action' => 'upload', - 'filename' => 'UploadFromUrlTest.png', - 'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png', - 'asyncdownload' => 1, - 'token' => $token, - 'leavemessage' => 1, - 'ignorewarnings' => 1, - ) ); - - $job = JobQueueGroup::singleton()->pop(); - $this->assertEquals( 'UploadFromUrlJob', get_class( $job ) ); - $job->run(); - - $this->assertTrue( wfLocalFile( 'UploadFromUrlTest.png' )->exists() ); - $this->assertTrue( (bool)$talk->getArticleID( Title::GAID_FOR_UPDATE ), 'User talk exists' ); - - $this->deleteFile( 'UploadFromUrlTest.png' ); - - $talkRev = Revision::newFromTitle( $talk ); - $talkSize = $talkRev->getSize(); - - $exception = false; - try { - $this->doApiRequest( array( - 'action' => 'upload', - 'filename' => 'UploadFromUrlTest.png', - 'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png', - 'asyncdownload' => 1, - 'token' => $token, - 'leavemessage' => 1, - ) ); - } catch ( UsageException $e ) { - $exception = true; - $this->assertEquals( 'Using leavemessage without ignorewarnings is not supported', $e->getMessage() ); - } - $this->assertTrue( $exception ); - - $job = JobQueueGroup::singleton()->pop(); - $this->assertFalse( $job ); - - return; - /* - // Broken until using leavemessage with ignorewarnings is supported - $job->run(); - - $this->assertFalse( wfLocalFile( 'UploadFromUrlTest.png' )->exists() ); - - $talkRev = Revision::newFromTitle( $talk ); - $this->assertTrue( $talkRev->getSize() > $talkSize, 'New message left' ); - */ - } - - /** - * Helper function to perform an async upload, execute the job and fetch - * the status - * - * @return array The result of action=upload&statuskey=key - */ - private function doAsyncUpload( $token, $ignoreWarnings = false, $leaveMessage = false ) { - $params = array( - 'action' => 'upload', - 'filename' => 'UploadFromUrlTest.png', - 'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png', - 'asyncdownload' => 1, - 'token' => $token, - ); - if ( $ignoreWarnings ) { - $params['ignorewarnings'] = 1; - } - if ( $leaveMessage ) { - $params['leavemessage'] = 1; - } - - $data = $this->doApiRequest( $params ); - $this->assertEquals( $data[0]['upload']['result'], 'Queued' ); - $this->assertTrue( isset( $data[0]['upload']['statuskey'] ) ); - $statusKey = $data[0]['upload']['statuskey']; - - $job = JobQueueGroup::singleton()->pop(); - $this->assertEquals( 'UploadFromUrlJob', get_class( $job ) ); - - $status = $job->run(); - $this->assertTrue( $status ); - - $data = $this->doApiRequest( array( - 'action' => 'upload', - 'statuskey' => $statusKey, - 'token' => $token, - ) ); - - return $data; - } - - /** - * - */ - protected function deleteFile( $name ) { - $t = Title::newFromText( $name, NS_FILE ); - $this->assertTrue( $t->exists(), "File '$name' exists" ); - - if ( $t->exists() ) { - $file = wfFindFile( $name, array( 'ignoreRedirect' => true ) ); - $empty = ""; - FileDeleteForm::doDelete( $t, $file, $empty, "none", true ); - $page = WikiPage::factory( $t ); - $page->doDeleteArticle( "testing" ); - } - $t = Title::newFromText( $name, NS_FILE ); - - $this->assertFalse( $t->exists(), "File '$name' was deleted" ); - } -} diff --git a/tests/phpunit/includes/upload/UploadStashTest.php b/tests/phpunit/includes/upload/UploadStashTest.php deleted file mode 100644 index 7a0fea48..00000000 --- a/tests/phpunit/includes/upload/UploadStashTest.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php -/** - * @group Database - */ -class UploadStashTest extends MediaWikiTestCase { - /** - * @var Array of UploadStashTestUser - */ - public static $users; - - protected function setUp() { - parent::setUp(); - - // Setup a file for bug 29408 - $this->bug29408File = __DIR__ . '/bug29408'; - file_put_contents( $this->bug29408File, "\x00" ); - - self::$users = array( - 'sysop' => new TestUser( - 'Uploadstashtestsysop', - 'Upload Stash Test Sysop', - 'upload_stash_test_sysop@example.com', - array( 'sysop' ) - ), - 'uploader' => new TestUser( - 'Uploadstashtestuser', - 'Upload Stash Test User', - 'upload_stash_test_user@example.com', - array() - ) - ); - } - - protected function tearDown() { - if ( file_exists( $this->bug29408File . "." ) ) { - unlink( $this->bug29408File . "." ); - } - - if ( file_exists( $this->bug29408File ) ) { - unlink( $this->bug29408File ); - } - - parent::tearDown(); - } - - public function testBug29408() { - $this->setMwGlobals( 'wgUser', self::$users['uploader']->user ); - - $repo = RepoGroup::singleton()->getLocalRepo(); - $stash = new UploadStash( $repo ); - - // Throws exception caught by PHPUnit on failure - $file = $stash->stashFile( $this->bug29408File ); - // We'll never reach this point if we hit bug 29408 - $this->assertTrue( true, 'Unrecognized file without extension' ); - - $stash->removeFile( $file->getFileKey() ); - } - - public function testValidRequest() { - $request = new FauxRequest( array( 'wpFileKey' => 'foo' ) ); - $this->assertFalse( UploadFromStash::isValidRequest( $request ), 'Check failure on bad wpFileKey' ); - - $request = new FauxRequest( array( 'wpSessionKey' => 'foo' ) ); - $this->assertFalse( UploadFromStash::isValidRequest( $request ), 'Check failure on bad wpSessionKey' ); - - $request = new FauxRequest( array( 'wpFileKey' => 'testkey-test.test' ) ); - $this->assertTrue( UploadFromStash::isValidRequest( $request ), 'Check good wpFileKey' ); - - $request = new FauxRequest( array( 'wpFileKey' => 'testkey-test.test' ) ); - $this->assertTrue( UploadFromStash::isValidRequest( $request ), 'Check good wpSessionKey' ); - - $request = new FauxRequest( array( 'wpFileKey' => 'testkey-test.test', 'wpSessionKey' => 'foo' ) ); - $this->assertTrue( UploadFromStash::isValidRequest( $request ), 'Check key precedence' ); - } -} diff --git a/tests/phpunit/install-phpunit.sh b/tests/phpunit/install-phpunit.sh deleted file mode 100644 index 1f602935..00000000 --- a/tests/phpunit/install-phpunit.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -has_binary () { - if [ -z `which $1` ]; then - return 1 - fi - return 0 -} - -if [ `id -u` -ne 0 ]; then - echo '*** ERROR: Must be root to run' - exit 1 -fi - -if ( has_binary phpunit ); then - echo PHPUnit already installed -else if ( has_binary pear ); then - echo Installing phpunit with pear - pear channel-discover pear.phpunit.de - pear channel-discover components.ez.no - pear channel-discover pear.symfony.com - pear update-channels - pear install --alldeps phpunit/PHPUnit -else if ( has_binary apt-get ); then - echo Installing phpunit with apt-get - apt-get install phpunit -else if ( has_binary yum ); then - echo Installing phpunit with yum - yum install phpunit -else if ( has_binary port ); then - echo Installing phpunit with macports - port install php5-unit -fi -fi -fi -fi -fi diff --git a/tests/phpunit/languages/LanguageAmTest.php b/tests/phpunit/languages/LanguageAmTest.php deleted file mode 100644 index a644f5e0..00000000 --- a/tests/phpunit/languages/LanguageAmTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageAm.php */ -class LanguageAmTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageArTest.php b/tests/phpunit/languages/LanguageArTest.php deleted file mode 100644 index 7b48f236..00000000 --- a/tests/phpunit/languages/LanguageArTest.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php -/** - * Based on LanguagMlTest - * @file - */ - -/** Tests for MediaWiki languages/LanguageAr.php */ -class LanguageArTest extends LanguageClassesTestCase { - /** - * @covers Language::formatNum - * @todo split into a test and a dataprovider - */ - public function testFormatNum() { - $this->assertEquals( '١٬٢٣٤٬٥٦٧', $this->getLang()->formatNum( '1234567' ) ); - $this->assertEquals( '-١٢٫٨٩', $this->getLang()->formatNum( -12.89 ) ); - } - - /** - * Mostly to test the raw ascii feature. - * @dataProvider providerSprintfDate - * @covers Language::sprintfDate - */ - public function testSprintfDate( $format, $date, $expected ) { - $this->assertEquals( $expected, $this->getLang()->sprintfDate( $format, $date ) ); - } - - public static function providerSprintfDate() { - return array( - array( - 'xg "vs" g', - '20120102030410', - 'يناير vs ٣' - ), - array( - 'xmY', - '20120102030410', - '١٤٣٣' - ), - array( - 'xnxmY', - '20120102030410', - '1433' - ), - array( - 'xN xmj xmn xN xmY', - '20120102030410', - ' 7 2 ١٤٣٣' - ), - ); - } - - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'zero', 'one', 'two', 'few', 'many', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'zero', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'few', 3 ), - array( 'few', 9 ), - array( 'few', 110 ), - array( 'many', 11 ), - array( 'many', 15 ), - array( 'many', 99 ), - array( 'many', 9999 ), - array( 'other', 100 ), - array( 'other', 102 ), - array( 'other', 1000 ), - array( 'other', 1.7 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageBeTest.php b/tests/phpunit/languages/LanguageBeTest.php deleted file mode 100644 index 7bd586af..00000000 --- a/tests/phpunit/languages/LanguageBeTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageBe.php */ -class LanguageBeTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'many', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 1 ), - array( 'many', 11 ), - array( 'one', 91 ), - array( 'one', 121 ), - array( 'few', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'few', 334 ), - array( 'many', 5 ), - array( 'many', 15 ), - array( 'many', 120 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageBe_taraskTest.php b/tests/phpunit/languages/LanguageBe_taraskTest.php deleted file mode 100644 index dbdb5889..00000000 --- a/tests/phpunit/languages/LanguageBe_taraskTest.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php - -class LanguageBe_taraskTest extends LanguageClassesTestCase { - /** - * Make sure the language code we are given is indeed - * be-tarask. This is to ensure LanguageClassesTestCase - * does not give us the wrong language. - */ - public function testBeTaraskTestsUsesBeTaraskCode() { - $this->assertEquals( 'be-tarask', - $this->getLang()->getCode() - ); - } - - /** - * @see bug 23156 & r64981 - * @covers Language::commafy - */ - public function testSearchRightSingleQuotationMarkAsApostroph() { - $this->assertEquals( - "'", - $this->getLang()->normalizeForSearch( '’' ), - 'bug 23156: U+2019 conversion to U+0027' - ); - } - - /** - * @see bug 23156 & r64981 - * @covers Language::commafy - */ - public function testCommafy() { - $this->assertEquals( '1,234,567', $this->getLang()->commafy( '1234567' ) ); - $this->assertEquals( '12,345', $this->getLang()->commafy( '12345' ) ); - } - - /** - * @see bug 23156 & r64981 - * @covers Language::commafy - */ - public function testDoesNotCommafyFourDigitsNumber() { - $this->assertEquals( '1234', $this->getLang()->commafy( '1234' ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'many', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 1 ), - array( 'many', 11 ), - array( 'one', 91 ), - array( 'one', 121 ), - array( 'few', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'few', 334 ), - array( 'many', 5 ), - array( 'many', 15 ), - array( 'many', 120 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( '1=one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'other', 11 ), - array( 'other', 91 ), - array( 'other', 121 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageBhoTest.php b/tests/phpunit/languages/LanguageBhoTest.php deleted file mode 100644 index 187bfbbc..00000000 --- a/tests/phpunit/languages/LanguageBhoTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageBho.php */ -class LanguageBhoTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageBsTest.php b/tests/phpunit/languages/LanguageBsTest.php deleted file mode 100644 index 7aca2ab1..00000000 --- a/tests/phpunit/languages/LanguageBsTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for Croatian (hrvatski) */ -class LanguageBsTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 4 ), - array( 'other', 5 ), - array( 'other', 11 ), - array( 'other', 20 ), - array( 'one', 21 ), - array( 'few', 24 ), - array( 'other', 25 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageClassesTestCase.php b/tests/phpunit/languages/LanguageClassesTestCase.php deleted file mode 100644 index 632e037f..00000000 --- a/tests/phpunit/languages/LanguageClassesTestCase.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * Helping class to run tests using a clean language instance. - * - * This is intended for the MediaWiki language class tests under - * tests/phpunit/languages. - * - * Before each tests, a new language object is build which you - * can retrieve in your test using the $this->getLang() method: - * - * @par Using the crafted language object: - * @code - * function testHasLanguageObject() { - * $langObject = $this->getLang(); - * $this->assertInstanceOf( 'LanguageFoo', - * $langObject - * ); - * } - * @endcode - */ -abstract class LanguageClassesTestCase extends MediaWikiTestCase { - /** - * Internal language object - * - * A new object is created before each tests thanks to PHPUnit - * setUp() method, it is deleted after each test too. To get - * this object you simply use the getLang method. - * - * You must have setup a language code first. See $LanguageClassCode - * @code - * function testWeAreTheChampions() { - * $this->getLang(); # language object - * } - * @endcode - */ - private $languageObject; - - /** - * @return Language - */ - protected function getLang() { - return $this->languageObject; - } - - /** - * Create a new language object before each test. - */ - protected function setUp() { - parent::setUp(); - $found = preg_match( '/Language(.+)Test/', get_called_class(), $m ); - if ( $found ) { - # Normalize language code since classes uses underscores - $m[1] = str_replace( '_', '-', $m[1] ); - } else { - # Fallback to english language - $m[1] = 'en'; - wfDebug( - __METHOD__ . " could not extract a language name " - . "out of " . get_called_class() . " failling back to 'en'\n" - ); - } - // @todo validate $m[1] which should be a valid language code - $this->languageObject = Language::factory( $m[1] ); - } - - /** - * Delete the internal language object so each test start - * out with a fresh language instance. - */ - protected function tearDown() { - unset( $this->languageObject ); - parent::tearDown(); - } -} diff --git a/tests/phpunit/languages/LanguageCsTest.php b/tests/phpunit/languages/LanguageCsTest.php deleted file mode 100644 index da9e6b88..00000000 --- a/tests/phpunit/languages/LanguageCsTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/Languagecs.php */ -class LanguageCsTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'other', 5 ), - array( 'other', 11 ), - array( 'other', 20 ), - array( 'other', 25 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageCuTest.php b/tests/phpunit/languages/LanguageCuTest.php deleted file mode 100644 index 07193172..00000000 --- a/tests/phpunit/languages/LanguageCuTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageCu.php */ -class LanguageCuTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'other', 5 ), - array( 'one', 11 ), - array( 'other', 20 ), - array( 'two', 22 ), - array( 'few', 223 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageCyTest.php b/tests/phpunit/languages/LanguageCyTest.php deleted file mode 100644 index eaf663a8..00000000 --- a/tests/phpunit/languages/LanguageCyTest.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageCy.php */ -class LanguageCyTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'zero', 'one', 'two', 'few', 'many', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'zero', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'few', 3 ), - array( 'many', 6 ), - array( 'other', 4 ), - array( 'other', 5 ), - array( 'other', 11 ), - array( 'other', 20 ), - array( 'other', 22 ), - array( 'other', 223 ), - array( 'other', 200.00 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageDsbTest.php b/tests/phpunit/languages/LanguageDsbTest.php deleted file mode 100644 index 94c11bcc..00000000 --- a/tests/phpunit/languages/LanguageDsbTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageDsb.php */ -class LanguageDsbTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'one', 101 ), - array( 'one', 90001 ), - array( 'two', 2 ), - array( 'few', 3 ), - array( 'few', 203 ), - array( 'few', 4 ), - array( 'other', 99 ), - array( 'other', 555 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageFrTest.php b/tests/phpunit/languages/LanguageFrTest.php deleted file mode 100644 index 46b65011..00000000 --- a/tests/phpunit/languages/LanguageFrTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageFr.php */ -class LanguageFrTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageGaTest.php b/tests/phpunit/languages/LanguageGaTest.php deleted file mode 100644 index c009f56b..00000000 --- a/tests/phpunit/languages/LanguageGaTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageGa.php */ -class LanguageGaTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageGdTest.php b/tests/phpunit/languages/LanguageGdTest.php deleted file mode 100644 index 0b2612b2..00000000 --- a/tests/phpunit/languages/LanguageGdTest.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012-2013, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageGd.php */ -class LanguageGdTest extends LanguageClassesTestCase { - /** - * @dataProvider providerPlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providerPlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'one', 11 ), - array( 'two', 12 ), - array( 'few', 3 ), - array( 'few', 19 ), - array( 'other', 200 ), - ); - } - - /** - * @dataProvider providerPluralExplicit - * @covers Language::convertPlural - */ - public function testExplicitPlural( $result, $value ) { - $forms = array( 'one', 'two', 'few', 'other', '11=Form11', '12=Form12' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providerPluralExplicit() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'Form11', 11 ), - array( 'Form12', 12 ), - array( 'few', 3 ), - array( 'few', 19 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageGvTest.php b/tests/phpunit/languages/LanguageGvTest.php deleted file mode 100644 index fc58022a..00000000 --- a/tests/phpunit/languages/LanguageGvTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * Test for Manx (Gaelg) language - * - * @author Santhosh Thottingal - * @copyright Copyright © 2013, Santhosh Thottingal - * @file - */ - -class LanguageGvTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'few', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'other', 3 ), - array( 'few', 20 ), - array( 'one', 21 ), - array( 'two', 22 ), - array( 'other', 23 ), - array( 'other', 50 ), - array( 'few', 60 ), - array( 'other', 80 ), - array( 'few', 100 ) - ); - } -} diff --git a/tests/phpunit/languages/LanguageHeTest.php b/tests/phpunit/languages/LanguageHeTest.php deleted file mode 100644 index 8edc6ddf..00000000 --- a/tests/phpunit/languages/LanguageHeTest.php +++ /dev/null @@ -1,132 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageHe.php */ -class LanguageHeTest extends LanguageClassesTestCase { - /** - * The most common usage for the plural forms is two forms, - * for singular and plural. In this case, the second form - * is technically dual, but in practice it's used as plural. - * In some cases, usually with expressions of time, three forms - * are needed - singular, dual and plural. - * CLDR also specifies a fourth form for multiples of 10, - * which is very rare. It also has a mistake, because - * the number 10 itself is supposed to be just plural, - * so currently it's overridden in MediaWiki. - */ - - // @todo the below test*PluralForms test methods can be refactored - // to use a single test method and data provider.. - - /** - * @dataProvider provideTwoPluralForms - * @covers Language::convertPlural - */ - public function testTwoPluralForms( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider provideThreePluralForms - * @covers Language::convertPlural - */ - public function testThreePluralForms( $result, $value ) { - $forms = array( 'one', 'two', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider provideFourPluralForms - * @covers Language::convertPlural - */ - public function testFourPluralForms( $result, $value ) { - $forms = array( 'one', 'two', 'many', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider provideFourPluralForms - * @covers Language::convertPlural - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function provideTwoPluralForms() { - return array( - array( 'other', 0 ), // Zero - plural - array( 'one', 1 ), // Singular - array( 'other', 2 ), // No third form provided, use it as plural - array( 'other', 3 ), // Plural - other - array( 'other', 10 ), // No fourth form provided, use it as plural - array( 'other', 20 ), // No fourth form provided, use it as plural - ); - } - - public static function provideThreePluralForms() { - return array( - array( 'other', 0 ), // Zero - plural - array( 'one', 1 ), // Singular - array( 'two', 2 ), // Dual - array( 'other', 3 ), // Plural - other - array( 'other', 10 ), // No fourth form provided, use it as plural - array( 'other', 20 ), // No fourth form provided, use it as plural - ); - } - - public static function provideFourPluralForms() { - return array( - array( 'other', 0 ), // Zero - plural - array( 'one', 1 ), // Singular - array( 'two', 2 ), // Dual - array( 'other', 3 ), // Plural - other - array( 'other', 10 ), // 10 is supposed to be plural (other), not "many" - array( 'many', 20 ), // Fourth form provided - rare, but supported by CLDR - ); - } - - /** - * @dataProvider provideGrammar - * @covers Language::convertGrammar - */ - public function testGrammar( $result, $word, $case ) { - $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) ); - } - - // The comments in the beginning of the line help avoid RTL problems - // with text editors. - public static function provideGrammar() { - return array( - array( - /* result */'וויקיפדיה', - /* word */'ויקיפדיה', - /* case */'תחילית', - ), - array( - /* result */'וולפגנג', - /* word */'וולפגנג', - /* case */'prefixed', - ), - array( - /* result */'קובץ', - /* word */'הקובץ', - /* case */'תחילית', - ), - array( - /* result */'־Wikipedia', - /* word */'Wikipedia', - /* case */'תחילית', - ), - array( - /* result */'־1995', - /* word */'1995', - /* case */'תחילית', - ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageHiTest.php b/tests/phpunit/languages/LanguageHiTest.php deleted file mode 100644 index f6d2c9e9..00000000 --- a/tests/phpunit/languages/LanguageHiTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageHi.php */ -class LanguageHiTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageHrTest.php b/tests/phpunit/languages/LanguageHrTest.php deleted file mode 100644 index 644c5255..00000000 --- a/tests/phpunit/languages/LanguageHrTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageHr.php */ -class LanguageHrTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 4 ), - array( 'other', 5 ), - array( 'other', 11 ), - array( 'other', 20 ), - array( 'one', 21 ), - array( 'few', 24 ), - array( 'other', 25 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageHsbTest.php b/tests/phpunit/languages/LanguageHsbTest.php deleted file mode 100644 index f95a43bf..00000000 --- a/tests/phpunit/languages/LanguageHsbTest.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageHsb.php */ -class LanguageHsbTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'one', 101 ), - array( 'one', 90001 ), - array( 'two', 2 ), - array( 'few', 3 ), - array( 'few', 203 ), - array( 'few', 4 ), - array( 'other', 99 ), - array( 'other', 555 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageHuTest.php b/tests/phpunit/languages/LanguageHuTest.php deleted file mode 100644 index ee9197d7..00000000 --- a/tests/phpunit/languages/LanguageHuTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageHu.php */ -class LanguageHuTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageHyTest.php b/tests/phpunit/languages/LanguageHyTest.php deleted file mode 100644 index 92e0ef94..00000000 --- a/tests/phpunit/languages/LanguageHyTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for Armenian (Հայերեն) */ -class LanguageHyTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageKshTest.php b/tests/phpunit/languages/LanguageKshTest.php deleted file mode 100644 index 568a3780..00000000 --- a/tests/phpunit/languages/LanguageKshTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageKsh.php */ -class LanguageKshTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other', 'zero' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'zero', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageLnTest.php b/tests/phpunit/languages/LanguageLnTest.php deleted file mode 100644 index 10b3234f..00000000 --- a/tests/phpunit/languages/LanguageLnTest.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageLn.php */ -class LanguageLnTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageLtTest.php b/tests/phpunit/languages/LanguageLtTest.php deleted file mode 100644 index 30642f62..00000000 --- a/tests/phpunit/languages/LanguageLtTest.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageLt.php */ -class LanguageLtTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 9 ), - array( 'other', 10 ), - array( 'other', 11 ), - array( 'other', 20 ), - array( 'one', 21 ), - array( 'few', 32 ), - array( 'one', 41 ), - array( 'one', 40001 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testOneFewPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - // This fails for 21, but not sure why. - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 15 ), - array( 'other', 20 ), - array( 'one', 21 ), - array( 'other', 22 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageLvTest.php b/tests/phpunit/languages/LanguageLvTest.php deleted file mode 100644 index 7120cfe3..00000000 --- a/tests/phpunit/languages/LanguageLvTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for Latvian */ -class LanguageLvTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'zero', 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'zero', 0 ), - array( 'one', 1 ), - array( 'zero', 11 ), - array( 'one', 21 ), - array( 'zero', 411 ), - array( 'other', 2 ), - array( 'other', 9 ), - array( 'zero', 12 ), - array( 'other', 12.345 ), - array( 'zero', 20 ), - array( 'other', 22 ), - array( 'one', 31 ), - array( 'zero', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageMgTest.php b/tests/phpunit/languages/LanguageMgTest.php deleted file mode 100644 index 65e8fd7b..00000000 --- a/tests/phpunit/languages/LanguageMgTest.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageMg.php */ -class LanguageMgTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 200 ), - array( 'other', 123.3434 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageMkTest.php b/tests/phpunit/languages/LanguageMkTest.php deleted file mode 100644 index ed155263..00000000 --- a/tests/phpunit/languages/LanguageMkTest.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for македонски/Macedonian */ -class LanguageMkTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'one', 11 ), - array( 'one', 21 ), - array( 'one', 411 ), - array( 'other', 12.345 ), - array( 'other', 20 ), - array( 'one', 31 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageMlTest.php b/tests/phpunit/languages/LanguageMlTest.php deleted file mode 100644 index 4fa45ce3..00000000 --- a/tests/phpunit/languages/LanguageMlTest.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2011, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageMl.php */ -class LanguageMlTest extends LanguageClassesTestCase { - - /** - * @dataProvider providerFormatNum - * @see bug 29495 - * @covers Language::formatNum - */ - public function testFormatNum( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->formatNum( $value ) ); - } - - public static function providerFormatNum() { - return array( - array( '12,34,567', '1234567' ), - array( '12,345', '12345' ), - array( '1', '1' ), - array( '123', '123' ), - array( '1,234', '1234' ), - array( '12,345.56', '12345.56' ), - array( '12,34,56,79,81,23,45,678', '12345679812345678' ), - array( '.12345', '.12345' ), - array( '-12,00,000', '-1200000' ), - array( '-98', '-98' ), - array( '-98', -98 ), - array( '-1,23,45,678', -12345678 ), - array( '', '' ), - array( '', null ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageMoTest.php b/tests/phpunit/languages/LanguageMoTest.php deleted file mode 100644 index e0e54ca8..00000000 --- a/tests/phpunit/languages/LanguageMoTest.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageMo.php */ -class LanguageMoTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'few', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 19 ), - array( 'other', 20 ), - array( 'other', 99 ), - array( 'other', 100 ), - array( 'few', 101 ), - array( 'few', 119 ), - array( 'other', 120 ), - array( 'other', 200 ), - array( 'few', 201 ), - array( 'few', 219 ), - array( 'other', 220 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageMtTest.php b/tests/phpunit/languages/LanguageMtTest.php deleted file mode 100644 index 96d2bc92..00000000 --- a/tests/phpunit/languages/LanguageMtTest.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageMt.php */ -class LanguageMtTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'many', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'few', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 10 ), - array( 'many', 11 ), - array( 'many', 19 ), - array( 'other', 20 ), - array( 'other', 99 ), - array( 'other', 100 ), - array( 'other', 101 ), - array( 'few', 102 ), - array( 'few', 110 ), - array( 'many', 111 ), - array( 'many', 119 ), - array( 'other', 120 ), - array( 'other', 201 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 10 ), - array( 'other', 11 ), - array( 'other', 19 ), - array( 'other', 20 ), - array( 'other', 99 ), - array( 'other', 100 ), - array( 'other', 101 ), - array( 'other', 102 ), - array( 'other', 110 ), - array( 'other', 111 ), - array( 'other', 119 ), - array( 'other', 120 ), - array( 'other', 201 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageNlTest.php b/tests/phpunit/languages/LanguageNlTest.php deleted file mode 100644 index 26bd691a..00000000 --- a/tests/phpunit/languages/LanguageNlTest.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2011, Santhosh Thottingal - * @file - */ - -/** Tests for MediaWiki languages/LanguageNl.php */ -class LanguageNlTest extends LanguageClassesTestCase { - - /** - * @covers Language::formatNum - * @todo split into a test and a dataprovider - */ - public function testFormatNum() { - $this->assertEquals( '1.234.567', $this->getLang()->formatNum( '1234567' ) ); - $this->assertEquals( '12.345', $this->getLang()->formatNum( '12345' ) ); - $this->assertEquals( '1', $this->getLang()->formatNum( '1' ) ); - $this->assertEquals( '123', $this->getLang()->formatNum( '123' ) ); - $this->assertEquals( '1.234', $this->getLang()->formatNum( '1234' ) ); - $this->assertEquals( '12.345,56', $this->getLang()->formatNum( '12345.56' ) ); - $this->assertEquals( ',1234556', $this->getLang()->formatNum( '.1234556' ) ); - } -} diff --git a/tests/phpunit/languages/LanguageNsoTest.php b/tests/phpunit/languages/LanguageNsoTest.php deleted file mode 100644 index 18efd736..00000000 --- a/tests/phpunit/languages/LanguageNsoTest.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageNso.php */ -class LanguageNsoTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguagePlTest.php b/tests/phpunit/languages/LanguagePlTest.php deleted file mode 100644 index d180037b..00000000 --- a/tests/phpunit/languages/LanguagePlTest.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguagePl.php */ -class LanguagePlTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'many' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'many', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'many', 5 ), - array( 'many', 9 ), - array( 'many', 10 ), - array( 'many', 11 ), - array( 'many', 21 ), - array( 'few', 22 ), - array( 'few', 23 ), - array( 'few', 24 ), - array( 'many', 25 ), - array( 'many', 200 ), - array( 'many', 201 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 3 ), - array( 'other', 4 ), - array( 'other', 5 ), - array( 'other', 9 ), - array( 'other', 10 ), - array( 'other', 11 ), - array( 'other', 21 ), - array( 'other', 22 ), - array( 'other', 23 ), - array( 'other', 24 ), - array( 'other', 25 ), - array( 'other', 200 ), - array( 'other', 201 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageRoTest.php b/tests/phpunit/languages/LanguageRoTest.php deleted file mode 100644 index ae7816bc..00000000 --- a/tests/phpunit/languages/LanguageRoTest.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageRo.php */ -class LanguageRoTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'few', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 19 ), - array( 'other', 20 ), - array( 'other', 99 ), - array( 'other', 100 ), - array( 'few', 101 ), - array( 'few', 119 ), - array( 'other', 120 ), - array( 'other', 200 ), - array( 'few', 201 ), - array( 'few', 219 ), - array( 'other', 220 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageRuTest.php b/tests/phpunit/languages/LanguageRuTest.php deleted file mode 100644 index e17c7085..00000000 --- a/tests/phpunit/languages/LanguageRuTest.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * based on LanguageBe_tarask.php - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageRu.php */ -class LanguageRuTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'many', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * Test explicit plural forms - n=FormN forms - * @covers Language::convertPlural - */ - public function testExplicitPlural() { - $forms = array( 'one','many', 'other', '12=dozen' ); - $this->assertEquals( 'dozen', $this->getLang()->convertPlural( 12, $forms ) ); - $forms = array( 'one', 'many', '100=hundred', 'other', '12=dozen' ); - $this->assertEquals( 'hundred', $this->getLang()->convertPlural( 100, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 1 ), - array( 'many', 11 ), - array( 'one', 91 ), - array( 'one', 121 ), - array( 'other', 2 ), - array( 'other', 3 ), - array( 'other', 4 ), - array( 'other', 334 ), - array( 'many', 5 ), - array( 'many', 15 ), - array( 'many', 120 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( '1=one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'one', 1 ), - array( 'other', 11 ), - array( 'other', 91 ), - array( 'other', 121 ), - ); - } - - /** - * @dataProvider providerGrammar - * @covers Language::convertGrammar - */ - public function testGrammar( $result, $word, $case ) { - $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) ); - } - - public static function providerGrammar() { - return array( - array( - 'Википедии', - 'Википедия', - 'genitive', - ), - array( - 'Викитеки', - 'Викитека', - 'genitive', - ), - array( - 'Викитеке', - 'Викитека', - 'prepositional', - ), - array( - 'Викиданных', - 'Викиданные', - 'prepositional', - ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageSeTest.php b/tests/phpunit/languages/LanguageSeTest.php deleted file mode 100644 index 533aa2bc..00000000 --- a/tests/phpunit/languages/LanguageSeTest.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageSe.php */ -class LanguageSeTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'other', 3 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 3 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageSgsTest.php b/tests/phpunit/languages/LanguageSgsTest.php deleted file mode 100644 index fa49a4dd..00000000 --- a/tests/phpunit/languages/LanguageSgsTest.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for Samogitian */ -class LanguageSgsTest extends LanguageClassesTestCase { - /** - * @dataProvider providePluralAllForms - * @covers Language::convertPlural - */ - public function testPluralAllForms( $result, $value ) { - $forms = array( 'one', 'two', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePluralAllForms - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePluralAllForms() { - return array( - array( 'few', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'other', 3 ), - array( 'few', 10 ), - array( 'few', 11 ), - array( 'few', 12 ), - array( 'few', 19 ), - array( 'other', 20 ), - array( 'few', 100 ), - array( 'one', 101 ), - array( 'few', 111 ), - array( 'few', 112 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 3 ), - array( 'other', 10 ), - array( 'other', 11 ), - array( 'other', 12 ), - array( 'other', 19 ), - array( 'other', 20 ), - array( 'other', 100 ), - array( 'one', 101 ), - array( 'other', 111 ), - array( 'other', 112 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageShTest.php b/tests/phpunit/languages/LanguageShTest.php deleted file mode 100644 index 1b390872..00000000 --- a/tests/phpunit/languages/LanguageShTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for srpskohrvatski / српскохрватски / Serbocroatian */ -class LanguageShTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 4 ), - array( 'other', 5 ), - array( 'other', 10 ), - array( 'other', 11 ), - array( 'other', 12 ), - array( 'one', 101 ), - array( 'few', 102 ), - array( 'other', 111 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageSkTest.php b/tests/phpunit/languages/LanguageSkTest.php deleted file mode 100644 index cb8a13b8..00000000 --- a/tests/phpunit/languages/LanguageSkTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Amir E. Aharoni - * based on LanguageSkTest.php - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageSk.php */ -class LanguageSkTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'few', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'other', 5 ), - array( 'other', 11 ), - array( 'other', 20 ), - array( 'other', 25 ), - array( 'other', 200 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageSlTest.php b/tests/phpunit/languages/LanguageSlTest.php deleted file mode 100644 index 9783dd80..00000000 --- a/tests/phpunit/languages/LanguageSlTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * @author Santhosh Thottingal - * @copyright Copyright © 2012, Amir E. Aharoni - * based on LanguageSkTest.php - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageSl.php */ -class LanguageSlTest extends LanguageClassesTestCase { - /** - * @dataProvider providerPlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providerPlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providerPlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'other', 5 ), - array( 'other', 99 ), - array( 'other', 100 ), - array( 'one', 101 ), - array( 'two', 102 ), - array( 'few', 103 ), - array( 'one', 201 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageSmaTest.php b/tests/phpunit/languages/LanguageSmaTest.php deleted file mode 100644 index 95cb333c..00000000 --- a/tests/phpunit/languages/LanguageSmaTest.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageSma.php */ -class LanguageSmaTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'two', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'two', 2 ), - array( 'other', 3 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'other', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - array( 'other', 3 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageSrTest.php b/tests/phpunit/languages/LanguageSrTest.php deleted file mode 100644 index d6fedb57..00000000 --- a/tests/phpunit/languages/LanguageSrTest.php +++ /dev/null @@ -1,246 +0,0 @@ -<?php -/** - * PHPUnit tests for the Serbian language. - * The language can be represented using two scripts: - * - Latin (SR_el) - * - Cyrillic (SR_ec) - * Both representations seems to be bijective, hence MediaWiki can convert - * from one script to the other. - * - * @author Antoine Musso <hashar at free dot fr> - * @copyright Copyright © 2011, Antoine Musso <hashar at free dot fr> - * @file - * - * @todo methods in test class should be tidied: - * - Should be split into separate test methods and data providers - * - Tests for LanguageConverter and Language should probably be separate.. - */ - -/** Tests for MediaWiki languages/LanguageSr.php */ -class LanguageSrTest extends LanguageClassesTestCase { - /** - * @covers LanguageConverter::convertTo - */ - public function testEasyConversions() { - $this->assertCyrillic( - 'шђчћжШЂЧЋЖ', - 'Cyrillic guessing characters' - ); - $this->assertLatin( - 'šđč枊ĐČĆŽ', - 'Latin guessing characters' - ); - } - - /** - * @covers LanguageConverter::convertTo - */ - public function testMixedConversions() { - $this->assertCyrillic( - 'шђчћжШЂЧЋЖ - šđčćž', - 'Mostly cyrillic characters' - ); - $this->assertLatin( - 'šđč枊ĐČĆŽ - шђчћж', - 'Mostly latin characters' - ); - } - - /** - * @covers LanguageConverter::convertTo - */ - public function testSameAmountOfLatinAndCyrillicGetConverted() { - $this->assertConverted( - '4 latin: šđčć | 4 cyrillic: шђчћ', - 'sr-ec' - ); - $this->assertConverted( - '4 latin: šđčć | 4 cyrillic: шђчћ', - 'sr-el' - ); - } - - /** - * @author Nikola Smolenski - * @covers LanguageConverter::convertTo - */ - public function testConversionToCyrillic() { - //A simple convertion of Latin to Cyrillic - $this->assertEquals( 'абвг', - $this->convertToCyrillic( 'abvg' ) - ); - //Same as above, but assert that -{}-s must be removed and not converted - $this->assertEquals( 'ljабnjвгdž', - $this->convertToCyrillic( '-{lj}-ab-{nj}-vg-{dž}-' ) - ); - //A simple convertion of Cyrillic to Cyrillic - $this->assertEquals( 'абвг', - $this->convertToCyrillic( 'абвг' ) - ); - //Same as above, but assert that -{}-s must be removed and not converted - $this->assertEquals( 'ljабnjвгdž', - $this->convertToCyrillic( '-{lj}-аб-{nj}-вг-{dž}-' ) - ); - //This text has some Latin, but is recognized as Cyrillic, so it should not be converted - $this->assertEquals( 'abvgшђжчћ', - $this->convertToCyrillic( 'abvgшђжчћ' ) - ); - //Same as above, but assert that -{}-s must be removed - $this->assertEquals( 'љabvgњшђжчћџ', - $this->convertToCyrillic( '-{љ}-abvg-{њ}-шђжчћ-{џ}-' ) - ); - //This text has some Cyrillic, but is recognized as Latin, so it should be converted - $this->assertEquals( 'абвгшђжчћ', - $this->convertToCyrillic( 'абвгšđžčć' ) - ); - //Same as above, but assert that -{}-s must be removed and not converted - $this->assertEquals( 'ljабвгnjшђжчћdž', - $this->convertToCyrillic( '-{lj}-абвг-{nj}-šđžčć-{dž}-' ) - ); - // Roman numerals are not converted - $this->assertEquals( 'а I б II в III г IV шђжчћ', - $this->convertToCyrillic( 'a I b II v III g IV šđžčć' ) - ); - } - - /** - * @covers LanguageConverter::convertTo - */ - public function testConversionToLatin() { - //A simple convertion of Latin to Latin - $this->assertEquals( 'abcd', - $this->convertToLatin( 'abcd' ) - ); - //A simple convertion of Cyrillic to Latin - $this->assertEquals( 'abcd', - $this->convertToLatin( 'абцд' ) - ); - //This text has some Latin, but is recognized as Cyrillic, so it should be converted - $this->assertEquals( 'abcdšđžčć', - $this->convertToLatin( 'abcdшђжчћ' ) - ); - //This text has some Cyrillic, but is recognized as Latin, so it should not be converted - $this->assertEquals( 'абцдšđžčć', - $this->convertToLatin( 'абцдšđžčć' ) - ); - } - - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 1 ), - array( 'other', 11 ), - array( 'one', 91 ), - array( 'one', 121 ), - array( 'few', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'few', 334 ), - array( 'other', 5 ), - array( 'other', 15 ), - array( 'other', 120 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'one', 1 ), - array( 'other', 11 ), - array( 'other', 4 ), - array( 'one', 91 ), - array( 'one', 121 ), - ); - } - - ##### HELPERS ##################################################### - /** - *Wrapper to verify text stay the same after applying conversion - * @param $text string Text to convert - * @param $variant string Language variant 'sr-ec' or 'sr-el' - * @param $msg string Optional message - */ - protected function assertUnConverted( $text, $variant, $msg = '' ) { - $this->assertEquals( - $text, - $this->convertTo( $text, $variant ), - $msg - ); - } - - /** - * Wrapper to verify a text is different once converted to a variant. - * @param $text string Text to convert - * @param $variant string Language variant 'sr-ec' or 'sr-el' - * @param $msg string Optional message - */ - protected function assertConverted( $text, $variant, $msg = '' ) { - $this->assertNotEquals( - $text, - $this->convertTo( $text, $variant ), - $msg - ); - } - - /** - * Verifiy the given Cyrillic text is not converted when using - * using the cyrillic variant and converted to Latin when using - * the Latin variant. - */ - protected function assertCyrillic( $text, $msg = '' ) { - $this->assertUnConverted( $text, 'sr-ec', $msg ); - $this->assertConverted( $text, 'sr-el', $msg ); - } - - /** - * Verifiy the given Latin text is not converted when using - * using the Latin variant and converted to Cyrillic when using - * the Cyrillic variant. - */ - protected function assertLatin( $text, $msg = '' ) { - $this->assertUnConverted( $text, 'sr-el', $msg ); - $this->assertConverted( $text, 'sr-ec', $msg ); - } - - - /** Wrapper for converter::convertTo() method*/ - protected function convertTo( $text, $variant ) { - return $this->getLang() - ->mConverter - ->convertTo( - $text, $variant - ); - } - - protected function convertToCyrillic( $text ) { - return $this->convertTo( $text, 'sr-ec' ); - } - - protected function convertToLatin( $text ) { - return $this->convertTo( $text, 'sr-el' ); - } -} diff --git a/tests/phpunit/languages/LanguageTest.php b/tests/phpunit/languages/LanguageTest.php deleted file mode 100644 index 78929e23..00000000 --- a/tests/phpunit/languages/LanguageTest.php +++ /dev/null @@ -1,1567 +0,0 @@ -<?php - -class LanguageTest extends LanguageClassesTestCase { - /** - * @covers Language::convertDoubleWidth - * @covers Language::normalizeForSearch - */ - public function testLanguageConvertDoubleWidthToSingleWidth() { - $this->assertEquals( - "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", - $this->getLang()->normalizeForSearch( - "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" - ), - 'convertDoubleWidth() with the full alphabet and digits' - ); - } - - /** - * @dataProvider provideFormattableTimes# - * @covers Language::formatTimePeriod - */ - public function testFormatTimePeriod( $seconds, $format, $expected, $desc ) { - $this->assertEquals( $expected, $this->getLang()->formatTimePeriod( $seconds, $format ), $desc ); - } - - public static function provideFormattableTimes() { - return array( - array( - 9.45, - array(), - '9.5 s', - 'formatTimePeriod() rounding (<10s)' - ), - array( - 9.45, - array( 'noabbrevs' => true ), - '9.5 seconds', - 'formatTimePeriod() rounding (<10s)' - ), - array( - 9.95, - array(), - '10 s', - 'formatTimePeriod() rounding (<10s)' - ), - array( - 9.95, - array( 'noabbrevs' => true ), - '10 seconds', - 'formatTimePeriod() rounding (<10s)' - ), - array( - 59.55, - array(), - '1 min 0 s', - 'formatTimePeriod() rounding (<60s)' - ), - array( - 59.55, - array( 'noabbrevs' => true ), - '1 minute 0 seconds', - 'formatTimePeriod() rounding (<60s)' - ), - array( - 119.55, - array(), - '2 min 0 s', - 'formatTimePeriod() rounding (<1h)' - ), - array( - 119.55, - array( 'noabbrevs' => true ), - '2 minutes 0 seconds', - 'formatTimePeriod() rounding (<1h)' - ), - array( - 3599.55, - array(), - '1 h 0 min 0 s', - 'formatTimePeriod() rounding (<1h)' - ), - array( - 3599.55, - array( 'noabbrevs' => true ), - '1 hour 0 minutes 0 seconds', - 'formatTimePeriod() rounding (<1h)' - ), - array( - 7199.55, - array(), - '2 h 0 min 0 s', - 'formatTimePeriod() rounding (>=1h)' - ), - array( - 7199.55, - array( 'noabbrevs' => true ), - '2 hours 0 minutes 0 seconds', - 'formatTimePeriod() rounding (>=1h)' - ), - array( - 7199.55, - 'avoidseconds', - '2 h 0 min', - 'formatTimePeriod() rounding (>=1h), avoidseconds' - ), - array( - 7199.55, - array( 'avoid' => 'avoidseconds', 'noabbrevs' => true ), - '2 hours 0 minutes', - 'formatTimePeriod() rounding (>=1h), avoidseconds' - ), - array( - 7199.55, - 'avoidminutes', - '2 h 0 min', - 'formatTimePeriod() rounding (>=1h), avoidminutes' - ), - array( - 7199.55, - array( 'avoid' => 'avoidminutes', 'noabbrevs' => true ), - '2 hours 0 minutes', - 'formatTimePeriod() rounding (>=1h), avoidminutes' - ), - array( - 172799.55, - 'avoidseconds', - '48 h 0 min', - 'formatTimePeriod() rounding (=48h), avoidseconds' - ), - array( - 172799.55, - array( 'avoid' => 'avoidseconds', 'noabbrevs' => true ), - '48 hours 0 minutes', - 'formatTimePeriod() rounding (=48h), avoidseconds' - ), - array( - 259199.55, - 'avoidminutes', - '3 d 0 h', - 'formatTimePeriod() rounding (>48h), avoidminutes' - ), - array( - 259199.55, - array( 'avoid' => 'avoidminutes', 'noabbrevs' => true ), - '3 days 0 hours', - 'formatTimePeriod() rounding (>48h), avoidminutes' - ), - array( - 176399.55, - 'avoidseconds', - '2 d 1 h 0 min', - 'formatTimePeriod() rounding (>48h), avoidseconds' - ), - array( - 176399.55, - array( 'avoid' => 'avoidseconds', 'noabbrevs' => true ), - '2 days 1 hour 0 minutes', - 'formatTimePeriod() rounding (>48h), avoidseconds' - ), - array( - 176399.55, - 'avoidminutes', - '2 d 1 h', - 'formatTimePeriod() rounding (>48h), avoidminutes' - ), - array( - 176399.55, - array( 'avoid' => 'avoidminutes', 'noabbrevs' => true ), - '2 days 1 hour', - 'formatTimePeriod() rounding (>48h), avoidminutes' - ), - array( - 259199.55, - 'avoidseconds', - '3 d 0 h 0 min', - 'formatTimePeriod() rounding (>48h), avoidseconds' - ), - array( - 259199.55, - array( 'avoid' => 'avoidseconds', 'noabbrevs' => true ), - '3 days 0 hours 0 minutes', - 'formatTimePeriod() rounding (>48h), avoidseconds' - ), - array( - 172801.55, - 'avoidseconds', - '2 d 0 h 0 min', - 'formatTimePeriod() rounding, (>48h), avoidseconds' - ), - array( - 172801.55, - array( 'avoid' => 'avoidseconds', 'noabbrevs' => true ), - '2 days 0 hours 0 minutes', - 'formatTimePeriod() rounding, (>48h), avoidseconds' - ), - array( - 176460.55, - array(), - '2 d 1 h 1 min 1 s', - 'formatTimePeriod() rounding, recursion, (>48h)' - ), - array( - 176460.55, - array( 'noabbrevs' => true ), - '2 days 1 hour 1 minute 1 second', - 'formatTimePeriod() rounding, recursion, (>48h)' - ), - ); - } - - /** - * @covers Language::truncate - */ - public function testTruncate() { - $this->assertEquals( - "XXX", - $this->getLang()->truncate( "1234567890", 0, 'XXX' ), - 'truncate prefix, len 0, small ellipsis' - ); - - $this->assertEquals( - "12345XXX", - $this->getLang()->truncate( "1234567890", 8, 'XXX' ), - 'truncate prefix, small ellipsis' - ); - - $this->assertEquals( - "123456789", - $this->getLang()->truncate( "123456789", 5, 'XXXXXXXXXXXXXXX' ), - 'truncate prefix, large ellipsis' - ); - - $this->assertEquals( - "XXX67890", - $this->getLang()->truncate( "1234567890", -8, 'XXX' ), - 'truncate suffix, small ellipsis' - ); - - $this->assertEquals( - "123456789", - $this->getLang()->truncate( "123456789", -5, 'XXXXXXXXXXXXXXX' ), - 'truncate suffix, large ellipsis' - ); - } - - /** - * @dataProvider provideHTMLTruncateData - * @covers Language::truncateHTML - */ - public function testTruncateHtml( $len, $ellipsis, $input, $expected ) { - // Actual HTML... - $this->assertEquals( - $expected, - $this->getLang()->truncateHTML( $input, $len, $ellipsis ) - ); - } - - /** - * @return array format is ($len, $ellipsis, $input, $expected) - */ - public static function provideHTMLTruncateData() { - return array( - array( 0, 'XXX', "1234567890", "XXX" ), - array( 8, 'XXX', "1234567890", "12345XXX" ), - array( 5, 'XXXXXXXXXXXXXXX', '1234567890', "1234567890" ), - array( 2, '***', - '<p><span style="font-weight:bold;"></span></p>', - '<p><span style="font-weight:bold;"></span></p>', - ), - array( 2, '***', - '<p><span style="font-weight:bold;">123456789</span></p>', - '<p><span style="font-weight:bold;">***</span></p>', - ), - array( 2, '***', - '<p><span style="font-weight:bold;"> 23456789</span></p>', - '<p><span style="font-weight:bold;">***</span></p>', - ), - array( 3, '***', - '<p><span style="font-weight:bold;">123456789</span></p>', - '<p><span style="font-weight:bold;">***</span></p>', - ), - array( 4, '***', - '<p><span style="font-weight:bold;">123456789</span></p>', - '<p><span style="font-weight:bold;">1***</span></p>', - ), - array( 5, '***', - '<tt><span style="font-weight:bold;">123456789</span></tt>', - '<tt><span style="font-weight:bold;">12***</span></tt>', - ), - array( 6, '***', - '<p><a href="www.mediawiki.org">123456789</a></p>', - '<p><a href="www.mediawiki.org">123***</a></p>', - ), - array( 6, '***', - '<p><a href="www.mediawiki.org">12 456789</a></p>', - '<p><a href="www.mediawiki.org">12 ***</a></p>', - ), - array( 7, '***', - '<small><span style="font-weight:bold;">123<p id="#moo">456</p>789</span></small>', - '<small><span style="font-weight:bold;">123<p id="#moo">4***</p></span></small>', - ), - array( 8, '***', - '<div><span style="font-weight:bold;">123<span>4</span>56789</span></div>', - '<div><span style="font-weight:bold;">123<span>4</span>5***</span></div>', - ), - array( 9, '***', - '<p><table style="font-weight:bold;"><tr><td>123456789</td></tr></table></p>', - '<p><table style="font-weight:bold;"><tr><td>123456789</td></tr></table></p>', - ), - array( 10, '***', - '<p><font style="font-weight:bold;">123456789</font></p>', - '<p><font style="font-weight:bold;">123456789</font></p>', - ), - ); - } - - /** - * Test Language::isWellFormedLanguageTag() - * @dataProvider provideWellFormedLanguageTags - * @covers Language::isWellFormedLanguageTag - */ - public function testWellFormedLanguageTag( $code, $message = '' ) { - $this->assertTrue( - Language::isWellFormedLanguageTag( $code ), - "validating code $code $message" - ); - } - - /** - * The test cases are based on the tests in the GaBuZoMeu parser - * written by Stéphane Bortzmeyer <bortzmeyer@nic.fr> - * and distributed as free software, under the GNU General Public Licence. - * http://www.bortzmeyer.org/gabuzomeu-parsing-language-tags.html - */ - public static function provideWellFormedLanguageTags() { - return array( - array( 'fr', 'two-letter code' ), - array( 'fr-latn', 'two-letter code with lower case script code' ), - array( 'fr-Latn-FR', 'two-letter code with title case script code and uppercase country code' ), - array( 'fr-Latn-419', 'two-letter code with title case script code and region number' ), - array( 'fr-FR', 'two-letter code with uppercase' ), - array( 'ax-TZ', 'Not in the registry, but well-formed' ), - array( 'fr-shadok', 'two-letter code with variant' ), - array( 'fr-y-myext-myext2', 'non-x singleton' ), - array( 'fra-Latn', 'ISO 639 can be 3-letters' ), - array( 'fra', 'three-letter language code' ), - array( 'fra-FX', 'three-letter language code with country code' ), - array( 'i-klingon', 'grandfathered with singleton' ), - array( 'I-kLINgon', 'tags are case-insensitive...' ), - array( 'no-bok', 'grandfathered without singleton' ), - array( 'i-enochian', 'Grandfathered' ), - array( 'x-fr-CH', 'private use' ), - array( 'es-419', 'two-letter code with region number' ), - array( 'en-Latn-GB-boont-r-extended-sequence-x-private', 'weird, but well-formed' ), - array( 'ab-x-abc-x-abc', 'anything goes after x' ), - array( 'ab-x-abc-a-a', 'anything goes after x, including several non-x singletons' ), - array( 'i-default', 'grandfathered' ), - array( 'abcd-Latn', 'Language of 4 chars reserved for future use' ), - array( 'AaBbCcDd-x-y-any-x', 'Language of 5-8 chars, registered' ), - array( 'de-CH-1901', 'with country and year' ), - array( 'en-US-x-twain', 'with country and singleton' ), - array( 'zh-cmn', 'three-letter variant' ), - array( 'zh-cmn-Hant', 'three-letter variant and script' ), - array( 'zh-cmn-Hant-HK', 'three-letter variant, script and country' ), - array( 'xr-p-lze', 'Extension' ), - ); - } - - /** - * Negative test for Language::isWellFormedLanguageTag() - * @dataProvider provideMalformedLanguageTags - * @covers Language::isWellFormedLanguageTag - */ - public function testMalformedLanguageTag( $code, $message = '' ) { - $this->assertFalse( - Language::isWellFormedLanguageTag( $code ), - "validating that code $code is a malformed language tag - $message" - ); - } - - /** - * The test cases are based on the tests in the GaBuZoMeu parser - * written by Stéphane Bortzmeyer <bortzmeyer@nic.fr> - * and distributed as free software, under the GNU General Public Licence. - * http://www.bortzmeyer.org/gabuzomeu-parsing-language-tags.html - */ - public static function provideMalformedLanguageTags() { - return array( - array( 'f', 'language too short' ), - array( 'f-Latn', 'language too short with script' ), - array( 'xr-lxs-qut', 'variants too short' ), # extlangS - array( 'fr-Latn-F', 'region too short' ), - array( 'a-value', 'language too short with region' ), - array( 'tlh-a-b-foo', 'valid three-letter with wrong variant' ), - array( 'i-notexist', 'grandfathered but not registered: invalid, even if we only test well-formedness' ), - array( 'abcdefghi-012345678', 'numbers too long' ), - array( 'ab-abc-abc-abc-abc', 'invalid extensions' ), - array( 'ab-abcd-abc', 'invalid extensions' ), - array( 'ab-ab-abc', 'invalid extensions' ), - array( 'ab-123-abc', 'invalid extensions' ), - array( 'a-Hant-ZH', 'short language with valid extensions' ), - array( 'a1-Hant-ZH', 'invalid character in language' ), - array( 'ab-abcde-abc', 'invalid extensions' ), - array( 'ab-1abc-abc', 'invalid characters in extensions' ), - array( 'ab-ab-abcd', 'invalid order of extensions' ), - array( 'ab-123-abcd', 'invalid order of extensions' ), - array( 'ab-abcde-abcd', 'invalid extensions' ), - array( 'ab-1abc-abcd', 'invalid characters in extensions' ), - array( 'ab-a-b', 'extensions too short' ), - array( 'ab-a-x', 'extensions too short, even with singleton' ), - array( 'ab--ab', 'two separators' ), - array( 'ab-abc-', 'separator in the end' ), - array( '-ab-abc', 'separator in the beginning' ), - array( 'abcd-efg', 'language too long' ), - array( 'aabbccddE', 'tag too long' ), - array( 'pa_guru', 'A tag with underscore is invalid in strict mode' ), - array( 'de-f', 'subtag too short' ), - ); - } - - /** - * Negative test for Language::isWellFormedLanguageTag() - * @covers Language::isWellFormedLanguageTag - */ - public function testLenientLanguageTag() { - $this->assertTrue( - Language::isWellFormedLanguageTag( 'pa_guru', true ), - 'pa_guru is a well-formed language tag in lenient mode' - ); - } - - /** - * Test Language::isValidBuiltInCode() - * @dataProvider provideLanguageCodes - * @covers Language::isValidBuiltInCode - */ - public function testBuiltInCodeValidation( $code, $message = '' ) { - $this->assertTrue( - (bool)Language::isValidBuiltInCode( $code ), - "validating code $code $message" - ); - } - - /** - * @covers Language::isValidBuiltInCode - */ - public function testBuiltInCodeValidationRejectUnderscore() { - $this->assertFalse( - (bool)Language::isValidBuiltInCode( 'be_tarask' ), - "reject underscore in language code" - ); - } - - public static function provideLanguageCodes() { - return array( - array( 'fr', 'Two letters, minor case' ), - array( 'EN', 'Two letters, upper case' ), - array( 'tyv', 'Three letters' ), - array( 'tokipona', 'long language code' ), - array( 'be-tarask', 'With dash' ), - array( 'Zh-classical', 'Begin with upper case, dash' ), - array( 'Be-x-old', 'With extension (two dashes)' ), - ); - } - - /** - * Test Language::isKnownLanguageTag() - * @dataProvider provideKnownLanguageTags - * @covers Language::isKnownLanguageTag - */ - public function testKnownLanguageTag( $code, $message = '' ) { - $this->assertTrue( - (bool)Language::isKnownLanguageTag( $code ), - "validating code $code - $message" - ); - } - - public static function provideKnownLanguageTags() { - return array( - array( 'fr', 'simple code' ), - array( 'bat-smg', 'an MW legacy tag' ), - array( 'sgs', 'an internal standard MW name, for which a legacy tag is used externally' ), - ); - } - - /** - * @covers Language::isKnownLanguageTag - */ - public function testKnownCldrLanguageTag() { - if ( !class_exists( 'LanguageNames' ) ) { - $this->markTestSkipped( 'The LanguageNames class is not available. The cldr extension is probably not installed.' ); - } - - $this->assertTrue( - (bool)Language::isKnownLanguageTag( 'pal' ), - 'validating code "pal" an ancient language, which probably will not appear in Names.php, but appears in CLDR in English' - ); - } - - /** - * Negative tests for Language::isKnownLanguageTag() - * @dataProvider provideUnKnownLanguageTags - * @covers Language::isKnownLanguageTag - */ - public function testUnknownLanguageTag( $code, $message = '' ) { - $this->assertFalse( - (bool)Language::isKnownLanguageTag( $code ), - "checking that code $code is invalid - $message" - ); - } - - public static function provideUnknownLanguageTags() { - return array( - array( 'mw', 'non-existent two-letter code' ), - array( 'foo"<bar', 'very invalid language code' ), - ); - } - - /** - * Test too short timestamp - * @expectedException MWException - * @covers Language::sprintfDate - */ - public function testSprintfDateTooShortTimestamp() { - $this->getLang()->sprintfDate( 'xiY', '1234567890123' ); - } - - /** - * Test too long timestamp - * @expectedException MWException - * @covers Language::sprintfDate - */ - public function testSprintfDateTooLongTimestamp() { - $this->getLang()->sprintfDate( 'xiY', '123456789012345' ); - } - - /** - * Test too short timestamp - * @expectedException MWException - * @covers Language::sprintfDate - */ - public function testSprintfDateNotAllDigitTimestamp() { - $this->getLang()->sprintfDate( 'xiY', '-1234567890123' ); - } - - /** - * @dataProvider provideSprintfDateSamples - * @covers Language::sprintfDate - */ - public function testSprintfDate( $format, $ts, $expected, $msg ) { - $this->assertEquals( - $expected, - $this->getLang()->sprintfDate( $format, $ts ), - "sprintfDate('$format', '$ts'): $msg" - ); - } - - /** - * sprintfDate should always use UTC when no zone is given. - * @dataProvider provideSprintfDateSamples - * @covers Language::sprintfDate - */ - public function testSprintfDateNoZone( $format, $ts, $expected, $ignore, $msg ) { - $oldTZ = date_default_timezone_get(); - $res = date_default_timezone_set( 'Asia/Seoul' ); - if ( !$res ) { - $this->markTestSkipped( "Error setting Timezone" ); - } - - $this->assertEquals( - $expected, - $this->getLang()->sprintfDate( $format, $ts ), - "sprintfDate('$format', '$ts'): $msg" - ); - - date_default_timezone_set( $oldTZ ); - } - - /** - * sprintfDate should use passed timezone - * @dataProvider provideSprintfDateSamples - * @covers Language::sprintfDate - */ - public function testSprintfDateTZ( $format, $ts, $ignore, $expected, $msg ) { - $tz = new DateTimeZone( 'Asia/Seoul' ); - if ( !$tz ) { - $this->markTestSkipped( "Error getting Timezone" ); - } - - $this->assertEquals( - $expected, - $this->getLang()->sprintfDate( $format, $ts, $tz ), - "sprintfDate('$format', '$ts', 'Asia/Seoul'): $msg" - ); - } - - public static function provideSprintfDateSamples() { - return array( - array( - 'xiY', - '20111212000000', - '1390', // note because we're testing English locale we get Latin-standard digits - '1390', - 'Iranian calendar full year' - ), - array( - 'xiy', - '20111212000000', - '90', - '90', - 'Iranian calendar short year' - ), - array( - 'o', - '20120101235000', - '2011', - '2011', - 'ISO 8601 (week) year' - ), - array( - 'W', - '20120101235000', - '52', - '52', - 'Week number' - ), - array( - 'W', - '20120102235000', - '1', - '1', - 'Week number' - ), - array( - 'o-\\WW-N', - '20091231235000', - '2009-W53-4', - '2009-W53-4', - 'leap week' - ), - // What follows is mostly copied from http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23time - array( - 'Y', - '20120102090705', - '2012', - '2012', - 'Full year' - ), - array( - 'y', - '20120102090705', - '12', - '12', - '2 digit year' - ), - array( - 'L', - '20120102090705', - '1', - '1', - 'Leap year' - ), - array( - 'n', - '20120102090705', - '1', - '1', - 'Month index, not zero pad' - ), - array( - 'N', - '20120102090705', - '01', - '01', - 'Month index. Zero pad' - ), - array( - 'M', - '20120102090705', - 'Jan', - 'Jan', - 'Month abbrev' - ), - array( - 'F', - '20120102090705', - 'January', - 'January', - 'Full month' - ), - array( - 'xg', - '20120102090705', - 'January', - 'January', - 'Genitive month name (same in EN)' - ), - array( - 'j', - '20120102090705', - '2', - '2', - 'Day of month (not zero pad)' - ), - array( - 'd', - '20120102090705', - '02', - '02', - 'Day of month (zero-pad)' - ), - array( - 'z', - '20120102090705', - '1', - '1', - 'Day of year (zero-indexed)' - ), - array( - 'D', - '20120102090705', - 'Mon', - 'Mon', - 'Day of week (abbrev)' - ), - array( - 'l', - '20120102090705', - 'Monday', - 'Monday', - 'Full day of week' - ), - array( - 'N', - '20120101090705', - '7', - '7', - 'Day of week (Mon=1, Sun=7)' - ), - array( - 'w', - '20120101090705', - '0', - '0', - 'Day of week (Sun=0, Sat=6)' - ), - array( - 'N', - '20120102090705', - '1', - '1', - 'Day of week' - ), - array( - 'a', - '20120102090705', - 'am', - 'am', - 'am vs pm' - ), - array( - 'A', - '20120102120000', - 'PM', - 'PM', - 'AM vs PM' - ), - array( - 'a', - '20120102000000', - 'am', - 'am', - 'AM vs PM' - ), - array( - 'g', - '20120102090705', - '9', - '9', - '12 hour, not Zero' - ), - array( - 'h', - '20120102090705', - '09', - '09', - '12 hour, zero padded' - ), - array( - 'G', - '20120102090705', - '9', - '9', - '24 hour, not zero' - ), - array( - 'H', - '20120102090705', - '09', - '09', - '24 hour, zero' - ), - array( - 'H', - '20120102110705', - '11', - '11', - '24 hour, zero' - ), - array( - 'i', - '20120102090705', - '07', - '07', - 'Minutes' - ), - array( - 's', - '20120102090705', - '05', - '05', - 'seconds' - ), - array( - 'U', - '20120102090705', - '1325495225', - '1325462825', - 'unix time' - ), - array( - 't', - '20120102090705', - '31', - '31', - 'Days in current month' - ), - array( - 'c', - '20120102090705', - '2012-01-02T09:07:05+00:00', - '2012-01-02T09:07:05+09:00', - 'ISO 8601 timestamp' - ), - array( - 'r', - '20120102090705', - 'Mon, 02 Jan 2012 09:07:05 +0000', - 'Mon, 02 Jan 2012 09:07:05 +0900', - 'RFC 5322' - ), - array( - 'e', - '20120102090705', - 'UTC', - 'Asia/Seoul', - 'Timezone identifier' - ), - array( - 'I', - '19880602090705', - '0', - '1', - 'DST indicator' - ), - array( - 'O', - '20120102090705', - '+0000', - '+0900', - 'Timezone offset' - ), - array( - 'P', - '20120102090705', - '+00:00', - '+09:00', - 'Timezone offset with colon' - ), - array( - 'T', - '20120102090705', - 'UTC', - 'KST', - 'Timezone abbreviation' - ), - array( - 'Z', - '20120102090705', - '0', - '32400', - 'Timezone offset in seconds' - ), - array( - 'xmj xmF xmn xmY', - '20120102090705', - '7 Safar 2 1433', - '7 Safar 2 1433', - 'Islamic' - ), - array( - 'xij xiF xin xiY', - '20120102090705', - '12 Dey 10 1390', - '12 Dey 10 1390', - 'Iranian' - ), - array( - 'xjj xjF xjn xjY', - '20120102090705', - '7 Tevet 4 5772', - '7 Tevet 4 5772', - 'Hebrew' - ), - array( - 'xjt', - '20120102090705', - '29', - '29', - 'Hebrew number of days in month' - ), - array( - 'xjx', - '20120102090705', - 'Tevet', - 'Tevet', - 'Hebrew genitive month name (No difference in EN)' - ), - array( - 'xkY', - '20120102090705', - '2555', - '2555', - 'Thai year' - ), - array( - 'xoY', - '20120102090705', - '101', - '101', - 'Minguo' - ), - array( - 'xtY', - '20120102090705', - '平成24', - '平成24', - 'nengo' - ), - array( - 'xrxkYY', - '20120102090705', - 'MMDLV2012', - 'MMDLV2012', - 'Roman numerals' - ), - array( - 'xhxjYY', - '20120102090705', - 'ה\'תשע"ב2012', - 'ה\'תשע"ב2012', - 'Hebrew numberals' - ), - array( - 'xnY', - '20120102090705', - '2012', - '2012', - 'Raw numerals (doesn\'t mean much in EN)' - ), - array( - '[[Y "(yea"\\r)]] \\"xx\\"', - '20120102090705', - '[[2012 (year)]] "x"', - '[[2012 (year)]] "x"', - 'Various escaping' - ), - - ); - } - - /** - * @dataProvider provideFormatSizes - * @covers Language::formatSize - */ - public function testFormatSize( $size, $expected, $msg ) { - $this->assertEquals( - $expected, - $this->getLang()->formatSize( $size ), - "formatSize('$size'): $msg" - ); - } - - public static function provideFormatSizes() { - return array( - array( - 0, - "0 B", - "Zero bytes" - ), - array( - 1024, - "1 KB", - "1 kilobyte" - ), - array( - 1024 * 1024, - "1 MB", - "1,024 megabytes" - ), - array( - 1024 * 1024 * 1024, - "1 GB", - "1 gigabytes" - ), - array( - pow( 1024, 4 ), - "1 TB", - "1 terabyte" - ), - array( - pow( 1024, 5 ), - "1 PB", - "1 petabyte" - ), - array( - pow( 1024, 6 ), - "1 EB", - "1,024 exabyte" - ), - array( - pow( 1024, 7 ), - "1 ZB", - "1 zetabyte" - ), - array( - pow( 1024, 8 ), - "1 YB", - "1 yottabyte" - ), - // How big!? THIS BIG! - ); - } - - /** - * @dataProvider provideFormatBitrate - * @covers Language::formatBitrate - */ - public function testFormatBitrate( $bps, $expected, $msg ) { - $this->assertEquals( - $expected, - $this->getLang()->formatBitrate( $bps ), - "formatBitrate('$bps'): $msg" - ); - } - - public static function provideFormatBitrate() { - return array( - array( - 0, - "0 bps", - "0 bits per second" - ), - array( - 999, - "999 bps", - "999 bits per second" - ), - array( - 1000, - "1 kbps", - "1 kilobit per second" - ), - array( - 1000 * 1000, - "1 Mbps", - "1 megabit per second" - ), - array( - pow( 10, 9 ), - "1 Gbps", - "1 gigabit per second" - ), - array( - pow( 10, 12 ), - "1 Tbps", - "1 terabit per second" - ), - array( - pow( 10, 15 ), - "1 Pbps", - "1 petabit per second" - ), - array( - pow( 10, 18 ), - "1 Ebps", - "1 exabit per second" - ), - array( - pow( 10, 21 ), - "1 Zbps", - "1 zetabit per second" - ), - array( - pow( 10, 24 ), - "1 Ybps", - "1 yottabit per second" - ), - array( - pow( 10, 27 ), - "1,000 Ybps", - "1,000 yottabits per second" - ), - ); - } - - - /** - * @dataProvider provideFormatDuration - * @covers Language::formatDuration - */ - public function testFormatDuration( $duration, $expected, $intervals = array() ) { - $this->assertEquals( - $expected, - $this->getLang()->formatDuration( $duration, $intervals ), - "formatDuration('$duration'): $expected" - ); - } - - public static function provideFormatDuration() { - return array( - array( - 0, - '0 seconds', - ), - array( - 1, - '1 second', - ), - array( - 2, - '2 seconds', - ), - array( - 60, - '1 minute', - ), - array( - 2 * 60, - '2 minutes', - ), - array( - 3600, - '1 hour', - ), - array( - 2 * 3600, - '2 hours', - ), - array( - 24 * 3600, - '1 day', - ), - array( - 2 * 86400, - '2 days', - ), - array( - // ( 365 + ( 24 * 3 + 25 ) / 400 ) * 86400 = 31556952 - ( 365 + ( 24 * 3 + 25 ) / 400.0 ) * 86400, - '1 year', - ), - array( - 2 * 31556952, - '2 years', - ), - array( - 10 * 31556952, - '1 decade', - ), - array( - 20 * 31556952, - '2 decades', - ), - array( - 100 * 31556952, - '1 century', - ), - array( - 200 * 31556952, - '2 centuries', - ), - array( - 1000 * 31556952, - '1 millennium', - ), - array( - 2000 * 31556952, - '2 millennia', - ), - array( - 9001, - '2 hours, 30 minutes and 1 second' - ), - array( - 3601, - '1 hour and 1 second' - ), - array( - 31556952 + 2 * 86400 + 9000, - '1 year, 2 days, 2 hours and 30 minutes' - ), - array( - 42 * 1000 * 31556952 + 42, - '42 millennia and 42 seconds' - ), - array( - 60, - '60 seconds', - array( 'seconds' ), - ), - array( - 61, - '61 seconds', - array( 'seconds' ), - ), - array( - 1, - '1 second', - array( 'seconds' ), - ), - array( - 31556952 + 2 * 86400 + 9000, - '1 year, 2 days and 150 minutes', - array( 'years', 'days', 'minutes' ), - ), - array( - 42, - '0 days', - array( 'years', 'days' ), - ), - array( - 31556952 + 2 * 86400 + 9000, - '1 year, 2 days and 150 minutes', - array( 'minutes', 'days', 'years' ), - ), - array( - 42, - '0 days', - array( 'days', 'years' ), - ), - ); - } - - /** - * @dataProvider provideCheckTitleEncodingData - * @covers Language::checkTitleEncoding - */ - public function testCheckTitleEncoding( $s ) { - $this->assertEquals( - $s, - $this->getLang()->checkTitleEncoding( $s ), - "checkTitleEncoding('$s')" - ); - } - - public static function provideCheckTitleEncodingData() { - return array( - array( "" ), - array( "United States of America" ), // 7bit ASCII - array( rawurldecode( "S%C3%A9rie%20t%C3%A9l%C3%A9vis%C3%A9e" ) ), - array( - rawurldecode( - "Acteur%7CAlbert%20Robbins%7CAnglais%7CAnn%20Donahue%7CAnthony%20E.%20Zuiker%7CCarol%20Mendelsohn" - ) - ), - // The following two data sets come from bug 36839. They fail if checkTitleEncoding uses a regexp to test for - // valid UTF-8 encoding and the pcre.recursion_limit is low (like, say, 1024). They succeed if checkTitleEncoding - // uses mb_check_encoding for its test. - array( - rawurldecode( - "Acteur%7CAlbert%20Robbins%7CAnglais%7CAnn%20Donahue%7CAnthony%20E.%20Zuiker%7CCarol%20Mendelsohn%7C" - . "Catherine%20Willows%7CDavid%20Hodges%7CDavid%20Phillips%7CGil%20Grissom%7CGreg%20Sanders%7CHodges%7C" - . "Internet%20Movie%20Database%7CJim%20Brass%7CLady%20Heather%7C" - . "Les%20Experts%20(s%C3%A9rie%20t%C3%A9l%C3%A9vis%C3%A9e)%7CLes%20Experts%20:%20Manhattan%7C" - . "Les%20Experts%20:%20Miami%7CListe%20des%20personnages%20des%20Experts%7C" - . "Liste%20des%20%C3%A9pisodes%20des%20Experts%7CMod%C3%A8le%20discussion:Palette%20Les%20Experts%7C" - . "Nick%20Stokes%7CPersonnage%20de%20fiction%7CPersonnage%20fictif%7CPersonnage%20de%20fiction%7C" - . "Personnages%20r%C3%A9currents%20dans%20Les%20Experts%7CRaymond%20Langston%7CRiley%20Adams%7C" - . "Saison%201%20des%20Experts%7CSaison%2010%20des%20Experts%7CSaison%2011%20des%20Experts%7C" - . "Saison%2012%20des%20Experts%7CSaison%202%20des%20Experts%7CSaison%203%20des%20Experts%7C" - . "Saison%204%20des%20Experts%7CSaison%205%20des%20Experts%7CSaison%206%20des%20Experts%7C" - . "Saison%207%20des%20Experts%7CSaison%208%20des%20Experts%7CSaison%209%20des%20Experts%7C" - . "Sara%20Sidle%7CSofia%20Curtis%7CS%C3%A9rie%20t%C3%A9l%C3%A9vis%C3%A9e%7CWallace%20Langham%7C" - . "Warrick%20Brown%7CWendy%20Simms%7C%C3%89tats-Unis" - ), - ), - array( - rawurldecode( - "Mod%C3%A8le%3AArrondissements%20homonymes%7CMod%C3%A8le%3ABandeau%20standard%20pour%20page%20d'homonymie%7C" - . "Mod%C3%A8le%3ABatailles%20homonymes%7CMod%C3%A8le%3ACantons%20homonymes%7C" - . "Mod%C3%A8le%3ACommunes%20fran%C3%A7aises%20homonymes%7CMod%C3%A8le%3AFilms%20homonymes%7C" - . "Mod%C3%A8le%3AGouvernements%20homonymes%7CMod%C3%A8le%3AGuerres%20homonymes%7CMod%C3%A8le%3AHomonymie%7C" - . "Mod%C3%A8le%3AHomonymie%20bateau%7CMod%C3%A8le%3AHomonymie%20d'%C3%A9tablissements%20scolaires%20ou" - . "%20universitaires%7CMod%C3%A8le%3AHomonymie%20d'%C3%AEles%7CMod%C3%A8le%3AHomonymie%20de%20clubs%20sportifs%7C" - . "Mod%C3%A8le%3AHomonymie%20de%20comt%C3%A9s%7CMod%C3%A8le%3AHomonymie%20de%20monument%7C" - . "Mod%C3%A8le%3AHomonymie%20de%20nom%20romain%7CMod%C3%A8le%3AHomonymie%20de%20parti%20politique%7C" - . "Mod%C3%A8le%3AHomonymie%20de%20route%7CMod%C3%A8le%3AHomonymie%20dynastique%7C" - . "Mod%C3%A8le%3AHomonymie%20vid%C3%A9oludique%7CMod%C3%A8le%3AHomonymie%20%C3%A9difice%20religieux%7C" - . "Mod%C3%A8le%3AInternationalisation%7CMod%C3%A8le%3AIsom%C3%A9rie%7CMod%C3%A8le%3AParonymie%7C" - . "Mod%C3%A8le%3APatronyme%7CMod%C3%A8le%3APatronyme%20basque%7CMod%C3%A8le%3APatronyme%20italien%7C" - . "Mod%C3%A8le%3APatronymie%7CMod%C3%A8le%3APersonnes%20homonymes%7CMod%C3%A8le%3ASaints%20homonymes%7C" - . "Mod%C3%A8le%3ATitres%20homonymes%7CMod%C3%A8le%3AToponymie%7CMod%C3%A8le%3AUnit%C3%A9s%20homonymes%7C" - . "Mod%C3%A8le%3AVilles%20homonymes%7CMod%C3%A8le%3A%C3%89difices%20religieux%20homonymes" - ) - ) - ); - } - - /** - * @dataProvider provideRomanNumeralsData - * @covers Language::romanNumeral - */ - public function testRomanNumerals( $num, $numerals ) { - $this->assertEquals( - $numerals, - Language::romanNumeral( $num ), - "romanNumeral('$num')" - ); - } - - public static function provideRomanNumeralsData() { - return array( - array( 1, 'I' ), - array( 2, 'II' ), - array( 3, 'III' ), - array( 4, 'IV' ), - array( 5, 'V' ), - array( 6, 'VI' ), - array( 7, 'VII' ), - array( 8, 'VIII' ), - array( 9, 'IX' ), - array( 10, 'X' ), - array( 20, 'XX' ), - array( 30, 'XXX' ), - array( 40, 'XL' ), - array( 49, 'XLIX' ), - array( 50, 'L' ), - array( 60, 'LX' ), - array( 70, 'LXX' ), - array( 80, 'LXXX' ), - array( 90, 'XC' ), - array( 99, 'XCIX' ), - array( 100, 'C' ), - array( 200, 'CC' ), - array( 300, 'CCC' ), - array( 400, 'CD' ), - array( 500, 'D' ), - array( 600, 'DC' ), - array( 700, 'DCC' ), - array( 800, 'DCCC' ), - array( 900, 'CM' ), - array( 999, 'CMXCIX' ), - array( 1000, 'M' ), - array( 1989, 'MCMLXXXIX' ), - array( 2000, 'MM' ), - array( 3000, 'MMM' ), - array( 4000, 'MMMM' ), - array( 5000, 'MMMMM' ), - array( 6000, 'MMMMMM' ), - array( 7000, 'MMMMMMM' ), - array( 8000, 'MMMMMMMM' ), - array( 9000, 'MMMMMMMMM' ), - array( 9999, 'MMMMMMMMMCMXCIX' ), - array( 10000, 'MMMMMMMMMM' ), - ); - } - - /** - * @dataProvider providePluralData - * @covers Language::convertPlural - */ - public function testConvertPlural( $expected, $number, $forms ) { - $chosen = $this->getLang()->convertPlural( $number, $forms ); - $this->assertEquals( $expected, $chosen ); - } - - public static function providePluralData() { - // Params are: [expected text, number given, [the plural forms]] - return array( - array( 'plural', 0, array( - 'singular', 'plural' - ) ), - array( 'explicit zero', 0, array( - '0=explicit zero', 'singular', 'plural' - ) ), - array( 'explicit one', 1, array( - 'singular', 'plural', '1=explicit one', - ) ), - array( 'singular', 1, array( - 'singular', 'plural', '0=explicit zero', - ) ), - array( 'plural', 3, array( - '0=explicit zero', '1=explicit one', 'singular', 'plural' - ) ), - array( 'explicit eleven', 11, array( - 'singular', 'plural', '11=explicit eleven', - ) ), - array( 'plural', 12, array( - 'singular', 'plural', '11=explicit twelve', - ) ), - array( 'plural', 12, array( - 'singular', 'plural', '=explicit form', - ) ), - array( 'other', 2, array( - 'kissa=kala', '1=2=3', 'other', - ) ), - array( '', 2, array( - '0=explicit zero', '1=explicit one', - ) ), - ); - } - - /** - * @covers Language::translateBlockExpiry() - * @dataProvider provideTranslateBlockExpiry - */ - public function testTranslateBlockExpiry( $expectedData, $str, $desc ) { - $lang = $this->getLang(); - if ( is_array( $expectedData ) ) { - list( $func, $arg ) = $expectedData; - $expected = $lang->$func( $arg ); - } else { - $expected = $expectedData; - } - $this->assertEquals( $expected, $lang->translateBlockExpiry( $str ), $desc ); - } - - public static function provideTranslateBlockExpiry() { - return array( - array( '2 hours', '2 hours', 'simple data from ipboptions' ), - array( 'indefinite', 'infinite', 'infinite from ipboptions' ), - array( 'indefinite', 'infinity', 'alternative infinite from ipboptions' ), - array( 'indefinite', 'indefinite', 'another alternative infinite from ipboptions' ), - array( array( 'formatDuration', 1023 * 60 * 60 ), '1023 hours', 'relative' ), - array( array( 'formatDuration', -1023 ), '-1023 seconds', 'negative relative' ), - array( array( 'formatDuration', 0 ), 'now', 'now' ), - array( array( 'timeanddate', '20120102070000' ), '2012-1-1 7:00 +1 day', 'mixed, handled as absolute' ), - array( array( 'timeanddate', '19910203040506' ), '1991-2-3 4:05:06', 'absolute' ), - array( array( 'timeanddate', '19700101000000' ), '1970-1-1 0:00:00', 'absolute at epoch' ), - array( array( 'timeanddate', '19691231235959' ), '1969-12-31 23:59:59', 'time before epoch' ), - array( 'dummy', 'dummy', 'return garbage as is' ), - ); - } - - /** - * @covers Language::commafy() - * @dataProvider provideCommafyData - */ - public function testCommafy( $number, $numbersWithCommas ) { - $this->assertEquals( - $numbersWithCommas, - $this->getLang()->commafy( $number ), - "commafy('$number')" - ); - } - - public static function provideCommafyData() { - return array( - array( 1, '1' ), - array( 10, '10' ), - array( 100, '100' ), - array( 1000, '1,000' ), - array( 10000, '10,000' ), - array( 100000, '100,000' ), - array( 1000000, '1,000,000' ), - array( 1.0001, '1.0001' ), - array( 10.0001, '10.0001' ), - array( 100.0001, '100.0001' ), - array( 1000.0001, '1,000.0001' ), - array( 10000.0001, '10,000.0001' ), - array( 100000.0001, '100,000.0001' ), - array( 1000000.0001, '1,000,000.0001' ), - ); - } - - /** - * @covers Language::listToText - */ - public function testListToText() { - $lang = $this->getLang(); - $and = $lang->getMessageFromDB( 'and' ); - $s = $lang->getMessageFromDB( 'word-separator' ); - $c = $lang->getMessageFromDB( 'comma-separator' ); - - $this->assertEquals( '', $lang->listToText( array() ) ); - $this->assertEquals( 'a', $lang->listToText( array( 'a' ) ) ); - $this->assertEquals( "a{$and}{$s}b", $lang->listToText( array( 'a', 'b' ) ) ); - $this->assertEquals( "a{$c}b{$and}{$s}c", $lang->listToText( array( 'a', 'b', 'c' ) ) ); - $this->assertEquals( "a{$c}b{$c}c{$and}{$s}d", $lang->listToText( array( 'a', 'b', 'c', 'd' ) ) ); - } - - /** - * @dataProvider provideIsSupportedLanguage - * @covers Language::isSupportedLanguage - */ - public function testIsSupportedLanguage( $code, $expected, $comment ) { - $this->assertEquals( $expected, Language::isSupportedLanguage( $code ), $comment ); - } - - public static function provideIsSupportedLanguage() { - return array( - array( 'en', true, 'is supported language' ), - array( 'fi', true, 'is supported language' ), - array( 'bunny', false, 'is not supported language' ), - array( 'FI', false, 'is not supported language, input should be in lower case' ), - ); - } - - /** - * @dataProvider provideGetParentLanguage - * @covers Language::getParentLanguage - */ - public function testGetParentLanguage( $code, $expected, $comment ) { - $lang = Language::factory( $code ); - if ( is_null( $expected ) ) { - $this->assertNull( $lang->getParentLanguage(), $comment ); - } else { - $this->assertEquals( $expected, $lang->getParentLanguage()->getCode(), $comment ); - } - } - - public static function provideGetParentLanguage() { - return array( - array( 'zh-cn', 'zh', 'zh is the parent language of zh-cn' ), - array( 'zh', 'zh', 'zh is defined as the parent language of zh, because zh converter can convert zh-cn to zh' ), - array( 'zh-invalid', null, 'do not be fooled by arbitrarily composed language codes' ), - array( 'en-gb', null, 'en does not have converter' ), - array( 'en', null, 'en does not have converter. Although FakeConverter handles en -> en conversion but it is useless' ), - ); - } - - /** - * @dataProvider provideGetNamespaceAliases - * @covers Language::getNamespaceAliases - */ - public function testGetNamespaceAliases( $languageCode, $subset ) { - $language = Language::factory( $languageCode ); - $aliases = $language->getNamespaceAliases(); - foreach ( $subset as $alias => $nsId ) { - $this->assertEquals( $nsId, $aliases[$alias] ); - } - } - - public static function provideGetNamespaceAliases() { - // TODO: Add tests for NS_PROJECT_TALK and GenderNamespaces - return array( - array( - 'zh', - array( - '文件' => NS_FILE, - '檔案' => NS_FILE, - ), - ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageTiTest.php b/tests/phpunit/languages/LanguageTiTest.php deleted file mode 100644 index e225af97..00000000 --- a/tests/phpunit/languages/LanguageTiTest.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageTi.php */ -class LanguageTiTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageTlTest.php b/tests/phpunit/languages/LanguageTlTest.php deleted file mode 100644 index 7ac51c69..00000000 --- a/tests/phpunit/languages/LanguageTlTest.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageTl.php */ -class LanguageTlTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageTrTest.php b/tests/phpunit/languages/LanguageTrTest.php deleted file mode 100644 index 8fc2795c..00000000 --- a/tests/phpunit/languages/LanguageTrTest.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php -/** - * @author Antoine Musso - * @copyright Copyright © 2011, Antoine Musso - * @file - */ - -/** Tests for MediaWiki languages/LanguageTr.php */ -class LanguageTrTest extends LanguageClassesTestCase { - - /** - * See @bug 28040 - * Credits to irc://irc.freenode.net/wikipedia-tr users: - * - berm - * - []LuCkY[] - * - Emperyan - * @see http://en.wikipedia.org/wiki/Dotted_and_dotless_I - * @dataProvider provideDottedAndDotlessI - */ - public function testDottedAndDotlessI( $func, $input, $inputCase, $expected ) { - if ( $func == 'ucfirst' ) { - $res = $this->getLang()->ucfirst( $input ); - } elseif ( $func == 'lcfirst' ) { - $res = $this->getLang()->lcfirst( $input ); - } else { - throw new MWException( __METHOD__ . " given an invalid function name '$func'" ); - } - - $msg = "Converting $inputCase case '$input' with $func should give '$expected'"; - - $this->assertEquals( $expected, $res, $msg ); - } - - public static function provideDottedAndDotlessI() { - return array( - # function, input, input case, expected - # Case changed: - array( 'ucfirst', 'ı', 'lower', 'I' ), - array( 'ucfirst', 'i', 'lower', 'İ' ), - array( 'lcfirst', 'I', 'upper', 'ı' ), - array( 'lcfirst', 'İ', 'upper', 'i' ), - - # Already using the correct case - array( 'ucfirst', 'I', 'upper', 'I' ), - array( 'ucfirst', 'İ', 'upper', 'İ' ), - array( 'lcfirst', 'ı', 'lower', 'ı' ), - array( 'lcfirst', 'i', 'lower', 'i' ), - - # A real example taken from bug 28040 using - # http://tr.wikipedia.org/wiki/%C4%B0Phone - array( 'lcfirst', 'iPhone', 'lower', 'iPhone' ), - - # next case is valid in Turkish but are different words if we - # consider IPhone is English! - array( 'lcfirst', 'IPhone', 'upper', 'ıPhone' ), - - ); - } -} diff --git a/tests/phpunit/languages/LanguageUkTest.php b/tests/phpunit/languages/LanguageUkTest.php deleted file mode 100644 index 9051bcff..00000000 --- a/tests/phpunit/languages/LanguageUkTest.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * based on LanguageBe_tarask.php - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for Ukrainian */ -class LanguageUkTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'few', 'many', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * Test explicit plural forms - n=FormN forms - * @covers Language::convertPlural - */ - public function testExplicitPlural() { - $forms = array( 'one', 'few', 'many', 'other', '12=dozen' ); - $this->assertEquals( 'dozen', $this->getLang()->convertPlural( 12, $forms ) ); - $forms = array( 'one', 'few', 'many', '100=hundred', 'other', '12=dozen' ); - $this->assertEquals( 'hundred', $this->getLang()->convertPlural( 100, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 1 ), - array( 'many', 11 ), - array( 'one', 91 ), - array( 'one', 121 ), - array( 'few', 2 ), - array( 'few', 3 ), - array( 'few', 4 ), - array( 'few', 334 ), - array( 'many', 5 ), - array( 'many', 15 ), - array( 'many', 120 ), - ); - } - - /** - * @dataProvider providePluralTwoForms - * @covers Language::convertPlural - */ - public function testPluralTwoForms( $result, $value ) { - $forms = array( '1=one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - public static function providePluralTwoForms() { - return array( - array( 'one', 1 ), - array( 'other', 11 ), - array( 'other', 91 ), - array( 'other', 121 ), - ); - } -} diff --git a/tests/phpunit/languages/LanguageUzTest.php b/tests/phpunit/languages/LanguageUzTest.php deleted file mode 100644 index 13f57c16..00000000 --- a/tests/phpunit/languages/LanguageUzTest.php +++ /dev/null @@ -1,121 +0,0 @@ -<?php -/** - * PHPUnit tests for the Uzbek language. - * The language can be represented using two scripts: - * - Latin (uz-latn) - * - Cyrillic (uz-cyrl) - * - * @author Robin Pepermans - * @author Antoine Musso <hashar at free dot fr> - * @copyright Copyright © 2012, Robin Pepermans - * @copyright Copyright © 2011, Antoine Musso <hashar at free dot fr> - * @file - * - * @todo methods in test class should be tidied: - * - Should be split into separate test methods and data providers - * - Tests for LanguageConverter and Language should probably be separate.. - */ - -/** Tests for MediaWiki languages/LanguageUz.php */ -class LanguageUzTest extends LanguageClassesTestCase { - - /** - * @author Nikola Smolenski - * @covers LanguageConverter::convertTo - */ - public function testConversionToCyrillic() { - // A convertion of Latin to Cyrillic - $this->assertEquals( 'абвгғ', - $this->convertToCyrillic( 'abvggʻ' ) - ); - // Same as above, but assert that -{}-s must be removed and not converted - $this->assertEquals( 'ljабnjвгўоdb', - $this->convertToCyrillic( '-{lj}-ab-{nj}-vgoʻo-{db}-' ) - ); - // A simple convertion of Cyrillic to Cyrillic - $this->assertEquals( 'абвг', - $this->convertToCyrillic( 'абвг' ) - ); - // Same as above, but assert that -{}-s must be removed and not converted - $this->assertEquals( 'ljабnjвгdaž', - $this->convertToCyrillic( '-{lj}-аб-{nj}-вг-{da}-ž' ) - ); - } - - /** - * @covers LanguageConverter::convertTo - */ - public function testConversionToLatin() { - // A simple convertion of Latin to Latin - $this->assertEquals( 'abdef', - $this->convertToLatin( 'abdef' ) - ); - // A convertion of Cyrillic to Latin - $this->assertEquals( 'gʻabtsdOʻQyo', - $this->convertToLatin( 'ғабцдЎҚё' ) - ); - } - - ##### HELPERS ##################################################### - /** - * Wrapper to verify text stay the same after applying conversion - * @param $text string Text to convert - * @param $variant string Language variant 'uz-cyrl' or 'uz-latn' - * @param $msg string Optional message - */ - protected function assertUnConverted( $text, $variant, $msg = '' ) { - $this->assertEquals( - $text, - $this->convertTo( $text, $variant ), - $msg - ); - } - - /** - * Wrapper to verify a text is different once converted to a variant. - * @param $text string Text to convert - * @param $variant string Language variant 'uz-cyrl' or 'uz-latn' - * @param $msg string Optional message - */ - protected function assertConverted( $text, $variant, $msg = '' ) { - $this->assertNotEquals( - $text, - $this->convertTo( $text, $variant ), - $msg - ); - } - - /** - * Verifiy the given Cyrillic text is not converted when using - * using the cyrillic variant and converted to Latin when using - * the Latin variant. - */ - protected function assertCyrillic( $text, $msg = '' ) { - $this->assertUnConverted( $text, 'uz-cyrl', $msg ); - $this->assertConverted( $text, 'uz-latn', $msg ); - } - - /** - * Verifiy the given Latin text is not converted when using - * using the Latin variant and converted to Cyrillic when using - * the Cyrillic variant. - */ - protected function assertLatin( $text, $msg = '' ) { - $this->assertUnConverted( $text, 'uz-latn', $msg ); - $this->assertConverted( $text, 'uz-cyrl', $msg ); - } - - - /** Wrapper for converter::convertTo() method*/ - protected function convertTo( $text, $variant ) { - return $this->getLang()->mConverter->convertTo( $text, $variant ); - } - - protected function convertToCyrillic( $text ) { - return $this->convertTo( $text, 'uz-cyrl' ); - } - - protected function convertToLatin( $text ) { - return $this->convertTo( $text, 'uz-latn' ); - } -} diff --git a/tests/phpunit/languages/LanguageWaTest.php b/tests/phpunit/languages/LanguageWaTest.php deleted file mode 100644 index d05196c0..00000000 --- a/tests/phpunit/languages/LanguageWaTest.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * @author Amir E. Aharoni - * @copyright Copyright © 2012, Amir E. Aharoni - * @file - */ - -/** Tests for MediaWiki languages/classes/LanguageWa.php */ -class LanguageWaTest extends LanguageClassesTestCase { - /** - * @dataProvider providePlural - * @covers Language::convertPlural - */ - public function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); - } - - /** - * @dataProvider providePlural - * @covers Language::getPluralRuleType - */ - public function testGetPluralRuleType( $result, $value ) { - $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); - } - - public static function providePlural() { - return array( - array( 'one', 0 ), - array( 'one', 1 ), - array( 'other', 2 ), - ); - } -} diff --git a/tests/phpunit/languages/utils/CLDRPluralRuleEvaluatorTest.php b/tests/phpunit/languages/utils/CLDRPluralRuleEvaluatorTest.php deleted file mode 100644 index bd3809d7..00000000 --- a/tests/phpunit/languages/utils/CLDRPluralRuleEvaluatorTest.php +++ /dev/null @@ -1,145 +0,0 @@ -<?php -/** - * @author Niklas Laxström - * @file - */ - -class CLDRPluralRuleEvaluatorTest extends MediaWikiTestCase { - /** - * @dataProvider validTestCases - */ - function testValidRules( $expected, $rules, $number, $comment ) { - $result = CLDRPluralRuleEvaluator::evaluate( $number, (array)$rules ); - $this->assertEquals( $expected, $result, $comment ); - } - - /** - * @dataProvider invalidTestCases - * @expectedException CLDRPluralRuleError - */ - function testInvalidRules( $rules, $comment ) { - CLDRPluralRuleEvaluator::evaluate( 1, (array)$rules ); - } - - function validTestCases() { - $tests = array( - # expected, number, rule, comment - array( 0, 'n is 1', 1, 'integer number and is' ), - array( 0, 'n is 1', "1", 'string integer number and is' ), - array( 0, 'n is 1', 1.0, 'float number and is' ), - array( 0, 'n is 1', "1.0", 'string float number and is' ), - array( 1, 'n is 1', 1.1, 'float number and is' ), - array( 1, 'n is 1', 2, 'float number and is' ), - - array( 0, 'n in 1,3,5', 3, '' ), - array( 1, 'n not in 1,3,5', 5, '' ), - - array( 1, 'n in 1,3,5', 2, '' ), - array( 0, 'n not in 1,3,5', 4, '' ), - - array( 0, 'n in 1..3', 2, '' ), - array( 0, 'n in 1..3', 3, 'in is inclusive' ), - array( 1, 'n in 1..3', 0, '' ), - - array( 1, 'n not in 1..3', 2, '' ), - array( 1, 'n not in 1..3', 3, 'in is inclusive' ), - array( 0, 'n not in 1..3', 0, '' ), - - array( 1, 'n is not 1 and n is not 2 and n is not 3', 1, 'and relation' ), - array( 0, 'n is not 1 and n is not 2 and n is not 4', 3, 'and relation' ), - - array( 0, 'n is not 1 or n is 1', 1, 'or relation' ), - array( 1, 'n is 1 or n is 2', 3, 'or relation' ), - - array( 0, 'n is 1', 1, 'extra whitespace' ), - - array( 0, 'n mod 3 is 1', 7, 'mod' ), - array( 0, 'n mod 3 is not 1', 4.3, 'mod with floats' ), - - array( 0, 'n within 1..3', 2, 'within with integer' ), - array( 0, 'n within 1..3', 2.5, 'within with float' ), - array( 0, 'n in 1..3', 2, 'in with integer' ), - array( 1, 'n in 1..3', 2.5, 'in with float' ), - - array( 0, 'n in 3 or n is 4 and n is 5', 3, 'and binds more tightly than or' ), - array( 1, 'n is 3 or n is 4 and n is 5', 4, 'and binds more tightly than or' ), - - array( 0, 'n mod 10 in 3..4,9 and n mod 100 not in 10..19,70..79,90..99', 24, 'breton rule' ), - array( 1, 'n mod 10 in 3..4,9 and n mod 100 not in 10..19,70..79,90..99', 25, 'breton rule' ), - - array( 0, 'n within 0..2 and n is not 2', 0, 'french rule' ), - array( 0, 'n within 0..2 and n is not 2', 1, 'french rule' ), - array( 0, 'n within 0..2 and n is not 2', 1.2, 'french rule' ), - array( 1, 'n within 0..2 and n is not 2', 2, 'french rule' ), - - array( 1, 'n in 3..10,13..19', 2, 'scottish rule - ranges with comma' ), - array( 0, 'n in 3..10,13..19', 4, 'scottish rule - ranges with comma' ), - array( 1, 'n in 3..10,13..19', 12.999, 'scottish rule - ranges with comma' ), - array( 0, 'n in 3..10,13..19', 13, 'scottish rule - ranges with comma' ), - - array( 0, '5 mod 3 is n', 2, 'n as result of mod - no need to pass' ), - - # Revision 33 new operand examples - # expected, rule, number, comment - array( 0, 'i is 1', '1.00', 'new operand i' ), - array( 0, 'v is 2', '1.00', 'new operand v' ), - array( 0, 'w is 0', '1.00', 'new operand w' ), - array( 0, 'f is 0', '1.00', 'new operand f' ), - array( 0, 't is 0', '1.00', 'new operand t' ), - - array( 0, 'i is 1', '1.30', 'new operand i' ), - array( 0, 'v is 2', '1.30', 'new operand v' ), - array( 0, 'w is 1', '1.30', 'new operand w' ), - array( 0, 'f is 30', '1.30', 'new operand f' ), - array( 0, 't is 3', '1.30', 'new operand t' ), - - array( 0, 'i is 1', '1.03', 'new operand i' ), - array( 0, 'v is 2', '1.03', 'new operand v' ), - array( 0, 'w is 2', '1.03', 'new operand w' ), - array( 0, 'f is 3', '1.03', 'new operand f' ), - array( 0, 't is 3', '1.03', 'new operand t' ), - - # Revision 33 new operator aliases - # expected, rule, number, comment - array( 0, 'n % 3 is 1', 7, 'new % operator' ), - array( 0, 'n = 1,3,5', 3, 'new = operator' ), - array( 1, 'n != 1,3,5', 5, 'new != operator' ), - - # Revision 33 samples - # expected, rule, number, comment - array( 0, 'n in 1,3,5@integer 3~10, 103~110, 1003, … @decimal 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 103.0, 1003.0, …', 3, 'samples' ), - - # Revision 33 some test cases from CLDR - array( 0, 'i = 1 and v = 0 or i = 0 and t = 1', '0.1', 'pt one' ), - array( 0, 'i = 1 and v = 0 or i = 0 and t = 1', '0.01', 'pt one' ), - array( 0, 'i = 1 and v = 0 or i = 0 and t = 1', '0.10', 'pt one' ), - array( 0, 'i = 1 and v = 0 or i = 0 and t = 1', '0.010', 'pt one' ), - array( 0, 'i = 1 and v = 0 or i = 0 and t = 1', '0.100', 'pt one' ), - array( 1, 'i = 1 and v = 0 or i = 0 and t = 1', '0.0', 'pt other' ), - array( 1, 'i = 1 and v = 0 or i = 0 and t = 1', '0.2', 'pt other' ), - array( 1, 'i = 1 and v = 0 or i = 0 and t = 1', '10.0', 'pt other' ), - array( 1, 'i = 1 and v = 0 or i = 0 and t = 1', '100.0', 'pt other' ), - array( 0, 'v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14', '2', 'bs few' ), - array( 0, 'v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14', '4', 'bs few' ), - array( 0, 'v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14', '22', 'bs few' ), - array( 0, 'v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14', '102', 'bs few' ), - array( 0, 'v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14', '0.2', 'bs few' ), - array( 0, 'v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14', '0.4', 'bs few' ), - array( 0, 'v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14', '10.2', 'bs few' ), - array( 1, 'v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14', '10.0', 'bs other' ), - - ); - - return $tests; - } - - function invalidTestCases() { - $tests = array( - array( 'n mod mod 5 is 1', 'mod mod' ), - array( 'n', 'just n' ), - array( 'n is in 5', 'is in' ), - ); - - return $tests; - } -} diff --git a/tests/phpunit/maintenance/DumpTestCase.php b/tests/phpunit/maintenance/DumpTestCase.php deleted file mode 100644 index 83d8c71d..00000000 --- a/tests/phpunit/maintenance/DumpTestCase.php +++ /dev/null @@ -1,379 +0,0 @@ -<?php - -/** - * Base TestCase for dumps - */ -abstract class DumpTestCase extends MediaWikiLangTestCase { - - /** - * exception to be rethrown once in sound PHPUnit surrounding - * - * As the current MediaWikiTestCase::run is not robust enough to recover - * from thrown exceptions directly, we cannot throw frow within - * self::addDBData, although it would be appropriate. Hence, we catch the - * exception and store it until we are in setUp and may finally rethrow - * the exception without crashing the test suite. - * - * @var Exception|null - */ - protected $exceptionFromAddDBData = null; - - /** - * Holds the xmlreader used for analyzing an xml dump - * - * @var XMLReader|null - */ - protected $xml = null; - - /** - * Adds a revision to a page, while returning the resuting revision's id - * - * @param $page WikiPage: page to add the revision to - * @param $text string: revisions text - * @param $text string: revisions summare - * - * @throws MWExcepion - */ - protected function addRevision( Page $page, $text, $summary ) { - $status = $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), $summary ); - if ( $status->isGood() ) { - $value = $status->getValue(); - $revision = $value['revision']; - $revision_id = $revision->getId(); - $text_id = $revision->getTextId(); - if ( ( $revision_id > 0 ) && ( $text_id > 0 ) ) { - return array( $revision_id, $text_id ); - } - } - throw new MWException( "Could not determine revision id (" . $status->getWikiText() . ")" ); - } - - - /** - * gunzips the given file and stores the result in the original file name - * - * @param $fname string: filename to read the gzipped data from and stored - * the gunzipped data into - */ - protected function gunzip( $fname ) { - $gzipped_contents = file_get_contents( $fname ); - if ( $gzipped_contents === false ) { - $this->fail( "Could not get contents of $fname" ); - } - - $contents = gzdecode( $gzipped_contents ); - - $this->assertEquals( - strlen( $contents ), - file_put_contents( $fname, $contents ), - '# bytes written' - ); - } - - /** - * Default set up function. - * - * Clears $wgUser, and reports errors from addDBData to PHPUnit - */ - protected function setUp() { - parent::setUp(); - - // Check if any Exception is stored for rethrowing from addDBData - // @see self::exceptionFromAddDBData - if ( $this->exceptionFromAddDBData !== null ) { - throw $this->exceptionFromAddDBData; - } - - $this->setMwGlobals( 'wgUser', new User() ); - } - - /** - * Checks for test output consisting only of lines containing ETA announcements - */ - function expectETAOutput() { - // Newer PHPUnits require assertion about the output using PHPUnit's own - // expectOutput[...] functions. However, the PHPUnit shipped prediactes - // do not allow to check /each/ line of the output using /readable/ REs. - // So we ... - // - // 1. ... add a dummy output checking to make PHPUnit not complain - // about unchecked test output - $this->expectOutputRegex( '//' ); - - // 2. Do the real output checking on our own. - $lines = explode( "\n", $this->getActualOutput() ); - $this->assertGreaterThan( 1, count( $lines ), "Minimal lines of produced output" ); - $this->assertEquals( '', array_pop( $lines ), "Output ends in LF" ); - $timestamp_re = "[0-9]{4}-[01][0-9]-[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-6][0-9]"; - foreach ( $lines as $line ) { - $this->assertRegExp( "/$timestamp_re: .* \(ID [0-9]+\) [0-9]* pages .*, [0-9]* revs .*, ETA/", $line ); - } - } - - - /** - * Step the current XML reader until node end of given name is found. - * - * @param $name string: name of the closing element to look for - * (e.g.: "mediawiki" when looking for </mediawiki>) - * - * @return bool: true if the end node could be found. false otherwise. - */ - protected function skipToNodeEnd( $name ) { - while ( $this->xml->read() ) { - if ( $this->xml->nodeType == XMLReader::END_ELEMENT && - $this->xml->name == $name - ) { - return true; - } - } - - return false; - } - - /** - * Step the current XML reader to the first element start after the node - * end of a given name. - * - * @param $name string: name of the closing element to look for - * (e.g.: "mediawiki" when looking for </mediawiki>) - * - * @return bool: true iff new element after the closing of $name could be - * found. false otherwise. - */ - protected function skipPastNodeEnd( $name ) { - $this->assertTrue( $this->skipToNodeEnd( $name ), - "Skipping to end of $name" ); - while ( $this->xml->read() ) { - if ( $this->xml->nodeType == XMLReader::ELEMENT ) { - return true; - } - } - - return false; - } - - /** - * Opens an XML file to analyze and optionally skips past siteinfo. - * - * @param $fname string: name of file to analyze - * @param $skip_siteinfo bool: (optional) If true, step the xml reader - * to the first element after </siteinfo> - */ - protected function assertDumpStart( $fname, $skip_siteinfo = true ) { - $this->xml = new XMLReader(); - $this->assertTrue( $this->xml->open( $fname ), - "Opening temporary file $fname via XMLReader failed" ); - if ( $skip_siteinfo ) { - $this->assertTrue( $this->skipPastNodeEnd( "siteinfo" ), - "Skipping past end of siteinfo" ); - } - } - - /** - * Asserts that the xml reader is at the final closing tag of an xml file and - * closes the reader. - * - * @param $tag string: (optional) the name of the final tag - * (e.g.: "mediawiki" for </mediawiki>) - */ - protected function assertDumpEnd( $name = "mediawiki" ) { - $this->assertNodeEnd( $name, false ); - if ( $this->xml->read() ) { - $this->skipWhitespace(); - } - $this->assertEquals( $this->xml->nodeType, XMLReader::NONE, - "No proper entity left to parse" ); - $this->xml->close(); - } - - /** - * Steps the xml reader over white space - */ - protected function skipWhitespace() { - $cont = true; - while ( $cont && ( ( $this->xml->nodeType == XMLReader::WHITESPACE ) - || ( $this->xml->nodeType == XMLReader::SIGNIFICANT_WHITESPACE ) ) ) { - $cont = $this->xml->read(); - } - } - - /** - * Asserts that the xml reader is at an element of given name, and optionally - * skips past it. - * - * @param $name string: the name of the element to check for - * (e.g.: "mediawiki" for <mediawiki>) - * @param $skip bool: (optional) if true, skip past the found element - */ - protected function assertNodeStart( $name, $skip = true ) { - $this->assertEquals( $name, $this->xml->name, "Node name" ); - $this->assertEquals( XMLReader::ELEMENT, $this->xml->nodeType, "Node type" ); - if ( $skip ) { - $this->assertTrue( $this->xml->read(), "Skipping past start tag" ); - } - } - - /** - * Asserts that the xml reader is at an closing element of given name, and optionally - * skips past it. - * - * @param $name string: the name of the closing element to check for - * (e.g.: "mediawiki" for </mediawiki>) - * @param $skip bool: (optional) if true, skip past the found element - */ - protected function assertNodeEnd( $name, $skip = true ) { - $this->assertEquals( $name, $this->xml->name, "Node name" ); - $this->assertEquals( XMLReader::END_ELEMENT, $this->xml->nodeType, "Node type" ); - if ( $skip ) { - $this->assertTrue( $this->xml->read(), "Skipping past end tag" ); - } - } - - - /** - * Asserts that the xml reader is at an element of given tag that contains a given text, - * and skips over the element. - * - * @param $name string: the name of the element to check for - * (e.g.: "mediawiki" for <mediawiki>...</mediawiki>) - * @param $text string|false: If string, check if it equals the elements text. - * If false, ignore the element's text - * @param $skip_ws bool: (optional) if true, skip past white spaces that trail the - * closing element. - */ - protected function assertTextNode( $name, $text, $skip_ws = true ) { - $this->assertNodeStart( $name ); - - if ( $text !== false ) { - $this->assertEquals( $text, $this->xml->value, "Text of node " . $name ); - } - $this->assertTrue( $this->xml->read(), "Skipping past processed text of " . $name ); - $this->assertNodeEnd( $name ); - - if ( $skip_ws ) { - $this->skipWhitespace(); - } - } - - /** - * Asserts that the xml reader is at the start of a page element and skips over the first - * tags, after checking them. - * - * Besides the opening page element, this function also checks for and skips over the - * title, ns, and id tags. Hence after this function, the xml reader is at the first - * revision of the current page. - * - * @param $id int: id of the page to assert - * @param $ns int: number of namespage to assert - * @param $name string: title of the current page - */ - protected function assertPageStart( $id, $ns, $name ) { - - $this->assertNodeStart( "page" ); - $this->skipWhitespace(); - - $this->assertTextNode( "title", $name ); - $this->assertTextNode( "ns", $ns ); - $this->assertTextNode( "id", $id ); - } - - /** - * Asserts that the xml reader is at the page's closing element and skips to the next - * element. - */ - protected function assertPageEnd() { - $this->assertNodeEnd( "page" ); - $this->skipWhitespace(); - } - - /** - * Asserts that the xml reader is at a revision and checks its representation before - * skipping over it. - * - * @param $id int: id of the revision - * @param $summary string: summary of the revision - * @param $text_id int: id of the revision's text - * @param $text_bytes int: # of bytes in the revision's text - * @param $text_sha1 string: the base36 SHA-1 of the revision's text - * @param $text string|false: (optional) The revision's string, or false to check for a - * revision stub - * @param $model String: the expected content model id (default: CONTENT_MODEL_WIKITEXT) - * @param $format String: the expected format model id (default: CONTENT_FORMAT_WIKITEXT) - * @param $parentid int|false: (optional) id of the parent revision - */ - protected function assertRevision( $id, $summary, $text_id, $text_bytes, $text_sha1, $text = false, $parentid = false, - $model = CONTENT_MODEL_WIKITEXT, $format = CONTENT_FORMAT_WIKITEXT - ) { - $this->assertNodeStart( "revision" ); - $this->skipWhitespace(); - - $this->assertTextNode( "id", $id ); - if ( $parentid !== false ) { - $this->assertTextNode( "parentid", $parentid ); - } - $this->assertTextNode( "timestamp", false ); - - $this->assertNodeStart( "contributor" ); - $this->skipWhitespace(); - $this->assertTextNode( "ip", false ); - $this->assertNodeEnd( "contributor" ); - $this->skipWhitespace(); - - $this->assertTextNode( "comment", $summary ); - $this->skipWhitespace(); - - if ( $this->xml->name == "text" ) { - // note: <text> tag may occur here or at the very end. - $text_found = true; - $this->assertText( $id, $text_id, $text_bytes, $text ); - } else { - $text_found = false; - } - - $this->assertTextNode( "sha1", $text_sha1 ); - - $this->assertTextNode( "model", $model ); - $this->skipWhitespace(); - - $this->assertTextNode( "format", $format ); - $this->skipWhitespace(); - - if ( !$text_found ) { - $this->assertText( $id, $text_id, $text_bytes, $text ); - } - - $this->assertNodeEnd( "revision" ); - $this->skipWhitespace(); - } - - protected function assertText( $id, $text_id, $text_bytes, $text ) { - $this->assertNodeStart( "text", false ); - if ( $text_bytes !== false ) { - $this->assertEquals( $this->xml->getAttribute( "bytes" ), $text_bytes, - "Attribute 'bytes' of revision " . $id ); - } - - if ( $text === false ) { - // Testing for a stub - $this->assertEquals( $this->xml->getAttribute( "id" ), $text_id, - "Text id of revision " . $id ); - $this->assertFalse( $this->xml->hasValue, "Revision has text" ); - $this->assertTrue( $this->xml->read(), "Skipping text start tag" ); - if ( ( $this->xml->nodeType == XMLReader::END_ELEMENT ) - && ( $this->xml->name == "text" ) - ) { - - $this->xml->read(); - } - $this->skipWhitespace(); - } else { - // Testing for a real dump - $this->assertTrue( $this->xml->read(), "Skipping text start tag" ); - $this->assertEquals( $text, $this->xml->value, "Text of revision " . $id ); - $this->assertTrue( $this->xml->read(), "Skipping past text" ); - $this->assertNodeEnd( "text" ); - $this->skipWhitespace(); - } - } -} diff --git a/tests/phpunit/maintenance/MaintenanceTest.php b/tests/phpunit/maintenance/MaintenanceTest.php deleted file mode 100644 index 318ce0da..00000000 --- a/tests/phpunit/maintenance/MaintenanceTest.php +++ /dev/null @@ -1,816 +0,0 @@ -<?php - -// It would be great if we were able to use PHPUnit's getMockForAbstractClass -// instead of the MaintenanceFixup hack below. However, we cannot do -// without changing the visibility and without working around hacks in -// Maintenance.php -// -// For the same reason, we cannot just use FakeMaintenance. - -/** - * makes parts of the API of Maintenance that is hidden by protected visibily - * visible for testing, and makes up for a stream closing hack in Maintenance.php. - * - * This class is solely used for being able to test Maintenance right now - * without having to apply major refactorings to fix some design issues in - * Maintenance.php. Before adding more functions here, please consider whether - * this approach is correct, or a refactoring Maintenance to separate concers - * is more appropriate. - * - * Upon refactoring, keep in mind that besides the maintenance scrits themselves - * and tests right here, also at least Extension:Maintenance make use of - * Maintenance. - * - * Due to a hack in Maintenance.php using register_shutdown_function, be sure to - * finally call simulateShutdown on MaintenanceFixup instance before a test - * ends. - * - */ -class MaintenanceFixup extends Maintenance { - - // --- Making up for the register_shutdown_function hack in Maintenance.php - - /** - * The test case that generated this instance. - * - * This member is motivated by allowing the destructor to check whether or not - * the test failed, in order to avoid unnecessary nags about omitted shutdown - * simulation. - * But as it is already available, we also usi it to flagging tests as failed - * - * @var MediaWikiTestCase - */ - private $testCase; - - /** - * shutdownSimulated === true if simulateShutdown has done it's work - * - * @var bool - */ - private $shutdownSimulated = false; - - /** - * Simulates what Maintenance wants to happen at script's end. - */ - public function simulateShutdown() { - - if ( $this->shutdownSimulated ) { - $this->testCase->fail( __METHOD__ . " called more than once" ); - } - - // The cleanup action. - $this->outputChanneled( false ); - - // Bookkeeping that we simulated the clean up. - $this->shutdownSimulated = true; - } - - // Note that the "public" here does not change visibility - public function outputChanneled( $msg, $channel = null ) { - if ( $this->shutdownSimulated ) { - if ( $msg !== false ) { - $this->testCase->fail( "Already past simulated shutdown, but msg is " - . "not false. Did the hack in Maintenance.php change? Please " - . "adapt the test case or Maintenance.php" ); - } - - // The current call is the one registered via register_shutdown_function. - // We can safely ignore it, as we simulated this one via simulateShutdown - // before (if we did not, the destructor of this instance will warn about - // it) - return; - } - - return call_user_func_array( array( "parent", __FUNCTION__ ), func_get_args() ); - } - - /** - * Safety net around register_shutdown_function of Maintenance.php - */ - public function __destruct() { - if ( !$this->shutdownSimulated ) { - // Someone generated a MaintenanceFixup instance without calling - // simulateShutdown. We'd have to raise a PHPUnit exception to correctly - // flag this illegal usage. However, we are already in a destruktor, which - // would trigger undefined behavior. Hence, we can only report to the - // error output :( Hopefully people read the PHPUnit output. - $name = $this->testCase->getName(); - fwrite( STDERR, "ERROR! Instance of " . __CLASS__ . " for test $name " - . "destructed without calling simulateShutdown method. Call " - . "simulateShutdown on the instance before it gets destructed." ); - } - - // The following guard is required, as PHP does not offer default destructors :( - if ( is_callable( "parent::__destruct" ) ) { - parent::__destruct(); - } - } - - public function __construct( MediaWikiTestCase $testCase ) { - parent::__construct(); - $this->testCase = $testCase; - } - - - // --- Making protected functions visible for test - - public function output( $out, $channel = null ) { - // Just to make PHP not nag about signature mismatches, we copied - // Maintenance::output signature. However, we do not use (or rely on) - // those variables. Instead we pass to Maintenance::output whatever we - // receive at runtime. - return call_user_func_array( array( "parent", __FUNCTION__ ), func_get_args() ); - } - - - // --- Requirements for getting instance of abstract class - - public function execute() { - $this->testCase->fail( __METHOD__ . " called unexpectedly" ); - } -} - -class MaintenanceTest extends MediaWikiTestCase { - - - /** - * The main Maintenance instance that is used for testing. - * - * @var MaintenanceFixup - */ - private $m; - - - protected function setUp() { - parent::setUp(); - $this->m = new MaintenanceFixup( $this ); - } - - protected function tearDown() { - if ( $this->m ) { - $this->m->simulateShutdown(); - $this->m = null; - } - parent::tearDown(); - } - - - /** - * asserts the output before and after simulating shutdown - * - * This function simulates shutdown of self::m. - * - * @param $preShutdownOutput string: expected output before simulating shutdown - * @param $expectNLAppending bool: Whether or not shutdown simulation is expected - * to add a newline to the output. If false, $preShutdownOutput is the - * expected output after shutdown simulation. Otherwise, - * $preShutdownOutput with an appended newline is the expected output - * after shutdown simulation. - */ - private function assertOutputPrePostShutdown( $preShutdownOutput, $expectNLAppending ) { - - $this->assertEquals( $preShutdownOutput, $this->getActualOutput(), - "Output before shutdown simulation" ); - - $this->m->simulateShutdown(); - $this->m = null; - - $postShutdownOutput = $preShutdownOutput . ( $expectNLAppending ? "\n" : "" ); - $this->expectOutputString( $postShutdownOutput ); - } - - - // Although the following tests do not seem to be too consistent (compare for - // example the newlines within the test.*StringString tests, or the - // test.*Intermittent.* tests), the objective of these tests is not to describe - // consistent behavior, but rather currently existing behavior. - - function testOutputEmpty() { - $this->m->output( "" ); - $this->assertOutputPrePostShutdown( "", false ); - } - - function testOutputString() { - $this->m->output( "foo" ); - $this->assertOutputPrePostShutdown( "foo", false ); - } - - function testOutputStringString() { - $this->m->output( "foo" ); - $this->m->output( "bar" ); - $this->assertOutputPrePostShutdown( "foobar", false ); - } - - function testOutputStringNL() { - $this->m->output( "foo\n" ); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testOutputStringNLNL() { - $this->m->output( "foo\n\n" ); - $this->assertOutputPrePostShutdown( "foo\n\n", false ); - } - - function testOutputStringNLString() { - $this->m->output( "foo\nbar" ); - $this->assertOutputPrePostShutdown( "foo\nbar", false ); - } - - function testOutputStringNLStringNL() { - $this->m->output( "foo\nbar\n" ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputStringNLStringNLLinewise() { - $this->m->output( "foo\n" ); - $this->m->output( "bar\n" ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputStringNLStringNLArbitrary() { - $this->m->output( "" ); - $this->m->output( "foo" ); - $this->m->output( "" ); - $this->m->output( "\n" ); - $this->m->output( "ba" ); - $this->m->output( "" ); - $this->m->output( "r\n" ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputStringNLStringNLArbitraryAgain() { - $this->m->output( "" ); - $this->m->output( "foo" ); - $this->m->output( "" ); - $this->m->output( "\nb" ); - $this->m->output( "a" ); - $this->m->output( "" ); - $this->m->output( "r\n" ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputWNullChannelEmpty() { - $this->m->output( "", null ); - $this->assertOutputPrePostShutdown( "", false ); - } - - function testOutputWNullChannelString() { - $this->m->output( "foo", null ); - $this->assertOutputPrePostShutdown( "foo", false ); - } - - function testOutputWNullChannelStringString() { - $this->m->output( "foo", null ); - $this->m->output( "bar", null ); - $this->assertOutputPrePostShutdown( "foobar", false ); - } - - function testOutputWNullChannelStringNL() { - $this->m->output( "foo\n", null ); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testOutputWNullChannelStringNLNL() { - $this->m->output( "foo\n\n", null ); - $this->assertOutputPrePostShutdown( "foo\n\n", false ); - } - - function testOutputWNullChannelStringNLString() { - $this->m->output( "foo\nbar", null ); - $this->assertOutputPrePostShutdown( "foo\nbar", false ); - } - - function testOutputWNullChannelStringNLStringNL() { - $this->m->output( "foo\nbar\n", null ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputWNullChannelStringNLStringNLLinewise() { - $this->m->output( "foo\n", null ); - $this->m->output( "bar\n", null ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputWNullChannelStringNLStringNLArbitrary() { - $this->m->output( "", null ); - $this->m->output( "foo", null ); - $this->m->output( "", null ); - $this->m->output( "\n", null ); - $this->m->output( "ba", null ); - $this->m->output( "", null ); - $this->m->output( "r\n", null ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputWNullChannelStringNLStringNLArbitraryAgain() { - $this->m->output( "", null ); - $this->m->output( "foo", null ); - $this->m->output( "", null ); - $this->m->output( "\nb", null ); - $this->m->output( "a", null ); - $this->m->output( "", null ); - $this->m->output( "r\n", null ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputWChannelString() { - $this->m->output( "foo", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo", true ); - } - - function testOutputWChannelStringNL() { - $this->m->output( "foo\n", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo", true ); - } - - function testOutputWChannelStringNLNL() { - // If this test fails, note that output takes strings with double line - // endings (although output's implementation in this situation calls - // outputChanneled with a string ending in a nl ... which is not allowed - // according to the documentation of outputChanneled) - $this->m->output( "foo\n\n", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\n", true ); - } - - function testOutputWChannelStringNLString() { - $this->m->output( "foo\nbar", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar", true ); - } - - function testOutputWChannelStringNLStringNL() { - $this->m->output( "foo\nbar\n", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar", true ); - } - - function testOutputWChannelStringNLStringNLLinewise() { - $this->m->output( "foo\n", "bazChannel" ); - $this->m->output( "bar\n", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar", true ); - } - - function testOutputWChannelStringNLStringNLArbitrary() { - $this->m->output( "", "bazChannel" ); - $this->m->output( "foo", "bazChannel" ); - $this->m->output( "", "bazChannel" ); - $this->m->output( "\n", "bazChannel" ); - $this->m->output( "ba", "bazChannel" ); - $this->m->output( "", "bazChannel" ); - $this->m->output( "r\n", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar", true ); - } - - function testOutputWChannelStringNLStringNLArbitraryAgain() { - $this->m->output( "", "bazChannel" ); - $this->m->output( "foo", "bazChannel" ); - $this->m->output( "", "bazChannel" ); - $this->m->output( "\nb", "bazChannel" ); - $this->m->output( "a", "bazChannel" ); - $this->m->output( "", "bazChannel" ); - $this->m->output( "r\n", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar", true ); - } - - function testOutputWMultipleChannelsChannelChange() { - $this->m->output( "foo", "bazChannel" ); - $this->m->output( "bar", "bazChannel" ); - $this->m->output( "qux", "quuxChannel" ); - $this->m->output( "corge", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar\nqux\ncorge", true ); - } - - function testOutputWMultipleChannelsChannelChangeNL() { - $this->m->output( "foo", "bazChannel" ); - $this->m->output( "bar\n", "bazChannel" ); - $this->m->output( "qux\n", "quuxChannel" ); - $this->m->output( "corge", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar\nqux\ncorge", true ); - } - - function testOutputWAndWOChannelStringStartWO() { - $this->m->output( "foo" ); - $this->m->output( "bar", "bazChannel" ); - $this->m->output( "qux" ); - $this->m->output( "quux", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar\nquxquux", true ); - } - - function testOutputWAndWOChannelStringStartW() { - $this->m->output( "foo", "bazChannel" ); - $this->m->output( "bar" ); - $this->m->output( "qux", "bazChannel" ); - $this->m->output( "quux" ); - $this->assertOutputPrePostShutdown( "foo\nbarqux\nquux", false ); - } - - function testOutputWChannelTypeSwitch() { - $this->m->output( "foo", 1 ); - $this->m->output( "bar", 1.0 ); - $this->assertOutputPrePostShutdown( "foo\nbar", true ); - } - - function testOutputIntermittentEmpty() { - $this->m->output( "foo" ); - $this->m->output( "" ); - $this->m->output( "bar" ); - $this->assertOutputPrePostShutdown( "foobar", false ); - } - - function testOutputIntermittentFalse() { - $this->m->output( "foo" ); - $this->m->output( false ); - $this->m->output( "bar" ); - $this->assertOutputPrePostShutdown( "foobar", false ); - } - - function testOutputIntermittentFalseAfterOtherChannel() { - $this->m->output( "qux", "quuxChannel" ); - $this->m->output( "foo" ); - $this->m->output( false ); - $this->m->output( "bar" ); - $this->assertOutputPrePostShutdown( "qux\nfoobar", false ); - } - - function testOutputWNullChannelIntermittentEmpty() { - $this->m->output( "foo", null ); - $this->m->output( "", null ); - $this->m->output( "bar", null ); - $this->assertOutputPrePostShutdown( "foobar", false ); - } - - function testOutputWNullChannelIntermittentFalse() { - $this->m->output( "foo", null ); - $this->m->output( false, null ); - $this->m->output( "bar", null ); - $this->assertOutputPrePostShutdown( "foobar", false ); - } - - function testOutputWChannelIntermittentEmpty() { - $this->m->output( "foo", "bazChannel" ); - $this->m->output( "", "bazChannel" ); - $this->m->output( "bar", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar", true ); - } - - function testOutputWChannelIntermittentFalse() { - $this->m->output( "foo", "bazChannel" ); - $this->m->output( false, "bazChannel" ); - $this->m->output( "bar", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar", true ); - } - - // Note that (per documentation) outputChanneled does take strings that end - // in \n, hence we do not test such strings. - - function testOutputChanneledEmpty() { - $this->m->outputChanneled( "" ); - $this->assertOutputPrePostShutdown( "\n", false ); - } - - function testOutputChanneledString() { - $this->m->outputChanneled( "foo" ); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testOutputChanneledStringString() { - $this->m->outputChanneled( "foo" ); - $this->m->outputChanneled( "bar" ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputChanneledStringNLString() { - $this->m->outputChanneled( "foo\nbar" ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputChanneledStringNLStringNLArbitraryAgain() { - $this->m->outputChanneled( "" ); - $this->m->outputChanneled( "foo" ); - $this->m->outputChanneled( "" ); - $this->m->outputChanneled( "\nb" ); - $this->m->outputChanneled( "a" ); - $this->m->outputChanneled( "" ); - $this->m->outputChanneled( "r" ); - $this->assertOutputPrePostShutdown( "\nfoo\n\n\nb\na\n\nr\n", false ); - } - - function testOutputChanneledWNullChannelEmpty() { - $this->m->outputChanneled( "", null ); - $this->assertOutputPrePostShutdown( "\n", false ); - } - - function testOutputChanneledWNullChannelString() { - $this->m->outputChanneled( "foo", null ); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testOutputChanneledWNullChannelStringString() { - $this->m->outputChanneled( "foo", null ); - $this->m->outputChanneled( "bar", null ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputChanneledWNullChannelStringNLString() { - $this->m->outputChanneled( "foo\nbar", null ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputChanneledWNullChannelStringNLStringNLArbitraryAgain() { - $this->m->outputChanneled( "", null ); - $this->m->outputChanneled( "foo", null ); - $this->m->outputChanneled( "", null ); - $this->m->outputChanneled( "\nb", null ); - $this->m->outputChanneled( "a", null ); - $this->m->outputChanneled( "", null ); - $this->m->outputChanneled( "r", null ); - $this->assertOutputPrePostShutdown( "\nfoo\n\n\nb\na\n\nr\n", false ); - } - - function testOutputChanneledWChannelString() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo", true ); - } - - function testOutputChanneledWChannelStringNLString() { - $this->m->outputChanneled( "foo\nbar", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar", true ); - } - - function testOutputChanneledWChannelStringString() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->outputChanneled( "bar", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar", true ); - } - - function testOutputChanneledWChannelStringNLStringNLArbitraryAgain() { - $this->m->outputChanneled( "", "bazChannel" ); - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->outputChanneled( "", "bazChannel" ); - $this->m->outputChanneled( "\nb", "bazChannel" ); - $this->m->outputChanneled( "a", "bazChannel" ); - $this->m->outputChanneled( "", "bazChannel" ); - $this->m->outputChanneled( "r", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar", true ); - } - - function testOutputChanneledWMultipleChannelsChannelChange() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->outputChanneled( "bar", "bazChannel" ); - $this->m->outputChanneled( "qux", "quuxChannel" ); - $this->m->outputChanneled( "corge", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar\nqux\ncorge", true ); - } - - function testOutputChanneledWMultipleChannelsChannelChangeEnclosedNull() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->outputChanneled( "bar", null ); - $this->m->outputChanneled( "qux", null ); - $this->m->outputChanneled( "corge", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar\nqux\ncorge", true ); - } - - function testOutputChanneledWMultipleChannelsChannelAfterNullChange() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->outputChanneled( "bar", null ); - $this->m->outputChanneled( "qux", null ); - $this->m->outputChanneled( "corge", "quuxChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar\nqux\ncorge", true ); - } - - function testOutputChanneledWAndWOChannelStringStartWO() { - $this->m->outputChanneled( "foo" ); - $this->m->outputChanneled( "bar", "bazChannel" ); - $this->m->outputChanneled( "qux" ); - $this->m->outputChanneled( "quux", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar\nqux\nquux", true ); - } - - function testOutputChanneledWAndWOChannelStringStartW() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->outputChanneled( "bar" ); - $this->m->outputChanneled( "qux", "bazChannel" ); - $this->m->outputChanneled( "quux" ); - $this->assertOutputPrePostShutdown( "foo\nbar\nqux\nquux\n", false ); - } - - function testOutputChanneledWChannelTypeSwitch() { - $this->m->outputChanneled( "foo", 1 ); - $this->m->outputChanneled( "bar", 1.0 ); - $this->assertOutputPrePostShutdown( "foo\nbar", true ); - } - - function testOutputChanneledWOChannelIntermittentEmpty() { - $this->m->outputChanneled( "foo" ); - $this->m->outputChanneled( "" ); - $this->m->outputChanneled( "bar" ); - $this->assertOutputPrePostShutdown( "foo\n\nbar\n", false ); - } - - function testOutputChanneledWOChannelIntermittentFalse() { - $this->m->outputChanneled( "foo" ); - $this->m->outputChanneled( false ); - $this->m->outputChanneled( "bar" ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputChanneledWNullChannelIntermittentEmpty() { - $this->m->outputChanneled( "foo", null ); - $this->m->outputChanneled( "", null ); - $this->m->outputChanneled( "bar", null ); - $this->assertOutputPrePostShutdown( "foo\n\nbar\n", false ); - } - - function testOutputChanneledWNullChannelIntermittentFalse() { - $this->m->outputChanneled( "foo", null ); - $this->m->outputChanneled( false, null ); - $this->m->outputChanneled( "bar", null ); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testOutputChanneledWChannelIntermittentEmpty() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->outputChanneled( "", "bazChannel" ); - $this->m->outputChanneled( "bar", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foobar", true ); - } - - function testOutputChanneledWChannelIntermittentFalse() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->outputChanneled( false, "bazChannel" ); - $this->m->outputChanneled( "bar", "bazChannel" ); - $this->assertOutputPrePostShutdown( "foo\nbar", true ); - } - - function testCleanupChanneledClean() { - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "", false ); - } - - function testCleanupChanneledAfterOutput() { - $this->m->output( "foo" ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo", false ); - } - - function testCleanupChanneledAfterOutputWNullChannel() { - $this->m->output( "foo", null ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo", false ); - } - - function testCleanupChanneledAfterOutputWChannel() { - $this->m->output( "foo", "bazChannel" ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testCleanupChanneledAfterNLOutput() { - $this->m->output( "foo\n" ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testCleanupChanneledAfterNLOutputWNullChannel() { - $this->m->output( "foo\n", null ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testCleanupChanneledAfterNLOutputWChannel() { - $this->m->output( "foo\n", "bazChannel" ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testCleanupChanneledAfterOutputChanneledWOChannel() { - $this->m->outputChanneled( "foo" ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testCleanupChanneledAfterOutputChanneledWNullChannel() { - $this->m->outputChanneled( "foo", null ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testCleanupChanneledAfterOutputChanneledWChannel() { - $this->m->outputChanneled( "foo", "bazChannel" ); - $this->m->cleanupChanneled(); - $this->assertOutputPrePostShutdown( "foo\n", false ); - } - - function testMultipleMaintenanceObjectsInteractionOutput() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->output( "foo" ); - $m2->output( "bar" ); - - $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foobar", false ); - } - - function testMultipleMaintenanceObjectsInteractionOutputWNullChannel() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->output( "foo", null ); - $m2->output( "bar", null ); - - $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foobar", false ); - } - - function testMultipleMaintenanceObjectsInteractionOutputWChannel() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->output( "foo", "bazChannel" ); - $m2->output( "bar", "bazChannel" ); - - $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foobar\n", true ); - } - - function testMultipleMaintenanceObjectsInteractionOutputWNullChannelNL() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->output( "foo\n", null ); - $m2->output( "bar\n", null ); - - $this->assertEquals( "foo\nbar\n", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testMultipleMaintenanceObjectsInteractionOutputWChannelNL() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->output( "foo\n", "bazChannel" ); - $m2->output( "bar\n", "bazChannel" ); - - $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foobar\n", true ); - } - - function testMultipleMaintenanceObjectsInteractionOutputChanneled() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->outputChanneled( "foo" ); - $m2->outputChanneled( "bar" ); - - $this->assertEquals( "foo\nbar\n", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testMultipleMaintenanceObjectsInteractionOutputChanneledWNullChannel() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->outputChanneled( "foo", null ); - $m2->outputChanneled( "bar", null ); - - $this->assertEquals( "foo\nbar\n", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foo\nbar\n", false ); - } - - function testMultipleMaintenanceObjectsInteractionOutputChanneledWChannel() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->outputChanneled( "foo", "bazChannel" ); - $m2->outputChanneled( "bar", "bazChannel" ); - - $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before shutdown simulation (m2)" ); - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foobar\n", true ); - } - - function testMultipleMaintenanceObjectsInteractionCleanupChanneledWChannel() { - $m2 = new MaintenanceFixup( $this ); - - $this->m->outputChanneled( "foo", "bazChannel" ); - $m2->outputChanneled( "bar", "bazChannel" ); - - $this->assertEquals( "foobar", $this->getActualOutput(), - "Output before first cleanup" ); - $this->m->cleanupChanneled(); - $this->assertEquals( "foobar\n", $this->getActualOutput(), - "Output after first cleanup" ); - $m2->cleanupChanneled(); - $this->assertEquals( "foobar\n\n", $this->getActualOutput(), - "Output after second cleanup" ); - - $m2->simulateShutdown(); - $this->assertOutputPrePostShutdown( "foobar\n\n", false ); - } -} diff --git a/tests/phpunit/maintenance/backupPrefetchTest.php b/tests/phpunit/maintenance/backupPrefetchTest.php deleted file mode 100644 index bc2d7375..00000000 --- a/tests/phpunit/maintenance/backupPrefetchTest.php +++ /dev/null @@ -1,275 +0,0 @@ -<?php - -require_once __DIR__ . "/../../../maintenance/backupPrefetch.inc"; - -/** - * Tests for BaseDump - * - * @group Dump - */ -class BaseDumpTest extends MediaWikiTestCase { - - /** - * @var BaseDump the BaseDump instance used within a test. - * - * If set, this BaseDump gets automatically closed in tearDown. - */ - private $dump = null; - - protected function tearDown() { - if ( $this->dump !== null ) { - $this->dump->close(); - } - - // Bug 37458, parent teardown need to be done after closing the - // dump or it might cause some permissions errors. - parent::tearDown(); - } - - /** - * asserts that a prefetch yields an expected string - * - * @param $expected string|null: the exepcted result of the prefetch - * @param $page int: the page number to prefetch the text for - * @param $revision int: the revision number to prefetch the text for - */ - private function assertPrefetchEquals( $expected, $page, $revision ) { - $this->assertEquals( $expected, $this->dump->prefetch( $page, $revision ), - "Prefetch of page $page revision $revision" ); - } - - function testSequential() { - $fname = $this->setUpPrefetch(); - $this->dump = new BaseDump( $fname ); - - $this->assertPrefetchEquals( "BackupDumperTestP1Text1", 1, 1 ); - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - $this->assertPrefetchEquals( "BackupDumperTestP2Text4 some additional Text", 2, 5 ); - $this->assertPrefetchEquals( "Talk about BackupDumperTestP1 Text1", 4, 8 ); - } - - function testSynchronizeRevisionMissToRevision() { - $fname = $this->setUpPrefetch(); - $this->dump = new BaseDump( $fname ); - - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - $this->assertPrefetchEquals( null, 2, 3 ); - $this->assertPrefetchEquals( "BackupDumperTestP2Text4 some additional Text", 2, 5 ); - } - - function testSynchronizeRevisionMissToPage() { - $fname = $this->setUpPrefetch(); - $this->dump = new BaseDump( $fname ); - - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - $this->assertPrefetchEquals( null, 2, 40 ); - $this->assertPrefetchEquals( "Talk about BackupDumperTestP1 Text1", 4, 8 ); - } - - function testSynchronizePageMiss() { - $fname = $this->setUpPrefetch(); - $this->dump = new BaseDump( $fname ); - - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - $this->assertPrefetchEquals( null, 3, 40 ); - $this->assertPrefetchEquals( "Talk about BackupDumperTestP1 Text1", 4, 8 ); - } - - function testPageMissAtEnd() { - $fname = $this->setUpPrefetch(); - $this->dump = new BaseDump( $fname ); - - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - $this->assertPrefetchEquals( null, 6, 40 ); - } - - function testRevisionMissAtEnd() { - $fname = $this->setUpPrefetch(); - $this->dump = new BaseDump( $fname ); - - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - $this->assertPrefetchEquals( null, 4, 40 ); - } - - function testSynchronizePageMissAtStart() { - $fname = $this->setUpPrefetch(); - $this->dump = new BaseDump( $fname ); - - $this->assertPrefetchEquals( null, 0, 2 ); - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - } - - function testSynchronizeRevisionMissAtStart() { - $fname = $this->setUpPrefetch(); - $this->dump = new BaseDump( $fname ); - - $this->assertPrefetchEquals( null, 1, -2 ); - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - } - - function testSequentialAcrossFiles() { - $fname1 = $this->setUpPrefetch( array( 1 ) ); - $fname2 = $this->setUpPrefetch( array( 2, 4 ) ); - $this->dump = new BaseDump( $fname1 . ";" . $fname2 ); - - $this->assertPrefetchEquals( "BackupDumperTestP1Text1", 1, 1 ); - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - $this->assertPrefetchEquals( "BackupDumperTestP2Text4 some additional Text", 2, 5 ); - $this->assertPrefetchEquals( "Talk about BackupDumperTestP1 Text1", 4, 8 ); - } - - function testSynchronizeSkipAcrossFile() { - $fname1 = $this->setUpPrefetch( array( 1 ) ); - $fname2 = $this->setUpPrefetch( array( 2 ) ); - $fname3 = $this->setUpPrefetch( array( 4 ) ); - $this->dump = new BaseDump( $fname1 . ";" . $fname2 . ";" . $fname3 ); - - $this->assertPrefetchEquals( "BackupDumperTestP1Text1", 1, 1 ); - $this->assertPrefetchEquals( "Talk about BackupDumperTestP1 Text1", 4, 8 ); - } - - function testSynchronizeMissInWholeFirstFile() { - $fname1 = $this->setUpPrefetch( array( 1 ) ); - $fname2 = $this->setUpPrefetch( array( 2 ) ); - $this->dump = new BaseDump( $fname1 . ";" . $fname2 ); - - $this->assertPrefetchEquals( "BackupDumperTestP2Text1", 2, 2 ); - } - - - /** - * Constructs a temporary file that can be used for prefetching - * - * The temporary file is removed by DumpBackup upon tearDown. - * - * @param $requested_pages Array The indices of the page parts that should - * go into the prefetch file. 1,2,4 are available. - * @return String The file name of the created temporary file - */ - private function setUpPrefetch( $requested_pages = array( 1, 2, 4 ) ) { - // The file name, where we store the prepared prefetch file - $fname = $this->getNewTempFile(); - - // The header of every prefetch file - $header = '<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.7/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.7/ http://www.mediawiki.org/xml/export-0.7.xsd" version="0.7" xml:lang="en"> - <siteinfo> - <sitename>wikisvn</sitename> - <base>http://localhost/wiki-svn/index.php/Main_Page</base> - <generator>MediaWiki 1.21alpha</generator> - <case>first-letter</case> - <namespaces> - <namespace key="-2" case="first-letter">Media</namespace> - <namespace key="-1" case="first-letter">Special</namespace> - <namespace key="0" case="first-letter" /> - <namespace key="1" case="first-letter">Talk</namespace> - <namespace key="2" case="first-letter">User</namespace> - <namespace key="3" case="first-letter">User talk</namespace> - <namespace key="4" case="first-letter">Wikisvn</namespace> - <namespace key="5" case="first-letter">Wikisvn talk</namespace> - <namespace key="6" case="first-letter">File</namespace> - <namespace key="7" case="first-letter">File talk</namespace> - <namespace key="8" case="first-letter">MediaWiki</namespace> - <namespace key="9" case="first-letter">MediaWiki talk</namespace> - <namespace key="10" case="first-letter">Template</namespace> - <namespace key="11" case="first-letter">Template talk</namespace> - <namespace key="12" case="first-letter">Help</namespace> - <namespace key="13" case="first-letter">Help talk</namespace> - <namespace key="14" case="first-letter">Category</namespace> - <namespace key="15" case="first-letter">Category talk</namespace> - </namespaces> - </siteinfo> -'; - - // An array holding the pages that are available for prefetch - $available_pages = array(); - - // Simple plain page - $available_pages[1] = ' <page> - <title>BackupDumperTestP1 - 0 - 1 - - 1 - 2012-04-01T16:46:05Z - - 127.0.0.1 - - BackupDumperTestP1Summary1 - 0bolhl6ol7i6x0e7yq91gxgaan39j87 - BackupDumperTestP1Text1 - 1 - 1 - - -'; - // Page with more than one revisions. Hole in rev ids. - $available_pages[2] = ' - BackupDumperTestP2 - 0 - 2 - - 2 - 2012-04-01T16:46:05Z - - 127.0.0.1 - - BackupDumperTestP2Summary1 - jprywrymfhysqllua29tj3sc7z39dl2 - BackupDumperTestP2Text1 - 1 - 1 - - - 5 - 2 - 2012-04-01T16:46:05Z - - 127.0.0.1 - - BackupDumperTestP2Summary4 extra - 6o1ciaxa6pybnqprmungwofc4lv00wv - BackupDumperTestP2Text4 some additional Text - 1 - 1 - - -'; - // Page with id higher than previous id + 1 - $available_pages[4] = ' - Talk:BackupDumperTestP1 - 1 - 4 - - 8 - 2012-04-01T16:46:05Z - - 127.0.0.1 - - Talk BackupDumperTestP1 Summary1 - nktofwzd0tl192k3zfepmlzxoax1lpe - 1 - 1 - Talk about BackupDumperTestP1 Text1 - - -'; - - // The common ending for all files - $tail = ' -'; - - // Putting together the content of the prefetch files - $content = $header; - foreach ( $requested_pages as $i ) { - $this->assertTrue( array_key_exists( $i, $available_pages ), - "Check for availability of requested page " . $i ); - $content .= $available_pages[$i]; - } - $content .= $tail; - - $this->assertEquals( strlen( $content ), file_put_contents( - $fname, $content ), "Length of prepared prefetch" ); - - return $fname; - } -} diff --git a/tests/phpunit/maintenance/backupTextPassTest.php b/tests/phpunit/maintenance/backupTextPassTest.php deleted file mode 100644 index 653a1145..00000000 --- a/tests/phpunit/maintenance/backupTextPassTest.php +++ /dev/null @@ -1,581 +0,0 @@ -tablesUsed[] = 'page'; - $this->tablesUsed[] = 'revision'; - $this->tablesUsed[] = 'text'; - - $ns = $this->getDefaultWikitextNS(); - - try { - // Simple page - $title = Title::newFromText( 'BackupDumperTestP1', $ns ); - $page = WikiPage::factory( $title ); - list( $this->revId1_1, $this->textId1_1 ) = $this->addRevision( $page, - "BackupDumperTestP1Text1", "BackupDumperTestP1Summary1" ); - $this->pageId1 = $page->getId(); - - // Page with more than one revision - $title = Title::newFromText( 'BackupDumperTestP2', $ns ); - $page = WikiPage::factory( $title ); - list( $this->revId2_1, $this->textId2_1 ) = $this->addRevision( $page, - "BackupDumperTestP2Text1", "BackupDumperTestP2Summary1" ); - list( $this->revId2_2, $this->textId2_2 ) = $this->addRevision( $page, - "BackupDumperTestP2Text2", "BackupDumperTestP2Summary2" ); - list( $this->revId2_3, $this->textId2_3 ) = $this->addRevision( $page, - "BackupDumperTestP2Text3", "BackupDumperTestP2Summary3" ); - list( $this->revId2_4, $this->textId2_4 ) = $this->addRevision( $page, - "BackupDumperTestP2Text4 some additional Text ", - "BackupDumperTestP2Summary4 extra " ); - $this->pageId2 = $page->getId(); - - // Deleted page. - $title = Title::newFromText( 'BackupDumperTestP3', $ns ); - $page = WikiPage::factory( $title ); - list( $this->revId3_1, $this->textId3_1 ) = $this->addRevision( $page, - "BackupDumperTestP3Text1", "BackupDumperTestP2Summary1" ); - list( $this->revId3_2, $this->textId3_2 ) = $this->addRevision( $page, - "BackupDumperTestP3Text2", "BackupDumperTestP2Summary2" ); - $this->pageId3 = $page->getId(); - $page->doDeleteArticle( "Testing ;)" ); - - // Page from non-default namespace - - if ( $ns === NS_TALK ) { - // @todo work around this. - throw new MWException( "The default wikitext namespace is the talk namespace. " - . " We can't currently deal with that." ); - } - - $title = Title::newFromText( 'BackupDumperTestP1', NS_TALK ); - $page = WikiPage::factory( $title ); - list( $this->revId4_1, $this->textId4_1 ) = $this->addRevision( $page, - "Talk about BackupDumperTestP1 Text1", - "Talk BackupDumperTestP1 Summary1" ); - $this->pageId4 = $page->getId(); - } catch ( Exception $e ) { - // We'd love to pass $e directly. However, ... see - // documentation of exceptionFromAddDBData in - // DumpTestCase - $this->exceptionFromAddDBData = $e; - } - } - - protected function setUp() { - parent::setUp(); - - // Since we will restrict dumping by page ranges (to allow - // working tests, even if the db gets prepopulated by a base - // class), we have to assert, that the page id are consecutively - // increasing - $this->assertEquals( - array( $this->pageId2, $this->pageId3, $this->pageId4 ), - array( $this->pageId1 + 1, $this->pageId2 + 1, $this->pageId3 + 1 ), - "Page ids increasing without holes" ); - } - - function testPlain() { - // Setting up the dump - $nameStub = $this->setUpStub(); - $nameFull = $this->getNewTempFile(); - $dumper = new TextPassDumper( array( "--stub=file:" . $nameStub, - "--output=file:" . $nameFull ) ); - $dumper->reporting = false; - $dumper->setDb( $this->db ); - - // Performing the dump - $dumper->dump( WikiExporter::FULL, WikiExporter::TEXT ); - - // Checking for correctness of the dumped data - $this->assertDumpStart( $nameFull ); - - // Page 1 - $this->assertPageStart( $this->pageId1, NS_MAIN, "BackupDumperTestP1" ); - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, false, "0bolhl6ol7i6x0e7yq91gxgaan39j87", - "BackupDumperTestP1Text1" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, NS_MAIN, "BackupDumperTestP2" ); - $this->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1", - $this->textId2_1, false, "jprywrymfhysqllua29tj3sc7z39dl2", - "BackupDumperTestP2Text1" ); - $this->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2", - $this->textId2_2, false, "b7vj5ks32po5m1z1t1br4o7scdwwy95", - "BackupDumperTestP2Text2", $this->revId2_1 ); - $this->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3", - $this->textId2_3, false, "jfunqmh1ssfb8rs43r19w98k28gg56r", - "BackupDumperTestP2Text3", $this->revId2_2 ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, false, "6o1ciaxa6pybnqprmungwofc4lv00wv", - "BackupDumperTestP2Text4 some additional Text", $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - $this->assertPageStart( $this->pageId4, NS_TALK, "Talk:BackupDumperTestP1" ); - $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, false, "nktofwzd0tl192k3zfepmlzxoax1lpe", - "Talk about BackupDumperTestP1 Text1" ); - $this->assertPageEnd(); - - $this->assertDumpEnd(); - } - - function testPrefetchPlain() { - // The mapping between ids and text, for the hits of the prefetch mock - $prefetchMap = array( - array( $this->pageId1, $this->revId1_1, "Prefetch_________1Text1" ), - array( $this->pageId2, $this->revId2_3, "Prefetch_________2Text3" ) - ); - - // The mock itself - $prefetchMock = $this->getMock( 'BaseDump', array( 'prefetch' ), array(), '', false ); - $prefetchMock->expects( $this->exactly( 6 ) ) - ->method( 'prefetch' ) - ->will( $this->returnValueMap( $prefetchMap ) ); - - // Setting up of the dump - $nameStub = $this->setUpStub(); - $nameFull = $this->getNewTempFile(); - $dumper = new TextPassDumper( array( "--stub=file:" - . $nameStub, "--output=file:" . $nameFull ) ); - $dumper->prefetch = $prefetchMock; - $dumper->reporting = false; - $dumper->setDb( $this->db ); - - // Performing the dump - $dumper->dump( WikiExporter::FULL, WikiExporter::TEXT ); - - // Checking for correctness of the dumped data - $this->assertDumpStart( $nameFull ); - - // Page 1 - $this->assertPageStart( $this->pageId1, NS_MAIN, "BackupDumperTestP1" ); - // Prefetch kicks in. This is still the SHA-1 of the original text, - // But the actual text (with different SHA-1) comes from prefetch. - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, false, "0bolhl6ol7i6x0e7yq91gxgaan39j87", - "Prefetch_________1Text1" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, NS_MAIN, "BackupDumperTestP2" ); - $this->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1", - $this->textId2_1, false, "jprywrymfhysqllua29tj3sc7z39dl2", - "BackupDumperTestP2Text1" ); - $this->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2", - $this->textId2_2, false, "b7vj5ks32po5m1z1t1br4o7scdwwy95", - "BackupDumperTestP2Text2", $this->revId2_1 ); - // Prefetch kicks in. This is still the SHA-1 of the original text, - // But the actual text (with different SHA-1) comes from prefetch. - $this->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3", - $this->textId2_3, false, "jfunqmh1ssfb8rs43r19w98k28gg56r", - "Prefetch_________2Text3", $this->revId2_2 ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, false, "6o1ciaxa6pybnqprmungwofc4lv00wv", - "BackupDumperTestP2Text4 some additional Text", $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - $this->assertPageStart( $this->pageId4, NS_TALK, "Talk:BackupDumperTestP1" ); - $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, false, "nktofwzd0tl192k3zfepmlzxoax1lpe", - "Talk about BackupDumperTestP1 Text1" ); - $this->assertPageEnd(); - - $this->assertDumpEnd(); - } - - /** - * Ensures that checkpoint dumps are used and written, by successively increasing the - * stub size and dumping until the duration crosses a threshold. - * - * @param $checkpointFormat string: Either "file" for plain text or "gzip" for gzipped - * checkpoint files. - */ - private function checkpointHelper( $checkpointFormat = "file" ) { - // Getting temporary names - $nameStub = $this->getNewTempFile(); - $nameOutputDir = $this->getNewTempDirectory(); - - $stderr = fopen( 'php://output', 'a' ); - if ( $stderr === false ) { - $this->fail( "Could not open stream for stderr" ); - } - - $iterations = 32; // We'll start with that many iterations of revisions in stub - $lastDuration = 0; - $minDuration = 2; // We want the dump to take at least this many seconds - $checkpointAfter = 0.5; // Generate checkpoint after this many seconds - - // Until a dump takes at least $minDuration seconds, perform a dump and check - // duration. If the dump did not take long enough increase the iteration - // count, to generate a bigger stub file next time. - while ( $lastDuration < $minDuration ) { - - // Setting up the dump - wfRecursiveRemoveDir( $nameOutputDir ); - $this->assertTrue( wfMkdirParents( $nameOutputDir ), - "Creating temporary output directory " ); - $this->setUpStub( $nameStub, $iterations ); - $dumper = new TextPassDumper( array( "--stub=file:" . $nameStub, - "--output=" . $checkpointFormat . ":" . $nameOutputDir . "/full", - "--maxtime=1" /*This is in minutes. Fixup is below*/, - "--checkpointfile=checkpoint-%s-%s.xml.gz" ) ); - $dumper->setDb( $this->db ); - $dumper->maxTimeAllowed = $checkpointAfter; // Patching maxTime from 1 minute - $dumper->stderr = $stderr; - - // The actual dump and taking time - $ts_before = microtime( true ); - $dumper->dump( WikiExporter::FULL, WikiExporter::TEXT ); - $ts_after = microtime( true ); - $lastDuration = $ts_after - $ts_before; - - // Handling increasing the iteration count for the stubs - if ( $lastDuration < $minDuration ) { - $old_iterations = $iterations; - if ( $lastDuration > 0.2 ) { - // lastDuration is big enough, to allow an educated guess - $factor = ( $minDuration + 0.5 ) / $lastDuration; - if ( ( $factor > 1.1 ) && ( $factor < 100 ) ) { - // educated guess is reasonable - $iterations = (int)( $iterations * $factor ); - } - } - - if ( $old_iterations == $iterations ) { - // Heuristics were not applied, so we just *2. - $iterations *= 2; - } - - $this->assertLessThan( 50000, $iterations, - "Emergency stop against infinitely increasing iteration " - . "count ( last duration: $lastDuration )" ); - } - } - - // The dump (hopefully) did take long enough to produce more than one - // checkpoint file. - // - // We now check all the checkpoint files for validity. - - $files = scandir( $nameOutputDir ); - $this->assertTrue( asort( $files ), "Sorting files in temporary directory" ); - $fileOpened = false; - $lookingForPage = 1; - $checkpointFiles = 0; - - // Each run of the following loop body tries to handle exactly 1 /page/ (not - // iteration of stub content). $i is only increased after having treated page 4. - for ( $i = 0; $i < $iterations; ) { - - // 1. Assuring a file is opened and ready. Skipping across header if - // necessary. - if ( !$fileOpened ) { - $this->assertNotEmpty( $files, "No more existing dump files, " - . "but not yet all pages found" ); - $fname = array_shift( $files ); - while ( $fname == "." || $fname == ".." ) { - $this->assertNotEmpty( $files, "No more existing dump" - . " files, but not yet all pages found" ); - $fname = array_shift( $files ); - } - if ( $checkpointFormat == "gzip" ) { - $this->gunzip( $nameOutputDir . "/" . $fname ); - } - $this->assertDumpStart( $nameOutputDir . "/" . $fname ); - $fileOpened = true; - $checkpointFiles++; - } - - // 2. Performing a single page check - switch ( $lookingForPage ) { - case 1: - // Page 1 - $this->assertPageStart( $this->pageId1 + $i * self::$numOfPages, NS_MAIN, - "BackupDumperTestP1" ); - $this->assertRevision( $this->revId1_1 + $i * self::$numOfRevs, "BackupDumperTestP1Summary1", - $this->textId1_1, false, "0bolhl6ol7i6x0e7yq91gxgaan39j87", - "BackupDumperTestP1Text1" ); - $this->assertPageEnd(); - - $lookingForPage = 2; - break; - - case 2: - // Page 2 - $this->assertPageStart( $this->pageId2 + $i * self::$numOfPages, NS_MAIN, - "BackupDumperTestP2" ); - $this->assertRevision( $this->revId2_1 + $i * self::$numOfRevs, "BackupDumperTestP2Summary1", - $this->textId2_1, false, "jprywrymfhysqllua29tj3sc7z39dl2", - "BackupDumperTestP2Text1" ); - $this->assertRevision( $this->revId2_2 + $i * self::$numOfRevs, "BackupDumperTestP2Summary2", - $this->textId2_2, false, "b7vj5ks32po5m1z1t1br4o7scdwwy95", - "BackupDumperTestP2Text2", $this->revId2_1 + $i * self::$numOfRevs ); - $this->assertRevision( $this->revId2_3 + $i * self::$numOfRevs, "BackupDumperTestP2Summary3", - $this->textId2_3, false, "jfunqmh1ssfb8rs43r19w98k28gg56r", - "BackupDumperTestP2Text3", $this->revId2_2 + $i * self::$numOfRevs ); - $this->assertRevision( $this->revId2_4 + $i * self::$numOfRevs, - "BackupDumperTestP2Summary4 extra", - $this->textId2_4, false, "6o1ciaxa6pybnqprmungwofc4lv00wv", - "BackupDumperTestP2Text4 some additional Text", - $this->revId2_3 + $i * self::$numOfRevs ); - $this->assertPageEnd(); - - $lookingForPage = 4; - break; - - case 4: - // Page 4 - $this->assertPageStart( $this->pageId4 + $i * self::$numOfPages, NS_TALK, - "Talk:BackupDumperTestP1" ); - $this->assertRevision( $this->revId4_1 + $i * self::$numOfRevs, - "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, false, "nktofwzd0tl192k3zfepmlzxoax1lpe", - "Talk about BackupDumperTestP1 Text1" ); - $this->assertPageEnd(); - - $lookingForPage = 1; - - // We dealt with the whole iteration. - $i++; - break; - - default: - $this->fail( "Bad setting for lookingForPage ($lookingForPage)" ); - } - - // 3. Checking for the end of the current checkpoint file - if ( $this->xml->nodeType == XMLReader::END_ELEMENT - && $this->xml->name == "mediawiki" - ) { - $this->assertDumpEnd(); - $fileOpened = false; - } - } - - // Assuring we completely read all files ... - $this->assertFalse( $fileOpened, "Currently read file still open?" ); - $this->assertEmpty( $files, "Remaining unchecked files" ); - - // ... and have dealt with more than one checkpoint file - $this->assertGreaterThan( 1, $checkpointFiles, "expected more than 1 checkpoint to have been created. Checkpoint interval is $checkpointAfter seconds, maybe your computer is too fast?" ); - - $this->expectETAOutput(); - } - - /** - * @group large - */ - function testCheckpointPlain() { - $this->checkpointHelper(); - } - - /** - * tests for working checkpoint generation in gzip format work. - * - * We keep this test in addition to the simpler self::testCheckpointPlain, as there - * were once problems when the used sinks were DumpPipeOutputs. - * - * xmldumps-backup typically uses bzip2 instead of gzip. However, as bzip2 requires - * PHP extensions, we go for gzip instead, which triggers the same relevant code - * paths while still being testable on more systems. - * - * @group large - */ - function testCheckpointGzip() { - $this->checkHasGzip(); - $this->checkpointHelper( "gzip" ); - } - - - /** - * Creates a stub file that is used for testing the text pass of dumps - * - * @param $fname string: (Optional) Absolute name of the file to write - * the stub into. If this parameter is null, a new temporary - * file is generated that is automatically removed upon - * tearDown. - * @param $iterations integer: (Optional) specifies how often the block - * of 3 pages should go into the stub file. The page and - * revision id increase further and further, while the text - * id of the first iteration is reused. The pages and revision - * of iteration > 1 have no corresponding representation in the - * database. - * @return string absolute filename of the stub - */ - private function setUpStub( $fname = null, $iterations = 1 ) { - if ( $fname === null ) { - $fname = $this->getNewTempFile(); - } - $header = ' - - wikisvn - http://localhost/wiki-svn/index.php/Main_Page - MediaWiki 1.21alpha - first-letter - - Media - Special - - Talk - User - User talk - Wikisvn - Wikisvn talk - File - File talk - MediaWiki - MediaWiki talk - Template - Template talk - Help - Help talk - Category - Category talk - - -'; - $tail = ' -'; - - $content = $header; - $iterations = intval( $iterations ); - for ( $i = 0; $i < $iterations; $i++ ) { - - $page1 = ' - BackupDumperTestP1 - 0 - ' . ( $this->pageId1 + $i * self::$numOfPages ) . ' - - ' . ( $this->revId1_1 + $i * self::$numOfRevs ) . ' - 2012-04-01T16:46:05Z - - 127.0.0.1 - - BackupDumperTestP1Summary1 - 0bolhl6ol7i6x0e7yq91gxgaan39j87 - wikitext - text/x-wiki - - - -'; - $page2 = ' - BackupDumperTestP2 - 0 - ' . ( $this->pageId2 + $i * self::$numOfPages ) . ' - - ' . ( $this->revId2_1 + $i * self::$numOfRevs ) . ' - 2012-04-01T16:46:05Z - - 127.0.0.1 - - BackupDumperTestP2Summary1 - jprywrymfhysqllua29tj3sc7z39dl2 - wikitext - text/x-wiki - - - - ' . ( $this->revId2_2 + $i * self::$numOfRevs ) . ' - ' . ( $this->revId2_1 + $i * self::$numOfRevs ) . ' - 2012-04-01T16:46:05Z - - 127.0.0.1 - - BackupDumperTestP2Summary2 - b7vj5ks32po5m1z1t1br4o7scdwwy95 - wikitext - text/x-wiki - - - - ' . ( $this->revId2_3 + $i * self::$numOfRevs ) . ' - ' . ( $this->revId2_2 + $i * self::$numOfRevs ) . ' - 2012-04-01T16:46:05Z - - 127.0.0.1 - - BackupDumperTestP2Summary3 - jfunqmh1ssfb8rs43r19w98k28gg56r - wikitext - text/x-wiki - - - - ' . ( $this->revId2_4 + $i * self::$numOfRevs ) . ' - ' . ( $this->revId2_3 + $i * self::$numOfRevs ) . ' - 2012-04-01T16:46:05Z - - 127.0.0.1 - - BackupDumperTestP2Summary4 extra - 6o1ciaxa6pybnqprmungwofc4lv00wv - wikitext - text/x-wiki - - - -'; - // page 3 not in stub - - $page4 = ' - Talk:BackupDumperTestP1 - 1 - ' . ( $this->pageId4 + $i * self::$numOfPages ) . ' - - ' . ( $this->revId4_1 + $i * self::$numOfRevs ) . ' - 2012-04-01T16:46:05Z - - 127.0.0.1 - - Talk BackupDumperTestP1 Summary1 - nktofwzd0tl192k3zfepmlzxoax1lpe - wikitext - text/x-wiki - - - -'; - $content .= $page1 . $page2 . $page4; - } - $content .= $tail; - $this->assertEquals( strlen( $content ), file_put_contents( - $fname, $content ), "Length of prepared stub" ); - - return $fname; - } -} diff --git a/tests/phpunit/maintenance/backup_LogTest.php b/tests/phpunit/maintenance/backup_LogTest.php deleted file mode 100644 index 98d81653..00000000 --- a/tests/phpunit/maintenance/backup_LogTest.php +++ /dev/null @@ -1,228 +0,0 @@ -setPerformer( $user ); - $logEntry->setTarget( Title::newFromText( $title, $ns ) ); - if ( $comment !== null ) { - $logEntry->setComment( $comment ); - } - if ( $parameters !== null ) { - $logEntry->setParameters( $parameters ); - } - - return $logEntry->insert(); - } - - function addDBData() { - $this->tablesUsed[] = 'logging'; - $this->tablesUsed[] = 'user'; - - try { - $user1 = User::newFromName( 'BackupDumperLogUserA' ); - $this->userId1 = $user1->getId(); - if ( $this->userId1 === 0 ) { - $user1->addToDatabase(); - $this->userId1 = $user1->getId(); - } - $this->assertGreaterThan( 0, $this->userId1 ); - - $user2 = User::newFromName( 'BackupDumperLogUserB' ); - $this->userId2 = $user2->getId(); - if ( $this->userId2 === 0 ) { - $user2->addToDatabase(); - $this->userId2 = $user2->getId(); - } - $this->assertGreaterThan( 0, $this->userId2 ); - - $this->logId1 = $this->addLogEntry( 'type', 'subtype', - $user1, NS_MAIN, "PageA" ); - $this->assertGreaterThan( 0, $this->logId1 ); - - $this->logId2 = $this->addLogEntry( 'supress', 'delete', - $user2, NS_TALK, "PageB", "SomeComment" ); - $this->assertGreaterThan( 0, $this->logId2 ); - - $this->logId3 = $this->addLogEntry( 'move', 'delete', - $user2, NS_MAIN, "PageA", "SomeOtherComment", - array( 'key1' => 1, 3 => 'value3' ) ); - $this->assertGreaterThan( 0, $this->logId3 ); - } catch ( Exception $e ) { - // We'd love to pass $e directly. However, ... see - // documentation of exceptionFromAddDBData in - // DumpTestCase - $this->exceptionFromAddDBData = $e; - } - } - - - /** - * asserts that the xml reader is at the beginning of a log entry and skips over - * it while analyzing it. - * - * @param $id int: id of the log entry - * @param $user_name string: user name of the log entry's performer - * @param $user_id int: user id of the log entry 's performer - * @param $comment string|null: comment of the log entry. If null, the comment - * text is ignored. - * @param $type string: type of the log entry - * @param $subtype string: subtype of the log entry - * @param $title string: title of the log entry's target - * @param $parameters array: (optional) unserialized data accompanying the log entry - */ - private function assertLogItem( $id, $user_name, $user_id, $comment, $type, - $subtype, $title, $parameters = array() - ) { - - $this->assertNodeStart( "logitem" ); - $this->skipWhitespace(); - - $this->assertTextNode( "id", $id ); - $this->assertTextNode( "timestamp", false ); - - $this->assertNodeStart( "contributor" ); - $this->skipWhitespace(); - $this->assertTextNode( "username", $user_name ); - $this->assertTextNode( "id", $user_id ); - $this->assertNodeEnd( "contributor" ); - $this->skipWhitespace(); - - if ( $comment !== null ) { - $this->assertTextNode( "comment", $comment ); - } - $this->assertTextNode( "type", $type ); - $this->assertTextNode( "action", $subtype ); - $this->assertTextNode( "logtitle", $title ); - - $this->assertNodeStart( "params" ); - $parameters_xml = unserialize( $this->xml->value ); - $this->assertEquals( $parameters, $parameters_xml ); - $this->assertTrue( $this->xml->read(), "Skipping past processed text of params" ); - $this->assertNodeEnd( "params" ); - $this->skipWhitespace(); - - $this->assertNodeEnd( "logitem" ); - $this->skipWhitespace(); - } - - function testPlain() { - global $wgContLang; - - // Preparing the dump - $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array( "--output=file:" . $fname ) ); - $dumper->startId = $this->logId1; - $dumper->endId = $this->logId3 + 1; - $dumper->reporting = false; - $dumper->setDb( $this->db ); - - // Performing the dump - $dumper->dump( WikiExporter::LOGS, WikiExporter::TEXT ); - - // Analyzing the dumped data - $this->assertDumpStart( $fname ); - - $this->assertLogItem( $this->logId1, "BackupDumperLogUserA", - $this->userId1, null, "type", "subtype", "PageA" ); - - $this->assertNotNull( $wgContLang, "Content language object validation" ); - $namespace = $wgContLang->getNsText( NS_TALK ); - $this->assertInternalType( 'string', $namespace ); - $this->assertGreaterThan( 0, strlen( $namespace ) ); - $this->assertLogItem( $this->logId2, "BackupDumperLogUserB", - $this->userId2, "SomeComment", "supress", "delete", - $namespace . ":PageB" ); - - $this->assertLogItem( $this->logId3, "BackupDumperLogUserB", - $this->userId2, "SomeOtherComment", "move", "delete", - "PageA", array( 'key1' => 1, 3 => 'value3' ) ); - - $this->assertDumpEnd(); - } - - function testXmlDumpsBackupUseCaseLogging() { - global $wgContLang; - - $this->checkHasGzip(); - - // Preparing the dump - $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array( "--output=gzip:" . $fname, - "--reporting=2" ) ); - $dumper->startId = $this->logId1; - $dumper->endId = $this->logId3 + 1; - $dumper->setDb( $this->db ); - - // xmldumps-backup demands reporting, although this is currently not - // implemented in BackupDumper, when dumping logging data. We - // nevertheless capture the output of the dump process already now, - // to be able to alert (once dumping produces reports) that this test - // needs updates. - $dumper->stderr = fopen( 'php://output', 'a' ); - if ( $dumper->stderr === false ) { - $this->fail( "Could not open stream for stderr" ); - } - - // Performing the dump - $dumper->dump( WikiExporter::LOGS, WikiExporter::TEXT ); - - $this->assertTrue( fclose( $dumper->stderr ), "Closing stderr handle" ); - - // Analyzing the dumped data - $this->gunzip( $fname ); - - $this->assertDumpStart( $fname ); - - $this->assertLogItem( $this->logId1, "BackupDumperLogUserA", - $this->userId1, null, "type", "subtype", "PageA" ); - - $this->assertNotNull( $wgContLang, "Content language object validation" ); - $namespace = $wgContLang->getNsText( NS_TALK ); - $this->assertInternalType( 'string', $namespace ); - $this->assertGreaterThan( 0, strlen( $namespace ) ); - $this->assertLogItem( $this->logId2, "BackupDumperLogUserB", - $this->userId2, "SomeComment", "supress", "delete", - $namespace . ":PageB" ); - - $this->assertLogItem( $this->logId3, "BackupDumperLogUserB", - $this->userId2, "SomeOtherComment", "move", "delete", - "PageA", array( 'key1' => 1, 3 => 'value3' ) ); - - $this->assertDumpEnd(); - - // Currently, no reporting is implemented. Alert via failure, once - // this changes. - // If reporting for log dumps has been implemented, please update - // the following statement to catch good output - $this->expectOutputString( '' ); - } -} diff --git a/tests/phpunit/maintenance/backup_PageTest.php b/tests/phpunit/maintenance/backup_PageTest.php deleted file mode 100644 index 99bd2700..00000000 --- a/tests/phpunit/maintenance/backup_PageTest.php +++ /dev/null @@ -1,404 +0,0 @@ -setMwGlobals( array( - 'wgLanguageCode' => 'en', - 'wgContLang' => Language::factory( 'en' ), - ) ); - - $this->tablesUsed[] = 'page'; - $this->tablesUsed[] = 'revision'; - $this->tablesUsed[] = 'text'; - - try { - $this->namespace = $this->getDefaultWikitextNS(); - $this->talk_namespace = NS_TALK; - - if ( $this->namespace === $this->talk_namespace ) { - // @todo work around this. - throw new MWException( "The default wikitext namespace is the talk namespace. " - . " We can't currently deal with that." ); - } - - $this->pageTitle1 = Title::newFromText( 'BackupDumperTestP1', $this->namespace ); - $page = WikiPage::factory( $this->pageTitle1 ); - list( $this->revId1_1, $this->textId1_1 ) = $this->addRevision( $page, - "BackupDumperTestP1Text1", "BackupDumperTestP1Summary1" ); - $this->pageId1 = $page->getId(); - - $this->pageTitle2 = Title::newFromText( 'BackupDumperTestP2', $this->namespace ); - $page = WikiPage::factory( $this->pageTitle2 ); - list( $this->revId2_1, $this->textId2_1 ) = $this->addRevision( $page, - "BackupDumperTestP2Text1", "BackupDumperTestP2Summary1" ); - list( $this->revId2_2, $this->textId2_2 ) = $this->addRevision( $page, - "BackupDumperTestP2Text2", "BackupDumperTestP2Summary2" ); - list( $this->revId2_3, $this->textId2_3 ) = $this->addRevision( $page, - "BackupDumperTestP2Text3", "BackupDumperTestP2Summary3" ); - list( $this->revId2_4, $this->textId2_4 ) = $this->addRevision( $page, - "BackupDumperTestP2Text4 some additional Text ", - "BackupDumperTestP2Summary4 extra " ); - $this->pageId2 = $page->getId(); - - $this->pageTitle3 = Title::newFromText( 'BackupDumperTestP3', $this->namespace ); - $page = WikiPage::factory( $this->pageTitle3 ); - list( $this->revId3_1, $this->textId3_1 ) = $this->addRevision( $page, - "BackupDumperTestP3Text1", "BackupDumperTestP2Summary1" ); - list( $this->revId3_2, $this->textId3_2 ) = $this->addRevision( $page, - "BackupDumperTestP3Text2", "BackupDumperTestP2Summary2" ); - $this->pageId3 = $page->getId(); - $page->doDeleteArticle( "Testing ;)" ); - - $this->pageTitle4 = Title::newFromText( 'BackupDumperTestP1', $this->talk_namespace ); - $page = WikiPage::factory( $this->pageTitle4 ); - list( $this->revId4_1, $this->textId4_1 ) = $this->addRevision( $page, - "Talk about BackupDumperTestP1 Text1", - "Talk BackupDumperTestP1 Summary1" ); - $this->pageId4 = $page->getId(); - } catch ( Exception $e ) { - // We'd love to pass $e directly. However, ... see - // documentation of exceptionFromAddDBData in - // DumpTestCase - $this->exceptionFromAddDBData = $e; - } - } - - protected function setUp() { - parent::setUp(); - - // Since we will restrict dumping by page ranges (to allow - // working tests, even if the db gets prepopulated by a base - // class), we have to assert, that the page id are consecutively - // increasing - $this->assertEquals( - array( $this->pageId2, $this->pageId3, $this->pageId4 ), - array( $this->pageId1 + 1, $this->pageId2 + 1, $this->pageId3 + 1 ), - "Page ids increasing without holes" ); - } - - function testFullTextPlain() { - // Preparing the dump - $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array( "--output=file:" . $fname ) ); - $dumper->startId = $this->pageId1; - $dumper->endId = $this->pageId4 + 1; - $dumper->reporting = false; - $dumper->setDb( $this->db ); - - // Performing the dump - $dumper->dump( WikiExporter::FULL, WikiExporter::TEXT ); - - // Checking the dumped data - $this->assertDumpStart( $fname ); - - // Page 1 - $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() ); - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87", - "BackupDumperTestP1Text1" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() ); - $this->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1", - $this->textId2_1, 23, "jprywrymfhysqllua29tj3sc7z39dl2", - "BackupDumperTestP2Text1" ); - $this->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2", - $this->textId2_2, 23, "b7vj5ks32po5m1z1t1br4o7scdwwy95", - "BackupDumperTestP2Text2", $this->revId2_1 ); - $this->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3", - $this->textId2_3, 23, "jfunqmh1ssfb8rs43r19w98k28gg56r", - "BackupDumperTestP2Text3", $this->revId2_2 ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", - "BackupDumperTestP2Text4 some additional Text", $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - $this->assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() ); - $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe", - "Talk about BackupDumperTestP1 Text1" ); - $this->assertPageEnd(); - - $this->assertDumpEnd(); - } - - function testFullStubPlain() { - // Preparing the dump - $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array( "--output=file:" . $fname ) ); - $dumper->startId = $this->pageId1; - $dumper->endId = $this->pageId4 + 1; - $dumper->reporting = false; - $dumper->setDb( $this->db ); - - // Performing the dump - $dumper->dump( WikiExporter::FULL, WikiExporter::STUB ); - - // Checking the dumped data - $this->assertDumpStart( $fname ); - - // Page 1 - $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() ); - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() ); - $this->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1", - $this->textId2_1, 23, "jprywrymfhysqllua29tj3sc7z39dl2" ); - $this->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2", - $this->textId2_2, 23, "b7vj5ks32po5m1z1t1br4o7scdwwy95", false, $this->revId2_1 ); - $this->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3", - $this->textId2_3, 23, "jfunqmh1ssfb8rs43r19w98k28gg56r", false, $this->revId2_2 ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - $this->assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() ); - $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe" ); - $this->assertPageEnd(); - - $this->assertDumpEnd(); - } - - function testCurrentStubPlain() { - // Preparing the dump - $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array( "--output=file:" . $fname ) ); - $dumper->startId = $this->pageId1; - $dumper->endId = $this->pageId4 + 1; - $dumper->reporting = false; - $dumper->setDb( $this->db ); - - // Performing the dump - $dumper->dump( WikiExporter::CURRENT, WikiExporter::STUB ); - - // Checking the dumped data - $this->assertDumpStart( $fname ); - - // Page 1 - $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() ); - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - $this->assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() ); - $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe" ); - $this->assertPageEnd(); - - $this->assertDumpEnd(); - } - - function testCurrentStubGzip() { - $this->checkHasGzip(); - - // Preparing the dump - $fname = $this->getNewTempFile(); - $dumper = new BackupDumper( array( "--output=gzip:" . $fname ) ); - $dumper->startId = $this->pageId1; - $dumper->endId = $this->pageId4 + 1; - $dumper->reporting = false; - $dumper->setDb( $this->db ); - - // Performing the dump - $dumper->dump( WikiExporter::CURRENT, WikiExporter::STUB ); - - // Checking the dumped data - $this->gunzip( $fname ); - $this->assertDumpStart( $fname ); - - // Page 1 - $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() ); - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - $this->assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() ); - $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe" ); - $this->assertPageEnd(); - - $this->assertDumpEnd(); - } - - - function testXmlDumpsBackupUseCase() { - // xmldumps-backup typically performs a single dump that that writes - // out three files - // * gzipped stubs of everything (meta-history) - // * gzipped stubs of latest revisions of all pages (meta-current) - // * gzipped stubs of latest revisions of all pages of namespage 0 - // (articles) - // - // We reproduce such a setup with our mini fixture, although we omit - // chunks, and all the other gimmicks of xmldumps-backup. - // - $this->checkHasGzip(); - - $fnameMetaHistory = $this->getNewTempFile(); - $fnameMetaCurrent = $this->getNewTempFile(); - $fnameArticles = $this->getNewTempFile(); - - $dumper = new BackupDumper( array( "--output=gzip:" . $fnameMetaHistory, - "--output=gzip:" . $fnameMetaCurrent, "--filter=latest", - "--output=gzip:" . $fnameArticles, "--filter=latest", - "--filter=notalk", "--filter=namespace:!NS_USER", - "--reporting=1000" ) ); - $dumper->startId = $this->pageId1; - $dumper->endId = $this->pageId4 + 1; - $dumper->setDb( $this->db ); - - // xmldumps-backup uses reporting. We will not check the exact reported - // message, as they are dependent on the processing power of the used - // computer. We only check that reporting does not crash the dumping - // and that something is reported - $dumper->stderr = fopen( 'php://output', 'a' ); - if ( $dumper->stderr === false ) { - $this->fail( "Could not open stream for stderr" ); - } - - // Performing the dump - $dumper->dump( WikiExporter::FULL, WikiExporter::STUB ); - - $this->assertTrue( fclose( $dumper->stderr ), "Closing stderr handle" ); - - // Checking meta-history ------------------------------------------------- - - $this->gunzip( $fnameMetaHistory ); - $this->assertDumpStart( $fnameMetaHistory ); - - // Page 1 - $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() ); - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() ); - $this->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1", - $this->textId2_1, 23, "jprywrymfhysqllua29tj3sc7z39dl2" ); - $this->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2", - $this->textId2_2, 23, "b7vj5ks32po5m1z1t1br4o7scdwwy95", false, $this->revId2_1 ); - $this->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3", - $this->textId2_3, 23, "jfunqmh1ssfb8rs43r19w98k28gg56r", false, $this->revId2_2 ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - $this->assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() ); - $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe" ); - $this->assertPageEnd(); - - $this->assertDumpEnd(); - - // Checking meta-current ------------------------------------------------- - - $this->gunzip( $fnameMetaCurrent ); - $this->assertDumpStart( $fnameMetaCurrent ); - - // Page 1 - $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() ); - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - $this->assertPageStart( $this->pageId4, $this->talk_namespace, $this->pageTitle4->getPrefixedText() ); - $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1", - $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe" ); - $this->assertPageEnd(); - - $this->assertDumpEnd(); - - // Checking articles ------------------------------------------------- - - $this->gunzip( $fnameArticles ); - $this->assertDumpStart( $fnameArticles ); - - // Page 1 - $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() ); - $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1", - $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" ); - $this->assertPageEnd(); - - // Page 2 - $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() ); - $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", - $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 ); - $this->assertPageEnd(); - - // Page 3 - // -> Page is marked deleted. Hence not visible - - // Page 4 - // -> Page is not in $this->namespace. Hence not visible - - $this->assertDumpEnd(); - - $this->expectETAOutput(); - } -} diff --git a/tests/phpunit/maintenance/fetchTextTest.php b/tests/phpunit/maintenance/fetchTextTest.php deleted file mode 100644 index e8df199e..00000000 --- a/tests/phpunit/maintenance/fetchTextTest.php +++ /dev/null @@ -1,238 +0,0 @@ - 0 ); - - - /** - * Data for the fake stdin - * - * @param $stdin String The string to be used instead of stdin - */ - function mockStdin( $stdin ) { - $this->mockStdinText = $stdin; - $this->mockSetUp = true; - } - - /** - * Gets invocation counters for mocked methods. - * - * @return Array An array, whose keys are function names. The corresponding values - * denote the number of times the function has been invoked. - */ - function mockGetInvocations() { - return $this->mockInvocations; - } - - // ----------------------------------------------------------------- - // Mocked functions from FetchText follow. - - function getStdin( $len = null ) { - $this->mockInvocations['getStdin']++; - if ( $len !== null ) { - throw new PHPUnit_Framework_ExpectationFailedException( - "Tried to get stdin with non null parameter" ); - } - - if ( !$this->mockSetUp ) { - throw new PHPUnit_Framework_ExpectationFailedException( - "Tried to get stdin before setting up rerouting" ); - } - - return fopen( 'data://text/plain,' . $this->mockStdinText, 'r' ); - } -} - -/** - * TestCase for FetchText - * - * @group Database - * @group Dump - */ -class FetchTextTest extends MediaWikiTestCase { - - // We add 5 Revisions for this test. Their corresponding text id's - // are stored in the following 5 variables. - private $textId1; - private $textId2; - private $textId3; - private $textId4; - private $textId5; - - - /** - * @var Exception|null As the current MediaWikiTestCase::run is not - * robust enough to recover from thrown exceptions directly, we cannot - * throw frow within addDBData, although it would be appropriate. Hence, - * we catch the exception and store it until we are in setUp and may - * finally rethrow the exception without crashing the test suite. - */ - private $exceptionFromAddDBData; - - /** - * @var FetchText the (mocked) FetchText that is to test - */ - private $fetchText; - - /** - * Adds a revision to a page, while returning the resuting text's id - * - * @param $page WikiPage The page to add the revision to - * @param $text String The revisions text - * @param $text String The revisions summare - * - * @throws MWExcepion - */ - private function addRevision( $page, $text, $summary ) { - $status = $page->doEditContent( ContentHandler::makeContent( $text, $page->getTitle() ), $summary ); - if ( $status->isGood() ) { - $value = $status->getValue(); - $revision = $value['revision']; - $id = $revision->getTextId(); - if ( $id > 0 ) { - return $id; - } - } - throw new MWException( "Could not determine text id" ); - } - - - function addDBData() { - $this->tablesUsed[] = 'page'; - $this->tablesUsed[] = 'revision'; - $this->tablesUsed[] = 'text'; - - $wikitextNamespace = $this->getDefaultWikitextNS(); - - try { - $title = Title::newFromText( 'FetchTextTestPage1', $wikitextNamespace ); - $page = WikiPage::factory( $title ); - $this->textId1 = $this->addRevision( $page, "FetchTextTestPage1Text1", "FetchTextTestPage1Summary1" ); - - $title = Title::newFromText( 'FetchTextTestPage2', $wikitextNamespace ); - $page = WikiPage::factory( $title ); - $this->textId2 = $this->addRevision( $page, "FetchTextTestPage2Text1", "FetchTextTestPage2Summary1" ); - $this->textId3 = $this->addRevision( $page, "FetchTextTestPage2Text2", "FetchTextTestPage2Summary2" ); - $this->textId4 = $this->addRevision( $page, "FetchTextTestPage2Text3", "FetchTextTestPage2Summary3" ); - $this->textId5 = $this->addRevision( $page, "FetchTextTestPage2Text4 some additional Text ", "FetchTextTestPage2Summary4 extra " ); - } catch ( Exception $e ) { - // We'd love to pass $e directly. However, ... see - // documentation of exceptionFromAddDBData - $this->exceptionFromAddDBData = $e; - } - } - - - protected function setUp() { - parent::setUp(); - - // Check if any Exception is stored for rethrowing from addDBData - if ( $this->exceptionFromAddDBData !== null ) { - throw $this->exceptionFromAddDBData; - } - - $this->fetchText = new SemiMockedFetchText(); - } - - - /** - * Helper to relate FetchText's input and output - */ - private function assertFilter( $input, $expectedOutput ) { - $this->fetchText->mockStdin( $input ); - $this->fetchText->execute(); - $invocations = $this->fetchText->mockGetInvocations(); - $this->assertEquals( 1, $invocations['getStdin'], - "getStdin invocation counter" ); - $this->expectOutputString( $expectedOutput ); - } - - - // Instead of the following functions, a data provider would be great. - // However, as data providers are evaluated /before/ addDBData, a data - // provider would not know the required ids. - - function testExistingSimple() { - $this->assertFilter( $this->textId2, - $this->textId2 . "\n23\nFetchTextTestPage2Text1" ); - } - - function testExistingSimpleWithNewline() { - $this->assertFilter( $this->textId2 . "\n", - $this->textId2 . "\n23\nFetchTextTestPage2Text1" ); - } - - function testExistingSeveral() { - $this->assertFilter( "$this->textId1\n$this->textId5\n" - . "$this->textId3\n$this->textId3", - implode( "", array( - $this->textId1 . "\n23\nFetchTextTestPage1Text1", - $this->textId5 . "\n44\nFetchTextTestPage2Text4 " - . "some additional Text", - $this->textId3 . "\n23\nFetchTextTestPage2Text2", - $this->textId3 . "\n23\nFetchTextTestPage2Text2" - ) ) ); - } - - function testEmpty() { - $this->assertFilter( "", null ); - } - - function testNonExisting() { - $this->assertFilter( $this->textId5 + 10, ( $this->textId5 + 10 ) . "\n-1\n" ); - } - - function testNegativeInteger() { - $this->assertFilter( "-42", "-42\n-1\n" ); - } - - function testFloatingPointNumberExisting() { - // float -> int -> revision - $this->assertFilter( $this->textId3 + 0.14159, - $this->textId3 . "\n23\nFetchTextTestPage2Text2" ); - } - - function testFloatingPointNumberNonExisting() { - $this->assertFilter( $this->textId5 + 3.14159, - ( $this->textId5 + 3 ) . "\n-1\n" ); - } - - function testCharacters() { - $this->assertFilter( "abc", "0\n-1\n" ); - } - - function testMix() { - $this->assertFilter( "ab\n" . $this->textId4 . ".5cd\n\nefg\n" . $this->textId2 - . "\n" . $this->textId3, - implode( "", array( - "0\n-1\n", - $this->textId4 . "\n23\nFetchTextTestPage2Text3", - "0\n-1\n", - "0\n-1\n", - $this->textId2 . "\n23\nFetchTextTestPage2Text1", - $this->textId3 . "\n23\nFetchTextTestPage2Text2" - ) ) ); - } -} diff --git a/tests/phpunit/maintenance/getSlaveServerTest.php b/tests/phpunit/maintenance/getSlaveServerTest.php deleted file mode 100644 index 2c848862..00000000 --- a/tests/phpunit/maintenance/getSlaveServerTest.php +++ /dev/null @@ -1,67 +0,0 @@ -db->getType() === 'sqlite' ) { - // for SQLite, only the empty string is a good server name - return ''; - } - - $octet = '([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])'; - $ip = "(($octet\.){3}$octet)"; - - $label = '([a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)'; - $hostname = "($label(\.$label)*)"; - - return "($ip|$hostname)(:[0-9]{1,5})?"; - } - - function testPlain() { - $gss = new GetSlaveServer(); - $gss->execute(); - - $this->expectOutputRegex( "/^" . self::getServerRE() . "\n$/D" ); - } - - function testXmlDumpsBackupUseCase() { - global $wgDBprefix; - - global $argv; - $argv = array( null, "--globals" ); - - $gss = new GetSlaveServer(); - $gss->loadParamsAndArgs(); - $gss->execute(); - $gss->globals(); - - // The main answer - $output = $this->getActualOutput(); - $firstLineEndPos = strpos( $output, "\n" ); - if ( $firstLineEndPos === false ) { - $this->fail( "Could not find end of first line of output" ); - } - $firstLine = substr( $output, 0, $firstLineEndPos ); - $this->assertRegExp( "/^" . self::getServerRE() . "$/D", - $firstLine, "DB Server" ); - - // xmldumps-backup relies on the wgDBprefix in the output. - $this->expectOutputRegex( "/^[[:space:]]*\[wgDBprefix\][[:space:]]*=> " - . $wgDBprefix . "$/m" ); - } -} diff --git a/tests/phpunit/mocks/filebackend/MockFSFile.php b/tests/phpunit/mocks/filebackend/MockFSFile.php deleted file mode 100644 index e0463281..00000000 --- a/tests/phpunit/mocks/filebackend/MockFSFile.php +++ /dev/null @@ -1,69 +0,0 @@ - $this->exists(), - 'size' => $this->getSize(), - 'file-mime' => $this->getMimeType(), - 'sha1' => $this->getSha1Base36(), - ); - } - - public function getSha1Base36( $recache = false ) { - return '1234567890123456789012345678901'; - } -} diff --git a/tests/phpunit/mocks/filebackend/MockFileBackend.php b/tests/phpunit/mocks/filebackend/MockFileBackend.php deleted file mode 100644 index 49aefbd1..00000000 --- a/tests/phpunit/mocks/filebackend/MockFileBackend.php +++ /dev/null @@ -1,122 +0,0 @@ - - */ - -/** - * Class simulating a backend store. - * - * @ingroup FileBackend - * @since 1.22 - */ -class MockFileBackend extends FileBackendStore { - - protected $mocked = array(); - - /** Poor man debugging */ - protected function debug( $msg = '' ) { - wfDebug( wfGetCaller() . "$msg\n" ); - } - - public function isPathUsableInternal( $storagePath ) { - return true; - } - - protected function doCreateInternal( array $params ) { - if ( isset( $params['content'] ) ) { - $content = $params['content']; - } else { - $content = 'Default mocked file content'; - } - $this->debug( serialize( $params ) ); - $dst = $params['dst']; - $this->mocked[$dst] = $content; - return Status::newGood(); - } - - protected function doStoreInternal( array $params ) { - $this->debug( serialize( $params ) ); - return $this->doCreateInternal( $params ); - } - - protected function doCopyInternal( array $params ) { - $this->debug( serialize( $params ) ); - $src = $params['src']; - $dst = $params['dst']; - $this->mocked[$dst] = $this->mocked[$src]; - return Status::newGood(); - } - - protected function doDeleteInternal( array $params ) { - $this->debug( serialize( $params ) ); - $src = $params['src']; - unset( $this->mocked[$src] ); - return Status::newGood(); - } - - protected function doGetFileStat( array $params ) { - $src = $params['src']; - if ( array_key_exists( $src, $this->mocked ) ) { - $this->debug( "('$src') found" ); - return array( - 'mtime' => wfTimestamp( TS_MW ), - 'size' => strlen( $this->mocked[$src] ), - # No sha1, stat does not need it. - ); - } else { - $this->debug( "('$src') not found" ); - return false; - } - } - - protected function doGetLocalCopyMulti( array $params ) { - $tmpFiles = array(); // (path => MockFSFile) - - $this->debug( '(' . serialize( $params ) . ')' ); - foreach ( $params['srcs'] as $src ) { - $tmpFiles[$src] = new MockFSFile( - wfTempDir() . '/' . wfRandomString( 32 ) - ); - } - return $tmpFiles; - } - - protected function doDirectoryExists( $container, $dir, array $params ) { - $this->debug(); - return true; - } - - public function getDirectoryListInternal( $container, $dir, array $params ) { - $this->debug(); - return array(); - } - - public function getFileListInternal( $container, $dir, array $params ) { - $this->debug(); - return array(); - } - - protected function directoriesAreVirtual() { - $this->debug(); - return true; - } -} diff --git a/tests/phpunit/mocks/media/MockBitmapHandler.php b/tests/phpunit/mocks/media/MockBitmapHandler.php deleted file mode 100644 index 742b41e4..00000000 --- a/tests/phpunit/mocks/media/MockBitmapHandler.php +++ /dev/null @@ -1,92 +0,0 @@ -getClientScalingThumbnailImage( $image, $scalerParams ); - } -} -class MockSvgHandler extends SvgHandler { - function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) { - return MockImageHandler::doFakeTransform( $this, $image, $dstPath, $dstUrl, $params, $flags ); - } -} -/** - * Mock handler for images. - * - * This is really intended for unit testing. - * - * @ingroup Media - */ -class MockImageHandler { - - /** - * Override BitmapHandler::doTransform() making sure we do not generate - * a thumbnail at all. That is merely returning a ThumbnailImage that - * will be consumed by the unit test. There is no need to create a real - * thumbnail on the filesystem. - */ - static function doFakeTransform( $that, $image, $dstPath, $dstUrl, $params, $flags = 0 ) { - # Example of what we receive: - # $image: LocalFile - # $dstPath: /tmp/transform_7d0a7a2f1a09-1.jpg - # $dstUrl : http://example.com/images/thumb/0/09/Bad.jpg/320px-Bad.jpg - # $params: width: 320, descriptionUrl http://trunk.dev/wiki/File:Bad.jpg - - $that->normaliseParams( $image, $params ); - - $scalerParams = array( - # The size to which the image will be resized - 'physicalWidth' => $params['physicalWidth'], - 'physicalHeight' => $params['physicalHeight'], - 'physicalDimensions' => "{$params['physicalWidth']}x{$params['physicalHeight']}", - # The size of the image on the page - 'clientWidth' => $params['width'], - 'clientHeight' => $params['height'], - # Comment as will be added to the EXIF of the thumbnail - 'comment' => isset( $params['descriptionUrl'] ) ? - "File source: {$params['descriptionUrl']}" : '', - # Properties of the original image - 'srcWidth' => $image->getWidth(), - 'srcHeight' => $image->getHeight(), - 'mimeType' => $image->getMimeType(), - 'dstPath' => $dstPath, - 'dstUrl' => $dstUrl, - ); - - # In some cases, we do not bother generating a thumbnail. - if ( !$image->mustRender() && - $scalerParams['physicalWidth'] == $scalerParams['srcWidth'] - && $scalerParams['physicalHeight'] == $scalerParams['srcHeight'] - ) { - wfDebug( __METHOD__ . ": returning unscaled image\n" ); - // getClientScalingThumbnailImage is protected - return $that->doClientImage( $image, $scalerParams ); - } - - return new ThumbnailImage( $image, $dstUrl, false, $params ); - } -} diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php deleted file mode 100644 index 1d65e521..00000000 --- a/tests/phpunit/phpunit.php +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env php -addOption( 'with-phpunitdir', - 'Directory to include PHPUnit from, for example when using a git fetchout from upstream. Path will be prepended to PHP `include_path`.', - false, # not required - true # need arg - ); - } - - public function finalSetup() { - parent::finalSetup(); - - global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType; - global $wgLanguageConverterCacheType, $wgUseDatabaseMessages; - global $wgLocaltimezone, $wgLocalisationCacheConf; - global $wgDevelopmentWarnings; - - // Inject test autoloader - require_once __DIR__ . '/../TestsAutoLoader.php'; - - // wfWarn should cause tests to fail - $wgDevelopmentWarnings = true; - - $wgMainCacheType = CACHE_NONE; - $wgMessageCacheType = CACHE_NONE; - $wgParserCacheType = CACHE_NONE; - $wgLanguageConverterCacheType = CACHE_NONE; - - $wgUseDatabaseMessages = false; # Set for future resets - - // Assume UTC for testing purposes - $wgLocaltimezone = 'UTC'; - - $wgLocalisationCacheConf['storeClass'] = 'LCStore_Null'; - - // Bug 44192 Do not attempt to send a real e-mail - Hooks::clear( 'AlternateUserMailer' ); - Hooks::register( - 'AlternateUserMailer', - function () { - return false; - } - ); - } - - public function execute() { - global $IP; - - # Make sure we have --configuration or PHPUnit might complain - if ( !in_array( '--configuration', $_SERVER['argv'] ) ) { - //Hack to eliminate the need to use the Makefile (which sucks ATM) - array_splice( $_SERVER['argv'], 1, 0, - array( '--configuration', $IP . '/tests/phpunit/suite.xml' ) ); - } - - # --with-phpunitdir let us override the default PHPUnit version - if ( $phpunitDir = $this->getOption( 'with-phpunitdir' ) ) { - # Sanity checks - if ( !is_dir( $phpunitDir ) ) { - $this->error( "--with-phpunitdir should be set to an existing directory", 1 ); - } - if ( !is_readable( $phpunitDir . "/PHPUnit/Runner/Version.php" ) ) { - $this->error( "No usable PHPUnit installation in $phpunitDir.\nAborting.\n", 1 ); - } - - # Now prepends provided PHPUnit directory - $this->output( "Will attempt loading PHPUnit from `$phpunitDir`\n" ); - set_include_path( $phpunitDir - . PATH_SEPARATOR . get_include_path() ); - - # Cleanup $args array so the option and its value do not - # pollute PHPUnit - $key = array_search( '--with-phpunitdir', $_SERVER['argv'] ); - unset( $_SERVER['argv'][$key] ); // the option - unset( $_SERVER['argv'][$key + 1] ); // its value - $_SERVER['argv'] = array_values( $_SERVER['argv'] ); - } - } - - public function getDbType() { - return Maintenance::DB_ADMIN; - } -} - -$maintClass = 'PHPUnitMaintClass'; -require RUN_MAINTENANCE_IF_MAIN; - -if ( !class_exists( 'PHPUnit_Runner_Version' ) ) { - require_once 'PHPUnit/Runner/Version.php'; -} - -if ( PHPUnit_Runner_Version::id() !== '@package_version@' - && version_compare( PHPUnit_Runner_Version::id(), '3.6.7', '<' ) -) { - die( 'PHPUnit 3.6.7 or later required, you have ' . PHPUnit_Runner_Version::id() . ".\n" ); -} - -if ( !class_exists( 'PHPUnit_TextUI_Command' ) ) { - require_once 'PHPUnit/Autoload.php'; -} -MediaWikiPHPUnitCommand::main(); diff --git a/tests/phpunit/run-tests.bat b/tests/phpunit/run-tests.bat deleted file mode 100644 index e6eb3e0c..00000000 --- a/tests/phpunit/run-tests.bat +++ /dev/null @@ -1 +0,0 @@ -php phpunit.php --configuration suite.xml %* diff --git a/tests/phpunit/skins/SideBarTest.php b/tests/phpunit/skins/SideBarTest.php deleted file mode 100644 index 9cb630fb..00000000 --- a/tests/phpunit/skins/SideBarTest.php +++ /dev/null @@ -1,223 +0,0 @@ -messages array */ - private function initMessagesHref() { - # List of default messages for the sidebar. The sidebar doesn't care at - # all whether they are full URLs, interwiki links or local titles. - $URL_messages = array( - 'mainpage', - 'portal-url', - 'currentevents-url', - 'recentchanges-url', - 'randompage-url', - 'helppage', - ); - - # We're assuming that isValidURI works as advertised: it's also - # tested separately, in tests/phpunit/includes/HttpTest.php. - foreach ( $URL_messages as $m ) { - $titleName = MessageCache::singleton()->get( $m ); - if ( Http::isValidURI( $titleName ) ) { - $this->messages[$m]['href'] = $titleName; - } else { - $title = Title::newFromText( $titleName ); - $this->messages[$m]['href'] = $title->getLocalURL(); - } - } - } - - protected function setUp() { - parent::setUp(); - $this->initMessagesHref(); - $this->skin = new SkinTemplate(); - $this->skin->getContext()->setLanguage( Language::factory( 'en' ) ); - } - - /** - * Internal helper to test the sidebar - * @param $expected - * @param $text - * @param $message (Default: '') - * @todo this assert method to should be converted to a test using a dataprovider.. - */ - private function assertSideBar( $expected, $text, $message = '' ) { - $bar = array(); - $this->skin->addToSidebarPlain( $bar, $text ); - $this->assertEquals( $expected, $bar, $message ); - } - - /** - * @covers SkinTemplate::addToSidebarPlain - */ - public function testSidebarWithOnlyTwoTitles() { - $this->assertSideBar( - array( - 'Title1' => array(), - 'Title2' => array(), - ), - '* Title1 -* Title2 -' - ); - } - - /** - * @covers SkinTemplate::addToSidebarPlain - */ - public function testExpandMessages() { - $this->setMwGlobals( array( - 'wgNoFollowDomainExceptions' => array( 'mediawiki.org' ), - ) ); - $this->assertSidebar( - array( 'Title' => array( - array( - 'text' => 'Help', - 'href' => $this->messages['helppage']['href'], - 'id' => 'n-help', - 'active' => null - ) - ) ), - '* Title -** helppage|help -' - ); - } - - /** - * @covers SkinTemplate::addToSidebarPlain - */ - public function testExternalUrlsRequireADescription() { - $this->setMwGlobals( array( - 'wgNoFollowLinks' => true, - 'wgNoFollowDomainExceptions' => array(), - 'wgNoFollowNsExceptions' => array(), - ) ); - $this->assertSidebar( - array( 'Title' => array( - # ** http://www.mediawiki.org/| Home - array( - 'text' => 'Home', - 'href' => 'http://www.mediawiki.org/', - 'id' => 'n-Home', - 'active' => null, - 'rel' => 'nofollow', - ), - # ** http://valid.no.desc.org/ - # ... skipped since it is missing a pipe with a description - ) ), - '* Title -** http://www.mediawiki.org/| Home -** http://valid.no.desc.org/ -' - ); - } - - /** - * bug 33321 - Make sure there's a | after transforming. - * @group Database - * @covers SkinTemplate::addToSidebarPlain - */ - public function testTrickyPipe() { - $this->assertSidebar( - array( 'Title' => array( - # The first 2 are skipped - # Doesn't really test the url properly - # because it will vary with $wgArticlePath et al. - # ** Baz|Fred - array( - 'text' => 'Fred', - 'href' => Title::newFromText( 'Baz' )->getLocalURL(), - 'id' => 'n-Fred', - 'active' => null, - ), - array( - 'text' => 'title-to-display', - 'href' => Title::newFromText( 'page-to-go-to' )->getLocalURL(), - 'id' => 'n-title-to-display', - 'active' => null, - ), - ) ), - '* Title -** {{PAGENAME|Foo}} -** Bar -** Baz|Fred -** {{PLURAL:1|page-to-go-to{{int:pipe-separator/en}}title-to-display|branch not taken}} -' - ); - } - - - #### Attributes for external links ########################## - private function getAttribs() { - # Sidebar text we will use everytime - $text = '* Title -** http://www.mediawiki.org/| Home'; - - $bar = array(); - $this->skin->addToSideBarPlain( $bar, $text ); - - return $bar['Title'][0]; - } - - /** - * Simple test to verify our helper assertAttribs() is functional - */ - public function testTestAttributesAssertionHelper() { - $this->setMwGlobals( array( - 'wgNoFollowLinks' => true, - 'wgNoFollowDomainExceptions' => array(), - 'wgNoFollowNsExceptions' => array(), - 'wgExternalLinkTarget' => false, - ) ); - $attribs = $this->getAttribs(); - - $this->assertArrayHasKey( 'rel', $attribs ); - $this->assertEquals( 'nofollow', $attribs['rel'] ); - - $this->assertArrayNotHasKey( 'target', $attribs ); - } - - /** - * Test $wgNoFollowLinks in sidebar - */ - public function testRespectWgnofollowlinks() { - $this->setMwGlobals( 'wgNoFollowLinks', false ); - - $attribs = $this->getAttribs(); - $this->assertArrayNotHasKey( 'rel', $attribs, - 'External URL in sidebar do not have rel=nofollow when $wgNoFollowLinks = false' - ); - } - - /** - * Test $wgExternaLinkTarget in sidebar - * @dataProvider dataRespectExternallinktarget - */ - public function testRespectExternallinktarget( $externalLinkTarget ) { - $this->setMwGlobals( 'wgExternalLinkTarget', $externalLinkTarget ); - - $attribs = $this->getAttribs(); - $this->assertArrayHasKey( 'target', $attribs ); - $this->assertEquals( $attribs['target'], $externalLinkTarget ); - } - - public static function dataRespectExternallinktarget() { - return array( - array( '_blank' ), - array( '_self' ), - ); - } -} diff --git a/tests/phpunit/structure/AutoLoaderTest.php b/tests/phpunit/structure/AutoLoaderTest.php deleted file mode 100644 index 205ea360..00000000 --- a/tests/phpunit/structure/AutoLoaderTest.php +++ /dev/null @@ -1,56 +0,0 @@ -assertEquals( - $results['expected'], - $results['actual'] - ); - } - - protected static function checkAutoLoadConf() { - global $wgAutoloadLocalClasses, $wgAutoloadClasses, $IP; - $supportsParsekit = function_exists( 'parsekit_compile_file' ); - - // wgAutoloadLocalClasses has precedence, just like in includes/AutoLoader.php - $expected = $wgAutoloadLocalClasses + $wgAutoloadClasses; - $actual = array(); - - $files = array_unique( $expected ); - - foreach ( $files as $file ) { - // Only prefix $IP if it doesn't have it already. - // Generally local classes don't have it, and those from extensions and test suites do. - if ( substr( $file, 0, 1 ) != '/' && substr( $file, 1, 1 ) != ':' ) { - $filePath = "$IP/$file"; - } else { - $filePath = $file; - } - if ( $supportsParsekit ) { - $parseInfo = parsekit_compile_file( "$filePath" ); - $classes = array_keys( $parseInfo['class_table'] ); - } else { - $contents = file_get_contents( "$filePath" ); - $m = array(); - preg_match_all( '/\n\s*(?:final)?\s*(?:abstract)?\s*(?:class|interface)\s+([a-zA-Z0-9_]+)/', $contents, $m, PREG_PATTERN_ORDER ); - $classes = $m[1]; - } - foreach ( $classes as $class ) { - $actual[$class] = $file; - } - } - - return array( - 'expected' => $expected, - 'actual' => $actual, - ); - } -} diff --git a/tests/phpunit/structure/ResourcesTest.php b/tests/phpunit/structure/ResourcesTest.php deleted file mode 100644 index fe823fa4..00000000 --- a/tests/phpunit/structure/ResourcesTest.php +++ /dev/null @@ -1,131 +0,0 @@ -assertFileExists( $filename, - "File '$resource' referenced by '$module' must exist." - ); - } - - /** - * This ask the ResouceLoader for all registered files from modules - * created by ResourceLoaderFileModule (or one of its descendants). - * - * - * Since the raw data is stored in protected properties, we have to - * overrride this through ReflectionObject methods. - */ - public static function provideResourceFiles() { - global $wgEnableJavaScriptTest; - - // Test existance of test suite files as well - // (can't use setUp or setMwGlobals because providers are static) - $live_wgEnableJavaScriptTest = $wgEnableJavaScriptTest; - $wgEnableJavaScriptTest = true; - - // Array with arguments for the test function - $cases = array(); - - // Initialize ResourceLoader - $rl = new ResourceLoader(); - - // See also ResourceLoaderFileModule::__construct - $filePathProps = array( - // Lists of file paths - 'lists' => array( - 'scripts', - 'debugScripts', - 'loaderScripts', - 'styles', - ), - - // Collated lists of file paths - 'nested-lists' => array( - 'languageScripts', - 'skinScripts', - 'skinStyles', - ), - ); - - foreach ( $rl->getModuleNames() as $moduleName ) { - $module = $rl->getModule( $moduleName ); - if ( !$module instanceof ResourceLoaderFileModule ) { - continue; - } - - $reflectedModule = new ReflectionObject( $module ); - - $files = array(); - - foreach ( $filePathProps['lists'] as $propName ) { - $property = $reflectedModule->getProperty( $propName ); - $property->setAccessible( true ); - $list = $property->getValue( $module ); - foreach ( $list as $key => $value ) { - // 'scripts' are numeral arrays. - // 'styles' can be numeral or associative. - // In case of associative the key is the file path - // and the value is the 'media' attribute. - if ( is_int( $key ) ) { - $files[] = $value; - } else { - $files[] = $key; - } - } - } - - foreach ( $filePathProps['nested-lists'] as $propName ) { - $property = $reflectedModule->getProperty( $propName ); - $property->setAccessible( true ); - $lists = $property->getValue( $module ); - foreach ( $lists as $list ) { - foreach ( $list as $key => $value ) { - // We need the same filter as for 'lists', - // due to 'skinStyles'. - if ( is_int( $key ) ) { - $files[] = $value; - } else { - $files[] = $key; - } - } - } - } - - // Get method for resolving the paths to full paths - $method = $reflectedModule->getMethod( 'getLocalPath' ); - $method->setAccessible( true ); - - // Populate cases - foreach ( $files as $file ) { - $cases[] = array( - $method->invoke( $module, $file ), - $module->getName(), - $file, - ); - } - } - - // Restore settings - $wgEnableJavaScriptTest = $live_wgEnableJavaScriptTest; - - return $cases; - } -} diff --git a/tests/phpunit/structure/StructureTest.php b/tests/phpunit/structure/StructureTest.php deleted file mode 100644 index df00d4df..00000000 --- a/tests/phpunit/structure/StructureTest.php +++ /dev/null @@ -1,63 +0,0 @@ -markTestSkipped( 'This test does not work on Windows' ); - } - $rootPath = escapeshellarg( __DIR__ . '/..' ); - $testClassRegex = implode( '|', array( - 'ApiFormatTestBase', - 'ApiTestCase', - 'ApiQueryTestBase', - 'ApiQueryContinueTestBase', - 'MediaWikiLangTestCase', - 'MediaWikiTestCase', - 'PHPUnit_Framework_TestCase', - 'DumpTestCase', - ) ); - $testClassRegex = "^class .* extends ($testClassRegex)"; - $finder = "find $rootPath -name '*.php' '!' -name '*Test.php'" . - " | xargs grep -El '$testClassRegex|function suite\('"; - - $results = null; - $exitCode = null; - exec( $finder, $results, $exitCode ); - - $this->assertEquals( - 0, - $exitCode, - 'Verify find/grep command succeeds.' - ); - - $results = array_filter( - $results, - array( $this, 'filterSuites' ) - ); - $strip = strlen( $rootPath ) - 1; - foreach ( $results as $k => $v ) { - $results[$k] = substr( $v, $strip ); - } - $this->assertEquals( - array(), - $results, - "Unit test file in $rootPath must end with Test." - ); - } - - /** - * Filter to remove testUnitTestFileNamesEndWithTest false positives. - */ - public function filterSuites( $filename ) { - return strpos( $filename, __DIR__ . '/../suites/' ) !== 0; - } -} diff --git a/tests/phpunit/suite.xml b/tests/phpunit/suite.xml deleted file mode 100644 index 7a9122fa..00000000 --- a/tests/phpunit/suite.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - includes - - - languages - - - skins - - - - maintenance - - - structure - - - suites/UploadFromUrlTestSuite.php - - - suites/ExtensionsTestSuite.php - suites/ExtensionsParserTestSuite.php - - - - - Utility - Broken - ParserFuzz - Stub - - - diff --git a/tests/phpunit/suites/ExtensionsParserTestSuite.php b/tests/phpunit/suites/ExtensionsParserTestSuite.php deleted file mode 100644 index 3d68b241..00000000 --- a/tests/phpunit/suites/ExtensionsParserTestSuite.php +++ /dev/null @@ -1,8 +0,0 @@ -addTestFile( $file ); - } - if ( !count( $files ) ) { - $this->addTest( new DummyExtensionsTest( 'testNothing' ) ); - } - } - - public static function suite() { - return new self; - } -} - -/** - * Needed to avoid warnings like 'No tests found in class "ExtensionsTestSuite".' - * when no extensions with tests are used. - */ -class DummyExtensionsTest extends MediaWikiTestCase { - public function testNothing() { - $this->assertTrue( true ); - } -} diff --git a/tests/phpunit/suites/UploadFromUrlTestSuite.php b/tests/phpunit/suites/UploadFromUrlTestSuite.php deleted file mode 100644 index 7eb599e3..00000000 --- a/tests/phpunit/suites/UploadFromUrlTestSuite.php +++ /dev/null @@ -1,207 +0,0 @@ - 'LocalRepo', - 'name' => 'local', - 'url' => 'http://example.com/images', - 'hashLevels' => 2, - 'transformVia404' => false, - 'backend' => new FSFileBackend( array( - 'name' => 'local-backend', - 'lockManager' => 'fsLockManager', - 'containerPaths' => array( - 'local-public' => wfTempDir() . '/test-repo/public', - 'local-thumb' => wfTempDir() . '/test-repo/thumb', - 'local-temp' => wfTempDir() . '/test-repo/temp', - 'local-deleted' => wfTempDir() . '/test-repo/delete', - ) - ) ), - ); - foreach ( $tmpGlobals as $var => $val ) { - if ( array_key_exists( $var, $GLOBALS ) ) { - $this->savedGlobals[$var] = $GLOBALS[$var]; - } - $GLOBALS[$var] = $val; - } - - $wgNamespaceProtection[NS_MEDIAWIKI] = 'editinterface'; - $wgNamespaceAliases['Image'] = NS_FILE; - $wgNamespaceAliases['Image_talk'] = NS_FILE_TALK; - - $wgEnableParserCache = false; - DeferredUpdates::clearPendingUpdates(); - $wgMemc = wfGetMainCache(); - $messageMemc = wfGetMessageCacheStorage(); - $parserMemc = wfGetParserCacheStorage(); - - // $wgContLang = new StubContLang; - $wgUser = new User; - $context = new RequestContext; - $wgLang = $context->getLanguage(); - $wgOut = $context->getOutput(); - $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) ); - $wgRequest = $context->getRequest(); - - if ( $wgStyleDirectory === false ) { - $wgStyleDirectory = "$IP/skins"; - } - - RepoGroup::destroySingleton(); - FileBackendGroup::destroySingleton(); - } - - protected function tearDown() { - foreach ( $this->savedGlobals as $var => $val ) { - $GLOBALS[$var] = $val; - } - // Restore backends - RepoGroup::destroySingleton(); - FileBackendGroup::destroySingleton(); - - $this->teardownUploadDir( $this->uploadDir ); - - parent::tearDown(); - } - - private $uploadDir; - private $keepUploads; - - /** - * Remove the dummy uploads directory - */ - private function teardownUploadDir( $dir ) { - if ( $this->keepUploads ) { - return; - } - - // delete the files first, then the dirs. - self::deleteFiles( - array( - "$dir/3/3a/Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg", - "$dir/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg", - - "$dir/0/09/Bad.jpg", - ) - ); - - self::deleteDirs( - array( - "$dir/3/3a", - "$dir/3", - "$dir/thumb/6/65", - "$dir/thumb/6", - "$dir/thumb/3/3a/Foobar.jpg", - "$dir/thumb/3/3a", - "$dir/thumb/3", - - "$dir/0/09/", - "$dir/0/", - - "$dir/thumb", - "$dir", - ) - ); - } - - /** - * Delete the specified files, if they exist. - * - * @param $files Array: full paths to files to delete. - */ - private static function deleteFiles( $files ) { - foreach ( $files as $file ) { - if ( file_exists( $file ) ) { - unlink( $file ); - } - } - } - - /** - * Delete the specified directories, if they exist. Must be empty. - * - * @param $dirs Array: full paths to directories to delete. - */ - private static function deleteDirs( $dirs ) { - foreach ( $dirs as $dir ) { - if ( is_dir( $dir ) ) { - rmdir( $dir ); - } - } - } - - /** - * Create a dummy uploads directory which will contain a couple - * of files in order to pass existence tests. - * - * @return String: the directory - */ - private function setupUploadDir() { - global $IP; - - if ( $this->keepUploads ) { - $dir = wfTempDir() . '/mwParser-images'; - - if ( is_dir( $dir ) ) { - return $dir; - } - } else { - $dir = wfTempDir() . "/mwParser-" . mt_rand() . "-images"; - } - - wfDebug( "Creating upload directory $dir\n" ); - - if ( file_exists( $dir ) ) { - wfDebug( "Already exists!\n" ); - - return $dir; - } - - wfMkdirParents( $dir . '/3/3a', null, __METHOD__ ); - copy( "$IP/skins/monobook/headbg.jpg", "$dir/3/3a/Foobar.jpg" ); - - wfMkdirParents( $dir . '/0/09', null, __METHOD__ ); - copy( "$IP/skins/monobook/headbg.jpg", "$dir/0/09/Bad.jpg" ); - - return $dir; - } - - public static function suite() { - // Hack to invoke the autoloader required to get phpunit to recognize - // the UploadFromUrlTest class - class_exists( 'UploadFromUrlTest' ); - $suite = new UploadFromUrlTestSuite( 'UploadFromUrlTest' ); - - return $suite; - } -} diff --git a/tests/qunit/.htaccess b/tests/qunit/.htaccess deleted file mode 100644 index 605d2f4c..00000000 --- a/tests/qunit/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Allow from all diff --git a/tests/qunit/QUnitTestResources.php b/tests/qunit/QUnitTestResources.php deleted file mode 100644 index c8743750..00000000 --- a/tests/qunit/QUnitTestResources.php +++ /dev/null @@ -1,68 +0,0 @@ - array( - 'scripts' => array( - 'tests/qunit/suites/resources/startup.test.js', - 'tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js', - 'tests/qunit/suites/resources/jquery/jquery.byteLength.test.js', - 'tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js', - 'tests/qunit/suites/resources/jquery/jquery.client.test.js', - 'tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js', - 'tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js', - 'tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js', - 'tests/qunit/suites/resources/jquery/jquery.hidpi.test.js', - 'tests/qunit/suites/resources/jquery/jquery.highlightText.test.js', - 'tests/qunit/suites/resources/jquery/jquery.localize.test.js', - 'tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js', - 'tests/qunit/suites/resources/jquery/jquery.mwExtension.test.js', - 'tests/qunit/suites/resources/jquery/jquery.tabIndex.test.js', - 'tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js', - 'tests/qunit/suites/resources/jquery/jquery.textSelection.test.js', - 'tests/qunit/data/mediawiki.jqueryMsg.data.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.jscompat.test.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.test.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js', - 'tests/qunit/suites/resources/mediawiki.api/mediawiki.api.test.js', - 'tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js', - 'tests/qunit/suites/resources/mediawiki.special/mediawiki.special.recentchanges.test.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js', - 'tests/qunit/suites/resources/mediawiki/mediawiki.cldr.test.js', - ), - 'dependencies' => array( - 'jquery.autoEllipsis', - 'jquery.byteLength', - 'jquery.byteLimit', - 'jquery.client', - 'jquery.colorUtil', - 'jquery.delayedBind', - 'jquery.getAttrs', - 'jquery.hidpi', - 'jquery.highlightText', - 'jquery.localize', - 'jquery.makeCollapsible', - 'jquery.mwExtension', - 'jquery.tabIndex', - 'jquery.tablesorter', - 'jquery.textSelection', - 'mediawiki', - 'mediawiki.api', - 'mediawiki.api.parse', - 'mediawiki.jqueryMsg', - 'mediawiki.Title', - 'mediawiki.Uri', - 'mediawiki.user', - 'mediawiki.util', - 'mediawiki.special.recentchanges', - 'mediawiki.language', - 'mediawiki.cldr', - ), - ) -); diff --git a/tests/qunit/data/callMwLoaderTestCallback.js b/tests/qunit/data/callMwLoaderTestCallback.js deleted file mode 100644 index dd034115..00000000 --- a/tests/qunit/data/callMwLoaderTestCallback.js +++ /dev/null @@ -1 +0,0 @@ -mediaWiki.loader.testCallback(); diff --git a/tests/qunit/data/generateJqueryMsgData.php b/tests/qunit/data/generateJqueryMsgData.php deleted file mode 100644 index 12e5a2dc..00000000 --- a/tests/qunit/data/generateJqueryMsgData.php +++ /dev/null @@ -1,150 +0,0 @@ - - QUnit.test( 'Output matches PHP parser', mw.libs.phpParserData.tests.length, function ( assert ) { - mw.messages.set( mw.libs.phpParserData.messages ); - $.each( mw.libs.phpParserData.tests, function ( i, test ) { - QUnit.stop(); - getMwLanguage( test.lang, function ( langClass ) { - var parser = new mw.jqueryMsg.parser( { language: langClass } ); - assert.equal( - parser.parse( test.key, test.args ).html(), - test.result, - test.name - ); - QUnit.start(); - } ); - } ); - }); - * - * - * @example Jasmine - * - describe( 'match output to output from PHP parser', function () { - mw.messages.set( mw.libs.phpParserData.messages ); - $.each( mw.libs.phpParserData.tests, function ( i, test ) { - it( 'should parse ' + test.name, function () { - var langClass; - runs( function () { - getMwLanguage( test.lang, function ( gotIt ) { - langClass = gotIt; - }); - }); - waitsFor( function () { - return langClass !== undefined; - }, 'Language class should be loaded', 1000 ); - runs( function () { - console.log( test.lang, 'running tests' ); - var parser = new mw.jqueryMsg.parser( { language: langClass } ); - expect( - parser.parse( test.key, test.args ).html() - ).toEqual( test.result ); - } ); - } ); - } ); - } ); - * - */ - -require __DIR__ . '/../../../maintenance/Maintenance.php'; - -class GenerateJqueryMsgData extends Maintenance { - - static $keyToTestArgs = array( - 'undelete_short' => array( - array( 0 ), - array( 1 ), - array( 2 ), - array( 5 ), - array( 21 ), - array( 101 ) - ), - 'category-subcat-count' => array( - array( 0, 10 ), - array( 1, 1 ), - array( 1, 2 ), - array( 3, 30 ) - ) - ); - - public function __construct() { - parent::__construct(); - $this->mDescription = 'Create a specification for message parsing ini JSON format'; - // add any other options here - } - - public function execute() { - list( $messages, $tests ) = $this->getMessagesAndTests(); - $this->writeJavascriptFile( $messages, $tests, __DIR__ . '/mediawiki.jqueryMsg.data.js' ); - } - - private function getMessagesAndTests() { - $messages = array(); - $tests = array(); - foreach ( array( 'en', 'fr', 'ar', 'jp', 'zh' ) as $languageCode ) { - foreach ( self::$keyToTestArgs as $key => $testArgs ) { - foreach ( $testArgs as $args ) { - // Get the raw message, without any transformations. - $template = wfMessage( $key )->inLanguage( $languageCode )->plain(); - - // Get the magic-parsed version with args. - $result = wfMessage( $key, $args )->inLanguage( $languageCode )->text(); - - // Record the template, args, language, and expected result - // fake multiple languages by flattening them together. - $langKey = $languageCode . '_' . $key; - $messages[$langKey] = $template; - $tests[] = array( - 'name' => $languageCode . ' ' . $key . ' ' . join( ',', $args ), - 'key' => $langKey, - 'args' => $args, - 'result' => $result, - 'lang' => $languageCode - ); - } - } - } - return array( $messages, $tests ); - } - - private function writeJavascriptFile( $messages, $tests, $dataSpecFile ) { - $phpParserData = array( - 'messages' => $messages, - 'tests' => $tests, - ); - - $output = - "// This file stores the output from the PHP parser for various messages, arguments,\n" - . "// languages, and parser modes. Intended for use by a unit test framework by looping\n" - . "// through the object and comparing its parser return value with the 'result' property.\n" - . '// Last generated with ' . basename( __FILE__ ) . ' at ' . gmdate( 'r' ) . "\n" - // This file will contain unquoted JSON strings as javascript native object literals, - // flip the quotemark convention for this file. - . "/*jshint quotmark: double */\n" - . "\n" - . 'mediaWiki.libs.phpParserData = ' . FormatJson::encode( $phpParserData, true ) . ";\n"; - - $fp = file_put_contents( $dataSpecFile, $output ); - if ( $fp === false ) { - die( "Couldn't write to $dataSpecFile." ); - } - } -} - -$maintClass = "GenerateJqueryMsgData"; -require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/tests/qunit/data/load.mock.php b/tests/qunit/data/load.mock.php deleted file mode 100644 index f6eff77a..00000000 --- a/tests/qunit/data/load.mock.php +++ /dev/null @@ -1,59 +0,0 @@ - " -mw.loader.implement( 'testUsesMissing', function () { - QUnit.ok( false, 'Module test.usesMissing script should not run.'); - QUnit.start(); -}, {}, {}); -", - - 'testUsesNestedMissing' => " -mw.loader.implement( 'testUsesNestedMissing', function () { - QUnit.ok( false, 'Module testUsesNestedMissing script should not run.'); -}, {}, {}); -", -); - -$response = ''; - -// Only support for non-encoded module names, full module names expected -if ( isset( $_GET['modules'] ) ) { - $modules = explode( ',', $_GET['modules'] ); - foreach ( $modules as $module ) { - if ( isset( $moduleImplementations[$module] ) ) { - $response .= $moduleImplementations[$module]; - } else { - $response .= Xml::encodeJsCall( 'mw.loader.state', array( $module, 'missing' ), true ); - } - } -} - -echo $response; diff --git a/tests/qunit/data/mediawiki.jqueryMsg.data.js b/tests/qunit/data/mediawiki.jqueryMsg.data.js deleted file mode 100644 index 776ee24f..00000000 --- a/tests/qunit/data/mediawiki.jqueryMsg.data.js +++ /dev/null @@ -1,492 +0,0 @@ -// This file stores the output from the PHP parser for various messages, arguments, -// languages, and parser modes. Intended for use by a unit test framework by looping -// through the object and comparing its parser return value with the 'result' property. -// Last generated with generateJqueryMsgData.php at Sat, 03 Nov 2012 21:32:01 +0000 -/*jshint quotmark: double */ - -mediaWiki.libs.phpParserData = { - "messages": { - "en_undelete_short": "Undelete {{PLURAL:$1|one edit|$1 edits}}", - "en_category-subcat-count": "{{PLURAL:$2|This category has only the following subcategory.|This category has the following {{PLURAL:$1|subcategory|$1 subcategories}}, out of $2 total.}}", - "fr_undelete_short": "Restaurer $1 modification{{PLURAL:$1||s}}", - "fr_category-subcat-count": "Cette cat\u00e9gorie comprend {{PLURAL:$2|la sous-cat\u00e9gorie|$2 sous-cat\u00e9gories, dont {{PLURAL:$1|celle|les $1}}}} ci-dessous.", - "ar_undelete_short": "\u0627\u0633\u062a\u0631\u062c\u0627\u0639 {{PLURAL:$1|\u062a\u0639\u062f\u064a\u0644 \u0648\u0627\u062d\u062f|\u062a\u0639\u062f\u064a\u0644\u064a\u0646|$1 \u062a\u0639\u062f\u064a\u0644\u0627\u062a|$1 \u062a\u0639\u062f\u064a\u0644|$1 \u062a\u0639\u062f\u064a\u0644\u0627}}", - "ar_category-subcat-count": "{{PLURAL:$2|\u0644\u0627 \u062a\u0635\u0627\u0646\u064a\u0641 \u0641\u0631\u0639\u064a\u0629 \u0641\u064a \u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641|\u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0641\u064a\u0647 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0627\u0644\u0641\u0631\u0639\u064a \u0627\u0644\u062a\u0627\u0644\u064a \u0641\u0642\u0637.|\u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0641\u064a\u0647 {{PLURAL:$1||\u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0627\u0644\u0641\u0631\u0639\u064a|\u0647\u0630\u064a\u0646 \u0627\u0644\u062a\u0635\u0646\u064a\u0641\u064a\u0646 \u0627\u0644\u0641\u0631\u0639\u064a\u064a\u0646|\u0647\u0630\u0647 \u0627\u0644$1 \u062a\u0635\u0627\u0646\u064a\u0641 \u0627\u0644\u0641\u0631\u0639\u064a\u0629|\u0647\u0630\u0647 \u0627\u0644$1 \u062a\u0635\u0646\u064a\u0641\u0627 \u0641\u0631\u0639\u064a\u0627|\u0647\u0630\u0647 \u0627\u0644$1 \u062a\u0635\u0646\u064a\u0641 \u0641\u0631\u0639\u064a}}\u060c \u0645\u0646 \u0625\u062c\u0645\u0627\u0644\u064a $2.}}", - "jp_undelete_short": "Undelete {{PLURAL:$1|one edit|$1 edits}}", - "jp_category-subcat-count": "{{PLURAL:$2|This category has only the following subcategory.|This category has the following {{PLURAL:$1|subcategory|$1 subcategories}}, out of $2 total.}}", - "zh_undelete_short": "\u6062\u590d$1\u4e2a\u88ab\u5220\u9664\u7684\u7f16\u8f91", - "zh_category-subcat-count": "{{PLURAL:$2|\u672c\u5206\u7c7b\u53ea\u6709\u4e0b\u5217\u4e00\u4e2a\u5b50\u5206\u7c7b\u3002|\u672c\u5206\u7c7b\u5305\u542b\u4e0b\u5217$1\u4e2a\u5b50\u5206\u7c7b\uff0c\u5171$2\u4e2a\u5b50\u5206\u7c7b\u3002}}" - }, - "tests": [ - { - "name": "en undelete_short 0", - "key": "en_undelete_short", - "args": [ - 0 - ], - "result": "Undelete 0 edits", - "lang": "en" - }, - { - "name": "en undelete_short 1", - "key": "en_undelete_short", - "args": [ - 1 - ], - "result": "Undelete one edit", - "lang": "en" - }, - { - "name": "en undelete_short 2", - "key": "en_undelete_short", - "args": [ - 2 - ], - "result": "Undelete 2 edits", - "lang": "en" - }, - { - "name": "en undelete_short 5", - "key": "en_undelete_short", - "args": [ - 5 - ], - "result": "Undelete 5 edits", - "lang": "en" - }, - { - "name": "en undelete_short 21", - "key": "en_undelete_short", - "args": [ - 21 - ], - "result": "Undelete 21 edits", - "lang": "en" - }, - { - "name": "en undelete_short 101", - "key": "en_undelete_short", - "args": [ - 101 - ], - "result": "Undelete 101 edits", - "lang": "en" - }, - { - "name": "en category-subcat-count 0,10", - "key": "en_category-subcat-count", - "args": [ - 0, - 10 - ], - "result": "This category has the following 0 subcategories, out of 10 total.", - "lang": "en" - }, - { - "name": "en category-subcat-count 1,1", - "key": "en_category-subcat-count", - "args": [ - 1, - 1 - ], - "result": "This category has only the following subcategory.", - "lang": "en" - }, - { - "name": "en category-subcat-count 1,2", - "key": "en_category-subcat-count", - "args": [ - 1, - 2 - ], - "result": "This category has the following subcategory, out of 2 total.", - "lang": "en" - }, - { - "name": "en category-subcat-count 3,30", - "key": "en_category-subcat-count", - "args": [ - 3, - 30 - ], - "result": "This category has the following 3 subcategories, out of 30 total.", - "lang": "en" - }, - { - "name": "fr undelete_short 0", - "key": "fr_undelete_short", - "args": [ - 0 - ], - "result": "Restaurer 0 modification", - "lang": "fr" - }, - { - "name": "fr undelete_short 1", - "key": "fr_undelete_short", - "args": [ - 1 - ], - "result": "Restaurer 1 modification", - "lang": "fr" - }, - { - "name": "fr undelete_short 2", - "key": "fr_undelete_short", - "args": [ - 2 - ], - "result": "Restaurer 2 modifications", - "lang": "fr" - }, - { - "name": "fr undelete_short 5", - "key": "fr_undelete_short", - "args": [ - 5 - ], - "result": "Restaurer 5 modifications", - "lang": "fr" - }, - { - "name": "fr undelete_short 21", - "key": "fr_undelete_short", - "args": [ - 21 - ], - "result": "Restaurer 21 modifications", - "lang": "fr" - }, - { - "name": "fr undelete_short 101", - "key": "fr_undelete_short", - "args": [ - 101 - ], - "result": "Restaurer 101 modifications", - "lang": "fr" - }, - { - "name": "fr category-subcat-count 0,10", - "key": "fr_category-subcat-count", - "args": [ - 0, - 10 - ], - "result": "Cette cat\u00e9gorie comprend 10 sous-cat\u00e9gories, dont celle ci-dessous.", - "lang": "fr" - }, - { - "name": "fr category-subcat-count 1,1", - "key": "fr_category-subcat-count", - "args": [ - 1, - 1 - ], - "result": "Cette cat\u00e9gorie comprend la sous-cat\u00e9gorie ci-dessous.", - "lang": "fr" - }, - { - "name": "fr category-subcat-count 1,2", - "key": "fr_category-subcat-count", - "args": [ - 1, - 2 - ], - "result": "Cette cat\u00e9gorie comprend 2 sous-cat\u00e9gories, dont celle ci-dessous.", - "lang": "fr" - }, - { - "name": "fr category-subcat-count 3,30", - "key": "fr_category-subcat-count", - "args": [ - 3, - 30 - ], - "result": "Cette cat\u00e9gorie comprend 30 sous-cat\u00e9gories, dont les 3 ci-dessous.", - "lang": "fr" - }, - { - "name": "ar undelete_short 0", - "key": "ar_undelete_short", - "args": [ - 0 - ], - "result": "\u0627\u0633\u062a\u0631\u062c\u0627\u0639 \u062a\u0639\u062f\u064a\u0644 \u0648\u0627\u062d\u062f", - "lang": "ar" - }, - { - "name": "ar undelete_short 1", - "key": "ar_undelete_short", - "args": [ - 1 - ], - "result": "\u0627\u0633\u062a\u0631\u062c\u0627\u0639 \u062a\u0639\u062f\u064a\u0644\u064a\u0646", - "lang": "ar" - }, - { - "name": "ar undelete_short 2", - "key": "ar_undelete_short", - "args": [ - 2 - ], - "result": "\u0627\u0633\u062a\u0631\u062c\u0627\u0639 2 \u062a\u0639\u062f\u064a\u0644\u0627\u062a", - "lang": "ar" - }, - { - "name": "ar undelete_short 5", - "key": "ar_undelete_short", - "args": [ - 5 - ], - "result": "\u0627\u0633\u062a\u0631\u062c\u0627\u0639 5 \u062a\u0639\u062f\u064a\u0644", - "lang": "ar" - }, - { - "name": "ar undelete_short 21", - "key": "ar_undelete_short", - "args": [ - 21 - ], - "result": "\u0627\u0633\u062a\u0631\u062c\u0627\u0639 21 \u062a\u0639\u062f\u064a\u0644\u0627", - "lang": "ar" - }, - { - "name": "ar undelete_short 101", - "key": "ar_undelete_short", - "args": [ - 101 - ], - "result": "\u0627\u0633\u062a\u0631\u062c\u0627\u0639 101 \u062a\u0639\u062f\u064a\u0644\u0627", - "lang": "ar" - }, - { - "name": "ar category-subcat-count 0,10", - "key": "ar_category-subcat-count", - "args": [ - 0, - 10 - ], - "result": "\u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0641\u064a\u0647 \u060c \u0645\u0646 \u0625\u062c\u0645\u0627\u0644\u064a 10.", - "lang": "ar" - }, - { - "name": "ar category-subcat-count 1,1", - "key": "ar_category-subcat-count", - "args": [ - 1, - 1 - ], - "result": "\u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0641\u064a\u0647 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0627\u0644\u0641\u0631\u0639\u064a \u0627\u0644\u062a\u0627\u0644\u064a \u0641\u0642\u0637.", - "lang": "ar" - }, - { - "name": "ar category-subcat-count 1,2", - "key": "ar_category-subcat-count", - "args": [ - 1, - 2 - ], - "result": "\u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0641\u064a\u0647 \u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0627\u0644\u0641\u0631\u0639\u064a\u060c \u0645\u0646 \u0625\u062c\u0645\u0627\u0644\u064a 2.", - "lang": "ar" - }, - { - "name": "ar category-subcat-count 3,30", - "key": "ar_category-subcat-count", - "args": [ - 3, - 30 - ], - "result": "\u0647\u0630\u0627 \u0627\u0644\u062a\u0635\u0646\u064a\u0641 \u0641\u064a\u0647 \u0647\u0630\u0647 \u0627\u06443 \u062a\u0635\u0627\u0646\u064a\u0641 \u0627\u0644\u0641\u0631\u0639\u064a\u0629\u060c \u0645\u0646 \u0625\u062c\u0645\u0627\u0644\u064a 30.", - "lang": "ar" - }, - { - "name": "jp undelete_short 0", - "key": "jp_undelete_short", - "args": [ - 0 - ], - "result": "Undelete 0 edits", - "lang": "jp" - }, - { - "name": "jp undelete_short 1", - "key": "jp_undelete_short", - "args": [ - 1 - ], - "result": "Undelete one edit", - "lang": "jp" - }, - { - "name": "jp undelete_short 2", - "key": "jp_undelete_short", - "args": [ - 2 - ], - "result": "Undelete 2 edits", - "lang": "jp" - }, - { - "name": "jp undelete_short 5", - "key": "jp_undelete_short", - "args": [ - 5 - ], - "result": "Undelete 5 edits", - "lang": "jp" - }, - { - "name": "jp undelete_short 21", - "key": "jp_undelete_short", - "args": [ - 21 - ], - "result": "Undelete 21 edits", - "lang": "jp" - }, - { - "name": "jp undelete_short 101", - "key": "jp_undelete_short", - "args": [ - 101 - ], - "result": "Undelete 101 edits", - "lang": "jp" - }, - { - "name": "jp category-subcat-count 0,10", - "key": "jp_category-subcat-count", - "args": [ - 0, - 10 - ], - "result": "This category has the following 0 subcategories, out of 10 total.", - "lang": "jp" - }, - { - "name": "jp category-subcat-count 1,1", - "key": "jp_category-subcat-count", - "args": [ - 1, - 1 - ], - "result": "This category has only the following subcategory.", - "lang": "jp" - }, - { - "name": "jp category-subcat-count 1,2", - "key": "jp_category-subcat-count", - "args": [ - 1, - 2 - ], - "result": "This category has the following subcategory, out of 2 total.", - "lang": "jp" - }, - { - "name": "jp category-subcat-count 3,30", - "key": "jp_category-subcat-count", - "args": [ - 3, - 30 - ], - "result": "This category has the following 3 subcategories, out of 30 total.", - "lang": "jp" - }, - { - "name": "zh undelete_short 0", - "key": "zh_undelete_short", - "args": [ - 0 - ], - "result": "\u6062\u590d0\u4e2a\u88ab\u5220\u9664\u7684\u7f16\u8f91", - "lang": "zh" - }, - { - "name": "zh undelete_short 1", - "key": "zh_undelete_short", - "args": [ - 1 - ], - "result": "\u6062\u590d1\u4e2a\u88ab\u5220\u9664\u7684\u7f16\u8f91", - "lang": "zh" - }, - { - "name": "zh undelete_short 2", - "key": "zh_undelete_short", - "args": [ - 2 - ], - "result": "\u6062\u590d2\u4e2a\u88ab\u5220\u9664\u7684\u7f16\u8f91", - "lang": "zh" - }, - { - "name": "zh undelete_short 5", - "key": "zh_undelete_short", - "args": [ - 5 - ], - "result": "\u6062\u590d5\u4e2a\u88ab\u5220\u9664\u7684\u7f16\u8f91", - "lang": "zh" - }, - { - "name": "zh undelete_short 21", - "key": "zh_undelete_short", - "args": [ - 21 - ], - "result": "\u6062\u590d21\u4e2a\u88ab\u5220\u9664\u7684\u7f16\u8f91", - "lang": "zh" - }, - { - "name": "zh undelete_short 101", - "key": "zh_undelete_short", - "args": [ - 101 - ], - "result": "\u6062\u590d101\u4e2a\u88ab\u5220\u9664\u7684\u7f16\u8f91", - "lang": "zh" - }, - { - "name": "zh category-subcat-count 0,10", - "key": "zh_category-subcat-count", - "args": [ - 0, - 10 - ], - "result": "\u672c\u5206\u7c7b\u5305\u542b\u4e0b\u52170\u4e2a\u5b50\u5206\u7c7b\uff0c\u517110\u4e2a\u5b50\u5206\u7c7b\u3002", - "lang": "zh" - }, - { - "name": "zh category-subcat-count 1,1", - "key": "zh_category-subcat-count", - "args": [ - 1, - 1 - ], - "result": "\u672c\u5206\u7c7b\u53ea\u6709\u4e0b\u5217\u4e00\u4e2a\u5b50\u5206\u7c7b\u3002", - "lang": "zh" - }, - { - "name": "zh category-subcat-count 1,2", - "key": "zh_category-subcat-count", - "args": [ - 1, - 2 - ], - "result": "\u672c\u5206\u7c7b\u5305\u542b\u4e0b\u52171\u4e2a\u5b50\u5206\u7c7b\uff0c\u51712\u4e2a\u5b50\u5206\u7c7b\u3002", - "lang": "zh" - }, - { - "name": "zh category-subcat-count 3,30", - "key": "zh_category-subcat-count", - "args": [ - 3, - 30 - ], - "result": "\u672c\u5206\u7c7b\u5305\u542b\u4e0b\u52173\u4e2a\u5b50\u5206\u7c7b\uff0c\u517130\u4e2a\u5b50\u5206\u7c7b\u3002", - "lang": "zh" - } - ] -}; diff --git a/tests/qunit/data/qunitOkCall.js b/tests/qunit/data/qunitOkCall.js deleted file mode 100644 index 3ed5514e..00000000 --- a/tests/qunit/data/qunitOkCall.js +++ /dev/null @@ -1,2 +0,0 @@ -QUnit.start(); -QUnit.assert.ok( true, 'Successfully loaded!' ); diff --git a/tests/qunit/data/styleTest.css.php b/tests/qunit/data/styleTest.css.php deleted file mode 100644 index 0e845811..00000000 --- a/tests/qunit/data/styleTest.css.php +++ /dev/null @@ -1,61 +0,0 @@ - - */ - QUnit.newMwEnvironment = ( function () { - var log, liveConfig, liveMessages; - - liveConfig = mw.config.values; - liveMessages = mw.messages.values; - - function freshConfigCopy( custom ) { - // Tests should mock all factors that directly influence the tested code. - // For backwards compatibility though we set mw.config to a copy of the live config - // and extend it with the (optionally) given custom settings for this test - // (instead of starting blank with only the given custmo settings). - // This is a shallow copy, so we don't end up with settings taking an array value - // extended with the custom settings - setting a config property means you override it, - // not extend it. - return $.extend( {}, liveConfig, custom ); - } - - function freshMessagesCopy( custom ) { - return $.extend( /*deep=*/true, {}, liveMessages, custom ); - } - - log = QUnit.urlParams.mwlogenv ? mw.log : function () {}; - - return function ( localEnv ) { - localEnv = $.extend( { - // QUnit - setup: $.noop, - teardown: $.noop, - // MediaWiki - config: {}, - messages: {} - }, localEnv ); - - return { - setup: function () { - log( 'MwEnvironment> SETUP for "' + QUnit.config.current.module - + ': ' + QUnit.config.current.testName + '"' ); - - // Greetings, mock environment! - mw.config.values = freshConfigCopy( localEnv.config ); - mw.messages.values = freshMessagesCopy( localEnv.messages ); - - localEnv.setup(); - }, - - teardown: function () { - log( 'MwEnvironment> TEARDOWN for "' + QUnit.config.current.module - + ': ' + QUnit.config.current.testName + '"' ); - - localEnv.teardown(); - - // Farewell, mock environment! - mw.config.values = liveConfig; - mw.messages.values = liveMessages; - } - }; - }; - }() ); - - // $.when stops as soon as one fails, which makes sense in most - // practical scenarios, but not in a unit test where we really do - // need to wait until all of them are finished. - QUnit.whenPromisesComplete = function () { - var altPromises = []; - - $.each( arguments, function ( i, arg ) { - var alt = $.Deferred(); - altPromises.push( alt ); - - // Whether this one fails or not, forwards it to - // the 'done' (resolve) callback of the alternative promise. - arg.always( alt.resolve ); - } ); - - return $.when.apply( $, altPromises ); - }; - - /** - * Recursively convert a node to a plain object representing its structure. - * Only considers attributes and contents (elements and text nodes). - * Attribute values are compared strictly and not normalised. - * - * @param {Node} node - * @return {Object|string} Plain JavaScript value representing the node. - */ - function getDomStructure( node ) { - var $node, children, processedChildren, i, len, el; - $node = $( node ); - if ( node.nodeType === ELEMENT_NODE ) { - children = $node.contents(); - processedChildren = []; - for ( i = 0, len = children.length; i < len; i++ ) { - el = children[i]; - if ( el.nodeType === ELEMENT_NODE || el.nodeType === TEXT_NODE ) { - processedChildren.push( getDomStructure( el ) ); - } - } - - return { - tagName: node.tagName, - attributes: $node.getAttrs(), - contents: processedChildren - }; - } else { - // Should be text node - return $node.text(); - } - } - - /** - * Gets structure of node for this HTML. - * - * @param {string} html HTML markup for one or more nodes. - */ - function getHtmlStructure( html ) { - var el = $( '
            ' ).append( html )[0]; - return getDomStructure( el ); - } - - /** - * Add-on assertion helpers - */ - // Define the add-ons - addons = { - - // Expect boolean true - assertTrue: function ( actual, message ) { - QUnit.push( actual === true, actual, true, message ); - }, - - // Expect boolean false - assertFalse: function ( actual, message ) { - QUnit.push( actual === false, actual, false, message ); - }, - - // Expect numerical value less than X - lt: function ( actual, expected, message ) { - QUnit.push( actual < expected, actual, 'less than ' + expected, message ); - }, - - // Expect numerical value less than or equal to X - ltOrEq: function ( actual, expected, message ) { - QUnit.push( actual <= expected, actual, 'less than or equal to ' + expected, message ); - }, - - // Expect numerical value greater than X - gt: function ( actual, expected, message ) { - QUnit.push( actual > expected, actual, 'greater than ' + expected, message ); - }, - - // Expect numerical value greater than or equal to X - gtOrEq: function ( actual, expected, message ) { - QUnit.push( actual >= expected, actual, 'greater than or equal to ' + expected, message ); - }, - - /** - * Asserts that two HTML strings are structurally equivalent. - * - * @param {string} actualHtml Actual HTML markup. - * @param {string} expectedHtml Expected HTML markup - * @param {string} message Assertion message. - */ - htmlEqual: function ( actualHtml, expectedHtml, message ) { - var actual = getHtmlStructure( actualHtml ), - expected = getHtmlStructure( expectedHtml ); - - QUnit.push( - QUnit.equiv( - actual, - expected - ), - actual, - expected, - message - ); - }, - - /** - * Asserts that two HTML strings are not structurally equivalent. - * - * @param {string} actualHtml Actual HTML markup. - * @param {string} expectedHtml Expected HTML markup. - * @param {string} message Assertion message. - */ - notHtmlEqual: function ( actualHtml, expectedHtml, message ) { - var actual = getHtmlStructure( actualHtml ), - expected = getHtmlStructure( expectedHtml ); - - QUnit.push( - !QUnit.equiv( - actual, - expected - ), - actual, - expected, - message - ); - } - }; - - $.extend( QUnit.assert, addons ); - - /** - * Small test suite to confirm proper functionality of the utilities and - * initializations defined above in this file. - */ - envExecCount = 0; - QUnit.module( 'mediawiki.tests.qunit.testrunner', QUnit.newMwEnvironment( { - setup: function () { - envExecCount += 1; - this.mwHtmlLive = mw.html; - mw.html = { - escape: function () { - return 'mocked-' + envExecCount; - } - }; - }, - teardown: function () { - mw.html = this.mwHtmlLive; - }, - config: { - testVar: 'foo' - }, - messages: { - testMsg: 'Foo.' - } - } ) ); - - QUnit.test( 'Setup', 3, function ( assert ) { - assert.equal( mw.html.escape( 'foo' ), 'mocked-1', 'extra setup() callback was ran.' ); - assert.equal( mw.config.get( 'testVar' ), 'foo', 'config object applied' ); - assert.equal( mw.messages.get( 'testMsg' ), 'Foo.', 'messages object applied' ); - - mw.config.set( 'testVar', 'bar' ); - mw.messages.set( 'testMsg', 'Bar.' ); - } ); - - QUnit.test( 'Teardown', 3, function ( assert ) { - assert.equal( mw.html.escape( 'foo' ), 'mocked-2', 'extra setup() callback was re-ran.' ); - assert.equal( mw.config.get( 'testVar' ), 'foo', 'config object restored and re-applied after test()' ); - assert.equal( mw.messages.get( 'testMsg' ), 'Foo.', 'messages object restored and re-applied after test()' ); - } ); - - QUnit.test( 'Loader status', 2, function ( assert ) { - var i, len, state, - modules = mw.loader.getModuleNames(), - error = [], - missing = []; - - for ( i = 0, len = modules.length; i < len; i++ ) { - state = mw.loader.getState( modules[i] ); - if ( state === 'error' ) { - error.push( modules[i] ); - } else if ( state === 'missing' ) { - missing.push( modules[i] ); - } - } - - assert.deepEqual( error, [], 'Modules in error state' ); - assert.deepEqual( missing, [], 'Modules in missing state' ); - } ); - - QUnit.test( 'htmlEqual', 8, function ( assert ) { - assert.htmlEqual( - '

            Child paragraph with A link

            Regular textA span
            ', - '

            Child paragraph with A link

            Regular textA span
            ', - 'Attribute order, spacing and quotation marks (equal)' - ); - - assert.notHtmlEqual( - '

            Child paragraph with A link

            Regular textA span
            ', - '

            Child paragraph with A link

            Regular textA span
            ', - 'Attribute order, spacing and quotation marks (not equal)' - ); - - assert.htmlEqual( - '', - '', - 'Multiple root nodes (equal)' - ); - - assert.notHtmlEqual( - '', - '', - 'Multiple root nodes (not equal, last label node is different)' - ); - - assert.htmlEqual( - 'fo"o
            b>ar', - 'fo"o
            b>ar', - 'Extra escaping is equal' - ); - assert.notHtmlEqual( - 'foo<br/>bar', - 'foo
            bar', - 'Text escaping (not equal)' - ); - - assert.htmlEqual( - 'fooexamplebar', - 'fooexamplebar', - 'Outer text nodes are compared (equal)' - ); - - assert.notHtmlEqual( - 'fooexamplebar', - 'fooexamplequux', - 'Outer text nodes are compared (last text node different)' - ); - - } ); - - QUnit.module( 'mediawiki.tests.qunit.testrunner-after', QUnit.newMwEnvironment() ); - - QUnit.test( 'Teardown', 3, function ( assert ) { - assert.equal( mw.html.escape( '<' ), '<', 'extra teardown() callback was ran.' ); - assert.equal( mw.config.get( 'testVar' ), null, 'config object restored to live in next module()' ); - assert.equal( mw.messages.get( 'testMsg' ), null, 'messages object restored to live in next module()' ); - } ); - -}( jQuery, mediaWiki, QUnit ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js b/tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js deleted file mode 100644 index e1895248..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.autoEllipsis.test.js +++ /dev/null @@ -1,58 +0,0 @@ -( function ( $ ) { - - QUnit.module( 'jquery.autoEllipsis', QUnit.newMwEnvironment() ); - - function createWrappedDiv( text, width ) { - var $wrapper = $( '
            ' ).css( 'width', width ), - $div = $( '
            ' ).text( text ); - $wrapper.append( $div ); - return $wrapper; - } - - function findDivergenceIndex( a, b ) { - var i = 0; - while ( i < a.length && i < b.length && a[i] === b[i] ) { - i++; - } - return i; - } - - QUnit.test( 'Position right', 4, function ( assert ) { - // We need this thing to be visible, so append it to the DOM - var $span, spanText, d, spanTextNew, - origText = 'This is a really long random string and there is no way it fits in 100 pixels.', - $wrapper = createWrappedDiv( origText, '100px' ); - - $( '#qunit-fixture' ).append( $wrapper ); - $wrapper.autoEllipsis( { position: 'right' } ); - - // Verify that, and only one, span element was created - $span = $wrapper.find( '> span' ); - assert.strictEqual( $span.length, 1, 'autoEllipsis wrapped the contents in a span element' ); - - // Check that the text fits by turning on word wrapping - $span.css( 'whiteSpace', 'nowrap' ); - assert.ltOrEq( - $span.width(), - $span.parent().width(), - 'Text fits (making the span "white-space: nowrap" does not make it wider than its parent)' - ); - - // Add two characters using scary black magic - spanText = $span.text(); - d = findDivergenceIndex( origText, spanText ); - spanTextNew = spanText.substr( 0, d ) + origText[d] + origText[d] + '...'; - - assert.gt( spanTextNew.length, spanText.length, 'Verify that the new span-length is indeed greater' ); - - // Put this text in the span and verify it doesn't fit - $span.text( spanTextNew ); - // In IE6 width works like min-width, allow IE6's width to be "equal to" - if ( $.browser.msie && Number( $.browser.version ) === 6 ) { - assert.gtOrEq( $span.width(), $span.parent().width(), 'Fit is maximal (adding two characters makes it not fit any more) - IE6: Maybe equal to as well due to width behaving like min-width in IE6' ); - } else { - assert.gt( $span.width(), $span.parent().width(), 'Fit is maximal (adding two characters makes it not fit any more)' ); - } - } ); - -}( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.byteLength.test.js b/tests/qunit/suites/resources/jquery/jquery.byteLength.test.js deleted file mode 100644 index e6aa3aa8..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.byteLength.test.js +++ /dev/null @@ -1,37 +0,0 @@ -( function ( $ ) { - QUnit.module( 'jquery.byteLength', QUnit.newMwEnvironment() ); - - QUnit.test( 'Simple text', 5, function ( assert ) { - var azLc = 'abcdefghijklmnopqrstuvwxyz', - azUc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', - num = '0123456789', - x = '*', - space = ' '; - - assert.equal( $.byteLength( azLc ), 26, 'Lowercase a-z' ); - assert.equal( $.byteLength( azUc ), 26, 'Uppercase A-Z' ); - assert.equal( $.byteLength( num ), 10, 'Numbers 0-9' ); - assert.equal( $.byteLength( x ), 1, 'An asterisk' ); - assert.equal( $.byteLength( space ), 3, '3 spaces' ); - - } ); - - QUnit.test( 'Special text', 4, function ( assert ) { - // https://en.wikipedia.org/wiki/UTF-8 - var u0024 = '$', - // Cent symbol - u00A2 = '\u00A2', - // Euro symbol - u20AC = '\u20AC', - // Character \U00024B62 (Han script) can't be represented in javascript as a single - // code point, instead it is composed as a surrogate pair of two separate code units. - // http://codepoints.net/U+24B62 - // http://www.fileformat.info/info/unicode/char/24B62/index.htm - u024B62 = '\uD852\uDF62'; - - assert.strictEqual( $.byteLength( u0024 ), 1, 'U+0024' ); - assert.strictEqual( $.byteLength( u00A2 ), 2, 'U+00A2' ); - assert.strictEqual( $.byteLength( u20AC ), 3, 'U+20AC' ); - assert.strictEqual( $.byteLength( u024B62 ), 4, 'U+024B62 (surrogate pair: \\uD852\\uDF62)' ); - } ); -}( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js b/tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js deleted file mode 100644 index 22d2af19..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js +++ /dev/null @@ -1,252 +0,0 @@ -( function ( $, mw ) { - var simpleSample, U_20AC, mbSample; - - QUnit.module( 'jquery.byteLimit', QUnit.newMwEnvironment() ); - - // Simple sample (20 chars, 20 bytes) - simpleSample = '12345678901234567890'; - - // 3 bytes (euro-symbol) - U_20AC = '\u20AC'; - - // Multi-byte sample (22 chars, 26 bytes) - mbSample = '1234567890' + U_20AC + '1234567890' + U_20AC; - - // Basic sendkey-implementation - function addChars( $input, charstr ) { - var c, len; - - function x( $input, i ) { - // Add character to the value - return $input.val() + charstr.charAt( i ); - } - - for ( c = 0, len = charstr.length; c < len; c += 1 ) { - $input - .val( x( $input, c ) ) - .trigger( 'change' ); - } - } - - /** - * Test factory for $.fn.byteLimit - * - * @param {Object} options - * @param {string} options.description Test name - * @param {jQuery} options.$input jQuery object in an input element - * @param {string} options.sample Sequence of characters to simulate being - * added one by one - * @param {string} options.expected Expected final value of `$input` - */ - function byteLimitTest( options ) { - var opt = $.extend( { - description: '', - $input: null, - sample: '', - expected: '' - }, options ); - - QUnit.asyncTest( opt.description, 1, function ( assert ) { - setTimeout( function () { - opt.$input.appendTo( '#qunit-fixture' ); - - // Simulate pressing keys for each of the sample characters - addChars( opt.$input, opt.sample ); - - assert.equal( - opt.$input.val(), - opt.expected, - 'New value matches the expected string' - ); - - QUnit.start(); - }, 10 ); - } ); - } - - byteLimitTest( { - description: 'Plain text input', - $input: $( '' ), - sample: simpleSample, - expected: simpleSample - } ); - - byteLimitTest( { - description: 'Plain text input. Calling byteLimit with no parameters and no maxlength attribute (bug 36310)', - $input: $( '' ) - .byteLimit(), - sample: simpleSample, - expected: simpleSample - } ); - - byteLimitTest( { - description: 'Limit using the maxlength attribute', - $input: $( '' ) - .attr( 'maxlength', '10' ) - .byteLimit(), - sample: simpleSample, - expected: '1234567890' - } ); - - byteLimitTest( { - description: 'Limit using a custom value', - $input: $( '' ) - .byteLimit( 10 ), - sample: simpleSample, - expected: '1234567890' - } ); - - byteLimitTest( { - description: 'Limit using a custom value, overriding maxlength attribute', - $input: $( '' ) - .attr( 'maxlength', '10' ) - .byteLimit( 15 ), - sample: simpleSample, - expected: '123456789012345' - } ); - - byteLimitTest( { - description: 'Limit using a custom value (multibyte)', - $input: $( '' ) - .byteLimit( 14 ), - sample: mbSample, - expected: '1234567890' + U_20AC + '1' - } ); - - byteLimitTest( { - description: 'Limit using a custom value (multibyte) overlapping a byte', - $input: $( '' ) - .byteLimit( 12 ), - sample: mbSample, - expected: '1234567890' + '12' - } ); - - byteLimitTest( { - description: 'Pass the limit and a callback as input filter', - $input: $( '' ) - .byteLimit( 6, function ( val ) { - var title = mw.Title.newFromText( String( val ) ); - // Return without namespace prefix - return title ? title.getMain() : ''; - } ), - sample: 'User:Sample', - expected: 'User:Sample' - } ); - - byteLimitTest( { - description: 'Limit using the maxlength attribute and pass a callback as input filter', - $input: $( '' ) - .attr( 'maxlength', '6' ) - .byteLimit( function ( val ) { - var title = mw.Title.newFromText( String( val ) ); - // Return without namespace prefix - return title ? title.getMain() : ''; - } ), - sample: 'User:Sample', - expected: 'User:Sample' - } ); - - byteLimitTest( { - description: 'Pass the limit and a callback as input filter', - $input: $( '' ) - .byteLimit( 6, function ( val ) { - var title = mw.Title.newFromText( String( val ) ); - // Return without namespace prefix - return title ? title.getMain() : ''; - } ), - sample: 'User:Example', - // The callback alters the value to be used to calculeate - // the length. The altered value is "Exampl" which has - // a length of 6, the "e" would exceed the limit. - expected: 'User:Exampl' - } ); - - byteLimitTest( { - description: 'Input filter that increases the length', - $input: $( '' ) - .byteLimit( 10, function ( text ) { - return 'prefix' + text; - } ), - sample: simpleSample, - // Prefix adds 6 characters, limit is reached after 4 - expected: '1234' - } ); - - // Regression tests for bug 41450 - byteLimitTest( { - description: 'Input filter of which the base exceeds the limit', - $input: $( '' ) - .byteLimit( 3, function ( text ) { - return 'prefix' + text; - } ), - sample: simpleSample, - hasLimit: true, - limit: 6, // 'prefix' length - expected: '' - } ); - - QUnit.test( 'Confirm properties and attributes set', 4, function ( assert ) { - var $el, $elA, $elB; - - $el = $( '' ) - .attr( 'maxlength', '7' ) - .appendTo( '#qunit-fixture' ) - .byteLimit(); - - assert.strictEqual( $el.attr( 'maxlength' ), '7', 'maxlength attribute unchanged for simple limit' ); - - $el = $( '' ) - .attr( 'maxlength', '7' ) - .appendTo( '#qunit-fixture' ) - .byteLimit( 12 ); - - assert.strictEqual( $el.attr( 'maxlength' ), '12', 'maxlength attribute updated for custom limit' ); - - $el = $( '' ) - .attr( 'maxlength', '7' ) - .appendTo( '#qunit-fixture' ) - .byteLimit( 12, function ( val ) { - return val; - } ); - - assert.strictEqual( $el.attr( 'maxlength' ), undefined, 'maxlength attribute removed for limit with callback' ); - - $elA = $( '' ) - .addClass( 'mw-test-byteLimit-foo' ) - .attr( 'maxlength', '7' ) - .appendTo( '#qunit-fixture' ); - - $elB = $( '' ) - .addClass( 'mw-test-byteLimit-foo' ) - .attr( 'maxlength', '12' ) - .appendTo( '#qunit-fixture' ); - - $el = $( '.mw-test-byteLimit-foo' ); - - assert.strictEqual( $el.length, 2, 'Verify that there are no other elements clashing with this test suite' ); - - $el.byteLimit(); - } ); - - QUnit.test( 'Trim from insertion when limit exceeded', 2, function ( assert ) { - var $el; - - // Use a new because the bug only occurs on the first time - // the limit it reached (bug 40850) - $el = $( '' ) - .appendTo( '#qunit-fixture' ) - .byteLimit( 3 ) - .val( 'abc' ).trigger( 'change' ) - .val( 'zabc' ).trigger( 'change' ); - - assert.strictEqual( $el.val(), 'abc', 'Trim from the insertion point (at 0), not the end' ); - - $el = $( '' ) - .appendTo( '#qunit-fixture' ) - .byteLimit( 3 ) - .val( 'abc' ).trigger( 'change' ) - .val( 'azbc' ).trigger( 'change' ); - - assert.strictEqual( $el.val(), 'abc', 'Trim from the insertion point (at 1), not the end' ); - } ); -}( jQuery, mediaWiki ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.client.test.js b/tests/qunit/suites/resources/jquery/jquery.client.test.js deleted file mode 100644 index 4c7c3022..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.client.test.js +++ /dev/null @@ -1,542 +0,0 @@ -( function ( $ ) { - - QUnit.module( 'jquery.client', QUnit.newMwEnvironment() ); - - var uacount = 0, - // Object keyed by userAgent. Value is an array (human-readable name, client-profile object, navigator.platform value) - // Info based on results from http://toolserver.org/~krinkle/testswarm/job/174/ - uas = { - // Internet Explorer 6 - // Internet Explorer 7 - 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)': { - title: 'Internet Explorer 7', - platform: 'Win32', - profile: { - name: 'msie', - layout: 'trident', - layoutVersion: 'unknown', - platform: 'win', - version: '7.0', - versionBase: '7', - versionNumber: 7 - }, - wikiEditor: { - ltr: true, - rtl: false - } - }, - // Internet Explorer 8 - // Internet Explorer 9 - // Internet Explorer 10 - 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)': { - title: 'Internet Explorer 10', - platform: 'Win32', - profile: { - name: 'msie', - layout: 'trident', - layoutVersion: 6, - platform: 'win', - version: '10.0', - versionBase: '10', - versionNumber: 10 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Internet Explorer 11 - 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv 11.0) like Gecko': { - title: 'Internet Explorer 11', - platform: 'Win32', - profile: { - name: 'msie', - layout: 'trident', - layoutVersion: 7, - platform: 'win', - version: '11.0', - versionBase: '11', - versionNumber: 11 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Internet Explorer 11 - Windows 8.1 x64 Modern UI - 'Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; rv:11.0) like Gecko': { - title: 'Internet Explorer 11', - platform: 'Win64', - profile: { - name: 'msie', - layout: 'trident', - layoutVersion: 7, - platform: 'win', - version: '11.0', - versionBase: '11', - versionNumber: 11 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Internet Explorer 11 - Windows 8.1 x64 desktop UI - 'Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko': { - title: 'Internet Explorer 11', - platform: 'WOW64', - profile: { - name: 'msie', - layout: 'trident', - layoutVersion: 7, - platform: 'win', - version: '11.0', - versionBase: '11', - versionNumber: 11 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Firefox 2 - // Firefox 3.5 - 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.19) Gecko/20110420 Firefox/3.5.19': { - title: 'Firefox 3.5', - platform: 'MacIntel', - profile: { - name: 'firefox', - layout: 'gecko', - layoutVersion: 20110420, - platform: 'mac', - version: '3.5.19', - versionBase: '3', - versionNumber: 3.5 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Firefox 3.6 - 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110422 Ubuntu/10.10 (maverick) Firefox/3.6.17': { - title: 'Firefox 3.6', - platform: 'Linux i686', - profile: { - name: 'firefox', - layout: 'gecko', - layoutVersion: 20110422, - platform: 'linux', - version: '3.6.17', - versionBase: '3', - versionNumber: 3.6 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Firefox 4 - 'Mozilla/5.0 (Windows NT 6.0; rv:2.0.1) Gecko/20100101 Firefox/4.0.1': { - title: 'Firefox 4', - platform: 'Win32', - profile: { - name: 'firefox', - layout: 'gecko', - layoutVersion: 20100101, - platform: 'win', - version: '4.0.1', - versionBase: '4', - versionNumber: 4 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Firefox 10 nightly build - 'Mozilla/5.0 (X11; Linux x86_64; rv:10.0a1) Gecko/20111103 Firefox/10.0a1': { - title: 'Firefox 10 nightly', - platform: 'Linux', - profile: { - name: 'firefox', - layout: 'gecko', - layoutVersion: 20111103, - platform: 'linux', - version: '10.0a1', - versionBase: '10', - versionNumber: 10 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Iceweasel 10.0.6 - 'Mozilla/5.0 (X11; Linux i686; rv:10.0.6) Gecko/20100101 Iceweasel/10.0.6': { - title: 'Iceweasel 10.0.6', - platform: 'Linux', - profile: { - name: 'iceweasel', - layout: 'gecko', - layoutVersion: 20100101, - platform: 'linux', - version: '10.0.6', - versionBase: '10', - versionNumber: 10 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Iceweasel 15.0.1 - 'Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1 Iceweasel/15.0.1': { - title: 'Iceweasel 15.0.1', - platform: 'Linux', - profile: { - name: 'iceweasel', - layout: 'gecko', - layoutVersion: 20100101, - platform: 'linux', - version: '15.0.1', - versionBase: '15', - versionNumber: 15 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Firefox 5 - // Safari 3 - // Safari 4 - 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; nl-nl) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7': { - title: 'Safari 4', - platform: 'MacIntel', - profile: { - name: 'safari', - layout: 'webkit', - layoutVersion: 531, - platform: 'mac', - version: '4.0.5', - versionBase: '4', - versionNumber: 4 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - 'Mozilla/5.0 (Windows; U; Windows NT 6.0; cs-CZ) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7': { - title: 'Safari 4', - platform: 'Win32', - profile: { - name: 'safari', - layout: 'webkit', - layoutVersion: 533, - platform: 'win', - version: '4.0.5', - versionBase: '4', - versionNumber: 4 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Safari 5 - // Safari 6 - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/536.29.13 (KHTML, like Gecko) Version/6.0.4 Safari/536.29.13': { - title: 'Safari 6', - platform: 'MacIntel', - profile: { - name: 'safari', - layout: 'webkit', - layoutVersion: 536, - platform: 'mac', - version: '6.0.4', - versionBase: '6', - versionNumber: 6 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Safari 6.0.5+ (doesn't have the comma in "KHTML, like Gecko") - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 1084) AppleWebKit/536.30.1 (KHTML like Gecko) Version/6.0.5 Safari/536.30.1': { - title: 'Safari 6', - platform: 'MacIntel', - profile: { - name: 'safari', - layout: 'webkit', - layoutVersion: 536, - platform: 'mac', - version: '6.0.5', - versionBase: '6', - versionNumber: 6 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Opera 10+ - 'Opera/9.80 (Windows NT 5.1)': { - title: 'Opera 10+ (exact version unspecified)', - platform: 'Win32', - profile: { - name: 'opera', - layout: 'presto', - layoutVersion: 'unknown', - platform: 'win', - version: '10', - versionBase: '10', - versionNumber: 10 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Opera 12 - 'Opera/9.80 (Windows NT 5.1) Presto/2.12.388 Version/12.11': { - title: 'Opera 12', - platform: 'Win32', - profile: { - name: 'opera', - layout: 'presto', - layoutVersion: 'unknown', - platform: 'win', - version: '12.11', - versionBase: '12', - versionNumber: 12.11 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Opera 15 (WebKit-based) - 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.52 Safari/537.36 OPR/15.0.1147.130': { - title: 'Opera 15', - platform: 'Win32', - profile: { - name: 'opera', - layout: 'webkit', - layoutVersion: 537, - platform: 'win', - version: '15.0.1147.130', - versionBase: '15', - versionNumber: 15 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Chrome 5 - // Chrome 6 - // Chrome 7 - // Chrome 8 - // Chrome 9 - // Chrome 10 - // Chrome 11 - // Chrome 12 - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_5_8) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30': { - title: 'Chrome 12', - platform: 'MacIntel', - profile: { - name: 'chrome', - layout: 'webkit', - layoutVersion: 534, - platform: 'mac', - version: '12.0.742.112', - versionBase: '12', - versionNumber: 12 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.68 Safari/534.30': { - title: 'Chrome 12', - platform: 'Linux i686', - profile: { - name: 'chrome', - layout: 'webkit', - layoutVersion: 534, - platform: 'linux', - version: '12.0.742.68', - versionBase: '12', - versionNumber: 12 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Android WebKit Browser 2.3 - 'Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; HTC Vision Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1': { - title: 'Android WebKit Browser 2.3', - platform: 'Linux armv7l', - profile: { - name: 'android', - layout: 'webkit', - layoutVersion: 533, - platform: 'linux', - version: '2.3.5', - versionBase: '2', - versionNumber: 2.3 - }, - wikiEditor: { - ltr: true, - rtl: true - } - }, - // Bug #34924 - 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.34 (KHTML, like Gecko) rekonq Safari/534.34': { - title: 'Rekonq', - platform: 'Linux i686', - profile: { - name: 'rekonq', - layout: 'webkit', - layoutVersion: 534, - platform: 'linux', - version: '534.34', - versionBase: '534', - versionNumber: 534.34 - }, - wikiEditor: { - ltr: true, - rtl: true - } - } - }, - testMap = { - // Example from WikiEditor - // Make sure to use raw numbers, a string like "7.0" would fail on a - // version 10 browser since in string comparaison "10" is before "7.0" :) - 'ltr': { - 'msie': [['>=', 7.0]], - 'firefox': [['>=', 2]], - 'opera': [['>=', 9.6]], - 'safari': [['>=', 3]], - 'chrome': [['>=', 3]], - 'netscape': [['>=', 9]], - 'blackberry': false, - 'ipod': false, - 'iphone': false - }, - 'rtl': { - 'msie': [['>=', 8]], - 'firefox': [['>=', 2]], - 'opera': [['>=', 9.6]], - 'safari': [['>=', 3]], - 'chrome': [['>=', 3]], - 'netscape': [['>=', 9]], - 'blackberry': false, - 'ipod': false, - 'iphone': false - } - } - ; - - // Count test cases - $.each( uas, function () { - uacount++; - } ); - - QUnit.test( 'profile( navObject )', 7, function ( assert ) { - var p = $.client.profile(); - - function unknownOrType( val, type, summary ) { - assert.ok( typeof val === type || val === 'unknown', summary ); - } - - assert.equal( typeof p, 'object', 'profile returns an object' ); - unknownOrType( p.layout, 'string', 'p.layout is a string (or "unknown")' ); - unknownOrType( p.layoutVersion, 'number', 'p.layoutVersion is a number (or "unknown")' ); - unknownOrType( p.platform, 'string', 'p.platform is a string (or "unknown")' ); - unknownOrType( p.version, 'string', 'p.version is a string (or "unknown")' ); - unknownOrType( p.versionBase, 'string', 'p.versionBase is a string (or "unknown")' ); - assert.equal( typeof p.versionNumber, 'number', 'p.versionNumber is a number' ); - } ); - - QUnit.test( 'profile( navObject ) - samples', uacount, function ( assert ) { - // Loop through and run tests - $.each( uas, function ( rawUserAgent, data ) { - // Generate a client profile object and compare recursively - var ret = $.client.profile( { - userAgent: rawUserAgent, - platform: data.platform - } ); - assert.deepEqual( ret, data.profile, 'Client profile support check for ' + data.title + ' (' + data.platform + '): ' + rawUserAgent ); - } ); - } ); - - QUnit.test( 'test( testMap )', 4, function ( assert ) { - // .test() uses eval, make sure no exceptions are thrown - // then do a basic return value type check - var testMatch = $.client.test( testMap ), - ie7Profile = $.client.profile( { - 'userAgent': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)', - 'platform': '' - } ); - - assert.equal( typeof testMatch, 'boolean', 'map with ltr/rtl split returns a boolean value' ); - - testMatch = $.client.test( testMap.ltr ); - - assert.equal( typeof testMatch, 'boolean', 'simple map (without ltr/rtl split) returns a boolean value' ); - - assert.equal( $.client.test( { - 'msie': null - }, ie7Profile ), true, 'returns true if any version of a browser are allowed (null)' ); - - assert.equal( $.client.test( { - 'msie': false - }, ie7Profile ), false, 'returns false if all versions of a browser are not allowed (false)' ); - } ); - - QUnit.test( 'test( testMap, exactMatchOnly )', 2, function ( assert ) { - var ie7Profile = $.client.profile( { - 'userAgent': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)', - 'platform': '' - } ); - - assert.equal( $.client.test( { - 'firefox': [['>=', 2]] - }, ie7Profile, false ), true, 'returns true if browser not found and exactMatchOnly not set' ); - - assert.equal( $.client.test( { - 'firefox': [['>=', 2]] - }, ie7Profile, true ), false, 'returns false if browser not found and exactMatchOnly is set' ); - } ); - - QUnit.test( 'test( testMap) - WikiEditor sample', uacount * 2, function ( assert ) { - var $body = $( 'body' ), - bodyClasses = $body.attr( 'class' ); - - // Loop through and run tests - $.each( uas, function ( agent, data ) { - $.each( ['ltr', 'rtl'], function ( i, dir ) { - var profile, testMatch; - $body.removeClass( 'ltr rtl' ).addClass( dir ); - profile = $.client.profile( { - userAgent: agent, - platform: data.platform - } ); - testMatch = $.client.test( testMap, profile ); - $body.removeClass( dir ); - - assert.equal( testMatch, data.wikiEditor[dir], 'testing comparison based on ' + dir + ', ' + agent ); - } ); - } ); - - // Restore body classes - $body.attr( 'class', bodyClasses ); - } ); -}( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js b/tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js deleted file mode 100644 index 39ae363c..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.colorUtil.test.js +++ /dev/null @@ -1,63 +0,0 @@ -( function ( $ ) { - QUnit.module( 'jquery.colorUtil', QUnit.newMwEnvironment() ); - - QUnit.test( 'getRGB', 18, function ( assert ) { - assert.strictEqual( $.colorUtil.getRGB(), undefined, 'No arguments' ); - assert.strictEqual( $.colorUtil.getRGB( '' ), undefined, 'Empty string' ); - assert.deepEqual( $.colorUtil.getRGB( [0, 100, 255] ), [0, 100, 255], 'Parse array of rgb values' ); - assert.deepEqual( $.colorUtil.getRGB( 'rgb(0,100,255)' ), [0, 100, 255], 'Parse simple rgb string' ); - assert.deepEqual( $.colorUtil.getRGB( 'rgb(0, 100, 255)' ), [0, 100, 255], 'Parse simple rgb string with spaces' ); - assert.deepEqual( $.colorUtil.getRGB( 'rgb(0%,20%,40%)' ), [0, 51, 102], 'Parse rgb string with percentages' ); - assert.deepEqual( $.colorUtil.getRGB( 'rgb(0%, 20%, 40%)' ), [0, 51, 102], 'Parse rgb string with percentages and spaces' ); - assert.deepEqual( $.colorUtil.getRGB( '#f2ddee' ), [242, 221, 238], 'Hex string: 6 char lowercase' ); - assert.deepEqual( $.colorUtil.getRGB( '#f2DDEE' ), [242, 221, 238], 'Hex string: 6 char uppercase' ); - assert.deepEqual( $.colorUtil.getRGB( '#f2DdEe' ), [242, 221, 238], 'Hex string: 6 char mixed' ); - assert.deepEqual( $.colorUtil.getRGB( '#eee' ), [238, 238, 238], 'Hex string: 3 char lowercase' ); - assert.deepEqual( $.colorUtil.getRGB( '#EEE' ), [238, 238, 238], 'Hex string: 3 char uppercase' ); - assert.deepEqual( $.colorUtil.getRGB( '#eEe' ), [238, 238, 238], 'Hex string: 3 char mixed' ); - assert.deepEqual( $.colorUtil.getRGB( 'rgba(0, 0, 0, 0)' ), [255, 255, 255], 'Zero rgba for Safari 3; Transparent (whitespace)' ); - - // Perhaps this is a bug in colorUtil, but it is the current behavior so, let's keep - // track of it, so we will know in case it would ever change. - assert.strictEqual( $.colorUtil.getRGB( 'rgba(0,0,0,0)' ), undefined, 'Zero rgba without whitespace' ); - - assert.deepEqual( $.colorUtil.getRGB( 'lightGreen' ), [144, 238, 144], 'Color names (lightGreen)' ); - assert.deepEqual( $.colorUtil.getRGB( 'transparent' ), [255, 255, 255], 'Color names (transparent)' ); - assert.strictEqual( $.colorUtil.getRGB( 'mediaWiki' ), undefined, 'Inexisting color name' ); - } ); - - QUnit.test( 'rgbToHsl', 1, function ( assert ) { - var hsl, ret; - - // Cross-browser differences in decimals... - // Round to two decimals so they can be more reliably checked. - function dualDecimals( a ) { - return Math.round( a * 100 ) / 100; - } - - // Re-create the rgbToHsl return array items, limited to two decimals. - hsl = $.colorUtil.rgbToHsl( 144, 238, 144 ); - ret = [ dualDecimals( hsl[0] ), dualDecimals( hsl[1] ), dualDecimals( hsl[2] ) ]; - - assert.deepEqual( ret, [0.33, 0.73, 0.75], 'rgb(144, 238, 144): hsl(0.33, 0.73, 0.75)' ); - } ); - - QUnit.test( 'hslToRgb', 1, function ( assert ) { - var rgb, ret; - rgb = $.colorUtil.hslToRgb( 0.3, 0.7, 0.8 ); - - // Re-create the hslToRgb return array items, rounded to whole numbers. - ret = [ Math.round( rgb[0] ), Math.round( rgb[1] ), Math.round( rgb[2] ) ]; - - assert.deepEqual( ret, [183, 240, 168], 'hsl(0.3, 0.7, 0.8): rgb(183, 240, 168)' ); - } ); - - QUnit.test( 'getColorBrightness', 2, function ( assert ) { - var a, b; - a = $.colorUtil.getColorBrightness( 'red', +0.1 ); - assert.equal( a, 'rgb(255,50,50)', 'Start with named color "red", brighten 10%' ); - - b = $.colorUtil.getColorBrightness( 'rgb(200,50,50)', -0.2 ); - assert.equal( b, 'rgb(118,29,29)', 'Start with rgb string "rgb(200,50,50)", darken 20%' ); - } ); -}( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js b/tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js deleted file mode 100644 index 234b19cb..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js +++ /dev/null @@ -1,37 +0,0 @@ -( function ( $ ) { - QUnit.asyncTest( 'jquery.delayedBind with data option', 2, function ( assert ) { - var $fixture = $( '
            ' ).appendTo( '#qunit-fixture' ), - data = { - magic: 'beeswax' - }, - delay = 50; - - $fixture.delayedBind( delay, 'testevent', data, function ( e ) { - assert.ok( true, 'testevent fired' ); - assert.ok( e.data === data, 'data is passed through delayedBind' ); - QUnit.start(); - } ); - - // We'll trigger it thrice, but it should only happen once. - $fixture.trigger( 'testevent', {} ); - $fixture.trigger( 'testevent', {} ); - $fixture.trigger( 'testevent', {} ); - $fixture.trigger( 'testevent', {} ); - } ); - - QUnit.asyncTest( 'jquery.delayedBind without data option', 1, function ( assert ) { - var $fixture = $( '
            ' ).appendTo( '#qunit-fixture' ), - delay = 50; - - $fixture.delayedBind( delay, 'testevent', function () { - assert.ok( true, 'testevent fired' ); - QUnit.start(); - } ); - - // We'll trigger it thrice, but it should only happen once. - $fixture.trigger( 'testevent', {} ); - $fixture.trigger( 'testevent', {} ); - $fixture.trigger( 'testevent', {} ); - $fixture.trigger( 'testevent', {} ); - } ); -}( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js b/tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js deleted file mode 100644 index 0b7e87ee..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.getAttrs.test.js +++ /dev/null @@ -1,13 +0,0 @@ -( function ( $ ) { - QUnit.module( 'jquery.getAttrs', QUnit.newMwEnvironment() ); - - QUnit.test( 'Check', 1, function ( assert ) { - var attrs = { - foo: 'bar', - 'class': 'lorem' - }, - $el = $( '
            ' ).attr( attrs ); - - assert.deepEqual( $el.getAttrs(), attrs, 'getAttrs() return object should match the attributes set, no more, no less' ); - } ); -}( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js b/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js deleted file mode 100644 index 906369ee..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js +++ /dev/null @@ -1,22 +0,0 @@ -( function ( $ ) { - QUnit.module( 'jquery.hidpi', QUnit.newMwEnvironment() ); - - QUnit.test( 'devicePixelRatio', 1, function ( assert ) { - var devicePixelRatio = $.devicePixelRatio(); - assert.equal( typeof devicePixelRatio, 'number', '$.devicePixelRatio() returns a number' ); - } ); - - QUnit.test( 'matchSrcSet', 6, function ( assert ) { - var srcset = 'onefive.png 1.5x, two.png 2x'; - - // Nice exact matches - assert.equal( $.matchSrcSet( 1, srcset ), null, '1.0 gives no match' ); - assert.equal( $.matchSrcSet( 1.5, srcset ), 'onefive.png', '1.5 gives match' ); - assert.equal( $.matchSrcSet( 2, srcset ), 'two.png', '2 gives match' ); - - // Non-exact matches; should return the next-biggest specified - assert.equal( $.matchSrcSet( 1.25, srcset ), null, '1.25 gives no match' ); - assert.equal( $.matchSrcSet( 1.75, srcset ), 'onefive.png', '1.75 gives match to 1.5' ); - assert.equal( $.matchSrcSet( 2.25, srcset ), 'two.png', '2.25 gives match to 2' ); - } ); -}( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.highlightText.test.js b/tests/qunit/suites/resources/jquery/jquery.highlightText.test.js deleted file mode 100644 index e1fb96dc..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.highlightText.test.js +++ /dev/null @@ -1,235 +0,0 @@ -( function ( $ ) { - QUnit.module( 'jquery.highlightText', QUnit.newMwEnvironment() ); - - QUnit.test( 'Check', function ( assert ) { - var $fixture, cases = [ - { - desc: 'Test 001', - text: 'Blue Öyster Cult', - highlight: 'Blue', - expected: 'Blue Öyster Cult' - }, - { - desc: 'Test 002', - text: 'Blue Öyster Cult', - highlight: 'Blue ', - expected: 'Blue Öyster Cult' - }, - { - desc: 'Test 003', - text: 'Blue Öyster Cult', - highlight: 'Blue Ö', - expected: 'Blue Öyster Cult' - }, - { - desc: 'Test 004', - text: 'Blue Öyster Cult', - highlight: 'Blue Öy', - expected: 'Blue Öyster Cult' - }, - { - desc: 'Test 005', - text: 'Blue Öyster Cult', - highlight: ' Blue', - expected: 'Blue Öyster Cult' - }, - { - desc: 'Test 006', - text: 'Blue Öyster Cult', - highlight: ' Blue ', - expected: 'Blue Öyster Cult' - }, - { - desc: 'Test 007', - text: 'Blue Öyster Cult', - highlight: ' Blue Ö', - expected: 'Blue Öyster Cult' - }, - { - desc: 'Test 008', - text: 'Blue Öyster Cult', - highlight: ' Blue Öy', - expected: 'Blue Öyster Cult' - }, - { - desc: 'Test 009: Highlighter broken on starting Umlaut?', - text: 'Österreich', - highlight: 'Österreich', - expected: 'Österreich' - }, - { - desc: 'Test 010: Highlighter broken on starting Umlaut?', - text: 'Österreich', - highlight: 'Ö', - expected: 'Österreich' - }, - { - desc: 'Test 011: Highlighter broken on starting Umlaut?', - text: 'Österreich', - highlight: 'Öst', - expected: 'Österreich' - }, - { - desc: 'Test 012: Highlighter broken on starting Umlaut?', - text: 'Österreich', - highlight: 'Oe', - expected: 'Österreich' - }, - { - desc: 'Test 013: Highlighter broken on punctuation mark?', - text: 'So good. To be there', - highlight: 'good', - expected: 'So good. To be there' - }, - { - desc: 'Test 014: Highlighter broken on space?', - text: 'So good. To be there', - highlight: 'be', - expected: 'So good. To be there' - }, - { - desc: 'Test 015: Highlighter broken on space?', - text: 'So good. To be there', - highlight: ' be', - expected: 'So good. To be there' - }, - { - desc: 'Test 016: Highlighter broken on space?', - text: 'So good. To be there', - highlight: 'be ', - expected: 'So good. To be there' - }, - { - desc: 'Test 017: Highlighter broken on space?', - text: 'So good. To be there', - highlight: ' be ', - expected: 'So good. To be there' - }, - { - desc: 'Test 018: en de Highlighter broken on special character at the end?', - text: 'So good. xbß', - highlight: 'xbß', - expected: 'So good. xbß' - }, - { - desc: 'Test 019: en de Highlighter broken on special character at the end?', - text: 'So good. xbß.', - highlight: 'xbß.', - expected: 'So good. xbß.' - }, - { - desc: 'Test 020: RTL he Hebrew', - text: 'חסיד אומות העולם', - highlight: 'חסיד אומות העולם', - expected: 'חסיד אומות העולם' - }, - { - desc: 'Test 021: RTL he Hebrew', - text: 'חסיד אומות העולם', - highlight: 'חסי', - expected: 'חסיד אומות העולם' - }, - { - desc: 'Test 022: ja Japanese', - text: '諸国民の中の正義の人', - highlight: '諸国民の中の正義の人', - expected: '諸国民の中の正義の人' - }, - { - desc: 'Test 023: ja Japanese', - text: '諸国民の中の正義の人', - highlight: '諸国', - expected: '諸国民の中の正義の人' - }, - { - desc: 'Test 024: fr French text and « french quotes » (guillemets)', - text: '« L\'oiseau est sur l’île »', - highlight: '« L\'oiseau est sur l’île »', - expected: '« L\'oiseau est sur l’île »' - }, - { - desc: 'Test 025: fr French text and « french quotes » (guillemets)', - text: '« L\'oiseau est sur l’île »', - highlight: '« L\'oise', - expected: '« L\'oiseau est sur l’île »' - }, - { - desc: 'Test 025a: fr French text and « french quotes » (guillemets) - does it match the single strings "«" and "L" separately?', - text: '« L\'oiseau est sur l’île »', - highlight: '« L', - expected: '« L\'oiseau est sur l’île »' - }, - { - desc: 'Test 026: ru Russian', - text: 'Праведники мира', - highlight: 'Праведники мира', - expected: 'Праведники мира' - }, - { - desc: 'Test 027: ru Russian', - text: 'Праведники мира', - highlight: 'Праве', - expected: 'Праведники мира' - }, - { - desc: 'Test 028 ka Georgian', - text: 'მთავარი გვერდი', - highlight: 'მთავარი გვერდი', - expected: 'მთავარი გვერდი' - }, - { - desc: 'Test 029 ka Georgian', - text: 'მთავარი გვერდი', - highlight: 'მთა', - expected: 'მთავარი გვერდი' - }, - { - desc: 'Test 030 hy Armenian', - text: 'Նոնա Գափրինդաշվիլի', - highlight: 'Նոնա Գափրինդաշվիլի', - expected: 'Նոնա Գափրինդաշվիլի' - }, - { - desc: 'Test 031 hy Armenian', - text: 'Նոնա Գափրինդաշվիլի', - highlight: 'Նոն', - expected: 'Նոնա Գափրինդաշվիլի' - }, - { - desc: 'Test 032: th Thai', - text: 'พอล แอร์ดิช', - highlight: 'พอล แอร์ดิช', - expected: 'พอล แอร์ดิช' - }, - { - desc: 'Test 033: th Thai', - text: 'พอล แอร์ดิช', - highlight: 'พอ', - expected: 'พอล แอร์ดิช' - }, - { - desc: 'Test 034: RTL ar Arabic', - text: 'بول إيردوس', - highlight: 'بول إيردوس', - expected: 'بول إيردوس' - }, - { - desc: 'Test 035: RTL ar Arabic', - text: 'بول إيردوس', - highlight: 'بو', - expected: 'بول إيردوس' - } - ]; - QUnit.expect( cases.length ); - - $.each( cases, function ( i, item ) { - $fixture = $( '

            ' ).text( item.text ).highlightText( item.highlight ); - assert.equal( - $fixture.html(), - // Re-parse to normalize - $( '

            ' ).html( item.expected ).html(), - item.desc || undefined - ); - } ); - } ); -}( jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.localize.test.js b/tests/qunit/suites/resources/jquery/jquery.localize.test.js deleted file mode 100644 index 3ef27903..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.localize.test.js +++ /dev/null @@ -1,135 +0,0 @@ -( function ( $, mw ) { - QUnit.module( 'jquery.localize', QUnit.newMwEnvironment() ); - - QUnit.test( 'Handle basic replacements', 4, function ( assert ) { - var html, $lc; - mw.messages.set( 'basic', 'Basic stuff' ); - - // Tag: html:msg - html = '

            '; - $lc = $( html ).localize().find( 'span' ); - - assert.strictEqual( $lc.text(), 'Basic stuff', 'Tag: html:msg' ); - - // Attribute: title-msg - html = '
            '; - $lc = $( html ).localize().find( 'span' ); - - assert.strictEqual( $lc.attr( 'title' ), 'Basic stuff', 'Attribute: title-msg' ); - - // Attribute: alt-msg - html = '
            '; - $lc = $( html ).localize().find( 'span' ); - - assert.strictEqual( $lc.attr( 'alt' ), 'Basic stuff', 'Attribute: alt-msg' ); - - // Attribute: placeholder-msg - html = '
            '; - $lc = $( html ).localize().find( 'input' ); - - assert.strictEqual( $lc.attr( 'placeholder' ), 'Basic stuff', 'Attribute: placeholder-msg' ); - } ); - - QUnit.test( 'Proper escaping', 2, function ( assert ) { - var html, $lc; - mw.messages.set( 'properfoo', '' ); - - // This is handled by jQuery inside $.fn.localize, just a simple sanity checked - // making sure it is actually using text() and attr() (or something with the same effect) - - // Text escaping - html = '
            '; - $lc = $( html ).localize().find( 'span' ); - - assert.strictEqual( $lc.text(), mw.msg( 'properfoo' ), 'Content is inserted as text, not as html.' ); - - // Attribute escaping - html = '
            '; - $lc = $( html ).localize().find( 'span' ); - - assert.strictEqual( $lc.attr( 'title' ), mw.msg( 'properfoo' ), 'Attributes are not inserted raw.' ); - } ); - - QUnit.test( 'Options', 7, function ( assert ) { - mw.messages.set( { - 'foo-lorem': 'Lorem', - 'foo-ipsum': 'Ipsum', - 'foo-bar-title': 'Read more about bars', - 'foo-bar-label': 'The Bars', - 'foo-bazz-title': 'Read more about bazz at $1 (last modified: $2)', - 'foo-bazz-label': 'The Bazz ($1)', - 'foo-welcome': 'Welcome to $1! (last visit: $2)' - } ); - var html, $lc, x, sitename = 'Wikipedia'; - - // Message key prefix - html = '
            '; - $lc = $( html ).localize( { - prefix: 'foo-' - } ).find( 'span' ); - - assert.strictEqual( $lc.attr( 'title' ), 'Lorem', 'Message key prefix - attr' ); - assert.strictEqual( $lc.text(), 'Ipsum', 'Message key prefix - text' ); - - // Variable keys mapping - x = 'bar'; - html = '
            '; - $lc = $( html ).localize( { - keys: { - 'title': 'foo-' + x + '-title', - 'label': 'foo-' + x + '-label' - } - } ).find( 'span' ); - - assert.strictEqual( $lc.attr( 'title' ), 'Read more about bars', 'Variable keys mapping - attr' ); - assert.strictEqual( $lc.text(), 'The Bars', 'Variable keys mapping - text' ); - - // Passing parameteters to mw.msg - html = '
            '; - $lc = $( html ).localize( { - params: { - 'foo-welcome': [sitename, 'yesterday'] - } - } ).find( 'span' ); - - assert.strictEqual( $lc.text(), 'Welcome to Wikipedia! (last visit: yesterday)', 'Passing parameteters to mw.msg' ); - - // Combination of options prefix, params and keys - x = 'bazz'; - html = '
            '; - $lc = $( html ).localize( { - prefix: 'foo-', - keys: { - 'title': x + '-title', - 'label': x + '-label' - }, - params: { - 'title': [sitename, '3 minutes ago'], - 'label': [sitename, '3 minutes ago'] - - } - } ).find( 'span' ); - - assert.strictEqual( $lc.text(), 'The Bazz (Wikipedia)', 'Combination of options prefix, params and keys - text' ); - assert.strictEqual( $lc.attr( 'title' ), 'Read more about bazz at Wikipedia (last modified: 3 minutes ago)', 'Combination of options prefix, params and keys - attr' ); - } ); - - QUnit.test( 'Handle data text', 2, function ( assert ) { - var html, $lc; - mw.messages.set( 'option-one', 'Item 1' ); - mw.messages.set( 'option-two', 'Item 2' ); - html = ''; - $lc = $( html ).localize().find( 'option' ); - assert.strictEqual( $lc.eq( 0 ).text(), mw.msg( 'option-one' ), 'data-msg-text becomes text of options' ); - assert.strictEqual( $lc.eq( 1 ).text(), mw.msg( 'option-two' ), 'data-msg-text becomes text of options' ); - } ); - - QUnit.test( 'Handle data html', 2, function ( assert ) { - var html, $lc; - mw.messages.set( 'html', 'behold... there is a link here!!' ); - html = '
            '; - $lc = $( html ).localize().find( 'a' ); - assert.strictEqual( $lc.length, 1, 'link is created' ); - assert.strictEqual( $lc.text(), 'link', 'the link text got added' ); - } ); -}( jQuery, mediaWiki ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js b/tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js deleted file mode 100644 index 6da56ed2..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js +++ /dev/null @@ -1,287 +0,0 @@ -( function ( mw, $ ) { - var loremIpsum = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.'; - - QUnit.module( 'jquery.makeCollapsible', QUnit.newMwEnvironment() ); - - function prepareCollapsible( html, options ) { - return $( $.parseHTML( html ) ) - .appendTo( '#qunit-fixture' ) - // options might be undefined here - this is okay - .makeCollapsible( options ); - } - - // This test is first because if it fails, then almost all of the latter tests are meaningless. - QUnit.asyncTest( 'testing hooks/triggers', 4, function ( assert ) { - var $collapsible, $content, $toggle; - $collapsible = prepareCollapsible( - '
            ' + loremIpsum + '
            ' - ); - $content = $collapsible.find( '.mw-collapsible-content' ); - $toggle = $collapsible.find( '.mw-collapsible-toggle' ); - - // In one full collapse-expand cycle, each event will be fired once - - // On collapse... - $collapsible.on( 'beforeCollapse.mw-collapsible', function () { - assert.assertTrue( $content.is( ':visible' ), 'first beforeCollapseExpand: content is visible' ); - } ); - $collapsible.on( 'afterCollapse.mw-collapsible', function () { - assert.assertTrue( $content.is( ':hidden' ), 'first afterCollapseExpand: content is hidden' ); - - // On expand... - $collapsible.on( 'beforeExpand.mw-collapsible', function () { - assert.assertTrue( $content.is( ':hidden' ), 'second beforeCollapseExpand: content is hidden' ); - } ); - $collapsible.on( 'afterExpand.mw-collapsible', function () { - assert.assertTrue( $content.is( ':visible' ), 'second afterCollapseExpand: content is visible' ); - - QUnit.start(); - } ); - - // ...expanding happens here - $toggle.trigger( 'click' ); - } ); - - // ...collapsing happens here - $toggle.trigger( 'click' ); - } ); - - QUnit.asyncTest( 'basic operation (
            )', 5, function ( assert ) { - var $collapsible, $content, $toggle; - $collapsible = prepareCollapsible( - '
            ' + loremIpsum + '
            ' - ); - $content = $collapsible.find( '.mw-collapsible-content' ); - $toggle = $collapsible.find( '.mw-collapsible-toggle' ); - - assert.equal( $content.length, 1, 'content is present' ); - assert.equal( $content.find( $toggle ).length, 0, 'toggle is not a descendant of content' ); - - assert.assertTrue( $content.is( ':visible' ), 'content is visible' ); - - $collapsible.on( 'afterCollapse.mw-collapsible', function () { - assert.assertTrue( $content.is( ':hidden' ), 'after collapsing: content is hidden' ); - - $collapsible.on( 'afterExpand.mw-collapsible', function () { - assert.assertTrue( $content.is( ':visible' ), 'after expanding: content is visible' ); - QUnit.start(); - } ); - - $toggle.trigger( 'click' ); - } ); - - $toggle.trigger( 'click' ); - } ); - - QUnit.asyncTest( 'basic operation ()', 7, function ( assert ) { - var $collapsible, $headerRow, $contentRow, $toggle; - $collapsible = prepareCollapsible( - '
            ' + - '' + - '' + - '' + - '
            ' + loremIpsum + '' + loremIpsum + '
            ' + loremIpsum + '' + loremIpsum + '
            ' + loremIpsum + '' + loremIpsum + '
            ' - ); - $headerRow = $collapsible.find( 'tr:first' ); - $contentRow = $collapsible.find( 'tr:last' ); - - $toggle = $headerRow.find( 'td:last .mw-collapsible-toggle' ); - assert.equal( $toggle.length, 1, 'toggle is added to last cell of first row' ); - - assert.assertTrue( $headerRow.is( ':visible' ), 'headerRow is visible' ); - assert.assertTrue( $contentRow.is( ':visible' ), 'contentRow is visible' ); - - $collapsible.on( 'afterCollapse.mw-collapsible', function () { - assert.assertTrue( $headerRow.is( ':visible' ), 'after collapsing: headerRow is still visible' ); - assert.assertTrue( $contentRow.is( ':hidden' ), 'after collapsing: contentRow is hidden' ); - - $collapsible.on( 'afterExpand.mw-collapsible', function () { - assert.assertTrue( $headerRow.is( ':visible' ), 'after expanding: headerRow is still visible' ); - assert.assertTrue( $contentRow.is( ':visible' ), 'after expanding: contentRow is visible' ); - QUnit.start(); - } ); - - $toggle.trigger( 'click' ); - } ); - - $toggle.trigger( 'click' ); - } ); - - function listTest( listType, assert ) { - var $collapsible, $toggleItem, $contentItem, $toggle; - $collapsible = prepareCollapsible( - '<' + listType + ' class="mw-collapsible">' + - '
          1. ' + loremIpsum + '
          2. ' + - '
          3. ' + loremIpsum + '
          4. ' + - '' - ); - $toggleItem = $collapsible.find( 'li.mw-collapsible-toggle-li:first-child' ); - $contentItem = $collapsible.find( 'li:last' ); - - $toggle = $toggleItem.find( '.mw-collapsible-toggle' ); - assert.equal( $toggle.length, 1, 'toggle is present, added inside new zeroth list item' ); - - assert.assertTrue( $toggleItem.is( ':visible' ), 'toggleItem is visible' ); - assert.assertTrue( $contentItem.is( ':visible' ), 'contentItem is visible' ); - - $collapsible.on( 'afterCollapse.mw-collapsible', function () { - assert.assertTrue( $toggleItem.is( ':visible' ), 'after collapsing: toggleItem is still visible' ); - assert.assertTrue( $contentItem.is( ':hidden' ), 'after collapsing: contentItem is hidden' ); - - $collapsible.on( 'afterExpand.mw-collapsible', function () { - assert.assertTrue( $toggleItem.is( ':visible' ), 'after expanding: toggleItem is still visible' ); - assert.assertTrue( $contentItem.is( ':visible' ), 'after expanding: contentItem is visible' ); - QUnit.start(); - } ); - - $toggle.trigger( 'click' ); - } ); - - $toggle.trigger( 'click' ); - } - - QUnit.asyncTest( 'basic operation (
              )', 7, function ( assert ) { - listTest( 'ul', assert ); - } ); - - QUnit.asyncTest( 'basic operation (
                )', 7, function ( assert ) { - listTest( 'ol', assert ); - } ); - - QUnit.test( 'basic operation when synchronous (options.instantHide)', 2, function ( assert ) { - var $collapsible, $content; - $collapsible = prepareCollapsible( - '
                ' + loremIpsum + '
                ', - { instantHide: true } - ); - $content = $collapsible.find( '.mw-collapsible-content' ); - - assert.assertTrue( $content.is( ':visible' ), 'content is visible' ); - - $collapsible.find( '.mw-collapsible-toggle' ).trigger( 'click' ); - - assert.assertTrue( $content.is( ':hidden' ), 'after collapsing: content is hidden' ); - } ); - - QUnit.test( 'mw-made-collapsible data added', 1, function ( assert ) { - var $collapsible; - $collapsible = prepareCollapsible( - '
                ' + loremIpsum + '
                ' - ); - assert.equal( $collapsible.data( 'mw-made-collapsible' ), true, 'mw-made-collapsible data present' ); - } ); - - QUnit.test( 'mw-collapsible added when missing', 1, function ( assert ) { - var $collapsible; - $collapsible = prepareCollapsible( - '
                ' + loremIpsum + '
                ' - ); - assert.assertTrue( $collapsible.hasClass( 'mw-collapsible' ), 'mw-collapsible class present' ); - } ); - - QUnit.test( 'mw-collapsed added when missing', 1, function ( assert ) { - var $collapsible; - $collapsible = prepareCollapsible( - '
                ' + loremIpsum + '
                ', - { collapsed: true } - ); - assert.assertTrue( $collapsible.hasClass( 'mw-collapsed' ), 'mw-collapsed class present' ); - } ); - - QUnit.asyncTest( 'initial collapse (mw-collapsed class)', 2, function ( assert ) { - var $collapsible, $content; - $collapsible = prepareCollapsible( - '
                ' + loremIpsum + '
                ' - ); - $content = $collapsible.find( '.mw-collapsible-content' ); - - // Synchronous - mw-collapsed should cause instantHide: true to be used on initial collapsing - assert.assertTrue( $content.is( ':hidden' ), 'content is hidden' ); - - $collapsible.on( 'afterExpand.mw-collapsible', function () { - assert.assertTrue( $content.is( ':visible' ), 'after expanding: content is visible' ); - QUnit.start(); - } ); - - $collapsible.find( '.mw-collapsible-toggle' ).trigger( 'click' ); - } ); - - QUnit.asyncTest( 'initial collapse (options.collapsed)', 2, function ( assert ) { - var $collapsible, $content; - $collapsible = prepareCollapsible( - '
                ' + loremIpsum + '
                ', - { collapsed: true } - ); - $content = $collapsible.find( '.mw-collapsible-content' ); - - // Synchronous - collapsed: true should cause instantHide: true to be used on initial collapsing - assert.assertTrue( $content.is( ':hidden' ), 'content is hidden' ); - - $collapsible.on( 'afterExpand.mw-collapsible', function () { - assert.assertTrue( $content.is( ':visible' ), 'after expanding: content is visible' ); - QUnit.start(); - } ); - - $collapsible.find( '.mw-collapsible-toggle' ).trigger( 'click' ); - } ); - - QUnit.test( 'clicks on links inside toggler pass through (options.linksPassthru)' , 2, function ( assert ) { - var $collapsible, $content; - - $collapsible = prepareCollapsible( - '
                ' + - '
                ' + - 'Toggle toggle toggle toggle' + - '
                ' + - '
                ' + loremIpsum + '
                ' + - '
                ', - // Can't do asynchronous because we're testing that the event *doesn't* happen - { instantHide: true } - ); - $content = $collapsible.find( '.mw-collapsible-content' ); - - $collapsible.find( '.mw-collapsible-toggle a' ).trigger( 'click' ); - assert.assertTrue( $content.is( ':visible' ), 'click event on link inside toggle passes through (content not toggled)' ); - - $collapsible.find( '.mw-collapsible-toggle b' ).trigger( 'click' ); - assert.assertTrue( $content.is( ':hidden' ), 'click event on non-link inside toggle toggles content' ); - } ); - - QUnit.asyncTest( 'collapse/expand text (data-collapsetext, data-expandtext)', 2, function ( assert ) { - var $collapsible, $toggleLink; - $collapsible = prepareCollapsible( - '
                ' + - loremIpsum + - '
                ' - ); - $toggleLink = $collapsible.find( '.mw-collapsible-toggle a' ); - - assert.equal( $toggleLink.text(), 'Collapse me!', 'data-collapsetext is respected' ); - - $collapsible.on( 'afterCollapse.mw-collapsible', function () { - assert.equal( $toggleLink.text(), 'Expand me!', 'data-expandtext is respected' ); - QUnit.start(); - } ); - - $collapsible.find( '.mw-collapsible-toggle' ).trigger( 'click' ); - } ); - - QUnit.asyncTest( 'collapse/expand text (options.collapseText, options.expandText)', 2, function ( assert ) { - var $collapsible, $toggleLink; - $collapsible = prepareCollapsible( - '
                ' + loremIpsum + '
                ', - { collapseText: 'Collapse me!', expandText: 'Expand me!' } - ); - $toggleLink = $collapsible.find( '.mw-collapsible-toggle a' ); - - assert.equal( $toggleLink.text(), 'Collapse me!', 'options.collapseText is respected' ); - - $collapsible.on( 'afterCollapse.mw-collapsible', function () { - assert.equal( $toggleLink.text(), 'Expand me!', 'options.expandText is respected' ); - QUnit.start(); - } ); - - $collapsible.find( '.mw-collapsible-toggle' ).trigger( 'click' ); - } ); - -}( mediaWiki, jQuery ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.mwExtension.test.js b/tests/qunit/suites/resources/jquery/jquery.mwExtension.test.js deleted file mode 100644 index 7571b929..00000000 --- a/tests/qunit/suites/resources/jquery/jquery.mwExtension.test.js +++ /dev/null @@ -1,57 +0,0 @@ -( function ( $ ) { - QUnit.module( 'jquery.mwExtension', QUnit.newMwEnvironment() ); - - QUnit.test( 'String functions', 7, function ( assert ) { - assert.equal( $.trimLeft( ' foo bar ' ), 'foo bar ', 'trimLeft' ); - assert.equal( $.trimRight( ' foo bar ' ), ' foo bar', 'trimRight' ); - assert.equal( $.ucFirst( 'foo' ), 'Foo', 'ucFirst' ); - - assert.equal( $.escapeRE( '