Page MenuHomePhabricator

Support running unit tests and extending MediaWikiUnitTestCase in skins and extensions
Closed, ResolvedPublic

Description

Plan is to:

  • Modify phpunit.xml.dist to support finding tests in extensions/**/tests/phpunit/unit
  • Add some code that runs before the testsuite to iterate over all extensions and skins, and call ExtensionRegistry::getInstance()->queue( $path ) followed by ExtensionRegistry::getInstance()->loadFromQueue()

Event Timeline

Cool! I’ll try to post something later today.

Change 519796 had a related patch set uploaded (by Kosta Harlan; owner: Kosta Harlan):
[mediawiki/core@master] (wip) Unit tests: Support unit tests in extensions and skins

https://gerrit.wikimedia.org/r/519796

Change 519796 merged by jenkins-bot:
[mediawiki/core@master] Unit tests: Support unit tests in extensions and skins

https://gerrit.wikimedia.org/r/519796

Change 520193 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/Wikibase@master] Move trivial unit tests to the new structure

https://gerrit.wikimedia.org/r/520193

Change 520212 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/MobileFrontend@master] Migrate unit tests to the new structure

https://gerrit.wikimedia.org/r/520212

Change 520212 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Migrate unit tests to the new structure

https://gerrit.wikimedia.org/r/520212

Done via the patches above.

Change 530809 had a related patch set uploaded (by Kosta Harlan; owner: Kosta Harlan):
[mediawiki/core@master] Unit tests: Remove duplicated code in ExtensionRegistry

https://gerrit.wikimedia.org/r/530809

Change 531352 had a related patch set uploaded (by Kosta Harlan; owner: Kosta Harlan):
[mediawiki/core@master] ExtensionRegistry: Remove exportAutoloadClassesAndNamespaces

https://gerrit.wikimedia.org/r/531352

Change 530809 merged by jenkins-bot:
[mediawiki/core@master] Unit tests: Remove duplicated code in ExtensionRegistry

https://gerrit.wikimedia.org/r/530809

Change 531352 abandoned by Kosta Harlan:
[mediawiki/core@master] ExtensionRegistry: Remove exportAutoloadClassesAndNamespaces

Reason:

https://gerrit.wikimedia.org/r/531352

Change 520193 abandoned by Ladsgroup:

[mediawiki/extensions/Wikibase@master] Move trivial unit tests to the new structure

Reason:

This is done mostly through other patches.

https://gerrit.wikimedia.org/r/520193