You are here

public function FieldsTest::assertRegionAssignmentFields in Layout Plugin Views 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/FieldsTest.php \Drupal\Tests\layout_plugin_views\Unit\FieldsTest::assertRegionAssignmentFields()

@test

File

tests/src/Unit/FieldsTest.php, line 151

Class

FieldsTest
@coversDefaultClass \Drupal\layout_plugin_views\Plugin\views\row\Fields @group Panels

Namespace

Drupal\Tests\layout_plugin_views\Unit

Code

public function assertRegionAssignmentFields() {
  $form = $this
    ->buildOptionsFrom();
  foreach ($this
    ->fieldLabels() as $field_name => $field_label) {
    $this
      ->assertEquals('select', $form['assigned_regions'][$field_name]['#type']);
    $this
      ->assertNotEmpty($form['assigned_regions'][$field_name]['#empty_option']);
    $this
      ->assertEquals($this
      ->availableRegions(), $form['assigned_regions'][$field_name]['#options']);
    $this
      ->assertEquals($field_label, $form['assigned_regions'][$field_name]['#title']);
    $this
      ->assertEquals('', $form['assigned_regions'][$field_name]['#default_value']);
  }
}