function DisplayPageTest::testDependencies

Same name in other branches
  1. 9 core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php \Drupal\Tests\views\Kernel\Plugin\DisplayPageTest::testDependencies()
  2. 10 core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php \Drupal\Tests\views\Kernel\Plugin\DisplayPageTest::testDependencies()
  3. 11.x core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php \Drupal\Tests\views\Kernel\Plugin\DisplayPageTest::testDependencies()

Tests the calculated dependencies for various views using Page displays.

File

core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php, line 133

Class

DisplayPageTest
Tests the page display plugin.

Namespace

Drupal\Tests\views\Kernel\Plugin

Code

public function testDependencies() {
    $view = Views::getView('test_page_display');
    $this->assertIdentical([
        'module' => [
            'views_test_data',
        ],
    ], $view->getDependencies());
    $view = Views::getView('test_page_display_route');
    $expected = [
        'content' => [
            'StaticTest',
        ],
        'module' => [
            'views_test_data',
        ],
    ];
    $this->assertIdentical($expected, $view->getDependencies());
    $view = Views::getView('test_page_display_menu');
    $expected = [
        'config' => [
            'system.menu.admin',
            'system.menu.tools',
        ],
        'module' => [
            'views_test_data',
        ],
    ];
    $this->assertIdentical($expected, $view->getDependencies());
}

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