You are here

RolesRidArgumentTest.php in Zircon Profile 8

Same filename and directory in other branches
  1. 8.0 core/modules/user/src/Tests/Views/RolesRidArgumentTest.php

File

core/modules/user/src/Tests/Views/RolesRidArgumentTest.php
View source
<?php

/**
 * @file
 * Contains \Drupal\user\Tests\Views\RolesRidArgumentTest.
 */
namespace Drupal\user\Tests\Views;


/**
 * Tests the handler of the user: roles argument.
 *
 * @group user
 * @see \Drupal\user\Plugin\views\argument\RolesRid
 */
class RolesRidArgumentTest extends UserTestBase {

  /**
   * Views used by this test.
   *
   * @var array
   */
  public static $testViews = array(
    'test_user_roles_rid',
  );

  /**
   * Tests the generated title of a user: roles argument.
   */
  public function testArgumentTitle() {
    $role_id = $this
      ->createRole([], 'markup_role_name', '<em>Role name with markup</em>');
    $user = $this
      ->createUser();
    $user
      ->addRole($role_id);
    $user
      ->save();
    $this
      ->drupalGet('/user_roles_rid_test/markup_role_name');
    $this
      ->assertEscaped('<em>Role name with markup</em>');
  }

}

Classes

Namesort descending Description
RolesRidArgumentTest Tests the handler of the user: roles argument.