Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Change the format of missing requirements message for migrate source plugins (#5051). #5052

Draft
wants to merge 1 commit into
base: 11.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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