Draft: [TEST] #3638148 Rector composer-based phpunit set + Drupal set

Part of #3638148: testing whether running Rector's composer-based sets on a Drupal codebase breaks Drupal.

Do not merge. This is a test MR. Generated with Rector 2.8.4 + palantirnet/drupal-rector dev-main, using rector-3638148/rector-phpunit-drupal.php from the 3638148-rector-tooling branch (paths: core/, skip list taken from core/phpstan.neon.dist excludePaths).

Update: this branch now runs the PHPUnit set together with drupal-rector's composer-based Drupal set, the way a Drupal site would combine them. That applies drupal-rector's skips for rules known to break Drupal (palantirnet/drupal-rector#449, #452, #453, #456). Earlier pipelines on this MR ran the PHPUnit set alone; compare them in the Pipelines tab.

The first commit makes the lint jobs non-blocking in .gitlab-ci.yml, so the test jobs run even when PHPCS/phpstan fail. Each further commit applies one Rector rule and lists the files it changed. The last commit adds the full dry-run output as JSON. To rebuild the branch, see rector-3638148/README.md on the tooling branch.

Result

66 files changed by 3 rules: GetMockBuilderGetMockToCreateMockRector, AllowMockObjectsForDataProviderRector, ExpressionCreateMockToCreateStubRector.

Skipped by drupal-rector, so no longer applied:

  • AddDoesNotPerformAssertionToNonAssertingTestRector (68 risky tests; rectorphp/rector#9965, fix rectorphp/rector-phpunit#822)
  • CreateStubOverCreateMockArgRector (stubs that get expects() later; rectorphp/rector#9966)

Expected to still fail: ExpressionCreateMockToCreateStubRector turns the mocks in RecipeConfigStorageWrapperTest::testCreateCollection() into stubs, although they get expects() through a foreach alias (same bug family as rectorphp/rector#9966).

Edited by Björn Brala

Merge request reports

Loading
Loading