diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/HTML5/ElementsTest.php | 15 | ||||
-rw-r--r-- | test/HTML5/Serializer/TraverserTest.php | 20 |
2 files changed, 15 insertions, 20 deletions
diff --git a/test/HTML5/ElementsTest.php b/test/HTML5/ElementsTest.php index 69d0675..df8d336 100644 --- a/test/HTML5/ElementsTest.php +++ b/test/HTML5/ElementsTest.php @@ -337,6 +337,21 @@ class ElementsTest extends TestCase { $this->assertFalse(Elements::isA('scriptypoo', Elements::KNOWN_ELEMENT)); $this->assertTrue(Elements::isA('script', Elements::TEXT_RAW)); $this->assertFalse(Elements::isA('script', Elements::TEXT_RCDATA)); + + $unaryElements = array( 'area', 'base', 'basefont', 'bgsound', 'br', 'col', + 'command', 'embed', 'frame', 'hr', 'img', + ); + + foreach ($unaryElements as $element) { + $this->assertTrue(Elements::isA($element, Elements::UNARY_TAG), 'Unary test failed on: ' . $element); + } + + $nonUnary = array('span', 'a', 'div'); + foreach ($nonUnary as $tag) { + $this->assertFalse(Elements::isA($tag, Elements::UNARY_TAG), 'Unary test failed on: ' . $tag); + } + + } } diff --git a/test/HTML5/Serializer/TraverserTest.php b/test/HTML5/Serializer/TraverserTest.php index 665f318..56fa4e1 100644 --- a/test/HTML5/Serializer/TraverserTest.php +++ b/test/HTML5/Serializer/TraverserTest.php @@ -44,24 +44,4 @@ class TraverserTest extends \HTML5\Tests\TestCase { $this->assertFalse($method->invoke($t, $tag), 'Block test failed on: ' . $tag); } } - - public function testIsUnary() { - $elements = array( 'area', 'base', 'basefont', 'bgsound', 'br', 'col', - 'command', 'embed', 'frame', 'hr', 'img', - ); - - // Mocking the required input because there is no checking. - $t = new Traverser('', ''); - $method = $this->getProtectedMethod('isUnary'); - - foreach ($elements as $element) { - $this->assertTrue($method->invoke($t, $element), 'Unary test failed on: ' . $element); - } - - $nonblocks = array('span', 'a', 'div'); - foreach ($nonblocks as $tag) { - $this->assertFalse($method->invoke($t, $tag), 'Unary test failed on: ' . $tag); - } - } - }
\ No newline at end of file |