function UpdatePostUpdateExceptionTest::testPostUpdate

Same name and namespace in other branches
  1. 10 core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateExceptionTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdatePostUpdateExceptionTest::testPostUpdate()
  2. 11.x core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateExceptionTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdatePostUpdateExceptionTest::testPostUpdate()

Tests hook_post_update_NAME().

File

core/modules/system/tests/src/Functional/UpdateSystem/UpdatePostUpdateExceptionTest.php, line 53

Class

UpdatePostUpdateExceptionTest
Tests hook_post_update() when there is an exception in a post update.

Namespace

Drupal\Tests\system\Functional\UpdateSystem

Code

public function testPostUpdate() {
    // There are expected to be failed updates.
    $this->checkFailedUpdates = FALSE;
    $this->runUpdates();
    $this->assertSession()
        ->pageTextContains('Failed: RuntimeException: This post update fails in post_update_test_failing_post_update_exception()');
}

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