You are here

function i18n_Taxonomy_Test::drupalCreateTerms in Internationalization 6

1 call to i18n_Taxonomy_Test::drupalCreateTerms()
i18n_Taxonomy_Test::testTaxonomyTranslationAPI in tests/i18n_taxonomy.test

File

tests/i18n_taxonomy.test, line 49

Class

i18n_Taxonomy_Test

Code

function drupalCreateTerms($number = 1, $data = array()) {
  $list = array();
  for ($i = 1; $i <= $number; $i++) {
    $term = $data + array(
      'name' => $this
        ->randomName(10),
      'description' => $this
        ->randomName(20),
    );
    taxonomy_save_term($term);
    $list[] = (object) $term;
  }
  return $list;
}