Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve tests for SourceMapper #6113

Closed

Conversation

dantleech
Copy link
Contributor

@dantleech dantleech commented Jan 29, 2025

This PR:

  • Refactors the source mapper test to make it more concise.
  • Adds basic test scenarios for prefix and suffix inclusion and exclusion.

I hope I haven't been overzealous in refactoring the test, let me know if you want me to revert it to the original format.

Would this be against main or a previous version?

@dantleech dantleech changed the title Source mapper test (relatess to #6111) Source mapper test (relates to #6111) Jan 29, 2025
@sebastianbergmann sebastianbergmann added the type/tests Tests! Yes, PHPUnit, too, needs tests. label Jan 29, 2025
@sebastianbergmann
Copy link
Owner

Would this be against main or a previous version?

Once the build is green and you tell me this is good to go, I will take care of cherry-picking this into 10.5 or 11.5 and merge it forward from there.

For a clean(er) history, I would appreciate it if you could squash these changes into a single commit. Sorry for the inconvenience.

@sebastianbergmann sebastianbergmann added the type/enhancement A new idea that should be implemented label Jan 29, 2025
@sebastianbergmann sebastianbergmann changed the title Source mapper test (relates to #6111) Improve tests for SourceMapper Jan 29, 2025
@dantleech dantleech force-pushed the gh-6111-source-mapper-test branch from a99a217 to c0f0771 Compare January 29, 2025 14:37
- Created a static factory method for `Source` to remove the redundant
  constructor arguments.
- Created a static helper method to resolve the fixture path.
- Test prefix inclusion and exlusion
- Test suffix inclusion and exlusion
@dantleech dantleech force-pushed the gh-6111-source-mapper-test branch from c0f0771 to 89391ec Compare January 29, 2025 14:42
Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.07%. Comparing base (a46d634) to head (89391ec).
Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #6113   +/-   ##
=========================================
  Coverage     95.07%   95.07%           
  Complexity     6730     6730           
=========================================
  Files           724      724           
  Lines         21195    21195           
=========================================
  Hits          20151    20151           
  Misses         1044     1044           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sebastianbergmann
Copy link
Owner

Thank you! I'll take care from here.

@sebastianbergmann
Copy link
Owner

Cherry-picked into 10.5 and merged to 11.5 and main from there.

@dantleech dantleech deleted the gh-6111-source-mapper-test branch January 29, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement A new idea that should be implemented type/tests Tests! Yes, PHPUnit, too, needs tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants