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/User/RelationshipRepresentativeNode.php, line 33
Definition of Drupal\views\Tests\User\RelationshipRepresentativeNode.

Class

RelationshipRepresentativeNode
Tests the representative node relationship for users.

Namespace

Drupal\views\Tests\User

Code

public function testRelationship() {
  $view = views_get_view('test_groupwise_user');
  $this
    ->executeView($view);
  $map = array(
    'node_users_nid' => 'nid',
    'uid' => 'uid',
  );
  $expected_result = array(
    array(
      'uid' => $this->users[1]->uid,
      'nid' => $this->nodes[1]->nid,
    ),
    array(
      'uid' => $this->users[0]->uid,
      'nid' => $this->nodes[0]->nid,
    ),
  );
  $this
    ->assertIdenticalResultset($view, $expected_result, $map);
}