You are here

public function SystemMessageTest::testOptionalRepeat in Rules 8.3

Tests that the action works if the optional repeat flag is not set.

@covers ::execute

File

tests/src/Unit/Integration/RulesAction/SystemMessageTest.php, line 77

Class

SystemMessageTest
@coversDefaultClass \Drupal\rules\Plugin\RulesAction\SystemMessage @group RulesAction

Namespace

Drupal\Tests\rules\Unit\Integration\RulesAction

Code

public function testOptionalRepeat() {
  $this->action
    ->setContextValue('message', 'test message')
    ->setContextValue('type', MessengerInterface::TYPE_STATUS);
  $this->action
    ->execute();
  $messages = $this
    ->getMessages(MessengerInterface::TYPE_STATUS);
  $this
    ->assertNotNull($messages);
  $this
    ->assertEquals([
    'test message',
  ], $messages);
}