diff --git a/tests/phpunit/unit/MathWikibaseConnectorTestFactory.php b/tests/phpunit/unit/MathWikibaseConnectorTestFactory.php index 6bc6fae1a..90901d1df 100644 --- a/tests/phpunit/unit/MathWikibaseConnectorTestFactory.php +++ b/tests/phpunit/unit/MathWikibaseConnectorTestFactory.php @@ -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; @@ -50,6 +51,13 @@ class MathWikibaseConnectorTestFactory extends MediaWikiUnitTestCase { ] ]; + public static function setUpBeforeClass(): void { + if ( !ExtensionRegistry::getInstance()->isLoaded( 'WikibaseClient' ) ) { + self::markTestSkipped( 'WikibaseClient is not installed. Skipping tests.' ); + } + parent::setUpBeforeClass(); + } + public function getWikibaseConnectorWithExistingItems( EntityRevision $entityRevision, bool $storageExceptionOnQ3 = false,