function RulesTestCase::createTestRule
Same name in other branches
- 8.x-3.x d7-tests/rules_test_case.test \RulesTestCase::createTestRule()
Helper function to create a test Rule.
3 calls to RulesTestCase::createTestRule()
- RulesTestCase::testRuleCreation in tests/
rules.test - Tests creating a rule and iterating over the rule elements.
- RulesTestCase::testRulesCrud in tests/
rules.test - Tests CRUD functionality.
- RulesTestCase::testSorting in tests/
rules.test - Tests sorting rule elements.
File
-
tests/
rules.test, line 49
Class
- RulesTestCase
- Rules test cases.
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;
}