Skip to content

fix(tests): avoid getStubBuilder and fix line length for CI - #290

Merged
dermatz merged 1 commit into
mainfrom
fix/ci-test-compat
Nov 12, 2026
Merged

dermatz merged 1 commit into
mainfrom
fix/ci-test-compat

Conversation

@dermatz

@dermatz dermatz commented Nov 12, 2026

Copy link
Copy Markdown
Member

Fixes failing PHPCS (line length in TemplateFallbackResolverTest) and Static Analysis (getStubBuilder() undefined with the PHPUnit version installed by Magento) on main.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 22:22
@github-actions github-actions Bot added the Fix label Nov 12, 2026
@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

Updates test doubles to avoid getStubBuilder() and wraps one long test line.

  • Block tests now create their Magento test doubles with supported PHPUnit calls.
  • The resolver test keeps its directory scan call within the line-length rule.

Reviews (1) · Last reviewed commit: "fix(tests): avoid getStubBuilder and fix..." · Reviewed by Greptile

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the test-only PHPUnit compatibility and formatting changes.

No open issues 🎉

What changed in this PR

This PR addresses test-suite CI failures by replacing unsupported PHPUnit builder calls and fixing a PHPCS line-length violation. Production code is unchanged.

Changes:

  • Replace getStubBuilder() with getMockBuilder() or createStub() in inspector tests.
  • Split a long method chain in the template fallback resolver test.
File Description
tests/​Unit/​Service/​TemplateOverride/​TemplateFallbackResolverTest.php Wraps a method chain to satisfy line-length checks.
tests/​Unit/​Service/​Inspector/​Cache/​BlockCacheCollectorTest.php Uses the mock builder for partial block doubles.
tests/​Unit/​Model/​TemplateEngine/​Decorator/​InspectorHintsTest.php Uses createStub() for parent and child block doubles.

Review effort: Balanced

@dermatz
dermatz enabled auto-merge (squash) November 12, 2026 22:29
@dermatz
dermatz disabled auto-merge November 12, 2026 22:29
@dermatz
dermatz merged commit 31d46be into main Nov 12, 2026
23 checks passed
@dermatz
dermatz deleted the fix/ci-test-compat branch November 12, 2026 22:29
@github-actions github-actions Bot mentioned this pull request Nov 12, 2026
dermatz added a commit that referenced this pull request Nov 12, 2026
Take main's fix (#290) for getStubBuilder and the overlong line, and drop the
now redundant phpstan.neon ignore.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants