mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-27 17:01:07 +00:00
Conditionally skip tests that depend on Wikibase
While investigating the dependency between Math and Wikibase, it turned out there was a hard dependency in the test code. This change makes the availability of the Wikibase Extension optional and conditionally skips tests. Bug: T362027 Change-Id: I9401d7d4a3277b6923dcd81f411ac5a08f1242d2
This commit is contained in:
parent
23a8d519a5
commit
0f11a20d8f
|
@ -3,6 +3,7 @@
|
|||
namespace MediaWiki\Extension\Math\Tests;
|
||||
|
||||
use DataValues\StringValue;
|
||||
use ExtensionRegistry;
|
||||
use Language;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
use MediaWiki\Extension\Math\MathFormatter;
|
||||
|
@ -51,6 +52,15 @@ class MathWikibaseConnectorTestFactory extends MediaWikiUnitTestCase {
|
|||
]
|
||||
];
|
||||
|
||||
public static function setUpBeforeClass(): void {
|
||||
ExtensionRegistry::enableForTest();
|
||||
if ( !ExtensionRegistry::getInstance()->isLoaded( 'WikibaseClient' ) ) {
|
||||
self::markTestSkipped( 'WikibaseClient is not installed. Skipping tests.' );
|
||||
}
|
||||
ExtensionRegistry::disableForTest();
|
||||
parent::setUpBeforeClass();
|
||||
}
|
||||
|
||||
public function getWikibaseConnectorWithExistingItems(
|
||||
EntityRevision $entityRevision,
|
||||
bool $storageExceptionOnQ3 = false,
|
||||
|
|
Loading…
Reference in a new issue