You are here

public function RelationshipRepresentativeNode::testRelationship in Views (for Drupal 7) 8.3

Same name in this branch
  1. 8.3 lib/Drupal/views/Tests/Taxonomy/RelationshipRepresentativeNode.php \Drupal\views\Tests\Taxonomy\RelationshipRepresentativeNode::testRelationship()
  2. 8.3 lib/Drupal/views/Tests/User/RelationshipRepresentativeNode.php \Drupal\views\Tests\User\RelationshipRepresentativeNode::testRelationship()

Tests the relationship.

File

lib/Drupal/views/Tests/Taxonomy/RelationshipRepresentativeNode.php, line 26
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);
}