function DrupalTestCaseTrait::expectExceptionMessageIs

Expects an exactly matching exception message.

Forward compatibility for PHPUnit 13.

Parameters

string $message: The expected exception message.

532 calls to DrupalTestCaseTrait::expectExceptionMessageIs()
AcceptHeaderMatcherTest::testNoRouteFound in core/tests/Drupal/Tests/Core/Routing/AcceptHeaderMatcherTest.php
Confirms that the AcceptHeaderMatcher throws an exception for no-route.
AccessAwareRouterTest::testCheckAccessResultWithReason in core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php
Tests the matchRequest() function for access denied with reason message.
AccessPolicyProcessorTest::testMultipleScopeAlterException in core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php
Tests the multiple scopes exception.
AccessPolicyProcessorTest::testMultipleScopeException in core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php
Tests the multiple scopes exception.
AccessPolicyProcessorTest::testWrongScopeException in core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php
Tests the wrong scope exception.

... 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.