function PendingUpdatesValidatorTest::testPendingPostUpdate

Tests that an error is raised if there are pending post-updates.

File

core/modules/package_manager/tests/src/Kernel/PendingUpdatesValidatorTest.php, line 66

Class

PendingUpdatesValidatorTest
Tests Pending Updates Validator.

Namespace

Drupal\Tests\package_manager\Kernel

Code

public function testPendingPostUpdate() : void {
  // Make an additional post-update function available; the update registry
  // will think it's pending.
  require_once __DIR__ . '/../../fixtures/post_update.php';
  $result = ValidationResult::createError([
    $this->t('Some modules have database updates pending. You should run the <a href="/update.php">database update script</a> immediately.'),
  ]);
  $this->assertStatusCheckResults([
    $result,
  ]);
  $this->assertResults([
    $result,
  ], PreCreateEvent::class);
}

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