You are here

function field_test_entity_info in SimpleTest 7

Define a test fieldable entity.

3 calls to field_test_entity_info()
field_test_create_bundle in tests/field_test.module
Create a new bundle for test_entity objects.
field_test_delete_bundle in tests/field_test.module
Delete a bundle for test_entity objects.
field_test_rename_bundle in tests/field_test.module
Rename a bundle for test_entity objects.

File

tests/field_test.module, line 62

Code

function field_test_entity_info() {
  $bundles = variable_get('field_test_bundles', array(
    'test_bundle' => array(
      'label' => 'Test Bundle',
    ),
  ));
  return array(
    'test_entity' => array(
      'name' => t('Test Entity'),
      'object keys' => array(
        'id' => 'ftid',
        'revision' => 'ftvid',
        'bundle' => 'fttype',
      ),
      'cacheable' => FALSE,
      'bundles' => $bundles,
      'fieldable' => TRUE,
    ),
    // This entity type doesn't get form handling for now...
    'test_cacheable_entity' => array(
      'name' => t('Test Entity, cacheable'),
      'object keys' => array(
        'id' => 'ftid',
        'revision' => 'ftvid',
        'bundle' => 'fttype',
      ),
      'fieldable' => TRUE,
      'cacheable' => TRUE,
      'bundles' => $bundles,
    ),
  );
}