function UnicodeUnitTest::testDecodeEntitiesExclusion in SimpleTest 7
File
- tests/
unicode.test, line 188 - Various unicode handling tests.
Class
- UnicodeUnitTest
- Test unicode handling features implemented in unicode.inc.
Code
function testDecodeEntitiesExclusion() {
$testcase = array(
'Drupal' => 'Drupal',
'<script>' => '<script>',
'<script>' => '<script>',
'<script>' => '<script>',
'&lt;script&gt;' => '&lt;script&gt;',
'"' => '"',
'"' => '"',
'&#34;' => '&#34;',
'"' => '"',
'&quot;' => '&quot;',
"'" => "'",
''' => "'",
'&#39;' => '&#39;',
'©' => '©',
'©' => '©',
'©' => '©',
'→' => '→',
'→' => '→',
'➼' => '➼',
'➼' => '➼',
'€' => '€',
);
$exclude = array(
'<',
'&',
'"',
);
foreach ($testcase as $input => $output) {
$this
->assertIdentical(decode_entities($input, $exclude), $output, t('Make sure the decoded entity of %input, excluding %excludes, is %output', array(
'%input' => $input,
'%excludes' => implode(',', $exclude),
'%output' => $output,
)));
}
}