summaryrefslogtreecommitdiff
path: root/tests/SanitizerTest.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2008-12-15 18:02:47 +0100
committerPierre Schmitz <pierre@archlinux.de>2008-12-15 18:02:47 +0100
commit396b28f3d881f5debd888ba9bb9b47c2d478a76f (patch)
tree10d6e1a721ee4ef69def34a57f02d7eb3fc9e31e /tests/SanitizerTest.php
parent0be4d3ccf6c4fe98a72704f9463ecdea2ee5e615 (diff)
update to Mediawiki 1.13.3; some cleanups
Diffstat (limited to 'tests/SanitizerTest.php')
-rw-r--r--tests/SanitizerTest.php65
1 files changed, 0 insertions, 65 deletions
diff --git a/tests/SanitizerTest.php b/tests/SanitizerTest.php
deleted file mode 100644
index 5babf0ae..00000000
--- a/tests/SanitizerTest.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-
-require_once( 'PHPUnit.php' );
-require_once( '../includes/Defines.php' );
-require_once( '../includes/Profiling.php' );
-require_once( '../includes/GlobalFunctions.php' );
-require_once( '../includes/Sanitizer.php' );
-
-class SanitizerTest extends PHPUnit_TestCase {
- function SanitizerTest( $name ) {
- $this->PHPUnit_TestCase( $name );
- }
-
- function setUp() {
- }
-
- function tearDown() {
- }
-
- function testDecodeNamed() {
- $this->assertEquals(
- "\xc3\xa9cole",
- Sanitizer::decodeCharReferences( '&eacute;cole' ) );
- }
-
- function testDecodeNumbered() {
- $this->assertEquals(
- "\xc4\x88io bonas dans l'\xc3\xa9cole!",
- Sanitizer::decodeCharReferences( "&#x108;io bonas dans l'&#233;cole!" ) );
- }
-
- function testDecodeMixed() {
- $this->assertEquals(
- "\xc4\x88io bonas dans l'\xc3\xa9cole!",
- Sanitizer::decodeCharReferences( "&#x108;io bonas dans l'&eacute;cole!" ) );
- }
-
- function testDecodeMixedComplex() {
- $this->assertEquals(
- "\xc4\x88io bonas dans l'\xc3\xa9cole! (mais pas &#x108;io dans l'&eacute;cole)",
- Sanitizer::decodeCharReferences( "&#x108;io bonas dans l'&eacute;cole! (mais pas &amp;#x108;io dans l'&#38;eacute;cole)" ) );
- }
-
- function testDecodeInvalidAmp() {
- $this->assertEquals(
- "a & b",
- Sanitizer::decodeCharReferences( "a & b" ) );
- }
-
- function testDecodeInvalidNamed() {
- $this->assertEquals(
- "&foo;",
- Sanitizer::decodeCharReferences( "&foo;" ) );
- }
-
- function testDecodeInvalidNumbered() {
- $this->assertEquals(
- UTF8_REPLACEMENT,
- Sanitizer::decodeCharReferences( "&#88888888888888;" ) );
- }
-
- /* TODO: many more! */
-}
-
-?> \ No newline at end of file