summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/tests/taxonomy_test.module24
1 files changed, 16 insertions, 8 deletions
diff --git a/modules/simpletest/tests/taxonomy_test.module b/modules/simpletest/tests/taxonomy_test.module
index 7f5b6f4df..2bbcf2453 100644
--- a/modules/simpletest/tests/taxonomy_test.module
+++ b/modules/simpletest/tests/taxonomy_test.module
@@ -14,19 +14,27 @@ function taxonomy_test_taxonomy_term_load($term) {
}
/**
- * Implementation of hook_taxonomy_term_save().
+ * Implementation of hook_taxonomy_term_insert().
*/
-function taxonomy_test_taxonomy_term_save($term) {
+function taxonomy_test_taxonomy_term_insert($term) {
+ if (!empty($term->antonyms)) {
+ foreach (explode ("\n", str_replace("\r", '', $term->antonyms)) as $antonym) {
+ if ($antonym) {
+ db_insert('term_antonym')->fields(array('tid' => $term->tid, 'name' => rtrim($antonym)))->execute();
+ }
+ }
+ }
+}
+
+/**
+ * Implementation of hook_taxonomy_term_update().
+ */
+function taxonomy_test_taxonomy_term_update($term) {
taxonomy_test_taxonomy_term_delete($term);
if (!empty($term->antonyms)) {
foreach (explode ("\n", str_replace("\r", '', $term->antonyms)) as $antonym) {
if ($antonym) {
- db_insert('term_antonym')
- ->fields(array(
- 'tid' => $term->tid,
- 'name' => rtrim($antonym),
- ))
- ->execute();
+ db_insert('term_antonym')->fields(array('tid' => $term->tid, 'name' => rtrim($antonym)))->execute();
}
}
}