You are here

public function UiRoleExpireTest::testRoleExpireEditUserFields in Role Expire 8

Same name and namespace in other branches
  1. 2.x tests/src/Functional/UiRoleExpireTest.php \Drupal\Tests\role_expire\Functional\UiRoleExpireTest::testRoleExpireEditUserFields()

Tests that users can assign an expiration date/time on user roles.

File

tests/src/Functional/UiRoleExpireTest.php, line 61

Class

UiRoleExpireTest
Tests that the Role expire interface is available.

Namespace

Drupal\Tests\role_expire\Functional

Code

public function testRoleExpireEditUserFields() {
  $account = $this
    ->drupalCreateUser([
    'administer role expire',
  ]);
  $this
    ->drupalLogin($account);
  $this
    ->drupalGet('user/' . $account
    ->id() . '/edit');
  $this
    ->assertSession()
    ->statusCodeEquals(200);

  // Test that we can set expiration for user roles.
  $this
    ->assertSession()
    ->pageTextContains('role expiration date/time');
}