Page MenuHomePhabricator

ArticlePlaceholder tests fail when Wikibase is not present
Open, Needs TriagePublic

Description

ArticlePlaceholder does not require Wikibase in extension.json. Running the tests fail though when it is not loaded:

There were 22 errors:

1) ArticlePlaceholder\Tests\SearchHookHandlerTest::testNewFromGlobalState
Error: Class "Wikibase\Client\WikibaseClient" not found

/workspace/src/extensions/ArticlePlaceholder/includes/SearchHookHandler.php:54
/workspace/src/vendor/wikimedia/testing-access-wrapper/src/TestingAccessWrapper.php:114
/workspace/src/extensions/ArticlePlaceholder/tests/phpunit/includes/SearchHookHandlerTest.php:134
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"Wikimedia\\ObjectCache\\HashBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
===

2) ArticlePlaceholder\Tests\SearchHookHandlerTest::testAddToSearch with data set #0 ('get term, check if entity wit...turned', 'Unicorn', '>Q7246 en label</a>: Q7246 en...</div>')
Error: Class "Wikibase\Lib\Interactors\MatchingTermsLookupSearchInteractor" not found

/workspace/src/extensions/ArticlePlaceholder/tests/phpunit/includes/SearchHookHandlerTest.php:90
/workspace/src/extensions/ArticlePlaceholder/tests/phpunit/includes/SearchHookHandlerTest.php:119
/workspace/src/extensions/ArticlePlaceholder/tests/phpunit/includes/SearchHookHandlerTest.php:163
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"Wikimedia\\ObjectCache\\HashBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
===
...