function ConfigActionTest::testDuplicatePluralizedOtherMethodNameException

See also

\Drupal\Core\Config\Action\Plugin\ConfigAction\Deriver\EntityMethodDeriver

File

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

Class

ConfigActionTest
Tests the config action system.

Namespace

Drupal\KernelTests\Core\Config\Action

Code

public function testDuplicatePluralizedOtherMethodNameException() : void {
    \Drupal::state()->set('config_test.class_override', DuplicatePluralizedOtherMethodName::class);
    \Drupal::entityTypeManager()->clearCachedDefinitions();
    $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('Duplicate action can not be created for ID \'config_test.dynamic:testMethod2\' for Drupal\\config_test\\ConfigActionErrorEntity\\DuplicatePluralizedOtherMethodName::testMethod2(). The existing action is for the ::testMethod() method');
    $manager->getDefinitions();
}

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