You are here

public function PathAliasCreateTest::testActionExecutionWithoutLanguage in Rules 8.3

Tests the action execution when no language is specified.

@covers ::execute

File

tests/src/Unit/Integration/RulesAction/PathAliasCreateTest.php, line 59

Class

PathAliasCreateTest
@coversDefaultClass \Drupal\rules\Plugin\RulesAction\PathAliasCreate @group RulesAction

Namespace

Drupal\Tests\rules\Unit\Integration\RulesAction

Code

public function testActionExecutionWithoutLanguage() {
  $path_alias = $this
    ->prophesizeEntity(PathAliasInterface::class);
  $path_alias
    ->save()
    ->shouldBeCalledTimes(1);
  $this->aliasStorage
    ->create([
    'path' => '/node/1',
    'alias' => '/about',
    'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
  ])
    ->willReturn($path_alias
    ->reveal())
    ->shouldBeCalledTimes(1);
  $this->action
    ->setContextValue('source', '/node/1')
    ->setContextValue('alias', '/about');
  $this->action
    ->execute();
}