You are here

public function ScheduledTransitionsTokenTest::testReplacementWithRunner in Scheduled Transitions 2.x

Tests tokens are replaced when a transition is run.

Integration test with the runner.

@covers ::transitionEntity @covers ::tokenReplace @covers \Drupal\scheduled_transitions\ScheduledTransitionsTokenReplacements

@dataProvider providerTokenReplacement

Parameters

string $token: The token.

string $expectedReplacement: What token should be replaced with.

File

tests/src/Kernel/ScheduledTransitionsTokenTest.php, line 128

Class

ScheduledTransitionsTokenTest
Tests tokens provided by Scheduled Transitions.

Namespace

Drupal\Tests\scheduled_transitions\Kernel

Code

public function testReplacementWithRunner(string $token, string $expectedReplacement) : void {
  \Drupal::configFactory()
    ->getEditable('scheduled_transitions.settings')
    ->set('message_transition_historical', $token)
    ->save(TRUE);
  $this
    ->runTransition($this->scheduledTransition);
  $entity = $this->testEntity::load($this->testEntity
    ->id());
  $this
    ->assertEquals($expectedReplacement, $entity
    ->getRevisionLogMessage());
}