You are here

protected function RuleConditionSetTestCase::createTestComponent in Conditional Rules 7

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

Creates an action set to test a rule condition set.

1 call to RuleConditionSetTestCase::createTestComponent()
RuleConditionSetTestCase::testEvaluate in tests/rules_conditional.test
Tests evaluation.

File

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

Class

RuleConditionSetTestCase
Rule condition set tests.

Code

protected function createTestComponent(RuleConditionSet $conditionSet) {
  return rule(array(
    'test' => array(
      'type' => 'text',
      'label' => 'Text',
    ),
  ))
    ->condition('component_' . $conditionSet->name, array(
    'test:select' => 'test',
  ))
    ->action('rules_conditional_test_throw', array(
    'message' => 'condition set',
  ));
}