You are here

protected function RuleExpressionTest::setUp in Rules 8.3

Overrides RulesUnitTestBase::setUp

File

tests/src/Unit/RuleExpressionTest.php, line 52

Class

RuleExpressionTest
@coversDefaultClass \Drupal\rules\Plugin\RulesExpression\RuleExpression @group Rules

Namespace

Drupal\Tests\rules\Unit

Code

protected function setUp() : void {
  parent::setUp();
  $this->expressionManager = $this
    ->prophesize(ExpressionManagerInterface::class);
  $this->conditions = new AndExpression([], 'rules_and', [
    'label' => 'Condition set (AND)',
  ], $this->expressionManager
    ->reveal(), $this->rulesDebugLogger
    ->reveal());
  $this->expressionManager
    ->createInstance('rules_and', [])
    ->willReturn($this->conditions);
  $this->actions = new ActionSetExpression([], 'rules_action_set', [], $this->expressionManager
    ->reveal(), $this->rulesDebugLogger
    ->reveal());
  $this->expressionManager
    ->createInstance('rules_action_set', [])
    ->willReturn($this->actions);
  $this->rule = new RuleExpression([], 'rules_rule', [
    'label' => 'Rule',
  ], $this->expressionManager
    ->reveal(), $this->rulesDebugLogger
    ->reveal());
}