public function EntityAutocompleteWebTestCase::createVocabulary in Entity Autocomplete 7
Returns a new vocabulary with random properties.
1 call to EntityAutocompleteWebTestCase::createVocabulary()
- EntityAutocompleteWebTestCase::testEntityAutocompleteCallback in tests/
entity_autocomplete.test - Tests autocomplete callback.
File
- tests/
entity_autocomplete.test, line 52 - Tests suite for Entity Autocomplete module.
Class
- EntityAutocompleteWebTestCase
- Performs functional tests on advanced functionalities, such as administrative UI, etc.
Code
public function createVocabulary($settings = array()) {
$settings += array(
'name' => $this
->randomName(),
'description' => $this
->randomName(),
'machine_name' => drupal_strtolower($this
->randomName()),
'help' => '',
'weight' => mt_rand(0, 10),
);
$settings = (object) $settings;
taxonomy_vocabulary_save($settings);
return $settings;
}