Skip to content

Conversation

@Litarnus
Copy link
Contributor

@Litarnus Litarnus commented Sep 29, 2025

Note

Replaces Symfony PHPUnit Bridge/ClockMock with a new internal Sentry\Util\ClockMock, updates tests accordingly, and adjusts static analysis and PHPUnit config.

  • Testing:
    • Replace Symfony\Bridge\PhpUnit\ClockMock with internal Sentry\Util\ClockMock across tests and tests/bootstrap.php (adds additional ClockMock::register(...), incl. Sentry\Serializer\PayloadSerializer).
    • Remove Symfony\Bridge\PhpUnit\ExpectDeprecationTrait usages from tests.
  • New Utility:
    • Add src/Util/ClockMock.php (ported clock mocking functions) used by tests.
  • Config:
    • Remove symfony/phpunit-bridge from require-dev and drop PHPUnit <listeners> from phpunit.xml.dist.
    • Exclude src/Util/ClockMock.php from analyzers (phpstan.neon excludePaths, psalm.xml.dist ignoreFiles).

Written by Cursor Bugbot for commit ee9440a. This will update automatically on new commits. Configure here.

Removes the symfony/phpunit-bridge dependency in favour of a vendored ClockMock class from said dependency. The motivation behind this is that a change in the bridge broke our pipeline and we only really use the ClockMock from the package.

@Jean85
Copy link
Contributor

Jean85 commented Sep 29, 2025

The bridge is needed for the ClockMock. Also, it's useful to detect deprecations, but in newer PHPUnit versions (10+) that could be handled natively.

@cleptric
Copy link
Member

Our entire CI broke because of changes in the bridge. We can vendor in the ClockMock and move on.

@Litarnus
Copy link
Contributor Author

Also, it's useful to detect deprecations

As far as I can see we don't use this

@Litarnus Litarnus marked this pull request as ready for review September 29, 2025 12:57
@Litarnus Litarnus self-assigned this Sep 29, 2025
@Litarnus Litarnus requested a review from cleptric September 29, 2025 13:00
@Jean85
Copy link
Contributor

Jean85 commented Sep 29, 2025

Also, it's useful to detect deprecations

As far as I can see we don't use this

You do:

<php>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0" />
</php>

See docs for usage: https://symfony.com/doc/current/components/phpunit_bridge.html#making-tests-fail

Since you still need to support older PHP versions, doing otherwise with PHPUnit 10+ is not a viable solution.

@cleptric cleptric merged commit bc33d2b into master Sep 29, 2025
39 checks passed
@cleptric cleptric deleted the remove-phpunit-bridge branch September 29, 2025 22:30
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.

4 participants