function EntityCloneConfigActionTest::testSuccessfulClone

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/KernelTests/Core/Recipe/EntityCloneConfigActionTest.php \Drupal\KernelTests\Core\Recipe\EntityCloneConfigActionTest::testSuccessfulClone()

Tests successful clone.

File

core/tests/Drupal/KernelTests/Core/Recipe/EntityCloneConfigActionTest.php, line 58

Class

EntityCloneConfigActionTest
Tests Entity Clone Config Action.

Namespace

Drupal\KernelTests\Core\Recipe

Code

public function testSuccessfulClone() : void {
  $this->container
    ->get('plugin.manager.config_action')
    ->applyAction('cloneAs', 'user.role.test', 'cloned');
  $clone = Role::load('cloned');
  $this->assertInstanceOf(Role::class, $clone);
  $this->assertTrue($clone->hasPermission('access user profiles'));
}

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