You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<?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('"', '"'),
|
|
|
|
array('<', '<'),
|
|
|
|
array('>', '>'),
|
|
|
|
array('&', '&'),
|
|
|
|
array('&', '&amp;'),
|
|
|
|
array('&', '&', true),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test for quote()
|
|
|
|
* @dataProvider data_quote
|
|
|
|
*/
|
|
|
|
function test_quote($str, $result, $validate = false)
|
|
|
|
{
|
|
|
|
$this->assertEquals(html::quote($str, $validate), $result);
|
|
|
|
}
|
|
|
|
}
|