You are here

class MenuLinkTestWithUnsafeTitle in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/MenuLinkTestWithUnsafeTitle.php \Drupal\menu_test\Plugin\Derivative\MenuLinkTestWithUnsafeTitle
  2. 10 core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/MenuLinkTestWithUnsafeTitle.php \Drupal\menu_test\Plugin\Derivative\MenuLinkTestWithUnsafeTitle

Test derivative with an unsafe string.

Hierarchy

Expanded class hierarchy of MenuLinkTestWithUnsafeTitle

1 string reference to 'MenuLinkTestWithUnsafeTitle'
menu_test.links.menu.yml in core/modules/system/tests/modules/menu_test/menu_test.links.menu.yml
core/modules/system/tests/modules/menu_test/menu_test.links.menu.yml

File

core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/MenuLinkTestWithUnsafeTitle.php, line 10

Namespace

Drupal\menu_test\Plugin\Derivative
View source
class MenuLinkTestWithUnsafeTitle extends DeriverBase {

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    $this->derivatives['unsafe'] = [
      'title' => '<script>alert("Even more wild animals")</script>',
      'menu_name' => 'tools',
    ] + $base_plugin_definition;
    return $this->derivatives;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
MenuLinkTestWithUnsafeTitle::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions