Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/rocksensor2/web/core/modules/views/tests/src/Functional/Wizard/

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/rocksensor2/web/core/modules/views/tests/src/Functional/Wizard/PagerTest.php

<?php

declare(strict_types=1);

namespace Drupal\Tests\views\Functional\Wizard;

/**
 * Tests the ability of the views wizard to create views without a pager.
 *
 * @group views
 */
class PagerTest extends WizardTestBase {

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

  /**
   * Tests the pager option.
   */
  public function testPager(): void {
    // Create nodes, each with a different creation time so that we have
    // conditions that are meaningful for the use of a pager.
    $this->drupalCreateContentType(['type' => 'page']);
    for ($i = 0; $i < 12; $i++) {
      $this->drupalCreateNode(['created' => \Drupal::time()->getRequestTime() - $i]);
    }

    // Make a View that uses a pager.
    $path_with_pager = 'test-view-with-pager';
    $this->createViewAtPath($path_with_pager, TRUE);
    $this->drupalGet($path_with_pager);

    // This technique for finding the existence of a pager
    // matches that used in Drupal\views_ui\Tests\PreviewTest.php.
    $this->assertSession()->elementExists('xpath', '//ul[contains(@class, "pager__items")]/li');

    // Make a View that does not have a pager.
    $path_with_no_pager = 'test-view-without-pager';
    $this->createViewAtPath($path_with_no_pager, FALSE);
    $this->drupalGet($path_with_no_pager);
    $this->assertSession()->elementNotExists('xpath', '//ul[contains(@class, "pager__items")]/li');
  }

  /**
   * Create a simple View of nodes at a given path.
   *
   * @param string $path
   *   The path at which the View should be created.
   * @param bool $pager
   *   A boolean for whether the View created should use a pager.
   */
  protected function createViewAtPath($path, $pager = TRUE) {
    $view = [];
    $view['label'] = $this->randomMachineName(16);
    $view['id'] = $this->randomMachineName(16);
    $view['show[sort]'] = 'node_field_data-created:ASC';
    $view['page[create]'] = 1;
    $view['page[title]'] = $this->randomMachineName(16);
    $view['page[path]'] = $path;
    $view['page[pager]'] = $pager;
    $this->drupalGet('admin/structure/views/add');
    $this->submitForm($view, 'Save and edit');
  }

}

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