Skip to content

Commit

Permalink
PHPUnit 9 | Update deprecation notices for assertObject[Not]HasAttrib…
Browse files Browse the repository at this point in the history
…ute()

... now PHPUnit 10.1.0 introduces the `assertObjectHasProperty()` and `assertObjectNotHasProperty()` methods.

Refs:
* #5231
* f18856c
  • Loading branch information
jrfnl authored and sebastianbergmann committed Apr 11, 2023
1 parent b754747 commit 5a0a0de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Framework/Assert.php
Expand Up @@ -1304,7 +1304,7 @@ public static function assertClassNotHasStaticAttribute(string $attributeName, s
*/
public static function assertObjectHasAttribute(string $attributeName, $object, string $message = ''): void
{
self::createWarning('assertObjectHasAttribute() is deprecated and will be removed in PHPUnit 10.');
self::createWarning('assertObjectHasAttribute() is deprecated and will be removed in PHPUnit 10. Refactor your test to use assertObjectHasProperty() (PHPUnit 10.1.0+) instead.');

if (!self::isValidObjectAttributeName($attributeName)) {
throw InvalidArgumentException::create(1, 'valid attribute name');
Expand Down Expand Up @@ -1334,7 +1334,7 @@ public static function assertObjectHasAttribute(string $attributeName, $object,
*/
public static function assertObjectNotHasAttribute(string $attributeName, $object, string $message = ''): void
{
self::createWarning('assertObjectNotHasAttribute() is deprecated and will be removed in PHPUnit 10.');
self::createWarning('assertObjectNotHasAttribute() is deprecated and will be removed in PHPUnit 10. Refactor your test to use assertObjectNotHasProperty() (PHPUnit 10.1.0+) instead.');

if (!self::isValidObjectAttributeName($attributeName)) {
throw InvalidArgumentException::create(1, 'valid attribute name');
Expand Down

0 comments on commit 5a0a0de

Please sign in to comment.