You are here

public function InstallTest::testRequiredModuleSchemaVersions in Drupal 8

Same name and namespace in other branches
  1. 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() {
  $version = drupal_get_installed_schema_version('system', TRUE);
  $this
    ->assertTrue($version > 0, 'System module version is > 0.');
  $version = drupal_get_installed_schema_version('user', TRUE);
  $this
    ->assertTrue($version > 0, 'User module version is > 0.');
  $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);
}