You are here

protected function DeployWebTestCase::createTerm in Deploy - Content Staging 7.3

Same name and namespace in other branches
  1. 7.2 deploy.test \DeployWebTestCase::createTerm()

Code taken from TaxonomyWebTestCase::createTerm() since we can't extend that test case. Some simplifications are made though.

@todo This will probably not work when the Testing profile is used. Then we need to create the vocabulary manually.

See also

TaxonomyWebTestCase::createTerm()

1 call to DeployWebTestCase::createTerm()
DeployWebTestCase::runScenario in ./deploy.test
This method runs a deployment scenario where we have one production site (the endpoint) and a staging site (the origin).

File

./deploy.test, line 234
Deployment tests.

Class

DeployWebTestCase
Helper class.

Code

protected function createTerm() {
  $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();

  // For our test cases it's enough to rely on the standard 'tags' vocabulary.
  $term->vid = 1;
  taxonomy_term_save($term);
  return $term;
}