public function RelationshipRepresentativeNode::testRelationship

Same name in this branch

Tests the relationship.

File

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

Class

RelationshipRepresentativeNode
Tests the representative node relationship for users.

Namespace

Drupal\user\Tests\Views

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);
}