Revert "Issue #3419914 by Spokje, longwave, andypost, smustgrave: Remove UpdateHookRegistryFactory and UpdateRegistryFactory services"

This reverts commit e5c3c870e3.
merge-requests/4324/merge
Dave Long 2024-03-04 09:14:28 +00:00
parent 589b8fe870
commit f41e428e8a
No known key found for this signature in database
GPG Key ID: ED52AE211E142771
8 changed files with 108 additions and 340 deletions

View File

@ -1788,19 +1788,17 @@ services:
Drupal\Component\Utility\EmailValidatorInterface: '@email.validator'
update.update_hook_registry:
class: Drupal\Core\Update\UpdateHookRegistry
arguments: ['%container.modules%', '@keyvalue']
factory: ['@update.update_hook_registry_factory', create]
Drupal\Core\Update\UpdateHookRegistry: '@update.update_hook_registry'
update.update_hook_registry_factory:
class: Drupal\Core\Update\UpdateHookRegistryFactory
parent: container.trait
deprecated: The "%service_id%" service is deprecated. You should use the 'update.update_hook_registry' service instead. See https://www.drupal.org/node/3423659
update.post_update_registry:
class: Drupal\Core\Update\UpdateRegistry
arguments: [ '%app.root%', '%site.path%', '%container.modules%', '@keyvalue', '@theme_handler' ]
factory: ['@update.post_update_registry_factory', create]
update.post_update_registry_factory:
class: Drupal\Core\Update\UpdateRegistryFactory
parent: container.trait
deprecated: The "%service_id%" service is deprecated. You should use the 'update.post_update_registry' service instead. See https://www.drupal.org/node/3423659
uuid:
class: Drupal\Component\Uuid\Php
Drupal\Component\Uuid\UuidInterface: '@uuid'

View File

