You are here

public function DomainAccessEntityCrudTest::testUserUpdateWithUninstalledDomainAccessFields in Domain Access 8

Tests user update with uninstalled domain access fields.

File

domain_access/tests/src/Kernel/DomainAccessEntityCrudTest.php, line 164

Class

DomainAccessEntityCrudTest
Tests creation of nodes and users before and after deleting required fields.

Namespace

Drupal\Tests\domain_access\Kernel

Code

public function testUserUpdateWithUninstalledDomainAccessFields() {
  $user = $this
    ->drupalCreateUser();
  $user
    ->save();
  self::assertNotEmpty($user
    ->id());
  $this
    ->deleteDomainAccessFields('user', 'user');
  $reloaded_user = $this->entityTypeManager
    ->getStorage('user')
    ->load($user
    ->id());
  $new_name = $this
    ->randomMachineName();
  $reloaded_user
    ->setUsername($new_name);
  $reloaded_user
    ->save();
  self::assertSame($new_name, $reloaded_user
    ->getAccountName());
}