function RulesTestCase::testAbortOnNULLValues in Rules 8.3
Same name and namespace in other branches
- 7.2 tests/rules.test \RulesTestCase::testAbortOnNULLValues()
Make sure Rules aborts when NULL values are used.
File
- d7-tests/
rules_test_case.test, line 898 - Rules 7.x tests.
Class
Code
function testAbortOnNULLValues() {
$rule = rule(array(
'node' => array(
'type' => 'node',
),
));
$rule
->action('drupal_message', array(
'message:select' => 'node:log',
));
$rule
->integrityCheck();
// Test the rule.
$node = $this
->drupalCreateNode();
$node->log = NULL;
$rule
->execute($node);
$text = RulesLog::logger()
->render();
$msg = RulesTestCase::t('The variable or parameter %message is empty.', array(
'message',
));
$this
->assertTrue(strpos($text, $msg) !== FALSE, 'Evaluation aborted due to an empty argument value.');
}