Phpunit: Deprecate assertions (and helper methods) that operate on (non-public) attributes

Created on 11 Oct 2018  路  9Comments  路  Source: sebastianbergmann/phpunit

The following methods should be deprecated:

  • assertAttributeContains()
  • assertAttributeNotContains()
  • assertAttributeContainsOnly()
  • assertAttributeNotContainsOnly()
  • assertAttributeCount()
  • assertAttributeNotCount()
  • assertAttributeEquals()
  • assertAttributeNotEquals()
  • assertAttributeEmpty()
  • assertAttributeNotEmpty()
  • assertAttributeGreaterThan()
  • assertAttributeGreaterThanOrEqual()
  • assertAttributeLessThan()
  • assertAttributeLessThanOrEqual()
  • assertAttributeSame()
  • assertAttributeNotSame()
  • assertAttributeInstanceOf()
  • assertAttributeNotInstanceOf()
  • assertAttributeInternalType()
  • assertAttributeNotInternalType()
  • attribute()
  • attributeEqualTo()
  • readAttribute()
  • getStaticAttribute()
  • getObjectAttribute

Most helpful comment

What should be used instead?

All 9 comments

What should be used instead?

@gmponos Thanks!

How do I figure out what replaces these?

@geoidesic There is no replacement. The correct course of action is to refactor your code to not require dirty tricks like this.

@geoidesic There is no replacement. The correct course of action is to refactor your code to not require dirty tricks like this.

why not

@sebastianbergmann What alternative using readAttribute(). If it deprecated almost for a secure reason what method I just need for use?

@AlexMalikov94 There is no replacement. The correct course of action is to refactor your code to not require dirty tricks like this.

@sebastianbergmann Yes you are right is dirty tricks but in the past developers used it just I think you have an alternative I see it is not. I just use another function more flexibly. I will contribute your code in the future.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

greg0ire picture greg0ire  路  4Comments

nicklevett picture nicklevett  路  4Comments

sebastianbergmann picture sebastianbergmann  路  4Comments

keradus picture keradus  路  3Comments

sebastianbergmann picture sebastianbergmann  路  3Comments