function PackageManagerKernelTestBase::registerPostUpdateFunctions

Marks all pending post-update functions as completed.

Since kernel tests don't normally install modules and register their updates, this method makes sure that we are testing from a clean, fully up-to-date state.

File

core/modules/package_manager/tests/src/Kernel/PackageManagerKernelTestBase.php, line 248

Class

PackageManagerKernelTestBase
Base class for kernel tests of Package Manager's functionality.

Namespace

Drupal\Tests\package_manager\Kernel

Code

protected function registerPostUpdateFunctions() : void {
    static $updates = [];
    $updates = array_merge($updates, $this->container
        ->get('update.post_update_registry')
        ->getPendingUpdateFunctions());
    $this->container
        ->get('keyvalue')
        ->get('post_update')
        ->set('existing_updates', $updates);
}

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