optionset('viewcensors', false);
$return = generate_text_for_edit($original, $uid, $flags);
$this->assertSame($expected, $return['text']);
}
public function get_legacy_tests()
{
return array(
array(
'',
''
),
array(
'0',
'0'
),
array(
'Hello [url=http://example.org:1f4coh9x]world[/url:1f4coh9x]
',
'Hello [url=http://example.org]world[/url] :)',
'1f4coh9x',
0
),
array(
"&<>"'",
"&<>"'"
)
);
}
/**
* @dataProvider get_text_formatter_tests
*/
public function test_text_formatter($original, $expected)
{
global $phpbb_dispatcher;
$phpbb_dispatcher = new phpbb_mock_event_dispatcher;
$this->get_test_case_helpers()->set_s9e_services();
$return = generate_text_for_edit($original, '', 0);
$this->assertSame($expected, $return['text']);
}
public function get_text_formatter_tests()
{
return array(
array(
'Plain text',
'Plain text'
),
array(
'Hello [url=http://example.org]world[/url] :)',
'Hello [url=http://example.org]world[/url] :)'
),
array(
'&<>"\'',
"&<>"'"
)
);
}
}