function WildcardConfigActionsTest::testCreateForEachNotAvailableOnNonBundleEntities
Tests that the createForEach action only works on bundle entities.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Recipe/ WildcardConfigActionsTest.php, line 253
Class
- WildcardConfigActionsTest
- Tests config actions targeting multiple entities using wildcards.
Namespace
Drupal\KernelTests\Core\RecipeCode
public function testCreateForEachNotAvailableOnNonBundleEntities() : void {
$this->enableModules([
'language',
]);
// We should not be able to use this action on entities that aren't
// themselves bundles of another entity type.
$this->expectException(PluginNotFoundException::class);
$this->expectExceptionMessage('The "language_content_settings" entity does not support the "createForEach" config action.');
$this->container
->get('plugin.manager.config_action')
->applyAction('createForEach', 'language.content_settings.node.*', []);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.