From 7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 12 May 2012 17:57:41 -0700 Subject: some important stuff we'll need --- .../tests/HTMLPurifier/HTMLModule/FormsTest.php | 155 +++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 lib/htmlpurifier/tests/HTMLPurifier/HTMLModule/FormsTest.php (limited to 'lib/htmlpurifier/tests/HTMLPurifier/HTMLModule/FormsTest.php') diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLModule/FormsTest.php b/lib/htmlpurifier/tests/HTMLPurifier/HTMLModule/FormsTest.php new file mode 100644 index 000000000..5bc4c99c3 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLModule/FormsTest.php @@ -0,0 +1,155 @@ +config->set('HTML.Trusted', true); + $this->config->set('Attr.EnableID', true); + } + + function testBasicUse() { + $this->config->set('HTML.Doctype', 'HTML 4.01 Strict'); + $this->assertResult( // need support for label for later + ' +
+

+ +
+ +
+ +
+ Male
+ Female
+ +

+
' + ); + } + + function testSelectOption() { + $this->config->set('HTML.Doctype', 'HTML 4.01 Strict'); + $this->assertResult(' +
+

+ + +

+
+ '); + } + + function testSelectOptgroup() { + $this->config->set('HTML.Doctype', 'HTML 4.01 Strict'); + $this->assertResult(' +
+

+ +

+
+ '); + } + + function testTextarea() { + $this->config->set('HTML.Doctype', 'HTML 4.01 Strict'); + $this->assertResult(' +
+

+ + +

+
+ '); + } + + // label tests omitted + + function testFieldset() { + $this->config->set('HTML.Doctype', 'HTML 4.01 Strict'); + $this->assertResult(' +
+
+ Personal Information + Last Name: + First Name: + Address: + ...more personal information... +
+
+ Medical History + Smallpox + Mumps + Dizziness + Sneezing + ...more medical history... +
+
+ Current Medication + Are you currently taking any medication? + Yes + No + + If you are currently taking medication, please indicate + it in the space below: + +
+
+ '); + } + + function testInputTransform() { + $this->config->set('HTML.Doctype', 'XHTML 1.0 Strict'); + $this->assertResult('', ''); + } + + function testTextareaTransform() { + $this->config->set('HTML.Doctype', 'HTML 4.01 Strict'); + $this->assertResult('', ''); + } + + function testTextInFieldset() { + $this->config->set('HTML.Doctype', 'HTML 4.01 Strict'); + $this->assertResult('
foo
'); + } + + function testStrict() { + $this->config->set('HTML.Doctype', 'HTML 4.01 Strict'); + $this->assertResult('
', ''); + } + + function testLegacy() { + $this->assertResult('
'); + $this->assertResult('
'); + } + +} + +// vim: et sw=4 sts=4 -- cgit v1.2.3