diff -u b/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 --- b/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 @@ -56,7 +56,7 @@ $this->assertSame($expected, $this->migration->getProcess()); } - /* + /** * Data provider for testGetFieldType(). */ public function getFieldTypeProvider() { diff -u b/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 --- b/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 @@ -61,7 +61,7 @@ $this->assertSame($expected, $this->migration->getProcess()); } - /* + /** * Data provider for testGetFieldType(). */ public function getFieldTypeProvider() { diff -u b/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 --- b/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 @@ -56,7 +56,7 @@ $this->assertSame($expected, $this->migration->getProcess()); } - /* + /** * Data provider for testGetFieldType(). */ public function getFieldTypeProvider() { diff -u b/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 --- b/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 @@ -61,7 +61,7 @@ $this->assertSame($expected, $this->migration->getProcess()); } - /* + /** * Data provider for testGetFieldType(). */ public function getFieldTypeProvider() { only in patch2: unchanged: --- /dev/null +++ b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/cckfield/TaxonomyTermReferenceCckTest.php @@ -0,0 +1,62 @@ +plugin = new TaxonomyTermReference([], 'text', []); + + $migration = $this->prophesize(MigrationInterface::class); + + // The plugin's processFieldValues() 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(). + $migration->setProcessOfProperty(Argument::type('string'), Argument::type('array')) + ->will(function($arguments) use ($migration) { + $migration->getProcess()->willReturn($arguments[1]); + }); + + $this->migration = $migration->reveal(); + } + + /** + * @covers ::processFieldValues + */ + public function testProcessCckFieldValues() { + $this->plugin->processFieldValues($this->migration, 'somefieldname', []); + + $expected = [ + 'plugin' => 'iterator', + 'source' => 'somefieldname', + 'process' => [ + 'target_id' => 'tid', + ], + ]; + $this->assertSame($expected, $this->migration->getProcess()); + } + +} only in patch2: unchanged: --- /dev/null +++ b/core/modules/taxonomy/tests/src/Unit/Plugin/migrate/field/TaxonomyTermReferenceFieldTest.php @@ -0,0 +1,62 @@ +plugin = new TaxonomyTermReference([], 'text', []); + + $migration = $this->prophesize(MigrationInterface::class); + + // The plugin's processFieldValues() 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(). + $migration->setProcessOfProperty(Argument::type('string'), Argument::type('array')) + ->will(function($arguments) use ($migration) { + $migration->getProcess()->willReturn($arguments[1]); + }); + + $this->migration = $migration->reveal(); + } + + /** + * @covers ::processFieldValues + */ + public function testProcessCckFieldValues() { + $this->plugin->processFieldValues($this->migration, 'somefieldname', []); + + $expected = [ + 'plugin' => 'iterator', + 'source' => 'somefieldname', + 'process' => [ + 'target_id' => 'tid', + ], + ]; + $this->assertSame($expected, $this->migration->getProcess()); + } + +}