function UpdatePathTestTrait::ensureUpdatesToRun

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/UpdatePathTestTrait.php \Drupal\Tests\UpdatePathTestTrait::ensureUpdatesToRun()
  2. 8.9.x core/tests/Drupal/Tests/UpdatePathTestTrait.php \Drupal\Tests\UpdatePathTestTrait::ensureUpdatesToRun()
  3. 11.x core/tests/Drupal/Tests/UpdatePathTestTrait.php \Drupal\Tests\UpdatePathTestTrait::ensureUpdatesToRun()

Installs the update_script_test module and makes an update available.

File

core/tests/Drupal/Tests/UpdatePathTestTrait.php, line 175

Class

UpdatePathTestTrait
Trait UpdatePathTestTrait.

Namespace

Drupal\Tests

Code

protected function ensureUpdatesToRun() {
  \Drupal::service('module_installer')->install([
    'update_script_test',
  ]);
  // Reset the schema so there is an update to run.
  \Drupal::service('update.update_hook_registry')->setInstalledVersion('update_script_test', 8000);
}

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