You are here

public function LanguageNegotiationTest::testTransformWithoutWeights in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/language/tests/src/Unit/process/LanguageNegotiationTest.php \Drupal\Tests\language\Unit\process\LanguageNegotiationTest::testTransformWithoutWeights()
  2. 9 core/modules/language/tests/src/Unit/process/LanguageNegotiationTest.php \Drupal\Tests\language\Unit\process\LanguageNegotiationTest::testTransformWithoutWeights()

Tests successful transformation without weights.

File

core/modules/language/tests/src/Unit/process/LanguageNegotiationTest.php, line 60

Class

LanguageNegotiationTest
@coversDefaultClass \Drupal\language\Plugin\migrate\process\LanguageNegotiation @group language

Namespace

Drupal\Tests\language\Unit\process

Code

public function testTransformWithoutWeights() {
  $source = [
    [
      'locale-url' => [],
      'locale-url-fallback' => [],
    ],
  ];
  $expected = [
    'enabled' => [
      'language-url' => 0,
      'language-url-fallback' => 1,
    ],
  ];
  $value = $this->plugin
    ->transform($source, $this->migrateExecutable, $this->row, 'destination_property');
  $this
    ->assertSame($value, $expected);
}