function BlogapiTestCase::createVocabulary in Blog API 7.2
Returns a new vocabulary with random properties.
4 calls to BlogapiTestCase::createVocabulary()
- BlogapiMetaweblogEndpointTestCase::testGetCategories in modules/
blogapi_metaweblog/ blogapi_metaweblog.test - Test metaWeblog.getCategories().
- BlogapiMovabletypeEndpointTestCase::testGetCategoryList in modules/
blogapi_movabletype/ blogapi_movabletype.test - Test mt.getCategoryList().
- BlogapiMovabletypeEndpointTestCase::testGetPostCategories in modules/
blogapi_movabletype/ blogapi_movabletype.test - Test mt.getPostCategories().
- BlogapiMovabletypeEndpointTestCase::testSetPostCategories in modules/
blogapi_movabletype/ blogapi_movabletype.test - Test mt.setPostCategories().
File
- ./
blogapi.test, line 144 - Test for general BlogAPI functionality
Class
- BlogapiTestCase
- @file Test for general BlogAPI functionality
Code
function createVocabulary() {
// Create a vocabulary.
$vocabulary = new stdClass();
$vocabulary->name = $this
->randomName();
$vocabulary->description = $this
->randomName();
$vocabulary->machine_name = drupal_strtolower($this
->randomName());
$vocabulary->help = '';
$vocabulary->nodes = array(
'article' => 'article',
);
$vocabulary->weight = mt_rand(0, 10);
taxonomy_vocabulary_save($vocabulary);
return $vocabulary;
}