'',
'end' => '',
'break' => '
',
'links' => false,
'flowed' => false,
'wrap' => false,
'space' => '_', // replace UTF-8 non-breaking space for simpler testing
);
$data[] = array(" aaaa", "_aaaa", $options);
$data[] = array("aaaa aaaa", "aaaa_aaaa", $options);
$data[] = array("aaaa aaaa", "aaaa__aaaa", $options);
$data[] = array("aaaa aaaa", "aaaa___aaaa", $options);
$data[] = array("aaaa\taaaa", "aaaa____aaaa", $options);
$data[] = array("aaaa\naaaa", "aaaa
aaaa", $options);
$data[] = array("aaaa\n aaaa", "aaaa
_aaaa", $options);
$data[] = array("aaaa\n aaaa", "aaaa
__aaaa", $options);
$data[] = array("aaaa\n aaaa", "aaaa
___aaaa", $options);
$data[] = array("\taaaa", "____aaaa", $options);
$data[] = array("\naaaa", "
aaaa", $options);
$data[] = array("\n aaaa", "
_aaaa", $options);
$data[] = array("\n aaaa", "
__aaaa", $options);
$data[] = array("\n aaaa", "
___aaaa", $options);
$data[] = array("aaaa\n\nbbbb", "aaaa
bbbb", $options);
$data[] = array(">aaaa \n>aaaa", "
aaaa_", $options); $data[] = array(">aaaa\n>aaaa", "
aaaa
aaaa", $options); $data[] = array(">aaaa \n>bbbb\ncccc dddd", "
aaaa
aaaa_cccc_dddd", $options); $data[] = array("aaaa-bbbb/cccc", "aaaa-bbbb/cccc", $options); $options['flowed'] = true; $data[] = array(" aaaa", "aaaa", $options); $data[] = array("aaaa aaaa", "aaaa_aaaa", $options); $data[] = array("aaaa aaaa", "aaaa__aaaa", $options); $data[] = array("aaaa aaaa", "aaaa___aaaa", $options); $data[] = array("aaaa\taaaa", "aaaa____aaaa", $options); $data[] = array("aaaa\naaaa", "aaaa
bbbb
aaaa aaaa", $options); $data[] = array(">aaaa\n>aaaa", "
aaaa", $options); $data[] = array(">aaaa \n>bbbb\ncccc dddd", "
aaaa
aaaa bbbbcccc_dddd", $options); $data[] = array(chr(0x002).chr(0x003), chr(0x002).chr(0x003), $options); $options['flowed'] = false; $options['wrap'] = true; $data[] = array(">>aaaa bbbb\n>>\n>>>\n>cccc\n\ndddd eeee", "
aaaa bbbbcccc
aaaa
bbbb
cccc
", $options); return $data; } /** * Test text to html conversion * * @dataProvider data_text2html */ function test_text2html($input, $output, $options) { $t2h = new rcube_text2html($input, false, $options); $html = $t2h->get_html(); $this->assertEquals($output, $html); } }test