UpdateRegistryTest.php

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

Namespace

Drupal\Tests\system\Functional\System

File

core/modules/system/tests/src/Functional/System/UpdateRegistryTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\system\Functional\System;

use Drupal\Tests\BrowserTestBase;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;

/**
 * Tests the update registry.
 */
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')));
  }

}

Classes

Title Deprecated Summary
UpdateRegistryTest Tests the update registry.

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