function DisplayTest::testDisplayPluginsAlter

Same name in other branches
  1. 9 core/modules/views_ui/tests/src/Functional/DisplayTest.php \Drupal\Tests\views_ui\Functional\DisplayTest::testDisplayPluginsAlter()
  2. 8.9.x core/modules/views_ui/tests/src/Functional/DisplayTest.php \Drupal\Tests\views_ui\Functional\DisplayTest::testDisplayPluginsAlter()
  3. 11.x 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 116

Class

DisplayTest
Tests the display UI.

Namespace

Drupal\Tests\views_ui\Functional

Code

public function testDisplayPluginsAlter() : void {
    $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.');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.