diff --git a/UPGRADING.md b/UPGRADING.md index e31f4d5a..9acb91b0 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -131,6 +131,29 @@ the missing behaviour themselves. Test the capability with `instanceof ContentCapabilityInterface` (or the relevant capability interface) before calling. +### DrushDriver no longer detects legacy Drush + +`DrushDriver` used to probe `drush version` during `bootstrap()` and cache the +answer in a `protected static bool $isLegacyDrush` to pick between Drush 8 and +Drush 9+ behaviour. Drupal `^10 || ^11` requires Drush 11 or newer, so the +Drush 8 branches were unreachable. Both the probe and the flag are gone: + +- `DrushDriver::isLegacyDrush()` (protected) - removed. +- `DrushDriver::$isLegacyDrush` (protected static) - removed. + +The behaviour they gated is now unconditional: + +- `drushResult()` always passes `--no-ansi`. The Drush 8 `--nocolor` spelling + is never emitted. +- `cacheClear()` always takes the `cache:rebuild` path. A `'drush'` type still + short-circuits to `cache-clear drush`. +- `bootstrap()` no longer shells out to Drush; it only flips the bootstrapped + flag. + +Subclasses that overrode `isLegacyDrush()` or read `static::$isLegacyDrush` +must drop those overrides. Sites that still run Drush 8 are on Drupal 9 or +earlier and belong on the 2.x line. + ### CoreInterface expanded `Drupal\Driver\Core\CoreInterface` now extends every capability interface in diff --git a/tests/Drupal/Tests/Driver/Unit/DrushDriverTest.php b/tests/Drupal/Tests/Driver/Unit/DrushDriverTest.php index dc3c99dd..c1cde667 100644 --- a/tests/Drupal/Tests/Driver/Unit/DrushDriverTest.php +++ b/tests/Drupal/Tests/Driver/Unit/DrushDriverTest.php @@ -101,22 +101,10 @@ public static function dataProviderParseUserId(): \Iterator { } /** - * Testable subclass that stubs the 'drush()' method. + * Testable subclass that exposes protected helpers. */ class TestDrushDriver extends DrushDriver { - /** - * The output to return from 'drush()'. - */ - public string $drushOutput = ''; - - /** - * {@inheritdoc} - */ - public function drush($command, array $arguments = [], array $options = []): string { - return $this->drushOutput; - } - /** * Exposes 'parseUserId()' for testing. */