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

ExpectUserDeprecation: Extension and Polyfill POC for PHPUnit 10 #1

Draft
wants to merge 1 commit into
base: feature/phpunit-10-non-error-handling
Choose a base branch
from

Conversation

hellofromtonya
Copy link

@hellofromtonya hellofromtonya commented Aug 2, 2024

*** DO NOT MERGE ***

This is a Proof of Concept (POC).

PHPUnit 10 extension for polyfilling expectUserDeprecationMessage and expectUserDeprecationMessageMatches that uses events.

The events used:

  • PHPUnit\Event\Test\Prepared to reset collector properties between tests.
  • PHPUnit\Event\Test\DeprecationTriggered to capture each deprecation triggered.
  • PHPUnit\Event\Test\AfterTestMethodFinished to verify the expected deprecations.

This POC is not drop-in as it does require configuring the extension in the using / consuming project's phpunit.xml, e.g.

  <extensions>
    <bootstrap class="Jrf\PHPUnit\Scenario\Deprecation\DeprecationExtension"/>
  </extensions>

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