Mercurial > hg > rr-repo
diff sites/all/modules/token/tests/token_test.module @ 0:ff03f76ab3fe
initial version
author | danieleb <danielebarchiesi@me.com> |
---|---|
date | Wed, 21 Aug 2013 18:51:11 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/all/modules/token/tests/token_test.module Wed Aug 21 18:51:11 2013 +0100 @@ -0,0 +1,33 @@ +<?php + +/** + * @file + * Helper module for token tests. + */ + +/** + * Implements hook_exit(). + */ +function token_test_exit() { + if ($debug = variable_get('token_page_tokens', array())) { + $debug += array('tokens' => array(), 'data' => array(), 'options' => array()); + foreach (array_keys($debug['tokens']) as $token) { + $debug['values'][$token] = token_replace($token, $debug['data'], $debug['options']); + } + variable_set('token_page_tokens', $debug); + } +} + +/** + * Implements hook_date_format_types(). + * + * @todo Remove when http://drupal.org/node/1173706 is fixed. + */ +function token_test_date_format_types() { + $info['token_test'] = t('Token test date format'); + + // Explicitly set the variable here as well. + variable_set('date_format_token_test', 'Y'); + + return $info; +}