You are here

protected function ContextConditionContextEntityTaxonomyFieldTest::createTerms in Context entity field 7

Create terms to test context condictions.

1 call to ContextConditionContextEntityTaxonomyFieldTest::createTerms()
ContextConditionContextEntityTaxonomyFieldTest::setUp in tests/context_entity_field.test
Create required data to run tests.

File

tests/context_entity_field.test, line 282
Test context condition.

Class

ContextConditionContextEntityTaxonomyFieldTest
Test context contition using taxonomy field.

Code

protected function createTerms() {
  $this->vocab = taxonomy_vocabulary_machine_name_load('tags');
  $this->terms = array();
  $this->terms['apples'] = (object) array(
    'name' => 'apples',
    'vid' => $this->vocab->vid,
  );
  $this->terms['oranges'] = (object) array(
    'name' => 'oranges',
    'vid' => $this->vocab->vid,
  );
  taxonomy_term_save($this->terms['apples']);
  taxonomy_term_save($this->terms['oranges']);
}