You are here

public function TextFieldTest::testProcessBooleanTextExplicitValues in Drupal 8

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

@covers ::defineValueProcessPipeline

1 call to TextFieldTest::testProcessBooleanTextExplicitValues()
TextFieldLegacyTest::testProcessBooleanTextExplicitValues in core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldLegacyTest.php
@covers ::processFieldValues @expectedDeprecation Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use defineValueProcessPipeline() instead. See https://www.drupal.org/node/2944598.
1 method overrides TextFieldTest::testProcessBooleanTextExplicitValues()
TextFieldLegacyTest::testProcessBooleanTextExplicitValues in core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldLegacyTest.php
@covers ::processFieldValues @expectedDeprecation Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use defineValueProcessPipeline() instead. See https://www.drupal.org/node/2944598.

File

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

Class

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

Namespace

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

Code

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