diff -u b/core/modules/system/src/Tests/Common/AttachedAssetsTest.php b/core/modules/system/src/Tests/Common/AttachedAssetsTest.php --- b/core/modules/system/src/Tests/Common/AttachedAssetsTest.php +++ b/core/modules/system/src/Tests/Common/AttachedAssetsTest.php @@ -74,20 +74,10 @@ * Tests non-existing libraries. */ function testLibraryUnknown() { - // Set a custom error handler so we can ignore the file not found error. - set_error_handler(function($severity, $message, $file, $line) { - // Skip error handling if this is a "file not found" error. - if (!(error_reporting() & $severity) || strstr($message, 'is missing from the file system:')) { - return; - } - throw new ErrorException($message, 0, $severity, $file, $line); - }); - $build['#attached']['library'][] = 'unknown/unknown'; + $build['#attached']['library'][] = 'core/unknown'; $assets = AttachedAssets::createFromRenderArray($build); $this->assertIdentical([], $this->assetResolver->getJsAssets($assets, FALSE)[0], 'Unknown library was not added to the page.'); - // Restore the original error handler. - restore_error_handler(); } /**