diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/it_html.t | 26 |
1 files changed, 20 insertions, 6 deletions
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"]), '<img alt="foo" bar="BAR" src="foo.gif">', "it_html inheritance" ); @@ -151,6 +156,18 @@ is( ); is( + overriddentag("one ", ['src' => "evil", 'alt' => ""], "two ", ['foo' => "bar"], "three"), + '<overriddentag src="evil" alt="" foo="bar">one two three</overriddentag>', + "moretags override" +); + +is( + defaulttag("one ", ['src' => "evil", 'alt' => ""], "two ", ['foo' => "bar"], "three"), + '<defaulttag src="evil" alt="" foo="bar">one two three</defaulttag>', + "moretags default" +); + +is( it_html::sanitize(" \r \n " . ' <p><a href="http://www.flickr.com/people/swisspics%/">swisspics</a> posted < < ä & yesterday <b>a <i>photo</i></b> <b><i>tag missmatch</b></i>:</p><br><BR /> <P><a href="javascript:window.close()" title="Wolken"><img src="http://farm1.static.flickr.com/177/377214376_bcba167a7d_m.jpg" width="240" height="180" alt="Wolken" style="border: 1px solid #ddd;" /></a></p> @@ -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"); - - -?> |