_addPrePostFixes() public method

$type may be an column array with pre and postfixes
public _addPrePostFixes ( string | array $type, string $val, string $pre = '', string $post = '' ) : string
$type string | array
$val string
$pre string
$post string
return string
 function testAddPrePostFixes()
 {
     global $conf;
     $helper = new helper_plugin_data();
     $this->assertEquals('value', $helper->_addPrePostFixes('', 'value'));
     $this->assertEquals('prevaluepost', $helper->_addPrePostFixes('', 'value', 'pre', 'post'));
     $this->assertEquals('valuepost', $helper->_addPrePostFixes('', 'value', '', 'post'));
     $this->assertEquals('prevalue', $helper->_addPrePostFixes('', 'value', 'pre'));
     $this->assertEquals('prevaluepost', $helper->_addPrePostFixes(array('prefix' => 'pre', 'postfix' => 'post'), 'value'));
     $conf['lang'] = 'en';
     $this->assertEquals('envalue', $helper->_addPrePostFixes(array('prefix' => '%lang%'), 'value'));
     $this->assertEquals('value', $helper->_addPrePostFixes(array('prefix' => '%trans%'), 'value'));
     if (plugin_enable('translation')) {
         global $ID;
         $conf['plugin']['translation']['translations'] = 'de';
         $ID = 'de:somepage';
         $this->assertEquals('de:value', $helper->_addPrePostFixes(array('prefix' => '%trans%:'), 'value'));
     }
 }
 function testAddPrePostFixes()
 {
     global $conf;
     $helper = new helper_plugin_data();
     $this->assertEquals('value', $helper->_addPrePostFixes('', 'value'));
     $this->assertEquals('prevaluepost', $helper->_addPrePostFixes('', 'value', 'pre', 'post'));
     $this->assertEquals('valuepost', $helper->_addPrePostFixes('', 'value', '', 'post'));
     $this->assertEquals('prevalue', $helper->_addPrePostFixes('', 'value', 'pre'));
     $this->assertEquals('prevaluepost', $helper->_addPrePostFixes(array('prefix' => 'pre', 'postfix' => 'post'), 'value'));
     $conf['lang'] = 'en';
     $this->assertEquals('envalue', $helper->_addPrePostFixes(array('prefix' => '%lang%'), 'value'));
     $this->assertEquals('value', $helper->_addPrePostFixes(array('prefix' => '%trans%'), 'value'));
     $plugininstalled = in_array('translation', plugin_list('helper', $all = true));
     if (!$plugininstalled) {
         $this->markTestSkipped('Pre-condition not satisfied: translation plugin must be installed');
     }
     if ($plugininstalled && plugin_enable('translation')) {
         global $ID;
         $conf['plugin']['translation']['translations'] = 'de';
         $ID = 'de:somepage';
         $this->assertEquals('de:value', $helper->_addPrePostFixes(array('prefix' => '%trans%:'), 'value'));
     }
 }