You are here

public function TextFieldTest::testProcessBooleanTextExplicitValues in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/text/tests/src/Unit/Migrate/TextFieldTest.php \Drupal\Tests\text\Unit\Migrate\TextFieldTest::testProcessBooleanTextExplicitValues()

@covers ::processCckFieldValues

File

core/modules/text/tests/src/Unit/Migrate/TextFieldTest.php, line 103
Contains \Drupal\Tests\text\Unit\Migrate\TextFieldTest.

Class

TextFieldTest
@coversDefaultClass \Drupal\text\Plugin\migrate\cckfield\TextField @group text

Namespace

Drupal\Tests\text\Unit\Migrate

Code

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