function SubProcessTest::providerTestSourceNotArray

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

Data provider for testSourceNotArray().

File

core/modules/migrate/tests/src/Unit/process/SubProcessTest.php, line 213

Class

SubProcessTest
Tests the sub_process process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public static function providerTestSourceNotArray() {
    return [
        'strings cannot be subprocess items' => [
            [
                'strings',
                'cannot',
                'be',
                'children',
            ],
            'string',
        ],
        'xml elements cannot be subprocess items' => [
            [
                new \SimpleXMLElement("<element>Content</element>"),
            ],
            'object',
        ],
        'integers cannot be subprocess items' => [
            [
                1,
                2,
                3,
                4,
            ],
            'integer',
        ],
        'booleans cannot be subprocess items' => [
            [
                TRUE,
                FALSE,
            ],
            'boolean',
        ],
        'null cannot be subprocess items' => [
            [
                NULL,
            ],
            'NULL',
        ],
        'iterator cannot be subprocess items' => [
            [
                new \ArrayIterator([
                    'some',
                    'array',
                ]),
            ],
            'object',
        ],
        'all subprocess items must be arrays' => [
            [
                [
                    'array',
                ],
                'not array',
            ],
            'string',
        ],
    ];
}

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