protobuf
protobuf copied to clipboard
Upgrade to PHPUnit 10
Upgrades to PHPUnit 10
- Specify PHPUnit 10 in composer.json. This requires PHP 8.1, but since PHP 8.1 is the oldest version that's not end-of-life, I believe that should be acceptable. From what I can tell, CI also only runs on 8.1+. Older versions of PHPUnit produce a lot of deprecation warnings when run on new versions of PHP, making the output very messy and hard to read.
- Fixes deprecation warnings:
- Dataproviders must be static (PHPUnit commit)
- assertContains() is now for arrays only, assertStringContains() should be used for strings (PHPUnit announcement)
- Mark PreviouslyGeneratedClassTest::testPrefixForReservedWords() explicitly as skipped when run on an unsupported version of PHP to avoid a warning:
This test did not perform any assertions
Edit: Seems to be a duplicate of https://github.com/protocolbuffers/protobuf/pull/20596
Thanks @mpesari, I've rebased and fixed the remaining deprecations