You are here

protected function MigrateMediaTestBase::setEmbedMediaReferenceMethod in Media Migration 8

Sets the method of the embed media reference.

Parameters

string|null $new_reference_method: The reference method to set. This can be 'id', or 'uuid'.

3 calls to MigrateMediaTestBase::setEmbedMediaReferenceMethod()
MigrateEmbedMediaTokenToEntityEmbedTest::testMediaTokenToEntityEmbedTransform in tests/src/Functional/MigrateEmbedMediaTokenToEntityEmbedTest.php
Tests the result of Media Migration's embed media token transform.
MigrateEmbedMediaTokenToMediaEmbedTest::testMediaTokenToMediaEmbedTransform in tests/src/Functional/MigrateEmbedMediaTokenToMediaEmbedTest.php
Tests the result of Media Migration's embed media token transform.
MigrateMediaTestBase::setUp in tests/src/Functional/MigrateMediaTestBase.php

File

tests/src/Functional/MigrateMediaTestBase.php, line 616

Class

MigrateMediaTestBase
Provides a base class for testing media migration via the UI.

Namespace

Drupal\Tests\media_migration\Functional

Code

protected function setEmbedMediaReferenceMethod($new_reference_method) {
  $current_method = Settings::get(MediaMigration::MEDIA_REFERENCE_METHOD_SETTINGS);
  if ($current_method !== $new_reference_method) {
    $settings['settings'][MediaMigration::MEDIA_REFERENCE_METHOD_SETTINGS] = (object) [
      'value' => $new_reference_method,
      'required' => TRUE,
    ];
    $this
      ->writeSettings($settings);
  }
}