The assertions assertObjectHasAttribute() and assertObjectNotHasAttribute() were removed in PHPUnit 10.0. When this decision was made and the change implemented, there was no replacement planned for these methods.
PHPUnit 9.6 was released alongside PHPUnit 10.0 to warn about functionality that was removed in PHPUnit 10.0. This is why PHPUnit 9.6.0 deprecated assertObjectHasAttribute() and assertObjectNotHasAttribute() without suggesting an alternative.
The functionality was reintroduced, using new methods names assertObjectHasProperty() and assertObjectNotHasProperty(), in PHPUnit 10.1 because users convinced me that it is useful (I never had to use it myself). As of PHPUnit 9.6.7, the deprecations suggest to use these new methods.
This series of events lead to a mess that was discussed in #5448 as well as here and here, for instance.
To fix this mess, I will add assertObjectHasProperty() and assertObjectNotHasProperty() to PHPUnit 9.6.
The assertions
assertObjectHasAttribute()andassertObjectNotHasAttribute()were removed in PHPUnit 10.0. When this decision was made and the change implemented, there was no replacement planned for these methods.PHPUnit 9.6 was released alongside PHPUnit 10.0 to warn about functionality that was removed in PHPUnit 10.0. This is why PHPUnit 9.6.0 deprecated
assertObjectHasAttribute()andassertObjectNotHasAttribute()without suggesting an alternative.The functionality was reintroduced, using new methods names
assertObjectHasProperty()andassertObjectNotHasProperty(), in PHPUnit 10.1 because users convinced me that it is useful (I never had to use it myself). As of PHPUnit 9.6.7, the deprecations suggest to use these new methods.This series of events lead to a mess that was discussed in #5448 as well as here and here, for instance.
To fix this mess, I will add
assertObjectHasProperty()andassertObjectNotHasProperty()to PHPUnit 9.6.