Revert "Issue #3031577 by alexpott: \Drupal\Tests\Listeners\DeprecationListenerTrait::getSkippedDeprecations() does not work in unit tests" This reverts commit c52175dd.