From 2965a981b7ec22866fbdf2d567d87e2d068d3617 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Fri, 31 Jul 2015 16:04:08 -0400
Subject: [PATCH] Allow to search and import missing PGP pubkeys from keyservers using Publickey.js
---
tests/Framework/Html.php | 73 ++++++++++++++++++++++++++++++++++++
1 files changed, 73 insertions(+), 0 deletions(-)
diff --git a/tests/Framework/Html.php b/tests/Framework/Html.php
index 107f828..259d73e 100644
--- a/tests/Framework/Html.php
+++ b/tests/Framework/Html.php
@@ -17,4 +17,77 @@
$this->assertInstanceOf('html', $object, "Class constructor");
}
+
+ /**
+ * 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"',
+ ),
+ );
+ }
+
+ /**
+ * 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()
+ {
+ return array(
+ array('abc', 'abc'),
+ array('?', '?'),
+ array('"', '"'),
+ array('<', '<'),
+ array('>', '>'),
+ array('&', '&'),
+ array('&', '&amp;'),
+ );
+ }
+
+ /**
+ * Test for quote()
+ * @dataProvider data_quote
+ */
+ function test_quote($str, $result)
+ {
+ $this->assertEquals(html::quote($str), $result);
+ }
}
--
Gitblit v1.9.1