summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/HTML5/SerializerTest.php24
-rw-r--r--test/HTML5/TestCase.php12
2 files changed, 36 insertions, 0 deletions
diff --git a/test/HTML5/SerializerTest.php b/test/HTML5/SerializerTest.php
new file mode 100644
index 0000000..5eb44eb
--- /dev/null
+++ b/test/HTML5/SerializerTest.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace HTML5\Tests;
+
+use \HTML5\Serializer;
+
+require_once 'TestCase.php';
+
+class SerializerTest extends TestCase {
+ public function testBasicDocument() {
+ $html = '<!DOCTYPE html><html><body>test</body></html>';
+
+ $dom = \HTML5::parse($html);
+
+ $this->assertTrue($dom instanceof \DOMDocument, "Canary");
+
+ $ser = new \HTML5\Serializer($dom);
+
+ $out = $ser->saveHTML();
+
+ $this->assertTrue(count($out) >= count($html));
+
+ }
+}
diff --git a/test/HTML5/TestCase.php b/test/HTML5/TestCase.php
new file mode 100644
index 0000000..b5c18e0
--- /dev/null
+++ b/test/HTML5/TestCase.php
@@ -0,0 +1,12 @@
+<?php
+namespace HTML5\Tests;
+
+require_once 'PHPUnit/Autoload.php';
+require_once __DIR__ . '/../../vendor/autoload.php';
+
+class TestCase extends \PHPUnit_Framework_TestCase {
+
+ public function testFoo() {
+ // Placeholder. Why is PHPUnit emitting warnings about no tests?
+ }
+}