You are here

public function TextFieldTest::testProcessBooleanTextImplicitValues in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php \Drupal\Tests\text\Unit\Plugin\migrate\field\d6\TextFieldTest::testProcessBooleanTextImplicitValues()

@covers ::defineValueProcessPipeline

File

core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php, line 75

Class

TextFieldTest
@coversDefaultClass \Drupal\text\Plugin\migrate\field\d6\TextField @group text

Namespace

Drupal\Tests\text\Unit\Plugin\migrate\field\d6

Code

public function testProcessBooleanTextImplicitValues($method = 'defineValueProcessPipeline') {
  $info = [
    'widget_type' => 'optionwidgets_onoff',
    'global_settings' => [
      'allowed_values' => "foo\nbar",
    ],
  ];
  $this->plugin
    ->{$method}($this->migration, 'field', $info);
  $expected = [
    'value' => [
      'plugin' => 'static_map',
      'source' => 'value',
      'default_value' => 0,
      'map' => [
        'bar' => 1,
      ],
    ],
  ];
  $this
    ->assertSame($expected, $this->migration
    ->getProcess()['process']);
}