protected function ContextConditionContextEntityTextFieldTest::createNodes in Context entity field 7
Create nodes to test context condictions.
1 call to ContextConditionContextEntityTextFieldTest::createNodes()
- ContextConditionContextEntityTextFieldTest::setUp in tests/
context_entity_field.test - Create required data to run tests.
File
- tests/
context_entity_field.test, line 148 - Test context condition.
Class
- ContextConditionContextEntityTextFieldTest
- Test context contition using text 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);
}