You are here

public function ActionBlockTest::testProcess in User Merge 2.x

Check if user was blocked.

Throws

\Drupal\usermerge\Exception\UserMergeException

File

tests/src/Kernel/ActionBlockTest.php, line 76

Class

ActionBlockTest
Class ActionBlockTest.

Namespace

Drupal\Tests\usermerge\Kernel

Code

public function testProcess() {
  $retired_id = $this->users['user3']
    ->id();
  $retained_id = $this->users['user4']
    ->id();
  $this->action
    ->process($this->users['user3'], $this->users['user4']);

  /** @var \Drupal\user\UserInterface $retired */
  $retired = User::load($retired_id);

  /** @var \Drupal\user\UserInterface $retained */
  $retained = User::load($retained_id);
  $this
    ->assertInstanceOf(User::class, $retired);
  $this
    ->assertInstanceOf(User::class, $retained);
  $this
    ->assertTrue($retired
    ->isBlocked());
  $this
    ->assertFalse($retained
    ->isBlocked());
}