diff options
author | Christian A. Weber | 2018-04-23 16:09:33 +0200 |
---|---|---|
committer | Christian A. Weber | 2018-04-23 16:09:33 +0200 |
commit | 817d4c55d30685b0dbee464f5aa63664020a05ad (patch) | |
tree | 94936b9194e6144c2bcd19880b5c3061231d6ee9 /tests | |
parent | e2eb0132003c790b9c97bc58144a445dc8b376eb (diff) | |
download | itools-817d4c55d30685b0dbee464f5aa63664020a05ad.tar.gz itools-817d4c55d30685b0dbee464f5aa63664020a05ad.tar.bz2 itools-817d4c55d30685b0dbee464f5aa63664020a05ad.zip |
add unit tests for doctype
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/it_html.t | 14 |
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']); |