-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Remove assertions that operate on class/object properties #4601
Description
Object-Oriented Programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code: data in the form of fields (often known as attributes or properties), and code, in the form of procedures (often known as methods).
PHPUnit currently refers to "fields" (see above) as "attributes". This is (or will become) confusing considering the introduction of attributes in PHP 8 and their support in PHPUnit.
PHPUnit will be changed to use the term "property" instead of "attribute" where "field" is meant.
The following methods of PHPUnit\Framework\Assert will be removed in PHPUnit 10:
assertClassHasAttribute()assertClassNotHasAttribute()assertClassHasStaticAttribute()assertClassNotHasStaticAttribute()assertObjectHasAttribute()assertObjectNotHasAttribute()classHasAttribute()classHasStaticAttribute()objectHasAttribute()
The following classes will be removed in PHPUnit 10:
PHPUnit\Framework\Constraint\ClassHasAttributePHPUnit\Framework\Constraint\ClassHasStaticAttributePHPUnit\Framework\Constraint\ObjectHasAttribute
At this time, no replacements are planned as these assertions are not wildly used (to the best of my knowledge) and, if at all, should only be used in edge case situations that I consider outside the scope of PHPUnit's standard distribution.