class RulesConditionalTestStubContainer in Conditional Rules 8
Same name and namespace in other branches
- 7 tests/rules_conditional_test.inc \RulesConditionalTestStubContainer
Test base conditional.
@method RulesConditional test() test().
Hierarchy
- class \RulesConditionalContainer extends \RulesContainerPlugin implements \RulesActionInterface
Expanded class hierarchy of RulesConditionalTestStubContainer
1 string reference to 'RulesConditionalTestStubContainer'
- rules_conditional_test_rules_plugin_info in tests/
rules_conditional_test.module - Implements hook_rules_plugin_info().
File
- tests/
rules_conditional_test.inc, line 12 - Testing implementations.
View source
class RulesConditionalTestStubContainer extends RulesConditionalContainer {
protected $itemName = 'stub conditional';
protected $interceptMethods = array(
'test',
);
/**
* Selects the branches to evaluate for this conditional.
*
* @param RulesState $state
* Rules state to use.
* @return RulesConditionalElement[]
* An array of branches to evaluate.
*/
protected function selectBranches(RulesState $state) {
// Pick the first element to pass.
foreach ($this->children as $element) {
if ($element
->canEvaluate($state)) {
return array(
$element,
);
}
}
return array();
}
/**
* Intercepts the 'test' method.
*/
protected function call_test() {
throw new Exception('intercept');
}
/**
* Sets a fluent element.
*/
public function fluent(RulesActionContainer $element) {
$this->fluentElement = $element;
return $this;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RulesConditionalContainer:: |
protected | property | ||
RulesConditionalContainer:: |
protected | property | ||
RulesConditionalContainer:: |
public | function | Adds an action to the active fluent statement. | |
RulesConditionalContainer:: |
public | function | Deletes the container and its children. | |
RulesConditionalContainer:: |
public | function | ||
RulesConditionalContainer:: |
public | function | ||
RulesConditionalContainer:: |
public | function | Evaluates the conditional statement. | |
RulesConditionalContainer:: |
protected | function | ||
RulesConditionalContainer:: |
public | function | ||
RulesConditionalContainer:: |
public | function | Provides intersections of variables in all branches, at least one default. | |
RulesConditionalContainer:: |
public | function | ||
RulesConditionalContainer:: |
protected | function | Declares only parent state variables for individual branches. | |
RulesConditionalContainer:: |
protected | function | Asserts no variables (since a conditional is *conditionally* evaluated). | |
RulesConditionalContainer:: |
public | function | Intercepts calls to magic methods, possibly using reserved keywords. | |
RulesConditionalTestStubContainer:: |
protected | property |
Magic methods to intercept. Overrides RulesConditionalContainer:: |
|
RulesConditionalTestStubContainer:: |
protected | property | ||
RulesConditionalTestStubContainer:: |
protected | function | Intercepts the 'test' method. | |
RulesConditionalTestStubContainer:: |
public | function | Sets a fluent element. | |
RulesConditionalTestStubContainer:: |
protected | function |
Selects the branches to evaluate for this conditional. Overrides RulesConditionalContainer:: |