1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/13803] Added user_signature tests

PHPBB3-13803
This commit is contained in:
JoshyPHP
2015-05-06 21:32:39 +02:00
parent 212fc277b4
commit a870f8f860
8 changed files with 138 additions and 16 deletions

View File

@@ -21,22 +21,16 @@ class user_signature extends \phpbb\textreparser\row_based_plugin
*/
protected $keyoptions;
/**
* Constructor
*
* Retrieves and saves the bit numbers used for user options
*/
public function __construct()
{
$class_vars = get_class_vars('phpbb\\user');
$this->keyoptions = $class_vars['keyoptions'];
}
/**
* {@inheritdoc}
*/
protected function add_missing_fields(array $row)
{
if (!isset($this->keyoptions))
{
$this->save_keyoptions();
}
$options = $row['user_options'];
$row += array(
'enable_bbcode' => phpbb_optionget($this->keyoptions['sig_bbcode'], $options),
@@ -44,7 +38,7 @@ class user_signature extends \phpbb\textreparser\row_based_plugin
'enable_magic_url' => phpbb_optionget($this->keyoptions['sig_links'], $options),
);
return $row;
return parent::add_missing_fields($row);
}
/**
@@ -67,4 +61,13 @@ class user_signature extends \phpbb\textreparser\row_based_plugin
{
return USERS_TABLE;
}
/**
* Save the keyoptions var from \phpbb\user
*/
protected function save_keyoptions()
{
$class_vars = get_class_vars('phpbb\\user');
$this->keyoptions = $class_vars['keyoptions'];
}
}