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 56

Class

PendingUpdatesValidatorTest
@covers \Drupal\package_manager\Validator\PendingUpdatesValidator @group package_manager @internal

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([
        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.