function 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
Tests rollback for invalid config.

File

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

Class

RollbackTest
Tests Rollback.

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.