You are here

public function RulesConditionalFrameworkTestCase::testEvaluate in Conditional Rules 8

Same name and namespace in other branches
  1. 7 tests/rules_conditional.test \RulesConditionalFrameworkTestCase::testEvaluate()

Tests basic evaluation.

File

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

Class

RulesConditionalFrameworkTestCase
Framework tests.

Code

public function testEvaluate() {

  // Set up stub objects.
  $container = new RulesConditionalTestStubContainer();
  $branch = new RulesConditionalTestStubElement();
  $branch
    ->action('rules_conditional_test_throw', array(
    'message' => 'evaluate',
  ))
    ->setParent($container);
  $defaultBranch = new RulesConditionalTestStubDefaultElement();
  $defaultBranch
    ->action('rules_conditional_test_throw', array(
    'message' => 'evaluate default',
  ))
    ->setParent($container);

  // Evaluate an element.
  $this
    ->assertExecution('evaluate', $container, array(), 'Evaluating container evaluates elements.');
  $branch
    ->setPass(FALSE);
  $this
    ->assertExecution('evaluate default', $container, array(), 'Evaluating container evaluates default elements.');
}