function FailureMarkerTest::testAssertNotExists
Same name and namespace in other branches
- 11.x core/modules/package_manager/tests/src/Kernel/FailureMarkerTest.php \Drupal\Tests\package_manager\Kernel\FailureMarkerTest::testAssertNotExists()
Tests that the failure marker can contain an exception message.
File
-
core/
modules/ package_manager/ tests/ src/ Kernel/ FailureMarkerTest.php, line 85
Class
Namespace
Drupal\Tests\package_manager\KernelCode
public function testAssertNotExists() : void {
$failure_marker = $this->container
->get(FailureMarker::class);
$failure_marker->write($this->createStage(), $this->t('Something wicked occurred here.'), new \Exception('Witchcraft!'));
$this->expectException(FailureMarkerExistsException::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.