core/includes/theme.inc | 1 - core/lib/Drupal/Core/Asset/CssCollectionRenderer.php | 1 - .../Tests/Core/Asset/CssCollectionRendererUnitTest.php | 16 ++++++++++++---- .../Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php | 8 ++++++-- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 0330bcb..31d666e 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -342,7 +342,6 @@ function theme_get_setting($setting_name, $theme = NULL) { } // Generate the path to the logo image. - if ($cache[$theme]->get('logo.use_default')) { $cache[$theme]->set('logo.url', file_url_transform_relative(file_create_url($theme_object->getPath() . '/logo.svg'))); } diff --git a/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php b/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php index 48105e5..da8a11b 100644 --- a/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php +++ b/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php @@ -169,7 +169,6 @@ public function render(array $css_assets) { // the @import statement, so we instead specify the media for // the group on the STYLE tag. $import[] = '@import url("' . Html::escape(file_url_transform_relative(file_create_url($next_css_asset['data'])) . '?' . $query_string) . '");'; - // Move the outer for loop skip the next item, since we // processed it here. $i = $j; diff --git a/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php b/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php index bae5cc8..100ee8c 100644 --- a/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php @@ -9,9 +9,9 @@ namespace { /** - * CssRenderer uses file_create_url(), which *is* available when using the - * Simpletest test runner, but not when using the PHPUnit test runner; hence - * this hack. + * CssCollectionRenderer uses file_create_url() & file_url_transform_relative(), + * which *are* available when using the Simpletest test runner, but not when + * using the PHPUnit test runner; hence this hack. */ if (!function_exists('file_create_url')) { @@ -22,17 +22,25 @@ function file_create_url($uri) { return 'file_create_url:' . $uri; } + } if (!function_exists('file_url_transform_relative')) { + /** - * Temporary mock of file_url_transform_relative. + * Temporary mock of file_url_transform_relative, until that is moved into + * Component/Utility. */ function file_url_transform_relative($uri) { return $uri; } + } + } + + + namespace Drupal\Tests\Core\Asset { use Drupal\Core\Asset\CssCollectionRenderer; diff --git a/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php b/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php index 77df7cd..84530be 100644 --- a/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php @@ -9,7 +9,8 @@ namespace { /** - * CssOptimizer uses file_create_url(), which *is* available when using the + * CssOptimizer uses file_create_url(), file_uri_scheme() and + * file_url_transform_relative(), which *are* available when using the * Simpletest test runner, but not when using the PHPUnit test runner; hence * this hack. */ @@ -33,12 +34,15 @@ function file_uri_scheme($uri) { } if (!function_exists('file_url_transform_relative')) { + /** - * Temporary mock of file_url_transform_relative. + * Temporary mock of file_url_transform_relative, until that is moved into + * Component/Utility. */ function file_url_transform_relative($uri) { return $uri; } + } }