function TokenTaxonomyTestCase::testTaxonomyTokens in Token 6
Same name and namespace in other branches
- 7 token.test \TokenTaxonomyTestCase::testTaxonomyTokens()
File
- ./
token.test, line 446 - Tests for the token module.
Class
Code
function testTaxonomyTokens() {
$vocabulary = $this
->addVocabulary(array(
'name' => '<blink>Vocab Name</blink>',
'description' => '<blink>Vocab Description</blink>',
));
$term = $this
->addTerm($vocabulary, array(
'name' => '<blink>Term Name</blink>',
'description' => '<blink>Term Description</blink>',
));
$tokens = array(
'tid' => $term->tid,
'cat' => check_plain($term->name),
'cat-raw' => $term->name,
'cat-description' => 'Term Description',
'vid' => $vocabulary->vid,
'vocab' => check_plain($vocabulary->name),
'vocab-raw' => $vocabulary->name,
'vocab-description' => 'Vocab Description',
'vocab-description-raw' => $vocabulary->description,
);
$this
->assertTokens('taxonomy', $term, $tokens);
$tokens = array(
'vocabulary-vid' => $vocabulary->vid,
'vocabulary-name' => check_plain($vocabulary->name),
'vocabulary-name-raw' => $vocabulary->name,
'vocabulary-description' => 'Vocab Description',
'vocabulary-description-raw' => $vocabulary->description,
);
$this
->assertTokens('vocabulary', $vocabulary, $tokens);
}