You are here

CanNotifyTest.php in Create user permission 8

Same filename and directory in other branches
  1. 2.x tests/src/FunctionalJavascript/CanNotifyTest.php

File

tests/src/FunctionalJavascript/CanNotifyTest.php
View source
<?php

namespace Drupal\Tests\create_user_permission\FunctionalJavascript;

use Drupal\FunctionalJavascriptTests\JavascriptTestBase;

/**
 * Test that "create users" able users can notify users about the new account.
 *
 * @group create_user_permission
 */
class CanNotifyTest extends JavascriptTestBase {

  /**
   * {@inheritdoc}
   */
  public static $modules = [
    'create_user_permission',
  ];

  /**
   * Test that we can check the "notify user" checkbox.
   */
  public function testCanNotify() {
    $create_user = $this
      ->drupalCreateUser([
      'create users',
    ]);
    $this
      ->drupalLogin($create_user);

    // Go to the add person page.
    $this
      ->drupalGet('admin/people/create');

    // Check that the "notify" thing is available.
    $this
      ->assertTrue($this
      ->getSession()
      ->getPage()
      ->find('css', '#edit-notify')
      ->isVisible());
  }

}

Classes

Namesort descending Description
CanNotifyTest Test that "create users" able users can notify users about the new account.