public function RelationshipRepresentativeNode::testRelationship

Same name in this branch
  1. 8.x drupal/core/modules/user/lib/Drupal/user/Tests/Views/RelationshipRepresentativeNode.php \Drupal\user\Tests\Views\RelationshipRepresentativeNode::testRelationship()
  2. 8.x drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/RelationshipRepresentativeNode.php \Drupal\taxonomy\Tests\Views\RelationshipRepresentativeNode::testRelationship()

Tests the relationship.

File

drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/RelationshipRepresentativeNode.php, line 33
Contains \Drupal\taxonomy\Tests\Views\RelationshipRepresentativeNode.

Class

RelationshipRepresentativeNode
Tests the representative node relationship for terms.

Namespace

Drupal\taxonomy\Tests\Views

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
        ->id(),
    ),
    array(
      'nid' => $this->nodes[1]->nid,
      'tid' => $this->term1
        ->id(),
    ),
  );
  $this
    ->assertIdenticalResultset($view, $expected_result, $map);
}