58782e94c76499d31daae04a9c7d46291d9a4a76
[yaffs-website] / web / core / modules / user / src / Tests / Views / RolesRidArgumentTest.php
1 <?php
2
3 namespace Drupal\user\Tests\Views;
4
5 /**
6  * Tests the handler of the user: roles argument.
7  *
8  * @group user
9  * @see \Drupal\user\Plugin\views\argument\RolesRid
10  */
11 class RolesRidArgumentTest extends UserTestBase {
12
13   /**
14    * Views used by this test.
15    *
16    * @var array
17    */
18   public static $testViews = ['test_user_roles_rid'];
19
20   /**
21    * Tests the generated title of a user: roles argument.
22    */
23   public function testArgumentTitle() {
24     $role_id = $this->createRole([], 'markup_role_name', '<em>Role name with markup</em>');
25     $user = $this->createUser();
26     $user->addRole($role_id);
27     $user->save();
28
29     $this->drupalGet('/user_roles_rid_test/markup_role_name');
30     $this->assertEscaped('<em>Role name with markup</em>');
31   }
32
33 }