Commit graph

11 commits

Author SHA1 Message Date
Roan Kattouw
e5a9b38294 Make Language::formatTimePeriod() more flexible so it can produce stuff like '3 hours ago'.
* Add a $noAbbrevs parameter that causes the 'seconds', 'minutes', etc. messages to be used instead of the 'seconds-abbrev', 'minutes-abbrev', etc. messages
* Add the 'seconds', 'minutes', 'hours' and 'days' messages
* Change the -abbrev messages to take a parameter rather than having the number prepended to them. This is for compatibility with 'seconds' et al, which need the parameter for {{PLURAL:}}. It also generally makes more sense. This does BREAK the messages in non-English languages that override them; Niklas told me to leave this alone and ping the TranslateWiki folks
* Introduce an 'ago' message for '$1 ago'. Not currently used in core, but I want to use it in an extension and it seemed stupid not to have such a thing in core.
* Refactor the function to use message objects and pass the number as a parameter
* Add tests! They exposed a subtle bug in my first iteration; all hail tests!
2011-09-23 22:17:10 +00:00
Roan Kattouw
e9e287d1de Rewrite testFormatTimePeriod() with a data provider 2011-09-23 22:02:36 +00:00
Roan Kattouw
6a8cb49f82 Per CR on r90915, fix the description of one of the assertions 2011-08-20 09:59:00 +00:00
Antoine Musso
854b84ef42 enhance tests name (for --testdox option) 2011-07-03 18:09:30 +00:00
Aaron Schulz
bc6aaa19ed * Added truncate() & truncateHTML() tests
* Some fixes/changes to truncateHTML() based on tests
** Something like "<span>hello</span>" ends up as "<span>...</span>" instead of just "..." for relevant cases)
** If we get something like "<span></span" in, just return it back instead of ""
* Renamed $dispLength -> $dispLen in truncateHTML()
2011-06-28 01:09:02 +00:00
Aaron Schulz
ac5f7b3127 Added formatTimePeriod() tests for r90385 and made some fixes 2011-06-27 22:32:58 +00:00
Chad Horohoe
db833df9dc Remove useless bootstrap inclusions 2011-06-03 04:25:21 +00:00
Antoine Musso
0330258617 Underscore are not valid in language code
* Reject underscore in validation
* Still case unsensitive
* Corrected tests using underscore


Follow up r83160 which was a follow up of r82927 (language code validation)
2011-03-04 17:16:09 +00:00
Antoine Musso
93348f39d4 Fix language code validation (from r82927)
A language code may contains the underscore character (be_tarask)
and might as well be upper case (FR).

Add tests for Language::isValidBuiltInCode() against some language codes
2011-03-03 19:13:57 +00:00
Chad Horohoe
5f528203aa Rename MediaWikiTestSetup to MediaWikiTestCase: this is going to be the base class for all unit tests from now on 2010-12-28 17:45:33 +00:00
Chad Horohoe
23f69f10ed Per wikitech-l discussion: Move tests from maintenance/tests/ to tests/. They're not strictly maintenance scripts, and some people want to do a selective checkout that doesn't include the tests. There's still debate on whether we should include these in the release downloads, but we had a pretty firm consensus to move this. 2010-12-14 16:26:35 +00:00