You are here

protected function ContextConditionContextEntityTaxonomyFieldTest::createNodes in Context entity field 7

Create nodes to test context condictions.

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

File

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

Class

ContextConditionContextEntityTaxonomyFieldTest
Test context contition using taxonomy field.

Code

protected function createNodes() {
  $settings = array(
    'type' => 'article',
    'title' => 'Article terms: EMPTY',
  );
  $this->nodes['terms_empty'] = $this
    ->drupalCreateNode($settings);
  $settings = array(
    'type' => 'article',
    'title' => 'Article term: oranges',
    'field_tags' => array(
      LANGUAGE_NONE => array(
        array(
          'tid' => $this->terms['oranges']->tid,
        ),
      ),
    ),
  );
  $this->nodes['terms_oranges'] = $this
    ->drupalCreateNode($settings);
  $settings = array(
    'type' => 'article',
    'title' => 'Article term: apples',
    'field_tags' => array(
      LANGUAGE_NONE => array(
        array(
          'tid' => $this->terms['apples']->tid,
        ),
      ),
    ),
  );
  $this->nodes['terms_apples'] = $this
    ->drupalCreateNode($settings);
  $settings = array(
    'type' => 'article',
    'title' => 'Article terms: oranges & apples',
    'field_tags' => array(
      LANGUAGE_NONE => array(
        array(
          'tid' => $this->terms['apples']->tid,
        ),
        array(
          'tid' => $this->terms['oranges']->tid,
        ),
      ),
    ),
  );
  $this->nodes['terms_all'] = $this
    ->drupalCreateNode($settings);
}