You are here

public function IndividualUiTest::testFieldsUi in CRM Core 8

Same name and namespace in other branches
  1. 8.2 modules/crm_core_contact/src/Tests/IndividualUiTest.php \Drupal\crm_core_contact\Tests\IndividualUiTest::testFieldsUi()

Test if the field UI is displayed on individual bundle.

File

modules/crm_core_contact/src/Tests/IndividualUiTest.php, line 261

Class

IndividualUiTest
Tests the UI for Individual CRUD operations.

Namespace

Drupal\crm_core_contact\Tests

Code

public function testFieldsUi() {
  $user = $this
    ->drupalCreateUser([
    'administer crm_core_individual display',
    'administer crm_core_individual form display',
    'administer crm_core_individual fields',
  ]);
  $this
    ->drupalLogin($user);
  $this
    ->drupalGet('admin/structure/crm-core/individual-types/customer/fields');
  $this
    ->assertText(t('Manage fields'), 'Manage fields local task in available.');
  $this
    ->assertText(t('Manage form display'), 'Manage form display local task in available.');
  $this
    ->assertText(t('Manage display'), 'Manage display local task in available.');
  $this
    ->drupalGet('admin/structure/crm-core/individual-types/customer/form-display');
  $this
    ->assertText(t('Name'), 'Name field is available on form display.');
  $this
    ->drupalGet('admin/structure/crm-core/individual-types/customer/display');
  $this
    ->assertText(t('Name'), 'Name field is available on manage display.');
}