5 * Add hooks for tests to use.
8 use Drupal\views\Plugin\views\cache\CachePluginBase;
9 use Drupal\views\ViewExecutable;
12 * Implements hook_views_pre_render().
14 function test_subtheme_views_pre_render(ViewExecutable $view) {
15 // We append the function name to the title for test to check for.
16 $view->setTitle($view->getTitle() . ":" . __FUNCTION__);
20 * Implements hook_views_post_render().
22 function test_subtheme_views_post_render(ViewExecutable $view, &$output, CachePluginBase $cache) {
23 // We append the function name to the title for test to check for.
24 $view->setTitle($view->getTitle() . ":" . __FUNCTION__);
25 if ($view->id() == 'test_page_display') {
26 $output['#rows'][0]['#title'] = t('%total_rows items found.', ['%total_rows' => $view->total_rows]);
31 * Implements hook_preprocess_HOOK() for theme_test_template_test templates.
33 function test_subtheme_preprocess_theme_test_template_test(&$variables) {