You are here

CanNotifyTest.php in Create user permission 2.x

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

File

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

namespace Drupal\Tests\create_user_permission\Functional;

use Drupal\FunctionalJavascriptTests\WebDriverTestBase;

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

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

  /**
   * {@inheritdoc}
   */
  protected 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.