You are here

public function GetTest::testIntegerValues 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::testIntegerValues()
  2. 9 core/modules/migrate/tests/src/Unit/process/GetTest.php \Drupal\Tests\migrate\Unit\process\GetTest::testIntegerValues()

Tests the Get plugin when source has integer values.

@dataProvider integerValuesDataProvider

File

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

Class

GetTest
Tests the get process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testIntegerValues($source, $expected_value) {
  $this->row
    ->expects($this
    ->atMost(2))
    ->method('get')
    ->willReturnOnConsecutiveCalls('val1', 'val2');
  $this->plugin = new Get([
    'source' => $source,
  ], '', []);
  $return = $this->plugin
    ->transform(NULL, $this->migrateExecutable, $this->row, 'destination_property');
  $this
    ->assertSame($expected_value, $return);
}