public function CallbackTest::testCallback in Drupal 10
Same name and namespace in other branches
- 8 core/modules/migrate/tests/src/Unit/process/CallbackTest.php \Drupal\Tests\migrate\Unit\process\CallbackTest::testCallback()
- 9 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\processCode
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);
}