You are here

protected function RuleConditionSetTestCase::createConditionSet in Conditional Rules 7

Same name and namespace in other branches
  1. 8 tests/rules_conditional.test \RuleConditionSetTestCase::createConditionSet()

Creates a rule condition set.

2 calls to RuleConditionSetTestCase::createConditionSet()
RuleConditionSetTestCase::testEvaluate in tests/rules_conditional.test
Tests evaluation.
RuleConditionSetTestCase::testExport in tests/rules_conditional.test
Tests exporting.

File

tests/rules_conditional.test, line 620
SimpleTest testing suites.

Class

RuleConditionSetTestCase
Rule condition set tests.

Code

protected function createConditionSet() {
  $conditionVariables = array(
    'test' => array(
      'type' => 'text',
      'label' => 'Test',
    ),
  );
  $set = rule_condition_set($conditionVariables)
    ->action('variable_add', array(
    'type' => 'text',
    'variable_added:var' => 'test2',
    'variable_added:label' => 'Test 2',
  ))
    ->action('data_set', array(
    'data:select' => 'test2',
    'value:select' => 'test',
  ))
    ->condition('data_is', array(
    'data:select' => 'test2',
    'value' => 'condition set',
  ));
  $set->component = TRUE;
  return $set;
}