You are here

public function FieldsTest::fieldIsRenderedInTheConfiguredRegion 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::fieldIsRenderedInTheConfiguredRegion()

@test

File

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

Class

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

Namespace

Drupal\Tests\layout_plugin_views\Unit

Code

public function fieldIsRenderedInTheConfiguredRegion() {
  $this
    ->initializeSubjectUnderTest([
    'assigned_regions' => [
      'somefield' => 'left',
      'some_other_field' => 'right',
    ],
  ]);
  $result = $this->sut
    ->render(new ResultRow([]));
  $this
    ->assertEquals(1, count($result['left']));
  $this
    ->assertFalse(isset($result['middle']));
  $this
    ->assertEquals(1, count($result['right']));
}