Upgrade test framework to PHPUnit 10.5
PHPUnit 10.x is a lot stricter than the 9.x branch we've been using until now. That's a good thing. It flags warnings, deprecations and other issues, even if the tests themselves pass.
I've fixed the issues that caused failures, and a few more, but the remaining deprecations, warnings and notices will be dealt with in future patches.