You are here

public function OrganizationUiTest::testFieldsUi in CRM Core 8

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

Test if the field UI is displayed on organization bundle.

File

modules/crm_core_contact/src/Tests/OrganizationUiTest.php, line 237

Class

OrganizationUiTest
Tests the UI for Organization CRUD operations.

Namespace

Drupal\crm_core_contact\Tests

Code

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