function UpdateRegistryTest::testExtensionDiscoveryIsInvalidatedOnModuleInstall

Same name and namespace in other branches
  1. main core/modules/system/tests/src/Functional/System/UpdateRegistryTest.php \Drupal\Tests\system\Functional\System\UpdateRegistryTest::testExtensionDiscoveryIsInvalidatedOnModuleInstall()

Tests discovery after installing a module.

File

core/modules/system/tests/src/Functional/System/UpdateRegistryTest.php, line 31

Class

UpdateRegistryTest
Tests the update registry.

Namespace

Drupal\Tests\system\Functional\System

Code

public function testExtensionDiscoveryIsInvalidatedOnModuleInstall() : void {
  $update_registry = $this->container
    ->get('update.post_update_registry');
  $this->assertNotEmpty($update_registry->getUpdateFunctions('system'));
  $this->assertEmpty($update_registry->getUpdateFunctions('help'));
  $this->container
    ->get('module_installer')
    ->install([
    'help',
  ]);
  $this->assertSame([
    'help_post_update_search_help_dependencies',
  ], array_values($update_registry->getUpdateFunctions('help')));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.