assertObjectHasAttribute and assertObjectNotHasAttribute are amongst the
assertion methods deprecated in PHPUnit 9.6. PHPUnit 10 introduced
replacement methods for them, assertObjectHasProperty and
assertObjectNotHasProperty respectively, but these weren't backported to
the 9.x branch.
Add temporary overrides for those methods in MediaWikiTestCaseTrait, so
that we can start migrating our code before the PHPUnit 10 update. The
signature, implementation, and error messages of these assertions are
copied from upstream, so the transition should be seamless. The only
tiny difference is that our version also prints "Failed asserting that
false is true" (and vice versa for NotHasAttribute) after the custom
message, but I don't think this is worth the complexity of adding a
custom Constraint.
Also migrate the few existing usages to the new methods.
Bug: T342110
Change-Id: If489d2c70fabbed6a068ef22d166f6e73f6adf6d