diff options
Diffstat (limited to 'modules/simpletest/tests/taxonomy_test.module')
-rw-r--r-- | modules/simpletest/tests/taxonomy_test.module | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/modules/simpletest/tests/taxonomy_test.module b/modules/simpletest/tests/taxonomy_test.module index aae13a2d4..f82950c30 100644 --- a/modules/simpletest/tests/taxonomy_test.module +++ b/modules/simpletest/tests/taxonomy_test.module @@ -3,6 +3,8 @@ /** * @file * Test module for Taxonomy hooks and functions not used in core. + * + * @see TaxonomyHooksTestCase::testTaxonomyTermHooks() */ /** @@ -55,6 +57,34 @@ function taxonomy_test_taxonomy_term_delete($term) { } /** + * Implements hook_taxonomy_term_view(). + */ +function taxonomy_test_taxonomy_term_view($term, $view_mode, $langcode) { + if ($view_mode == 'full') { + $term->content['taxonomy_test_term_view_check'] = array( + '#prefix' => '<div>', + '#markup' => t('The antonym is %antonym', array('%antonym' => $term->antonym)), + '#suffix' => '</div>', + '#weight' => 10, + ); + } +} + +/** + * Implements hook_entity_view(). + */ +function taxonomy_test_entity_view($entity, $type, $view_mode, $langcode) { + if ($type == 'taxonomy_term' && $view_mode == 'full') { + $entity->content['taxonomy_test_entity_view_check'] = array( + '#prefix' => '<div>', + '#markup' => t('The antonym is %antonym', array('%antonym' => $entity->antonym)), + '#suffix' => '</div>', + '#weight' => 20, + ); + } +} + +/** * Implements hook_form_alter(). */ function taxonomy_test_form_alter(&$form, $form_state, $form_id) { |