You are here

public function DisplayTest::testDisplayPluginsAlter in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views_ui/tests/src/Functional/DisplayTest.php \Drupal\Tests\views_ui\Functional\DisplayTest::testDisplayPluginsAlter()

Tests views_ui_views_plugins_display_alter is altering plugin definitions.

File

core/modules/views_ui/tests/src/Functional/DisplayTest.php, line 114

Class

DisplayTest
Tests the display UI.

Namespace

Drupal\Tests\views_ui\Functional

Code

public function testDisplayPluginsAlter() {
  $definitions = Views::pluginManager('display')
    ->getDefinitions();
  $expected = [
    'route_name' => 'entity.view.edit_form',
    'route_parameters_names' => [
      'view' => 'id',
    ],
  ];

  // Test the expected views_ui array exists on each definition.
  foreach ($definitions as $definition) {
    $this
      ->assertSame($expected, $definition['contextual links']['entity.view.edit_form'], 'Expected views_ui array found in plugin definition.');
  }
}