diff --git a/core/modules/locale/tests/src/Unit/LocaleTranslationTest.php b/core/modules/locale/tests/src/Unit/LocaleTranslationTest.php
index 47c4cca8bf6e0b81f6ad71fa31c11776b39e74d2..39458a9abda03b6c247d16913ef7773aa8c69d64 100644
--- a/core/modules/locale/tests/src/Unit/LocaleTranslationTest.php
+++ b/core/modules/locale/tests/src/Unit/LocaleTranslationTest.php
@@ -50,8 +50,7 @@ protected function setUp() {
public function testDestruct() {
$translation = new LocaleTranslation($this->storage, $this->cache, $this->lock, $this->getConfigFactoryStub(), $this->languageManager, $this->requestStack);
// Prove that destruction works without errors when translations are empty.
- $this->assertAttributeEmpty('translations', $translation);
- $translation->destruct();
+ $this->assertNull($translation->destruct());
}
}
diff --git a/core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php b/core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php
index cc4d2043484c7f2ee9c836f8f9199929d32e2291..ba91b651b60b6d78538d450f9b7e4f075d27f613 100644
--- a/core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php
+++ b/core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php
@@ -28,7 +28,6 @@ trait PHPUnit8Warnings {
'getObjectAttribute() is deprecated and will be removed in PHPUnit 9.',
'assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.',
'assertAttributeInstanceOf() is deprecated and will be removed in PHPUnit 9.',
- 'assertAttributeEmpty() is deprecated and will be removed in PHPUnit 9.',
'The optional $ignoreCase parameter of assertContains() is deprecated and will be removed in PHPUnit 9.',
'The optional $ignoreCase parameter of assertNotContains() is deprecated and will be removed in PHPUnit 9.',
];