r24279 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24278‎ | r24279 | r24280 >
Date:00:15, 20 July 2007
Author:avar
Status:old
Tags:
Comment:
this has been replaced by t/inc/Sanitizer.t
Modified paths:
  • / (modified) (history)
  • /trunk/phase3/tests/SanitizerTest.php (deleted) (history)

Diff [purge]

Index: trunk/phase3/tests/SanitizerTest.php
@@ -1,49 +0,0 @@
2 -<?php
3 -
4 -class SanitizerTest extends PHPUnit_Framework_TestCase {
5 - function testDecodeNamed() {
6 - $this->assertEquals(
7 - "\xc3\xa9cole",
8 - Sanitizer::decodeCharReferences( '&eacute;cole' ) );
9 - }
10 -
11 - function testDecodeNumbered() {
12 - $this->assertEquals(
13 - "\xc4\x88io bonas dans l'\xc3\xa9cole!",
14 - Sanitizer::decodeCharReferences( "&#x108;io bonas dans l'&#233;cole!" ) );
15 - }
16 -
17 - function testDecodeMixed() {
18 - $this->assertEquals(
19 - "\xc4\x88io bonas dans l'\xc3\xa9cole!",
20 - Sanitizer::decodeCharReferences( "&#x108;io bonas dans l'&eacute;cole!" ) );
21 - }
22 -
23 - function testDecodeMixedComplex() {
24 - $this->assertEquals(
25 - "\xc4\x88io bonas dans l'\xc3\xa9cole! (mais pas &#x108;io dans l'&eacute;cole)",
26 - Sanitizer::decodeCharReferences( "&#x108;io bonas dans l'&eacute;cole! (mais pas &amp;#x108;io dans l'&#38;eacute;cole)" ) );
27 - }
28 -
29 - function testDecodeInvalidAmp() {
30 - $this->assertEquals(
31 - "a & b",
32 - Sanitizer::decodeCharReferences( "a & b" ) );
33 - }
34 -
35 - function testDecodeInvalidNamed() {
36 - $this->assertEquals(
37 - "&foo;",
38 - Sanitizer::decodeCharReferences( "&foo;" ) );
39 - }
40 -
41 - function testDecodeInvalidNumbered() {
42 - $this->assertEquals(
43 - UTF8_REPLACEMENT,
44 - Sanitizer::decodeCharReferences( "&#88888888888888;" ) );
45 - }
46 -
47 - /* TODO: many more! */
48 -}
49 -
50 -
Property changes on: .
___________________________________________________________________
Modified: svk:merge
511 - 27bc04cf-33ed-4153-9a14-f265503a8842:/local/mediawiki:61331
7cf7ea9e-0fb0-4aec-bfeb-b705e7e456c6:/local/mediawiki:61660
522 + 27bc04cf-33ed-4153-9a14-f265503a8842:/local/mediawiki:61334
7cf7ea9e-0fb0-4aec-bfeb-b705e7e456c6:/local/mediawiki:61660

Follow-up revisions

RevisionCommit summaryAuthorDate
r24302Merged revisions 24276-24301 via svnmerge from...david03:42, 21 July 2007

Status & tagging log