You are here

public function EntityDeleteTest::testActionExecution in Rules 8.3

Tests the action execution.

@covers ::execute

File

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

Class

EntityDeleteTest
@coversDefaultClass \Drupal\rules\Plugin\RulesAction\EntityDelete @group RulesAction

Namespace

Drupal\Tests\rules\Unit\Integration\RulesAction

Code

public function testActionExecution() {
  $entity = $this
    ->prophesizeEntity(EntityInterface::class);
  $entity
    ->delete()
    ->shouldBeCalledTimes(1);
  $this->action
    ->setContextValue('entity', $entity
    ->reveal());
  $this->action
    ->execute();
}