class UpdateRegistryTest

Same name in this branch
  1. main core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php \Drupal\Tests\Core\Update\UpdateRegistryTest
Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php \Drupal\Tests\Core\Update\UpdateRegistryTest
  2. 10 core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php \Drupal\Tests\Core\Update\UpdateRegistryTest
  3. 9 core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php \Drupal\Tests\Core\Update\UpdateRegistryTest
  4. 8.9.x core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php \Drupal\Tests\Core\Update\UpdateRegistryTest
  5. 11.x core/modules/system/tests/src/Functional/System/UpdateRegistryTest.php \Drupal\Tests\system\Functional\System\UpdateRegistryTest

Tests the update registry.

Attributes

#[Group('Update')] #[RunTestsInSeparateProcesses]

Hierarchy

Expanded class hierarchy of UpdateRegistryTest

File

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

Namespace

Drupal\Tests\system\Functional\System
View source
class UpdateRegistryTest extends BrowserTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'system',
  ];
  
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';
  
  /**
   * Tests discovery after installing a module.
   */
  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.