function RowTest::createRowWithDestinationProperties

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Unit/RowTest.php \Drupal\Tests\migrate\Unit\RowTest::createRowWithDestinationProperties()
  2. 8.9.x core/modules/migrate/tests/src/Unit/RowTest.php \Drupal\Tests\migrate\Unit\RowTest::createRowWithDestinationProperties()
  3. 11.x core/modules/migrate/tests/src/Unit/RowTest.php \Drupal\Tests\migrate\Unit\RowTest::createRowWithDestinationProperties()

Create a row and load it with destination properties.

Parameters

array $source_properties: The source property array.

array $source_ids: The source ids array.

array $destination_properties: The destination properties to load.

bool $is_stub: Whether this row is a stub row, defaults to FALSE.

Return value

\Drupal\migrate\Row The row, populated with destination properties.

2 calls to RowTest::createRowWithDestinationProperties()
RowTest::testGet in core/modules/migrate/tests/src/Unit/RowTest.php
Tests getting source and destination properties.
RowTest::testGetMultiple in core/modules/migrate/tests/src/Unit/RowTest.php
Tests getting multiple source and destination properties.

File

core/modules/migrate/tests/src/Unit/RowTest.php, line 448

Class

RowTest
@coversDefaultClass \Drupal\migrate\Row @group migrate

Namespace

Drupal\Tests\migrate\Unit

Code

protected function createRowWithDestinationProperties(array $source_properties, array $source_ids, array $destination_properties, $is_stub = FALSE) {
    $row = new Row($source_properties, $source_ids, $is_stub);
    foreach ($destination_properties as $key => $property) {
        $row->setDestinationProperty($key, $property);
    }
    return $row;
}

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