summaryrefslogtreecommitdiff
path: root/test/HTML5/ElementsTest.php
diff options
context:
space:
mode:
authorMatt Farina <[email protected]>2013-04-24 03:59:41 -0400
committerMatt Farina <[email protected]>2013-04-24 03:59:41 -0400
commitd814e21b16f37a8895baa95e911f0502d1117879 (patch)
tree2bf9e4e85b1416c9ed8c582e2bb5b7e3bb087196 /test/HTML5/ElementsTest.php
parent8250662c81b3b850bf49c516835a2ac3f7b6a61f (diff)
Added tests around the html element checking.
Diffstat (limited to 'test/HTML5/ElementsTest.php')
-rw-r--r--test/HTML5/ElementsTest.php140
1 files changed, 140 insertions, 0 deletions
diff --git a/test/HTML5/ElementsTest.php b/test/HTML5/ElementsTest.php
new file mode 100644
index 0000000..d3ba43b
--- /dev/null
+++ b/test/HTML5/ElementsTest.php
@@ -0,0 +1,140 @@
+<?php
+namespace HTML5\Tests;
+
+use \HTML5\Elements;
+
+require_once 'TestCase.php';
+
+class ElementsTest extends TestCase {
+
+ public function testIsHtml5Element() {
+ $html5 = array(
+ "a",
+ "abbr",
+ "address",
+ "area",
+ "article",
+ "aside",
+ "audio",
+ "b",
+ "base",
+ "bdi",
+ "bdo",
+ "blockquote",
+ "body",
+ "br",
+ "button",
+ "canvas",
+ "caption",
+ "cite",
+ "code",
+ "col",
+ "colgroup",
+ "command",
+ //"data",
+ "datalist",
+ "dd",
+ "del",
+ "details",
+ "dfn",
+ "dialog",
+ "div",
+ "dl",
+ "dt",
+ "em",
+ "embed",
+ "fieldset",
+ "figcaption",
+ "figure",
+ "footer",
+ "form",
+ "h1",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "h6",
+ "head",
+ "header",
+ "hgroup",
+ "hr",
+ "html",
+ "i",
+ "iframe",
+ "img",
+ "input",
+ "ins",
+ "kbd",
+ "keygen",
+ "label",
+ "legend",
+ "li",
+ "link",
+ "map",
+ "mark",
+ "menu",
+ "meta",
+ "meter",
+ "nav",
+ "noscript",
+ "object",
+ "ol",
+ "optgroup",
+ "option",
+ "output",
+ "p",
+ "param",
+ "pre",
+ "progress",
+ "q",
+ "rp",
+ "rt",
+ "ruby",
+ "s",
+ "samp",
+ "script",
+ "section",
+ "select",
+ "small",
+ "source",
+ "span",
+ "strong",
+ "style",
+ "sub",
+ "summary",
+ "sup",
+ "table",
+ "tbody",
+ "td",
+ "textarea",
+ "tfoot",
+ "th",
+ "thead",
+ "time",
+ "title",
+ "tr",
+ "track",
+ "u",
+ "ul",
+ "var",
+ "video",
+ "wbr",
+ );
+
+ foreach ($html5 as $element) {
+ $this->assertTrue(Elements::isHtml5Element($element), 'html5 element test failed on: ' . $element);
+
+ $this->assertTrue(Elements::isHtml5Element(strtoupper($element)), 'html5 element test failed on: ' . strtoupper($element));
+ }
+
+ $nonhtml5 = array('foo', 'bar', 'baz');
+ foreach ($nonhtml5 as $element) {
+ $this->assertFalse(Elements::isHtml5Element($element), 'html5 element test failed on: ' . $element);
+
+ $this->assertFalse(Elements::isHtml5Element(strtoupper($element)), 'html5 element test failed on: ' . strtoupper($element));
+ }
+
+
+ }
+
+} \ No newline at end of file