You are here

public function DisplayPageTest::testDependencies in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php \Drupal\Tests\views\Kernel\Plugin\DisplayPageTest::testDependencies()
  2. 9 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 140

Class

DisplayPageTest
Tests the page display plugin.

Namespace

Drupal\Tests\views\Kernel\Plugin

Code

public function testDependencies() {
  $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());
}