You are here

public function CallbackTest::testCallback in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate/tests/src/Unit/process/CallbackTest.php \Drupal\Tests\migrate\Unit\process\CallbackTest::testCallback()

Tests callback with valid "callable".

@dataProvider providerCallback

File

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

Class

CallbackTest
Tests the callback process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testCallback($callable) {
  $configuration = [
    'callable' => $callable,
  ];
  $this->plugin = new Callback($configuration, 'map', []);
  $value = $this->plugin
    ->transform('FooBar', $this->migrateExecutable, $this->row, 'destination_property');
  $this
    ->assertSame('foobar', $value);
}