function LinearHistoryTest::testDeleteException

Same name in other branches
  1. 10 core/tests/Drupal/Tests/Core/Config/Checkpoint/LinearHistoryTest.php \Drupal\Tests\Core\Config\Checkpoint\LinearHistoryTest::testDeleteException()

@covers ::delete

File

core/tests/Drupal/Tests/Core/Config/Checkpoint/LinearHistoryTest.php, line 141

Class

LinearHistoryTest
@coversDefaultClass \Drupal\Core\Config\Checkpoint\LinearHistory @group Config

Namespace

Drupal\Tests\Core\Config\Checkpoint

Code

public function testDeleteException() : void {
    $state = $this->prophesize(StateInterface::class);
    $state->get(self::CHECKPOINT_KEY, [])
        ->willReturn([]);
    $time = $this->prophesize(TimeInterface::class);
    $checkpoints = new LinearHistory($state->reveal(), $time->reveal());
    $this->expectException(UnknownCheckpointException::class);
    $this->expectExceptionMessage('Cannot delete a checkpoint with the ID "foo" as it does not exist');
    $checkpoints->delete('foo');
}

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