You are here

public function SystemPageRedirectTest::testRedirect in Rules 8.3

Tests redirection.

@covers ::execute

File

tests/src/Unit/Integration/RulesAction/SystemPageRedirectTest.php, line 99

Class

SystemPageRedirectTest
@coversDefaultClass \Drupal\rules\Plugin\RulesAction\SystemPageRedirect @group RulesAction

Namespace

Drupal\Tests\rules\Unit\Integration\RulesAction

Code

public function testRedirect() {
  $this->currentPathStack
    ->getPath()
    ->willReturn('some/random/test/path');
  $this->action
    ->setContextValue('url', '/test/url');
  $this->action
    ->execute();
  $this->parameterBag
    ->set('_rules_redirect_action_url', '/test/url')
    ->shouldHaveBeenCalled();
}