You are here

public function NodeUnpublishTest::testActionExecution in Rules 8.3

Tests the action execution.

@covers ::execute

File

tests/src/Unit/Integration/RulesAction/NodeUnpublishTest.php, line 44

Class

NodeUnpublishTest
@coversDefaultClass \Drupal\rules\Plugin\RulesAction\NodeUnpublish @group RulesAction

Namespace

Drupal\Tests\rules\Unit\Integration\RulesAction

Code

public function testActionExecution() {
  $node = $this
    ->prophesizeEntity(NodeInterface::class);
  $node
    ->setUnpublished()
    ->shouldBeCalledTimes(1);
  $this->action
    ->setContextValue('node', $node
    ->reveal());
  $this->action
    ->execute();
  $this
    ->assertEquals([
    'node',
  ], $this->action
    ->autoSaveContext(), 'Action returns the user context name for auto saving.');
}