function NatWebTestCase::_get_vocabulary_by_name in Node Auto Term [NAT] 6
Same name and namespace in other branches
- 6.2 tests/nat.test \NatWebTestCase::_get_vocabulary_by_name()
- 7 tests/nat.test \NatWebTestCase::_get_vocabulary_by_name()
This function will return a vocabulary object which matches the given name. Will return null if no such vocabulary exists.
Parameters
$vocabulary_name: This is the name of the section which is required
Return value
This is the vocabulary object with the name or null if no such vocabulary exists
1 call to NatWebTestCase::_get_vocabulary_by_name()
- NatWebTestCase::_create_vocabs in tests/
nat.test - Create two vocabularies for testing.
File
- tests/
nat.test, line 70 - NAT module functionality tests.
Class
- NatWebTestCase
- Base class for all NAT webtest cases.
Code
function _get_vocabulary_by_name($vocabulary_name) {
$vocabs = taxonomy_get_vocabularies(NULL);
foreach ($vocabs as $vocab_object) {
if ($vocab_object->name == $vocabulary_name) {
return $vocab_object;
}
}
return NULL;
}