Skip to content

feat(bridge-rector): convert #[Skip] in all three directions - #340

Merged
roxblnfk merged 2 commits into
1.xfrom
feat/rector-skip-attribute
Sep 18, 2026
Merged

roxblnfk merged 2 commits into
1.xfrom
feat/rector-skip-attribute

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

🔍 What was changed

  • #[Skip] now converts in all three bridge directions instead of passing through untouched — until now it reached PHPUnit unchanged, where it does nothing and the test would simply have run.
  • Testo → PHPUnit unrolls the attribute into the leading markTestSkipped() call PHPUnit has instead, fanning a class-level attribute onto each test method and dropping it from the class.
  • PHPUnit → Testo and Pest → Testo produce the attribute wherever the source is unconditional: a markTestSkipped('literal') opening a test method, and Pest's ->skip('reason') modifier, which previously became a prepended throw.
  • Everything that cannot be declared stays a SkipTest throw: a guarded call, one deeper in the body, a non-literal message, and a markTestSkipped() opening setUp().

Why?

A user-facing attribute needs a conversion counterpart in the bridge, and #[Skip] had none.

Checklist

Documentation

FEATURE_PARITY.md, the three TODO.md residual lists and the migration skill's PHPUnit map are updated in the same change.

A user-facing attribute needs a conversion counterpart in the bridge, and `#[Skip]` had none: it passed through to PHPUnit unchanged, where it does nothing and the test would have run.

Testo -> PHPUnit unrolls the attribute into the leading `markTestSkipped()` call PHPUnit has instead, fanning a class-level attribute onto each test method. Both reverse directions now produce the attribute where the source is unconditional — a `markTestSkipped('literal')` opening a test method, and Pest's `->skip('reason')` modifier, which previously became a prepended throw. What stays a `SkipTest` throw is what cannot be declared: a guarded call, one deeper in the body, or a message no attribute argument can hold.

Assisted-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 125 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...rc/TestoToPhpunit/SkipAttributeToPhpUnitRector.php 0.00% 79 Missing ⚠️
...itToTesto/MarkTestSkippedToSkipAttributeRector.php 0.00% 45 Missing ⚠️
...ector/src/PestToTesto/TestCallToFunctionRector.php 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@roxblnfk
roxblnfk marked this pull request as ready for review September 18, 2026 21:28
@roxblnfk
roxblnfk requested a review from a team as a code owner September 18, 2026 21:28
@roxblnfk
roxblnfk merged commit 6168dca into 1.x Sep 18, 2026
27 of 30 checks passed
@roxblnfk
roxblnfk deleted the feat/rector-skip-attribute branch September 18, 2026 21:28
@roxblnfk roxblnfk mentioned this pull request Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant