function ConfigActionTest::testPluralizedEntityMethodException

Same name in other branches
  1. 11.x core/tests/Drupal/KernelTests/Core/Config/Action/ConfigActionTest.php \Drupal\KernelTests\Core\Config\Action\ConfigActionTest::testPluralizedEntityMethodException()

See also

\Drupal\Core\Config\Action\Plugin\ConfigAction\EntityMethod

File

core/tests/Drupal/KernelTests/Core/Config/Action/ConfigActionTest.php, line 188

Class

ConfigActionTest
Tests the config action system.

Namespace

Drupal\KernelTests\Core\Config\Action

Code

public function testPluralizedEntityMethodException() : void {
    $this->installConfig('config_test');
    
    /** @var \Drupal\Core\Config\Action\ConfigActionManager $manager */
    $manager = $this->container
        ->get('plugin.manager.config_action');
    $this->expectException(EntityMethodException::class);
    $this->expectExceptionMessage('The pluralized entity method config action \'entity_method:config_test.dynamic:addToArrayMultipleTimes\' requires an array value in order to call Drupal\\config_test\\Entity\\ConfigTest::addToArray() multiple times');
    $manager->applyAction('entity_method:config_test.dynamic:addToArrayMultipleTimes', 'config_test.dynamic.dotted.default', 'Test value');
}

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