abstract class RulesConditionalBaseTestCase in Conditional Rules 8
Same name and namespace in other branches
- 7 tests/rules_conditional.test \RulesConditionalBaseTestCase
Base class for conditional rules testing.
Hierarchy
- class \RulesConditionalBaseTestCase extends \DrupalWebTestCase
Expanded class hierarchy of RulesConditionalBaseTestCase
File
- tests/
rules_conditional.test, line 10 - SimpleTest testing suites.
View source
abstract class RulesConditionalBaseTestCase extends DrupalWebTestCase {
/**
* Asserts a test message from the execution of a rule configuration.
*
* @param $error
* @param RulesPlugin $config
* @param array $args
* @param string $message
*/
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);
}
}
/**
* Retrieves a file in the test directory.
*/
protected function getFileContents($fileName) {
$filePath = drupal_get_path('module', 'rules_conditional_test') . '/' . $fileName;
return file_get_contents($filePath);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RulesConditionalBaseTestCase:: |
protected | function | Asserts a test message from the execution of a rule configuration. | |
RulesConditionalBaseTestCase:: |
protected | function | Retrieves a file in the test directory. |