You are here

protected function AreaDisplayLinkTest::assertFormOptions in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php \Drupal\Tests\views\Kernel\Handler\AreaDisplayLinkTest::assertFormOptions()

Assert the display options contains only path based displays.

Parameters

\Drupal\views\ViewExecutable $view: The view to check.

string $display_link_id: The display link ID to check the options for.

1 call to AreaDisplayLinkTest::assertFormOptions()
AreaDisplayLinkTest::testAreaDisplayLink in core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php
Tests the views area display_link handler.

File

core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php, line 306

Class

AreaDisplayLinkTest
Tests the core views_handler_area_display_link handler.

Namespace

Drupal\Tests\views\Kernel\Handler

Code

protected function assertFormOptions(ViewExecutable $view, $display_link_id) {
  $form = [];
  $form_state = new FormState();
  $view->display_handler
    ->getHandler('header', $display_link_id)
    ->buildOptionsForm($form, $form_state);
  $this
    ->assertTrue(isset($form['display_id']['#options']['page_1']));
  $this
    ->assertTrue(isset($form['display_id']['#options']['page_2']));
  $this
    ->assertFalse(isset($form['display_id']['#options']['block_1']));
}