public function EntityCloneUserTest::testUserEntityClone in Entity Clone 8
Test user entity clone.
File
- tests/
src/ Functional/ EntityCloneUserTest.php, line 57
Class
- EntityCloneUserTest
- Create a user and test a clone.
Namespace
Drupal\Tests\entity_clone\FunctionalCode
public function testUserEntityClone() {
$this
->drupalPostForm('entity_clone/user/' . $this->adminUser
->id(), [], t('Clone'));
$users = \Drupal::entityTypeManager()
->getStorage('user')
->loadByProperties([
'name' => 'test_user_cloned',
]);
$user = reset($users);
$this
->assertInstanceOf(User::class, $user, 'Test user cloned found in database.');
}