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. 8.9.x core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php \Drupal\Tests\views\Kernel\Plugin\DisplayPageTest::testDependencies()
  3. 10 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 138

Class

DisplayPageTest
Tests the page display plugin.

Namespace

Drupal\Tests\views\Kernel\Plugin

Code

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

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