diff --git a/core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php b/core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php
index 5b80264681..931a7589fc 100644
--- a/core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php
+++ b/core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php
@@ -18,25 +18,65 @@
 trait PHPUnit8Warnings {
 
   /**
-   * The list of warnings to ignore.
+   * Warnings to always ignore because they fail for core.
+   *
+   * Once core passes for these warnings, add them to
+   * self::$corePassingDeprecationWarnings instead.
    *
    * @var string[]
    */
-  private static $ignoredWarnings = [
+  private static $coreFailingWarnings = [
     'expectExceptionMessageRegExp() is deprecated in PHPUnit 8 and will be removed in PHPUnit 9.',
   ];
 
   /**
-   * Ignores specific PHPUnit 8 warnings.
+   * Warnings that fail if deprecation is not suppressed and pass for core.
+   *
+   * Add any PHPUnit deprecations that pass for core and should be handled as
+   * deprecation warnings (rather than unconditional failures) for contrib.
+   *
+   * @var string[]
+   */
+  private static $corePassingDeprecationWarnings = [
+    'Using assertContains() with string haystacks is deprecated and will not be supported in PHPUnit 9. Refactor your test to use assertStringContainsString() or assertStringContainsStringIgnoringCase() instead.',
+    'Using assertNotContains() with string haystacks is deprecated and will not be supported in PHPUnit 9. Refactor your test to use assertStringNotContainsString() or assertStringNotContainsStringIgnoringCase() instead.',
+    'assertArraySubset() is deprecated and will be removed in PHPUnit 9.',
+    'assertInternalType() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertIsArray(), assertIsBool(), assertIsFloat(), assertIsInt(), assertIsNumeric(), assertIsObject(), assertIsResource(), assertIsString(), assertIsScalar(), assertIsCallable(), or assertIsIterable() instead.',
+    'readAttribute() is deprecated and will be removed in PHPUnit 9.',
+    'getObjectAttribute() is deprecated and will be removed in PHPUnit 9.',
+    'The optional $canonicalize parameter of assertEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertEqualsCanonicalizing() instead.',
+    'assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.',
+    'assertAttributeSame() 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.',
+  ];
+
+  /**
+   * Skips PHPUnit 8 warnings based on core compliance and deprecation handling.
+   *
+   * @param string $warning
+   *   The warning message raised in tests.
+   *
+   * @return void
    *
    * @see \PHPUnit\Framework\TestCase::addWarning()
    *
    * @internal
    */
   public function addWarning(string $warning): void {
-    if (in_array($warning, self::$ignoredWarnings, TRUE)) {
+    if (in_array($warning, self::$coreFailingWarnings, TRUE)) {
+      // Do not raise the warning if core would fail.
       return;
     }
+    if (in_array($warning, self::$corePassingDeprecationWarnings, TRUE)) {
+      // Return early only if deprecation errors are specifically suppressed.
+      if (!('disabled' !== getenv('SYMFONY_DEPRECATIONS_HELPER'))) {
+        return;
+      }
+      // Otherwise, let the parent raise the warning.
+    }
     parent::addWarning($warning);
   }
 
