function GetTest::testTransformSourceString

Same name and namespace in other branches
  1. 9 core/modules/migrate/tests/src/Unit/process/GetTest.php \Drupal\Tests\migrate\Unit\process\GetTest::testTransformSourceString()
  2. 8.9.x core/modules/migrate/tests/src/Unit/process/GetTest.php \Drupal\Tests\migrate\Unit\process\GetTest::testTransformSourceString()
  3. 10 core/modules/migrate/tests/src/Unit/process/GetTest.php \Drupal\Tests\migrate\Unit\process\GetTest::testTransformSourceString()

Tests the Get plugin when source is a string.

File

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

Class

GetTest
Tests the get process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.