You are here

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

Same name and namespace in other branches
  1. 8.2 ldap_test/LdapTestCase.class.php \LdapTestCase::createTestUserFields()

Keep user entity fields function for ldap_user in base class instead of user test class in case module integration testing is needed.

2 calls to LdapTestCase::createTestUserFields()
LdapTestCase::setUp in ldap_test/LdapTestCase.class.php
Sets up a Drupal site for running functional and integration tests.
LdapUserIntegrationTests::testProvisionToLdap in ldap_user/tests/ldap_user.test
Integration tests for provisioning to ldap.

File

ldap_test/LdapTestCase.class.php, line 207

Class

LdapTestCase

Code

public function createTestUserFields() {
  foreach ($this
    ->ldap_user_test_entity_fields() as $field_id => $field_conf) {
    $field_info = field_info_field($field_id);
    if (!$field_info) {
      field_create_field($field_conf['field']);
      field_create_instance($field_conf['instance']);
    }
    $field_info = field_info_field($field_id);
  }
}