function FailureMarkerTest::testAssertNotExists

Tests that the failure marker can contain an exception message.

@covers ::assertNotExists

File

core/modules/package_manager/tests/src/Kernel/FailureMarkerTest.php, line 77

Class

FailureMarkerTest
@coversDefaultClass \Drupal\package_manager\FailureMarker @group package_manager @internal

Namespace

Drupal\Tests\package_manager\Kernel

Code

public function testAssertNotExists() : void {
    $failure_marker = $this->container
        ->get(FailureMarker::class);
    $failure_marker->write($this->createStage(), t('Something wicked occurred here.'), new \Exception('Witchcraft!'));
    $this->expectException(StageFailureMarkerException::class);
    $this->expectExceptionMessageMatches('/^Something wicked occurred here. Caused by Exception, with this message: Witchcraft!\\nBacktrace:\\n#0 .*/');
    $failure_marker->assertNotExists();
}

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