GetDrupalRootToRootPropertyRector
Replace deprecated DrupalTestCaseTrait::getDrupalRoot() calls with $this->root property access in Drupal test classes.
-$dir = $this->getDrupalRoot() . '/core/tests/fixtures';
+$dir = $this->root . '/core/tests/fixtures';
Configure your rector.php:
<?php
use DrupalRector\Drupal11\Rector\Deprecation\GetDrupalRootToRootPropertyRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
GetDrupalRootToRootPropertyRector::class,
]);