You are here

public function GetTest::testTransformSourceStringAt in Drupal 10

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

Tests the Get plugin when source is a string pointing to destination.

File

core/modules/migrate/tests/src/Unit/process/GetTest.php, line 48

Class

GetTest
Tests the get process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testTransformSourceStringAt() {
  $this->row
    ->expects($this
    ->once())
    ->method('get')
    ->with('@@test')
    ->will($this
    ->returnValue('source_value'));
  $this->plugin = new Get([
    'source' => '@@test',
  ], '', []);
  $value = $this->plugin
    ->transform(NULL, $this->migrateExecutable, $this->row, 'destination_property');
  $this
    ->assertSame('source_value', $value);
}