Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/store/web/core/modules/user/tests/src/Functional/Views/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : /var/www/html/store/web/core/modules/user/tests/src/Functional/Views/HandlerFieldRoleTest.php

<?php

namespace Drupal\Tests\user\Functional\Views;

use Drupal\Component\Utility\Html;
use Drupal\user\Entity\User;

/**
 * Tests the handler of the user: role field.
 *
 * @group user
 * @see views_handler_field_user_name
 */
class HandlerFieldRoleTest extends UserTestBase {

  /**
   * Views used by this test.
   *
   * @var array
   */
  public static $testViews = ['test_views_handler_field_role'];

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

  public function testRole() {
    // Create a couple of roles for the view.
    $rolename_a = 'a' . $this->randomMachineName(8);
    $this->drupalCreateRole(['access content'], $rolename_a, '<em>' . $rolename_a . '</em>', 9);

    $rolename_b = 'b' . $this->randomMachineName(8);
    $this->drupalCreateRole(['access content'], $rolename_b, $rolename_b, 8);

    $rolename_not_assigned = $this->randomMachineName(8);
    $this->drupalCreateRole(['access content'], $rolename_not_assigned, $rolename_not_assigned);

    // Add roles to user 1.
    $user = User::load(1);
    $user->addRole($rolename_a);
    $user->addRole($rolename_b);
    $user->save();

    $this->drupalLogin($this->createUser(['access user profiles']));
    $this->drupalGet('/test-views-handler-field-role');
    // Verify that the view test_views_handler_field_role renders role assigned
    // to user in the correct order and markup in role names is escaped.
    $this->assertSession()->responseContains($rolename_b . Html::escape('<em>' . $rolename_a . '</em>'));
    // Verify that the view test_views_handler_field_role does not render a role
    // not assigned to a user.
    $this->assertSession()->pageTextNotContains($rolename_not_assigned);
  }

}

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net