You are here

public function PendingUpdatesValidatorTest::testPendingUpdateHook in Automatic Updates 8.2

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

File

tests/src/Kernel/ReadinessValidation/PendingUpdatesValidatorTest.php, line 33

Class

PendingUpdatesValidatorTest
@covers \Drupal\automatic_updates\Validator\PendingUpdatesValidator

Namespace

Drupal\Tests\automatic_updates\Kernel\ReadinessValidation

Code

public function testPendingUpdateHook() : void {
  require __DIR__ . '/../../../fixtures/db_update.php';
  $this->container
    ->get('keyvalue')
    ->get('system.schema')
    ->set('automatic_updates', \Drupal::CORE_MINIMUM_SCHEMA_VERSION);
  $result = ValidationResult::createError([
    'Some modules have database schema updates to install. You should run the <a href="/update.php">database update script</a> immediately.',
  ]);
  $this
    ->assertCheckerResultsFromManager([
    $result,
  ], TRUE);
}