function TaxonomyWebTestCase::createTerm

Returns a new term with random properties in vocabulary $vid.

40 calls to TaxonomyWebTestCase::createTerm()
RdfMappingDefinitionTestCase::testTaxonomyTermRdfaAttributes in drupal-7.x/modules/rdf/rdf.test
Creates a random term and ensures the right RDFa markup is used.
RdfMappingDefinitionTestCase::testTaxonomyTermRdfaAttributes in drupal-7.x/modules/rdf/rdf.test
Creates a random term and ensures the right RDFa markup is used.
TaxonomyEFQTestCase::testTaxonomyEFQ in drupal-7.x/modules/taxonomy/taxonomy.test
Tests that a basic taxonomy EntityFieldQuery works.
TaxonomyEFQTestCase::testTaxonomyEFQ in drupal-7.x/modules/taxonomy/taxonomy.test
Tests that a basic taxonomy EntityFieldQuery works.
TaxonomyLoadMultipleTestCase::testTaxonomyTermMultipleLoad in drupal-7.x/modules/taxonomy/taxonomy.test
Create a vocabulary and some taxonomy terms, ensuring they're loaded correctly using taxonomy_term_load_multiple().

... See full list

Archivo

drupal-7.x/modules/taxonomy/taxonomy.test, line 32
Tests for taxonomy.module.

Class

TaxonomyWebTestCase
Provides common helper methods for Taxonomy module tests.

Código

function createTerm($vocabulary) {
  $term = new stdClass();
  $term->name = $this->randomName();
  $term->description = $this->randomName();
  // Use the first available text format.
  $term->format = db_query_range('SELECT format FROM {filter_format}', 0, 1)->fetchField();
  $term->vid = $vocabulary->vid;
  taxonomy_term_save($term);
  return $term;
}