don't slurp the whole file, we only need to test line 1, this speeds things up immensely
[lhc/web/wiklou.git] / tests / SanitizerTest.php
index e9ce295..3c66681 100644 (file)
@@ -1,22 +1,6 @@
 <?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() {
-       }
-
+class SanitizerTest extends PHPUnit_Framework_TestCase {
        function testDecodeNamed() {
                $this->assertEquals(
                        "\xc3\xa9cole",
@@ -28,13 +12,13 @@ class SanitizerTest extends PHPUnit_TestCase {
                        "\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)",
@@ -46,20 +30,20 @@ class SanitizerTest extends PHPUnit_TestCase {
                        "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
+