function MonitoringCoreTest::createVocabulary in Monitoring 7
Returns a new vocabulary with random properties.
Return value
object Vocabulary object.
1 call to MonitoringCoreTest::createVocabulary()
- MonitoringCoreTest::testGenericDBAggregate in test/
tests/ monitoring.core.test - Tests the watchdog entries aggregator.
File
- test/
tests/ monitoring.core.test, line 799 - Contains \MonitoringCoreTest.
Class
- MonitoringCoreTest
- Tests for cron sensor.
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->weight = mt_rand(0, 10);
taxonomy_vocabulary_save($vocabulary);
return $vocabulary;
}