summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.test
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-08-03 02:17:18 +0000
committerDries Buytaert <dries@buytaert.net>2010-08-03 02:17:18 +0000
commitf645ab468a57a9c8d5d5cac70c29dd0315f149d4 (patch)
tree5a902aaadd36a7c531db45ada7a15ccb3a482004 /modules/taxonomy/taxonomy.test
parent98ef4e3e4ad8cc330af27a267ee0ab2406c1939f (diff)
downloadbrdo-f645ab468a57a9c8d5d5cac70c29dd0315f149d4.tar.gz
brdo-f645ab468a57a9c8d5d5cac70c29dd0315f149d4.tar.bz2
- Patch #844410 by Dave Reid: taxonomy parents need to be saved before term hooks are called.
Diffstat (limited to 'modules/taxonomy/taxonomy.test')
-rw-r--r--modules/taxonomy/taxonomy.test17
1 files changed, 16 insertions, 1 deletions
diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test
index adda2fa3a..a7c922b7f 100644
--- a/modules/taxonomy/taxonomy.test
+++ b/modules/taxonomy/taxonomy.test
@@ -1005,7 +1005,22 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase {
$edit[$this->instance['field_name'] . '[' . $this->langcode . '][]'] = $term2->tid;
$this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
- // Generate and test sanitized tokens.
+ // Generate and test sanitized tokens for term1.
+ $tests = array();
+ $tests['[term:tid]'] = $term1->tid;
+ $tests['[term:name]'] = check_plain($term1->name);
+ $tests['[term:description]'] = check_markup($term1->description, $term1->format);
+ $tests['[term:url]'] = url('taxonomy/term/' . $term1->tid, array('absolute' => TRUE));
+ $tests['[term:node-count]'] = 0;
+ $tests['[term:parent:name]'] = '[term:parent:name]';
+ $tests['[term:vocabulary:name]'] = check_plain($this->vocabulary->name);
+
+ foreach ($tests as $input => $expected) {
+ $output = token_replace($input, array('term' => $term1), array('language' => $language));
+ $this->assertFalse(strcmp($output, $expected), t('Sanitized taxonomy term token %token replaced.', array('%token' => $input)));
+ }
+
+ // Generate and test sanitized tokens for term2.
$tests = array();
$tests['[term:tid]'] = $term2->tid;
$tests['[term:name]'] = check_plain($term2->name);