Skip to content

Generic/InlineControlStructure: improve code coverage#1144

Merged
jrfnl merged 1 commit into
PHPCSStandards:4.xfrom
rodrigoprimo:test-coverage-inline-control-structure
Mar 5, 2026
Merged

Generic/InlineControlStructure: improve code coverage#1144
jrfnl merged 1 commit into
PHPCSStandards:4.xfrom
rodrigoprimo:test-coverage-inline-control-structure

Conversation

@rodrigoprimo

@rodrigoprimo rodrigoprimo commented Jun 18, 2025

Copy link
Copy Markdown
Contributor

Description

This PR improves code coverage for the Generic.ControlStructures.InlineControlStructure sniff. It is the last PR in a series discussed in #482 (review). It includes commit 8 from #482 and expands it, adding more tests. Including a test suggested by @jrfnl related to commit 3 (InlineControlStructureUnitTest.11.inc), which has been dropped.

There is still one line that is not covered by tests. I plan to address it in a separate PR. I still want to check a bit more, but I believe #880 made this line unreachable, and thus it can be removed.

I'm targeting 4.x instead of master as this PR builds on top of #880, which also target 4.x (see #880 (comment)).

Suggested changelog entry

N/A

Related issues/external references

Initially suggested in #482.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
    • This change is only breaking for integrators, not for external standards or end-users.
  • Documentation improvement

PR checklist

  • I have checked there is no other PR open for the same change.
  • I have read the Contribution Guidelines.
  • I grant the project the right to include and distribute the code under the BSD-3-Clause license (and I have the right to grant these rights).
  • I have added tests to cover my changes.
  • I have verified that the code complies with the projects coding standards.
  • [Required for new sniffs] I have added XML documentation for the sniff.

@rodrigoprimo

Copy link
Copy Markdown
Contributor Author

I had to force-push to resolve conflicts on src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.php.

@rodrigoprimo rodrigoprimo force-pushed the test-coverage-inline-control-structure branch from 615e820 to a24ae3a Compare March 5, 2026 16:51
@rodrigoprimo

Copy link
Copy Markdown
Contributor Author

Force-pushed without changes to update this branch against the latest from 4.x.

@jrfnl jrfnl modified the milestones: 4.x, 4.0.2 Mar 5, 2026
@jrfnl

jrfnl commented Mar 5, 2026

Copy link
Copy Markdown
Member

Thanks for the reminder and for your work on this @rodrigoprimo! Let's just get this merged. More variation in the tests is always a good thing 😉

@jrfnl jrfnl merged commit 55f655b into PHPCSStandards:4.x Mar 5, 2026
53 checks passed
@jrfnl jrfnl deleted the test-coverage-inline-control-structure branch March 5, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants