You are here

protected function EntityWebTestCase::createVocabulary in Entity API 7

Creates a new vocabulary.

3 calls to EntityWebTestCase::createVocabulary()
EntityMetadataIntegrationTestCase::createValue in ./entity.test
Creates a value for the given property.
EntityMetadataIntegrationTestCase::testTaxonomyProperties in ./entity.test
Tests properties provided by the taxonomy module.
EntityMetadataTaxonomyAccessTestCase::testTaxonomyMetadataAccess in ./entity.test
Runs basic tests for entity_access() function.

File

./entity.test, line 16
Entity CRUD API tests.

Class

EntityWebTestCase
Common parent class containing common helpers.

Code

protected function createVocabulary() {
  $vocab = entity_create('taxonomy_vocabulary', array(
    'name' => $this
      ->randomName(),
    'machine_name' => drupal_strtolower($this
      ->randomName()),
    'description' => $this
      ->randomName(),
  ));
  entity_save('taxonomy_vocabulary', $vocab);
  return $vocab;
}