When creating ServiceOptions objects or fake HashConfigs use the constant to refer the config name Change-Id: I59a29f25b76e896c07e82156c6cc4494f98e64cc
33 lines
1,008 B
PHP
33 lines
1,008 B
PHP
<?php
|
|
|
|
use MediaWiki\Config\ServiceOptions;
|
|
use MediaWiki\JobQueue\JobQueueGroupFactory;
|
|
use MediaWiki\MainConfigNames;
|
|
use Wikimedia\UUID\GlobalIdGenerator;
|
|
|
|
/**
|
|
* @covers \MediaWiki\JobQueue\JobQueueGroupFactory
|
|
*/
|
|
class JobQueueGroupFactoryTest extends MediaWikiUnitTestCase {
|
|
public function testMakeJobQueueGroupReturnsSameInstance(): void {
|
|
$factory = new JobQueueGroupFactory(
|
|
new ServiceOptions(
|
|
JobQueueGroupFactory::CONSTRUCTOR_OPTIONS,
|
|
new HashConfig( [
|
|
MainConfigNames::LocalDatabases => [],
|
|
MainConfigNames::JobClasses => [],
|
|
MainConfigNames::JobTypeConf => [],
|
|
MainConfigNames::JobTypesExcludedFromDefaultQueue => []
|
|
] )
|
|
),
|
|
$this->createMock( ConfiguredReadOnlyMode::class ),
|
|
$this->createMock( IBufferingStatsdDataFactory::class ),
|
|
$this->createMock( WANObjectCache::class ),
|
|
$this->createMock( GlobalIdGenerator::class )
|
|
);
|
|
|
|
$group = $factory->makeJobQueueGroup();
|
|
|
|
$this->assertSame( $group, $factory->makeJobQueueGroup() );
|
|
}
|
|
}
|