From 71424c7b562619b4321f47b98128b9d93b76cbd2 Mon Sep 17 00:00:00 2001 From: "Theresa.Grannum" <theresa.grannum@3688861.no-reply.drupal.org> Date: Tue, 24 May 2022 20:22:22 +0000 Subject: [PATCH] Issue #3274837 by Theresa.Grannum: Remove "recommended" from text of version validators --- src/Validator/VersionPolicy/ForbidMinorUpdates.php | 2 +- src/Validator/VersionPolicy/MajorVersionMatch.php | 2 +- src/Validator/VersionPolicy/MinorUpdatesEnabled.php | 2 +- .../VersionPolicy/TargetSecurityRelease.php | 2 +- src/Validator/VersionPolicy/TargetVersionStable.php | 2 +- .../VersionPolicyValidatorTest.php | 12 ++++++------ .../Unit/VersionPolicy/ForbidMinorUpdatesTest.php | 13 +++++++------ .../Unit/VersionPolicy/MajorVersionMatchTest.php | 4 ++-- .../Unit/VersionPolicy/MinorUpdatesEnabledTest.php | 12 ++++++------ .../VersionPolicy/TargetSecurityReleaseTest.php | 2 +- .../Unit/VersionPolicy/TargetVersionStableTest.php | 8 ++++---- 11 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/Validator/VersionPolicy/ForbidMinorUpdates.php b/src/Validator/VersionPolicy/ForbidMinorUpdates.php index 86327d4161..83e5cfe6de 100644 --- a/src/Validator/VersionPolicy/ForbidMinorUpdates.php +++ b/src/Validator/VersionPolicy/ForbidMinorUpdates.php @@ -35,7 +35,7 @@ class ForbidMinorUpdates { if ($installed_minor !== $target_minor) { return [ - $this->t('Drupal cannot be automatically updated from its current version, @installed_version, to the recommended version, @target_version, because automatic updates from one minor version to another are not supported during cron.', [ + $this->t('Drupal cannot be automatically updated from @installed_version to @target_version because automatic updates from one minor version to another are not supported during cron.', [ '@installed_version' => $installed_version, '@target_version' => $target_version, ]), diff --git a/src/Validator/VersionPolicy/MajorVersionMatch.php b/src/Validator/VersionPolicy/MajorVersionMatch.php index 58709075b7..378251ac18 100644 --- a/src/Validator/VersionPolicy/MajorVersionMatch.php +++ b/src/Validator/VersionPolicy/MajorVersionMatch.php @@ -36,7 +36,7 @@ class MajorVersionMatch { if ($installed_major !== $target_major) { return [ - $this->t('Drupal cannot be automatically updated from its current version, @installed_version, to the recommended version, @target_version, because automatic updates from one major version to another are not supported.', [ + $this->t('Drupal cannot be automatically updated from @installed_version to @target_version because automatic updates from one major version to another are not supported.', [ '@installed_version' => $installed_version, '@target_version' => $target_version, ]), diff --git a/src/Validator/VersionPolicy/MinorUpdatesEnabled.php b/src/Validator/VersionPolicy/MinorUpdatesEnabled.php index 52f6fd80e1..6ce2042cab 100644 --- a/src/Validator/VersionPolicy/MinorUpdatesEnabled.php +++ b/src/Validator/VersionPolicy/MinorUpdatesEnabled.php @@ -74,7 +74,7 @@ class MinorUpdatesEnabled implements ContainerInjectionInterface { if (!$minor_updates_allowed) { return [ - $this->t('Drupal cannot be automatically updated from its current version, @installed_version, to the recommended version, @target_version, because automatic updates from one minor version to another are not supported.', [ + $this->t('Drupal cannot be automatically updated from @installed_version to @target_version because automatic updates from one minor version to another are not supported.', [ '@installed_version' => $installed_version, '@target_version' => $target_version, ]), diff --git a/src/Validator/VersionPolicy/TargetSecurityRelease.php b/src/Validator/VersionPolicy/TargetSecurityRelease.php index 4ac64316a1..b209e52b9b 100644 --- a/src/Validator/VersionPolicy/TargetSecurityRelease.php +++ b/src/Validator/VersionPolicy/TargetSecurityRelease.php @@ -32,7 +32,7 @@ class TargetSecurityRelease { public function validate(string $installed_version, ?string $target_version, array $available_releases): array { if (!$available_releases[$target_version]->isSecurityRelease()) { return [ - $this->t('Drupal cannot be automatically updated during cron from its current version, @installed_version, to the recommended version, @target_version, because @target_version is not a security release.', [ + $this->t('Drupal cannot be automatically updated during cron from @installed_version to @target_version because @target_version is not a security release.', [ '@installed_version' => $installed_version, '@target_version' => $target_version, ]), diff --git a/src/Validator/VersionPolicy/TargetVersionStable.php b/src/Validator/VersionPolicy/TargetVersionStable.php index 787bd477d6..64d61473f0 100644 --- a/src/Validator/VersionPolicy/TargetVersionStable.php +++ b/src/Validator/VersionPolicy/TargetVersionStable.php @@ -34,7 +34,7 @@ class TargetVersionStable { if ($extra) { return [ - $this->t('Drupal cannot be automatically updated during cron to the recommended version, @target_version, because Automatic Updates only supports updating to stable versions during cron.', [ + $this->t('Drupal cannot be automatically updated during cron to @target_version, because Automatic Updates only supports updating to stable versions during cron.', [ '@target_version' => $target_version, ]), ]; diff --git a/tests/src/Kernel/ReadinessValidation/VersionPolicyValidatorTest.php b/tests/src/Kernel/ReadinessValidation/VersionPolicyValidatorTest.php index 15d01b7841..97bcf17920 100644 --- a/tests/src/Kernel/ReadinessValidation/VersionPolicyValidatorTest.php +++ b/tests/src/Kernel/ReadinessValidation/VersionPolicyValidatorTest.php @@ -116,7 +116,7 @@ class VersionPolicyValidatorTest extends AutomaticUpdatesKernelTestBase { [CronUpdater::SECURITY], [ $this->createValidationResult('9.8.1', '9.8.2', [ - 'Drupal cannot be automatically updated during cron from its current version, 9.8.1, to the recommended version, 9.8.2, because 9.8.2 is not a security release.', + 'Drupal cannot be automatically updated during cron from 9.8.1 to 9.8.2 because 9.8.2 is not a security release.', ]), ], ], @@ -236,7 +236,7 @@ class VersionPolicyValidatorTest extends AutomaticUpdatesKernelTestBase { ['drupal' => '9.8.2'], [ $this->createValidationResult('8.9.1', '9.8.2', [ - 'Drupal cannot be automatically updated from its current version, 8.9.1, to the recommended version, 9.8.2, because automatic updates from one major version to another are not supported.', + 'Drupal cannot be automatically updated from 8.9.1 to 9.8.2 because automatic updates from one major version to another are not supported.', ]), ], ], @@ -273,7 +273,7 @@ class VersionPolicyValidatorTest extends AutomaticUpdatesKernelTestBase { ['drupal' => '9.8.2'], [ $this->createValidationResult('9.8.1', '9.8.2', [ - 'Drupal cannot be automatically updated during cron from its current version, 9.8.1, to the recommended version, 9.8.2, because 9.8.2 is not a security release.', + 'Drupal cannot be automatically updated during cron from 9.8.1 to 9.8.2 because 9.8.2 is not a security release.', ]), ], ], @@ -296,7 +296,7 @@ class VersionPolicyValidatorTest extends AutomaticUpdatesKernelTestBase { ['drupal' => '9.8.2'], [ $this->createValidationResult('9.7.9', '9.8.2', [ - 'Drupal cannot be automatically updated from its current version, 9.7.9, to the recommended version, 9.8.2, because automatic updates from one minor version to another are not supported during cron.', + 'Drupal cannot be automatically updated from 9.7.9 to 9.8.2 because automatic updates from one minor version to another are not supported during cron.', ]), ], ], @@ -308,7 +308,7 @@ class VersionPolicyValidatorTest extends AutomaticUpdatesKernelTestBase { ['drupal' => '9.8.2'], [ $this->createValidationResult('9.7.9', '9.8.2', [ - 'Drupal cannot be automatically updated from its current version, 9.7.9, to the recommended version, 9.8.2, because automatic updates from one minor version to another are not supported.', + 'Drupal cannot be automatically updated from 9.7.9 to 9.8.2 because automatic updates from one minor version to another are not supported.', ]), ], ], @@ -341,7 +341,7 @@ class VersionPolicyValidatorTest extends AutomaticUpdatesKernelTestBase { ['drupal' => '9.8.1-beta1'], [ $this->createValidationResult('9.8.0', '9.8.1-beta1', [ - 'Drupal cannot be automatically updated during cron to the recommended version, 9.8.1-beta1, because Automatic Updates only supports updating to stable versions during cron.', + 'Drupal cannot be automatically updated during cron to 9.8.1-beta1, because Automatic Updates only supports updating to stable versions during cron.', ]), ], ], diff --git a/tests/src/Unit/VersionPolicy/ForbidMinorUpdatesTest.php b/tests/src/Unit/VersionPolicy/ForbidMinorUpdatesTest.php index 28cb73b9be..889c7614d2 100644 --- a/tests/src/Unit/VersionPolicy/ForbidMinorUpdatesTest.php +++ b/tests/src/Unit/VersionPolicy/ForbidMinorUpdatesTest.php @@ -41,32 +41,33 @@ class ForbidMinorUpdatesTest extends UnitTestCase { 'target version in older minor' => [ '9.8.0', '9.7.2', - ['Drupal cannot be automatically updated from its current version, 9.8.0, to the recommended version, 9.7.2, because automatic updates from one minor version to another are not supported during cron.'], + ['Drupal cannot be automatically updated from 9.8.0 to 9.7.2 because automatic updates from one minor version to another are not supported during cron.'], ], + 'target version in newer minor' => [ '9.8.0', '9.9.2', - ['Drupal cannot be automatically updated from its current version, 9.8.0, to the recommended version, 9.9.2, because automatic updates from one minor version to another are not supported during cron.'], + ['Drupal cannot be automatically updated from 9.8.0 to 9.9.2 because automatic updates from one minor version to another are not supported during cron.'], ], 'target version in older major' => [ '9.8.0', '8.8.0', - ['Drupal cannot be automatically updated from its current version, 9.8.0, to the recommended version, 8.8.0, because automatic updates from one minor version to another are not supported during cron.'], + ['Drupal cannot be automatically updated from 9.8.0 to 8.8.0 because automatic updates from one minor version to another are not supported during cron.'], ], 'target version in newer major' => [ '9.8.0', '10.8.0', - ['Drupal cannot be automatically updated from its current version, 9.8.0, to the recommended version, 10.8.0, because automatic updates from one minor version to another are not supported during cron.'], + ['Drupal cannot be automatically updated from 9.8.0 to 10.8.0 because automatic updates from one minor version to another are not supported during cron.'], ], 'target version in older major and minor' => [ '9.8.0', '8.9.9', - ['Drupal cannot be automatically updated from its current version, 9.8.0, to the recommended version, 8.9.9, because automatic updates from one minor version to another are not supported during cron.'], + ['Drupal cannot be automatically updated from 9.8.0 to 8.9.9 because automatic updates from one minor version to another are not supported during cron.'], ], 'target version in newer major and minor' => [ '9.8.0', '10.9.2', - ['Drupal cannot be automatically updated from its current version, 9.8.0, to the recommended version, 10.9.2, because automatic updates from one minor version to another are not supported during cron.'], + ['Drupal cannot be automatically updated from 9.8.0 to 10.9.2 because automatic updates from one minor version to another are not supported during cron.'], ], ]; } diff --git a/tests/src/Unit/VersionPolicy/MajorVersionMatchTest.php b/tests/src/Unit/VersionPolicy/MajorVersionMatchTest.php index f7b10afc45..c01842ba0d 100644 --- a/tests/src/Unit/VersionPolicy/MajorVersionMatchTest.php +++ b/tests/src/Unit/VersionPolicy/MajorVersionMatchTest.php @@ -51,12 +51,12 @@ class MajorVersionMatchTest extends UnitTestCase { 'target version in newer major' => [ '9.8.0', '10.0.0', - ['Drupal cannot be automatically updated from its current version, 9.8.0, to the recommended version, 10.0.0, because automatic updates from one major version to another are not supported.'], + ['Drupal cannot be automatically updated from 9.8.0 to 10.0.0 because automatic updates from one major version to another are not supported.'], ], 'target version in older major' => [ '9.8.0', '8.9.0', - ['Drupal cannot be automatically updated from its current version, 9.8.0, to the recommended version, 8.9.0, because automatic updates from one major version to another are not supported.'], + ['Drupal cannot be automatically updated from 9.8.0 to 8.9.0 because automatic updates from one major version to another are not supported.'], ], ]; } diff --git a/tests/src/Unit/VersionPolicy/MinorUpdatesEnabledTest.php b/tests/src/Unit/VersionPolicy/MinorUpdatesEnabledTest.php index be9616a7f1..89579dc2df 100644 --- a/tests/src/Unit/VersionPolicy/MinorUpdatesEnabledTest.php +++ b/tests/src/Unit/VersionPolicy/MinorUpdatesEnabledTest.php @@ -51,7 +51,7 @@ class MinorUpdatesEnabledTest extends UnitTestCase { FALSE, '9.8.0', '9.9.2', - ['Drupal cannot be automatically updated from its current version, 9.8.0, to the recommended version, 9.9.2, because automatic updates from one minor version to another are not supported.'], + ['Drupal cannot be automatically updated from 9.8.0 to 9.9.2 because automatic updates from one minor version to another are not supported.'], ], 'target version in newer minor, minor updates allowed' => [ TRUE, @@ -75,7 +75,7 @@ class MinorUpdatesEnabledTest extends UnitTestCase { FALSE, '9.8.0', '9.7.2', - ['Drupal cannot be automatically updated from its current version, 9.8.0, to the recommended version, 9.7.2, because automatic updates from one minor version to another are not supported.'], + ['Drupal cannot be automatically updated from 9.8.0 to 9.7.2 because automatic updates from one minor version to another are not supported.'], ], 'target version in older minor, minor updates allowed' => [ TRUE, @@ -87,25 +87,25 @@ class MinorUpdatesEnabledTest extends UnitTestCase { FALSE, '9.8.0', '8.8.0', - ['Drupal cannot be automatically updated from its current version, 9.8.0, to the recommended version, 8.8.0, because automatic updates from one minor version to another are not supported.'], + ['Drupal cannot be automatically updated from 9.8.0 to 8.8.0 because automatic updates from one minor version to another are not supported.'], ], 'target version in older major, minor updates allowed' => [ FALSE, '9.8.0', '8.8.0', - ['Drupal cannot be automatically updated from its current version, 9.8.0, to the recommended version, 8.8.0, because automatic updates from one minor version to another are not supported.'], + ['Drupal cannot be automatically updated from 9.8.0 to 8.8.0 because automatic updates from one minor version to another are not supported.'], ], 'target version in newer major, minor updates forbidden' => [ FALSE, '9.8.0', '10.8.0', - ['Drupal cannot be automatically updated from its current version, 9.8.0, to the recommended version, 10.8.0, because automatic updates from one minor version to another are not supported.'], + ['Drupal cannot be automatically updated from 9.8.0 to 10.8.0 because automatic updates from one minor version to another are not supported.'], ], 'target version in newer major, minor updates allowed' => [ FALSE, '9.8.0', '10.8.0', - ['Drupal cannot be automatically updated from its current version, 9.8.0, to the recommended version, 10.8.0, because automatic updates from one minor version to another are not supported.'], + ['Drupal cannot be automatically updated from 9.8.0 to 10.8.0 because automatic updates from one minor version to another are not supported.'], ], ]; } diff --git a/tests/src/Unit/VersionPolicy/TargetSecurityReleaseTest.php b/tests/src/Unit/VersionPolicy/TargetSecurityReleaseTest.php index 386a8e4fdd..da1e31e7f9 100644 --- a/tests/src/Unit/VersionPolicy/TargetSecurityReleaseTest.php +++ b/tests/src/Unit/VersionPolicy/TargetSecurityReleaseTest.php @@ -45,7 +45,7 @@ class TargetSecurityReleaseTest extends UnitTestCase { 'version' => '9.8.1', ]), ], - ['Drupal cannot be automatically updated during cron from its current version, 9.8.0, to the recommended version, 9.8.1, because 9.8.1 is not a security release.'], + ['Drupal cannot be automatically updated during cron from 9.8.0 to 9.8.1 because 9.8.1 is not a security release.'], ], ]; } diff --git a/tests/src/Unit/VersionPolicy/TargetVersionStableTest.php b/tests/src/Unit/VersionPolicy/TargetVersionStableTest.php index 81fd98f44a..ef6f3e2a82 100644 --- a/tests/src/Unit/VersionPolicy/TargetVersionStableTest.php +++ b/tests/src/Unit/VersionPolicy/TargetVersionStableTest.php @@ -29,19 +29,19 @@ class TargetVersionStableTest extends UnitTestCase { ], 'dev target version' => [ '9.9.0-dev', - ['Drupal cannot be automatically updated during cron to the recommended version, 9.9.0-dev, because Automatic Updates only supports updating to stable versions during cron.'], + ['Drupal cannot be automatically updated during cron to 9.9.0-dev, because Automatic Updates only supports updating to stable versions during cron.'], ], 'alpha target version' => [ '9.9.0-alpha3', - ['Drupal cannot be automatically updated during cron to the recommended version, 9.9.0-alpha3, because Automatic Updates only supports updating to stable versions during cron.'], + ['Drupal cannot be automatically updated during cron to 9.9.0-alpha3, because Automatic Updates only supports updating to stable versions during cron.'], ], 'beta target version' => [ '9.9.0-beta7', - ['Drupal cannot be automatically updated during cron to the recommended version, 9.9.0-beta7, because Automatic Updates only supports updating to stable versions during cron.'], + ['Drupal cannot be automatically updated during cron to 9.9.0-beta7, because Automatic Updates only supports updating to stable versions during cron.'], ], 'release candidate target version' => [ '9.9.0-rc2', - ['Drupal cannot be automatically updated during cron to the recommended version, 9.9.0-rc2, because Automatic Updates only supports updating to stable versions during cron.'], + ['Drupal cannot be automatically updated during cron to 9.9.0-rc2, because Automatic Updates only supports updating to stable versions during cron.'], ], ]; } -- GitLab