class ActionMethodAttributeTest

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Config/Action/ActionMethodAttributeTest.php \Drupal\Tests\Core\Config\Action\ActionMethodAttributeTest

Tests Drupal\Core\Config\Action\Attribute\ActionMethod.

Attributes

#[CoversClass(ActionMethod::class)] #[Group('Config')]

Hierarchy

Expanded class hierarchy of ActionMethodAttributeTest

File

core/tests/Drupal/Tests/Core/Config/Action/ActionMethodAttributeTest.php, line 16

Namespace

Drupal\Tests\Core\Config\Action
View source
class ActionMethodAttributeTest extends UnitTestCase {
  
  /**
   * Tests invalid function name.
   *
   * @legacy-covers ::__construct
   */
  public function testInvalidFunctionName() : void {
    $name = "hello Goodbye";
    $this->expectException(InvalidPluginDefinitionException::class);
    $this->expectExceptionMessage("'{$name}' is not a valid PHP function name.");
    new ActionMethod(name: $name);
  }

}

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