diff --git a/core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php b/core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php index aad0be5fe6..aec99cd0d7 100644 --- a/core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php +++ b/core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php @@ -166,8 +166,14 @@ public static function staticMethod($suffix) { * * @return string * A test string. + * + * @throws \Exception + * Throws an exception when called statically. */ public function method($suffix) { + if (!isset($this)) { + throw new \Exception('Non-static method called statically.'); + } return 'foo' . $suffix; }