You are here

function field_test_entity_info_translatable in Drupal 7

Same name and namespace in other branches
  1. 8 core/modules/field/tests/modules/field_test/field_test.entity.inc \field_test_entity_info_translatable()
  2. 9 core/modules/field/tests/modules/field_test/field_test.entity.inc \field_test_entity_info_translatable()

Helper function to enable entity translations.

10 calls to field_test_entity_info_translatable()
EntityFieldQueryTestCase::testEntityFieldQueryMetaConditions in modules/simpletest/tests/entity_query.test
Tests field meta conditions.
EntityFieldQueryTestCase::testEntityFieldQueryTranslatable in modules/simpletest/tests/entity_query.test
Tests querying translatable fields.
FieldSqlStorageTestCase::testFieldSqlStorageMultipleConditionsDifferentColumnsMultipleLanguages in modules/field/modules/field_sql_storage/field_sql_storage.test
Test handling multiple conditions on multiple columns of one field for multiple languages.
FieldTranslationsTestCase::testFieldAvailableLanguages in modules/field/tests/field.test
Ensures that only valid values are returned by field_available_languages().
FieldTranslationsTestCase::testFieldDisplayLanguage in modules/field/tests/field.test
Tests display language logic for translatable fields.

... See full list

File

modules/field/tests/field_test.entity.inc, line 146
Defines an entity type.

Code

function field_test_entity_info_translatable($entity_type = NULL, $translatable = NULL) {
  drupal_static_reset('field_has_translation_handler');
  $stored_value =& drupal_static(__FUNCTION__, array());
  if (isset($entity_type)) {
    $stored_value[$entity_type] = $translatable;
    entity_info_cache_clear();
  }
  return $stored_value;
}