mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 00:28:47 +02:00
Merge remote-tracking branch 'origin/support/3.0' into develop
# Conflicts: # tests/php-unit-tests/unitary-tests/application/utilsTest.php
This commit is contained in:
@@ -834,4 +834,32 @@ class utilsTest extends ItopTestCase
|
||||
'raw_data' => ['raw_data', '<Test>\s😃😃😃', '<Test>\s😃😃😃'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider escapeHtmlProvider
|
||||
*/
|
||||
public function testEscapeHtml($sInput, $sExpectedEscaped)
|
||||
{
|
||||
if (is_null($sExpectedEscaped)) {
|
||||
$sExpectedEscaped = $sInput;
|
||||
}
|
||||
|
||||
$sEscaped = utils::EscapeHtml($sInput);
|
||||
self::assertSame($sExpectedEscaped, $sEscaped);
|
||||
|
||||
$sEscapedDecoded = utils::EscapedHtmlDecode($sEscaped);
|
||||
self::assertSame($sInput, $sEscapedDecoded);
|
||||
}
|
||||
|
||||
public function escapeHtmlProvider()
|
||||
{
|
||||
return [
|
||||
'no escape' => ['abcdefghijklmnop', null],
|
||||
'&' => ['abcdefghijklmnop&0123456789', 'abcdefghijklmnop&0123456789'],
|
||||
['"double quotes"', '"double quotes"'],
|
||||
["'simple quotes'", ''simple quotes''],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user