summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian A. Weber2018-04-23 16:09:33 +0200
committerChristian A. Weber2018-04-23 16:09:33 +0200
commit817d4c55d30685b0dbee464f5aa63664020a05ad (patch)
tree94936b9194e6144c2bcd19880b5c3061231d6ee9
parente2eb0132003c790b9c97bc58144a445dc8b376eb (diff)
downloaditools-817d4c55d30685b0dbee464f5aa63664020a05ad.tar.gz
itools-817d4c55d30685b0dbee464f5aa63664020a05ad.tar.bz2
itools-817d4c55d30685b0dbee464f5aa63664020a05ad.zip
add unit tests for doctype
-rwxr-xr-xtests/it_html.t14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/it_html.t b/tests/it_html.t
index bcfd40d..8e529e0 100755
--- a/tests/it_html.t
+++ b/tests/it_html.t
@@ -7,7 +7,7 @@ it::getopt(""); #handle possible --debug parameter
# Traditional html5 generation
ini_set('default_charset', "utf-8");
-new it_html(array('htmltype' => "html"));
+new it_html(array('htmltype' => "html5", 'prettyprint' => false));
is(
a(array('href' => "&foo", 'true' => true, 'false' => false, 'null' => null, 'empty' => ""), "bar"),
@@ -100,6 +100,12 @@ is(
"use html entities in attributes but not in normal text"
);
+is(
+ html(),
+ "<!DOCTYPE html>\n<html lang=\"de\">\n</html>\n",
+ "html5 doctype"
+);
+
# Test different html types
foreach (array('html5' => "<br flag>", 'html' => "<br flag>", 'xhtml' => "<br flag=\"flag\" />", 'xhtml-mobile' => "<br flag=\"flag\" />") as $type => $value)
{
@@ -124,6 +130,12 @@ is(
"empty h1 tag in xhtml context"
);
+is(
+ html(),
+ "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"de\">\n</html>\n",
+ "xhtml doctype"
+);
+
# XML generation
unset($GLOBALS['it_html']);