ActiveLinkTest.php

Namespace

Drupal\Tests\system\FunctionalJavascript

File

core/modules/system/tests/src/FunctionalJavascript/ActiveLinkTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\system\FunctionalJavascript;

use Drupal\FunctionalJavascriptTests\WebDriverTestBase;

/**
 * Tests active link JS behavior.
 *
 * @see Drupal.behaviors.activeLinks
 *
 * @group system
 */
class ActiveLinkTest extends WebDriverTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';
  
  /**
   * Ensures no JS error is thrown with query strings containing special chars.
   */
  public function testQueryStringQuotes() : void {
    $user = $this->createUser();
    $this->drupalLogin($user);
    $this->drupalGet($this->getSession()
      ->getCurrentUrl(), [
      'query' => [
        'foo' => "\"'[](){}*+~>|\\/:;,.!@#\$%^&-_=?<>",
      ],
    ]);
    $this->failOnJavaScriptErrors();
  }

}

Classes

Title Deprecated Summary
ActiveLinkTest Tests active link JS behavior.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.