diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-12-08 09:07:38 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-12-08 09:07:38 +0100 |
commit | 6d3eb7673d1671a9e1f8437388f344a90e3d71dd (patch) | |
tree | fdf438cbf491bd4d70c1f13b1c02e2adc8ae5a5d /tests | |
parent | 4b293dffe56ac452ed3bdadb3dd094e667ecfb2d (diff) | |
download | nextcloud-server-6d3eb7673d1671a9e1f8437388f344a90e3d71dd.tar.gz nextcloud-server-6d3eb7673d1671a9e1f8437388f344a90e3d71dd.zip |
Add unit test for nested arrays
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/util.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/lib/util.php b/tests/lib/util.php index 9b82be36955..fa559c17c80 100644 --- a/tests/lib/util.php +++ b/tests/lib/util.php @@ -95,16 +95,22 @@ class Test_Util extends \Test\TestCase { } function testSanitizeHTML() { - $badArray = array( + $badArray = [ 'While it is unusual to pass an array', 'this function actually <blink>supports</blink> it.', - 'And therefore there needs to be a <script>alert("Unit"+\'test\')</script> for it!' - ); - $goodArray = array( + 'And therefore there needs to be a <script>alert("Unit"+\'test\')</script> for it!', + [ + 'And It Even May <strong>Nest</strong>', + ], + ]; + $goodArray = [ 'While it is unusual to pass an array', 'this function actually <blink>supports</blink> it.', - 'And therefore there needs to be a <script>alert("Unit"+'test')</script> for it!' - ); + 'And therefore there needs to be a <script>alert("Unit"+'test')</script> for it!', + [ + 'And It Even May <strong>Nest</strong>' + ], + ]; $result = OC_Util::sanitizeHTML($badArray); $this->assertEquals($goodArray, $result); |