3 class SanitizerTest
extends PHPUnit_Framework_TestCase
{
4 function testDecodeNamed() {
7 Sanitizer
::decodeCharReferences( 'école' ) );
10 function testDecodeNumbered() {
12 "\xc4\x88io bonas dans l'\xc3\xa9cole!",
13 Sanitizer
::decodeCharReferences( "Ĉio bonas dans l'école!" ) );
16 function testDecodeMixed() {
18 "\xc4\x88io bonas dans l'\xc3\xa9cole!",
19 Sanitizer
::decodeCharReferences( "Ĉio bonas dans l'école!" ) );
22 function testDecodeMixedComplex() {
24 "\xc4\x88io bonas dans l'\xc3\xa9cole! (mais pas Ĉio dans l'école)",
25 Sanitizer
::decodeCharReferences( "Ĉio bonas dans l'école! (mais pas Ĉio dans l'école)" ) );
28 function testDecodeInvalidAmp() {
31 Sanitizer
::decodeCharReferences( "a & b" ) );
34 function testDecodeInvalidNamed() {
37 Sanitizer
::decodeCharReferences( "&foo;" ) );
40 function testDecodeInvalidNumbered() {
43 Sanitizer
::decodeCharReferences( "�" ) );
46 /* TODO: many more! */