function EntityCloneConfigActionTest::testSuccessfulClone

Tests successful clone.

File

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

Class

EntityCloneConfigActionTest
@covers \Drupal\Core\Config\Action\Plugin\ConfigAction\EntityClone @group Recipe

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.