You are here

class RulesConditionalTestStubElement in Conditional Rules 8

Same name and namespace in other branches
  1. 7 tests/rules_conditional_test.inc \RulesConditionalTestStubElement

Test element.

Hierarchy

Expanded class hierarchy of RulesConditionalTestStubElement

1 string reference to 'RulesConditionalTestStubElement'
rules_conditional_test_rules_plugin_info in tests/rules_conditional_test.module
Implements hook_rules_plugin_info().

File

tests/rules_conditional_test.inc, line 54
Testing implementations.

View source
class RulesConditionalTestStubElement extends RulesConditionalElement {
  protected $itemName = 'stub conditional element';
  protected $pass;
  public function __construct($pass = TRUE) {
    parent::__construct();
    $this
      ->setPass($pass);
  }

  /**
   * Sets whether the element should pass.
   */
  public function setPass($pass) {
    $this->pass = $pass;
  }

  /**
   * Determines whether this branch can be evaluated.
   */
  public function canEvaluate(RulesState $state) {
    return $this->pass;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RulesConditionalElement::$parent protected property The parent conditional.
RulesConditionalElement::checkSiblings protected function Checks basic conditional element integrity.
RulesConditionalElement::delete public function Deletes the element and its children. 1
RulesConditionalElement::dependencies public function 1
RulesConditionalElement::exportChildren protected function 3
RulesConditionalElement::exportSettings protected function
RulesConditionalElement::getAllSibling public function Gets sibling elements.
RulesConditionalElement::getNextSibling public function Gets the next sibling element.
RulesConditionalElement::getPreviousSibling public function Gets the previous sibling element.
RulesConditionalElement::importChildren protected function 3
RulesConditionalElement::integrityCheck public function 1
RulesConditionalElement::isDefault public function Determines whether this branch is default, i.e. covers the remainder of conditions outside of all non-default branches inside the conditional. 3
RulesConditionalElement::label public function 1
RulesConditionalElement::providesVariables public function 1
RulesConditionalElement::setParent public function @todo Remove once http://drupal.org/node/1671344 is resolved.
RulesConditionalTestStubElement::$itemName protected property
RulesConditionalTestStubElement::$pass protected property
RulesConditionalTestStubElement::canEvaluate public function Determines whether this branch can be evaluated. Overrides RulesConditionalElement::canEvaluate
RulesConditionalTestStubElement::setPass public function Sets whether the element should pass.
RulesConditionalTestStubElement::__construct public function