Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html1/testsite/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/html1/testsite/web/core/modules/views/tests/src/Functional/Wizard/MenuTest.php

<?php

namespace Drupal\Tests\views\Functional\Wizard;

use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\Url;

/**
 * Tests the ability of the views wizard to put views in a menu.
 *
 * @group views
 */
class MenuTest extends WizardTestBase {

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

  /**
   * Tests the menu functionality.
   */
  public function testMenus() {
    $this->drupalPlaceBlock('system_menu_block:main');

    // Create a view with a page display and a menu link in the Main Menu.
    $view = [];
    $view['label'] = $this->randomMachineName(16);
    $view['id'] = strtolower($this->randomMachineName(16));
    $view['description'] = $this->randomMachineName(16);
    $view['page[create]'] = 1;
    $view['page[title]'] = $this->randomMachineName(16);
    $view['page[path]'] = $this->randomMachineName(16);
    $view['page[link]'] = 1;
    $view['page[link_properties][menu_name]'] = 'main';
    $view['page[link_properties][title]'] = $this->randomMachineName(16);
    $this->drupalPostForm('admin/structure/views/add', $view, t('Save and edit'));

    // Make sure there is a link to the view from the front page (where we
    // expect the main menu to display).
    $this->drupalGet('');
    $this->assertSession()->statusCodeEquals(200);
    $this->assertSession()->linkExists($view['page[link_properties][title]']);
    $this->assertLinkByHref(Url::fromUri('base:' . $view['page[path]'])->toString());

    // Make sure the link is associated with the main menu.
    /** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */
    $menu_link_manager = \Drupal::service('plugin.manager.menu.link');
    /** @var \Drupal\Core\Menu\MenuLinkInterface $link */
    $link = $menu_link_manager->createInstance('views_view:views.' . $view['id'] . '.page_1');
    $url = $link->getUrlObject();
    $this->assertEqual($url->getRouteName(), 'view.' . $view['id'] . '.page_1', new FormattableMarkup('Found a link to %path in the main menu', ['%path' => $view['page[path]']]));
    $metadata = $link->getMetaData();
    $this->assertEqual(['view_id' => $view['id'], 'display_id' => 'page_1'], $metadata);
  }

}

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