You are here

public function UpdatePostUpdateFailingTest::testPostUpdate in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateFailingTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdatePostUpdateFailingTest::testPostUpdate()

Tests hook_post_update_NAME().

File

core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateFailingTest.php, line 61

Class

UpdatePostUpdateFailingTest
Tests hook_post_update() when there are failing update hooks.

Namespace

Drupal\Tests\system\Functional\UpdateSystem

Code

public function testPostUpdate() {

  // There are expected to be failed updates.
  $this->checkFailedUpdates = FALSE;
  $this
    ->runUpdates();

  // There should be no post update hooks registered as being run.
  $this
    ->assertIdentical([], \Drupal::state()
    ->get('post_update_test_execution', []));
  $key_value = \Drupal::keyValue('update__post_update');
  $this
    ->assertEqual([], $key_value
    ->get('existing_updates', []));
}