You are here

public function CallbackTest::testCallback in Drupal 8

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

Test callback with valid "callable".

@dataProvider providerCallback

File

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

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);
}