Skip to content

Commit 184bc5c

Browse files
committed
RandomTest.php
- handle module name based on MediaWiki version
1 parent 8b2f024 commit 184bc5c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tests/phpunit/Unit/Api/IncrementTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
class IncrementTest extends TestCase {
2424

2525
public function testGetExamples() {
26+
// Handle module name based on MediaWiki version
2627
$moduleName = version_compare( MW_VERSION, '1.40', '>=' ) ? 'idprovider-increment' : null;
2728

2829
$increment = new Increment( new ApiMain(), $moduleName );

tests/phpunit/Unit/Api/RandomTest.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
class RandomTest extends TestCase {
2424

2525
public function testGetExamples() {
26-
$random = new Random( new ApiMain(), null );
26+
// Handle module name based on MediaWiki version
27+
$moduleName = version_compare( MW_VERSION, '1.40', '>=' ) ? 'idprovider-random' : null;
28+
29+
$random = new Random( new ApiMain(), $moduleName );
2730
$messages = $random->getExamplesMessages();
2831
$this->assertCount( 2, $messages );
2932
}

0 commit comments

Comments
 (0)