You are here

public function FlattenTest::providerTestFlatten in Drupal 10

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

Provides data for the testFlatten.

File

core/modules/migrate/tests/src/Unit/process/FlattenTest.php, line 36

Class

FlattenTest
Tests the flatten plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function providerTestFlatten() {
  $object = (object) [
    'a' => 'test',
    'b' => '1.2',
    'c' => 'NULL',
  ];
  return [
    'array' => [
      [
        1,
        2,
        [
          3,
          4,
          [
            5,
          ],
        ],
        [],
        [
          7,
          8,
        ],
      ],
      [
        1,
        2,
        3,
        4,
        5,
        7,
        8,
      ],
    ],
    'object' => [
      $object,
      [
        'test',
        '1.2',
        'NULL',
      ],
    ],
  ];
}