You are here

public function RulesConditionalTestCase::doTestEvaluate in Conditional Rules 7

Same name and namespace in other branches
  1. 8 tests/rules_conditional.test \RulesConditionalTestCase::doTestEvaluate()

Tests evaluating a conditional.

2 calls to RulesConditionalTestCase::doTestEvaluate()
RulesConditionalTestCase::testEvaluate in tests/rules_conditional.test
Tests evaluation.
RulesConditionalTestCase::testImport in tests/rules_conditional.test
Tests importing.

File

tests/rules_conditional.test, line 368
SimpleTest testing suites.

Class

RulesConditionalTestCase
Default if-else tests.

Code

public function doTestEvaluate($comp) {
  $node = $this
    ->drupalCreateNode();
  $result = TRUE;

  // Test "if".
  $node->title = 'if';
  $result = $this
    ->assertExecution('if', $comp, array(
    $node,
  )) && $result;

  // Test "else if".
  $node->title = 'else if';
  $result = $this
    ->assertExecution('else if', $comp, array(
    $node,
  )) && $result;

  // Test "else".
  $node->title = 'else';
  $result = $this
    ->assertExecution('else', $comp, array(
    $node,
  )) && $result;
  return $result;
}