-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use "property" instead of "attribute" for configuring the backup of static fields #4603
Comments
|
After upgrading to 10.0.3, using either
It works as expected when added at the method level. Also, |
Yes, the documentation still needs to be updated. |
I cannot reproduce this. If you still experience this issue after 1bd8f24 then please open a new ticket. |
…cause backupStaticAttributes is deprecated Error Message: Element 'phpunit', attribute 'backupStaticAttributes': The attribute 'backupStaticAttributes' is not allowed. See: - sebastianbergmann/phpunit#4604 - sebastianbergmann/phpunit#4603 - sebastianbergmann/phpunit@642ca8b
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.
PHPUnit can optionally create a backup of static fields before each test and restore these fields from that backup after each test. This functionality is controlled by
backupStaticAttributes
attribute on the<phpunit>
root element of PHPUnit's XML configuration file--static-backup
CLI option@backupStaticAttributes
annotationBackupStaticProperties
attribute (as of PHP 8 and PHPUnit 10)The
backupStaticAttributes
attribute will be deprecated in PHPUnit 10. It will be removed in PHPUnit 11. A newbackupStaticProperties
attribute will implemented to replace it. The XML configuration file migrator will be expanded to handle this change.The
--static-backup
CLI option does not need to be renamed, only its help text will be updated to use "properties" instead of "attributes".Support for metadata in comments (using the the
@backupStaticAttributes
annotation, for example) will be deprecated in PHPUnit 11 (February 2022) and removed in PHPUnit 12 (February 2023). Therefore, I do not think it's sensible to deprecate@backupStaticAttributes
now and introduce a@backupStaticProperties
replacement that will itself be deprecated within a year.The text was updated successfully, but these errors were encountered: