You are here

protected function RedirectImportExportTest::createDuplicateRedirect in Acquia Content Hub 8.2

Creates a duplicate redirect based on fixture data.

Parameters

string $uuid: UUID for the duplicate.

string $source: Source for the duplicate.

string $path: Path for the duplicate.

string $language: Langcode for the duplicate.

Throws

\Drupal\Core\Entity\EntityStorageException

1 call to RedirectImportExportTest::createDuplicateRedirect()
RedirectImportExportTest::testDuplicateRedirectImport in tests/src/Kernel/RedirectImportExportTest.php
Tests import of a redirect that already has a local match.

File

tests/src/Kernel/RedirectImportExportTest.php, line 213

Class

RedirectImportExportTest
Tests redirect export and import.

Namespace

Drupal\Tests\acquia_contenthub\Kernel

Code

protected function createDuplicateRedirect(string $uuid, string $source, string $path, string $language) {
  $redirect = Redirect::create([
    'uuid' => $uuid,
  ]);
  $redirect
    ->setSource($source);
  $redirect
    ->setRedirect($path);
  $redirect
    ->setLanguage($language);
  $redirect
    ->save();
}