public function RulesConditionalSwitchTestCase::doTestEvaluate in Conditional Rules 7
Same name and namespace in other branches
- 8 tests/rules_conditional.test \RulesConditionalSwitchTestCase::doTestEvaluate()
Tests evaluating a conditional.
2 calls to RulesConditionalSwitchTestCase::doTestEvaluate()
- RulesConditionalSwitchTestCase::testEvaluate in tests/
rules_conditional.test - Tests evaluation.
- RulesConditionalSwitchTestCase::testImport in tests/
rules_conditional.test - Tests importing.
File
- tests/
rules_conditional.test, line 456 - SimpleTest testing suites.
Class
- RulesConditionalSwitchTestCase
- Switch tests.
Code
public function doTestEvaluate($comp) {
$node = $this
->drupalCreateNode();
$result = TRUE;
// Test basic "case".
$node->title = 'case 1';
$result = $this
->assertExecution('case', $comp, array(
$node,
)) && $result;
// Test fall-through "case".
$node->title = 'case 2';
$result = $this
->assertExecution('case 3', $comp, array(
$node,
)) && $result;
$result = $this
->assertEqual('fall through', $node->title) && $result;
// Test "default case".
$node->title = 'anything';
$result = $this
->assertExecution('default', $comp, array(
$node,
)) && $result;
return $result;
}