You are here

public function DisplayTest::testDisplayPluginsAlter in Zircon Profile 8

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

Tests views_ui_views_plugins_display_alter is altering plugin definitions.

File

core/modules/views_ui/src/Tests/DisplayTest.php, line 116
Contains \Drupal\views_ui\Tests\DisplayTest.

Class

DisplayTest
Tests the display UI.

Namespace

Drupal\views_ui\Tests

Code

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

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