public function RowTest::testMultipleDestination in Drupal 10
Same name and namespace in other branches
- 8 core/modules/migrate/tests/src/Unit/RowTest.php \Drupal\Tests\migrate\Unit\RowTest::testMultipleDestination()
- 9 core/modules/migrate/tests/src/Unit/RowTest.php \Drupal\Tests\migrate\Unit\RowTest::testMultipleDestination()
Tests setting/getting multiple destination IDs.
File
- core/
modules/ migrate/ tests/ src/ Unit/ RowTest.php, line 295
Class
- RowTest
- @coversDefaultClass \Drupal\migrate\Row @group migrate
Namespace
Drupal\Tests\migrate\UnitCode
public function testMultipleDestination() {
$row = new Row($this->testValues, $this->testSourceIds);
// Set some deep nested values.
$row
->setDestinationProperty('image/alt', 'alt text');
$row
->setDestinationProperty('image/fid', 3);
$this
->assertTrue($row
->hasDestinationProperty('image'));
$this
->assertFalse($row
->hasDestinationProperty('alt'));
$this
->assertFalse($row
->hasDestinationProperty('fid'));
$destination = $row
->getDestination();
$this
->assertEquals('alt text', $destination['image']['alt']);
$this
->assertEquals(3, $destination['image']['fid']);
$this
->assertEquals('alt text', $row
->getDestinationProperty('image/alt'));
$this
->assertEquals(3, $row
->getDestinationProperty('image/fid'));
}