Improve Xml::languageSelector: add parameters to change label message and id/name of the select tag.
Use languageSelector in SpecialAllmessages (less code duplication)
Patchset 10 July: add tests per MaxSem; add version for new parameters and change the message parameter to require a Message object per Nikerabbit
Change-Id: I7fbb29ee2dc37a2b6a5e2cfc88207a0b47b83e9b
Since we're here: nothing uses $namespaceNames, $mNamespaceIds or $namespaceAliases
outside of this class (core or extensions) so lets make it protected.
* Previously it was passing $selectAttribs['name'] to Xml::label, which uses its value for the <label for=""> attribute. This works as long as $selectAttribs['id'] and $selectAttribs['name'] match, but when they don't it fails. <label for=""> always corresponds with <{input,text area,select} id=""> in browsers, never with "name".
* Make name/id match eachother by default to avoid backwards compatibility breakages (they used to match in the Xml class method as well)
* Add HtmlTest.php entries similar to the ones in XmlTest
* Fix E_NOTICE about $params['selected'], default to ''
-- Follows-up r109974, r109698, r109990
-- Bug originally introduced in r41425
-- XmlTest.php still runs successfully
-- HtmlTest.php runs successfully
* This is in preparation for deprecating this in favor of an Html:: method soon, making sure here that tests still match afterwards
* Follows-up r109698
PHPUnit seems to only accept one class per test file. This patch move the
XmlSelect class to a new file.
It also add some assertions for XmlSelect::addOption(). Please review them
carefully! Although the assertions are fine:
OK (5 tests, 5 assertions)
I am not sure they are the expected behaviour.