Skip to content

Commit

Permalink
8.2.0
Browse files Browse the repository at this point in the history
- Updated contrib modules and patch (#56)
  • Loading branch information
pookmish authored May 2, 2022
2 parents ab1e9cf + 8ab1e97 commit 5f32a58
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 9 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Stanford Migrate


8.x-2.0
--------------------------------------------------------------------------------
_Release Date: 2022-05-02_

- Updated contrib modules and patch (#56)
- Lock migrate_plus to 5.2 (#55)


8.x-1.24
--------------------------------------------------------------------------------
_Release Date: 2022-04-05_
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
],
"require": {
"drupal/migrate_file": "^2.0",
"drupal/migrate_plus": "^5.0",
"drupal/migrate_plus": "^6.0",
"drupal/migrate_source_csv": "^3.4",
"drupal/migrate_tools": "^5.0",
"drupal/migrate_tools": "^6.0",
"drupal/readonly_field_widget": "^1.4",
"drupal/ultimate_cron": "^2.0@alpha",
"joshfraser/php-name-parser": "dev-master"
Expand All @@ -29,7 +29,7 @@
"patches": {
"drupal/migrate_plus": {
"https://www.drupal.org/project/migrate_plus/issues/2837684": "https://www.drupal.org/files/issues/2837684-8-migrate-plus-xml-return-as-xml.patch",
"https://www.drupal.org/project/migrate_plus/issues/3050058": "https://www.drupal.org/files/issues/2022-01-03/3050058-9-item-selector-missing.patch"
"https://www.drupal.org/project/migrate_plus/issues/3050058": "https://git.drupalcode.org/project/migrate_plus/-/merge_requests/59.patch"
}
}
},
Expand Down
6 changes: 3 additions & 3 deletions src/StanfordMigrateBatchExecutable.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class StanfordMigrateBatchExecutable extends MigrateBatchExecutable {
/**
* {@inheritdoc}
*/
public function batchImport() {
public function batchImport(): void {
// Create the batch operations for each migration that needs to be executed.
// This includes the migration for this executable, but also the dependent
// migrations.
Expand All @@ -46,7 +46,7 @@ public function batchImport() {
/**
* {@inheritdoc}
*/
protected function batchOperations(array $migrations, $operation, array $options = []) {
protected function batchOperations(array $migrations, $operation, array $options = []): array {
array_walk($migrations, [$this, 'prepareMigrations']);
$operations = parent::batchOperations($migrations, $operation, $options);
foreach ($operations as &$operation) {
Expand Down Expand Up @@ -77,7 +77,7 @@ protected function prepareMigrations(MigrationInterface $migration) {
/**
* {@inheritdoc}
*/
public static function batchProcessImport($migration_id, array $options, &$context) {
public static function batchProcessImport($migration_id, array $options, &$context): void {
if (empty($context['sandbox'])) {
$context['finished'] = 0;
$context['sandbox'] = [];
Expand Down
2 changes: 1 addition & 1 deletion stanford_migrate.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: 'Adds more functionality to migrate and migrate plus modules'
type: module
core_version_requirement: ^8.8 || ^9 || ^10
package: 'Stanford'
version: 8.x-1.24
version: 8.x-2.0
dependencies:
- drupal:migrate
- migrate_plus:migrate_plus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\stanford_migrate\Plugin\migrate\process\EntityGenerateNoLookup;
use Drupal\migrate\MigrateExecutable;
Expand Down Expand Up @@ -37,9 +38,14 @@ public function testTranform() {
$entity_storage->method('create')
->willReturn($entity);

$entity_definition = $this->createMock(EntityTypeInterface::class);
$entity_definition->method('getKey')->willReturn('foo');

$entity_type_manager = $this->createMock(EntityTypeManagerInterface::class);
$entity_type_manager->method('getStorage')
->willReturn($entity_storage);
$entity_type_manager->method('getDefinition')
->willReturn($entity_definition);

$field_manager = $this->createMock(EntityFieldManagerInterface::class);

Expand All @@ -48,9 +54,11 @@ public function testTranform() {
$container->set('plugin.manager.entity_reference_selection', $this->createMock(SelectionPluginManagerInterface::class));
$container->set('plugin.manager.migrate.process', $this->createMock(MigratePluginManager::class));

$destination_plugin = $this->createMock(MigrateDestinationInterface::class);
$destination_plugin->method('getPluginId')->willReturn('foo:bar');
$migration = $this->createMock(MigrationInterface::class);
$migration->method('getDestinationPlugin')
->willReturn($this->createMock(MigrateDestinationInterface::class));
->willReturn($destination_plugin);
$configuration = [
'entity_type' => 'type',
'value_key' => 'key',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Drupal\Core\Entity\EntityFieldManagerInterface;
use Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Entity\RevisionableInterface;
use Drupal\stanford_migrate\Plugin\migrate\process\EntityGenerateNoLookup;
Expand Down Expand Up @@ -40,9 +41,14 @@ public function testTranform() {
->willReturn($entity);
$entity_storage->method('load')->willReturn($entity);

$entity_definition = $this->createMock(EntityTypeInterface::class);
$entity_definition->method('getKey')->willReturn('foo');

$entity_type_manager = $this->createMock(EntityTypeManagerInterface::class);
$entity_type_manager->method('getStorage')
->willReturn($entity_storage);
$entity_type_manager->method('getDefinition')
->willReturn($entity_definition);

$field_manager = $this->createMock(EntityFieldManagerInterface::class);

Expand All @@ -51,9 +57,12 @@ public function testTranform() {
$container->set('plugin.manager.entity_reference_selection', $this->createMock(SelectionPluginManagerInterface::class));
$container->set('plugin.manager.migrate.process', $this->createMock(MigratePluginManager::class));

$destination_plugin = $this->createMock(MigrateDestinationInterface::class);
$destination_plugin->method('getPluginId')->willReturn('foo:bar');

$migration = $this->createMock(MigrationInterface::class);
$migration->method('getDestinationPlugin')
->willReturn($this->createMock(MigrateDestinationInterface::class));
->willReturn($destination_plugin);
$configuration = [
'entity_type' => 'type',
'value_key' => 'key',
Expand Down

0 comments on commit 5f32a58

Please sign in to comment.