Skip to content
Snippets Groups Projects
Verified Commit 88bdd6e1 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3097444 by longwave: Remove color.module BC layers

parent 00865132
No related branches found
No related tags found
No related merge requests found
......@@ -119,19 +119,6 @@ function color_block_view_system_branding_block_alter(array &$build, BlockPlugin
$build['#pre_render'][] = [ColorSystemBrandingBlockAlter::class, 'preRender'];
}
/**
* #pre_render callback: Sets color preset logo.
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* \Drupal\color\ColorSystemBrandingBlockAlter::preRender() instead.
*
* @see https://www.drupal.org/node/2966725
*/
function color_block_view_pre_render(array $build) {
@trigger_error('color_block_view_pre_render() is deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Use \Drupal\color\ColorSystemBrandingBlockAlter::preRender() instead. See https://www.drupal.org/node/2966725', E_USER_DEPRECATED);
return ColorSystemBrandingBlockAlter::preRender($build);
}
/**
* Retrieves the Color module information for a particular theme.
*/
......
<?php
namespace Drupal\Tests\color\Kernel;
use Drupal\KernelTests\KernelTestBase;
/**
* Tests Color module's legacy code.
*
* @group color
* @group legacy
*/
class ColorLegacyTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = ['system', 'color'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->container->get('theme_installer')->install(['bartik']);
$this->config('system.theme')
->set('default', 'bartik')
->save();
}
/**
* Tests color_block_view_pre_render() deprecation.
*
* @expectedDeprecation color_block_view_pre_render() is deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Use \Drupal\color\ColorSystemBrandingBlockAlter::preRender() instead. See https://www.drupal.org/node/2966725
*/
public function testColorSystemBrandingBlockAlterPreRender() {
$render = color_block_view_pre_render([]);
$this->assertEquals(['config:color.theme.bartik'], $render['#cache']['tags']);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment