summaryrefslogtreecommitdiff
path: root/test/HTML5/TestDataTest.php
blob: de97040a137f9694b953799da1856557c8079c09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
);
    }
}