You are here

protected function BlockedDeleteTest::checkTestResults in Auto Purge Users 8.3

Check the state of each user.

2 calls to BlockedDeleteTest::checkTestResults()
BlockedDeleteTest::checkConfirmFormResults in tests/src/Functional/BlockedDeleteTest.php
Verifies the expected results of each test.
BlockedDeleteTest::checkCronResults in tests/src/Functional/BlockedDeleteTest.php
Verifies the expected results of each test.

File

tests/src/Functional/BlockedDeleteTest.php, line 72

Class

BlockedDeleteTest
Purge users who have been blocked for a specific period.

Namespace

Drupal\Tests\purge_users\Functional

Code

protected function checkTestResults() : void {
  $account = $this->userStorage
    ->load($this->admin
    ->id());
  $this
    ->assertNotNull($account);

  // Blocked user is not deleted.
  $account = $this->userStorage
    ->load($this->blockedUser
    ->id());
  $this
    ->assertNotNull($account);

  // Blocked user is deleted.
  $account = $this->userStorage
    ->load($this->blockedUserToDelete
    ->id());
  $this
    ->assertNull($account);

  // Confirm user's content is deleted.
  $test_node = $this->nodeStorage
    ->loadUnchanged($this->node
    ->id());
  $this
    ->assertNull($test_node);
  $account = $this->userStorage
    ->load($this->activeUser
    ->id());
  $this
    ->assertNotNull($account);
}