You are here

public function NotLoggedBlockedUnpublishTest::setUp in Auto Purge Users 8.3

Overrides BrowserTestBase::setUp

File

tests/src/Functional/NotLoggedBlockedUnpublishTest.php, line 21

Class

NotLoggedBlockedUnpublishTest
Purge users who did not log in for a specific period.

Namespace

Drupal\Tests\purge_users\Functional

Code

public function setUp() : void {
  parent::setUp();
  $this->nodeStorage = $this->container
    ->get('entity_type.manager')
    ->getStorage('node');
  $this->userStorage = $this->container
    ->get('entity_type.manager')
    ->getStorage('user');

  // Set the users for this scenario.
  $this
    ->addAdminUser();
  $this
    ->createTestUser();

  // Set the basic configuration and add the specific changes.
  $this
    ->setBasicConfig();
  $this
    ->config('purge_users.settings')
    ->set('user_lastlogin_value', '10')
    ->set('user_lastlogin_period', 'month')
    ->set('enabled_loggedin_users', TRUE)
    ->set('purge_user_cancel_method', 'user_cancel_block_unpublish')
    ->save();
}