You are here

public function UpdatePostUpdateFailingTest::testPostUpdate in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateFailingTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdatePostUpdateFailingTest::testPostUpdate()
  2. 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 53

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
    ->assertSame([], \Drupal::state()
    ->get('post_update_test_execution', []));
  $key_value = \Drupal::keyValue('update__post_update');
  $this
    ->assertEquals([], $key_value
    ->get('existing_updates', []));
}