protected function RulesUiTestCase::getTestRuleExport in Rules 7.2
Helper function to return a known JSON encoded rule export.
Parameters
string $machine_name: The machine name of the returned rule.
1 call to RulesUiTestCase::getTestRuleExport()
- RulesUiTestCase::testOverrideStatus in rules_admin/
tests/ rules_admin.test - Tests overriding and reverting configurations.
File
- rules_admin/
tests/ rules_admin.test, line 358 - Rules UI tests.
Class
- RulesUiTestCase
- Tests for creating rules through the UI.
Code
protected function getTestRuleExport($machine_name) {
return '{ "' . $machine_name . '" : {
"LABEL" : "example imported default rule",
"PLUGIN" : "reaction rule",
"ACTIVE" : false,
"OWNER" : "rules",
"TAGS" : [ "Admin", "Tag2" ],
"REQUIRES" : [ "rules" ],
"ON" : { "node_update" : [] },
"IF" : [
{ "NOT data_is" : { "data" : [ "node:status" ], "value" : true } },
{ "data_is" : { "data" : [ "node:type" ], "value" : "page" } }
],
"DO" : [ { "drupal_message" : { "message" : "A node has been updated." } } ]
}
}';
}