public function RelationshipRepresentativeNode::testRelationship

Same name in this branch
  1. 9.x drupal/core/modules/views/lib/Drupal/views/Tests/User/RelationshipRepresentativeNode.php \Drupal\views\Tests\User\RelationshipRepresentativeNode::testRelationship()
  2. 9.x drupal/core/modules/views/lib/Drupal/views/Tests/Taxonomy/RelationshipRepresentativeNode.php \Drupal\views\Tests\Taxonomy\RelationshipRepresentativeNode::testRelationship()

Tests the relationship.

File

drupal/core/modules/views/lib/Drupal/views/Tests/Taxonomy/RelationshipRepresentativeNode.php, line 33
Definition of Drupal\views\Tests\Taxonomy\RelationshipRepresentativeNode.

Class

RelationshipRepresentativeNode
Tests the representative node relationship for terms.

Namespace

Drupal\views\Tests\Taxonomy

Code

public function testRelationship() {
  $view = views_get_view('test_groupwise_term');
  $this
    ->executeView($view);
  $map = array(
    'node_taxonomy_term_data_nid' => 'nid',
    'tid' => 'tid',
  );
  $expected_result = array(
    array(
      'nid' => $this->nodes[1]->nid,
      'tid' => $this->term2->tid,
    ),
    array(
      'nid' => $this->nodes[1]->nid,
      'tid' => $this->term1->tid,
    ),
  );
  $this
    ->assertIdenticalResultset($view, $expected_result, $map);
}