|
|
|
@ -129,6 +129,36 @@ class Framework_Utils extends PHPUnit_Framework_TestCase
|
|
|
|
|
$this->assertFalse(rcube_utils::check_ip($ip));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Data for test_rep_specialchars_output()
|
|
|
|
|
*/
|
|
|
|
|
function data_rep_specialchars_output()
|
|
|
|
|
{
|
|
|
|
|
return array(
|
|
|
|
|
array('', '', 'abc', 'abc'),
|
|
|
|
|
array('', '', '?', '?'),
|
|
|
|
|
array('', '', '"', '"'),
|
|
|
|
|
array('', '', '<', '<'),
|
|
|
|
|
array('', '', '>', '>'),
|
|
|
|
|
array('', '', '&', '&'),
|
|
|
|
|
array('', '', '&', '&amp;'),
|
|
|
|
|
array('', '', '<a>', '<a>'),
|
|
|
|
|
array('', 'remove', '<a>', ''),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Test for rep_specialchars_output
|
|
|
|
|
* @dataProvider data_rep_specialchars_output
|
|
|
|
|
*/
|
|
|
|
|
function test_rep_specialchars_output($type, $mode, $str, $res)
|
|
|
|
|
{
|
|
|
|
|
$result = rcube_utils::rep_specialchars_output(
|
|
|
|
|
$str, $type ? $type : 'html', $mode ? $mode : 'strict');
|
|
|
|
|
|
|
|
|
|
$this->assertEquals($result, $res);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* rcube_utils::mod_css_styles()
|
|
|
|
|
*/
|
|
|
|
|