summaryrefslogtreecommitdiff
path: root/test/HTML5/ElementsTest.php
diff options
context:
space:
mode:
authorMatt Farina <[email protected]>2013-04-24 06:04:07 -0400
committerMatt Farina <[email protected]>2013-04-24 06:04:07 -0400
commit608bb4ba191cf3b40c29b28347c2a75e7c043246 (patch)
tree5d18c53221eb692110c60d8bd99639fb86383be6 /test/HTML5/ElementsTest.php
parent4815ad81c8317961c6ec607910b08b401b3e52c4 (diff)
Added SVG to the element setup.
Diffstat (limited to 'test/HTML5/ElementsTest.php')
-rw-r--r--test/HTML5/ElementsTest.php108
1 files changed, 108 insertions, 0 deletions
diff --git a/test/HTML5/ElementsTest.php b/test/HTML5/ElementsTest.php
index 318b210..20161bb 100644
--- a/test/HTML5/ElementsTest.php
+++ b/test/HTML5/ElementsTest.php
@@ -162,6 +162,89 @@ class ElementsTest extends TestCase {
"munderover",
);
+ public $svgElements = array(
+ "a",
+ "altGlyph",
+ "altGlyphDef",
+ "altGlyphItem",
+ "animate",
+ "animateColor",
+ "animateMotion",
+ "animateTransform",
+ "circle",
+ "clipPath",
+ "color-profile",
+ "cursor",
+ "defs",
+ "desc",
+ "ellipse",
+ "feBlend",
+ "feColorMatrix",
+ "feComponentTransfer",
+ "feComposite",
+ "feConvolveMatrix",
+ "feDiffuseLighting",
+ "feDisplacementMap",
+ "feDistantLight",
+ "feFlood",
+ "feFuncA",
+ "feFuncB",
+ "feFuncG",
+ "feFuncR",
+ "feGaussianBlur",
+ "feImage",
+ "feMerge",
+ "feMergeNode",
+ "feMorphology",
+ "feOffset",
+ "fePointLight",
+ "feSpecularLighting",
+ "feSpotLight",
+ "feTile",
+ "feTurbulence",
+ "filter",
+ "font",
+ "font-face",
+ "font-face-format",
+ "font-face-name",
+ "font-face-src",
+ "font-face-uri",
+ "foreignObject",
+ "g",
+ "glyph",
+ "glyphRef",
+ "hkern",
+ "image",
+ "line",
+ "linearGradient",
+ "marker",
+ "mask",
+ "metadata",
+ "missing-glyph",
+ "mpath",
+ "path",
+ "pattern",
+ "polygon",
+ "polyline",
+ "radialGradient",
+ "rect",
+ "script",
+ "set",
+ "stop",
+ "style",
+ "svg",
+ "switch",
+ "symbol",
+ "text",
+ "textPath",
+ "title",
+ "tref",
+ "tspan",
+ "use",
+ "view",
+ "vkern",
+ );
+
public function testIsHtml5Element() {
foreach ($this->html5Elements as $element) {
@@ -192,6 +275,20 @@ class ElementsTest extends TestCase {
}
}
+ public function testIsSvgElement() {
+ foreach ($this->svgElements as $element) {
+ $this->assertTrue(Elements::isSvgElement($element), 'SVG element test failed on: ' . $element);
+
+ // SVG is case sensetitive so these should all fail.
+ $this->assertFalse(Elements::isSvgElement(strtoupper($element)), 'SVG element test failed on: ' . strtoupper($element));
+ }
+
+ $nonSVG = array('foo', 'bar', 'baz');
+ foreach ($nonSVG as $element) {
+ $this->assertFalse(Elements::isSvgElement($element), 'SVG element test failed on: ' . $element);
+ }
+ }
+
public function testIsElement() {
foreach ($this->html5Elements as $element) {
$this->assertTrue(Elements::isElement($element), 'html5 element test failed on: ' . $element);
@@ -206,6 +303,17 @@ class ElementsTest extends TestCase {
$this->assertFalse(Elements::isElement(strtoupper($element)), 'MathML element test failed on: ' . strtoupper($element));
}
+ foreach ($this->svgElements as $element) {
+ $this->assertTrue(Elements::isElement($element), 'SVG element test failed on: ' . $element);
+
+ // SVG is case sensetitive so these should all fail. But, there is duplication
+ // html5 and SVG. Since html5 is case insensetitive we need to make sure
+ // it's not a html5 element first.
+ if (!in_array($element, $this->html5Elements)) {
+ $this->assertFalse(Elements::isElement(strtoupper($element)), 'SVG element test failed on: ' . strtoupper($element));
+ }
+ }
+
$nonhtml5 = array('foo', 'bar', 'baz');
foreach ($nonhtml5 as $element) {
$this->assertFalse(Elements::isElement($element), 'html5 element test failed on: ' . $element);