You are here

public function UserTest::testCompatibility in Display Suite 8.4

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/UserTest.php \Drupal\Tests\ds\Functional\UserTest::testCompatibility()

Tests hook_ds_pre_render_alter() with user entities

File

tests/src/Functional/UserTest.php, line 15

Class

UserTest
Tests user functionality

Namespace

Drupal\Tests\ds\Functional

Code

public function testCompatibility() {

  // Create a test user.

  /** @var \Drupal\user\UserInterface $new_user */
  $new_user = $this
    ->drupalCreateUser([
    'access content',
  ]);
  $this
    ->dsSelectLayout([], [], 'admin/config/people/accounts/display');
  $fields = [
    'fields[username][region]' => 'right',
  ];
  $this
    ->dsConfigureUi($fields, 'admin/config/people/accounts/display');
  $this
    ->drupalGet('user/' . $new_user
    ->id());
  $this
    ->assertSession()
    ->responseContains('entity-label-class-' . $new_user
    ->label());
}