Skip to content

Commit 5a0a0de

Browse files
jrfnlsebastianbergmann
authored andcommitted
PHPUnit 9 | Update deprecation notices for assertObject[Not]HasAttribute()
... now PHPUnit 10.1.0 introduces the `assertObjectHasProperty()` and `assertObjectNotHasProperty()` methods. Refs: * #5231 * f18856c
1 parent b754747 commit 5a0a0de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Framework/Assert.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ public static function assertClassNotHasStaticAttribute(string $attributeName, s
13041304
*/
13051305
public static function assertObjectHasAttribute(string $attributeName, $object, string $message = ''): void
13061306
{
1307-
self::createWarning('assertObjectHasAttribute() is deprecated and will be removed in PHPUnit 10.');
1307+
self::createWarning('assertObjectHasAttribute() is deprecated and will be removed in PHPUnit 10. Refactor your test to use assertObjectHasProperty() (PHPUnit 10.1.0+) instead.');
13081308

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

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

0 commit comments

Comments
 (0)