function LanguageTypesTest::testTransformConfigurable

Tests successful transformation of configurable language types.

File

core/modules/language/tests/src/Unit/process/LanguageTypesTest.php, line 42

Class

LanguageTypesTest
Tests Drupal\language\Plugin\migrate\process\LanguageTypes.

Namespace

Drupal\Tests\language\Unit\process

Code

public function testTransformConfigurable() : void {
  $this->plugin = new LanguageTypes([
    'filter_configurable' => TRUE,
  ], 'map', []);
  $source = [
    'language' => TRUE,
    'language_url' => FALSE,
    'language_content' => FALSE,
  ];
  $expected = [
    0 => 'language_interface',
  ];
  $value = $this->plugin
    ->transform($source, $this->migrateExecutable, $this->row, 'destination_property');
  $this->assertSame($value, $expected);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.