Page MenuHomePhabricator

CategoriesRdfTest mocks getCategoryIterator and getCategoryLinksIterator to be an array
Closed, DeclinedPublic

Description

This means that https://gerrit.wikimedia.org/r/c/mediawiki/core/+/624786/2/maintenance/dumpCategoriesAsRdf.php#167 fails

18:21:10 1) MediaWiki\Tests\Maintenance\CategoriesRdfTest::testCategoriesDump
18:21:10 Error: Call to a member function setCaller() on array
18:21:10 
18:21:10 /workspace/src/maintenance/dumpCategoriesAsRdf.php:152
18:21:10 /workspace/src/tests/phpunit/maintenance/categoriesRdfTest.php:90
18:21:10 /workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:446
18:21:10 /workspace/src/tests/phpunit/phpunit.php:75
18:21:10 /workspace/src/maintenance/doMaintenance.php:107
18:21:10 /workspace/src/tests/phpunit/phpunit.php:134

As it's not a BatchRowIterator... It's now just an array. It works fine for the PHP code as is, but breaks other stuff...

Is there a better way we can mock BatchRowIterator for this test?

Created in T157676: Provide access to category information from WDQS SPARQL

Event Timeline

Adds complexity to the test for little gain... Other ways we can structure the callers to not have this issue