function ActionSetExpressionTest::testTwoActionExecution

Tests that two actions in the set fire both.

File

tests/src/Unit/ActionSetExpressionTest.php, line 48

Class

ActionSetExpressionTest
@coversDefaultClass \Drupal\rules\Plugin\RulesExpression\ActionSetExpression @group Rules

Namespace

Drupal\Tests\rules\Unit

Code

public function testTwoActionExecution() {
    // The execute method on the test action must be called once.
    $this->testActionExpression
        ->executeWithState(Argument::type(ExecutionStateInterface::class))
        ->shouldBeCalledTimes(1);
    // The execute method on the second action must be called once.
    $second_action = $this->prophesize(ActionExpressionInterface::class);
    $second_action->executeWithState(Argument::type(ExecutionStateInterface::class))
        ->shouldBeCalledTimes(1);
    $second_action->getUuid()
        ->willReturn('uuid2');
    $second_action->getWeight()
        ->willReturn(0);
    $this->actionSet
        ->addExpressionObject($this->testActionExpression
        ->reveal())
        ->addExpressionObject($second_action->reveal())
        ->execute();
}