summaryrefslogtreecommitdiff
path: root/tests/Framework/Html.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-08-27 12:55:58 +0200
committerAleksander Machniak <alec@alec.pl>2012-08-27 12:55:58 +0200
commit5f8097b9eba09302be561d67ce035275494043e3 (patch)
treea626f76ceefcab171311767aba8ca5db5525b782 /tests/Framework/Html.php
parentbe71abeff913611086e4f36f6888bf57666042c5 (diff)
Added tests for specialchars quoting
Diffstat (limited to 'tests/Framework/Html.php')
-rw-r--r--tests/Framework/Html.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/Framework/Html.php b/tests/Framework/Html.php
index 107f82805..8a27baca8 100644
--- a/tests/Framework/Html.php
+++ b/tests/Framework/Html.php
@@ -17,4 +17,30 @@ class Framework_Html extends PHPUnit_Framework_TestCase
$this->assertInstanceOf('html', $object, "Class constructor");
}
+
+ /**
+ * Data for test_quote()
+ */
+ function data_quote()
+ {
+ return array(
+ array('abc', 'abc'),
+ array('?', '?'),
+ array('"', '&quot;'),
+ array('<', '&lt;'),
+ array('>', '&gt;'),
+ array('&', '&amp;'),
+ array('&amp;', '&amp;amp;'),
+ array('&amp;', '&amp;', true),
+ );
+ }
+
+ /**
+ * Test for quote()
+ * @dataProvider data_quote
+ */
+ function test_quote($str, $result, $validate = false)
+ {
+ $this->assertEquals(html::quote($str, $validate), $result);
+ }
}