function ExtractTest::testExtractInvalid

Tests invalid input.

Attributes

#[DataProvider('providerTestExtractInvalid')]

File

core/modules/migrate/tests/src/Unit/process/ExtractTest.php, line 40

Class

ExtractTest
Tests Drupal\migrate\Plugin\migrate\process\Extract.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testExtractInvalid($value) : void {
  $this->expectException(MigrateException::class);
  $type = gettype($value);
  $this->expectExceptionMessage(sprintf("Input should be an array, instead it was of type '%s'", $type));
  $this->plugin
    ->transform($value, $this->migrateExecutable, $this->row, 'destination_property');
}

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