You are here

public function DisplayTest::testDisplayPluginsAlter in Views (for Drupal 7) 8.3

Tests views_ui_views_plugins_display_alter is altering plugin definitions.

File

lib/Drupal/views/Tests/UI/DisplayTest.php, line 170
Definition of Drupal\views\Tests\UI\DisplayTest.

Class

DisplayTest
Tests the handling of displays in the UI, adding removing etc.

Namespace

Drupal\views\Tests\UI

Code

public function testDisplayPluginsAlter() {
  $definitions = drupal_container()
    ->get('plugin.manager.views.display')
    ->getDefinitions();
  $expected = array(
    'parent path' => 'admin/structure/views/view',
    'argument properties' => array(
      'name',
    ),
  );

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