You are here

public function CallbackTest::testCallbackArray in Drupal 9

Test callback with valid "callable" and multiple arguments.

@dataProvider providerCallbackArray

File

core/modules/migrate/tests/src/Unit/process/CallbackTest.php, line 42

Class

CallbackTest
Tests the callback process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testCallbackArray($callable, $args, $result) {
  $configuration = [
    'callable' => $callable,
    'unpack_source' => TRUE,
  ];
  $this->plugin = new Callback($configuration, 'map', []);
  $value = $this->plugin
    ->transform($args, $this->migrateExecutable, $this->row, 'destination_property');
  $this
    ->assertSame($result, $value);
}