You are here

protected function ContextConditionContextEntityNoFieldTest::createNodes in Context entity field 7

Create nodes to test context condictions.

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

File

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

Class

ContextConditionContextEntityNoFieldTest
Test context contition to entity without field.

Code

protected function createNodes() {
  $settings = array(
    'type' => 'article',
    'title' => 'Article body: EMPTY',
  );
  $this->nodes['body_empty'] = $this
    ->drupalCreateNode($settings);
  $this->nodes['body_empty']->body[LANGUAGE_NONE] = array();
  node_save($this->nodes['body_empty']);
  $settings = array(
    'type' => 'article',
    'title' => 'Article body: EMPTY',
    'body' => array(
      LANGUAGE_NONE => array(
        array(
          'value' => 'test',
        ),
      ),
    ),
  );
  $this->nodes['body_test'] = $this
    ->drupalCreateNode($settings);
  $settings = array(
    'type' => 'article',
    'title' => 'Article body: other',
    'body' => array(
      LANGUAGE_NONE => array(
        array(
          'value' => 'other',
        ),
      ),
    ),
  );
  $this->nodes['body_other'] = $this
    ->drupalCreateNode($settings);
}