You are here

protected function RulesTestCase::createTestRule in Rules 8.3

Same name and namespace in other branches
  1. 7.2 tests/rules.test \RulesTestCase::createTestRule()
2 calls to RulesTestCase::createTestRule()
RulesTestCase::testRulesCRUD in d7-tests/rules_test_case.test
Tests CRUD functionality.
RulesTestCase::testSorting in d7-tests/rules_test_case.test
Test sorting rule elements.

File

d7-tests/rules_test_case.test, line 42
Rules 7.x tests.

Class

RulesTestCase

Code

protected function createTestRule() {
  $rule = rule();
  $rule
    ->condition('rules_test_condition_true')
    ->condition('rules_test_condition_true')
    ->condition(rules_or()
    ->condition(rules_condition('rules_test_condition_true')
    ->negate())
    ->condition('rules_test_condition_false')
    ->condition(rules_and()
    ->condition('rules_test_condition_false')
    ->condition('rules_test_condition_true')
    ->negate()));
  $rule
    ->action('rules_test_action');
  return $rule;
}