Skip to content

Conversation

@miladev95
Copy link

Adds a focused unit test that verifies the singleton behavior of PHPUnit\Metadata\Parser\Registry::parser() and that the registry can be recreated after resetting its private static instance.

testParserReturnsParserInstanceAndIsSingleton — asserts Registry::parser() returns an instance implementing PHPUnit\Metadata\Parser\Parser and that repeated calls return the same instance (singleton).

testParserRecreatedAfterResettingInstanceWithReflection — uses reflection to reset the private static instance, asserts a new Parser is created and is not the same object as before (tests recreation path).

@sebastianbergmann sebastianbergmann added the type/tests Tests! Yes, PHPUnit, too, needs tests. label Dec 2, 2025
@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.85%. Comparing base (61804e3) to head (448344a).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #6431   +/-   ##
=========================================
  Coverage     95.85%   95.85%           
  Complexity     7281     7281           
=========================================
  Files           789      789           
  Lines         22404    22404           
=========================================
  Hits          21476    21476           
  Misses          928      928           

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

@sebastianbergmann
Copy link
Owner

Thank you for your contribution. I appreciate the time you invested in preparing this pull request. However, I have decided not to merge it as the method in question is already sufficiently tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/tests Tests! Yes, PHPUnit, too, needs tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants