Update to Drupal 8.0.0-beta15. For more information, see: https://www.drupal.org/node/2563023
This commit is contained in:
parent
2720a9ec4b
commit
f3791f1da3
1898 changed files with 54300 additions and 11481 deletions
|
@ -4,6 +4,7 @@
|
|||
* @file
|
||||
* Add hooks for tests to use.
|
||||
*/
|
||||
use Drupal\views\Plugin\views\cache\CachePluginBase;
|
||||
use Drupal\views\ViewExecutable;
|
||||
|
||||
/**
|
||||
|
@ -17,7 +18,7 @@ function test_basetheme_views_pre_render(ViewExecutable $view) {
|
|||
/**
|
||||
* Implements hook_views_post_render().
|
||||
*/
|
||||
function test_basetheme_views_post_render(ViewExecutable $view) {
|
||||
function test_basetheme_views_post_render(ViewExecutable $view, &$output, CachePluginBase $cache) {
|
||||
// We append the function name to the title for test to check for.
|
||||
$view->setTitle($view->getTitle() . ":" . __FUNCTION__);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* Add hooks for tests to use.
|
||||
*/
|
||||
|
||||
use Drupal\views\Plugin\views\cache\CachePluginBase;
|
||||
use Drupal\views\ViewExecutable;
|
||||
|
||||
/**
|
||||
|
@ -18,9 +19,12 @@ function test_subtheme_views_pre_render(ViewExecutable $view) {
|
|||
/**
|
||||
* Implements hook_views_post_render().
|
||||
*/
|
||||
function test_subtheme_views_post_render(ViewExecutable $view) {
|
||||
function test_subtheme_views_post_render(ViewExecutable $view, &$output, CachePluginBase $cache) {
|
||||
// We append the function name to the title for test to check for.
|
||||
$view->setTitle($view->getTitle() . ":" . __FUNCTION__);
|
||||
if ($view->id() == 'test_page_display') {
|
||||
$output['#rows'][0]['#title'] = t('%total_rows items found.', array('%total_rows' => $view->total_rows));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
<div class="suggestion">{{ foo }}</div>
|
||||
{% if bar %}
|
||||
<div class="suggestion">{{ bar }}</div>
|
||||
{% endif %}
|
|
@ -0,0 +1 @@
|
|||
<div class="suggestion">{{ foo }}</div>
|
|
@ -105,3 +105,47 @@ function test_theme_theme_test_function_suggestions__module_override($variables)
|
|||
function test_theme_theme_registry_alter(&$registry) {
|
||||
$registry['theme_test_template_test']['variables']['additional'] = 'value';
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a theme overriding a suggestion of a base theme hook.
|
||||
*/
|
||||
function test_theme_theme_test_preprocess_suggestions__kitten__meerkat($variables) {
|
||||
return 'Theme hook implementor=test_theme_theme_test__suggestion(). Foo=' . $variables['foo'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a theme overriding a default hook with a suggestion.
|
||||
*
|
||||
* Implements hook_preprocess_HOOK().
|
||||
*/
|
||||
function test_theme_preprocess_theme_test_preprocess_suggestions(&$variables) {
|
||||
$variables['foo'] = 'Theme hook implementor=test_theme_preprocess_theme_test_preprocess_suggestions().';
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a theme overriding a default hook with a suggestion.
|
||||
*/
|
||||
function test_theme_preprocess_theme_test_preprocess_suggestions__suggestion(&$variables) {
|
||||
$variables['foo'] = 'Suggestion';
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a theme overriding a default hook with a suggestion.
|
||||
*/
|
||||
function test_theme_preprocess_theme_test_preprocess_suggestions__kitten(&$variables) {
|
||||
$variables['foo'] = 'Kitten';
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a theme overriding a default hook with a suggestion.
|
||||
*/
|
||||
function test_theme_preprocess_theme_test_preprocess_suggestions__kitten__flamingo(&$variables) {
|
||||
$variables['bar'] = 'Flamingo';
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a preprocess function with suggestions.
|
||||
*/
|
||||
function test_theme_preprocess_theme_test_preprocess_suggestions__kitten__meerkat__tarsier__moose(&$variables) {
|
||||
$variables['bar'] = 'Moose';
|
||||
}
|
||||
|
|
Reference in a new issue