function AddToAllBundlesConfigActionTest::testFailIfExists
Same name in other branches
- 11.x core/modules/field/tests/src/Kernel/AddToAllBundlesConfigActionTest.php \Drupal\Tests\field\Kernel\AddToAllBundlesConfigActionTest::testFailIfExists()
Tests that the action can be set to fail if the field already exists.
File
-
core/
modules/ field/ tests/ src/ Kernel/ AddToAllBundlesConfigActionTest.php, line 84
Class
Namespace
Drupal\Tests\field\KernelCode
public function testFailIfExists() : void {
$this->installConfig('node');
node_add_body_field(NodeType::load('one'));
$this->expectException(ConfigActionException::class);
$this->expectExceptionMessage('Field node.one.body already exists.');
$this->applyAction('field.storage.node.body', TRUE);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.