You are here

public function WebformViewsRelationshipTestBase::testReverseRelationship in Webform Views Integration 8.5

Test the reverse relationship.

@dataProvider providerReverseRelationship()

Parameters

array $expected: Expected output from $this->renderView().

File

tests/src/Kernel/relationship/WebformViewsRelationshipTestBase.php, line 67

Class

WebformViewsRelationshipTestBase
Reasonable starting point for testing webform views relationships.

Namespace

Drupal\Tests\webform_views\Kernel\relationship

Code

public function testReverseRelationship($expected) {
  $this->webform = $this
    ->createWebform($this->webform_elements);
  $this
    ->createWebformSubmissions($this->webform_submissions_data, $this->webform);
  $this->view = $this
    ->initView($this->webform, [], 'webform_views_reverse_entity_reference_test');
  $rendered_cells = $this
    ->renderView($this->view, [], []);
  $this
    ->assertSame($expected, $rendered_cells, 'Reverse relationship works.');
}