You are here

public function WebformViewsFieldTestBase::testField in Webform Views Integration 8.5

Test field rendering.

Execute a view and make sure the field handler we are testing produced correct HTML markup.

File

tests/src/Kernel/field/WebformViewsFieldTestBase.php, line 18

Class

WebformViewsFieldTestBase
Reasonable starting point for testing webform views field handlers.

Namespace

Drupal\Tests\webform_views\Kernel\field

Code

public function testField() {
  $this->webform = $this
    ->createWebform($this->webform_elements);
  $this
    ->createWebformSubmissions($this->webform_submissions_data, $this->webform);
  $this->view = $this
    ->initView($this->webform, $this->view_handlers);
  $rendered_cells = $this
    ->renderView($this->view);
  $this
    ->assertSame($this->webform_submissions_data, $rendered_cells, 'Views field on a webform element produces correct output.');
}