function i18nTaxonomyTestCase::createTerm in Internationalization 7
Returns a new term with random properties in vocabulary $vid.
3 calls to i18nTaxonomyTestCase::createTerm()
- i18nTaxonomyTestCase::drupalCreateTerms in i18n_taxonomy/
i18n_taxonomy.test - i18nTaxonomyTestCase::testTaxonomyTermLocalize in i18n_taxonomy/
i18n_taxonomy.test - i18nTaxonomyTestCase::testTaxonomyTermTranslate in i18n_taxonomy/
i18n_taxonomy.test
File
- i18n_taxonomy/
i18n_taxonomy.test, line 202 - Test case for multilingual taxonomy
Class
- i18nTaxonomyTestCase
- @file Test case for multilingual taxonomy
Code
function createTerm($data = array()) {
$data += array(
'name' => $this
->randomName(),
'description' => $this
->randomName(),
// Use the first available text format and vocabulary.
'format' => filter_default_format(),
'vid' => 1,
);
$term = (object) $data;
taxonomy_term_save($term);
return $term;
}