@ -2,7 +2,6 @@
namespace Drupal\Core\Update;
use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
/**
@ -51,24 +50,16 @@ class UpdateHookRegistry {
protected $allAvailableSchemaVersions = [];
/**
* Constructs a new UpdateHookRegistry.
* Constructs a new UpdateRegistry.
*
* @param array $module_list
* An associative array whose keys are the names of installed modules.
* @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface|\Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_factory
* The key value factory.
* @param string[] $enabled_modules
* A list of enabled modules.
* @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $key_value
* The key value store.
*/
public function __construct(array $module_list, KeyValueStoreInterface|KeyValueFactoryInterface $key_value_factory) {
if ($module_list !== [] && array_is_list($module_list)) {
@trigger_error('Calling ' . __METHOD__ . '() with the $enabled_modules argument is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use an associative array whose keys are the names of installed modules instead. See https://www.drupal.org/node/3423659', E_USER_DEPRECATED);
$module_list = \Drupal::service('module_handler')->getModuleList();
}
if ($key_value_factory instanceof KeyValueStoreInterface) {
@trigger_error('Calling ' . __METHOD__ . '() with the $key_value_factory argument as a KeyValueStoreInterface instead of a KeyValueFactoryInterface is deprecated in drupal:10.3.0 and it will be required in drupal:11.0.0. See https://www.drupal.org/node/3423659', E_USER_DEPRECATED);
$key_value_factory = \Drupal::service('keyvalue');
}
$this->enabledModules = array_keys($module_list);
$this->keyValue = $key_value_factory->get('system.schema');
public function __construct(array $enabled_modules, KeyValueStoreInterface $key_value) {
$this->enabledModules = $enabled_modules;
$this->keyValue = $key_value;
}
/**

View File

@ -7,22 +7,11 @@ use Symfony\Component\DependencyInjection\ContainerAwareTrait;
/**
* Service factory for the versioning update registry.
*
* @deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use
* \Drupal\Core\Update\UpdateHookRegistry instead.
*
* @see https://www.drupal.org/node/3423659
*/
class UpdateHookRegistryFactory implements ContainerAwareInterface {
use ContainerAwareTrait;
/**
* {@inheritdoc}
*/
public function __construct() {
}
/**
* Creates a new UpdateHookRegistry instance.
*
@ -30,10 +19,9 @@ class UpdateHookRegistryFactory implements ContainerAwareInterface {
* The update registry instance.
*/
public function create() {
@trigger_error(__NAMESPACE__ . '\UpdateHookRegistryFactory is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Update\UpdateHookRegistry instead. See https://www.drupal.org/node/3423659', E_USER_DEPRECATED);
return new UpdateHookRegistry(
$this->container->get('module_handler')->getModuleList(),
$this->container->get('keyvalue')
array_keys($this->container->get('module_handler')->getModuleList()),
$this->container->get('keyvalue')->get('system.schema')
);
}

View File

@ -6,8 +6,7 @@ use Drupal\Core\Config\ConfigCrudEvent;
use Drupal\Core\Config\ConfigEvents;
use Drupal\Core\Extension\Extension;
use Drupal\Core\Extension\ExtensionDiscovery;
use Drupal\Core\Extension\ThemeHandlerInterface;
use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
// cspell:ignore updatetype
@ -56,6 +55,13 @@ class UpdateRegistry implements EventSubscriberInterface {
*/
protected $keyValue;
/**
* Should we respect update functions in tests.
*
* @var bool|null
*/
protected $includeTests = NULL;
/**
* The site path.
*
@ -80,26 +86,19 @@ class UpdateRegistry implements EventSubscriberInterface {
* The app root.
* @param string $site_path
* The site path.
* @param array $module_list
* An associative array whose keys are the names of installed modules.
* @param \Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_factory
* The key value factory.
* @param \Drupal\Core\Extension\ThemeHandlerInterface|bool|null $theme_handler
* The theme handler.
* @param string[] $enabled_extensions
* A list of enabled extensions.
* @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $key_value
* The key value store.
* @param bool|null $include_tests
* (optional) A flag whether to include tests in the scanning of extensions.
*/
public function __construct($root, $site_path, $module_list, KeyValueFactoryInterface $key_value_factory, ThemeHandlerInterface|bool $theme_handler = NULL) {
public function __construct($root, $site_path, array $enabled_extensions, KeyValueStoreInterface $key_value, $include_tests = NULL) {
$this->root = $root;
$this->sitePath = $site_path;
if ($module_list !== [] && array_is_list($module_list)) {
@trigger_error('Calling ' . __METHOD__ . '() with the $enabled_extensions argument is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use an associative array whose keys are the names of installed modules instead. See https://www.drupal.org/node/3423659', E_USER_DEPRECATED);
$module_list = \Drupal::service('module_handler')->getModuleList();
}
if ($theme_handler === NULL || is_bool($theme_handler)) {
@trigger_error('Calling ' . __METHOD__ . '() with the $include_tests argument is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3423659', E_USER_DEPRECATED);
$theme_handler = \Drupal::service('theme_handler');
}
$this->enabledExtensions = array_merge(array_keys($module_list), array_keys($theme_handler->listInfo()));
$this->keyValue = $key_value_factory->get('post_update');
$this->enabledExtensions = $enabled_extensions;
$this->keyValue = $key_value;
$this->includeTests = $include_tests;
}
/**

View File

@ -7,11 +7,6 @@ use Symfony\Component\DependencyInjection\ContainerAwareTrait;
/**
* Service factory for the update registry.
*
* @deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use
* \Drupal\Core\Update\UpdateRegistry instead.
*
* @see https://www.drupal.org/node/3423659
*/
class UpdateRegistryFactory implements ContainerAwareInterface {
@ -24,14 +19,8 @@ class UpdateRegistryFactory implements ContainerAwareInterface {
* The update registry instance.
*/
public function create() {
@trigger_error(__NAMESPACE__ . '\UpdateHookRegistryFactory is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Update\UpdateRegistry instead. See https://www.drupal.org/node/3423659', E_USER_DEPRECATED);
return new UpdateRegistry(
$this->container->getParameter('app.root'),
$this->container->getParameter('site.path'),
$this->container->get('module_handler')->getModuleList(),
$this->container->get('keyvalue'),
$this->container->get('theme_handler')
);
$extensions = array_merge(array_keys($this->container->get('module_handler')->getModuleList()), array_keys($this->container->get('theme_handler')->listInfo()));
return new UpdateRegistry($this->container->getParameter('app.root'), $this->container->getParameter('site.path'), $extensions, $this->container->get('keyvalue')->get('post_update'));
}
}

View File

@ -619,11 +619,43 @@ parameters:
count: 1
path: lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php
-
message: """
#^Class Drupal\\\\Core\\\\Update\\\\UpdateHookRegistryFactory implements deprecated interface Symfony\\\\Component\\\\DependencyInjection\\\\ContainerAwareInterface\\:
since Symfony 6\\.4, use dependency injection instead$#
"""
count: 1
path: lib/Drupal/Core/Update/UpdateHookRegistryFactory.php
-
message: """
#^Usage of deprecated trait Symfony\\\\Component\\\\DependencyInjection\\\\ContainerAwareTrait in class Drupal\\\\Core\\\\Update\\\\UpdateHookRegistryFactory\\:
since Symfony 6\\.4, use dependency injection instead$#
"""
count: 1
path: lib/Drupal/Core/Update/UpdateHookRegistryFactory.php
-
message: "#^Method Drupal\\\\Core\\\\Update\\\\UpdateKernel\\:\\:discoverServiceProviders\\(\\) should return array but return statement is missing\\.$#"
count: 1
path: lib/Drupal/Core/Update/UpdateKernel.php
-
message: """
#^Class Drupal\\\\Core\\\\Update\\\\UpdateRegistryFactory implements deprecated interface Symfony\\\\Component\\\\DependencyInjection\\\\ContainerAwareInterface\\:
since Symfony 6\\.4, use dependency injection instead$#
"""
count: 1
path: lib/Drupal/Core/Update/UpdateRegistryFactory.php
-
message: """
#^Usage of deprecated trait Symfony\\\\Component\\\\DependencyInjection\\\\ContainerAwareTrait in class Drupal\\\\Core\\\\Update\\\\UpdateRegistryFactory\\:
since Symfony 6\\.4, use dependency injection instead$#
"""
count: 1
path: lib/Drupal/Core/Update/UpdateRegistryFactory.php
-
message: "#^Method Drupal\\\\Core\\\\Updater\\\\Module\\:\\:postUpdateTasks\\(\\) should return array but return statement is missing\\.$#"
count: 1

View File

@ -93,7 +93,7 @@ class UpdateHookRegistryTest extends UnitTestCase {
public function testGetVersions() {
$module_name = 'drupal\tests\core\update\under_test';
$update_registry = new UpdateHookRegistry([], $this->keyValueFactory);
$update_registry = new UpdateHookRegistry([], $this->keyValueStore);
// Only under_test_update_X - passes through the filter.
$expected = [1, 20, 3000];
@ -136,7 +136,7 @@ class UpdateHookRegistryTest extends UnitTestCase {
$versions[$key] = $value;
});
$update_registry = new UpdateHookRegistry([], $this->keyValueFactory);
$update_registry = new UpdateHookRegistry([], $this->keyValueStore);
$this->assertSame(3000, $update_registry->getInstalledVersion('module3'));
$update_registry->setInstalledVersion('module3', 3001);

View File

@ -4,8 +4,6 @@ declare(strict_types=1);
namespace Drupal\Tests\Core\Update;
use Drupal\Core\Extension\ThemeHandlerInterface;
use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
use Drupal\Core\Site\Settings;
use Drupal\Core\Update\RemovedPostUpdateNameException;
@ -190,33 +188,11 @@ EOS;
$key_value->get('existing_updates', [])->willReturn([]);
$key_value = $key_value->reveal();
$key_value_factory = $this->prophesize(KeyValueFactoryInterface::class);
$key_value_factory->get('post_update')->willReturn($key_value);
$key_value_factory = $key_value_factory->reveal();
$theme_handler = $this->prophesize(ThemeHandlerInterface::class);
$theme_handler->listInfo()->willReturn([
'theme_d' => [
'type' => 'theme_d',
'pathname' => 'core/themes/theme_d/theme_d.info.yml',
],
]);
$theme_handler = $theme_handler->reveal();
$update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
'module_a' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_a/module_a.info.yml',
'filename' => 'module_a.module',
],
'module_b' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_b/module_b.info.yml',
'filename' => 'module_b.module',
],
], $key_value_factory, $theme_handler);
'module_a',
'module_b',
'theme_d',
], $key_value, FALSE);
$this->assertEquals([
'module_a_post_update_a',
@ -237,27 +213,14 @@ EOS;
$key_value->get('existing_updates', [])->willReturn([]);
$key_value = $key_value->reveal();
$key_value_factory = $this->prophesize(KeyValueFactoryInterface::class);
$key_value_factory->get('post_update')->willReturn($key_value);
$key_value_factory = $key_value_factory->reveal();
$theme_handler = $this->prophesize(ThemeHandlerInterface::class);
$theme_handler->listInfo()->willReturn([]);
$theme_handler = $theme_handler->reveal();
// Preload modules to ensure that ::getAvailableUpdateFunctions filters out
// not enabled modules.
include_once 'vfs://drupal/sites/default/modules/module_a/module_a.post_update.php';
include_once 'vfs://drupal/sites/default/modules/module_b/module_b.post_update.php';
$update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
'module_a' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_a/module_a.info.yml',
'filename' => 'module_a.module',
],
], $key_value_factory, $theme_handler);
'module_a',
], $key_value, FALSE);
$this->assertEquals([
'module_a_post_update_a',
@ -272,40 +235,14 @@ EOS;
$this->setupBasicExtensions();
$key_value = $this->prophesize(KeyValueStoreInterface::class);
$key_value->get('existing_updates', [])->willReturn([
'module_a_post_update_a',
'theme_d_post_update_a',
'theme_d_post_update_b',
]);
$key_value->get('existing_updates', [])->willReturn(['module_a_post_update_a', 'theme_d_post_update_a', 'theme_d_post_update_b']);
$key_value = $key_value->reveal();
$key_value_factory = $this->prophesize(KeyValueFactoryInterface::class);
$key_value_factory->get('post_update')->willReturn($key_value);
$key_value_factory = $key_value_factory->reveal();
$theme_handler = $this->prophesize(ThemeHandlerInterface::class);
$theme_handler->listInfo()->willReturn([
'theme_d' => [
'type' => 'theme_d',
'pathname' => 'core/themes/theme_d/theme_d.info.yml',
],
]);
$theme_handler = $theme_handler->reveal();
$update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
'module_a' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_a/module_a.info.yml',
'filename' => 'module_a.module',
],
'module_b' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_b/module_b.info.yml',
'filename' => 'module_b.module',
],
], $key_value_factory, $theme_handler);
'module_a',
'module_b',
'theme_d',
], $key_value, FALSE);
$this->assertEquals(array_values([
'module_a_post_update_b',
@ -325,33 +262,11 @@ EOS;
$key_value->get('existing_updates', [])->willReturn([]);
$key_value = $key_value->reveal();
$key_value_factory = $this->prophesize(KeyValueFactoryInterface::class);
$key_value_factory->get('post_update')->willReturn($key_value);
$key_value_factory = $key_value_factory->reveal();
$theme_handler = $this->prophesize(ThemeHandlerInterface::class);
$theme_handler->listInfo()->willReturn([
'theme_d' => [
'type' => 'theme_d',
'pathname' => 'core/themes/theme_d/theme_d.info.yml',
],
]);
$theme_handler = $theme_handler->reveal();
$update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
'module_a' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_a/module_a.info.yml',
'filename' => 'module_a.module',
],
'module_b' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_b/module_b.info.yml',
'filename' => 'module_b.module',
],
], $key_value_factory, $theme_handler);
'module_a',
'module_b',
'theme_d',
], $key_value, FALSE);
$expected = [];
$expected['module_a']['pending']['a'] = 'Module A update A.';
@ -373,40 +288,14 @@ EOS;
$this->setupBasicExtensions();
$key_value = $this->prophesize(KeyValueStoreInterface::class);
$key_value->get('existing_updates', [])->willReturn([
'module_a_post_update_a',
'theme_d_post_update_a',
'theme_d_post_update_b',
]);
$key_value->get('existing_updates', [])->willReturn(['module_a_post_update_a', 'theme_d_post_update_a', 'theme_d_post_update_b']);
$key_value = $key_value->reveal();
$key_value_factory = $this->prophesize(KeyValueFactoryInterface::class);
$key_value_factory->get('post_update')->willReturn($key_value);
$key_value_factory = $key_value_factory->reveal();
$theme_handler = $this->prophesize(ThemeHandlerInterface::class);
$theme_handler->listInfo()->willReturn([
'theme_d' => [
'type' => 'theme_d',
'pathname' => 'core/themes/theme_d/theme_d.info.yml',
],
]);
$theme_handler = $theme_handler->reveal();
$update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
'module_a' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_a/module_a.info.yml',
'filename' => 'module_a.module',
],
'module_b' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_b/module_b.info.yml',
'filename' => 'module_b.module',
],
], $key_value_factory, $theme_handler);
'module_a',
'module_b',
'theme_d',
], $key_value, FALSE);
$expected = [];
$expected['module_a']['pending']['b'] = 'Module A update B.';
@ -429,22 +318,9 @@ EOS;
$key_value->get('existing_updates', [])->willReturn(['module_a_post_update_a']);
$key_value = $key_value->reveal();
$key_value_factory = $this->prophesize(KeyValueFactoryInterface::class);
$key_value_factory->get('post_update')->willReturn($key_value);
$key_value_factory = $key_value_factory->reveal();
$theme_handler = $this->prophesize(ThemeHandlerInterface::class);
$theme_handler->listInfo()->willReturn([]);
$theme_handler = $theme_handler->reveal();
$update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
'module_c' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_c/module_c.info.yml',
'filename' => 'module_c.module',
],
], $key_value_factory, $theme_handler);
'module_c',
], $key_value, FALSE);
$this->expectException(RemovedPostUpdateNameException::class);
$update_registry->getPendingUpdateInformation();
@ -457,33 +333,11 @@ EOS;
$this->setupBasicExtensions();
$key_value = $this->prophesize(KeyValueStoreInterface::class)->reveal();
$key_value_factory = $this->prophesize(KeyValueFactoryInterface::class);
$key_value_factory->get('post_update')->willReturn($key_value);
$key_value_factory = $key_value_factory->reveal();
$theme_handler = $this->prophesize(ThemeHandlerInterface::class);
$theme_handler->listInfo()->willReturn([
'theme_d' => [
'type' => 'theme_d',
'pathname' => 'core/themes/theme_d/theme_d.info.yml',
],
]);
$theme_handler = $theme_handler->reveal();
$update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
'module_a' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_a/module_a.info.yml',
'filename' => 'module_a.module',
],
'module_b' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_b/module_b.info.yml',
'filename' => 'module_b.module',
],
], $key_value_factory, $theme_handler);
'module_a',
'module_b',
'theme_d',
], $key_value, FALSE);
$this->assertEquals(['module_a_post_update_a', 'module_a_post_update_b'], array_values($update_registry->getUpdateFunctions('module_a')));
$this->assertEquals(['module_b_post_update_a'], array_values($update_registry->getUpdateFunctions('module_b')));
@ -504,33 +358,11 @@ EOS;
->shouldBeCalledTimes(1);
$key_value = $key_value->reveal();
$key_value_factory = $this->prophesize(KeyValueFactoryInterface::class);
$key_value_factory->get('post_update')->willReturn($key_value);
$key_value_factory = $key_value_factory->reveal();
$theme_handler = $this->prophesize(ThemeHandlerInterface::class);
$theme_handler->listInfo()->willReturn([
'theme_d' => [
'type' => 'theme_d',
'pathname' => 'core/themes/theme_d/theme_d.info.yml',
],
]);
$theme_handler = $theme_handler->reveal();
$update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
'module_a' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_a/module_a.info.yml',
'filename' => 'module_a.module',
],
'module_b' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_b/module_b.info.yml',
'filename' => 'module_b.module',
],
], $key_value_factory, $theme_handler);
'module_a',
'module_b',
'theme_d',
], $key_value, FALSE);
$update_registry->registerInvokedUpdates(['module_a_post_update_a']);
}
@ -548,33 +380,11 @@ EOS;
->shouldBeCalledTimes(1);
$key_value = $key_value->reveal();
$key_value_factory = $this->prophesize(KeyValueFactoryInterface::class);
$key_value_factory->get('post_update')->willReturn($key_value);
$key_value_factory = $key_value_factory->reveal();
$theme_handler = $this->prophesize(ThemeHandlerInterface::class);
$theme_handler->listInfo()->willReturn([
'theme_d' => [
'type' => 'theme_d',
'pathname' => 'core/themes/theme_d/theme_d.info.yml',
],
]);
$theme_handler = $theme_handler->reveal();
$update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
'module_a' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_a/module_a.info.yml',
'filename' => 'module_a.module',
],
'module_b' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_b/module_b.info.yml',
'filename' => 'module_b.module',
],
], $key_value_factory, $theme_handler);
'module_a',
'module_b',
'theme_d',
], $key_value, FALSE);
$update_registry->registerInvokedUpdates(['module_a_post_update_a', 'module_a_post_update_b', 'theme_d_post_update_c']);
}
@ -592,28 +402,10 @@ EOS;
->shouldBeCalledTimes(1);
$key_value = $key_value->reveal();
$key_value_factory = $this->prophesize(KeyValueFactoryInterface::class);
$key_value_factory->get('post_update')->willReturn($key_value);
$key_value_factory = $key_value_factory->reveal();
$theme_handler = $this->prophesize(ThemeHandlerInterface::class);
$theme_handler->listInfo()->willReturn([]);
$theme_handler = $theme_handler->reveal();
$update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
'module_a' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_a/module_a.info.yml',
'filename' => 'module_a.module',
],
'module_b' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_b/module_b.info.yml',
'filename' => 'module_b.module',
],
], $key_value_factory, $theme_handler);
'module_a',
'module_b',
], $key_value, FALSE);
$update_registry->registerInvokedUpdates(['module_a_post_update_a']);
}
@ -631,33 +423,12 @@ EOS;
->shouldBeCalledTimes(1);
$key_value = $key_value->reveal();
$key_value_factory = $this->prophesize(KeyValueFactoryInterface::class);
$key_value_factory->get('post_update')->willReturn($key_value);
$key_value_factory = $key_value_factory->reveal();
$theme_handler = $this->prophesize(ThemeHandlerInterface::class);
$theme_handler->listInfo()->willReturn([
'theme_d' => [
'type' => 'theme_d',
'pathname' => 'core/themes/theme_d/theme_d.info.yml',
],
]);
$theme_handler = $theme_handler->reveal();
$update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
'module_a' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_a/module_a.info.yml',
'filename' => 'module_a.module',
],
'module_b' =>
[
'type' => 'module',
'pathname' => 'core/modules/module_b/module_b.info.yml',
'filename' => 'module_b.module',
],
], $key_value_factory, $theme_handler);
'module_a',
'module_b',
'theme_d',
], $key_value, FALSE);
$update_registry->filterOutInvokedUpdatesByExtension('module_a');
}