public function RelationshipRepresentativeNodeTest::testRelationship in Zircon Profile 8
Same name in this branch
- 8 core/modules/user/src/Tests/Views/RelationshipRepresentativeNodeTest.php \Drupal\user\Tests\Views\RelationshipRepresentativeNodeTest::testRelationship()
- 8 core/modules/taxonomy/src/Tests/Views/RelationshipRepresentativeNodeTest.php \Drupal\taxonomy\Tests\Views\RelationshipRepresentativeNodeTest::testRelationship()
Same name and namespace in other branches
- 8.0 core/modules/user/src/Tests/Views/RelationshipRepresentativeNodeTest.php \Drupal\user\Tests\Views\RelationshipRepresentativeNodeTest::testRelationship()
Tests the relationship.
File
- core/modules/ user/ src/ Tests/ Views/ RelationshipRepresentativeNodeTest.php, line 29 
- Contains \Drupal\user\Tests\Views\RelationshipRepresentativeNodeTest.
Class
- RelationshipRepresentativeNodeTest
- Tests the representative node relationship for users.
Namespace
Drupal\user\Tests\ViewsCode
public function testRelationship() {
  $view = Views::getView('test_groupwise_user');
  $this
    ->executeView($view);
  $map = array(
    'node_field_data_users_field_data_nid' => 'nid',
    'uid' => 'uid',
  );
  $expected_result = array(
    array(
      'uid' => $this->users[1]
        ->id(),
      'nid' => $this->nodes[1]
        ->id(),
    ),
    array(
      'uid' => $this->users[0]
        ->id(),
      'nid' => $this->nodes[0]
        ->id(),
    ),
  );
  $this
    ->assertIdenticalResultset($view, $expected_result, $map);
}