function TextFieldTest::testProcessBooleanTextExplicitValues

Same name in this branch
  1. 8.9.x core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php \Drupal\Tests\text\Unit\Plugin\migrate\field\d6\TextFieldTest::testProcessBooleanTextExplicitValues()
Same name 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()

Calls the deprecated processFieldValues() method to test BC.

@covers ::processFieldValues

@depends testBooleanTextExplicitValueProcessPipeline

File

core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php, line 159

Class

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

Namespace

Drupal\Tests\text\Unit\Migrate\d6

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.