* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
class phpbb_text_processing_decode_message_test extends phpbb_test_case
{
/**
* @dataProvider get_legacy_tests
*/
public function test_legacy($original, $expected, $bbcode_uid = '')
{
$actual = $original;
decode_message($actual, $bbcode_uid);
$this->assertSame($expected, $actual);
}
public function get_legacy_tests()
{
return array(
array(
"&<>"'",
"&<>"'"
),
array(
'
',
':)'
),
/**
* Fails as per PHPBB3-8420
* @link http://tracker.phpbb.com/browse/PHPBB3-8420
*
array(
'[url=http://example.com:2cpxwbdy]
here[/url:2cpxwbdy]',
'[url=http://example.com] :arrow: here[/url]',
'2cpxwbdy'
),
*/
);
}
/**
* @dataProvider get_text_formatter_tests
*/
public function test_text_formatter($original, $expected)
{
$this->get_test_case_helpers()->set_s9e_services();
$actual = $original;
decode_message($actual);
$this->assertSame($expected, $actual);
}
public function get_text_formatter_tests()
{
return array(
array(
"&<>\"'",
"&<>"'"
),
array(
':)',
':)'
),
array(
"a
\nb",
"a\nb"
),
/**
* @link http://tracker.phpbb.com/browse/PHPBB3-8420
*/
array(
'[url=http://example.com] :arrow: here[/url]',
'[url=http://example.com] :arrow: here[/url]'
),
);
}
}
$R(5RIUU@
J")I*+Z$DUP)%(H(J5TURUJEU TKJj(XD
J %Q
"EF
KLHBJR$ %%B+`IQ"("DQ$(BJHP$
U6((!P UIZʂfEEJR@%*H R%JJ
TA
!(PUP RUUT{TPR$D%
A'JDI% *
EE +cH
DIU*()T PT @T
E(U UTTU@TEK` 4)D(
R J$ ( ICf-*"*b@R%QUT(mD$Q65Kim-2e!ل^5 L L1 0 ` 1 Ѡ #iM4
D @ hh L L ` 4h2i6i= 0F4ɠO&A=F$H
Fh L#FMd#bd4 A &