summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Catchpole2018-07-13 11:39:04 (GMT)
committerNathaniel Catchpole2018-07-13 11:39:04 (GMT)
commit14a769b7580317bd3d690449c9222492e9308c72 (patch)
tree3eaf49e6d13ac607496c0749fbbc22163f1c8334
parent163144a9237a9ad5d28916573d3b34f5a8ddd625 (diff)
Issue #2631698 by Jo Fitzgerald, robpowell, phenaproxima, heddn, quietone: Fix sub-optimal DX in MigrateFieldInterface
-rw-r--r--core/lib/Drupal/Core/Field/Plugin/migrate/field/Email.php2
-rw-r--r--core/modules/comment/src/Plugin/migrate/D7Comment.php2
-rw-r--r--core/modules/datetime/src/Plugin/migrate/field/DateField.php2
-rw-r--r--core/modules/datetime/src/Plugin/migrate/field/d6/DateField.php2
-rw-r--r--core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldLegacyTest.php18
-rw-r--r--core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php18
-rw-r--r--core/modules/datetime/tests/src/Unit/Plugin/migrate/field/d6/DateFieldLegacyTest.php18
-rw-r--r--core/modules/datetime/tests/src/Unit/Plugin/migrate/field/d6/DateFieldTest.php19
-rw-r--r--core/modules/field/migrations/d6_field.yml2
-rw-r--r--core/modules/field/migrations/d6_field_formatter_settings.yml2
-rw-r--r--core/modules/field/migrations/d6_field_instance.yml2
-rw-r--r--core/modules/field/migrations/d6_field_instance_widget_settings.yml2
-rw-r--r--core/modules/field/migrations/d7_field.yml2
-rw-r--r--core/modules/field/migrations/d7_field_formatter_settings.yml2
-rw-r--r--core/modules/field/migrations/d7_field_instance.yml2
-rw-r--r--core/modules/field/migrations/d7_field_instance_widget_settings.yml2
-rw-r--r--core/modules/file/src/Plugin/migrate/field/d6/FileField.php2
-rw-r--r--core/modules/file/src/Plugin/migrate/field/d7/FileField.php2
-rw-r--r--core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d6/FileCckTest.php2
-rw-r--r--core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/FileCckTest.php2
-rw-r--r--core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/ImageCckTest.php2
-rw-r--r--core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldLegacyTest.php19
-rw-r--r--core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldTest.php8
-rw-r--r--core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldLegacyTest.php19
-rw-r--r--core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php8
-rw-r--r--core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldLegacyTest.php18
-rw-r--r--core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldTest.php8
-rw-r--r--core/modules/image/src/Plugin/migrate/field/d7/ImageField.php2
-rw-r--r--core/modules/image/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldTest.php2
-rw-r--r--core/modules/link/src/Plugin/migrate/cckfield/LinkField.php4
-rw-r--r--core/modules/link/src/Plugin/migrate/cckfield/d7/LinkField.php4
-rw-r--r--core/modules/link/src/Plugin/migrate/field/d6/LinkField.php4
-rw-r--r--core/modules/link/src/Plugin/migrate/field/d7/LinkField.php2
-rw-r--r--core/modules/link/tests/src/Kernel/Plugin/migrate/cckfield/d7/LinkCckDeprecationTest.php18
-rw-r--r--core/modules/link/tests/src/Kernel/Plugin/migrate/cckfield/d7/LinkCckTest.php10
-rw-r--r--core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldLegacyTest.php18
-rw-r--r--core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldTest.php8
-rw-r--r--core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldLegacyTest.php18
-rw-r--r--core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldTest.php8
-rw-r--r--core/modules/migrate_drupal/src/Plugin/MigrateFieldInterface.php12
-rw-r--r--core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php11
-rw-r--r--core/modules/migrate_drupal/src/Plugin/migrate/field/FieldPluginBase.php81
-rw-r--r--core/modules/migrate_drupal/src/Plugin/migrate/field/NodeReference.php2
-rw-r--r--core/modules/migrate_drupal/src/Plugin/migrate/field/UserReference.php2
-rw-r--r--core/modules/node/src/Plugin/migrate/D6NodeDeriver.php2
-rw-r--r--core/modules/node/src/Plugin/migrate/D7NodeDeriver.php2
-rw-r--r--core/modules/taxonomy/src/Plugin/migrate/D7TaxonomyTermDeriver.php2
-rw-r--r--core/modules/taxonomy/src/Plugin/migrate/field/TaxonomyTermReference.php2
-rw-r--r--core/modules/taxonomy/tests/src/Unit/Plugin/migrate/cckfield/TaxonomyTermReferenceCckLegacyTest.php18
-rw-r--r--core/modules/taxonomy/tests/src/Unit/Plugin/migrate/cckfield/TaxonomyTermReferenceCckTest.php10
-rw-r--r--core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldLegacyTest.php18
-rw-r--r--core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php8
-rw-r--r--core/modules/text/src/Plugin/migrate/field/d6/TextField.php2
-rw-r--r--core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php87
-rw-r--r--core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldLegacyTest.php36
-rw-r--r--core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php20
-rw-r--r--core/modules/user/src/Plugin/migrate/User.php2
57 files changed, 482 insertions, 120 deletions
diff --git a/core/lib/Drupal/Core/Field/Plugin/migrate/field/Email.php b/core/lib/Drupal/Core/Field/Plugin/migrate/field/Email.php
index 11226fa..f56a6f8 100644
--- a/core/lib/Drupal/Core/Field/Plugin/migrate/field/Email.php
+++ b/core/lib/Drupal/Core/Field/Plugin/migrate/field/Email.php
@@ -46,7 +46,7 @@ class Email extends FieldPluginBase {
/**
* {@inheritdoc}
*/
- public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
+ public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
$process = [
'plugin' => 'sub_process',
'source' => $field_name,
diff --git a/core/modules/comment/src/Plugin/migrate/D7Comment.php b/core/modules/comment/src/Plugin/migrate/D7Comment.php
index 77a7dca..9a509f4 100644
--- a/core/modules/comment/src/Plugin/migrate/D7Comment.php
+++ b/core/modules/comment/src/Plugin/migrate/D7Comment.php
@@ -35,7 +35,7 @@ class D7Comment extends FieldMigration {
$this->fieldPluginCache[$field_type] = $this->fieldPluginManager->createInstance($field_type, [], $this);
}
$info = $row->getSource();
- $this->fieldPluginCache[$field_type]->processFieldValues($this, $field_name, $info);
+ $this->fieldPluginCache[$field_type]->defineValueProcessPipeline($this, $field_name, $info);
}
else {
$this->setProcessOfProperty($field_name, $field_name);
diff --git a/core/modules/datetime/src/Plugin/migrate/field/DateField.php b/core/modules/datetime/src/Plugin/migrate/field/DateField.php
index 4460762..876c9da 100644
--- a/core/modules/datetime/src/Plugin/migrate/field/DateField.php
+++ b/core/modules/datetime/src/Plugin/migrate/field/DateField.php
@@ -44,7 +44,7 @@ class DateField extends FieldPluginBase {
/**
* {@inheritdoc}
*/
- public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
+ public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
switch ($data['type']) {
case 'date':
$from_format = 'Y-m-d\TH:i:s';
diff --git a/core/modules/datetime/src/Plugin/migrate/field/d6/DateField.php b/core/modules/datetime/src/Plugin/migrate/field/d6/DateField.php
index 4e7cd88..7ea04b9 100644
--- a/core/modules/datetime/src/Plugin/migrate/field/d6/DateField.php
+++ b/core/modules/datetime/src/Plugin/migrate/field/d6/DateField.php
@@ -40,7 +40,7 @@ class DateField extends FieldPluginBase {
/**
* {@inheritdoc}
*/
- public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
+ public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
switch ($data['type']) {
case 'date':
$from_format = 'Y-m-d\TH:i:s';
diff --git a/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldLegacyTest.php b/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldLegacyTest.php
new file mode 100644
index 0000000..fb51066
--- /dev/null
+++ b/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldLegacyTest.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace Drupal\Tests\datetime\Unit\Plugin\migrate\field;
+
+/**
+ * @group migrate
+ * @group legacy
+ */
+class DateFieldLegacyTest extends DateFieldTest {
+
+ /**
+ * @expectedDeprecation Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use defineValueProcessPipeline() instead. See https://www.drupal.org/node/2944598.
+ */
+ public function testUnknownDateType($method = 'processFieldValues') {
+ parent::testUnknownDateType($method);
+ }
+
+}
diff --git a/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php b/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php
index 6b7f137..500eac2 100644
--- a/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php
+++ b/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php
@@ -12,24 +12,14 @@ use Drupal\Tests\UnitTestCase;
class DateFieldTest extends UnitTestCase {
/**
- * @var \Drupal\migrate_drupal\Plugin\MigrateFieldInterface
- */
- protected $plugin;
-
- /**
- * @var \Drupal\migrate\Plugin\MigrationInterface
- */
- protected $migration;
-
- /**
* Tests an Exception is thrown when the field type is not a known date type.
*/
- public function testUnknownDateType() {
- $this->migration = $this->prophesize('Drupal\migrate\Plugin\MigrationInterface')->reveal();
- $this->plugin = new DateField([], '', []);
+ public function testUnknownDateType($method = 'defineValueProcessPipeline') {
+ $migration = $this->prophesize('Drupal\migrate\Plugin\MigrationInterface')->reveal();
+ $plugin = new DateField([], '', []);
$this->setExpectedException(MigrateException::class, "Field field_date of type 'timestamp' is an unknown date field type.");
- $this->plugin->processFieldValues($this->migration, 'field_date', ['type' => 'timestamp']);
+ $plugin->$method($migration, 'field_date', ['type' => 'timestamp']);
}
}
diff --git a/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/d6/DateFieldLegacyTest.php b/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/d6/DateFieldLegacyTest.php
new file mode 100644
index 0000000..00e6e8c
--- /dev/null
+++ b/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/d6/DateFieldLegacyTest.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace Drupal\Tests\datetime\Unit\Plugin\migrate\field\d6;
+
+/**
+ * @group migrate
+ * @group legacy
+ */
+class DateFieldLegacyTest extends DateFieldTest {
+
+ /**
+ * @expectedDeprecation Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use defineValueProcessPipeline() instead. See https://www.drupal.org/node/2944598.
+ */
+ public function testUnknownDateType($method = 'processFieldValues') {
+ parent::testUnknownDateType($method);
+ }
+
+}
diff --git a/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/d6/DateFieldTest.php b/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/d6/DateFieldTest.php
index c2c5017..cbd26d4 100644
--- a/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/d6/DateFieldTest.php
+++ b/core/modules/datetime/tests/src/Unit/Plugin/migrate/field/d6/DateFieldTest.php
@@ -4,6 +4,7 @@ namespace Drupal\Tests\datetime\Unit\Plugin\migrate\field\d6;
use Drupal\datetime\Plugin\migrate\field\d6\DateField;
use Drupal\migrate\MigrateException;
+use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\Tests\UnitTestCase;
/**
@@ -13,26 +14,28 @@ use Drupal\Tests\UnitTestCase;
class DateFieldTest extends UnitTestCase {
/**
- * @var \Drupal\migrate_drupal\Plugin\MigrateFieldInterface
+ * @var \Drupal\migrate\Plugin\MigrationInterface
*/
- protected $plugin;
+ protected $migration;
/**
- * @var \Drupal\migrate\Plugin\MigrationInterface
+ * {@inheritdoc}
*/
- protected $migration;
+ protected function setUp() {
+ parent::setUp();
+ $this->migration = $this->prophesize(MigrationInterface::class)->reveal();
+ }
/**
* Tests an Exception is thrown when the field type is not a known date type.
*
* @expectedDeprecation DateField is deprecated in Drupal 8.4.x and will be removed before Drupal 9.0.x. Use \Drupal\datetime\Plugin\migrate\field\DateField instead.
*/
- public function testUnknownDateType() {
- $this->migration = $this->prophesize('Drupal\migrate\Plugin\MigrationInterface')->reveal();
- $this->plugin = new DateField([], '', []);
+ public function testUnknownDateType($method = 'defineValueProcessPipeline') {
+ $plugin = new DateField([], '', []);
$this->setExpectedException(MigrateException::class, "Field field_date of type 'timestamp' is an unknown date field type.");
- $this->plugin->processFieldValues($this->migration, 'field_date', ['type' => 'timestamp']);
+ $plugin->$method($this->migration, 'field_date', ['type' => 'timestamp']);
}
}
diff --git a/core/modules/field/migrations/d6_field.yml b/core/modules/field/migrations/d6_field.yml
index ab8313a..e25d7ae 100644
--- a/core/modules/field/migrations/d6_field.yml
+++ b/core/modules/field/migrations/d6_field.yml
@@ -4,7 +4,7 @@ migration_tags:
- Drupal 6
- Configuration
class: Drupal\migrate_drupal\Plugin\migrate\FieldMigration
-field_plugin_method: processField
+field_plugin_method: alterFieldMigration
source:
plugin: d6_field
constants:
diff --git a/core/modules/field/migrations/d6_field_formatter_settings.yml b/core/modules/field/migrations/d6_field_formatter_settings.yml
index 772f364..23ea2bd 100644
--- a/core/modules/field/migrations/d6_field_formatter_settings.yml
+++ b/core/modules/field/migrations/d6_field_formatter_settings.yml
@@ -4,7 +4,7 @@ migration_tags:
- Drupal 6
- Configuration
class: Drupal\migrate_drupal\Plugin\migrate\FieldMigration
-field_plugin_method: processFieldFormatter
+field_plugin_method: alterFieldFormatterMigration
source:
plugin: d6_field_instance_per_view_mode
constants:
diff --git a/core/modules/field/migrations/d6_field_instance.yml b/core/modules/field/migrations/d6_field_instance.yml
index 7c23055..4594116 100644
--- a/core/modules/field/migrations/d6_field_instance.yml
+++ b/core/modules/field/migrations/d6_field_instance.yml
@@ -4,7 +4,7 @@ migration_tags:
- Drupal 6
- Configuration
class: Drupal\migrate_drupal\Plugin\migrate\FieldMigration
-field_plugin_method: processFieldInstance
+field_plugin_method: alterFieldInstanceMigration
source:
plugin: d6_field_instance
constants:
diff --git a/core/modules/field/migrations/d6_field_instance_widget_settings.yml b/core/modules/field/migrations/d6_field_instance_widget_settings.yml
index 4c2f4fd..9faac2f 100644
--- a/core/modules/field/migrations/d6_field_instance_widget_settings.yml
+++ b/core/modules/field/migrations/d6_field_instance_widget_settings.yml
@@ -4,7 +4,7 @@ migration_tags:
- Drupal 6
- Configuration
class: Drupal\migrate_drupal\Plugin\migrate\FieldMigration
-field_plugin_method: processFieldWidget
+field_plugin_method: alterFieldWidgetMigration
source:
plugin: d6_field_instance_per_form_display
constants:
diff --git a/core/modules/field/migrations/d7_field.yml b/core/modules/field/migrations/d7_field.yml
index aba5c9f..96bf5ca 100644
--- a/core/modules/field/migrations/d7_field.yml
+++ b/core/modules/field/migrations/d7_field.yml
@@ -4,7 +4,7 @@ migration_tags:
- Drupal 7
- Configuration
class: Drupal\migrate_drupal\Plugin\migrate\FieldMigration
-field_plugin_method: processField
+field_plugin_method: alterFieldMigration
source:
plugin: d7_field
constants:
diff --git a/core/modules/field/migrations/d7_field_formatter_settings.yml b/core/modules/field/migrations/d7_field_formatter_settings.yml
index 5978332..b4580a2 100644
--- a/core/modules/field/migrations/d7_field_formatter_settings.yml
+++ b/core/modules/field/migrations/d7_field_formatter_settings.yml
@@ -4,7 +4,7 @@ migration_tags:
- Drupal 7
- Configuration
class: Drupal\migrate_drupal\Plugin\migrate\FieldMigration
-field_plugin_method: processFieldFormatter
+field_plugin_method: alterFieldFormatterMigration
source:
plugin: d7_field_instance_per_view_mode
constants:
diff --git a/core/modules/field/migrations/d7_field_instance.yml b/core/modules/field/migrations/d7_field_instance.yml
index de5f346..c824c00 100644
--- a/core/modules/field/migrations/d7_field_instance.yml
+++ b/core/modules/field/migrations/d7_field_instance.yml
@@ -4,7 +4,7 @@ migration_tags:
- Drupal 7
- Configuration
class: Drupal\migrate_drupal\Plugin\migrate\FieldMigration
-field_plugin_method: processFieldInstance
+field_plugin_method: alterFieldInstanceMigration
source:
plugin: d7_field_instance
constants:
diff --git a/core/modules/field/migrations/d7_field_instance_widget_settings.yml b/core/modules/field/migrations/d7_field_instance_widget_settings.yml
index 14c1a8c..eaa7831 100644
--- a/core/modules/field/migrations/d7_field_instance_widget_settings.yml
+++ b/core/modules/field/migrations/d7_field_instance_widget_settings.yml
@@ -4,7 +4,7 @@ migration_tags:
- Drupal 7
- Configuration
class: Drupal\migrate_drupal\Plugin\migrate\FieldMigration
-field_plugin_method: processFieldWidget
+field_plugin_method: alterFieldWidgetMigration
source:
plugin: d7_field_instance_per_form_display
constants:
diff --git a/core/modules/file/src/Plugin/migrate/field/d6/FileField.php b/core/modules/file/src/Plugin/migrate/field/d6/FileField.php
index 87c3bfe..d532ccb 100644
--- a/core/modules/file/src/Plugin/migrate/field/d6/FileField.php
+++ b/core/modules/file/src/Plugin/migrate/field/d6/FileField.php
@@ -42,7 +42,7 @@ class FileField extends FieldPluginBase {
/**
* {@inheritdoc}
*/
- public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
+ public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
$process = [
'plugin' => 'd6_field_file',
'source' => $field_name,
diff --git a/core/modules/file/src/Plugin/migrate/field/d7/FileField.php b/core/modules/file/src/Plugin/migrate/field/d7/FileField.php
index 8157def..8ca9450 100644
--- a/core/modules/file/src/Plugin/migrate/field/d7/FileField.php
+++ b/core/modules/file/src/Plugin/migrate/field/d7/FileField.php
@@ -18,7 +18,7 @@ class FileField extends D6FileField {
/**
* {@inheritdoc}
*/
- public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
+ public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
$process = [
'plugin' => 'sub_process',
'source' => $field_name,
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d6/FileCckTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d6/FileCckTest.php
index 0581c27..43d7959 100644
--- a/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d6/FileCckTest.php
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d6/FileCckTest.php
@@ -33,7 +33,7 @@ class FileCckTest extends UnitTestCase {
$migration = $this->prophesize(MigrationInterface::class);
- // The plugin's processFieldValues() method will call
+ // The plugin's defineValueProcessPipeline() method will call
// mergeProcessOfProperty() and return nothing. So, in order to examine the
// process pipeline created by the plugin, we need to ensure that
// getProcess() always returns the last input to mergeProcessOfProperty().
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/FileCckTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/FileCckTest.php
index 01db93e..e47a5a9 100644
--- a/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/FileCckTest.php
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/FileCckTest.php
@@ -33,7 +33,7 @@ class FileCckTest extends UnitTestCase {
$migration = $this->prophesize(MigrationInterface::class);
- // The plugin's processFieldValues() method will call
+ // The plugin's defineValueProcessPipeline() method will call
// mergeProcessOfProperty() and return nothing. So, in order to examine the
// process pipeline created by the plugin, we need to ensure that
// getProcess() always returns the last input to mergeProcessOfProperty().
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/ImageCckTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/ImageCckTest.php
index 2175c64..b20d3d0 100644
--- a/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/ImageCckTest.php
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/cckfield/d7/ImageCckTest.php
@@ -32,7 +32,7 @@ class ImageCckTest extends UnitTestCase {
$migration = $this->prophesize(MigrationInterface::class);
- // The plugin's processFieldValues() method will call
+ // The plugin's defineValueProcessPipeline() method will call
// mergeProcessOfProperty() and return nothing. So, in order to examine the
// process pipeline created by the plugin, we need to ensure that
// getProcess() always returns the last input to mergeProcessOfProperty().
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldLegacyTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldLegacyTest.php
new file mode 100644
index 0000000..15cfb63
--- /dev/null
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldLegacyTest.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace Drupal\Tests\file\Unit\Plugin\migrate\field\d6;
+
+/**
+ * @coversDefaultClass \Drupal\file\Plugin\migrate\field\d6\FileField
+ * @group legacy
+ * @group file
+ */
+class FileFieldLegacyTest extends FileFieldTest {
+
+ /**
+ * @expectedDeprecation Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use defineValueProcessPipeline() instead. See https://www.drupal.org/node/2944598.
+ */
+ public function testDefineValueProcessPipeline($method = 'processFieldValues') {
+ parent::testDefineValueProcessPipeline($method);
+ }
+
+}
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldTest.php
index 63407c8..176657f 100644
--- a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldTest.php
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d6/FileFieldTest.php
@@ -32,7 +32,7 @@ class FileFieldTest extends UnitTestCase {
$migration = $this->prophesize(MigrationInterface::class);
- // The plugin's processFieldValues() method will call
+ // The plugin's defineValueProcessPipeline() method will call
// mergeProcessOfProperty() and return nothing. So, in order to examine the
// process pipeline created by the plugin, we need to ensure that
// getProcess() always returns the last input to mergeProcessOfProperty().
@@ -44,10 +44,10 @@ class FileFieldTest extends UnitTestCase {
}
/**
- * @covers ::processFieldValues
+ * @covers ::defineValueProcessPipeline
*/
- public function testProcessFieldValues() {
- $this->plugin->processFieldValues($this->migration, 'somefieldname', []);
+ public function testDefineValueProcessPipeline($method = 'defineValueProcessPipeline') {
+ $this->plugin->$method($this->migration, 'somefieldname', []);
$expected = [
'plugin' => 'd6_field_file',
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldLegacyTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldLegacyTest.php
new file mode 100644
index 0000000..72c2fca
--- /dev/null
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldLegacyTest.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace Drupal\Tests\file\Unit\Plugin\migrate\field\d7;
+
+/**
+ * @coversDefaultClass \Drupal\file\Plugin\migrate\field\d7\FileField
+ * @group legacy
+ * @group file
+ */
+class FileFieldLegacyTest extends FileFieldTest {
+
+ /**
+ * @expectedDeprecation Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use defineValueProcessPipeline() instead. See https://www.drupal.org/node/2944598.
+ */
+ public function testDefineValueProcessPipeline($method = 'processFieldValues') {
+ parent::testDefineValueProcessPipeline($method);
+ }
+
+}
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php
index a019647..8e85916 100644
--- a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/FileFieldTest.php
@@ -32,7 +32,7 @@ class FileFieldTest extends UnitTestCase {
$migration = $this->prophesize(MigrationInterface::class);
- // The plugin's processFieldValues() method will call
+ // The plugin's defineValueProcessPipeline() method will call
// mergeProcessOfProperty() and return nothing. So, in order to examine the
// process pipeline created by the plugin, we need to ensure that
// getProcess() always returns the last input to mergeProcessOfProperty().
@@ -44,10 +44,10 @@ class FileFieldTest extends UnitTestCase {
}
/**
- * @covers ::processFieldValues
+ * @covers ::defineValueProcessPipeline
*/
- public function testProcessFieldValues() {
- $this->plugin->processFieldValues($this->migration, 'somefieldname', []);
+ public function testDefineValueProcessPipeline($method = 'defineValueProcessPipeline') {
+ $this->plugin->$method($this->migration, 'somefieldname', []);
$expected = [
'plugin' => 'sub_process',
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldLegacyTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldLegacyTest.php
new file mode 100644
index 0000000..65655e6
--- /dev/null
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldLegacyTest.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace Drupal\Tests\file\Unit\Plugin\migrate\field\d7;
+
+/**
+ * @group legacy
+ * @group file
+ */
+class ImageFieldLegacyTest extends ImageFieldTest {
+
+ /**
+ * @expectedDeprecation Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use defineValueProcessPipeline() instead. See https://www.drupal.org/node/2944598.
+ */
+ public function testDefineValueProcessPipeline($method = 'processFieldValues') {
+ parent::testDefineValueProcessPipeline($method);
+ }
+
+}
diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldTest.php
index 9e9c3fa..ff9d74c 100644
--- a/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldTest.php
+++ b/core/modules/file/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldTest.php
@@ -32,7 +32,7 @@ class ImageFieldTest extends UnitTestCase {
$migration = $this->prophesize(MigrationInterface::class);
- // The plugin's processFieldValues() method will call
+ // The plugin's defineValueProcessPipeline() method will call
// mergeProcessOfProperty() and return nothing. So, in order to examine the
// process pipeline created by the plugin, we need to ensure that
// getProcess() always returns the last input to mergeProcessOfProperty().
@@ -44,11 +44,11 @@ class ImageFieldTest extends UnitTestCase {
}
/**
- * @covers ::processFieldValues
+ * @covers ::defineValueProcessPipeline
* @expectedDeprecation ImageField is deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.x. Use \Drupal\image\Plugin\migrate\field\d7\ImageField instead. See https://www.drupal.org/node/2936061.
*/
- public function testProcessFieldValues() {
- $this->plugin->processFieldValues($this->migration, 'somefieldname', []);
+ public function testDefineValueProcessPipeline($method = 'defineValueProcessPipeline') {
+ $this->plugin->$method($this->migration, 'somefieldname', []);
$expected = [
'plugin' => 'sub_process',
diff --git a/core/modules/image/src/Plugin/migrate/field/d7/ImageField.php b/core/modules/image/src/Plugin/migrate/field/d7/ImageField.php
index 4336c15..1d82925 100644
--- a/core/modules/image/src/Plugin/migrate/field/d7/ImageField.php
+++ b/core/modules/image/src/Plugin/migrate/field/d7/ImageField.php
@@ -18,7 +18,7 @@ class ImageField extends FieldPluginBase {
/**
* {@inheritdoc}
*/
- public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
+ public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
$process = [
'plugin' => 'sub_process',
'source' => $field_name,
diff --git a/core/modules/image/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldTest.php b/core/modules/image/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldTest.php
index 198aa9d..638c4ed 100644
--- a/core/modules/image/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldTest.php
+++ b/core/modules/image/tests/src/Unit/Plugin/migrate/field/d7/ImageFieldTest.php
@@ -10,6 +10,7 @@ use Prophecy\Argument;
/**
* @coversDefaultClass \Drupal\image\Plugin\migrate\field\d7\ImageField
* @group image
+ * @group legacy
*/
class ImageFieldTest extends UnitTestCase {
@@ -44,6 +45,7 @@ class ImageFieldTest extends UnitTestCase {
/**
* @covers ::processFieldValues
+ * @expectedDeprecation Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use defineValueProcessPipeline() instead. See https://www.drupal.org/node/2944598.
*/
public function testProcessFieldValues() {
$this->plugin->processFieldValues($this->migration, 'somefieldname', []);
diff --git a/core/modules/link/src/Plugin/migrate/cckfield/LinkField.php b/core/modules/link/src/Plugin/migrate/cckfield/LinkField.php
index f902987..1a823f5 100644
--- a/core/modules/link/src/Plugin/migrate/cckfield/LinkField.php
+++ b/core/modules/link/src/Plugin/migrate/cckfield/LinkField.php
@@ -29,8 +29,8 @@ class LinkField extends CckFieldPluginBase {
* {@inheritdoc}
*/
public function getFieldFormatterMap() {
- // See d6_field_formatter_settings.yml and CckFieldPluginBase
- // processFieldFormatter().
+ // See d6_field_formatter_settings.yml and FieldPluginBase
+ // alterFieldFormatterMigration().
return [
'default' => 'link',
'plain' => 'link',
diff --git a/core/modules/link/src/Plugin/migrate/cckfield/d7/LinkField.php b/core/modules/link/src/Plugin/migrate/cckfield/d7/LinkField.php
index c4f09f2..a796409 100644
--- a/core/modules/link/src/Plugin/migrate/cckfield/d7/LinkField.php
+++ b/core/modules/link/src/Plugin/migrate/cckfield/d7/LinkField.php
@@ -38,9 +38,9 @@ class LinkField extends D6LinkField {
}
/**
- * {@inheritdoc}
+ * @inheritdoc}
*/
- public function processFieldInstance(MigrationInterface $migration) {
+ public function alterFieldInstanceMigration(MigrationInterface $migration) {
$process = [
'plugin' => 'static_map',
'source' => 'settings/title',
diff --git a/core/modules/link/src/Plugin/migrate/field/d6/LinkField.php b/core/modules/link/src/Plugin/migrate/field/d6/LinkField.php
index 547e492..7c6fe3b 100644
--- a/core/modules/link/src/Plugin/migrate/field/d6/LinkField.php
+++ b/core/modules/link/src/Plugin/migrate/field/d6/LinkField.php
@@ -23,7 +23,7 @@ class LinkField extends FieldPluginBase {
*/
public function getFieldFormatterMap() {
// See d6_field_formatter_settings.yml and FieldPluginBase
- // processFieldFormatter().
+ // alterFieldFormatterMigration().
return [
'default' => 'link',
'plain' => 'link',
@@ -39,7 +39,7 @@ class LinkField extends FieldPluginBase {
/**
* {@inheritdoc}
*/
- public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
+ public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
$process = [
'plugin' => 'field_link',
'source' => $field_name,
diff --git a/core/modules/link/src/Plugin/migrate/field/d7/LinkField.php b/core/modules/link/src/Plugin/migrate/field/d7/LinkField.php
index c9c7f9f..20bf629 100644
--- a/core/modules/link/src/Plugin/migrate/field/d7/LinkField.php
+++ b/core/modules/link/src/Plugin/migrate/field/d7/LinkField.php
@@ -42,7 +42,7 @@ class LinkField extends D6LinkField {
/**
* {@inheritdoc}
*/
- public function processFieldInstance(MigrationInterface $migration) {
+ public function alterFieldInstanceMigration(MigrationInterface $migration) {
$process = [
'plugin' => 'static_map',
'source' => 'settings/title',
diff --git a/core/modules/link/tests/src/Kernel/Plugin/migrate/cckfield/d7/LinkCckDeprecationTest.php b/core/modules/link/tests/src/Kernel/Plugin/migrate/cckfield/d7/LinkCckDeprecationTest.php
new file mode 100644
index 0000000..97a3892
--- /dev/null
+++ b/core/modules/link/tests/src/Kernel/Plugin/migrate/cckfield/d7/LinkCckDeprecationTest.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace Drupal\Tests\link\Kernel\Plugin\migrate\cckfield\d7;
+
+/**
+ * @group link
+ * @group legacy
+ */
+class LinkCckDeprecationTest extends LinkCckTest {
+
+ /**
+ * @expectedDeprecation Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use alterFieldInstanceMigration() instead. See https://www.drupal.org/node/2944598.
+ */
+ public function testAlterFieldInstanceMigration($method = 'processFieldInstance') {
+ parent::testAlterFieldInstanceMigration($method);
+ }
+
+}
diff --git a/core/modules/link/tests/src/Kernel/Plugin/migrate/cckfield/d7/LinkCckTest.php b/core/modules/link/tests/src/Kernel/Plugin/migrate/cckfield/d7/LinkCckTest.php
index 14345a6..d1e55d1 100644
--- a/core/modules/link/tests/src/Kernel/Plugin/migrate/cckfield/d7/LinkCckTest.php
+++ b/core/modules/link/tests/src/Kernel/Plugin/migrate/cckfield/d7/LinkCckTest.php
@@ -39,7 +39,7 @@ class LinkCckTest extends KernelTestBase {
$migration = $this->prophesize(MigrationInterface::class);
- // The plugin's processFieldInstance() method will call
+ // The plugin's alterFieldInstanceMigration() method will call
// mergeProcessOfProperty() and return nothing. So, in order to examine the
// process pipeline created by the plugin, we need to ensure that
// getProcess() always returns the last input to mergeProcessOfProperty().
@@ -52,12 +52,10 @@ class LinkCckTest extends KernelTestBase {
}
/**
- * @covers ::processCckFieldValues
- * @expectedDeprecation CckFieldPluginBase is deprecated in Drupal 8.3.x and will be be removed before Drupal 9.0.x. Use \Drupal\migrate_drupal\Plugin\migrate\field\FieldPluginBase instead.
- * @expectedDeprecation MigrateCckFieldInterface is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. Use \Drupal\migrate_drupal\Annotation\MigrateField instead.
+ * @covers ::alterFieldInstanceMigration
*/
- public function testProcessCckFieldValues() {
- $this->plugin->processFieldInstance($this->migration);
+ public function testAlterFieldInstanceMigration($method = 'alterFieldInstanceMigration') {
+ $this->plugin->$method($this->migration);
$expected = [
'plugin' => 'static_map',
diff --git a/core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldLegacyTest.php b/core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldLegacyTest.php
new file mode 100644
index 0000000..149442e
--- /dev/null
+++ b/core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldLegacyTest.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace Drupal\Tests\link\Kernel\Plugin\migrate\field\d7;
+
+/**
+ * @group legacy
+ * @group link
+ */
+class LinkFieldLegacyTest extends LinkFieldTest {
+
+ /**
+ * @expectedDeprecation Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use alterFieldInstanceMigration() instead. See https://www.drupal.org/node/2944598.
+ */
+ public function testAlterFieldInstanceMigration($method = 'processFieldInstance') {
+ parent::testAlterFieldInstanceMigration($method);
+ }
+
+}
diff --git a/core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldTest.php b/core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldTest.php
index 494aa02..37789dc 100644
--- a/core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldTest.php
+++ b/core/modules/link/tests/src/Kernel/Plugin/migrate/field/d7/LinkFieldTest.php
@@ -38,7 +38,7 @@ class LinkFieldTest extends KernelTestBase {
$migration = $this->prophesize(MigrationInterface::class);
- // The plugin's ProcessFieldInstance() method will call
+ // The plugin's alterFieldInstanceMigration() method will call
// mergeProcessOfProperty() and return nothing. So, in order to examine the
// process pipeline created by the plugin, we need to ensure that
// getProcess() always returns the last input to mergeProcessOfProperty().
@@ -51,10 +51,10 @@ class LinkFieldTest extends KernelTestBase {
}
/**
- * @covers ::processFieldInstance
+ * @covers ::alterFieldInstanceMigration
*/
- public function testProcessFieldInstance() {
- $this->plugin->processFieldInstance($this->migration);
+ public function testAlterFieldInstanceMigration($method = 'alterFieldInstanceMigration') {
+ $this->plugin->$method($this->migration);
$expected = [
'plugin' => 'static_map',
diff --git a/core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldLegacyTest.php b/core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldLegacyTest.php
new file mode 100644
index 0000000..7e7be8e
--- /dev/null
+++ b/core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldLegacyTest.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace Drupal\Tests\link\Unit\Plugin\migrate\field\d6;
+
+/**
+ * @group legacy
+ * @group link
+ */
+class LinkFieldLegacyTest extends LinkFieldTest {
+
+ /**
+ * @expectedDeprecation Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use defineValueProcessPipeline() instead. See https://www.drupal.org/node/2944598.
+ */
+ public function testDefineValueProcessPipeline($method = 'processFieldValues') {
+ parent::testDefineValueProcessPipeline($method);
+ }
+
+}
diff --git a/core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldTest.php b/core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldTest.php
index 0dbc741..a4c86db 100644
--- a/core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldTest.php
+++ b/core/modules/link/tests/src/Unit/Plugin/migrate/field/d6/LinkFieldTest.php
@@ -31,7 +31,7 @@ class LinkFieldTest extends UnitTestCase {
$migration = $this->prophesize(MigrationInterface::class);
- // The plugin's processFieldValues() method will call
+ // The plugin's defineValueProcessPipeline() method will call
// mergeProcessOfProperty() and return nothing. So, in order to examine the
// process pipeline created by the plugin, we need to ensure that
// getProcess() always returns the last input to mergeProcessOfProperty().
@@ -44,10 +44,10 @@ class LinkFieldTest extends UnitTestCase {
}
/**
- * @covers ::processFieldValues
+ * @covers ::defineValueProcessPipeline
*/
- public function testProcessFieldValues() {
- $this->plugin->processFieldValues($this->migration, 'somefieldname', []);
+ public function testDefineValueProcessPipeline($method = 'defineValueProcessPipeline') {
+ $this->plugin->$method($this->migration, 'somefieldname', []);
$expected = [
'plugin' => 'field_link',
diff --git a/core/modules/migrate_drupal/src/Plugin/MigrateFieldInterface.php b/core/modules/migrate_drupal/src/Plugin/MigrateFieldInterface.php
index 2aac5d1..96ed53e 100644
--- a/core/modules/migrate_drupal/src/Plugin/MigrateFieldInterface.php
+++ b/core/modules/migrate_drupal/src/Plugin/MigrateFieldInterface.php
@@ -17,7 +17,7 @@ interface MigrateFieldInterface extends PluginInspectionInterface {
* @param \Drupal\migrate\Plugin\MigrationInterface $migration
* The migration entity.
*/
- public function processField(MigrationInterface $migration);
+ public function alterFieldMigration(MigrationInterface $migration);
/**
* Apply any custom processing to the field instance migration.
@@ -25,7 +25,7 @@ interface MigrateFieldInterface extends PluginInspectionInterface {
* @param \Drupal\migrate\Plugin\MigrationInterface $migration
* The migration entity.
*/
- public function processFieldInstance(MigrationInterface $migration);
+ public function alterFieldInstanceMigration(MigrationInterface $migration);
/**
* Apply any custom processing to the field widget migration.
@@ -33,7 +33,7 @@ interface MigrateFieldInterface extends PluginInspectionInterface {
* @param \Drupal\migrate\Plugin\MigrationInterface $migration
* The migration entity.
*/
- public function processFieldWidget(MigrationInterface $migration);
+ public function alterFieldWidgetMigration(MigrationInterface $migration);
/**
* Apply any custom processing to the field formatter migration.
@@ -41,7 +41,7 @@ interface MigrateFieldInterface extends PluginInspectionInterface {
* @param \Drupal\migrate\Plugin\MigrationInterface $migration
* The migration entity.
*/
- public function processFieldFormatter(MigrationInterface $migration);
+ public function alterFieldFormatterMigration(MigrationInterface $migration);
/**
* Get the field formatter type from the source.
@@ -57,7 +57,7 @@ interface MigrateFieldInterface extends PluginInspectionInterface {
/**
* Get a map between D6 formatters and D8 formatters for this field type.
*
- * This is used by static::processFieldFormatter() in the base class.
+ * This is used by static::alterFieldFormatterMigration() in the base class.
*
* @return array
* The keys are D6 formatters and the values are D8 formatters.
@@ -93,7 +93,7 @@ interface MigrateFieldInterface extends PluginInspectionInterface {
* @param array $data
* The array of field data from FieldValues::fieldData().
*/
- public function processFieldValues(MigrationInterface $migration, $field_name, $data);
+ public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data);
/**
* Computes the destination type of a migrated field.
diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php b/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php
index 220c8bb..80ad6fa 100644
--- a/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php
+++ b/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php
@@ -21,16 +21,9 @@ use Drupal\migrate_drupal\Plugin\MigrateCckFieldInterface;
abstract class CckFieldPluginBase extends FieldPluginBase implements MigrateCckFieldInterface {
/**
- * Apply any custom processing to the field bundle migrations.
- *
- * @param \Drupal\migrate\Plugin\MigrationInterface $migration
- * The migration entity.
- * @param string $field_name
- * The field name we're processing the value for.
- * @param array $data
- * The array of field data from FieldValues::fieldData().
+ * {@inheritdoc}
*/
- public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
+ public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
// Provide a bridge to the old method declared on the interface and now an
// abstract method in this class.
return $this->processCckFieldValues($migration, $field_name, $data);
diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/field/FieldPluginBase.php b/core/modules/migrate_drupal/src/Plugin/migrate/field/FieldPluginBase.php
index dc115ab..7827470 100644
--- a/core/modules/migrate_drupal/src/Plugin/migrate/field/FieldPluginBase.php
+++ b/core/modules/migrate_drupal/src/Plugin/migrate/field/FieldPluginBase.php
@@ -20,24 +20,66 @@ use Drupal\migrate_drupal\Plugin\MigrateFieldInterface;
abstract class FieldPluginBase extends PluginBase implements MigrateFieldInterface {
/**
- * {@inheritdoc}
+ * Alters the migration for field definitions.
+ *
+ * @deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use
+ * alterFieldMigration() instead.
+ *
+ * @see https://www.drupal.org/node/2944598
+ * @see ::alterFieldMigration()
*/
public function processField(MigrationInterface $migration) {
+ @trigger_error('Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use alterFieldMigration() instead. See https://www.drupal.org/node/2944598.', E_USER_DEPRECATED);
+ $this->alterFieldMigration($migration);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function alterFieldMigration(MigrationInterface $migration) {
$process[0]['map'][$this->pluginId][$this->pluginId] = $this->pluginId;
$migration->mergeProcessOfProperty('type', $process);
}
/**
- * {@inheritdoc}
+ * Alert field instance migration.
+ *
+ * @deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use
+ * alterFieldInstanceMigration() instead.
+ *
+ * @see https://www.drupal.org/node/2944598
+ * @see ::alterFieldInstanceMigration()
*/
public function processFieldInstance(MigrationInterface $migration) {
- // Nothing to do by default with field instances.
+ @trigger_error('Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use alterFieldInstanceMigration() instead. See https://www.drupal.org/node/2944598.', E_USER_DEPRECATED);
+ $this->alterFieldInstanceMigration($migration);
}
/**
* {@inheritdoc}
*/
+ public function alterFieldInstanceMigration(MigrationInterface $migration) {
+ // Nothing to do by default with field instances.
+ }
+
+ /**
+ * Alter field widget migration.
+ *
+ * @deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use
+ * alterFieldWidgetMigration() instead.
+ *
+ * @see https://www.drupal.org/node/2944598
+ * @see ::alterFieldWidgetMigration()
+ */
public function processFieldWidget(MigrationInterface $migration) {
+ @trigger_error('Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use alterFieldWidgetMigration() instead. See https://www.drupal.org/node/2944598.', E_USER_DEPRECATED);
+ $this->alterFieldWidgetMigration($migration);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function alterFieldWidgetMigration(MigrationInterface $migration) {
$process = [];
foreach ($this->getFieldWidgetMap() as $source_widget => $destination_widget) {
$process['type']['map'][$source_widget] = $destination_widget;
@@ -77,11 +119,24 @@ abstract class FieldPluginBase extends PluginBase implements MigrateFieldInterfa
}
/**
- * {@inheritdoc}
+ * Alter field formatter migration.
+ *
+ * @deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use
+ * alterFieldFormatterMigration() instead.
+ *
+ * @see https://www.drupal.org/node/2944598
+ * @see ::processFieldFormatter()
*/
public function processFieldFormatter(MigrationInterface $migration) {
- $process = [];
+ @trigger_error('Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use alterFieldFormatterMigration() instead. See https://www.drupal.org/node/2944598.', E_USER_DEPRECATED);
+ $this->alterFieldFormatterMigration($migration);
+ }
+ /**
+ * {@inheritdoc}
+ */
+ public function alterFieldFormatterMigration(MigrationInterface $migration) {
+ $process = [];
// Some migrate field plugin IDs are prefixed with 'd6_' or 'd7_'. Since the
// plugin ID is used in the static map as the module name, we have to remove
// this prefix from the plugin ID.
@@ -93,9 +148,23 @@ abstract class FieldPluginBase extends PluginBase implements MigrateFieldInterfa
}
/**
- * {@inheritdoc}
+ * Defines the process pipeline for field values.
+ *
+ * @deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use
+ * defineValueProcessPipeline() instead.
+ *
+ * @see https://www.drupal.org/node/2944598
+ * @see ::defineValueProcessPipeline()
*/
public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
+ @trigger_error('Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use defineValueProcessPipeline() instead. See https://www.drupal.org/node/2944598.', E_USER_DEPRECATED);
+ return $this->defineValueProcessPipeline($migration, $field_name, $data);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
$process = [
'plugin' => 'get',
'source' => $field_name,
diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/field/NodeReference.php b/core/modules/migrate_drupal/src/Plugin/migrate/field/NodeReference.php
index d8b756b..de8c4f5 100644
--- a/core/modules/migrate_drupal/src/Plugin/migrate/field/NodeReference.php
+++ b/core/modules/migrate_drupal/src/Plugin/migrate/field/NodeReference.php
@@ -20,7 +20,7 @@ class NodeReference extends FieldPluginBase {
/**
* {@inheritdoc}
*/
- public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
+ public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
$process = [
'plugin' => 'sub_process',
'source' => $field_name,
diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/field/UserReference.php b/core/modules/migrate_drupal/src/Plugin/migrate/field/UserReference.php
index b42d94c..4a60f45 100644
--- a/core/modules/migrate_drupal/src/Plugin/migrate/field/UserReference.php
+++ b/core/modules/migrate_drupal/src/Plugin/migrate/field/UserReference.php
@@ -20,7 +20,7 @@ class UserReference extends FieldPluginBase {
/**
* {@inheritdoc}
*/
- public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
+ public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
$process = [
'plugin' => 'sub_process',
'source' => $field_name,
diff --git a/core/modules/node/src/Plugin/migrate/D6NodeDeriver.php b/core/modules/node/src/Plugin/migrate/D6NodeDeriver.php
index 536303e..94c759b 100644
--- a/core/modules/node/src/Plugin/migrate/D6NodeDeriver.php
+++ b/core/modules/node/src/Plugin/migrate/D6NodeDeriver.php
@@ -165,7 +165,7 @@ class D6NodeDeriver extends DeriverBase implements ContainerDeriverInterface {
$this->fieldPluginCache[$field_type] = $this->fieldPluginManager->createInstance($plugin_id, ['core' => 6], $migration);
}
$this->fieldPluginCache[$field_type]
- ->processFieldValues($migration, $field_name, $info);
+ ->defineValueProcessPipeline($migration, $field_name, $info);
}
catch (PluginNotFoundException $ex) {
try {
diff --git a/core/modules/node/src/Plugin/migrate/D7NodeDeriver.php b/core/modules/node/src/Plugin/migrate/D7NodeDeriver.php
index 28c61b8..25099cf 100644
--- a/core/modules/node/src/Plugin/migrate/D7NodeDeriver.php
+++ b/core/modules/node/src/Plugin/migrate/D7NodeDeriver.php
@@ -168,7 +168,7 @@ class D7NodeDeriver extends DeriverBase implements ContainerDeriverInterface {
$this->fieldPluginCache[$field_type] = $this->fieldPluginManager->createInstance($plugin_id, ['core' => 7], $migration);
}
$this->fieldPluginCache[$field_type]
- ->processFieldValues($migration, $field_name, $info);
+ ->defineValueProcessPipeline($migration, $field_name, $info);
}
catch (PluginNotFoundException $ex) {
try {
diff --git a/core/modules/taxonomy/src/Plugin/migrate/D7TaxonomyTermDeriver.php b/core/modules/taxonomy/src/Plugin/migrate/D7TaxonomyTermDeriver.php
index 561a9af..566cf3b 100644
--- a/core/modules/taxonomy/src/Plugin/migrate/D7TaxonomyTermDeriver.php
+++ b/core/modules/taxonomy/src/Plugin/migrate/D7TaxonomyTermDeriver.php
@@ -137,7 +137,7 @@ class D7TaxonomyTermDeriver extends DeriverBase implements ContainerDeriverInter
$this->fieldPluginCache[$field_type] = $this->fieldPluginManager->createInstance($plugin_id, ['core' => 7], $migration);
}
$this->fieldPluginCache[$field_type]
- ->processFieldValues($migration, $field_name, $info);
+ ->defineValueProcessPipeline($migration, $field_name, $info);
}
catch (PluginNotFoundException $ex) {
try {
diff --git a/core/modules/taxonomy/src/Plugin/migrate/field/TaxonomyTermReference.php b/core/modules/taxonomy/src/Plugin/migrate/field/TaxonomyTermReference.php
index bea9a3f..1fa80d2 100644
--- a/core/modules/taxonomy/src/Plugin/migrate/field/TaxonomyTermReference.php
+++ b/core/modules/taxonomy/src/Plugin/migrate/field/TaxonomyTermReference.php
@@ -30,7 +30,7 @@ class TaxonomyTermReference extends FieldPluginBase {
/**
* {@inheritdoc}
*/
- public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
+ public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
$process = [
'plugin' => 'sub_process',
'source' => $field_name,
diff --git a/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/cckfield/TaxonomyTermReferenceCckLegacyTest.php b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/cckfield/TaxonomyTermReferenceCckLegacyTest.php
new file mode 100644
index 0000000..003185a
--- /dev/null
+++ b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/cckfield/TaxonomyTermReferenceCckLegacyTest.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace Drupal\Tests\taxonomy\Unit\Plugin\migrate\cckfield;
+
+/**
+ * @group taxonomy
+ * @group legacy
+ */
+class TaxonomyTermReferenceCckLegacyTest extends TaxonomyTermReferenceCckTest {
+
+ /**
+ * @expectedDeprecation Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use defineValueProcessPipeline() instead. See https://www.drupal.org/node/2944598.
+ */
+ public function testDefineValueProcessPipeline($method = 'processFieldValues') {
+ parent::testDefineValueProcessPipeline($method);
+ }
+
+}
diff --git a/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/cckfield/TaxonomyTermReferenceCckTest.php b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/cckfield/TaxonomyTermReferenceCckTest.php
index 437fd67..48af568 100644
--- a/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/cckfield/TaxonomyTermReferenceCckTest.php
+++ b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/cckfield/TaxonomyTermReferenceCckTest.php
@@ -44,11 +44,15 @@ class TaxonomyTermReferenceCckTest extends UnitTestCase {
$this->migration = $migration->reveal();
}
+ public function testProcessCckFieldValues() {
+ $this->testDefineValueProcessPipeline('processCckFieldValues');
+ }
+
/**
- * @covers ::processCckFieldValues
+ * @covers ::defineValueProcessPipeline
*/
- public function testProcessCckFieldValues() {
- $this->plugin->processFieldValues($this->migration, 'somefieldname', []);
+ public function testDefineValueProcessPipeline($method = 'defineValueProcessPipeline') {
+ $this->plugin->$method($this->migration, 'somefieldname', []);
$expected = [
'plugin' => 'sub_process',
diff --git a/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldLegacyTest.php b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldLegacyTest.php
new file mode 100644
index 0000000..60b1cab
--- /dev/null
+++ b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldLegacyTest.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace Drupal\Tests\taxonomy\Unit\Plugin\migrate\field;
+
+/**
+ * @group taxonomy
+ * @group legacy
+ */
+class TaxonomyTermReferenceFieldLegacyTest extends TaxonomyTermReferenceFieldTest {
+
+ /**
+ * @expectedDeprecation Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use defineValueProcessPipeline() instead. See https://www.drupal.org/node/2944598.
+ */
+ public function testDefineValueProcessPipeline($method = 'processFieldValues') {
+ parent::testDefineValueProcessPipeline($method);
+ }
+
+}
diff --git a/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php
index 8422293..5b7ec3e 100644
--- a/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php
+++ b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php
@@ -31,7 +31,7 @@ class TaxonomyTermReferenceFieldTest extends UnitTestCase {
$migration = $this->prophesize(MigrationInterface::class);
- // The plugin's processFieldValues() method will call
+ // The plugin's defineValueProcessPipeline() method will call
// setProcessOfProperty() and return nothing. So, in order to examine the
// process pipeline created by the plugin, we need to ensure that
// getProcess() always returns the last input to setProcessOfProperty().
@@ -44,10 +44,10 @@ class TaxonomyTermReferenceFieldTest extends UnitTestCase {
}
/**
- * @covers ::processFieldValues
+ * @covers ::defineValueProcessPipeline
*/
- public function testProcessFieldValues() {
- $this->plugin->processFieldValues($this->migration, 'somefieldname', []);
+ public function testDefineValueProcessPipeline($method = 'defineValueProcessPipeline') {
+ $this->plugin->$method($this->migration, 'somefieldname', []);
$expected = [
'plugin' => 'sub_process',
diff --git a/core/modules/text/src/Plugin/migrate/field/d6/TextField.php b/core/modules/text/src/Plugin/migrate/field/d6/TextField.php
index aa324b6..dba6398 100644
--- a/core/modules/text/src/Plugin/migrate/field/d6/TextField.php
+++ b/core/modules/text/src/Plugin/migrate/field/d6/TextField.php
@@ -44,7 +44,7 @@ class TextField extends FieldPluginBase {
/**
* {@inheritdoc}
*/
- public function processFieldValues(MigrationInterface $migration, $field_name, $field_info) {
+ public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $field_info) {
$widget_type = isset($field_info['widget_type']) ? $field_info['widget_type'] : $field_info['widget']['type'];
if ($widget_type == 'optionwidgets_onoff') {
diff --git a/core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php b/core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php
index e17404e..807b9f1 100644
--- a/core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php
+++ b/core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php
@@ -33,7 +33,7 @@ class TextFieldTest extends UnitTestCase {
$migration = $this->prophesize(MigrationInterface::class);
- // The plugin's processFieldValues() method will call
+ // The plugin's defineValueProcessPipeline() method will call
// setProcessOfProperty() and return nothing. So, in order to examine the
// process pipeline created by the plugin, we need to ensure that
// getProcess() always returns the last input to setProcessOfProperty().
@@ -46,7 +46,11 @@ class TextFieldTest extends UnitTestCase {
}
/**
+ * Calls the deprecated processFieldValues() method to test BC.
+ *
* @covers ::processFieldValues
+ *
+ * @depends testFilteredTextValueProcessPipeline
*/
public function testProcessFilteredTextFieldValues() {
$field_info = [
@@ -69,7 +73,34 @@ class TextFieldTest extends UnitTestCase {
}
/**
+ * @covers ::defineValueProcessPipeline
+ */
+ public function testFilteredTextValueProcessPipeline() {
+ $field_info = [
+ 'widget_type' => 'text_textfield',
+ ];
+ $this->plugin->defineValueProcessPipeline($this->migration, 'body', $field_info);
+
+ $process = $this->migration->getProcess();
+ $this->assertSame('sub_process', $process['plugin']);
+ $this->assertSame('body', $process['source']);
+ $this->assertSame('value', $process['process']['value']);
+
+ // Ensure that filter format IDs will be looked up in the filter format
+ // migrations.
+ $lookup = $process['process']['format'][2];
+ $this->assertSame('migration', $lookup['plugin']);
+ $this->assertContains('d6_filter_format', $lookup['migration']);
+ $this->assertContains('d7_filter_format', $lookup['migration']);
+ $this->assertSame('format', $lookup['source']);
+ }
+
+ /**
+ * Calls the deprecated processFieldValues() method to test BC.
+ *
* @covers ::processFieldValues
+ *
+ * @depends testBooleanTextImplicitValueProcessPipeline
*/
public function testProcessBooleanTextImplicitValues() {
$info = [
@@ -94,7 +125,36 @@ class TextFieldTest extends UnitTestCase {
}
/**
+ * @covers ::defineValueProcessPipeline
+ */
+ public function testBooleanTextImplicitValueProcessPipeline() {
+ $info = [
+ 'widget_type' => 'optionwidgets_onoff',
+ 'global_settings' => [
+ 'allowed_values' => "foo\nbar",
+ ],
+ ];
+ $this->plugin->defineValueProcessPipeline($this->migration, 'field', $info);
+
+ $expected = [
+ 'value' => [
+ 'plugin' => 'static_map',
+ 'source' => 'value',
+ 'default_value' => 0,
+ 'map' => [
+ 'bar' => 1,
+ ],
+ ],
+ ];
+ $this->assertSame($expected, $this->migration->getProcess()['process']);
+ }
+
+ /**
+ * Calls the deprecated processFieldValues() method to test BC.
+ *
* @covers ::processFieldValues
+ *
+ * @depends testBooleanTextExplicitValueProcessPipeline
*/
public function testProcessBooleanTextExplicitValues() {
$info = [
@@ -119,6 +179,31 @@ class TextFieldTest extends UnitTestCase {
}
/**
+ * @covers ::defineValueProcessPipeline
+ */
+ public function testBooleanTextExplicitValueProcessPipeline() {
+ $info = [
+ 'widget_type' => 'optionwidgets_onoff',
+ 'global_settings' => [
+ 'allowed_values' => "foo|Foo\nbaz|Baz",
+ ],
+ ];
+ $this->plugin->defineValueProcessPipeline($this->migration, 'field', $info);
+
+ $expected = [
+ 'value' => [
+ 'plugin' => 'static_map',
+ 'source' => 'value',
+ 'default_value' => 0,
+ 'map' => [
+ 'baz' => 1,
+ ],
+ ],
+ ];
+ $this->assertSame($expected, $this->migration->getProcess()['process']);
+ }
+
+ /**
* Data provider for testGetFieldType().
*/
public function getFieldTypeProvider() {
diff --git a/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldLegacyTest.php b/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldLegacyTest.php
new file mode 100644
index 0000000..d30844b
--- /dev/null
+++ b/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldLegacyTest.php
@@ -0,0 +1,36 @@
+<?php
+
+namespace Drupal\Tests\text\Unit\Plugin\migrate\field\d6;
+
+/**
+ * @coversDefaultClass \Drupal\text\Plugin\migrate\field\d6\TextField
+ * @group text
+ * @group legacy
+ */
+class TextFieldLegacyTest extends TextFieldTest {
+
+ /**
+ * @covers ::processFieldValues
+ * @expectedDeprecation Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use defineValueProcessPipeline() instead. See https://www.drupal.org/node/2944598.
+ */
+ public function testProcessFilteredTextFieldValues($method = 'processFieldValues') {
+ parent::testProcessFilteredTextFieldValues($method);
+ }
+
+ /**
+ * @covers ::processFieldValues
+ * @expectedDeprecation Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use defineValueProcessPipeline() instead. See https://www.drupal.org/node/2944598.
+ */
+ public function testProcessBooleanTextImplicitValues($method = 'processFieldValues') {
+ parent::testProcessBooleanTextImplicitValues($method);
+ }
+
+ /**
+ * @covers ::processFieldValues
+ * @expectedDeprecation Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use defineValueProcessPipeline() instead. See https://www.drupal.org/node/2944598.
+ */
+ public function testProcessBooleanTextExplicitValues($method = 'processFieldValues') {
+ parent::testProcessBooleanTextExplicitValues($method);
+ }
+
+}
diff --git a/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php b/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php
index 4cc1bad..c6970f4 100644
--- a/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php
+++ b/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php
@@ -32,7 +32,7 @@ class TextFieldTest extends UnitTestCase {
$migration = $this->prophesize(MigrationInterface::class);
- // The plugin's processFieldValues() method will call
+ // The plugin's defineValueProcessPipeline() method will call
// setProcessOfProperty() and return nothing. So, in order to examine the
// process pipeline created by the plugin, we need to ensure that
// getProcess() always returns the last input to setProcessOfProperty().
@@ -45,13 +45,13 @@ class TextFieldTest extends UnitTestCase {
}
/**
- * @covers ::processFieldValues
+ * @covers ::defineValueProcessPipeline
*/
- public function testProcessFilteredTextFieldValues() {
+ public function testProcessFilteredTextFieldValues($method = 'defineValueProcessPipeline') {
$field_info = [
'widget_type' => 'text_textfield',
];
- $this->plugin->processFieldValues($this->migration, 'body', $field_info);
+ $this->plugin->$method($this->migration, 'body', $field_info);
$process = $this->migration->getProcess();
$this->assertSame('sub_process', $process['plugin']);
@@ -68,16 +68,16 @@ class TextFieldTest extends UnitTestCase {
}
/**
- * @covers ::processFieldValues
+ * @covers ::defineValueProcessPipeline
*/
- public function testProcessBooleanTextImplicitValues() {
+ public function testProcessBooleanTextImplicitValues($method = 'defineValueProcessPipeline') {
$info = [
'widget_type' => 'optionwidgets_onoff',
'global_settings' => [
'allowed_values' => "foo\nbar",
],
];
- $this->plugin->processFieldValues($this->migration, 'field', $info);
+ $this->plugin->$method($this->migration, 'field', $info);
$expected = [
'value' => [
@@ -93,16 +93,16 @@ class TextFieldTest extends UnitTestCase {
}
/**
- * @covers ::processFieldValues
+ * @covers ::defineValueProcessPipeline
*/
- public function testProcessBooleanTextExplicitValues() {
+ public function testProcessBooleanTextExplicitValues($method = 'defineValueProcessPipeline') {
$info = [
'widget_type' => 'optionwidgets_onoff',
'global_settings' => [
'allowed_values' => "foo|Foo\nbaz|Baz",
],
];
- $this->plugin->processFieldValues($this->migration, 'field', $info);
+ $this->plugin->$method($this->migration, 'field', $info);
$expected = [
'value' => [
diff --git a/core/modules/user/src/Plugin/migrate/User.php b/core/modules/user/src/Plugin/migrate/User.php
index 5316259..d918932 100644
--- a/core/modules/user/src/Plugin/migrate/User.php
+++ b/core/modules/user/src/Plugin/migrate/User.php
@@ -37,7 +37,7 @@ class User extends FieldMigration {
}
$info = $row->getSource();
$this->fieldPluginCache[$field_type]
- ->processFieldValues($this, $field_name, $info);
+ ->defineValueProcessPipeline($this, $field_name, $info);
}
else {
if ($this->cckPluginManager->hasDefinition($field_type)) {