Aleksander Machniak
2013-11-28 ffec857b697ce0a23134f04cf345dc3a8b45a7ae
tests/Framework/Washtml.php
@@ -47,7 +47,7 @@
        $html   = "<!--[if gte mso 10]><p>p1</p><!--><p>p2</p>";
        $washed = $washer->wash($html);
        $this->assertEquals('<!-- html ignored --><!-- body ignored --><p>p2</p>', $washed, "HTML conditional comments (#1489004)");
        $this->assertEquals('<!-- node type 8 --><!-- html ignored --><!-- body ignored --><p>p2</p>', $washed, "HTML conditional comments (#1489004)");
        $html   = "<!--TestCommentInvalid><p>test</p>";
        $washed = $washer->wash($html);
@@ -55,4 +55,30 @@
        $this->assertEquals('<!-- html ignored --><!-- body ignored --><p>test</p>', $washed, "HTML invalid comments (#1487759)");
    }
    /**
     * Test fixing of invalid self-closing elements (#1489137)
     */
    function test_self_closing()
    {
        $html = "<textarea>test";
        $washer = new rcube_washtml;
        $washed = $washer->wash($html);
        $this->assertRegExp('|<textarea>test</textarea>|', $washed, "Self-closing textarea (#1489137)");
    }
    /**
     * Test fixing of invalid closing tags (#1489446)
     */
    function test_closing_tag_attrs()
    {
        $html = "<a href=\"http://test.com\">test</a href>";
        $washer = new rcube_washtml;
        $washed = $washer->wash($html);
        $this->assertRegExp('|</a>|', $washed, "Invalid closing tag (#1489446)");
    }
}