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
|
|
|
{
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function test_parseCDATA()
|
|
|
|
{
|
2007-11-25 02:24:39 +00:00
|
|
|
$def = new HTMLPurifier_AttrDefTestable();
|
2008-12-06 07:28:20 +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"));
|
2008-05-25 05:40:20 +00:00
|
|
|
$this->assertIdentical('translate to space', $def->parseCDATA("translate\nto\tspace"));
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-04 03:13:04 +00:00
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public 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);
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-05-23 00:39:07 +00:00
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-04 03:13:04 +00:00
|
|
|
}
|
|
|
|
|
2008-12-06 09:24:59 +00:00
|
|
|
// vim: et sw=4 sts=4
|