Aleksander Machniak
2014-10-18 ced34cb15e095836767971aa4d27b141fb1d7ec9
tests/Framework/Html.php
@@ -19,6 +19,54 @@
    }
    /**
     * 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()
@@ -31,7 +79,6 @@
            array('>', '>'),
            array('&', '&'),
            array('&', '&'),
            array('&', '&', true),
        );
    }
@@ -39,8 +86,8 @@
     * Test for quote()
     * @dataProvider data_quote
     */
    function test_quote($str, $result, $validate = false)
    function test_quote($str, $result)
    {
        $this->assertEquals(html::quote($str, $validate), $result);
        $this->assertEquals(html::quote($str), $result);
    }
}