function AreaDisplayLinkTest::assertFormOptions

Same name in other branches
  1. 8.9.x core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php \Drupal\Tests\views\Kernel\Handler\AreaDisplayLinkTest::assertFormOptions()
  2. 10 core/modules/views/tests/src/Kernel/Handler/AreaDisplayLinkTest.php \Drupal\Tests\views\Kernel\Handler\AreaDisplayLinkTest::assertFormOptions()
  3. 11.x 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.

@internal

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 308

Class

AreaDisplayLinkTest
Tests the core views_handler_area_display_link handler.

Namespace

Drupal\Tests\views\Kernel\Handler

Code

protected function assertFormOptions(ViewExecutable $view, string $display_link_id) : void {
    $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']));
}

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