You are here

protected function RangeBaseWebTestCase::createTestNode in Range 7

Creates a test node and sets values for a given range field type.

Parameters

array $values: Array with values for a single range item. Required keys are:

  • from: FROM value
  • to: TO value

string $field_type: Range field type. Possible values:

  • range_decimal
  • range_float
  • range_integer

Return value

stdClass Node object.

1 call to RangeBaseWebTestCase::createTestNode()
RangeInternationalizationWebTestCase::testRangeFieldFormatterRespectsInterfaceLanguage in tests/range.i18n.test
Verifies that range module field formatters respect interface language.

File

tests/range.base.test, line 210
Contains range base test classes.

Class

RangeBaseWebTestCase
Base class for the range module's tests.

Code

protected function createTestNode(array $values, $field_type = 'range_integer') {
  $node = new stdClass();
  $node->type = $this->contentType;
  $node->uid = $this->loggedInUser->uid;
  $field_name = $this
    ->getTestFieldName($field_type);
  $node->{$field_name}[LANGUAGE_NONE][0] = $values;
  node_save($node);
  return $node;
}