You are here

public function LocalTaskTestWithUnsafeTitle::getDerivativeDefinitions in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalTaskTestWithUnsafeTitle.php \Drupal\menu_test\Plugin\Derivative\LocalTaskTestWithUnsafeTitle::getDerivativeDefinitions()

@inheritDoc

Overrides DeriverBase::getDerivativeDefinitions

File

core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalTaskTestWithUnsafeTitle.php, line 22
Contains \Drupal\menu_test\Plugin\Derivative\LocalTaskTestWithUnsafeTitle.

Class

LocalTaskTestWithUnsafeTitle
Test derivative to check local task title escaping.

Namespace

Drupal\menu_test\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  $this->derivatives['unsafe'] = [
    'title' => "<script>alert('Welcome to the derived jungle!')</script>",
    'route_parameters' => [
      'bar' => 'unsafe',
    ],
  ] + $base_plugin_definition;
  return $this->derivatives;
}