summaryrefslogtreecommitdiff
path: root/tests/Framework/Html.php
blob: 60284deef5f2cf6f90d00085aae9ace99f3d3dee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php

/**
 * Test class to test rcube_html class
 *
 * @package Tests
 */
class Framework_Html extends PHPUnit_Framework_TestCase
{

    /**
     * Class constructor
     */
    function test_class()
    {
        $object = new html;

        $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;'),
        );
    }

    /**
     * Test for quote()
     * @dataProvider data_quote
     */
    function test_quote($str, $result)
    {
        $this->assertEquals(html::quote($str), $result);
    }
}