Page MenuHomePhabricator

ReadingLists Action API tests pass User object to the $appendModule param in ApiTestCase::doApiRequest()
Closed, ResolvedPublic1 Estimated Story PointsBUG REPORT

Description

The method signature in core, which likely dates back to 2021, when the parameters were changed in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/697685

	protected function doApiRequest( array $params, ?array $session = null,
		$appendModule = false, ?Authority $performer = null, $tokenType = null,
		$paramPrefix = null
	) {

In ApiQueryReadingListEntriesTest.php and ApiQueryReadingListsTest.php, there is:

$result = $this->doApiRequest( $this->apiParams, null, $this->user );

This results in the $performer not being set and defaulting to what is set in doApiRequest (which seems to work since tests pass) and appendModule is interpreted as being true.

Event Timeline

Change #1271805 had a related patch set uploaded (by Aude; author: Aude):

[mediawiki/extensions/ReadingLists@master] Fix ApiTestCase::doApiRequest method call in ReadingLists tests

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

Change #1271805 merged by jenkins-bot:

[mediawiki/extensions/ReadingLists@master] Fix ApiTestCase::doApiRequest method call in ReadingLists tests

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

aude triaged this task as Medium priority.Apr 16 2026, 7:28 PM
aude set the point value for this task to 1.
Jdlrobson-WMF claimed this task.