function FlattenTest::providerTestFlatten

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Unit/process/FlattenTest.php \Drupal\Tests\migrate\Unit\process\FlattenTest::providerTestFlatten()
  2. 11.x 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 38

Class

FlattenTest
Tests the flatten plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public static 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',
            ],
        ],
    ];
}

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