You are here

function i18nTaxonomyTestCase::createVocabulary in Internationalization 7

Returns a new vocabulary with random properties.

2 calls to i18nTaxonomyTestCase::createVocabulary()
i18nTaxonomyTestCase::testTaxonomyTermLocalize in i18n_taxonomy/i18n_taxonomy.test
i18nTaxonomyTestCase::testTaxonomyTermTranslate in i18n_taxonomy/i18n_taxonomy.test

File

i18n_taxonomy/i18n_taxonomy.test, line 183
Test case for multilingual taxonomy

Class

i18nTaxonomyTestCase
@file Test case for multilingual taxonomy

Code

function createVocabulary($data = array()) {

  // Create a vocabulary.
  $data += array(
    'i18n_mode' => I18N_MODE_LOCALIZE,
    'name' => $this
      ->randomName(),
    'description' => $this
      ->randomName(),
    'machine_name' => drupal_strtolower($this
      ->randomName()),
    'help' => '',
    'nodes' => array(
      'article' => 'article',
    ),
    'weight' => mt_rand(0, 10),
  );
  $vocabulary = (object) $data;
  taxonomy_vocabulary_save($vocabulary);
  return $vocabulary;
}