You are here

public function WebformViewsArgumentTestBase::testArgument in Webform Views Integration 8.5

Test argument handler.

@dataProvider providerArgument()

Parameters

string $argument: Argument to supply to the view when executing it.

array $expected: Expected output from $this->renderView() for the specified above argument.

File

tests/src/Kernel/argument/WebformViewsArgumentTestBase.php, line 23

Class

WebformViewsArgumentTestBase
Reasonable starting point for testing webform views argument handlers.

Namespace

Drupal\Tests\webform_views\Kernel\argument

Code

public function testArgument($argument, $expected) {
  $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, [
    $argument,
  ]);
  $this
    ->assertSame($expected, $rendered_cells, 'Argument works for ' . $argument);
}