You are here

public function ExtractTest::providerExtractDefault in Drupal 10

Same name and namespace in other branches
  1. 9 core/modules/migrate/tests/src/Unit/process/ExtractTest.php \Drupal\Tests\migrate\Unit\process\ExtractTest::providerExtractDefault()

Data provider for testExtractDefault.

File

core/modules/migrate/tests/src/Unit/process/ExtractTest.php, line 85

Class

ExtractTest
@coversDefaultClass \Drupal\migrate\Plugin\migrate\process\Extract @group migrate

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function providerExtractDefault() {
  return [
    [
      [
        'foo' => 'bar',
      ],
      [
        'index' => [
          'foo',
        ],
        'default' => 'one',
      ],
      'bar',
    ],
    [
      [
        'foo' => 'bar',
      ],
      [
        'index' => [
          'not_key',
        ],
        'default' => 'two',
      ],
      'two',
    ],
    [
      [
        'foo' => 'bar',
      ],
      [
        'index' => [
          'not_key',
        ],
        'default' => NULL,
      ],
      NULL,
    ],
    [
      [
        'foo' => 'bar',
      ],
      [
        'index' => [
          'not_key',
        ],
        'default' => TRUE,
      ],
      TRUE,
    ],
    [
      [
        'foo' => 'bar',
      ],
      [
        'index' => [
          'not_key',
        ],
        'default' => FALSE,
      ],
      FALSE,
    ],
    [
      [
        'foo' => '',
      ],
      [
        'index' => [
          'foo',
        ],
        'default' => NULL,
      ],
      '',
    ],
  ];
}