diff options
author | Matt Farina <[email protected]> | 2014-05-15 10:23:49 -0400 |
---|---|---|
committer | Matt Farina <[email protected]> | 2014-05-15 10:23:49 -0400 |
commit | 692140c902df735c6de2aa0863a4334f585f5f95 (patch) | |
tree | 7b21e902caa5da544f6f386ae1bad7f5d0264c01 /test/HTML5/Parser/DOMTreeBuilderTest.php | |
parent | 08711d17ad0dc08626347da9f48b477e2c717925 (diff) | |
parent | 30aa8a64547d2f1770489133b96269e9d5907a9a (diff) |
Merge pull request #34 from goetas/prs-tests
Fixes the testing errors and makes the tests PSR compatible
Diffstat (limited to 'test/HTML5/Parser/DOMTreeBuilderTest.php')
-rw-r--r-- | test/HTML5/Parser/DOMTreeBuilderTest.php | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/test/HTML5/Parser/DOMTreeBuilderTest.php b/test/HTML5/Parser/DOMTreeBuilderTest.php index 6eeafe8..dde8393 100644 --- a/test/HTML5/Parser/DOMTreeBuilderTest.php +++ b/test/HTML5/Parser/DOMTreeBuilderTest.php @@ -3,11 +3,13 @@ * @file * Test the Tree Builder. */ -namespace HTML5\Parser; +namespace HTML5\Tests\Parser; use HTML5\Elements; - -require_once __DIR__ . '/../TestCase.php'; +use HTML5\Parser\StringInputStream; +use HTML5\Parser\Scanner; +use HTML5\Parser\Tokenizer; +use HTML5\Parser\DOMTreeBuilder; /** * These tests are functional, not necessarily unit tests. @@ -108,7 +110,7 @@ class DOMTreeBuilderTest extends \HTML5\Tests\TestCase { <svg width='150' viewbox='2'> <rect textlength='2'/> <animatecolor>foo</animatecolor> - </svg> + </svg> </body></html>"; $doc = $this->parse($html); $root = $doc->documentElement; @@ -208,7 +210,7 @@ class DOMTreeBuilderTest extends \HTML5\Tests\TestCase { $html = "<!DOCTYPE html><html><math><![CDATA[test"; $doc = $this->parse($html); - // We're JUST testing that we can access errors. Actual testing of + // We're JUST testing that we can access errors. Actual testing of // error messages happen in the Tokenizer's tests. $this->assertGreaterThan(0, count($doc->errors)); $this->assertTrue(is_string($doc->errors[0])); @@ -345,23 +347,3 @@ class DOMTreeBuilderTest extends \HTML5\Tests\TestCase { $this->assertEquals('foo', $div->textContent); } } - -class InstructionProcessorMock implements \HTML5\InstructionProcessor { - - public $name = NULL; - public $data = NULL; - public $count = 0; - - public function process(\DOMElement $element, $name, $data) { - $this->name = $name; - $this->data = $data; - $this->count++; - - $div = $element->ownerDocument->createElement("div"); - $div->nodeValue = 'foo'; - - $element->appendChild($div); - - return $div; - } -} |