コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     // Create a test condition plugin that always evaluates to TRUE.
     $this->trueCondition = $this->prophesize(RulesConditionInterface::class);
     $this->trueCondition->execute()->willReturn(TRUE);
     $this->trueCondition->evaluate()->willReturn(TRUE);
     $this->conditionManager = $this->prophesize(ConditionManager::class);
     $this->processorManager = $this->prophesize(DataProcessorManager::class);
     $this->conditionExpression = new RulesCondition(['condition_id' => 'test_condition'], '', [], $this->conditionManager->reveal(), $this->processorManager->reveal());
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $this->trueConditionExpression = $this->prophesize(ConditionExpressionInterface::class);
     $this->trueConditionExpression->execute()->willReturn(TRUE);
     $this->trueConditionExpression->executeWithState(Argument::type(RulesStateInterface::class))->willReturn(TRUE);
     $this->falseConditionExpression = $this->prophesize(ConditionExpressionInterface::class);
     $this->falseConditionExpression->execute()->willReturn(FALSE);
     $this->falseConditionExpression->executeWithState(Argument::type(RulesStateInterface::class))->willReturn(FALSE);
     $this->testActionExpression = $this->prophesize(ActionExpressionInterface::class);
     $this->expressionManager = $this->prophesize(ExpressionManagerInterface::class);
 }