function NullCoalesceTest::transformWithDefaultProvider

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Unit/process/NullCoalesceTest.php \Drupal\Tests\migrate\Unit\process\NullCoalesceTest::transformWithDefaultProvider()
  2. 10 core/modules/migrate/tests/src/Unit/process/NullCoalesceTest.php \Drupal\Tests\migrate\Unit\process\NullCoalesceTest::transformWithDefaultProvider()

Provides Data for ::testTransformWithDefault.

File

core/modules/migrate/tests/src/Unit/process/NullCoalesceTest.php, line 106

Class

NullCoalesceTest
Tests the null_coalesce process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public static function transformWithDefaultProvider() {
    return [
        'default not used' => [
            'source' => [
                NULL,
                NULL,
                'Test',
                'Test 2',
            ],
            'default_value' => 'default',
            'expected_result' => 'Test',
        ],
        'default string' => [
            'source' => [
                NULL,
                NULL,
            ],
            'default_value' => 'default',
            'expected_result' => 'default',
        ],
        'default NULL' => [
            'source' => [
                NULL,
                NULL,
            ],
            'default_value' => NULL,
            'expected_result' => NULL,
        ],
    ];
}

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