summaryrefslogtreecommitdiff
path: root/tests/it_html.t
diff options
context:
space:
mode:
authorChristian A. Weber2018-04-12 17:54:23 +0200
committerChristian A. Weber2018-04-12 17:54:23 +0200
commit31bb4ba99f6572acfe08c3daf78dc043dc924903 (patch)
tree0d543471d4c5b76cef420b9fb9c592d9b9b34ba7 /tests/it_html.t
parent1bf1f64969a6270d655e8819258e574b4dcb33e0 (diff)
downloaditools-31bb4ba99f6572acfe08c3daf78dc043dc924903.tar.gz
itools-31bb4ba99f6572acfe08c3daf78dc043dc924903.tar.bz2
itools-31bb4ba99f6572acfe08c3daf78dc043dc924903.zip
remove custom img() implementation with ie_png_fix, allow using it_html::tagname() for all tags+moretags
Diffstat (limited to 'tests/it_html.t')
-rwxr-xr-xtests/it_html.t26
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 < &lt; &auml; &amp; 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("&#8217;"), "'", "it_html::entity_decode numeric decim
is(it_html::entity_decode("&#xfff;"), " ", "it_html::entity_decode invalid numeric hex entity");
is(it_html::entity_decode("&#999;"), " ", "it_html::entity_decode invalid numeric decimal entity");
is(it_html::entity_decode("&#x8b;"), " ", "it_html::entity_decode entity von 0x80-0x9f");
-
-
-?>