function UpdatesWith7xTest::testWith7x

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdatesWith7xTest::testWith7x()
  2. 8.9.x core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdatesWith7xTest::testWith7x()
  3. 11.x core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdatesWith7xTest::testWith7x()

File

core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php, line 54

Class

UpdatesWith7xTest
Tests the minimum schema version when only 7.x update hooks are retained.

Namespace

Drupal\Tests\system\Functional\UpdateSystem

Code

public function testWith7x() : void {
  /** @var \Drupal\Core\Update\UpdateHookRegistry $update_registry */
  $update_registry = \Drupal::service('update.update_hook_registry');
  // Ensure that the minimum schema version is 8000, despite 7200 update
  // hooks and a 7XXX hook_update_last_removed().
  $this->assertEquals(8000, $update_registry->getInstalledVersion('update_test_with_7x'));
  // Try to manually set the schema version to 7110 and ensure that no
  // updates are allowed.
  $update_registry->setInstalledVersion('update_test_with_7x', 7110);
  // Click through update.php with 'administer software updates' permission.
  $this->drupalLogin($this->updateUser);
  $this->drupalGet($this->updateUrl, [
    'external' => TRUE,
  ]);
  $this->updateRequirementsProblem();
  $this->clickLink('Continue');
  $this->assertSession()
    ->pageTextContains('Some of the pending updates cannot be applied because their dependencies were not met.');
}

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