mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-23 23:25:02 +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
(cherry picked from commit 0f11a20d8f
)
This commit is contained in:
parent
a8e8717bb9
commit
354393b670
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue