From 31bb4ba99f6572acfe08c3daf78dc043dc924903 Mon Sep 17 00:00:00 2001 From: Christian A. Weber Date: Thu, 12 Apr 2018 17:54:23 +0200 Subject: remove custom img() implementation with ie_png_fix, allow using it_html::tagname() for all tags+moretags --- tests/it_html.t | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/it_html.t b/tests/it_html.t index dc039f7..e863339 100755 --- a/tests/it_html.t +++ b/tests/it_html.t @@ -124,22 +124,27 @@ class myhtml extends it_html function myhtml($p = array()) { - parent::it_html($p + array('nonewlinetags' => 'a,b,em,img,input,span,div')); + parent::__construct($p + ['moretags' => 'overriddentag,defaulttag', 'nonewlinetags' => 'a,b,defaulttag,em,img,input,overriddentag,span,div']); } function myimg($args) { array_unshift($args, array('alt' => "ALT", 'bar' => "BAR")); - return parent::img(array_filter(it_parse_args($args))); } + +function overriddentag($args) +{ + return parent::overriddentag($args); +} + } unset($GLOBALS['it_html']); new myhtml(array('htmltype' => "html")); is( - myimg(array('src' => "foo.gif", 'alt' => "foo")), + myimg(['src' => "foo.gif", 'alt' => "foo"]), 'foo', "it_html inheritance" ); @@ -150,6 +155,18 @@ is( "different nonewlinetags respected" ); +is( + overriddentag("one ", ['src' => "evil", 'alt' => ""], "two ", ['foo' => "bar"], "three"), + 'one two three', + "moretags override" +); + +is( + defaulttag("one ", ['src' => "evil", 'alt' => ""], "two ", ['foo' => "bar"], "three"), + 'one two three', + "moretags default" +); + is( it_html::sanitize(" \r \n " . '

swisspics posted < < ä & yesterday a photo tag missmatch:



@@ -219,6 +236,3 @@ is(it_html::entity_decode("’"), "'", "it_html::entity_decode numeric decim is(it_html::entity_decode("࿿"), " ", "it_html::entity_decode invalid numeric hex entity"); is(it_html::entity_decode("ϧ"), " ", "it_html::entity_decode invalid numeric decimal entity"); is(it_html::entity_decode("‹"), " ", "it_html::entity_decode entity von 0x80-0x9f"); - - -?> -- cgit v1.2.3