function ServicesResourceTaxonomyTests::createVocabulary in Services 6.3
Same name and namespace in other branches
- 7.3 tests/functional/ServicesResourceTaxonomyTests.test \ServicesResourceTaxonomyTests::createVocabulary()
Helper. Create taxonomy vocabulary.
11 calls to ServicesResourceTaxonomyTests::createVocabulary()
- ServicesResourceTaxonomyTests::testTermCreate in tests/
functional/ ServicesResourceTaxonomyTests.test - Test taxonomy term create method.
- ServicesResourceTaxonomyTests::testTermCreateLegacy in tests/
functional/ ServicesResourceTaxonomyTests.test - Test taxonomy term create method (Legacy).
- ServicesResourceTaxonomyTests::testTermDelete in tests/
functional/ ServicesResourceTaxonomyTests.test - Test taxonomy term delete method.
- ServicesResourceTaxonomyTests::testTermRetrieve in tests/
functional/ ServicesResourceTaxonomyTests.test - Test taxonomy term retrieve method.
- ServicesResourceTaxonomyTests::testTermUpdate in tests/
functional/ ServicesResourceTaxonomyTests.test - Test taxonomy term update method.
File
- tests/
functional/ ServicesResourceTaxonomyTests.test, line 472
Class
- ServicesResourceTaxonomyTests
- Run test cases for the endpoint with no authentication turned on.
Code
function createVocabulary() {
$vocabulary = array(
'name' => $this
->randomName(),
'description' => $this
->randomString(),
'help' => $this
->randomString(),
'relations' => 1,
'hierarchy' => 1,
'multiple' => 1,
'required' => 0,
'module' => 'services',
'weight' => 0,
);
taxonomy_save_vocabulary($vocabulary);
$vid = db_result(db_query('SELECT vid FROM {vocabulary} WHERE name = "%s"', $vocabulary['name']));
return (array) taxonomy_vocabulary_load($vid, TRUE);
}