protected function TermstatusWebTestCase::createVocabulary in Taxonomy Term Status 7
Returns a new vocabulary with random properties.
1 call to TermstatusWebTestCase::createVocabulary()
- TermstatusSafeguardTestCase::testFirstUseSafeguard in ./
termstatus.test - Tests the first-use-safeguard mechanism.
File
- ./
termstatus.test, line 17 - Tests for termstatus.module
Class
- TermstatusWebTestCase
- Provides common helper methods for Taxonomy Term Status tests.
Code
protected 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;
}