function TextCckTest::testProcessBooleanTextImplicitValues

Same name in this branch
  1. 8.9.x core/modules/text/tests/src/Unit/Migrate/TextCckTest.php \Drupal\Tests\text\Unit\Migrate\TextCckTest::testProcessBooleanTextImplicitValues()

@covers ::processCckFieldValues

File

core/modules/text/tests/src/Unit/Plugin/migrate/cckfield/TextCckTest.php, line 74

Class

TextCckTest
@coversDefaultClass \Drupal\text\Plugin\migrate\cckfield\TextField @group text @group legacy

Namespace

Drupal\Tests\text\Unit\Plugin\migrate\cckfield

Code

public function testProcessBooleanTextImplicitValues() {
    $info = [
        'widget_type' => 'optionwidgets_onoff',
        'global_settings' => [
            'allowed_values' => "foo\nbar",
        ],
    ];
    $this->plugin
        ->processCckFieldValues($this->migration, 'field', $info);
    $expected = [
        'value' => [
            'plugin' => 'static_map',
            'source' => 'value',
            'default_value' => 0,
            'map' => [
                'bar' => 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.