function EntityCloneConfigActionTest::testErrorIfOriginalDoesNotExist
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/Core/Recipe/EntityCloneConfigActionTest.php \Drupal\KernelTests\Core\Recipe\EntityCloneConfigActionTest::testErrorIfOriginalDoesNotExist()
Tests error if original entity does not exist.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Recipe/ EntityCloneConfigActionTest.php, line 48
Class
- EntityCloneConfigActionTest
- Tests Entity Clone Config Action.
Namespace
Drupal\KernelTests\Core\RecipeCode
public function testErrorIfOriginalDoesNotExist() : void {
$this->expectException(ConfigActionException::class);
$this->expectExceptionMessage("Cannot clone 'user.role.nope' because it does not exist.");
$this->container
->get('plugin.manager.config_action')
->applyAction('cloneAs', 'user.role.nope', 'user.role.yep');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.