2006-08-04 03:13:04 +00:00
|
|
|
<?php
|
|
|
|
|
2007-11-25 02:24:39 +00:00
|
|
|
Mock::generatePartial(
|
|
|
|
'HTMLPurifier_AttrDef',
|
|
|
|
'HTMLPurifier_AttrDefTestable',
|
|
|
|
array('validate'));
|
|
|
|
|
2007-08-01 14:06:59 +00:00
|
|
|
class HTMLPurifier_AttrDefTest extends HTMLPurifier_Harness
|
2006-08-04 03:13:04 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
function test_parseCDATA() {
|
|
|
|
|
2007-11-25 02:24:39 +00:00
|
|
|
$def = new HTMLPurifier_AttrDefTestable();
|
2006-08-04 03:13:04 +00:00
|
|
|
|
2007-05-05 20:17:04 +00:00
|
|
|
$this->assertIdentical('', $def->parseCDATA(''));
|
|
|
|
$this->assertIdentical('', $def->parseCDATA("\t\n\r \t\t"));
|
|
|
|
$this->assertIdentical('foo', $def->parseCDATA("\t\n\r foo\t\t"));
|
|
|
|
$this->assertIdentical('ignorelinefeeds', $def->parseCDATA("ignore\nline\nfeeds"));
|
|
|
|
$this->assertIdentical('translate to space', $def->parseCDATA("translate\rto\tspace"));
|
2006-08-04 03:13:04 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2007-05-23 00:39:07 +00:00
|
|
|
function test_make() {
|
|
|
|
|
2007-11-25 02:24:39 +00:00
|
|
|
$def = new HTMLPurifier_AttrDefTestable();
|
2007-05-23 00:39:07 +00:00
|
|
|
$def2 = $def->make('');
|
|
|
|
$this->assertIdentical($def, $def2);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2006-08-04 03:13:04 +00:00
|
|
|
}
|
|
|
|
|