Problem/Motivation

We no longer need the extra bit for CSSOPtimizerUnitTest
core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php
since #3034072: Move file uri/scheme functions from file.inc and FileSystem to StreamWrapperManager

Steps to reproduce

Proposed resolution

Delete this at the bottom:

/**
 * CssCollectionRenderer uses file_uri_scheme() which need to be mocked.
 */
namespace Drupal\Core\Asset;

if (!function_exists('Drupal\Core\Asset\file_uri_scheme')) {

  function file_uri_scheme($uri) {
    return FALSE;
  }

}

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3539921

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nicxvan created an issue. See original summary.

tanushree gupta made their first commit to this issue’s fork.

tanushree gupta’s picture

Status: Postponed » Needs review

I've removed the provided lines
Kindly review

berdir’s picture

Status: Needs review » Needs work

Needs a phpstan baseline update.

tanushree gupta’s picture

We've removed the `file_uri_scheme()` mock from the test as requested. After doing that, the test is now throwing a 500 error — likely because the function isn't available in the test context anymore.
We've updated the PHPStan baseline to reflect the current state.

Just wanted to check how you'd prefer we handle this:

* Should we include the required `file.inc` file manually in the test (using something like `require_once`)?
* Or would it make more sense to convert this into a `KernelTestBase` or another test type where the function is already available?
* Or is it okay to leave things as they are now with the updated baseline?

berdir’s picture

Status: Needs work » Needs review

file_uri_scheme() was removed a long time ago. the test fail is unrelated, those tests just sometimes randomly fail. If it doesn't look related to your changes, you can trigger a retest. I did that now.

tanushree gupta’s picture

Thank you!!

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Novice

Seems straight forward enough.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x, thanks!

  • catch committed c724e71e on 11.x
    Issue #3539921 by tanushree gupta, nicxvan: Clean up CSSOptimizer unit...
catch’s picture

catch’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.