You are here

public function LdapTestCase::ldap_user_test_entity_fields in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_test/LdapTestCase.class.php \LdapTestCase::ldap_user_test_entity_fields()
1 call to LdapTestCase::ldap_user_test_entity_fields()
LdapTestCase::createTestUserFields in ldap_test/LdapTestCase.class.php
Keep user entity fields function for ldap_user in base class instead of user test class in case module integration testing is needed.

File

ldap_test/LdapTestCase.class.php, line 221

Class

LdapTestCase

Code

public function ldap_user_test_entity_fields() {
  $fields = [];
  $fields['field_lname']['field'] = [
    'field_name' => 'field_lname',
    'type' => 'text',
    'settings' => [
      'max_length' => 64,
    ],
  ];
  $fields['field_lname']['instance'] = [
    'field_name' => 'field_lname',
    'entity_type' => 'user',
    'label' => 'Last Name',
    'bundle' => 'user',
    'required' => FALSE,
    'widget' => [
      'type' => 'text_textfield',
    ],
    'display' => [
      'default' => [
        'type' => 'text_default',
      ],
    ],
    'settings' => [
      'user_register_form' => FALSE,
    ],
  ];
  $fields['field_department']['field'] = [
    'field_name' => 'field_department',
    'type' => 'text',
    'settings' => [
      'max_length' => 64,
    ],
  ];
  $fields['field_department']['instance'] = [
    'field_name' => 'field_department',
    'entity_type' => 'user',
    'label' => 'Department',
    'bundle' => 'user',
    'required' => FALSE,
    'widget' => [
      'type' => 'text_textfield',
    ],
    'display' => [
      'default' => [
        'type' => 'text_default',
      ],
    ],
    'settings' => [
      'user_register_form' => FALSE,
    ],
  ];
  $fields['field_fname']['field'] = [
    'field_name' => 'field_fname',
    'type' => 'text',
    'settings' => [
      'max_length' => 64,
    ],
  ];
  $fields['field_fname']['instance'] = [
    'field_name' => 'field_fname',
    'entity_type' => 'user',
    'label' => 'Last Name',
    'bundle' => 'user',
    'required' => FALSE,
    'widget' => [
      'type' => 'text_textfield',
    ],
    'display' => [
      'default' => [
        'type' => 'text_default',
      ],
    ],
    'settings' => [
      'user_register_form' => FALSE,
    ],
  ];

  // Display name for testing compound tokens.
  $fields['field_display_name']['field'] = [
    'field_name' => 'field_display_name',
    'type' => 'text',
    'settings' => [
      'max_length' => 64,
    ],
  ];
  $fields['field_display_name']['instance'] = [
    'field_name' => 'field_display_name',
    'entity_type' => 'user',
    'label' => 'Display Name',
    'bundle' => 'user',
    'required' => FALSE,
    'widget' => [
      'type' => 'text_textfield',
    ],
    'display' => [
      'default' => [
        'type' => 'text_default',
      ],
    ],
    'settings' => [
      'user_register_form' => FALSE,
    ],
  ];

  // Display name for testing compound tokens.
  $fields['field_binary_test']['field'] = [
    'field_name' => 'field_binary_test',
    'type' => 'text',
    'size' => 'big',
  ];
  $fields['field_binary_test']['instance'] = [
    'field_name' => 'field_binary_test',
    'entity_type' => 'user',
    'label' => 'Binary Field',
    'bundle' => 'user',
    'required' => FALSE,
    'widget' => [
      'type' => 'text_textfield',
    ],
    'display' => [
      'default' => [
        'type' => 'text_default',
      ],
    ],
    'settings' => [
      'user_register_form' => FALSE,
    ],
  ];
  return $fields;
}