aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/libs/Message
Commit message (Collapse)AuthorAgeFilesLines
* Move libs/Message tests under unit testsDannyS7122021-03-015-428/+0
| | | | | | | Do not rely on integration, and extends the base PHPUnit\Framework\TestCase Change-Id: Ib3d53e1611dbaa6c684c5393f94e7f199daa34d8
* Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUseJames D. Forrester2020-01-101-1/+1
| | | | Change-Id: I94a0ae83c65e8ee419bbd1ae1e86ab21ed4d8210
* libs/Message: Fix value of ParamType::DURATION_SHORTBrad Jorsch2019-11-251-2/+2
| | | | | | | | | | | | The values of the constants are supposed to match the keys used for the corresponding special parameters to Message. This one was different. Note the values of these constants are considered an internal implementation detail, as is the format of the XML-ish output of MessageValue::dump(), so we don't have to worry about compatibility when changing it here. Change-Id: If5a7279e661df8c13780552d1dee752215e1d497
* libs/Message: Add DataMessageValueBrad Jorsch2019-10-171-0/+59
| | | | | | | MediaWiki's ApiMessage was a hack, but a useful one. Let's provide that functionality here without it being a hack. Change-Id: Icaf88950ae6e083fc1fb89a3cadbb7f353822eaf
* libs/Message: Add static constructorBrad Jorsch2019-10-171-0/+6
| | | | | | | When chaining ->params() methods, this is more convenient than having to put extra parentheses around the "new". Change-Id: I34845310e6bfdfbf1924b27eb58a734f2991fe13
* libs/Message: Improve parameter validationBrad Jorsch2019-10-171-0/+25
| | | | | | | Validate that all parameters are of expected types, not just list parameter values. Change-Id: Id47c6f9ad1cf3a3dfc1f6d0c3766ba607c4ef633
* libs/Message: Improve testsBrad Jorsch2019-10-174-6/+124
| | | | | | | | | If code in libs isn't supposed to depend on stuff outside of libs, then that code's tests shouldn't either. Also, let's explicitly test MessageParam and its subclasses. Change-Id: I87b7c6aabea5bdb694cc598a412e0428cd78a68a
* libs/Message: Improve documentationBrad Jorsch2019-08-291-5/+6
| | | | | | | | | | | | Among other things, this removed mention of MediaWiki classes from the library and adds a README.md that attempts to define constraints for interoperability between libraries producing MessageValues and formatter implementations that are expected to handle them. This also renames "TextParam" to "ScalarParam", as that seems a more accurate name for the class. Change-Id: I264dd4de394d734a87929cf4740779e7b7d0e04a
* MessageFormatterFactoryTim Starling2019-08-281-0/+219
An injectable service interface for message formatting, somewhat narrowed compared to Message. Only the text format is implemented in this framework so far, with getTextFormatter() returning a formatter that converts to the text format. Other formatters could be added to MessageFormatterFactory. Bug: T226598 Change-Id: Id053074c1dbcb692e8309fdca602f94a385bca0c