You are here

public function ProfileDefaultTest::testProfileFieldOnUserDisplayConfig in Profile 8

Test profile display options on user entity display mode.

File

tests/src/Functional/ProfileDefaultTest.php, line 77

Class

ProfileDefaultTest
Tests "default" functionality via the UI.

Namespace

Drupal\Tests\profile\Functional

Code

public function testProfileFieldOnUserDisplayConfig() {
  $id = $this->type
    ->id();
  $this
    ->drupalLogin($this->rootUser);

  // Check that profile field is configurable on user diplay mode.
  $this
    ->drupalGet('admin/config/people/accounts/display');
  $field_label = $this->type
    ->label() . ' profiles';
  $this
    ->assertSession()
    ->pageTextContains($field_label);
  $edit = [
    "fields[{$id}_profiles][label]" => 'inline',
  ];
  $edit = [
    "fields[{$id}_profiles][type]" => 'entity_reference_entity_view',
  ];
  $this
    ->drupalPostForm(NULL, $edit, t('Save'));
}