function RollbackTest::assertCheckpointsExist

Same name in other branches
  1. 11.x core/tests/Drupal/FunctionalTests/Core/Recipe/RollbackTest.php \Drupal\FunctionalTests\Core\Recipe\RollbackTest::assertCheckpointsExist()

Asserts that the current set of checkpoints matches the given labels.

Parameters

string[] $expected_labels: The labels of every checkpoint that is expected to exist currently, in the expected order.

1 call to RollbackTest::assertCheckpointsExist()
RollbackTest::testRollbackForInvalidConfig in core/tests/Drupal/FunctionalTests/Core/Recipe/RollbackTest.php
@testWith ["invalid_config", "core.date_format.invalid"] ["recipe_depend_on_invalid", "core.date_format.invalid"] ["recipe_depend_on_invalid_config_and_valid_modules", "core.date_format.invalid"]

File

core/tests/Drupal/FunctionalTests/Core/Recipe/RollbackTest.php, line 72

Class

RollbackTest
@group Recipe

Namespace

Drupal\FunctionalTests\Core\Recipe

Code

private function assertCheckpointsExist(array $expected_labels) : void {
    $checkpoints = \Drupal::service('config.checkpoints');
    $labels = array_map(fn(Checkpoint $c) => $c->label, iterator_to_array($checkpoints));
    $this->assertSame($expected_labels, array_values($labels));
}

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