Mercurial > hg > isophonics-drupal-site
diff core/modules/user/src/Tests/Views/RolesRidArgumentTest.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/user/src/Tests/Views/RolesRidArgumentTest.php Wed Nov 29 16:09:58 2017 +0000 @@ -0,0 +1,33 @@ +<?php + +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 = ['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>'); + } + +}