function MigrateExecutableTest::testProcessRowEmptyDestination
Same name in other branches
- 9 core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php \Drupal\Tests\migrate\Unit\MigrateExecutableTest::testProcessRowEmptyDestination()
- 8.9.x core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php \Drupal\Tests\migrate\Unit\MigrateExecutableTest::testProcessRowEmptyDestination()
- 10 core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php \Drupal\Tests\migrate\Unit\MigrateExecutableTest::testProcessRowEmptyDestination()
Tests the processRow method.
File
-
core/
modules/ migrate/ tests/ src/ Unit/ MigrateExecutableTest.php, line 388
Class
- MigrateExecutableTest
- @coversDefaultClass \Drupal\migrate\MigrateExecutable @group migrate
Namespace
Drupal\Tests\migrate\UnitCode
public function testProcessRowEmptyDestination() : void {
$expected = [
'test' => 'test destination',
'test1' => 'test1 destination',
'test2' => NULL,
];
$row = new Row();
$plugins = [];
foreach ($expected as $key => $value) {
$plugin = $this->prophesize(MigrateProcessInterface::class);
$plugin->getPluginDefinition()
->willReturn([]);
$plugin->transform(NULL, $this->executable, $row, $key)
->willReturn($value);
$plugin->multiple()
->willReturn(TRUE);
$plugin->reset()
->shouldBeCalled();
$plugin->isPipelineStopped()
->willReturn(FALSE);
$plugins[$key][0] = $plugin->reveal();
}
$this->migration
->method('getProcessPlugins')
->willReturn($plugins);
$this->executable
->processRow($row);
foreach ($expected as $key => $value) {
$this->assertSame($value, $row->getDestinationProperty($key));
}
$this->assertCount(2, $row->getDestination());
$this->assertSame([
'test2',
], $row->getEmptyDestinationProperties());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.