Skip to content
Snippets Groups Projects
Verified Commit a8ca27f4 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3337195 by Spokje: Rename test theme test_legacy_theme

(cherry picked from commit bad33160)
parent 68530cb6
No related branches found
No related tags found
7 merge requests!8506Draft: Issue #3456536 by ibrahim tameme,!5646Issue #3350972 by nod_: [random test failure]...,!5600Issue #3350972 by nod_: [random test failure]...,!5343Issue #3305066 by quietone, Rename RedirectLeadingSlashesSubscriber,!3603#ISSUE 3346218 Add a different message on edit comment,!3555Issue #2473873: Views entity operations lack cacheability support, resulting in incorrect dropbuttons,!3494Issue #3327018 by Spokje, longwave, xjm, mondrake: Update PHPStan to 1.9.3 and...
<?php
/**
* @file
* Theme to test functionality of legacy theme functions.
*
* @todo Remove in https://www.drupal.org/project/drupal/issues/3097889
*/
/**
* Tests a theme overriding a suggestion of a base theme hook.
*/
function test_legacy_theme_theme_test_preprocess_suggestions__kitten__meerkat($variables) {
return 'Theme hook implementor=test_theme_theme_test__suggestion(). Foo=' . $variables['foo'];
}
/**
* Implements hook_theme_suggestions_HOOK_alter().
*/
function test_legacy_theme_theme_suggestions_theme_test_function_suggestions_alter(array &$suggestions, array $variables) {
// Theme alter hooks run after module alter hooks, so add this theme
// suggestion to the beginning of the array so that the suggestion added by
// the theme_suggestions_test module can be picked up when that module is
// enabled.
array_unshift($suggestions, 'theme_test_function_suggestions__' . 'theme_override');
}
/**
* Returns HTML for a theme function suggestion test.
*
* Implements the theme_test_function_suggestions__theme_override suggestion.
*/
function test_legacy_theme_theme_test_function_suggestions__theme_override($variables) {
return 'Theme function overridden based on new theme suggestion provided by the test_legacy_theme theme.';
}
/**
* Returns HTML for a theme function suggestion test.
*
* Implements the theme_test_function_suggestions__module_override suggestion.
*/
function test_legacy_theme_theme_test_function_suggestions__module_override($variables) {
return 'Theme function overridden based on new theme suggestion provided by a module.';
}
name: 'Test legacy theme'
name: 'Test theme with deprecated libraries'
type: theme
description: 'Test theme to test deprecated functionality.'
description: 'Test theme to test themes with deprecated libraries.'
version: VERSION
package: Testing
base theme: test_theme
......@@ -13,4 +13,4 @@ libraries-override:
libraries-extend:
theme_test/another_deprecated_library:
- test_legacy_theme/library
- test_theme_with_deprecated_libraries/library
......@@ -238,7 +238,7 @@ public function testDeprecatedLibrary() {
$this->expectDeprecation('Theme "theme_test" is extending a deprecated library. The "theme_test/another_deprecated_library" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another library instead. See https://www.example.com');
$this->expectDeprecation('The "theme_test/deprecated_library" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another library instead. See https://www.example.com');
$this->expectDeprecation('The "theme_test/another_deprecated_library" asset library is deprecated in drupal:X.0.0 and is removed from drupal:Y.0.0. Use another library instead. See https://www.example.com');
$this->activateTheme('test_legacy_theme');
$this->activateTheme('test_theme_with_deprecated_libraries');
$this->libraryDiscovery->getLibraryByName('theme_test', 'deprecated_library');
$this->libraryDiscovery->getLibraryByName('theme_test', 'another_deprecated_library');
}
......
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