Implements hook_block_info().
function block_test_block_info() {
$blocks['test_cache'] = array(
'info' => t('Test block caching'),
'cache' => state()
->get('block_test.caching') ?: DRUPAL_CACHE_PER_ROLE,
);
$blocks['test_html_id'] = array(
'info' => t('Test block html id'),
);
return $blocks;
}