public function RulesTestCase::testNamedParameters in Rules 7.2
Same name and namespace in other branches
- 8.3 d7-tests/rules_test_case.test \RulesTestCase::testNamedParameters()
Tests the named parameter mode.
File
- tests/
rules.test, line 923 - Rules tests.
Class
- RulesTestCase
- Rules test cases.
Code
public function testNamedParameters() {
$rule = rule(array(
'node' => array(
'type' => 'node',
),
));
$rule
->action('rules_action_node_set_title', array(
'title' => 'foo',
));
$rule
->integrityCheck();
// Test the rule.
$node = $this
->drupalCreateNode(array(
'type' => 'page',
'sticky' => 0,
));
$rule
->execute($node);
$this
->assertTrue($node->title == 'foo', 'Action with named parameters has been correctly executed.');
RulesLog::logger()
->checkLog();
}