function GetTest::testIntegerValues

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Unit/process/GetTest.php \Drupal\Tests\migrate\Unit\process\GetTest::testIntegerValues()
  2. 8.9.x core/modules/migrate/tests/src/Unit/process/GetTest.php \Drupal\Tests\migrate\Unit\process\GetTest::testIntegerValues()
  3. 11.x 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 85

Class

GetTest
Tests the get process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testIntegerValues($source, $expected_value) : void {
    $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);
}

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