function LanguageNegotiationTest::testTransformWithWeights
Tests successful transformation without weights.
File
- 
              core/
modules/ language/ tests/ src/ Unit/ process/ LanguageNegotiationTest.php, line 26  
Class
- LanguageNegotiationTest
 - @coversDefaultClass \Drupal\language\Plugin\migrate\process\LanguageNegotiation[[api-linebreak]] @group language
 
Namespace
Drupal\Tests\language\Unit\processCode
public function testTransformWithWeights() {
  $source = [
    [
      'locale-url' => [],
      'language-default' => [],
    ],
    [
      'locale-url' => -10,
      'locale-session' => -9,
      'locale-user' => -8,
      'locale-browser' => -7,
      'language-default' => -6,
    ],
  ];
  $expected = [
    'enabled' => [
      'language-url' => -10,
      'language-selected' => -6,
    ],
    'method_weights' => [
      'language-url' => -10,
      'language-session' => -9,
      'language-user' => -8,
      'language-browser' => -7,
      'language-selected' => -6,
    ],
  ];
  $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.