Skip to content

Commit

Permalink
Change the format of missing requirements message for migrate source …
Browse files Browse the repository at this point in the history
…plugins (drush-ops#5051).
  • Loading branch information
Matroskeen committed Jan 29, 2022
1 parent 4700fec commit 2ef70f0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Drupal/Commands/core/MigrateRunnerCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ protected function getMigrationList(?string $migrationIds, ?string $tags): array
$sourcePlugin->checkRequirements();
}
} catch (RequirementsException $exception) {
$this->logger()->debug("Migration '$migrationId' is skipped as its source plugin has missed requirements: {$exception->getRequirementsString()}");
$this->logger()->debug("Migration '$migrationId' is skipped as its source plugin has missed requirements: {$exception->getMessage()}");
unset($migrations[$migrationId]);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function getIds(): array

public function checkRequirements(): array
{
throw new RequirementsException('message', [
throw new RequirementsException('Requirements message.', [
'type1' => ['a', 'b', 'c'],
'type2' => ['x', 'y', 'z'],
]);
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/MigrateRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function testMigrateStatus(): void

// Debug message registered for 'test_migration_source_issues'.
// @see \Drush\Drupal\Commands\core\MigrateRunnerCommands::getMigrationList()
$this->assertStringContainsString("[debug] Migration 'test_migration_source_issues' is skipped as its source plugin has missed requirements: type1: a. type1: b. type1: c. type2: x. type2: y. type2: z.", $this->getErrorOutputRaw());
$this->assertStringContainsString("[debug] Migration 'test_migration_source_issues' is skipped as its source plugin has missed requirements: Requirements message.", $this->getErrorOutputRaw());

// With arguments.
$this->drush(
Expand Down

0 comments on commit 2ef70f0

Please sign in to comment.