function SubProcessTest::testSourceNotArray

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

Tests behavior when source children are not arrays.

@dataProvider providerTestSourceNotArray

File

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

Class

SubProcessTest
Tests the sub_process process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testSourceNotArray($source_values, $type) : void {
    $process = new SubProcess([
        'process' => [
            'foo' => 'source_foo',
        ],
    ], 'sub_process', []);
    $this->expectException(MigrateException::class);
    $this->expectExceptionMessage("Input array should hold elements of type array, instead element was of type '{$type}'");
    $process->transform($source_values, $this->migrateExecutable, $this->row, 'destination_property');
}

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