function InstallTest::testRequiredModuleSchemaVersions

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/Module/InstallTest.php \Drupal\Tests\system\Functional\Module\InstallTest::testRequiredModuleSchemaVersions()
  2. 8.9.x core/modules/system/tests/src/Functional/Module/InstallTest.php \Drupal\Tests\system\Functional\Module\InstallTest::testRequiredModuleSchemaVersions()
  3. 10 core/modules/system/tests/src/Kernel/Module/InstallTest.php \Drupal\Tests\system\Kernel\Module\InstallTest::testRequiredModuleSchemaVersions()

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

File

core/modules/system/tests/src/Kernel/Module/InstallTest.php, line 71

Class

InstallTest
Tests the installation of modules.

Namespace

Drupal\Tests\system\Kernel\Module

Code

public function testRequiredModuleSchemaVersions() : void {
    
    /** @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);
}

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