Commit 2efba3a2 authored by voleger's avatar voleger
Browse files

Issue #3224274 by voleger: Issue with config override

parent 5a0fbba1
......@@ -18,9 +18,9 @@ use Drupal\Core\Queue\QueueWorkerManager as CoreQueueWorkerManager;
class QueueWorkerManager extends CoreQueueWorkerManager {
/**
* The module config.
* Config factory.
*
* @var \Drupal\Core\Config\ImmutableConfig
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $config;
......@@ -39,14 +39,14 @@ class QueueWorkerManager extends CoreQueueWorkerManager {
*/
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config) {
parent::__construct($namespaces, $cache_backend, $module_handler);
$this->config = $config->get('queue_order.settings');
$this->config = $config;
}
/**
* {@inheritdoc}
*/
public function getDefinitions() {
return self::sortDefinitions(parent::getDefinitions(), $this->config->get('order') ?: []);
return self::sortDefinitions(parent::getDefinitions(), $this->config->get('queue_order.settings')->get('order') ?: []);
}
/**
......
......@@ -3,4 +3,3 @@ type: module
description: 'Provides testing definitions for Queue Order module'
package: Testing
core_version_requirement: ^8.8 || ^9
<?php
namespace Drupal\Tests\queue_order\Functional;
use Drupal\Tests\BrowserTestBase;
namespace Drupal\Tests\queue_order\Kernel;
/**
* Class DefinitionsWithModuleTest.
......@@ -11,12 +9,7 @@ use Drupal\Tests\BrowserTestBase;
*
* @group queue_order
*/
class DefinitionsWithOverridesTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
class DefinitionsWithOverridesTest extends DefinitionsWithoutModuleTest {
/**
* {@inheritdoc}
......@@ -26,17 +19,11 @@ class DefinitionsWithOverridesTest extends BrowserTestBase {
'queue_order',
];
/**
* Queue Worker Manager service.
*
* @var \Drupal\Core\Queue\QueueWorkerManagerInterface
*/
protected $queueWorkerManager;
/**
* Expected order list.
*
* @var string[]
* @see queue_order_overrides_fixtures/config/install/queue_order.settings.yml
*/
protected $orderedList = [
'queue_order_worker_F',
......@@ -52,6 +39,7 @@ class DefinitionsWithOverridesTest extends BrowserTestBase {
*/
protected function setUp(): void {
parent::setUp();
$this->installConfig(['queue_order_overrides_fixtures']);
$this->queueWorkerManager = \Drupal::service('plugin.manager.queue_worker');
}
......@@ -59,6 +47,7 @@ class DefinitionsWithOverridesTest extends BrowserTestBase {
* Test equality of Queue Worker definition order.
*/
public function testOrder() {
$this->assertNotEmpty(\Drupal::configFactory()->get('queue_order.settings')->get());
$this->assertEquals(
$this->orderedList,
array_keys($this->queueWorkerManager->getDefinitions()),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment