You are here

views_ui_test.module in Zircon Profile 8

Helper module for Views UI tests.

File

core/modules/views_ui/tests/modules/views_ui_test/views_ui_test.module
View source
<?php

/**
 * @file
 * Helper module for Views UI tests.
 */

/**
 * Implements hook_views_preview_info_alter().
 *
 * Add a row count row to the live preview area.
 */
function views_ui_test_views_preview_info_alter(&$rows, $view) {
  $data = [
    '#markup' => t('Test row count'),
  ];
  $data['#attached']['library'][] = 'views_ui_test/views_ui_test.test';
  $rows['query'][] = [
    [
      'data' => $data,
    ],
    count($view->result),
  ];
}