* DeprecatedHooksTest: Don't use assertContains().
* Replace uses of deprecated asserts:
- assertFileNotExists() -> assertFileDoesNotExist()
* Update hierarchy of MediaWikiPHPUnitResultPrinter, since ResultPrinter
is an interface in PHPUnit 9.
* Remove temporary forward-compat methods.
* Remove directories that don't exist from tests/phpunit/suite.xml, since
they now make PHPUnit exit:
- tests/phpunit/skins, it used to have SideBarTest, then moved to
tests/phpunit/includes/skins
- tests/phpunit/documentation, it used to have ReleaseNotesTest, then
moved to tests/phpunit/unit/documentation
* Update configuration with --migrate-configuration and reformat.
* Avoid redefining getMockBuilder() in
ActionModuleBasedHandlerTestTrait, use a @method annotation instead.
* In RCCacheEntryFactoryTest, avoid using internal PHPUnit logic for
HTML validation, and use native PHP methods instead. The code was
copied from Xml::load (moved to \Xml\Loader::load in PHPUnit 9) and
simplified for this use case.
Bug: T243600
Bug: T262076
Change-Id: I851b9158b73d0cfc315eed9d63b15c54b05895e3
And also assertNotRegExp -> assertDoesNotMatchRegularExpression. The
methods were renamed in PHPUnit 9.
Done automatically with:
grep -rl assertRegExp tests/ | xargs sed -r -i "s/>assertRegExp\(/>assertMatchesRegularExpression\(/"
grep -rl assertNotRegExp tests/ | xargs sed -r -i "s/>assertNotRegExp\(/>assertDoesNotMatchRegularExpression\(/"
Split out from Ifdba0f9e98eb6bce4590b7eb73170c51a697d7c6 so that it
remains smaller and easier to review.
Also make a test use MediaWikiUnitTestCase (it's already in the unit/
dir) so that it can access the forward-compat method.
Bug: T243600
Change-Id: Ifa279d5f201d7abeebece292141ebface8278046
Use the content language from the header, and give that the highest
priority when identifying the page language.
Bug: T317019
Change-Id: Ibb0671f1b873ef83a4d53824a9c4c17726e68635
assertRegExp was deprecated in PHPUnit 9 and its replacement,
assertMatchesRegularExpression, was also introduced in PHPUnit 9. Hence,
we cannot migrate callers before the upgrade, but we also can't upgrade
before callers are migrated due to deprecation warnings. This is
especially true in extensions.
So create a temporary method that extensions can use while we
transition.
Bug: T243600
Change-Id: Ibce4c2479a533d132eb9f0641f8473fc6ca14fdb
The GlobalPreferences extension are using types for the denylist and
classes for the allowlist, while every derivative class of HTMLFormField
defined in the core have a valid type registered.
So, we should use type instead of class here, which all the other fields
did.
Bug: T320238
Change-Id: I1cc59eaf6ed8ac1505eb79c6ecfc7f137c8e17a8
With PHPUnit 9, tests without @covers tags are considered risky and emit
warnings. Not having @covers is bad practice anyway, so use
@coversNothing instead to make the intention clear, and re-enable the
phpcs rule.
Also rewrite an assertion in ResourcesTest that was bothering me.
Bug: T243600
Change-Id: I6dd683f93b6b2faed5f107be2ca7860602277fbc
Code a couple of lines below is dependant on $title
existing and having an id, but that's not explicitly
being checked.
If the result is not a valid title, there isn't going
to be a thumbnail for it.
Bug: T319798
Change-Id: I22c2ab886b3a1b1fdf2df062ffa76cd00d4d25fd
This is needed by VE when performing Wikitext -> HTML transformation
during editing.
Also, this patch introduces the new flavor: fragment, that is passed in
via $envOptions to activate VisualEditor's body only mode functionality.
NOTE: This patch also fixes a PHPUnit test that broke by correctly
injecting the appropriate parsoid instance for checking error handling.
Bug: T308743
Change-Id: I838a3b05d7d8523a469236cf112158349063283c
- [x] Reduce Namespace width on all skins
- [x] Make sure vector legacy is unaffected
Bug: T319392
Change-Id: I6725e04479129a90fe956f389e35f2a3dfe25b6a
The runOnSkinTemplateNavigationHooks hook is used by skins to make final modifications
to the list of menu items, so we should check whether the hook changed namespaces inside
there rather than outside.
Due to this mistake tabs disappeared from Special:Homepage
Bug: T319396
Change-Id: I81bcbf509eafdb6451849df62c52f411fba53fe5