2 // $Id: rules_test.rules_defaults.inc,v 1.1.2.14 2009/04/19 15:03:43 fago Exp $
6 * @file Rules default rules - this rules are used by the tests
10 * Implementation of hook_rules_defaults.
12 function rules_test_rules_defaults() {
16 $rules['rules_test_1'] = array(
18 '#name' => 'rules_test_1',
19 '#label' => t('Test altering arguments by reference'),
20 '#set' => 'rules_test_1',
24 $condition1 = rules_use_condition('rules_test_condition_alter_arg', array(
25 '#settings' => array('#argument map' => array('rules_test' => 'rules_test')),
28 $condition2 = rules_use_condition('rules_test_condition_check_for_altered_arg', array(
29 '#settings' => array('#argument map' => array('rules_test' => 'rules_test')),
31 $action = rules_use_action('rules_test_action_log_msg', array(
33 'msg' => 'Rules Test 1 - Success!',
36 $rules['rules_test_1'] += array(
37 '#conditions' => array($condition1, $condition2, $condition2),
38 '#actions' => array($action),
41 $rules['rules_test_2_1'] = array(
43 '#name' => 'rules_test_2_1',
44 '#label' => t('Test changing arguments per action'),
45 '#set' => 'rules_test_2',
50 $action = rules_use_action('rules_test_change_arg', array(
51 // leave out this argument map, as it should take this as default value!
52 // '#settings' => array('#argument map' => array('rules_test' => 'rules_test')),
54 $rules['rules_test_2_1'] += array(
55 '#conditions' => array(),
56 '#actions' => array($action),
59 $rules['rules_test_2_2'] = array(
61 '#name' => 'rules_test_2_2',
62 '#label' => t('Test changing arguments per action - check'),
63 '#set' => 'rules_test_2',
67 $condition = rules_use_condition('rules_test_condition_check_for_altered_arg', array(
68 '#settings' => array('#argument map' => array('rules_test' => 'rules_test')),
70 $action = rules_use_action('rules_test_action_log_msg', array(
72 'msg' => 'Rules Test 2 - Success!',
75 $rules['rules_test_2_2'] += array(
76 '#conditions' => array($condition),
77 '#actions' => array($action),
81 $rules['rules_test_4_1'] = array(
83 '#name' => 'rules_test_4_1',
84 '#label' => t('Test changing arguments per action'),
85 '#set' => 'rules_test_4',
89 $condition = rules_use_condition('rules_test_condition_check_for_altered_arg', array(
90 '#settings' => array('#argument map' => array('rules_test_2' => 'rules_test')),
92 $action = rules_use_action('rules_test_action_log_msg', array(
94 'msg' => 'Rules Test 4 - Success!',
97 $rules['rules_test_4_1'] += array(
98 '#conditions' => array($condition),
99 '#actions' => array($action),
103 $rules['rules_test_5_1'] = array(
105 '#name' => 'rules_test_5_1',
106 '#label' => t('Test adding a new variable'),
107 '#set' => 'rules_test_5',
109 '#status' => 'fixed',
111 $action = rules_use_action('rules_test_add_var', array(
112 '#settings' => array('#argument map' => array('rules_test_var' => 'rules_test')),
114 'label' => 'Adds a new variable',
115 'new variables' => array('rules_test_var' => array('type' => 'rules_test', 'label' => 'test')),
118 $rules['rules_test_5_1'] += array(
119 '#conditions' => array(),
120 '#actions' => array($action),
125 'rule_sets' => array(
126 'rules_test_1' => array(
127 'label' => 'Rule Testing 1',
128 'arguments' => array('rules_test' => array('type' => 'rules_test', 'label' => 'node')),
131 'rules_test_2' => array(
132 'label' => 'Rule Testing 2',
133 'arguments' => array('rules_test' => array('type' => 'rules_test', 'label' => 'node')),
136 'rules_test_4' => array(
137 'label' => 'Rule Testing 4',
138 'arguments' => array(
139 'rules_test_1' => array('type' => 'rules_test', 'label' => 'node'),
140 'rules_test_2' => array('type' => 'rules_test', 'label' => 'node', 'handler' => 'rules_test_4_load_data'),
144 'rules_test_5' => array(
145 'label' => 'Rule Testing 5',
146 'arguments' => array(),