function LanguageTypesTest::testTransformAll

Same name in other branches
  1. 9 core/modules/language/tests/src/Unit/process/LanguageTypesTest.php \Drupal\Tests\language\Unit\process\LanguageTypesTest::testTransformAll()
  2. 10 core/modules/language/tests/src/Unit/process/LanguageTypesTest.php \Drupal\Tests\language\Unit\process\LanguageTypesTest::testTransformAll()
  3. 11.x core/modules/language/tests/src/Unit/process/LanguageTypesTest.php \Drupal\Tests\language\Unit\process\LanguageTypesTest::testTransformAll()

Tests successful transformation of all language types.

File

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

Class

LanguageTypesTest
@coversDefaultClass \Drupal\language\Plugin\migrate\process\LanguageTypes @group language

Namespace

Drupal\Tests\language\Unit\process

Code

public function testTransformAll() {
    $this->plugin = new LanguageTypes([], 'map', []);
    $source = [
        'language' => TRUE,
        'language_url' => FALSE,
        'language_content' => FALSE,
    ];
    $expected = [
        0 => 'language_url',
        1 => 'language_content',
        2 => '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.