Skip to content

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

Draft
roxblnfk wants to merge 1 commit into
1.xfrom
feat/rector-skip-attribute
Draft

roxblnfk wants to merge 1 commit 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!

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