You are here

function title_test_entity_presave in Title 7

Implements hook_entity_presave().

File

tests/title_test.module, line 101
Testing functionality for Title module.

Code

function title_test_entity_presave($entity, $type) {
  if ($type == 'test_entity') {
    $info = entity_get_info('test_entity');
    $label_key = $info['entity keys']['label'];
    $entity->{$label_key} = DrupalWebTestCase::randomName();
  }
}