function DrupalTestCaseTrait::expectExceptionMessageIs

Same name and namespace in other branches
  1. main core/tests/Drupal/Tests/DrupalTestCaseTrait.php \Drupal\Tests\DrupalTestCaseTrait::expectExceptionMessageIs()

Expects an exactly matching exception message.

Forward compatibility for PHPUnit 13.

Parameters

string $message: The expected exception message.

313 calls to DrupalTestCaseTrait::expectExceptionMessageIs()
AccountSwitcherTest::testAccountSwitching in core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php
Tests the account switching, switching to and switching back.
AddComponentTest::testActionFailsIfEntityNotFound in core/modules/layout_builder/tests/src/Kernel/Plugin/ConfigAction/AddComponentTest.php
Tests that applying the config action to a missing entity fails.
AddComponentTest::testAddComponent in core/modules/layout_builder/tests/src/Kernel/Plugin/ConfigAction/AddComponentTest.php
Tests adding a component to a view display using a config action.
AddItemToToolbarConfigActionTest::testActionRequiresCKEditor5 in core/modules/ckeditor5/tests/src/Kernel/ConfigAction/AddItemToToolbarConfigActionTest.php
Tests that the `addItemToToolbar` config action requires CKEditor 5.
AddItemToToolbarConfigActionTest::testAddNonExistentItem in core/modules/ckeditor5/tests/src/Kernel/ConfigAction/AddItemToToolbarConfigActionTest.php
Tests that adding non-existent toolbar item to CKEditor triggers an error.

... See full list

File

core/tests/Drupal/Tests/DrupalTestCaseTrait.php, line 100

Class

DrupalTestCaseTrait
Provides methods common across all Drupal abstract base test classes.

Namespace

Drupal\Tests

Code

protected function expectExceptionMessageIs(string $message) : void {
  $this->expectExceptionMessage($message);
}

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