function EntitySaveTest::testActionExecutionPostponed

Tests the action execution when saving is postponed.

@covers ::execute

File

tests/src/Unit/Integration/RulesAction/EntitySaveTest.php, line 68

Class

EntitySaveTest
@coversDefaultClass \Drupal\rules\Plugin\RulesAction\EntitySave @group RulesAction

Namespace

Drupal\Tests\rules\Unit\Integration\RulesAction

Code

public function testActionExecutionPostponed() {
    $this->entity
        ->save()
        ->shouldNotBeCalled();
    $this->action
        ->setContextValue('entity', $this->entity
        ->reveal());
    $this->action
        ->execute();
    $this->assertEquals($this->action
        ->autoSaveContext(), [
        'entity',
    ], 'Action returns the entity context name for auto saving.');
}