summaryrefslogtreecommitdiff
path: root/tests/Framework
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-02-14 18:25:02 +0100
committerAleksander Machniak <alec@alec.pl>2014-02-14 18:25:02 +0100
commitabecca8f4bc0898f952a3362bd42b4c78ac783c3 (patch)
treecf1f70fee183c64f2da2f0d7b09afd055b41c0ab /tests/Framework
parentc6227fe7b08e2371f07250261a464cb86fdbc9d4 (diff)
parent80102a2dde8d2870ee7d8c4ad8e8626a555ecc2f (diff)
Merge branch 'master' of github.com:roundcube/roundcubemail
Diffstat (limited to 'tests/Framework')
-rw-r--r--tests/Framework/Html.php57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/Framework/Html.php b/tests/Framework/Html.php
index 60284deef..d9466e601 100644
--- a/tests/Framework/Html.php
+++ b/tests/Framework/Html.php
@@ -19,6 +19,63 @@ class Framework_Html extends PHPUnit_Framework_TestCase
}
/**
+ * Data for test_attrib_string()
+ */
+ function data_attrib_string()
+ {
+ return array(
+ array(
+ array(), null, '',
+ ),
+ array(
+ array('test' => 'test'), null, ' test="test"',
+ ),
+ array(
+ array('test' => 'test'), array('test'), ' test="test"',
+ ),
+ array(
+ array('test' => 'test'), array('other'), '',
+ ),
+ array(
+ array('checked' => true), null, ' checked="checked"',
+ ),
+ array(
+ array('checked' => ''), null, '',
+ ),
+ array(
+ array('onclick' => ''), null, '',
+ ),
+ array(
+ array('size' => 5), null, ' size="5"',
+ ),
+ array(
+ array('size' => 'test'), null, '',
+ ),
+ array(
+ array('data-test' => 'test'), null, ' data-test="test"',
+ ),
+ array(
+ array('data-test' => 'test'), array('other'), '',
+ ),
+ array(
+ array('data-test' => 'test'), array('data-test'), ' data-test="test"',
+ ),
+ array(
+ array('data-test' => 'test'), array('data-*'), ' data-test="test"',
+ ),
+ );
+ }
+
+ /**
+ * Test for attrib_string()
+ * @dataProvider data_attrib_string
+ */
+ function test_attrib_string($arg1, $arg2, $result)
+ {
+ $this->assertEquals(html::attrib_string($arg1, $arg2), $result);
+ }
+
+ /**
* Data for test_quote()
*/
function data_quote()