You are here

public function InstallTest::testRequiredModuleSchemaVersions in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/Module/InstallTest.php \Drupal\Tests\system\Functional\Module\InstallTest::testRequiredModuleSchemaVersions()
  2. 9 core/modules/system/tests/src/Functional/Module/InstallTest.php \Drupal\Tests\system\Functional\Module\InstallTest::testRequiredModuleSchemaVersions()

Tests recorded schema versions of early installed modules in the installer.

File

core/modules/system/tests/src/Functional/Module/InstallTest.php, line 53

Class

InstallTest
Tests the installation of modules.

Namespace

Drupal\Tests\system\Functional\Module

Code

public function testRequiredModuleSchemaVersions() {

  /** @var \Drupal\Core\Update\UpdateHookRegistry $update_registry */
  $update_registry = \Drupal::service('update.update_hook_registry');
  $version = $update_registry
    ->getInstalledVersion('system');
  $this
    ->assertGreaterThan(0, $version);
  $version = $update_registry
    ->getInstalledVersion('user');
  $this
    ->assertGreaterThan(0, $version);
  $post_update_key_value = \Drupal::keyValue('post_update');
  $existing_updates = $post_update_key_value
    ->get('existing_updates', []);
  $this
    ->assertContains('module_test_post_update_test', $existing_updates);
}