You are here

protected function RulesConditionalBaseTestCase::assertExecution in Conditional Rules 7

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

Asserts a test message from the execution of a rule configuration.

Parameters

$error:

RulesPlugin $config:

array $args:

string $message:

6 calls to RulesConditionalBaseTestCase::assertExecution()
RuleConditionSetTestCase::testEvaluate in tests/rules_conditional.test
Tests evaluation.
RulesConditionalFrameworkTestCase::testEvaluate in tests/rules_conditional.test
Tests basic evaluation.
RulesConditionalFrameworkTestCase::testPredicateElement in tests/rules_conditional.test
Tests the base predicate element.
RulesConditionalSwitchTestCase::doTestEvaluate in tests/rules_conditional.test
Tests evaluating a conditional.
RulesConditionalTestCase::doTestEvaluate in tests/rules_conditional.test
Tests evaluating a conditional.

... See full list

File

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

Class

RulesConditionalBaseTestCase
Base class for conditional rules testing.

Code

protected function assertExecution($error, $config, array $args = array(), $message = '') {
  if (empty($message)) {
    $message = t('Message "@error" captured by executing rule configuration.', array(
      '@error' => $error,
    ));
  }
  try {
    $config
      ->executeByArgs($args);
    return $this
      ->fail($message);
  } catch (RulesConditionalTestException $ex) {
    return $this
      ->assertEqual($error, $ex
      ->getMessage(), $message);
  }
}