You are here

public function FlattenTest::testFlattenInvalid 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::testFlattenInvalid()

Tests that Flatten throws a MigrateException.

@dataProvider providerTestFlattenInvalid

File

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

Class

FlattenTest
Tests the flatten plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

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