diff options
Diffstat (limited to 'test/HTML5/TestDataTest.php')
-rw-r--r-- | test/HTML5/TestDataTest.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/HTML5/TestDataTest.php b/test/HTML5/TestDataTest.php new file mode 100644 index 0000000..de97040 --- /dev/null +++ b/test/HTML5/TestDataTest.php @@ -0,0 +1,31 @@ +<?php + +require_once dirname(__FILE__) . '/../autorun.php'; + +class HTML5_TestDataTest extends UnitTestCase +{ + function testSample() { + $data = new HTML5_TestData(dirname(__FILE__) . '/TestDataTest/sample.dat'); + $this->assertIdentical($data->tests, array( + array('data' => "Foo", 'des' => "Bar"), + array('data' => "Foo") + )); + } + function testStrDom() { + $dom = new DOMDocument(); + $dom->loadHTML('<!DOCTYPE html PUBLIC "http://foo" "http://bar"><html><body foo="bar" baz="1">foo<b>bar</b>asdf</body></html>'); + $this->assertIdentical(HTML5_TestData::strDom($dom), <<<RESULT +| <!DOCTYPE html "http://foo" "http://bar"> +| <html> +| <body> +| baz="1" +| foo="bar" +| "foo" +| <b> +| "bar" +| "asdf" +RESULT +); + } +} + |