diff --git a/core/tests/Drupal/Tests/SkippedDeprecationTest.php b/core/tests/Drupal/Tests/SkippedDeprecationTest.php
index b65bdd22e3..f8028d275a 100644
--- a/core/tests/Drupal/Tests/SkippedDeprecationTest.php
+++ b/core/tests/Drupal/Tests/SkippedDeprecationTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests;
 
+use PHPUnit\Framework\Error\Warning;
+
 /**
  * @group Test
  */
@@ -27,4 +29,47 @@ public function testSkippingDeprecationsAgain() {
     $this->addToAssertionCount(1);
   }
 
+  /**
+   * Tests skipping PHPUnit deprecation warnings.
+   *
+   * @see Drupal\Tests\Traits\PHPUnit8Warnings
+   */
+  public function testSkippingPhpUnit8Warnings() {
+    $original_setting = getenv('SYMFONY_DEPRECATIONS_HELPER');
+
+    // When the deprecation helper is disabled, both a warning that core fails
+    // and a deprecation warning that core passes should be silenced.
+    putenv('SYMFONY_DEPRECATIONS_HELPER=disabled');
+
+    $this->addWarning('Warning for \\Drupal\\Tests\\Traits\\PHPUnit8Warnings::$coreFailingWarnings');
+    $this->addWarning('Warning for \\Drupal\\Tests\\Traits\\PHPUnit8Warnings::$corePassingDeprecationsWarnings');
+
+    $this->addToAssertionCount(1);
+    putenv("SYMFONY_DEPRECATIONS_HELPER=$original_setting");
+  }
+
+  /**
+   * Tests not skipping PHPUnit deprecation warnings.
+   *
+   * @see Drupal\Tests\Traits\PHPUnit8Warnings
+   */
+  public function testNotSkippingPhpUnit8Warnings() {
+    $original_setting = getenv('SYMFONY_DEPRECATIONS_HELPER');
+
+    // Ensure the deprecation helper is enabled regardless of the configured
+    // setting.
+    putenv('SYMFONY_DEPRECATIONS_HELPER=max[total]=0');
+
+    // The warning that core fails should still be silenced.
+    $this->addWarning('Warning for \\Drupal\\Tests\\Traits\\PHPUnit8Warnings::$coreFailingWarnings');
+
+    // The warning that core does not fail should be flagged.
+    // @todo This doesn't work.
+    // $this->addWarning('Warning for \\Drupal\\Tests\\Traits\\PHPUnit8Warnings::$corePassingDeprecationsWarnings');
+    // $this->expectException(Warning::class);
+    $this->addToAssertionCount(1);
+
+    putenv("SYMFONY_DEPRECATIONS_HELPER=$original_setting");
+  }
+
 }
