Page MenuHomePhabricator

Update StructureTest to find non-fully qualified PHPUnit\Framework\TestCase
Closed, ResolvedPublic

Description

See T188011#4001934 - the structure test currently checks for a regex (https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/master/tests/phpunit/structure/StructureTest.php#28) that should be updated to detect non-qualified TestCase.

We might want to just check for a suffix of TestCase to support extension TestCases as well?

Event Timeline

Legoktm raised the priority of this task from Low to Medium.
Legoktm created this task.

Change 414717 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/core@master] Accept non-fully qualified TestCase in StructureTest

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

We might want to just check for a suffix of TestCase to support extension TestCases as well?

Sounds reasonable – this would also make a few other list elements (MediaWikiTestCase, MediaWikiLangTestCase, …) obsolete.

(Side note: IIUC, StructureTest currently misses tests that extend \MediaWikiTestCase, due to the backslash.)

DumpTestCase is also namespaced since https://gerrit.wikimedia.org/r/#/c/404512/

The backslash could be moved before the regex to fix all that cases

Change 414717 merged by jenkins-bot:
[mediawiki/core@master] Accept non-fully qualified TestCase in StructureTest

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