diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FileUriTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FileUriTest.php index bfbdc32..78d5082 100644 --- a/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FileUriTest.php +++ b/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FileUriTest.php @@ -70,7 +70,7 @@ public function testTemporary() { protected function doTransform(array $value) { $executable = new MigrateExecutable($this->getMigration(), new MigrateMessage()); - $row = new Row([], []); + $row = new Row(); return (new FileUri([], 'file_uri', [])) ->transform($value, $executable, $row, 'foobaz'); diff --git a/core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterIdTest.php b/core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterIdTest.php index 39e4037..1206734 100644 --- a/core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterIdTest.php +++ b/core/modules/filter/tests/src/Kernel/Plugin/migrate/process/FilterIdTest.php @@ -71,7 +71,7 @@ public function test($value, $expected_value, $invalid_id = NULL) { ); } - $row = new Row([], []); + $row = new Row(); $output_value = $plugin->transform($value, $this->executable, $row, 'foo'); $this->assertSame($expected_value, $output_value); diff --git a/core/modules/migrate/src/Row.php b/core/modules/migrate/src/Row.php index 94cb8b2..ea70acd 100644 --- a/core/modules/migrate/src/Row.php +++ b/core/modules/migrate/src/Row.php @@ -91,7 +91,7 @@ class Row { * @throws \InvalidArgumentException * Thrown when a source ID property does not exist. */ - public function __construct(array $values, array $source_ids, $is_stub = FALSE) { + public function __construct(array $values = [], array $source_ids = [], $is_stub = FALSE) { $this->source = $values; $this->sourceIds = $source_ids; $this->isStub = $is_stub; diff --git a/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php b/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php index 352b660..54ded16 100644 --- a/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php @@ -123,7 +123,7 @@ public function testTranslated() { // Import some rows. foreach ($destination_rows as $idx => $destination_row) { - $row = new Row([], []); + $row = new Row(); foreach ($destination_row as $key => $value) { $row->setDestinationProperty($key, $value); } diff --git a/core/modules/migrate/tests/src/Kernel/process/CopyFileTest.php b/core/modules/migrate/tests/src/Kernel/process/CopyFileTest.php index 53ada1d..42c3f04 100644 --- a/core/modules/migrate/tests/src/Kernel/process/CopyFileTest.php +++ b/core/modules/migrate/tests/src/Kernel/process/CopyFileTest.php @@ -172,7 +172,7 @@ public function testRenameFile() { protected function doImport($source_path, $destination_path, $configuration = []) { $plugin = FileCopy::create($this->container, $configuration, 'file_copy', []); $executable = $this->prophesize(MigrateExecutableInterface::class)->reveal(); - $row = new Row([], []); + $row = new Row(); $result = $plugin->transform([$source_path, $destination_path], $executable, $row, 'foobaz'); diff --git a/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php b/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php index 84c97f2..60809a9 100644 --- a/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php +++ b/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php @@ -398,7 +398,7 @@ public function testProcessRow() { ->method('getProcessPlugins') ->with(NULL) ->will($this->returnValue($plugins)); - $row = new Row(array(), array()); + $row = new Row(); $this->executable->processRow($row); foreach ($expected as $key => $value) { $this->assertSame($row->getDestinationProperty($key), $value); @@ -414,7 +414,7 @@ public function testProcessRowEmptyPipeline() { ->method('getProcessPlugins') ->with(NULL) ->will($this->returnValue(array('test' => array()))); - $row = new Row(array(), array()); + $row = new Row(); $this->executable->processRow($row); $this->assertSame($row->getDestination(), array()); } diff --git a/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php b/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php index db8313e..4a462e9 100644 --- a/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php +++ b/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php @@ -286,7 +286,7 @@ public function testPrepareRow() { // Get a new migration with an id. $migration = $this->getMigration(); $source = new StubSourcePlugin([], '', [], $migration); - $row = new Row([], []); + $row = new Row(); $module_handler = $this->prophesize(ModuleHandlerInterface::class); $module_handler->invokeAll('migrate_prepare_row', [$row, $source, $migration]) @@ -328,7 +328,7 @@ public function testPrepareRowGlobalPrepareSkip() { $migration = $this->getMigration(); $source = new StubSourcePlugin([], '', [], $migration); - $row = new Row([], []); + $row = new Row(); $module_handler = $this->prophesize(ModuleHandlerInterface::class); // Return a failure from a prepare row hook. @@ -357,7 +357,7 @@ public function testPrepareRowMigratePrepareSkip() { $migration = $this->getMigration(); $source = new StubSourcePlugin([], '', [], $migration); - $row = new Row([], []); + $row = new Row(); $module_handler = $this->prophesize(ModuleHandlerInterface::class); // Return a failure from a prepare row hook. @@ -386,7 +386,7 @@ public function testPrepareRowPrepareException() { $migration = $this->getMigration(); $source = new StubSourcePlugin([], '', [], $migration); - $row = new Row([], []); + $row = new Row(); $module_handler = $this->prophesize(ModuleHandlerInterface::class); // Return a failure from a prepare row hook. diff --git a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php index 33aec58..c9b3d11 100644 --- a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php +++ b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php @@ -74,7 +74,7 @@ public function testImport() { ->willReturn(5); $destination->setEntity($entity->reveal()); // Ensure the id is saved entity id is returned from import. - $this->assertEquals([5], $destination->import(new Row([], []))); + $this->assertEquals([5], $destination->import(new Row())); // Assert that import set the rollback action. $this->assertEquals(MigrateIdMapInterface::ROLLBACK_DELETE, $destination->rollbackAction()); } @@ -95,7 +95,7 @@ public function testImportEntityLoadFailure() { $this->entityManager->reveal(), $this->prophesize(FieldTypePluginManagerInterface::class)->reveal()); $destination->setEntity(FALSE); - $destination->import(new Row([], [])); + $destination->import(new Row); } /** diff --git a/core/modules/migrate/tests/src/Unit/RowTest.php b/core/modules/migrate/tests/src/Unit/RowTest.php index 96c27ea..ec04f82 100644 --- a/core/modules/migrate/tests/src/Unit/RowTest.php +++ b/core/modules/migrate/tests/src/Unit/RowTest.php @@ -49,7 +49,7 @@ class RowTest extends UnitTestCase { * Tests object creation: empty. */ public function testRowWithoutData() { - $row = new Row(array(), array()); + $row = new Row(); $this->assertSame(array(), $row->getSource(), 'Empty row'); } diff --git a/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php b/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php index f1e288e..1886914 100644 --- a/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php +++ b/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php @@ -67,7 +67,7 @@ public function testGetEntityDestinationValues() { $this->storage->loadRevision(12) ->shouldBeCalled() ->willReturn($entity->reveal()); - $row = new Row([], []); + $row = new Row(); $this->assertEquals($entity->reveal(), $destination->getEntity($row, [12, 13])); } diff --git a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php index 1be14bc..4782dc0 100644 --- a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php +++ b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php @@ -29,7 +29,7 @@ public function testImport() { 'field_name' => 'field_name_test', 'options' => array('test setting'), ); - $row = new Row(array(), array()); + $row = new Row(); foreach ($values as $key => $value) { $row->setDestinationProperty($key, $value); } diff --git a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php index 18df362..50cdbf6 100644 --- a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php +++ b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php @@ -29,7 +29,7 @@ public function testImport() { 'field_name' => 'field_name_test', 'options' => array('test setting'), ); - $row = new Row(array(), array()); + $row = new Row(); foreach ($values as $key => $value) { $row->setDestinationProperty($key, $value); } diff --git a/core/modules/migrate/tests/src/Unit/process/IteratorTest.php b/core/modules/migrate/tests/src/Unit/process/IteratorTest.php index 7c731a2..cdffac0 100644 --- a/core/modules/migrate/tests/src/Unit/process/IteratorTest.php +++ b/core/modules/migrate/tests/src/Unit/process/IteratorTest.php @@ -67,7 +67,7 @@ public function testIterator() { ), ); // This is not used but the interface requires it, so create an empty row. - $row = new Row(array(), array()); + $row = new Row(); // After transformation, check to make sure that source_foo and source_id's // values ended up in the proper destinations, and that the value of the diff --git a/core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php b/core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php index 539858f..78d89a1 100644 --- a/core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php +++ b/core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php @@ -57,7 +57,7 @@ public function testUrls($input, $output) { */ protected function doTransform($value) { $executable = new MigrateExecutable($this->getMigration(), new MigrateMessage()); - $row = new Row([], []); + $row = new Row(); return (new UrlEncode([], 'urlencode', [])) ->transform($value, $executable, $row, 'foobaz');