You are here

public function ExplodeTest::providerExplodeWithNonStrictAndEmptySource in Drupal 8

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

Data provider for ::testExplodeWithNonStrictAndEmptySource().

File

core/modules/migrate/tests/src/Unit/process/ExplodeTest.php, line 79

Class

ExplodeTest
Tests the Explode process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function providerExplodeWithNonStrictAndEmptySource() {
  return [
    'normal_string' => [
      'a|b|c',
      [
        'a',
        'b',
        'c',
      ],
    ],
    'integer_cast_to_string' => [
      123,
      [
        '123',
      ],
    ],
    'zero_integer_cast_to_string' => [
      0,
      [
        '0',
      ],
    ],
    'true_cast_to_string' => [
      TRUE,
      [
        '1',
      ],
    ],
    'null_empty_array' => [
      NULL,
      [],
    ],
    'false_empty_array' => [
      FALSE,
      [],
    ],
    'empty_string_empty_array' => [
      '',
      [],
    ],
  ];
}