public function EntityReferenceRevisionsDestinationTest::getEntityDataProviderForceRevision in Entity Reference Revisions 8
Provides multiple migration definitions for "getEntity" test.
File
- tests/
src/ Kernel/ Plugin/ migrate/ destination/ EntityReferenceRevisionsDestinationTest.php, line 276
Class
- EntityReferenceRevisionsDestinationTest
- Tests the migration destination plugin.
Namespace
Drupal\Tests\entity_reference_revisions\Kernel\Plugin\migrate\destinationCode
public function getEntityDataProviderForceRevision() {
return [
'with ids, new revisions and no force revision' => [
'definition' => [
'source' => [
'plugin' => 'embedded_data',
'data_rows' => [
[
'id' => 1,
'name' => 'content item 1a',
],
[
'id' => 2,
'name' => 'content item 2',
],
],
'ids' => [
'id' => [
'type' => 'integer',
],
'name' => [
'type' => 'text',
],
],
],
'process' => [
'name' => 'name',
'id' => 'id',
],
'destination' => [
'plugin' => 'entity_reference_revisions:entity_test_composite',
'new_revisions' => TRUE,
'force_revision' => FALSE,
],
],
'expected' => [
[
[
'id' => 1,
'revision_id' => 1,
'label' => 'content item 1a',
],
[
'id' => 2,
'revision_id' => 2,
'label' => 'content item 2',
],
],
[
[
'id' => 1,
'revision_id' => 1,
'label' => 'content item 1a',
],
[
'id' => 2,
'revision_id' => 2,
'label' => 'content item 2',
],
],
],
],
'with ids, new revisions and force revision' => [
'definition' => [
'source' => [
'plugin' => 'embedded_data',
'data_rows' => [
[
'id' => 1,
'name' => 'content item 1a',
],
[
'id' => 2,
'name' => 'content item 2',
],
],
'ids' => [
'id' => [
'type' => 'integer',
],
'name' => [
'type' => 'text',
],
],
],
'process' => [
'name' => 'name',
'id' => 'id',
],
'destination' => [
'plugin' => 'entity_reference_revisions:entity_test_composite',
'new_revisions' => TRUE,
'force_revision' => TRUE,
],
],
'expected' => [
[
[
'id' => 1,
'revision_id' => 1,
'label' => 'content item 1a',
],
[
'id' => 2,
'revision_id' => 2,
'label' => 'content item 2',
],
],
[
[
'id' => 1,
'revision_id' => 3,
'label' => 'content item 1a',
],
[
'id' => 2,
'revision_id' => 4,
'label' => 'content item 2',
],
],
],
],
];
}